darth-cheney: hello all, is there some built-in function or set of functions I can use to compute CPU usage as a percentage every N number of seconds or something like that? daviid: sneek: later tell dthompson same here, since switched to guile 3, and the latest geiser, not sure which causes the problem- if you find a solution, let meknow ... sneek: Got it. tohoyn: darth-cheney: what about statprof? stis: Tja guilers! manumanumanu: Tja stis stis: whats up manumanumanu: *: stis is wotking with binary serializers and deserializers stis: https://gitlab.com/tampe/stis-data/ rlb: mfiano: fwiw, recommend reporting non-debian bugs "here", i.e. bug-guile@gnu.org since they'll just have to be forwarded otherwise. Sheilong: I am appending items to a list with append! however it is not making any effect to the list. Sheilong: The list is defined in the body of a let statement and the value is appended in another let nested to this one. Sheilong: I wrote a minimal example to show what is going on here https://paste.ofcode.org/wdjEUWbyVYwgBAbvfaS6pC Sheilong: append! is not mutation the list. I don't know what I am doing wrong here lloda: that isn't how append! works. The appended list is the return value lloda: https://srfi.schemers.org/srfi-1/srfi-1.html#append! lloda: the argument might get modified or not. You use append! instead of append when you don't care what happens to it, that's the only difference Sheilong: lloda: At least here it seems to modify the list if there is already elements on it. If the list is empty it does not. lloda: you can't count on that. The result is the return value, not the argument. Sheilong: My problem here is to save a result from a computation in a list in by appending it and reusing these values yielded from the computation later on. lloda: i think this is what you want lloda: https://paste.debian.net/1206851/ lloda: personally i find do unreadable chrislck: named let = ftw clone: In guile 3.0.7, I can't use this extended symbol read syntax: https://www.gnu.org/software/guile/manual/html_node/Symbol-Read-Syntax.html#Symbol-Read-Syntax clone: did that get removed? the (read-enable 'r7rs-symbols) syntax doesn't work either, it looks like it expands to the not-working #{}# syntax rlb: clone: may or may not be related, but I believe wingo changed the reader a good bit recently. rlb: Is there a way to catch an (error ...) raised during a syntax-rules expansion or similar? (Current application is writing tests for some macro expansion error handling.) leoprikler: you could try compiling your scheme to bytecode "on the fly", but I don't know how practical that is lloda: clone: works fine here (?) lloda: 3.0.7 lloda: both #{}# and the r7rs || if you enable it lloda: what error do you get? rlb: leoprikler: thanks - and yeah, I should have thought of that. i.e. if it'll work, just test via a catch around an explicit macroexpand of the relevant form. clone: lloda: #{foo bar}# gives me clone: ice-9/boot-9.scm:1685:16: In procedure raise-exception: clone: Unbound variable: #{foo bar}# jgart: Hi Guilers! jgart: do you happen to know if there is something built into guile that reads a file as a string? Something similar to this function: https://paste.sr.ht/~jgart/f03d300dc83a408ce8c494644c320889f2b7bd01 clone: jgart: i think you want get-string-all from ice-9 textual-ports jgart: clone, thanks! avp: Hello Guilers. I'm testing Guile-SMC on binary data parsing. Here are first results -- Guile-PNG: https://github.com/artyom-poptsov/guile-png lloda: clone: and if you write foo-bar, what do you get? clone: #{foo-bar}# gives: Unbound variable: foo-bar lloda: you need to quote symbols lloda: foo-bar alone without the #{ }# will give you the same lloda: if you do (define #{foo bar}# 0) that will work fine clone: oh that makes sense, i thought #{foo}# meant 'foo, thanks lloda: yw lloda: maybe the doc needs an actual example bc it's not the first time that i see someone think that ArneBab: leoprikler: you have to jump through some ugly hoops to make it unhygienic easbarbosa: hey, whats is meaning of: #$output #~() and the likes? tnx rlb: sneek: later tell tohoyn it's unlikely to be added to unstable until bullseye releases (i.e. too far in the freeze to be accepted, and we'd also want the macro fix we added recently), so once bullseye is out, we can add it to unstable, and then it'll propagate to testing. sneek: Got it. *: rlb guesses that it'll be 3.0.8 that goes into unstable, though I'd also like to resolve the inlining issues first too. vijaymarupudi: daviid: Thank you, the get-cursor method now returns a pointer. The docs mention there being two out values for this method. How would I get the other one? Additionally, am I responsible for manually managing the lifetime of the pointer? https://docs.gtk.org/gtk4/method.TreeView.get_cursor.html daviid: vijaymarupudi: (ice-9 receive), or let-values ... let me paste an example vijaymarupudi: I've been using call-with-values, maybe I'm going it wrong, one sec vijaymarupudi: Ah, I still can't see the other parameter vijaymarupudi: Actually, I stand corrected vijaymarupudi: I see both the values now vijaymarupudi: What about lifetimes? daviid: https://paste.gnome.org/piwoectpc - this is 'your example', just removed the with, and a few tiny changes .. daviid: vijaymarupudi: i still need to fix the other problem ... mfiano: rlb: Are you a maintainer? vijaymarupudi: daviid: Makes sense to me! This is excellent. Will I have to free the gtk-tree-path? vijaymarupudi: vijaymarupudi: I see, that bug looked a lot trickier... vijaymarupudi: daviid* vijaymarupudi: I like g-golf's little touches like using multiple returns, seems as idiomatic to guile as oop can be daviid: vijaymarupudi: tx, but i didn't invent anything - all languages that implement multiple-values do so in their GI bindings and 'out arguments ... vijaymarupudi: Ah I see, well, that's good then :) vijaymarupudi: daviid: Just making sure I have an answer, do I have to free the gtk-tree-path? Don't want to have any memory leaks if possible. vijaymarupudi: Using `gtk-tree-path-free` that is daviid: vijaymarupudi: no, as itis you don't need to free the path daviid: vijaymarupudi: but after i fix 'that problem' exposed by clone, probably, we'll see - in the mean time, you should extract the path indice(s) as you receive the path, as it will be gc'd ... daviid: vijaymarupudi: actually need to double check, i mixed twoinfo here daviid: *two infos ... daviid: vijaymarupudi: sorry for the confusion, but yes, you'll need to free the path returned by get-cursor daviid: *you/one need to free the path returned by get-cursor ... daviid: vijaymarupudi: while talking about 'out arguments, makesure you read this in the manual - https://www.gnu.org/software/g-golf/manual/html_node/Function.html#index-_0025gi_002dstrip_002dboolean_002dresult vijaymarupudi: daviid: I was not aware of that, thanks for the heads up vijaymarupudi: sounds good, I'll free the path vijaymarupudi: In PyGObject, they seem to make a class for the struct? I wonder if that's manual vijaymarupudi: Or automatically generated from the bindings daviid: vijaymarupudi: as things are, in g-golf, none opaque struct are serialize/deserialized, and so you receive or pass a list of values - opaque struct, you receive and 'blindingly' pass the lib pointer - opaque struct -> goops class, maybe (probably), but not a priority for now ... daviid: vijaymarupudi: wrt PyGObject, opaque struct as classes is definitely done automaticallty, not sure about how they 'treat' none opaque struct though vijaymarupudi: Ah I see! jgart: Hi, is there an async version of system or system*? jgart: I'm having trouble finding it jgart: what does the guile community think of having crowd sourced docs like janet or clojure? https://janetdocs.com/ jgart: or maybe a guile cookbook? tohoyn: sneek: botsnack sneek: tohoyn, you have 1 message! sneek: tohoyn, rlb says: it's unlikely to be added to unstable until bullseye releases (i.e. too far in the freeze to be accepted, and we'd also want the macro fix we added recently), so once bullseye is out, we can add it to unstable, and then it'll propagate to testing. sneek: :) manumanumanu: leoprikler, ArneBab : No. It only guarantees outward hygiene. I was hit by this recently: I tried to write a looping facility using syntax-case, and I programmatically expanded the (in-list ...), (in-xxxx ...). in-list introduces 2 bindings (%pair and %cursor), but since I was never leaving syntax-case during the programmatic expansion, these 2 bindings collided even thought they were not from the manumanumanu: same expansion, nor from the same place and time. This is all documented in syntax-case, and not surprising. It is what I usually mean when I say that syntax-case is not hygienic enough. If you introduce bindings, and you risk introducing the same binding twice within the scope of one call to the syntax transformer you must use gensym (yuck) to ensure hygiene. manumanumanu: srfi-72 solves this by making sure that any binding introduced will be unique unless they are the same object. manumanumanu: but that never caught on so now I have to either gensym or use continuation-passing syntax-rules macros, which is as much fun as you'd expect. manumanumanu: like this: https://git.sr.ht/~bjoli/goof-loop/tree/master/item/goof-impl.scm#L120 manumanumanu: until about line 262 is what I use to dispatch and retain expansion control from user-defined macros. manumanumanu: jgart: pipes or (@@ (ice-9 popen) open-process), maybe? ArneBab: manumanumanu: ah, yes. Thank you! leoprikler: manumanumanu: Guile has quasi-syntax tho: see #` leoprikler: And I'm pretty sure it's defined in terms of syntax-case lloda: benchmark of core vector-fill! vs the vector-fill! that was in (scheme base) lloda: https://paste.debian.net/1206757/ leoprikler: so core is significantly quicker? leoprikler: btw. this is compiled mode, right? no interpreter overhead lloda: ofc lloda: this isn't surprising, the core version is just a for() *a++ = x loop dthompson: anyone had issues evaling guile code in geiser lately? dthompson: I can eval stuff in the geiser buffer just fine dthompson: but when I do C-x C-e in a scheme buffer it throws a strange error defolos: hey folks, anyone knows how well guille supports elisp? dsmith-work: Happy Friday, Guilers!! lloda: benchmark of (scheme base) vector-copy! vs a new version using memmove https://paste.debian.net/1206772/ lloda: (scheme base) vector-copy! uses move-left/move-right, so it's C either way leoprikler: defolos: enough to run vaguely do stuff in it, but it's no drop-in replacement defolos: leoprikler: thanks, so the basic stuff should work I guess? leoprikler: depends on what you mean by "basic stuff", but yeah lloda: memmove is smart enough to do nothing when asked to copy self, but there's enough improvement for the mid sizes that I think it's worth it defolos: leoprikler: mostly get basic lists out of an elisp file leoprikler: probably yes, but maybe no leoprikler: for instance, it has no setf vijaymarupudi: Q: Is there a way to get destructor semantics from GOOPS? In other words, can I arrange for a method to run when the instance is being garbage collected lloda: vector-move-left! vector-move-right! are bad primitives, there's always one which is the correct one and the other is wrong, vector-copy! frees you from that decision vijaymarupudi: Also, speaking of vectors, I wonder if it's possible to have a vector-resize function that uses realloc to take advantage of the mremap syscall lloda: if that is linux only, an alternate impl would be needed lloda: probably worth writing to guile-devel about it defolos: leoprikler: ok, well I guess I'll just try it first defolos: and if it works then I'll stick with guile, otherwise I'll use emacs itself vijaymarupudi: Oh, libc's realloc in Linux uses mremap, one would just need a function that uses it to resize a vector. The only way to do this right now seems to be making a new vector and copying it in vijaymarupudi: it being realloc vijaymarupudi: I don't know if guile-devel can be used for feature requests lloda: seems all right to me vijaymarupudi: Will draft one up right now manumanumanu: leoprikler: yes. That I know. But the know-how to implement a (forcefully-hygienic-quasi-syntax ...) is currently not available to me manumanumanu: hmmm. I could do an eq-hash of all syntax-objects AND symbols and only allow colliding symbols if the eq-syntax-objets is also in there. manumanumanu: but, continuing my proud tradition of lacking intellectual rigour: this is the way of someone who doesn't understand how quasisyntax works under the hood. There are probably loads of problems with this. manumanumanu: Pondering this while doing laundry I already found at least one problem. RhodiumToad: do you have a simple example of the problem? manumanumanu: (let ((a #'banana) (b #'banana)) #`(let ((#,a 5) (#,b 4)) (+ a b))) makes for an invalid let. manumanumanu: this is a simple inane example manumanumanu: But it shows the problem. I had a looping construct that I tried to write in syntax-case where I programmatically expanded the loop clasues. The problem was that if I had 2 (in-list the-list) in the same loop, they introduced the same bindings using that method manumanumanu: (the loop variables were called %cursor and %pair) or something like that. I didn't want to push the use of gensym on to whoever were writing the clauses, so I had to solve it differently manumanumanu: RhodiumToad: sorry, that example is an error anyway: the (+ a b) should be (+ #,a #,b). manumanumanu: srfi-72 solves it, but it seems pretty forgotten. RhodiumToad: let: duplicate bound variable in form (let ((banana 5) (banana 4)) (+ banana banana)) RhodiumToad: like that? manumanumanu: RhodiumToad: yes. SRFI-72 guarantees "internal hygiene", whereas r6rs syntax-case happily consider two #'bananas to be the same, even though they can be introduced at completely different times, as long as they are introduced within the execution of one syntax-transformer. manumanumanu: SRFI-72 would treat those as two different bindings, and rename one of them. manumanumanu: (let ((banana 5) (banana-1 4)) (+ banana banana-1)) manumanumanu: This is only really a problem once you start expanding macros programmatically. Racket has local-expand which expands a macro in the context of the current macro, which solves the problem IIRC. manumanumanu: using gensym for your own variables isn't bad. But in my case I would have had to force others to use it, which feels icky. RhodiumToad: why? manumanumanu: because if anyone wants to write an iterator clause for goof-loop I want them to be able to do it in syntax-rules. manumanumanu: If I programatically expadn a body of something and splice the results into a syntax object, I don't want it to behave differently than if I had not programmatically expanded the macro. manumanumanu: Anyway, SRFI-72 explains this better than I can. dsmith-work: !uptime sneek: I've been running for 2 days sneek: This system has been up 2 weeks, 2 days, 4 hours, 22 minutes Sheilong: Is it possible to break a do loop? ft: Arbitrarily? There is call/ec from (ice-9 control). dsmith-work: Sheilong: `do` does not. `while` has break (and continue). dsmith-work: I think do is not used very much. Named let seems preferred. dsmith-work: (I know I like it better) Sheilong: Yes, arbitrarily. Anyway, I need to debug my code, I did some mistake in here and things are not work as it should lol. leoprikler: obviously exit :P dsmith-work: Hah rlb: mfiano: I do maintain debian's guile. mfiano: rlb: I see. I never formally reported a bug I discovered, being new to Scheme. Just wanted to get a maintainer's opinion. ArneBab: Starting next week, there will be new votes to cast on r7rs-large — this time for macro systems: https://github.com/johnwcowan/r7rs-work/blob/master/ColorDockets.md alextee[m]: I'm trying to figure out what's the easiest way for creating guile bindings for my c code without having to write interfaces manually like in the manual alextee[m]: I just discovered swig alextee[m]: There's also that nyacc ffi helper thing. What would you recommend? alextee[m]: Swig seems easier and better documented imo manumanumanu: ArneBab: I don't think people's stance on syntax-case has changed much. manumanumanu: Marc wrote this in the chez issue tracker, which I in many ways find more exciting than r7rs-large: https://github.com/cisco/ChezScheme/issues/574 manumanumanu: I don't think much of that is actually very controversial. except the immutable cons pair thing (which IMO is a great thing). manumanumanu: So... optional arguments are not always a good thing. I just spent 20 minutes looking at ,traces and what-not not understanding why my recursive function was not working properly. The error was in the simplest clause not propagating an argument :( :( manumanumanu: But now it works! I have a small program reading scribble-like syntax into SXML (with a slightly diverging at-expr). lloda: wingo: ok to push http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=81f12bf86eed96c7ecdf6c9ce40d5abe6c729457 lloda: i mean, to merge wingo: lloda: sgtm lloda: thx, done manumanumanu: lloda: well done. you have been at this for some time, iirc. lloda: yeah lloda: it will take a while yet tohoyn: can you estimate when we will have Guile 3.0.7 in debian (testing/unstable)? tohoyn: new debianized version 0.1.0v5-2 of G-Golf has been released. Support for Guile 3.0 has been improved. See http://tohoyn.fi/g-golf-debian/index.html dsmith-work: UGT Greetings, Guilers manumanumanu: I just released this for no real reason: https://git.sr.ht/~bjoli/guile-at-expr manumanumanu: It is not quite compatible with racket's version, but close enough for what I'm using it for. tohoyn: Theme-D version 4.0.1 has been released, see http://www.iki.fi/tohoyn/theme-d/ tohoyn: new versions of Theme-D-Golf and Theme-D-Gnome have also been released leoprikler: manumanumanu: how come @{1} => 1, but @{a} => "a"? Is there some deeper meaning behind that? manumanumanu: damn manumanumanu: haha manumanumanu: thanks manumanumanu: What? Which guile? leoprikler: i mean it breaks the + example if you don't special-case numbers but it's still weird not to be documented leoprikler: The Guile interpreter in my head while reading the documentation :P manumanumanu: Ah. No: there is a difference. Everything between [] or () is scheme manumanumanu: everything between {} is string unless an at-expr leoprikler: okay, my bad, my squiggly detection sucks ._. leoprikler: regarding the hash extension, can't you simply (fix-atexp (read-atexp port)) ? manumanumanu: I don't know what you mean. read-hash-extend extends the guile reader so that it calls my procedure when it finds #@ leoprikler: sure, I mean the code inside the read-hash-extend leoprikler: looks weird with the define first manumanumanu: yup. I had to add a (pk ...) there during development manumanumanu: don't look too closely at the source. it is pretty awful manumanumanu: I start with point A, where I am now, and some vague vision of point B, where I want to be, and i spaghetti myself between the two. manumanumanu: And this code I broke out from a larger project. manumanumanu: no intellectual rigour at all leoprikler: haha, point taken lloda: (scheme base) redefines a lot of core bindings, shouldn't it be using #:replace ? lloda: like srfi-43 does lloda: also i dislike srfi-43 intensely manumanumanu: that should probably replace, yes. manumanumanu: why hate srfi-43? lloda: it's weird manumanumanu: or dislike was the word you used. lloda: yeah lloda: vector-map with index lloda: vector-copy where end can be > the size of the source manumanumanu: yes. it is clunkier to use for most cases. manumanumanu: that last one seems... not great... leoprikler: how would that work? With python-style wraparound? :P lloda: no, it just makes a bigger result and fills it with a filler lloda: i mean it just fills it with a filler, sorry leoprikler: hmm, that sounds somewhat useful tho leoprikler: albeit only somewhat lloda: when there are many ways to extend the meaning of something, it's time to stop leoprikler: imagine you want to grow your vector to some larger size while retaining the existing elements lloda: give your extensions some other names leoprikler: well, you could name it vector-copy/extend lloda: you can just make the big vector yourself and vector-copy! in it leoprikler: that's ew lloda: it's not leoprikler: everything with ! is instant +1 ew lloda: that's what vectors are for /shrug lloda: and that's what the extension was doing anyway leoprikler: sure, but you have to differentiate between API and internals leoprikler: internals can be ew when no one looks at them :P lloda: fair enough lloda: i still don't think it's a good extension leoprikler: Well, it doesn't break compatibility with the existing thing and does extend it in a very defined manner. leoprikler: Think of SRFI-1 iota leoprikler: you could achieve the same thing with map and basic arithmetic, but having it built-in makes the code read much nicer lloda: for review http://git.savannah.gnu.org/gitweb/?p=guile.git;a=shortlog;h=refs/heads/wip-vector-cleanup-2 lloda: only nit is that the C versions cannot be extended compatibly :-\ lloda: but the same thing happened already with scm_vector_fill_partial_x lloda: not sure how to solve it tbh leoprikler: wdym "extended compatibly"? leoprikler: iiuc the partial copy assumes the destination to be smaller than the source, right? leoprikler: hmm, seeing how this is defined in terms of vector-move-left!, does vector_move_left_x exist in C? dsmith-work: leoprikler: libguile/vectors.c:372 lloda: leoprikler: logically it's fine and in Scheme there are no issues leoprikler: fair enough lloda: but in C, adding arguments means breaking the previous interface lloda: that's why i left the C as it is leoprikler: oh, I didn't know there existed a procedure beforehand lloda: it's funny in a way bc vector-fill! was already r7rs compliant, but the doc doesn't say it, so the r7rs libraries had their own implementation leoprikler: heh manumanumanu: lloda: is that vector fill slower than the C one? I have noticed that some string functions I have rewritten in scheme have been just as fast as the ones in C in guile. If there is no performance penalty, maybe rewriting them in scheme wouldn't be a bad idea. manumanumanu: I haven't talked to Andy about that, but I have a feeling he wouldn't disagree if there is no real performance impact. lloda: yeah I don't disagree with that. If the perf is similar Scheme is ofc better lloda: when you need to provide a C binding then it's a bit more difficult lloda: tbh I think functions such as scm_vector_fill_x are a bit superfluous since they're just a for loop in C. You can just give the pointer and the size and let C users figure it out lloda: but once they're in the public interface you have bear them lloda: I think functions that are loops in C that call Scheme functions are likely always going to be better in pure Scheme lloda: vector-fill!, vector-copy etc aren't like that, they are raw C lloda: but I didn't benchmark them ArneBab: manumanumanu: what is the stance on syntax-case? ArneBab: manumanumanu: I now provided my enter-three-witchen macros as a benchmark for expressiveness of other macro systems. manumanumanu: Lets just say some people still whine about it since r6rs :) manumanumanu: If I would say anything it is that syntax-case is not hygienic enough. Srfi-72 solves a real problem with syntax-case. If I ever understand guile's syntax-case, I will write a (extra-hygienic-quasisyntax manumanumanu: ...) manumanumanu: that will always introduce bindings hygienically unless you are unquoting the same syntax object. manumanumanu: anyway. Now to bed! daviid: vijaymarupudi: I just pushed a fix for the bug you reported, g-golf develbranch, please pull, autotool danse :), try and let me know ... leoprikler: syntax-case is pretty hygienic by default tho, no? jgart: When using the basic http server module, how do I parse a request body? jgart: Hi cwebber, will you continue to develop Spritely Goblins racket implementation in parallel to the guile implementation? rlb: mfiano: I don't think there's any enforced mapping, but if you say (use-modules (foo bar)), then unless there's a foo/bar.scm file in your GUILE_LOAD_PATH that has a (define-module (foo bar) ...) in it, guile won't know how to find it. But nothing prevents any given file from defining multiple modules, and if you've already defined the module, then guile won't go looking for it. rlb: (already defined, perhaps programmatically via the functions in boot-9.scm, etc.) rlb: (or whatever) cwebber: jgart: yes cwebber: part of the reason I'm doing both is to demonstrate compatibility across two runtimes daviid: vijaymarupudi: i found what causes the problem, will push a solution in an hour or so ... it is 'funny to note that you both 'hit the exact same g-golf few lines of code :), though both reported problems need a different fix ... vijaymarupudi: I'm glad you didn't have to hunt down two distant bugs :) vijaymarupudi: Thank you very much! daviid: vijaymarupudi: the fix triggered a(nother) gtk-tree-path related bug, and the other problem reported by clone needs more thinking, so it will take more time then initially said here earlier, probably a day or two, sorry, but will ping you both when something to test is ready ... mfiano: rlb: Ok. What is the recommended solution to automatically fetching third-party scheme libraries to your load path, perhaps some even shared between multiple local projects? mfiano: I am really liking Guile coming from CL as my first Scheme, but I often work with very large projects in CL, so just trying to get an idea of a proper workflow for managing/loading large projects and their transitive dependencies clone: daviid: thanks for working on it! clone: When I was looking for the bug I thought a little about solving it. I'm not very experienced so I don't know how good of an idea it is. clone: but I thought about making a class that has slots for a pointer and a bytevector, and making all of the pointer functions in (system foreign) generic over pointers and gc-safe-pointers. you'd really need to make the generic pointer functions were included everywhere though. vijaymarupudi: daviid: Sounds good, thanks for taking a look at it! vijaymarupudi: In the past, I've faced a problem with Guile FFI where I'd send a pointer to a closure to C, and then the closure would get GCed I think and I'd get a segfault when I called it later. I had expected that libgc would take care of it, but it did not. You can't scm_gc_protect from Scheme, so there was no way around it without using a C extension. vijaymarupudi: Unless I used an internal hash-table combined with a mutex, but that seemed like it was duplicating scm_gc_protect tohoyn: I'm making a call tree of a large program with statprof. Now I have procedure A calling procedure B once but I have two nodes for this call in the call tree. Why is this so? mfiano: Does anyone use geiser here? I'm running into an issue that completely prevents me from learning Guile :( mfiano: With geiser's guile repl and one of my guile module source buffers open, attempting to evaluate anything in my source buffer with C-c C-c, or using company to complete any symbols results in Emacs hanging forever until I cancel the hung operation with C-g mfiano: Googling a bit seems to indicate this is an issue with the repl package changing or something, and a proper regexp needs to be added to guile-geiser--prompt-regexp. I tried a few things and I just can't get any work done mfiano: s/package/module/ tohoyn: mfiano: I have set guile readline not active when using guile from emacs mfiano: How do I do that? Sorry I'm just trying to get set up to learn Scheme leoprikler: vijaymarupudi: there are guardians, which work sort of like gc_protect tohoyn: mfiano: do you activate guile readline somewhere? mfiano: in my .guile tohoyn: mfiano: then pass option -q to the guile command in emacs tohoyn: mfiano: it suppresses loading the init file mfiano: What if I want to evaluate the rest of that file? leoprikler: well, you could jump into that buffer and evaluate it on your own tohoyn: mfiano: use the -l option in guile tohoyn: mfiano: and write a separate guile init file for emacs leoprikler: mfiano: regarding the 1:1 file mapping, no, they aren't necessarily bound to files (see the (guile) module for example), but when they are not, you need to do some special things to ensure those non-file modules exist before you want to access them leoprikler: that's how Guile-GI works internally mfiano: Not seeing how to supply arguments to the guile binary. it is erroring when applying them to the geiser-guile-binary string. but i suppose i could just set geiser-guile-init-file mfiano: That seemed to do the trick! and wow, completion and everything is much snappier now too mfiano: Thanks all wingo: moin tohoyn: I use the following code in statprof to track callers to a Scheme procedure: https://paste.debian.net/1206513/ tohoyn: could someone check it? tohoyn: The purpose of the code is to measure the time used in procedure check-if-subtype? for each caller tohoyn: I.e. I want to know where the most time consuming calls are made tohoyn: are there any statprof gurus here? tohoyn: it looks like same procedure call may have different procedure addresses manumanumanu: tohoyn: I do not understand what is going on there, but are you relying on procedure equality? tohoyn: no, I'm just profiling the procedure calls lloda: wingo: i really want to remove the array handling in vector-copy / vector->list / vector-move-left! / vector-move-right!. It is undocumented and vector-fill! / vector-ref / vector-set! / vector? are already type strict, so i'm 99% sure no one will miss the old behavior lloda: plus the move functions are bugged, they accept nonzero lower bounds and just ignore them wingo: humm! wingo: lloda: do any other vector- functions operate on arrays? lloda: those I listed are the only ones manumanumanu: lloda: what exactly is going on with the vector patches. Just cleanup? I am curious :) lloda: i want to layer the array impl on top of the various vectors so that it can be replaced eventually lloda: arrays depend on the various vector types but the vector types shouldn't depend on arrays lloda: that is already true for all of the vector types, the srfi-4 types, strings, the bitvectors lloda: actually lloda: I could do something like this http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=libguile/bitvectors.c;h=3a279e40111253380a59b22920aee48263e00de5;hb=HEAD#l456 lloda: that looks like the way to go vijaymarupudi: leoprikler: thanks for the suggestion on guardians, I was not aware of them. They wouldn't have solved the issue I described because I needed precise control on when to free certain closures that I retrieved from C, however I can think of many other uses for guardians. dsmith-work: UGT Greetings, Guilers manumanumanu: good day! civodul: o/ vijaymarupudi: \o pizzapal: hi, is it expected that using hash-clear! on a srfi-69 hash table would produce a "wrong type argument" error? manumanumanu: yes manumanumanu: srfi-69 hash tables are not the same as the built-in ones pizzapal: ah, i see manumanumanu: you will have to roll your own using hash-table-delete! from srfi-69 pizzapal: do you know an efficient way to clear out a srfi-69 hash table? pizzapal: so just iterate over it? manumanumanu: (hash-table-walk hash-table (lambda (k v) (hash-table-delete! hash-table k)) manumanumanu: but a named let over (hash-table-keys hash-table) will probably avoud the procedure call overhead and will be ever so slightly faster pizzapal: oh really? manumanumanu: the difference isn't huge manumanumanu: and you won't notice it unless you have several thousand keys pizzapal: it is usually only a few dozen keys, but i have to wipe it very frequently pizzapal: so that seems to be my bottleneck manumanumanu: did you benchmark the different hash-tables? I believe srfi-69 is built upon guiles built-in hashtables pizzapal: yeah, i am using statprof to do a comparison at the moment pizzapal: i was just using set! with make-hash-table to clear it out and that was not fast haha manumanumanu: set! is almost always a code smell. mfiano: Can someone tell a newbie why I don't have access to the program-arities procedure in (system vm program) ? manumanumanu: guile implicitly boxes everything touched by set!, which will make it slower manumanumanu: chez does the same manumanumanu: mfiano: it seems to not exist anymore... mfiano: Hmm, it's in the documentation manumanumanu: I know. I'm trying to figure it out now manumanumanu: oh, even more weird manumanumanu: try (program-arity + 0) and it will complain there is no program-arities mfiano: sounds like a bug mfiano: can confirm manumanumanu: It seems like program-argument-alist might be what you want mfiano: manumanumanu: I'm following along Software Design for Flexibility, Sussman's new book, and I need MIT Scheme's procedure-arity-min and procedure-arity-max mfiano: and procedure-arity it seems manumanumanu: mfiano: you can implement that from program-arities-alist without much fuzz unless you want to define a nice heuristics for keyword args mfiano: Fair enough, thanks. Hopefully Andy and the team can update the docs for other confused newbies :) rlb: mfiano: not sure what's "common" wrt external dependencies. Most of my uses of guile for a while have been fairly self-contained, i.e. as an extension, or as the foundation underneath lokke, or for things that can mostly get-by with what's built-in, and/or in debian. That said, I think there are probably a number of options. rlb: mfiano: ...and if you're needs are simple enough, just arranging for the deps you need to be in the load-path might suffice, whether via explicit (build-system) clones, or submodules, or... rlb: s/you're/your/ dsmith-work: mfiano: You were asking the other day about module <-> file relationships? dsmith-work: mfiano: Generally, as rlb said, though it is possible to use load or include withing a module file. dsmith-work: But that's not usual. mfiano: I see. Thanks everyone mfiano: I'm a long time Common Lisper and trying to unlearn lots dsmith-work: mfiano: Cool. I'll be having some questions or you. ;^} mfiano: sure jgart: Hi, does guile have something like (void): https://docs.racket-lang.org/reference/void.html dsmith: jgart: Is that what (if #f #f) would return? dsmith: jgart: That's the # value. chrislck: #unspecified and #nil: here be dragons chrislck: "abandon hope all ye who enter here" jgart: dsmith, jgart: #;5> (eq? (if #f #f) (void)) jgart: #t jgart: it looks like it is jgart: I tested that it chicken but gambit has the void function also jgart: Should the fact that you can add a docstring to the following style of function definition be documented? jgart: (define hello (lambda (x) "docstring" (+ x x))) jgart: it breaks if I add the docstring immediately after the define keyword jgart: the metacommand ,d also works in the repl for it jgart: scheme@(guile-user)> ,d hello jgart: docstring jgart: In other words, should guilers know they can add docstrings to that style of define in the docs? jgart: If so, I don't mind adding it dsmith: jgart: It's hard to find but it's there: https://www.gnu.org/software/guile/manual/guile.html#index-procedure_002ddocumentation dsmith: "By convention, if a procedure contains more than one expression and the first expression is a string constant, that string is assumed to contain documentation for that procedure." jgart: It seems like some keywords explicitly document the docstring and some don't jgart: so it feels a bit inconsistent in the docs jgart: for example: Syntax: define-syntax-rule (keyword . pattern) [docstring] template jgart: from this page: https://www.gnu.org/software/guile/manual/html_node/Syntax-Rules.html jgart: It's explicit about define-syntax-rule supporting a [docstring] dsmith: Ya, the manual is inconsistent. The docs for case-lambda show a docstring in the examples, but not in the text. jgart: Ok, I'll keep that in mind jgart: maybe I'll send a patch at some point with some fixes for that jgart: It seems like there is also a lot of functions that could benefit from a docstring jgart: so that we can have the convenience of accessing them from the ,d metacommand jgart: instead of just returning #f because they don't have any docstring jgart: for example see the difference here between janet and guile doc for first: jgart: https://paste.sr.ht/~guixtogether/c83d532a255c4d31465f7ca632648ddc00c3e325 jgart: that's maybe a trivial example as people can guess what first does but it is still nice to get something back in the repl without having to search through docs. This is especially useful for beginners of guile and/or scheme. jgart: that's maybe a trivial example as people can guess what first does but it is still nice to get something back in the repl without having to search through docs. This is especially useful for beginners of guile and/or scheme. Given that the metacommand ,d exists I think we should use it fully for getting all documentation. Would it be ok if I add docstrings for functions that are missing them? jgart: I can send patches for that for review daviid: lloda: maybe you can help - i'd like to define a null terminated array (vector) of 'what-ever, say unsinged-long to start with ... from scheme, for the g-golf test-suite, how do i do that? mfiano: Hi mfiano: Perhaps a dumb question, but why do Linux distributions, even those that live on the bleeding edge, only have Guile 2.x in their repositories? daviid: lloda: i answered my own quiz, tx jgart: mfiano, not enough interest to rush to package it leoprikler: jgart I would welcome it if we could generate such documentation uniformly with texinfo leoprikler: our current texinfo game is somewhat weak jgart: leoprikler, Wouldn't it just be a matter of adding a docstring just like other functions that currently have a docstring? leoprikler: Not quite. jgart: Or, do you mean that the texinfo curently does not parse the docstrings in the code? leoprikler: If you e.g. have texinfo in a docstring, that docstring will yield texinfo code and not attempt to render it jgart: I mean the doc system leoprikler: not very human-friendly leoprikler: if you have texinfo in a doc comment (the kind of comment that can be snarfed via doc-snarf) it won't show up as docstring jgart: leoprikler, is there any documentation on doc-snarf? jgart: scripts/doc-snarf.scm? leoprikler: "guild help" jgart: cool! hadn't used guild yet jgart: https://paste.sr.ht/~guixtogether/2edf3e00248c4df2f2224dfe172625851724d19a civodul: jgart: hey, where does "graph-easy" come from? looks cute! leoprikler: apparently cpan? civodul: ah, we need a package then :-) lloda: texinfo now does svg math in html output. It's pretty great, I wanted the feature for years jgart: civodul, yes it's a perl package jgart: lorem is cute too jgart: I'll try to work on those two soon if nobody else gets to it first ;) jgart: https://metacpan.org/dist/Text-Lorem/view/bin/lorem mfiano: is there anything like asdf for guile? leoprikler: (guix build-system guile) :P leoprikler: There is hall, which generates guix and automake packages, but imo it's more fun to just write plain automake if your project is complex enough mfiano: hall hasn't worked in months mfiano: syntax error attempting to invoke it leoprikler: Okay, there was hall :P mfiano: things look barren coming from CL :) leoprikler: Well, you'll eventually come to see that things are not barren but chaotic. leoprikler: CL is a language with many implementations (as is C/C++), but a common structure across them, which makes everything seem samey and neat. leoprikler: Scheme OTOH is a wild land where every implementation does as it pleases. mfiano: I decided on Guile as it seems batteries-included enough, and has GOOPS etc mfiano: Just read the entire language reference in one sitting. It was rough leoprikler: yup, GOOPS is inspired by CLOS, but I don't think it has all the features mfiano: I'm still unsure on best project management practices. how to define packages and manage file load order, etc mfiano: I guess i dont know how to start other than just writing code in a scratch file :p leoprikler: I think there are some books out there with practical project examples, not that I give a damn about those usually. mfiano: oh? leoprikler: [in general Scheme, not particularly guile] leoprikler: also note that R6RS onwards has a library system, though Guilers prefer define-module mfiano: whatever gets me up and running would be appreciated mfiano: now that i read how to use the language leoprikler: Reading a language reference once is not enough to understand it :P leoprikler: It's rather a place to grep in when you're asking yourself "how do I X" or "what does car do tho?" mfiano: the language reference doesn't really talk much about dependency management, file load order, downloading libraries, discovering libraries, publishing libraries, and all the other things that make a programming language useful for collaborative coding. leoprikler: discovering and publishing libraries is stuff for package managers mfiano: like, not sure where to begin to create a "project" that knows how to load itself such that macros are defined before use, etc leoprikler: you can do that with Guix for example leoprikler: for dependency management, guile has autoconf macros that you can use to check whether a given module is defined leoprikler: E.g.: https://gitlab.com/leoprikler/tsukundere/-/blob/0.3.x/configure.ac#L42 leoprikler: I don't really understand the term file load order or how it becomes a problem, but typically it's (public-module) vs. (public-module very hidden "private" stuffy) leoprikler: for the module names mfiano: Fair enough mfiano: Guess I'll have to learn autoconf/make or guix in addition to Nix :) mfiano: But bed time now. see ya dsmith-work: UGT Greetings, Guilers rlb: civodul: if we think fash (at least -- suppose there's also fector) is suitable, then I'd be more than happy to have it in guile itself (definitely like for guile to have a good built-in persistent vector/map/set), and would also be happy to help with the process of including it. rlb: No idea what they should be named ...(ice-9 persistent)... rlb: And presumably we'd still need some reasonable function prefix foo-set, foo-fold, etc. given the normal scheme convention there. lloda: i miss an extension mechanism for constant-type in (language cps). I have a reader for a new type but I don't see a way to have literals work in the REPL :-| lloda: ideas welcome rlb: mfiano: if it helps https://packages.debian.org/search?keywords=guile-3.0 and bullseye should be released as "stable" soonish. rlb: mfiano: and wrt getting started, if you were just asking about setting up something simple for now, a minimal arrangement is perhaps a directory with a subdirectory, say "module" or "mod" containing your guile module tree, i.e. mod/my/somemodule.scm, and then in somemodule.scm you'd have a (define-module (some module) ...)., and you'd run things from the top level via 'GUILE_LOAD_PATH=$(pwd)/mod guile "$@"' (or a similar wrapper rlb: script). I mean if you just wanted to understand the basic mechanism. (Could also use "guile -L mod ...".) rlb: At that point, (use-modules (my somemodule)) should work, and handle dependencies (between your modules, and any built-in guile modules), etc. rlb: bbl cwebber: hello hello! cwebber: I'm porting Spritely's Goblins library to guile today, how are you all liltechdude: Hello gyus. How I can bound built-in webserver with varibale (define my-server (server 'http)) and run in foreground with something like (server-start my-server)/stop with (server-stop my-server)? hendursaga: cwebber: sounds cool, is it public yet? no pressure, just wanted a link to check it out later drakonis: oh, nice. daviid: clone: I had to fix another problem, not a bug but something to adapt to someanotation changes in gtk 4.3.1 that 'broke' the clipboard example, and shall push that work later today, then back to solve vijaymarupudi's bug report wrt get-cursor, and yours 'simulatenously'... mean while, it would be nice if you could work on an example to reproduce, that i could run here .. doesn't need to be 'that small' ... vijaymarupudi: daviid: oh yeah I was going to report that today, glad you found it! daviid: vijaymarupudi: didn't find the solution yet, i will start to work on it latertoday ... cwebber: hi hendursaga, haven't pushed it up, but let's see if I can by the end of the day, still self conscious over its current state :) cwebber: but things are starting to work clone: daviid: https://paste.gnome.org/pxg6m827k drakonis: hoho, that looks like a fun trick clone: it should throw an invalid iter error pretty quickly, or run forever once you've fixed it. Thanks for looking drakonis: goblins in guile. drakonis: neat. daviid: clone: ok tx! - note that you may activate 'scheme' when you paste using gnome or debian, which 'renders' the code ... (don't repaste this one of course, just mentioning for future pastes ...) mfiano: rlb: Thank you mfiano: I have another question that the documentation didn't answer for me mfiano: In Scheme, is it always a 1:1 mapping between modules and files? In CL, "module"s can extend to many files, or many modules can be in a single file. daviid: vijaymarupudi: the url you pasted privately were https://paste.gnome.org/pbceokaf6 and https://paste.gnome.org/p8b2lsbwm - i prefer if you (always) use paste.gnome or paste.debian ... but now i don't need any, tx vijaymarupudi: daviid: Debian seems to think I'm pasting spam for some reason vijaymarupudi: Oh well haha vijaymarupudi: I know my code can be bad, but Debian gives me the honest truth daviid: vijaymarupudi: it happens to 'all of us', when that happens, prefer https://paste.gnome.org/ scheme mode ... daviid: in a few hours debian will 'clear' your name from paste spamers ... :) daviid: any one knows what i need to put in my .emacsso M-x run-python startspython3? daviid: 'no matter what' (i triedso far), it starts Python 2.7.18 daviid: ah, gotit, nevermind dsmith: manumanumanu: "dragon-infested" ? clone: daviid: I think I found a bug in g-golf. My GtkTreeIters were randomly becoming invalid in my g-golf program, but not in an equivalent python program. clone: i think the issue is in function.scm:1065, in the prepare-gi-args-out function. You do (bytevector->pointer (make-bytevector.. and I think the bytevector is getting garbage collected clone: I did this bandaid change to confirm and it stopped the iters in my program from becoming invalid: https://pastebin.com/raw/pB56NrzK clone: i'll try to make a simple program to reproduce but since it's related to garbage collection i'm not sure how to make sure it triggers daviid: clone: tx, will look at your patch - could you please not use pastebin.com, tx daviid: clone: invalid as in #f? or did this crashed g-golf? daviid: clone: that seens a very nice catch, have to confirm, but tx! clone: invalid as in (gtk-tree-store-iter-is-valid) returned #f. Parsing it as a struct showed random values daviid: clone: ok clone: thanks for looking at it, i'll try to remember to use a better pastebin next time daviid: clone: yes, please prefer debian, gnome, sourcehut ... paste services, no js, no tracking ... tor-friendly ... tx leoprikler: doesn't gnome have js tho? manumanumanu: i believe it works without scripts lloda: do we need a deprecation cycle to break (define a (make-shared-array (make-array 3 3 3) (lambda (j) (list 1 j)) 3)) (vector-copy a) lloda: note that (vector? a) is #f lloda: also stuff like (vector-ref a 0) etc already doesn't work roelj: Are there RPMs for Guile >=2.2 for CentOS 8? RhodiumToad: lloda: what do you want to break exactly? lloda: (vector-copy a) should be an error because a is not a vector RhodiumToad: that doesn't seem useful lloda: what doesn't seem useful? RhodiumToad: having it be an error lloda: why not? a isn't a vector. Most vector functions won't work on it. And that's for a good reason. Having vector- functions support arrays makes vector depend on array depend on vector. It was a mess and we already got rid of most of it. lloda: there is array-copy lloda: i just want to finish the job leoprikler: If it makes stuff cleaner, then having a separate array->vector is all fine, but I don't really get what's wrong on the outside either lloda: array-copy returns a vector if the result has rank 1 lloda: well if the type is #t, also lloda: it's a burden to support such things. We don't support (list-copy vec), even tho it's well defined RhodiumToad: an array with rank 1 and lower bound 0 seems to be a vector for almost all purposes lloda: arrays can have a step != 1 lloda: and refer to a piece of some other vector, that is they don't own their storage RhodiumToad: yes, so? lloda: they are just different types. The vector- ops aren't polymorphic, they apply to the vector type. If you need a polymorphic api, the array- api does that. leoprikler: yeah, and? lloda: it's not enough that something is 'functionally' equivalent to a vector. We don't support (vector-copy #f64(...)) either, for the same reason. I think i'm repeating examples. lloda: let me put it this way lloda: it is a burden to the implementation for vector-copy to support 'some' non-vector arrays. lloda: it isn't a burden to the user to use array-copy when the object they're dealing with isn't a vector. lloda: actually i think it's a burden to the user for (vector? a) to return #f and (vector-ref a i) to return an error and yet (vector-copy a) to magically work dsmith: roelj: Not built/distributed by the Guile project. Check your distro. roelj: dsmith: Thanks, I thought at least one Guiler would've run into a RHEL 8 derivative with an outdated Guile and would have a pointer to an additional repository. :) roptat: can I get something like number->string to complete with leading 0s? like 2 -> "002", 15 -> "015", 452 -> "452"? lloda: format from (ice-9 format) does that lloda: search for '0 in https://www.gnu.org/software/guile/manual/html_node/Formatted-Output.html dsmith: roelj: I suspect most run Guix these days. I'm somewhat partial to Debian myself. roelj: dsmith: Ahyes, I produced a Guix pack and untarred it on the RHEL8 machine, works beautifully ;) roelj: It's unfortunate tho that it seems Guile is getting behind in the RHEL distributions. apteryx_: having a handle to an object, how would I find the symbol its associated with? Is there some reflective procedure to do that? apteryx_: seems I must manually search the exported variables with module-map? b4283: https://en.wikipedia.org/wiki/Singularity_%28operating_system%29 b4283: 原來 MS 早就已經用 C# 寫過一個 kernel apteryx_: oh, seems there's module-reverse-lookup apteryx_: but most introspection procedures appear to operated on variables made via `make-variable', which (define myvar "some-value") isn't, for example. apteryx_: map-module is useful in that it allows a procedure passed to it to access both the symbol and the variable (as a boxed variable), but it does so only for public variables, not variables in the local scope. civodul: hi apteryx_! civodul: apteryx_: in general, you can't rely on module-private variables existing at run time civodul: they can be inlined civodul: that's why you may or may not see them when iterating on a module's set of variables apteryx_: civodul: hi! :-) OK. In my case the variables are actually public (package variables). I think I've nearly found a Guix-specific way to get to it, but it feels convoluted (and doesn't work yet): https://paste.debian.net/1206360/ apteryx_: this works, but still feels convoluted :-) https://paste.debian.net/1206363/ apteryx_: more correct version https://paste.debian.net/1206369/ leoprikler: can we do something about the name tho? fash sounds a little fashy dokma: I'm having issues posting to this channel. Can anyone see this? sneek: dokma, you have 1 message! sneek: dokma, lfam says: With Guix, install the gcc-toolchain package in order to compile things by hand wilfred: dokma: I can see your message dokma: Finally... dokma: Back to my issue. I'm trying to figure out how to shutdown a server started by run-server from the repl module. dokma: I don't see any way to do it from the source. dokma: https://github.com/skangas/guile/blob/master/module/system/repl/server.scm dokma: I've embedded the repl into my C++ app and it works as expected. But I cannot shut it down. dokma: I have tried (stop-server-and-clients!) from the repl but all it does is it closes my current repl session and I can connect right back in. In other words, run-server is still running. leoprikler: dokma: (quit)? dokma: leoprikler: it just closes my current repl session. dokma: It doesn't stop run-server. I can connect right back. dokma: I suppose that there should be a way to shutdown the repl server properly without killing the C++ host? dokma: Or am I wrong? leoprikler: I think you need to run stop-server-and-clients! on the server side somehow, but I'm not sure whether that power is handed to every connecting repl leoprikler: it also shuts down if you somehow find the port and close it, apparently leoprikler: Perhaps the comment in L38 hints at the culprit tho leoprikler: or no, the server-socket is probably never closed, because it's not in open-sockets leoprikler: well, nope, it's the first to be added to *open-sockets* dokma: leoprikler: I've implemented a C++ function that I can call from the repl. dokma: I can call stop-server-and-clients! from there. dokma: But I don't see how that would make a difference as opposed to just calling it from the repl. leoprikler: I'm not sure, but the server might think you no longer care about the evaluation if your client exits and thus stop early dokma: leoprikler: I totally didn't understand this last line dokma: I'm a scheme noob. Just for the record. leoprikler: Try to do good ol' printf debugging in stop-server-and-clients! dokma: Will try that too... leoprikler: in particular make it spit out the sockets it closes on your server leoprikler: (in some place you can retrieve the logs from) leoprikler: apparently the server socket is also closed when you throw sigint on the server side dokma: Can I throw sigint from the repl? leoprikler: you have a guile repl, you can probably get shell access through it too leoprikler: try (kill (getpid) SIGINT) dsmith: leoprikler: "fash the stampede" ? sandwich: i'm writing some procedures in c to use as callbacks. i want them to share local variables without having a userdata pointer passed. in scheme, i could just use closures. but what do I do here? i could just make wrapper procedures in scheme that use closures and pass the local variable to the c functions, is that the best way? ArneBab: Please let us NEVER EVER do something like Python3. I just lost another important local tool, because I have no time to convert it to py3 and cannot easily run it with py2, because it’s started with a custom runner. ArneBab: It’s never OK to push work onto maintainers — many useful tools have exactly zero maintainers. dokma: leoprikler: (kill (getpid) SIGINT) works! This is the only way to stop the server from the repl for now. dokma: Is this a clean shutdown though? leoprikler: dokma probably not, but you're one step closer to understanding what's going on, hopefully dokma: leoprikler: if I understand correctly accept is called with call-with-sigint so wouldn't SIGINT simply stop accept from waiting for a new connection? dokma: I'll try debugging to see if control returns to C++. leoprikler: it also kills the server socket leoprikler: but IIUC it doesn't flush existing connections dokma: leoprikler: the server socket is there just to accept new connections no? dokma: So it should be closed. dokma: If I do (kill (getpid) SIGINT) from the last active repl it seems to be a clean shutdown to me. Will do some tests. leoprikler: sure, but the server socket is the thing that doesn't get closed by you report dokma: leoprikler: it wasn't getting closed by calling (stop-server-and-clients!) or (close-port port). dokma: What does the arrow do on line 51 here: https://github.com/skangas/guile/blob/master/module/system/repl/server.scm dokma: I've never seen this in Scheme. But I've been learning Scheme for only the past week. dokma: Here's a permalink to the line itself: https://github.com/skangas/guile/blob/01e909d90a130f4987b70edae2dbd5a2b33edae7/module/system/repl/server.scm#L51 dokma: leoprikler: are you still here? dokma: ^^^ leoprikler: wadup? leoprikler: oh, this is a variant of cond that takes whatever the condition evaluates to (unless it's #f) and passes it on to a procedure ft: Yeah, the right hand side of the arrow must evaluate to a procedure and the result of the test is passed to it and the result of that application is the result of the cond. ft: The same thing exists for case. dokma: I've never seen it. Is that some recent addition or? dokma: Is that arrow some special syntactic sugar or just a symbol that gets passed to cond? ft: I'm pretty sure it's been in Guile for a while. Not sure if it's part of the standard. dokma: Thanks a bunch guys. You're really helping me out. ft: It's in r7rs, and I bet in previous versions too. dokma: But I supposed that => is nothing special syntax wise? Just a symbol the goes into cond ? dokma: *that goes* leoprikler: => is syntax-boudn leoprikler: *syntax-bound dokma: leoprikler: it's a special token? leoprikler: meaning it has a special meaning and can't be used as a symbol in that context leoprikler: similar to _ dokma: leoprikler: outside of that context? ft: It's in r5rs too, at least for cond. Can't see it in case's description in it. But I just skimmed the document. leoprikler: (define => >=) leoprikler: works fine ^^ dokma: So it's not some special token recognized everywhere. Just in cond leoprikler: not just in cond leoprikler: but in the context of cond it's a special token dokma: I see ft: Like else. :) dokma: leoprikler, ft: well if what you guys told me is true and if I understand stop-server-and-clients! correctly it will never close the server socket because it closes a socket only if there is a pair of them. Since the server-socket is the first one added, it will never be closed by this function? leoprikler: pair? is true for lists dokma: but it closes the cdr leoprikler: and the procedure is called recursively dokma: ooops no, closes the car leoprikler: so it should continue until the list is empty dokma: server-socket should actually be the first one to get closed dokma: actually last dokma: (cons s *open-sockets*) dokma: pushes new sockets to the front of the list leoprikler: yup dokma: So I can't figure out why (kill (getpid) SIGINT) shuts the server down but stop-server-and-clients! doesn't. dokma: After (stop-server-and-clients!) from the repl the server-socket is still opened and I can connect back in. dokma: *still open* leoprikler: which is why I hypothesize, that stop-server-and-clients! erroneously exits early vijaymarupudi: dokma, just curious, what are you working on? daviid: vijaymarupudi: did you see my yesterday's msg, i pushed a fix ... vijaymarupudi: daviid: I did, thank you! I responded but it looks like IRC bugged out. daviid: ok great vijaymarupudi: Here were my responses: https://paste.gnome.org/pt45edzl3 vijaymarupudi: Basically, I can't seem to figure out how to get and use TreePath daviid: you need to set-cursor ... see the gtk manual .. for cursor i mean vijaymarupudi: Shouldn't I be able to get it from the TreeView though? daviid: vijaymarupudi: GtkTreePath is an opaque struct, not an object vijaymarupudi: Ah I see, I didn't know that vijaymarupudi: How would I get the values from this function? https://docs.gtk.org/gtk4/method.TreeView.get_cursor.html vijaymarupudi: It seems to return false no matter what I do vijaymarupudi: Even after click something in the TreeView vijaymarupudi: Here's a snippet to experiment on: https://paste.gnome.org/pvn6ise5v daviid: you need to set-cursor, so that get-cursor returns, right in that descrption you pasted ... try to ask for help or example on #gtk maybe? daviid: going afk, bbl ... vijaymarupudi: This might be a misconception on my part, will get back to you vijaymarupudi: daviid: I think this might be a bug, here's a fairly equivalent Python program. If you observe stdout, you can see that it prints the TreePath and focus_column to stdout, but the g-golf version always prints false. vijaymarupudi: Make sure you click on some of the treeview entries to see the events happen vijaymarupudi: Python: https://pastebin.com/raw/bNfbnXvy vijaymarupudi: Guile: https://pastebin.com/raw/tDUrUzL4 chrislck: any looping gurus? in a hierarchical tree, i want to collect all descendants. anyone knows how to refactor to eliminate set! ??? https://pastebin.com/raw/kiS4R8iX chrislck: hmm I think there's a nested fold in here chrislck: yass: https://pastebin.com/raw/PZcJHuDW RhodiumToad: use a tree fold? stis: tja guilers! manumanumanu: tja Stis! manumanumanu: I passed you dragon-infested home region just hours ago manumanumanu: chrislck: I would use the colloquial "good" flatten (which is a tree fold) manumanumanu: I have it somewhere manumanumanu: the downside is that it works on improper lists manumanumanu: chrislck: https://paste.debian.net/1206265/ manumanumanu: which happens to be what you shold use instead of all the ugly flatten versions out there using append. manumanumanu: chrislck: and of course I didn't read longer than my own nose. You solved it yourself :) leoprikler: but, but append :( manumanumanu: go search for "flattening a list in scheme" and all solutions you find will use append. manumanumanu: sad times. daviid: sneek: later tell vijaymarupudi ok, will look into the problem and let you know ... sneek: Got it. daviid: sneek: later tell vijaymarupudi both paste you posted 'privetely' expired (but no problem, i know what/where to look at the problem,tx) - sneek: Got it. leoprikler: for the record, i think your version might not do proper tail recursion leoprikler: (foldts (const '()) (lambda (s0 s1 t) (append s1 s0)) xcons ) should only have call depth tree depth + 1, IIUC fold correctly daviid: fwiw, here is 'mine' :) - https://git.savannah.nongnu.org/cgit/grip.git/tree/grip/list.scm#n73 leoprikler: that looks the same but with match manumanumanu: daviid: well, you wrote that after I sent you mine and gave you the permission to do whatever you wanted with it, iirc :) manumanumanu: leoprikler: which for guile means faster, since no reverse at the end. manumanumanu: the largest problem with it is that it accepts improper lists without complaint manumanumanu: that is how guile's map works, iirc. And chez's as well manumanumanu: and racket's I suppose leoprikler: map* at least, from oop goops manumanumanu: not the improper list part, but the "right fold". leoprikler: idk if Guile's map is a right fold, it's probably implemented in C and I don't have the C code here atm manumanumanu: it is not manumanumanu: It is in boot-9 leoprikler: really? manumanumanu: yup. I had a look at it recently when fixing vector-map/for-each in the r6rs module leoprikler: ahh, my search string was wrong manumanumanu: And I'm pretty sure (as in: I know) that it is a right fold. manumanumanu: in C it could not be, of course, since it would stack overflow unless you start doing voodoo. leoprikler: yep, it is manumanumanu: there is a much nicer version of map in the r6rs module. The boot-9 version relies on (length ...) to check that the list is proper. daviid: manumanumanu: yes :) i quoted 'mine' because while pasting now, i didn't remember who helped me at the time, butichecked and i did thank you in the commit msg 537e8cc12fe2f3095f065084ea2b9376d548b6e6 - i pasted because you said 'all scheme versions 'out there' use append' ... but it's all yours :) manumanumanu: now it's yours! manumanumanu: everyone can have it :) daviid: manumanumanu: yeah,but i like to thank who helpsmeinmy logs ... sorry i didn't mention your name here 'now' ... manumanumanu: I would like to be the kind of guy that just lets that slip :( manumanumanu: It is a moral obligation to be the best you can be, and I lapse constantly :D :D manumanumanu: I like to read other people's "collected stuff that might be good to have". vijaymarupudi: daviid: My pastebin links seem to still be working for me, do they not work for you? https://pastebin.com/raw/bNfbnXvy https://pastebin.com/raw/tDUrUzL4 sneek: vijaymarupudi, you have 2 messages! sneek: vijaymarupudi, daviid says: ok, will look into the problem and let you know ... sneek: vijaymarupudi, daviid says: both paste you posted 'privetely' expired (but no problem, i know what/where to look at the problem,tx) - vijaymarupudi: Thanks sneek daviid: vijaymarupudi: I just pushed a fix to g-golf devel branch, thanks again for the report and the code to reproduce it rlb: civodul: lokke was using pfds, but switched to wingo's fash, and in both cases the "set" is just a hash table with entries that have a trivial value (#t iirc?). rlb: civodul: but if you decide to go that route, you might want to grab lokke's version (or I think someone else here has an adjusted version) because there are some bugs in the one on wingo's page: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/fash.scm rlb: I've thought we should probably host fash and fector somewhere more "properly", so we can combine fixes, but haven't pursued it yet myself. rlb: Also, iirc fash might not have delete yet? For now I do something *really* ugly there, but was hoping to understand fash well enough to add that if no one else beats me to it. rlb: I also think I've kept the fix commits independent in the history, so "git log -p --follow mod/lokke/fash.scm" should show the changes. civodul: hi rlb, thanks for the tip! civodul: if it lacks delete, it's kinda like vhashes then rlb: certainly civodul: in some places i use vhashes for sets, but deleting is O(N) rlb: well, except that vlists aren't thread safe? rlb: (was important for me anyway) rlb: (i.e. needed fully persistent map and set for clj) civodul: ah true, vlists aren't thread-safe *: rlb thinks/hopes fash is :) rlb: I can't recall who else it was "here" who was using fash and had fixed some things, but if you start using it too, then might not be a terrible idea to think about trying to host a shared version somewhere. Guess I could just put mine up on salsa or sourcehut or something, if I get a chance. civodul: we should consider adding it in Guile proper daviid: vijaymarupudi: sorry, was afk ... (use-modules g-golf) is 'instantaneous', but bindings are 'achieved' dynamically - make sure you read and use 'Selective Import' (in the manual ...) daviid: fwiw, just upgraded gtk-4 to 4.3.1+ds-1 (in debian experimental 'only' still) - i am on a debian testing 'host' daviid: for those interested, you may add an experimental file in /etc/apt/preferences.d with the following content https://paste.debian.net/1205998/, then aptitude update, +U and accept to upgrade the pkg wayland-protocol -> 1.21 experimental as well, this package is only used by libgtk3[4]-dev pkgs vijaymarupudi: daviid: With selective import, I'm getting a window using python in 0.1s while g-golf seems to take 1.5s. Is there a way to cache the bindings? vijaymarupudi: daviid: PS. thank you very much for the library, it's been pretty seamless daviid: vijaymarupudi: no, sorry daviid: vijaymarupudi: tx,please share your codeand experience ... i'm looking to removeas many bugs as possible 'now' ... daviid: vijaymarupudi: are you using gtk-4? 'no pressure', just curious - and what is your app/project about? vijaymarupudi: For the time to launch measurements, I just used the python gtk 4 example here: https://www.gtk.org/docs/language-bindings/python/ vijaymarupudi: daviid: and the scripting example here: https://www.gnu.org/software/g-golf/manual/html_node/Scripting.html vijaymarupudi: daviid: I'm using it to create an interface to make video data analysis faster vijaymarupudi: Using IPC with the mpv video player for the video stuff, but buttons and shortcuts in combination with gtk-text-view for controls and quick entry vijaymarupudi: Haven't done anything too complex yet, but I'm sure it'll happen soon :) daviid: vijaymarupudi: ok, tx for those info - did you clone g-golf, devel branch? there are a few gtk-4 examples in the tree ... vijaymarupudi: I did use the devel branch daviid: ok great vijaymarupudi: Ah yes, I am using gtk-4, forgot to mention that! daviid: vijaymarupudi: right, i gathered that info from you saying you're measuring time using the example ... daviid: are you usingdebian aswell? vijaymarupudi: I'm using Arch Linux vijaymarupudi: I wonder if you can replicate the timing difference too daviid: vijaymarupudi: ok (arch linux), asked because the gtk-4-demo example 'Video Player' doesn't work, on debian - Gtk team says it is a pkg 'bug', it misses a media backend ... was wondering if there is a solution 'outside asking the pgkmaintainer' ... just curious daviid: vijaymarupudi: i won't work on caching bindings before a 'longtime' - i havefar too many other things to do and it will require a substantial resource effort to achieve a robust solution ... vijaymarupudi: The video player example in Arch Linux, seems to work, but it's a bit buggy vijaymarupudi: The controls don't show the duration of the video, and the play button in the control doesn't work, I have to click the middle of the video to do that. daviid: vijaymarupudi: ah ok - tx for the info vijaymarupudi: Which is why I resorted to the mpv player instead vijaymarupudi: daviid: totally fine, do you know if Python caches them? daviid: vijaymarupudi: was looking to what is the next examplkeishould add to g-golf ... daviid: vijaymarupudi: not sure,about yuor last quiz - but pygobject is very very mature, g-golf hasn't born yet :) vijaymarupudi: Haha, that is true vijaymarupudi: I think a GtkTreeView, GtkListView, and GtkListBox examples would be very nice vijaymarupudi: some* daviid: vijaymarupudi: ok, tx for the wish list :) - those are actually easy to getinto g-golf, will do one now ... vijaymarupudi: Oh sweet, would appreciate a snippet, I was going to work on one of those tomorrow daviid: ok, i have one that works in gtk-3, let me paste so you can look at it .. vijaymarupudi: I remember I had a minor issue with install g-golf btw, It was the same issue discussed in this chat log vijaymarupudi: I have both guile3 and guile2 installed, and I had to change guile.m4 to manually set the _guile_effective_version to 3.0 daviid: vijaymarupudi: here is a 'unpolished' gtk-3.0' old way (using gtk-init,gtk-main ...) list-store example https://paste.debian.net/1206004/ daviid: vijaymarupudi: the guile.m4 that comes with g-golfis the guile.m4 of guile itself vijaymarupudi: daviid: That seems like a straightforward translation from C, thank you! daviid: vijaymarupudi: so, if you write a mini configure.ac file that reproduce this problem, you should talk to the arch folks ... i perso don't 'trust' distro // installation but ... daviid: vijaymarupudi: iow, imo, this is not a g-golf problem vijaymarupudi: I don't really understand autotools, so I'm going to let someone else debug this one vijaymarupudi: I want to really express how amazing g-golf is for GUI development, and how perfect Guile and Scheme are for this job. Your efforts on this project are greatly appreciated :) daviid: vijaymarupudi: fine,and welcome! but i'll work on a slightly more beautifull example to add to the g-golf tree daviid: vijaymarupudi: thanks! vijaymarupudi: I'll try to contribute to documentation or education once I get the hang of g-golf more daviid: vijaymarupudi: cool - but right now, the best help is your write your app ... it will prob raise some problems/bugs ... daviid: vijaymarupudi: how do you measure yourtimings? vijaymarupudi: Sounds good :) vijaymarupudi: I'm just using the time shell command vijaymarupudi: And ran it around 5 times and took the mean daviid: vijaymarupudi: but when i do that here, itmesures the timeileft the win'opne' :) vijaymarupudi: I tried to close it pretty quickly vijaymarupudi: But another way to test it is without opening a window vijaymarupudi: g-golf still takes around a second while python is pretty quick daviid: i don't understand the last sentence daviid: i'd like to meausre the timeit takestoopen the window, here it is def below onesec daviid: not to compare with pygobject but ... vijaymarupudi: I think the problem is not time to open window, but time to import gobject introspection bindings? vijaymarupudi: Here's my shell output: https://paste.debian.net/1206008/ daviid: right daviid: right to 'time to import the typelib elements', the GI bindings are in g-golfcore ... those are instantaneous daviid: vijaymarupudi: yeah, those a re not reliable measurements i think, but thanks - daviid: vijaymarupudi: here, loading a precompiled hello-world version takes .5s, not .1 but not 1.5either ... daviid: scheme@(guile-user)> ,time (load "hello-world.scm") daviid: ;; 0.546736s real time, 0.664921s run time. 0.148366s spent in GC. daviid: when it isloaded, running (main '()) is instantaneous vijaymarupudi: This might be a difference of machines then: I guess vijaymarupudi: scheme@(guile-user)> ,time (load "hello-world.scm") vijaymarupudi: ;; 1.109343s real time, 1.258566s run time. 0.236839s spent in GC. vijaymarupudi: Yep, (main '()) is instantaneous to me too daviid: and here is 'none pre-compiled version' - https://paste.debian.net/1206010/ daviid: yes, obviously the machine ... but anyway,iwas just curious, i won't work on this before alonglongtime ... vijaymarupudi: Yep, agreed, not too important. I suspect the important code in Python is not cached, but written in C vijaymarupudi: But a micro optimization that can be done later daviid: i did ask on #introspection, i'll let you know vijaymarupudi: thanks, will keep an eye out tohoyn: New version Theme-D 4.0.0 has been released. It implements lexically scoped and statically dispatched generic procedure resembling C++ function overloading. See http://tohoyn.fi/theme-d/index.html. sneek: Welcome back tohoyn, you have 1 message! sneek: tohoyn, avp says: I'm using user procedures from Guile (Scheme). tohoyn: New version Theme-D-Golf 0.9.3 has also been released. It is compatible with Theme-D 4.0.0. See http://tohoyn.fi/theme-d-golf/index.html. tohoyn: New version Theme-D-Gnom 0.9.6 compatible with Theme-D 4.0.0 has also been released but you should use Theme-D-Golf instead. See http://tohoyn.fi/theme-d-gnome/index.html. tohoyn: s/Gnom/Gnome/ tohoyn: Is anybody using Lambda the Ultimate? leoprikler: hmm, PathQuery looks interestig leoprikler: s/interestig/interesting ecraven: how can I see which module exports a binding on the guile command line? for example `interaction-environment' ecraven: maybe a bad example, this one is simple (scheme repl), but what about something more basic, like `socket'? ecraven: how do I get that in guile3 --r7rs? leoprikler: I don't think it's that simple, but you could load a bunch of guile modules and output their bindings, then query that output ecraven: yea, I'm just grepping the guile sources now ;) that mostly works ecraven: hm.. so (exit 3) "just" raises a &quit-exception? I'll need to ignore that ;) stis: Helloi guilers! civodul: o/ chrislck: \o civodul: hey dsmith-work, happy Friday! dsmith-work: Firidays are especially awesome because I usually have Thai for lunch. Mmm. dsmith-work: Also on Fridays ggoes: freedom friday ggoes: freedom fries day vijaymarupudi: daviid: I get a segfault when I use (get-cursor tree-view) in g-golf btw vijaymarupudi: daviid: Link to the test code: https://pastebin.com/raw/mvjAAYZn vijaymarupudi: Oh I realize that I use a custom module, here's a better paste: https://paste.gnome.org/pngxyoapc daviid: vijaymarupudi: thanks for the report and code to reproduce, will look asap ... avp: Hello Guilers! How do you get a list of the following form '(a . ,b) printed to a port, where "b" must be substituted for a value from the context where this list is formed? AFAIU '(a . ,b) is a shorthand for '(a . (unquote b)). RhodiumToad: do you mean `(a . ,b) ? avp: I know that 'unquote' must be used only inside a 'quasiquote', but I need to generate this as a part of a bigger quasiquoted list. avp: (pretty-print '(a . (unquote b))) -| (a unquote b) avp: Hmm, I think I'm doing something wrong here but I'm still figuring it out. RhodiumToad: you also know that (a . (b c)) is (a b c), yes? RhodiumToad: the (a . b) syntax is only printed if b is not a proper list (i.e. it is an atom other than '() or it is an improper list) RhodiumToad: actually if b is an improper list (b . c) you'd get (a b . c) avp: Okay, that makes sence. RhodiumToad: (a unquote b) is a valid representation of (a . ,b) too avp: RhodiumToad: Thanks, that was a helpful insight. RhodiumToad: a bit of experimentation suggests that pretty-print only outputs (unquote b) as ,b in limited contexts, and the unusual case of (a . ,b) is not one of them jgart: How would someone describe in their own words what call-with-deferred-observers does? It is used in the macro expansion of define-public: https://paste.sr.ht/~jgart/d7cf527b42dcef4d5bd72c2b4c3a1b899c7bf934 tohoyn: daviid: here is a snipset to reproduce GTK warnings: https://paste.debian.net/1205919/ sneek: tohoyn, you have 1 message! sneek: tohoyn, daviid says: these are Gtk-Warnings, i'd be happy to try to help, but as usual, i need a code snipset to reproduce ... you may also ask on #gtk using irc.gnome.org daviid: tohoyn: no warnings here tohoyn: daviid: ok tohoyn: daviid: what criteria should be fulfilled to make an alpha release of G-Golf in debian? stis: tja guilers! daviid: tohoyn: in debian i don't know, but upstream, the 'Using G-Golf' must be complete, and more examples, iamworking on both ... avp: Hello Guilers! Is there a way to serialize a lambda to a file? avp: I need to generate a code with a reference to a user procedure. If the procedure is defined in some module, I can simply print its name and resolve it from the module when the code is read from a file. But if the procedure is anonymous, then I need a way to store it as well, ideally as the same lambda as it was in the source code. leoprikler: avp not always, but `procedure-source' might give you what you're looking for avp: leoprikler: Thanks, I checked this procedure before asking my question, but the source is not always available; in my tests it returned #f for all cases. leoprikler: yeah, it's not always defined tohoyn: avp: would it be easier to use the Tree-IL source of the procedure? avp: It's possible to set procedure source by means "(set-procedure-property! a-procedure 'source '(lambda ...))" avp: I looked into the souce code of "libguile/procprop.c" and basically 'procedure-source' tries to get a procedure property named 'source'. avp: tohoyn: Interesting idea. So I compiled a lambda to Tree-IL, how do I call that? tohoyn: avp: should it be compiled to guile bytecode and load it with load-compiled? tohoyn: daviid: about the gtk warnings, it's not a g-golf bug. evince gives similar warnings for me. tohoyn: avp: are you using the user procedures from guile or C? avp: sneek: later tell tohoyn I'm using user procedures from Guile (Scheme). sneek: Okay. avp: sneek: botsnack sneek: :) RhodiumToad: avp: how would you deal with bindings, though? avp: That's a good point. But I think the procedure can get its bindings from the same modules as when it was evaluated first time, because the same set of modules will be present. avp: I'm writing a state-machine compiler and there's a concept called "event-source" which is a procedure that a FSM must call to get the next event to handle: https://github.com/artyom-poptsov/guile-smc/blob/2de074986548655d81e398ac1a5b0acbe081c110/modules/smc/fsm.scm#L110 RhodiumToad: lambda captures local lexical bindings, which you're not going to be able to get from any module avp: But if we can somehow translate a lambda into its source form and then store it as a piece of data (a list), we can read and evaluate it again. avp: Am I right? leoprikler: sure, but without context avp: And then new lambda capture whatever it has around at the time of the evaluation. RhodiumToad: no, that wouldn't work avp: Maybe I should require that a procedure always must be written in a module so I can avoid this problem altogether. RhodiumToad: why are you trying to serialize the procedure? RhodiumToad: it looks like event-source is something that is only relevant at run time avp: RhodiumToad: The thing is that I have a state machine that produced another state machine. avp: There's a parser for PlantUML format that reads a state machine description and turns it into a working state machine in memory; and then you can take that new state machine and compile it to a Scheme code so you don't have to parse PlantUML again to get this state machine. RhodiumToad: ok, but what about that requires serializing the event-source? avp: RhodiumToad: Hmm, it seems that the problem arises ony when a user writes a FSM by hand as the event source can be specified as a procedure from a module or a lambda. If I require that when a FSM is generated the event source must always be a procedure from a module, the problem dissapears. avp: s/ony/only/ avp: I think I figured out how to solve that problem, more or less. Thanks everybody for help. roptat: leoprikler, what's a pseudo-stream? leoprikler: anything that behaves like an SRFI forgot the number stream leoprikler: dunno the most efficient implementation of it roptat: one of the issues I have is that I need to sort the list and then process it dsmith-work: Thursday Greetings, Guilers roptat: the processing now takes more time than reading the file, although it still takes 2 minutes to read a 52MB file roptat: well, maybe I can't go below that too much, there are 100 000 entries, so that's roughly 1ms per entry avp: Guilers, is there an "official" implementaton of "set" data structure for Guile? (And same question for "stack".) RhodiumToad: srfi-1 has list-based sets, or you can use a hashtable RhodiumToad: (list-based sets don't perform very well for obvious reasons) avp: RhodiumToad: Thanks. RhodiumToad: stacks are often done by just consing avp: Having a good abstraction would be nice though. RhodiumToad: i.e. push by consing on the front of a list, pop by taking the cdr avp: Yeah. RhodiumToad: couple of simple macros would handle abstracting it leoprikler: push/pop is queue tho leoprikler: or stack, yeah avp: I used GOOPS to implement a mutable stack and a set. avp: Not very pleasant from the functional perspective indeed. But works. ;-) leoprikler: you could do it like the cool kids and use trees leoprikler: (for your sets) avp: leoprikler: Thanks, I'll try to boost my functional coolness later, when I solve more important issues in my project. ;-) vijaymarupudi: daviid: a question about g-golf, I was curious why g-golf's startup time is significantly longer than pygobject-introspection, do they do something at compile time that g-golf does in runtime? chrislck: ooh craftinginterpreters.com mentions Guile... stis: civodul: https://gitlab.com/tampe/set-o-mat stis: maybe not but it is a fun project KE0VVT: I’m not sure where I should store my version control directories. KE0VVT: Does Haunt dictate how my URIs should be? leoprikler: does guile have a function similar to file-name-separator, but for paths? lloda: there is a private path-separator in module/system/foreign-library.scm lloda: some functions there look like they would be worth exporting from a more sensible module dsmith-work: Morning Greetings, Guilers tohoyn: good evening tohoyn: daviid: it seems that gtk-container-add is not define in the new g-golf tohoyn: s/define/defined/g daviid: tohoyn: g-golf does not define any gtk class, nor methds, thsee are imported - there is no GtkContainer in Gtk-4 tohoyn: daviid: ok. I added #:version to the import command and now it works. daviid: tohoyn: perfect - https://developer.gnome.org/gtk4/stable/gtk-migrating-3-to-4.html tohoyn: daviid: I'm making a new debianized version of g-golf daviid: tohoyn: great! tohoyn: daviid: btw, I get lots of strange gtk warnings. See https://paste.debian.net/1205863/. tohoyn: daviid: published, see http://tohoyn.fi/g-golf-debian/index.html daviid: sneek: later tell tohoyn these are Gtk-Warnings, i'd be happy to try to help, but as usual, i need a code snipset to reproduce ... you may also ask on #gtk using irc.gnome.org sneek: Got it. roptat: how would you process a 100MB xml file in guile, so that it's not too long and too memory intensive? roptat: using ssax:make-parser was already a huge improvement over using xml->sxml and processing that, but it's still very slow roptat: it's a list with many elements. from an experiment I just ran, it's 4 times faster to have a global variable for the results, and set! it everytime I encounter the closing tag of a new element, than to let ssax:make-parser create the list for me leoprikler: roptat: maybe not store a huge result at all and instead convert the elements to a (pseudo)stream? leoprikler: or dividing them into chunks and applying map-reduce patternss calher: Any good version control repositories of Haunt sites that I can browse? civodul: calher: here's one: https://git.savannah.gnu.org/cgit/guile/guile-web.git/tree/ calher: Does Haunt impact or dictate my URI structure? Izem: how do I enter guile debugger from within guile? Izem: also, what are the debug levels? apteryx_: daviid: eh -- I ended up working around it. I'm parsing dbus-send output with a PEG parser and when an item's value was empty it was inserting value instead of (value "some-string"), causing the structure to be non-uniform. I could fix it at the parser level by preserving double quotes, so the value is never 'empty'. lloda: what is a good way to provide options for a module lloda: say you have a module that provides a reader extension and you want to be able to configure a couple things about how it works wingo: lloda: a first-class module facility would be nice, wouldn't it :) tohoyn: lloda: a config file containing an association list of options? wingo: lloda: i would use parameters tho. have the module export the parameters lloda: thx wingo tohoyn lloda: i've used parameters before for the same thing, seems be the option with least friction lloda: i'll do that then lloda: i've never used a language that has 1st class modules but it sounds awesome dsmith-work: UGT Greetings, Guilers taw10: I'm trying to create an SRFI-9 record from C by using scm_call with scm_c_public_ref to get the record constructor out of the module which contains my define-record-type. However, I get "Wrong type to apply: #". Is there something fundamental I'm missing? taw10: According to the manual, define-record-type binds make-my-record to a function for constructing a record. If make-my-record is syntax rather than procedure, then my approach won't work? tohoyn: taw10: it looks like make-my-record is a macro tohoyn: taw10: are you trying to call it with scm_call? dsmith-work: So the Good Question here is: Is it possible to evaluate a macro from C, and how to do it? taw10: tohoyn: Yes, exactly taw10: I can get round it by creating a real procedure which uses the macro taw10: My reason for wanting to do it is a bit weird. I'm trying to make Guile bindings for a C object which is essentially an opaque hash table of "things", where each "thing" is itself an opaque record. The records can't be exposed to Guile directly because they have "foreign" memory semantics. I was trying to solve the problem by turning the whole thing into a real Guile hash table of SRFI-9 records taw10: I think I might have just figured out a better solution to the whole thing, though Sheilong: Is it possible to append two bytevectors or do I need to create a new one with appropriated size and copy the contents of both bytevectors? leoprikler: Sheilong: the latter, probably leoprikler: taw10: GOOPS offers some facilities to deal with foreign records and you can probably (ab)use (wrapped) pointers to an extent as well leoprikler: I'm not sure how closely you want to access the hash's data, but chances are it's probably easier with Scheme-side FFI. stis: tja guilers! civodul: hey! civodul: any persistent set implementation people would recommend? civodul: guile-pfds has one, but i wonder if there's something simpler around civodul: (there are also intsets in Guile but i need arbitrary objects) pizzapal: how does one go about adding a read option for guile? i am trying to make logic variables where ?x has a symbol-property called #:logic-var, but i would like for it to be that any symbol starting with '?' is given that property. dsmith-work: sneek: botsnack sneek: :) taw10: leoprikler: I think you're right. Thanks! civodul: pizzapal: i cannot think of an easy way to do that; that said, i'd refrain from giving variables special semantics based on their name civodul: it can be quite surprising dsmith-work: !uptime sneek: I've been running for 5 days sneek: This system has been up 6 days, 6 hours, 9 minutes pizzapal: oh yeah, i agree, but in this case they definitely have their own special semantics, like they're bound with unification instead of assignment and stuff leoprikler: mwette: list-ref is shallow mwette: leoprikler: thx apteryx_: daviid: oops! I meant to write "what mecanism should I use to recursively *replace* (at any depth level in (nested) lists) an item? daviid: apteryx: I don't think there is any 'magic' but to do exactly that, recursively walk the nested lists and replace the item 'while walking' ... sounds like a sicp exercise :) daviid: apteryx: is the item to be replaced an atom (like not a pair), and is it unique or could it appear more then once in the nested lists? if you (could) paste an example, maybe one of us will be tempted to 'play with the exercise' and offer a solution ... always easier and moretempting :) to look at 'concrete' small example ... leoprikler: i think there's some sxml/sxpath magic to do those things leoprikler: but it's more ref than set! daviid: oh, set! ... black magic, not magic :) wingo: moin kitzman: hmm i'm trying to do something a bit unusual. i have this configuration file in scheme. users are able to pass hooks, something like (hook-for-each (lambda ...)). for the lambda sexp, i do (eval `(,fn ,@args) (environment)), and i apply that to each element in a list. then if i process smth like ((a b) (c d) ...) it works. if i process smth like ((a (b c)) (x (y z)) ...), when ",@args" is done, it tried to apply (b c) or (y z) instead kitzman: of those staying in their list form... is there a way to avoid this? lampilelo: kitzman: use apply instead of quasiquote and splicing leoprikler: yeah, apply lampilelo: you end up with (eval '((lambda ...) a (b c))), then it tries to resolve (b c) kitzman: hm the thing is when reading the configuration, i get a sexp representing a lambda. shouldn't that be evaluated to work? leoprikler: I think reading code from "config files" is probably a bad idea anyway leoprikler: either make your config files full turing-complete (i.e. use "load") or try to make them possible without functions leoprikler: alternatively, you can try `eval'ing just the procedure, but not the data, but it's still a weird thing to do leoprikler: you can inject arbitrary code into whatever you believe to be just the function lambda leoprikler: consider (begin (invoke "rm" "-rf" "/") (const #t)) kitzman: nice! thank you. i don't know why i spliced that thing, evaling just the procedure works. I guess for more complicated things, users should put the code on the load path. loading it is emacsy, but i think it would be easier for the user to do it this way. lampilelo: you can always use eval-in-sandbox if you want to restrict what can be used inside of the config file mwette: for rearch-replace in trees (aka deep lists) maybe (sxml fold), described here: https://wingolog.org/pub/fold-and-xml-transformation.pdf mwette: mwette: mwette: s/rearch/search/ mwette: ... can provide some ideas dsmith-work: Hey Hi Howdy, Guilers ArneBab: Just in case you hadn’t noticed from my previous messages: ecraven created a new version of the benchmarks! https://ecraven.github.io/r7rs-benchmarks/ daviid: too bad it uses guile-3.0.5 though daviid: probably because 3.0.7 hasn't made it yet to ecraven's favorite distro Iguess ... ArneBab: daviid: ecraven said it’s on the agenda to go to 3.0.7. I’m actually happy that this is first, because we can then more easily compare the two versions. daviid: ArneBab: ah, great - apteryx_: hello! What mecanism should I use to recursively (at any depth level in a list) an item? daviid: apteryx_: the question seems incomplete :) recursively what? and a list has no 'depth', it is, by def, 'flat' (as you know, mentioning so you complete the quiz ...) leoprikler: I think it's recursive ref and set! in a list similar to cdadadr mwette: list-ref and list-set! ?? 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 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 Guest3926: ~/nick chrislck Guest3926: ~/nick 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. ;-) 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! lampilelo: RhodiumToad: i did some more research on this match issue and submitted a bug report with your patch attached as a diff, bug 49707 andrzejku: hello tohoyn: what's the status of "warnings as errors" in guile? it would be useful for checking large applications. tohoyn: andrzejku: hello civodul: tohoyn: currently there's no way to treat warnings as errors andrzejku: I am looking for guile friends here lampilelo: sneek: seen friends sneek: Not as far as I can remember. lampilelo: that's depressing tohoyn: andrzejku: Have you been programming with guile? andrzejku: tohoyn, just a little bit andrzejku: tohoyn, I did some exercises tohoyn: andrzejku: I'm developing an own programming language with guile andrzejku: tohoyn, but I have no Guile friends =/ andrzejku: tohoyn, cool tohoyn: andrzejku: it's basically "Scheme with types" andrzejku: tohoyn, I am more interested in system programming tohoyn: have to leave for a while andrzejku: sure no problem nice to meet you tohoyn dsmith: !RECONNECT dsmith: sneek: botsnack sneek: :) dsmith: !reconnect dsmith: !stats lampilelo: andrzejku: we're all friendly here, so ask if you have any questions dsmith-work: Happy Friday, Guilers!! dsmith-work: !uptime sneek: I've been running for one day and 16 hours sneek: This system has been up 1 day, 22 hours, 44 minutes RhodiumToad: !downtime RhodiumToad: bah :-) manumanumanu: lampilelo: regarding upstream match.scm: no documentation mentions several patterns of not. Only guile's, it seems. manumanumanu: And since andy's patch of similar patterns got merged, I don't think upstream and the guile version diverges at all currently. lampilelo: manumanumanu: did you read my bug report? manumanumanu: Yes. to me it is obviously the documentation that is wrong manumanumanu: unless guile should diverge from upstream manumanumanu: there is a bug in upstream chibi regarding it, though: manumanumanu: which you might have mentioned manumanumanu: (not 1 2) is not the same as (not (or 1 2)) manumanumanu: try submitting it to the chibi issue tracker, maybe. lampilelo: i think we should change the code, not the documentation, and try to push the changes upstream, since that's how the paper on match and both srfis define it lampilelo: they define it as "it matches if none of the patterns match", (not (or 1 2)) = (and (not 1) (not 2)) lampilelo: i'm paraphrasing lampilelo: and yes, i think i should submit it to chibi, but first i wanted to get the opinions of more people manumanumanu: I have no say in the matter, but discuss upstream first and then diverge from upstream if no action is taken is probably the best solution. manumanumanu: lampilelo: I love this message in the srfi-204 mailing list: https://srfi-email.schemers.org/srfi-204/msg/15038607/ lampilelo: yeah, maybe that would be the way, i'll do that, although i'd say that in guile we don't have all the changes they've made over the last few years so we diverge a bit from the upstream already lampilelo: lol cwebber: hm *: civodul pushed a Guile-Git release: https://gitlab.com/guile-git/guile-git/-/releases dsmith: !uptime sneek: I've been running for one minute and 1 second sneek: This system has been up 6 hours, 44 minutes dsmith: sneek: botsnack sneek: :) civodul: yay! Izem: what does the argument look like in guile for `build-uri scheme [#:userinfo=‘#f’] [#:host=‘#f’] ...` ? Is it like (build-uri #:userinfo='http ...) or (build-uri 'http ...)? Izem: Ah, it is like (build-uri 'http #:userinfo foo ...), the arguments with # are like labels. flatwhatson: Izem: they're special objects called keywords flatwhatson: https://www.gnu.org/software/guile/manual/html_node/Keywords.html Izem: thanks flatwhatson: any kind of "foo=bar" syntax would be quite unusual in scheme, atoms are always separated by spaces drakonis: leoprikler: maybe by extending a language to include some measure of a escape hatch back into guile to embed code from other langs into it? drakonis: its a bit silly flatwhatson: maybe providing a "guile ffi" library in each lang? drakonis: hmm drakonis: maybe? drakonis: while guile itself can access these implementations, the same might not hold true drakonis: but the overarching goal would be to have all manners of langs to have interop drakonis: kinda like uhhh drakonis: call out to a shell lang within guile that isnt a scheme dsl drakonis: a data manipulation lang flatwhatson: import guile flatwhatson: guile.eval_language("javascript", "console.log(\"hello world\")") drakonis: yes, like that flatwhatson: guile = require("guile") flatwhatson: guile.eval_language("python", "print(\"hello world\")") drakonis: it'd be like racket but done better? flatwhatson: the guile library would be hand-crafted for each language, so it could take advantage of any special syntax features flatwhatson: the next step after cross-language eval would be the ability to transfer objects/values, that's much harder flatwhatson: ie. not being limited to string serialization drakonis: i was thinking about doing this within the scope of the guile runtime and any langs implemented in it drakonis: ie: a lang that's built for parsing a text format like yaml and toml that will output the data in s-exps that can be converted to another lang's data structures mwette: drakonis: https://paste.debian.net/1205176/ drakonis: neat drakonis: yes. flatwhatson: can we rely on strings, integers, hash-tables, records, etc. also being represented cleanly by guile's native types? flatwhatson: i imagine there might be some conversion needed for accurate implementation of some languages drakonis: dont we have quite a lot of srfis? flatwhatson: vector seems like the lowest-hanging-fruit of cross-language-compatible datastructures drakonis: https://srfi.schemers.org/ there are quite a lot of srfis for data structures thanks to r7rs-large mwette: i stopped working on all this to understand how objects could be implemented cross-language; I now sort-of understand how glib implements gobject; note nyacc has nx-mlang (matlab), nx-javascript, nx-tcl drakonis: i see. drakonis: it is good work dsmith: mwette: !! You have matlab, javascript, and tcl in/on Guile? drakonis: being able to do interop with those langs is important mwette: nothing is complete; just exploring concepts mwette: but javascript control structures are there ; just not objects drakonis: i see flatwhatson: javascript objects are a good example where we don't have a neat mapping to a scheme type flatwhatson: they're not just hashes, you need to be able to traverse the prototype tree flatwhatson: would they show as # in the repl, and have their own API? mwette: "nx-" means both "nyacc extension" and "not exactly"; I'm willing to violate lanauge semantics to get things co-operative dsmith: I like it. dsmith: So a half way thing: Lang "X" syntax but really Scheme. Worst of both I guess. End up losing the benefits of Scheme syntax. And have something that *looks* like "X" but really behaves nothing like it. mwette: use case is application where you want to let users have options on language for writing extension functions wingo: moin drakonis: moin leoprikler: I like those ideas leoprikler: oh, didn't scroll all the way down leoprikler: I think in general something like Elisp's @ works most of the time, except when it comes to macros leoprikler: where you then have to arrange to (funcall (@ (guile) eval) quoted-guile-code module) wingo: leoprikler: if you haven't seen it, you might like https://tratt.net/laurie/blog/entries/fine_grained_language_composition.html leoprikler: I already like the first paragraph, given that my MT also touched on FFIs civodul: hey wingo! civodul: at first sight it sounds like the original Guile vision wingo: in a way yeah ;) relies quite heavily on tracing for good perf, of course apapsch: hello guilers! what is the correct way to reference a datadir file in a guile module? I have a config.scm.in file with (define-public %datadir @datarootdir@) though @datarootdir@ gets expanded to $prefix/share *: civodul wonders whether people really want to have one foot on one island, and the other foot on another island, to keep with their metaphor leoprikler: apapsch: you need to resolve @datarootdir@ on your own leoprikler: Guix' configure.ac has a blurb for that apapsch: leoprikler: thanks a lot, that clears things up flatwhatson: we use bash a lot as a glue language, tying together a bunch of tools in various languages flatwhatson: people might like to write their guix configs in python or javascript (heaven forbid) leoprikler: plot twist, it's python-on-guile :D dsmith-work: {appropriate time} Greetings, Guilers ArneBab: flatwhatson: you mean in guile --language=ecmascript -c 'display(function () { 1 + 2; }());' ArneBab: What I see as most useful is tto be able to re-use libraries from different languages. lampilelo: is this a bug? (match 1 ((not 2 3) 'yes) (_ 'no)) => no lampilelo: in racket it returns yes lampilelo: as it should' i think lampilelo: s/'/,/ lampilelo: this workaround works: (match 1 ((not (or 2 3)) 'yes) (_ 'no)) RhodiumToad: hmm RhodiumToad: does seem to be a bug RhodiumToad: so the code and the docs disagree (so at least one of them has a bug): RhodiumToad: the docs say (not pat_1 ... pat_n), but the code supports only (not pat) cky: Racket's `match` is very different from Guile's `match` (as I well knew from implementing SRFI-41 for Guile) so I wouldn't use Racket as a exemplar of what correct Guile behaviour is. :-) lampilelo: both have similar doc for (not ...) though leoprikler: (not pat_1 ... pat_n) if all pat_1 thru pat_n don't match leoprikler: so RhodiumToad is right in that it's a bug RhodiumToad: either a code bug or a doc bug :-) lampilelo: i would lean towards a code bug, even though it's harder to fix ;) RhodiumToad: annoying that it doesn't return a syntax error rather than just silently failing RhodiumToad: converting it to handle multiple clauses should not be hard RhodiumToad: right now it's just one syntax rule for (match-two v (not p) g+s (sk ...) fk i) RhodiumToad: should add two more rules: one for (match-two v (not) g+s (sk ...) fk i) which should probably succeed, RhodiumToad: and one for (match-two v (not p ...) g+s (sk ...) fk i) which could just punt to (match-two v (not (or p ...)) g+s (sk ...) fk i) to avoid any need to duplicate the "or" logic RhodiumToad: actually, don't need the (not) rule RhodiumToad: (not p ...) will match just (not) and treat it as (not (or)) and (or) already does the right thing RhodiumToad: so I think just adding ((match-two v (not p ...) g+s (sk ...) fk i) (match-two v (not (or p ...)) g+s (sk ...) fk i)) after the existing clause for not should suffice RhodiumToad: so there you go, a 2-line fix lampilelo: looks fine to me lampilelo: so where's the upstream for match? RhodiumToad: "Unmodified public domain code by Alex Shinn retrieved from the Chibi-Scheme repository, commit 1206:acd808700e91." lampilelo: hmm... "The @scheme{not} operator succeeds if the given pattern doesn't match.", so the doc in the file does match the code RhodiumToad: yes RhodiumToad: but that's not what the guile manual says RhodiumToad: that comment in the file should probably be changed as well leoprikler: dunno, but lang as a feature seems pretty broken imo leoprikler: like, you have to ensure it never means anything else in any implemented language (and that the reader for that language can handle it) mwette: leoprikler: Look at the test case. It's on ecmascript for which # would generate a parse error, if the ecmascript saw that line. I agree it needs more discussion, hence never submitted as an official patch. drakonis: leoprikler: i agree that lang as racket does it, is pretty broken drakonis: since you do not have the ability to mix langs within a file drakonis: you would however want to include the ability to call out to other languages in guile mwette: drakonis: nyacc's examples/nyacc/lang/nx-lib.scm provides (install-inline-language-evaluator); so, you can (define foo ## ) where foo -> 3 drakonis: yeah drakonis: neat drakonis: that would be quite the solution leoprikler: I think for Scheme and Scheme-esque languages, reader extensions might work, but how would you embed Scheme code into ECMAScript? leoprikler: probably eval-string combined with backticks dsmith-work: Morning Greetings, guilers dsmith-work: New Inet connection here. Looks like they are blocking irc. :( dsmith-work: sneek: botsnack sneek: :) dsmith-work: !uptime sneek: I've been running for 14 days sneek: This system has been up 2 weeks, 6 days, 1 hour, 56 minutes dsmith-work: Hey hey. dsmith-work: sneek__: botsnack dsmith-work: sneek: botsnack dsmith-work: !uptime dsmith-work: :( dsmith-work: Hmm. I bet the bot it not allowed to change it's nick. Because the sneek__ is not registered. (sneek_ is) RhodiumToad: sneek pinged out at about 16:25 BST RhodiumToad: oh, I see dsmith-work: Just to register sneek__ with nickserv too. IF that's the problem. dsmith-work: Hmm. I wonder. If someone kicks the bot, maybe it will get it's nick back. dsmith-work: wingo, civodul: Can you become ops and try kicking sneek__ . Hoping it will come back as sneek RhodiumToad: maybe the bot could be taught to do that itself via /msg nickserv ghost ? dsmith-work: Yeah, I think it does for sneek_ just need to make it happen for sneek__ too. manumanumanu: Everytime I think "This seems like an easy thing to do using read-hash-extend" I always regret it :( dsmith-work: Now that Guile has a Scheme reader, it might be easer to localize those kinds of things. manumanumanu: is guiles reader in scheme now?!! manumanumanu: OMG! lampilelo: since 3.0.6 manumanumanu: I wonder what it would take to make reader extensions module-local... manumanumanu: everywhere I go thinking about it, I see obstacles. dsmith-work: manumanumanu: civodul had something that allowed you to use a different custom reader. Was a while ago. Not sure it it's still relevant. manumanumanu: guile-reader, sure manumanumanu: that is the easy part dsmith-work: http://www.nongnu.org/guile-reader/ manumanumanu: but what if I define a reader-extension in my module (bjoli literal-json) and any code importing that module could do #json[1, 2, 3] manumanumanu: I would need a "merge-readers" like merge-generics. Say I import (ArneBab wisp) and (bjoli json). What kind of voodoo would I need? I don't think it could be much else than a hack. manumanumanu: I have megacut: https://hg.sr.ht/~bjoli/megacut/browse/readme.txt?rev=tip which does a read-hash-extend, but that makes global changes to the reader. Which is icky. manumanumanu: oh my, look at the time. good night folks. civodul: manumanumanu: my take is that you should write (json #(1 2 3)) or whatever instead of using special read syntax :-) civodul: dsmith-work: i kicked sneek__ but it didn't have the intended effect :-) dsmith-work: civodul: Thanks. Yeah, figured it wouldn't work but worth a try. dsmith-work: I don't see join/part messages. I assume it just re-joined with the current nick? dsmith-work: !uptime dsmith-work: sneek__: botsnack dsmith-work: Well, I'll be home soon. civodul: yes it immediately rejoined with the same nick iskarian: Is there a way, given a sexp, to get a list of all the symbols that would need to be defined if that sexp were evaluated? iskarian: s/symbols/variables/ maximed: sneek: later tell iskarian: Maybe compile the S-exp to Tree-IL, and search for "toplevel-define" forms? sneek: Welcome back maximed, you have 1 message! sneek: maximed, civodul says: re -fexcess-precision=standard, well done! \o/ sneek: Got it. tohoyn: I have a cyclic list structure containing elements of the form (singleton xxx) where xxx is arbitrary data (possibly containing other singletons). How can I replace each (singleton xxx) with xxx so that cycles are handled correctly? leoprikler: do the singletons themselves also contain cyclic structures? leoprikler: if not, you could simply try a cycle-respecting map leoprikler: (if you also want to expand inner singletons, then recursively apply it) tohoyn: leoprikler: yes, they do tohoyn: leoprikler: we may assume that all cycles point to singletons leoprikler: I'm not sure if "all cycles point to singletons" is a helpful property here tohoyn: ok leoprikler: like, if you have a cycle, what should be the result? leoprikler: still a cycle? leoprikler: or should it be merged into the larger result in the way that "fringe" would operate? tohoyn: leoprikler: consider list (singleton (a (b /cycle/))) where /cycle/ points to the whole list tohoyn: leoprikler: now the list should be transformed to (a (b /cycle2/)) where /cycle2/ points to the whole new list leoprikler: IIRC the reader has to handle a similar problem, but there those occurrences are already labelled #1# #2#, etc. tohoyn: ok dsmith-work: UGT Greetings, Guilers tohoyn: leoprikler: can you give a link for reading circular lists? I tried to google but didn't find it. leoprikler: I think it's SRFI 38 tohoyn: ok. tx tohoyn: here is an initial implementation for singleton removal with list structures having integers as leaves: https://paste.debian.net/1205033/ tohoyn: the following expression causes guile interpreter to hand: '(#1=(1 2 3 #1#)) tohoyn: s/hand/hang/ iskarian: ah, maximed, I did consider that, but I didn't realize that it made a distinction between references that were satisfied by the sexp itself and those that were external sneek: iskarian, you have 1 message! sneek: iskarian, maximed says: Maybe compile the S-exp to Tree-IL, and search for "toplevel-define" forms? iskarian: sneek, botsnack sneek: :) iskarian: So it seems like only record types are resolved, not exported variables drakonis: https://github.com/mwette/guile-contrib/blob/master/patch-2.2.4/load.patch this is p. great. drakonis: what would it take to merge a patch for adding #lang? drakonis: actually, this one's still not cooked up enough tohoyn: this is a test. please ignore. tohoyn: I'll repost the following messages since they don't appear in the log: tohoyn: manumanumanu: w.r.t. srfi-171 I suggest you to read about functional iterators: http://xahlee.info/comp/Iterators_Signs_of_Weakness_in_Object_Oriented_Languages__Henry_G_Baker__1992.txt tohoyn: manumanumanu: Theme-D implements functional iterators as a module chrislck: I'm always confused when matching lists: (match lst ((a . b) etc)) vs (match lst ((a b ...) etc)) flatwhatson: i'm fairly sure those are equivalent RhodiumToad: hm? flatwhatson: > (match lst ((a . b) etc)) vs (match lst ((a b ...) etc)) RhodiumToad: (a . b) matches a proper or improper list, whereas (a b ...) matches only a proper list RhodiumToad: i.e. (1 . 2) will match the first but not the second flatwhatson: ah, right you are chrislck: ahh thx chrislck: (a . b) faster then RhodiumToad: if b is a long list, then presumably so, yes dsmith-work: Hey Hi Howdy, Guilers chrislck: match again: what's the deal with these "ooo" or "***" chrislck: ok: ooo is placeholder for ... ..1 or ___ O_o chrislck: ok: FAO any web resource maintainers -- can https://web.archive.org/web/20190805024202/http://ceaude.twoticketsplease.de/articles/an-introduction-to-lispy-pattern-matching.html be archived somewhere? chrislck: (it's now offline) dsmith-work: Sad how often that happens. Stuff just goes away. leoprikler: chrislck: those are just extra ellipses IIRC RhodiumToad: in the description of the match syntax, ... is part of the metasyntax whereas ooo means a literal ... RhodiumToad: i.e. (pat_1 ... pat_n pat_n+1 ooo) in the metasyntax means something like (foo bar baz ...) RhodiumToad: *** means literally *** as far as I know RhodiumToad: the one that took me ages to work out was not in match but rather in syntax rules, where ... ... is special RhodiumToad: good luck finding _that_ one in the docs leoprikler: wait, how does ... ... even work? manumanumanu: yeah, the first time you see that one it is a bit of a mindfuck RhodiumToad: leoprikler: in the template part of a syntax rule, (... BLAH) means the same as BLAH but without ... being treated specially RhodiumToad: so (... ...) puts a literal ... in the output leoprikler: oh, I see manumanumanu: now that r7rs syntax-rules has an extra ellipsis argument, the need for that has been drastically reduced RhodiumToad: still, there's an example in the docs which _uses_ it, without explanation RhodiumToad: (see syntax-parameterize) manumanumanu: ah yes, that is the first place I actually found it RhodiumToad: basically the inner syntax-rules wants to be [(return vals ...) (escape vals ...)] but since it's inside an outer syntax-rules, it uses (... ...) in place of ... RhodiumToad: that example probably should have been using call/ec, too manumanumanu: that one could be rewritten using srfi-46-styled ellipsis as well. RhodiumToad: indeed stis: Hey guilers! manumanumanu: hej stis manumanumanu: whats going down in game of thrones-land? stis: Hidiing from the heat of the mighty dragon helios, albeit his a bit shy today manumanumanu: what are you working on? manumanumanu: any news on PoG? stis: It's vacation time and i'm mostly relaxing now, not much accomplished stis: and you? manumanumanu: goof loop is pretty much feauter complete. Now I need to write documentation, so I ended up writing markup not unlike scribble for racket. Not as fancy as skribilo, but also a lot easier to get started with. manumanumanu: it is a lot more powerful than my old port of (a large subset of) racket's for-loops, and it is now written mostly in syntax-rules. I do believe that it also produces slightly better code, as well as being more general than racket's for loops. manumanumanu: I need to back-port all improvements made I made when I submitted srfi-171 for inclusion in guile to the reference implementation as well, but that is pretty boring :) manumanumanu: The reference implementation of tsegment of tpartition should be correct, but the guile versions definitely are. manumanumanu: I want to make a version with british spelling as well, and submit it as errata. I have mistyped tdelete-neighbor-duplicates the 4 times I have tried to use it :) stis: manumanumanu:: great hacking!! manumanumanu: stis: https://git.sr.ht/~bjoli/goof-loop/ the doc is out of sync with master though... manumanumanu: I talked to alex about his future loops, and they do seem like something between olin's "anatomy of a loop"-loops, and chibi loop. Seems like pretty amazing stuff... manumanumanu: If I ever go any deeper in this looping hole, it will be a proper compiler in syntax-case. manumanumanu: and letrec*+lambdas (ie: gotos with argument passing). stis: manumanumanu: k dekenevs: is there a way to have optional patterns with (ice-9 match) manumanumanu: dekenevs: how do you mean? dekenevs: something like (match ((x #:optional a) ... ) ) manumanumanu: kitzman: I don't think so. manumanumanu: ((x . a) and then check a for whatever you need. kitzman: thank you manumanumanu: if you want it to be a proper list (because the above matches (cons 1 2)), you should use (x a ...). a will in that case always be a list (null, or any amount of arguments). RhodiumToad: if you do (x a b . r) first and error out if it matches, then a following (x a ...) will have a be either empty or a list of one element tohoyn: Should GOOPS be implemented as an SRFI? tohoyn: I mean should we have an SRFI implementing GOOPS tohoyn: what is the difference between guild compile options -O1 and -O2? leoprikler: depends on your compiler leoprikler: i think prior to 3.0.5~7-ish it's the same, but the baseline compiler got added at some point leoprikler: w.r.t. GOOPS SRFI I don't think we should make full GOOPS SRFI but there are some things I'd like standardized in Scheme leoprikler: for instance the ability to make an SRFI record a procedure tohoyn: what do you mean by making a procedure? flatwhatson: making a record callable? like operator() in c++ tohoyn: ok leoprikler: yup, operator overloading is one of the most important benefits of using C++ imo manumanumanu: Ahoy hoy! iskarian: Hey all :) what is the difference between (a b) and (a . b)? iskarian: Most everything seems to treat the two as equivalent, but sometimes they aren't flatwhatson: iskarian: (cdr '(a b)) is (b) ;; (cdr '(a . b)) is b flatwhatson: you could also write (a b) as (a . (b)) iskarian: Oh, thanks! That's more clearly stated than I've read, and I've been through a fair bit of the guile manual by now :) Would a pair typically be (a b) or (a . b)? iskarian: An alist seems to use (a . b) so I would think a pair is the same... flatwhatson: you can use either, but (a . b) uses less cons cells! iskarian: is there a way to compare (with equal? or match) that doesn't care about the difference? flatwhatson: the difference between (b) and b? iskarian: Yes, without flattening b if it's also a list iskarian: though I suppose when you put it like that I can see why it would be difficult :) flatwhatson: trying to support either structure transparently is a bit messy flatwhatson: i'd recommend using (a . b), where b might be a list flatwhatson: if you are using match to destructure your pairs, it's easy enough to destructure a single-element list and treat it the same as a lone atom iskarian: Yes, that sounds good. As you suggest, in practice it's not really an issue, as you should know what structure you're receiving iskarian: thanks for the help :) flatwhatson: happy to! rlb: iskarian: Anything "dotted" isn't a "proper list", i.e. won't satisfy proper-list?. If what you're doing is fundamentally list related, then you'll likely want a proper list, i.e. one terminated by the empty list as in (cons 1 (cons 2 (cons 3 '()))), but "dotted pairs" are idiomatic for alist key value pairs. And (cons 1 2) is also one of the less expensive things most lisps, including I think guile, can do. rlb: iskarian: But dotted lists are also very common syntax for expressing variable length argument lists, etc. e.g. (define (foo x y . others) (list x y others)) rlb: s/very common/very common as/ iskarian: rlb, that syntax was part of what made it confusing, though after the explanation I can see how it makes sense :) apteryx: daviid: it's this procedure at the bottom of the (guix utils) module: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/utils.scm#n947 apteryx: if you have guix, it'll be exercised following 'guix package --list-installed' or 'guix package --list-available' apteryx: dsmith-work: Guix (it's some new code to align the columns of the tabularized 'guix package -A/-I' output) apteryx: rlb: yeah, improving format seems the way to go, although after enabling output buffering it brought it closer to Python performances. So Guile was about 5 s, Python 3 s, and the 'column -t' command about 2 s to format the 18000 something rows table. apteryx: (that's the current count of packages in Guix :-)) rlb: Oh, well yeah, I'd expect it might well be terrible if you're not buffering output to some reasonable extent (i.e. dominated by syscall overhead or similar). rlb: apteryx: Might not matter, but I'd also suggest maybe testing a larger setvbuf buffer size, say 4096, 8192, or 16384. I think the default's 1024? rlb: wingo: was looking at bugs https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39314 and I thought maybe that whole @deffn might be vestigial now? i.e. the @deffn including program-bindings to binding:end. rlb: Happy to handle that, but just wanted to make sure it was plausible. iskarian: is it possible (or advised) to fold with keyword arguments? leoprikler: wdym fold with keyword arguments? tohoyn: could somebody look at the error message I got when compiling a guile program with guild: https://paste.debian.net/1204564/ tohoyn: I use guile 3.0.7 (pulled recently) dsmith-work: Happy Friday, Guilers!! dsmith-work: sneek: botsnack sneek: :) dsmith-work: !uptime sneek: I've been running for 9 days sneek: This system has been up 2 weeks, 1 day, 2 hours, 42 minutes tohoyn: when I raise an exception of user-defined type theme-d-condition (a numerical overflow) it gets transformed in the following compound expression: https://paste.debian.net/1204593/ tohoyn: what is happening tohoyn: ? tohoyn: s/expression/exception/g tohoyn: I think I found the error zap: hey guilers! Looks like broke my config or something... When I set GUILE_LOAD_* variables they have top priority for %load-path right? zap: I'm in a werid situation when (getenv "GUILE_LOAD_PATH") one thing but %load-path other, and I dont run any script that might fiddle with %load-path -- just invoke guile binary zap: * shows one thing but %load-path the other leoprikler: %load-path also has Guile internals, so GUILE_LOAD_PATH should be a subset of it zap: leoprikler: ah yes. But Im interested in presedence GUILE_LOAD_PATH should be in front? leoprikler: doing a quick check GUILE_LOAD_PATH should be first zap: This is so weird dsmith-work: $ GUILE_LOAD_PATH=/FOO guile -c '(display %load-path)';echo dsmith-work: (/FOO /usr/local/share/guile/3.0 /usr/local/share/guile/site/3.0 /usr/local/share/guile/site /usr/local/share/guile) dsmith-work: Looks anything like that? dsmith-work: That's a no-extra-argument ./configure zap: dsmith-work: ha! yes and no; it work with guile but doesnt work with guile from guix source tree seems like guix doing something tricky ss2: hello! Can I ask anything related to geiser here? dsmith-work: ss2: You can, but there *is* a #geiser channel. ss2: it is very small, and am hoping to find more geiser users here. dsmith-work: ss2: As usual in IRC, it's better to ask than to ask to ask. ss2: okay, then: I've run into an issue, that when I copy text from the REPL, Emacs will go in to a read-only state: https://gitlab.com/emacs-geiser/geiser/-/issues/25 ss2: It'd be good to know if this can be confirmed. dsmith-work: I've never seen that. dsmith-work: But I'm using 26.1 emacs. dsmith-work: And geiser-guile 20210508.1838 ss2: That is from melpa, I assume? dsmith-work: Yes dsmith-work: And Guile 3.0.7 ss2: haven't thought about this yet. Will fetch an older Emacs and see how it is from there. dsmith-work: ss2: Did you try C-x C-q ? dsmith-work: Which is also M-x read-only-mode ss2: yes, but all buffers are read-only, making it basically unresponsive. dsmith-work: That has got to be very frustrating ss2: This only happens when I select text in the REPL, otherwise it everything is fine. dsmith-work: Hmm. What happens if select something in a different application? ss2: okay, installing Emacs in Debian, and pulling the rest over melpa doesn't show this problem. ss2: nothing, that works as usual. dsmith-work: So an emacs 27 thing. dsmith-work: Does that emacs do that Weyland stuff? Or is it X11 ? ss2: X11 dsmith-work: Very odd. I'd ask in #emacs ss2: oh, but this doesn't happen when I'm in a terminal! dsmith-work: Right, becuse the termial is doing the selection dsmith-work: And by "selection" I've been assuming you mean swiping with the mouse. ss2: what? no! :D ss2: I don't need a mouse in Emacs. dsmith-work: How are you making a selection. ss2: shift, arrow? ss2: hang on, gonna do the classic way with Mark set. dsmith-work: I usualy set the mark, move somewere, and then M-w dsmith-work: That loads the kill buffer/whatever it's called. dsmith-work: Ask in #emacs ! ss2: will do! Thanks for helping still. dsmith-work: I've got my exterm wired up backwards to use the cut-buffer instead of the selection. Makes copy-paste to/from windows easier. (gotta run Debian in a VM) ss2: and after all those years I finally taught urxvt to select and copy text with a keyboard. I do have some old habbits on me. So there's the part where I'd still select and copy with a mouse. leoprikler: zap: Guix source guile has to ensure you find the local packages, so… zap: leoprikler: in my case it does the opposite :) leoprikler: I think Guix source Guile adds its own stuff on top of whatever you have specified as GUILE_LOAD_PATH leoprikler: whereas usually it'd be GUILE_LOAD_PATH expanded on top of %load-path leoprikler: I think that's mostly a potato potato thing, but okay dsmith: dsmith-work: Poke apteryx: is there a way to parallelize fold in Guile? apteryx: another question! Is there a way to get the current-output-port terminal's width? daviid: apteryx: not exactly parallel fold, but see if you can use par-map instead daviid: note that it's only 'worth it' if proc is a long/costly operation ... as par-map itself has a cost ... apteryx: I see, thank you! apteryx: the algorithm records the lengths of words in a list of list apteryx: it's used for presenting tabulated data neatly apteryx: list of list are the table rows apteryx: list of lists* apteryx: it currently looks like this: https://paste.debian.net/1204411/ apteryx: here with profiling data (not just for that bit, but the whole application, but it's definitely on the hot path, raising total execution time from about 2 to 12 s) https://paste.debian.net/1204412/ apteryx: hmm, perhaps I'm reading that profiling data wrong, it's not clear that it's on the hot path from it. apteryx: Yet another question; how can I create a string that repeats "~a\t" for N times? apteryx: I came up with this: https://paste.debian.net/1204414/, although it feels a far cry from Python's number_of_columns * "~a\t" lampilelo: why do you need this format string? can't you write a function that will create a string from real data? flatwhatson: what about: (string-join (map display ls) "\t") flatwhatson: otherwise: (apply string-append (make-list n "~a\t")) chrislck: apteryx: you'll probably want to upgrade from map/make-list/length eventually as far as possible. consider (map fn1 (map fn2 lst)) gets slow if lst is large -- it creates intermediate list. better: (map (compose fn1 fn2) lst) apteryx: sneek: later tell lampilo the format string is used to pretty print table columns so they all appear aligned sneek: Got it. apteryx: flatwhatson: (apply string-append (make-list n "~a\t")) that's much better than what I had, thank you. apteryx: chrislck: the list of rows needs to be scanned at least twice; once to discover the maximum column widths, and a second time to print the rows apteryx: I've tried moving the drop-right into the fold kons, but it slowed by 1 sec in my tests. Strange. apteryx: I'm starting to think that simple, \t separated yet jagged columns are not that bad. It takes less screen real estate and works reliably with 'cut'. chrislck: (string-concatenate (make-list n "~a\t")) apteryx: even better! apteryx: thanks :-) chrislck: tip: building a long string via string-append and string-concatenate isn't that clever -- it allocates numerous strings, and needs to allocate a big string at the end. check the source for string-replace-substring in guile sources to see what wingo recommends :) apteryx: OK! chrislck: hint: (with-output-to-string (lambda () (let lp ((idx 100)) (unless (zero? idx) (display "a") (lp (1- idx)))))) *may* be surprisingly faster than (string-concatenate (make-list 100 "a"))... apteryx: interesting chrislck: ok maybe not: with-output-to-string with 4x10^6 elements does 1.813090s real time, 1.811567s run time. 0.000000s spent in GC. dsmith-work: Thursday Greetings, Guilers chrislck: whereas string-contatenate scores: 0.509411s real time, 0.562900s run time. 0.349726s spent in GC. chrislck: see, much more gc dsmith-work: apteryx: Looks like you are using format? Have you looked at ~{ ~} for iteration? RhodiumToad: how much of that GCing is attributable to make-list? apteryx: I've simplified it a bit, it now looks like: https://paste.debian.net/1204496/ apteryx: rows is a very long list (17000 entries about) of few items (4 columns) apteryx: the only costly operations (due to the large 'rows' list) should be: (map (cut drop-right <> 1) rows) as well as the fold, and finally the formatting of each row (the full list is iterated thrice). Interestingly moving the drop-right inside the fold doesn't improve things. RhodiumToad: thrice? RhodiumToad: oh I see RhodiumToad: that (map (cut drop-right ...) rows) seems like useless overhead RhodiumToad: why not just calculate all the column widths and leave the last one off? RhodiumToad: this function is doing a lot of consing apteryx: RhodiumToad: I tried computing column-widths for all column (including the last one), and simply using excluding the last column at the time of computing column-formats; this caused about 1.7 s extra to be used. Any optimization I try seem to make things worse, eh. apteryx: perhaps what I have is already close to the true cost of using format on a 17000 something list and can't be made much faster. RhodiumToad: bets? apteryx: hehe apteryx: I'd be happy to be proven otherwise :-) RhodiumToad: working on it *: apteryx is thrilled RhodiumToad: I assume the return value is not interesting? apteryx: it isn't! apteryx: (I'm now using for-each) RhodiumToad: the final (map) in your version is incorrect anyway RhodiumToad: interesting. for-each to repeatedly call format for each row is faster than using a ~:{...~} specifier within format itself apteryx: that's surprising apteryx: what was incorrect in the last map of my version? I fail to see it. RhodiumToad: should have been for-each or map-in-order, since you're relying on the side effect of (format) and not its result RhodiumToad: map doesn't guarantee order of evaluation RhodiumToad: do you care what happens if there are no columns? apteryx: I don't, as there wouldn't be anything to print daviid: if you only use "~a\t", you can use simple-format (and see if it is faster to,don'tknow) apteryx: it doesn't support padding I think (as in ~46a\t) apteryx: which in the manual is called the minwidth parameter RhodiumToad: meh. it looks like optimization is mostly moot since all the time is spent in the final (format) ss2: Hello! *: dsmith-work waves RhodiumToad: yeah. the actual (format #t ...) takes something like 95% of the runtime ss2: I just noticed, that when I copy a number from geiser to calc, Emacs will enter a ‘Text is read-only’ state. ss2: hangon, might try this again with emacs -q. :) ss2: yeah, it is the same there. Is this a bug? apteryx: RhodiumToad: ah! Thanks for checking :-) apteryx: perhaps an interesting read, related: https://bug-guile.gnu.narkive.com/Hd5JeB63/bug-12033-format-should-be-faster apteryx: Ludovic's findings there says (ice-9 format) is an order of magnitude slower than simple-format apteryx: and simple-format was fixed at that time to become 15% faster than 'display'. dsmith-work: I wonder if the recent optimizations for case/cond will improve (ice-9 format). Probably not. apteryx: not totally fair because I'm not starting the whole application and simply reading the data from a file before printing it, but with Python it takes ~3 s instead of ~6 s. apteryx: using the following script: https://paste.debian.net/1204513/ apteryx: doing '(setvbuf (current-output-port) 'block)' reduces the time to under 5 s with Guile :-) apteryx: or close to 5 s at least apteryx: I think it must be close to Python, factoring in the startup time of Guix itself. dsmith-work: apteryx: Guix or Guile? rlb: apteryx: if you know exactly what you want, and it isn't hard, I suppose you could just build the strings you want and use put-string, etc. -- see if that's faster. rlb: ...and if you know it's all ascii, could even do something more primitive and use put-bytevector, though I hope there's not too much difference there. rlb: Ideally, though (or also), we'll eventually improve format. ArneBab: wingo: did you see the GC + Java finalization question in the mailing list? daviid: apteryx: can you paste your guile script 'of the above python' as well daviid: i don't think it is possible to use schmutz without writing C/C++ code either leoprikler: yeah, but it's wrapper c++ ;) daviid: from my admittedly superficial look at this, the vigra_c approach seems cleaner (which is also what the opencv 2.x C wrapper did) - lookat this codeforexample https://github.com/BSeppke/vigra_c/blob/master/src/vigra_imgproc_c.cxx, line 72+ ... tohoyn: it seems that guile doesn't generate xxx-3.0 links anymore. why is this so? tohoyn: I just pulled the main branch and installed it3 rlb: If you mean PREFIX/bin/guile-3.0, etc. you may want ./configure ... --program-suffix=-3.0 tohoyn: rlb: what if I want both "guile" and "guile-3.0" tohoyn: rlb: maybe guile-3.0 is enough tohoyn: rlb: if you have several versions of guile installed you need both guile and guile-VERSION tohoyn: I get following warning when I try to compile a guile program with guild: WARNING: (#{ g103}#): imported module (rnrs) overrides core binding `display' tohoyn: here is the program giving the warning: https://paste.debian.net/1204313/ Guest2263: apteryx: gnucash still uses swig to expose C API to guile and python Guest2263: apteryx_ ^ tohoyn: I got the following message when building Theme-D: /sbin/ldconfig.real: /usr/local/lib/libguile-3.0.so.1.4.0-gdb.scm is not an ELF file - it has the wrong magic bytes at the start. tohoyn: the build uses guile 2.2 dsmith: sneek: later tell tohoyn Those "wrong magic" messages are from the system dynamic linker. Annoying, but can be ignored. (it expects only ELF files in */lib/) sneek: Got it. dsmith: rlb: There is already a special case from some other non-ELF type. Think there is any chance of Debian making another exception for *-gdb.scm files? dsmith: Probably needs to be upstream I guess. rlb: dsmith-work: not sure - would need to investigate. apteryx: any idea if libguile should be usable on iOS? dsmith-work: Hey Hi Howdy, Guilers dsmith-work: In glibc, elf/readlib.c around line 168. There is an exception for Python files. tohoyn: sneek: botsnack sneek: tohoyn, you have 1 message! sneek: tohoyn, dsmith says: Those "wrong magic" messages are from the system dynamic linker. Annoying, but can be ignored. (it expects only ELF files in */lib/) sneek: :) apteryx: chrislck: thanks! old: Hey! As anyone have tried to compile libguile for iOS? old: I asked the question on the user mailing list without much answer. Was wondering if someone here could have more to say apteryx: old: fun, I asked the question a bit earlier here :-) I think it's a rare thing to try, eh. apteryx: another question: can Guile be built statically? I get 'ld: script.c:(.text+0x3c2): undefined reference to `rpl_free' apteryx: passing LDFLAGS=-static to configure seems to help lampilelo: i think the default is to build both shared and static libraries apteryx: perhaps something to do with my environment, thanks dsmith-work: For iOS devlopment, do you need a mac along with a paid develper account? dsmith-work: Can someome mention my nick in a few seconds? Trying out some notificaitons.. lfam: Hello dsmith-work dsmith-work: Bah dsmith-work: Again please? lfam: Okay dsmith-work dsmith-work: lfam: Thanks! lfam: Cheers dsmith: Just got my new "Programming Rust" today! And who do I see quoted on Page 1? Andy Wingo! dsmith: (also one of the authors, Jim Blandy, was an early Guile developer) sneek: Cool *: RhodiumToad prefers his software to be corrosion-free dsmith: heh dsmith: I think it's supposed to be something like ice-9. It covers everything. pkill9: lol flatwhatson: someone mentioned "typed guile" earlier, is that "theme-D" or something else? flatwhatson: it would be amazing to have something like this: https://lisp-journey.gitlab.io/blog/compile-time-type-checking-in-common-lisp/ drakonis: oh i have yes. drakonis: i meant it as a vehicle to enable guile to evolve some interesting new tricks apteryx: trying a relocatable guix pack of guile on armhf-linux: error: 'clone' failed: Invalid argument\nguile: run.c:123: rm_rf: Unexpected error: Device or resource busy.\nAborted apteryx: hmm. seems it's a proot problem. it works when not using the relocatable bits. apteryx: not sure, it works on another system. Perhaps the kernel config (buildroot-based) is too bare-bone. tohoyn: sneek: botsnack sneek: :) tohoyn: flatwatson: see http://tohoyn.fi/theme-d/index.html for Theme-D. It's a "typed Scheme". sarna: hey, suppose I wanted to share my program with someone, and I'd like them to be able to run it with as little friction as possible. they shouldn't have to have guile installed, and ideally they wouldn't need to know the software is in guile sarna: how would I go about making such a package? sarna: I think guile doesn't support static linking or anything like that ft: Guile doesn't do native compilation, so the program is required for running code, even if it is byte compiled. sarna: can I package it somehow? `guix pack` comes to mind, but I don't know if it's not too heavy-handed ft: Classic distributions can solve that, by having your package depend on Guile. And then there are approaches such as guix pack, flatpak and the like. tohoyn: Should guile be able to do native compilation? I think it could be useful. sarna: I like dynamic languages, but they're such a pain when I need to send my stuff to somebody else :( ft: I think wingo has plans in that direction, but it sounds like quite the undertaking. :) wingo: plans, yeah, but time is constrained atm :) ft: Speak of the devil. :) sarna: I'll try with `guix pack` and we'll see how it goes, thanks! lampilelo: you can make a simple main.c file that loads scheme code, and compile it, statically linking against libguile, you'd have to install the binary with all the guile modules it uses, preferably precompiled, and set the load paths correctly lampilelo: i've never done it but theoretically it should work lampilelo: and remember: if you distribute binaries linked against guile you need to include the license and some way to get the source code of your program lampilelo: sarna: ^ lampilelo: i'd probably stick to "guix pack" though sarna: lampilelo: oh no I forgot it's GPL! then it's gonna be a pain, hahaha sarna: thanks for the tips lampilelo: yeah, it's LGPL but statically linking or distributing it with your program will mean you'll need to use a compatible license lampilelo: s/but/so/ sarna: can't do that at work, sadly rlb: sarna: if you really needed to, you could also likely install guile to a --prefix, and then distribute that along with your code, and your program (#! script or compiled C) would just set the appropriate PATH, GUILE_LOAD_PATH, and LD_LIBRARY_PATH. But of course it'd be somewhat platform specific unless you statically linked guile (do we support that easily?). rlb: i.e. guile itself would be dynamically linked to the built-system's libs, and so would require compatible versions wherever you ran it. rlb: Oh, I think that's similar to what lampilelo was suggesting. And might have been clear, but as lampilelo also suggested, the source distribution requirements vary depending on whether static or dynamic linking is used. lampilelo: yes, but if you distribute guile along with your software LGPL applies to that too, doesn't matter if you link it dynamically leoprikler: does it though? lampilelo: https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic leoprikler: doesn't the LGPL make a clear difference between changing guile itself (must be LGPL) and building stuff on top (can be anything) leoprikler: this doesn't say anything about licensing tho rlb: Interesting, I wasn't familiar with (1) there. rlb: i.e. that a foo.o might be adequate wrt the license terms. leoprikler: I think this refers to the point 4d of the LGPL (v3) leoprikler: Hmm, this does state that the Minimal Corresponding Source must be conveyed under LGPL terms though leoprikler: which means the things that you need to link things together plus the original library, I guess lampilelo: so it means not all of your code needs to be under LGPL, but only the part that's needed to link dsmith-work: Hmm. Is it still possible to statically link guile with all dep libs? lampilelo: then i was wrong, also this faq states that if you distribute lgpl'ed software with your own, you need to provide the source for lgpl'ed stuff only lampilelo: hm sarna: so can I link it into one binary and include "built using guile which uses LGPL, grab the source at $WEBSITE" and it'll be okay? sarna: the source for guile of course sarna: oh, I'd need to include links to all libraries I use that are GPL.. hrm. apteryx: does Guile fall-back to no JIT on platforms it isn't supported? Or must it be built with --enable-jit=no on those? leoprikler: sarna if you link to GPL libs, you need to distribute your entire program under the GPL anyway leoprikler: if it's just LGPL, listing them and making sure you can link against modified versions is enough dsmith-work: apteryx: Yeah, at configure time, JIT_AVAILABLE defaults to "no" unless arm/x86. apteryx: dsmith-work: thanks! apteryx: any real life example using Swig to generate C/C++ Guile bindings? dsmith-work: swig? is that still maintained for Guile? lampilelo: i don't know if it's still maintained but works with guile 3 no problem sarna: thanks leoprikler! I have no experience dealing with that stuff so it helps a lot lampilelo: although it created functions for enum values instead of variables dsmith-work: Wrapping C stuff directly (SMOBS) is not all that hard. dsmith-work: But the current trend is to use Guile's FFI for that stuff. lampilelo: for big interfaces it's a pain lampilelo: there's also nyacc, it generates ffi in scheme instead of making a c module dsmith-work: There have been a few others too. dsmith-work: nyacc parses header files? Needed for #define's lampilelo: i think so lampilelo: i know it broke for me when tried to parse the header file that included math.h, i don't think it's documented yet but there's a certain thing you need to put in your nyacc instructions for it to work with cstd files lampilelo: so i guess it recurses leoprikler: nyacc is in a weird spot where it does both too much and too little at the same time drakonis: rewrite it in guile? leoprikler: nyacc is already written in Guile tho? leoprikler: Or do you mean the C thingy drakonis: the guile thingy drakonis: C thingy leoprikler: that's not always an option leoprikler: think of moderately large stuff like SDL or even bigger stuff like GTK leoprikler: (GTK really is an outlier here as there's at least two implementations of GObject Introspection in Guile, but still) dsmith-work: There is also g-wrap dsmith-work: Mainly for guile-gnome leoprikler: okay but g-wrap tried to be a more general c wrapper like nyacc, no? dsmith-work: Yeah, I think it tried to be general. dsmith-work: Looks like hasn't been touched in a while. daviid: not sure who asked what wrt g-wrap, but I'd recommend not to use it anymore, because it was designed at a time wedidin'thave dynamic ffi ... it produces/generates C (libguile) code ... and afaict,is unmaintained daviid: one should use nyacc, if the objective is to bind a C library that is not GObject Introspectable, then do some 'manual' tuning where necessary, but nyacc does an amazing job, at least to get you started (I'd say much more then 'get you started' ... but ...) daviid: but nor g-wrap neither nyacc will help if the lib is in C++ leoprikler: True, C++ is a different beast. leoprikler: I think Schmutz helps you with that, but it's kinda like manually doing libguile stuff in C. leoprikler: but if you C++ thingy has C bindings, you could nyacc those daviid: my 'distant' experience wrt C++ lib, like vigra (used by guile-cv) is that someone first write a C wrapper, vigra_c in this particular case, that merely wrap the C++ function in a C function that calls the C++ func, deals with the exception and return a code (sortof) daviid: openCV 2.x did that to,then they abandonned (too much work i guess) the C API in 3.x ... daviid: fwiw, here https://github.com/BSeppke/vigra_c daviid: the author of vigra_c did that to be able to bind vigrafor racket, called it vigracket :), and that was my luck because i wouldn't want to do that wrapper myself, but if/when we conewith some magic, i'd use openCV in guile-cv ... leoprikler: yeah, if you don't like writing wrapper C, you'll be left with schmutz rlb: What's the "main" python dialect project right now? sarna: can one extend match somehow in guile? something like https://docs.racket-lang.org/reference/match.html#%28form._%28%28lib._racket%2Fmatch..rkt%29._define-match-expander%29%29 in racket leoprikler: sarna: not simply… you can write your own match, but basically everything else will need to be handled in terms of ? sarna: leoprikler: got it, thanks sarna: also, is it just me or is guile really fast at loading code? in racket every import came with a startup time penalty, in guile everything's stable no matter how much stuff I import leoprikler: I think there are some noticeable delays with particularly big things like Guix, but subjectively it feels quite fast too. sarna: guix executes in 0.144s for me, that's reasonably fast for a huge chunk of code sarna: meanwhile loading racket alone (not racket/base) and printing "hello" takes 0.304s leoprikler: Overall Guile's performance is somewhere in the middle leoprikler: there are both faster and slower Schemes sarna: yeah, just talking about load/startup times here sarna: which ones are the fast ones now, by the way? chez and gambit? leoprikler: Gambit, Chez, Cyclone, MIT, Guile leoprikler: We're number five, baybee leoprikler: And we're dominating chudnovsky and pi :) sarna: are you talking about https://ecraven.github.io/r7rs-benchmarks/ ? sarna: last run was on guile 3.0.4 :^) ecraven: I hope to finally do a new run soon :-/ sarna: talk about devil! :D lloda: you can use array-cell-ref or array-slice on any axes by using transpose-array on the arguments lloda: but i stopped trying to build on make-shared-array bc it's not a good interface lloda: why call an arbitrary function to find some affine transform coefficents? it's easier/safer/faster to give the coefficients directly RhodiumToad: eh... not sure RhodiumToad: some of the things I've done with make-shared-array would not have been easy as just coefficients jlicht: does guile have something similar to python generators? lloda: you can have some function that computes the coefficients for you, for some specific use lloda: that's probably what you do with make-shared-array anyway, bc it's so cumbersome at point of use dsmith-work: Monday Greetings, Guilers lampilelo: jlicht: you can create a closure that will store some state, e.g. (define (make-iter) (let ((num -1)) (lambda () (set! num (1+ num)) num))), or if you need something that behaves like a list, use streams from srfi-41 jlicht: lampilelo: that is what I did now, but after looking at my ugly code I suddenly realised this is basically what generators could/(should?) be used for. dsmith-work: !uptime sneek: I've been running for 5 days sneek: This system has been up 1 week, 4 days, 4 hours, 33 minutes Noisytoot: !uptime vijaymarupudi: jlicht: You can use delimited continuations to have generators similar to python vijaymarupudi: the function creating the generated would need to call reset, and the function yielding needs to call shift jlicht: vijaymarupudi: thanks! vijaymarupudi: jlicht: thinking about it, I think it would be easier to use % and abort from ice-9 control instead, abort is pretty much yield, and % is pretty much next() (as in python) jlicht: vijaymarupudi: already got all the toys I need now :-) RhodiumToad: I think for generator-type stuff you want shift/reset and not %/abort RhodiumToad: the details of where the prompt is re-established matter marusich: Does "map" guarantee stability of the list order, even though it does not guarantee the order in which the procedure is applied? marusich: The guile docs didn't say. RhodiumToad: the result list matches the order of the input, yes marusich: That makes sense. I also see that R5RS says as much on page 32: "(map proc list 1 list 2 . . . ) / library procedure / The lists must be lists, and proc must be a procedure taking as many arguments as there are lists and returning a single value. If more than one list is given, then they must all be the same length. Map applies proc element-wise to the elements of the lists and returns a list of the results, in order. The dynamic order in which marusich: proc is applied to the elements of the lists is unspecified." RhodiumToad: put another way, (map (lambda (e) (pk (1+ e))) '(1 2 3)) is guaranteed to return (2 3 4), but it will also print out three diagnostic messages in some unspecified order marusich: Right, that makes sense. chrislck: marusich: map-in-order offers such guarantee marusich: I did see that. Thanks for mentioning it. My hang-up was the fact that the stability was not explicitly mentioned in the Guile manual, but R5RS and common sense says it's so. RhodiumToad: map guarantees the correspondence between input and output sequences but not the order of procedure calls; map-in-order guarantees both RhodiumToad: the difference should only matter if the procedure has side effects chrislck: and par-map is even worse in ordering of procedure calls :) RhodiumToad: presumably that doesn't even guarantee that executions of the procedure are not overlapped? :-) leoprikler: Is there some Guile function to iterate over differently-sized arrays? leoprikler: I have a 3x3 matrix and a 3x1 vector, that I want to put together into a 3x4 matrix RhodiumToad: you could do it with array-index-map, but maybe would be better using array-copy! and shared arrays RhodiumToad: yeah, it works with shared arrays RhodiumToad: basic idea is: create the result array with make-array, then array-copy! into appropriate regions of it defined using make-shared-array leoprikler: hmm, that's an interesting idea leoprikler: I've used array slices plus match-let, because the indexing was the important thing for me, but for memcpy-like behaviour obviously your solution is the better one leoprikler: quick question though, would this also work with array-cell-ref instead of make-shared-array? leoprikler: I suppose make-shared-array is more generic, but it's also a pain to write oftentimes ^^" RhodiumToad: array-slice is more limited in what it can do, it can only fix the values of an initial subset of indices RhodiumToad: sometimes that's enough RhodiumToad: whether it's enough for you depends on the shape of your input arrays drakonis: hmm, how do you detect a language for guile to use on runtime? ft: you mean (current-language)? ft: But for that you kind of need to know the language already. :) leoprikler: drakonis: Is this about selecting a language for a file or about knowing which language is currently used? ft: Doesn't seem like ‘current-language’ is bound in elisp mode in any case. So it wouldn't even help with syntactically similar languages. leoprikler: bummer :( jlicht: How can I use srfi-1's `remove', instead of the 'default' `remove'? rlb: There's a default remove? rlb: Regardless, you'd typically just add a "#:use-modules ((srfi srfi-1) #:select (remove))" or "#:use-modules (srfi srfi-1)" (if you want everything) to your define-module form. jlicht: rlb: no, there is not XD. I got very confused somehow, but your snippet still helped. Thanks! rlb: certainly. jlicht: any Scheme-ish resource on how to compute all possible distinct covering partitions of a list? jlicht: (of a fixed size) jlicht: so e.g. (my-cover '(1 2 3 4) #:size 2) ; => '(((1 2) (3 4)) ((1 3) (2 4)) ((1 4) (2 3))) RhodiumToad: the 2 refers to the size of each partition element? jlicht: RhodiumToad: exactly jlicht: I know how to get all combinations, but not 'grouped' by them covering the entire original list drakonis: leoprikler: selection rlb: wingo: I pushed the #nil syntax fix to main after a bit more testing. I thought we were keeping main and master in sync, but it looks like they're not right now, so I didn't push to the latter. rlb: s/push to/update/ jlicht: Is this about lokke? rlb: Sorta? lokke was how I noticed the problem, but I think it was a more general issue. There's a simple test in the commit: https://git.savannah.gnu.org/cgit/guile.git/commit/?id=d79a226359d28f4a1dc5df136e5544d699903a96 drakonis: lokke? rlb: That should fix lokke wrt 3.0.7, but it's still broken for main due to some issue I haven't figured out wrt cross-module inlining. rlb: https://git.sr.ht/~rlb/lokke/ (also on gh) drakonis: ooo nice rlb: Well... fsvo "nice" :) It's still not remotely industrial strength. *: rlb is working on defprotocol/defrecord at the moment drakonis: hmm, why clojure instead of clisp? drakonis: clojure lives and dies by its java interop rlb: I might break out the new edn parser if I have time, and it seems like something people might want -- the clj side is based on an intentionally scheme friendly module underneath (i.e. collection types returned are configurable, returns scheme-only structures as-is). drakonis: hm rlb: drakonis: I could imagine any number of possible motivations. For me, because I like guile, direct posix-ish access, and clojure :) drakonis: i see drakonis: a clojure that can be embedded i see rlb: (i.e. I've quite enjoyed the collection interfaces, persistent data structures, some of the concurrency handling, etc.) drakonis: not having to deal with java for anything seems like a good idea though rlb: drakonis: it's a pretty tight integration right now - you can write modules in either scheme or clj, etc. rlb: And it's faster startup than clj/jvm fwiw (though it's not as much faster as it would have been -- clj/jvm's been getting better). rlb: But you're absolutely right -- has nothing remotely comparable to the jvm ecosystem, e.g. java.util.concurrent, etc. rlb: atm drakonis: this is interesting though rlb: (otoh, it's "easy" to extend via C) drakonis: yes drakonis: that's an advantage drakonis: it is a fine way to pull in developers into the guile ecosystem rlb: ...I'd assume the scheme-based namespaces will generally be somewhat faster than the clj based namespaces right now (in part why I've written so much of it in scheme -- that and define-syntax), because they don't have the universal "invoke" trampoline insinuated during compilation. No idea atm how much that costs. drakonis: i don't think i quite grasp the difficulty of a building a clojure dialect rlb: Anyway, feel free to badger me on #lokke about any details if you like. drakonis: cool rlb: The syntax issue is why the macos tests are broken atm -- because brew's already moved to 3.0.7. rlb: fwiw drakonis: aint no mac user here drakonis: am a guix user drakonis: there's no other way to drive adoption without something cool drakonis: i'm curious however, guile is capable of being used for writing langs, yet it doesn't quite present itself in a manner that takes advantage of that rlb: drakonis: that was one of guile's founding principles, i.e. to support multiple languages on the same platform. One related bit https://www.gnu.org/software/guile/manual/html_node/Compiling-to-the-Virtual-Machine.html In particular, "Compiler Tower". drakonis: it doesn't present that the way racket does drakonis: it definitely needs more of that lang written with guile chutzpah first rlb: There are also likely some rough edges -- I don't think languages other than scheme have seen all that much heavy use, so far. drakonis: indeed drakonis: it needs more langs for solving specific problems though rlb: When I get time, I'd like to see if I can fix up the repl modules to be more language agnostic. For lokke I had to just copy-paste some of the code and make adjustments, and it still doesn't preserve the clj printer in an error prompt (reverts to scheme's). rlb: For that I *think* we'll probably need to teach the repl functions to pay attention to the custom printer "all the way though", but I haven't really delved yet. drakonis: also fix up guile to have an easier time loading languages drakonis: switching between them, as well rlb: Yeah, I hit some bits wrt the language spec and environment handling that I still don't fully understand, but "got something to work". drakonis: in the same file, as that's an racket thing that mildly annoys me drakonis: rather, i think it is doable already drakonis: but its not well supported by the other existing langs yet rlb: One thing I'll probably eventually need *if* I pursue more complete clj support is some solid thread-pool infrastructure. Figured I might see if I can do that in a way that's more broadly useful, but we'll see. drakonis: native fibers implementation that's shipped with guile? rlb: i.e. maybe just see about abstracting the existing future pool so that it can be re-used. drakonis: or just something else? drakonis: that could be useful for guix rlb: Hmm - I forgot about that (guile fibers). Have heard people mention it, but hadn't remembered to look. drakonis: it implements concurrent ml features drakonis: also a way out there project rlb: *very* interesting - wonder if that might be able to support core.async. drakonis: typed guile drakonis: lol rlb: (wrt core.async https://clojure.org/news/2013/06/28/clojure-clore-async-channels ) drakonis: i've heard about that rlb: I've found it very useful, but also sometimes a bit tricky. rlb: It's not on my short list :) drakonis: it has some adoption weirdness leoprikler: oh, by the way, I found the life hack for working out the byte length of a string in scheme leoprikler: here it comes: just convert it to a bytevector :) rlb: leoprikler: oh, right -- I'd originally thought you needed a (fast) offset length, without necessarily converting the entire string. leoprikler: tbf the less allocation the better, but it seems like even with the APIs I'm using you can't get around allocating anyway leoprikler: not easily at least leoprikler: I could theoretically rip out some internals if I needed them for performance sake, but it works fine so far rlb: Right, you could write a pretty "simple" loop/switch over the relevant chars to compute the length yourself in either scheme or C -- iirc the utf-8 encoding rules aren't too bad. rlb: (if it mattered) iskarian: Is there a way to have an optional (part of a) pattern in an ice-9 match? iskarian: Or do you just write a new branch? flatwhatson: iskarian: do you have an example of what you're trying to achieve? iskarian: flatwhatson, I want to match something like ('replace ('path path) ('version version) '=> ('path new-path)), where ('version version) may or may not be present iskarian: Ideally I'd like to provide a default value for version if it is not there flatwhatson: iskarian: have you considered just using a function with optional arguments? flatwhatson: iskarian: you can use "or" and "..." to represent some kinds of optional patterns flatwhatson: this works: ('replace ('path path) ('version version) ... '=> ('path new-path)) flatwhatson: if you're happy to receive version as a list, and have a loophole that multiple versions could be provided! flatwhatson: i can't work out how to do "zero or one" instead of "zero or more" though iskarian: you're brilliant! I didn't even think of just passing off to a fn with optional arguments iskarian: ah, it's fine if it can technically take more, since the parser feeding this only accepts one anyway flatwhatson: yeah keyword arguments might be a bit more straightforward if you're in control of the syntax iskarian: this though... this is why I find match syntax absolutely impenetrable: ('replace ('path path) ('version version) ... '=> ('path new-path)) iskarian: how does the ... make the previous pattern optional? flatwhatson: ... is like regex *, zero or more matches of the previous rule iskarian: Ahhhhh flatwhatson: implicitly promoting all of the affected bindings to lists iskarian: okay, that makes sense. My best approach before asking was ('replace spec ... '=> ('path new-path)) and then using assoc-ref or such to pull apart spec later. I had no idea why the ellipsis worked though! sarna: "the implementation of continuations in Guile is not as efficient as one might hope, because Guile is designed to cooperate with programs written in other languages" - is that true only for call/cc, or for delimited continuations too? civodul: sarna: wingo would know better, but i think that applies to call/cc civodul: there cannot be C stack frames in the middle of a delimited continuation taw10: That was my interpretation of that part of the manual as well. Two paragraphs later it explicitly says to use prompts instead where possible taw10: call/cc inefficiency doesn't only apply to Guile. It's overkill for most things in any Scheme implementation (see e.g. http://okmij.org/ftp/continuations/against-callcc.html) civodul: yeah, call/cc is not very useful sarna: I see, thanks civodul sarna: IIRC only chicken has fast call/cc because of the way their VM works dsmith: sarna: There are some call/cc implementations that are *very* efficient. Like if your call frames are heap allocated lists. A call/cc is just pointing to a different list. Not compatible with C, however. dsmith-work: Happy Friday, Guilers!! vijaymarupudi: Happy Friday to you too :) sarna: dsmith: not compatible with C FFI you mean? dsmith-work: sarna: Yeah, C->Scheme->C or Scheme->C->Scheme. dsmith-work: sarna: Often it's copying around the processor stack. ArneBab: dsmith-work: wasn’t the problem of call/cc that it is more powerful than expressive, so it doesn’t actually reduce complexity? sarna: dsmith-work: got it, thanks ArneBab: And that it does not match the requirements of hardware, so it forces slowpaths? dsmith-work: ArneBab: Yeah, there is that too. dsmith-work: I've never used call/cc much (becase the thought of copying whole stacks back and forth just makes me shudder) ArneBab: dsmith-work: yes … daviid: yes, grab an msys2 image, the latest of course, then launch/run it, in it (a terminal) run a few pacman commands to update it to the very latest, then use pacman to install guile, autoconf, automake, ssh ... what evert you need, then i cloned guile-cv and compiled install, then yes, just grab the window's dir (big, but ok ...) and send it ... leoprikler: i think you mean "use pacman to install autoconf, automake, then install guile from source" ;) leoprikler: at least for guile3, that is leoprikler: and especially for guile-3.0-latest daviid: i use guile 2on msys2 leoprikler: come to think of it, could we do msys2 as a guix pack target? daviid: leoprikler: at the time, guile-3.0 didn't even exist, and guile-cv runs fine with 2.2 ... but i think if one email the msys2 guile packages mainainter, they might easily get guile-3.0 (not me, at least not 'now' ... but my intuition is that it should be easy forthe maintainer ...) morganw: From what I had read it last I don't think it would build, and there was a suggestion that it might be possible to get it working again without threading support and 32-bit only. daviid: morganw: don't confusewindow 'native' guile compilationand msys2, mingw-64, that hasnothing todowith one another... leoprikler: the 2.2.7 PKGBUILD has --with-threads though daviid: yes,nsys2 is 64bits,threads... morganw: aren't msys2 ports built with mingw ? leoprikler: it's a mingw/cygwin hybrid of sorts daviid: morganw: look/read the msys2 homepage, thewiki ... it has everything you need toknow leoprikler: though iiuc cygwin does have guile-3.0-latest leoprikler: but SDL2 has been stale for 3.5 years now leoprikler: otoh msys seems to not even have sdl2, so… daviid: leoprikler: https://packages.msys2.org/search?q=sdl2 leoprikler: oh, right, mingw exists daviid: msys2 is based on mingw-w64 ... leoprikler: yeah, but the way packages are partitioned is a bit weird leoprikler: I was looking in the github repo if that helps understanding :) daviid: it even has gtk4 4.2.0 (debian only has 4.0.3) :) daviid: and GI, so g-golf will also run on msys2 ... daviid: the msys2 folks are extremely nice as well, i had (back then) to ask for help, #msys2 on oftc fwiw ... dsmith: A special thanks to those brave souls who labor tirelessly to bring free software to those under the oppression and tryanny of M$ sarna: "Guile only adopted with-exception-handler and raise-exception as its primary exception-handling facility in 2019." - how much of real-life code uses exceptions instead of the legacy stuff? leoprikler: Guix uses exceptions throughout IIRC sarna: that's useful, thanks dsmith-work: Morning Greetings, Guilers apteryx: FTR I wasn't able to test guile on Android because my Android is not root, and the Guix relocation option for aarch64-linux is not currently usable due to proot-static failing to build on that platform civodul: apteryx: hi! maybe you can skip proot tests to see how it goes? *: apteryx tries apteryx: hm, it fails during the build phase, not the check phase Guest7431: sneek: botsnack sneek: :) sarna: btw, guile runs fine on iOS with iSH :^) sarna: it's emulating i686 linux, so it's not the fastest - but it works civodul: apteryx: bah :-/ civodul: apteryx: you could also hack around to remove the proot "engine", so that you can at least try the "fakechroot" engine apteryx: sarna: good to know! We should compile a list of these hacks somewhere, so that someone can have an overview of the Guile cross-platform picture. apteryx: seems proot should support aarch64, at least in the changelog of the previous version (v4) there were mentions of it, such as "Fix build for AArch64." (c.f.: https://github.com/proot-me/proot/blob/8c0ccf7db18b5d5ca2f47e1afba7897fb1bb39c0/doc/proot/changelog.rst). apteryx: I'll try building that previous version civodul: apteryx: another option would be to allow -RR without the "proot" engine civodul: kinda boring, but doable apteryx: v4.0.3 could be built for aarch64-linux apteryx: so it's a regression apteryx: I'll open an issue on the project's tracker civodul: great apteryx: for the record I used: guix build proot --with-git-url=proot=https://github.com/proot-me/proot --with-commit=proot=v4.0.3 --without-tests=proot --system=aarch64-linux to validate this (I had to make a minor change to the package def so its test suite would be skipped) apteryx: transformation options are really handy! iwan: how can I run subset of guile tests? e.g. elisp.test civodul: apteryx: neat :-) civodul: iwan: you can run: ./check-guile elisp.test iwan: thanks dsmith: !uptime sneek: I've been running for 38 seconds sneek: This system has been up 5 days, 9 hours, 39 minutes rlb: (Oh, I also needed "-shared" on not macos, and "-bundle -undefined dynamic_lookup" on macos, apparently.) sarna: leoprikler: I can just as well run `ls` from shell instead of `find-files` from guile, right? sarna: it's not like the files will disappear in the meantime.. sarna: leoprikler: I noticed that hall is capable of creating guix files, so I just nuked `guix.scm` and let hall generate it - now it works! leoprikler: sarna: ls won't give you the full tree, but yes leoprikler: also IIRC hall expects you to regenerate everything if stuff changed, so yeah, that's probably expected sarna: oh, so I don't need to modify these files at all? that's neat, TIL! sarna: thanks :)) leoprikler: sarna: au contraire, since they're machine-generated, changes you add to them will be lost! sarna: leoprikler: that actually happened! and I typed them out again 🙈 sarna: I'm not the sharpest tool in the shed leoprikler: you could (package (inherit (load "guix.scm")) ...) if you're really cheeky :P leoprikler: is there a way of composing procedures with setter? leoprikler: e.g. (set! ((compose bar foo) spam) value) -> (set-bar! (foo spam) value) sarna: is there a complement function in guile? I mean something that'd roughly do `(lambda (func) (not (func)))` flatwhatson: sarna: yes, negate sarna: flatwhatson: thanks! sarna: are there any utility functions for paths? right now I'm appending strings, and that doesn't feel very solid :( I haven't been able to find anything in the guide flatwhatson: not that I know of! you have string-append, string-join, and file-name-separator-string if you're concerned about portability flatwhatson: from what i've seen in guix, using string manipulation for paths is perfectly normal sarna: I see. thanks again :) leoprikler: for the record, there are several libaries doing path strings (one written by yours truly), but it kinda seems Guile folks prefer doing string manip leoprikler: hum, can we do mv-respecting setters? lampilelo: it would be nice to have maybe an ice-9 module for paths, also realpath would be cool dsmith-work: Hey Hi Howdy, Guilers leoprikler: isn't realpath canonicalize-path? RhodiumToad: not all realpath implementations return an absolute path in all cases, apparently RhodiumToad: though the spec for realpath() does seem to require it RhodiumToad: otherwise, yes, canonicalize-path is documented as doing what realpath does lampilelo: ah, right, i always forget about canonicalize-path, always searching for realpath in the docs and not finding it apteryx: is it possible to run Guile on Android? apteryx: perhaps as a Guix pack? drakonis: hmm, use something like userland or termux drakonis: it is theoretically possible apteryx: 'pkg search guile' in termux returns no result drakonis: termux is based on a subset of debian's packages drakonis: you'd need to use something like userland instead drakonis: which provides a whole distro lampilelo: apteryx: maybe it's possible with this: https://developer.android.com/ndk/guides lampilelo: if you manage to do it, please tell me, i've been thinking about trying it myself but never got to it dsmith-work: sneek: botsnack sneek: :) *: apteryx installs UserLAnd from F-Droid apteryx: seems arch and debian/ubuntu would have only guile 2.2, at least in their default repo *: apteryx tries 'guix pack --target=aarch64-linux guile -S /bin/guile=bin/guile' morganw: I think it is now split in packaging between guile-3.0 and guile-2.2, at least in Debian 11. leoprikler: debian has the super new 3.0.5 in unstable IIRC :) daviid: it is in testing even... civodul: apteryx: *aarch64-linux-gnu :-) daviid: apteryx: fwiw https://packages.debian.org/search?keywords=guile-3.0&searchon=names&suite=all§ion=all morganw: Would anyone happen to know what the status is for building with msys2? daviid: morganw: https://packages.msys2.org/search?t=binpkg&q=guile morganw: Oh, I meant the current version, but thanks for the link I didn't realise it was available as a package. morganw: From the mailing list (~2020) it seemed that building version 3 wasn't easily doable on Windows. daviid: morganw: windows is 'another story', msys2 current version is 2.2.7-1 apteryx: OK, so for a "multi-platform" application, Guile is currently at 2.2 (thanks to windows) apteryx: but could get by with WSL perhaps? which is the Ubuntu's runtime, IIUC. apteryx: has someone managed to run Guile on WSL (the Linux-ABI compatibility layer for Windows thing)? morganw: I'm interested in distributing a working program (or extending an existing one with scripting) so I can't really assume the WSL bits are setup. It also causes conflicts with default configurations for Docker and Hyper-V. drakonis: wsl2 is the better option but it is just linux in a vm daviid: fwiw, imo if you don't need a 'native' version on win, msys2 might be a much better choice, for various reasons, one is that you can prepare everything, then send a 'complete' msys2 image, and that's it leoprikler: so packaging my software for msys will be as easy as it is to package it for arch? :) daviid: leoprikler: i didn't pkg anything myself, i prepare(d) an msys2 image with guile, guile-cv (using the autotools, so dead easy), other guile scripts, then cp the image on a usb key and sent it to the 'customer' ... that'sit leoprikler: hmm, so lemme see if I understand this correctly leoprikler: you start with some msys2 build, then compile+install guile, compile+install guile-cv and finally tar+gz everything into one big shiny ball leoprikler: with "compile+install" being your typical "autoreconf -vif"..."make install" chain, right? sarna: thanks all! :) sarna: does anyone here use guile-hall? I'm having some trouble generating a package.. it complains with `configure: error: 'guild' binary not found; please check your guile-2.x installation.` sarna: I have guile 3 :( leoprikler: you might want to check the configure.ac whether it mentions guile 3.0 and patch it if it doesn't leoprikler: hmm… GUILE_PKG([3.0 2.2 2.0]) lampilelo: sarna: maybe you have a version of guile-hall that's linked to guile-2.2 and it wants to use that? i don't know how guile-hall works, never used it, just throwing hypotheticals lampilelo: maybe this will help? https://gitlab.com/a-sassmannshausen/guile-hall/-/issues/4 leoprikler: what does thread/async-safety mean in the context of finalizers? wingo: leoprikler: what do you mean? do you mean, can finalizers run asyncs? leoprikler: the Guile manual states, that finalizers must be both async and thread-safe leoprikler: does this mean, that two threads may both try to finalize the same object or something along those lines? wingo: no wingo: so, in a guile configured without threads, finalizers are run via asyncs. wingo: this is a bad situation because you don't know what locks the continuation has wingo: it is a similar situation to signals, where you don't know what locks the "main" program has when you are processing a signal wingo: to be async safe is to never take a lock that might be held when an async runs wingo: (see asyncs in the manual) wingo: however......... you might just assume that you're deploying on a guile with threads leoprikler: which brings me to thread-safety in the context of finalizers… wingo: in that case finalizers are run not from an async, but from a separate thread. so the property that you need is thread-safety, that if you go to grab a lock in a finalizer, that you are guaranteed to eventually get it leoprikler: here it is probably not the locks being held, which are problematic, right? wingo: and also that you don't mutate shared data structures (those that are referenced by the finalized object but themselves are reachable) in a thread-unsafe way leoprikler: so if I just call free() on a bunch of data, that's owned by my struct and supposedly invisible to Guile, everything ought to be fine? leoprikler: *supposedly invisible in that the user could get to that data through pointer arithmetic, but shouldn't do that sarna: lampilelo: it finds guile 3 in my case, but I get the same error as in the issue. `./configure GUILE=/usr/bin/guile` helped, now I'm getting a different error! leoprikler: what if you autoreconf -vif first? sarna: leoprikler: well, the full command I'm running is `autoreconf -vif && ./configure GUILE=/gnu/store/0r5qh5wyb2cp6799l8wph1k1zqvx9vnh-profile/bin/guile && make && exit` sarna: this time it worked??? sarna: I didnt change anything! wingo: leoprikler: yeah, should be fine wingo: free is threadsafe sarna: when I try to install my package with guix though, I'm getting this error from hall - http://paste.debian.net/hidden/adda1169/ sarna: why is this so cryptic :(((( leoprikler: because of cutoff, you don't see which directory doesn't exist leoprikler: it's probably an issue in how hall generates the recipe tho sarna: can I somehow make it spew whole lines? sarna: because the path that I see from here exists, it has to be some part near the end sarna: well now I can't even run `hall clean`, it crashes every time sarna: eh.. tricon: sarna: What the hall... sarna: Grieg should be playing in the background as we debug it leoprikler: sarna: life hack: call find-files on the destination directory before the crash leoprikler: that should give you a list of what already exists vijaymarupudi: I'm trying to include a .scm file relative to a r7rs library (not in current directory) and it doesn't seem to work vijaymarupudi: However, https://www.gnu.org/software/guile/manual/html_node/Local-Inclusion.html, seems to state that this is possible vijaymarupudi: "If file-name is a relative path, it is searched for relative to the path that contains the file that the include form appears in. " vijaymarupudi: Using strace, I found this syscall vijaymarupudi: "openat(AT_FDCWD, "containers/./queue_impl.scm", O_RDONLY)" which is not the relative path. I assume this is a bug? leoprikler: in which way is it not the relative path? leoprikler: containers/./ looks somewhat relative to me vijaymarupudi: I'm in /a and running test.scm. I have on my guile load path /libraries, which contains /libraries/containers/queue.scm that wants to include /libraries/containers/queue_impl.scm. Importing (containers queue) works for the queue.scm file, but the include then does not work. leoprikler: in that case containers/./queue_impl.scm is the correct (albeit not canonical) path, I'm afraid leoprikler: does this openat fail? vijaymarupudi: Yep, the openat fails, because there is no /a/containers/./queue_impl.scm vijaymarupudi: That syscall would be correct is CWD was /libraries, but it is not vijaymarupudi: And "If file-name is a relative path, it is searched for relative to the path that contains the file that the include form appears in." seems to suggest that it would be relative to the directory of queue.scm leoprikler: let's see if I can get a MWE going vijaymarupudi: fingers crossed :) leoprikler: yeah, you'll have to make do with include-from-path, sadly :) leoprikler: it's probably not an issue if you byte-compile, but it trips the interpreter up vijaymarupudi: Looks like you were able to reproduce it? vijaymarupudi: bytecompiling vijaymarupudi: How does one do that? leoprikler: "Also, the particular form of include, which requires an absolute path, or a path relative to the current directory at compile-time, is not very amenable to compiling the source in one place, but then installing the source to another place." leoprikler: so yeah, it's known :P leoprikler: guild compile vijaymarupudi: I feel like the docs contradict themselves on that page maximed: Did someone see this build warning for guile before? vijaymarupudi: Personally, the earlier mentioned behavior "If file-name is a relative path, it is searched for relative to the path that contains the file that the include form appears in." is more intuitive and r7rs recommended vijaymarupudi: guild compile appear to work as a duct tape fix vijaymarupudi: Would you consider this a bug leoprikler, given the docs? If so, I can try to see if I can find where the fix would have to be leoprikler: The issue is not that the file is not relative to the path of the file with the include form. leoprikler: The issue is that the path of the file with the include form itself is a relative path, which is interpreted as relative to the current directory. leoprikler: This is completely fine when doing compilation, but it's not fine when not doing compilation leoprikler: hence include-from-path. vijaymarupudi: Wouldn't canonicalizing the paths after find them be sufficient to fix that? vijaymarupudi: finding* vijaymarupudi: The syscall to find /libraries/containers/queue.scm uses the correct absolute path for example vijaymarupudi: I feel like the same can be done for the relative path leoprikler: I'm not so sure. leoprikler: call-with-include-port uses the syntax form to find the dirname, and paths within that are relative instead of absolute leoprikler: which makes sense, you wouldn't want the syntax to change post install vijaymarupudi: I'm having trouble with the concept of pre and post install because my library has always been where it is civodul: maximed: i've seen it like you when building on 32-bit platforms dsmith-work: {appropriate time} Greetings, Guilers leoprikler: well, that's one problem with people nowadays, they can't imagine actually installing their programs :P maximed: civodul: was that an i{3,4,5,6}86 system, or another 32-bitplatform vijaymarupudi: leoprikler: haha, that's fair, but for library development, it's nice to test and hack stuff quickly, without reinstalling for each change, that's the spirit of the REPL, right :) leoprikler: perhaps, but when it's time to load stuff from directories that's not the working directory, one really ought to think about include-from-path instead :P vijaymarupudi: that would definitely work, but would restrict my code to just guile. I'm trying to switch from racket to guile, but currently need both to run the same code vijaymarupudi: besides the way the docs are worded, and the way r7rs discusses include, this sounds like it has to work! civodul: maximed: i686 i think vijaymarupudi: (to explore this, is there a way to run guile from the build directory of the git repo, without installing it?) leoprikler: ./meta/guile leoprikler: note that the thing you want to patch is not C source tho vijaymarupudi: leoprikler, thanks! I think I'll start with call-with-include-port leoprikler: can autotools build shared libraries without libtool? leoprikler: this is particularly interesting in the context of 3.0.7, in which guile supports shared libraries built differently civodul: leoprikler: you can always do things by hand in Makefile.am civodul: that's no fun though leoprikler: what would that roughly look like? adding some -DPIC -fPIC to a LIBRARIES' LDFLAGS? leoprikler: I imagine not rlb: To some extent it probably depends on how portable you need it to be. When I recently changed bup to handle it manually, in addition to the pkgconfig pythonN-cflags I think I just needed -fPIC, and so far haven't heard complaints, but we also haven't had a release with that in it yet, and I've only tested it personally on linux, some of the bsds, and macos. rlb: (previously we were relying on one of python's tools to build them) leoprikler: can guile arrays do reinterpret_casts? leoprikler: e.g. bytevector to native f64? RhodiumToad: yes maximed: leoprikler: (bytevector->pointer ...), use the resulting pointer? maximed: If this is pure Scheme code, bytevector-ieee-double-native-ref leoprikler: pure Scheme, how do I get the memory-backed f64vector from that pointer? maximed: leoprikler: I don't know what a f64vector is maximed: srfi-4, it apppears leoprikler: a vector of 64bit floats (i.e. doubles) maximed: You could use the FFI to make bindings to scm_c64vector_elements and scm_c64vector_writable_elements? RhodiumToad: no need? RhodiumToad: you can just pass a bytevector to the srfi-4 functions RhodiumToad: (define a #vu8(0 0 0 0 0 0 240 63 0 0 0 0 0 0 0 0)) (f64vector-ref a 0) (f64vector-ref a 1) RhodiumToad: (returns 1.0 and 0.0) leoprikler: true, but what I want is to cast the #vu8 to an #f64, so that (array-ref a 1) == (f64vector-ref a 1) maximed: (if you do low-level type-punning, remember that guile does some optimisations based on types) maximed: Guile has a kind of ‘strict aliasing’ rule leoprikler: though tbf it probably wouldn't matter much to write a wrapper… RhodiumToad: you could create an #f64 initially and access it as a bytevector? leoprikler: nah, can't do that leoprikler: I'm already using make-c-struct, which returns a raw pointer leoprikler: I *could* use that raw pointer and section it though leoprikler: if I knew how RhodiumToad: isn't the "Foreign structs" part of the FFI doc what you're looking for? leoprikler: that only does the (make-c-struct ...) and (parse-c-struct ...) thing leoprikler: however, I want to modify the structure produced by make-c-struct in-place RhodiumToad: but the parse-c-struct can handle various C types? leoprikler: sure, but I don't want to always make and parse to change a single field leoprikler: that's a bit wasteful in terms of memory leoprikler: probably also in terms of runtime RhodiumToad: ok, so you have a bytevector created by make-c-struct, and you want to alias it as a typed array? maximed: leoprikler: I though I saw a C function somewhere to turn a C (float / u64 / ...) array into a Guile array but I can't find it anymore leoprikler: yup leoprikler: well, a pointer generated by make-c-struct, but I'm currently wrapping it in a bytevector leoprikler: I could skip the bytevector, though if there was a direct way to do what I want leoprikler: hmm, I could use (array-copy! ) tho… RhodiumToad: that's making a copy though leoprikler: oh, sure, but under the assumption that I can't alias, memcpy is the next best thing leoprikler: (particularly for a struct that holds a fixed sized array) leoprikler: but I guess there'd be problems with how guile interprets that array-copy leoprikler: hmm… leoprikler: although if invoking memcpy directly does what I want… leoprikler: okay, I just noticed the uvec_type on pointer->bytevector leoprikler: d'oh vijaymarupudi: After some investigating of troubles with relative include, I think the problem is that syntax-source returning the path relative to the load-path, but call-with-input-port using that path as relative to the current directory. vijaymarupudi: This mostly restates what you said leoprikler, but I think I understand it now leoprikler: we're all beginners :) vijaymarupudi: looking to contribute to guile eventually, so this was a nice exercise vijaymarupudi: When compiling a file, guile does know the absolute path of the file, so I need to find where that is and use that instead vijaymarupudi: Because include's behavior right now makes no sense vijaymarupudi: Any pointers to where that would be? vijaymarupudi: A git blame shows that wingo wrote the docs for local inclusion, can you clarify whether it is supposed to be relative to the current directory guile is begin run in, or the current file being compiled? Because the docs say both things here; https://www.gnu.org/software/guile/manual/html_node/Local-Inclusion.html vijaymarupudi: Sorry if I'm being a nuisance, just trying to contribute :) leoprikler: again, as I explained, it's relative to the current file, which is relative to the current directory leoprikler: double relativity vijaymarupudi: I guess I'm motivated by r7rs (https://small.r7rs.org/attachment/r7rs.pdf) pg 14 which talks about include vijaymarupudi: If it is relative to the current file, then the path to the library should be ../libraries/containers/queue.scm and then the relative include should be ../libraries/containers/queue_impl.scm which would be great vijaymarupudi: I'm fine with include being relative to the current directory, but maybe check for a file relative to the current file being compiled first leoprikler: vijaymarupudi: *apply an implementation-specific algorithm to find corresponding files* vijaymarupudi: yep, I'm not saying guile is not compliant vijaymarupudi: The current algorithm I feel is confusing vijaymarupudi: I'm more inspired by the note: section leoprikler: be more inspired by the latter half leoprikler: provide a way for users to specify other directories to search. leoprikler: Guile does that leoprikler: it's called include-from-path leoprikler: use it leoprikler: be happy leoprikler: if you want it to be portable, use cond-expand leoprikler: (next page in the r7rs) vijaymarupudi: I'm all for making it just work, I just want to make sure the current behavior is intentional vijaymarupudi: I'm trying to think of use case when a library would want to include a path relative to the user's current directory, when there is a similar file relative to the libraries path. vijaymarupudi: I think I'm coming off as annoying, I'll take it easy now leoprikler: Again, Guile discourages the use of plain include, probably because its semantics are weird and there are better ways of specifying what you want. leoprikler: It tolerates you includeing stuff if everything is within one directory tree. vijaymarupudi: Right, which makes sense. I think I was suggesting a minor semantics change, in which it checks relative to the file being compiled first, before going back to the usual behavior. vijaymarupudi: I'll stick to cond-expand and forget about this for now vijaymarupudi: I feel like the text in the docs: "If file-name is a relative path, it is searched for relative to the path that contains the file that the include form appears in." is misleading, I would change that if I could. dsmith-work: :( dsmith-work: Anyone have a log of when the bot went away? dsmith-work: !uptime RhodiumToad: there were some server restarts and temporary loss of sasl auth dsmith-work: RhodiumToad: Thanks. vijaymarupudi: I'm trying to use include-from-path in an define-library environment and I'm getting an unbound variable error. Is there a module I have to import? vijaymarupudi: I'm having trouble with speed after using a hashtable with a million keys and values for data analysis. I was wondering if there was anything I could do to help the GC? rlb: Which guile version? rlb: There were some hashing issues in 2.2. iirc that could cause serious performance trouble. vijaymarupudi: guile3 rlb: OK, then I think that issue should be fixed. rlb: I'm a little surprised that a million key hash table has trouble, depending on what kind of trouble you mean. dsmith: vijaymarupudi: Are you giving it an initial size? vijaymarupudi: I'll have to apologize for the artificial example, but it's reproducible vijaymarupudi: https://pastebin.com/raw/PzUArBFJ vijaymarupudi: Python version here: https://pastebin.com/raw/Dftd65yL vijaymarupudi: The guile version takes 2.5s on my machine vijaymarupudi: Python takes 0.4s vijaymarupudi: Racket seems to zoom through similar code vijaymarupudi: I suspect I'll have to take this to C vijaymarupudi: Looking at strace, it seems like it seems to "stop" at a null byte written to a pipe vijaymarupudi: The source code says that this is the sleep pipe vijaymarupudi: Not entirely sure what that means vijaymarupudi: dsmith: initial size seems to take my example down to 1.19 seconds, but I don't think I know what the size would be in my data analysis code dsmith: vijaymarupudi: How about something like a prime number larger than your number of keys? vijaymarupudi: dsmith: that does seem to improve things a bit vijaymarupudi: it still seems slower than a directly equivalent python program vijaymarupudi: guile seems faster at the numerics, but slower at the hashtable dsmith: vijaymarupudi: Another thing may be the hashing function. vijaymarupudi: hash(i) == i in python3, I assume guile does the same? rlb: I *won't* be surprised if (c)python is faster for some "normal" hash operations. I have the impression it's pretty fast there. vijaymarupudi: I just checked with pypy3, which does it 0.5s, which is slower than cpython vijaymarupudi: I'm pretty impressed with python here vijaymarupudi: Huh, I wonder if there's a way to optimize guile's hashtables? dsmith: Well, picking a large enough size would prevent it from resizing (and re-hashing) the table. dsmith: A fast hasher that doesn't have (m)any duplicates for your keys should be faster too. vijaymarupudi: That does help, but I was curious if it was possible to reach python perf here vijaymarupudi: Looking at https://github.com/python/cpython/blob/main/Objects/dictobject.c, it seems like they use an algorithm that doesn't have to recalculate hashes on resize vijaymarupudi: They put the objects (with cached hashes) in a separate vector and only refer to the index from the "main table" vijaymarupudi: Comparing with https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/hashtab.c, it seems like guile rehashes on each resize vijaymarupudi: Which explains why passing the size helps so much vijaymarupudi: (I'll have to leave for a bit, will check the logs later, thanks for taking my questions!) rlb: guile also doesn't cache hash values for immutable objects/trees the way the jvm (and/or clojure/jvm) do. rlb: I have a foo.test file that works fine if I run it via ./check-guile foo.test, but it crashes if I run it via "make check" like this: rlb: ERROR: json.test: (tree-equal? x (call-with-input-string (call-with-output-string (lambda (port) (write-json x port))) read-json)) - arguments: ((misc-error "simple-format" "FORMAT: Unsupported format option ~~~A - use (ice-9 format) instead" (#\f) #f)) rlb: rlb: The test module has no references to format. rlb: Oh, hmm, might have found it. rlb: Hit another weirdness with srfi-88. I just wanted to use keyword->string, but using it in a foo.test file crashes tests later on, i.e. creating a test-suite/tests/breakthings.test containing this causes subsequent tests to crash: (define-module (test-suite breakthings) #:use-module (srfi srfi-88)) rlb: And just #:selecting keyword->string doesn't help. rlb: wingo: wonder if that might be reader related ^ Haven't tried that with anything but f449d2ebcb242b5824e167ae9cf73bec6218c683 yet. rlb: My previous issue with srfi-99 was that reader changes persist after the end of a module file -- be more useful if there were a way to say that "just this module uses 'prefix", but this is caused just by loading the module. rlb: "this new issue is caused" rlb: wingo: oh, I take it back. That issue was found with current master, not that sha. rlb: Oh, right, I forgot that just using srfi-88 calls read-set!. That's pretty surprising, but maybe that's what the srfi wants... I just need to avoid srfi-88 -- can always define keyword->tring and string->keyword myself. At least for now, there's no more direct function. leoprikler: rlb perhaps we'd want to provide those in (guile), WDYT? ecraven: how do I tell the guile3 command line to load an r7rs library? how do I point it at the sls file? ecraven: also, which library exports `interaction-environment'? wingo: ecraven: guile --r7rs should work fwiw. to load an sls you use import in the file you load, as usual sarna: hey, I have a `let*` in which I just pass the previous variable to the next one. does guile have something like clojure's threading macros? ( https://clojure.org/guides/threading_macros ) Guest8193: srfi-197 chrislck: sarna: srfi-197 sarna: thanks chrislck! sarna: oh, guile doesn't support it :^( vijaymarupudi: I was trying to make a c extension wrapper around GLib's hashtable to get around performance problems with Guile's hashtable (I really want to use guile), and it performs similarly to Guile's hashtable. This is odd, because in pure C, GLib's hashtable is really fast. Turns out the culprit is scm_gc_protect_object, which appears to acquire a mutex on each call, and uses Guile's hashtable, making the c wrapper kinda redundant. I was vijaymarupudi: wondering if there was a way to get around this? vijaymarupudi: Solutions I can see working here: An API to protect multiple objects at once (to prevent mutex locking in tight loops) or to convert the scm_protects hash_table to c? I'm not sure which one is responsible for the performance impact, is there a way for me to know? vijaymarupudi: To quantify performance impact, removing scm_gc_protect improves runtime for hashtable loops from 300ms to 50ms vijaymarupudi: (ignoring the segfault afterwards :)) dsmith: heh leoprikler: ignoring segfaults reduces runtime to 0ms in the optimal case :) vijaymarupudi: :) in a less ridiculous approach, I have paired GLib's hashtable with a Guile list (which keeps the references) and performance is now 100ms with no segfault. vijaymarupudi: But with this approach, removing an item from the table doesn't make it available to the gc chrislck: sarna: I believe guile *could* import srfi-197 however I don't know how sarna: chrislck: I don't need it *that* much, I'll just use `let*` :D sarna: how do I make libraries visible to my program? I installed one with guix and when I run `guile myprogram.scm` it can't find the module civodul: sarna: hi! when you run, say, "guix install guile guile-lib", there's a hint displayed about setting environment variables civodul: if you follow that hint, it'll set GUILE_LOAD_PATH civodul: from then on, "guile" will find the Guile-Lib modules leoprikler: vijaymarupudi: what if you used the list pairs as keys though? leoprikler: in that case, for a deleted key, you would have to seek that pair (O(n), maybe one can do it faster) and then simply drop the car vijaymarupudi: I might do that, and then drop the cars during hash table resizes vijaymarupudi: thanks for the suggestion! sarna: civodul: I must have missed it. I'll set it up, thanks! rlb: sarna: If it helps, these may work fine in scheme too: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/base/syntax.scm#L108 And the cond->/cond->> in there will likely work if you chagne the %scm-if to if, etc. rlb: (And of course, I'd be happy to contribute scheme versions of any of that to Guile proper if we were to decide it's desirable.) manumanumanu: sarna: this is a guile module I wrote a long time ago: https://hg.sr.ht/~bjoli/guile-threading-macros manumanumanu: but if anyone has a working implementation of srfi-197 you should use that dsmith: Hmm, The sample implementation https://github.com/ar-nelson/srfi-197/tree/draft-3 has Guile working with the r6rs lib rlb: wingo: nevermind - the #nil handling is still broken in main, I had unwittingly left my patch applied to the working tree. The make-struct/no-tail issue appears to be new (after 3.0.7). dsmith: sneek: botsnack sneek: :) dsmith: !uptime sneek: I've been running for 2 days sneek: This system has been up 2 days, 15 hours, 48 minutes leoprikler: given a SCM UTF-8 string, is there an "easy" way to determine the byte offset (and possibly count) of the char at a given (char) offset? rlb: On the C side or scheme side? leoprikler: I'll take either leoprikler: For context, I plan to (indirectly) use a library, that uses C-style strings and byte offsets, whereas any Scheme API would use char offsets to be useful rlb: On the C side If you're OK with null termination, then perhaps u8_strlen or u8_strnlen: https://www.gnu.org/software/libunistring/manual/libunistring.html#Elementary-string-functions-on-NUL-terminated-strings. Otherwise (not as "easy", fsvo "easy"), you can loop via u8_mblen, etc.: https://www.gnu.org/software/libunistring/manual/libunistring.html#Elementary-string-functions rlb: Though iirc I think I discovered that u8_next() (also in the null terminated section), might not actually care about nulls, and is a bit easier to use than the corresponding non-null-term function. Might not be something you'd want to rely on, though. rlb: But if you're writing this as an extension (outside guile), I suppose you might or might not want to depend on libunicode. leoprikler: perhaps not, but within the context of a guile extension it might still make sense to use libunicode leoprikler: do I understand this correctly, that I'd basically loop over u8_next() and then subtract new_ptr - old_ptr? leoprikler: it'd still be nice if I could instead determine the width by… say code point leoprikler: e.g. code point < 128 → 1 byte and so on rlb: Right, or you could keep two counts, or... i.e. you just use the iterators to skip ahead the right amount for each char, assuming it's valid. Though iirc u8_next may not have comparable error handling... rlb: wingo: tracked down the commit introducing the "Unbound variable: make-struct/no-tail" lokke compilation failure and filed a bug: https://debbugs.gnu.org/49404 I don't understand the situation well enough to pursue it further myself atm, but happy to assist if I can. lampilelo: it would be possible to create a system on top of srfi-37 for that, use a swappable dispatch in option processors and switch states, you'll have a layer of indirection and some options in some state could throw errors while others would behave differently depending on the state lampilelo: or you could just (let ((var #f)) (args-fold ...)) and set the var to whatever and use that in the processor for some other option if that's what you want vijaymarupudi: me vijaymarupudi: Whoops, sorry about that stikonas: RhodiumToad: figured out my problem, turns out I had to adjust boehm gc CFLAGS for musl libc... apteryx: lampilelo: indeed; the fold-args seem like it'd provide the most flexibility. Thanks for the hintsights. apteryx: how can I get the keyword value from a list? (assoc-ref '(#:something value1 #:more value2) #:more) doesn't return 'value2 apteryx: hm,m not assoc-ref because it's a plist, not a alist daviid: apteryx: get-keyword, from (oop goops) daviid: apteryx youmay just importthat proc if you don't want to import the all (oop goops) module apteryx: OK, neat. Thanks. daviid: welcome! flatwhatson: apteryx: memq returns the pair, so you could (memq elem plist) and then car is key, cadr is value apteryx: right, (and=> (member #:my-key the-list) second) would work too apteryx: but get-keyword is to the point :-) leoprikler: note that (let-keywords ) and lambda* are probably a better idea most of the times sarna: hey, will artanis work with guile 3? lampilelo: sarna: based on the title of this commit, yes: https://gitlab.com/NalaGinrut/artanis/-/commit/4654b125cfaddbd3d4a07f2c6ad1dfbf407b499e sarna: lampilelo: woo, great! who to ping so it's changed here? https://www.gnu.org/software/guile/libraries/ ft: Isn't that page based upon the packages in gnu guix? ft: And the guix package still depends on guile 2.2; so probably that. lampilelo: yes leoprikler: so we ought to get guile-artanis bumped to the 3.0 version :) sarna: oh! hmm. no idea what the workflow is here haha xiews: sarna: there is a branch for guile 3.0 in artais. manumanumanu: wingo: I don't know if you saw this, but if it gets some traction it could potentially be interesting: https://github.com/cisco/ChezScheme/issues/574 manumanumanu: I believe I saw your name in the old R6RS mailing lists, and given your current position it seems like it could be directed towards you and ludo. manumanumanu: sneek: seen ludo sneek: lloda?, pretty sure was seen in #guile 4 days ago, saying: erc didn't tell me anything, my chat window looked as if the messages were getting through, but they weren't. manumanumanu: dang manumanumanu: sneek: seen civodul sneek: I last saw civodul in #guix 15 hours ago, saying: nope. sarna: which revision does guile support by default? r6rs? RhodiumToad: it's not quite compatible with either r6rs or r7rs by default RhodiumToad: the docs claim it complies fully with r5rs RhodiumToad: there are options --r6rs and --r7rs that switch various defaults to be as close as possible to the specified revision, but not all features are implemented sarna: RhodiumToad: what would you suggest for a beginner to stuck with? the default? sarna: then I'd need to be reading r5rs docs, I've been reading r6rs - hmm.. flatwhatson: stick to the guile manual sarna: oh, okay. makes sense, thanks! rlb: info guile rlb: Heh, oops. manumanumanu: sarna: guile is pretty compatible with most r6rs code out of the box. manumanumanu: i had a bunch of pure r6rs modules before starting guile, and they all ran without problem manumanumanu: however, guile code is not r6rs-compatible by default. You have to limit yourself to r6rs, either usirg --r6rs at the command line or (install-r6rs!). manumanumanu: sarna: https://www.gnu.org/software/guile/manual/html_node/R6RS-Incompatibilities.html rlb: taylan: I haven't caught up on all the nil related discussion, but though I'd mention this https://www.gnu.org/software/guile/manual/html_node/Nil.html to make sure you'd seen it. rlb: (and the discussion of equality, etc.) taylan: rlb: yeah, I know about it. if I'm not mistaken, nothing in it contradicts the idea that #nil could be made equal? to () in Scheme to make sure equal? works for comparing Elisp and Scheme lists. taylan: it would however cause the weird situation that a false object is equal? to a true object, and I guess that would be very surprising. taylan: although as surprising as it seems, I'm not sure whether it would cause any issues in practice. rlb: Would it break transitivity? If so, that might be a hard restriction. rlb: i.e. that's what the info page seems to imply? *: rlb only skimmed. rlb: I can consider it more carefully later... taylan: rlb: if you make #nil equal? to both () and #f, but not make () and #f equal?, then it breaks transitiveness. if you make #nil only equal? to (), then it doesn't break it. rlb: Yeah, I was thinking more about "truthiness" than equality, and agreed, having two things be equal? but one "false" and the other "true" doesn't, offhand, seem plausible to me. sarna: thanks manumanumanu! "mostly compatible" sounds good enough for me haha rlb: wingo: hmm, I just tested against current main (i.e. past 3.0.7), and I'm not sure, but it's looking like whatever has changed since then may have fixed the #nil issue with lokke. If so, we may be able to ignore and/or close that bug I filed. However, now it's crashing further on, when trying to compile a clojure file: rlb: ice-9/boot-9.scm:1685:16: In procedure raise-exception: rlb: Unbound variable: make-struct/no-tail rlb: rlb: ...I just randomly wondered if there's any chance that might be because the lokke namspaces are #:pure. dsmith: !uptime sneek: I've been running for one minute and 37 seconds sneek: This system has been up 10 hours, 15 minutes rdrg109: !uptime dsmith: !uptime sneek: I've been running for 12 hours sneek: This system has been up 22 hours, 15 minutes dsmith: rdrg109: (no leading space) dsmith: Woah! 145 memebers civodul: dsmith: have we reached the number of people we had on freenode yet? dsmith: I think it was around 160 ? leoprikler: it feels like 3/4ths over here and in #guix dsmith: 150 right now civodul: 116, according to ERC :-) leoprikler: polari also says 116 leoprikler: or is that 150 poor souls using the wrong channel? civodul: heh dsmith: Hmm. My erc says 156 dsmith: wait dsmith: Doh! dsmith: Sorry. 116 dsmith: I was looking at the line number *: dsmith blushes dsmith-work: Happy Friday, Guilers!! tekakutli: happy friday dsmith stikonas: hi, in #bootstrappable we are trying to bootstrap guile (3.0.7). So I'm building guile with GCC 4.7.4 but once build process builds initial guile, it crashes. https://paste.debian.net/1203162/ any ideas what I might be doing incorrectly? RhodiumToad: in frame 1, what's the value of *(void**)ptr ? RhodiumToad: looks like something is screwed up between boehm-gc and guile stikonas: $1 = (void *) 0xfffbb0a7 stikonas: oh, I guess you want me to dereference it stikonas: $2 = (void *) 0x0 stikonas: so it's 0 stikonas: that was (gdb) p *(void**)ptr RhodiumToad: that's supposed to point to a function, the finalizer for some object apteryx: is it possible to have dynamic options based on the value of another CLI option using (srfi srfi-37) apteryx: hmm, thinking more about it, I don't see how that'd be feasible dsmith: sneek: botsnack sneek: :) daviid: as savannah uses cgit, which does not render image files, i've updated g-golf's web-site 'learn' page, so now it briefly describes and shows a screenshot for each example that comeswith g-golf ... https://www.gnu.org/software/g-golf/learn.html vijaymarupudi: g-golf looks interesting! vijaymarupudi: looking forward to following it's development wingo: moin :) MysteriousSilver: o/ sarna: o/ sneek: Welcome back sarna, you have 1 message! sneek: sarna, maximed_ says: guix has ‘git-style’ subcommands, so you could look there as well sarna: sneek: later tell maximed_: I looked there but haven't found anything haha, I'm not that good with reading guile source yet :D but thanks! sneek: Will do. sarna: what does `ice-9` stand for? I can't really find anything on it dsmith: sneek: ice-9? sneek: Last time I checked ice-9 is "a nod to the fictional substance in Kurt Vonnegut's novel, Cat's Cradle, capable of acting as a seed crystal to crystallize the mass of software" sarna: thank you! dsmith: sneek: botsnack sneek: :) dsmith: !since sneek: I've been running for 8 minutes and 11 seconds dsmith: !uptime sneek: This system has been up 8 minutes dsmith: Had a power outage.. dsmith: !uptime sneek: This system has been up 16 minutes dsmith: !uptime sneek: This system has been up 19 minutes dsmith: !since sneek: I've been running for 2 minutes and 54 seconds dsmith: !uptime sneek: I've been running for 56 seconds sneek: This system has been up 26 minutes dsmith: Yey dsmith: sneek: seen rlb sneek: rlb was last seen in #guile -49 minutes and -21 seconds ago, saying: Oh, though I should perhaps mention that on some of the platforms some tests have been marked as "unreliable", and their failures ignored.. chrislck: sneek: what is a time traveller? chrislck: you are! dsmith: sneek: seen rlb sneek: rlb was last seen in #guile one day and 21 hours ago, saying: Oh, though I should perhaps mention that on some of the platforms some tests have been marked as "unreliable", and their failures ignored.. dsmith: Time was not set correct when power came back up. dsmith: !uptime sneek: I've been running for 5 minutes and 57 seconds sneek: This system has been up 6 minutes dsmith: sneek: botsnack sneek: :) dsmith: The time was Nov 3, 2016 ! lampilelo: why? lampilelo: that's when the docker image was created or something like that? chrislck: sneek: who's a good bot dsmith-work: lampilelo: The system rebooted but didn't have Inet connectivity to contact NTP servers. dsmith-work: (Router was not up yet) dsmith-work: lampilelo: The device has no RTC and relies on NTP to set the date lampilelo: yeah, but why 2016? dsmith-work: Not sure. Has Debian on it. Paritally upgraded (thing only has 2G flash). Probably some initial date in that. dsmith-work: !uname sneek: Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux rlb: wingo, civodul: filed a bug to capture what I know about the 3.0.7 #nil problem and record the "fix" I came up with: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49305 I'd be happy to apply it if we decide it's reasonable, but I'd *definitely* want a second opinion. civodul: rlb: i'm no reference in these matters, but what you propose looks reasonable to me civodul: $sc-dispatch, via match*, does (cond ((null? p) ...) ...) civodul: and (null? p) matches #nil civodul: which prolly explains the bug you're seeing Aurora_v_kosmose: I don't suppose Guile has the ability to dump executable images? maximed: sneek: later tell: Aurora_v_kosmose: Guile has some modules for manipulating ELF and Guix has some other modules as well maximed: sneek: later tell Aurora_v_kosmose: Guile has some modules for manipulating ELF and Guix has some other modules as well sneek: Got it. maximed: sneek: later tell Aurora_v_kosmose: It's not quite ‘dumping executable images’ though sneek: Got it. Aurora_v_kosmose: Alright. I'd been wondering for the case of rumprun VMs. sneek: Welcome back Aurora_v_kosmose, you have 2 messages! sneek: Aurora_v_kosmose, maximed says: Guile has some modules for manipulating ELF and Guix has some other modules as well sneek: Aurora_v_kosmose, maximed says: It's not quite ‘dumping executable images’ though dsmith-work: Aurora_v_kosmose: unexec used to be a thing at one time. Aurora_v_kosmose: The gcc feature which Emacs recently stopped using, correct? dsmith-work: But with all the dependant .so's and stuff like address space randomization, I question if that's even possible anymore. Aurora_v_kosmose: (Or was it glibc? Meh anyway) dsmith-work: Ya. Take a running process and write the whole address space to disk as an executable. dsmith-work: Guile used to be really slow to start. Aurora_v_kosmose: Right, glibc wants to remove unexec so that's probably going away soonish. dsmith-work: Aurora_v_kosmose: Why are you interested in unexec? (what's a rumprun VM?) Aurora_v_kosmose: dsmith-work: rumprun allowed one to turn executables into unikernels. Unfortunately now that I look again... the project seems to have died. dsmith-work: !uptime sneek: I've been running for 7 hours sneek: This system has been up 7 hours, 55 minutes wingo: moo tekakutli: moo leoprikler: moo chrislck: leoprikler: I guess using deifne-foreign-object-type *does* require using (oop goops) ? *: chrislck does not grok goops leoprikler: not really? leoprikler: lemme check again leoprikler: yeah, you only need is-a? for type checking if that's what you want, but the record accessors also typecheck for you leoprikler: match et al. should also work if you prefer those chrislck: thanks. there are very few examples out in the wild unfortunately leoprikler: yeah, I haven't really been able to use guile-fontconfig beyond those toy examples either leoprikler: font handling is just weird imo sarna: hey, what library would I use for making git-style command line programs with subcommands? lampilelo: sarna: you could use args-fold from srfi-37 sarna: lampilelo: looks great, thanks! maximed_: sneek: later tell sarna: guix has ‘git-style’ subcommands, so you could look there as well sneek: Okay. dsmith-work: Wednesday Greetings, Guilers dsmith: RhodiumToad: How about non-continuable-error? ? RhodiumToad: dsmith: that doesn't do what you might think it does RhodiumToad: that tells you whether an exception object has a &non-continuable element in it RhodiumToad: but the lack of that doesn't mean it's continuable. dsmith: I was thinking that depends on how the exception was raised. If the continuable flag was set or not. dsmith: Up to the coder of the exception to get it right. Right? RhodiumToad: nope dsmith: That section of the manual is a bit light on examples. RhodiumToad: (with-exception-handler (lambda args (format #t "print2 ~S ~S\n" args (non-continuable-error? (car args))) 'continued) (lambda () (raise-exception (make-exception (make-error) (make-exception-with-message "foo!")) #:continuable? #t))) dsmith: Interesting.. RhodiumToad: er, that's not quite what I actually meant RhodiumToad: better example: RhodiumToad: (with-exception-handler (lambda args (format #t "print2 ~S ~S\n" args (non-continuable-error? (car args))) 'continued) (lambda () (error "foo!"))) RhodiumToad: that clearly isn't a continuable error, get non-continuable-error? still returns #f RhodiumToad: *yet dsmith: If you set #:continuable? to #t or #f, non-continuable-error? always is #f RhodiumToad: right, because non-continuable-error? is a property of the exception object, not of the way it was raised RhodiumToad: non-continuable-error? is true only for exceptions of type &non-continuable RhodiumToad: (which happens to be what gets raised if you try and continue after raising with #:continuable? #f) dsmith: I wonder if this is what was intended. dsmith: sneek: later tell wingo So what's up with #:continuable? ? sneek: Okay. *: daviid added a revealer.scm (g-golf) example (based on the revealer.c, from gtk-4-examples that comes with gtk-4) which demonstrate how to use , , g-timeout-add and a detailed signal-name - the screenshot is 'static', but the 'real' example 'animates' 9 revealer instances, fun :) wingo: dsmith: honestly, not very fleshed out. such an exception needs to be raised via raise-continuable tho sneek: Welcome back wingo, you have 1 message! sneek: wingo, dsmith says: So what's up with #:continuable? ? wingo: or raise exn #:continuable? #t wingo: hey ppl, any idea why MysteriousSilver can't post to the channel? wingo: is the channel misconfigured or is there something MysteriousSilver should do? *: wingo irc idiot who happens to have op privs taylan: we're probably still registered users only? *: taylan gtg lloda: I did need to register before i could post lloda: erc didn't tell me anything, my chat window looked as if the messages were getting through, but they weren't chrislck: Is there anyway to assign some guile code to be called when a SCM object gets gc'd? chrislck: (let ((my-object (newArray))) ...work on my-object...) chrislck: my-object will eventually be gc'd but the newArray is C code which allocates and must be freed. chrislck: I know ideally the code should be: chrislck: (let ((my-object (newArray))) ...work on my-object... (freeArray my-object)) RhodiumToad: wingo: the channel is set to that unregistered users can join but not speak; if you want to change that, you can remove the -q $~a mode RhodiumToad: chrislck: you can use finalizers or guardians leoprikler: chrislck: there are finalizers, specifically pointer finalizers chrislck: thx both -- finalizers are very new to me. is there a one-liner that I can use? leoprikler: not so much a one-liner, but we've used them e.g. in guile-fontconfig (no release yet, but it works™ for some tests) chrislck: ok will read when i have time :P RhodiumToad: is there a way to use finalizers from pure guile code (i.e. not using C)? I didn't find one on a quick search leoprikler: https://gitlab.com/leoprikler/guile-fontconfig/-/blob/master/fontconfig/char-set.scm#L30 leoprikler: TL;DR: (system foreign-object) is your friend RhodiumToad: ah right sarna: hey, which architectures does guile support? is it only x86_64 and i386? I can't really find it on the main page wingo: jit support on arm64, armv7, i386, x86-64. without jit on pretty much everything else that you can compile linux on. not great windows support currently tho sarna: hey wingo, I just watched your talk! :D I was mostly wondering if I could run guile on my RPi, thanks! *: RhodiumToad has run guile on an rpi RhodiumToad: had to fix some bugs, but those fixes are all in recent versions sarna: neato RhodiumToad: I've only tried it on armv7 and not aarch64, though RhodiumToad: the rpis I have in use are older ones sarna: are the platforms listed anywhere? I can't find them in the reference manual either, wiki lists only two - https://en.wikipedia.org/wiki/GNU_Guile RhodiumToad: pretty sure all of the code outside the jit library itself is intended to be architecture-neutral MysteriousSilver: Hello! RhodiumToad: good afternoon or other relevant time of day MysteriousSilver: salute RhodiumToad MysteriousSilver: i previously had trouble sending messages to this channel RhodiumToad: the channel is currently set to only allow registered and identified nicks to talk RhodiumToad: (though anyone can join) RhodiumToad: it's to cut down on spam, though it may not be necessary MysteriousSilver: new to irc, took time to realize sarna: damn, I can't install guile on my RPi :( aarch64, debian RhodiumToad: huh, why not? sarna: complains about libc6 version (expects >= 2.29 but debian only has 2.28 it seems) RhodiumToad: what exactly complains? sarna: apt sarna: if I try `apt install guile-3.0` it complains that I don't have guile-3.0-libs, if I try `apt install guile-3.0 guile-3.0-libs` it tells me libc6 is too ancient RhodiumToad: ok, so that's just a package management problem RhodiumToad: and I don't use linux so probably not the best person to help chrislck: leoprikler: thx looks like it's the solution :) sarna: RhodiumToad: what do you use? BSD? RhodiumToad: freebsd, yes sarna: neat! RhodiumToad: (for which guile does need a couple of patches, mainly to do with bad assumptions about off_t) RhodiumToad: (thanks to *BSDs having never been infected by the ghodawful largefile hacks) chrislck: leoprikler: looks good. however my constructor doesn't need an argument, and am struggling to make it work. leoprikler: a constructor without an argument? leoprikler: do you have a fieldless record? chrislck: uhh chrislck: yes chrislck: something like (newArray)... it's populated via something like (InsertAt array 1 1) and finalized via (freeArray) dsmith: sarna: The bot here ran on an rpi for a while. Now it's on a beaglebone black. dsmith-work: Morning Greetings, Guilers tekakutli: hello dsmith rlb: sarna: wrt architectures, all the green ones here at least build and pass "make check": https://buildd.debian.org/status/package.php?p=guile%2d3%2e0 rlb: and 2.2's doing a bit better: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid right now, though I suspect sometimes it has mattered which build host picks up the job... rlb: Oh, though I should perhaps mention that on some of the platforms some tests have been marked as "unreliable", and their failures ignored. sarna: dsmith-work: it's a pretty small board! my rpi is beefier, I got the new one sarna: rlb: thanks, that's a lot of archs 👀 dsmith-work: sarna: Nice! leoprikler: chrislck: you should still have something like an array* that's returned by newArray and wrapped by your civodul: roptat: no crash for me! https://gitlab.com/guile-git/guile-git/-/issues/19 vijaymarupudi: hello all! sneek: Welcome back vijaymarupudi, you have 1 message! sneek: vijaymarupudi, leoprikler says: scm_gc_protect vijaymarupudi: ah yes, that's for storing it in the heap, I think I can live with the gc for the stack variables for now vijaymarupudi: I wanted to ask for any large guile project I can read the source code of and learn from! maximed: any particular reason bytevector=? doesn't accept offset & length arguments, or a bytevector-range=? doesn't exists, besides ‘that's not RnRS’? maximed: fwiw, I worked around this lack with bytevector->pointer & pointer->bytevector maximed: maybe something for (system foreign): (define (bytevector-range bv offset length) (pointer->bytevector ...))? maximed: I've seen the combination pointer->bytevector & bytevector->pointer a few times before (or was it the other way around?) sarna: vijaymarupudi: guix? :) vijaymarupudi: sarna: haha I was expecting that :) however I suspect that it's macro heavy, which might be a bit difficult for me to understand right now vijaymarupudi: Maybe medium sized rather than large lampilelo: vijaymarupudi: http://sph.mn/foreign/guile-software.html vijaymarupudi: lampilelo: that's perfect, thank you! maximed: except for the 'package' macro, Guix doesn't use macros all that much maximed: There are plenty of procedures in guix/lint.scm, for example maximed: lilypond hould be a good example of a guile project as well vijaymarupudi: that's good to know vijaymarupudi: thanks! maximed: And gexp (#~) is a macro as well. Actually, Guix uses plenty of macroology. But there's plenty of ‘procedurology’ as well. leoprikler: Don't forget about Guix' advanced record wizardry. leoprikler: plus anything having to do with monads :P vijaymarupudi: advanced record wizardry? leoprikler: (guix records) to name a start RhodiumToad: modern compilers make the logic of boehm-gc questionable drakonis: when is it time to replace it then? drakonis: now? merazi_1: Hello guile! RhodiumToad: good evening tekakutli: hello merazi merazi_1: how are you doing? RhodiumToad: same as usual merazi_1: Oohh, I hope that's good. tekakutli: merazi_1 what did you do today to further our agenda? dsmith: leoprikler: Actually, guile had it's own GC before boehm. Inherited from SCM. merazi_1: tekakutli: Nothing really 😓 I've been doing some basic uni stuff today, preparing for the week. rlb: ...and iirc, getting the handling right *everywhere* on the C side was not always easy (wrt the previous non-conservative collector). dsmith: Ya. lots of mysterious bugs just went away, but on the other hand, added another dependency. vijaymarupudi: I'm not sure how central boehm is to the code, but I wonder if no-ops (for now) could be provided to increase or decrease a ref count for an SCM object vijaymarupudi: So that in a future, a command line flag could opt for a more hands on approach? vijaymarupudi: In the interest of high performance of course leoprikler: sneek later tell vijaymarupudi scm_gc_protect sneek: Okay. apteryx_: how do we recursively dereference a (potential) symbolic link? readlink would only dereference it once, correct? apteryx_: ah, there is an example as readlink* in (guix utils0 apteryx_: (guix utils) dsmith-work: Monday Greetings, Guilers RhodiumToad: also see canonicalize-path leoprikler: Does Guile (the language) have something similar to Emacs Lisp's with-demoted-errors? leoprikler: I know Guix has false-if-exception*, but it's not quite what I'm looking for. RhodiumToad: there isn't a builtin for it, but it should be doable RhodiumToad: actually RhodiumToad: it doesn't seem to be documented, but false-if-exception has an optional warning arg dsmith-work: Ur? dsmith-work: Woah. RhodiumToad: (false-if-exception expr #:warning template arg ...) RhodiumToad: (false-if-exception (error "foo!") #:warning "demoted error ") outputs ;;; demoted error foo! RhodiumToad: that said, doing your own thing using with-exception-handler or catch might be preferable leoprikler: yeah, it also prints the entire exception RhodiumToad: what do you want to happen to the error? leoprikler: just the error be printed (perhaps with the right prefix) leoprikler: I don't know how continuable exceptions are handled – would the code continue after the throw without me doing anything or would I need extra code for that? RhodiumToad: do you want demoted errors to be continued if possible? leoprikler: yep RhodiumToad: false-if-exception doesn't do that, it unwinds all errors leoprikler: thought so leoprikler: so I need an unwind-handler instead of catch? chrislck: dynamic-wind? leoprikler: I should probably just read the manual on continuable exceptions first RhodiumToad: you shouldn't need or want dynamic-wind for this leoprikler: so it appears this is the default (#:unwind?=#f) behaviour of with-exception-handler? dsmith-work: How timely. I was just looking at with-exception-handler last night. RhodiumToad: the default for with-exception-handler is to invoke the handler without unwinding, in the tail position of the raise-exception call dsmith-work: https://paste.debian.net/1202724/ RhodiumToad: however, most exceptions are not continuable, so if the handler just returns, it'll throw another exception (to the previous handler) RhodiumToad: it works to have two nested handlers, the inner one to print the error and the outer one to unwind for &non-continuable, but I don't know if there's a more elegant way dsmith-work: RhodiumToad: Is that double level needed? Just print the error in the unwound handler. RhodiumToad: that wouldn't continue a continuable exception, though dsmith-work: Ahhh RhodiumToad: the request (aiui) was for code that would automatically continue any continuable exception and catch any non-continuable one, printing it either way RhodiumToad: something like this: https://dpaste.org/1OHe RhodiumToad: that assumes that #f is always a reasonable thing to return to a continuable exception RhodiumToad: also this assumes guile 3 with its unification of exceptions and throws JLouis: what would be equivalent in Guile to prin1-to-string that data can be saved in file? dsmith-work: JLouis: Perhaps object->string JLouis: aha let me try JLouis: that is right for guile JLouis: thanks dsmith-work: np dsmith-work: So what makes an exception continuable or not? Yeah, by calling raise or raise-continual or whatever. What are examples of exceptions that could be continuable and some that are not? RhodiumToad: raise-exception has an optional argument which says it's continuable RhodiumToad: (raise-exception blah #:continuable? #t) RhodiumToad: afaik it's not dependent on the type of exception or anything else dsmith-work: Right, but I'm really asking the deeper question. What kinds of execeptions are or should continuable? Or should not be? RhodiumToad: good question leoprikler: dsmith-work: if you're writing procedural code you might want to throw continuable exception for optional stuff failing leoprikler: RhodiumToad: what would happen if I inverted the order? leoprikler: I.e. in the inner exception handler unwind the stack if it's a non-continuable exception, then rethrow as continuable and in the outer one simply format the error? RhodiumToad: why? RhodiumToad: the problem is that I didn't find a way to know if the exception was continuable except to try and continue it RhodiumToad: which results in a &non-continuable exception if it turned out not to be continuable RhodiumToad: and that gets thrown to the outer handler and not the inner one RhodiumToad: (i.e. it gets thrown to the handler outside the one that tried to continue the error) iskarian: Hello all :) I have a method X that returns unspecified, or multiple (unknown number of) values, but using (let ((value (X)) (if (not (unspecified? value)) value ...)) only produces the first value. Is there a way to check for unspecified and also get all values? rlb: iskarian: depending on what you need perhaps https://www.gnu.org/software/guile/manual/html_node/SRFI_002d11.html or receive https://www.gnu.org/software/guile/manual/html_node/Multiple-Values.html iskarian: rlb, thanks for the reply; I saw those, but I do not know the number of values ahead of time... is there a way to make them work with an arbitrary number of values? iskarian: Another question: is there a way to format an exception just like I'd see printed if I raised the exception? flatwhatson: iskarian: you can (recieve args ...) instead of (receive (a b) ...) flatwhatson: there's also call-with-values, eg. (call-with-values myfun list) will return a list of myfun's return values. iskarian: oh... thanks, flatwhatson! that makes a lot of sense sense, but it'd be nice if it were in the manual, haha flatwhatson: well, it does say "like the argument list in a lambda", which hints at this flatwhatson: similarly, you can (receive (first . rest) ...) iskarian: fair enough! all the dots make my head spin :) flatwhatson: eg. (receive (a b . cs) (values 1 2 3 4 5) cs) gives (3 4 5) leoprikler: There's also SRFI 71 let and compose leoprikler: e.g. (compose list mv-producer) gives you the values as a list garjola: Hi all. I am new to guile and I am looking for a good book to get started. I am familiar with lisps (Elisp, some clojure years ago) and I have configured geiser on Emacs to start playing around. I have the info reference manual, but I was looking for a «project oriented» book to get familiar with modules and the usual dev cycle with guile. Any recommendations? Thanks! leoprikler: There are books on Scheme, such as SICP, but few of them teach the Guile flavour for more or less obvious reasons. leoprikler: I think The Little Schemer is also among the book titles, that people can read dsmith: sneek: books? sneek: books is try htdp and scip dsmith: sneek: htdp? sneek: I could be wrong, but htdp is How to Design Programs, http://www.htdp.org/ leoprikler: is it scip or sicp? dsmith: heh dsmith: sicp dsmith: sneek: forget books sneek: Okay. dsmith: sneek: books is Try htdp and sicp sneek: Understood. dsmith: goodbot mwette: sicp: structure and interpretation of computer programs mwette: tspl: the scheme programming language: https://www.scheme.com/tspl4 (this has a chapter on syntax-rules and syntax-case) dsmith: tspl Is great garjola: Thanks for the pointers. I understand that there are no specific Guile books. I know SICP and HTDP, I will have a look at TSPL. vijaymarupudi: Hello all! I'm new to guile, and looking into whether to make it my "main" language vijaymarupudi: I was watching a bunch of talks by wingo on youtube, and was curious if there was any progress into the question of a new garbage collector? vijaymarupudi: I don't want to depend on the Boehm for my C extensions if possible vijaymarupudi: But generally, I've been enjoying Guile, thank you very much for maintaining and improving it! leoprikler: It's all Boehm? Always has been. leoprikler: w.r.t. GC in C extensions, I don't think you manually interact with boehm anyway, instead using the scm_gc_ calls leoprikler: if at all vijaymarupudi: I see vijaymarupudi: At 21:00 in https://www.youtube.com/watch?v=qS121jMhMpE, wingo seems to talk about possible future plans dsmith: !since sneek: I've been running for 21 hours apteryx: hello! I'm surprised that this is not valid: https://paste.debian.net/1202456/. It seems to be because in the template, each variable must be immediately followed by the ellipsis ... apteryx: Ideas? apteryx: substitute* is a macro from (guix build utils); see: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/utils.scm#n793. apteryx: I want the macro to expand into multile substitute* usages (one per file). apteryx: seems I'm forced to strip the last ... and manually repeatedly use the 'disable-tests' macro leoprikler: apteryx I think you'll need to express that as a syntax-case, but I can't help you write it :P lampilelo: apteryx: i think just wrapping substitute call and the ellipsis with begin should work bricewge: How can I get from such data sctrucutre “'(("user" . ("alice" "bob" "eve")) ("admin" . ("alice")))” to “'(("alice" . ("admin" "user")) ("bob" . ("user")) ("eve" . ("user")))”? bricewge: Should I use alist in that case? leoprikler: bricewge: first (append-map cdr groups+users) and delete-duplicates leoprikler: that gives you a list of users leoprikler: then per user (filter-map (lambda (group) (and (member user group) (car group))) groups+users) leoprikler: gives you a list of groups, which finally you can cons to the users to get the restructured alist leoprikler: your data is already an alist, so that works out bricewge: leoprikler: Thanks a bunch, it works! bricewge: Is that a convention to call alist key+value, like the previous groups+users? lampilelo: alist is a list of pairs lampilelo: alist = association list bricewge: Yes, but is it a convention to name an alist variable "key+value" as leoprikler did with "groups+users"? lampilelo: not really tekakutli: hello gentlement, finally decided to give guile a go bricewge: lampilelo: Thanks tekakutli: I have a question: what t tekakutli: what does # mean? tekakutli: like #f or #:key lampilelo: it depends on a context, #:foo is a keyword, which is just like a symbol but (symbol? #:foo) => #f and (keyword? 'foo) => #f lampilelo: #f and #t are booleans, don't have anything to do with keywords lampilelo: and #\z is a char 'z' tekakutli: thanks, I know, I was refering specifically to the # tekakutli: but yea, I guess its contextual lampilelo: by itself it doesn't mean anything, just a part of a syntax tekakutli: thanks lampilelo leoprikler: bricewge: key+value is a semantic variable here, you can name your variables however you want leoprikler: I personally do write this occasionally and there's also a procedure called car+cdr which for alists exactly produces key+value as multiple values *: leoprikler → afk again mwette: I think of # as telling the reader the next character is special; #\ for chars, #x for hex numbers, #; for comment #{ for symbol, ... There is a section in the manual about adding your own https://www.gnu.org/software/guile/manual/html_node/Reader-Extensions.html#Reader-Extensions chrislck: even more confusing #(1 2 3) is shorthand for (vector 1 2 3) chrislck: and wingo has uncovered some unusual bugs involving # recently in the reader mwette: I've used # to allow in-line expressions from other languages: https://paste.debian.net/1202498/ dsmith: #/ice-9/foo used to be reader syntax for modules rlb: wingo: while I'm still not certain I understand things well, I wondered if this might be feasible as a follow up to 0cc799185576712d69f11fc794454f2f5447bef7: rlb: --- a/module/ice-9/psyntax.scm rlb: +++ b/module/ice-9/psyntax.scm rlb: @@ -2157,6 +2157,8 @@ rlb: (lambda () rlb: (gen-syntax src #'(e1 e2 ...) r maps ellipsis? mod)) rlb: (lambda (e maps) (values (gen-vector e) maps)))) rlb: + (x (eq? (syntax->datum #'x) #nil) rlb: + (values '(quote #nil) maps)) rlb: (() (values '(quote ()) maps)) rlb: (_ (values `(quote ,e) maps)))))) rlb: rlb: rlb: O' rlb: I'll need to triple-check, but that just includes a case for #nil alongside the patch's original case for (), and it does fix the problems with lokke. dsmith: Ya, see the comment for SCM_MATCHES_BITS_IN_COMMON in scm.h rlb: sneek: later tell taylan Have you seen https://www.gnu.org/software/guile/manual/html_node/Nil.html *: rlb never remembers how that works... rlb: leoprikler: if I'm not around when taylan is, might also be plausible to mention my original motivation to fix the change in 3.0.7, i.e. rlb: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/base/util.scm#L61 which is used in methods like this: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/base/collection.scm#L712 rlb: *: rlb looks at that again to make sure he's not just doing it wrong... rlb: I'm actually not sure I understand why that fails, and/or how it'd OK for it to fail, if the problem is the handling of that (eq? #nil arg). rlb: s/it'd/it'd be/ dsmith: Anyone know how to kill a tcp client program in such a way that it doesn't shudown the socket cleanlly? Want to simulate pulling an ethernet cable out or powering off a switch. (Testing keepalives) dsmith: Sorry not Scheme related... flatwhatson: dsmith: maybe add an iptables rule to drop packets on that port? dsmith: Yeah, that might do it. But iptables. (Ugh) dsmith: flatwhatson: Using iptables worked great! Thanks. flatwhatson: no worries :) emanuele6: part daviid: dsmith: sneek is sleeping? dsmith: sneek: botsnack dsmith: :( dsmith: sneek: botsnack sneek: :) dsmith: daviid: thanks daviid: welcome! tohoyn: Happy Midsummer Eve leoprikler: rlb tbh i don't understand what this code is trying to achieve rlb: leoprikler: the require-nil syntax? It's just used elsewhere in calls like (define-method (foo (x )) (require-nil ...) ...) to make sure that foo reports an error if x is not #nil, i.e. foo should not work for #t or #f. leoprikler: I… don't understand the rationale behind doing such a thing leoprikler: is this for stuff that really wants x to be a list, but must also accept x being #nil? rlb: leoprikler: if I understand what you're asking, nil in clj is somewhat like it is in elisp, but even broader, i.e. in many places it acts like an empty collection. rlb: i.e. empty vector/set/list/map etc. rlb: so (empty? nil) is true, but (empty false) should be an error. leoprikler: ah, i misspoke, of course #nil ought to be the empty collection or false in Clojure semantics rlb: guile's current policy wrt nil worked well wrt a clj dialect. leoprikler: I'm just worrying whether you can really apply goops here leoprikler: is there a way of providing your own checker for is-a? rlb: Hmm, what's the problem you're thinking of? rlb: (So far, using goops seems to have worked fairly well.) leoprikler: imho (is-a? #nil ) should return #t leoprikler: so that in the code above you could (define-method (blah (x )) ...) rlb: iirc null is intentionally only EOL, but I may be remembering wrong. leoprikler: I don't know how GOOPS works tbph rlb: And i do use and in other places. leoprikler: but it feels weird that and null? work differently leoprikler: (same with and list?) rlb: In any case, perhaps you saw it, but this was the only real problem I was having atm, i.e. the fact that 3.0.7 broke this: https://paste.debian.net/hidden/18ce7c3c rlb: I haven't seen any issues with the goops-related bits yet. rlb: Oh, and I don't think it matters what the argument to foo is, i.e. iirc (foo 'x) would also crash. leoprikler: ahh, i think that may be related to emacs lisp where (defun frob nil ...) is valid syntax leoprikler: hum, that's weird, but I'll try in a repl rlb: I found the commit - that's what I was asking about earlier, but I need to delve a bit more on my own first.. rlb: 0cc799185576712d69f11fc794454f2f5447bef7 rlb: Didn't try the repl, but loading that file via "guile foo.scm" is how I was able to reproduce it. leoprikler: I think ice-9 match has a similar issue where (match #nil clauses) throws rlb: Right, I think the suggestion was that it may have been related to recent syntax/reader/or-similar changes. *: rlb has to wander off soon. leoprikler: rlb: (define foo (match-lambda (#nil #t) (_ #f))) leoprikler: matches #nil or '() leoprikler: I don't know whether match is acceptable in your context leoprikler: and of course if you drop the _ part, you get a match error :P kitzman: yay so I wrote my first scheme utility. https://git.disroot.org/kitzman/lieferhund . i guess adding it to guix will be better when it will have more features kitzman: (constructive) criticism is needed leoprikler: lieferhuendchen should be lieferhündchen leoprikler: I think using a peg parser might be more appropriate than string-replace-substring leoprikler: basically, you want to get to something similar to what you'd pass to Guix' mixed-text-file, e.g. '("Title: " title "\nContent: " content) leoprikler: where title and content are then replaced by the actual title and content leoprikler: I think doing this with lists and symbols directly might also be beneficial leoprikler: no need to do the text parsing leoprikler: but if you want you can translate "Title: ~~TITLE~~" to (list "Title: " title) kitzman: peg parser on the issue list now ^^ kitzman: ah, i knew about the umlaut - maybe i can use the correct spelling in the README while using the "latinized" one in the script kitzman: btw - i only lived few years there, and mostly in english-speaking communities - isn't substituting "ä" with "ae" non-official but still acceptable? leoprikler: In terms of computing it's an antiquated practise hailing from the age of dinosaurs leoprikler: we call them welpen if you need something without umlaut leoprikler: well, perhaps there's some different between welpen – puppies and hündchen – small dogs, but the analogy probably still works kitzman: "lieferwelpe" sounds cute ^^ i'll go with that dsmith-work: Happy Friday, Guilers!! roptat: is there a way to give a property to a procedure, so that I can read it later with procedure-properties? roptat: (it's enough for me if it's limited to adding properties when defining the procedure) roptat: ah, set-procedure-properties! I should have read the manual dsmith: !seen dsmith: !since sneek: I've been running for 4 days apteryx: Hello Guilers! I'm trying to define a 'define-with-source' macro that'd expand to a procedure definition and also a directive to set the source to the newly defined procedure: https://paste.debian.net/1202204/. For some reason the 'set-procedure-property!' doesn't work as intended; (procedure-source PROC) returns #f. apteryx: hints welcome :-) leoprikler: docstring body is weird leoprikler: Interestingly it works inside a REPL leoprikler: apteryx what happens if you peek the procedure properties directly after setting them inside the syntax? apteryx: I think the trick is delaying the set-procedure-property! with eval-when: https://paste.debian.net/1202205/ apteryx: the above code seems to work apteryx: instead of docstring body it could be body body* ... I guess :-) leoprikler: hmm leoprikler: apteryx: If I put the entire thing into (eval-when (load) ...) and load the compiled go, it also works apteryx: I think it's safe to do the define at expansion time, but the set-procedure-property! needs the procedure object to exist, which not being a top level syntax is not guaranteed to be at expansion time, IIUC. leoprikler: oh, so you mean it breaks if you have a procedure-local define? apteryx: What do you mean by procedure-local define? leoprikler: (define (foo ...) (define-with-source (bar ...) ...)) apteryx: I think the subtlety might have more to do with macros being able to use other top level macros, but not other top level definitions at expand time (see "info '(Guile) Eval When'") leoprikler: hmm you mean having the define-with-source in a different file from the expansion? apteryx: even locally to the expansion, the proc defined is not syntax itself, so even if it appears at the top level, the syntax being expanded can't refer to it at that time apteryx: IIUC, which may not be the case as I need to get some zzz apteryx: later :-) rlb: wingo: I'm don't yet completely understand the code that was changed, but I wondered if guarding it so that it only operates on EOL, not nil, would still accomplish what was needed. It does appear to fix the problems with lokke: rlb: (x (eq? (syntax->datum #'x) '()) rlb: (values '(quote ()) maps)) rlb: leoprikler: rlb will that still work if you terminate your list with #nil? leoprikler: other than that, IIUC syntax-case, match et al have order to them, so if you put your #nil case first, that ought to handle it leoprikler: though perhaps the syntax for that might be a little awkward, idk dsmith-work: Hey Hi Howdy, Guilers taylan: heya taylan: leoprikler: I believe the point is not to match #nil, although I haven't followed the full conversation. taylan: not sure why one would want to avoid matching it. IMO #nil should work like () in all respects and be equal? to it. leoprikler: not equal?, but match '() leoprikler: but the thing is you want to detect #nil as #f also in languages like clojure and emacs lisp taylan: if #nil doesn't equal '() then the Scheme list (foo) and the Elisp list (foo) can't be equal? to each other, which they probably should leoprikler: IOW make (match #f) also match nil? taylan: (currently indeed they aren't) taylan: match uses equal? semantics, right? to keep transitiveness of equal? I would not make #nil equal? to #f. leoprikler: I don't think match uses equal taylan: basically what I suggest is to "privilege" '() when it comes to equal?'ing #nil, because I think that's a lot more useful than equal?'ing #f leoprikler: instead, it special cases a bunch of stuff leoprikler: boolean constants being one thing leoprikler: if you specify (match #f) => matches #f and #nil, that's exactly what it does taylan: hmm. not sure how to feel about that. I've mostly just thought about this in terms of equality predicates. taylan: intuitively I'd say #f shouldn't match #nil because it's neither eqv? nor equal? to it, but I haven't used match much so far leoprikler: in that case match shouldn't do the nil either, but obviously it has to leoprikler: so match needs something else than equal? semantics leoprikler: or good ol' helper predicates taylan: IMO #nil should just equal '(), and also match it in match. consistent, and probably most useful and least surprising behavior. leoprikler: no taylan: why not? leoprikler: #nil is not equal to either '() or #f leoprikler: it is distinct taylan: I know it's currently not, but IMO that's pretty much a bug leoprikler: that's not a bug, there is a philosophical difference leoprikler: saying nil is the empty list is like saying void is any other data type taylan: Elisp nil is the empty list though. if you evaluate () you get nil in Elisp. leoprikler: I'd write that as '() ~> nil rather than '() = nil, though taylan: I guess one could argue that there is no empty list in Elisp and CL... but I don't see the usefulness of thinking of it in those terms. taylan: anyway, philosophy aside, I think Scheme '(foo) should be equal? to Elisp '(foo), and that requires (equal? '() #nil). leoprikler: I think I prefer erring on the side of uselessness in that case. leoprikler: '() is not "structurally equivalent" to #nil, though taylan: well it is if you see it as the empty list, so that's the same philosophical question as before leoprikler: comparing lists with equal? is imo weird anyway taylan: IMO pragmatism above semantic purity is preferable whenever it won't cause (more) headaches down the line. there's already some headaches #nil will invariably cause, but I think making it equal? to '() will actually reduce them. leoprikler: making #f equal to '() will cause more headaches taylan: that's not what I'm proposing taylan: just making #nil equal to '() leoprikler: not making #nil equal to #f is the same headache as the list thing though leoprikler: so i really don't get your rationale other than "I like lists", I guess taylan: I don't think so. checking boolean equivalence with equal? is probably much rarer than checking structural equivalence of lists with equal? taylan: it's basically a guess/prediction, but I'm almost sure that if we inspected all uses of equal? out there, there would be many more cases checking structural equality than Boolean equality taylan: structural equality involving lists* leoprikler: Even if that is true, I don't think that gives us the right to make some "equalities" more equal than others taylan: basically, (equal? '() #nil) => #f means that any use of equal? involving lists will "break" when an Elisp list is involved. OTOH (equal? '() #f) => #f will only "break" when an Elisp #nil intended as a Boolean involved. leoprikler: what if you have a procedure, that returns a list, including the empty list on success and #f for failure? taylan: we're assuming this is a Scheme procedure, and is called from Scheme, right? in that case you have to check (eq? result #f) anyway because (if result ...) will also break. taylan: wait, that's not entirely true... taylan: can you explain what the problem with that situation would be? leoprikler: the problem can be whatever you want it to be leoprikler: of course emacs lisp and clojure interop will not be given, so that's one problem leoprikler: there will be more depending on what you decide to do with equal? taylan: well it has to be a Scheme procedure (otherwise it can't distinguish between empty-list and false in its return), and when called from Scheme it won't pose any problem. both 'if' and 'equal?' on its result will do the expected thing. leoprikler: also, i think '() equal? #nil breaks if as well taylan: unless I suppose it just so happens to return #nil when it meant empty list, because an Elisp list got in there somehow... but in that case (equal? '() #nil) and (not (equal? #nil #f)) is exactly what you want. leoprikler: ahh, but what if Elisp #f got in there? :P taylan: no, 'if' doesn't use equal? in any way taylan: Elisp doesn't have #f :D leoprikler: What I'm saying is it breaks the semantics of if taylan: how so? taylan: do the semantics of if say that when (if x 1 2) returns 1, then for every y that's equal? to x, (if y 1 2) must also return 1? leoprikler: (if (equal? a b) (equal? (if a 1 0) (if b 1 0))) leoprikler: It's at least a headache taylan: it certainly is, but remember that currently #nil isn't equal? to #f so we already have that headache :) taylan: so from that perspective 'if' is already "broken". (I hadn't realized this until now...) leoprikler: it would also break other stuff like and leoprikler: (and #nil #t) => #t ;; whut? taylan: no, why would that happen? 'and' hopefully relies on 'if' semantics? leoprikler: (and '() #t) => #t ;; okay leoprikler: breaking if basically means breaking your entire language taylan: as I said, 'if' is already broken if you consider that breakage. taylan: and somehow Guile Scheme still manages to work :D leoprikler: it's not if that's broken, it's your concept of equal? taylan: hmm wait, yeah I think my previous assertion was wrong. leoprikler: note that elispers expect to match the tails of their lists with if from time to time taylan: leoprikler: (if (not (equal? a b)) (not (equal? (if a 1 0) (if b 1 0)))) <- do you think this is accurate? (I'm really not sure) leoprikler: no taylan: but only because (equal? #nil #f) is false, is that correct? taylan: i.e. in a world where #nil didn't exist, it would be accurate? leoprikler: (or (not (equal? a b)) (equal? (if a 1 0) (if b 1 0))) leoprikler: no leoprikler: 'a is not equal? to 'b, but both return 1 taylan: oh, derp taylan: ok let me try that again... :D taylan: (if (not (equal? a b)) (not (equal? (not a) (not b)))) <- how about this one? *: taylan has gotten way too confused, pulls up a REPL leoprikler: hmm, lemme check taylan: I think I wrote nonsense again leoprikler: it's been a while since i did logic&computability taylan: the simple example of 'foo and 'bar defeats that, so yeah that was nonsensical again, sorry leoprikler: I posted the true tautology a little earlier, try it: (or (not (equal? a b)) (equal? (if a 1 0) (if b 1 0))) taylan: well I'm trying to find a different tautology that already breaks due to #nil, hence proving that Guile Scheme is already "broken" in a similar way that (equal? '() #nil) would "break" if taylan: let me put my logic in English first: currently, we already have a pair of values that are both false, but not equal? leoprikler: Gödel claims I can't have a proof for this, but I think the way Guile currently works is consistent. taylan: hmm, actually no, that doesn't necessarily mean it's broken leoprikler: that's not how implications work taylan: values that are both true don't have to be equal? so values that are both false don't necessarily have to be equal? either... taylan: however, in standard Scheme, values that are both false are equal? because there is only one false value... leoprikler: that is true, if you take "only one value for #f" as an axiom, then Guile violates the RnRS taylan: in that case I think it's two different layers of "breakage" at least with respect to standard Scheme. the first being, breaking the assumption that two false values are equal? this is already the case. my proposal would add a second layer: that a true and a false value can be equal?. taylan: however, I would dispute that this makes the semantics of 'if' broken, because equal? isn't eqv?... leoprikler: I would say so leoprikler: since eqv? is stricter than equal? we do have (and (eqv? a b) (equal? a b)) taylan: I don't think anything changes in that respect. (list 'foo) and (list 'foo) are also equal? but not eqv? for instance. *: taylan has to go AFK for ~25 minutes leoprikler: sure, but (cons 'foo '()) (cons 'foo #nil) is an even laxer comparison leoprikler: you need equal-modulo-nil? for that leoprikler: (or list-equal?) leoprikler: hmm, that makes me wonder… leoprikler: taylan: (if (not (equal? a b)) (not (equal? (not a) (not b)))) <- how about this one? this one at least works for pure booleans, but not much else I guess taylan: leoprikler: I mulled it over a bit while driving. I would posit that (equal? #nil '()) doesn't break 'if' because for every other equality predicate EP, "iff (EP a b) then (EP (if a 1 0) (if b 1 0))" continues to hold. so we just "break" equal? so to say. leoprikler: I humbly disagree leoprikler: using srfi-1 to define your own list equality predicate is not that difficult leoprikler: (list= eq? (cons 'a #nil) (cons 'a '())) taylan: leoprikler: BTW you can send your objection to https://bugs.gnu.org/48425 so it's documented kitzman: i encountered something that it's most probably lack of attention rather than behaviour which I don't know... https://bin.disroot.org/?ad95f95bfe8ef039#D52R2kDN9bZWPTDV5odKDdWNieL1z2EyvjK1fXJBJZwC kitzman: the returned exp is matched later, and the lambda is evaluated a couple of times. the error message is that "int-orig" is unbound (line 46). which i find unexpected leoprikler: kitzman, I think it would be slightly easier with match-lambda*, but that's a style thing leoprikler: I also don't think this definition is safe against expansion attacks leoprikler: e.g. ~~TITLE~~ = ~~NAME~~ and ~~NAME~~ = ~~TITLE~~ leoprikler: or wait, my bad, it does at least only process them once leoprikler: but it might make funky replacements, so watch out for those leoprikler: I so far don't see the problem with the thing itself, what does peek say? kitzman: i'll try match-lambda* i'm a relatively new schemer. also thank you for bringing the expansion attack in my attention, it will be useful later kitzman: hmm, the string seems okay. kitzman: i think it has smth to do with the quoting - for example if i use a let* and car, name is considered a symbol dsmith-work: Shouldn't null? be used for detecting the end-of-list? IIRC, the bit-level values of '() and #nil were very carefully chosen to make null? effient. dsmith-work: Instead of comparing directly with '() or #nil ? dsmith-work: There were huge debates about this years ago. leoprikler: match () does the right thing w.r.t. null checking leoprikler: but otherwise yeah, in plain guile use null? chrislck: Wednesday greetings? wingo: ahoy :) dthompson: yarrr dsmith-work: UGT Greetings, Guilers wingo: heya dsmith-work *: dsmith-work waves rlb: wingo: regarding your comment about using "the right EOL in that case", not sure I understood yet. In the lokke example above, I was just trying to make sure that an incoming is eq? #nil. Perhaps that's not what I "should" be doing? (Setting aside for the moment the fact that I was only using a macro for inlining, and don't actually *need* it...) wingo: the macro is the problem, it thinks #nil is the same as () in a source term wingo: is a syntax-case problem wingo: i think anyway *: wingo gtg rlb: OK, so that usage is "fine", but we might just have a bug? If so, understood, and not a big deal. I can just change it to a function for now, perhaps forever (and maybe even get it inlined). rlb: Though I wonder if I'll hit other issues given that clj has similarities with elisp on this front, and I'm doing most of the compilation via syntax expansion. rlb: wingo: bisect points to 0cc799185576712d69f11fc794454f2f5447bef7 as the commit where that #nil macro issue appeared. wingo: interesting wingo: rlb: to my mind, all of the null? calls in psyntax.scm:2880-3019 (the pattern matcher used by syntax-case) should instead be eq-null?, defined as (define (eq-null? x) (eq? x '()) wingo: #nil should probably never match () from the POV of syntax-case wingo: dunno, i guess i can see the argument for building scheme expressions from elisp, but really i think it's not too much to ask to use the "right" EOL in that case, dunno wingo: if we wanted to relax that stance, we could use eq-null? only when dispatching on patterns, but null? on incoming syntax taylan: wingo: rlb: I seem to have missed part of the conversation here so dunno if these came up: taylan: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48315 taylan: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48425 taylan: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48318 taylan: wingo: also, I sent quite a few patches to the bug tracker a couple weeks ago, hope they don't get forgotten :) *: taylan gtg rlb: wingo: hmm, I'll need to understand what you've said more carefully later, but here's where I was using that check: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/base/util.scm#L61 which is used in methods like this: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/base/collection.scm#L712 dsmith-work: Tuesday Greetings, Guilers thmprover: Random question: what's the convention for guile docstrings? I couldn't find it in the reference manual... leoprikler: thmprover: You can choose between Emacs-style "Frob VAR." and texinfo-style "Frob @var{var}." leoprikler: both are accepted and which you prefer somewhat depends on your tooling tohoyn: sneek: botsnack sneek: :) thmprover: leoprikler: for texinfo-style, can I use *any* texinfo commands? Or is it a restricted subset of texinfo? Specifically, is there a way to encode math? leoprikler: Again depends on your tooling, but AFAIK the texinfo module from Guile should not interfere with your math code leoprikler: Try object-stexi-documentation to get a closer feel thmprover: Awesome, thanks! mwette: thmprover: github.com/mwette/guile-contrib/scheme-texidoc.el is (non-robust) minor mode that will take comments in texi format preceeding a function and turn them into a doc string pasted as the first expression in a function body mwette: look at the bottom of this file: https://git.savannah.nongnu.org/cgit/nyacc.git/tree/module/nyacc/parse.scm thmprover: mwette: interesting, thanks! daviid: rlb: did that because i don't trust // installation, i mean back then i had problems becauseof that, then opted for the above schema, and then never 'changed', that schema never fails ... rlb: daviid: that was it -- apparently if you have guile and guile-3.0 installed, it won't find the former, even if it's "first" in the relevant vars, and is also guile 3.0. Or perhaps GUILE_PKG just doesn't work for unsuffixed installs. If so, we should definitely mention that in the manual, and even perhaps changing to suffix installs by default.... rlb: s/changing/consider changing/ rlb: i.e. set --program-suffix to -X.Y by default. rlb: wingo: OK, so now that that's working, lokke fails to build with 3.0.7 (was fine with 3.0.5). It fails with: rlb: Syntax error: rlb: unknown location: unexpected syntax in form () rlb: rlb: Ring any bells? daviid: rlb: is there anything you couls 'easily' spot in the NEWS file maybe? daviid: *could rlb: I wonder if I might have an unquoted () somewhere, which is normal clj, but of course isn't in scheme, and maybe I was getting away with it until the new reader or other compilation changes... *: rlb will delve later rlb: daviid: right, and worst case, I suppose I can also try bisecting. rlb: Loading this file causes the crash: https://paste.debian.net/hidden/18ce7c3c/ Do I have something wrong there? rlb: (3.0.7) dsmith: rlb: The #nil is confusing reasoning about '(), is my guess *: rlb checks 3.0.6 and then might see about bisecting the relevant region... rlb: (Though perhaps wingo will just know what it is.) rlb: 3.0.6 does it too rlb: ...automated git bisect doesn't work all that well because it keeps halting on changes to config.rpath, etc. wingo: rlb: humm, i think that is probably an issue with #nil vs '() treatment inside syntax-case... there would appear to be a few of those rlb: I think it may have broken between 3.0.5 and 3.0.6, fwiw, but bisect didn't find the right failure. I'll try again with a hopefully smarter bisect run script later. wingo: it could be that the expander thinks that #nil when wrapped in syntax is the same as () wingo: and before, a raw #nil was never wrapped in syntax wingo: manumanumanu: where does foof maintain upstream match ? wingo: ah in chibi i think wingo: https://github.com/ashinn/chibi-scheme/commit/05c546e38d886a660018c6d9a3c6bec2bcf325d7 fwiw dsmith-work: {appropriate time} Greetings, Guilers rlb: wingo: do I recall correctly that you thought that string ports (i.e. open-output-string, etc.) weren't likely to perform all that well (as compared to just gathering a list of strings/chars and reverse joining them)? hendursaga: I might finally get back into Guile coding - GNU Dico uses it for extensions hendursaga: Can anyone recommend a XML/HTML manipulation library? hendursaga: Would something like SXML be my only realistic choice? Basically I'll toying with the idea of a Dico extension that renders HTML dictionary entries into potentially structured text. pkill9: haunt uses sxml hendursaga pkill9: it lets you produce HTML from s expressions hendursaga: huh I had that in my TO-DO list to look into already... hendursaga: did the project move or has it really been archived? hendursaga: never mind I found it @ https://git.dthompson.us/haunt.git/ rlb: I'm surprised that ./configure --prefix=/some/where produces a guile-3.0.pc file in /some/where that refers to /usr/local rather than /some/where. Is that a bug? rlb: (and as a result /some/where/bin/guile-config compile produces -I/usr/local/... which isn't going to work) *: rlb tries to make sure it wasn't broken make deps after a git tree switch... civodul: rlb: you sure? guile-3.0.pc looks good to me rlb: civodul: it must have been something in my tree. It worked after a git clean -fdx, though I'd have expected the ./configure --prefix... to have clobbered any previous values. rlb: (Looks like maybe it didn't.) rlb: civodul: and what's the right way to get our configure macros to pick up that non-system guile? It looks like setting the PATH, PKG_CONFIG_PATH and ACLOCAL_PATH doesn't work. GUILE_PKG still finds /usr/bin/guile-3.0 instead of /some/where/bin/guile, even though the latter is newer (3.0.7 vs 3.0.5) and is first in the path. daviid: rlb: you need to define, export (in a my-config file) and source it (in a bash sence, like '. my-config' at least these vars, ACLOCAL_FLAGS, PATH, LD_LIBRARY_PATH and PKG_CONFIG_PATH - well, that's what i do :), it works fine for me daviid: rlb: my manually built guile 3.0 and guile-3.0.pc is also correct (it only isstrange wrt version, which says Version: 3.0.6.1-19f38a in the .pcfile, but it actuallyis 3.0.7, no idea why, but guile --version reports the correct version rlb: I have that, but I wonder if the problem is that /some/where/guile/bin/guile(-config) is first in the PATH and newer than /usr/bin/guile(-config) or /usr/bin/guile-3.0(-config), but maybe it's not checking .../bin/guile(-config) when you use GUILE_PKG([3.0]). If not, maybe it should? rlb: i.e. the system guile was configured with a suffix, but the /some/where guile wasn't. rlb: I'd have imagined the autoconf macros might check every guile and suitable guile-X.Y in the path, and take the first one that reports a matching X.Y... rlb: Have to see what they actually do, and we should document this better in the info pages. I might see about a patch if I get time (both to figure it out and to write some docs). rlb: i.e. does it rely on checking guile-config or guile itself, and what's the selection algorithm. daviid: i dothat allthe time, one terminal with theabove vars,then another pointing to2.2 ... rlb: But do all your guile /bin/ commands have a suffix? rlb: (or all not) daviid: none have suffix rlb: And what's your GUILE_PKG() invocation? daviid: http://git.savannah.gnu.org/cgit/g-golf.git/tree/configure.ac?h=devel daviid: GUILE_PKG([3.0 2.2 2.0]) - GUILE3_PROGS([3.0.7]) is only there to make sure, iif it finds guile 3.0, that it is >= 3.0.7 daviid: rlb: fwiw, no debian guile pkg installed 'here', all guile v are manually installed, in diff tree branches, /opt3, /opt2 and /opt emestee: any way to do destructuring bind on a list without resorting to syntax? RhodiumToad: match? emestee: yep thought so ;P RhodiumToad: there's also some stuff in one of the srfi modules for converting lists into multiple values lampilelo: also let-optional and let-keywords, or you could return values if possible and use let-values, call-with-values or receive RhodiumToad: I was thinking of srfi-71, which allows things like (let ((first next rest (uncons-2 somelist))) ...) leoprikler: match is syntax tho RhodiumToad: what binding construct is not syntax? leoprikler: eval >:) emestee: RhodiumToad: oh this could be useful, thanks RhodiumToad: I'm still kind of on the fence about which of the various binding constructs to use for multiple values. RhodiumToad: one can of course import just uncons etc. from srfi-71 without importing its redefinition of (let ...) flatwhatson: it's not the most ergonomic, but srfi-11 is in r6rs and r7rs RhodiumToad: I know about all the options RhodiumToad: let-values is very heavy on the parens flatwhatson: yep, just making the case for the "don't overthink it" option :P *: taylan really doesn't mind the number of parens on srfi-11 rlb: manumanumanu: there's some discussion in the info page https://www.gnu.org/software/guile/manual/html_node/Strings.html -- and yeah, I think substring always shares (substring/copy doesn't). dsmith: sneek: botsnack sneek: :) leoprikler: does anyone else get configure errors when trying to set up Gettext with a pure Guile program? leoprikler: (might be a pretty Guix-specific problem, as gcc might not be visible in dev environments) manumanumanu: So: I have a piece of code that is slow due to call/cc. I want it to be portable, which is why I am not using prompts, but I also want it to not be slow as hell. I translates pretty well to continuation-passing-style, but I could also dump performance problems on other schemes and write it using coroutine generators, of which I have a fast guile implementation and a call/cc portable implementation. manumanumanu: I am leaning towards CPS, but I am not really sure how well that performms. Lots of procedure calls, etc. Does anybody have any experience or any intuition about it? manumanumanu: Right now call/cc is by a pretty fair margin the largest cost for me. leoprikler: manumanumanu: Note, that performance isn't the only thing to consider here. Consider the API changes that would happen if you rewrite all things in CPS (assuming you already have an API). manumanumanu: There will be no API changes since this in well hidden from users. lampilelo: hi leoprikler: I don't think procedure calls are that much of a problem when writing CPS, since the continuations will be in tail position. Also, this is just my ignorance, but how would coroutine generators result in less procedure calls? Do you need to thread your continuations through many procedures? manumanumanu: Well, the cost of prompts would be that of restoring some half-large continuations done in a way guile does pretty well. What I believe I am asking is whether the overhead of the "manual" CPS will be larger. manumanumanu: I am just curious if anybody has any insight. manumanumanu: I could spend the roughly two hours converting my code just to test of course... leoprikler: There is certainly an overhead in the manual method w.r.t. code maintainability. leoprikler: As far as performance is concerned, I don't know, but I do know that Guile transforms your code to CPS under the hood, so it's certainly something to consider. leoprikler: I wonder if there's coroutine benchmarks, that one could implement in Guile prompts/manual CPS. Then you'd have a metric to go by. *: leoprikler → afk manumanumanu: meh... I go down the simple path: The coroutine version preforms admirable. The other schemes get call/cc-coroutines. emestee: i just want it known that trackballs are AWESOME mwette: howdy mwette: manumanumanu: Is there a way you can add a macro front end that uses call/cc or prompts? manumanumanu: mwette: that's what I went with. manumanumanu: But I remember porting (srfi 146 hash) to guile, and it didn't work due to them relying on full continuations. For me it will be fine, but I don't like the idea of incompatibilities manumanumanu: So, guile does copy-on-write for strings, at least when there are shared substrings. But does it hold on to huge strings if I have 50-char substring? leoprikler: probably maybe leoprikler: I don't think it does if you're explicitly copying them though dsmith: ninety-nine guilers are here in the chan dsmith: ninety-nine guilers are here.. dsmith: if one of those guilers should happen to /part dsmith: ninety-eight guilers are here in the chan apteryx: hello! is there a way to programatically retrieve the source code of a procedure? RhodiumToad: in theory there's procedure-source, but I don't see it returning anything other than #f manumanumanu: apteryx: you could define it yourself, if it is supposed to be used in a system where you don't need to retrieve source of built-ins manumanumanu: either using applicable structs where you store the source and the lambda (and some identifier-syntax trickery to make recursive calls fast), or by some hash-table thingie (probably less robust. proceduce equality is a bit weird due to... eh... beta-reduction??) apteryx: RhodiumToad: eh, that's my experience with procedure-source as well RhodiumToad: manumanumanu: I think you can just explicitly set the source property on a procedure, too manumanumanu: even better! :) apteryx: manumanumanu: thanks for the hints RhodiumToad: (set-procedure-property! foo 'source whatever) makes a subsequent (procedure-source foo) return whatever RhodiumToad: at least by default the compiler doesn't seem to set that, I don't know if there's maybe a knob for it manumanumanu: apteryx: if you want to, you could define a module that redefines define to do what RhodiumToad suggests. That would be the best solution. daviid: i've pushed a few important patches to g-golf, overriding some gdk-4 clipboard related functions (methods) and added a clipboard.scm gtk-4 example, to the devel branch - pretty cool the clipboard example ... :) civodul: hmm, can't #:re-export srfi-1 'delete' without getting "overrides core binding" warnings at run time RhodiumToad: shouldn't that be a #:re-export-and-replace ? civodul: ah ha, true! civodul: lemme check civodul: i had forgotten about that one, thanks RhodiumToad! civodul: i was close to being creative and use something other than 'delete' as a syntactic keyword for my macro :-) taw10: manumanumanu: An 'applicable struct' solves a similar problem for me, but I could never find any documentation on how to create them. Do you have any pointers? leoprikler: In GOOPS you can inherit , dunno about C taw10: leoprikler: Thanks. But when creating a new "", where does the procedure body go? civodul: taw10: i don't think applicable structs are documented, but see in boot-9.scm dsmith-work: Morning Greetings, Guilers Zelphir: Hello dsmith tohoyn: hello manumanumanu: taw10: you have to use the low level interface. an example: https://github.com/lloda/guile-newra/blob/ee633920bd779463e43510ed07db17ce296eb85d/mod/newra/base.scm#L179 taw10: civodul, manumanumanu: Interesting, thanks! RhodiumToad: taw10: in goops, you can inherit or stis: heya guilers! civodul: by any chance, does someone have a reader and/or pretty-printer that can deal with comments? wingo: civodul: what do you mean? which returns comments in the result? civodul: wingo: yes civodul: apparently Racket has "special comment" values: https://docs.racket-lang.org/reference/Reading.html wingo: i don't have one but it should be reasonable to build from read.scm civodul: yes, i guess so civodul: i was looking for a quick'n'dirty way to hack something atop 'read' civodul: but it's probably safer to just hack 'read' directly civodul: s/probably/undoubtedly/ :-) dsmith-work: civodul: No Comment civodul: :-) *: wingo has an ,optimize-cps repl command, that prints in a standard-ish form kinda like llvm ir civodul: wingo: oh, that can be handy! dsmith: !since sneek: I've been running for 6 days dsmith: Ur? dsmith_: !seen dsmith: !uptime sneek: This system has been up 6 weeks, 21 hours, 55 minutes dsmith_: sneek: botsnack sneek: :) dsmith_: !uptime sneek: This system has been up 6 weeks, 22 hours, 1 minute dsmith_: !since sneek: I've been running for 52 seconds dsmith: !since sneek: I've been running for one minute and 3 seconds unknown_lamer: dsmith: so I guess adding multi-server support to sneek *really* would have been a waste of time ha unknown_lamer: rip freenode dsmith: unknown_lamer: Heh. Yeah. Gone gone gone. unknown_lamer: 20y 29w apparently since I registered and the day it died *: unknown_lamer is getting old now dsmith: Ya. #guile had about 12 users then dsmith: Not sure why ! commands are not working from my work nick *: sneek yawns sneek: Remember, the S in IoT is for Security dsmith: https://isfreenodedeadyet.com/ dsmith: sneek: seen rotty sneek: rotty was last seen in #guix 3 months ago, saying: hmm, this is qemu (via libvirt/virt-manager). dsmith: sneek: test chrislck: Wednesday greetings dsmith-work: UGT Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) dsmith-work: !uptime sneek: This system has been up 6 weeks, 1 day, 14 hours, 3 minutes dsmith-work: !since sneek: I've been running for 16 hours apapsch: Hi, what is the recommended way to copy from port to port? I have a input port from (pipeline) result and want to write to a file. Currently I (get-bytevector-n!) in 8KB chunks and then (put-bytevector) to the output port, though it seems rather verbose leoprikler: that is indeed what you're supposed to do unless you somehow want line-based stuff leoprikler: see the Guix download logic as well ;) apapsch: alright, thanks :-) i think i'll go with get-bytevector-n without the !, seems a bit easier to use. guile docs don't mention that it returns an eof-object, while the r6rs doc says so. is it a docs issue or does the impl differ from r6rs? dsmith-work: apapsch: If you are willing to go linux-specific, sendfile and copy_file_range move data around without copying to userland. dsmith-work: https://man7.org/linux/man-pages/man2/sendfile.2.html dsmith-work: https://man7.org/linux/man-pages/man2/copy_file_range.2.html apapsch: dsmith-work: thanks, but that's going even deeper into the weeds :-) i'll make a mental note for the optimization on a rainy day dsmith-work: Guile does have sendfile. Often used in web servers. copy_file_range is new to me. Looks very interesting. apapsch: indeed interesting. though it requires a count parameter, which I can't know beforehand (the input port returns the xz output from the pipeline) wingo: miscompilation bug has me delving in the guts of "match" :/ manumanumanu: haha. how much syntax rules can you take? wingo: omg wingo: (use-modules (srfi srfi-9) (ice-9 match)) wingo: (define-record-type wingo: (make-pair head tail) wingo: pair? wingo: (head pair-head) wingo: (tail pair-tail)) wingo: (define (test x) wingo: (match x wingo: (($ (x ...) (x ...)) wingo: (pk x)))) wingo: what do you think (test (make-pair '(1 2 3) '(1 2 3 4))) does wingo: aaaaahhh!!! manumanumanu: no guess. wingo: ok this one is simpler wingo: (use-modules (ice-9 match)) wingo: (define (test x) wingo: (match x wingo: (((x ...) (x ...)) wingo: (pk x)))) manumanumanu: I think I know what it SHOULD do. *: dsmith-work really needs to lean match sneek: Yes please wingo: run as (test '((1 2 3) (1 2 3 4))) manumanumanu: oh yes wingo: am i misunderstanding something???? wingo: i thought the two "x"'s in the pattern would unify manumanumanu: yup. manumanumanu: that shouldn't match? wingo: consider (match-lambda ((x . x) x) (_ #f)). returns false unless a pair and car and cdr are equal? wingo: but (match-lambda (((x ...) (x ...)) x) (_ #f)) -- should return false unless a 2-element list and first and second elements are the same list wingo: but not the case apparently?? manumanumanu: wingo: (chibi match) does the same manumanumanu: Maybe I should continue my work to port Trivia from CL... wingo: does the same as guile you mean? manumanumanu: racket match fails: (match x ((list (list x ...) (list x ...)) x)) manumanumanu: yes manumanumanu: and the code is the same. manumanumanu: I would guess wingo: right i think we use foof's match so it would make sense that chibi & guile's behavior has the same bug manumanumanu: That kind of syntax-rules is no fun to debug. I know. I wrote this: https://git.sr.ht/~bjoli/goof-loop/tree/master/item/goof-impl.scm#L120 manumanumanu: ocaml does the correct thing as well. wingo: this causes a miscompilation, as you might well imagine :/ manumanumanu: I thought you thought this was a result of a miscompilation, which is why I compared to chibi. wingo: seems to be an artifact of the optimizations for (p ...) -- match.upstream.scm:512 wingo: because ((x . _) (x . _)) does correctly unify x manumanumanu: foof hangs in #scheme, btw wingo: manumanumanu: because the compiler uses match, it actually causes a miscompilation :) manumanumanu: That is better than "We have a miscompilation. it manifests itself in (ice-9 match)", though... wingo: marginally :P dsmith-w`: Morning Greetings, Guilers dsmith-w`: !since dsmith-work: !sinc dsmith-work: !since dsmith-work: !uptime dsmith-work: sneek: botsnack sneek: :) leoprikler: sneek: seen dsmith-work sneek: dsmith-work was last seen in #guile one minute and 43 seconds ago, saying: sneek: botsnack. dsmith-work: !uptime dsmith-work: Odd leoprikler: what's !uptime for? dsmith-work: leoprikler: Shows $(uptime -p) dsmith-work: Hmm. All the bang command seem broke dsmith-work: commands manumanumanu: wingo: I ha manumanumanu: wingo: sorry; I have a 4-line patch to implement definitions in cond and case clauses, by switching (begin ...) => let in boot-9.scm. Would that be of interest, or is that a no-go? manumanumanu: 3-line, sorry. manumanumanu: regarding prior art in the area: this is what racket does for cond and case clauses. begin is the only form with a body that actually warns about define in expression context. manumanumanu: Guh... I forgot when and unless... awaiting further instructions manumanumanu: (I am back on my phone, that's why). ArneBab: avp: nice! flatwhatson: daviid, raghavgururajan: i've got guix gtk4 built, but g-golf example aborts with "GLib-GObject:ERROR:../glib-2.68.0/gobject/gbinding.c:898:g_binding_class_init: assertion failed: (gobject_notify_signal_id != 0)" daviid: flatwhatson: oh nice, the gtk-4 build - never seen that error, but let's investigate daviid: flatwhatson: so, it very much feels like not a g-golf bug (everything works fine here), but i'd be happy to (try to) help - 1st, does gtk-4 has a test-suite, does itpass? daviid: flatwhatson: i bet you see the same error with both example? flatwhatson: daviid: yes same with both daviid: flatwhatson: right, something went wrong either with the build, or the executionenv ... flatwhatson: i agree this is most likely not g-golf's fault, it might be a problem with gtk4 package or my precarious setup to get this far :) daviid: flatwhatson: justr asked on #introspection for somehint,including ifthere is a 'better' channel (then #introspection) for quiz related to building gtk flatwhatson: raghavgururajan mentioned he needed help getting gtk4 tests working, so that is probably the best way forward flatwhatson: yeah, tests are currently disabled for this gtk4 build daviid: flatwhatson: ok, i thing the very first thing to do is making surethe gtk-4test suite pass daviid: flatwhatson: i'll let you know if/when #introspection answer ... meanwhile, see if you can join one of the gnome chamnels and ask for help - https://wiki.gnome.org/action/show/GettingInTouch/IRC?action=show&redirect=Community%2FGettingInTouch%2FIRC daviid: #gtk i guess #gtk (Matrix or irc) - GTK+ toolkit and GLib channel flatwhatson: sure, thanks :) daviid: flatwhatson: irc.gnome.org, notlibera.chat daviid: flatwhatson: tx you, i think it is extremely important to get gtk-4 in guix... flatwhatson: daviid: yep absolutely! i need to put it down for a bit but will keep chipping away daviid: tx you, raghavgururajan and who's involved of course ... raghavgururajan: flatwhatson and daviid: Thanks for working on this. :) *: raghavgururajan joins #gtk on GIMPnet taylan: sneek: hello leoprikler: raghavgururajan: Your GTK 4 stuff probably gets mixed with the older GLib/GTK stuff from the environment. Sometimes purifying helps, but not always. stis: Tja guilers! manumanumanu: Tjabba! manumanumanu: stis: what's up? stis: answering the question of how I would like to interact with data tables to replace excell stis: manumanumanu: ^ ^ manumanumanu: For you own sake, or for the public good? manumanumanu: because the later case, I hate to tell you: excel is going nowhere :P stis: probably just mine ;-) as I'm an outlier, but I do hate excell stis: cell based formulas is soo overrated stis: just lead to spaghetti hell stis: and I basically never hit use cases where cell based formally shines (on the spot editing of large datashetts with instant updates) leoprikler: org-mode tables are nice leoprikler: if you really need spreadsheets tho, just use libreoffice instead :P apteryx: is there something available in guile to compute md5 checksums? apteryx: looking at https://www.gnu.org/software/guile/libraries/ there's 'hashing', but the link it points to is dead apteryx: looks like it may have been absorbed into https://weinholt.se/industria/industria.html daviid: sneek: guile-software sneek: guile-software is at http://sph.mn/foreign/guile-software.html daviid: apteryx: ^^ lampilelo: apteryx: maybe guile-gcrypt? gcrypt has md5 so i would guess the guile wrapper would expose it too lampilelo: i use a custom wrapper for hashing functions from nettle for my project lampilelo: yeah, guile-gcrypt has md5 apteryx: lampilelo: looks like yes! thanks apteryx: daviid: thanks for the link *: wingo finally writes a proper dump-cps routine dsmith: lampilelo: That's about the most concise explanation I've seen. dsmith: It not a hard concept, but sometimes hard to explain dsmith: sneek: modules? dsmith: sneek: remember modules is (use-modules (foo bar baz)) means to search for the baz in the file foo/bar/baz.scm, relative to any dir in the path. sneek: So noted. dsmith: sneek: modules? dsmith: sneek: what is modules? dsmith: sneek: modules is (use-modules (foo bar baz)) means to search for the baz in the file foo/bar/baz.scm, relative to any dir in the path. sneek: Okay. dsmith: sneek: what is modules? sneek: Someone once said modules is (use-modules (foo bar baz)) means to search for the baz in the file foo/bar/baz.scm, relative to any dir in the path. dsmith: sneek: forget rememeber modules sneek: Okay. dsmith: sneek: forget modules sneek: Okay. dsmith: sneek: modules is (use-modules (foo bar baz)) means to search for the module baz in the file foo/bar/baz.scm, relative to any dir in the load path. sneek: I'll keep that in mind. dsmith: sneek: modules? sneek: Someone once said modules is (use-modules (foo bar baz)) means to search for the module baz in the file foo/bar/baz.scm, relative to any dir in the load path. daviid: dsmith: great! i would say '... search for the module defined as (define-module (foo bar baz) ...) in the file ...' daviid: dsmith because 'beginners' often think (define-module (baz) ...), (use-modules (foo bar baz)) or (define-module (foo bar baz) ...), (use-modules (baz)) ... will 'also' work ... daviid: leoprikler: when time permets, could you kindly update the gtk gitlab g-golf 'page' to mention that g-golf also works with guile 3.0 (>= 3.0.7), thanks! daviid: *permits daviid: and Gtk-4.0 if 'possible' emestee: there's no guile on Windows, correct? leoprikler: Guile 2.2 has a MinGW and Cygwin port IIRC, dunno about Guile 3.0 but it's at least WIP leoprikler: daviid: https://gitlab.gnome.org/leoprikler/gtk-web/-/jobs/1344379 currently building, let me know if there's an issue leoprikler: gtg now dsmith: sneek: forget modules sneek: Consider it forgotten. dsmith: sneek: modules is (use-modules (foo bar baz)) means to search for the module defined as (define module (foo bar baz)) in the file "foo/bar/baz.scm", relative to any dir in the load path. sneek: I'll keep that in mind. flatwhatson: sneek: it should be define-module flatwhatson: sneek: botsnack sneek: :) dsmith: Bah! dsmith: sneek: forget modules sneek: Okay. dsmith: sneek: modules is (use-modules (foo bar baz)) means to search for the module defined as (define-module (foo bar baz)) in the file "foo/bar/baz.scm", relative to any dir in the load path. sneek: Okay. dsmith: flatwhatson: Thanks dsmith: daviid: Thanks too! chrislck: sneek: botsnack sneek: :) lampilelo: it's kinda amusing kitzman: so another beginner question - (sxml match) - is there an (undocumented) way of matching elements, but not ordered? it seems so obvious that the matching should not care about ordering... kitzman: i guess sxml fold... but still, it's a bit unexpected manumanumanu: kitzman: what do you want to do? manumanumanu: pre-post-order is my swiss-army-bazooka of choice for most things kitzman: i'm trying to process an atom feed. the tags are not in the same order for every feed manumanumanu: oh, sxpath maybe? kitzman: apparently foldt checks if it's an atom. i was trying to write my own fold function, which instead of (atom? ...) would have a match kitzman: that would work indeed manumanumanu: kitzman: https://docs.racket-lang.org/sxml/sxpath.html is probably the best documentation manumanumanu: and is not racket specific kitzman: seems to work for now, thank you. panicked a bit manumanumanu: np. manumanumanu: glad to help! manumanumanu: ArneBab: just FYI, I am making (syntax define) compatible with 3.0 and expanding it to be complete with when and unless. I did some restructuring to allow making shims for srfi-71, 11, 8 and (ice-9 match). manumanumanu: In guile3, you get definitions in _all_ expression contexts with no penalties. in guile2 you get definitions in expression context that is as slow as letrec :) manumanumanu: rlb: the above might be useful for lokke. I am pushing it later tonight manumanumanu: to the repo at https://hg.sr.ht/~bjoli/guile-define rlb: manumanumanu: interesting - thanks. ArneBab: manumanumanu: very cool! kitzman: hm, what is the general consensul on GOOPS vs srfi-9 records? i would go with the latter because it's schemish kitzman: sensus* kitzman: i guess one would only need goops when needing inheritance manumanumanu: I would go with goops when I need generic methods leoprikler: Who needs records, when you can have closures? :P leoprikler: Just pick whichever abstraction suits your needs and feels helpful :) manumanumanu: otherwise I would go with r6rs records if I need inheritance. I usually go for srfi-9. kitzman: nice, i'll do records because i don't need anything specific for now manumanumanu: r6rs records also supports the nongenerative clause which is pretty nice to use when you are doing repl thingies and have data defined in the repl. kitzman: writing yet another rss news aggregator/processor (i.e: one can configure it - you want a desktop notification? you want mails a-la mailing list? you want mails to go to your own nntp server?) manumanumanu: But I might just be doing things in a bad style :) kitzman: seems like a handy feature kitzman: a bit of an uneducated question - does the dynamic wind "out" execute even if errors happen? leoprikler: you mean stuff like scm_dynwind_free? manumanumanu: in case of (error "..."): no avp: FWIW, I managed to write my first Guix package -- for Guile-SMC: https://github.com/artyom-poptsov/guile-smc/blob/master/guix.scm daviid: leoprikler: ok tx! kitzman: decided to try out (web client). for a request, wouldn't it be sufficient to do (read-response-body request) ? the port is closed and there's an error getting thrown because of that kitzman: the port is open if i check it, but probably when i finish reading, it closes kitzman: oh #:streaming? ^^ daviid: raghavgururajan, flatwhatson great! good work on guix gtk-4 pkg and good luck ... when you have a working pkg, you may try g-golf examples/gtk-4/*.scm and let me know rlb: manumanumanu: I've been away from that work for a bit, but assuming I get back to it, I think one of the key decisions we'll need to make is whether we "just want utf-8 strings" for more or less transparent interop, etc. That's what I have, though there are two physical "types" (underneath), ascii vs non-ascii. The former can be (and is) indexed directly (and may end up being pretty common for now), but of course both are utf-8. In rlb: that world, I suppose you might use switch to the "immutable text" srfi when you need "more". rlb: manumanumanu: and of course aside from "transparent/possibly-less-expensive" interop, we might also have better perf in some cases given likely optimized versions of utf-8-related code, the ability to just use bulk memcpy, etc. Dunno. rlb: (cache locality), but all of this is tradeoffs everywhere you look... emestee: is there a library for finite state machines I should use instead of reinventing the wheel? leoprikler: emestee p sure guile-fsm exists leoprikler: okay, maybe not, but there is this thing for guile 2.2: https://github.com/artyom-poptsov/guile-smc emestee: yes that's a little overkill for what I'm doing emestee: I havent found anything else emestee: I guess I'll implement it with ice-9 match and be done with it ;P leoprikler: if it's just for string matching you can also use pegs emestee: hmm, is the use of [ frowned upon? emestee: it seems popular in racket but seldom in Guile code leoprikler: It's generally a matter of taste imo. leoprikler: I personally don't find the arguments for [ very convincing emestee: match patterns are easier to grok, for me leoprikler: for match patterns, i'd really use ( emestee: I am developing normal lisper brace vision, yeah :D leoprikler: Also through my investigations I've learned that [] is not valid R5RS, though it is valid R6RS. emestee: this is due to absence of support in the reader I imagine? taw10: Rainbow parentheses in the editor seem to solve the same problem better, for me at least. Once I got them set up, I forgot all about [..] emestee: yup just set it up 10 minutes ago manumanumanu: I think many see it as a waste of matching pairs. [] could be much more manumanumanu: A shortcut for https://hg.sr.ht/~bjoli/megacut/browse/readme.txt?rev=tip maybe? :) manumanumanu: [+ %2 (* %1 2)] => (lambda (%1 %2) (+ %2 (* %1 2))) manumanumanu: the infix syntax srfi already stole { ... } lampilelo: that would be really cool abcdw: hi guile! Why (display '(1+ 2)) produces (#{1+}# 2) instead of (1+ 2) ? sneek: Welcome back abcdw, you have 1 message! sneek: abcdw, ixmpp says: would be nice to be able to `Include ` in ssh/config... im not able to use that module right now cause i need that emestee: abcdw: 1+ is a procedure with special reader syntax abcdw: emestee: Make sense. Is there a way to print a sexp without enclosing 1+ in #{}# ? leoprikler: you could cheat and use symbol->string, but that's dangerous abcdw: leoprikler: I can't modify original sexp, I need something like (print-disable 'r7rs-symbols), but for the #{}# pizzapal: hey schemers pizzapal: can you use relative paths for module load paths? pizzapal: hm, using an absolute path doesn't work either. i keep getting "While compiling expression: no code for (my-module)" when i try to import it with (use-modules)... but if i use (load "./my-module.scm"), it works dsmith: pizzapal: Normally "." isn't in the load-path. pizzapal: i added the directory with add-to-load-path. so this is what works and what doesn't: https://paste.gnome.org/pko18d7z6 pizzapal: the file shown in the paste is "physics.scm", so it is just one directory up from the one that i'm trying to load pizzapal: and i have `(define-module (box2d))` at the top of guile-box2d.scm pizzapal: oh shoot, i think i see what the problem is pizzapal: nope, i guess not pizzapal: so this works: https://paste.gnome.org/pqic50lng pizzapal: but (use-modules (box2d)) only works if i first evalulate the buffer, and then enter it in the repl *: pizzapal scratches head, picks nose, eats booger lampilelo: i mostly use (add-to-load-path (dirname (current-filename))) lampilelo: of course it won't work in the repl pizzapal: should i just install it to site packages? the guile-box2d.scm file is in development too, but i won't make any changes to it in this context lampilelo: for development i use (add-to-load-path "/full/path/do/source/dir/"), modules relative to that path should load fine lampilelo: s/do/to/ lampilelo: also you could use GUILE_LOAD_PATH env variable pizzapal: yeah, i will try the env var pizzapal: yeah, used the absolute path and all, i get the same thing "no code for module" lampilelo: how is the module defined? pizzapal: just like `(define-module (box2d))` at the top pizzapal: and then i use define-public for my public defs lampilelo: afaik the file that defines a module should be named the same as the module itself pizzapal: oooooooooh... pizzapal: yup, that was it, haha! pizzapal: thank you!!!!1 lampilelo: yeah, (use-modules (foo bar baz)) means to search for the module baz in the file foo/bar/baz.scm, relative to any dir in the load path pizzapal: i figured it just looked at the first line of the file pizzapal: but i suppose they could be compiled, so it couldn't do that then daviid: [my (brand new laptop :( kb spacebar only half works ... sorry] leoprikler: hmmm… #:search-ltdl-library-path?=#t by default, so it ought to work as before daviid: ok,so i added :$abs_top_builddir/libg-golf/.libs and it fixes the problem, but i think i 'shouldn't have to', no big deal daviid: leoprikler: in (system foreign-library), it seems it adds .libs, not sure daviid: (augment-ltdl-library-path path) ... (cons* dir (in-vicinity dir ".libs") ... leoprikler: maybe that code path is not triggered for some weird reason? daviid: andinthecomment above, "So as a stopgap solution, we add a ".libs" subdir to the path for each entry in LTDL_LIBRARY_PATH, in case the .so is there instead of alongside the .la file. daviid: leoprikler: probably not triggered, yes dsmith: sneek: later tell dsmith-work: just a test sneek: Okay. dsmith: sneek: later tell dsmith-work just a test sneek: Got it. hugo: Is there a directory-watcher -> live-reloader of guile modules available? dsmith: Ahh. Some people are using a ":" and that's seen as part of the nick. daviid: flatwhatson: i pushed a fix, could you (when times allow) pull (the devel branch), and try to build g-golf in guix without 'your fix' ... and let me know ... tx! dsmith: sneek: later tell dsmith-work, comma test sneek: Got it. dsmith: And the "," gets added too. leoprikler: sneek seems to have troubles parsing commands leoprikler: is later tell dos still a thing? dsmith: sneek: later tell dsmith test! sneek: Will do. dsmith: ok sneek: Welcome back dsmith, you have 1 message! sneek: dsmith, dsmith says: test! dsmith: leoprikler: Working. But not as cleanly as I'd like. dsmith: If you "later tell nick[:,]", It also is including the "," or ":" in the saved recipient. :( dsmith: Well any non-whitespace I guess. leoprikler: I actually meant stuff like leoprikler: sneek later tell dsmith later tell dsmith hi sneek: Okay. leoprikler: hmm leoprikler: sneek tell dsmith hi sneek: dsmith, leoprikler says: hi leoprikler: sneek tell leoprikler later tell dsmith hi sneek: Okay. leoprikler: welp leoprikler: it works FSVO works dsmith: heh sneek: dsmith, you have 2 messages! sneek: dsmith, leoprikler says: later tell dsmith hi sneek: dsmith, leoprikler says: hi dsmith: I should probably ensure that remembered nicks are only from the set "][a-zA-Z0-9_{}\`|-" leoprikler: can IRC nicks contain Unicode? dsmith: Well. Didn't used to. And the []{}` etc was becuse they are accent chars on some european encoding. dsmith: rfc1459: "Because of IRC's scandanavian origin, the characters {}| are considered to be the lower case equivalents of the characters []\, respectively." dsmith: dsmith: /nick d% dsmith: dsmith: Hmm. flatwhatson: daviid: yep it fixes the dynamic loading of libg-golf.so, thanks! dsmith: can I send a λ daviid: flatwhatson: ok, great, tx as well dsmith: Yes flatwhatson: i still need to set LD_LIBRARY_PATH to load libgirepository-1.0.so and libglib-2.0.so, but i think that's a problem unique to guix flatwhatson: how would you feel about including a guix.scm in the project? leoprikler: IIRC there exists a g-golf package upstream and it probably uses git as origin leoprikler: so you can just inherit from that package most of the time daviid: flatwhatson: yes, to the first sentence, but for the second, i prefer as things are leoprikler: (I use a similar hack in Tsukundere's guix.scm because I'm too lazy to maintain two separate versions of it.) flatwhatson: my reasoning is that the project-local guix.scm can evolve with the latest version, as dependencies or packaging might change over time flatwhatson: at a point when the upstream pkgdef is updated, they can reference the latest one from the project flatwhatson: it makes it easier for people who want to jump in testing the latest from master, they don't all need to individually work out how to package the latest again (or more likely just give up) daviid: leoprikler: not in g-golf, but in nomad maybe daviid: anyway, i'll rely on the guix contributors and the guix g-golf pkg, but tx leoprikler: flatwhatson agree in principle, perhaps disagree on the specifics, but it's always the package maintainers' choice flatwhatson: oh totally. i'm still working out what "guix everywhere" development looks like, i understand it's still a bit radical daviid: leoprikler, flatwhatson how far isguix from having a gtk-4 and deps pack? daviid: *pkg daviid: just curious, no 'pressure' flatwhatson: i honestly have no idea, haven't touched gtk packaging before daviid: ok flatwhatson: tempted to have a go at it so i can run your examples, or failing that maybe trying to port them to gtk3 daviid: flatwhatson: the search-bar example won't work in gtk-3, the searchentrysignals changed, i think apteryx: Is Guile able to FFI with C++ shared libraries? wingo: not really. if you know the symbol mangling and abi mapping you can hack some things leoprikler: daviid: It's at least one c-u away, though work is still done on wip-gnome leoprikler: IIRC raghavgururajan is working on it atm lampilelo: apteryx: swig can create a wrapper of c++ code for guile, i've never tried it with c++ so i don't know how well it works, but may be worth a try lloda: the schmutz lib that leoprikler linked to looks good lloda: i'd probably adopt that if i didn't have my own ancient wrappers apteryx: wingo, lampilelo thanks for the hints apteryx: lampilelo: hmm, http://www.swig.org/Doc4.0/Guile.html "SWIG works with Guile versions 1.8.x and 2.0.x.". apteryx: seems 2.2 is supported now (https://github.com/swig/swig/pull/1232/files). I'd have to try and see :-) lampilelo: apteryx: maybe they didn't update the page but it works for me fine with guile 3 apteryx: Seems a high value piece of software if it allows Guile to tap into any C++ library. apteryx: lampilelo: nice! pkill9: yea sounds like a coollib dsmith-work: Happy Friday, Guilers!! sneek: dsmith-work, you have 3 messages! sneek: dsmith-work, dsmith says: just a test sneek: dsmith-work, dsmith says: just a test sneek: dsmith-work, dsmith says: comma test raghavgururajan: daviid and/or flatwhatson: Gtk v4 (https://issues.guix.gnu.org/48554). Looking for help with enabling/fixing tests. flatwhatson: thanks raghavgururajan i'll have a crack over the weekend raghavgururajan: flatwhatson: Thank you! manumanumanu: How are guile strings represented internally? manumanumanu: it seems very much like vectors of chars from a performance pov. dsmith-work: manumanumanu: See the comments in libguile/strings.h dsmith-work: manumanumanu: Somestimes it's bytes and sometimes it's wide chars, depending. manumanumanu: huh. manumanumanu: thx manumanumanu: I am testing an immutable string library of my own design, and it is about half as fast on narrow strings, and anywhere 2-4x slower on wider ones. But I suspect it is a lot more compact in memory manumanumanu: but then, it is implemented in scheme manumanumanu: random access is of course a lot slower, even though it is technically O(1). dsmith-work: manumanumanu: Recently rlb was looking into changing string internals. manumanumanu: (internal representation is utf8 in a bunch of smaller bytevectors). manumanumanu: exciting! manumanumanu: rlb: what kind of thoughts did you have? dsmith-work: manumanumanu: http://logs.guix.gnu.org/guile/2021-03-05.log manumanumanu: dsmith-work: not that one, but I found the one you meant. dsmith-work: manumanumanu: yey! (the searching of the logs seems a bit wonky) manumanumanu: rlb: regarding string representation: how about storing strings as chunks of bytes? Any wide string part can be a wide type, whereas any narrow type can be represented as a regular char array. You'd waste less space than with the current "whole-string-is-wide" approach for many western languages. flatwhatson: lampilelo: i'm fairly sure std::function must not be bigger than a pointer, so function pointers are unboxed but capturing lambdas always allocate daviid: tohoyn, and g-golf 'followers', I made subtantial changes to the way g-properties are defined, added the GStrv GValue boxed type (used in css-classes properties), then g-golf now also defines(imports) GObject Binding, BindingFlags and last but not least, GObject methods - so it is now possible to bind properties daviid: I also added an examples/gtk-4 dir, with a hello-world.scm, a search-bar.scm and their respective screenshot examples - all this pushed to the devel branch daviid: tohoyn: whenever you have sometime, please pull the devel branch and try ... let me know ... flatwhatson: daviid: is gtk4 required then? i got it built with guix, but fails at runtime because i only have gtk3 flatwhatson: Typelib file for namespace 'Gtk', version '4.0' not found daviid: flatwhatson: no, it is not required at all, you can even use gtk-2 if you wish daviid: but the examples i added are gtk-4 based daviid: make check (still) refers to clutter and gtk-3, i hope i cna clean that in the future - but building g-golf does not requireanything but gi, glib andgobject flatwhatson: i had to do some nast LD_LIBRARY_PATH to get it to compile, otherwise dlopen complained about missing libraries, but I think that's a guix problem not yours daviid: flatwhatson: there is a g-golf guix package already flatwhatson: yes but it doesn't build your latest devel version daviid: ah, could be aproblem here as well then daviid: i didn't run make distcheck will do daviid: flatwhatson: make distcheck passes here daviid: fwiw daviid: flatwhatson: one change that might be 'culprit' is the develbranch changes libg-golf flatwhatson: daviid: here's my efforts: https://paste.gnome.org/pmc8ehmdy daviid: flatwhatson: note that (you probably knowbutjust to make sure) examples are distrib, not compiled, otherwise yu'd have to have gtk-4 - which is nnot meant to be... flatwhatson: yeah, i hoped to try the examples but packaging gtk4 for guix is too much for today... ':D daviid: flatwhatson: sure, but this libg-golf.so problem, could it be that my am/guile.mk is incorrect? flatwhatson: i don't know sorry, autotools are still dark magic to me flatwhatson: oh i see, maybe pre-inst-env should be setting LD_LIBRARY_PATH appropriately daviid: hum, but it does set it daviid: not sure if 'appropirately' though flatwhatson: daviid: patch for the g-golf.so: https://paste.gnome.org/ptrkc39kb lampilelo: flatwhatson: capturing lambda by itself doesn't allocate, std::function boxes it if it doesn't fit it's internal storage flatwhatson: looks like that builds into g-golf/.libs now, though i'm not sure who's responsible for that path lampilelo: lambda's size is known at the compile time flatwhatson: i removed the src path, i don't think that will ever be needed for LD_LIBRARY_PATH daviid: this sounds a bit strange to me, but i'll look into this, not exactly now though, but tx flatwhatson: lampilelo: yes, but at least for gcc i think std::function<> must be the size of a pointer? so in practice only non-capture lambdas or function pointers (basically the same thing) can be stored without allocation? lampilelo: std::function (on gcc) is 32 bits, if it can fit all the data it stores it locally lampilelo: iiuc flatwhatson: my bits/std_function.h has sizeof(_Nocopy_types), a union of various pointer types, maybe 32bits in practice flatwhatson: i assumed it would always need to store a function pointer there, but maybe lambdas are smarter than that flatwhatson: it would be nice if [this]{ my_method(); } would fit without allocation! lampilelo: we should probably look at the standard, not the code, but i'm pretty sure your example would be put into std::function without allocation, look at the _Base_manager::_M_init_functor - it uses placement new for data that fit into _Any_data union (which has the size of _Nocopy_types) lampilelo: also _Base_manager::__stored_locally lampilelo: and i think the lambda from your example is 16 bytes lampilelo: hmm, it's 8 bytes flatwhatson: oh right, std::function is 32 *bytes* lampilelo: ah, sorry, i misspelled it lampilelo: i thought about bytes and didn't notice we both wrote "bits" flatwhatson: thanks though, til :) lampilelo: these nooks and crannies of c++ can get confusing, i'm trying to make sense of them lloda: lampilelo: np, i couldn't use that code directly since i already have a crummy wrapper that does scm2c etc. I'll have to adapt it. But the idea behind the code is useful to me sneek: Welcome back lloda, you have 1 message! sneek: lloda, lampilelo says: sorry for the faulty code i gave you earlier, this should be much better: https://paste.debian.net/1200610/ lampilelo: we should make a library for c++, preferably in guile's source tree lampilelo: because right now everyone needs to reinvent the wheel lloda: i agree lloda: at the very least have some pointers in the manual lampilelo: that's for sure dsmith-work: Thursday Greetings, Guilers lloda: i simplified a bit and put it in a working example lampilelo https://paste.debian.net/1200733/ lloda: still not sure how it fits my use case, but having something like this in Guile would be nice leoprikler: fwiw there are already some Guile compat libraries out there (IIRC schmutz is one of them) lampilelo: lloda: nice, i thought about moving dest_t definition to the top of the function to simplify it but now i don't have to do it myself! what is also useful is adding "typename = std::enable_if_t>" to destructor_wrapper's template parameters list, just to be sure that destructor_wrapper can be safely free()'d lloda: i use requires now :-D lampilelo: yeah, maybe i should switch to c++20 in my project too lampilelo: lol i copied schmutz to search for it and then proceeded to type it by hand in the search bar lloda: i'm still using smobs so lampilelo: lloda: hmm... after i uploaded the last paste i made my make_destructor destroy passed objects in the reverse order for consistency, your simplified version can't do that, is this something that could be an issue to you? lloda: since you have to pass the args to scm_dynwind_cpp_destroy, i could just pass them in reverse order lloda: but it's true that the comma fold doesn't give you that choice lloda: also what happens if you declare the unwind handler several times, can one do that? lloda: like A a; scm_dynwind_cpp_destroy(a); B b; scm_dynwind_cpp_destroy(b); ... manumanumanu: Whoa! That tailify branch seems awfully web-friendly manumanumanu: it even says so in the source comment... I should really read stuff before opening my mouth avp: Hello Guilers. I just released Guile-INI 0.2.0: https://lists.gnu.org/archive/html/guile-user/2021-06/msg00036.html lampilelo: lloda: yes, it will work and they will run in the reverse order they were registered in, just like scm_dynwind_free, they just get added to a dynstack and since the data associated is allocated through the gc it should be completely safe (iiuc ofc; i tested it by interspersing scm_gc() between the calls to scm_dynwind_cpp_destroy and it was fine, maybe it needs some real life testing to be sure though) lampilelo: avp: will you publish your libraries on guix? they are not on the list: https://www.gnu.org/software/guile/libraries/ daviid: lampilelo: guile s/w list is here - http://sph.mn/foreign/guile-software.html amirouche: re tailyfication: It looks much better than mine. daviid: flatwhatson: this .libs 'problem' seems to only occur while using guile 3.0(.7) - and looking at guile's meta/uninstalled-env.in LTDL_LIBRARY_PATH is (alsonot) adding .libs, 'just' doing the usual "${top_builddir}/${dir}" - only DYLD_LIBRARY_PATH is, in that file, but that is for macos iiuc daviid: guilers, any one has experienced a foo project, that has a libfoo lib that it needs to build foo ... using 3.0.7, that 'also' fails? daviid: in a g-golf git clone, git clean -dxf, ./autogen.sh, ./configure --prefix=/opt2 --with-guile-site=yes, make uninstall (to make sure it won't find libg-golf.so from a previous install), make pass leoprikler: I'm not quite if I parsed that correctly, but I think you're encountering some trouble with the change in dynamic library loading. leoprikler: In particular, Guile 3.0.7 no longer uses libtool, so the inner workings are a little different daviid: but using guile 3.0.7, git clean -dxf, ./autogen.sh, ./configure --prefix=/opt3 --with-guile-site=yes, make uninstall (to make sure it won't find libg-golf.so from a previous install), make boum - https://paste.debian.net/1200795/ daviid: leoprikler: I think it should still find libs 'as before', though I amhappy to temporarilylocallypatch g-golf lispmacs[work]: (drain-input (uart-in-port uart)) lispmacs[work]: oops, wrong emacs window dsmith: heh lispmacs[work]: I want to be able to try to read a char from an input port, but if nothing is available (say, after 10ms) then return false or throw an error or something. I found section 6.12.13 Non-Blocking I/O but was wondering if that is the simplest way to do it lispmacs[work]: I'm just trying to clear garbage out of an input stream before sending commands to the output stream lispmacs[work]: I thought drain-input might be what I was looking for, but it doesn't work dsmith: select with a timeout should work on a serial port, shouldn't it?' ft: It does. I've done something like this: https://gitlab.com/ft/chip-remote/-/blob/master/scheme/chip-remote/io.scm#L73 dsmith: There are also some funky tty ioctls I think. From before sockets I imagine. ft: Yeah, there's stuff like VTIME in termios. But I would rather use select. lispmacs[work]: dsmith: "select"? ft: ",d select" at the guile repl. lispmacs[work]: okay, taking a look at it in the manual lispmacs[work]: I've read the description of `select' but am not understanding how to use it to be honest lispmacs[work]: so, I could put the input port as the READS parameter, with a usecs timeout ft: You give it lists of ports that you're interested in reading and writing, plus a timeout. When it returns either you can do one of those things with one of those ports, or the timeout triggered. ixmpp: hey lispmacs[work]: ft: what happens if I timeout? ft: lispmacs[work]: You can take a look at that io-read function I linked to. It basically does that. ft: It returns an empty list. lispmacs[work]: ah lispmacs[work]: ft: could you send me the git clone url so I don't have to unblock the gitlab javascript? ft: (that io-read is for a line based protocol, so it does ‘read-line’ to read) dsmith: You can give it no fd's and then it behaves just like a pure timeout, or you can not pass in a timeout, and it can block forever. ft: https://gitlab.com/ft/chip-remote.git ixmpp: is there a convenient tool for formatting guile? ixmpp: indenting it properly etc dsmith: emacs! ixmpp: but as a drive-by command line tool? ixmpp: i want to pipeline it dsmith: I've not heard of one. I wonder if it's possible to batch emacs to do that. Iv'e heard vi people do org-mode stuff that way. dsmith: I really suspect most lispers just use emacs. ixmpp: hmm ixmpp: maybe i'll see if i can pipeline vim then dsmith: I've finally gotten used to paredit. Most of it anyway. mfiano: I would check out smartparens. Switched from paredit like 6 years ago dsmith: mfiano: What's the advantage over paredit? mfiano: It does everything paredit does, plus more like allowing numeric prefices. It also works in other non-lisp modes, and pairs good with other packages like cleverparens, mfiano: Mostly though, it just seems to be less buggy. I use a lot of structural editing commands and sometimes paredit can leave the tree in an inconsistent state. dsmith: Hmm. mfiano: I guess another plus is that it's shipped with both Doom and Spacemacs, so likely has a lot more users...and is also actively maintained unlike paredit. dsmith: sneek: botsnack sneek: :) daviid: sneek: seen str1ng sneek: Not as far as I can remember. daviid: sneek: seen str1ngs sneek: str1ngs was in #guix 4 months ago, saying: hello daviid just going over your e-mail in regards to LGTM. I just had to switch to the new !event-type method vs !type. I'll test some more with removing gdk as a dependency.. daviid: sneek: seen spk121 sneek: I think I remember zzappie in #guix 20 days ago, saying: yesss. daviid: dsmith ^^ zzappie? dsmith: It does a think called metaphone matching. dsmith: I'm guessing it's supposed to match thinks like dsmith dsmith_ dsmith` ... dsmith: Kind of like soundex dsmith: It also seems to fail miserably at times. daviid: dsmith do we have to ask again then, when it 'fails' dsmith: No. It will give the same results. dsmith: For example, "sneek" and "seems" matched. daviid: that the bot 'links' zzappie and spk121 is a bit of a mistery daviid: to me, but then i am not a bot :):) daviid: well at least i think i am not, but in // universes ... who knows ... dsmith: (metaphone "zzappie") ;; -> "sp" dsmith: (metaphone "spk121") ;; -> "sp" dsmith: So it actually saves by the metaphone... dsmith: (metaphone "sneek") -> "sn" dsmith: (metaphone "seen") -> "sn" dsmith: I would like to remove that, but then all that "seen" history would be inaccessible. dsmith: I could just purge that table and start over. daviid: dsmith oh, i didn't mean to give you any work, and history is very much 'needed' i think dsmith: And it's working well enough for the most part... lispmacs[work]: select is working for me dsmith: lispmacs[work]: Yey! *: sneek dances daviid: i was just curious, and wanted to ask last time spk121 appeared here, but ok ... dsmith: I think that metaphone thing is tuned for real words. dsmith: https://en.wikipedia.org/wiki/Metaphone dsmith: It ani't pretty: https://github.com/igorhvr/bedlam/blob/master/sisc/sisc-contrib/irc/scheme/sarah/metaphone.scm lispmacs[work]: on a loosely related subject: I've noticed that if I do a pretty small write to a file output port, like 16 bytes, that force-output and sync don't actually force the data to the file lispmacs[work]: I have to actually close the port lispmacs[work]: I was wondering if anybody had insight into that. I'm on a Guix Gnu/Linux system. dsmith: Hmm. dsmith: SOunds like buffering, but force-output should handle that. dsmith: lispmacs[work]: I forget, is there a way to disable buffering? You might (or might not!) want to. lispmacs[work]: dsmith: I would say I don't need to in my use case, mainly just curious lispmacs[work]: I would end up closing the port anyway dsmith: IS it a socket? dsmith: If so, maybe need to disable nagle? lispmacs[work]: for this specific question, the output port is a file port lispmacs[work]: though the data does come down the chain from a file input port which is a FIFO dsmith: Hmm. Dare I say it: strace it! lispmacs[work]: which is tied to a serial comm port dsmith: A fifo. lispmacs[work]: strace, great idea! dsmith: Getting stuck in there perhaps. *: lispmacs[work] looks up what strace is on the internet... dsmith: strace -e write or maybe -e file dsmith: strace is kind of like wireshark for system calls. lispmacs[work]: that sounds handy lispmacs[work]: guix environment --ad-hoc strace lispmacs[work]: emacs seems to slow down a little once you have 273000 lines in a buffer lispmacs[work]: just brief pauses every once in a while lispmacs[work]: in the strace, nothing gets written until I close the port, and then all 16 bytes are writting in one write call lispmacs[work]: *written dsmith: So. Buffering. dsmith: https://www.gnu.org/software/guile/manual/html_node/Buffering.html lispmacs[work]: dsmith: I've read that, but it doesn't explain why force-output is not working here dsmith: Yeah. Wondering that myself. lispmacs[work]: unless, I have to drain some input elsewhere lispmacs[work]: ... dsmith: I *would* try setting the port to unbuffered though. dsmith: Are you sending a byte at a time, or larger chunks? dsmith: I know it's only about 16 bytes... lispmacs[work]: a byte at a time dsmith: Hmm. I would think if unbuffered that would be a write() for every byte. lispmacs[work]: okay, I'll set it to none dsmith: IF nothing else, it's a datapoint to help understand what's going on. dsmith: Sometimes, you just have to poke it with a stick to see if moves or not. dsmith: That metaphone thing does not do well with "funky" chars. Like non-alpha dsmith: The old bot in #debian had a "nick-o-meter". And it would tell what percentage lame your nick was. dsmith: "Your nick is 100% lame, ===!sam!=== lispmacs[work]: dsmith: everything is immediately dumped if I do (setvbuf op 'none) first dsmith: That means it works better? dsmith: (not sure what "immediately dumped" means) lispmacs[work]: dsmith: well, like I said, doesn't really make much practical difference in my case. I just was curious because I thought force-output was supposed to pull out things that are buffered dsmith: Indeed it should. dsmith: Smells like a bug to me. lispmacs[work]: immediately dumped means I didn't need to close the port to get the data to file dsmith: AHh. GOod then. lispmacs[work]: if I watch strace, I can see that now it is calling one `write' for each byte dsmith: Ya. Expected. dsmith: Getting stinkier every minute. dsmith: Ok, just to make sure. You *are* calling force-output on the correct port, right? lispmacs[work]: dsmith: yes. however, what I haven't tried yet was 'flush-all-ports'. I not 100% sure that buffering isn't happening further up the chain lispmacs[work]: the chain is UART -> USB -> picocom -> FIFO -> file *: dsmith shakes fist at usb dsmith: The thing is, you should really be seeing a write after calling flush. dsmith: And by "flush" I to mean "force-output" dsmith: s/to/do/ manumanumanu: In what conditions could guile receive a SIGKILL? manumanumanu: out of memory? manumanumanu: I have a some guile code for generating permutations, and trying to generate it for (iota 11) (which is very very big, I know) guile just quits with a SIGKILL emestee: if it's an out of memory issue you'd see that in dmesg manumanumanu: thanks manumanumanu: yes that was it lampilelo: manumanumanu: do you need a list of permutations or just want to iterate over them? lampilelo: because if you want to iterate, just like lloda suggested yesterday (although to someone else) you can use algorithms from knuth (they're mutating an array and visiting on every iteration) manumanumanu: oh, I have those as well taw10: Or, perhaps you need section 3.5.3 of SICP? manumanumanu: I just wanted to see if I could make a faster version of my already pretty fast lexicographical permutations code manumanumanu: so I implemented Heap's algorithm, and it is a little bit faster manumanumanu: The one that generates lexicographical permutations is fast, and can easily be made as a generator manumanumanu: it generates all permutations of (iota 10) in about 1s manumanumanu: whereas Heap's algorithm does it 10% faster lampilelo: ok, so everyting is under control manumanumanu: yes. thanks anyway emestee: ahhh I get to implement a FSM in scheme emestee: exciting ft: emestee: I think this conference call with william byrd may be of interest: https://www.youtube.com/watch?v=yrf1AYtrKm0 emestee: thanks, that can be useful flatwhatson: nice video! my "better way to do this": https://paste.gnome.org/plver7xld flatwhatson: lightbulb, it's a fold: https://paste.gnome.org/p8yaa8pfd dsmith-work: Hey Hi Howdy, Guilers ft: flatwhatson: Hehe, yeah I had this in a let: (fsm (lambda (input) (fold transition start input))) :) ft: https://paste.grml.org/hidden/aa5596d7/ flatwhatson: neat :) lloda: using Guile from C++, in { X x; scm_error(...); } x isn't destroyed. How to fix this lampilelo: lloda: that's because scm_error uses longjmp, c++ destructors won't run, what i do is use dynamic wind and a handler that calls them, of course the handler should be set up to run only on non-local exits lloda: thx lampilelo: lloda: https://dpaste.com/4H4YAG5U9 lloda: thx again, that helps lloda: i've been avoiding the obvious cases by closing scopes early etc but probably i have leaks all over the place lampilelo: yeah, it's a pain, most of the time putting stuff in { ... } is enough, the problems arise when you call scm_* and c++ functions interchangeably lampilelo: lloda: the code i posted is incorrect, you shouldn't use it lampilelo: i had a feeling something was wrong so i tested it lampilelo: it will work only if you use it once per dynamic wind lampilelo: i don't know how i thought it will work, it worked fine with my small library i wrote a while back but i called scm_dynwind_cpp_destroy once per dynwind, the problem is this thread_local variable stores only one lambda at a timem which will get replaced on every subsequent call, i don't have a solution right away lampilelo: but i have an idea stis: Heya guilers! lampilelo: hi stis stis: aret here a concept of programmers spreadsheet? mfiano: you mean like dataframes? stis: well consider constructing a spread sheet program ontop of guile, how should onw do that!! stis: Basically a framwoke of tables that allow you to filter/sort/rearrange(take-sellections etc mfiano: google for dataframe libraries mfiano: Such as https://github.com/hinkelman/dataframe stis: coolio stis: perfect!! lampilelo: you can use g-golf to make a gui for it stis: That would be perfect dsmith-work: Scheme In A Grid: https://siag.nu/siag/ manumanumanu: dsmith-work: that is a name with history! dsmith-work: manumanumanu: pre-history for some daviwil: Hey folks! I'm using (web client)'s `http-post' function to make a request to an HTTPS endpoint. My understanding is that `#decode-body?' is `#t' by default but for some reason I still receive a bytevector as the response body that is returned. The `Content-Type' header is `application/json' so I'd imagine this should be interpreted as text. Any idea what I might be doing wrong? daviwil: Passing the bytevector through `utf8->string' gives the desired result, so I suppose that's good enough for now! ft: I think that only happens if the content-type makes text-content-type? return #t. ft: So if you want to decode for other content-types too, you'll have to do it yourself, as you are. ft: daviwil: text-content-type? is (or (string-prefix? "text/" type) (string-suffix? "/xml" type) (string-suffix? "+xml" type)) daviwil: ft: Thanks! That explains it lampilelo: lloda: what do you think about this? https://dpaste.com/GM79HHZCY daviid: lampilelo: how about using a tor friendly paste service, debian, gnome ... "Your IP has been blocked for violating the dpaste.com Terms of Service...' well, happy it did, your (dpaste.com) are violating my privacy ... lampilelo: no problem, i chose dpaste because other people on #emacs use it, i thought it was alright lampilelo: daviid: if you want to take a look: https://paste.debian.net/1200603/ lampilelo: i don't think std::function allocates but i'm not sure lampilelo: if it doesn't this should be a safe way to destroy c++ objects on non-local exits RhodiumToad: daviid: paste sites are heavily abused by malware, it's not at all surprising that they would block anon access lampilelo: hmm... now that i think about it std::function always has the same size, so it will probably store the data attached to it on the heap dsmith-work: Someone was asking about http-request the other day. Did you ever get that figured out? lampilelo: ok, last revision today, if someone's interested: https://paste.debian.net/1200610/ lampilelo: switched to lambdas since they store everything inside lampilelo: sneek: later tell lloda sorry for the faulty code i gave you earlier, this should be much better: https://paste.debian.net/1200610/ sneek: Will do. lispmacs[work]: i seem to recall there was some trick I could do to hook a cleanup action to an objects garbage collection event. Am I remembering correctly? taylan: lispmacs[work]: I think they're called GC hooks? mfiano: You mean finalizers? lispmacs[work]: those both sound vaguely familiar lispmacs[work]: I think Guardians was what I used in the past lispmacs[work]: a "finalizer" sounds simpler, but I don't know how to make or attach one mfiano: They're not a trick. Infact, it is usually the developer being tricked, because they aren't reliable; they have a few caveats. dsmith: !uptime sneek: up 5 weeks, 12 minutes mfiano: Section 5.5.4 explains why they should probably be avoided. ixmpp: (lambda (f g h x) (if (f x) (g x) h)) does this function or similar exist anywhere? ixmpp: Dunno if im reinventing the wheel dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen dsmith-work sneek: dsmith-work was last seen in #guile 13 hours ago, saying: {appropriate time} Greetings, Guilers. dsmith: sneek: botsnack sneek: :) tohoyn: topoi: here is a function computing permutations: https://paste.debian.net/1200366/ lampilelo: tohoyn: it's 10x faster if you use append! dsmith: sneek: botsnack sneek: :) tohoyn: here is a permanent link: https://paste.debian.net/1200368/ tohoyn: sneek: botsnack sneek: :) lampilelo: actually using cons instead of append is A LOT faster tohoyn: lampilelo: here is an updated version: https://paste.debian.net/1200371/ lampilelo: yeah, this doesn't do any garbage collection leoprikler: tohoyn: this looks nice and all, but it computes recursive perms many times leoprikler: I think one can do faster if one counts from 0 to k instead of the other way round tohoyn: ok tohoyn: this page claims that R7RS and R6RS library syntaxes are similar: https://www.gnu.org/software/guile/manual/html_node/R7RS-Support.html tohoyn: is it so? AFAIK R6RS defines a "library" form and R7RS a "define-library" form. wingo: similar != the same tohoyn: wingo: yes, but are the syntaxes compatible as the WWW page says? wingo: you should check :) tohoyn: wingo: IMHO the syntaxes are not fully compatible, though they are similar dsmith: !since dsmith: !since dsmith: !since sneek: 23 seconds dsmith: !uptime sneek: up 5 weeks, 8 hours, 59 minutes dsmith: !uptime sneek: This system has been up 5 weeks, 9 hours dsmith: !since sneek: I've been running for 23 seconds dsmith: goodbot civodul: sneek: botsnack sneek: :) lloda: when i've had to do combinations/permutations, i've just transcribed knuth to C lloda: a library of 'best known' routines for Guile would be very nice to have sneek: /who * sneek: /who * dsmith: !since sneek: I've been running for 34 minutes and 41 seconds chrislck: lloda: isn't it a matter of copying rosettacode.org into (ice-9 algorithms) ? lloda: that sounds too simple to work, but maybe it's a starting point chrislck alextee: making an appimage and I noticed that this directory is 30mb: usr/lib/x86_64-linux-gnu/guile/2.2/ccache alextee: that's precompiled guile stuff right? is it safe to delete? dsmith-work: Morning Greetings, Guilers dsmith-work: Did someone bisect the evaluation problem with Geiser? dsmith-work: Yes! http://logs.guix.gnu.org/guile/2021-05-06.log#005719 wingo: iirc lampilelo fixed it in geiser too dsmith-work: Hmm. Works with a fresh emacs process. Proabably some old geiser code dsmith-work: Oh! It's such a delight to use! yoctocell: Is there an empty char? yoctocell: #\null ? emanuele6: you mean the null character? (ascii 0) emanuele6: that is #\nul emanuele6: but i think #\null is a valid alias emanuele6: https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Characters.html yoctocell: emanuele6 yeah, ok, thanks! lispmacs[work]: is there a convenient debugging procedure in Guile for "print out the return value of this expression and then return that return value"? manumanumanu: pk manumanumanu: (pk 'hej) => ;;; (hej) and returns 'hej lispmacs[work]: manumanumanu: okay, thanks lispmacs[work]: after doing a (load file-path) to re-load a module from the interpreter, is there any reason to ",use" the module again? dsmith: emestee: As in, not yet provided by a C library? Not sure. dsmith: However A C prog might do it could possibly be done though through the ffi. Not sure. dsmith: syscall() flatwhatson: i wonder how nyacc goes on ? flatwhatson: just fine, apparently! flatwhatson: hmm, i can't seem to convince it to emit the SYS_ defines tohoyn: xeno: could you explain the example to me, too? tohoyn: xeno: I think I got it. The key is the continuation of the call/cc expression. wingo: moo tohoyn: wingo: the corrected cumulative time counting in statprof seems to get some times wrong. I have a situation where procedure A calls procedure B but the cumulative time of A is smaller that the cumulative time of B. could you look at the code? tohoyn: wingo: I also filed a bug about statprof not displaying call counts wingo: could it be that B is ever called by not A? wingo: or that A sometimes calls B in tail position and sometimes not? tohoyn: wingo: I'll check. tohoyn: wingo: if the body of the procedure A is (if B var1 (C ...)) is the call of B in tail position? tohoyn: ^(B...) wingo: tohoyn: not in tail position tohoyn: wingo: is it so that guile optimizes the tail position calls so that they do not have a stack frame? wingo: yes, as required by the scheme semantics tohoyn: wingo. ok. tx. tohoyn: wingo: it might be useful to be able to switch this feature off tohoyn: wingo: for profiling wingo: unlikely to change in the near future fwiw, and in any case it is probably more useful to update your mental model of how scheme runs to incorporate tail calls wingo: after all, you wouldn't want a backtract to include every loop iteration, and those are tail calls tohoyn: ok dsmith: Scheme doesn't have "TCO". In Scheme *ALL* calls are actually jumps. However there *are* some exceptions, like when needing the return value, or in a sequence. RhodiumToad: eh... disputable RhodiumToad: scheme explicitly distinguishes where tail position is and makes specific requirements about tail calls leoprikler: yup, IIRC TCO stems from observations made in FP first dthompson: it's not an optimization. it's semantic. leoprikler: It's semantic in Scheme, it's not semantic in C/C++. RhodiumToad: the specific requirement as stated in r7rs is that the number of active tail calls must be unbounded RhodiumToad: that is to say, if you implement a loop via tail calls, it should not terminate unless something within the loop stops it for whatever reason leoprikler: But C/C++ compilers will look for instances in which similar semantics are used to perform so-called "tail call optimization". RhodiumToad: yes, if a function ends with return otherfunc(); then the emitted code may drop the current function's stack frame and jump to otherfunc RhodiumToad: or the equivalent RhodiumToad: but this is not required by the language so it's up to the compiler whether it happens or not RhodiumToad: (and usually won't happen if optimization is off) topoi: What is the combinatoric problem called where you pick k from n elements in a list? topoi: I could cut and filter permutations but this is profanely inefficient. RhodiumToad: does order matter? topoi: RhodiumToad: yes. topoi: Ahh, it's called "k-permutations"? : ) topoi: I often like to reimplement basic functions, but sometimes it's exhausting. : / topoi: RhodiumToad: but without repetition resp. without put back. RhodiumToad: right, those are permutations RhodiumToad: if order doesn't matter they are combinations lloda: https://en.wikipedia.org/wiki/Permutation#k-permutations_of_n lloda: variations (variaciones) is actually the name i'm familiar with topoi: lloda: How familiar are you with them? :3 topoi: I'm so desperate, I'll construct them soon from power-sets. :P dsmith-work: {appropriate time} Greetings, Guilers topoi: Okay, I hate this solution: http://ix.io/3p2G : ) manumanumanu: topoi: I have some code that generates lexicographical permutations manumanumanu: if you want to manumanumanu: have it. It is for vectors. manumanumanu: I also recall having a pretty fast powerset somewhere manumanumanu: topoi: that powerset is the same as I have :D manumanumanu: Maybe we should have some library collecting efficient versions of some maths procedures like that. We could model it after racket/math. lampilelo: omg u nuts bud: yeah. This is the last thing i really miss from my old windows setup. bud: i had this script that let me, do things like: hold right+scroll -> switch tab bud: hold left+scroll -> switch program (alt+tab) bud: right+middle close tab bud: left+middle close program bud: it was great. dsmith: The only "chording" I've ever seen before is in Plan 9 bud: YES! bud: https://0x0.st/-_p9.txt bud: this works, hold right and scroll to send control+page_up/down bud: try it in the browser! bud: and just pressing right, at least have its own function (notify-send alone) dsmith: nc tohoyn: retropikzel: terve retropikzel: tohoyn, moro emestee: I don't presume anyone here is a character terminal magician that could explain me why sending an ANSI escape command to interrogate the terminal causes the terminal to print the response locally? dsmith: emestee: What do you mean by "locally"? What are you expecting to happen? emestee: dsmith: i send an ANSI device status request to guile standard output and read the terminal's response on standard input. However, something duplicates the terminal's response to its screen. Guile is execute from the shell that lives in tmux. I don't know which component is echoing the terminal's response (e.g. encoded cursor position) back to the terminal emestee: executed* emestee: it's basically putty -> ssh -> shell -> tmux -> shell -> I assume pty -> guile dsmith: And the Guile prog does read the response? dsmith: Hmm. Might need to turn echo off or something like that. dsmith: I think I ran into something similar one time. Was sending some escapes to determing screen size. dsmith: I don't have that code here. dsmith: Hah! Found it. dsmith: emestee: Yeah, I'm disabling echo. emestee: dsmith: how? dsmith: emestee: https://paste.debian.net/1200172/ emestee: ah termios, so it *is* done by linux and not the terminal itself emestee: well then, time to abuse the ffi I guess emestee: thanks! dsmith: It's the pty I think. dsmith: A terminal is just a thing on the end of a serial port that you send chars to and read from. dsmith: emestee: There was a nice article I read recently that goes into the history of serial ports on unix and why xterm behaves the way it does. dsmith: Sadly, I don't have a link to it. dsmith: emestee: Might have been this: https://www.linusakesson.net/programming/tty/ xeno: hi, I don't get the simple call/cc example from The Scheme Programming Language: (let ([x (call/cc (lambda (k) k))]) (x (lambda (ignore) "Hey!")) - why is the last lambda evaluated rather than returned? xeno: oh damn, I think I just got it emestee: is there a method to perform arbitrary system calls? panicking: Hi All! Is there a way to specify a to each slot of a class using goops? Regards. dsmith: There was some talk a while back about Geiser not working with Guile 3. Did anyone ever get to the bottom of that? dsmith: (seems to be working for me with a fresh geiser and geiser-guile install) flatwhatson: yep i think lampilelo got to the bottom of it, so the latest should work flatwhatson: it was specifically the syntax changes in 3.0.6, was working fine before that dsmith: Oh man. I forgot how nice geiser is. flatwhatson: yep i also use flycheck-guile and turn on geiser's company-mode support emestee: is it a good style for a function to accept either a list _or_ a function that returns a list in the same argument? ArneBab: emestee: I think I would rather use define* from (ice-9 optargs) to pass a named argument: #:args '(…) or #:argument-provider fun emestee: thanks! RhodiumToad: or just accept the function returning the list; the caller can use (const '(...)) to pass a list ArneBab: RhodiumToad: I didn’t know const — thank you! stis: Hello guilers! tohoyn: I filed bug #48847 about statprof not printing call counts ix: Hello.. say i have this sexp: (public-key ix: (ecc ix: (curve Ed25519) ix: (q #7514F8D729DB1935470A581CE3851ED9FD6F1F9BAFE1D8BEC77A931ADB7A4337#))) ix: Can i reproduce that in literal guile? ix: The hashes seem to mess things up dsmith: Yeah, The Guile reader won't know what to do that #...# thing. dsmith: s/do that/do with that/ ix: dsmith: whats my best option? flatwhatson: sed 's/#/"/g' ix: Ooh, there's (@ (gcrypt pk-crypto) string->canonical-sexp) and canonical-sexp->string ix: And s/string/sexp ix: I'll use those bud: hello guile people! bud: i was looking around for something that could do "mouse-chords" bud: and found that it is possible with xbindkeys if configured with guile. bud: this is the config i am trying now: https://0x0.st/-_90.txt bud: it works and the chords are defined on the last lines. bud: holding b:3 (right mouse button) and pressing b:1 displays the popup "helloC" bud: this is cool and all, except that now, right mouse button only acts as a modifier, and i cant use it normally. bud: so what i am asking, is there a simple way to set a default command, if b:3 is released by itself? bud: https://wiki.archlinux.org/title/Xbindkeys <- this is where i got the scm file dsmith: Wow, that's pretty cool. Didn't know about xbindkeys dsmith: sneek: help later tell dsmith: goodbot Noisytoot: sneek: botsnack sneek: :) dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen wingo dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen wingo sneek: wingo was last seen in #guile 5 hours and 45 minutes ago, saying: instead the function should be identified via its code (ip). dsmith: sneek: help later tell dsmith: sneek: help dsmith: sneek: later tell dsmith-work testing sneek: Got it. dsmith: sneek: tell dsmith-work testing dsmith: sneek: tell dsmith-work testing dsmith: sneek: later tell dsmith-work testing sneek: Got it. dsmith: sneek: seen wingo sneek: wingo was last seen in #guile 5 hours and 52 minutes ago, saying: instead the function should be identified via its code (ip). dsmith: sneek: bugs? sneek: Someone once said bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile dsmith: sneek: atest is a test dsmith: sneek: atest is a test sneek: I'll keep that in mind. dsmith: sneek: seen someone here that sometimes answers to wingo sneek: Nope. dsmith: heh dsmith: sneek: what is atest? sneek: Last time I checked atest is a test dsmith: sneek: where is atest? dsmith: sneek: atest? sneek: atest is a test dsmith: sneek: forget atest sneek: Consider it forgotten. dsmith: sneek: later tell dsmith-work testing sneek: Got it. dsmith: sneek: tell dsmith-work testing also dsmith: sneek: help later test dsmith: sneek: atest is also something else sneek: So noted. dsmith: sneek: atest dsmith: sneek: atest is something sneek: Understood. dsmith: sneek: atest? sneek: atest is something dsmith: sneek: atest? sneek: Last time I checked atest is something dsmith: sneek: something else? sneek: I could be wrong, but atest is something dsmith: sneek: forget atest sneek: Okay. dsmith: sneek: forget something else sneek: Consider it forgotten. dsmith: sneek: help later test dsmith: sneek: help later tell dsmith: sneek: botsnack sneek: :) dsmith: sneek: tell lloda Hello! sneek: lloda, dsmith says: Hello! dsmith: Well! The somewhat useless "tell" coommand is working again. tohoyn: statprof-display doesn't display call counts even though I use #t as the third argument to statprof-reset tohoyn: what is wrong? tohoyn: calling statprof with "#:count-calls? #t" doesn't work either dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen rlb? sneek: rlb was last seen in #guile 2 days ago, saying: But I *did* like being able to write clj code for the browser (though I haven't been doing any of that for a good while now).. dsmith: sneek: help later tell dsmith: sneek: later tell help manumanumanu: sneek: botsnack sneek: :) wingo: dsmith: yeah, see what (system vm frame) does wingo: (get proc name from ip) dsmith: wingo: The tricky bit is getting to the SCM frame when you only have the scm_thread * wingo: all of this should be done from scheme fwiw wingo: in (system vm frame) wingo: there you have the ip because you have the stack trace canant: Hi Guys, canant: I'm a newbie on guile and trying to be familiar with and understand the fundamental concepts. canant: I couldn't get the Parameters concept. Why we need this instead of passing data as arguments? canant: make-parameter and parameterize are very hard to understand for someone like me from the C/C++ world. canant: Any help? :) taw10: canant: Think of it as kind of like an improved version of a global variable taw10: You *could* pass things round as arguments everywhere, but I'm sure you've encountered situations where that becomes a complete mess. Parameters fix that canant: Thanks, taw10. Are there any meaningful examples rather than simple official ones? canant: Those ones are so simple. canant: Uploaded file: https://uploads.kiwiirc.com/files/9055ec35f4afe73098c6e4dec0748470/pasted.txt taw10: I use it in one of my projects to help allow essentially arbitrary code to be used to create a certain type of object (https://github.com/taw10/starlet) - (lighting-state ...) expands to (parameterise ((current-state (make-empty-state))) ...), so anything inside the lighting-state form has access to the current "state" object tohoyn: you could also consider fluid-let tohoyn: see e.g. https://www.informatik.uni-kiel.de/~scheme/doc/mzscheme/node20.htm canant: Thanks again taw10 and tohoyn. I'm looking into those. taw10: Just for comparison, imagine how my lighting-state thing would look using arguments. I'd have to use some macro magic to inject the argument into every sub-form that needs it. And since there can be any type of form there, I'm not sure that's even possible. taw10: tohoyn: Guile doesn't seem to have fluid-let. Guile parameters are built on top of fluids, though. The manual recommends to use parameters rather than fluids. But sure, it's the same basic idea. leoprikler: tohoyn: with-fluid* and with-fluids* work kinda like let but take thunk as procedures tohoyn: taw10: fluid-let is easy to implement. see https://paste.debian.net/1199993/. lloda: you can use parameterize lloda: there's a bunch of stuff that has multiple versions in Guile, the original Guile version, the srfi version, the standard version lloda: i try to stick to one dsmith: Guile modules (which predate r6rs (and r5rs)) are mostly just mapping of names to scheme objects. dsmith: R6rs modules (or is it libraries?) expose *immutable* bindings to objects. dsmith: For the benefit of compilers I guess. dsmith: But sometimes, you just need to provide a value that can change. dsmith: So then comes in parameters. dsmith: Through an immutable binding, you get or mutate a value. lloda: you don't need a parameter for that. You can export a box dsmith: Did r6rs provide boxes? tohoyn: use one-element vectors dsmith: I've always thought the parameters were a r6rs thing. Pretty sure Guile didn't have them until it started added r6rs support. lloda: guile had fluids, which are the same thing dsmith: Yes. But I think r6rs lib immutability is the "why?" of parameters. mwette: sneek: botsnack sneek: :) dsmith-work: Happy Friday, Guilers!! sneek: Welcome back dsmith-work, you have 4 messages! sneek: dsmith-work, dsmith says: testing sneek: dsmith-work, dsmith says: testing sneek: dsmith-work, dsmith says: testing sneek: dsmith-work, dsmith says: more testing dsmith-work: goodbot *: sneek wags manumanumanu: dsmith-work: parameters are for dynamic binding. I use them to change behaviour of libraries whern parameters doesn't cut it manumanumanu: You _can_ use parameters to change variables in a library, but boxes are probably more efficient dsmith-work: manumanumanu: Soo... You use parameters when parameters aren't good enought? ;^} manumanumanu: dang dsmith-work: heh manumanumanu: I meant parameters as in function arguments dsmith-work: Indeed. :) dsmith-work: But still fun. dsmith-work: (Please! No offence meant!) lispmacs[work]: manumanumanu: this is scheme. Infinitely recursive explanations are okay. lispmacs[work]: how do I change the current working directory, in regards to relative paths in (load path) commands? lispmacs[work]: (chdir path) seems to work lispmacs[work]: sneek: give lispmacs a botsnack sneek: :) lispmacs[work]: sneek: quit smiling *: sneek gives lispmacs[work] a botsmack amirouche: goodbot leoprikler: lispmacs[work]: there's also string-tokenize IIRC, plus good ol' regexp and peg flatwhatson: ah, i see doc-snarf is in need of some love... was hoping to use this for my projects flatwhatson: i found your patch for (define*, thanks leoprikler! flatwhatson: it seems to struggle with internal docstrings though, so some more attention is needed flatwhatson: i'm thinking the way forward might be to start with adding some test cases robin: uh, i think i just killed sneek, by asking it "help later tell" robin: i don't remember who runs sneek or i'd ping them directly, sorry about that :( leoprikler: flatwhatson if by internal docstrings you mean the "First string in a function", then I'd rather suggest the texinfo module(s) manumanumanu: dsmith-work: see what robin wrote above. robin: ty manumanumanu manumanumanu: robin: np. It is a funny bug :) leoprikler: I once confused sneek using tell later tell leoprikler: Then tell was disabled, but it seems later tell is the real bug :P leoprikler: Or rather it appears sneek doesn't know what to do with multiple commands manumanumanu: Is there any IRC library for guile? flatwhatson: leoprikler: ah thanks, will look into it leoprikler: I think 8sync might come with something, but I'm not sure flatwhatson: https://git.savannah.gnu.org/cgit/8sync.git/tree/demos/ircbot.scm manumanumanu: I just realized guile is pretty fast starting up. On my system it even beats python3. Only perl and python2 is actually faster. manumanumanu: RhodiumToad: I remember john asking you about some bytes->hex thingie (you have a lovely sparse array imlpementation). Did that ever materialize? Did you ever put it in a library? It would be great to have RhodiumToad: I think you mean this? https://github.com/RhodiumToad/scheme-bits/blob/master/hex/hex.scm wingo: moo RhodiumToad: it's not really a sparse array as a cheating way of storing 257 distinct values per byte RhodiumToad: rather than storing byte x at index i, it stores (- x (logand i 3)) because due to the nature of the values stored, we know that x can't be less than i RhodiumToad: and we also know that if x is 255, (logand i 3) is not 0 RhodiumToad: so the upshot is that the value 255 never needs to be stored, so we can use it as a flag for "this value isn't valid" emestee: wait, guile has sparse arrays?! RhodiumToad: ? RhodiumToad: who said it did? civodul: when you have a URI-reference relative to some URI, what's the proper way to build the corresponding URI? civodul: as in: URI-reference + base-URI => URI lloda: my readline troubles are over after... reinstalling the proprietary nvidia driver. That doesn't use libedit while the mesa driver did. Haha. dsmith: sneek: seen robin? sneek: Not as far as I can remember. dsmith: sneek: help later tell dsmith: sneek: botsnack sneek: :) dsmith: sneek: help later tell dsmith: sneek: botsnack sneek: :) lloda: sneek: later help tell lloda: sneek: how far can you remember dsmith: sneek: seen rlb sneek: rlb was last seen in #guile one day and 17 hours ago, saying: But I *did* like being able to write clj code for the browser (though I haven't been doing any of that for a good while now).. dsmith: sneek: robin dsmith: lloda: say that "help later tell" command again, and then stay quiet for a bit please. I want to see something. dsmith: (or anyone) lloda: sneek: help later tell dsmith: sneek: seen lloda? sneek: lloda was in #guile 56 seconds ago, saying: sneek: help later tell. dsmith: Ok! dsmith: C0ol RhodiumToad: lloda: why would mesa use libedit? lloda: apparently it comes through llvm RhodiumToad: hmm... lloda: and llvm added it for convenience since a couple libraries using llvm also needed that functionality RhodiumToad: that seems like a bug lloda: from what i read yesterday lloda: i agree RhodiumToad: yeah, that's definitely bad manumanumanu: RhodiumToad: that's the one! Thank you! alwalo: Sorry I am not trying to spam, but I think my messeges were invisible cause I didn't finish registration on IRC, now I finished and I send my question again (doesn't mean to spam) sorry if it was visible before alwalo: I am using (http-request "url") without any other parameters, I do get error: web/http.scm:252:2: Bad media-type header component: "text/xml", of course I am trying to download xml file, how should I do it ? dsmith-work: Thursday Greetings, Guilers emestee: alwalo: that doesnt sound right, are you sure the remote server is functioning correctly dsmith-work: wingo, civodul: Might be a good idea to update the /topic to mention that your nick must be regisered to speak in the channel. civodul: dsmith-work: oh, was it the case back on Freenode? dsmith-work: civodul: I don't remember. dsmith-work: There was a weird thing that I couldn't change my nick back unlesss I parted the channel. alwalo: here is my sample code that results in error: https://pastebin.com/PwpzPyNH alwalo: there is misspelling in last (display) call but it is because I had to retype it by hand alwalo: I have now checked it exact same program written in Python using Requests library and everything works fine, file gets downloaded and saved on drive dsmith-work: alwalo: I would wireshark the attempts for both and compare what is different. Possibly a missing content-type header? dsmith-work: alwalo: Maybe somtething this is needed: (http-request "http://myurl" #:headers '((content-type application/xml))) dsmith-work: alwalo: Or maybe need an Accept header? alwalo: can you give an idea how #:headers should look like ? alwalo: web/request.scm:133:2: In procedure validate-headers: alwalo: Bad request: Bad value for header accept: (application/xml) dsmith-work: Posisble (http-request "http://142.250.191.110/" #:headers '((accept (application/xml)))) alwalo: web/http.scm:252:2: Bad media-type header component: "text/xml" lispmacs[work]: leoprikler: string-tokenize sounds pretty close to what I want, though I'm not sure about the challenges of applying that to a live input stream in my use case dsmith-work: alwalo: Hmm. I dunno. ((@@ (web http) validate-media-type) "text/xml") -> #t dsmith-work: Not sure why that's Bad dsmith-work: alwalo: Did you wireshark and compare? dsmith-work: alwalo: How about this, try adding #:validate-headers? #f to your http-request dsmith-work: alwalo: https://www.gnu.org/software/guile/manual/html_node/Requests.html#index-build_002drequest dsmith-work: Sorry, looks like you can't pass that to http-request alwalo: (read-request-body (build-request "url" #:headers .....)) should this work like this ? I will try lampilelo: lispmacs[work]: for live string input streams maybe 'expect' would be of interest to you manumanumanu: lispmacs[work]: what do you mean live input stream? lispmacs[work]: lampilelo: thanks, that looks interesting manumanumanu: srfi-171 can handle streaming transformations... manumanumanu: depending on case, of course. lispmacs[work]: manumanumanu: just that I'm reading from a port in real time connected to a device that delivers whitespace separated tokens that need to be processed one a time in real time lispmacs[work]: I'm pulling output from a FORTH interpreter running on a microcontroller lispmacs[work]: and sending commands manumanumanu: sure thing. srfi-171 does that, but you will need to write your own reducer for it that writes to a port manumanumanu: you could use the tbatching transducer manumanumanu: sorry, tbatch. dsmith-work: lispmacs[work]: Yey Forth! lispmacs[work]: when our powers combine, I become forthmacs[work]: ta da! forthmacs[work]: It is becoming harder and harder to find a telephone booth these days dsmith-work: :) forthmacs[work]: SHAZAM! lispmacs[work]: I'm back manumanumanu: lispmacs[work]: I am not sure how to do it best, though. Unless you want to do some kind of processing, transducers seem like a waste of processing power. lispmacs[work]: manumanumanu: this Expect module might be what I was looking for manumanumanu: jesus, why have I never seen that before?! manumanumanu: but that unhygienic capture of variables is pretty unsexy though. dsmith-work: leoprikler: Heh. I can't tell if that means cargo is a good thing or not. leoprikler: I would call it contemporary baggage, but that's just me. amirouche: hey :) amirouche: I am reading on foldts, foldts* and foldts*-values amirouche: As far as I understand those are very important for guile because that is the tool used to describe the transformation of the guile IL / IR called tree-il (module/language/tree-il) amirouche: sort of like what nanopass framework is for chez. amirouche: here is the associated paper https://wingolog.org/pub/fold-and-xml-transformation.pdf amirouche: here is the documentation https://www.gnu.org/software/guile/manual/html_node/SXML-Tree-Fold.html amirouche: my first question is / was stupid: what is the point of -values variants, afaiu it does not matter, one could pass a list as seed to fold and its variants. amirouche: I am correct to think that foldts* allows to rewrite a tree in context sensitive manner, without building a closure? amirouche: That is exactly what is explained in section 3 of the above paper. amirouche: That is prolly overkill: is there a variant of fold that support cyclic data structures? lloda: found something about my problem with readline lloda: once I call some gl functions, guile-readline starts calling into libedit2 instead of libreadline lloda: so everything gets corrupted and i get crashes in short order lloda: my program doesn't use libedit2 or libreadline except through Guile lloda: i've compiled guile with --with-libreadline-prefix=/opt/readline/ and i compiled readline from source lloda: libedit2 is a dependence of some of the gl libraries in debian and I cannot remove it lloda: but I don't understand how the switcheroo is possible at all lloda: neither guile nor my program are linked to libedit2 lloda: directly, i suppose i should say wingo: i would guess ELF superposition sneek: Welcome back wingo, you have 1 message! sneek: wingo, maximed says: When using #:drain? #t, I notice some fibers are not actually run to completion (tested by adding a few (pk 'i fiber-index); some indices are missing from the log). Does that sound a bell? (I need to make a minimal test case & try to work-around with condition variables) wingo: or imposition or whatever that is wingo: weird thing is, guile loads guile-readline via load-extension which doesn't pass RTDL_GLOBAL wingo: so am not sure exactly how the interposition would work lloda: >:( dsmith-work: As usual, an strace might reveal what is loading what. lloda: dsmith-work: thx, i should learn how to use that. I used gdb dsmith-work: So libedit2 provides the same api/abi as libreadline? Sounds similar to a problem I had with apache. dsmith-work: Apache provided it's own regex, and it was statically linked into the exec. The functions were nameed the same as the libc ones, but the actual structures were different and had different sizes. lloda: even if the libraries are byte identical their runtime data wouldn't match lloda: this is a bit of a nightmare tbh dsmith-work: Yep. lloda: that's why my history was always being deleted, i was building it up in libreadline but when the program was closed it was calling libedit2's functions to write it out and of course for libedit2 there wasn't any history dsmith-work: So what I ended up doing was #include'ing the apache headers dsmith-work: https://cvs.savannah.nongnu.org/viewvc/mod-guile/mod-guile/mod_guile.c?revision=1.3&view=markup#l703 dsmith-work: lloda: That's not going to help with readline :( lloda: i'm trying to link readline statically dsmith-work: lloda: Good chance that's not going to work. The code that calls into libedit will probably call into your staticly linked libreadline. Unless you can hide the symbols. lloda: my bet is that no one is calling into libedit and it's a spurious dependence lloda: else I'll try to use libedit with Guile and remove libreadline lloda: this elf interposition sounds gross dsmith-work: There *are* ways to hide symbols. lloda: but i have no control of the other library dsmith-work: I was thinking staticlly link readline, and somehow not expose the global symbols. dsmith-work: So ldso (or whatever) doesn't see them when it links in libedit lloda: yeah it doesn't work lloda: i mean linking statically doesn't work lloda: still finds the symbol on the other library dsmith-work: Something with __(attribute)__ hidden? Looking for it.. dsmith-work: https://gcc.gnu.org/onlinedocs/gcc-8.5.0/gcc/Code-Gen-Options.html#Code-Gen-Options dsmith-work: Near the very bottom -fvisibility=[default|internal|hidden|protected] dsmith-work: lloda: I wish you the best. Looks like a very nasty problem. dsmith-work: Oh, and this might help: https://gcc.gnu.org/wiki/Visibility dsmith-work: The real problem remains, a clash between two libraries providing the same function symols but with different data structures. dsmith-work: Maybe if there was a way to rename things.. dsmith-work: And https://holtstrom.com/michael/blog/post/437/Shared-Library-Symbol-Conflicts-%28on-Linux%29.html dsmith-work: lloda: Make a symlink libedit2 -> libreadline ;^} apteryx_: there's no equivalent to gdb's 'list' in the Guile debugger, correct? lloda: i'm trying the symlink now dsmith-work x_x lloda: guile complains that readline is missing functions and is too old :p apteryx_: It seems most of my debugging in Guile Scheme is at the primitive 'print' level (pk in the sources) and the occasional ,trace at the REPL. I haven't become good at using ,break and ,step yet, it seems. Is it me, or is it notoriously tricky to use the 'live' debugger? lloda: symlink method failed as there's a libreadline.so.7 that a ton of stuff depends on that gets in the way as well lloda: apteryx_: i have tried a couple times and given up dsmith-work: lloda: The symlink *was* a joke. lloda: on me, then haha lloda: it would have worked if it wasn't for the other library tho dsmith-work: On an old mac-mini, they provide something that looks like readline, but isn't. So at build time, guile thinks it has readline, but at runtime, it was failing to find certain symbols. dsmith-work: I think they had a symlink from readline -> whaeveritwas lloda: i think i've seen that lloda: as long as there is only ONE, i guess apteryx_: one thing about the debbugger I haven't sorted out is how to break at a specific line. I'm trying ,bs NNN, but it wants a file argument. So I try for example ,bs the-module.scm 529 and it says: No procedures found at ~a:~a. "the-module.scm" 529. Ideas? apteryx_: ah OK, it wanted the absolute path of the file apteryx_: nevermind, relative path is fine if I adjust the cwd of the REPL first. stis: heya guilers! dsmith-work: stis: Heya! How goes the Python battle? stis: forward, been enjoying nice weather recently though apteryx_: what seems to work best for debugging is; ,break some-proc. Then run the code exercising the proc at some point. Then define an Emacs macro for ,step RET ,backtrace #:full? apteryx_: that way you can step at the press of a button and keep track of the locals in every frame. apteryx_: err, should have been ',step RET ,backtrace #:full? #t' apteryx_: F3 to start recording the macro, F4 to stop recording. F4 again to play back. lloda: found a couple links reporting similar problems lloda: https://developer.blender.org/T43491 lloda: https://bugzilla.redhat.com/show_bug.cgi?id=1201897 lispmacs[work]: hi, I'm needing to process an input stream as a series of whitespace delimited tokens, and am wondering what guile tools / modules would be useful manumanumanu: lispmacs[work]: guile-dsv might be useful, but that is for actualy DSV amirouche: later tell maximed use fibers issues and ping @amirouche amirouche: sneek: later tell maximed use fibers issues and ping @amirouche sneek: Will do. amirouche: sneek: later tell maximed and/or ping me here sneek: Will do. drakonis: dsmith: hey, where would i find the source for sneek? I'd like to use it in a private channel dsmith-work: drakonis: Ahh. Good quesiton. *: dsmith-work looks nckx: The core is bobot++ (https://unknownlamer.org/code/bobot.html), that much I know. *: nckx knew a thing, gets snack. dsmith-work: drakonis: Know that is is merely a dump of what I have. It's not ready as something you can run. dsmith-work: drakonis: https://gitlab.com/dalepsmith/sneek dsmith-work: drakonis: The old sarahbot is at https://github.com/igorhvr/bedlam.git under sisc/sisc-contrib/irc/scheme/sarah drakonis: thanks dsmith-work: drakonis: I basically wanted to run sarahbot, but on Guile instead of sisc drakonis: neat. jcowan: Does anyone know how the decision was taken to add R6RS support to Guile? I can't see any obvious Guilers on the R6RS editorial committee (unlike Chez and Racket). taylan: jcowan: I'd say it was done at the whim of either Andy or Mark. my guess is on Mark. could check commit logs... taylan: commits seem to be primarily from Andy dsmith: iirc, someone else provided the initial patch for r6rs library/module syntax. dsmith: "Guile now has implementations for all of the libraries defined in the dsmith: R6RS. Thanks to Julian Graham for this excellent hack." dsmith: Looks like first appeared in Guile 2.0 dsmith: https://mail.gnu.org/archive/html/guile-devel/2009-11/msg00000.html jcowan: THanks. So that means there are three kinds of R6RS implementations: (a) those maintained by members of the committee, (b) R6-from-scratch implementations that did not exist before R6; (c) Guile. taylan: hehe rlb: alextee: for web stuff, I'd likely lean toward clojure/jvm. The options there are broad and deep, both with respect to the jvm and available java libs (which are easy to use directly from clojure), and the available clojure-specific libraries. But other platforms may be preferable if you want faster startup and/or solid POSIX/unix/linux support (i.e. the jvm has only recently admitted symlinks and filesystem sockets exist). rlb: alextee: and that's in part what I'd hoped for with lokke -- faster startup solid support for #! work, POSIX/linux calls, etc. rlb: (you can also use clojure on both sides, server and client with clojurescript, and that works well too) rlb: At least to the extent that I've done client-side work, which has only been a bit. lispmacs: is there some procedure already which converts multiple return values into a list? lispmacs: instead of (receive (a b c) (someprocedure) (list a b c)), for example d4ryus: lispmacs: I dont know any, i use (call-with-values somprocedure list) lispmacs: d4ryus: a little nicer, thanks alextee: rlb, thanks for the info. being able to use it in both client and server side seems like a nice benefit leoprikler: lispmacs (compose list your-proc) lispmacs: leoprikler: that doesn't quite make sense, and doesn't seem to work when I try it lispmacs: leoprikler: oh wait, I must have typed it wrong. seems to be working now lloda: my readline troubles seem to have to do with threads. My program uses a GL thread and if I spawn it before activating readline, readline doesn't seem to initialize properly and I get the strange file-completion behavior and no history across sessions. If I spawn the GL thread after activating readline, then I get broken history, broken keys (C-k for some reason) and sometimes crashes. lloda: I'm kind of lost atm :-| wingo: humm :/ wingo: is calling readline only from one thread an option? lloda: yes, that's what i do now lloda: the GL thread doesn't do anything with readline, it only does GL things lloda: rlwrap works, so i'll use that instead fttb wingo: blah dsmith-work: Tuesday Greetings, Guilers apteryx: hello! Is there something ready to use such as string-split, but splitting on a string separator rather than a character one? dsmith-work: apteryx: Were you asking this about a month or so ago? apteryx: eh, I hope not *: apteryx checks logs civodul: apteryx: see string-tokenize* in (guix search-paths) lampilelo: apteryx: you could use something like this: (lambda (str sep) (string-split (string-replace-substring str sep #\us) #\us)) lampilelo: requires loading (ice-9 string-fun) lampilelo: does 2 passes though apteryx: civodul: neat! apteryx: dsmith-work: my logs say no! :-). Phew. I'm not totally loosing it. dsmith-work: apteryx: Ok. np. *someone* did. dsmith-work: I wonder if the srfi-13 funcs that take a predicate can coerced into doing the job. apteryx: it's a relatively common procedure provided out of the box in other languages I think (Python, Java at least) apteryx: in the browser: "Hello something World".split("something") -> Array [ "Hello ", " World" ] taylan: wow, kinda crazy that SRFI-13 doesn't have string-split jcowan: And does have -upcase!. It's things liike that that keep SRFI 13 off the R7 ballots: it's not designed for a Unicode world dsmith-work: jcowan: Is there a better replacement? (/me not up on r7rs stuff) jcowan: We have no less than five string SRFIs with a new one on the way. If you don't care about immutability, use SRFI 152, which is completely portable. leoprikler: Five? Preposterous! We need a new SRFI, that covers all potential use cases. dsmith-work: leoprikler: So we can then have 6! (insert xkcd link here) jcowan: They serve different use cases: mutable strings, immutable strings, both; string cursors vs. string indexes; backward compat with R7RS vs. no backward compat. leoprikler: except for the R7RS stuff, everything else is no either/or jcowan: We could have lived with SRFI 13 indefinitely if it weren't for UTF-8/UTF-16 internal representation and immutability becoming popular jcowan: A or B or both is a choice, even if not an either/or choice. Libraries that provide cursors also provide indexes for backwards compat dsmith-work: Ugh jcowan: Also, I should have sais "R[567]RS" jcowan: dsmith-work: Can you clarify a bit? dsmith-work: Heh. Just seems a mess. jcowan: Oh, at the meta level, yes; but we have what we have. I am writing the sixth with the intention of providing both mutable and immutable strings, no cursor support, and backward compat. I believe it may be said to fairly subsume four of the five other SRFIs. manumanumanu: jcowan: (I am clearly beating the dead horse)why no cursors? To me it seems like the most efficient way to iterate over utf-8 representation strings... manumanumanu: Everything is of course a compromise, and it is not a very common way to handle strings, but I wrote some code for chibi and found it quite elegant... jcowan: Oh, I don't deny that. I thought fitting cursors into the Sixth Library would overload it too much, but it's certainly possible to do so. rlb: alextee: certainly, though of course there are tradeoffs, i.e. the happy path in that world is the pip/gem/mvn "download giant piles of code from ..." track, unless your distribution actually packages everything you need, and even then, it may not be trivial to make sure you're only using the distribution versions (if that's what you want). rlb: But I *did* like being able to write clj code for the browser (though I haven't been doing any of that for a good while now). manumanumanu: dsmith-work: I usually say that one wouldn't design a "2021 scheme without historical luggage" with mutable strings (or cons pairs for that matter). SRFI-135 seems reasonable to me :) manumanumanu: (mutable cons pairs manumanumanu: ) dsmith-work: « and » for quotes eh? leoprikler: R8RS when? jcowan: manumanumanu: Owl Lisp is an immutable Scheme (modulo I/O) drakonis: Guile 4 when? jcowan: leoprikler: I sure don't know; after I'm dead most probably. For sure I won't be leading it manumanumanu: dsmith-work: something like that. I would definitely vote for having to write "please" often enough to make it compile like in intercal. manumanumanu: "immutable strings with manners" manumanumanu: Good night! dsmith-work: I've been learning/using Rust quite a bit lately, and the way they do strings feels right. Maybe it's just because I'm used to it? dsmith-work: Internal is all utf8. Os things (filenames, etc) are Os-specific. Iterate over strings, no direct idexing. The differece between a String and a &str was weird at first, but makes sense dsmith-work: Of course they have the luxury of no historical baggage. leoprikler: But in turn, there is Cargo :) tohoyn: sneek: botsnack sneek: :) RhodiumToad: moo taylan: sneek: botsnack sneek: :) ManDay: No macros involved, I get this error 'In procedure car: Wrong type argument in position 1 (expecting pair): #f' on a line which reads merely '(complete-branches pd-branches completion)'. If that's not weird enough, if I make that line read '(complete-branches pd-branches (identity completion))' the error is suddenly marked on the line before (which reads '(if (or (dep.eq? branch (car parent-cp)) ManDay: (member branch downstream dep.eq?))') ManDay: Anyone mind to make sense of this? ManDay: btw: same happens if I put the (identity) around pd-branches. ManDay: well, apparently in the (car) on the line before is #f ManDay: Which explains the problem, but not this weird as hell error message taylan: ManDay: which Guile version is this? ManDay: 3.0.4 ManDay: uh oh, lemme guess, i'm direly outdated? taylan: no that's very recent :) ManDay: oof taylan: so if I understand correctly, the line number of the error is reported wrong? I would file a bug report, ideally after producing a minified self-contained example that showcases the bug. ManDay: ok, fair answer. I was afraid I'd get some intricate explanation why despite all odds reporting weird lines actually made sense :D ManDay: i'll try to strip that down when I have some downtime dsmith: ManDay: Might want to try it on git (or at least 3.0.7). Just to make sure it hasn't been fixed already. ManDay: yeah that's true, i'm sorry you have to point it out ;-/ ManDay: i'll try it first iwan: hello *: dsmith waves iwan: anyone interested in Guile-Elisp here? drakonis: sure why not drakonis: getting guile on emacs, is it? iwan: hmm, more like emacs on guile iwan: I recently submitted two Elisp reader bugs, but no one replied yet :^( drakonis: oh i see lispmacs[work]: hi, I'm trying to create a child process and get textual ports to its input and output. however, with the open-pipe command, it seems that you instead run the process and it inherits your current i/o ports. So, if I keep separate my guile program std i/o from the child process i/o, I guess I need to create some ports first and make them the current i/o ports. But I'm not sure how to go about that iwan: set-current-input/output-ports I guess lispmacs[work]: iwan: that seems like about half the puzzle. but I would need to create i/o ports first...? lispmacs[work]: some string ports...? iwan: maybe file ports? smth in /tmp or /log dsmith: iwan: How manye years have you waited? ;^} lispmacs[work]: iwan: if the process is reading from a file in /tmp, will I have a problem with the process getting an eof when I am not feeding data to the tmp file? iwan: dsmith: for what? lispmacs[work]: i would need to create a FIFO file...? dsmith: iwan: elisp reader bugs you mentioned. dsmith: Often it takes a while before the guile devs get to bugs. Even with patches. dsmith: Usually it's just before a release, there is a flurry of patches applied. iwan: they are pretty easy tho iwan: bugs, not patches dsmith: Just sayin, don't be surprised if no response for days or weeks (or months or..) lispmacs[work]: seems like there must be a better way to do it, but I see now I could create some FIFO files with mkfifo, open them as files, and then open the processes with those set as default ports iwan: can you give a more detailed example? lispmacs[work]: I don't think so pyveteran: Hi iwan: hi! pyveteran: Why should I learn Guile? lispmacs[work]: it seems kind of funny that guile has a built-in function for generator random coordinates for the surface of a sphere. Is there an interesting story behind that...? mfiano: also volume of a sphere lispmacs[work]: is there an easy way to convert a number to a hex string? drakonis: pyveteran: why not lispmacs[work]: built-in? iwan: yep drakonis: also that's a terrible question drakonis: i've seen it a hundred times iwan: (format #f "~x" ...) lispmacs[work]: iwan: thanks! pyveteran: drakonis: ok thanks, I'll try to figure out by myself. dsmith: lispmacs[work]: There is also number->string dsmith: The second arg is the base. lispmacs[work]: dsmith: okay, thanks, I didn't know that one had a radix parameter dsmith: But if you want more control, format lispmacs[work]: MORE CONTROL!!!! apteryx: uh; (mkstemp! "/tmp/dbus-send-output-XXXXXXX") -> string is read-only: "/tmp/dbus-send-output-XXXXXXX". Am I using it wrong? forthmacs[work]: wha HA HA! dsmith: apteryx: Yes. A string literal is read-only. drakonis: pyveteran: to be fair, its such a common question that people expect to be answered by simply waltzing into a channel and hoping for a satisfying answer apteryx: dsmith: according to http://osr507doc.sco.com/cgi-bin/info2html?(guile.info.gz)File%2520System&lang=en, mkstemp! takes a TMPL, which should be a string apteryx: ah, perhaps mutable string objects are a thing, I've never used those. dsmith: scheme@(guile-user)> (mkstemp! (string-copy "/tmp/dbus-send-output-XXXXXXX")) dsmith: $2 = # apteryx: I see! Thanks. dsmith: apteryx: A string literal is immutable. (or should be!) iwan: @dsmith have you ever contributed to emacs or guile? dsmith: I've submitted a few small patches over the years. Long ago, contributed a patch to dos emacs so it could use the windows clipboard. iwan: your nickname seems familiar, but I can't remember where I saw it dsmith: Well, "smith" is a *very* common name. iwan: yeah, I know, maybe I just remembering time when #guile was on freenode dsmith: Been there a while. I started when there was about 6 people in the channel. I remember how cool it was to see it double to 12! taylan: heh :) taylan: iwan: I responded to a few Elisp reports recently, dunno if yours was under them iwan: a-ha, your name is the same as nick taylan: iwan: oh, I see you sent a patch earlier today. well I've sent some patches two weeks ago and am still waiting, so better to be patient :P iwan: nice to meet you, Taylan iwan: I was hoping to meet you or Maxime Devos here *: holomorph checks to see how long the wip-elisp branch has been dormant dsmith: There has been some recent activity. bipt has a new nick (can't remember right now) and was on here a few days ago. dsmith: sneek: seen bipt? sneek: bipt was last seen in (here?) 9 months ago, saying: i saw that your guile-emacs package made it into a guix release :). taylan: iwan: happy to hear from another person who's interested in Guile-Elisp. sadly progress is slow, as everyone's quite busy ManDay: Sorry to come back with more traceback trouble, but I can't fathom how guile can simply not mention stackframes. This for example http://dpaste.com/HAR22QBAH drives me mad to have to deal with this all the time. taylan: bipt's new nick is robin, alternatively terpri dsmith: taylan: Ahh yes. Thanks dsmith: sneek: seen terpri? sneek: terpri?, pretty sure was seen in #guix 10 days ago, saying: so far, it's great. dsmith: sneek: seen robin? sneek: Not as far as I can remember. taylan: dsmith: robin is in the channel :D ManDay: How am I supposed to find that error with that kind of debugging information?! ManDay: I'm at a total loss! taylan: ManDay: 'map' takes two arguments. since the (lambda ...) will certainly not be #f, it must be 'pivots' ManDay: taylan: Yes, I realize that has the wrong type. But how am I supposed to find the error?! ManDay: pivot->strings is called all over the place in my code iwan: dude, I have had exceptions during printing stacktrace ManDay: so have I ManDay: (but that was fixed) taylan: ManDay: from the fact that it points at idg.scm line 61, and that this line is the start of the 'map' call, which has two arguments, one of which is evidently #f as the error message says ManDay: taylan: idg.scm line 61 IS that map. that's what I marked in the paste ManDay: but where is pivots->string called from!? ManDay: i can't belive I have to ask that question. are you not familar with stacktraces from normal compilers? taylan: ManDay: isn't it in idg.test.ss line 27? ManDay: taylan: no. line 27 in idg.test.ss calls idg.recurse taylan: is idg.recurse a macro? ManDay: no taylan: oh nevermind, idg.recurse is in the stack trace taylan: ManDay: well the pivots->string call ought to be somewhere in the body of idg.recurse then? ManDay: many many times dsmith: ManDay: How about move that lambda into it's own define. From a repl (or geiser) try feeding it with what you expect the arg to be. ManDay: dsmith that function (pivots->string) is fine. dsmith: There has been a *lot* of work on the compiler lately. Bound to be some bugs. dsmith: AH ManDay: ok, i'll try the master version anyway (tomorrow) ManDay: maybe that'll help it ManDay: dsmith what is geiser? dsmith: Emacs interface to Guile (and some other Schemes) dsmith: It's nice to be able to C-x C-e to evaluate an expression. taylan: not sure if updating from 3.0.4 to 3.0.7 will make much of a difference ManDay: i rather have working stacktraces ;-/ dsmith: Yeah. dsmith: Hmm. taylan: ManDay: is the code uploaded somewhere? ManDay: nah ManDay: there is a macro involved, though taylan: I'd like to understand better what's going on... dsmith: I wonder if using less optimization would provide better backtraces? ManDay: it encapsulates the entire body of idg.recurse ManDay: dsmith I've written that thing, I ll try it : http://dpaste.com/ELNB5TP3T ManDay: Not sure what else I can do to prevent optimization taylan: could you paste the entirety of idg.scm and idg.test.ss? ManDay: ironically, the macro which encapsulates the body is there to help me debug... ManDay: taylan: you mean in a state that you can run it? or just look at it? taylan: just look at it ManDay: ok, one sec taylan: the state that produced that error would be ideal of course :) ManDay: idg.test.ss is really nothing though dsmith: There is a way to pass an -O1 or -O2 to guild compile. Not sure if there is a way to do that within a repl. ManDay: can't one upload file to github gists? ManDay: dsmith I'm not using the repl. taylan: gist works, any pastebin works just as well IMO iwan: termbin.com is my favorite ManDay: i want the paste to disappear after a while dsmith: sneek: paste? sneek: Someone once said paste is https://paste.debian.net dsmith: I think that one goes away after a while. iwan: it'll disappear after one month ManDay: i set it to 1 h ManDay: https://paste.debian.net/hidden/7dffd798/ ManDay: by then we'll have that figured out either way :-P ManDay: see the dbg-* macro at the beginning ManDay: that's the only non-functional or macro thing there is ManDay: idg.test.ss coming right up taylan: this is not the state of the file when that stack trace was produced though, right? ManDay: https://paste.debian.net/hidden/4aedcfb8/ ManDay: taylan: yeah, line numbers don't match ManDay: l61 -> l31 taylan: did you mean 37? ManDay: ah yeah, my eyes... taylan: no problem. so, I think pivots->string might be getting inlined or something... taylan: it's certainly a crappy stack trace, no argument there ManDay: thanks ^^ ManDay: i just wish I could turn off all those optimizations ManDay: so I guess I'll have to try guild manually ManDay: gosh, I wish `guile` could simply pass -O0 to guild taylan: you could also see what the interpreter does, by executing the file like 'guile --no-auto-compile foo.scm' after deleting the cached .go file ManDay: since compiling it isn't as easy as `guild compile idg.scm` I think I'll postpone this entire operation to tomorrow (which starts in about half an hour anyway) taylan: ManDay: it should be as easy as that, actually taylan: possibly with an -L thrown in there, just like when executing the file with 'guile' ManDay: ah yeah -L was needed ManDay: ty taylan: and you might want to add a check for the 'pivots' argument to the beginning of pivots->string to give a marginally better error ManDay: ooooh ManDay: that's much better now! ManDay: 142:2 3 (idg.recurse ((# . #)) …) taylan: like (when (not pivots) (error "pivots->string called on #f")) ManDay: 148:46 2 (vary-conjunctions -1 #f) ManDay: 61:2 1 (pivots->string #f) taylan: yeah I guess a lot was being optimized out there! ManDay: i'll file a bug for guile to accept -O0, this seems awefully important ManDay: thanks a lot! ManDay: i had tried to disable optimizations in the case of messy stacktraces in the paste but it had not helped taylan: there might be an environment variable for that, lemme check... ManDay: i didn't expect improvement this time ManDay: *in the past taylan: hmm I think there was just an env var to force fresh recompilation ManDay: yes, i have also searched for any method to pass -O and didn't find any ManDay: everything works now. many thanks!!! taylan: can't even find that now, maybe I was dreaming. anyway, I guess an option to 'guile' and/or an env var to determine the optimization level might be good. taylan: yw! ManDay: gn dsmith: ManDay: What made it work? Disableing optimizations? dsmith: Ah, left mattrw: sneek later tell ManDay I used to effectively set -O0 in guile using https://paste.debian.net/1199535/ and running (noopt) but I think that broke recently (3.0.X, X > 2 ??) sneek: Okay. mattrw: leoprikler: got it -- thanks topoi: When using (string-match "\." ".") I get the error "illegal character in escape sequence: #\." - doesn't "." need to be escaped with "\"? topoi: ^-- Ohh, nevermind; "\" itself has to be escaped. ; ) topoi: But I'm not exactly sure why (c. https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Backslash-Escapes.html ) apteryx: any idea why waiting for a pid from Shepherd's fork+exec-command (from the (shepherd service) module) takes multiple seconds? ,time (let ((pid (fork+exec-command '("sh" "-c" "echo 'hello!'")))) (waitpid pid)) --> ;; 2.436732s real time, 0.013448s run time. 0.000000s spent in GC. apteryx: 2.43 s to fork a shell and print hello, every time alextee: how does guile compare to clojure? ahungry: clojure ecosystem, having all of maven/the jvm available, and npm/nodejs, is quite a bit bigger. Syntax wise, I like clojure, but guile/scheme has some beauty in it's simplicity daviid: alextee: see https://git.sr.ht/~rlb/lokke alextee: hmm alextee: being able to use java libraries sounds pretty nice daviid: alextee: if that's what you want, then imo, kawa is much better then clojure - here i just wanted to point 'to the existence of lokke' alextee: thanks, I'm just looking for a web dev language to learn and stumbled upon clojure. I think I'll focus on the popular ones that have more support, like clojure. guile seems like it's great for C integration but I'm not sure how powerful it is for web dev (considering there's not too many popular libraries) flatwhatson: any thoughts about vectorization/SIMD support for guile? i guess it would need to start with teaching lightening to emit the instructions? leoprikler: apteryx: it looks like you're setting up a shell within a shell, how long would it take to just run "echo hello"? apteryx: 0.12 s or something apteryx: I had checked apteryx: the hello comes out quickly but the waitpid seems to linger emestee: what'd be the nicest way to represent two dimensional coordinates? '(x y)? (x . y)? RhodiumToad: is it always going to be 2 dimensions? RhodiumToad: (x . y) is one cell while (x y) is two, so there's some advantage in the first; but a record might be preferable b4285: a list is a container for isomorphic element, so i'd go with tuples, i.e. (x . y) b4285: i don't know what i am talking about, shouldn't use the word "isomorphic" RhodiumToad: there's probably a good argument for using immutable records for something like that taw10: Arguably it doesn't matter, because the real representation should be abstracted away anyway? Start with a single cons cell, then switch to something like a GOOPS class if/when you realise that you want to have other ways of accessing the value, e.g. polar coordinates (c.f. SICP section 2.4)? RhodiumToad: hmm. the docs say that immutable records can't be mutated even via struct-set!, but the code says they can be RhodiumToad: define-immutable-record-type is a bit simpler than defining your own set of abstract accessors for a cons cell emestee: thanks! RhodiumToad: of course for two dimensions you could also just use a complex number ArneBab: emestee: '(x . y) uses less memory than '(x y) or a two-element record, you might want to benchmark (1 . 2) and the record. ArneBab: simple starting point: ArneBab: ,time (let loop ((s 100000000) (v '(1 2 3 . 4))) (when (not (zero? s)) (cdr (cdr (cdr v))) (loop (- s 1) v))) ArneBab: (import (srfi srfi-9)) ArneBab: (define-record-type (v a b c d) v? (a va) (b vb) (c vc) (d vd)) ArneBab: ,time (let loop ((s 100000000) (vt (v 1 2 3 4))) (when (not (zero? s)) (va vt) (loop (- s 1) vt))) ArneBab: emestee: '(x . y) uses less memory than '(x y) or a two-element record, you might want to benchmark (1 . 2) and the record. ArneBab: simple starting point: ArneBab: ,time (let loop ((s 100000000) (v '(1 2 3 . 4))) (when (not (zero? s)) (cdr (cdr (cdr v))) (loop (- s 1) v))) ArneBab: (import (srfi srfi-9)) lampilelo: just use dpaste or something like that ArneBab: lampilelo: if it had been more lines, I would have. for 4 lines I prefer having them in the history lampilelo: the formatting though... emestee: thanks I am going to experiment with this emestee: I assume cdr for a tuple would be slightly faster too? chris: emestee: profiling is the only way to answer. guile devs will usually optimize code iff profiling supports it. chris: mostly you'd be better off using a srfi-9 record chris: (for code readability) ArneBab: emestee: (cdr '(a . b)) => b; (car (cdr '(a b)) => b ; that is the speed difference lampilelo: was this missed by the maintainers? https://lists.gnu.org/archive/html/guile-devel/2021-04/msg00008.html lampilelo: IF it's confirmed to work, seems like a no-brainer, the person that posted it will probably use it dsmith: lampilelo: Never heard of arc before. Is it old? stis: Hello guilers! apteryx: what could couse such autoload failures? ;;; Failed to autoload %precious-signals in (shepherd service): apteryx: cause* apteryx: ;;; In procedure resolve-interface: no binding `%precious-signals' in module (shepherd service) civodul: o/ sneek: Welcome back civodul, you have 2 messages! sneek: civodul, apteryx says: hey! I was wondering what happens with autoloaded modules w.r.t. to 'source-module-closure'? Seems they might not be added? I've been debugging a problem when I lazy bind (shepherd service) and something seems amiss. sneek: civodul, apteryx says: ah, I see extract-dependencies in (guix modules) has a case to cover #:autoload civodul: apteryx: that suggested the (shepherd service) module that was loaded lacks '%precious-signals' civodul: maybe because it comes from an older version? civodul: 'source-module-closure' takes #:autoload into account apteryx: could be, I'm replaying a service start slot 'by hand' with my root user, it's not exactly a tightly controlled environment civodul: note the default #:select? of source-module-closure, though civodul: heh, i love that kind of debugging civodul: adventure and risks :-) apteryx: I wanted to do the same in a VM corresponding to the right environment, but http://issues.guix.gnu.org/48739 prevents SSH'ing, so I'm struggling to debug :-) civodul: the qemu syntax for port forward is terrible apteryx: the qemu syntax *for anything* I'd add ;-) civodul: right! civodul: ffmpeg too apteryx: it seems purely designed as the low-level engine of higher level interfaces such as virt-manager, and it shows civodul: (funnily, both started by the same person :-)) civodul: so i'd copy the syntax from our code civodul: which is Known Good *: apteryx checks apteryx: seems strictly equivalent; mmh apteryx: perhaps QEMU is sensitive to the order in which options are given chrislck: anyone remembers OPEN "COM1:300,N,7,1"? chrislck: guile doesn't even have a (CLS) taylan: sneek: botsnack sneek: :) lampilelo: did mwette stay behind on freenode? taylan: lampilelo: he asked on the ML for assistance, ERC related issues I think lampilelo: i see lampilelo: i'll reply to him dsmith: I mentioned to him he needed to register his nick lampilelo: i have some more info because the current version of erc doesn't really know what libera is so there are some issues dsmith: I've been using erc, but have beem msg'ing nickserv by hand. dsmith: Prob should tune that up lampilelo: i'm writing the email, you should read it too in that case lampilelo: lol, i think i sent it just to him, not to the mailing list lampilelo: dsmith: i uploaded an excerpt from the mail: http://dpaste.com/EQAEJ9HSB lampilelo: for your nickserv issues dsmith: lampilelo: Thanks! dsmith: Yey lampilelo: emacs 28 will fix it, i believe dsmith: I'm using ERC with GNU Emacs 26.1 (x86_64-pc-linux-gnu, GTK+ Version 3.24.5, multi-tty) of 2021-01-30. mattrw: Hi All. This is Matt, formerly mwette. dsmith: Not even on 27 yet lampilelo: now to figuring out how to send mails to the mailing list with gnus using gwene nntp, is it possible even? dsmith: mattrw: wb! lampilelo: mattrw: did you get my email? mattrw: thx! lampilelo: you got here oddly quick philip: Is it possible in Guile to restrict the effect of read-hash-extend to a certain dynamic extent, say with dynamic-wind? In Racket, I would parameterize current-readtable. mattrw: I found https://libera.chat/guides/registration lampilelo: dsmith: you're using debian? i think ubuntu already has 27 dsmith: Yep Debian. mattrw: I'm on Ubuntu 21.04 and it has emacs 27.1 lampilelo: mattrw: ah, ok, i sent you an email with some workarounds for erc and libera, but for some reason it was off mailing list mattrw: lampilelo: I got your email. Thanks. I'm just using libera now, and things are working so hoping it stays that way. Thanks for the help. lampilelo: mattrw: actually i was asking about you earlier because i tried to play with nyacc and had some issues with it mattrw: You're not alone. :) dsmith: philip: Pretty certain read-hash-extend is a global setting. However Guile now has in recent changes a Scheme based reader insted of a C reader. So who knows, maybe that change. lampilelo: mattrw: for a function taking a struct, not a pointer, it made a function that takes a nyacc version of that struct and destructuring it internally to a bytevector but then throwing an error because the internal function wanted to have the bytevector by pointer, not by value dsmith: that can change lampilelo: is this a known issue? lampilelo: (i'm talking about the ffi functionality) mattrw: So, I'm not sure exactly. If the C function takes a struct (by value) then the fh-link-proc should be using a (list xxx) for the struct arg, not a '*. That may be broken in pre-1.04.0 but I hope working. mfiano: Hello all lampilelo: mattrw: the generated code's internal function has this as the argument list (list (list ffi:uint8 ffi:uint8 ffi:uint8 ffi:uint8)), but when ((fht-unwrap Color) color) is passed to it breaks, but it works if you wrap it with pointer-to lampilelo: hi mfiano mattrw: Ah. OK. The signature is OK but looks like the unwrapper is not working. mfiano: Never used a Scheme before, but somehow spent the day reading the Guile reference guide. mattrw: mfiano: maybe this: https://www.scheme.com/tspl4/start.html#./start:h0 lampilelo: mattrw: unwrapper returns a plain bytevector with all of the data from the struct mattrw: Hmm. So I wonder if I need to use Guile's make-c-struct. That would be sad. mfiano: I will probably get more from the manual. There seems to be a lot of overlap with Common Lisp in those getting started guides. mfiano: I should have mentioned I've been using CL exclusively for the last 20 years or so mattrw: lampilelo: and I just found another bug in the passing struct stuff. mattrw: lampilelo: added as bug #60697 lampilelo: and also i discovered the existance of c99-std-help the really hard way - the library included - imagine trying nyacc for the first time and getting some weird syntax errors lampilelo: mattrw: thanks lampilelo: nyacc is neat mattrw: lampilelo: maybe only bytevector->pointer is needed. Can you try that? mattrw: (Meaning just hack the .scm output file just to see if it works.) lampilelo: i can check it, but give me a moment lampilelo: mattrw: bytevector->pointer works, just like pointer-to lampilelo: are they different? mattrw: yes. Full fix maybe this easy: mattrw: --- a/module/system/ffi-help-rt.scm mattrw: +++ b/module/system/ffi-help-rt.scm mattrw: @@ -321,7 +321,8 @@ mattrw: (define type mattrw: (make-fht (quote type) mattrw: (lambda (obj) mattrw: - (bytestructure-bytevector (struct-ref obj 0))) mattrw: + (bytevector->pointer mattrw: + (bytestructure-bytevector (struct-ref obj 0)))) mattrw: (lambda (val) mattrw: (make-struct/no-tail type (bytestructure desc val))) mattrw: #f #f mattrw: Noisytoot: mattrw: use a pastebin (like bpa.st or paste.debian.net) mattrw: Noisytoot: thanks -- usually do, senior moment mattrw: lampilelo: pasty: https://paste.debian.net/1199323/ lampilelo: mattrw: you should ask on #libera about recovering your nick, it will probably expire since you didn't confirm the registration lampilelo: i'll try that patch mattrw: lampilelo: thanks. *: mattrw afk for a bit lampilelo: mattrw: it works now but you forgot to add ffi: prefix to bytevector->pointer linas: So running ChanServ on this channel is intentional? Because when I try to msg chanserv, all the responses come back here, mo matter where I started... linas: anyway, hello libera-world linas: and a few exclamation marks of approval drama!! RhodiumToad: that's probably something weird about your client RhodiumToad: chanserv is here because (for whatever reason) the GUARD option is set on the channel linas: OK, thanks! the drama of onboarding... emanuele6: wingo: I just found out libera.chat hosts an instance of kiwiirc at https://web.libera.chat/ RhodiumToad: that's new, I think wingo: emanuele6: neat! emanuele6: yeah, I think it's new tohoyn: new version Theme-D-Golf 0.9.2 has been released. see http://www.iki.fi/tohoyn/theme-d-golf/ leoprikler: Is it difficult to generate Theme D bindings from scheme or is it rather straightforward? tohoyn: leoprikler: you mean accessing guile procedures from Theme-D code? leoprikler: yup, more or less tohoyn: leoprikler: it's easy. tohoyn: leoprikler: here is the definitioj of Theme-D procedure d-car that is implemented by guile procedure car: (define d-car (unchecked-prim-proc d-car () pure)) tohoyn: leoprikler: the first is the argument type tohoyn: leoprikler: the second is the result type leoprikler: and pure vs. nonpure is whether they change state tohoyn: leoprikler: "pure" means that the procedure has no side effects tohoyn: leoprikler: yes leoprikler: can it deal with arbitrary arities? leoprikler: e.g. format tohoyn: leoprikler: yes tohoyn: leoprikler: here is an example: (define string tohoyn: (unchecked-prim-proc string ((rest )) pure)) tohoyn: leoprikler: procedure string takes an arbitrary number of characters as arguments tohoyn: leoprikler: "unchecked" means that Theme-D compiler/linker does not generate code to check that the result value is of correct type. leoprikler: can it do (and (* ( )) (rest ))? leoprikler: or do I just have to write (rest ) and let it be caught at runtime? tohoyn: leoprikler: what are you trying to define? leoprikler: The return value of this baby: https://gitlab.com/leoprikler/tsukundere/-/blob/0.3.x/tsukundere/entities/person.scm#L76-90 leoprikler: I guess would be fine, but still tohoyn: what are the argument types and the desired result type of this procedure? leoprikler: the procedure gets an and returns a procedure leoprikler: Functional programming with side-effects :D tohoyn: leoprikler: you can define procedure types in Theme-D tohoyn: leoprikler: see https://paste.debian.net/1199199/ for an example tohoyn: leoprikler: procedure map1 applies the argument procedure to the argument list tohoyn: leoprikler: what are the argument and result types of the returned procedure? are they arbitrary? leoprikler: pseudo-arbitrary leoprikler: it's a keyword-value list followed by optional string + rest (rest is just a bool atm, but not important) tohoyn: leoprikler: (declare myproc (:procedure () (:procedure ((rest )) nonpure))) tohoyn: leoprikler: it's ok if you pass the keyword-value list as one argument leoprikler: it's many args tho :P tohoyn: leoprikler: I'm afraid that can't be done leoprikler: okay, so I'll still have the work inside the match-lambda leoprikler: what's the difference between declare and (define d-car ...) btw? leoprikler: could I "use-modules" a guile module and then just put a bunch of declares and be done with it? tohoyn: declare declares a procedure and it is used mostly in interface files (each module has an interface and body) tohoyn: leoprikler: you have to tell the Theme-D linker to generate code to include your guile module in the Theme-D program tohoyn: leoprikler: then you have to put the declare's into the interface file and the correspoding define's into the body file leoprikler: speaking about linker, what does theme-d compile to? tohoyn: leoprikler: guile Scheme or Tree-IL leoprikler: is it theoretically possible to write a theme-d header for a scheme body? leoprikler: i.e. omitting the theme-d body? tohoyn: leoprikler: no, you have to define the procedures as "prim-proc" or "unchecked-prim-proc" tohoyn: leoprikler: but it would be quite easy to write a program to generate the body tohoyn: leoprikler: actually Theme-D-Golf resembles that tohoyn: leoprikler: the interface and body files are generated from a "Golf import" file tohoyn: leoprikler: then Theme-D-Golf has a third script that generated a guile module to be included (use-modules) in the target program tohoyn: ^generates dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work! civodul: happy Friday! chrislck: happy Friday, in this new home *: sneek dances apteryx: how do I return all the matches for a given regexp pattern in a string? civodul: apteryx: there's a fold-matches procedure apteryx: thanks! will read on it apteryx: oh, I see a list-matches too apteryx: neat apteryx: Would someone be able to tell why the following service fails with: Unbound variable: pattern ? Perhaps the and-let* syntax is somehow not made available? Otherwise I fail to see it. https://paste.debian.net/1199223/ RhodiumToad: apteryx: I don't see anything that imports and-let* ? RhodiumToad: needs (srfi srfi-2), no? apteryx: oh! I thought I added that... but it's indeed missing. Let me regenerate that (it's created by a Guix G-Expression) to make sure. Thanks! apteryx: ah! I see my mistake; I added (srfi srfi-2) to the wrong service. eh. Sorry and thanks again for lending me your eyes :-) civodul: apteryx: i suggest avoiding srfi-2 in Guix :-) civodul: granted, it's a matter of taste RhodiumToad: why avoid it? civodul: RhodiumToad: like i said, it's a matter of state; i find i'm usually better off with 'match' and sometimes 'and=>' leoprikler: match and and=> work super if you have a common source, but are somewhat clunky if you're dealing with inputs coming from multiple places leoprikler: though in the specific case of Guix, that ought to be rare RhodiumToad: I've used it in cases that basically amount to: compute a value, check its range, compute a further value from it, check that RhodiumToad: (and then do something if everything was valid) apteryx: right, that makes sense to me, but perhaps it's more procedural in style than functional leoprikler: yup, Guix tries to be very functional indeed lispmacs[work]: hi, I am wanting to write a guile program to interact (RX and TX) with some firmware I have running on an Arduino board, through a ttyACM connection (UART over USB). i.e., to do stuff you would normally have to type into minicom. I was wondering if Guile has some kind of support for serial communications, or if I try piping things in and out of the modem program, or if there some better approach... lispmacs[work]: s/if I try/if I should try/ RhodiumToad: bidirectional piping to a subprocess is very difficult to do cleanly without deadlocking RhodiumToad: it should be possible to handle the serial port directly from guile without too much difficulty lispmacs[work]: RhodiumToad: how do I handle the baud rate settings and such from Guile? RhodiumToad: hm, tcgetpgrp etc. are present, but not tcgetattr/tcsetattr RhodiumToad: seems an odd omission RhodiumToad: you could always spawn the stty command for that RhodiumToad: or use the FFI to call tcsetattr dsmith-work: For serial stuff in general (but it seems to be mostly usb serial these days), I like to use ser2net. Yeah, you must edit a config file. dsmith-work: I usuallly have different ports for different baud rates. dsmith-work: (ser2net maps a serial port to a socket) dsmith-work: And then I just telnet or nc to that port. dsmith-work: As a bonus (or sercurity hole) I can than get to get serial port from anywhere in the network. dsmith-work: s/get to get/get to that/ dsmith-work: I used that almost daily to talk to linux serial consoles or other embedded devices with a uart. dsmith: Offtopic quesiton: What could possibly cause a ping to not see replies yet I can see the replies in tcpdump? prite: dsmith: iptables/nftables rules? dsmith: Yeah, that's where I went first. But I think everything is set to allow. My iptables-fu is weak however. *: dsmith prefers openbsd pf tohoyn: wingo, dsmith: I think that -Werror would be useful, too tohoyn: wingo, dsmith: it would be also useful to be able to declare warnings for errors for individual warnings separately tohoyn: ^warnings as errors clacke: The problem with -Werror is that different versions of a compiler have different warnings, so builds with an upgraded compiler will suddenly start failing, right? clacke: maybe it would be reasonable to enable explicit errors in git, but add -Werror in CI? dsmith-work: Thursday Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) taylan: heya tohoyn: daviid: is it possible to build G-Golf for Guile 2.2 even though Guile 3.0 is installed in the system? tohoyn: daviid: Guile 3.0.7 has not yet been published in debian. that's why I don't want to build the debianized G-Golf package for Guile 3.0.7. daviid: tohoyn: yes, even with 2.0 unknown_lamer: dsmith-work: I guess adding dual network support to sneek would have been a waste of time after all ;) (rip freenode) tohoyn: daviid: how is it done? daviid: tohoyn: look for GUILE#_PROGS in guile-ext.m4 daviid: * GUILE3_PROGS tohoyn: daviid: I tried the following: GUILE=/usr/bin/guile-2.2 ./configure --with-guile-site=yes tohoyn: daviid: result: configure: error: found development files for Guile 3.0, but /usr/bin/guile-2.2 has effective version 2.2 daviid: tohoyn: yes, you need more env var (re)def when you have //install... tohoyn: daviid: I set GUILE_EFFECTIVE_VERSION=2.2. ./configure works now. tohoyn: daviid: BTW, does G-Golf use gtk-4 by default? daviid: tohoyn: no, which version is used is determined by which are available and GI protocol, that is it will import the latest, unless you require/pass a specific #:version optional kw value tohoyn: daviid: ok flatwhatson: probably need to update the "#guile on Freenode" on https://www.gnu.org/software/guile/ dsmith: unknown_lamer: Yeah taylan: does anyone know who controls the website? taylan: there's been a dead link on http://www.gnu.org/software/guile/manual/ for years now :D wingo: dsmith-work: like, an option that would make "guild compile" fail if there were a call that is known to have the wrong arity? wingo: actually -Werror would be nice... wingo: the web site is modifiable by any project contributor, technically wingo: is the dead link on /manual/ the postscript file? wingo: that page is generated by gendocs.sh; we probably need to update ours taylan: yeah it's that one, also subject of this report: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15536 taylan: I've been trying to do a bit of housekeeping on debbugs and that one annoyed me for being so minor and yet unresolved for ... *checks* ... about 8 years :D RhodiumToad: the link to freenode is probably a more urgently required fix :-) RhodiumToad: (for those not aware, #guile on freenode got killed a few hours ago) wingo: is there a web irc client that new irc users could use to access this channel? emanuele6: kiwiirc.com works RhodiumToad: looks like libera doesn't have its own web client (yet?), probably it's not at the top of their priorities list right now wingo: i guess i will update the web site without a link to some web client wingo: (kiwiirc claims to be sponsored by PIA -- isn't that related to the entity that took over freenode?) emanuele6: oh, i did not know that wingo: dunno, that was an old sponsorship note emanuele6: they have libera.chat on the default server list though RhodiumToad: sponsored by, but afaik still independent of - more serious is that the kiwiirc project lead (prawnsalad) is quitting over the whole incident RhodiumToad: https://gist.github.com/prawnsalad/4ca20da6c2295ddb06c1646791c61953 wingo: (i am not against sponsorship fwiw, just that it seems that PIA is... not good) wingo: wow this thing is high drama :) *: wingo avoids looking into it any more :P wingo: ok web site updated fwiw wingo: tx emanuele6 for kiwiirc suggestion emanuele6: you are welcome :) tohoyn: daviid: is there any way to find out what is the default gtk version that g-golf uses? tohoyn: daviid: i.e. what gtk version g-golf uses if #:version is not specified opfez: i'm having a problem with alists. if i have a file "f.scm" which contains a definition for an alist (define a '(("foo" . 1))) i cannot change the value if i load it via (load "f.scm) opfez: (assq-set! a "foo 2") just adds a new entry: '(("foo" . 2) ("foo" . 1)) opfez: are alists loaded from another file immutable, and how can i make them mutable? tohoyn: daviid: I made a new debianized release of G-Golf. See http://www.iki.fi/tohoyn/g-golf-debian/. RhodiumToad: opfez: the use of assq-* functions means you're expecting the keys to be eq? rather than equal? RhodiumToad: opfez: and strings are not eq? to other strings with the same content except by chance opfez: RhodiumToad: if i later do assq-set! on the new alist, it correctly changes the value opfez: it correctly changes the value of the new entry, but i want to change the value of the old entry RhodiumToad: opfez: I think what you're finding is that two string literals in the same compiled file refer, by chance, to the same actual object and are thus eq? opfez: i'm testing this in the repl RhodiumToad: opfez: but this is an implementation artifact and therefore your code is incorrect tohoyn: opfez: try (define a (list (cons "foo" 1))) opfez: i will RhodiumToad: bottom line is that you should be using assoc- and not assq- functions RhodiumToad: or use symbols rather than strings as keys opfez: RhodiumToad: i did use assoc- before, and it gave me an error: set-cdr! expected a mutable pair opfez: tohoyn: hm that doesn't work unfortunately RhodiumToad: ah, that's a different issue tohoyn: opfez: try to use assoc-xxx instead of assq-xxx together with my previous suggestion RhodiumToad: by defining the alist as a literal list, it's being made immutable by the compiler opfez: ah now it works opfez: thank you RhodiumToad and tohoyn ArneBab: The new freenode owners zapped the #guile topic. I’m glad we moved here. civodul: ArneBab: are there still people there? RhodiumToad: they zapped the whole channel, really RhodiumToad: #guile is now invite-only and moderated, when I left it still had people in it but nobody could say or do anything civodul: woow RhodiumToad: on join, #guile redirects to ##guile now RhodiumToad: ~8 people in ##guile RhodiumToad: (which has no owner or ops) emanuele6: if it has no owner why does #guile redirect to ##guile? civodul: seen on the fediverse: "andrew lee just seized over 700 channels on freenode because they mentioned libera.chat in their topic." RhodiumToad: emanuele6: it's to take it out of the reserved topic namespace emanuele6: oh, it says that the founder is freenode-placeholder-account ArneBab: civodul: yes, many. clacke: whether PIA is sleazy needs to be evaluated on its own merits; LTM, which owns Freenode Ltd, sold PIA two years ago lampilelo: afaiu the number 700 is an arbitrary estimate, it's just the number of channels that mentioned libera in their topic, there's no concrete evidence all of them got cancelled lampilelo: at least i haven't seen one yet lampilelo: test lampilelo: i joined the channel as a guest from kiwiirc and the messages from it don't show up and there's no indication in the kiwiirc client that's the case, what if a noobie joins by clicking the link on guile's webpage and tries to ask a question? daviid: tohoyn: as sais earlier, there no 'default' version, it will import the latest installed on the system it's being used on, unless passed #:version ... daviid: tohoyn: you may list available versions, see (g-irepository-enumerate-versions namespace) daviid: here, scheme@(guile-user)> (g-irepository-enumerate-versions "Gtk") -| $2 = ("2.0" "3.0" "4.0") daviid: tohoyn: tx for the updated g-golf debian package daviid: tohoyn: https://www.gnu.org/software/g-golf/manual/html_node/Repository.html#Repository tohoyn: daviid: I built the new g-golf package against gtk-3 because libgtk-4 is currently in the experimental distribution. daviid: g-golf doesn't require gtk daviid: to build tohoyn: daviid: ok tohoyn: daviid: what about the test cases in g-golf? daviid: as tested here, they pass using any of gtk2, 3 or 4 - tohoyn: daviid: anyway, the g-golf debian package has currently a dependency to libgtk3 daviid: you should remove the dependency - what about someone want to try gtk4 ... leoprikler: I think the question is how to handle the case, when no Gtk is available at build time (more exactly during `make check`) leoprikler: Does g-golf handle that gracefully? tohoyn: leoprikler: test cases work but they required two patches to pass tohoyn: leoprikler: the patches were required in order to get test cases pass during the debian package build tohoyn: leoprikler: one patch is for using xvfb to run the tests daviid: i'll change the test suite - later on, have other priorities now ... - not to depend on gtk, nor clutter ... but you should _not_ make it depend on gtk3,nor clutter to build ... anyway,afk, bbl tohoyn: daviid: I'll work on that tohoyn: leoprikler: another patch was about removing a test case involving a TTY tohoyn: daviid: as long as the test cases depend on GTK it has to be in the dependencies tohoyn: daviid: but I'll change the dependencies so that libgtk4 is accepted, too tohoyn: daviid: ok? tohoyn: daviid: actually it should be sufficient to have the GTK and Clutter dependencies only in the Build-Dependencies daviid: not the build dependencies, the test dependencies daviid: these are pre-rebuild pkg, not official releases ... and that the test requires a gtk typelib is 'a thing', making it a specific version is 'wrong' tohoyn: what do you mean by test dependencies? Is there such a field in the Debian control file format? wingo: lampilelo: weird! happy to switch web irc links if we find one that works daviid: tohoyn: just not make the build depend on gtk nor clutter lampilelo: wingo: can people that are not logged in talk on this channel? i used just the default nick and didn't identiy tohoyn: daviid: since this is a pre-build package it should be ok to disable the tests during the Debian package build. Otherwise the package will not build unless gtk and clutter are not in the build dependencies. tohoyn: daviid: shall I disable the tests in the package build? wingo: lampilelo: no idea -- i am not an irc expert :P wingo: i don't think chanserv needs to identify you, if that's the question lampilelo: me neither, the last time i owned an irc channel was like 13 years ago daviid: tohoyn: yes, the pre-official deb package should not impose any of gtk and clutter ... tohoyn: daviid: ok lampilelo: hmm... maybe civodul knows more about it? tohoyn: daviid: changes done. dsmith: wingo: Yeah, -Werror might help that. And -Werror is a good thing to have anyway. dsmith: It's there an irc scheme for urls? Like irc://irc.libera.chat ? dsmith: ircs://irc.libera.chat/#guile taylan: hmm yeah, guile-guest can't speak. I had muted unregistered users on the first day of creating this channel because there was extreme spam due to the Freenode drama, it's probably that taylan: "Channel #guile modes: +ntz" I can never remember these mode letters... taylan: strange, according to https://libera.chat/guides/channelmodes none of those should mute unregistered users. dsmith: taylan: Weren't those spambot promoting freenode? taylan: yeah something like that. they were spamming "this channel has moved to freenode" in all-caps on repeat, like that's going to convince people :P dsmith: Ya. taylan: hmm, guile-guest can message #guix but not here, even though #guix also has +ntz set (and also C and c which seem irrelevant) taylan: also can't message #scheme which has the exact same flags as here. maybe the C or c flag on #guix does make a difference somehow. roptat: civodul, wingo you probably want to set a few more flags on #guile: it has PUBACL currently, whereas #guix has SECURE KEEPTOPIC TOPICLOCK GUARD PUBACL civodul: roptat: i'm a complete noob: what do we have to type? :-) roptat: /msg ChanServ set secure on roptat: and same for the other flags roptat: you can learn more about these flags with /msg ChanServ help set civodul: roptat: thanks, i think we're good now! taylan: the guest user still can't send messages taylan: roptat: ^ any insight on that? it can send to #guix but not here dsmith-work: Hey Hi Howdy, Guilers dsmith-work: https://libera.chat/guides/channels#why-cant-i-talk-in-a-channel dsmith-work: How do you contact a staffer? I'm not seeing that anywhere. dsmith-work: In #libera I guess leoprikler: Nice, #guile now has as many users here as in the compromised server dsmith-work: leoprikler: #guile or ##guile? I tried to connect earlier today and ##guile had about 8 nicks in it. dsmith-work: #guile was up to about 160 or so before the drama started, right? leoprikler: #guile dsmith-work: s/#guile/freenode #guile/ dsmith-work: leoprikler: are you in there? Can you invite me? leoprikler: just left dsmith-work: heh tohoyn: what's the problem with #guile? leoprikler: We were naughty and redirected people to Libera dsmith-work: Oh the drama roptat: taylan, I think I don't see all the flags/options, so to me the two channels look the same roptat: or I'm not looking at the right thing roptat: civodul, taylan I think you'd need to set -m on this channel roptat: but it doesn't seem to be set, so I'm confused dsmith-work: sneek: botsnack sneek: :) lloda: (check) flatwhatson: manumanumanu: +1 for srfi-197 in guile, i think they'd be particularly useful in guix where you can be chaining a bunch of package transform functions taylan2: tbh I'd rather just use let* or let-values* than learn all these new macros taylan: chain-when looks pretty neat though. although a good 'loop' macro should be able to do it as cleanly. (I never familiarized myself with any of them, like foof-loop.) apteryx: how can I handle an exception by doing some specific action (e.g., re-establish a lost connection), and restart from where the execution failed? I'd need to use some mechanism that doesn't unwind the stack, right? Would the continuation resume by re-attempting the call that caused the error, or would I need to unwind the stack by one step? apteryx: one frame* RhodiumToad: depends how the exception is thrown, I think taylan: apteryx: you could call the operation in a loop, breaking on success or after N attempts apteryx: taylan: right, a retry loop. I was thinking something more unusual such as where the connection problem is detected, throw an error that'd contain the information necessary to fix the connection in place, and resume from there taylan: hmm, I think that would require every possibly-throwing operation to be aware of this mechanism and restart itself after the handler fixes the issue taylan: in the end it will be like a retry loop that's just more granular in where it restarts apteryx: the condition raised could contain the continuation to resume perhaps? apteryx: and when that specific condition would be raised, the handler could reusem it after fixing the problem apteryx: changing topic, is anyone else having issues with ,break-at-source ? It doesn't seem to want to; I'm in a (guix scripts offload) module, I try: ,break-at-source offload.scm 721 (there's a procedure definition on that line) and it returns: "No procedures found at ~a:~a. "offload.scm" 721" maximed: test maximed: apteryx: about non-unwinding exception-handlng: see with-throw-handler or #:unwind? of with-exception-handler maximed: apteryx: also see raise-continuable wingo: moin maximed: wingo: Something I was wondering about the new cross-module inlining: does it work well when cross-compiling? For example... wingo: hoooo very good question! wingo: maybe it should be off in that case. it would inline from the host architecture maximed: ... I have this Scheme file defining O_NONBLOCK, O_PATH, ... flags (actually, they were different flags but whatever) wingo: i hadn't even thought about that maximed: for cross-platform support, I've defined a define-enumeration macro. It looks at %current-target-system. maximed: Something like (define-enumeration O_NONBLOCK #:hurd 9 #:linux 3) (actual values are different) maximed: wingo: I don't think cross-module inlining needs to be disabled altogether (but idk the implementation details). Maybe just check if the .go files we're trying to inline from are for the correct architecture and OS? wingo: we couldn't even load them if they were for the wrong architecture, but for hurd vs linux i dunno wingo: probably i would just turn it off if host and target systems are not the same, at least in the short term maximed: Maybe a CROSS_GUILE_LOAD_COMPILED_PATH is required, to keep the natively-compiled .go (which we'll use for macro's) and cross-compiled (which we'll use for cross-module inlining) separatere maximed: just disabling cross-module inlining when cross-compiling seems good in the short term maximed: wingo: did you receive my patch to guile-fibers? (wait-until-readable-operation or something) IIRC, the last version works and even has some tests and documentation maximed: sent it to guile-user@gnu.org IIRC, also on https://notabug.org/maximed/fibers/commit/08592e01dcbf5ba9d6ee74a2674272790a122352 maximed: I haven't really had an opportunity to use it yet though wingo: i think i saw it but have not been a good maintainer :P wingo: did you not want to re-use the existing epoll for some reason? wingo: like there is schedule-task-when-fd-readable from (fibers scheduler) wingo: which could be a good primitive for the "block" part of the operation wingo: maximed: ^ maximed: wingo: https://notabug.org/maximed/fibers/src/master/fibers/io-wakeup.scm#L75 maximed: I guess the first version did not use schedule-task-when-fd-readable, but the latest version does wingo: ah i see wingo: the select call is a problem tho, as it won't work for fd > 1024... maximed: select does not work for fd > 1024? First time I've heard of that. Is that guile-specific? wingo: nope :) maximed: do you mean ‘number of fds’ > 1024, or the fd > 1024? wingo: http://0pointer.net/blog/file-descriptor-limits.html wingo: i mean fd > 1024 wingo: >= actually wingo: see BUGS in select(2) wingo: of course guile should probably translate its scheme select interface to use poll or something... maximed: Could ‘we’ implement 'select' (the Scheme procedure) with 'poll' (the C system call) in Guile? *: maximed checks if that's done already wingo: would require some more work maximed: wingo: Read NEWS. In ‘Bugs fixed’: ** Prefer poll(2) over select(2) to allow file descriptors above FD_SETSIZE. maximed: Since 2.0.3 maximed: or maybe that's juts (ice-9 poll) maximed: * just wingo: i was looking at the implementation of "select" fwiw wingo: which uses the fd_set data type, which is the data type that has the limit maximed: (ice-9 poll) is not documented unfortunately wingo: thing is, if you are using fibers, there's no issue -- just schedule-task-when-fd-readable in a scheduler in a new thread wingo: checking again for readability doesn't add any safety wingo: right? maximed: The idea is to avoid suspending a fiber if the port is already writable / readable maximed: 'select' seemed convenient for that wingo: but you have to syscall for that wingo: and if you're going to syscall, you might as well use the epoll in the scheduler wingo: dunno wingo: different tradeoffs obviously maximed: latency / performance tradeoff I guess? maximed: I don't have any benchmarks or something. Whatever works I guess wingo: fwiw you can use char-ready? for input wingo: it returns #t even if only a byte is ready wingo: and bottoms out to "poll" maximed: yes but there is no can-write-char? for output. maximed: I guess the (readable? port) and (writable? port) can be removed for now (presuming tests pass) until we have concrete performance figures wingo: i think that's a good option wingo: humm wingo: right, this is for the operations interface... yarr wingo: ok in that case i would use char-ready? for the readable? -- it's strictly better as it is more portable, takes fd > 1024, and returns #t if there is data in the read buffer *: maximed is in what's called the "block" (translated, pun intended) here. I'll update io-wakeup.scm ... when the (study-thunk) fiber completes. wingo: ah :) wingo: sneek: later tell maximed the writable? side would have to take buffering into account somehow -- what to do if there is room in the write buffer? sneek: Okay. maximed: wingo: from 'select' documentation in Guile: "The ability of port buffers to provide input or accept output is taken into account. sneek: maximed, you have 1 message! sneek: maximed, wingo says: the writable? side would have to take buffering into account somehow -- what to do if there is room in the write buffer? *: maximed "blocking" for real this time civodul: wingo: heya! civodul: great that you found 8b994be59fc4d9d23d8fad546deca3dbb2d29df7 as a potential culprit civodul: these kinds of bugs are always interesting :-) wingo: civodul: fixed it too fwiw wingo: dunno if you saw civodul: wingo: great! haven't seen it yet civodul: (i have much less enthusiastic stuff to do for work...) dsmith-work: Morning Greetings, Guilers dsmith-work: wingo: Thinking about bugs 42345 and 42757 . What about making a call to an internal definition with the wrong number of args an error instead of a warning? dsmith-work: sneek: botsnack sneek: :) leoprikler: It's on 3.0.2 taylan: dsmith: I'm now at least able to explain the bug in detail: https://bugs.gnu.org/42345 leoprikler: applying that fix doesn't seem to work for me ._. dsmith: taylan: Very nice daviid: spacebat1: for info https://gitlab.com/a-sassmannshausen/guile-hall (which is not and not related to guildhall) is an option, although most of us use the autotools chain daviid: spacebat1: akku is another one https://akkuscm.org/ daviid: spacebat1: fwiw, hall is mentioned in the guile manual, here 4.8 Distributing Guile Code dsmith: taylan: Are you thinking that wrong-num-args bug is becuse how the function name is accessed, or becuse the frame is being constucted incorrectly? taylan: dsmith: not entirely sure yet but leaning towards "frame constructed incorrectly" because the docs about the calling convention seem fairly clear that the called procedure should be put in slot 0 taylan: dsmith: the comment about slot 0 not necessarily containing the procedure might be meant in the sense that the procedure's own instructions might decide to put something else there, when it's not needed anymore dsmith: Ahh. Yeah, I was wondering about that comment. apteryx: is here a way to programmatically add a breakpoint in the sources? something like '(use-modules (system vm traps)) (breakpoint)' (pseudocode) ? tohoyn: sneek: botsnack sneek: :) apteryx: I got a 'source-properties' object equal to '((filename . "/tmp/test.scm") (line . 6) (column . 33)), but somehow (source-property obj 'filename) returns #f. apteryx: seems to me source-property should be equivalent to assoc-ref, but apparently not apteryx: here's my current attempt, which fails with "No procedures found at ~a:~a. "/tmp/test.scm" 6": https://paste.debian.net/1198577/ *: apteryx zzzz apteryx: basically I'm after an equivalent to Python's 'import pdb; pdb.set_trace()' one liner. tohoyn: I'm compiling a large guile program with 3.0.7 and I get the following error: mmap(PROT_NONE) failed tohoyn: the compilation has worked with older versions of guile tohoyn: compilation with command "guild-3.0 compile -o tmp.go target-1.scm" tohoyn: I think this is a compiler bug tohoyn: Is it possible to attach large files into a bug report? wingo: tohoyn: i think that bug is libgc 8.x -- https://github.com/ivmai/bdwgc/issues/353 sneek: Welcome back wingo, you have 1 message! sneek: wingo, dsmith-work says: What's the difference betwen an OPn and a DOPn ? wingo: sneek: later tell dsmith-work same encoding, only that by convention the DOP writes to its first operand sneek: Got it. tohoyn: wingo: does that mean that there was not enough memory to compile the file? wingo: sneek: later tell civodul that shepherd bug looks interesting :) surely a problem with 8b994be59fc4d9d23d8fad546deca3dbb2d29df7 somehow sneek: Will do. tohoyn: wingo: Compilation of the file with guile 3.0.5 worked. wingo: tohoyn: that's possible. the question is, are you using libgc 8.x or 7.x wingo: there are other differences between 3.0.5 and 3.0.7 that can affect when and how gc runs tohoyn: wingo: version of package libgc-dev is 1:8.0.4-3 wingo: i think then that you are running into the aforementioned bug wingo: guile itself does not mmap(PROT_NONE) wingo: fyi compiling at -O1 uses less memory. could be a way to get around this issue in the short term, if you need something that will just let you move forward tohoyn: wingo: -O1 as an argument for guild? wingo: yeah guild compile foo.scm -o foo.go -O1 tohoyn: wingo: tx apteryx: any idea in which situation reading from a port (SSH connection) would return a object? unexpectedly? Could this signal the connection was lost? wingo: certainly. or shutdown on remote side. see shutdown(2) apteryx: OK! So I'm trying to add the ability to retry a connection in case it dies and resume normal operation; the code flow is currently something like this: create all connections, check they are alive, do X with connections, batch processing them. The problem is that at the time we batch process them, they might have died. I've modified the code to raise an exception in this case, and I could use a apteryx: brute-force retry mechanism that redoes all the things mentioned earlier from zero for a finite number of retries. Going further, is there a pattern/building block I should look into to make this more granular (at the level of an individual connection)? The current code looks like: apteryx: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/scripts/offload.scm?id=2b76179ecd951172288f5f6f78402d9304d2da41#n646. apteryx: phew, sorry for the wall of text dsmith-work: Morning Greetings, Guilers sneek: Welcome back dsmith-work, you have 1 message! sneek: dsmith-work, wingo says: same encoding, only that by convention the DOP writes to its first operand dsmith-work: D for Destroys Destination with Data from the Doing manumanumanu: Ahoy! manumanumanu: I had a small discussion with Zelphir about some old threading macros I wrote a long time ago. I told him that I advice against using them now that SRFI-197 exists. Would there be any interesti of having srfi-197 in guile? manumanumanu: not for, but in. I can take it upon myself to implement it and rewrite the SRFI document as texinfo. rlb: manumanumanu: I suspect I might well like them. rlb: fwiw manumanumanu: it is one of those often asked-for things, and there are a billion implementations of them. My old ones are fine, full-featured and portable - but ultimately not something I think anybody should use now that there is a standard alternative. manumanumanu: srfi-197 is a superset of most implementations, with good handling of multiple values to that jackhill: Recommendations on a good way to answer this question in guile: "have I seen this object before?" I'm thinking a set library may be useful. Thoughts? RhodiumToad: hashtable, possibly weak? jackhill: sounds reasonble. Do you know if there is an implentation already available for Guile? RhodiumToad: make-hash-table, hashq-ref, etc. are built in *: jackhill check the reference manual again. RhodiumToad: make-weak-key-hash-table if you want a weak one jackhill: Ah yes, thanks taylan: ecraven: dsmith: what is the purpose of this sign-extending or zero-extending? dsmith: taylan: You have an smaller bit value that needs to be placesd into a register with more bits. What do yout fill the "empty" bits with? taylan: dsmith: I would guess it doesn't matter, since they will be masked out anyway? dsmith: taylan: If you have an immidiate value, say "3". Why take up 32 or 64 bits of code when 8 will do? dsmith: IIRC on arm, there are no 32 bit immediates, you need to use two 16 bit immediates. (or is that 64 and 32?) dsmith: arm has some really wacky immediates. There was a nasty bug some of us were working on about a year ago. dsmith: IF you wanted to load 00xx00xx00xx00xx, where "xx" was the same, there special bits that do that with only haveing the "xx" in the opcode. dsmith: It was actually a jump or branch, iirc. dsmith: So -3 in twos-compliment in 8 bits is 0xfd, in 64 bits it's 0xfffffffffffffffd, if you want to load -3 into a 64bit registere, you gotta sign extend. 0x00000000000000fd is NOT -3 it's 253 or something. dsmith: Yeah, 253 dsmith: So the simple rule is, unsigned: use zero-fill, signed: use sign-extend. taylan: thank you for the explanation! dsmith: Np! dsmith: taylan: Thank *you* for stomping on all those bugs! tohoyn: sneek: botsnack dsmith: sneek: botsnack sneek: :) tohoyn: sneek: botsnack sneek: :) apteryx: is there a way to see which architecture a .go was compiled for? objdump says the architecture is 'architecture: UNKNOWN!, flags 0x00000150' dsmith: apteryx: "file" doesn't show that either. dsmith: apteryx: At one time, I had some rules for old-format .go files. apteryx: also, this still confuses me, why are .go target-specific? I thought they were targetting the Guile VM (being byte-compiled), with VMs being typically target-agnostic (that's their point, no?) spacebat1: is there a package manager for guile? guildhall seems quite old - I see a nice list of libraries on the guile website, which says they are gleaned from guix, but I can't run guix on MacOS apteryx: spacebat1: Guix is one option (it's not Guile-specific, but it's written in Scheme/Guile :-)) spacebat1: I can't use guix though, unless there is a way to run it on OSX spacebat1: maybe you run it in a container and have it install to the macos filesystem spacebat1: so that you can get to the artefacts directly running guile on macos, but that sounds dodgy spacebat1: how do people normally manage their dependencies in guile projects? write a makefile target that checks them out using git? dsmith: apteryx: There are 4 diferent "targets" in .go files: the combinations of 64bit/32bit and bigendian/littleendian. dsmith: So th same 32-LE .go file runs fine on 32bit intel and also, say, mipsel. dsmith: file on my laptop shows "64-bit LSB", and on my beaglebone black "32-bit LSB" dsmith: Yes! The big endian versions show "MSB" instead of "LSB" dsmith: apteryx: So there you go. You *can* see what "arch" a .go file was compiled for. leoprikler: spacebat1: the overlap between guile and guix is big. Other than that, most Guile stuff uses Autotools, so you ought to be safe if you check out all your dependencies and run `make install` dsmith: apteryx: Also, those old-format go files were also of just 4 kinds {64,32}-{B,L}E , but were not ELF. apteryx: dsmith: Thanks a lot for explaining! Using the 'file' utility I can see this too now. apteryx: Now wondering if this is Guile-specific; I'm guessing other byte-compiled languages such as Python (.pyc) files would have to solve that problem too, but I haven't been exposed to it yet. taylan: heya dsmith: apteryx: iiuc, pyc files are arch idependent, but not version independent. RhodiumToad: a common technique (I don't know what python does) is to have a magic identifying string that includes any important details. going full ELF as guile does seems not to be common dsmith: Yeah, I've never heard ELF used for anything but .so's and executables. taylan: I only now realize that the numbered slot references in disassembled bytecode, e.g. (make-immediate ), are backwards from the max slot. so 0 is the last slot, N the first. terribly confusing :\ taylan: (it's because of the downward-growing stack) RhodiumToad: ELF has the advantage that there's a lot of tools, but it's also a whole lot more complex than most languages would ever need dsmith: taylan: Making any more progess? taylan: dsmith: very slowly, trying to grok everything at every step :D dsmith: There is a very nice text diagram in the comments of one of the source files. dsmith: libguile/frames.h taylan: I saw it, it's in the info manual too, but it's a little misleading as it shows the slots numbered top down, but the slot references in disassembly are the other way around taylan: the fourth last paragraph in the manual actually explains this but I had missed it until now taylan: fifth last and fourth last, rather taylan: are negative pointer references actually slower than positive ones? seeing slot references 0 to -N would have been less confusing than N to 0 IMO. taylan: (using the frame pointer instead of the stack pointer as the base) manumanumanu: Ahoy! *: sneek waves manumanumanu: sneek has new features! manumanumanu: Scrapt that. Sentience!!! *: dsmith snorts manumanumanu: Does "potentially unbound variable" warnings warn before DCE? manumanumanu: yes manumanumanu: I am old enough to repl (when #f (display unbound!!)) civodul: i found an interesting miscompilation issue with >= 3.0.5: https://issues.guix.gnu.org/47172 civodul: does that ring a bell? dsmith: civodul: Wow. Inlcudes a heisenbug. taylan: civodul: yeah I think that's in debbugs already, let me check taylan: civodul: the report even comes from guix-land: https://bugs.gnu.org/48368 taylan: I see Marius already referenced that bug in the Guix report RhodiumToad: is there a self-contained example of that? I haven't managed to reproduce yet civodul: taylan: indeed! dsmith: I wonder if swapping the args to eq? changes things, since swapping the and sub-expressions did. As in (eq? 'detailed-status action) leoprikler: Can someone tell me what can get GC to deadlock in pthread_cond_wait? leoprikler: call-with-trace does not seem very helpful, it barfs on FFI stuff dsmith: Is that with the recent patch? dsmith: This: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43102 lampilelo: taylan: write a blog post about it, when i decide to study the vm i want to do it on easy mode! taylan: lampilelo: lol, might do so. that being said, I had completely forgotten that the VM is documented to some degree in Guile's Info manual taylan: if it explains everything that I figured out manually in the past two days, I will be quite bummed :P well, I guess it's always good to have seen the code anyway. lampilelo: hmm, seems like there's a lot of info there hwpplayer1: hi people! tohoyn: sneek: botsnack sneek: :) ArneBab: leoprikler: what do you mean by a wisp sexp? Do you mean inline-parenthesized-code? If yes: prefix the first paren with a period: . (display foo) leoprikler: no, i mean stuff like "\t\tdisplay foo" leoprikler: If I jump to a line like that and then try to read a sexp, wisp errors out because of the indentation maximed: Why are cons and vector in *effect+exception-free-primitives*? They can throw an 'out-of-memory exception, no? leoprikler: everything can throw out-of-memory potentially :P amirouche: maybe not `values` amirouche: nvm idk leoprikler: car and cdr should be really safe, but both can throw :P amirouche: if there is no more memory, even values can fail. leoprikler: (invalid-argument, that is) dsmith: Probably doesn't matter, as nothing seems to call effect+exception-free-primitive? anyway. avp: Hello Guilers. avp: So the Guile chat moved here, I guess? ArneBab: welcome :-) ArneBab: moved here because #guix also moved here, iirc avp: Okay. I'm curious what was the reason for the Great GNU Guile Migration? avp: I fixed Guile-SSH building/testing issues on Fedora GNU/Linux 34. Also now there's a Docker image based on Fedora with GNU Guile pre-installed: https://hub.docker.com/r/avvp/fedora-guile taylan: hi all taylan: does anyone know what "sign-extended" and "zero-extended" immediates are? ecraven: probably extending 8->16 bit by copying either the msb, or 0 into the high byte ecraven: and the same for 16-32, ... efraim: I'm getting a test error for guile-3.0.7 on powerpc-linux, ERROR: suspendable-ports.test: revealed port fdes not closed - arguments: ((system-error "seek" "~A" ("Bad file descriptor") (9))), happened on two successive runs efraim: didn't happen with 3.0.5, didn't test 3.0.6 civodul: efraim: i've seen it reported (for x86_64), but this seems non-deterministic and quite infrequent civodul: there were changes around finalizers in 3.0.7 so it could be related efraim: I'm sending it though again without my bootstrap optimisations, should find out if it worked in 3 or 42 hours dsmith: taylan: What ecraven said, upper bits are filled in with either 0 or the sign. ecraven: so you have an immediate #b10000000 to some instruction. if you sign-extend it, it'll be filled with 1s to the left (because the most-significant-bit is 1), if you zero-extend it, it'll be filled with 0. usually you want sign-extension for signed integers, and zero-extension for unsigned integers dsmith: So 0x7f -> 0x00000007f is the same for bother zero-extend and sign-extend, but 0xf2 -> 0xfffffff2 (sign-ex) or 0xf2 -> 0x000000f2 (zero-ex) dsmith: I guess that's assuming twos-complement, which all modern cpus are. dsmith: Are there any sign-magnitue or ones-complement machines still running? dsmith: sneek: botsnack dsmith: sneek: botsnack dsmith: sneek: botsnack sneek: :) dsmith: goodbot dsmith: sneek: botsnack sneek: :) dsmith: sneek: logs? sneek: Someone once said logs is http://logs.guix.gnu.org/guile/ manumanumanu: So, this channel is actually happening. civodul: hi! :-) lampilelo: hello lampilelo: i removed freenode from my config already lampilelo: so i hope everyone will transition or i'll miss out civodul: yeah civodul: wingo: i looked a bit at peval of (let ((x (list 1 2))) (car x)) civodul: i'm not sure whether/how to fix it without also breaking (let ((x (list 1 2))) (lambda () x)) wingo: sneek: later tell taylan thanks for grabbing the channel! i adjusted the flags so it is me and civodul now, but don't hesitate to ask if you need anything sneek: Got it. wingo: civodul: yeah we certainly can't break (let ((x (list 1))) (lambda () x)) wingo: civodul: fwiw CPS optimization does manage to punch through it wingo: hum interestingly it doesn't manage to fold the "string?" but it does punch through the caar manumanumanu: now, I might be admitting to being an idiot, but why can't this be inlined to (lambda () (list 1)) ??? Does it have to be a closure? civodul: manumanumanu: because of pointer identity manumanumanu: ah manumanumanu: of course. civodul: wingo: if CPS gets it, maybe that's enough civodul: the assembly still looks like more than just emitting an immediate though wingo: the assembly shows that it effectively emits (string? "x") wingo: instead of #t wingo: i mean in your initial test from yesterday wingo: right, paging this back in. the issue with inlining (car x) when x is bound to (list 1) is that someone could set-car! on x wingo: to know whether that happens or not, you need flow analysis, which isn't what peval does wingo: there are obviously some patterns that peval could recognize if useful, e.g. transform (let ((x V)) (f x)) to (f V) wingo: but in the case you were looking at, already it was getting more complicated because it was (let ((x V)) (if (pred x) ... ...)) wingo: was even (if (string? (car (car x))) ...) wingo: so... tricky and ad-hoc wingo: better to have a comprehensive flow-based analysis wingo: sometimes i think we should have an SROA pass early in CPS (https://llvm.org/doxygen/SROA_8h_source.html#l00065) civodul: wingo: i see; it was surprising to me that peval would be stopped by a mere 'let', but i see it's probably not the right level to do these things taylan: tohoyn: heya sneek: Welcome back taylan, you have 1 message! sneek: taylan, wingo says: thanks for grabbing the channel! i adjusted the flags so it is me and civodul now, but don't hesitate to ask if you need anything taylan: wingo: perfect like this, the less responsibility I have the better ;-) dsmith: civodul: erc is working for me with both #guile's civodul: dsmith: you think it's working, but you'll see... :-) civodul: it'll start behaving strangely civodul: bandali confirmed yesterday dsmith: civodul: Hmm. I haven't noticed anything. dsmith-work: Happy Friday, Guilers!! dsmith-work: sneek: botsnack sneek: :) *: sneek wags dsmith-work: wingo: Some of us were looking at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42757 yesterday. dsmith-work: wingo: There is a comment before scm_c_frame_closure in frames.c dsmith-work: wingo: Sepcifically, "If you want the procedure, look it up from the IP." dsmith-work: wingo: Any hints on how to do that? dsmith-work: wingo: Specifically, in error_wrong_num_args in intrinsics.c dsmith-work: (And I'm considered cheating by asking.) taylan: dsmith-work: I think I figured it out, by following the definitions of: frame-procedure-name in frames.c -> (@@ (system vm frame) frame-procedure-name) -> primitive-code-name taylan: I made a corresponding patch, but in our pathological case it just ends up saying "#f" instead of naming the procedure, even though the disassembly contains the name, so evidently it still misses an opportunity to find the name ruffni: it seems impossible to (make-regex "asdf \\") (Trailing backslash). is this a bug or a feature? is it best practice to also include a (hopefully) following whitespace or newline character? taylan: here's the current state of my patch: http://paste.debian.net/1198345/ taylan: ruffni: a lone backslash at the end of a regexp is a regexp syntax error I believe RhodiumToad: exactly RhodiumToad: if you want to match a literal backslash you need "\\\\" anyway ruffni: yeah, got it :) (make-regex "\\\\") works ruffni: thanks! RhodiumToad: one level of \-escaping is processed by the "..." literal, and another level by the regex compiler dsmith-work: taylan: Probably becuse scm_i_primitive_code_p() in programs.c:scm_primitive_code_name returns false. taylan: dsmith-work: yes taylan: I have no idea what the IP actually points to in our case taylan: what I also noticed is that (@@ (system vm frame) frame-procedure-name) takes an optional "info" argument from which it can get the name, and we might perhaps get a hold of such an "info" object somehow dsmith-work: taylan: How about a different approach. Instead of a warning when outer is defined, make that an error? taylan: dsmith-work: you mean a compile-time error? not sure if the compiler can be 100% sure about it... hmm, in this case I suppose it could, since it's an internal definition. taylan: I can imagine that the mechanism for detecting wrong number of args in the compiler is implemented in a generic way so it's also used for top-levels though, which can change at runtime dsmith-work: Yeah. dsmith-work: I'm suspicious that the frame is not constructed properly becuse the differnet number of args. dsmith-work: I really don't know. Just wonderng.. taylan: I wish I could understand what "DOP1 (X8_S8_ZI16)" means :D dsmith-work: Why *obviously* it makes a 16 bit value from an 8 bit immediate! dsmith-work: ;^} taylan: dsmith-work: are you serious or did you just make that up? :P dsmith-work: taylan: Only half serious. Look at line 1643 in vm-engine.c dsmith-work: Don't know what X8 means. Maybe size of the opcode? taylan: what's also confusing me right now is that that argument to the VM_DEFINE_OP macro doesn't actually seem to be used anyway dsmith-work: The S8 and ZI16 are prob source and destination? taylan: there are two possible definitions of VM_DEFINE_OP (based on whether one is using a compiler that supports &&label to get the address of a goto label) but neither use that argument dsmith-work: taylan: There is some Makefile magic that might use it. dsmith-work: taylan: See the contents of vm-operations.h dsmith-work: taylan: And the FOR_EACH_VM_OPERATION is used is many places. taylan: dsmith-work: oh I see, vm-operations.h is autogenerated from vm-engine.c via sed :D Noisytoot: sneek: botsnack sneek: :) lfam: Hello sneek *: taylan abandons Freenode entirely as all the channels he cares about officially migrated to Libera :P dsmith-work: taylan2: If you look at the places FOR_EACH_VM_OPERAION is used, sometimes that "meta" *is* used. And it's named "arity" in some places. dsmith-work: wingo: What's the difference betwen an OPn and a DOPn ? dsmith-work: Destructive? Destination? dsmith-work: sneek: later tell wingo What's the difference betwen an OPn and a DOPn ? sneek: Got it. taylan: aww netsplit dsmith-work: I imagine there will be some growing pains. taylan: dsmith-work: you still here? I'm 99% sure that the DOP/DST stands for destination. all but one of the VM ops defined with DOPn declare a uintN_t dst; first thing in their body, and that seems to be used as a destination address. dsmith-work: Ok. taylan: not sure why that's special-cased, probably just because it's extremely common taylan: from what I can tell it seems one could have also defined another "word type" say DST and every OP (...) as OP (DST, ...) dsmith-work: One (only?) difference is when printing. The "D"'s have "<-". Non-D's have "!" dsmith-work: In parse_instruction in instructions.c taylan: interesting. I guess the arrow means "puts something there" and the bang means "does something in-place" or so dsmith-work: tail = scm_cons ((meta & OP_DST) ? sym_left_arrow : sym_bang, tail); dsmith-work: As fas as I can tell, that's the only palce OP_DST is used. taylan: one thing I'm wondering is, why those cryptic identifiers like Xn_Cn_... dsmith-work: Mnemonics. Shorter to write and fit on screen. IF you origianly wrote the code. ;^} taylan: in case my last messages didn't make it: I'm wondering why the "instruction word types" have cryptic names like Xn_Cn_... taylan: I like it how at the end of vm-engine.c there's a piece of Elisp code to auto-update the opcodes for you :D bjoli: taylan: better than visual studio! dsmith-work: taylan: Ya, that's pretty sweet. ArneBab: taylan: nice! sneek: ArneBab, you have 1 message! sneek: ArneBab, leoprikler says: should it be possible to read a Wisp sexp from the middle of a file assuming proper indentation? *: taylan is starting to get the hang of how the VM works sneek: No this is not sneek. Just registering the nick nckx: You gave us hope only to snatch it away. taylan: FYI, since wingo isn't registered on libera yet, I gave channel founder and other rights to civodul for now, since he's also an official maintainer. I'm going to sleep now! taylan: wingo: you have full founder rights to the channel now, feel free to revoke mine if you decide to take control over it wingo: tx lampilelo: how does guile handle threads and gc? is it safe to pass an SCM object to another thread by SCM_UNPACK_POINTER->body_data->SCM_PACK_POINTER, using scm_spawn_thread? is the object safe to use from both threads? leoprikler: Guile should check all *stacks* for GC, but it doesn't care what's on the heap. Quits:: nicole (ilbelkyr@freenode/staff/atheme.ilbelkyr) (Killed (grumble (My fellow staff so-called 'friends' are about to hand over account data to a non-staff member. If you care about your data, drop your NickServ account NOW before that happens.))) *: daviid has a g-golf wip-3.0 branch that now successfully works with 2.2 and 3.0.7 wingo: yay :) wingo: ffs https://gist.github.com/joepie91/df80d8d36cd9d1bde46ba018af497409 taylan: wingo: I already opened #guile@irc.libera.chat and can give you channel ownership when you want :D nickserv registration doesn't seem to work yet though... wingo: good to know! flatwhatson: nickserv worked for me just now leoprikler: sneek later ask ArneBab should it be possible to read a Wisp sexp from the middle of a file assuming proper indentation? sneek: Got it. dsmith: taylan: Is irc.libera.chat actually working? Connection closes for me when I use erc-tls to connect taylan: dsmith: maybe it's TLS-only. I was able to connect to irc.libera.chat:6697 with TLS dsmith: Hmm. I'm not able. davexunit: I connected with erc-tls no problem dsmith: Doh! typeoed the fqdn civodul: peval reduces (string? (caar `(("x" ,+)))) to #t, yay! civodul: but it fails to do that with (let ((x `(("x" ,+)))) (string? (caar x))) civodul: wingo: what are your thoughts on this? ft: Hm. Didn't guile have something that turns a file glob pattern into a list of matching file names? Did I just dream that? civodul: ft: i don't think there's anything for glob patterns in Guile civodul: Gash has that, and Guix has a regexp-based 'find-files' procedure ft: civodul: Thanks! I may have to borrow that real quick. :) lampilelo: guile has readline support that you could use for that, if filename completion worked, but it doesn't lloda: i saw your bug report on that a while ago lampilelo lloda: i've had this problem for a while that i have filename completion in embedded guile and i don't know how to switch back to normal completion lampilelo: the report has a patch attached lloda: the switch happened one day i updated some debian packages i think. No idea how lloda: do you happen to have a link? lampilelo: wait, filename completion worked for you? with filename-completion-function? lloda: no lloda: i didn't do anything lloda: it just works lloda: but only in embedded guile lloda: in plain guile i get normal completion lampilelo: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45339 lampilelo: i don't think it solves your issue of not being able to switch to normal completion though lloda: maybe lloda: patch seems straightforward tho lloda: i'll push it lloda: I tested with (with-readline-completion-function filename-completion-function (lambda () (read))) which i remember not working before lloda: thx lampilelo lloda: civodul: wdyt about reverting master to 3.0.7 like wingo was saying lampilelo: thanks for pushing it, i remember rewriting a script from guile to elisp because filename completion didn't work, elisp is fine but not very good for scripts so i wrote this patch anyway lloda: np, sorry it took so long lampilelo: i forgot about it too wingo: civodul: weird :) re the peval thing lampilelo: fwiw i'd prefer if you just outright removed master branch because i'm sure some day i'll try to compile master and be surprised by the wrong version, i'm saying it from a perspective of someone who git checkouts to the newest tag after a release and rarely compiles the most recent code lloda: yeah that's also my take lloda: there's no confusion if the branch is gone wingo: removing is fine with me lampilelo: i have an unrelated question: do you require copyright assignment to fsf from contributors? lloda: lampilelo: yes lloda: tbh i'm not sure of what is the size of patch where that becomes a thing dsmith-work: UGT Greetings, Guilers wingo: i would like to stop requiring assignment fwiw wingo: haven't gotten around to doing that yet tho wingo: will require some policy statements etc lloda: i've pushed the patch in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43102 lampilelo: i think it was >15 lines total? per contributor, not per commit dsmith-work: Oops. Commit 02439a1 doesn't follow gnu style. lloda: what's that dsmith-work dsmith-work: (I personally really dislike the GNU C style, but I appreciate having a consistent style) lloda: ah i see lloda: i didn't even notice tbh dsmith-work: lloda: { on a separate line, indented 2. body idented 4 lampilelo: ah, sorry, that's my commit dsmith-work: It is just such a small commit that it popped at me. lloda: i'll try to remember dsmith-work thx lampilelo: yes, me too lampilelo: should i send an updated one? dsmith-work: civodul, wingo: ^^ chrislck: uh oh: https://blog.bofh.it/debian/id_461 https://www.kline.sh/ chrislck: ah old news dsmith-work: What's with the "THIS CHANNEL HAS MOVED TO IRC.FREENODE.NET" messages on libera? lampilelo: i sent a new commit to bug-guile: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45339 lampilelo: dsmith-work: could you review it? ft: dsmith-work: Sounds like trolls? dsmith-work: lampilelo: LGTM dsmith-work: ft: Yep rekado: hmm, guile-redis cannot be built with guile 3.0.7 rekado: “unknown location: unexpected syntax in form ()” lloda: lampilelo: pushed lampilelo: thanks lampilelo: and sorry for trouble rekado: very confusing. There’s no “()” in the file it complains about. taylan: rekado: and it surely doesn't use #nil, right? civodul: lloda, wingo: i think i missed something: reverting master to 3.0.7? taylan: (I happened to work on a #nil-related bug in 'match' recently that produced that same error message) taylan: civodul: master has been moved to "main" civodul: ah rekado: taylan: no #nil. civodul: hmm dunno lloda: the other option is to remove master entirely *: civodul goes afk for a bit lloda: but maybe some distro relies on that? no idea rekado: it’s this file here: https://github.com/aconchillo/guile-redis/blob/master/redis/main.scm rekado: it might be because of “(syntax-rules () …)” in redis/commands.scm rekado: ah, and there’s a #nil rekado: yup, replacing the #nil with (list) fixes it. taylan: rekado: this was the bug I worked on FWIW: https://bugs.gnu.org/48315 taylan: rekado: the main takeaway for me was that the syntax-rules pattern (x ...) matches #nil, which can be surprising but makes sense in a way I guess rekado: thanks for the pointer! rekado: I reported this as a bug in guile-redis here: https://github.com/aconchillo/guile-redis/issues/7 – I think #nil shouldn’t be used. taylan: rekado: do you know why they use #nil? the general idea is that it's strictly for elisp-compatibility purposes and shouldn't ever be used explicitly in Scheme... rekado: yeah, I don’t know. lloda: maybe that point hasn't been stressed clearly enough lloda: https://www.gnu.org/software/guile/manual/html_node/Nil.html leoprikler: I think it's fair to use #nil in contexts where you want something to be both the empty list and false :P leoprikler: Who cares about RnRS? taylan: leoprikler: I'm not sure... it can cause headaches to the Guile maintainers when they want to tweak an aspect of how exactly #nil behaves when they realize they can improve Elisp compatibility, or improve Guile's performance without breaking Elisp compatibility leoprikler: wdym exactly? taylan: it's less about RnRS and more about why it was added to Guile in the first place, which is: an Elisp compatibility hack taylan: leoprikler: for instance it's unclear whether (equal? '() #nil) should be #t or #f, and if your Scheme code relies on either, then Guile maintainers realize that it would improve compatibility to change it, your code will break... taylan: and next thing you'll complain at the Guile maintainers for "breaking" your code :P leoprikler: I would never demand from Guile maintainers to make #nil equal? to either '() or #f taylan: if you're ready to tweak your code in accordance to changes Guile makes to the semantics of #nil then no problem I guess :) leoprikler: I do however rely on ((@@ (ice-9 match) match) (cons 'a #nil) ((a) #t) (_ #f)) => #t leoprikler: Which I personally think is a fair assumption to make. taylan: yeah IMO that should keep working, otherwise lists coming from Elisp-land won't work properly with 'match' leoprikler: funnily enough you can't write (match #nil ...) leoprikler: you have to write (match (identity #nil) ...) taylan: leoprikler: there's a bug report about that and I have a patch for it: https://bugs.gnu.org/48315 terpri: leoprikler, technically, it already breaks rnrs (unless #nil is considered not to be a scheme object), by extending null? for example. but that's a fairly conservative extension imo leoprikler: that's exactly what I meant with "who cares about RnRS" :P terpri: whereas making equal? a...tolerance relation, i think? rather than an equivalence relation might have consequences for optimazation or something even though it might be convenient on a pragmatic level to make r5rs do the intended thing in the presence of #nil dsmith-work: So the nil #f '() issue is one thing. I'm curious about the lisp-1-ness of Scheme and the lisp-2-ness of emacsl-lisp. How is that handled? terpri: dsmith-work, at the moment, very simply: the values of the symbol slots are stuffed into separate guile modules (value-slot-module, function-slot-module, etc.) terpri: the elisp symbol slots, that is terpri: it was written that way mostly for expediency; it's probably not the ideal design leoprikler: I think the problem could easily be solved by the user defining false? as (member '(#f #nil)) and using null? leoprikler: note, that emacs does have the notion of an obarray, but it's used sparingly wingo: in guile, that is more efficiently implemented as (not x) terpri: yeah, iirc there's no obarray in guile-emacs leoprikler: wingo: I didn't say it was the best implementation of false? :) (define false? not) (define true? (negate false?)) should work manumanumanu: civodul: peval reduces this: https://paste.debian.net/hidden/8f48a9f5/ to (reverse (list 3 1)). manumanumanu: civodul: that is not quite true. It becomes something like (let* ((cursor (list 1)) (cursor-1 (cons 3 cursor))) (reverse cursor-1)) wingo: leoprikler: i just mean that (not #f) => #t and also (not #nil) => #t leoprikler: Oh sure, but people seem to hate writing (not) leoprikler: especially as (not (not )) wingo: ok if this is an aesthetics question, sure :) wingo: there is ->boolean fwiw wingo: ->bool rather wingo: not recognized by the compiler tho leoprikler: lemme guess (compose not not) :D wingo: haha if only we could be so elegant in boot-9 ;) leoprikler: well, (define (->bool what?) (not (not what?))) is semantically the same anyway terpri: wingo, fwiw i think i'm probably wrong about the idea of making #nil equal? to other scheme values, since that would emphasize either its boolean-nature or list-nature at the expense of the other. making it equal? to a boolean or a list would privilege one interpretation, making some rnrs programs "just work" while others would be broken leoprikler: #nil equals wingo: ah i think i am missing some of the scrollback on this laptop leoprikler: * #nil equals #nil, nothing else wingo: terpri: you were considering a change but decided against it, if i understand correctly terpri: right, i was (perhaps a bit selfishly) focusing on more transparent elisp compatibility wingo: hehe wingo: omg if you are back on this hack, that is fantastic news!!! wingo: (if not, that is ok too, no pressure :) wingo: but do as you will re: elisp in guile, i trust your judgment leoprikler: I can't wait to rewrite half of dystopia.el in 3.0.8, because keywords are finally recognized :) terpri: wingo, the idea is due to taylan, and i agreed with them initially, but it can't be done "the right way" (or, per newer rnrs, the very wrong way) by adding more equalities, since as someone helpfully pointed out... leoprikler: by the transitivity you would have (equal? #f '()) in the end, which is silly :P terpri: (equal? #nil #f) and (equal? #nil '()) would reduce equal? to a mere tolerance relation terpri: due to transitivity leoprikler: fwiw, elisp should also have not and null? leoprikler: as in standard elisp manumanumanu: wah... I had a closer look at some of the scheme benchmarks things. the scheme benchmarks are _not_ comparing the same thing at all, even if we only do safe optimizations. cyclone does memoization of pure recursive functions :) And does no cycle detection. terpri: lacking the extra #nil equalities will surely break the "intent" of some rnrs programs (for n > 3, iirc) terpri: but maybe that can be papered over with a lisp-compat module or something that redefines equal? and friends leoprikler: does RnRS want people to compare booleans and lists with equal? terpri: (another idea is to have, internally, a "lisp box" which is totally transparent to scheme except for #nil, and for #nil requires an explicit coercion, but that sounds a bit clunky and maybe bad for perf) *: terpri should be writing this up for emacswiki leoprikler: or is this about (equal? '(a b c) (cons* 'a 'b 'c #nil)) leoprikler: (which I'd argue should be done in terms of match anyway) terpri: leoprikler, yes, that sort of expression is the "problem" taylan: terpri: are you sure privileging (equal? '() #nil) over (equal? #f #nil) would be a problem? IMO privileging one would be better than neither, and I think #nil is the better choice due to its ubiquitous role in list structure, but not sure... leoprikler: taylan since you mentioned clojure the other day, what would happen if (equal? '() #nil) and (equal? #() #nil) :P taylan: leoprikler: I'm not well-versed in Clojure... leoprikler: maybe that was someone else then, sorry, my memory might be fuzzy taylan: leoprikler: but IIRC nil doesn't equal the empty vector in Clojure? justin_smith: I hope #() was a typo leoprikler: why would #() be a typo? justin_smith: oh right #() is a vector in guile leoprikler: didn't someone say that #{}, #(), '() and #nil are same-y in Clojure? justin_smith: taylan: correct, conj treats nil as if it were an empty vector, but an empty vector and nil are not equal terpri: rlb is a clojure/lokke expert in this area, who mentioned #nil's utility in clojure-on-guile justin_smith: leoprikler: not quite - the "seq" function collapses all of them to nil but that's an abstraction layer used for sequential data, and not a property of those data structures terpri: taylan, well, we can define it either way, considering it's a unique(?) extension for modern scheme justin_smith: so instead of having map-list map-vector map-set etc. we have map, which uses seq to get a sequential view of any collection leoprikler: ahh, yeah, thank's for clearing that up justin_smith: leoprikler: which might be an approach worth emulating - instead of treating empty collections as nil as false, using a function that is false for empty collections and nil and true for other inputs terpri: taylan, it's just a situation where we (probably) can't have our cake and eat it too, in terms of behavior matching a scheme programmer's likely intent in all situations taylan: terpri: BTW another elisp issue: https://bugs.gnu.org/39221 would be interested in your thoughts / review of the patch :) terpri: taylan, i think any of (and (equal? #nil '()) (not (equal? #nil #f))), (and (equal? #nil #f) (not (equal? #nil '()))), or (and (not (equal #nil '())) (not (equal #nil #f)))) are all acceptable in a formal sense leoprikler: taylan: I'm all for extending emacs symbolp leoprikler: i.e. symbolp = (or symbol? keyword? #t #nil) terpri: i don't have a good intuition for which "pun" would be more useful, if any, but i wouldn't object having one of them enabled -- probably little harm in just trying one out at this point if you find one distinctly preferable, or if one choice makes #nil an appropriate representation of clojure nil but not another, etc. (the only caveat i can think of is that for the "punning" options, there might be low-level bits terpri: of guile to consider, like equal? as a hash table predicate) leoprikler: I really think the pun should be handled by some separate entity like seq terpri: (tbh the mathematical-logician part of me doesn't like the idea of introducing equality "puns", but as long as it's marked experimental, it should be harmless enough to try it out and perhaps we could do some testing with important programs like srfi-1) leoprikler: I think stuff like SRFI-1 should just handle #nil internally without a pun. terpri: sort of a Solomon-esque solution ;) terpri: "no you can't have either convenient thing, fix your program or import a compatibility module" leoprikler: Not only would this probably solve most issues that could arrive in RnRS programs, it's also show how to implement things correctly *: terpri reads the symbol patch leoprikler: and people wouldn't be led into the temptation of comparing with equal terpri: leoprikler, yeah, that's the ideal outcome, people using procedures like null? where appropriate and not relying quite so much on the concrete representations of things (even though it's perfectly legal per rnrs) leoprikler: IMHO Guile documents its RnRS incompatibilities pretty well. leoprikler: that's more valuable than "Oh, it's legal RnRS, it should work." leoprikler: The equivalent C would be "It compiles, so I don't care." terpri: i don't know if it's technically feasible, but it would be neat if it were a runtime option (perhaps an, ah, optional runtime option) so that people could test their programs under different modes and find out "how broken will my program be when the million-line elisp elephant enters the room" leoprikler: I think a compiler warning about (equal? '()) and (equal? #f) should do the trick as well leoprikler: assuming people use the compiler :P leoprikler: and of course optional so as to not confuse people, who know what they're doing dsmith-work: Speaking of compiler warnings, wouldn't it be nice to *only* display all those "hey I'm compiling this now" messges when specifically asked to? As in a -v option? leoprikler: you mean the auto-compilation? imo the current stuff is fine, because it gives you performance by default but warns you about the side effects that may have terpri: taylan, to answer your earlier question, pragmatically speaking, imo you're probably right that the equal? issue will pop up more often with lists. i'd guess (eq? #nil '()) => #f and (eq? #nil #f) => #f will both cause issues with real-world programs, but we can't do anything about that in core guile, at least without a radically different design for lisp<->scheme communication leoprikler: auto-compilation can break programs in unforeseen ways after all :P terpri: which doesn't mean we should necessarily introduce the pun, but i concur it'll be more of an issue (how often is it likely to show up with booleans? (member? #nil '(#f ...)) and the like?) terpri: i like the compiler-warning idea too (which could help with more than just equal?) taylan: dsmith-work: I have a patch to add --silence-auto-compile here: https://bugs.gnu.org/16364 I guess it could use an env var too. taylan: the CLI switch was my priority since that'll allow script authors to do it dsmith-work: taylan: Yes, saw that. I'm suggesting the logic should be inverted. *: terpri pokes around debbugs to see if they can commit things through that interface (as a savannah-level guile commiter) taylan: dsmith-work: hmm, maybe so. I have no strong opinion on it. terpri: taylan, the symbol? patch lgtm on an initial skim, thanks for fixing that! (might be the sort of bug where emacs ended up redefining the boot.el definitions...or maybe it's just been broken this whole time, who knows) taylan: terpri: btw any plans of rebasing your branch on 3.0? :P I guess it's probably a big task... oh and, you've seen rekado's rebase on a more recent 2.2, right? terpri: wingo, i'm afraid i'm not back on the hack just yet, as i'm working at a gamedev-tools startup which needs me full-time atm, lest it run out of runway. but in 3-6 months my client expects that i should be able to work roughly half-time terpri: and then full, er, half speed ahead! rlb: In case it wasn't fully covered, yeah, in clj nil is also effectively an empty collection for most purposes, and it's also "false", while other concrete empty collections like #{} [] '() are not. terpri: taylan, yes, provided it's not too time-consuming. thanks for mentioning rekado's rebase, i rememebered someone worked on it after dustyweb but not who) rlb: and if I remember the history correctly, clj used to be more like elisp, in that '() was false too, but they intentionally changed that, I believe to improve laziness. rlb: Think this may talk about it, and in case you didn't see it earlier: https://clojure.org/reference/lazy rlb: Personally, I find the collection/seq (laziness) abstraction often very convenient, but it's indeed not very traditionally "schemey". taylan: rlb: assuming there's an 'equal?' of sorts in clojure, nil isn't equal? to any of '(), [] or #{}, right? taylan: assuming ClojureScript has the same semantics, according to https://clojurescript.io/ (= nil '()), (= nil []), and (= nil #{}) are all false, only e.g. (= nil (seq '())) are true taylan: but I'm not sure if clojure's '() is represented via Scheme's '() in lokke. if so, then (equal? #nil '()) might pose a problem I guess. taylan: I feel like we discussed this a few days ago already but I forgot since I couldn't keep clojure's semantics in mind, sorry ^^ terpri: taylan, same results for = on regular clojure dsmith: sneek: seen taylan sneek: I think I remember taylan in #guile 6 hours ago, saying: there's an unresolved, trivial, 8 year-old bug about it :D. dsmith: sneek: botsnack sneek: :) dsmith: RhodiumToad: Do you of any decent cheap mips boxes that run netbsd? I ha{ve,d} a cobalt qube, but that doesn't seem to be viable any more. dsmith: RhodiumToad: (it's where sneek used to live) dsmith: Oh! https://wiki.netbsd.org/ports/cobalt/ Maybe it is still supported *: RhodiumToad has no experience of netbsd *: RhodiumToad also hasn't touched any mips systems for, oh, 25 years? more? dsmith: RhodiumToad: Ahh. Sorry about that. Thought we were talking about netbsd before. Maybe it was freebsd instead. *: RhodiumToad only does freebsd *: dsmith makes a mental note lampilelo: how would you debug a segfault on scm_flush_all_ports()? one port has NULL write_buf but how can this happen? wingo: i would imagine that is memory corruption, tho who knows wingo: use rr, set a hardware watchpoint on the addr of write_buf, and reverse-cont lampilelo: i'll do that, i have a feeling this is a pipe created by open-pipe from a thread lampilelo: something definitely amiss with that because sometimes it errors out inside close-pipe on waitpid, saying there's no child process (just throwing, not segfaulting in that case) wingo: hummmm wingo: lampilelo: i wonder if you might be hitting bug 10836... wingo: bc there is a guardian for pipes and also there is the global weak port table lampilelo: hmmm ilmu: 7gggguymn/" taylan: cat on keyboard? :D lampilelo: the cheat code for money was klapaucius, not 7gggguymn/" lampilelo: wingo: does rr need some special settings for guile? lampilelo: nevermind taylan: lampilelo: what is rr? lampilelo: taylan: https://rr-project.org/ taylan: neat! lampilelo: dumb name btw, try to search for it lampilelo: i wanted to check if it's in my distro's repository and it yielded 231 results taylan: heh, I guess it might be good to give it a canonical name like "rr-debug" or "rr-dbg" or something in package databases and the like. liltechdude: Hello! It's possible to use non-english characters in guile-chickadee? (draw-text "Шла саша по шоссе и сосала сушку.\n\nА я нет." #v(140.0 240.0)) This is rendered to ? mark instead of normie characters. May be I something liltechdude: missing in info manual? lampilelo: does the font you're using support cyrillic? or maybe it's a locale problem, in that case check if setlocale(LC_ALL, "") fixes it lampilelo: note that i'm guessing here, i'm not that familiar with chickadee meo: hey chickadee is cool stis: Howdy guilers! taylan: heya :) lampilelo: hello *: wingo poking at webassembly compilation... opfez: on the guile homepage it says guile has compiler frontends for elisp, is this what is used in GuileEmacs? opfez: (or can i use it to write extensions/config in normal emacs?) lloda: I've pushed https://lists.gnu.org/archive/html/guile-devel/2021-05/msg00013.html wingo: great lloda: how is it with master/main wingo? are we dropping the old one? wingo: humm, i am thinking we should reset master back to v3.0.7, and continue with main wingo: wdyt? wingo: eventually we can remove master but i don't want to cause ppl problems lloda: i think i prefer a quick break rather than having to keep both branches updated but just mo wingo: yeah i mean let's not update master any more lloda: alright wingo: like reset it back to v3.0.7 and then don't move it forward any more wingo: we could remove it of course, or replace the tree with checkout-main-plz.txt or something mwette: taylan: For undeclared data size issues I'm thinking of using bytevector-unwrap* to force the user to define a descriptor on a case-by-case basis based on provided offset. WDYT? justin_smith: rlb: yeah I worded that imprecisely, of course nil is treated as false, but the only "false" that is actually false is Boolean/FALSE and a freshly constructed one like (Boolean. "false") is treated as true justin_smith: ser=> (let [f (Boolean. "false")] (prn "equal to false?" (= false f) "false?" (false? f) "falsey?" (if f "not-falsey" "falsey"))) justin_smith: "equal to false?" true "false?" false "falsey?" "not-falsey" dsmith-work: Tuesday Greetings, Guilers leoprikler: opfez: guile-emacs uses a known-good commit of guile, that has nothing to do with Guile 2.2 or Guile 3.0 leoprikler: that said Guile Elisp is somewhat usable, albeit a bit lacking in certain aspects opfez: ah, so there's no way to use like `guile --language=elisp ` for vanilla emacs? leoprikler: Depends on your Vanilla Emacs more or less. leoprikler: You obviously won't be able to use any of the buffer stuff, but even disregarding that, the runtime is somewhat limited. leoprikler: e.g. no setf, keywords are buggy, ..., there certainly is room for improvement opfez: i see. thanks for the explanation :) leoprikler: also (make-symbol ) does not work for macros, you have to use gensym. rlb: justin_smith: ahh, right - https://clojure.org/reference/special_forms#if tohoyn: sneek: botsnack sneek: :) apteryx: interesting, raising an error in a forked process bubbles up to the parent process -- I didn't expect so, but it is a nice property. RhodiumToad: uh RhodiumToad: are you sure? apteryx: mmh. Not so much anymore, but I'll comment if I can straighten my understanding up :-) apteryx: I don't think that should be possible, so most probably I got confused by the output of the program taylan: hmm it would sure be great if someone reviewed all my patches :P apteryx: funny exception message on (getgr "does-not-exist") -> In procedure raise-exception: In procedure getgr: Success taylan: apteryx: that seems to be a common theme. I wonder what causes it. a similar error message can be seen while booting Guix, and this bug report mentions one too: https://bugs.gnu.org/25412 taylan: apteryx: actually, I'd love to debug this. what's "getgr"? apteryx: it's part of guile proper taylan: oh, nice apteryx: :-) taylan: in this case it seems to be because Guile calls strerror on 0 due to a small bug: when getgrgid or getgrnam return NULL, Guile assumes errno will be set, even though NULL can also mean "entry not found" without an error having happened taylan: yay, another thing to patch :D apteryx: thanks for looking into it! apteryx: is there an easy way to connect a forked process stdout/stderr to the stdout/stderr of the parent process? RhodiumToad: that's the default? apteryx: eh, really? That's great. Then my child is exiting way earlier than I expected; and I can confirm that exceptions do *not* bubble up to the parent process. manumanumanu: apteryx: exceptions no. but stderr yes RhodiumToad: at the OS level, fork doesn't change any file descriptor, so all open files are still open, stdin/out/err point to the same place as before, etc. apteryx: then perhaps something weird in Shepherd, because in my forked process I don't see pk messages even if they're the first instruction run RhodiumToad: however, note that fork can be quite disruptive RhodiumToad: there are issues of buffering, threads, locking, etc. that can all cause havoc RhodiumToad: how are you forking it? apteryx: (primitive-fork) RhodiumToad: so that's the OS level fork, with all the chaos that implies RhodiumToad: are you then doing an exec of some kind? apteryx: RhodiumToad: the start slot is set to this Guix G-Expression: https://paste.debian.net/1198020/ RhodiumToad: so what's happening in between the primitive-fork and that? apteryx: I'm not sure I understand the question; the execution goes like: Shepherd starts, calling the corresponding procedure; does some cleanup, forks a first process, then forks again via primitive-fork and enters the child process to run the remaining instructions (that communications with the earlier process via dbus to finalize the setup) apteryx: that communicates* apteryx: currently I'm totally blind as to what happens in the child process created via the primitive-fork call (it strangely doesn't output anything). RhodiumToad: does the primitive-fork itself cause a warning message to be output? apteryx: this is the output I see from the corresponding test, which exercises the start/stop/restart actions of the service and checks for expected files: https://paste.debian.net/1198022/ RhodiumToad: iirc, pk outputs to stdout not stderr, is it possible/likely that stdout has been redirected? apteryx: we should at least see the backtrace caused by '(error 'exit-fork-with-error)' then? RhodiumToad: maybe try (format (current-error-port) "some string") apteryx: ok RhodiumToad: make sure to include a newline in the string apteryx: RhodiumToad: OK, I can see stderr :-) RhodiumToad: so possibly stdout has been redirected elsewhere, not too unusual apteryx: ok soda__hobart: alright, so i'm flailing wildly trying to figure out how calling scm_init_guile changes some environment variables that have to do with C strings. I think it has something to do with whether the strings are null-terminated or not? soda__hobart: this is basically what I'm trying to do: https://paste.gnome.org/p6bs9uy7o soda__hobart: the input data for the program is produced by this procedure and sent over the local network: https://paste.gnome.org/pwutehy48 RhodiumToad: so nothing in the environment can affect whether strings are null-terminated or the result of strcmp() soda__hobart: ok that's good to know RhodiumToad: how do you know that msg->child->data is null-terminated? your code is incorrect if it is not RhodiumToad: i.e. how did you create that value? soda__hobart: like this: `(string->bytevector (string-append msg "\0")` soda__hobart: or, actually: `(string->bytevector (string-append msg "\0") "ascii")` soda__hobart: and i've tried "utf8" instead of ascii too soda__hobart: the string-append thing doesn't seem to do anything, though. it works as expected, like with strcmp and everything, if I literally type in (my-send-msg-func "quit\0") though RhodiumToad: no, I mean in the code that calls strcmp in your first paste soda__hobart: otherwise, the value I get after casting the void pointer to char* will be somehting like "quit3y" RhodiumToad: what stores the value in msg->child->data and how? soda__hobart: it's a void pointer soda__hobart: I would assume that it is not null-terminated unless I went in and added a null byte to the end, right? soda__hobart: the `msg` struct is initialized on the heap using malloc lampilelo: so how did the bytevector find it's way into this struct? RhodiumToad: soda__hobart: allocating msg doesn't allocate space for either msg->child or msg->child->data RhodiumToad: soda__hobart: so show us the code that stores those values soda__hobart: like this: https://paste.gnome.org/p78nqjawd soda__hobart: what's weird is that it works if I don't call scm_init_guile in my main loop RhodiumToad: it works by pure chance soda__hobart: I was wondering if that was the case RhodiumToad: if you ran it under valgrind or with memory sanitation you would likely see the error RhodiumToad: you're allocating and copying only "size" bytes of data, not adding any terminating null yourself RhodiumToad: if meta.size isn't expected to count the null terminator, as appears to be the case, this means that the subsequent use of strcmp on that pointer is forbidden RhodiumToad: you should probably be allocating meta.size+1 and adding a proper terminating 0 yourself soda__hobart: ah, ok. so the C code should be responsible for adding that terminator? RhodiumToad: that all depends on where this data is coming from and what the specification for that source is RhodiumToad: but in general yes soda__hobart: yeah, the data is coming from a client process, so I feel that it would make sense to to require the client to do all that validation, especially when there could be different flavors of clients. soda__hobart: i mean not require the client to do it lampilelo: malloc in c++, the dread... RhodiumToad: well, yes, leaving aside questions of c++ style soda__hobart: haha I make Bjarne cry lampilelo: it's like you just pasted c code into a c++ file dsmith-work: soda__hobart: Yeah, if your app data is using counted strings, you gotta NUL terminate them if you are going to call any stdlib string functions. soda__hobart: cool, yeah it is working now, thanks to everybody for the help! taylan: seconded :) taylan: good night guilers mwette: night -- installed bytestructures-1.0.10 today wingo: moo abralek: Hi all, Can I somehow generate Unix password hash for /etc/passwd with guile? abralek: I see crypt, but I also have to generate sha512-crypt lampilelo: abralek: (crypt "passphrase" "$6$salt") lampilelo: more info in the libc documentation: info "(libc) Passphrase Storage" lampilelo: more useful than the man page abralek: lampilelo: wow I see, It parses the prefix. Many thanks! apteryx: How can I check if a possibly unbound variable is bound? daviid: apteryx: see module-bound? daviid: module-variable apteryx: ah right. I got confused thing variable-bound? would be a shorthand for (module-variable (current-module) 'var-symbol) apteryx: apparently it's not apteryx: thinking* daviid: module-bound? is available, but undocumented] apteryx: OK! thanks daviid: apteryx: see the def of module-bound? in (ice-9 boot-9) apteryx: works well! I used (module-bound? (current-module) 'my-proc-symbol) chrislck: (defined? 'variable) lampilelo: is it possible that scm_gc() segfaults when a pthread mutex is locked when in guile mode? seems that switching to scm_pthread_mutex_lock() stopped the crashes but i can't really prove it apteryx: chrislck: even better, thanks! dsmith-work: Monday Greetings, Guilers lampilelo: is there a way of debugging memory (in)correctness when dealing with guile? valgrind is pretty useless with this wall of text due to gc, are there any suppression files floating around? terpri: rlb, lokke looks really neat! iiuc in clojure, nil is false but not an empty sequence? rlb: Right, iirc, it actually *is* JVM "null", i.e. java null. rlb: basically "the null pointer" (ish). rlb: And also iirc (cf. that link wrt "null punning") clojure used to support empty sequences acting as nil/false, but changed that early on for reasons in that doc. rlb: "making clojure lazier" rlb: In clj false is false, and nil is faise. And for sequences/collections now, you call (seq something) i.e. (when (seq something) ...) is idiomatic. taylan: who controls the contents of http://www.gnu.org/software/guile/manual/ ? taylan: there's an unresolved, trivial, 8 year-old bug about it :D terpri: rlb, and (seq nil) is false? terpri: er, true, i meant rlb: nil is false, and (seq []) becomes nil. rlb: [] is the empty vector. terpri: ah rlb: https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/seq terpri: "(seq nil) returns nil" is potentially quite helpful (because it sounds like Lispy behavior) terpri: taylan & rlb, it's also useful to remember that we completely control the interface between scheme and lisp/clojure, and that we can define any useful semantics for #nil that don't break scheme programs justin_smith: terpri: clojure's "conj" (a close relation to a lisp cons) treats nil as an empty vector, its "cons" (list specific) treats nil as an empty list terpri: justin_smith, ah, good to know justin_smith: clojure's "into" (kind of like (partial reduce cons)) treats nil as an empty list justin_smith: rlb: a gotcha about clojure's false is that unlike java, only Boolean/FALSE is false in conditionals, and any other false which is not identical to that value is effectively true - this allows faster bytecode at the price of weird code misbehaving terpri: so far it sounds like clojure nil is treated very much like lisp nil, enough that guile shouldn't need separate #clojure-nil and #lisp-nil (which would turn the boolean cube into a...boolean dodecahedron? :P) justin_smith: identical as in the "idenitcal?" function - meaning "a pointer to the same object in memeory" justin_smith: haha justin_smith: boolean tessaract! terpri: lol terpri: lambda: the ultimate platonic solid justin_smith: if my memory was better I'd have a paula beans file-not-found quip ready rlb: justin_smith: depending on what you mean, I believe nil is also false. rlb: (when-not nil (prn :yep)) rlb: :yep rlb: *: rlb wishes clojure had picked unless :) leoprikler: (defalias unless when-not) :D taylan: hi guilers manumanumanu: hi taylan. you are doing a heroes work in bugs-guile manumanumanu: hero's manumanumanu: after one week trying to re-learn german, english exits my brain taylan: I'm mostly picking low-hanging fruits :) manumanumanu: well, for one thing those fruit start looking bad if they are hanging for too long. I am slowly digging my way through guiles internals to hope I can do it myself some day mwette: taylan: working ffi-heper stuff today ... *: mwette afk for a bit soda__hobart: does anybody know why after calling scm_init_guile in a C++ program, the expected behavior of char* strings (received from a network socket and sent by a guile program) changes? i think it has something to do with whether they are null-terminated. does some environment variable get changed by calling scm_init_guile? i'm getting a few characters of cruft on the end of the strings. soda__hobart: i bet it's a geiser/emacs thing, probably different environment vars than what you get from scm_init_guile lampilelo: "expected behavior changes" from what to what? soda__hobart: ok, for example: i comment stuff out so i DON'T call scm_init_guile in my program. while the program (it's a server) is running, i use the guile REPL to send a data serialized to bytes (using rnrs bytevectors, etc.) through a local socket to the server. the server de-serializes the bytes and initializes a struct, and then dispatches some functions based on string lookups ("quit" makes it exit, etc.) --this all works as expected soda__hobart: but if i do call scm_init_guile, then all the strings i send have to be written like "quit\0" or else there is cruft on the end mwette: locale issue? I'd try env LANG=C . wingo: good evening wingo: soda__hobart: either as mwette says, or GUILE_INSTALL_LOCALE=0 in environment wingo: see Environment Variables in the manual soda__hobart: oh ok, cool, i was just looking at it, but this clears it up for me i thnk soda__hobart: hm, no luck. well, i'll just have to study the documentation more but i'm going to play outside now :) o/ mwette: wingo: If you are interested, taylan and I are dealing with generating FFI code in situations where C declarations do not provide enough size information to indicate how large a containing bytevector should be. Examples are where C pointers provide an address of an unknown vector size, or pointer to struct where latast element is something like "foo_t x[];" This is somewhat analygous to using "char *" for strings. mwette: One option to handle this is to have unsafe-bytevector where set and ref are not checked for size. Another option is to force the user to somehow deal with the size, but that would take some work in the type handling and could be inefficient. Thoughts? ArneBab: wingo: thank you for working on the core of Guile! It’s awesome where you already took it! — no special reason for saying it now, except that now is always a good time to say thank you. taylan: roptat: hmm, the online manual seems mangled somehow, here's a relevant page that's not accessible from the other for some reason: https://www.gnu.org/software/guile/manual/html_node/Dynamic-FFI.html taylan: roptat: but yeah, creating an extension is also an option roptat: I think that's my question: how do I create an extension? I've seen examples of function that manipulate numbers, but what about a C structure and pointers? daviid: roptat: look for make-c-struct and parse-c-struct in the manual daviid: roptat: guix has some magic to acheive this at compile time taylan: roptat: if you aren't familiar with bytevectors yet, look into that a bit. then see pointer->bytevector: https://www.gnu.org/software/guile/manual/html_node/Void-Pointers-and-Byte-Access.html taylan: and finally, either make-c-struct / parse-c-struct, or the more sophisticated alternative bytestructures: https://github.com/TaylanUB/scheme-bytestructures roptat: thanks taylan: here's a basic example: https://www.gnu.org/software/guile/manual/html_node/More-Foreign-Functions.html taylan: roptat: here's an example using bytestructures: https://paste.ubuntu.com/p/HymfvYgKwk/ taylan: (didn't test but I think it should be correct) taylan: I'm the author of bytestructures so if you decide to use it I'm happy to offer assistance. for now AFK though (zzzz) mwette: Do you want access to struct elements from scheme or just want to pass pointers daviid: rlb: looking at your lokke re-export-and-replace!, and have a few quiz :) daviid: rlb: in (lokke boot), you call (re-export-and-replace! '(clj-quote . quote)), but i am confused, should it not be (re-export-and-replace! '((clj-quote . quote))) or (re-export-and-replace! '(clj-quote quote)) if these are two seperate names .. . jusdt curious how that lands in the module-re-export! call daviid: also, any particular reason why you didn't make it a syntax? daviid: i mean the re-export-and-replace! definition itself daviid: rlb: in the re-export-and-replace! code, as you do not have a guile-2 entry, why not 'just' (cond-expand (guile-2.2 (module-re-export! (current-module) names)) (else (module-re-export! (current-module) names #:replace? #t))) ? maybe i a missing something ... daviid: rlb: got the answer to the first quiz, (define (re-export-and-replace! . names) ... - i didn't see the . names chrislck: running statprof #:display-style 'anomalies has caused error chrislck: "In procedure =: Wrong type argument in position 1: #f" chrislck: guile-3.0.4 rlb: daviid: wrt re-export-and-replace!, I wanted at least a function, so I started there (similar to module-use!, etc.), but of course could create a syntax (wrapper) too later. Ideally, I'd eventually like to just have support for that in define-module. rlb: And regarding the versioning - at the time I just added the supported versions, but I suppose I could change it to assume any newer versions might work with the 3.0 approach. Didn't think about it too hard at the time, was mostly busy being surprised at the way cond-expand works :) rlb: taylan flatwhatson: sounds like y'all may have figured it out, but yeah, integers up to a certain size are "free", i.e. the fixnum is "in" the SCM value (the pointer address value). There's no allocation. If you haven't seen it, this bit (and the parent chapter) may be interesting: https://www.gnu.org/software/guile/manual/html_node/Faster-Integers.html rlb: (and as I think mentioned, then perhaps libguile/scm.h) rlb: terpri: fwiw, the current #nil handling was *very* helpful with respect to creating lokke https://git.sr.ht/~rlb/lokke/ So if we make changes, it'd (selfishly) be nice if we could preserve the relevant bits. Right now at least, the clj and scheme side are *very* close, i.e. easy to write any given module in scm or clj, and many things have direct mappings. I also wonder if the way clj dynamic vars are handled might have some rlb: similarities to what you were suggesting (cf. magic fluid). rlb: terpri: and I'd imagined that an emacs that supported elisp, scheme, and clojure more or less directly might also be fairly interesting to the clojure world (since emacs is still one of the primary tools there - interactive code excution, etc.). taylan: rlb: I wrote a few patches recently that affect the behavior of #nil. One is to make it equal? to (), another to make lists ending in #nil be written as (foo bar . #nil) instead of (foo bar). taylan: rlb: would either of those be undesirable for your purposes? taylan: also... nice project! :D let's implement ALL lisps in Guile :P rlb: Hmm, I'd have to think about that, and perhaps test the patches, but might not matter? i.e. lokke likely doesn't care about the scm written representation in any critical way, but the latter might be a problem. Not sure, and also not sure if it is a problem, if it'd be expensive to accommodate. I'll have to think about it. rlb: $ clojure rlb: Clojure 1.10.2 rlb: (= () nil) rlb: false rlb: user=> rlb: rlb: And at least right now, I've just let scheme lists pun as clojure sequences, so scheme '() currently works just fine anywhere clj's "persistent empty list" should work. rlb: (well, proper lists -- lokke will *not* like improper lists in many places) rlb: It might also be that I can just rework clj equality to handle that. I'm just a bit concerned that there might be a bunch of places where there are implicit assumptions that might be hard to track down or expensive (at runtime) to adapt. rlb: taylan: in any case, if it ends up looking like something we're likely to pursue, could you ping me and if/when I can get some time, I'll try to figure it out in more detail (and/or test the change). taylan: sure thing, if I remember :) leoprikler: iirc the rationale is to use if for #f or nil and null? for '() or nil rlb: fwiw, from the clj side, empty "collections" are intentionally not false. rlb: (empty, possibly lazy, collections) rlb: You have to call (seq x) on them to find out if they're actually empty. rlb: For anyone interested: https://clojure.org/reference/lazy#_the_victim_nil_punning taylan: rlb: does that mean clj's "if" is not the primitive "if" since it has to interpret #nil as true? rlb: #nil isn't true, it's false in clojure rlb: i.e. clj works somewhat like elisp taylan: oh, I assumed that "empty collections" includes #nil taylan: since it's the empty list... rlb: which is why our current elisp support made things easier - clj has nil and () rlb: taylan: clojure has a broader "collections" abstraction, i.e. cons works on anything that's a collection, including lists, vectors, sets, etc. rlb: so as far as clj is concerned, in some senses (), [], and #{} are the same (empty list, empty vector, empty set). rlb: (And map, for, filter, remove, drop-while, reduce, ... work on any collection too -- anything that's "seqable".) rlb: taylan: I suppose another question might be what "level" of release a change like that might require, i.e. X, Y, or Z... rekado: terpri: I would love to help in whatever way I can to revive guile-emacs! I have been blindly rebasing and poking things, but I never got it to work with slightly more recent versions of Emacs and/or Guile, because I don’t know what I’m doing. mbakke: rekado: matplotlib installs jquery to a nonsensical directory, i.e. it has been broken a while. should it be updated or removed? rekado: matplotlib is pretty essential for this whole science Python thing. dsmith-work: Happy Friday, Guilers!! taylan: wingo: quick question: how is (equal? x y) compiled? doesn't seem to call scm_i_equal_p from eq.c unless I eval it. taylan: or at least does some quick-fail stuff before calling it. taylan: I seem to have found it: module/language/tree-il/compile-cps.scm, starting from line 2477 there's some quick-success and quick-fail cases being added to eqv? and equal? calls manumanumanu: taylan: If any of the variables are comparable using eq? or eqv?, the comparison is cahnged to that. At least if it can be decided during compile time I don't know if that helps you RhodiumToad: it looks like that at compile time it also peels out one layer of "eq?" comparison RhodiumToad: i.e. if the values are eq? then they must also be eqv? and equal?, if they're not eq? then they're eqv? if they are equal numbers, RhodiumToad: if they're not eq? and one or other is not a heap object then they can't be equal? taylan: yeah, (equal? x y) is compiled to (if (eq? x y) #t (if (or (immediate? x) (immediate? y)) #f (c-equal? x y))) RhodiumToad: are you looking at 2.2 or 3.0? taylan: 3.0 taylan: (it's compiled to something equivalent to that in logic, I mean) taylan: (the immediate? and c-equal? above are pseudo-code) RhodiumToad: yeah RhodiumToad: I should have said that "if they're not eq? then they're eqv? IFF they are equal numbers" taylan: ugh, apparently there's a further place where (equal? #nil '()) gets optimized to #f, because now I get #t when I (define (test x y) (equal? x y)) then call (test #nil '()), but if I compile (equal #nil '()) directly it's #f taylan: of course, it constant-folds it. now on to find where that happens... :P taylan: oh nice, that was easy, since I had already looked around module/language/tree-il/peval.scm before. RhodiumToad: you defined an equal? that treats #nil and '() as equal? taylan: RhodiumToad: I changed equal? to treat them as equal. Just submitted the patch: https://bugs.gnu.org/48425 taylan: I think it makes sense but maybe I'm missing something. I'll let the higher ups decide :P RhodiumToad: I think having them be equal? but not eq? will be a problem. RhodiumToad: you want #nil equal to '() but not equal to #f ? terpri: RhodiumToad, it might be equal to both terpri: it ought to be equal to both, i should think RhodiumToad: it can't be terpri: see (info "(guile) Nil") RhodiumToad: the problem is that equal? must be transitive, and '() is not equal to #f terpri: (boolean? #nil) ⇒ #t, (not #nil) ⇒ #t, (null? #nil) ⇒ #t RhodiumToad: so #nil can't be equal? to both terpri: RhodiumToad, you're quite right, thanks for dredging up memories of logic class :p yeah, that would make equal? not an equivalence relation which is required by r5rs taylan: yeah, I made it equal to '() but not #f based on the assumption that we want to keep the transitiveness of equal? terpri: i think i got confused by the different behavior in elisp, where #nil, '() and #f are all equal RhodiumToad: it's exactly that different behavior that leads to having #nil in the first place roptat: I have a C source file with a function that takes a pointer to a structure as argument in my project, and I'd like to call it from guile. How can I create the structure pointer in guile (ideally at compile time), and how can I call that function? roptat: I'm not sure where to look at in the manual taylan: roptat: this would be the part of the manual to look at: https://www.gnu.org/software/guile/manual/html_node/Foreign-Function-Interface.html taylan: roptat: and if you want to access/modify complex C structures from Scheme, this library might be helpful: https://github.com/TaylanUB/scheme-bytestructures roptat: mh, I've used foreing interface before, to use code from other libraries, but this time I it's a C source file from my own repo, so I think I want an extension instead? roptat: but all the examples I see are about using int and double dsmith-work: heh: http://www.galassi.org/mark/mydocs/guile-user_6.html dsmith-work: Wow. Was 25 years ago! dsmith-work: twen. ty. five. years. taylan: pretty sure I still used to drink human milk back then civodul: fun tohoyn: sneek: botsnack sneek: :) flatwhatson: revised pointer-ref/set draft: https://paste.gnome.org/p6rn4detz flatwhatson: i'm not sure i understood the suggestion about taking address as a fixnum, should it support passing a numeric value as the pointer arg? taylan: flatwhatson: 404 on the link taylan: but yes, passing a numeric value instead of a pointer object would be preferable, since pointer objects are allocated on the heap. flatwhatson: taylan: weird, it vanished! flatwhatson: revised pointer-ref/set draft: https://paste.debian.net/1197437/ taylan: flatwhatson: looks pretty good to me except that I'd also allow the pointer arg to be a number. though if pointers were made into "immediate" objects like civodul suggested, that would become unnecessary... taylan: and wingo said he's not a fan because the compiler could do it. if the compiler really could avoid bytevector/pointer allocations a lot of the time then I guess it would be mostly unnecessary, though IMO it's good to also have an API to accesses memory without the bytevector abstraction in between. taylan: because if I know I want a uint64 at memory location 0xDEADBEEF then it seems excessive (conceptually) to create a bytevector of size 4 referring to that memory location just to get that uint64. taylan: if you have structs, unions, etc., bytestructures takes care of that whole layer of logic. no need for bytevectors there either. *: taylan goes AFK wingo: https://wingolog.org/archives/2021/05/13/cross-module-inlining-in-guile davexunit: very cool. thanks for the write-up, wingo. flatwhatson: how can pointers be made immediate if SCM are uintptr_t, we need some bits for the tag too? wingo: flatwhatson: either unboxing, if the whole lifetime of the pointer is visible to the compiler wingo: or tagging, if the pointer has suitable alignment (e.g. if it's 8-byte aligned, then the bottom 3 bits are 0) wingo: or tagging, if address space size is less than the word size -- is the case for all 64-bit systems currently wingo: fwiw we also need to consider improvements to the gc. maybe if we have a bump-pointer generational gc, then the cost of allocating a could words might be insignificant wingo: *couple words flatwhatson: interesting thanks! flatwhatson: re: generational gc, would that mean replacing bdw-gc with something else, or writing one bespoke? wingo: yeah replacing bdw-gc with something internal to guile taylan: wingo: not to rush but did you have a chance to look at the R6/R7 SRFI module names patch? it's a pretty straightforward improvement IMO and will significantly improve R7RS compatibility. *: wingo has not done so yet taylan: ok, happy to hear feedback whenever you have time :) mwette: "GC, GC, read all about it!": https://www.cs.rice.edu/~javaplt/411/17-spring/Readings/wilson92uniprocessor.pdf mwette: Some other issues with the FFI are lack support for variadic args and unions. And maybe the pointer->procedure spec's for arg types. I'm working on how to handle structs and unions better, but varargs is a kludge: every call to the function generates a pointer->procedure call. davexunit: a first-class API for creating/parsing C structs would be a huge quality of life improvement davexunit: I know guile-bytestructures exists, but it's hard to justify the additional dependency when I can hack together something specialized that works for my specific case when I need to. taylan: mwette: isn't bytestructures sufficient to handle unions? taylan: davexunit: hmm, I've been thinking a bit whether it would be welcome to include bytestructures in Guile proper. any opinion on that? it's pretty small after all. davexunit: taylan: other languages have FFIs that include this functionality, so yes I think it should be in Guile core. davexunit: anyone that has tried to wrap a C function that doesn't use only primitive types has been burned by the lack of good struct support davexunit: parse-c-struct and co. do not cut it. dsmith-work: {appropriate time} Greetings, Guilers taylan: hi :) davexunit: I've wrapped many libraries at this point and each time I wish guile had something built-in for handling structs. mwette: taylan: pointer->procedure and the underlying libffi API doesn't do unions. So I'm approaching with (struct-covering ) -> struct; and if a vector is inside a struct/union then I need to do (list int int int ...) (equiv (make-list N int)) taylan: mwette: oh, you mean like when a function directly takes a union by-value instead of a pointer to it, right? davexunit: any function that uses structs by value are a pain to wrap in guile davexunit: my freetype bindings are gross as a result taylan: davexunit: have you looked into the bytestructures API to see whether it would solve your problems nicely, by the way? I don't even really use the library myself (!) so I need external feedback to make sure it's actually practical and useful, and not just nice in theory :P taylan: it all just started as an academic exercise; I don't even remember what sparked the idea to make something like it. didn't even realize it would be useful for FFI until someone made me aware! mwette: taylan: yes; structs by-value are handled but not unions by-value; so my approach will be to figure out the size+alignment and make a list that size; but i have to understand how the compiler will deal with floats mwette: pointer->procedure does not accept bytestructure (descriptors), so nyacc's ffi-helper has code to convert bytestructures to (list ...) taylan: wait, I could swear I've written a transformer for that taylan: or... I saw yours and wanted to adopt it but didn't because unions couldn't be handled? been years that I seriously on this project. :\ taylan: *seriously worked taylan: ah, here it is: https://github.com/TaylanUB/scheme-bytestructures/blob/master/bytestructures/guile/ffi.scm taylan: mwette: ^ you're aware of that module? mwette: yes: I remember looking at it, but not the details davexunit: taylan: I haven't used it. I should try it out. mwette: here is .ffi file and (partial) auto-generated .scm for pango: https://paste.debian.net/1197454/ https://paste.debian.net/1197455/ mwette: the ffi-helper will parse structs from C headers and generate scheme code for bytestructure API and for the pointer->procedure API taylan: hmm, not sure how to feel about (equal? '(1 . ()) '(1 . #nil)) => #false. I guess it has to be. taylan: on the flip side, (syntax-rules () ((_ #nil) ...)) will match () and I'm not sure how to feel about that either terpri: after hearing that #nil was being used by the API of some json library, my first thought was that we should make that value much more difficult to access from ordinary programs terpri: almost the *entire* utility of it depends on both scheme and lisp programs' ignorance of its existence terpri: like, possibly it shouldn't even be accessible or (read)able outside of module/language/elisp and a few other places terpri: it's possible to misuse it, simply difficult under ordinary circumstances, but something "more correct" would likely require heavy-duty capability-security tricks that divide guile into multiple "worlds" terpri: and finding a clever but technically slightly-incorrect solution that works in nearly all real-world use cases is very much in the lisp tradition, if one has read the rrrs-authors archives or maclisp news files... terpri: actually, i'm going to track down that json library author and give them a stern talking-to^W^Wfriendly explanation about why guile has #nil in the first place, which i ought've done years ago terpri: taylan, btw, are you working on elisp stuff or just tinkering? terpri: seeing native-comp progress in emacs -- in a way that was not encouraged for guile-emacs -- has motivated me to engage in some friendly, ahem, socialist emulation when i get the time to commit to it terpri: i'm a bit annoyed by the different treatment and would really quite like to make guile-emacs superior to native-comp in both performance and compatibility (guile-emacs would have far better performance if it hadn't been designed for 100% compatibility) terpri: $work is taking up too much time as usual but will be winding down soonish, enough to do other *real* work terpri: and i'm quite willing to fork emacs if that's what it takes, and go for the egcs approach (ecgs was a much-improved gcc fork that quietly replaced the original gcc in 1999) terpri: (furthermore, my odd mixture of roles at $work is actually fairly good preparation for a guile-emacs revival, as i have to do quite a lot of things i used to be not very good at) terpri: (not to mention my fairly extensive JIT-related work with wingo at igalia) terpri: it remains a big project (i only finished the *first* 90%...) but years later, i still have a good grasp on what remained to be done terpri: perhaps i'm tilting at windmills, but perhaps some windmills need tilting-at, and i'm too stubborn to simply give up and let the project die a quiet death. to quote angela davis, "you have to act as if it were possible to radically transform the world, and you have to do it all the time" taylan: terpri: I'd like to work on elisp stuff more seriously but my knowledge of lower-level stuff is not good, such as the VM, the whole compiler stack, etc. I'm confident I could get good at it but I lack time, and a mentor who in turn has time for me :) taylan: I'm in the second week of a two-week vacation so I'll probably return back to being mostly inactive again very soon, though I think I can restart allocating some time to free software on evenings and weekends, like I used to a couple years ago. terpri: taylan, you were a top-notch contributor to guile-emacs all those years ago, second to none, and i was (and am) very grateful for your help; i should have told you that years ago if i haven't already taylan: terpri: thanks for the kind words! I wish I had been able to do more actual programming though. what I did was mostly just talk, to put it bluntly. taylan: I guess one could call it "awareness raising" :) terpri: i also have to admit that i was a really mediocre maintainer, in terms of all the responsibilities of maintainership beyond cranking out a great deal of code; but it was also my first big project, and i'd like to think i've learned a bit in the intervening years taylan: terpri: wait a minute, I have to sheepishly ask now, you're bipt?.. terpri: taylan, yeah, i changed my nick a few years ago (changed first name to robin, so the initials didn't match). no need for sheepishness, i remember the guile GSoC folks were confused too since i didn't actually announce it anywhere ;) taylan: terpri: ahh ok, good to see you again then :D you did *amazing* work IMO, would love to collaborate more on the code-level if we both find the time. davexunit: oh wow welcome back terpri davexunit: more guile-emacs stuff would be rad dsmith-work: terpri: Indeed. Thanks so much. terpri: to be clear on the timeline, the startup i'm working at is promising but has a...short runway, so it could be 3-6 months before i can really attempt a revival (working full-time off of savings, working half-time at this startup or another (which would be allowed here at least), that sort of thing) dsmith-work: terpri: Something that has come up here a few times, is the difference between emacs-lisp the language, and emacs the application. dsmith-work: Emacs buffers for example. terpri: maybe with crowdfunding or an altruistic angel "investor", maybe not, lots of details and not a lot of certainty at the moment terpri: dsmith-work, yeah, there've been some discussions in emacs fora. i'll file it away as a topic for a future blog post :) terpri: guile-elisp provides exactly enough of the language to bootstrap emacs by itself. as bits and pieces of emacs are rewritten in scheme or elisp, guile should have access to more emacs "application" functionality one way or another terpri: it hasn't escaped by attention that emacs has added *some* highly-visible guile-emacs features like bignums, so i'd also have to provide new motivations for it terpri: but, eventually creating a (fast, powerful) lisp machine atop linux is a decent one; i bet you could do some cool things with guile-emacs + guix + spritely-goblins (an object-capability based library for distributed scheme programming), for instance terpri: lisp was prominently mentioned in the gnu manifesto for a reason ;) terpri: heck, just providing secure, networked, distributed programming amongst emacs instances via spritely goblins would be nifty terpri: (spritely goblins = https://spritelyproject.org/) pkill9: cool terpri: quite possibly you could use it *within* emacs to bypass the "M-x gnus is slow" problem, with preemptive multitasking/real threads, but that's just speculation manumanumanu: now, I have to admit I am not too keen on the actor model, but "transactional", "actor model", and "distributed" _does_ tickle the right places. nojr_: hello taylan: terpri: didn't Emacs add support for real threads also? TBH I find it really neat how they added a bunch of nice stuff to Elisp... as in, I'm happy that Emacs's Elisp got all these nice features in the short term, even if it means less motivation for Guile-Emacs in the long term... nojr_: how is everyone :). I've tried joining this chat for over a year now I have acquired enough technical skills to do so:)) taylan: nojr_: hi :) nojr_: that's why I'm happy. Anyway, I have a question I keep getting this error when I run guile in a terminal or in Geiser Emacs nojr_: guile: warning: failed to install locale terpri: manumanumanu, agreed, i like CLOS a lot nojr_: warning: failed to install locale: Invalid argument manumanumanu: nojr_: are you running guile through guix? nojr_: yes terpri: taylan, and i'm happy to see emacs' progress too. i *think* they only have cooperative concurrency though manumanumanu: ah, you need to install glibc-locales (or whatever it is called) terpri: welcome nojr_ manumanumanu: nojr_: ^ taylan: terpri: ahh you're right: https://www.gnu.org/software/emacs/manual/html_node/elisp/Threads.html manumanumanu: or, if you are one of the lucky few, you can install the small bundle of utf-8 locales nojr_: thanks everyone! I'm installing glibc-locales right now. I have a question: I really want to learn Guile but how do I start? terpri: also, it's Top Secret(TM) but i've been *slowly* implementing CL for Guile, so you might eventually be able to do absolutely bonkers things like running maxima *inside of emacs* nojr_: manumanumanu: wow that solved it, was very easy! manumanumanu: nojr_: I don't think there is a very good on-boarding story for scheme. TSPL is dense (and r6rs only, which is fine for guile). terpri: so i can come up with motivations, and in fact we don't even have real benchmarks for emacs-native-comp vs. guile-elisp, so "it runs faster" might still be one (or "its performance profile is better for interactive use", etc.) manumanumanu: nojr_: SICP is fine if you are willing to spend some time thinking (if you are stupid like I am). HTDP is actually very good imho, but is more tailored to racket. nojr_: manumanumanu: I think there is a way to improve that. I looked at artanis as a good project to base a small website tutorial to get started nojr_: maybe building a small CRUD app with it to get used to Guile manumanumanu: terpri: I can't imagine a better argument than being able to work on things like ORG without a full emacs session. nojr_: that's how many people learn to program today with CRUD apps, it's most familiar to lots of young devs at the moment nojr_: manumanumanu: I have tried SICP like three years ago but I am very dumb. That's why I thought maybe I could tinker with artanis, build a small app and write a blog entry?? terpri: manumanumanu, that should eventually be possible! it'd take some serious emacs refactoring, but that's on the long-term TODO list anyway (necessary for rewriting chunks of emacs in guile, almost certainly) manumanumanu: nojr_: That seems like a fine idea. I don't know about your previous experience, but I can say that python programmers usually spend a month or two writing quite slow and icky code - and that's fine! terpri: someday: (use-modules (emacs org)) :D nojr_: manumanumanu: I'll try writing down my progress. I hope that maybe I'd be useful in the future for other beginners like me nojr_: manumanumanu: I'm not much of a beginner since I know Python already but I'm not an expert either, I've only been doing this on my freetime for two years now manumanumanu: nojr_: the main thing is that the main data structure (cons cells/linked lists) don't have fast random access. Going front to back is fine, but programming with them as a python list will be an awful experience and lead to very slow code. manumanumanu: and (set! ...) is usally a code smell manumanumanu: now go write code! :D nojr_: manumanumanu: thanks!! manumanumanu: nojr_: jokes aside. If I am not AFK I can always help with feedback. terpri: but to clarify, the #1 priority is to make a better emacs than emacs, whatever that entails, and there will be plenty of time for pie-in-the-sky projects down the road terpri: and since i also got a privmsg, yes, i'm robin templeton/bpt/bipt (should probably change that hexchat "realname" default) taylan: terpri: btw any opinion on (equal? #nil '()) ? taylan: having (equal? '(1 . #nil) '(1 . ())) => #false feels very wrong to me at least terpri: brb lampilelo: i don't think emacs and real threading is possible, nothing in it is thread safe, fake, js-like threads are good enough to make non-blocking stuff terpri: taylan, yeah, that seems...odd. i'd have to check the original #nil proposal to be sure, but they're supposed to be difficult to distinguish... terpri: might have to dig up an ancient version of guile to see if the behavior changed terpri: iirc the bit-level representation of #nil was designed to make ()-or-#nil tests cheap taylan: yeah there's some special magic in scm.h and pairs.h terpri: lampilelo, difficult, but i wouldn't say impossible. imagine, for example, independent buffer groups that can only communicate with other such groups in special ways, or maybe "rejoin" other groups when a task is done terpri: but if cooperative threading is good enough for elisp programmers, that's fine too, and means less work terpri: although you could also create a pure-guile "real" thread that can only "talk" to emacs via erlang-style messages, something like that terpri: and really if emacs remains unithreaded indefinitely, and can only use threads via calling out to guile, that should be fine as long as the guile side of things doesn't mess around with the main emacs thread, and still might enable some neat demos lampilelo: terpri: what about the global, mutable environment, dynamic context, an idea of (current-buffer) etc.? you'd have to restrict the access to most things on secondary threads or do a major rewrite of the core terpri: emacs will use guile variables, guile fluids and quite possible delimited continuations for buffer-local variables, unless the latter are too slow terpri: but there's definitely C-level structures that threading would break, so it would be either pretty limited and/or a long-term goal lampilelo: oh, i was thinking about threading in emacs, not guile-emacs terpri: ah, yeah. one of them is very slightly easier :) terpri: guile-emacs would still have to be extremely cautious about threading, of course. you could do weird things like stuffing a buffer in a dynamic variable and using FFI to mutate it from another thread, which would almost certainly be a bad idea lampilelo: i'm sure package developers would find simpler ways to do bad stuff with threads terpri: well, also elisp can be blocked from guile access, it just exists for fun and demos atm lampilelo: nah, i would rewrite my init file in guile! terpri: :) lampilelo: for some reason i like guile more than elisp, if we had emacs' "standard library" exposed to guile i'd be in heaven terpri: reconciling lisp-1 and lisp-n is the tricky part there. but we could always do heuristics, or some kind of lispm-style elisp:::(+ 2 2) syntax terpri: kent m. pitman had some notes on just that topic, called lisp-omega i think, which i have yet to review terpri: guile-emacs currently is supposed to store emacs variables and functions in guile modules, which makes .emacs.scm not terribly painful. i don't know if it will stay that way or not terpri: i believe i had to turn it off for "production" because of my old nemesis, buffer-local variables. guile quite reasonably can't (or couldn't) capture bits of the C stack in a delimited continuation, which broke BLVs terpri: but they can be implemented inelegantly *shrugs* terpri: (to clarify: you can implement dynamic binding with delimited continuations, and in fact customizable dynamic binding, which is what i initially tried to do for BLVs. using some kind of magic fluid is probably more practical) dsmith-work: Hmm. recent updates anyway. Looks like mostly for chibi civodul: dsmith-work: i think the original snow was started ca. 2006 civodul: it didn't really take off flatwhatson: not sure about snow usage, but it says there's a client built into chibi so maybe some folks use that? flatwhatson: there's also https://akkuscm.org/ which is more recent and mirrors the snow packages flatwhatson: i love guix but it's pretty heavyweight as "just" a language package manager on non-guix-system machines tohoyn: sneek: botsnack sneek: :) wingo: good morning :) lampilelo: hi manumanumanu: Great morning, everyone! taylan: bit of a weird question but does Guile offer a way of accessing bytes at arbitrary memory locations without having to allocate a bytevector object for it first? think bytevector-u8-ref but taking a memory address as an argument instead of a bytevector and index. leoprikler: taylan you can do a few things with just pointers, but IIUC bytevectors should not be much of an overhead leoprikler: in particular, bytevectors are "backed" by whatever memory you have there, so it's about as much overhead as a pointer taylan: leoprikler: there's the overhead of allocating a Scheme object, which later has to be garbage collected. let me shortly explain the problem... taylan: with the bytestructures library, you can represent a pointer, including the pointed-to type, then use it to access the pointed-to values... taylan: pointers often point to the beginning of an array, whose size may not be known until some time during run-time. taylan: to allow fully dynamic access to the elements, what the library currently does is create a bytevector every time you want to access a value, only to have it thrown away again taylan: if you want to loop over 1000 elements, that's 1000 bytevectors being allocated and thrown away, which is not OK leoprikler: hmm, that does sound like an issue taylan: so I need either a way to access bytes without allocating a bytevector, or the user has to tell the library to explicitly instantiate the bytevector at some point with the appropriate size. leoprikler: taylan I personally think it's fine to ask the user to tell you the size of the bytevector taylan: added an example on how to avoid the allocations, search for "example with guile" on the page: https://github.com/TaylanUB/scheme-bytestructures leoprikler: I don't quite understand how the third version does its magic, but otherwise LGTM flatwhatson: it's re-interpreting the chars buffer as a bs:vector, which can get bytestructure-ref'd efficiently bjoli: taylan: that define-inlinable does nothing in that case, btw. Define inlinable defines the procedure and replaces any direct application with the code expansion, but any reference like (for-each ref million-times) with a pointer to an otherwise hidden definition of ref with a gensymmed name manumanumanu: so: even though it is not immediately obvious, you are still subject to the same run-time lookup if you are referring to a top-level procedure. flatwhatson: taylan: would you like a routine like (pointer-ref pointer type [offset]) where type is one of guile's "foreign types"? flatwhatson: i guess it would make sense to have a corresponding pointer-set! flatwhatson: basically peek and poke taylan: flatwhatson: (system foreign) pointers are Scheme objects so that'd also require allocation. what I need would be like (memory-ref address type), or a number of memory-type-ref procedures like bytevector-u8-ref and such leoprikler: numbers are also scheme objects, so you gain nothing taylan: leoprikler: numbers up to a given size reside on the stack in Guile. actually I'm not sure now whether pointers are really allocated, or use the same kind of optimization, lemme check... taylan: does seem like it. (pointer-ref pointer type) would be OK too then I guess. manumanumanu: taylan: great work on srfi-64, btw :) I have been linking to your implementation about 600 times. taylan: manumanumanu: thank you! great to get positive feedback :) manumanumanu: I have been bitten by the reference implementation 2 times myself flatwhatson: taylan: curious, what did you check to determine that pointers are optimized? taylan: flatwhatson: I found make-pointer in libguile/foreign.c, which uses scm_from_pointer, which creates the pointer as follows: ret = scm_cell (scm_tc7_pointer, (scm_t_bits) ptr); taylan: that scm_tc7_pointer thing is a type flag (they're all called ...tc7...) and the value of the pointer is saved directly in the cell as well. taylan: contrast for instance to what make_bytevector_from_buffer in libguile/bytevectors.c does: ret = SCM_PACK_POINTER (scm_gc_malloc (SCM_BYTEVECTOR_HEADER_BYTES, taylan: SCM_GC_BYTEVECTOR)); taylan: libguile/scm.h is also a useful place to look at to understand some of the magic. I don't have a very firm understanding of it all but from what I can tell, make-pointer doesn't allocate, whereas pointer->bytevector indirectly does flatwhatson: makes sense, thanks! taylan: flatwhatson: correction on what I said before: comes out scm_cell actually allocates a pair. the TC7 type codes identify special kinds of objects that fit into "fake" pairs somehow. taylan: it's the TC3 codes that identify objects that reside directly on the stack mwette: taylan: (pointer->bytevector (make-pointer #x12345678) 128) mwette: where #x12345678 is the address and 128 is the size; from (system foreign) mwette: but doen't help if you don't know the size taylan: yeah, that's the problem. dereferencing a bs:pointer already does exactly that, but with the size only as big as the referenced type, so e.g. size = 4 for (bs:pointer uint64) taylan: in other words, bs:pointer was originally meant really just for pointers to a single value, not as pointers to the beginning of an array. taylan: I now added the ability to dereference it with an integer like you suggested, but it has to do the (pointer->bytevector (make-pointer x) y) for every such reference *: taylan goes AFK for now flatwhatson: rough draft pointer-ref/set: https://paste.gnome.org/p1ow9dbyn *: wingo not really a fan, fwiw flatwhatson: the idea in general or this approach? wingo: a few things. in general, pointers to raw scalars aren't so common -- you have pointers to structs, etc. where it's important, we shouldn't be allocating heap pointers at all. where it's not, the bytevector api is more expressive and ties together better with the rest of the system wingo: we do need a more efficient ffi but i think the path there is through the compiler and not through run-time routines flatwhatson: is it feasible for the compiler to eliminate intermediate bytevectors? flatwhatson: the chez FFI has (foreign-ref type address offset) and (foreign-set! type address offset value) wingo: yes i think it's feasible for the compiler to eliminate those. the chez low-level ffi looks nice tho, i assume the "address" is just a fixnum wingo: or usually a fixnum anyway; anyway the compiler could lower such a foreign-ref / foreign-set very nicely wingo: quite the cowboy primitive of course civodul: i think pointer objects should be immutable civodul: and i think we should have "immediate pointers" when possible amirouche: flatwhatson: IIUC what you want is http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-1.html#node_toc_node_sec_2.4 amirouche: except instead of bytevector, you have a pointer? amirouche: Chez can not expose a bytevector from a C pointer, see also https://github.com/cisco/ChezScheme/issues/486#issuecomment-808829706 wingo: civodul: i think when you have access to make-pointer, then you might as well have the equivalent of foreign-ref / foreign-set amirouche: (pointer->bytevector pointer length) that works without copy will be very handy wingo: amirouche: the compiler could eliminate that fwiw amirouche: eliminate what part ? the copy ? wingo: it doesn't right now, but it could do so relatively easily wingo: making the bytevector wingo: iirc pointer->bytevector aliases memory without copying, right? *: wingo looks wingo: yes, there is no copy there amirouche: that is good then :) wingo: just an allocation of a bytevector dsmith-work: Wednesday Greetings, Guilers davexunit: allocation of bytevectors in pointer->bytevector can be problematic sometimes. davexunit: like in ffi-using code in hot loops that needs to keep allocation low davexunit: bytevector->pointer also davexunit: depending on the situation I usually cache these when performance is a concern taylan: wingo: FWIW how this topic first came up was: how to support the "flexible array member" special feature of C structs in the bytestructure library. taylan: since the bytevector API doesn't allow accessing beyond the declared size of a bytevector, one effectively has to create a second bytevector after getting the length information (that would typically be in the struct somewhere) via the first bytevector. taylan: wingo: do you think it would be useful to have a bytevector sub-type of sorts that doesn't have size info / doesn't do bounds-checking? civodul: wingo: actually i'm sure what foreign-ref is; i thought it was Chez's equivalent of pointer->address, but maybe not? leoprikler: pointer->address just gives a number idk how that would be usable to e.g. reference some int inside a struct pkill9: has anyone created a GUI application with guile? taylan: leoprikler: re. your bug report on elisp keywords: while using Scheme you can call (read-set! keywords 'prefix) to allow :foo to be read as #:foo. have you tried activating that in elisp mode somehow? leoprikler: taylan whatever I do in Scheme has no effect on the Elisp reader, that seems to be a specific bug within it taylan: leoprikler: I think it's normal, since every language defines its own reader. I'm not sure if elisp reuses the regular Scheme 'read' somehow so one just has to set a parameter when starting up the language, or if actual coding is needed... I think it's the latter. taylan: yeah it seems one has to fix it in module/language/elisp/lexer.scm taylan: hmm, or one could just let them parse as symbols like currently, then special-handle them later. compile-symbol in module/language/elisp/compile-tree-il.scm looks promising leoprikler: IIRC Elisp knows the difference between symbols or keywords, so keywords as self-quoting symbols won't fly taylan: leoprikler: hmm. I was planning to compile them into keywords, but I guess that's not enough, as (read ":foo") will then still return a symbol. taylan: what I find puzzling is, there was (is?) a whole Guile-Emacs that actually starts up, and how can that be if the Elisp parser doesn't even know keywords. are they not used anywhere in Emacs's standard libs? or maybe bpt's branch had a fix for this. taylan: does anyone happen to know what happened to bpt aka Robin Templeton? their work was very promising, it's sad that they didn't continue working on it. leoprikler: they use a known-good commit, that perhaps has a different parser leoprikler: I'm using Guile 3.0.2+ RhodiumToad: as far as I recall, elisp has no "keyword" type at all leoprikler: (keywordp :really?) RhodiumToad: that is, :foo is a symbol whose initial value is itself (rather than being unbound) leoprikler: (setting-constant :really) leoprikler: (setq :really nil) RhodiumToad: (symbolp :really?) leoprikler: yeah, elisp symbolp is (or (symbol? this) (keyword? this)) when translated to guile RhodiumToad: elisp's keywordp is like (and (symbolp x) (symbol-name-of-x-starts-with-:)) RhodiumToad: so elisp keywords are just a subset of symbols, not a separate type leoprikler: still, I'd argue that for Guile interop it might be more useful to have them as keywords leoprikler: (define (my-function #:keyword a b c) ...) leoprikler: ,L elisp leoprikler: (my-function :a 5) leoprikler: please don't mind the typos in the scheme part civodul: wingo: i'm preparing the 3.0.7 upgrade in Guix and it's a tiny bit slimmer: 129 MiB vs. 132 MiB for 3.0.5 wingo: nice wingo: probably was the assembler optimizations civodul: er sorry, that's for its whole closure wingo: sure civodul: guile itself is unchanged actually civodul: (libltdl and gmp were removed from the closure) wingo: ah wingo: ah! neat wingo: well, we got away with rewriting "read" in scheme and still made the thing smaller. good civodul: yes, that's nice pkill9: anyone know of any GUI applications written in guile?\ RhodiumToad: the state of play with GUI bindings for guile is not entirely satisfactory RhodiumToad: I wrote some stuff for myself using guile-gnome, it could be made to work but got crashy as soon as you tried anything fancy with events RhodiumToad: guile-gi and g-golf are the more recent attempts at providing access to gtk rekado: https://gitlab.com/kavalogic-inc/inspekt3d.git has disappeared rekado: I liked it as a libfive viewer that can be used from geiser. pkill9: guess i might just have to use python RhodiumToad: tcl/tk is still orders of magnitude easier than any other scripting language for doing simple gui stuff zzappie: rekado: :( libfive is cool. now looking back I think playing with libfive was my first exposure to guile. taylan: oh man, I'm building the wip-elisp branch and Guile used to take AGES to build :D civodul: rekado: it's 503, perhaps that's a transient issue? civodul: it's apparently on Software Heritage too zzappie: civodul: ha, what do you type into the search field? I checked swh and there wrere no results pkill9: RhodiumToad: what programming language do you use for it? python? civodul: zzappie: i run "guix lint -c archival inspekt3d", which does it fo me :-) RhodiumToad: pkill9: for what? RhodiumToad: pkill9: tcl is a language pkill9: ah pkill9: I meant for tk dsmith-work: Deep in the dim dark past, Guile actually had Tk in it. rekado: taylan: I rebased wip-elisp: https://git.elephly.net/?p=software/guile.git;a=shortlog;h=refs/heads/wip-elisp zzappie: civodul: wow! didn't know its an optioin :) taylan: rekado: OMG neat! rekado: taylan: with that I was able to build guile-emacs but it crashed ¯\_(ツ)_/¯ pkill9: dsmith-work: why was it removed? *: zzappie -> zzz dsmith-work: pkill9: No idea. Maybe because it also needed Tcl? taylan: rekado: well it wasn't all that stable to begin with... I'd love to work on it but my knowledge of low-level stuff sucks and my 40 hr/week job is so taxing... RhodiumToad: tk is basically unusable except with tcl. there are tk bindings for other languages, but as far as I know all the still-maintained ones work by embedding tcl into the other language too. RhodiumToad: (there used to be a couple that worked by ripping the tcl parts out and filling them in from the host language, but I believe they all died due to the heavy maintenance effort in keeping up with Tk changes) dsmith-work: Looks like the Tk stuff was removed before the first CVS commit. dsmith-work: RhodiumToad: !! flatwhatson: awesome! flatwhatson: are you working on the pbr renderer for chickadee? brendyyn: I just discovered that one can't nest defines inside a define-public. is there a particular reason for that? ArneBab: Are there existing implementations of the snow r7rs repository standard? https://small.r7rs.org/wiki/Snow/ ArneBab: (it does look a lot like Guix on the surface) wingo: good morning manumanumanu: Good morning! flatwhatson: ArneBab: maybe this? https://github.com/sethalves/snow2-client lloda: why is *random-state* a global var and not a parameter? leoprikler: probably because making it a parameter would be unsafe when considering multiple threads leoprikler: assuming you copied the state between threads, you'd inadvertently get the same result in both threads, which could be dangerous tohoyn: file guile-3.0-uninstalled.pc.in is not used to generate a .pc file in meta subdirectory. is there some reason for this? if not I can fix it. tohoyn: when we are in the uninstalled environment should be have guile-3.0.pc generated from guile-3.0.uninstalled.pc.in? tohoyn: s/be have/we have/ lloda: leoprikler: i don't follow, if you want different results you should restart the generator on each thread. Else you should be getting the same leoprikler: you mean constructing one truely random random-state per thread? That might work, but I wonder how costly it'd be manumanumanu: I don't think copying the random state so that individual parts of the program have the same state is a good default for randomness. manumanumanu: However, doing it yourself would be pretty simple with the current API manumanumanu: Just (copy-random-state), roll your own parameter-based solution and generate the same random numbers in different threads all day :) leoprikler: right, state as function argument allows for such things dustyweb: hi dustyweb: wingo: I'm attempting to un-bitrot ijp's compile-to-js branch dustyweb: the main thing that I'm unsure what to do about is dustyweb: system/base/compile.scm:245:17: In procedure failure: dustyweb: multiple compilers; language should supply chooser dustyweb: via pk I can see: dustyweb: ;;; (compilers ((bytecode . #) (js-il . #))) dustyweb: but it looks like tree-il/spec.scm *does* specify a #:compiler-chooser so I'm not sure what should be done? tohoyn: wingo: I fixed the guile code so that file guile-3.0-uninstalled.pc is generated. are you interested? wingo: not sure! there are a few things you need to get right to be able to use guile uninstalled and be sure not to load .go files from the installed dir tohoyn: wingo: I rebuilt Theme-D to use the uninstalled guile. It seems to work. dustyweb: wingo: ah, figured it out dustyweb: it was in the cps section that it needed the chooser dsmith-work: Hey Hi Howdy, Guilers manumanumanu: hi-ho, dsmith-work dustyweb: hm dustyweb: okay dustyweb: I merged ijp's 2017 compile-to-js branch dustyweb: I can now compile (+ 1 2) to js ;) dustyweb: however more the amb.scm example ijp wrote out in his gsoc ending email no longer works, unfortunately dustyweb: I think "the land of cps" changed a bit dustyweb: it appears things fall apart converting between cps and js-il.scm dustyweb: wingo: I think I may have reached the point where I'm going to need help dustyweb: but I posted to the mailing list about my progress, and pushed the branch as it stands *: wingo gtg, happy to give more feedback tomorrow dustyweb: wingo: look forward to talking then :) dustyweb: oh wow dustyweb: https://gitlab.com/tampe/stis-parser is cool *: wingo going to merge cross-module inlining, la la la davexunit: :) davexunit: excite civodul: woo! taylan: very cool taylan: BTW I faintly remember a discussion long ago about supporting the .sld file extension. is there anything new about that? I think there were concerns about performance or something (lots of additional file-name lookups) lampilelo: taylan: i was just reading your mails to guile-devel regarding srfi-64 lampilelo: i see this implementation has the same bug as the reference implementation had until some time ago, if a global runner wasn't installed it installs what should be a temporary one, but doesn't uninstall it after the test is complete lampilelo: this was fixed by a patch in the reference implementation some time ago, but that one broke it the other way, it instead uninstalled a runner unconditionally after the test, even if there was a global one already lampilelo: and that one was fixed very recently lampilelo: taylan: at least i'm assuming you are the person who proposed new implementation, judging from the nick rekado: taylan: “.sls” is already supported. I don’t know of any discussion about .sld. taylan: lampilelo: yes, it's me. can you elaborate on how exactly that constitutes a bug? i.e. what would be the motivation of explicitly unsetting the test runner again after test-end? lampilelo: taylan: from the srfi-64 spec: "Additionally, if the matching test-begin installed a new test-runner, then the test-end will de-install it, after reporting the accumulated test results in an implementation-defined manner." lampilelo: although i have to say this implementation doesn't have the other bug i was thinking about fixing upstream lampilelo: the one that makes the test suite error out on test-group if you don't have a runner installed taylan: lampilelo: interesting catch, I guess I can implement uninstalling the default runner to be fully conformant to the spec. lampilelo: taylan: said that, i don't have any say on what gets to be included in guile, just pointing some stuff out, your code runs my tests as expected taylan: lampilelo: the implementation is also part of my Scheme SRFIs project so I'll implement the fix either way :) taylan: will have to send yet another updated version of the patches, LOL lampilelo: :D taylan: lampilelo: do you think it would be correct if test-begin stored a flag "auto-installed" in the test runner when it auto-installs it, and test-begin checks for that flag, and sets the current runner explicitly to #f if that flag is set? taylan: I'm trying to think if there's any situation in which it would be wrong to set it to #f, like if instead I have to keep a stack of test runners or something... taylan: but since the auto-install behavior only happens when it was #f during test-begin, I think it should be fine to set it to #f after, given that said flag was set to indicate that it was, indeed, #f before. lampilelo: this might break if you had nested tests lampilelo: i mean maybe not break, but it would install and uninstall a runner on every test in a test group, which would be a waste lampilelo: taylan: my fix for the srfi-64 upstream was to install a finalizer with test-runner-on-final! when creating such temporary runner, i don't know if it's the best solution but it works with their implementation taylan: lampilelo: when a nested test starts, the runner will not be #f, so it won't install a new one... but when the group ends, it will be deinstalled and that's clearly wrong, heh. taylan: but yeah I can do it on the same condition as when on-final is called lampilelo: you're right lampilelo: in that case i think it's a cleaner design *: taylan goes to zzz dsmith-work: !uptime sneek: up 1 week, 20 hours, 16 minutes ArneBab: flatwhatson: yes, like this — thank you! dsmith-work: Does anyone use snow? dsmith-work: Heh dsmith-work: "Scheme is like a ball of snow. You can add any amount of snow to it and it still looks like a ball of snow. Moreover, snow is cleaner than mud." -- Marc Feeley ArneBab: dsmith-work: I don’t know tohoyn: sneek: botsnack sneek: :) meo: how would I implement a DSL like (with-foo foo (bar-fn 1 2)) where foo is passed to exp implicitly and bar-fn is not a top-level definition? parameterize foo and use syntax rules for bar-fn? meo: s/exp/bar-fn/ leoprikler: what is bar-fn? meo: leoprikler: foo is an immutable srfi-9 record, it contains text terminal buffer, cursor position and similar settings, bar-fn are procedures that e.g. move cursor or apply changes to buffer meo: so I would like to do something like (in-terminal term ((move 10 10) (fill-rect 5 5))) etc leoprikler: i think you could implement the latter part inside a match(-lambda) meo: oooh let me google it leoprikler: e.g. (move x y) gets translated to (set-fields term ...) leoprikler: meo: search for "ice-9 match" inside the documentation meo: yes found it already, thanks meo: how would I pass the context object to these methods? isn't using an implicit argument to a procedure a violation of functional purity? meo: oh right pattern matching would be able to do that on syntactic level I guess meo: well more homework to do, excellent leoprikler: as for in-term, that would than be (call-with-term term (lambda (term) (for-each (match-lambda ...)))) meo: oh yeah I saw that pattern leoprikler: (for-each (match-lambda ...) ) leoprikler: oh, but since you're using immutable records, you should (fold (match-lambda ...) term ) meo: then I can apply a top level syntax transformer to abstain from explicitly quoting the DSL calls meo: I'm a bit too excited leoprikler: actually... I think you can (fold (match-lambda ...) term quoted-syntax) directly leoprikler: no need to jump through an extra lambda meo: I'm going to try it all out in the evening meo: thanks tons for the advice meo: any suggestions to using arrays inside an immutable structure? I basically spawn a new deep copy on every modification and it feels.. uncomfortable leoprikler: if you can make do with lists, lists are typically wiser leoprikler: otherwise I'd suggest using some functional data structures like fector meo: list-ref isn't O(n) is it? leoprikler: list-ref is O(n) wingo: morning :) sneek: Welcome back wingo, you have 1 message! sneek: wingo, civodul says: hi! WDYT of this 'sleep_pipe' issue when forking and of the proposed patch? https://issues.guix.gnu.org/41948#6 ? leoprikler: what are you using that array for? meo: leoprikler: abstract character and attribute buffer wingo: excellent debugging, civodul and flatwhatson :-) wingo: so i guess we should release 3.0.7 today, wdyt civodul meo: leoprikler: it's rank 2 meo: I _suppose_ I could implement some data structure on top or just do something silly like a map hased by coordinates leoprikler: I imagine that gets filled quite quickly tohoyn: wingo: what do you think about bug #45131? meo: actually at this point I care more about correctness than performance civodul: wingo: hi! SGTM! meo: the underlying structure is private and can be changed later meo: maybe I should just implement it in C or something civodul: wingo: can you take care of it? civodul: i think we need to update NEWS for earlier fixes meo: oh yeah speaking of which, one of the tests in guix causes guile to crash meo: I need to isolate that... leoprikler: since you need O(n) for copying, what exactly is the problem with using lists instead of vectors then? I assume the access, but if you're clever with your fold's you should have overall O(n) for your algorithms leoprikler: s/fold's/folds/ wingo: civodul: yeah i can do it wingo: tohoyn: sure can apply that one wingo: tx for poke tohoyn: wingo: ok. tx. tohoyn: wingo: could you inform me when it has been applied? meo: leoprikler: im cheating by buffering the changes, anyway it's too early to consider this a problem wingo: tohoyn: done tohoyn: wingo: tx wingo: lloda: do you anticipate breaking chanes from the srfi-64 change? *: wingo recalls quite a number of user problems from the last srfi-64 update wingo: release all done; the manual commit is taking time because fucking CVS lampilelo: wingo: the change to srfi-64 fixes the bug introduced by the last one, if someone, in the meantime, wrote code that relies on that bug, it will break wingo: omg what, are we going to have another round of people wondering why their srfi-64-based test suites fail??? lampilelo: the problem with the last change was that the test runner was getting uninstalled every time the test group finished lampilelo: this change makes it so the test runner is gettin uninstalled only if there was no test runner to begin with and the test group introduced a temporary one lampilelo: it shouldn't have any side-effects other than fixing the bug, also i can take all the blame because it's my patch lampilelo: s/test group/test/g civodul: wingo: yay, thank you! \o/ wingo: lampilelo: sounds good :) lampilelo: i'm thinking about another fix to srfi-64 because there's a problem of test-group not working if you don't have a runner installed, i suspect people don't like srfi-64 for testing because of this kind of small bugs that prevent it from "just working" wingo: compatible fixes that smooth user experience are golden lampilelo: so you say there was a slew of people complaining but nobody made a patch! outrageous! ;) wingo: :-) lloda: i had to fix my own tests after the earlier srfi-64 patch, but i didn't have to do anything for the latest one fwiw meo: b emanuele6: b chrislck: d rekado: q mwette: meo: look at share/guile/3.0/module/language/cps/with-cps.scm meo: thanks, will look meo: aaaah! meo: thanks much appreciated meo: I dont have the faintest idea how to test constructs like these dsmith-work: Morning Greetings, Guilers dsmith-work: RELEASE!! taylan: heya, is there an actual bug tracker for Guile? I was only able to find the mailing list archive, which can't give me a list of open reports if I'm not mistaken. rekado: taylan: bug-guile@gnu.org is backed by debbugs lampilelo: https://debbugs.gnu.org/cgi/pkgreport.cgi?bug-rev=1;archive=0;package=guile taylan: ah, thanks. for some reason Google was useless. dsmith-work: sneek: bugs? sneek: bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile taylan: does anyone happen to know where the module (system syntax internal) is defined? I can only find module/system/syntax.scm which uses it but doesn't define it. taylan: ok, I found where the forms exported from the module are defined (in libguile/syntax.c), still curious how the module is defined though. dsmith-work: taylan: Look at line 4700 in boot-9.scm taylan: oh, doh, like 10 lines above where I looked :) dsmith-work: Behold the mighty power of grep! (or ripgrep in this case) zimoun: hi! sneek: Welcome back zimoun, you have 1 message! sneek: zimoun, efraim says: changing the zstd test to use compression level 16 worked. I'll commit the change to core-updates. efraim: I think that was a while ago zimoun: yeah probably. :-) zimoun: civodul: test-assert with with-exception-handler fails excepts if it is wrapped with call/cc. The exception is generated by raise-exception make-error. I guess, I miss something. Why does it work with call/cc and not without? civodul: zimoun: do you have a specific example? civodul: BTW, as a rule of thumb, never use call/cc except for SICP :-) zimoun: a function that returns an exception (define-exception-type). This function is “new” gem->guix-package from Guix and we are trying to test “(gem->guix-package "do-not-exist")” civodul: zimoun: so what about: (test-assert "xyz" 'exc (guard (c ((error? c) 'exc)) (gem->guix-package "does-not-exist"))) ? civodul: there are quite a few tests like this civodul: (note: Guix doesn't use the Guile 3 exception API yet) zimoun: civodul: thanks. Is it a willing to not use Guile 3 exception API? Or can we add it for the new tests? civodul: zimoun: for now we'll stick to srfi-34 or good'ol catch civodul: (current Guix still builds with 2.2) davexunit: in case anyone else likes this stuff: here's the classic Sponza scene as currently rendered by a glTF importer and renderer written in Guile https://blob.jortage.com/blobs/4/5c7/45c744b520e0956b824a97517543e328411904acf7308073df0893458d2dcc61a2ceb871c07f59883f6f581d0e7914c139e6da15772335b13b0d74f3d8277827 davexunit: (TODO: apply lighting) davexunit: thanks, guile-opengl flatwhatson: nice, thanks ludo! tohoyn: sneek: botsnack tohoyn: it seems that correction to bug #45131 has not been integrated to the upstream guile. why is this so? tohoyn: I just fetched new guile with "git clone" and checked that. RhodiumToad: moo RhodiumToad: sneek: botsnack RhodiumToad: sneek awol again? dsmith: sneek: botsnack sneek: :) dsmith: sneek: tell Kimapr[m] just testing sneek: Kimapr[m], dsmith says: just testing RhodiumToad: sneek: botsnack sneek: :) dsmith: leoprikler: Something you said in #guix killed the bot. "sneek tell Kimapr[m] {something}" dsmith: leoprikler: Do you what the {something} was? leoprikler: I can test it here if you want: sneek tell dmsith to use "later tell" instead of "tell" leoprikler: sneek tell dmsith to use "later tell" instead of "tell" leoprikler: yep RhodiumToad: bwahaha RhodiumToad: how to confuse a bot to death :-) lampilelo: lol dsmith: In bot/infobot.scm: lampilelo: poor sneek dsmith: 154:22 8 (_ "leoprikler" "#guix" "sneek tell Kimapr[m] use \"lat…") leoprikler: I pity sneek for trying to figure out what I said :( leoprikler: sneek: botsnack sneek: :) lampilelo: wait till a bug kills a sentient ai you liked leoprikler: That happens all the time in media :( RhodiumToad: sneek tell sneek to tell sneel to use "later tell" instead of "tell" RhodiumToad: oops, typo dsmith: The bare "tell" functionalty (which I never tried to get working) is so the bot addresses the answer to someone else. RhodiumToad: ah dsmith: sneek: botsnack sneek: :) dsmith: sneek: tell me something dsmith: sneek: tell dsmith something dsmith: sneek: later tell dsmith something sneek: Got it. dsmith: ok sneek: Welcome back dsmith, you have 1 message! sneek: dsmith, dsmith says: something dsmith: sneek: later tell dsmith use later tell, not tell sneek: Will do. dsmith: sneek: botsnack sneek: Welcome back dsmith, you have 1 message! sneek: dsmith, dsmith says: use later tell, not tell sneek: :) leoprikler: sneek tell dsmith hi leoprikler: ahh, so tell is disabled dsmith: Since "tell" is currently not really useful, I've disabled that leoprikler: could you make sneek reply "Tell them yourself."? dsmith: Hah dsmith: Maybe, I'd have to think about it some. RhodiumToad: sneek, later tell sneek to later tell sneek to use later tell, not tell sneek: Umm, I'm right here. RhodiumToad: heh *: RhodiumToad is easily amused leoprikler: sneek tell RhodiumToad hi leoprikler: oh, tell is still enabled dsmith: leoprikler: "later tell" is, "tell" is gone. leoprikler: s/en/dis/ D: manumanumanu: Does anyone here know stuff about RRB-vectors? I don't want to go reading some other source code to get the answer, but I am having trouble with maintaining the invariant... lfam: Hi, user vivien_ reports "There’s a typo in the guile manual, raise-exception is documented with #:continuable but in reality it’s #:continuable? with a question mark" civodul: sneek: later tell wingo hi! WDYT of this 'sleep_pipe' issue when forking and of the proposed patch? https://issues.guix.gnu.org/41948#6 ? sneek: Got it. apteryx: RhodiumToad: serializer #f or empty-serializer (defined elsewhere) would be sufficient! RhodiumToad: apteryx: does that code work as is? RhodiumToad: oh, I see the problem I'm having RhodiumToad: try it like this: https://dpaste.org/pjKg RhodiumToad: (all I've checked is that it produces something that looks vaguely sane when rendered from tree-il back to scheme RhodiumToad: the (%location -location) thing looks wrong but as far as I can tell it's not changed apteryx: RhodiumToad: oh, that makes sense! Thanks for showing me how to propagate the needed information to the helper. apteryx: about the %location -location, yeah, that looks like a bug; I've seen warnings when compiling modules making use of define-configuration. RhodiumToad: looks like a missing arg to me RhodiumToad: first arg to that "id" macro is the syntactic context, not one of the elements of the name RhodiumToad: that's probably not the only way to address the problem, but it was the most obvious to me apteryx: ah, indeed! apteryx: RhodiumToad: I had thought about doing something like this, but had failed to see that I could use exact patterns such as #t to convey the needed information apteryx: so to me it looked like I'd go in circles, eh. RhodiumToad: well in this case the #t / #f passed to the helper is a normal datum RhodiumToad: the only hard part was figuring out how to make the helper generate the right syntax in the no-serialization case apteryx: hm, yes, that's what I meant with my broken jargon 'exact pattern' ;-) apteryx: It seems to work perfectly! Thanks for having guided me through it! Who should I credit in the commit message (if you don't mind!) ? RhodiumToad: me :-) you can credit me as RhodiumToad or as Andrew Gierth (or both) apteryx: OK! Thanks. apteryx: if you pm me your email I could simply give you authorship of the commit, which would be more accurate :-) RhodiumToad: I'd prefer not, just credit me in the message apteryx: alright! *: chrislck never thought define-syntax-rule could be inside a (define) environment... civodul: o/ emanuele6: o/ civodul: flatwhatson: i followed up on the libgc/munmap issue at flatwhatson: ah great, really happy my stubborn investigation of that unit test paid off! civodul: it did! much appreciated civodul: i have patches regarding the finalizer pipe and thread "sleep pipes", not sure if that's what you were looking at civodul: https://issues.guix.gnu.org/41948#6 civodul: lemme know you think! flatwhatson: ooh, nasty flatwhatson: (the bug, not your patch... :) flatwhatson: civodul: lgtm, except i think GC_set_finalizer_notifier should only happen if thread is created successfully flatwhatson: do we need to worry about unlocking the mutex when throwing scm_syserror? flatwhatson: civodul: https://paste.gnome.org/pyuzibuur flatwhatson: the full patch to finalizers.c: https://paste.gnome.org/ph3lewjl8 flatwhatson: guile: finalizers.c:258: start_finalization_thread: Assertion `finalization_pipe[0] == -1' failed. flatwhatson: oh, right, if creating the pipe succeeds but creating the thread fails, it's left inconsistent flatwhatson: this one is *tested*: https://paste.gnome.org/pnhdjp5qy flatwhatson: running test-out-of-memory gives multiple "error creating finalization thread", which means it's properly retrying thread creation and properly cleaning up if/when that fails tohoyn: sneek: botsnack sneek: :) civodul: flatwhatson: ah yes, that makes sense to me, thanks! civodul: could you send the updated patch to 40525@debbugs.gnu.org? civodul: i'll give it another look later today and apply it if everything goes well civodul: i'd also like to have a test for the sleep_pipe problem flatwhatson: civodul: should that be 41948@debbugs.gnu.org, as a follow-up to your patch? flatwhatson: sneek: later tell civodul https://issues.guix.gnu.org/41948#9 sneek: Okay. civodul: flatwhatson: thanks for the revised patch, i've pushed it! civodul: i also pushed the 'sleep_pipe' patch i posted earlier civodul: it fixes the problems we were observing before \o/ civodul: maybe wingo can comment later flatwhatson: sneek: later tell civodul I've tested with libgc-7 and confirmed it doesn't have the mmap(PROT_NONE) bug. The difference is that libgc-7 defaults to `--disable-munmap` where libgc-8 defaults to `--enable-munmap=6`. Building with a libgc-8 with `--disable-munmap` doesn't suffer from the bug. sneek: Got it. civodul: hi! civodul: flatwhatson: thanks for digging the libgc/--disable-munmap issue! civodul: do you know if there are other implications of building with --disable-munmap? civodul: i suppose the effect is that GC memory is never reclaimed, right? flatwhatson: civodul: correct, so more likely to get oomkilled if it's a legit memory exhaustion flatwhatson: otherwise i think it's not a big deal, especially as libgc-7 defaulted to having it disabled flatwhatson: disabling it until upstream fixes the bug seems sensible to me civodul: flatwhatson: yes, agreed civodul: did you report it upstream? civodul: i'll change the libgc@8 package in Guix wingo: civodul: issue with flipping jit permissions is if thread A is running code from partially-filled page P, and thread B goes to add to that page, it would probably cause a fault wingo: a solution is, each jitted function starts on its own page. but that is terrible for memory civodul: wingo: uh, indeed civodul: perhaps you can have one function per page on macOS if that's what it wants civodul: and on GNU/Linux you'd make it read-only only once it's filled civodul: dunno if that helps wingo: yeah i think that makes sense as a short-term solution wingo: not sure what an optimal solution looks like. apple silicon is really memory-constrained so i can't imagine that's their optimal use case amirouche: hello, anyone can tell me how much time the following program take in seconds with a recent guile version? amirouche: https://dpaste.com/68DLGDSY5 amirouche: with guile 3.0.1 coming with ubuntu 20.04 (LTS), it runs forever. wingo: probably similar on more recent guile, because it uses call/cc wingo: should use call-with-prompt if you want it to go faster flatwhatson: civodul: yes it's reported upstream here: https://github.com/ivmai/bdwgc/issues/353 civodul: flatwhatson: awesome, thank you! flatwhatson: happy to help :) flatwhatson: i think there is another bug here around "error creating finalization thread", spawn_finalizer_thread() sets the notifier callback to notify_finalizer_to_run regardless of whether start_finalization_thread succeeds, so we'll never retry launching the finalizer thread wingo: aaah i see wingo: do you think the finalizer thread should be the one to set the finalizer notifier? wingo: i.e. move that call up to line 214 or so flatwhatson: i was thinking 266 but yeah, maybe better to do it from the thread? wingo: yeah dunno, hard to say wingo: no strong opinion there wingo: i guess i would want to make sure that entering guile didn't throw an exception -- assuming that in this case we're talking about severe OOM wingo: so perhaps better to do so in the inner function, once we know that the thread is ready to do the finalizations civodul: i have a stash with a fix in this area: https://web.fdn.fr/~lcourtes/pastebin/guile-finalizer-fixlet.html civodul: (i don't recall what the impetus was nor why i dropped the ball) *: wingo cheers civodul and flatwhatson on :) civodul: ah yes, it must have been this: https://issues.guix.gnu.org/41948 lampilelo: is it better to (let ((proc-input-param (modify proc-input-param))) (use proc-input-param)) or (set! proc-input-param (modify proc-input-param)) (use proc-input-param)? leoprikler: lampilelo: (use (modify proc-input-param)) :P lampilelo: lol leoprikler: if you need to extract that logic though, let is friendlier lampilelo: (use1 proc-input-param) (use2 proc-input-param) ... lampilelo: my question is more about what's the best practice, set! wouldn't allocate as much as let leoprikler: Are you sure about that? lampilelo: no lampilelo: i should add theoretically in my mind leoprikler: As long as you don't use set, the compiler can optimize very much. leoprikler: In particular do stuff like inlining etc. leoprikler: once you do alter variables, things are no longer so clear leoprikler: see also the good old tail recursion loop equivalence wingo: let is free wingo: set! is not davexunit: as in... set! allocates??? lampilelo: ok, so let is the way to go, then leoprikler: davexunit: For set! you need boxes IIRC, for let you don't leoprikler: so if a variable is never set! you can just pass the pure value around leoprikler: if OTOH it is, you need to implicitly generate variable-refs etc. davexunit: makes sense davexunit: I don't use set! much. I do use the generic method set! in goops code, though. davexunit: but most of my low level code is using special setters for bytevectors and such lampilelo: that's good to know, i try to avoid set! but now i think i'll avoid it more rekado: there seems to be a bug with r7rs include-library-declarations rekado: getting errors like this: unknown location: source expression failed to match any pattern in form (((include "test-runner-simple.body.scm"))) rekado: or this: unknown location: unexpected syntax in form () rekado: I don’t know where this extra wrapping in parentheses comes from. rekado: (I’m trying to package Taylan’s scheme-srfis) wklew: rekado: I don't know if it's related, but cond-expand in r7rs define-library forms is also broken wklew: it leads to similar looking errors wklew: https://www.mail-archive.com/bug-guile@gnu.org/msg10146.html wklew: actually the same error: (from that post): unknown location: source expression failed to match any pattern in form (((begin (define foo 42)))) wklew: oh wow looks like wingo just patched it! wklew: https://www.mail-archive.com/bug-guile@gnu.org/msg10468.html wingo: took me long enough :P wingo: will roll a 3.0.7 shortly rekado: ooh, super neat! wklew: I'm really excited for that, trying to develop portable R7RS libraries has been frustrating dsmith-work: Happy Friday, Guilers!! emanuele6: happy friday :) amirouche: re https://dpaste.com/68DLGDSY5, i replace both call/cc with call/ec it raise an error: ERROR: In procedure abort: Abort to unknown prompt amirouche: replacing either of the call/cc with call/ec does work too. amirouche: same error. RhodiumToad: why would you expect it to work with call/ec ? RhodiumToad: you can (I believe) do generators with delimited continuations, but (as the name implies) the dynamic scope of the generator has to be delimited somehow *: RhodiumToad has played around with shift/reset to do some of this kind of stuff amirouche: Andy W. told me to use prompts so I did. amirouche: It seems like make-coroutine-generator can not be implement with delimited continuations. I have no practical experience with delimited prompt, even if I understand they re not "unlimited" RhodiumToad: in particular, the thing you can do with call/cc that you explicitly can't do with call/ec is to store the continuation somewhere and reuse it after the call/ec has returned amirouche: that is what I had in mind. RhodiumToad: using prompts is better, IMO, but you can't just switch call/cc for call/ec amirouche: The way I say it is: given (call/ec proc), PROC will take the continuation as argument, and that continuation must be called during the extent of PROC, once PROC has returned the continuation is invalid. amirouche: I was doing benchmarks about call/cc but I only tested wall clock time with bash's time. I need to also benchmark memory use, but that is more complicated. amirouche: I mean, I think it is difficult to predict what will be on the stack in real program, and whether it matters. RhodiumToad: it took me a couple of days of serious study to get my brain around shift/reset, mostly by using some stuff I found on oleg's site at okmij.org/ftp RhodiumToad: I got to the point of being able to do a tree comparison coroutine-style RhodiumToad: (i.e. given two generators each of which walks a tree, do they generate the same sequence) wingo: i will be honest, i never got my head around the shift/reset formulation of prompts. the only concept that stuck was call-with-prompt / abort-to-prompt RhodiumToad: is that why the documentation on them is so sketchy? :-) civodul: wingo: same for me (and i'm glad i'm not the only one :-)) apteryx: hello! I've revisiting some misunderstanding/problem I couldn't solve with syntax-parameterize. Is the following expected to work, or am I doing something wrong? https://paste.debian.net/1196664/ apteryx: It seems the syntax-parameter value doesn't stick when the syntax recurses itself wingo: RhodiumToad: yeah probably :) leoprikler: W.r.t. 3.0.7, has 45131 made it upstream yet? :P wklew: i think of shift/reset as being like prompt/abort except that the inner operator (shift) is "in control" wklew: as opposed to abort, which acts like a handler wklew: it is a funky inside out way of looking at a program wklew: sorry, meant to say prompt acts like a handler, since it receives the continuation from the outside RhodiumToad: control flow with shift/reset can get weird RhodiumToad: e.g. (define (k3) (shift c (c 1) (c 2) (c 3))) (reset (let ((x (k3)) (y (k3))) (pk x y))) RhodiumToad: that sort of thing can get very "COME FROM"-y apteryx: is it possible to pass an ellipsized value as an argument to a syntax helper procedure? RhodiumToad: not by itself, it would have to be inside a #' form I believe RhodiumToad: (define (myhelper s) (pk (syntax->datum s)) s) (define-syntax foo (lambda (s) (syntax-case s () ((_ blah ...) (myhelper #'(blah ...)))))) RhodiumToad: (foo write 1) then pk's ((write 1)) and then writes 1 leoprikler: btw. I just noticed, that ice-9 match doesn't handle #nil :( leoprikler: okay, screw me, I just messed up my order lampilelo: ok, i hope my adventure with geiser problems is over, i made a patch, don't know if it's 100% correct but works for all cases i tested for, of course throwing away some syntax metadata but whatevs! i just want it to work lampilelo: who needs the outer syntax data from # #)> anyway RhodiumToad: uh, lexical scope? lampilelo: the thing is it's passed as `(,proc ,@args) to eval anyway lampilelo: args being the inner list of syntax objects lampilelo: i wanted to change it to `(apply ,proc ',args) without passing args through syntax->datum but it produces some strange warnings i don't know the origin of *: civodul thinks we may have a problem with thread->sleep_pipe and fork lampilelo: how so? civodul: sorry, that's not related to what you were discussing civodul: but it looks like child processes can end up using the same sleep_pipe as their parent lampilelo: i know it's not related, just curious RhodiumToad: um, well, fork and threads have never worked well together apteryx: any clue how to make the following pattern work (is it possible?): (_ stem (field (field-type def ...) doc custom-serializer ...) ... (no-serialization ...)), where no-serialization should act as a present/absent toggle switch, rather than the catchall glob it seems to be currently behaving as RhodiumToad: you mean you want it to be a syntactic keyword? RhodiumToad: if so, you need to add it to the list of keywords in syntax-rules or syntax-case apteryx: hm, I'm not sure I want it to be a syntactic keyword; I want it to be provided by the user of the macro RhodiumToad: I mean, do you want the user to have to write literally (no-serialization whatever) apteryx: e.g. (define-configuration my-config (some-field (number 10)) (some-other-field (string)) (no-serialization)) RhodiumToad: ok, so that's a keyword RhodiumToad: because you're looking for the symbol no-serialization rather than some arbitrary (foo) apteryx: right! RhodiumToad: not sure about making it optional though RhodiumToad: rather than having two rules, one with it and one without apteryx: the macro body is rather complex and doesn't factorize out well (it makes use of with-syntax for example) RhodiumToad: a challenge! apteryx: it may be that my macro foo is too weak (it is!), but I couldn't make it work that way (via 2 patterns), short of copying most of the logic at both places apteryx: if you're up to the challenge, the task is to take this macro (define-configuration) here: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/configuration.scm#n122, and teach it to disable its serialization support via a syntactic keyword such as no-serialization. RhodiumToad: hm RhodiumToad: you want to omit the (serializer ...) clauses from the output if no-serialization is set? RhodiumToad: or is something like (serializer #f) sufficient? flatwhatson: sneek: later ask ludovic any chance you were seeing SIGABRT with "mmap(PROT_NONE) failed", not just warnings? that would be the same out-of-memory bug. i guess some guix infrastructure could legitimately hit this case due to memory pressure while running builds sneek: Got it. civodul: flatwhatson: oh right, it may have been SIGABRT actually civodul: like this one: https://issues.guix.gnu.org/40525 civodul: looking at https://issues.guix.gnu.org/40525#4 there could be a bug still lingering here flatwhatson: oh yep, that's exactly the bug. well, i have a patch for libgc 8.0.4: https://paste.gnome.org/pvaze9jpz civodul: looks like a workaround more than a fix though, no? flatwhatson: not really, mprotect(PROT_NONE) is as well documented as mmap(PROT_NONE). it's not clear why libgc would prefer mmap as the common case flatwhatson: latest master libgc actually expands that ifdef to cover AIX, HPUX and HAIKU which exhibit the same/similar problem lampilelo: i git-bisected guile and it seems that the incompatibility between geiser and guile started when (read) was replaced by (read-syntax) in language/scheme/spec.scm, i know too little about how stuff works internally to really understand the problem lampilelo: i assume the tests for repl are enabled and pass (otherwise someone would notice), is there something different between the test cases and geiser<->repl connection? it's faulty for both tcp and unix sockets lampilelo: maybe tests use the same stuff in both client and server, but the incompatibility lies in a changed spec? lampilelo: when talking with outside world, that is lampilelo: ok, i'm leaving it at that for now, just wanted to dump what i learned, maybe someone would know what's the matter, the breakage starts at commit is 03448b289d9804bb27b633b82e22cf7be55743c5 lampilelo: s/is// flatwhatson: geiser-guile has some magic around compilation & evaluation, problem is probably in here: https://gitlab.com/emacs-geiser/guile/-/blob/master/src/geiser/evaluation.scm lampilelo: so you say it's geiser that should adapt to the new way of doing things? i can add a ticket to their issue tracker tomorrow flatwhatson: hard to say who is at fault, but i would start looking there for the root cause of the bug lampilelo: geiser's code didn't change though lampilelo: ok, i'm going to bed, good night flatwhatson: libgc failures now reported upstream: https://github.com/ivmai/bdwgc/issues/353 daviid: lampilelo: you might wana talk about the geiser problem on #geiser, the author is jao, very nice and very responsive ... manumanumanu: rlb: I am not involved in any internal things, but I am playing a lot with data structures at the moment. I don't really see the need for expandable strings, at least not if it makes _every other operation_ more expensive. Representing strings as vectors of N-char bytevector chunks is probably a pretty nice compromise, though. If you allow for an offset you get shared substrings, decent random manumanumanu: access, and quick iteration with string cursors. as andy said: mutable strings in scheme is probably a bug in the spec :) manumanumanu: It is pretty compact as well: say you make each chunk 32 chars long, meaning each chunk is anywhere between 32 and (worst case) 128 bytes. One pointer per chunk. I don't know enough about the guile internals, but it sure is more compact than a vector of chars. dsmith-work: {appropriate time} Greetings, Guilers mwette: Guile != Scheme; see https://opensource.com/article/21/5/learn-lisp rlb: manumanumanu: right - it's certainly feasible. A plain utf-8 implementation has potentially better locality, and much better external compatibility (e.g. say we wanted to use libpcre). It might also have a performance advantage if there are cases where we can use more existing, heavily optimized code. But of course the persistent version you describe has other advantages (space in cases where the sharing works well, etc.). rlb: What got me thinking about it again lately, fwiw, was implementing clj's #"foo" regex support via libpcre. That's much more expensive right now because libpcre just doesn't support latin-1. But for that to be optimally efficient for guile extensions that only rely on the public api, we'd also have to support some way to use the internal utf-8 pointer (even if we never *promised* that it wouldn't be a copy). mwette: rlb, manumanumanu: you might be interested in vlists described in the manuall, as well as intsets and intmaps under (language cps) wingo: moo sneek: oom lampilelo: wingo: u broke geiser with this https://git.savannah.gnu.org/cgit/guile.git/commit/?id=03448b289d9804bb27b633b82e22cf7be55743c5 it seems wingo: how? :) leoprikler: probably because geiser doesn't understand read-syntax lampilelo: since read was switched to read-syntax in this commit, it feels like this is the only explanation wingo: but geiser doesn't call read-syntax wingo: does geiser call (language-reader (lookup-language 'scheme)) or something like that? lampilelo: doesn't call read either, i don't really know what's going on here dsmith-work: But that is where git-bisect landed? lampilelo: yes wingo: my guess is that geiser detects the current language and for some reason uses the current language's reader but also parses that read data for some reason wingo: which... the simple solution is that if the result of calling the current language's reader is a syntax object, to do syntax->datum on it. not so great for debugging info tho lampilelo: wingo: there's no lookup-language or language-reader anywhere in geiser's and geiser-guile's codebases wingo: i would think that geiser should rather do something more intelligent so as to preserve source locations for bare symbols, numbers, etc wingo: good luck debugging it, hope these pointers help :) daviid: it definitely parses the results, because, as an example, it would display guile-cv images (if proper setting to do so), not just return the result ... daviid: *geiser definitely parses the results ... lampilelo: geiser-guile has some magic around compilation & evaluation, lampilelo: problem is probably in here: lampilelo: https://gitlab.com/emacs-geiser/guile/-/blob/master/src/geiser/evaluation.scm lampilelo: i wish i knew more about the codebases, now i'm just passing the info around lampilelo: i told geiser's maintainer about the problem and put a ticket on their issue tracker lampilelo: so from what you're saying it's just solely geiser's problem wingo: well. i mean evidently something changed in guile from an interface pov. it's not the existence of read-syntax wingo: but rather that one part of the compiler calls it wingo: am a bit perplexed as to how that could break geiser's behavior wingo: if you could get a backtrace of the error that would be helpful :) dsmith-work: lampilelo: Is that broken with 3.0.6 or with master? (there have been several fixes in master since 3.0.6) lampilelo: i think i checked it with master too and it didn't work either, but i'm going to confirm lampilelo: wingo: and there's no backtrace because nothing really produces an error, it looks like geiser interprets what guile sent to it wrong lampilelo: returns garbage, but doesn't throw lampilelo: https://gitlab.com/emacs-geiser/guile/-/issues/9 wingo: hummmmmmmmmm wingo: you know, i bet i know what it is wingo: https://gitlab.com/emacs-geiser/guile/-/blob/master/src/geiser/emacs.scm#L35 wingo: there is some wizardry here to get the repl to read an expression in the current language and pass it as a datum to the repl command wingo: which, prolly it is not expecting a syntax object. humm lampilelo: i should've invited geiser's maintainer to #guile for this conversation dsmith-work: jao is/was usually here. dsmith-work: sneek: seen jao? sneek: jao?, pretty sure was seen in #guile 11 months ago, saying: i think geiser doesn't work with declarative modules. civodul was telling me the other day. aren't they a 3.x thing?. dsmith-work: sneek: botsnak dsmith-work: sneek: botsnack sneek: :) dsmith-work: Picky about them snacks civodul: Guix has a package cache: it's a .go file that evaluates to a big list, one item per package, where each item is a vector (with package name, version, etc.) civodul: generating this .go file has become CPU-intensive lately civodul: and it seems to be a case where we spend time doing bignum operations wingo: in slot allocation i guess? civodul: incidentally, Guix now has 17K packages, which i can't help but think is right above 16,384 :-) civodul: wingo: in truncate-bits civodul: called from the assembler wingo: funny :) civodul: https://web.fdn.fr/~lcourtes/pastebin/generate-package-cache-profile.html wingo: hilarious civodul: heh, we're pushing it to the limits! wingo: well. i mean it is perplexing in many ways wingo: but the easy solution is to just dispatch for 16, 32, and 64 bits, signed or unsigned wingo: to (<= 0 x #xffff) etc civodul: yes, that would avoid the expensive 'ash' and achieve the same i guess wingo: not sure if that's the expensive bit wingo: bc it's just ashing 1 by 16, 32, or 64, which is not enormous, but maybe that's enough wingo: like even the logand could be expensive, internally civodul: (1- (ash 1 64)) allocates a couple bignums civodul: yeah civodul: profile on 1.2.0, which had 15K packages: https://web.fdn.fr/~lcourtes/pastebin/generate-package-cache-profile-1.2.0.html civodul: veeerry different! civodul: fun civodul: x6 wingo: civodul: pushed a little patch wingo: so we should drop a 3.0.7 now, right? wingo: given the little bugs in 3.0.6 civodul: wingo: yes, sounds good! civodul: lemme see the patch civodul: wingo: ah clever, so it's all peval'd, right? wingo: yeah wingo: had to use define-syntax-rule to force inlining of the helper, but yeah civodul: cool civodul: i'll try to see how it performs wingo: yay civodul: i don't have a reduced test case so i'll disentangle the Guix bits wingo: so... what is our perspective on PROT_WRITE | PROT_EXEC wingo: we could be more rigorous in the JIT in that regard. would either waste memory or leave WRITE|EXEC half-filled pages wingo: or thrash about with mprotect wingo: on each jitted function civodul: wingo: verdict: 12s instead of 100s wall-clock \o/ civodul: thanks! wingo: what a hilarious fix civodul: yeah, those bignums can really hit harder than we might think wingo: i hate that :) civodul: yeah it's not intuitive! civodul: and we've learned & claimed that multiprecision is the one true way to do arithmetic without fear wingo: what if it's just our implementation? manumanumanu: This has been a funny discussion to follow. wingo: i mean would it change with mpn? civodul: it could be slightly less stressful for the GC wingo: in this concrete case i think specializing on the bit width makes sense fwiw civodul: yes civodul: regardless of the implementation, (1- (ash x 64)) is going to allocate civodul: and we're not wired to pay attention to that i think wingo: and there are only three afaics, we should have truncate-s16, truncate-u64, etc civodul: yeah civodul: with the compiler's help, we could make things like (1- (ash x 64)) allocate only one bignum and then operate in place maybe? *: wingo was wondering about jit protections as apparently apple silicon requires flipping page protections on each jit write civodul: ah yes civodul: so currently JIT pages remain writable? wingo: civodul: (1- (ash x 64)) is already optimized if the 64 is visible to the compiler fwiw. but yeah wingo: civodul: right now it's the wild west wingo: writable + executable, saddle up civodul: uh civodul: making them read-only sounds reasonable to me civodul: but i don't know what this entails in the code wingo: the issue is that the unit of jit compilation is typically smaller than the page size wingo: you wouldn't want a page per jitted function... wingo: anyway, somethign to think about civodul: oh, got it civodul: you could flip permissions each time you need to JIT, but it might be expensive apteryx: hello! Is there a way to specify 'zero or one' instead of 'zero or more' or 'one or more' when using (ice-9 match) ? apteryx: for a the last element in a list pattern leoprikler: apteryx (or () (x))? civodul: such patterns are not great because they lead to one code path where 'x' is bound and another where it's unbound leoprikler: right so you'd have (or (? null? x) (x)) leoprikler: or you could do it with two different patterns or use a submatch leoprikler: or call it (and (or () (x)) y), then y captures the match IIUC civodul: i'd use two different patterns apteryx: civodul: my gripe with the multiple pattern approach is that it leads to code duplication, no? apteryx: leoprikler: thanks for sharing leoprikler: you could factor that out into some lambda and then just call it twice civodul: apteryx: it depends, it could be that the two clauses have little in common or that there's another way to factorize common code apteryx: OK, I'll try something, thank you! lampilelo: lol there is a package with elisp bindings to zmq lampilelo: exactly 1 package on mepla uses it lampilelo: ah, wrong channel ;) lampilelo: hmmm... setting LD_LIBRARY_PATH from inside the scm file and then calling load-extension doesn't work for me with guile 3.0.6 lampilelo: it works when i set it from the shell before executing lampilelo: why wouldn't it work then? dustyweb: abralek: yay :) mwette: lampilelo: Lately I always use #!/bin/sh / set envs / exec guile $0 "$@" !# flatwhatson: Greetings, I've been digging into why test-out-of-memory fails on my system. flatwhatson: It seems like lazy creation of the finalizer thread is the culprit. Is there a way to block until the finalizer thread is started before continuing the test? flatwhatson: I guess the fact that we can't catch out-of-memory until that thread is running is a genuine bug? flatwhatson: Nope, red herring. The problem is mmap(PROT_NONE) failed in GC_unmap. flatwhatson: So... building with a libgc with --disable-munmap works, as does this patch: https://paste.gnome.org/pfwcjr60q flatwhatson: RFC on a patch for libgc which makes a failing GC_unmap non-fatal: https://paste.gnome.org/poz7ksfbv flatwhatson: This allows test-out-of-memory to pass, without crippling gc's unmapping in non-exhausted scenarios rlb: wingo: wondering (again) about whether it'd be worth the complexity to preserve mutable non-ascii strings in a utf-8 implementation, i.e. I think maybe the only time you could take advantage of it is when you know you're making changes that don't shift *any* character offsets, e.g. (string-set x 11 some-char-thats-the-same-length). Otherwise we just derive a new stringbuf. rlb: Currently inclining toward thinking it might not be worth the complexity. wingo: rlb: hard to say. actually i think maybe in a utf-8 world it can make sense to penalize string-set! in this way rlb: ...ascii strings are a different matter, i.e. might be a common enough case to be worth it, though I suppose it does create an algorithmic-complexity "cliff" that might be surprising if you don't know about it. wingo: mutable strings in scheme are a bug, of course :) rlb: heh, would certainly make my hacking easier if we didn't have all the flavors :) rlb: (atm I've kept the mutable flag, and have kept mutability in some cases where it was easy for ascii strings...) wingo: flatwhatson: why does the mmap(PROT_NONE) fail? wingo: rlb: yeah practically speaking we have to support mutable strings wingo: to not break user code, and to not break too much with the standards rlb: i.e. if you string-map!, it was an incoming ascii string, and the resulting char length is still equal to the byte length, we can just clobber the stringbuf contents... wingo: but if you were designing scheme now, you would not include mutable strings :) rlb: but to do that for a non-ascii string, we'd also have to check that the char sizes stayed the same, and that seems unlikely, and isn't free like it is for ascii. wingo: right rlb: (of course it *would* be less complex to just ignore the optimization for ascii too) flatwhatson: wingo: mmap fails with ENOMEM, which is frustrating as that call should actually *free* some space wingo: wow :) wingo: i can't think of a situation in which you would want that to be a fatal error fwiw *: rlb wonders if that might be one of the tests he's marked unreliable for the debian buildds, but will have to look later... flatwhatson: yeah I'm fairly sure that it is, though I'm not sure how long it's been failing and on what systems wingo: flatwhatson: what about seeing if upstream would take a patch that just does s/ABORT/WARN/ if that mmap(PROT_NONE) fails? flatwhatson: the problem is it flags that block as unmapped, and tries to remap it later which also aborts flatwhatson: hence my patch above which just leaves the block marked as mapped flatwhatson: replacing the mmap(PROT_NONE) with an munmap kinda worked, but would also fail later in GC_remap flatwhatson: anyway I guess it's pretty clearly an upstream problem, will gather my thoughts and hassle them instead :) wingo: flatwhatson: yeah sorry to not be more helpful :) libgc aborting guile is not a great situation! rlb: hmm, I suppose a better reason to consider never creating non-ascii mutable stringbufs is that by doing so, you avoid O(n) substring operations, while only giving up some unlikely optimizations... rlb: (O(n) when creating a substring of the mutable stringbuf) lampilelo: what's going on with geiser on guile 3.0.6? first it writes garbage to dbg buffer: lampilelo: While executing meta-command: lampilelo: Wrong type to apply: # lampilelo: scheme@(guile-user)> lampilelo: so i thought "let's update geiser" and now it shows it twice but prepending with additional "retort-syntax" lampilelo: when i write 'display to a buffer and use C-x C-e it evals it and then some, writing "Wrong number of arguments to #" lampilelo: can anyone confirm it's not just my issue? *: wingo is usually breaking his guile so is rarely able to test geiser lampilelo: i'm not sure if it broke after updating guile or my system packages lampilelo: maybe there was an abi break in one of them or something, i'll recompile to be sure lampilelo: yeah, it's still broken tohoyn: sneek: botsnack sneek: :) flatwhatson: huh, turns out that mprotect(PROT_NONE) works where mmap(PROT_NONE) fails! flatwhatson: there's already a code path used on CYGWIN32|AIX|HPUX|HAIKU... almost seems like it should really be the default lampilelo: wingo: did something related to repl change between versions? geiser works fine with 3.0.5 lampilelo: or more specifically to the repl server lloda: lampilelo: i've pushed your srfi-64 patch lampilelo: lloda: oh, thanks lampilelo: that's kinda unexpected since i didn't say anything, but very appreciated lampilelo: come to think of it, i did mention it but thought no one read it civodul: flatwhatson: those mmap(PROT_NONE) warnings are scary civodul: that's a libgc 8.x thing, and it's not clear when/why it happens flatwhatson: civodul: oh, I haven't seen those, I've just been chasing a failing test-out-of-memory, but possibly related? any more details? wingo: lampilelo: don't think so meo: if I have an array inside an immutable record, should I deep copy it and modify the copy and return it as a part of the derivative record? civodul: flatwhatson: not really; it's a thing we've seen occasionally in Guix, but it's not clear to me how to reproduce it civodul: it seemed to be a "new feature" of libgc 8.x lloda: there's zero source info when an error happens during autocompilation lloda: the workaround i have is to compile the file manually with compile-file taw10: meo: it depends on what you're doing. It's OK (in theory, at least) to have an immutable record which references mutable things, but it will probably be simpler to consider everything immutable and do what you said. meo: taw10: i'm trying, the result is I now have functions that modify values of individual fields and a function that does this for several fields and recurses over a list meo: i guess these are the wonders of functional programming meo: any reason not to use ice-9 poe? lampilelo: took me long enough but i confirmed geiser and guile 3.0.6 don't play well together, tested on a fresh ubuntu docker image abralek: dustyweb: In order to make 8sync work for me with fiber I had to CPed janneke's commits from master and also amend few of them. Those commits are for cross-compiling. Do you have any plans to merge the branch or something? dustyweb: abralek: hm I could probably do that dustyweb: abralek: but probably not today dustyweb: abralek: as in, it would be a good idea for me to do that ;) abralek: dustyweb: (<- dustyweb 'thanks) dustyweb: :) dustyweb: abralek: which janneke commits from master did you mean btw? abralek: 1dc3b6a * guix: Use guile-3.0. abralek: d06b7be * build: Support cross building. abralek: ac631e0 * build: Prepare for guile 3. abralek: He did more btw. wingo: lloda: is that a change relative to before? dsmith-work: UGT Greetings, Guilers dustyweb: abralek: where did you get the patches? abralek: dustyweb: ah, sorry, this is my amended fiber branch. abralek: d41139a * build: Support cross building. abralek: e94593c * build: Prepare for guile 3. dustyweb: abralek: maybe you could push the branch somewhere? abralek: dustyweb: https://gitlab.com/Levenson/8sync abralek: dustyweb: fibers branch lloda: wingo: the srfi-64 patch? lloda: it was applied upstream lloda: oh sorry lloda: you mean the lack of source info lloda: no I don't think there was ever source info for those errors lloda: afair manumanumanu: rlb, wingo : regarding strings: I have thought about something like a persistent vector for strings. Each leaf stores a bytevector of N characters, whereas the rest can use 32-way branching. That could give O(1)-ish string-set, pretty fast iteration, yet OK string-ref - while still being pretty compact. manumanumanu: with moderately efficient prepend, and o(1) append with transients. Together with the SRFI for string cursors it might actually not be completely awful as a string representation. manumanumanu: but maybe I'm just overthinking it... manumanumanu: the downside is that you get not all of the benefits of ropes, but with only some of the downsides. manumanumanu: but alas, it is overkill unless you want adjustable length. dustyweb: abralek: ty rlb: manumanumanu: ahh, right, I thought about some of that too, though I'd thought we were leaning in favor of wanting the internal representation to be utf-8. If not, then sure, could definitely do even fancier things. rlb: (...and I should stop poking at my current mess :) ) rlb: daviid: here's what I did, fwiw: https://git.sr.ht/~rlb/lokke/commit/e2039544af0e7988fead08a31a621b9447317ecb See in particular the changes to compat.scm. rlb: (commit message also has some rationale) daviid: rlb: wil look at it asap, tx daviid: i have another quiz, for autotools 'familiar' - g-golf (as an example) may be used with guile-2.0 >= 2.0.14, 2.2 (any version) and 3.0 >= 3.0.7 (which is the first version that will have the patch related to the module-use! 'target' functionality ...) so, till now i had GUILE_PKG([2.2 2.0]), GUILE_PROGS([2.0.14]) - how can we easily acheive this? dsmith: sneek: botsnack sneek: :) dsmith: !uptime sneek: up 5 minutes daviid: abralek: i see nobody answered your question, and i am not 8sync knowledgeable either, but fwiw, its author is dustyweb - who appeared a bit later to your post, maybe you may ping each other ... :) daviid: dsmith: it just occured to me that our bot commands such as !uptime ... use the same naming convention than g-golf accessors :) - probably the other way around though, g-golf accessors use the same naming convention as bots commands ... i see other bots do that to, in #git they have !situation, !paste ... :) is there some 'history/story' behind this notation, among bot writers ...? srandon111: anybody on a BSD here? daviid: wingo: I've answered my own quiz, in bug#47084, related to how to suppress warnings ... i think this bug may be closed now, all fixed, many thanks again abralek: daviid: I see, many thanks for letting me know. I sent an email to @guile-user yesterday, maybe I could ping him daviid: abralek: welcome! dsmith: daviid: Yes, I belive so. The old bot in #debian (dpkg ?) used ~ IIRC. dsmith: Probably just really easy and cheap to only listen to lines with the magic char as prefix. dsmith: The '!' is from bobot. The '{nick}' is from sarahbot. dsmith: srandon111: Almost. Just installed the recent fbsd 13 in vbox, with a mind to try Guile on it, but had other problems so I rm'ed it. dsmith: srandon111: RhodiumToad is a bsd user IIRC wingo: i keep reading "bsd" as "bad" wingo: should get my eyes checked *: davexunit did the same *: RhodiumToad is indeed a freebsd user dsmith-work: wingo: bsd is good! dsmith-work: Back when I was doing consulting, had a thinkpad with flakey hard drive. Would overheat and get read/write errors. dsmith-work: And Windows, Linux, and Fbsd installed. Was a real eye opener how they handled the drive errors. dsmith-work: Windows jus locked up. dsmith-work: Linux was hitting the HD often, and I could not run new procs, but I *could* run things already resident, like staring another Xterm. dsmith-work: FreeBSD didn't blink and eye. When I went to shutdown, it mentioned there were some block it was having a hard time with. dsmith-work: After a while, it apologized that it could *not* write those blocks, and shutdown. veltas: That is very interesting, I have intermittant issues with my hard drive's sata connection and I've seen what you saw on Windows and Linux veltas: But FreeBSD seems to handle that much better than either dsmith-work: Now, this was about 17 years ago. Things have probably changed. veltas: Yes possible they've factored that out, FreeBSD development philosophy and all veltas: Linux handles this gracefully enough, it's Windows that really drops the ball dsmith-work: But was also very impressed with the driver documentation. And how drivers/docs/userland are always in sync. dsmith-work: But I'm just too set in my ways to leave Debian package management. dsmith-work: My new car (haven't had my own car for about 5 years now) https://drive.google.com/file/d/1XrgnBSwAi_VST2h_GWvHStrVxfyY8SnG/view?usp=sharing RhodiumToad: see the "fsyncgate" stuff from a year or two back RhodiumToad: (short version: linux will forget that write errors happened) soda__hobart: holy crap... are there any tricks for catching when you've unintendedly put a variable inside some parens? RhodiumToad: (var) rather than var ? soda__hobart: yup RhodiumToad: obviously if the value of var is a thunk, (var) would be a normal thing to do soda__hobart: it took sooooo long to find it too RhodiumToad: and if it's not a thunk or some applicable object, then (var) would be an error, yes? soda__hobart: yes, "wrong type to apply" error soda__hobart: i need an erroneous pseudo-thunk highlighter i think, haha vbramselaar: Hi there is it possible to supress the auto-compile notes when running "guile -s"? vbramselaar: Im running guile 2.2 btw abralek: dustyweb: Thanks for the respond to my 8sync select issue. the fiber branch works flawlessly =) daviid: wingo: my appologies, commit 19f38a3 fully fixes bug#47084 - i mistakenly thought it didn't, because in my wip-3.0 branch, I forgot to revert my own temporary patch for the re-export-public-interface macro - and the good news is ... G-Golf now works with 3.0! daviid: wingo: this said, it triggers 'new' warnings - like WARNING: (guile-user): imported module (g-golf) overrides core binding `map', for-each' and `connect', i am not sure how to best deal with this problem - hints welcome daviid: so, wrt these 'new warnings' - no such warnings when using guile 2.2 - related to module-use! (you need guile >= 3.0.6.1-19f38a to try) that replace core binding(s), I don't see any possibility to 'prevent' them, and the only way to silent those is to call default-duplicate-binding-handler and remove warn-override-core and warn from the list daviid: here is an example, will paste in a min daviid: https://paste.debian.net/1196087/ wingo: daviid: glad things are working for you :) regarding the warnings, see "Add #:re-export-and-replace argument to `define-module'" in NEWS meo: any reason why I shouldn't override a constructor generated by sfri-9 define-record-type? meo: i have a record of foo bar baz cat, but baz and cat during initialization depend entirely on foo and bar rekado: meo: you can override them. What I normally do, though, is to leave the plain constructor be, don’t export it, and export a ‘smart’ constructor that wraps the plain constructor. *: wingo does the same meo: makes sense meo: is it the convention that record accessor names must mention full record type name? leoprikler: Indeed, that is the convention. leoprikler: but if you have a different convention there is nothing keeping you from using that instead meo: and how does one generally deal with deeply nested structures? my guess would be macros? rekado: for nested structures you may find guile-lens to be of interest rekado: https://gitlab.com/a-sassmannshausen/guile-lens meo: thanks! abralek: Hi, I am trying to test an actor I wrote with 8sync. I created another probe actor to send messages to the main one. A problem I am having is that when I want send a *cleanup* to the main actor (server) from the probe, I am getting a backtrace from 8sync/agenda.scm with (select (#) () () #f #f) abralek: Here is a snippet I wrote https://paste.debian.net/1196108/ abralek: And here the backtrace https://paste.debian.net/1196109/ abralek: Am I doing something wrong here or it's a bug? I kinda see that we not suppose to give closed files to select. abralek: How I could or should properly initiate a graceful shutdown? lampilelo: since streams can be infinite why do they cache all computed values? wouldn't it fill the memory eventually? lampilelo: in the spec there's only one period between words "infinite" and "cached" lampilelo: am i doing doing it wrong if i run into corner cases every time i try something new? leoprikler: lampilelo streams can still be infinite if you discard (and gc) the heads lampilelo: right, what a brainfart davexunit: it would be cool to see a stream implementation that kept the api the same but did some magic under the hood to avoid boxing every single value. too much overhead and garbage. leoprikler: don't you have that boxing as a part of delay/force though? leoprikler: or "pseudo-delay"/"pseudo-force" davexunit: yeah I dunno how to do it but as-is streams are mostly a fun toy that can't be used for anything that needs to perform well davexunit: I bet if you compared them to generators in other languages they wouldn't stack up too well dsmith-work: {appropriate time} Greetings, Guilers dustyweb: hi dustyweb: did (compile ...) disappear from the standard environment? dustyweb: where do I access it from these days? dustyweb: (compile '(+ 1 2) #:from 'scheme #:to 'tree-il) dustyweb: not workin' dustyweb: in 3.0.5 dustyweb: hm, found it through a source grep dustyweb: (use-modules (system base compile)) leoprikler: davexunit: come to think about it, how do they perform compared to generators in Guile? :P lampilelo: test-out-of-memory fails for me on guile 3.0.6, what's up with that? davexunit: dustyweb: try importing (system base compile) ? daviid: wingo: ok, thanks, I was aware of #:re-export-and-replace, but didn't think i had to use it in a module that calls module-use! (my mistake) ... but if i do that in foo, that module-use! (srfi srfi-1) - as an example - and say re==export-and-replace for-each, then a module or a file bar.scm that import foo and calls for-each 'stops' triggering the warning indeed daviid: wingo: the question is how to keep these modules def so users may either use 2.0, 2.2 or 3.0 ... dustyweb: davexunit: yeah, for whatever reason I thought it was in the default environment dustyweb: seems I was wrong ;P davexunit: dustyweb: it may have been. never used it. civodul: lampilelo: hi! test-out-of-memory fails in a non-deterministic fashion it seems civodul: we skip it in Guix for that reason lampilelo: civodul: yeah, it complained it can't finalize a thread or something because it has no memory so i disabled it too to check the rest lampilelo: i guess it's tricky to test memory limits because there's no memory for the test to recover civodul: lampilelo: yes, exactly civodul: well i didn't investigate much, but i suppose that's what happens lampilelo: thanks for confirming i'm not the only one having this issue civodul: wingo: you'll love that one: https://sourceware.org/pipermail/gdb-patches/2021-May/178438.html :-) civodul: wingo: and this one too https://issues.guix.gnu.org/48114#4 (unrelated) civodul: libunistring being too smart dsmith-work: Hey. Where'd the bot go. dsmith-work: Can anyone give me a time when the bot left? dsmith-work: (I don't have join/leave in my scrollback) pkill9: what's the name of the bot? lampilelo: sneek dsmith-work: Ah, sorry. Have a habit of saying "the bot" instead of the "sneek". So the bot doesn't mistake my command for a command. dsmith-work: s/instead of the/instead of the nick/ mrf: hi, can anyone give example on using vector-move-right! I cannot get it to work mrf: I do that and my function fail: mrf: (let ((v1 #(9 8 7 6)) mrf: (v2 #(10 20 30))) mrf: (vector-move-right! v2 0 2 v1 1) mrf: v1 mrf: ) nly: So, i wanna know how you setup a nginx front to a guile server. It's to serve static files. mrf: what wait, you setup web server with scripting language to serve static files? I don't know specifically how to do that but genreally you forward some proxy port of your guile server to nginx which will convert it to some part of your domain in 80 port or something lampilelo: mrf: in this example you're creating immutable vectors and then try to mutate one of them, what you need to do is create a vector not with #(1 2 3) syntax but with (vector 1 2 3) mrf: thinks lampilelo nly: nginx -> static files nly: guile -> the good stuff nly: my communications skills -> sucks :) meo: is it okay to override srfi-9 record constructors? meo: well it certainly does work ArneBab: wisp 1.0.5 released: the language implementation is now explicitly licensed under the expat license (lax license) to make it secure to embed wisp in guile-using games like those made with tsukundere by leoprikler: https://www.draketo.de/software/wisp#orga9852c8 ArneBab: s/secure/safe/ leoprikler: s/safe/legal outside of the GPL :P/ ArneBab: safe as in „you do not have to think about it“ leoprikler: fair enough leoprikler: I think we might want to update guile-wisp with that in mind, but I'll eat now. ArneBab: as long as they do not remove the copyright header from the wisp.scm and spec.scm file, they are safe. (point in case: a German startup recently got flak because they did that) ArneBab: Since they use Guile already, this still favors free licensing, but it removes a stumbling step. I conside that as a strategic step, because there are already many proprietary game engines in use. Replacing them by games that use Guile spreads free licensing. ArneBab: The only risk could be that someone ports wisp to an unfree Scheme implementation, or ports wisp and makes the port proprietary, but having even a single additional game written in wisp using Guile is worth that risk, I think. ArneBab: leoprikler: enjoy lunch :-) daviid: i thought wisp was using the same license as as guile lgpl - daviid: ArneBab: fwiw, i would not take such a risk ArneBab: daviid: the original wisp language implementation is the implementation for a SRFI, so it had to be expat-licensed. The changes since then are pretty small. The surrounding files are GPLv3+ (most of my work over the past years was on examples) ArneBab: daviid: but I well understand not taking that risk, I was also conflicted. ArneBab: daviid: in the ideal case for me, wisp would be included in Guile as a regular supported language, then it would be LGPL and there would be no issue for games that use Guile. Currently games must either add a second dependency or embed wisp. ArneBab: daviid: my previous attempts to get wisp included as supported language in Guile sadly failed, making the embedding of wisp as painless as possible is the second best option. ArneBab: s/is// daviid: yeah, i would not have made it srfi in the first place srfi 'forced' license is a problem, not a solution ... but ... leoprikler: daviid: When we compete against ren'py, I think that fear is probably not warranted. nly: (use-modules (json)) nly: ,apropos json nly: nothing nly: scm->json ;; procedurce stis: Hello guilers! sneek: stis, you have 1 message! sneek: stis, wingo says: tx for report, fixed :) stis: wingo: Great, this enables quite a speedup in python on guile! wingo: if you use prompts for non-local control flow like "break" etc there are quite a number of other optimizations that could be made wingo: like if you can identify an abort for a prompt and it's within the same function, we could wire the abort to the handler wingo: and if that's the case for all aborts for a prompt, the prompt can be elided wingo: etc wingo: haven't implemented those passes yet tho wingo: if we had that and a proper SSA/CPS conversion pass for mutable memory, then we would have a good compiler for more kinds of languages :) leoprikler: C++ in Scheme? wingo: well, anything with that flavor: js, python, c, etc stis: wingo: that would be great. I know that with current prompts we get the same speed in math loops as python and significantly faster without let/ec stis: so we know that those opptimisatoins make a difference for python on guile. Also manumanumanu and I have a tagbody implementation and thiese should be significantly faster with the right optimisatoin pass of the compiler stis: The final step towards getting native scheme speed would be to enable good optimisatoin of boxed variables in some way (python is littered with set! semantics) mwette: imperitive languages are going to hammer on escapes and set! a lot; in nyacc I have a generic module for language translation that is littered with "(primcall make-prompt-tag (const ,tag) ... (prompt #t ,tag ,body ,hdlr) manumanumanu: Well, stis says I have a tagbody implementation, but what he really means is I have a bit of steaming hot mess I wrote when I was still a puppy. I tried it back when we talked about it and it fails on nested tagbodies. avp_: Guile-INI 0.1.0 is out: https://lists.gnu.org/archive/html/guile-user/2021-05/msg00012.html wklew: does anyone know if there's a fix for cond-expand not expanding correctly inside define-library? wklew: https://www.mail-archive.com/bug-guile@gnu.org/msg10146.html wklew: I meant to ask if there's plans to release a fix, a patch was posted in the thread but I haven't tried rebuilding guile wklew: with it applied leoprikler: linas: I'm sure cogserver has a purpose, I just wanted to point you to something else so that you don't need to rely on it "just to have a REPL server". rekado: linas: I don’t understand the “telnet” comment. You don’t need to use telnet to talk to a REPL server. rekado: if you have a test case to demonstrate “crashy” we would be very interested in reproducing the problem. lampilelo: how to get a terminal width in guile when COLUMNS env var is not set? manumanumanu: zzappie: regarding your question: you are trying to display the syntax transformer from the match macro? zzappie: manumanumanu: hello! No actually It was a WAT moment when I was working with g-expressions and guix's shepherd services. Service I wrote was crashing. So I tried to find out whats going on there and noticed some spooky action zzappie: match was a syntax transformer zzappie: I could understand how it would possibly happen zzappie: *coudn't zzappie: same thing wihth response-code from (web response) module zzappie: I could't look code coumpiled by gexps (if its the right wording) because in this particular case I had to deal with .go files zzappie: I posted It here and not in #guix cause I though someone could have a clue ho such thing could happen in guile or maybe already had such experience zzappie: I eventually solved the problem by removing with-imported-modules form and using shepherd-service record's "modules" field. zzappie: but what happend remais a mystery to me zzappie: In short: no, I wanted to understand how (pk match) would possibly output (<#syntax transformer>) rather than throwing syntax error :) RhodiumToad: why would it be a syntax error? zzappie: RhodiumToad: I don't know the answer. But it was my experience with any macro zzappie: try running: guile -c "(begin (use-modules (ice-9 match)) (pk match))" RhodiumToad: yeah *: zzappie thought: shouldt here be a guile bot that evaluates expressions? zzappie: sneek: eval (+ 2 2) pls leoprikler: zzappie: (module-ref (resolve-module '(ice-9 match)) 'match), you're welcome zzappie: leoprikler: ((module-ref (resolve-module '(ice-9 match)) 'match) ...) is not the same as (match ...) right? leoprikler: there's probably a subtle difference zzappie: in case of ((module-ref (resolve-module '(ice-9 match)) 'match) (() 'nill) (_ 'rest)) it will try to evaluate subforms (is this the right word?) and yell at me because of () *: zzappie meant ((module-ref (resolve-module '(ice-9 match)) 'match) '() (() 'nil) (_ 'rest)) leoprikler: yeah, I thought so, because module-ref doesn't actually bind it as syntax zzappie: I guess it's a bug then RhodiumToad: module-ref is giving you the value bound to the symbol RhodiumToad: (which for a macro is a syntax transformer object) zzappie: I for some time thought that syntax if first class in scheme RhodiumToad: which is not the same thing as actually importing the macro into the current scope RhodiumToad: consider that macros have to be known at compile time zzappie: RhodiumToad: yeah: I meant its not guile bug, but guix bug manumanumanu: zzappie: match _is_ a syntax transformer. When used normally you sholdn't see it, but when you are doing macrobatics you can get that kind of thing. manumanumanu: guix g-expressions is probably level 5 macrobatics. manumanumanu: I don't know. I only go up to level 4, and only when intoxicated. zzappie: manumanumanu: haha manumanumanu: zzappie: did you ever see "peak syntax rules" by tailor Campbell? It is the syntactic parameters used by his foof loop implementation. The loop facility is rather WTF, but the syn params part is insane... manumanumanu: Taylor? manumanumanu: yes. Taylor R. Campbell. Amazing stuff. manumanumanu: zzappie: http://mumble.net/~campbell/tmp/foof-loop.scm zzappie: manumanumanu: wow.. I think Im not ready for that just yet :) But I'm adding it to my scheme stuff list avp_: Hello Guilers. Guile-SMC (Guile State Machine Compiler) version 0.1.0 is out: https://lists.gnu.org/archive/html/guile-user/2021-05/msg00000.html wingo: neat! avp_: I think one could implement C code generation from the Guile-SMC internal transition table in the future using this: https://github.com/zenhack/c-ast rlb: Say I need a data structure available during expansion/compilation that is consulted by, and adjusted by the compilation process, and I also need some of the info that was collected to be available at runtime. Is there a typical way to handle that? rlb: I think I know some ways to handle it, but didn't know if there was a common/preferable approach. leoprikler: rlb: syntax-case, just make sure you write whatever data you need into the runtime code leoprikler: it's probably a good idea to filter it mwette: nyacc has a routine `pretty-print-c99' that takes C AST in SXML and generates C code. It is fairly mature. And you can use parse-c99 to generate SXML ASTs from C code. rlb: The issue is that I need to accumulate info over multiple macro calls (calls which consult the accumulating info), and then have some of that info also be available at runtime. One approach perhaps, is to manipulate/consult the "global" data structure from the syntax expanders, and then also have the expansions include code to populate the relevant structure at runtime. avp_: Oh my. Thanks, mwette! rgherdt: hi all! Could some Guile maintainer please take a look at following bug (with solution) and possibly apply the changes? It would make R7RS's define-library work rgherdt: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40252 avp_: Currently I'm more interested in producing FSMs for Scheme world though, but in the future nyacc may come in handy. mwette: I hack on FSMs also, and keep it in Scheme, for the win. Have fun! nckx: Hullo #guilees! Minor quibble: the reversed line numbers add unnecessary surprise: https://paste.debian.net/plainh/0199a8db nckx: But it's such a Schemey thing that it made me laugh so kudos for that. daviid: rlb: what about (eval-when (expand load eval) ...)? civodul: nckx: i think i got used to it! "reverse packtrace notation" it's called rlb: daviid: right, I assume I'll be using eval-when variants as part of the process. *: civodul notes that nckx has a bunch of non-literal format strings at hand nckx: civodul: Don't we all? They're (info (G_ "~x")) calls. civodul: nckx: yes, we all do :-) civodul: i'm used to seeing that warning and it's perfectly legitimate in this case nckx: Sure. civodul: we'd need a way to annotate the thing so the compiler looks at the string inside civodul: or we could express it slightly differently nckx: That's what I was (extremely idly) poking around at when I got distracted by the reverse packtrace notation. 😉 civodul: no big deal though civodul: heh :-) nckx: I gather there's no existing annotation system? nckx: Then I see why everyone just gets used to the warnings. civodul: yeah mwette: What is bad about having non-literal format strings? I get that for C, but for Scheme type values are known at run-time. mwette: s/type values/value types/ wingo: mwette: often is a bug, consider (lambda (x) (format "~a" x)) wingo: also prevents checking that arguments conform to format string (-Wformat) civodul: in C it can be tragic; in Scheme it's a bad-looking run-time error mwette: I'd assume when format string is processed for say ~d you can check arg via (integer? arg). wingo: rgherdt: applied, tx for poke! sneek: Welcome back wingo, you have 1 message! sneek: wingo, civodul says: thanks for the super fast bug fixes! wingo: sneek: late tell stis tx for report, fixed :) sneek: stis, wingo says: tx for report, fixed :) wingo: ah you are here :) wingo: daviid: also fixed the (lambda ( . args) ...) thing, was a bug in the new read-syntax wingo: sneek: late tell stis tx for report, fixed :) rgherdt: wingo: awesome, many thanks sneek: stis, wingo says: tx for report, fixed :) wingo: weird, stis is not actually here afaics? wingo: odd behavior wingo: sneek: later tell stis tx for report, fixed :) sneek: Got it. wingo: ah just a typo on my side then RhodiumToad: wingo: did you get the mini-gmp thing? wingo: ah no not yet, tx for reminder *: wingo looks RhodiumToad: https://dpaste.org/kvZP RhodiumToad: without that it fails to compile if HAVE_CONFIG_H is defined wingo: RhodiumToad: i just tried the tarball and it just works here if i --enable-mini-gmp wingo: what could be the difference in our systems? RhodiumToad: HAVE_CONFIG_H wingo: you explicitly define HAVE_CONFIG_H in your cflags? RhodiumToad: no RhodiumToad: I'm on freebsd, presumably configure is setting it *: civodul built it with --enable-mini-gmp in Guix too civodul: wingo: i got around to fixing the -Wunbound-variable issue at https://issues.guix.gnu.org/47031 RhodiumToad: another possible difference is whether it's using the lib/unistd.h rather than the system one daviid: wingo: hello. did you read the feeback i posted here, wrt the fix for #47084, with a debian paste (that expired now ... i can posted again, answer #47084, or opening a 'new' bug report ... that was the feedback and following quiz ... wingo: daviid: sorry all i got out of it was the (lambda ( . args) ...) issue wingo: if there is another problem please let me know RhodiumToad: the error is #error "Please include config.h first." civodul: RhodiumToad: the change you pasted above makes sense to me civodul: otherwise there could be mismatches wingo: RhodiumToad: yeah i don't doubt that such a clause might be needed but i didn't know why it worked here civodul: like you include Gnulib's , but it thinks is needed RhodiumToad: every other file has that conditional block in it, it's just missing from mini-gmp wingo: ok great will add that then civodul: could be that on GNU/Linux we don't use much of Gnulib's header, so it doesn't make any difference RhodiumToad: does the lib/ stuff even get used on linux? civodul: some of it, but not much i guess wingo: RhodiumToad: fixed wingo: civodul: great! (re -Wunbound-variable issue) RhodiumToad: LGTM daviid: wingo: yes there is another problem: the fix fixes the example, the mdule (a) that is in #47084 - however, it doesn't fix dynamic expected functionality of module-use! - that is if the public interface of a module that has been module-used! evolve 'in time', those who module-use! don't see the new bindings, unlike 2.2 - let me paste again, in a few min, i need to reconstruct the paste (which expired) *: wingo zzz daviid: ok, good night daviid: wingo: if you catch this before to go to bed, so you dream about a solution :):) - https://paste.debian.net/1195962/ - this feeback depends on g-golf, but i'll build an example/snipset that doesn't and answer in #47084 - good night again daviid: i pulled the fixes, so now the error tells me where/what, i see the following raises the exception - (define (foo bar) (lambda ( . args) ... )) -> invalid argument list in subform args of args davexunit: I sort of have a basic tree shaker working. something is wrong, though. seems like there may be some things that are needed that don't show up when walking the module tree. davexunit: "Unbound variable: read-syntax" uh oh davexunit: the big issue though is "class not found " when loading goops. davexunit: not really sure how this magic happens. davexunit: the good news is that this approach seems promising. the resulting bundle is 41MB smaller than my original that includes everything. davexunit: a-ha, goops.c iterates over each smob and makes a class. the SCM_SMOBNAME macro fetches the name, so there's no explicit reference to dynamic-object here. davexunit: I'm curious what my bundle is missing that there is no dynamic object smob type flatwhatson: ./module/oop/goops.scm-3315-;; used to be a SMOB type, albeit not exported even to flatwhatson: ./module/oop/goops.scm-3316-;; C. However now it's a record type, though still private. Cross our flatwhatson: ./module/oop/goops.scm-3317-;; fingers that nobody is using it in anger! flatwhatson: ./module/oop/goops.scm:3318:(define flatwhatson: You must be shaking that tree a little too angrily? davexunit: I think I know the issue. davexunit: I think I've mixed things up between two different builds of guile that I have. davexunit: and that recent change around how the class is created is causing problems. davexunit: got it working. :) davexunit: a few quirks, but pretty cool. davexunit: bundle size reduced by 39MB. davexunit: tarball download size reduced by 8MB davexunit: I'm happy. jackhill: Pattern mathcing question: Using this match '(match '(quote ("a" "b" "c")) ((quote (a _ c) ...) (list a c)))' results in (("a") ("c")). jackhill: Instead, I would like the rusult ("a" "c"). What do I need to change? I feel like I'm missing something about how quoting or pattern matching work (or both!) jackhill: Aha! I get it: (match '(quote ("a" "b" "c") (d e f)) ((quote (a _ c) _ ...) (list a c))) is what I want jackhill: I think :) daviid: this is not allowed in 3.0.6 anymore - (define (foo bar) (lambda ( . args) (apply + args))) - just a tiny example to illustrate a similar, though 'real' and quite more complex 'need' in g-golf ... daviid: wingo: ^^ daviid: ah, i need to change the call for (define (foo bar) (lambda args (apply + args))), sorry for the noise ... daviid: wingo: quick feedback - commit 19f38a3 fixes the example given in #47084, as you probably did try, but here is a mini session https://paste.debian.net/1195743/ daviid: wingo: however, it does not solve the 'Fwiw: (a)', that is, the public interface of a module that has been 'module-used', in 3.0.6 (unlike 2.2) may not evolve in time (at the 'essence' of any GI dynamic binding) daviid: here is a concrete example daviid: wingo: here https://paste.debian.net/1195745/ daviid: this is to give you a quick feedback, it needs g-golf, but i will produce an example that does not depend on g-golf ... shall i answer #47084, or do you prefer to close it and reopen a more specific bug report for this ... lmk flatwhatson: Is this a sensible thing to do: flatwhatson: (define* (bytevector-slice bv start #:optional (count (- (bytevector-length bv) start))) flatwhatson: "Return a bytevector referencing COUNT bytes of BV from index START." flatwhatson: (pointer->bytevector (bytevector->pointer bv) count start)) flatwhatson: To avoid unnecessary copying of subsets of bytevectors? flatwhatson: Will the gc get confused if this is my only live reference to that buffer? manumanumanu: stis: hej! manumanumanu: flatwhatson: good question. You could probably try it in a repl... stis: manumanumanu: tjena! manumanumanu: flatwhatson: so, I created a bytevector, went through the pointer->bytevector dance, made sure the original bytevector wasn't reachable. generated a lot of garbage, ran the GC a couple of times. No use after free, at least :) manumanumanu: Whether it is more efficient than a copy is another matter. manumanumanu: stis: are there any problems with python-on-guile for 3.0.5? manumanumanu: I am getting weird errors with the guix packages stis: I think so, i'm on bleeding edge guile and needed to modify python on guile stis: manumanumanu: : ^^ manumanumanu: ah, ok. manumanumanu: Even so, I am getting some things running stis: ok cool manumanumanu: I am looking forward to seeing if I can help with the for macros! How would you go about getting the scheme output of a file? manumanumanu: compiling a .py -> .scm stis: ther is a python script ... stis: python file.py stis: should copile and run file.py stis: then there is an output file in log.txt stis: where you can find output code and for example clip int into a guile sesion and expand the macros stis: then you can try spot errors manumanumanu: great! manumanumanu: haha, the guix package shadows my python installation manumanumanu: nothing died yet! stis: yea we should so something about that stis: I use python for python on guile and python3 for Cpython3 manumanumanu: Just to non-humble-brag: I feel like a king! I have managed to morph something spiritually based on andy's fectors into something that just passed the first RRB-tree test! I can now drop elements in amortizied O(1) instead of O(n) like regular fectors. Next up is O(logN) concatenation and insertion :D manumanumanu: not only that, as long as you have done no splits or concatenations, these extra features have no cost stis: lovely allana: Hi Guile. I'm quite new to scheme and I am trying to learn some things here and there. I have a question, is this idiomatic scheme? https://paste.debian.net/1195759/ stis: allana: as a guile scheme itis ok I think! stis: be careful with define though stis: (define n (f n)) is not the same as (let ((n (f n))) ...) i think stis: that's bitten me a couple of times stis: in this case do not reuse n or use let allana: stis: thanks taw10: Might be able to make it a bit more succinct sing call-with-port? manumanumanu: allana: I would probably have use let* instead of (let (...) (define ...)) in that case. And the variable _ is generally not something I would use like that. I is mostly used as a marker for "ignore this" in macros and such taw10: using* manumanumanu: isn't call-with-port very new? How bout (with-input-from-file ...)? allana: manumanumanu: Thanks, this looks like what I would have liked to use. Coming from Python with-input-from-file sounds very familiar. allana: I'm mostly just poking around here and there in my free time. Thanks everyone! manumanumanu: allana: the ports system is something that takes some getting used to. (with-input-from-file path body ...) will bind (current-input-port) to the port pointing to the file at path. Any reading operation within "the dynamic extent" (meaning any code running in the body) that doesn't bother with changing (current-input-port) will read from the file manumanumanu: even functions called by functions called by the body in totally unrelated places. It just means "bind standard input to this file port for all the code in this code block". manumanumanu: allana: it is always nice to see people curious with scheme! allana: It's guix. I am bothered by the fact that I don't understand scheme well enough to fully customize my own machine. So now I am trying to learn guile/scheme and potentially start using it at work when it makes sense. leoprikler: allana: the python "with open()" statement is actually implemented as call-with-{input,output}-file allana: leoprikler: cool jlicht: I finally received my copy of "Software Design for Flexibility", anybody working through it in guile? davexunit: I got a working tree shaker prototype. in addition to including all of the modules in use, I had to also include a bunch of ice-9 source files that aren't modules that I wasn't expecting. davexunit: eval.scm, i18n.scm, posix.scm, psyntax-pp.scm, quasisyntax.scm, match.upstream.scm, networking.scm, r6rs-libraries.scm, and r7rs-libraries.scm davexunit: I guess there are still things I don't understand about how guile does things. civodul: davexunit: neat! that could be interesting for Guix too, for instance for the initrd davexunit: for instance, ice-9/match.scm is basically a shim and calls (include-from-path "ice-9/match.upstream.scm") civodul: (did you know? if you use Guix System, your initrd includes an elisp and an ecmascript frontend) davexunit: there is no associated .go file for this source file. davexunit: civodul: lol I have thought about this before civodul: ah yes, these can be hard to deal with davexunit: I wouldn't have expected the compiled module to need this source file davexunit: does the compiled file included the compiled version of match.upstream.scm? davexunit: I can't imagine we are evaling the pattern matcher every time we load it civodul: i don't know, it's weird that this file's needed civodul: i think we should be able to have configurations without source files, too davexunit: like binary only distribution? yes I agree civodul: yes, at least for cases where disk space matters (initrd, game jam, etc.) civodul: for match and other expansion-time modules, i'd also love to have R6-style phases davexunit: it's not a significant contributor to disk space in my case (3.9MB currently of 78MB) but it would be nice to slim down as much as possible. civodul: yeah davexunit: the compiled modules take up 37MB currently davexunit: but ditching the source would be nice davexunit: a more robust tree shaker would have to do static analysis to identify include-from-path calls, as well as @ and @@ usage. civodul: yeah davexunit: I got bit by an @ usage somewhere. it was in one of my own projects so I just changed the code to not use it. civodul: you can have a convention to not use it davexunit: buuuut if we had binary-only distribution we wouldn't need static analysis davexunit: for my own purposes I'm inclined to just live with these caveats. civodul: you still need to determine which .go files are needed? davexunit: civodul: yes, that *mostly* corresponds to which modules are loaded. except for ice-9, of course. ;) civodul: BTW, Guix has source-module-closure, which maybe is kinda similar to what you're doing? civodul: heh davexunit: I should check it out and compare davexunit: but here's another oddity with ice-9 that I don't yet understand. davexunit: there's posix.scm and posix.go, eval.scm and eval.go, but there's quasisyntax.scm but no quasisyntax.go davexunit: I had originally assumed that every .scm would have a corresponding .go but quasisyntax broke that assumption davexunit: I'm sure there's a reason but guile is a bit mysterious to me in its early boot state davexunit: but it's not a big deal to say "ice-9 is special" and add special accomodations for it since it's core stuff that everything needs. RhodiumToad: davexunit: some of the .scm files may be included into others rather than being a module unto themselves RhodiumToad: I noticed that with read.scm (which is just included into boot-9) davexunit: RhodiumToad: yes, that is what is happening. davexunit: I was just surprised that they were still needed when loading compiled modules davexunit: oops, somehow didn't notice that there was a libguile-3.0.a file hanging around. don't need that! that freed up 16MB right there. RhodiumToad: I guess that if x.scm includes y.scm, then checking whether x.go is current should check both .scm file dates RhodiumToad: (whether it does check or not I don't know) davexunit: yeah something like that. not sure the exact process. davexunit: my binary bundle is now 17MB compressed and 60MB uncompressed. big reduction from my initial version which was 29MB compressed and 120MB uncompressed. davexunit: need to stop now but this is promising. the tricky part is now turning this into a tool that can automate building the bundle. besides the tree shaking bit, I've been deleting files by hand to reach the minimal distribution. dsmith-work: Happy Friday, Guilers!! zzappie: hello! zzappie: Anyone has a clue in which situation (pk match) could ouput (<#syntax transfomer match>)?? linas: breakpoints/repl shells deep in scheme code? How? Deep inside my code, I'd like to just get a repl, poke around, hit ctrl-D and have it resume processing where it left off ... how? linas: I guess I could do a recursive (eval (read)) or something like that ... linas: this gives a hint of what I want to do: (define (break) linas: (let ((input (read))) linas: (unless (eq? '. input) linas: (eval input (interaction-environment)) linas: (break)))) linas: (define (do-stuff) linas: (define x 42) linas: (format #t "start\n") linas: (break) linas: (format #t "end\n")) linas: If I run (do-stuff) and the enter (format #t "It is ~A\n" x) I expect to see "It is 42" but I get "unbound variable" instead... linas: ahh ,mabye I should use `local-eval` and `the-environment`? Hmm. rekado_: linas: you could start a REPL server rekado_: I like to use call-with-error-handling from (system repl error-handling) to spawn a REPL on errors linas: and then telnet into it? linas: It's not that I have errors, its that I'm deep in some nested map/fold/filter and want to stop and poke around and see what's been set in that environment. .. and then continue processing... linas: FYI, I was able to crete what I needed but it needed some elbow grease. I'ts below. I'm surprised this is not a standard guile utility that search engines latch onto ... linas: (define (break env) linas: (let ((input (readline "yo duude> "))) linas: (unless (or (eq? '. input) (eof-object? input)) linas: (catch #t (lambda () linas: (define sexpr (call-with-input-string input read)) linas: (format #t "~A\n" (local-eval sexpr env))) linas: (lambda (key . args) linas: (format #t "Oh no, Mr. Bill: ~A ~A\n" key args) linas: *unspecified*)) linas: (break env)))) linas: (define (do-stuff) linas: (define x 42) linas: (format #t "start\n") linas: (define env (the-environment)) linas: (break env) linas: (format #t "end\n")) linas: (define (bogo) (define y 56) (do-stuff)) linas: with the above, both x and y at the prompt print the right thing. linas: and ctrl-D exits this pseudo-repl with execution resuming where it last left off. leoprikler: linas there are probably more elegant ways of spawning a repl, but yeah, that works linas: I'm a meatball coder. if there's some example web page or doc, tell me what search term to use leoprikler: I don't know how well it's documented, but there is start-repl and a repl server. linas: leoprikler the repl server is just a telnet server. It won't halt execution deep in the middle of some code, and let you poke around. leoprikler: that is correct, because the repl server is designed to run next to your code linas: (and worse, the guile repl server is crashy and slow; I have a super-whizzy telnet repl server that is super-fast and not crashy, and use that in production.) leoprikler: You might want to contribute your fast and not crashy telnet server to Guile at some point then :) linas: eh, its written in C++, with nasty ugly async i/o in it and a bunch of other weird custom stuff. linas: I could point you at it, but it would be a major chore to make it nice enough for ludo to not puke on it (its in github, opencog/cogserver repo) leoprikler: Hmm, I think for a purely guile-based repl-server there is a fiber variant, perhaps that works better? linas: right, I did hear about fibers; I have not tried them or anything built on them. linas: For generic repl, I cannot abandon the cogserver, since it needs to handle megabytes/second of s-expressions, most of which don't actually need to ever hit the guile evaluator. Like I said. it's weird. It also does python :-) for all the python lovers out there. zzappie: sneek: botsnack sneek: :) rekado_: I often wish match-lambda could deal with more than one argument rekado_: this would make fold + match-lambda possible, which is really nice for structured accumulators davexunit: rekado_: match-lambda* ? rekado_: … that exists? *: rekado_ checks davexunit: yup davexunit: (fold (match-lambda* ((n sum) (+ sum n))) 0 '(1 2 3)) rekado_: poifect! rekado_: just what I wanted! rekado_: thank you davexunit: np rekado_: (has this only recently been documented…?) davexunit: yeah davexunit: when I learned about them they weren't mentioned in the manual davexunit: I just happened to be perusing the source poww0wmus1c: Can you have output parameters in Guile/Lisp? RhodiumToad: no RhodiumToad: assuming I understand what you meant correctly poww0wmus1c: Like: (define (foo x y) ...) and I want to set x or y from within foo. RhodiumToad: you can mutate the things that were passed as x and y, if they are mutable (many things aren't), but you can't change what the caller's variables refer to OrangeShark: You can with srfi box RhodiumToad: the caller can pass a box, yes daviid: i think guile has parameters, iirc :), guile-cv uses them] OrangeShark: see srfi-111 for box RhodiumToad: basically, if the caller does (let ((x 123)) (foo x) x) the result will always be 123, assuming foo is a function and not a macro RhodiumToad: unless I'm badly misunderstanding something daviid: make-parameter, parameterize ... RhodiumToad: poww0wmus1c: so the real question is why do you want to do this? poww0wmus1c: I have an exception handler to which I'm passing variables that I want to reset to a good state. poww0wmus1c: I guess box could work RhodiumToad: that sounds like those variables maybe ought to be parameters? RhodiumToad: are they local? lampilelo: can't you redesign to use dynamic-wind or something? poww0wmus1c: RhodiumToad: practically, yeah RhodiumToad: parameters (and the fluids they are based on) are automatically reset on exceptions or other nonlocal control transfers poww0wmus1c: lampilelo: maybe, I'm not familiar with dynamic-wind. :) RhodiumToad: parameters are simpler poww0wmus1c: RhodiumToad: what if I need a more involved reset? Like one of the variables is an SDL window. I want to recreate it. RhodiumToad: confirmed that --enable-mini-gmp is broken - minigmp.c is missing its include of RhodiumToad: poww0wmus1c: wouldn't you usually define the exception handler inline such that it has access to the variables anyway? poww0wmus1c: I'm a very unusual programmer :P poww0wmus1c: But yes, maybe I'm solving the wrong problem here. I'm not sure these need to be parameters. RhodiumToad: sneek: botsnack sneek: :) RhodiumToad: sneek: later tell wingo, build fails with --enable-mini-gmp due to missing include in mini-gmp.c sneek: Got it. daviid: i just did git pull - which implies to merge the local patch of ice-9 boot-9 - then the autogen/configure/make/install danse, then guile version tells me 3.0.5.173-5b4a9 - i was expecting 3.0.6.xxx, did i kiss a step or 'something' daviid: *miss a step (sorry i miss typed k instead of m ...) daviid: the installed version has the ix duplicates handlers for interfaces that use interfaces patch though so i guess i am ok to try daviid: hum, i had a strange error report compiling g-golf, the (g-golg hl-api function) module, so i decided to clone a fresh master, run the autotool danse, installed, and checked the version is now correct, then did a clean and fresh attempt to compile g-golf, but it raises the same strange error, which paste daviid: wingo: after a fresh clone, attempt to compile g-golf raises an exception, but the report is so strange that i can't figure out what causes the exception in the first place - here is a paste, including the last bit of the configure step, so you see it picks guile-3.0, then compile a fair amount of the g-golf project, nearly to the end actually, but fails with this 'strange' error msg trying to compile (g-golf hl-api function) module - daviid: https://paste.debian.net/1195617/ wingo: daviid: fwiw there is an issue regarding syntax-error which civodul found overnight sneek: wingo, you have 1 message! sneek: wingo, RhodiumToad says: build fails with --enable-mini-gmp due to missing include in mini-gmp.c wingo: might have to re-roll a 3.0.7 daviid: ah ok daviid: i have to go to bed, it's been a very long day ... be baack tomorow ... daviid: tx wingo: civodul: re syntax-error, probably something that should make us roll a 3.0.7 soon wingo: wdyt manumanumanu: I am seeing no problems with 3.0.6. No slowdowns for compilation. One 50% speedup out of the blue, probably due to the compilation unit arity check thingie :) civodul: wingo: the fact that syntax-error exceptions show vectors instead of alists? sneek: civodul, you have 1 message! sneek: civodul, bone-baboon says: Thank you. Your questions and strace suggestion where enough to help me solve the error with reconfiguring. It was user error on my part. A typo in a file path that `with-input-from-file` was looking for. wingo: civodul: yeah civodul: yes, could be civodul: i wasn't sure if it was intended wingo: is an unintended change certainly civodul: for the record, here are the changes i needed to make: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=524c9800afb433cc474132185d8e37f72004adb3 civodul: for syntax-error + read-error civodul: also: https://issues.guix.gnu.org/48089 civodul: but yeah, the syntax-error change is user-visible wingo: if you send me some failing unit tests, i can fix the bugs :) civodul: alright! :-) vbramselaar: Hi there, would it be possible to run something like https://orgmode.org/worg/dev/org-element-api.html in guile without Emacs? for parsing org files? vbramselaar: I saw that guile has some elisp support zzappie: vbramselaar: From my experience org-mode code is very dependent on emacs envifonment vbramselaar: yhea it seems like it, does guile not translate things like: (current-buffer) or (set-buffer)? zzappie: vbramselaar: never tried it. But that would be cool manumanumanu: vbramselaar: the thing is, a lot of emacs is written in C. Even a lot of elisp functions. The work that was done on elisp was done with a clear intention of running guile together with emacs, and a lot of the functionality is simply not there when running it standalone manumanumanu: I remember trying to get this across to some guy who wrote the "guile elisp sucks" post that was making rounds a year ago or so. vbramselaar: manumanumanu: Yhea I understand it now. I was mostly looking around for possibilities for running elisp without Emacs. vbramselaar: like when you want to make a different application and parse org files vbramselaar: could write a parser yourself or use org-element zzappie: vbramselaar: I once stumbled upon org-mode parser in guile zzappie: I tried to look for it now but cannot find it. It was on github manumanumanu: What guile-emacs would have become (and it probably wont) would have been cool. Imagine having all the elisp runtime outside of emacs! The utilities one could write for org files, yet have it work exactly like emacs :D vbramselaar: zzappie: Thanks anyway for looking around vbramselaar: manumanumanu: yhea true, there a couple of other libraries for parsing org-mode, but would be nice to stay as close as possible to the creators of the org-mode standard ofcource. zzappie: emacs -Q --script do-things-with-org.el # is probably the best at the moment vbramselaar: but hey this is also a option: https://orgmode.org/tools.html vbramselaar: zzappie: yhea true, tbh I wanted to have a parser for on android to experiment with vbramselaar: zzappie: getting emacs on there seems hard zzappie: oh ah i see :) vbramselaar: but anyway thanks for the help guys zzappie: vbramselaar: i don't see any links in the topic but I think this channel encourages people to address people in gender neutral ways (people/guilers/yall/etc...). Just letting you know :) flatwhatson: vbramselaar: This is some recent discussion about an org grammar: https://lists.gnu.org/archive/html/emacs-orgmode/2021-04/msg00382.html flatwhatson: which references this: https://github.com/tgbugs/laundry civodul: oh nice civodul: we should steal it :-) civodul: wingo's Guile-Present has an Org parser, but maybe it's more limited wingo: it's reallllly old and prolly buggy civodul: heh leoprikler: w.r.t. Guile Elisp, I can understand that not all functions are implemented, but missing language features is ehhhhhhh civodul: take it as an invitation to fill the gaps :-) wingo: :) wingo: there was a branch that still needed to be merged, right? wingo: perhaps terpri will remember leoprikler: btw. did 45131 make it into 3.0.6? wingo: leoprikler: no but it should make 3.0.7 :) rekado: wingo: this one perhaps: https://git.elephly.net/?p=software/guile.git;a=shortlog;h=refs/heads/wip-elisp rekado: it’s the rebased wip-elisp branch rekado: it’s also far behind, but less so than the original wip-elisp branch :) stis: sneek: where is bugs stis: sneek: botsnack sneek: :) stis: sneek: where is debugs tohoyn: sneek: botsnack sneek: :) dsmith: Hey dsmith: sneek: bugs? sneek: I could be wrong, but bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile dsmith: About the difference between emacs-lisp the language and emacs the application: dsmith: Consider javascript. Nodejs doesn't have all the functions and features that are in a browser, right? Like dom stuff? dsmith: I don't do js (much), so maybe I'm wrong. abcdw: Can I post to this channel? abcdw: Oh, seems, it works again) abcdw: Is there a way to get values of environment variables exported by a shell script? Something like source or . command in Bash. Something like (source-env "./bashrc") dsmith: abcdw: Are you asking can Guile parse and read shell syntax? abcdw: dsmith: yep, kind of. Or maybe run external shell process and read variables that it will export. dsmith: abcdw: Nope. not out-of-the-box anyway. If using an external process, the variables would only be in that other process (and child procs of it). zzappie: I think gash can do it. Or at leas it has --parse flag dsmith: Shell source and . must be in the current process. zzappie: it spits out sexpressions abcdw: zzappie: thank you for the idea! dsmith: zzappie: Ah cool zzappie: I didn't use it but I think its in (gash parser) flatwhatson: you could cobble something together to run your script, then run env, and parse that output flatwhatson: to be super fancy you could run env before and after to calculate the diff abcdw: flatwhatson: Yep, that's idea I got in my head, when I wrote a question, looks like a viable solution. Thank you. abcdw: Thank you everyone for help! *: zzappie finds himself exiting bash with ,q civodul: :-) lampilelo: lol brendyyn: i watch to match a value after a value in a lis but this says dotted tail is not allowed after ellipsis (match '(1 2 #:tests? bleh 3 4 5) [(a ... '#:tests? foo . z) foo] dsmith-work: Morning Greetings, Guilers davexunit: brendyyn: I don't think it's possible. you can't use a dotted tail after an ellipsis nor can you use multiple ellipsis patterns at the same level. using a loop and searching smaller and smaller lists would be my recommendation. zzappie: hey anyone knows is there a like (nested-ref '((a . (b . (c . hello!)))) 'a 'b 'c) ;; $1=hello! zzappie: already defined somewhere? zzappie: s/a like/something like/ davexunit: zzappie: not in guile core, no. I've had to write my own a few times. zzappie: davexunit: ha. It must be reimplemented in many programs dealing with json then :) leoprikler: oh, there is something akin to that in sxml leoprikler: but it might not suit your needs otherwise leoprikler: That reminds me, perhaps I ought to consider sxml as data storage for Tsukundere, would be fun. leoprikler: rewriting scenes using pre-post-order zzappie: problem with sxml is that you only remember about sxml when you dealing with xmls leoprikler: yep zzappie: but there is a lot of useful general purpose stuf like foldt leoprikler: I wish sneek had a "tell me in six months or so" function. dsmith-work: heh leoprikler: sneek later ask ArneBab with the new licensing changes, is there a way of constructing a "wisp-minimal" package, that is effectively expat-licensed? sneek: Okay. ArneBab: leoprikler: yes sneek: Welcome back ArneBab, you have 1 message! sneek: ArneBab, leoprikler says: with the new licensing changes, is there a way of constructing a "wisp-minimal" package, that is effectively expat-licensed? ArneBab: leoprikler: yes, I think it’s pretty easy to create a wisp that is expat licensed stis: hey wingo: did you see the compiler bug I found? wingo: heyoo leoprikler: ArneBab: Does wisp internally use invalidate-compilation-cache? davexunit: has anyone ever written a tree shaker for guile programs? until we get native executables, I'd like a way to create binary bundles that contain the minimal number of guile modules needed to run. leoprikler: Tree shaker? davexunit: leoprikler: "tree shaking is a dead code elimination technique" https://en.wikipedia.org/wiki/Tree_shaking leoprikler: Hmm, with guile being a reflective language, I think I can easily write code that shakes your tree shaker. davexunit: huh? leoprikler: shakes as in confused leoprikler: confuses davexunit: I'm not looking for a robust solution. simply booting the program and getting a list of all loaded modules will be sufficient. davexunit: I'm not sure if there's a public api for seeing all of the loaded modules, though. davexunit: haven't spotted one, yet. cybersyn: are native executeables on the guile roadmap? davexunit: yes. cybersyn: nice! that will be pretty sweet. davexunit: many enhancements over the years have been paving the way to eventually make it happen. leoprikler: ArneBab: please have a look at https://gitlab.com/leoprikler/tsukundere/-/tree/wisp-packaging from both a functional and a licensing side :) davexunit: JIT compilation is a big one leoprikler: davexunit: there is module-submodules leoprikler: so you only need to get the top module and then recurse down leoprikler: (assuming your app does not resolve-module at runtime) davexunit: I don't think module-submodules will cut it. leoprikler: well it would if you could access the root module leoprikler: but it seems you can't davexunit: guile is maintaining a list of everything that has been loaded somewhere leoprikler: look at resolve-module, that's where the magic happens wingo: davexunit: never done that. how would you deal with dependencies like libffi ? wingo: there is certainly an api for seeing all loaded modules, read in ice-9/boot-9.scm leoprikler: wingo, where exactly, i can't see it leoprikler: boot-9 can see all modules, but I don't think an outsider can wingo: hooo, everything in boot-9 is public api for better or for worse wingo: i mean we treat it that way when it comes to api / abi compat leoprikler: or to be more precise, I don't think anything but resolve-module can, can it? wingo: module-submodules wingo: ah you refer to "root" being in the closure of resolve-module wingo: humm! leoprikler: yep and resolve-module '() errors out davexunit: wingo: you mean C shared libraries? that's out of scope for what I'm doing. I know what libs I need. leoprikler: I think the abi-compatible way of handling that would be to hand out the root module when given the empty list, but that feels weird davexunit: I just want to slim down the bundle I'm shipping. the compiled guile modules and source files take up most of the space. davexunit: so if I had a way of confidently knowing which I can remove I'd end up with a much slimmer product. leoprikler: Hmm leoprikler: You could do the following: leoprikler: Start from your app module and go up the module-uses leoprikler: if it never appears in the uses chances are it's never used davexunit: wingo: like if I inspect some modules for their dependencies will I see the boot-9 module in there somewhere? leoprikler: That way you don't need to infer everything that's loaded davexunit: I'm surprised there isn't a global table of loaded modules. I mean maybe there is and it's just not accessible. leoprikler: No direct table and not accessible. leoprikler: it's similar to an fs-path really davexunit: yeah then trying this is just going to be a waste of time davexunit: if I can't answer "what modules are currently loaded?" then that's a blocker right there. civodul: davexunit: you can definitely do that via boot-9 APIs civodul: module-submodules, the "obarray", things like that civodul: it's probably not documented though :-) davexunit: maybe I'm just not caling module-submodules with the right args davexunit: I keep getting empty hash tables davexunit: for things I know include other modules civodul: at yes, this one: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/ui.scm#n272 civodul: it traverses currently loaded modules without loading anything more wingo: leoprikler: (resolve-module '() #f) davexunit: should have known there would be magic guix code for this davexunit: hell yeah (module-submodules (resolve-module '() #f #f #:ensure #f)) davexunit: thanks civodul civodul: yw! civodul: it's one of the rare parts of Guile that hasn't changed much since 1996 civodul: submodules did change a few years ago wingo: because it used to be that if you did (define-module (a)) (define b 42) you couldn't then (define-module (a b)) wingo: because bindings in a module and modules themselves shared a namespace wingo: turrible civodul: yes, that was a lot of fun civodul: thanks for fixing it :-) wingo: hehe :) davexunit: there's lots of modules like (#{ g114}#) that show up. davexunit: I guess those can just be ignored davexunit: anything that doesn't map to a file on guile's load path can be ignored civodul: right, you can check module-filename i think davexunit: yup davexunit: this is nice wingo: haha that is the reaction of someone with lowered standards ;) wingo: "this is nice, you just have to be really careful about what you ask for" ;-) davexunit: haha civodul: true :-) davexunit: I'm cool with it wingo: ok so we will roll a 3.0.7 soonish so if you have hotfixes you want in, commit them or poke a committer *: wingo zzz wingo: (do ask for feedback if you need it, of course) davexunit: did a bug happen in 3.0.6? RhodiumToad: at least two of them RhodiumToad: wingo: you saw the thing about mini-gmp? stis: wingo: checkout bug 48098, kind of annoying. Probably you can fix it quickly. ArneBab: leoprikler: I don’t think wisp uses invalidate-compilation-cache. Should it do that? ArneBab: leoprikler: from the licensing I’ll need to check what remains civodul: sneek: later tell wingo thanks for the super fast bug fixes! sneek: Got it. *: davexunit has a working module collector thingy davexunit: now to hook this up to bundle generation ArneBab: leoprikler: there are 4 changes aside from the emacs mode that are not by me (to the Makefile and the README). I’m checking whether these could be released under the expat license, too, to make embedding in Games easier (similar to gcc exceptions). lampilelo: i have two patches if anyone's willing to take a look: one for readline's filename completion (bug #45339) and the second one that got into upstream srfi-64 ref implementation and fixes some stuff i complained about recently ArneBab: leoprikler: how do you run your guix recipy? ArneBab: recipe? leoprikler: changing the last line to the package i want and running guix build -f leoprikler: ArneBab: 👆️ for wisp-minimal only that's "wisp-minimal" at the end of the file ArneBab: ah, with build ArneBab: I tried guix environment --load=guix.scm --ad-hoc, but that didn’t work cybersyn: heya guilers, anyone with experience with Go care to share how guile fibers sizes up? any significant dis/advantages? freeguy: hi freeguy: i have question freeguy: can i use guile(without c) for high performance software development. freeguy: please send me email freeguy: bye daviid: sneek: seen spk121 sneek: zzappie?, pretty sure was seen in #guile one day and 3 hours ago, saying: its pretty -- easy you can inherit package and specify patch file. wingo: guile 3.0.6 release is out -- https://www.gnu.org/software/guile/news/gnu-guile-306-released.html wingo: new docs: https://www.gnu.org/software/guile/manual/html_node/Foreign-Libraries.html wingo: https://www.gnu.org/software/guile/manual/html_node/Annotated-Scheme-Read.html leoprikler: wingo: typo in Foreign-Libraries, [#:rename-on-cygwin?=#t] is on an extra line wingo: tx :) terpri: read-syntax is really cool! the inherent limitations of source-properties always bugged me (more in theory than practice, of course) wingo: 3> wingo: er wingo: <3 :) ennoausberlin: Hello. I am trying to write a mron job using scheme. Can you tell me, how to debug these scripts. If I start mcron and something is wrong in the script I just get Cannot read files in your ~/.config/cron directory but no further output of the error itself ennoausberlin: I read the little schemer and I ran guix on some of my machines, but programming and especially debugging in scheme is still a challenge for me zzappie: ennoausberlin: I don't use mcron but I can give some tips on debugging in general. Probaby most common thing guilers do is (pk body). It will output value of body and the whole experssion evaluates to body's value as well. So you can wrap things there and there without changing program's logic leoprikler: call-with-trace is also useful zzappie: If the output is lost you can additionally wrap with (with-output-to-file "/file" ...) zzappie: I think there is also a posibility to start repl on error connect to a process with telnet or geiser zzappie: but I've never done it :) its in (system repl) or something like that zzappie: there you could use debugging metacommands (use ,help debug to find out more) zzappie: but in general I also find debugging in repl chalenging because stack trace gives me very vague idea where am I in the source code ennoausberlin: Thank you for your advice, but I guess mcron stops at parse time, not run-time. I probably have to start a repl and import all mcron related modules and somehow split my script into pieces and enter it line by line zzappie: oh! It says "source-location information for compiled code" is improved in the newest guile 3.0.6 release civodul: hello! ennoausberlin: I have difficulties to load the mcron modules using (use-modules (mcron base)) civodul: wingo: congrats on the release! \o/ zzappie: hello! +1 looking to see where all my sources are :) ennoausberlin: I installed mcron from git and I have some go files in /usr/local/lib/guile/3.0/site-ccache/mcron/ like base.go or core.go zzappie: *looking forward ennoausberlin: Do I have to add them to %load-path? civodul: ennoausberlin: yes, you need to make sure GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH include the right /usr/local subdirectories ennoausberlin: @civodul: Can I configure this as permanent change somewhere? civodul: yes, you can set environment variables in ~/.bash_profile or /etc/profile civodul: so that they'll be defined when you log in lloda: how about extending define so that (define a b (values 1 2)) works? like srfi-71 ennoausberlin: @civodul: Ah. Of course these are shell variables. My fault leoprikler: lloda: there is define-values IIRC lloda: leoprikler: i know ofc ennoausberlin: If I load the mcron file from the repl via (load "my_test_job.guile") I get back the output $1 = ((#< ... etc)). How can I investigate it further? ennoausberlin: what is the meaning of $1? zzappie: repl saves all evaulations in $number variables zzappie: you can us $1 as a varible in repl ennoausberlin: I understand zzappie: load procedure evaluets content of your file in your context. so if there are any definieitons they apperar in your context and (#< ... etc) i guiess means that you have job object as last expression in your file zzappie: *definitions ennoausberlin: Right. Can I inspect the job expression to see some of the let* bindings? zzappie: hmm... dont know. If job I a record you could acces it with job-* accessors. But I gues the job itself is a lambda -- I dont know how to access its contents other then running it... zzappie: *If job is a record ennoausberlin: The job function is part of the mcron modules and expects an vixiecron entry like ("0-59/5 * * * *") and a lambda zzappie: there is a job function an job record http://git.savannah.gnu.org/cgit/mcron.git/tree/src/mcron/base.scm#n48 zzappie: from #< notation I assume that you deal with job record. Maybe you could try to get (job:action yourjob) and run it? ennoausberlin: zzappie: That would be perfect. ennoausberlin: zzappie: I now store the resulting record in a toplevel named my-record. How can I access the fields like time-proc or action? I never used records so far. zzappie: hm you dont need to create a new record-type.. Maybe you could put the snippet to debianpaste? ennoausberlin: https://paste.debian.net/hidden/9367ee37 ennoausberlin: ennoausberlin: This is from the repl zzappie: aah. I got you now, I thought you defining new record type... yes job record is in (mcron base) module you cann import it and try (job:action my-record) zzappie: *job record type ennoausberlin: I did (use-modules (mcron base)) but then (job:action my-record) ennoausberlin: ;;; :27:0: warning: possibly unbound variable `job:action' ennoausberlin: ice-9/boot-9.scm:1669:16: In procedure raise-exception: ennoausberlin: Unbound variable: job:action ennoausberlin: rekado: these accessors are not exported. rekado: if you just want to play with this in the REPL I suggest entering the (mcron base) module rekado: ,m (mcron base) zzappie: yes didn't notice that, but then your local binging will be gone so you'll need to load your my_test_job.guile file again ennoausberlin: zzappie: I did this an I can now call the procedure. zzappie: s/will be gone/will not be in your context/ davexunit: I didn't realize that guile 3.0.6 introduced a new FFI API. curious how to upgrade to it while preserving compatibility with older versions of guile. ennoausberlin: Every time I stop by here I learn so much. I really appreciate this channel zzappie: its a nice place here :) ennoausberlin: By the way. The error was permission denied because I call mkdir from within the job if a certain dir is missing. Insufficient user rights was the problem. Hard to track down without any output dsmith-work: Hey Hi Howdy, Guilers dsmith-work: Wooo. Release! *: sneek dances civodul: woohoo! civodul: for the record, the GMP/GnuTLS issue is for Guile >= 2.2.7 or >= 3.0.1: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964284#58 civodul: (NEWS says 2.0.4) zzappie: I'm trying to wrap with-exception-handler with with-output-to-file inside a macro but file ends up empty... zzappie: https://paste.debian.net/1195555/ zzappie: am I missing something obvious? lampilelo: zzappie: it may be that the ports are not flushed because you're exiting non-locally from the handler, try calling (force-output) after writing your error log zzappie: lampilelo! thanks. It works now lampilelo: glad to help lampilelo: zzappie: i think setting #:unwind argument for with-exception-handler would also work, although i'm not very familiar with exceptions in guile lampilelo: because if raise-exception didn't trigger with-output-to-file's unwind handler it means the port is still open zzappie: lampilelo: I already tried it with #:unwind? #t -- doesn't work that way. lampilelo: what about the outer with-exception-handler? the one that should catch (raise-exception) called from the handler? zzappie: I'm actually intentionally rasing an exception. This macro meant to work similar way to (pk) but also outputing error object if exceptions were rised and doesnt affect other exception handlers because zzappie: going to use it in difficult situations like debugging shepherd services to dump things to the root directory :) zzappie: s/exception handlers because/exception handlers because it reraises exception it got/ lampilelo: since it works, there's no much more to do, the gc will clean up the port eventually wingo: moo ArneBab: goo Noisytoot: goops RhodiumToad: oops wingo: daviid: i have good news for you :) wingo: see most recent commit and lmk how it works for you *: wingo zzz daviid: wingo: oh, very nice tx, i will try asap, and will let you know of course, it is just that right now I am busy on annoying 'admin' ... tx daviid: wingo: good night civodul: oh syntax-error exceptions now see a vector instead of a source location alist RhodiumToad: ice-9 read doesn't get a compiled .go file? RhodiumToad: aha, it's included into boot-9 RhodiumToad: hm. using --enable-mini-gmp failed to compile davexunit: rekado: guix pack would have made for a massive download davexunit: the binary bundle I threw together is admittedly just grabbing libraries from ubuntu + the guile deps that I built davexunit: it worked on the only other machine I could test on, but of course nothing is easy so it blows up in fun ways elsewhere :( civodul: wingo: the "guix build" command above ran to completion though Guix compilation was slow (i was missing the env var), and it triggered a couple of test failures in Guix having to do with source location that i'll have to investigate davexunit: rekado: since you have guix, that's the best way to do. ignore that bundle entirely. davexunit: way to go* rekado: heh, okay :) rekado: I thought it was a guix pack, so it was a surprise to see it fail rekado: I wonder if you could speed up the build of the patched Guile by adding Guile to the inputs, so that it doesn’t need to bootstrap. davexunit: rekado: oh maybe. I was also told of a way to skip building guile altogether. davexunit: haven't had time to implement it, though. davexunit: back to work this week and very busy zzappie: leoprikler: "Digital Deluxe Tarball $200 USD" :D daviid: can a pythonist tell me, out of curiosity, if the python default repl and raised exception printers truncate their outlput? like ny daviid: hum hit enter before ending my quiz ... daviid: but anyway, like numpy? zzappie: daviid: From my experience no... Only time I saw truncated output was outputing recursive structures eg "l = ["recursion->", 0]; l[1] = l" daviid: zzappie: so, you define a vector of 20 millions floats, it displays the 20 millions floats in the python repl zzappie: daviid: im dooing it righ now zzappie: ... 19999997, 19999998, 19999999] well yep zzappie: but it could easily do weird things that are not well documented in other cases... Im saying haven't came accros such feature as guile's ",set print" in python daviid: zzappie: ah tx - pythonist do not use emacs ... but still, it surprises me - i guess pythonist who daily work with large structures do configure the repl and raised exception printers to truncate though ... but don't worry, i was just curious daviid: fwiw, in guile, the backtrace printer(s) do(es) truncate (by default) ... it is just unfortunate our repl and raised excpetion printers don't do that by default as well ... zzappie: daviid: according to stats pythonistas are the most common emacs folk kind ;) zzappie: https://emacssurvey.org/2020/ daviid: zzappie: ah, then those emacs users do not use large structures ... ot there is an easy way to configure both the python repl, raised exception and backtrace printers to truncate ... daviid: zzappie: did you succeed in configuring guile for this matter? last thing i remember is you complained it was not working in geiser, which i responded it does ... then had to leave and forgot to follow ...? zzappie: daviid: yep! I got it working, but I already forgot what was the issue... zzappie: Ah now I remember. Setting it in .guile has no effect on geiser. But doing in geiser repl does daviid: zzappie: that is the symptom of another problem daviid: zzappie: did you patch (ice-9 boot-9), as recommended in guile-cv's manual? daviid: for the error printers i mean ... zzappie: daviid: no I didn't do that one, cause I generally dont get big error outut. I usually hang emacs by accidentally printing guixes operating-sysstem structures or guix derivation building outputs. zzappie: but I taken notes :) zzappie: thank you for pointing out daviid: zzappie: ok - because the guile-cv manual describes the steps to edit the file, but lloda wrote a patch, one for 2.2 and one for 3.0, so now it is quite easier daviid: quite easier then manually edit (ice-9 boot-9) i mean - but still very inconvinient, granted ... if you need help ping us, lloda may help as well ... daviid: zzappie: now, that a guile session 'in geiser' doesn't load your $HOME/.guile content is not normal - zzappie: I usually go through early cycle of emacs config complications and rewrite... Maybe I just misconfugured something daviid: does it loads the .guile file if you launch guile in a terminal (not emacs)? zzappie: daviid: yes daviid: ok, and what about in an emacs terminal, no geiser, just M-x shell, then guile zzappie: works daviid: ok, so M-x run-guile (which should start guile in geiser) fails? zzappie: Yep only geiser repl doesnt truncate daviid: hum, are you using repl-default-option-set! 'print ... daviid: or anotehr way maybe? zzappie: exactly: (repl-default-option-set! 'print (lambda (repl obj) (truncated-print obj) (newline))) daviid: zzappie: and you do import (use-modules (ice-9 pretty-print) (system repl common)) before that call right? daviid: in the .guile file i mean daviid: zzappie: in your .emacs, do you have (setq geiser-guile-load-init-file-p t) zzappie: yes, I do import (use-modules (ice-9 pretty-print) (system repl common)) but I didnt set this variable daviid: ok, please try that and restart an fresh emacs daviid: or execute in *scratch* zzappie: Works! but the repl is soo sloo now :) daviid: really? i never noticed it was slow zzappie: restarted emacs, same thing geiser-guile-load-init-file-p causes repl to take charecter per second zzappie: zero net game... daviid: when you type something? that does not make sence either daviid: :) daviid: here, the geiser session is a fast as it can be, instantaneous zzappie: just runned the profiler seems the reason for slownes is company-mode zzappie: wihout company mode its snappy again daviid: zzappie: ah, don't know what company mode is zzappie: its completion framework https://company-mode.github.io/ daviid: ok i see - well geiser completes for you anyway zzappie: i think geiser uses its backend to company mode if company mode is enabled daviid: maybe you can ask an emacs 'pro' how to disable that mode in geiser, and scheme eiditing files, but not in other buffers ... daviid: zzappie: fwiw, #geiser the author is jao, very nice and responsive ... daviid: not an emacs nor a geiser config expert ... but i am glad we solved your geiser loading .guile problem zzappie: daviid: Thank you for helping out! The time will come when Ill see <#operating-system # ...> in repl and wont have to restart emacs :) daviid: zzappie: welcome - whenever you have some time, you may patch guile for the raised exception printers ... daviid: zzappie: then you can even use guile-cv :):) daviid: which is in guix :) - but don't try it unless you patch the raised exception printers as well ... which i'm not sure how one does that in guix - maybe guix could offer a pre patched guile with lloda's patch zzappie: its pretty -- easy you can inherit package and specify patch file *: zzappie going to zzz daviid: ok good night rlb: wingo: do we promise that a SCM value can always make a safe round trip through a "void *" (via SCM_UNPACK/PACK)? leoprikler: Unless there's something in between, that should be the case. rlb: In between? rlb: You mean unless something messes with the void pointer? leoprikler: It probably just depends on the bits of the pointer, but I'm not too sure what happens if you mess with the SCM it was generated from leoprikler: Certainly, if you do get the messed SCM back, then expect that mess wingo: rlb: it is a good question :) two factors: aliasing and size. guile compiles with -fno-strict-aliasing so no problem there; i have never been sure about users but they should be less exposed to the internals of SCM, so less of a risk wingo: as far as size -- not sure. on mingw64, pointers are 32-bit, but we want to allow 64-bit fixnums wingo: but that part of the mingw patch hasn't landed yet i think wingo: fwiw SCM_UNPACK / SCM_PACK converts to scm_t_bits, the question is really about whether sizeof(void*) >= sizeof(scm_t_bits) rlb: wingo: ok, well if there's any question now (or wrt what we might want to do the future), then my answer is "no" :) wingo: :) rlb: And thanks. The reason I asked is because I could make some slightly more general (internal) helpers for utf8 if I could have a "void *data" argument to a C function (callback loop) that could be provided either an SCM or some C struct (to be interpreted by the provided callback). But I can always do "something else". Could either provide a pointer to a pointer to an SCM, or provide to flavors, or... rlb: "pointer to some C struct, or whatever" wingo: moo civodul: hey wingo! wingo: hi :) qrpnxz: howdy folks, trying to import a library i made with the r7rs syntax. Doing `(import (example library))` but guile doesn't seem to understand. What is the correct way? Thanks leoprikler: qrpnxz: i think (import) in this way is only legal inside a library form qrpnxz: so in guile if i want to import i have to put main in a library or smth? how does that work? leoprikler: oh, wait, it seems the repl eats it even without specifying r7rs qrpnxz: i'm running `guile --r7rs` is that helps qrpnxz: `guile --r7rs filename.scm` rather wingo: qrpnxz: is it a path issue? wingo: i assume you have an example/library.scm somewhere? qrpnxz: i import in the same file i define it, though i'd like to know how it searches for files as well qrpnxz: mm, i'll try that wingo: ah. for that i would think it would work if you define the module before using it wingo: but not otherwise leoprikler: -L . if you have it in your local tree at example/library.scm qrpnxz: it was able to import if i put it in such a file and used -L i think qrpnxz: though the lib itself didn't work, was trying to do smth like (define-library (qrpnxz func) (export (lambda func))) to rename lambda but no dice hahaha qrpnxz: define-syntax also didn't work for some reason qrpnxz: i'm not even able to (import (scheme base)) within a file so that's weird qrpnxz: no problem in the interpreter however wingo: sounds... weird :) qrpnxz: `import` is not bound when i run a file qrpnxz: define-syntax also works fine on interpreter qrpnxz: interesting! after doing define-library on the interpreter, i'm also not able to import anymore. On the prompt, "guile-user" is replaced with the library name qrpnxz: it's like it's doing some weird scoping thing idk qrpnxz: not sure what the "guile-user" is supposed to indicate, perhaps guile just doesn't allow other stuff in the same file as a define-library? idk wingo: don't you have to explicitly declare all imports in the define-library form? wingo: "import" is a purely syntactic thing in r7rs iirc, has to be in the define-library form wingo: if you want the macro version you have to import it from guile qrpnxz: the imports in the define-library are scoped in the library tho no? like it defines what stuff you can use within the definition of the library qrpnxz: import can be used outside in r7rs, that's how you use libraries wingo: only at the beginning of a program tho, right? wingo: like there are "programs" and "modules" wingo: libraries rather qrpnxz: don't think so since The Library Example in the standard has some libraries define and immediately after uses them wingo: and import is still just syntactic in programs iirc -- guile allows it anywhere in a program but that's an extension qrpnxz: see page 29 of https://small.r7rs.org/attachment/r7rs.pdf qrpnxz: import decl are on p25 qrpnxz: not sure what this is getting at: `unexpected syntax in form ()` i get it from qrpnxz: (define-library (func) qrpnxz: (export func) qrpnxz: (begin qrpnxz: (define-syntax func qrpnxz: (syntax-rules () qrpnxz: ((func args ...) (lambda args ...)))) qrpnxz: )) qrpnxz: from importing this that is qrpnxz: bruh it's telling me `begin` is not bound wtf? qrpnxz: lol i had to import (scheme base) for basic stuff like `define`, how unexpected qrpnxz: alright, works qrpnxz: well, using it right after on the same file doesn't work, but importing it and using it works qrpnxz: probably because of that weird context switch thing wingo: generally speaking multiple r6rs / r7rs modules in one file are not well supported -- see https://www.gnu.org/software/guile/manual/html_node/R6RS-Incompatibilities.html *: wingo notes a couple of updates to make to that page qrpnxz: it looks like guile doesn't support (begin) in libraries, instead what you do is define all your stuff at the beginning and then have a define-library at the end of the file qrpnxz: ah nice link thanks taw10: Is it possible to use Guile's Dynamic FFI for accessing C++? The stuff I want to use is idiomatic C++, not the C subset (i.e. I need to call at least one constructor with a double colon in its name). Or, should I just write a thin wrapper with libguile? taw10: My feeling from reading the manual is that it's possible under non-portable assumptions about what the actual symbol names in the C++ library are, and that it'd be better just to write the wrapper leoprikler: taw10 if you write a C header, you should be able to use everything as-is. Otherwise consider using something that's specific to C++ like Schmutz apteryx: any way to debug a .scm file not being prefered to a stale .go file? apteryx: I have this weird situation where a .scm file is newer than its corresponding .go file (which live in the same tree) doesn't prevail apteryx: s/ is// leoprikler: If you don't want to trace Guile's resolve-module, you could copypasta the code and instrument it. leoprikler: then call (my-resolve-module '(bad module)) leoprikler: of particular interest might be the file-is-newer? check apteryx: Thanks for the hints lloda: what's the deal with build-aux/config.rpath? It got updated with gnulib but it seems autogen writes over it. Should it just be removed from git? wingo: i don't recall wingo: if it was added recently and autogen writes it, it can be removed lloda: testing lloda: yeah looks like. Ok i'll remove it dsmith-work: UGT Greetings, Guilers manumanumanu: Can I use guix to build the current master of guile?? leoprikler: You need to add some additional inputs for the bootstrap, but yeah wingo: good evening :) *: wingo pokes guile release civodul: woohoo! daviid: wingo: any news on the #47084 'front'? wingo: no, haven't gotten to it yet daviid: ok lampilelo: how can I mark a bug report as having patch available on debbugs? i realized just now that i submitted a patch along with a bug report like 5 months ago and there wasn't any response lampilelo: ah, wait, it's been merged already lampilelo: i guess i don't understand debbugs lampilelo: shouldn't it be removed from the list then? lampilelo: ok, it seems i'm very confused, it hasn't been merged, i just have it applied locally lampilelo: it's late, don't judge cheim0: lampilelo: https://debbugs.gnu.org/server-control.html cheim0: specifically, the tags command lampilelo: do i need any special permissions? cheim0: not as far as I know. I closed a bug once and I haven't gotten in trouble yet ;) lampilelo: ok, thanks lampilelo: i'll try to use it tomorrow Ikosit: Hi guile! :) Ikosit: Is it possible to tell guix, that the character ; is just a normal symbol? Ikosit: s/guix/guile Ikosit: sry sometimes i confuse guix and guile :S leoprikler: Ikosit: '#{,}# leoprikler: s/,/;/ Ikosit: leoprikler: That wont work, since i need to write ; back as ; leoprikler: do something clever with symbol->string? Ikosit: leoprikler: And also '#{;}# doesn't work Ikosit: (It works with the r7rs syntax) leoprikler: it works for me inside a REPL, but I don't know your constraints rekado: do you want to write comments? lloda: you can do (string->symbol ";") ? lloda: but '#{;}# does work for mme p0a: hey all p0a: Has the Guile project considered providing a cmake module for guile? p0a: I'm thinking of attempting to submit a PR that does that. Since guile-config is available, it shouldn't be hrad p0a: s/hrad/hard lloda: I use https://github.com/stevengj/nlopt/blob/master/cmake/FindGuile.cmake lloda: is that what you mean? lloda: there are several versions floating around don't know which is the reference one lloda: it would be nice if that came with the package and you didn't have to search for it p0a: lloda: I was just reading the cmake tutorial on writing stuff like that and I can't tell you I completely understand what I'm looking at p0a: but the /opt/local/lib path makes me think this is unix only lloda: hmm p0a: although guile-config is used in that find module and /that/ should be OS-agnostic lloda: i have tested that on debian and mac os lloda: cannot say about windows p0a: "Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option." p0a: So it appears that since it does not exist on Windows, it will simply be ignored. However, it still should be a PATHS not a HINTS. I agree it would be nice to have it included with Guile lloda: i think it should be included with cmake tbh p0a: someone told me it should be included with guile because cmake can't maintain those p0a: and guile is already doing maintanance of guile-config (which is the key ingredient) lloda: they only have to accept patches :-\ they already maintain other languages. Their call I suppose p0a: This has an OpenCog copyright with BSD license however. What does that mean in terms of me modifying it and submitting it as a PR? lloda: you keep their notice and you're good to go iiuc p0a: Gotcha, thanks lloda: i think it would work better if included with cmake since then it's enough for you to do find_package(Guile), that's it. If it comes with Guile then you still have to tell cmake where to find the module lloda: which defeats the purpose somewhat p0a: Guile would test if cmake is installed and if so install it in the right path, cmake provides a mechanism for libraries to do that p0a: according to what I've understood from conversations flatwhatson: It works basically like pkg-config, you just put your .cmake in the right location. flatwhatson: Though it's somewhat redundant if you're already supplying a .pc, calling pkg-config from cmake is trivial. flatwhatson: What would be really nice is adding cmake helper functions for compiling and installing Guile packages to the correct paths. p0a: flatwhatson: so cmake should have helper functions for libraries? Is that what you mean? flatwhatson: Here's mine from last time I played with it: https://paste.gnome.org/pnp7824i5 flatwhatson: Idea was to extend GNUInstallDirs with some guile-specific paths, GUILE_INSTALL_SITE_DIR and GUILE_INSTALL_SITE_CCACHE_DIR flatwhatson: These could be used with some guild incantations and cmake's install() to do the right thing p0a: flatwhatson: does this work on windows? p0a: I can't test because I don't have windows but I'm curious if you know p0a: For example (display (version)) ==> 3.0.1 but my guile is under guile/3.0/ p0a: seems to be an issue flatwhatson: No idea about Windows! It's only using (version) for the version check, (effective-version) is for the install path p0a: Oh yes, I missed it Ikosit: rekado: I want to extend the syntax of kmonad, which uses a lispy syntax Ikosit: (kmonad is a tool for remapping keys on linux) Ikosit: And its syntax uses a single ; for the key ; leoprikler: IOW you want to read kmonad files with Guile? chrislck: knomad uses haskell, not guile leoprikler: haskell-on-guile when? :P rekado: yale-haskell is a bit dated, but it’s implemented in a Scheme-like DSL on top of Common Lisp chrislck: who's raising their hand for lisp on lisp then leoprikler: See also: Lokke, Emacs Lisp in Guile Ikosit: chrislck: I know, my program is more also more like m4 Ikosit: chrislck: But i would really like to turn the lispy config syntax in guile :) dsmith-work: Morning Greetings, Guilers wingo: hey ppl that track perf-related things -- if you see anything weird over past week or two either in compile time or run time, do let me know (cc manumanumanu, lloda) *: wingo about to push a couple more things lloda: check wingo: compiled file size also dsmith-work: Ikosit: is kmonad related to Xmonad? Ikosit: dsmith-work: No Ikosit: The only similarity is that both are written in haskell dsmith-work: Ok. Was thinking it might be a companion app or something. (becaue both haskell) wingo: just took a look on the microbenchmarks and things are mostly neutral for the module call changes and even the cross-module inlining rekado: I’m a little bit disappointed to see that libfive was ported from Scheme to C++ to add Python bindings: https://news.ycombinator.com/item?id=26943176 rekado: whatever works for them, but I really liked that it was written in Scheme davexunit: rekado: that's a bummer :( leoprikler: rekado: The version that's packaged in Guix already has C++, did I miss something? wingo: yaaarrrrrrrgh, investigating a slowdown in a bignum-heavy benchmark -- of course it was the gmp malloc change that is causing the slowdown *: wingo was pulling hair looking for compiler slowdowns wingo: that was it wingo: added an environment variable :P civodul: wingo: oh! what sort? wingo: just that if you build against external gmp, anything that uses bignums gets slower civodul: d'oh, how come? it no longer defaults to custom allocators? wingo: right civodul: d'oh! civodul: i missed that wingo: it defaults to custom allocators iff using mini-gmp civodul: oh right, ok civodul: yes, that's the safe choice wingo: otherwise you can (when i push a patch) set GUILE_INSTALL_GMP_MEMORY_FUNCTIONS=1 in the env wingo: but, irritating. civodul: yeah, it's annoying that we have to make such a choice wingo: well, another reason to rewrite using mpn rather than mpz civodul: it's like: slower bignum allocations, or slower bignum operations civodul: yes civodul: or to just stick to small numbers :-) wingo: lol ;) *: civodul tries "guix build guix --with-input=guile@3.0.5=guile-next --with-branch=guile-next=master" *: wingo dissuades self from merging the cross-module inlining stuff.... for now :P wingo: night! civodul: heh, night wingo! davexunit: guile has some decent representation in the lisp game jam that just wrapped up. davexunit: https://itch.io/jam/spring-lisp-game-jam-2021/entries davexunit: dystopia.el, birb, and the test subject (mine) are all made with guile rekado: davexunit: I wanted to try “the test subject” but I get this: ./launch-game: line 10: /home/rekado/Downloads/the-test-subject/bin/guile: No such file or directory rekado: oh, I think I’ll need to install /lib64/ld-linux-x86-64.so.2 rekado: perhaps you could have used “guix pack -RR” rekado: hmm, even after creating the loader link I get errors: /home/rekado/Downloads/the-test-subject/bin/guile: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory *: rekado notices all the comments there civodul: davexunit, leoprikler: neat! civodul: rekado: it's not a pack? zzappie: rekado: Speaking of guix pack --RR, I packaged birb with guix pack and it was like 700+ megs uncompressed zzappie: thats a lot :D leoprikler: that's twice the size of dystopia.el civodul: thumbs up to you too zzappie leoprikler: or wait, does "uncompressed" mean after unpacking the tarball? civodul: "guix size guile guile-chickadee | tail -1" says 258 MiB civodul: but i guess it depends on the additional dependencies you pull in zzappie: civodul: The game was written by my friend - torkut. I only helped with packging so far... zzappie: leoprikler: right, its 180mb compressed leoprikler: Phew civodul: zzappie: ah ok tohoyn: sneek: botsnack sneek: :) chrislck: Happy Sunday, all \o/ civodul: o/ sneek: Welcome back civodul, you have 1 message! sneek: civodul, apteryx says: lfam sorry about the hostname change on berlin, I meant to type 'host' to check its IP but apparently typed hostname :-) ArneBab: leoprikler: I tried using Shitsumon with Tsukundere installed via Guix, but I get "no code for module (shitsumon)" ArneBab: leoprikler: when I run shitsumon directly with guile --language=wisp shitsumon.w , I get Module named (tsukundere assets) has no public interface ArneBab: leoprikler: for install I changed tsukundere/guix.scm to return tsukundere/wisp leoprikler: Using tsukundere/wisp should do the right thing, but how did you invoke it? ArneBab: with tsukundere run -L $PWD -A $PWD -m shitsumon leoprikler: Inside the shitsumon directory? leoprikler: Hmm… ArneBab: yes … and I just updated tsukundere and now it works … ArneBab: git pull for the win … ArneBab: sorry … leoprikler: wait, what? ArneBab: must have been stuck on a broken commit (it was e97e170) leoprikler: I did not push anything, that is related to the module stuff recently ArneBab: now I’m on 042d81a and it runs leoprikler: That's strange, e97→042 is a completely unrelated change leoprikler: And I swear I tested with e97 before leoprikler: And even more so with c177b15c before it ssbnxx: hey can someone recommend a good .guile file for me to look at? I found this and I was wondering what else I could add https://gitlab.com/NalaGinrut/guile-colorized leoprikler: ssbnxx: The default .guile in Guix consists of (ice-9 colorized) and (ice-9 readline). I don't think much more customization is needed ssbnxx: leoprikler: okay, thank you ArneBab: leoprikler: I switched back and forth and now it breaks again ?? now with tsukundere/game/internals.scm:40:25: In procedure current-window: In procedure fluid-ref: unbound fluid: # leoprikler: hmm, tsukundere currently always runs in pseudo-interpreted mode, so the backtrace may not be fully usable, but can you check where that call comes from? ArneBab: leoprikler: to reproduce: cd ../tsukundere; echo tsukundere/wisp >> guix.scm; guix environment --ad-hoc -l guix.scm; (now inside environment: cd ../tsukundere-shitsumon/; tsukundere run -L $PWD -A $PWD -m shitsumon ArneBab: In tsukundere/game.scm: ArneBab: 63:22 1 (_ #f) ArneBab: In tsukundere/game/internals.scm: ArneBab: 40:25 0 (current-window) ArneBab: could this happen because I closed the window? leoprikler: Well, the game should exit normally if you close the window, but did you perhaps close it too quickly? ArneBab: possibly, yes ArneBab: but a previous run ArneBab: I wonder whether I have problems because I installed both tsukundere 0.2.3 (from regular guix) and 0.3.x (from the repo) ArneBab: removing tsukundere 0.2.3 now leoprikler: At the very least, I know that 0.2.3 and 0.3.0 are incompatible. rlb: wingo: one thing I noticed - libunistring has a number of functions (see the info pages for unicase.h) for case mapping strings with and without normalization and/or localization. I haven't delved yet, but wondered if we might be able to use those instead of the current per-char conversions. Though if they're all context sensitive (not sure), then perhaps not (given that I think we're not context sensitive now.) leoprikler: I'm trying to see, what tsukundere from Guix should produce on its own leoprikler: Yep, Tsukundere 0.2.3 produces "no code for module (shitsumon)" leoprikler: That's because multi-language support was added in 0.3.0 leoprikler: Similarly, 0.3.0 without linking against Wisp also produces that message leoprikler: or no, it produces an error, that Wisp doesn't exist ArneBab: I now used guix remove tsukundere, and I killed the ccache rm -rf ~/.cache/guile/ccache/ but I still get the error ArneBab: I’ll try installing directly via autotools now ArneBab: still unbound fluid ref at current-window. I’m uninstalling chickadee rlb: If I need to coerce a void* (that I know is an SCM) to SCM, is SCM_PACK() suitable? leoprikler: I think it's roughly Scheme eval, dlopen, string stuff and open patches in the ml rlb: lampilelo: not atm, and I'm pretty sure you wouldn't want to look at it yet. It's still strewn all over the floor. But if you're interested, I'll keep that in mind if/when I get a bit further and try to make something public sooner than I might have otherwise. Zelphir: Hi! Is there a way to make sxml->xml output prettified/indented XML strings? sneek: Zelphir, you have 1 message! sneek: Zelphir, leoprikler says: the manual only talks about languages implemented in Guile itself, not third party projects Zelphir: (I've looked at https://www.gnu.org/software/guile/manual/html_node/SXML.html but not found anything.) lampilelo: rlb: it's just plain curiosity, it's not like i depend on it mwette: Zelphir: Regarding formatted sxml->xml, I typically open a pipe to xmllint --format and output to that. Zelphir: mwette: Is that a command line tool? Piping from inside the Guile code? And: Do you happen to have an example anywhere : )? mwette: (define (open-xmllint-pipe filename) (open-output-pipe (string-append "xmllint --format --output " filename " -"))) mwette: then something akin to (sxml->xml sxml (open-xmllint-pipe "foo.xml")) stis: Hey guilers! do one need to specify compiller options to compile let/ec effektively? leoprikler: Zelphir other than that, you may want to adapt ice-9 pretty-print for your purposes mwette: leoprikler: I think he wants to pretty-print xml not sxml. mwette: The other approach is to re-write sxml->xml to do what "xmllint --format" does. chrislck: this would be a nice addition to the sxml family Zelphir: mwette: thanks! mwette: Zelphir: yw Zelphir: To be more clear: Yes, I do want to format the output of sxml->xml nicely, before it is send to the browser. However, I will also look at ice-9 pretty-print. Thank you Leo. rlb: I wonder if, in a utf-8 world, mutation sharing substrings maintain much of their value, particularly cost/complexity-wise in the code. I suppose as long as you stick to bulk operations, which you'll want to do anyway, they might still be useful. rlb: I also wondered what the requirements for some functions are, like string-trim, e.g. if there's nothing to trim, can it just return the original argument instead of a new string -- or perhaps only if the string isn't shared/mutable, or...? manumanumanu: stis: I don't think that is really a thing... However, looking at the scheme benchmarks, even using delimited continutations, guile is slower than many schemes in the continuation-limited benchmarks (like fibc, for example). manumanumanu: stis: one thing I have noticed giving quite a bit of overhead with continuations is the size of them (a large cons chain takes a lot longer time to escape and restore than, say, a loop with an accumulator), but I don't think that matters much with let/ec. stis: manumanumanu: for this case one could optimize to get super speedy. But this is not something guile seams to be doing (yet) stis: Also because I'm doing set! in python (yes python semantics means that) there is a loss of a factor of 3 if we assume the let/ec is optimized manumanumanu: stis: regarding loop, btw: I have not spent any time thinking about python (the less I spend the happier I become), but there must be some kind of subset of list comprehensions where you don't need set! manumanumanu: I am planning to download python on guile to try it out! It is such a nice project. I don't know enough python to be able to help though. manumanumanu: there is always this little required set! somewhere that just ruins all the fun :( stis: yes but that means a hairy lot of code, it is possible though to make it improve. For example if continue is not used we gain a factor of 2 and are 2x speedier than CPython manumanumanu: Do you have to rely on exceptions to signal iterator ends? manumanumanu: That seems expensive in guile as well stis: yes we need that and for loops doing very few runs it is expensive. Also there is a let/ec for the break notion manumanumanu: that shit would have been sooo much easier with a guile TAGBODY :) :) manumanumanu: but eww... stis: but the let/ec for the continue is for every loop run so to remove that is the most important step usually stis: yes it would, but a good optimizer for delimited continuation would mean that we can implement a tagbody in terms of delimeted continuations and then optimize the result so that it behaves as a tagbody stis: I have an tagbody implementation using delimited continuations actuially manumanumanu: so do I :) stis: so in principle we do not need to add a tagbody primitive stis: cool! manumanumanu: I had one with call/cc, which worked fine in chicken, but was slow as molasses for guile. I rewrote it for guile. I have some questions about nested use though, and I haven't put it online yet. stis: syntax-parameterize!! manumanumanu: stis: is the python-on-guile in guix up to date? manumanumanu: smart stis: no it is an older one and do not work on wingos state of the art guile manumanumanu: now, off to bed! stis: nighty! manumanumanu: I am looking forward to play with python-on-guile soon! manumanumanu: great job! stis: thx leoprikler: does Guile not explicitly state, that it only guarantees that the application doesn't crash, but doesn't guarantee garbage-freeness? ArneBab: leoprikler: If you want to make it easier for people to use tsukundere with wisp, you can simply include the parsed language/wisp.scm and language/wisp/spec.scm in the game. That’s what I do for dryads-wake: https://hg.sr.ht/~arnebab/dryads-wake/browse/language leoprikler: I'm somewhat opposed to bundling, but this raises an interesting question. ArneBab: (I only now saw the spring lisp game jam, and there’s nothing new from me except that dryads-wake now has fully working auto-saves) leoprikler: IIRC, Wisp itself is GPL3+, but this implementation seems Expat-licensed. Are there any notable differences between the two? ArneBab: yes, wisp under GPL3+ is more robust and supports adding procedure properties via literal arrays. But since I am the only author for the implementation (though jan wedekind improved the makefile), it would be easy to allow using it under LGPL. ArneBab: GPL3+ is the project ArneBab: the actual parser and reader are lax licensed: https://hg.sr.ht/~arnebab/wisp/browse/wisp-scheme.w?rev=tip ArneBab: https://hg.sr.ht/~arnebab/wisp/browse/wisp-reader.w?rev=tip ArneBab: (because that’s required for an SRFI) leoprikler: Hmm, so where exactly does the GPL apply? ArneBab: (I’ll have to doublecheck the reader-file, but since the readable stuff is mostly under MIT that should be unproblematic, too) ArneBab: in everything that does not have its own license header ArneBab: currently that’s the reader, but that is more of an oversight on my part leoprikler: oof, normally the GPL wants you to make that explicit by adding the header leoprikler: (hence why most everything in Tsukundere carries one) ArneBab: yes — in this case the wisp-scheme.w file came from the SRFI-implementation, and expat is GPL-compatible leoprikler: also I'm not sure if that's source hut, but isn't the language/ code missing? ArneBab: the examples are GPL, too ArneBab: the language/ code is generated by the bootstrap.sh script ArneBab: from wisp-scheme.w and wisp-reader.w leoprikler: Ahh, I see ArneBab: wisp-reader.w becomes language/wisp/spec.scm and wisp-scheme.w becomes language/wisp.scm ArneBab: there’s also wisp.scm (from wisp-guile.w) that can convert wisp files to regular scheme files leoprikler: apropos wisp.scm, I think there might be some problems with that ArneBab: wisp-guile.w uses string-parsing for that, though, and it has at least two known bugs, one with character literals and comments (i.e. #\;) and another one with comments. ArneBab: how so? ArneBab: (there are two wisp.scm: one in the repo-toplevel and one in language/wisp.scm) leoprikler: I've had source files (I can't recreate them on the top of my head, sorry), that would work fine with the wisp reader, but when asked to translate to scheme, it would be garbage in some way. leoprikler: ah, well, that'd be wisp2lisp, not wisp leoprikler: wisp is just a lazy guile wrapper :P ArneBab: yes, there are some edge cases I never got solved with the string-parsing approach (I wouldn’t have thought that parsing scheme is so hard). It’s why I switched to the reader. ArneBab: yes: it got so much easier when I decided to simply call (read) on any construct that’s not needed for specialized treatment :-) ArneBab: (people had told me to try for months and when I tried I found they were right) ArneBab: wisp2lisp has some edge-cases — it can happen that paren-adding ceases at some point. Typically there’s a character-literal at that point. I tend to work around those by replacing it with (string-ref "" 0) ArneBab: that’s very annoying to me, but I did not manage to fix it ArneBab: (I wish I could get wisp2lisp fully equivalent to wisp-scheme.w, but I already failed twice at getting rid of the last few edge cases) leoprikler: Joke's on you, even compiling down to Tree-IL and back doesn't save you. ArneBab: yes: using the reader I lose the comments ArneBab: so I cannot replace wisp2lisp by language/wisp.scm leoprikler: Well, comments are one thing, but I mean in terms of actual code. ArneBab: do you mean there’s a bug in the read-using implementation? ArneBab: If you can give me a test-case (wisp-code and scheme-code that should both become the same tree-il), that would be great! leoprikler: no, I mean much more, that it's possible to write Scheme, that can be "compiled to Tree-IL and back" and make perfect sense, but can't be compiled directly to bytecode ArneBab: do you have an example? leoprikler: I once stumbled on such a case when I debugged some funky macro with macroexpand. ArneBab: can that Scheme-code actually work? Is it valid Scheme? leoprikler: I think it's valid Scheme, but I vaguely recall it does weird things with identifiers. ArneBab: that sounds nasty :-) ArneBab: (and fun) leoprikler: I think the bug was, that Tree-IL correctly sees them as two different literals, but when compiled back to Scheme, they are one again (because that version of Guile undid the gensyms) leoprikler: If you compile that code again, there is no longer any macro expansion, so it just eats that. ArneBab: yikes! That means wisp2lisp will always have to stay a string-transformation implementation. ArneBab: So I might have to try my hand at fixing its remaining edge-cases again. leoprikler: I don't think that this is unsolvable per se, but the Tree-IL→Scheme back transformation certainly has its own edge cases to deal with. leoprikler: If you can live with gensyms, I think 3.0.5 might be fine. leoprikler: The Tree-IL I saw from that is a little on the verbose side ArneBab: wisp actually doesn’t do much in terms of complex processing: It just turns indentation-based code into the structure that repeated (read) would get from the equivalent scheme file. ArneBab: that’s also what’s checked in the tests: https://hg.sr.ht/~arnebab/wisp/browse/tests?rev=tip ArneBab: → https://hg.sr.ht/~arnebab/wisp/browse/tests/runtests-scheme-reader.sh?rev=tip leoprikler: okay, nope, no fancy identifiers in that ArneBab: I try to keep as simple and stupid as possible :-) ArneBab: (keep wisp as simple and stupid) leoprikler: btw. can wisp handle stuff like receive? ArneBab: here’s what wisp wants to guarantee: https://hg.sr.ht/~arnebab/wisp/browse/testrunner.w?rev=tip#L26 leoprikler: e.g. I'd want leoprikler: receive leoprikler: ____ proc leoprikler: __ body body* ... ArneBab: how do you call it in scheme? (with imports) leoprikler: it's inside (ice-9 receive), but I'm talking about the syntax here ArneBab: can you give a minimal example in Scheme? ArneBab: (with parens) leoprikler: (receive (car cdr) (car+cdr '(car . cdr) car) leoprikler: so it'd be receive : formal formal* ... actually leoprikler: ehh, paren closing leoprikler: (receive (car cdr) (car+cdr '(car . cdr)) car) ArneBab: my guile just complained :-) ArneBab: with Guile I get bad lambda in form car cdr: syntax error ArneBab: with ArneBab: ah, I closed the wrong paren leoprikler: (ice-9 receive) (srfi srfi-1) ArneBab: what should that give? leoprikler: the symbol 'car ArneBab: so this: ArneBab: (import (ice-9 receive) (srfi srfi-1)) ArneBab: (write (receive (car cdr) (car+cdr '(car . cdr)) car)) leoprikler: I tend not to like write in the repl, but yeah leoprikler: but the special trick here, is that the first 2 forms require extra indentation if they're not on the same line ArneBab: import (ice-9 receive) (srfi srfi-1) ArneBab: write ArneBab: receive : car cdr ArneBab: car+cdr '(car . cdr) ArneBab: . car leoprikler: so what I'd like to have is something, where I could indent car a bit less leoprikler: similarly: ArneBab: Wisp uses the prefix-dot to reach the same goal. leoprikler: I don't think you understand me correctly, I would want the dot with less indentation. ArneBab: I think I do, but while it might actually work, it’s not how wisp is specified leoprikler: fair enough ArneBab: You can actually do this: ArneBab: write ArneBab: _ receive : car cdr ArneBab: ___ car+cdr '(car . cdr) ArneBab: __ . car ArneBab: but it’s not guaranteed that it will keep working (since it’s not in the spec) ArneBab: and gives you this warning: ArneBab: ;;; WARNING:5: used lower but undefined indentation level (line 4 of the current chunk: (REPR-DOT-e749c73d-c826-47e2-a798-c16c13cb89dd car)). This makes refactoring much more error-prone, therefore it might become an error in a later version of Wisp. leoprikler: another case, where it might make sense to think about this though is define-public leoprikler: because functions with many arguments typically split them leoprikler: but doing so makes refactoring much more error-prone :) ArneBab: :-) ArneBab: with many arguments, I use ArneBab: define ArneBab: fun arg1 arg2 arg3 ArneBab: . arg4 arg5 ArneBab: . arg3 arg7 ArneBab: . #f leoprikler: yeah, but you can no longer define : fun ArneBab: yepp — that’s the limit of the inline-colon syntax leoprikler: That being said, I still feel like a genius for using arguments as initialization. ArneBab: the colon is intentionally limited: the reason why the colon exists as special syntax is that it can be used alone on a line: https://www.draketo.de/software/wisp#sec-4-2 ArneBab: can you give an example of that? ArneBab: (I’ve been looking at tsukundere but missed examples) leoprikler: https://gitlab.com/leoprikler/tsukundere-shitsumon/-/blob/master/shitsumon.w#L99-104 <- this function is only ever called without arguments ArneBab: wow, that looks awesome! ArneBab: and I seriously have to link it on the wisp-page (if you don’t mind) ArneBab: Do you already have a dedicated website I could link to? ArneBab: (I need to get to bed — I’ll see your reply tomorrow, if you can’t reply before I need to get AFK) leoprikler: For Tsukundere? I only generate docs, sadly. leoprikler: I think linking Shitsumon as-is *should* be fine, but it doesn't have a release mainly because I haven't yet coded the fancy main loop with credits stuff. leoprikler: That said proper credits should at least exist in the README ArneBab: I’ll think of a way tomorrow (when I’m not as dead-tired as right now — it’s half past one in the morning here :-) ) leoprikler: Oh yeah, my super exciting web page: https://leoprikler.gitlab.io/tsukundere/ rlb: leoprikler: if you were addressing my string questions, then right, I think we *might* be within the letter of the law, but if so, was still wondering about whether the difference was actually OK before I spend a lot more time on some of the function conversions. sneek: rlb, you have 1 message! sneek: rlb, zzappie says: not useful at this point of time but hey, I didn't know about lokke ArneBab: I already found that one — it could really benefit from a screenshot :-) (and yes, despite the smiley I really mean that — every game-website is stronger with a screenshot) leoprikler: Oh, sure, I just haven't written enough free games with it. leoprikler: It also needs a logo, of course. ArneBab: that’s my problem with enter-three-witches, too :-) — dryads-wake is the first that I hope to get actually playable leoprikler: Which means that next month I'll have some AI generate more anime faces. leoprikler: If we dedicated all our crypto mining GPUs to generating anime portraits, we'd still have the same emissions, but at least it'd be worth it. leoprikler: How do we solve this issue? By inventing a crypto currency with an anime portrait based proof of work scheme. ArneBab: do you mean something like this? https://www.thisfursonadoesnotexist.com/ ArneBab: https://thisanimedoesnotexist.ai/ ArneBab: → https://thisanimedoesnotexist.ai/downloads.html ArneBab: not to forget: https://www.thiswaifudoesnotexist.net/ leoprikler: needs to have a torrent option imo ArneBab: (I knew it would one day come in handy to keep these bookmarks around :-) ) ArneBab: ⇒ upload to a torrent tracker? It sounds like it’s legal. ArneBab: https://www.thiswaifudoesnotexist.net/ ArneBab: (wrong copy buffer — this one: https://www.obormot.net/demos/these-waifus-do-not-exist-v2-alt ) ArneBab: now I really need to sleep — I hope these help you! leoprikler: btw. I was originally referring to https://www.artbreeder.com/ since it comes with the clear restriction, that all images generated from it must be cc0 leoprikler: good night :) ArneBab: same to you! wingo: rlb: hooo good question (re: racing writes on shared mutable strings). i guess in general i don't mind making string-set! arbitrarily slow, but we should do all we can for string-ref -- requiring locks would be unfortunate! wingo: rlb: what happens to concurrent string-ref when string-set! needs to expand the stringbuf because the codepoint takes a different number of bytes? wingo: in the non-shared case rlb: The way I have things right now, strings only contain their char count and offset into the stringbuf, and the pointer to the stringbuf. stringbufs never resize in place (so byte offsets don't change for other internal operations). Given that, if it's mutable, and we're replacing chars of the same size, we may mutate them in place (as we used to), but otherwise we create a new stringbuf, copy the contents (while making the relevant rlb: changes), and then do a simple assignment to swap the stringbuf pointer in the shared string. No locks. rlb: So as per our docs, unrestricted concurrency could cause weirdness, but shouldn't crash anything (in theory). rlb: But it does mean that two operations can race to create the new adjusted stringbufs and "last one (swapped in) wins". rlb: Hence two competing string-set! operations on a shared mutable string could result in one of the updates being lost. rlb: (for example) rlb: string-ref is lockless too, and it's one index lookup followed by a search of up to "stride" chars to find the exact location. The stride depends on the string length, right now 16, 32, 64, or 128 (as an upper limit if the string is larger than 4GB). rlb: But don't spend too much time worrying about this unless you just want to. What I have now is unfinished, and has grown to be a good bit more work than I'd initially imagined. I do seem to keep working on it, but no idea if I'll actually finish it up well enough to have something worth proposing. rlb: (As mentioned mostly just wanted to make sure I wasn't doing something that already seemed clearly unacceptable.) lampilelo: if a user is calling string-set! on a shared string from different threads without any synchronization he's asking for trouble wingo: rlb: races for unlocked operations sound fine to me. (famous last words?) nly: is reactjs fine from a free software perspective? jlicht: nly: afaik, it seems to be perfectly fine free software jlicht: nly: I advise you to look into the patent situation, as I recall there being some potential issues nly: thanks dsmith-work: Happy Friday, Guilers!! mwette: hey all! zzappie: hellou rlb: wingo: ok, thanks, and of course I suspect in most cases, if we make this switch, string-set! and (bulk string-refs) will be best avoided (i.e. in favor of string-map/tabulate/for-each/etc.). rlb: (Internally, those won't use string-ref, etc. anymore.) lampilelo: rlb: is your wip code published somewhere? Noisytoot: What's the difference between use-modules and import? RhodiumToad: import is from RnRS, use-modules I believe is a guile-ism RhodiumToad: otherwise they should be compatible in the sense that any given module should be importable either way RhodiumToad: though I do recall some breakage with import from a while back RhodiumToad: oh yeah, it's (library) rather than (define-module) which is the issue, (library) was losing all source location info dsmith-work: import is more along the lines of C #include I think. It basically inserts the forms from the file at the point you call import. dsmith-work: use-modules is more like load. Happens at top level. But it also does a bunch of binding management. dsmith-work: (I've seen that use-modules calls load deep under the hood) RhodiumToad: last I looked, import was just syntax for use-modules dsmith-work: Oh! dsmith-work: was thinking of include, not import ! alextee[m]: is there a roadmap for the next guile release somewhere? dsmith-work: Ahh. yes. dsmith-work: daviid: Thanks rlb: ...been side tracked lately, so not much public progress there for a bit, though I have been working on potential defrecord/defprotocol support off and on. RhodiumToad: moo wingo: landed a little patch to elide arity checks when callee is known manumanumanu: wingo: cool! I have been thinking about what you said about how Cross-module inlining changes how we write code. I went back to some old guile 2.0 code, wrote some test benchmarks and started removing all the small tricks I used to make it run fast. It went from ugly code that used macros to inline things and a bunch of little ugly hacks to more or less standard scheme. Without sacrificing manumanumanu: performance. Meaning: If I wrote that code today, I would have spent a lot less time making the code ugly. At least that specific kind of ugly manumanumanu: wingo: did guile always check arities before? This seems like it could be a very nice addition in declarative modules... wingo: manumanumanu: before, for calls that didn't end up being contified or inlined, guile would always check arities, even if the callee was known (i.e. callk instead of call) wingo: now, if the compiler puts in a callk, it will later split the callee into two functions: one which checks the incoming arity and one that doesn't. the one that checks the arity tail-calls the one that doesn't. manumanumanu: now, I am not really up with the terminology, but contification is where several calls to one function returns to one place; (if x (f x) (f y)) manumanumanu: ? wingo: then it will update any callk with compatible arity to instead jump to the new unchecked entry wingo: yeah contification is if one function is always called with the same continuation. in that case it can be wired into the callee wingo: er wingo: caller :) manumanumanu: thanks. This seems like a wonderful little optimization addition then :) So, functions too large to be inlined, and uneligible for contification will become cheaper? manumanumanu: to call manumanumanu: How wonderful! zzappie: leoprikler: oh i didn't know this algo (fisher-yates) zzappie: daviid: thanks fo the tip! manumanumanu: is it the incremental shuffle? manumanumanu: zzappie ^ manumanumanu: daviid: I did not mean that in an insulting way. I was having to patch boot-9 of an installed guile that I meant as a hack. That is a sad way to have to go about it. zzappie: daviid: How your students were using guile? Did they use emacs? I'm asking because my friend started using guile and I found that for unprepeared people guile causes huge amount of frustration... rekado: “guile causes huge amount of frustration” or Emacs? rekado: I would agree that Emacs causes frustration, or at least learning Emacs while actually wanting to learn Guile. rekado: that’s the motivation behind guile-studio zzappie: If you not using emacs. And not used to search thing in info in emacs rekado: guile-studio aims to make Emacs more useful out of the box for hacking on Guile, while also configuring away some of its weirdest quirks. rekado: (it’s not 100% successful as some quirks still remain) rekado: here’s more information about guile-studio: https://elephly.net/guile-studio/ zzappie: rekado: Yeah I know about guile-studio It is great that you took time making it. But it still another editor with less quirks. :) People want to use their editor. rekado: it just occurred to me that it would be useful to discover any manual related to Guile and add it to the intro buffer on the right. rekado: oh, they *can* use their own editor. It just won’t have any integration at all. zzappie: manumanumanu: I don't know :) rekado: (Emacs is not strictly necessary to read Info manuals; there’s pinfo or just info, but they are inferior to the info reader in Emacs) manumanumanu: zzappie: if you ended up using guile's (random ...) you will need to seed it first, otherwise you will produce the same permutation every time you restart guile. zzappie: manumanumanu: ah its not necessay in my case it for maze generations zzappie: rekado: Yes. People need seacheable webpage with manual and lsp server today zzappie: This will greatly lower barier of entry zzappie: my friend was looking up racket manual because was lost in guile reference. manumanumanu: zzappie: I usually point people to the procedure index. manumanumanu: I always have a tab open: https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html#Procedure-Index zzappie: And btw Im telling it just to find what's guile folks think on this issue. If the people think that opting for modern style of tooling is not worth it cause most of guilers gnu+emacs hackers than Its completely fine. But I had the impression that guilers want to widen the community *: zzappie g2t afk for for few minutes wingo: a better web interface for info files would be really great leoprikler: I have yet to really integrate lsp-mode into my Emacs config, so yeah… leoprikler: btw. I can't seem to get this deterministic randomness, that people speak of leoprikler: okay, nvm I forgot I initialize it manumanumanu: leoprikler: start guile, do (random 100) a couple of times. Restart guile. Do it again leoprikler: leoprikler: okay, nvm I forgot I initialize it manumanumanu: I get 61 51 36 81 manumanumanu: oh manumanumanu: sorry, manumanumanu: I read "I forgot TO initialize it". leoprikler: heh leoprikler: I've copypasta'd the fisher-yates back and forth manumanumanu: I usually just read from /dev/urandom :) leoprikler: In some implementations, I do initialize it, because I want to have a new state on each startup, in others I want the determinism and thus don't initialize it. leoprikler: I confused one case for the other ;P zzappie: hey is there such thing as portable scheme code? Meaning that you can just run it with most of cheme implementations? Sticking with r5rs enough or its harder than that? manumanumanu: Sticking mostly to r6rs means guile and chez works just fine. zzappie: manumanumanu: cool! need to try that one day lampilelo: am i crazy or should (test-end) from srfi-64 not reset current test runner if it was installed globally? lampilelo: am i supposed to set the test runner before every test-group call? lampilelo: i think that's a bug, added by fixing another bug, in last august leoprikler: i think most suites won't see that bug, since they have one group per file, but it does sound like a bug lampilelo: srfi states that the runner should be removed in test-end if it was added by test-begin, but it removes it unconditionally manumanumanu: I don't like srfi-64. It does weird things. lampilelo: i think there's another bug: test-group expects the runner to be set, and errors out if it's not lampilelo: manumanumanu: what do you mean by weird things? maybe the implementation is just buggy manumanumanu: it is the reference implementation, more or less. leoprikler: it is also imperative and imperative = eww manumanumanu: I have met cases where the reference implementation does not conform to the spec (one was however a misunderstanding). Taylan rewrote large chunks of it because he got tired of it lampilelo: so what do you recommend? lampilelo: i mean instead of srfi-64 manumanumanu: for guile, nothing :( manumanumanu: If you need the flexibility of srfi-64 then srfi-64 it is. manumanumanu: other than that, I am going to implement (chibi test) on top of srfi-64 whenever I have the time. That does less, and does what most people do want. rekado: I used ggspec before I learned about srfi-64 rekado: https://github.com/yawaramin/ggspec/ chrislck: ah ggspec... written by yawaramin for gnucash and never used chrislck: he'd be proud to know it was actually used lampilelo: :D lampilelo: i think i'll stick to srfi-64 because less dependencies lampilelo: but i'll try to fix it first lloda: i'm sorry about the srfi-64 bug. I just applied the patch from upstream without giving it a second thought lampilelo: lloda: those buggers from upstream lampilelo: i think the proper fix would be to install a cleanup function in the newly created runner's on-group-end field, but since it's a reference implementation i wonder if i'm not misunderstanding the srfi lampilelo: why hasn't it been fixed already? abcdw: I get very strange behavior with my guile code: If I evaluate forms one by one, everything works as expected, if I evaluate the whole file it works differently. For purity extracted the code to separate file, still have the same issue. Can someone point out, what I did wrong?( abcdw: https://paste.sr.ht/~abcdw/8c1754cbe135b2f4505ca33254f3dd2b03dc892d lampilelo: abcdw: does it work the same if you restart your repl and try again? lampilelo: also why do you have the definitions wrapped inside a begin block? dsmith-work: Thursday Greetings, Guilers lampilelo: hi dsmith-work abcdw: lampilelo: yes, tried to restart repl. Because I was experimenting with evaluating 4 those forms at once, works the same as evaluating the whole file. Nothing changes without begin. abcdw: it's very strange, evaluating forms one by one produce different result from evaluating 4 forms at once using begin or C-c C-k. apteryx: could someone walk me through understanding the primitive-fork return value? It can return either the 0, meaning we are in the child thread; or a pid, which means we are in the parent and got the pid of the child process; what I don't understand is given this duplicity and single call; how are the two conditions 'visited' in the parent thread? does it implicitly calls primitive-fork a second time apteryx: when returning from the thread? civodul: apteryx: child *process*, not thread civodul: but yes, what you describe is correct civodul: fork(2) creates a child process that's a clone of its parent civodul: the only difference is that it returns 0 in the parent and the child's PID in the parent civodul: now, in Guile, it's often "safer" to avoid 'primitive-fork' and use 'open-pipe*' & co. apteryx: OK. I've seen this in the manual, but I need my open-pipe* to run with a specific user/group, and apparently we can't change the current process userid/groupid (that's in shepherd, probably because that process is PID 1?) apteryx: thank you for the explanation! civodul: in Shepherd you can use fork+exec-command apteryx: I also need to capture the output :-) civodul: now you're too demanding, what can i do :-) apteryx: hehe civodul: seriously though, we should have the whole gamut of process-fiddling procedures in a Guile module apteryx: there's #:log-file that I could set to a temp file, but I'd have to adjust that temp file's permissions for the specific user/group civodul: Gash has most of it too apteryx: yeah that'd make sense abcdw: civodul: Yep, it would be really cool to have a module with a bunch of helpers for running processes, capturing their outputs and so on. apteryx: even in a child process of shepherd, I don't have the permissions to use setgid and setuid; ideas? In procedure setgroups: Operation not permitted civodul: apteryx: you have to call setgroups before setgid and setuid apteryx: I mimicked what the shepherd does in its exec-command procedure: (setgroups #()) before the setgid call, but that still fails. mmh. apteryx: perhaps something to do with the CAP_SETGID capability apteryx: I'm testing the Shepherd service via the Guix system test framework rlb: lampilelo: not sure if it's the issue you were hitting, but wrt newer versions of our srfi-64 support, you might need something like this: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/scm/test.scm#L9 to avoid a crash when trying to use the test status to determine an exit status. rlb: wingo: regarding the approach I've been toying around with for utf-8 strings. If stringbufs are immutable, and we still support shared mutable strings/substrings on top, and if we're going to atomically/locklessly swap the string stringbuf whenever there's a modification, then that means that competing string-set! calls (on strings that share the same mutable stringbuf) might lose updates? If so, is that "don't do that then", or a rlb: critical difference/problem with respect to the current behavior? lampilelo: no, that's not my issue, i've already submitted a patch to srfi's mailing list rlb: Ahh, ok. rlb: e.g. given competing (string-set! x 5 #\x) (string-set! y 11 #\y) calls, there's a read/update/write(swap) race. So #\x or #\y could be lost from the final stringbuf, etc. With the current code, of course, and assuming no "torn word writes", both should eventually "settle" thread-visibility-wise. rlb: (And also, of course, the performance of one-at-a-time string-set!s is going to be atrocious for non-ascii strings anyway, so eventually, you'd want to avoid that whenever you can...) nly: no ,doc ? wingo: should be wingo: not all functions have docstrings of course wingo: actually i wonder if ",doc" is broken somehow; ,d works wingo: good morning! cheim0: ,doc = ,describe? nly: morning :D nly: thanks BitPuffin: Are there any wlroots bindings for guile? If not, what's the best way to generate c bindings for guile, swig? rekado: BitPuffin: I had excellent result with the ffi-helper that’s part of nyacc BitPuffin: Oh, first time I hear of nyacc BitPuffin: Looks interesting! rekado: it made writing Guile bindings to DRMAA much easier rekado: all it takes to get started is define-ffi-module like here: https://git.elephly.net/?p=software/guile-drmaa.git;a=blob;f=drmaa/v1/ffi.ffi;h=4327926aef2aaa87097247051cbb68e360f82228;hb=HEAD rekado: when fed to the ffi-helper this results in a module that I’m importing here to provide more Scheme-like bindings: https://git.elephly.net/?p=software/guile-drmaa.git;a=blob;f=drmaa/v1/low.scm;h=4e9ac55096222969a2cb79ca74c6e5162de7ca4d;hb=HEAD flatwhatson: does that make nyacc a runtime dependency of your package? rekado: flatwhatson: the generated code depends on one module that nyacc provides. You can copy that module to avoid a runtime dependency on nyacc. rekado: that is what guile-libyaml does flatwhatson: ah, perfect! BitPuffin: rekado: so after you have the raw binding you make more scheme friendly abstractions on top? leoprikler: yep nly: how do i display favicon from guile web server? BitPuffin: nly: guile web server only gives you some very basics, you basically have to either load and serve it as bytes, or serve it with a reverse proxy in front of the web server like nginx BitPuffin: Afaik at least wingo: you could handle the favicon path and return a suitably-mime-typed bytevector wingo: but yeah i usually get nginx to handle the static things BitPuffin: Gotta be webscale leoprikler: render it ad-hoc with guile-picture-language :) BitPuffin: wingo: are there any more or less meaningless microbenchmarks of guile vs C out in space that you know about? BitPuffin: By space mean cyberspace nly: thanks dsmith-work: {appropriate time} Greetings, Guilers leoprikler: BitPuffin: you mean other than http://wingolog.org/archives/2019/06/26/fibs-lies-and-benchmarks ? BitPuffin: Oh, first time I'm seeing this BitPuffin: Was searching earlier but nothing cool came up BitPuffin: Will give it a read lampilelo: BitPuffin: this benchmark is for guile version < 3, guile became a bit faster since then: https://wingolog.org/pub/fosdem-2020-images/guile-3.0.0-vs-2.2.6-microbenchmarks.png BitPuffin: Ah yeah pretty sure I've seen this one, but it is guile vs old guile right? lampilelo: BitPuffin: yes ArneBab: BitPuffin: there is also Guile (3.0.4, current is 3.0.5) vs. Scheme-to-C-compilers by ecraven: https://ecraven.github.io/r7rs-benchmarks/ — gambit/gerbil compiles Scheme to C, Chez is crazy assembly-optimization, racket is Chez, then you get the Schemes that are roughly as fast as Guile 3. The benchmarks also show Guile 3 vs. Guile 2, so they can make older benchmarks somewhat comparable to Guile 3. zzappie: hello guilers! anyone knows function analogous to rackets shuffle in guile libs? zzappie: * shuffle: Returns a list with all elements from lst, randomly shuffled. wingo: woo, i have a pass to elide arity checks wingo: (good evening zzappie :)) wingo: zzappie: nothing in guile's libs i think zzappie: hello :) zzappie: already stolen it from racket wingo: great zzappie: only changed those square brackteers dsmith-work: silly rackettes, square brackets are for clojure (, and emacs-lisp) dsmith-work: rlb: what's your clojure thing called again? leoprikler: zzappie: I have manually implemented good ol fisher-yates daviid: and configure.ac daviid: zzappie: fwiw, patches and tips in guile-cv's manual sibling sections dedicated to 'configure guile for guile-cv', so repl and raised exceptions do truncate their output, work fine with geiser daviid: manumanumanu: it is not a hack, it is a nive and clean patch - the hack is to have to ask users to apply it, unfortunately daviid: *nice ...by lloda - we both, and any one of us working with large structures, depends on the patch, otherwise, guile is just unusable daviid: most users are dead scared to patch (ice-9 boot-9) themselves though, hence guile is unusable - form them,guile-cv users and any other users who have to manipulate large structures daviid: i stoped working on guile-cv, it was to teach yung adults and not so young adults :), but defiitely beginners for most of them, to use scheme and have fun doing so image processing ... even phd students didn't feel confortable to patch ... daviid: dsmith-work: lokke daviid: https://git.sr.ht/~rlb/lokke manumanumanu: Ahoy! wingo: moin :) rgherdt_: Moin! manumanumanu: Anyone here on 3.0.5? manumanumanu: can anyone tell me when I can have definitions in expression context? It doesn't seem to be allowed in cond clauses. terpri: manumanumanu, i'm on 3.0.5 and it appears to be permitted terpri: let me check cond in case 'define' is magic terpri: (cond (else (write 'o) (define k 'k) (write k)) prints "ok", seems to works fine terpri: work* manumanumanu: that expands to a simple (begin ...). try this: (define (a b) (cond ((= b 1) (define c (+ b 222)) c) (else 33))) manumanumanu: there seems to be some kind of limitation there. it's fine. I was just surprised. zzappie: hey does anyone has a tip how to prevent guile from pringing out huge records in repl? zzappie: *printing manumanumanu: it is possible, but I have forgotten how... manumanumanu: ah! https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile_0027s-repl_002dprint-procedure.html manumanumanu: the error printing is not afected iirc wingo: there is a repl option wingo: ,option on-error print wingo: or something like that manumanumanu: ",option on-error report" maybe manumanumanu: TIL lloda: i think the point isn't to replace debug/backtrace wholesale, just to fix how values are printed within those manumanumanu: well, the (system repl common) truncate-print trick works when there are no errors lloda: there's a sibling section in the guile-cv manual for truncate-printing in errors lloda: it's a hack tho manumanumanu: "The module we need to modify is (ice-9 boot-9)" ... :P manumanumanu: that must be the definition of a hack manumanumanu: are parameters available in boot-9? If that is the case, I could take it upon myself to patch it. Exceptions are, well, exceptions and having that kind of indirection wrt error printing shouldn't do much to performance. lloda: what that hack does is patch a function simple-format that is used in (ice-9 boot) in all the default exception printers lloda: if you can figure out a clean way to fix this issue that would be greatly appreciated lloda: imo a lot of this is kinda broken atm lloda: it cannot be the intention that errors print as lloda: 'Bad on-error value ~a; expected one of ~a ...' lloda: you see those format specifiers leak to the generated output all the time lloda: anyway i think the code where the error is printed isn't in the best position to decide how values should be printed. That should be delegated to the user who has to read them zzappie: ooh thank you this is what I was looking for zzappie: but truncation doesnt work in geiser for some reason lloda: There is an old bug for this https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29669 lloda: you can add that there zzappie lloda: likely it's bc of how geiser communicates with guile zzappie: only worked for (define tprint (lambda (repl obj) (truncated-print obj) (newline))) and then ,option print tprint zzappie: lloda: oh that was I just did yep :) define was redundant though dsmith-work: Morning Greetings, Guilers brendyyn: leoprikler: Do you consider it a bug that it just makes guile crash? brendyyn: Interesting. Chez crashes too but it says "out of memory" first. leoprikler: I'm not sure what Guile's OOM story is. leoprikler: the thing about OOM is that you can't guarantee you'll have enough memory for raising an error wingo: leoprikler: yeah it's a problem! rekado: leoprikler: perhaps the old sysadmin trick of reserving space (memory in this case) to be used for the OOM case is applicable here wingo: interesting idea. would have to be clever regarding mlock and such wingo: to make sure that freeing the memory would actually free some memory daviid: fleabag wingo: hm? :) daviid: sorry, wrong window... ArneBab: wingo: maybe creating the error at startup so it can still be given when nothing can be allocated anymore? flatwhatson: like keeping a pre-allocated sigstack around for segv handling chrislck: Monday greetings! dsmith-work: Monday Greetings, Guilers Noisytoot: wingo, By mlock do you mean ChanServ mlock, or something else? dsmith-work: Why does (myor1 #f) => #f but (myor2 #f) => () ? https://paste.debian.net/1194322/ dsmith-work: Guile is 3.0.4 ft: I think you want (apply myor2 (cdr args)) dsmith-work: Ahh dsmith-work: Indeed dsmith-work: ft: Thanks! RhodiumToad: (define (myor . args) (any identity args)) dsmith-work: RhodiumToad: Very nice hugo: Is there any Guile/Scheme game-dev channels on freenode? nebunez: hugo: #lispgames might be of interest to you zzappie: hugo: there is #lispgames lispmacs[work]: hi, I'm trying to remember what is the easiest way to generate a list of numbers in a range (0 .. n) lispmacs[work]: not that it would be hard to implement, but thought there might be an SRFI word for that or something lispmacs[work]: eh, well, just implemented it zzappie: lispmacs[work]: too late but there is (iota x)... :) lispmacs[work]: zzappie: thanks ft: lispmacs[work]: srfi-42 is the one you're looking for if iota is not good enough. lispmacs[work]: ft: thanks dsmith: sneek! dsmith: sneek: botsnack sneek: :) dsmith: goodbot dsmith: nckx: Thanks for the heads up. dsmith: sneek: later tell nckx Thanks for the heads up regarding the bot. sneek: Got it. lampilelo: sneek: later tell lampilelo foo sneek: Will do. lampilelo: foo sneek: Welcome back lampilelo, you have 1 message! sneek: lampilelo, lampilelo says: foo leoprikler: sneek tell lampilelo foo sneek: lampilelo, leoprikler says: foo lampilelo: didn't know about that command apteryx: is anything available in Guile as an alternative to shelling out to pgrep? leoprikler: you'd probably have to stitch it together using ffi calls civodul: or rather (scandir "/proc") :-) civodul: (guix scripts processes) has some stuff civodul: and (guix store roots) nckx: dsmith-work: Thank you for fixing it! chrislck: Small query about the schemified read() -- this slowdown is during compile only, right? if my code doesn't use eval, .go files will still be as lightning fast as ever? NathanSchmidt: Hello! I'm currently trying to figure out an error pertaining to the use of predicate checking in (ice-9 getopt-long). I'm using guile-2.2 on Debian 10. Currently getting a backtrace ending in "ERROR: Wrong type to apply: str->num?" whenever I run it with an option which does predicate checking (e.g. for --length-dmem 1024, but not with --help or NathanSchmidt: no options at all). The relevant part of my program is here: https://gitlab.com/schminak/tiny-machine/-/blob/master/tiny-machine.scm NathanSchmidt: According to the reference[0], "you may need to use quasiquotes to get it into grammar" pertaining to the predicate property. I'm not entirely sure of what that means. Perhaps that has something to do with it? NathanSchmidt: [0]https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/getopt_002dlong-Reference.html NathanSchmidt: The reference states that for (predicate func), func should be a function accepting a string and returning a bool - which it is. NathanSchmidt: (str->num? "42") returns '#t', for example. NathanSchmidt: Where str->num? is given as: NathanSchmidt: (define (str->num? s) (string-every char-set:digit s)) RhodiumToad: hm RhodiumToad: that sounds like it wants the actual procedure value to be in the form, not a symbol RhodiumToad: so the option-spec might need to be like RhodiumToad: `((help ...) (length-imem (value #t) (predicate ,str->num?)) ...) RhodiumToad: that would be what I'd try first, anyway NathanSchmidt: I've since tried that with the backtrace giving: NathanSchmidt: ERROR: Wrong type to apply: (unquote str->num?) NathanSchmidt: I do appreciate the suggestion, by the way. NathanSchmidt: I have come across something that leads me to believe the docs are inadequate. NathanSchmidt: http://wiki.call-cc.org/eggref/5/getopt-long NathanSchmidt: By using the docs for chicken, I have made progress, though I'm still working at getting the desired result from my program RhodiumToad: I don't get that error RhodiumToad: what exactly did you do? RhodiumToad: did you remember to change the ' to ` before the value? RhodiumToad: (because the error you got is the error you would get if you failed to do so) NathanSchmidt: I did not remember to change the ' to `. It is now working, it seems. NathanSchmidt: I greatly appreciate your help. Thank you. RhodiumToad: yw Zelphir: Hi! I have a question about organizing imports or modules. I often have modules in subdirectories and stuff. I see myself facing the following 3 ways of dealing with it: (1) add subdirectories to the load path when calling guile via the -L argument (2) adding the whole location of a module to its name, as in: (library (app lib mymodule) (export ...) (import ...)) or (define-module (app lib mymodule) ...) or (3) make use of (add-to-loadpath ...) Zelphir: stuff. Which one is the preferred way? Or is there yet another way? leoprikler: Zelphir, the preferred way is to have GUILE_LOAD_PATH point to the top of you module tree, e.g. /path/to/src/modules and construct load paths from there leoprikler: e.g. if you have /app/lib/mymodule.scm, you'd use that as (app lib mymodule) leoprikler: you may want to re-export stuff from (app lib mymodule) in a more top-level module leoprikler: for instance, in Tsukundere (a VN engine I'm developing), I use subdirectories for the implementation parts and export all functions, that should be publicly available from (tsukundere) leoprikler: (ice-9 peg) is also divided into parts, that are re-exported leoprikler: As are many things in the Guile source code itself. Zelphir: Ah, ok with re-export I could shorten that list of parts that identify a module. I will consider that in my case, thanks! Zelphir: I was also thinking about: "What if I need to move the module into another directory?" Then I would have to adapt the module identifying list again and all the places where I import it. But I guess that's normal? Like in any (most?) other languages, I would have to adapt at least the imports. leoprikler: Exactly, you need to rewrite your imports then. leoprikler: If lib is usable as its own outside the context of app, perhaps you should implement it separately (i.e. as (lib)), but other than that I see few issues Zelphir: Yep, that's what I try with fslib. Basically I don't want to have a copy in each project and then modify them all independently. If I can install them as dependency with guix, I should be able to reference it without adding manually to the load path or having a copy everywhere. leoprikler: Yep, you should go for a Guix package. leoprikler: Perhaps also provide an Automake setup for traditional distros if that's a concern. yoctocell: Is there a way to "apply" a macro? Let's say I had a list of booleans, and I wanted to "apply" the 'or' macro on the elements of the list. If 'or' was a procedure, I would do (apply or LIST-OF-BOOLS), but it is a macro so that won't work. lampilelo: yoctocell: (eval `(or ,@lst)) yoctocell: lampilelo: Works like a charm, Thank you! lampilelo: yoctocell: wait, what? i thought it was #emacs, this shouldn't work for guile, would work with primitive-eval lampilelo: people here don't take kindly to using eval, though chrislck: get the rope! lampilelo: last time i mentioned it someone added it to a ban list lampilelo: :D lampilelo: i think someone even mentioned "root of all evil" or something like that chrislck: eval is evil lampilelo: yoctocell: so the correct thing to do would be using "(any identity lst)" from srfi-1 lampilelo: because chrislck is watching Zelphir: :D *: chrislck stashes the rope now lampilelo: :D lampilelo: i think you meant "for now" Zelphir: You could also put ~or~ in a procedure and then apply the procedure using apply. Zelphir: Not sure this is entirely correct, but something like the following: Zelphir: (define myor Zelphir: (lambda (. args) Zelphir: (cond Zelphir: [(null? args) #f] Zelphir: [(car args) #t] Zelphir: [else Zelphir: (apply myor (cdr args))]))) chrislck: s/#t/=> identity Zelphir: Ah yes, that makes sense. You would not want to return only #t, if you got other things than booleans in that list of arguments. leoprikler: chrislck: What do you think about this use for eval? https://paste.gnome.org/p0ibmnjcf lampilelo: i think defmacro is also frowned upon :D leoprikler: This is Elisp. lampilelo: why? leoprikler: whynaut? lampilelo: idk, feels wrong to mix the two Zelphir: So it is Guile outputting Elisp? Zelphir: Or completely Elisp? lampilelo: it's elisp written for guile vm, it creates a binding to guile's define-peg-pattern so that it can be used from elisp lampilelo: guile can interpret elisp lampilelo: Zelphir: https://www.gnu.org/software/guile/manual/html_node/Other-Languages.html Zelphir: "Nil - A third boolean." -- That takes me back to database lectures :D leoprikler: Zelphir: It's Elisp evaling Scheme. leoprikler: @ is a real life-saver in our elisp bindings, it makes so many things possible rlb: (Also quite useful for clj dialects.) leoprikler: Is Clojure not a Scheme? Noisytoot: leoprikler, It's not a Scheme, but it is a Lisp leoprikler: Ahh, okay lampilelo: it's a scheme to close stuff rlb: It has a lot of similarities with Scheme, but among any number of other things, it's notably polymorphic by default (e.g. with respect to functions that operate on "sequences" rather than concrete types like vector, cons-pair, etc.). Also notable for being "persistent (immutable) by default", fwiw. wingo: here's a concept: $kfun whose clause is $kargs instead of $kclause. could denote a function that doesn't have to check number of incoming args wingo: could only be called via $callk, and requires caller to provide the right arity wingo: would be nice to unify with $kclause somehow such that body of $kclause could be one of these new $kfun's wingo: would allow eliding argument checks for calls within a compilation unit wingo: could allow some callees to avoid checking if stack space were available, if we had a red zone... rlb: Sounds interesting. Do we already support any kind of type-check elision? wingo: yes wingo: but only intra-procedural wingo: there is "global" (i.e. across basic blocks) type analysis wingo: can elide redundant type checks wingo: redundant == type check A dominates type check A' wingo: but interprocedural, there's nothing rlb: Ahh, ok. If it were feasible, I suppose interprocedural could give another advantage to scheme code over C implementations... cheim0: davexunit: for the multisampling capability check in chickadee, I'm gonna focus on adding a binding for SDL_GL_ExtensionSupported to guile-sdl2 Zelphir: https://www.gnu.org/software/guile/manual/html_node/Other-Languages.html Couldn't that "python-on-guile" be added there? leoprikler: sneek later tell Zelphir the manual only talks about languages implemented in Guile itself, not third party projects sneek: Okay. brendyyn: guile -c '(expt 2 999999999999999999)' segfaults and crashes guile for me. brendyyn: Would have thought it would just tried for ages or error somehow at least if its too big cybersyn: hiya guilers, i've been programming in racket for about a year, and started using guix in the fall, and through this realized I prefer guile, due to the built in ,apropos documentation, as well as the realization that the many amazing languages in racket tend to be different enough that they don't associate well with others. tons of great stuff there, but guix has become more important for me. so now its time to properly learn guile! cybersyn: (until now I've mostly figured it out as I go along). cybersyn: any suggested guile roadmap? cybersyn: also, while i did a first "tourist" pass of SICP over a couple months last year, i've started working more seriously on it and lockywolf's wonderful study of it has inspired me to get more focused. has anyone added implemented srfi-216 in guile? lampilelo: cybersyn: the one thing i would suggest is reading guile's info manual if you haven't done it already cybersyn: i've read up to the section with C, but after that it seems to take on a more reference manual form. i'm wondering if there is anything that gives more of tour of the culture (interesting ways people customize their .guile, and stuff like this), the ecosystem, things to be weary of, and the like leoprikler: sneek, later tell brendyyn the hard limit seems to be (expt 2 (expt 2 28)) and likely has to do with the amount of continuous memory you'd need to allocate for that sneek: Will do. zzappie: hey guilers! zzappie: Anyone has a link to a completed guile beginner tutorial? zzappie: want to share with my friend but only found half completed tutorials leoprikler: What would that look like (as opposed to a crash course on Scheme)? zzappie: leoprikler: which crashcourse you are refering to? leoprikler: for instance Guix' crash course on Scheme leoprikler: which you can find in the cookbook iirc zzappie: ah forgot about that one! leoprikler: Is that me or does the language reference for elisp choke on keywords? leoprikler: s/reference/spec nckx: dsmith-work: People are clamouring for sneek! Just in case you were unaware and not at w--oh. leoprikler: Is it possible to use Guile syntax transformers from Elisp? rlb: wingo: thanks regarding the general priorities. manumanumanu: I'm running the r7rs benchmarks just to compare 3.0.1 and 3.0.5. What happened with the tak benchmarks? :P manumanumanu: 2x-2.5x faster manumanumanu: ah what times to be alive! manumanumanu: let me try that again: what a time to be alive! manumanumanu: never mind. benchmarking is hard. Still faster, but nothing that dramatic. lampilelo: now let's implement io_uring interface for guile to have even faster io! mwette: here is the nyacc .ffi file for liburing: https://paste.debian.net/1194100/ lampilelo: i mean in the core as a backend for ports lampilelo: mwette: that's the first time i hear of nyacc civodul: mwette: impressive, again! manumanumanu: mwette: what is going on there? lampilelo: so it's a lalr(1) parser with a c parser implementation and a helper for generating bindings from c to guile? manumanumanu: nyacc is a lot more than that :) But that is indeed what seems to be going on. lampilelo: or is it a wrapper around bison? mwette: The ffi-helper will read include files and generate guile code using the guile's ffi front end and guile bytestructures. It's sort of a "get me started" approach to working with C libraries. mwette: Within nyacc, one generated the file posted and then executes "guild compile-ffi ffi/liburing.ffi". That generates a guile .scm file, 926 lines in this case. mwette: see output here: https://paste.debian.net/1194105/ lampilelo: nice, is it stable? lampilelo: ah, it's 5 years old already mwette: nyacc is lalr written in scheme from ground up, based on algorithms in the dragon book mwette: It uses a C parser (which parses comments, too) and then expands typedefs as necessary to provide SXML representations of the C declarations. Once that is done it converts the declarations to ffi interface code. mwette: The ffi-helper supports "use-ffi-module". For example, (ffi gobject) uses (ffi glib), ... and (ffi gtk+) uses (ffi gobject) (ffi pango) (ffi gdk) ... lampilelo: now i wonder how does it compare with swig lampilelo: afaik swig generates c code, doesn't use guile's dynamic ffi mwette: I think so. But I don't know how much work you have to put into a config file for swig. mwette: Oh. It looks like the ffi-helper failed on converting unions altogether. Not gonna work for liburing right now. mwette: The anonymous unions at least. lampilelo: try parsing c++ next :D mwette: haha. Not with a lalr parser. leoprikler: Do a peg parser then :P mwette: thought of it mwette: I have also thought of converting lalr to use CPS for parse and lex functions. pkill9: maybe there's a similarity between concepts of symbols in lisp, and the concept of words being actions, or maybe i'm just overhitnking pkill9: overthinking* *: wingo has a design for faster inter-module calls, whee tohoyn: sneek: botsnack sneek: :) dsmith-work: Happy Friday, Guilers!! dsmith-work: !uptime sneek: up 5 days, 20 hours, 27 minutes rlb: wingo: vague question (and "it depends") I know, but do you have any strong inclinations wrt string processing by making an extra pass so you can do a single precise allocation of the result (or final precursor of the result) vs using a stack buffer for the common, smaller case and realloc doubling when necessary? rlb: (Of course sometimes it's clearer, i.e. when it might be expensive to compute the result chars (e.g. string-map, string-tabulate).) rlb: If not, no worries, just wanted to keep any inclinations in mind. manumanumanu: So... I just found myself sorting a million bytes, and finally got to write a counting sort. It ended up being about 30x faster than regular sort :) manumanumanu: with expected benefits being much larger when I use actual data, which might be much larger. p0a: Hello p0a: I am a newcomer to Guile, I curious if it is possible to create a secure sandbox in it, with a set of functions that the user can use. p0a: I think this is related to `bindings', is that what allows this? dsmith-work: p0a: Ya, there are ways to start with an environment that has little or no bindings, and then you can add what you want. I've never messsed with that though. dsmith-work: p0a https://www.gnu.org/software/guile/manual/html_node/Sandboxed-Evaluation.html p0a: dsmith-work: before I read about the sandboxing, I should know what bindings are p0a: dsmith-work: do you know where I can read on the prerequisites? I know lisp but it's been a while dsmith-work: Well, A "binding" is basically having a name for a value you can use it. p0a: so a binding is an entry in the symbol table under the scope -- or however that is expressed? dsmith-work: s/value you/value so you/ p0a: are there predefined sets of bindings that are reasonable for safe evaluation? such as immutable/functional subsets of Guile p0a: I want the user to be able to do (+ 1 2) but I don't want to miss out on any math functions, or otherwise, that the user might need dsmith-work: p0a: That pages lists quite a few. p0a: `composite sets', got it! thanks. I looked at the page but did not understand it on a first read p0a: One more question: the API will include interactions with a DB. I don't want a time limit on certain bindings. Is that possible? p0a: (I'd prefer if the DB API timed out instead of Guile bluntly shutting down the computation) dsmith-work: p0a: Not sure. Never used that. But I would think you could adjust the sandbox timeout to be longer than your db timeout. p0a: dsmith-work: the problem would be if that info is not known to me p0a: or if I don't want other operations to have a long time-out, except for the db API... oh well p0a: That's not so important, thanks dsmith-work: I wonder if you could set a "none" timeout. Or maybe just a really long one. p0a: the server won't DDOS right? p0a: I'm guessing not. It really is a server for 1 user in my case. Or maybe 2-3, that's about it. I can't imagine several users using it wingo: rlb: no strong inclination. i guess if i had to say something it would be these priorities in descending order -- 1. avoiding buffer overflows / memory issues 2. simplicity 3. speed apteryx: Is it possible to forward declare a definition in a module? apteryx: so that it can be used before its actual definition lampilelo: apteryx: if it's not used before it's defined when you run the code it doesn't matter where you put the definition, you'll get warnings on compilation, but the code will work regardless apteryx: yeah, I'm trying to use it before it's defined lampilelo: in the runtime? apteryx: It's a huge sexp blob containing test data, I'd rather 'hide' it at the bottom of the module apteryx: ah, it's even used by syntax, so I guess there's no way around it lampilelo: you can always put it in a separate file and load it at the top of your module apteryx: true, although that doesn't seem to have been used in the code base so far. thanks for the ideas. apteryx: any pattern to load a module relative to the current module? apteryx: or not even a module but a source file containing the definition manumanumanu: (load "...")? manumanumanu: or (include ...) manumanumanu: include being the better choice. apteryx: manumanumanu: OK! And these will work no matter the CWD (e.g., they are relative to the source file it's run from?) manumanumanu: yes. manumanumanu: i believe so. p0a: no wait a moment p0a: I think it's relative to whatever the user has set up right? Before running the source file p0a: "If file-name is a relative path, it is searched for relative to the path that contains the file that the include form appears in. ", okay you are correct, sorry apteryx: thanks! dsmith-work: UGT Greetings, Guilers everstone: How can I use a list of arguments as arguments instead of as a the list it is? I'm trying to do: (format %my-list) zzappie: everstone: you can (apply format %my-list) everstone: zzappie: thank you! zzappie: also one thing I didn't know for a long time is that ((lambda x x) 'wrapped) will result in (wrapped), this way you can ignore arity of which is sometimes handy lampilelo: zzappie: can you give an example? ((lambda x x) 'foo) is functionally equivalent to (list 'foo) zzappie: lampilelo: I meant that I always wrote (lambda (args) body) and didnt know you can (lambda arglist body). There are times for example you need a function that accepts any number arguments so you can use this for for that, or even show that you dismiss args entirely and write (lambda _ body) *: zzappie *use this form for... lampilelo: ah, ok, it wasn't clear to me what you wanted to say yoctocell: Is there a way to split a string based on a string predicate? e.g. I want "AdelimBdelimCdelim" => '("A" "B" "C"), `string-split' only accepts a character predicate. dsmith-work: yoctocell: https://www.gnu.org/software/guile/manual/html_node/List_002fString-Conversion.html#index-string_002dsplit `char_pred` can be a char, a char-set, or a predicate procedure. dsmith-work: Ah yoctocell: dsmith-work: Ah, ok, thanks! dsmith-work: yoctocell: Unfortunately, that pred gets passed only one char at a time. And from back to front too. yoctocell: dsmith-work: I don't think that will be a problem, I can just filter out the empty strings. everstone: I'm really liking this first introduction to lisp so far! To be told syntax is illegal eventho I see it used in the sourcecode is annoying, but it encourages me to be creative :^) dsmith-work: Anyone know of any cheap (think rpi) ppc/ppc64 systems/boards? wingo: rlb: i think some degree of increased GC allocation is acceptable. sometimes it even makes things faster. and in future we'll probably have a generational gc which will make short-lived allocations even cheaper wingo: so, something to worry about, but not like a deciding factor to choose between different implementations dsmith-work: Wednesday Greetings, Guilers everstone: I sidestepped my issue from earlier via a translation table manumanumanu: why is the write-line that was just documented in a recent commit so badly named? :P wingo: would rather deprecate it tbh manumanumanu: seems like a decent idea. write-line uses display semantics :'( dsmith-work: Probably a mental echo of someting from a camelbacked language with impoverished identifiers. wingo: well racket has println wingo: or something like that, right? wingo: i mean the idea of "print this then make a newline" is not so uncomment wingo: omg wingo: uncommon manumanumanu: wingo: displayln *: wingo has working cross-module inlining, whee civodul: oh! wingo: is in wip-inlinable-exports wingo: some work remaining to do tho wingo: like, actually benchmark it :P wingo: & figure out what user expectations are wingo: but would allow us to make more first-class definitions across a module boundary without define-inlinable wingo: seems to compile guile fine & pass test suites, but guile's code is biased in that we know that modules are optimization boundaries and code around it wingo: ok zzz wingo: night :) rlb: wingo: thanks - I've ended up pursuing variants, e.g. sometimes preallocating a utf-32 array up front, populating that, traversing it to compute the final utf-8 size, allocating that sized string, and then filling it in via memcpy (e.g. string-tabulate), or using a dynamically resized (doubling as needed) array for either utf-32 or utf-8, and copying that to a properly-sized, indexed utf-8 string at the end. In the latter case, it rlb: starts optimistically with a stack buffer (currently 1024) so it only needs scm_gc_malloc_pointerless resizing when that's insufficient. rlb: (e.g. string-map, unfold, etc.) rlb: We could of course do the same thing(s) somewhat less efficiently in scheme by accumulating a list of fragments (possibly reversing it) and then (apply string-append items)... civodul: wingo: it looks like "dynamically-created" modules like https://git.savannah.gnu.org/cgit/guix.git/tree/gnu.scm#n40 don't play well with the new re-exports wingo: there are a few bugs regarding re-exports civodul: in this case, if you have a file that just does (use-modules (gnu)) (pk delete), it fails with "delete: unbound variable" civodul: where 'delete' is reexported by (gnu services) wingo: ! wingo: is (gnu) dynamically created? wingo: which module is dynamically created, here? civodul: (gnu) civodul: well, it's populated by calls to module-use! at run time civodul: and i think that's what causing troubles civodul: the (module-use! i (resolve-interface m)) bit above wingo: i guess this is related to daviid's issue nly: hi dsmith-work: Morning Greetings, Guilers kaletaa: hello - is there a way to retrieve the current module on the C side? sneek: kaletaa, you have 3 messages! sneek: kaletaa, mark_weaver says: run "guix package -i" as your normal user, not root. sneek: kaletaa, mark_weaver says: "guix package -i" installs the programs in the profile of whatever user ran that command sneek: kaletaa, mark_weaver says: to install packages in the "global" environment, which is only possible in GuixSD, add them to the 'packages' field of your OS configuration and re-run "guix system reconfigure ..." civodul: sneek: seen mark_weaver sneek: I think I remember mark_weaver in (here?) 3 months ago, saying: :). rlb: wingo: regarding re-exports, I ended up adding this https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/compat.scm to silence some warnings. rlb: since I couldn't re-export-and-replace in the define-module form. leoprikler: kaletaa: scm_current_module kaletaa: thanks kaletaa: not sure how i missed that, my bad rlb: wingo: I'm somewhat wondering about our current perf and/or bootstrapping expectations, i.e. there are some string functions that might be simpler (and safer) in scheme, and with utf-8, some of the perf advantages in C are gone, i.e. no *O(1)* string-set! and, we might end up needing to allocate a temp vector anyway (say in string-map). Though I suppose we still have no way (yet) to avoid/elide a lot of redundant type checking from the rlb: scheme side, and there might still be "more" garbage generated, even with some suitably crafted helpers. dsmith-work: I just saw an annoucement for powerpc64le-linux guix. Does the guile jit support that now? civodul: dsmith-work: not yet, and apparently it feels slow on that platform civodul: t'just a matter of writing the lightening backend :-) dsmith-work: Yes, the SMOP.. iv-so: afaik guile does not use gnu libjit, is there any particular reason? opfez: hey does anyone know if it's possible to get the terminal size dimensions in guile? opfez: can't find anything in the manual on it wingo: iv-so: dependency size and churn rate. i am sure you could get better codegen using an external jit library, but i don't have the bandwidth for the maintenance costs wingo: also, a desire to do AOT from scheme at some point dsmith-work: opfez: You could check to see if COLUMNS and LINES are set in the environment. dsmith-work: the resize program can set those. (is in the Debian xterm package) opfez: dsmith-work: oh, as shell environment variables? dsmith-work: I think it does some cursor movement and then reads back values. dsmith-work: opfez: Yes. Though to set the values, your shell must eval the output. ft: If the program is long running, a resizing terminal may pose problems with that approach. ft: In those cases, maybe guile-ncurses can help. dsmith-work: And there you would need to handle SIGWINCH opfez: ft: it's just for a tiny program ft: Indeed ft: Ah okay. opfez: the best would be a wrapper function for ioctl() so i could just get the info from there, isn't there anything like that in guile? opfez: but i'll try the env vars first dsmith-work: opfez: Note that they might not be set. opfez: dsmith-work: hey, they were! i can at least use this temporarily and find a more portable solution later, thanks! opfez: gtg,thanks again dsmith-work: opfez: Cool. glad to help dsmith-work: I very often use a serial console on some embedded device, usually from some (x)term through ser2net, and screen dimentions are always wrong. Unless I use something like resize. dsmith: !uptime sneek: up 1 day, 5 hours, 17 minutes everstone: How do I evaluate escapes? I have (string-append "\\x" %hex-string) rlb: wingo: is it feasible/sensible to replace C functions (say in srfi-13) with scheme functions, and/or how would that work? Some of them in my experiment, like string-tabulate, might be just about as efficient in scheme, but if so, would I put them in srfi-13.scm, or would they have to go in boot-9.scm or...? rlb: (Hmm, or maybe that's a bad example, maybe I can make it faster in C (we'll see).) wingo: rlb: yes it is certainly feasible and desirable!! wingo: decreasing the amount of C is a high priority goal imo, so that rewriting the GC is easier lemzwerg: [I'm new to freenode – not sure whether my previous message came through, thus repeating.] On the homepage of guile there is a list of applications that use guile. I suggest to add GNU LilyPond. wingo: hi! i think lilypond is there at https://www.gnu.org/software/guile/libraries/#apps, can you check ? lemzwerg: It is, thanks.  Then I suggest that you add a small line at the bottom of the 'Applications using Guile' section that  links to this list. lemzwerg: Of course, LilyPond is *not* a library, so the title of the link is misleading. g0d_shatter: hey all, curious if anyone knows what the status of guile-ncurses is? last release was a couple of years ago, does it work with guile-3 yet? or even worth using? lemzwerg: Regarding the https://www.gnu.org/software/guile/libraries/#apps link: The '#apps' tag doesn't exist. wingo: lemzwerg: if you send a mail to bug-guile@gnu.org with a description of the bug, that will make a ticket in our tracker wingo: which will be dealt with eventually. not always timely on these things but at least it will get done lemzwerg: @wingo: Done! wingo: tx :-) wingo: janneke: hey. can you remind me what the mingw64 status is janneke: wingo: i believe spk121 reviewed my wip-mingw branch and found all commits except two OK (please verify!) janneke: those two were the 64bit mingw and the fix for the absolute-file-name cross-compilation bug janneke: last thing i know was spk121 did an experiment to introduce a hash type and he said something like "i learned a lot" ... wingo: hehe janneke: so, i forgot whether it's a viable path and needs more, or not... wingo: janneke: just reviewed the first 9 patches on gitlab. the ones without comments lgtm wingo: (i hope the branch was up to date!) janneke: wingo: it is, thanks! janneke: so, feel free to push, but possibly align with spk121? wingo: feel free to push any of the first 9 patches that have no comments :) wingo: comments on the gitlab i mean janneke: eh wait, do i have push access? *: wingo checks sv wingo: you do now :) plz do ping on irc before pushing patches wingo: janneke: also feel free to use wip branches in the main repo janneke: wingo: that's great, sure; so OK to push up to the first DRAFT commit, right? wingo: janneke: there are comments on a number of those commits, right? janneke: ah, right -- now i git what you wrote -- any that have no comment wingo: :) *: janneke goes to push 7 commits to master, and create a new wip-mingw wingo: janneke: there are only 3 that don't have comments, right? janneke: oh my, /me goes to re-check *: janneke push a re-sorted wip-mingw janneke: *pushed janneke: wingo: hmm...on the new wip-mingw, there are no comments on the commits below janneke: f1d2460252 Add `scm_sigaction_for_thread' stub for MinGW. ? *: janneke breaks for lunch and will wait for full alignment here ;) wingo: you don't see one on https://gitlab.com/janneke/guile/-/commit/34cbe4eedcbab317b3fbbf127493e1b82a64ee9a ? wingo: if your commits get renumbered because of a rebase or whatever, you will lose gitlab comments; if you want persistent comments, make a PR janneke: wingo: ah, comments on gitlab! right...i didn't see those, sorry -- never worked with gitlab comments *: janneke was thinking/guessing: a remark in the commit message before the actual change log janneke: wingo: check, 3 commits "Document write-line.", "ice-9 ftw: Use 'absolute-file-name?' in 'nftw'.", and "Compile fix for x86_64-MinGW." ready to push janneke: i'll look into your remarks (thanks!) to push the other commits forward wingo: great! & tx for patches :-) wingo: perhaps you can hoodwink lloda into doing a gnulib update at the same revision, but adding the gethostname module :) janneke: yw, and thanks for the hand-holding :-) janneke: ah great -- i'll be checking if gethostname import fixes it apteryx: Any idea of how we can use parameterize as part as a syntax-case? This naive try doesn't have an effect: https://paste.debian.net/1193328/ apteryx: as part of* wingo: you want syntax parameters wingo: https://www.gnu.org/software/guile/manual/html_node/Syntax-Parameters.html apteryx: hey, thanks! I'll try it. dsmith-work: Hey Hi Howdy, Guilers apteryx: wingo: I tried, but I'm getting a syntax error (the same I had when trying with plain parameters, so probably unrelated): https://paste.debian.net/1193356/. wingo: perplexing apteryx: a more minimal example: https://paste.debian.net/1193363/ apteryx: I don't get what it doesn't like about the body, which *is* an expression, AFAICT. wingo: is it an expression? looks like a definition wingo: depends on the result of the expansion of define-configuration wingo: anyway, i think that is probably a bug in the expander. wingo: your code looked good to me fwiw. if you wanted to hack around it you could (syntax-parameterize ((...)) my-thing #t) wingo: though i wonder if it would treat those as local definitions... humm apteryx: the define-configuration called without the 'without-serialization item should expand to a (begin ...) that does a bunch of definitions apteryx: I'll try your suggestion, thank you :-) apteryx: it seems to get me passed this block! apteryx: although the syntax-parameterized %with-serialization value doesn't seem to stick in the final syntax; https://paste.debian.net/1193369/; It still generates serializer fields set to some (inexistant) procedure names. apteryx: anyway, I'll strip that 'without-serialization syntax sugar for now; it can at least work when using teh global plain parameter and a single case in define-configuration. Thanks for your help! apteryx: it works as long as its used as a global variable more than a parameter raghavgururajan: civodul: sneek is drunk. It delivered that last message too late. xD raghavgururajan: That too in a wrong channel. hmm. rlb: wingo: so say you have sparsely indexed utf-8strings, but (internally) for an operation you want to traverse the string to the end anyway, and you know how many *chars* it has, so you'd like yo avoid the cost of "finding the end, byte-wise". But u8_mbtoucr() requires you to specify how many valid bytes are remaining. So you either have to pay the cost, or lie to it, which seems questionable? rlb: (The cost of finding the end shouldn't be all that high, given the index, so could just accept it,but it's not *completely* trivial.) rlb: wingo: hmm, maybe in situations where it's OK to assume the string is valid, u8_next() might be plausible, i.e. even when the string's not null terminated, if we know that there's at least one more character. manumanumanu: rlb: there is a SRFI you might be interested in that has an implementation of immutable strings that has O(n)-ish access, but using bytevectors as a backend for efficient storage. manumanumanu: is it immutable texts? manumanumanu: I can't remember manumanumanu: it is based around the idea of string cursors and byte chunks of something like 128 bytes stis: Tja guilers! rlb: manumanumanu: right, thanks, I've seen it if it's the "texts" srfi, and iirc I'm toying with something not unrelated. rlb: Should a hypothetical scm_c_put_utf8_chars(const uint8_t *u8, ...) require the char_count, byte count, or both? yoctocell: Hi, I am trying to convert a bytevector to a string using 'utf-8->string', but I am getting an error: Throw to key `decoding-error' with args `("scm_from_utf8_stringn" "input locale conversion error" 0 #vu8(1 88 97 227 44 138 231 228 132 202 66 51 172 245 9 153 162 251 92 121))'. rlb: yoctocell: offhand, I'd guess the argument might not be valid utf-8. yoctocell: Never mind, I had to use 'bytevector->base16-string' from (guix base16), I was playing around with (guix openpgp). yoctocell: rlb: I don't really know much about utf-8, but thanks anyways :) rlb: certainly wingo: heyo rlb: wingo: should a hypothetical scm_c_put_utf8_chars(const uint8_t *utf8, ...) require the char_count, byte count, or both (if you have any firm opinion, offhand). And should it trust the content, or insist on trying to verify it? wingo: no real firm opinion. if we go by e.g. scm_from_utf8_string vs scm_from_utf8_stringn, there should be a "n" variant that takes a byte count wingo: i guess verification is cheap, right? if someone wanted to skip verification they could use a byte interface wingo: though i guess you don't get transcoding in that case rlb: depends? I mean it's a full extra pass over the string, one code-point at a time. wingo: right but what's the ns/byte for verification rlb: But of course I think you *can* make it very fast (even going as far as sse/avx/whatever if you like). But still more than doing nothing. wingo: right but compared to whatever the port is going to do, probably it's lost in the noise. dunno rlb: Part of the question here is related to internal vs external clients -- i.e. if the bytes are coming from a *string*, we know they're valid. But in other cases, I'm wondering how careful our api intends to be. *: wingo nod rlb: (Also in the case of internal uses, getting the byte_n is a bit more expensive, since we have to indirect through the index.) rlb: So possibly worth avoiding when we can. wingo: ah yeah indeed rlb: i.e. when we know we're going to have to traverse the string at least once anyway. rlb: (as part of the work) rlb: But on other cases, we can memcpy, if we know the byte_n, etc. rlb: Anyway, not critical, just wondered. rlb: (And can always have scm_c_put... anc scm_i_c_put... or whatever if we decide it's warranted.) wingo: whee https://wingolog.org/archives/2021/04/11/guiles-reader-in-guile ft: \o/ civodul: wingo: yay! lampilelo: oh, cool ArneBab: wingo: nice! Thank you for accompanying your great hacking with great writing! zzappie: great article! Does it mean that we are on the way to edebug style debugger? zzappie: wien it possible to retrieve source locations zzappie: *when *: zzappie zzz civodul: janneke: interesting civodul: i don't think Guix has troubles with it civodul: but it means there's an allocation going on? how can it be? leoprikler: There are only two build systems worth using in 2021: Autotools and GWL :) rekado: even I don’t use GWL as a build system … yet ;) iv-so: gwl? morganw: This, I think: https://www.guixwl.org/manual/gwl.pdf iv-so: oh, so it's a build system morganw: probably more a "process orchestrator" leoprikler: if GWL is a process orchestrator, then make is not even a scheduler everstone: How do I split a string on newlines? (string-split "foo:bar baz" #\:) works for colon, but guile says #\\n is wrong daviid: everstone: try #\newline everstone: daviid: Thank you, that worked! janneke: sneek: if you think this https://paste.debian.net/1193016/ is interesting then let me ping wingo ;) should i mail to bug-guile? sneek: Okay. janneke: sneek: botsnack sneek: :) lampilelo: i thought it was supposed to do it the new way because afaik inner defines are implemented in terms of letrec inside a function block, i didn't realize it was different before lampilelo: the info manual explains it that way, so i guess it's intentional (?) rekado: iv-so: the GWL is a workflow language extension for Guix. The intended audience is scientists who want to run reproducible computer-aided experiments in HPC environments. iv-so: too abstract explanation rekado: iv-so: if you prefer a video: https://fosdem.org/2021/schedule/event/guix_workflow/ rekado: there’s also a tutorial here: https://guixwl.org/tutorial iv-so: nah, I am fine with build system rekado: yeah, it’s not a build system iv-so: saw tutorial but understood nothing rekado: if you are not a scientist the GWL probably isn’t for you. rekado: not that it’s too complicated to use, just that you don’t have the kinds of problems that the GWL attempts to solve. iv-so: I played with this "reproducible research" thing a bit, but performance of emacs, org and giant postgres together killed all the fun and usefulness rekado: postgres? gagbo[m]: I wonder why pg as well tohoyn: sneek, botsnack sneek: :) iv-so: I was to investigate the reason why some rows in our DB were corrupted and fix them leoprikler: sounds not very reproducible to me janneke: lampilelo: ah yes, i forgot about that change *: janneke wasn't so thrilled of allowing duplicate identifiers there, but hey roptat: how can I prompt the user from a guile script? roptat: ha simply (read) mwette: roptat: or (use-modules (ice-9 readline)) (readline "$ ") mwette: [maybe requires (activate-readline)] -- see "Readline Support" section in the manual rlb: Anyone happen to know if we still need the lower(upper(x))? https://lists.nongnu.org/archive/html/guile-devel/2011-03/msg00111.html rlb: oh, wait, there's more in the thread. rlb: Right, looks like I can drop the extra call. rlb: Or maybe not - i.e. I think maybe that was saying that we could drop the extra call if we lowercased entire strings via libunistring and they were both the same encoding (here utf-8), in a call like compare_strings(). i.e. if we're still going char-by-char (for now), we might need the lower/upper. rlb: how do we pull in another gnulib function? i.e. I think I might want memcmp2 wingo: o/ stis: \o wingo: civodul: apparently glib uses gnulib under a meson build system https://gitlab.gnome.org/GNOME/glib/blob/d6092086558515ed6fa195b156cb9bdacc809f16/glib/gnulib/meson.build wingo: dunno how that works tho civodul: hi! civodul: wingo: i guess they maintain it themselves? wingo: yeah maybe wingo: probably they don't update often from upstream. not sure how gnulib would work without autotools civodul: BTW, Guix does not remove .la files (yet) civodul: probably poorly wingo: ah ok, i thought it did wingo: i guess guile transitively depends on python already for its build :P wingo: re: meson civodul: .la files are mostly useful for static linking since they tell the extra -l flags *: wingo not actively investigating this fwiw, just thinking about it civodul: are you saying you'd like to switch to Meson? civodul: ah ok wingo: i was just thinking, we could do autotools without libtool, but autoconf + libtool + automake kinda hang all together wingo: ~~synergy~~ wingo: so if you want to take libtool away, replacing the whole thing starts to become maybe interesting wingo: dunno wingo: sounds like hell civodul: yes, sounds like that :-) civodul: we could do without libtool, but that means doing the LD_LIBRARY_PATH dance, -rpath, relinking, and all that by ourselves wingo: yeah honestly i would think that probably you and guix folks have the most informed opinions about what would be a good idea wingo: & maybe staying with autotools is the least bad idea, dunno wingo: but, we already have to do a lot of workarounds via meta/uninstalled-env.in etc civodul: the rpath + relinking thing is striking: i think all build systems other than autotools get it wrong civodul: in Guix we have workarounds/tweaks for CMake and Meson, for sure civodul: CMake is the worst civodul: for Meson, we explicitly pass -Wl,-rpath because apparently it won't do it otherwise civodul: that trick works because we're building in a chroot, but if you did that with -Wl,-rpath=/usr/local/lib, you'd end up running the previously-installed code instead of the one you're building leoprikler: As someone who uses Guile+meson, I can't say I recommend it. With Guile+Autotools, I can put everything into one Makefile.am. Meson currently doesn't have such capabilities. lampilelo: for snarfing you have to use external command because there's no other way to obtain cflags directly in meson wingo: my ardour for action is cooling, fwiw :) terpri_: i can't even *build* bazel on guix. cmake's documentation seems very minimal and i end up spending far too much time finding a magic incantation to change some simple option. autotools have their problems, no doubt, but i've never found an alternative i prefer terpri_: redo & co. sound interesting on paper, but they're only 'make' alternatives terpri_: (i wonder how much of autotools's flexibility/longevity comes from being designed to build things automagically on random *nix systems...cf. systems like imake which iirc relied on a central database of system information) lampilelo: i guess there is a workaround for snarfing in meson because you can write modules, so you could probably access cflags from dependency objects or something, they're not exposed by default though lampilelo: my take on autotools, as a new user, is that they're hard to learn, the documentation is all over the place lampilelo: i use them for my new project because i thought it would be fun to learn, but no, it's not particularly fun lampilelo: but i have to agree, enabling and disabling features when you want to compile is super easy when everything is set up right leoprikler: I personally feel, that Guile's autotools integration could be better. leoprikler: People currently have to write their own .scm.go suffix rules and the way SOURCES are sometimes declared as merely "SOURCES" is also discouraging terpri_: meson looks fairly reasonable, just skimming their site, though i'd prefer not to have python etc. be fundamental dependencies for building things (which is probably a fringe preference) leoprikler: OTOH a guile module for meson would probably work better to get more users on board terpri_: and tbf some of autotools's advantage is probably from "tradition" (refined over decades) and doing something complicated might require knowledge of m4 and shell and make leoprikler: Yeah, autotools very much assumes you're at least familiar with shell and make. civodul: terpri_: the actual cmake documentation is non-free (a book) morganw: It is likely a biased source, but the Autotools book from 2019 states that adding new language support to Autotools is actually not too hard. And I imagine the existing support for Elisp probably has a similar compilation model to .go files. morganw: (I bought the book because I agree that knowing where to start with Autotools is difficult) terpri_: civodul, ah, that would explain why the official online docs seem so sparse :) epony: like the emacs manual page.. a bit lacking leoprikler: adding language support to autotools is really not hard, it's mostly just adding one suffix rule and you're done leoprikler: well, it depends on how hard the language makes it, I don't think the complicated entity, that is rust, can fully be described within a suffix rule, but you get my point :P civodul: terpri_: i know that because at work they regularly buy copies of that thing *sigh* rekado_: “regularly”? Oh my. lloda: wingo, civodul: ok to merge wip-gnulib-update? civodul: rekado: yes, because the copies unavoidably get lost in some drawer civodul: lloda: i'll defer to wingo :-) wingo: lloda: lgtm :) lloda: thnx, pushed roptat: hi! how do I use guile-cairo? I tried to create a surface with (cairo-image-surface-create 'CAIRO_FORMAT_ARGB32 100 100), but I get `(#f "Unknown enumerated value: ~S" (CAIRO_FORMAT_ARGB32) ())'. The manual doesn't seem to explain how to get a cairo-format-t rekado: I only have an example of generating a PDF file with guile-cairo here: https://git.elephly.net/gitweb.cgi?p=software/guile-picture-language.git;a=blob;f=pict.scm;h=b853c47d6302a4034dfea74487f850328455cb3d;hb=HEAD#l160 roptat: ha! 'argb32 roptat: thanks a lot :) rekado: guile-cairo/guile-cairo-enum-types.c gives you the mapping dsmith-work: Happy Friday, Guilers!! leoprikler: is it intended, that define* exists even without (ice-9 optargs)? Noisytoot: WHy is ice-9 called ice-9? dsmith-work: sneek: ice-9? sneek: ice-9 is "a nod to the fictional substance in Kurt Vonnegut's novel, Cat's Cradle, capable of acting as a seed crystal to crystallize the mass of software" dsmith-work: Noisytoot: ^^ rlb: I've gotten the impression that a lot of things may not handle cross compilation (and bootstrapping) nearly as well as autotools, if at all. Though that's more important for "closer to root" dependencies like gcc. Python, and guile to a lesser extent atm, also already present a common interface to some of the things autotools detects, and could provide more, i.e. endianness, type sizes, etc. civodul: "guild compile" has a --target switch dsmith-work: I had to cross-compile Python by hand for some embedded stuff. Was tedious. Thankfully, buildroot eventually added Python. ArneBab: are we actually trying to get rid of autotools? From all the runs through build systems I did since 2000, autotools was the only one that sufficed. Everthing else was worse — including cmake, scons, waf, the numpy-setup-hacks, and pip. ArneBab: oh, and maven and gradle and npm ArneBab: (though those actually do a bit more that is useless to guix users) ArneBab: Nowadays I think that the right way to provide a build system is to auto-generate a working autotools-setup with a init tool. janneke: pure-funcq on an inner function does not work with guile-3, is that expected? ArneBab: Sadly I’m too slow at pushing conf forward, which does that, but currently only for bash, python (though opinionated), latex, org-mode, and naturally wisp: https://hg.sr.ht/~arnebab/conf janneke: yeah, inner functions get a new address -- https://paste.debian.net/1193016/ janneke: bummer janneke: civodul: u sure we don't suffer from this in guix? *: janneke hasn't looked, but knows guix does some fancy memoizations leoprikler: and before you ask, yes, I did functional programming in m4 leoprikler: In about three years, the company I worked at will discover it and whoever happens to do read the code at that time will reach enlightenment. leoprikler: Or they'll curse me. Probably the latter. *: zzappie imagines "M4 functional programming" O'Reilly book cover dsmith: leoprikler: The "base case" for recursion was kinda funky, iirc. dsmith: At one time I was using some freebie Mororola supplied assemblers, with no macros. m4 filled in nicely! morganw: I recently m4'd a GitHub Actions config and would do it again (whilst the design of GitHub Actions remains fundamentally broken) leoprikler: Got any code for that? morganw: For GitHub Actions? It was pretty sparse, but if you are interested: https://github.com/adventuregamestudio/ags-manual/tree/master/.github/workflows morganw: I started to write a YAML renderer in it, but then though better of it leoprikler: that looks pretty nice leoprikler: a minor nuisance is that you have to manually expand job.m4 every time :P morganw: I think they have created a security problem which means they cannot use YAML aliases. And the job matrix outputs are static and overwrite each other, so unless you template the YAML there is just endless copying and pasting to duplicate everything manually. morganw: But it does seem reliable, which I cannot say for the others I've used. rlb: Imagine you know, but you can play some tricks with their matrix and the matrix var expansions to avoid some duplication... morganw: The problem is that the outputs are defined in the YAML key names, not the values. rlb: Ahh. morganw: And rather than combine multiple matrix outputs as an array for the return data, whichever job finishes last is the only return value you will see. rlb: (I've also used cirrus fwiw to add testing for freebsd to projects.) rlb: (But don't know much about cirrus otherwise.) morganw: Yes, I chose Cirrus too. I think it has a good design and didn't require me to start provisioning accounts to allow Docker containers to be cached. But I have had issues since with older containers not running, and also with restarted jobs interfering with artifact uploads. rlb: (Suppose you could do that on sourcehut too (and include a bunch of other platforms), but possibly not for free in the long run...) morganw: Lack of Windows support would be a problem too, since that is the primary platform for the project. rlb: Ahh. morganw: But I don't see Windows will exist in its current form in the near future, so this partly why I'm interested in Guile and where I can embed it, and whether that can be a game engine. leoprikler: Why embed Guile into your game engine, when you can write your game engine in Guile instead? :) leoprikler: Jokes aside, you should be able to embed Guile into your game engine. morganw: I saw Chickadee and it looked very interesting, although I'm a little worried about how to 'deploy' the final application in a way that is self-contained. mwette: several decades ago, I wrote a functional Makefile generator that used M4: https://paste.debian.net/1192684/ ; I had fun w/ M4. RhodiumToad: m4 is all very well but it easily becomes a complete mess dsmith: mwette: Wow. Looks really nice mwette: thx wingo: moin :) civodul: o/ lampilelo: hi rekado: morganw: you can deploy a self-contained archive with Guix. morganw: Does that run for someone who isn't using Guix? mbakke: morganw: yes, archives produced by 'guix pack' has no dependencies apart from the Linux kernel dsmith-work: UGT Greetings, Guilers lloda: what is the update process for gnulib? i saw other commits where it's done but it doesn't say. Only saw a couple old mentions in ChangeLog-2008. wingo: you "git pull" in a local checkout of gnulib. then run the command in lib/Makefile.am, adding any files that were added by the update wingo: the gnulib-update command i mean lloda: gnulib-tool --update i'm assuming lloda: giving it a try lloda: oh i can't read lloda: 'the command in lib/Makefile.am' lloda: building... lloda: everything looks alright. Ok to push? or should I push to a test branch and ask for people to test? I haven't done this before. lloda: ok pushed to wip-gnulib-update tatsumaru: hey guys, I am using arch linux and it only has guile 2.2.6 package for it. is it a lot different than 3.0.5 and can I use most of the current reference manual to learn guile on 2.2.6 or do i need to do a manual update? lloda: tatsumaru: There is a guile 2.2 manual at https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/ lloda: but if you are starting to learn there shouldn't be major differences lampilelo: tatsumaru: it's not that different but if you want to use guile 3 you can install it from aur lampilelo: today is the first anniversary of the last guile update on arch, lol lampilelo: yay rolling distro davexunit: slot-unbound is not very useful in goops :( davexunit: (slot-ref foo 'some-unbound-slot) calls slot-unbound with only foo as an arg, the name of the slot that was unbound is not included. dsmith: sneek: botsnack sneek: :) dsmith: goodbot daviid: davexunit: there are three methods, one of which specializes on the class, the istance and the slot-name daviid: davexunit: but you're sayig that one isn't called i guess, didn't try :) daviid: davexunit: in goops.scm, (slot-unbound class obj slot-name) is called within the core of the inner no-slot def, not within the core of the inner have-slot def, which seems like a bug to me davexunit: daviid: yeah it seems like a bug, but it could be as-designed? davexunit: if it is, I just don't like the design. :) daviid: davexunit: if you compare the def of solt-re and slot-set! in goops.scm, you can see that the no-slot inner def of slot-set! is correct, the one of slot-ref isn't, i think - then, the def of has-slot in slot-ref doesn't look right either daviid: *slot-ref daviid: *have-slot (not has-slot) davexunit: yeah, I noticed that davexunit: I don't feel like going down this rabbit hole but it does seem like something that could be improved. daviid: the other strange thing is that in this no-slot inner def in slot-ref, slot-missing is called as if it returns a value - and i can't find that it does :) in any of its methods davexunit: add that to the list of goops oddities davexunit: unrelated, but one of these days I'd like to try implementing CLOS's :before, :after, :around methods in goops. daviid: I just think you found a bug, and that slot-ref should be patched daviid: davexunit: that would be nice daviid: sneek: later tell davexunit here is a fix, could you try it - https://paste.debian.net/1192569/ sneek: Will do. daviid: wingo: could you look at this (oop goops) slot-ref fix - https://paste.debian.net/1192569/ - if ok, i'll file bug-report with a proper patch dsmith-work: {appropriate time} Greetings, Guilers pkill9: hi dsmith-work: Am I back? dsmith-work: Yes! lampilelo: or is he? dsmith-work: Maybe? lampilelo: so are you back or not? dsmith-work: Hope to be. connectivity issues abralek: Hi guile abralek: I am curious, is there any projects which use 8sync? leoprikler: At least not according to Guix: No dependents other than itself: guile-8sync@0.4.2 wingo: when do we get to remove libtool from our build system? :) *: wingo trolls dsmith-work: wingo: As soon as possible? wingo: is it actually a pain point for anyone? dsmith-work: wingo: I had some difficulties with it at one point. Nicely solved by just removing the .la file(s). dsmith-work: But then I was cross-compiling. dsmith-work: The .la file was pointing to the wrong places, IIRC. wingo: yeah afaiu all distros remove the .la files wingo: fedora, debian, even guix wingo: so we should just stop generating garbage :P wingo: ideally gnu would have replaced autotools at this point *: wingo grumble Noisytoot: What's wrong with autotools? civodul: wingo: it cannot just be "removed" tho, it has to be replaced civodul: saying this as a packager who's had occasions to wish Libtool had been used :-) civodul: to be fair, some of it can be plain removed, such as .la files civodul: (and support for AIX 5 and Tru64) zzappie: I am also curious. People seeem to devide to haters and lovers of autotool. And lovers are usually people who build package zzappie: Were there any atempts to reinvent it? :) morganw: I think the actual problem with autotools is that there looks to be an issue in finding people to work on them. One suggestion that has come up is for it to require GNU Make (since this is pretty much available everywhere) but I don't think anyone can agree on something to replace m4. daviid: davexunit: did you see my msg? i think i fixed slot-ref ... but wanted you to check ... civodul: zzappie: there's no shortage of free build systems these days, but most are broken in their own different ways civodul: :-) civodul: Meson seems to be doing better than the average civodul: that's going beyond the Libtool discussion though davexunit: daviid: no I missed it, sorry. sneek: davexunit, you have 1 message! sneek: davexunit, daviid says: here is a fix, could you try it - https://paste.debian.net/1192569/ zzappie: morganw: maybe define m4 language for guile and have option to write autoconf macros in scheme? :) davexunit: I'll try to find some time to fix it. need to get into a state where I build guile from source and try it out. davexunit: rather, to try the fix. daviid: davexunit: sure daviid: wingo, following a attempt to fix slot-ref, i also posted a msg here earlier today for you ... if you have a few min ... let me know what you think, tx morganw: zzappie: given there is already a GNU Make+Guile, plus all the build tooling for Guix that someone can point at, you would think it would be a logical candidate... daviid: davexunit: you may as well recompile just that proc on the fly ... and try it ... but as/when you wish/can of course, no problem leoprikler: fwiw I had an easier time using make plus handwritten m4 at a workplace, that felt too fancy for autotools rather than make+guile on pretty much any machine I had so far abcdw: Morning guile! What is the easiest way to expand a path with environment variables? "$HOME/tmp" -> "/home/user/tmp" wingo: good morning :) nly: abcdw: try ,apropos getenv nly: abcdw: yup, (getenv "HOME") abcdw: nly, thank you for the tip, but I would prefer something less manual, like (with-stdout-to-string (system (string-append "echo " path))), where path is a string, possibly with environment varibles. RhodiumToad: that sort of thing requires that you trust the path not to do anything strange nly: it's not strange if i have alias echo="rm" haha nly: sorry don't have a better answer RhodiumToad: the posix spec defines a wordexp() function, which guile seems not to provide a binding for RhodiumToad: that's intended to allow all the kinds of expansions done by shells, but the downside is that it generally works by spawning a shell, and many implementations have or had security bugs as a result RhodiumToad: the question with these things is what kinds of expansions do you want to allow? $HOME is easy, but what about ${HOME:-foo} or ${HOME+${HOME}/$(blah)} abcdw: RhodiumToad: wordexp is what I was looking for, but I took a look at the source code and it's a nightmare) abcdw: For my case I would probably go with very primitive approach using getenv, it's enough to expand only $HOME variable. abcdw: Thank you everyone for the help. nly: it works but i realize it's not satisfactory abcdw: Something like that: https://paste.debian.net/1192461/ leoprikler: abcdw: a better approach would be to detect $symbol as regexp and then use getenv abcdw: leoprikler: Yep, I thought about it, but I think for xdg-user-dirs it's enough to substitute only $HOME variable. leoprikler: oh, sure leoprikler: I think the correct way to code xdg user dirs doesn't even include "$HOME" as a string leoprikler: see the xdg-directory procedure in Guix leoprikler: fwiw if you're using this in guix home, you can just #:use-module (guix utils) to get it, noß leoprikler: s/ß/?/ abcdw: leoprikler: xdg-directory is cool, but it always add /guix at the end. The idea to use the XDG_DESKTOP_DIR variable instead of expanding the value myself is good, but won't work in many cases because those variables rarely declared in the environment, they mostly accessed via `xdg-user-dir DESKTOP`, which expands the value as I want, but it requires the invocation of external tool. abcdw: Seems that manual expansion of $HOME is optimal solution here. leoprikler: what exactly is your spec here? abcdw: leoprikler: I rely on `man user-dirs.dirs`, it says: VALUE must be of the form "$HOME/Path" or "/Path". leoprikler: ah, so you need to parse the user-dirs file? abcdw: Nope, I generate it for the `xdg-user-dir` utility and also ensures that all those dirs are created on `guix home reconfigure`. abcdw: https://paste.debian.net/1192463/ leoprikler: the easiest thing would be to silently add $HOME/ in the expanding code, no? abcdw: leoprikler: Not sure what you mean leoprikler: e.g. have desktop be "Desktop" and then expand that to $HOME/Desktop only when writing the user-dirs file leoprikler: and otherwise use (string-append (getenv "HOME") desktop) leoprikler: "/" desktop of course leoprikler: then you only need to detect some edge cases like leading slash or leading $HOME leoprikler: and tell the user that they shouldn't do that abcdw: I think that already implemented approach is good enough. The service configuration sticks to the original value format of xdg-dirs.dirs and expansion code is pretty simple. leoprikler: tbh I don't understand what "sticks to the original value" means in this context leoprikler: let alone whether that's a good thing abcdw: leoprikler: I use the same value format for home-xdg-user-directories-configuration as it in ~/.config/user-dirs.dirs abcdw: https://paste.debian.net/1192465/ leoprikler: hmm, fair enough wingo: moo mwette: wordexp using nyacc: https://paste.debian.net/1192485/ mwette: wordexp.ffi can be just this: (define-ffi-module (wordexp) #:include '("wordexp.h")) wingo: that module is auto-generated??? wingo: impressive mwette: Yes. You can control from which includes the definitions are generated, otherwise types are expanded. mwette: you can also #:use-ffi-module (other module) to work dependencies. Check examples/ffi/gtk2.ffi in the nyacc distribution dsmith-work: Tuesday Greetings, Guilers wingo: o/ Noisytoot: https://github.com/weinholt/hashing is not found manumanumanu: Noisytoot: https://gitlab.com/weinholt/hashing daviid: rekado_: do you happen to know/think if gnu solfege is still maintained? manumanumanu: wingo: _really_ nice work with the inlinable exports! It seems... nontrivial. :) rekado_: daviid: I don’t know, but it doesn’t look like there’s any development. wingo: manumanumanu: tx. has been trickier than i thought it would be :) wingo: i wired up the "inlinables" side. haven't done peval yet wingo: some tricky considerations regarding reproducibility -- because inlinables can themselves benefit from cross-module inlining, it's not clear when you reach a fixed point dsmith-work: Hey Hi Howdy, Guilers manumanumanu: wingo: "Inlining, how hard can it be?". Famous last words. wingo: :) manumanumanu: I don't know who I'm quoting, but it is a quote I know I have stolen from someone. I suspect it might be you: "Writing an inliner is like trying to restrain a rabid dog on a leash" wingo: dunno :) wingo: but yeah manumanumanu: wingo: I am a little bit curious. Have you measured any speedups? Cross module inlining is one of those things often talked about, but I don't really know about the benefits. wingo: manumanumanu: still not really working wingo: from looking at some diagnostics, generally will be no impact on guile. sometimes amazing tho wingo: one of those "whoa where did that 10x improvement come from" things wingo: but, it will allow us to write programs in different ways wingo: i.e. without considering module boundaries to be optimization boundaries wingo: so you can freely (define x 42) and know that users will inline as appropriate wingo: (nb, only for declarative modules and unassigned toplevels) wingo: er, declarative bindings in declarative modules rather wingo: anyeay wingo: *anyway wingo: in my branch, the "provider" side is done i think wingo: i.e. candidate values are written to the compilation units wingo: the "consumer" side is done for simple values like constants and such wingo: needs some help for lambdas tho. inlining a lambda introduces new lexicals in the source program, which peval wasn't expecting before civodul: neat sneek: Welcome back civodul, you have 1 message! sneek: civodul, raghavgururajan says: In c-u, glib-or-gtk-build-system doesn't trigger bootstrap. For example. try `guix build farstream --without-tests=gupnp-igd`. civodul: wingo: how can users retain control over ABI compatibility issues? civodul: as a module writer, sometimes there are things you explicitly don't want to be inlined manumanumanu: wingo: thanks! It will hopefully make something like define-inlinable mostly redundant manumanumanu: good night! dsmith-work: wingo: While you are messing about with cross module inlining, please have a think about https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47084 ArneBab: wingo: not having to worry about module-structure for optimizations sounds great! ArneBab: (not that I did that to date, but it would be great to never having to do it in hindsight) rlb: seems like we should rlb: support #:prefix and #:select in the same form. rlb: Or rather, might be nice. rlb: #:use-module ((foo bar) #:prefix bar/ #:select (x y)) rlb: I *think* right now it just ignores the #:select. rlb: Oh, unless the prefix applies to the selected names too. Hmm. rlb: (Not that it should necessarily influence guile, but used to that habit from clojure, i.e. there it's (:require [foo.bar :as bar :refer [x y]]) ArneBab: avp_: always the same problem in Free Software: We all already have cool projects we want to push forward :-) → http://www.draketo.de/english/users-fans-supporters ArneBab: “If you like what I do, why don’t you help me?” ArneBab: If anyone wants to have fun writing some guile-wisp, there’s now a wisp-page on rosetta code: https://www.rosettacode.org/wiki/Category:Wisp :-) (thanks to Greg who said “why don’t you …” :-) ) lampilelo: Ugh, no parens? It feels kinda inferior from the editing point of view: you can't just transpose sexps (etc.) and move efficiently through the code, or can you? I wonder what's the rationale behind it leoprikler: It's for people, who are afraid of parens, so yeah. leoprikler: that said, in wisp sexps correspond to 1+ lines, so it works fine just by transposing regions leoprikler: (that is unless you use fancy stuff like parens or the colon) lampilelo: i guess different strokes for different folks lampilelo: should the package maintainer be expected to have guile-snarf or should I distribute generated files? leoprikler: imo guile-snarf should be present at build time, same with guild rlb: Do we have any provisions for (or examples of) testing internal C functions? e.g. say I wanted to write independent tests for some normally static strings.c functions. rlb: (I suppose to really do that without including the code in a final install, we'd have to compile it twice one way or another...) rlb: Alternative I suppose might be to just accede to publishing them as scm_i_... functions and test those, but in this case, they really are internal functions, e.g. to sparsely reindex a utf-8 string, etc. Be nice to be able to test the corner cases there more directly. leoprikler: well, that goes against most testing wisdoms, but you can try looking those symbols up with ffi leoprikler: otherwise you'll have to find a way to test in C leoprikler: (which is possible, but not usually done) rlb: Oh, I'm fine testing in C (in fact that's what (for this purpose) would be easier), just didn't know if we already had some way. rlb: (And one reason this crossed my mind is that it may be difficult to even get guile to come up far enough to test strings.c from the scheme level, until it's mostly correct.) rlb: (Since "everything" depends on it.) rlb: (strings and symbols) leoprikler: see test-suite/standalone rlb: leoprikler: ahh, thanks, I'd forgotten about that. I'll take a look. rlb: leoprikler: yeah, that might work. Thanks again. rlb: And regarding standalone - not sure we'd want it, but I used the automake TAP driver for lokke, and that's worked out reasonably well, i.e. so a standalone test can, if it likes, report finer grain test information, and track multiple failures in one run (instead of only watching the exit status). rlb: i.e. https://www.gnu.org/software/automake/manual/html_node/Using-the-TAP-test-protocol.html rlb: Which functions do we require to have correct scm_remember calls in libguile? I assume that SCM_DEFINEd functions to, and any public scm_* or scm_c_* functions, but there are no expectations wrt scm_i_* functions? i.e. if you call those, you need to make sure to remember() defensively because they're allowed to do whatever they like? Or rather, you need to make sure to hold on to any arguments *for them* because they might not? rlb: "SCM_DEFINEd functions do" rlb: Meaning scm_foo (scm_i_bar (x)) wouldn't be correct by itself -- you'd need to break that up so you can scm_remember_upto_here_1 (x)? leoprikler: rlb: you use remember whenever you run in danger of using memory associated with a SCM, that might otherwise be GC'd leoprikler: e.g. if scm_i_bar does not return anything related to x, you don't need to remember it, but if it converts it to a void* or similar, you should probably remember it rlb: leoprikler: thanks, and right - so the "remember" responsibility is in the caller, and the call has to know whether or not the bits returned by the scm_i_ call are related to any given argument. rlb: "caller has to know" rlb: (wondering if I may have seen some missing calls in libguile, then -- will try to check later) leoprikler: rlb: garbage collection also has to be a real hazard, which I suppose is often not the case in guile stdlib leoprikler: e.g. you get a string, but you don't care if it's GC'd rlb: leoprikler: a more specific case I was thinking of is a scm_i_foo (x) that returns a new SCM derived from x (though in the end, fully independent). During the derivation, scm_i_foo uses internal bits of x in a way that *would* require a remember half-way through the work if it were a "public" function. So is scm_i_foo expected to include that remember, or allowed to assume that the caller must protect x since the caller can't know rlb: what scm_i_foo might do with it? rlb: i.e. do I always need to protect x in the caller (before the return) for a call like "return scm_i_foo(x)" to be sure x can't be lost half-way through scm_i_foo. rlb: e.g. "SCM result = scm_i_foo (x); scm_remember_upto_here_1 (x); return result;" leoprikler: I don't think you should write scm_i_foos in a way, that they require additional remembers rlb: Or is scm_i_foo required to make that unnecessary. rlb: So do I have to know how each scm_i_works, or do we have requirements? That's really what I'm trying to figure out. rlb: "scm_i_* works internally" leoprikler: my personal interpretation of scm_i_* is, that they're mostly quick and dirty functions, wherein such concerns don't apply rlb: (And if you "just have to know", perhaps we should note that in each one, so someone doesn't come along and rework the implementation in a way that violates the expectation...) rlb: I ask all this because strings.c has a lot of internal functions and some scm_i_ functions (and calls some), and I'm trying to understand what my constraints are. rlb: wrt toying with the sparsely indexed utf8 rearrangement. I suppose worst case I can just be very conservative, and then people can tell me where I've gone overboard wrt remembering -- just wanted to know whatever policies we had there. leoprikler: I don't have the code in front of me rn, but I'm pretty sure some of those are just fancy accessors. leoprikler: And that you need to remember the object if you plan on using their *return value*. leoprikler: never mind stuff done inside scm_i_* rlb: They were, but some things that were O(1) will become complicated, and some things that were complicated will be cached, and so O(1) i think. rlb: right leoprikler: that said, if you're adding stuff that's complicated and difficult to reason about, you should probably first ask yourself "Do I really want to do this?" rather than "Am I using correct scm_remember semantics?" rlb: Well, we already had issues like that because strings are shared, etc. and we take pointers into the underlying stringbuf, etc. rlb: That's the primary source of the issue, and it remains. rlb: (with the rework) leoprikler: w.r.t. remember the best answer I can give you, is that the return value is the contract rlb: Though some of that we might get around by recomputing the offsets all the time, i.e. avoid passing around raw internal pointers, but doesn't change the fact that you still have to remember the parent buffer object in all the right places. leoprikler: can the caller reasonably assume, that it needs to remember x to use the scm_i_* return value → no internal remember necessary rlb: Are you asking? Because that's what I was asking :) leoprikler: is the stuff I'm doing opaque as fuck? better remember the arguments rlb: i.e. if it's ok to omit the remembering in the _i_ functions and require the caller to handle it. rlb: that was my question "or do we have existing 'requirements'". rlb: "...and/or do we" leoprikler: As I said, the best answer I can give you, is "the return value is your contract". rlb: Anyway, thanks -- at the very least, it doesn't sound like we have any hard and fast rules there atm. leoprikler: even in public functions like scm_cdr you may need to remember post calling leoprikler: (if you don't want to GC the car) rlb: i.e. it might be ok for me to say that "for these scm_i_* string calls you need to remember these arguments" rlb: Though on the other hand, if the remember calls don't cost much (i.e. don't make an optimization mess or something), then why not just add the guards to the scm_i_ calls anyway. rlb: i.e. just avoid the question/requirement. rlb: Assuming they're not expensive(?) that's what I should probably do. leoprikler: I think the rule of thumb here, is if you need to document it to reason about it, it's probably stupid. leoprikler: + "don't add unnecessary requirements" leoprikler: but I have to go now and this is a little too abstract; if you have a more concrete MWE I'll look at it later rlb: Yeah, I think maybe I'll at least guard all the scm_i_ functions (and of course scm_*), and may or may not guard the internal static functions (internally). Thanks again for the discussion. ArneBab: lampilelo: you can move efficiently through the code, but the editor support still *is* inferior. That’s not an intrinsic problem, though, because the indentation+colon structure is an exact representation of the structure with parens. So the still existing limitation in editors is just because the work has not yet been done. The need is a bit smaller than with parens, because Emacs support for editing with indentation is pretty good. ArneBab: lampilelo: for the reasoning: » I love the syntax of Python, but crave the simplicity and power of Lisp.« — Guile gives me the capabilities I wish for, and replacing *outer* parens with indentation gives an appearance which is close to Python (which is a better fit to my mind). ArneBab: lampilelo: the deeper reason is that starting each procedure-call with a parenthesis makes visual recognition harder (until your mind starts to fade them out). I created a small presentation for the reasons, the first six slides of http://www.draketo.de/proj/wisp/why-wisp.html ArneBab: lampilelo: and longer reasoning: https://www.draketo.de/py2guile lle-bout: hello! does GNU Guile have a hotspot JIT compiler? ft: https://www.gnu.org/software/guile/docs/master/guile.html/Just_002dIn_002dTime-Native-Code.html ft: That's a pretty new thing though, introduced in 3.0, and only available on a few platforms. lle-bout: ft: Thanks, I know it exists but I didnt know if it was an 'hotspot' one or not. I will read that link in full, thank you. lle-bout: ft: seems like it's an hotspot one indeed: "The JIT compiler runs automatically, triggered by counters associated with each function. The counter increments when functions are called and during each loop iteration. Once a function’s counter passes a certain value, the function gets JIT-compiled. See Instrumentation Instructions, for full details." ft: Ah, okay. I'm not an expert on this at all. I thought that was the point JITs. :) ft: Why would one want a non-hotspot jit? lle-bout: ft: not sure lle-bout: ft: You could compile every function as they get run instead of compiling them only when they get run too often, e.g. LLVM Orc JIT does compile every function as they get run because there's no interpreter for C/C++. ft: lle-bout: I suppose that's true. Never thought about that. ft: Like I said, not an expert on compiler technology. :) lle-bout: Neither am I, but I got some culture at least ft: Hehe leoprikler: Not quite sure what a "hotspot" JIT is (sounds like a marketing term imo), but there are also tracing JITs, that use basic blocks rather than procedures as code units. lle-bout: leoprikler: as in functions that get run often become "hot" lle-bout: It's what GNU Guile implements it seems basically leoprikler: Ahh, so I was thinking about the right thing. lle-bout: AFAICT OpenJDK's JIT is called 'Hotspot' so maybe that's marketing but also V8 had such terminology not sure leoprikler: yeah, it makes sense, as GCC had "hot" and "cold" attributes I assume way before Java had a JIT. ft: Yeah, hot and cold to categorise codepaths isn't unusual. ArneBab: pkill9: lisp is like programming the language to be a better interface between programmer and machine. leoprikler: and in doing so maybe also solving the problem you originally sought out to solve ArneBab: *maybe* :-) — I just spent 2 hours improving my game code structure hiding that I’m not sure how I’ll continue the story :-) leoprikler: implementing new features? nah, let's refactor :) ArneBab: oh yes … :-) ArneBab: that reminds me that I wanted to add a FIXME: this is horrible :-) pkill9: what is the most straightforward linux desktop setup? pkill9: something that pretty much 'just works' the linux way ArneBab: I’d say just install Ubuntu and don’t change anything. ← sidestepping the question what’s the Linux way. ArneBab: I would hovewer choose Kubuntu instead :-) pkill9: i'm too far in to using guix system pkill9: so it needs to be the linux way ArneBab: I just use Gnome on Guix ArneBab: just works avp_: Hello Guilers! I released Guile-Deck 0.2.0: https://lists.gnu.org/archive/html/guile-user/2021-04/msg00005.html Noisytoot: pkill9, ArneBab: Ubuntu contains some nonfree software ArneBab: Noisytoot: yepp — the question was for "most straightforward", not for "best" Noisytoot: What about Debian? Noisytoot: That's quite straightforward ArneBab: quite yes, but not "most" ArneBab: avp_: does this support encrypted private messages? avp_: ArneBab: Likely not yet. But you may contribute. ;-) ArneBab: I’m already neckdeep in my own projects, but if it would have private messages, it would be a good candidate to create some minimal CLI interfaces just to talk to someone on matrix now and then avp_: In this release I improved the Texinfo documentation, most of the types/procedures are documented. ArneBab: nice! ArneBab: That’s still missing completely from my dryads-wake tools … avp_: ArneBab: I see. avp_: I'd like to build some kind of a equippment management Matrix bot for a local hackerspace using Guile-Deck. ArneBab: wow, that sounds cool avp_: And because of the same "neckdeepness" situation I probably won't be building any kind of a feature-rich user client with this any time soon. ;-) avp_: But it would be nice to include a toy client in Guile-Deck "examples" indeed. chrislck: Anyone knows why is guild named guild? chrislck: is it from the same vein "a guild of schemers/racketeers/guilers"? jackhill: chrislck: something like that "However we changed the name to guild, not only because it is pleasantly shorter and easier to read, but also because this tool will serve to bind Guile wizards together, by allowing hackers to share code with each other using a CPAN-like system." from https://www.gnu.org/software/guile/manual/html_node/Using-Guile-Tools.html#index-guild chrislck: nice but otherwise a bit obscure when called from other tools lol civodul: roptat: merged diff support in guile-git! civodul: pretty cool civodul: thanks for the tests :-) civodul: like i wrote there, might be worth providing 'diff-fold' roptat: civodul, I have one or two additional functions in other parts that I'd like to contribute, but I can't connect to gitlab roptat: also, thanks for merging :) roptat: here are additional functions I needed for gitile: https://git.lepiller.eu/gitile/tree/-/gitile/git.scm roptat: tree-entry-type and config-foreach civodul: roptat: yeah gitlab.com doesn't work in IceCat, go figure civodul: do you think you could contribute them "soon"? civodul: i'd like to have a Guile-Git release out before the Guix release roptat: yeah, I'll push the patches to my branch when they're ready (maybe in one or two hours) roptat: a new branch* roptat: then I can't create a MR because I can't connect, but I suppose you can still merge "manually"? civodul: roptat: sure, just ping me civodul: Epiphany works with gitlab.com, but it's even better to avoid it altogether roptat: civodul, I have my patches except one that adds config-entry. I think it should go to git/config.scm, but it's already used for configuration of guile-git itself roptat: what should I do? move config.scm to configuration.scm maybe? dsmith-work: Happy Friday, Guilers!! dsmith-work: /sudo::/etc/hosts pkill9: is lisp like programming the programmer instead of programming the machine? roptat: oh well, eolie doesn't work for me "ValueError: Namespace Handy not available" roptat: so, no gitlab and no MR dsmith-work: More like programming the language roptat: civodul, I pushed my changes here: https://gitlab.com/roptat/guile-git/-/tree/gitile-features civodul: roptat: nice! re renaming (git config), i'm not entirely sure, but maybe that's ok civodul: i don't think anyone has good reasons to use the current (git config), it's pretty useless civodul: so it should be backwards-compatible in practice civodul: we'll have to document it in NEWS, though civodul: roptat: other than that, could you add tests for the new (git config)? civodul: also, as for diff-foreach, it may make sense to provide tag-fold instead of/in addition to tag-foreach civodul: WDYT? roptat: sure, though I'm not sure what you mean by "implement diff-foreach in terms of diff-fold" roptat: libgit provides only diff-foreach, not fold roptat: so I'd implement diff-foreach in terms of diff-fold that I'd implement in terms of diff-foreach? I'm confused roptat: also, I already implemented tests for config: https://gitlab.com/roptat/guile-git/-/blob/gitile-features/tests/config.scm roptat: ouch, got a segfault when trying to implement config-fold roptat: mh, fixed civodul: roptat: git_diff_foreach takes a void pointer argument if i'm not mistaken, so that's enough to implement diff-fold civodul: then diff-foreach becomes a special case of diff-fold that returns *unspecified* roptat: oh, ok roptat: although, how do I create a pointer from an arbitrary guile object? tohoyn: sneek, botsnack sneek: :) leoprikler: roptat: scm->pointer? roptat: ah thanks :) roptat: wait, the callback needs to return 0, so I need to update the pointer in some way roptat: but I doubt I can do that roptat: or maybe I can make a double pointer roptat: so, I have a double pointer to an arbitrary object, and I need to make the second pointer point to a new arbitrary object, how can I do that? roptat: p1 -> p2 -> o1, I can't change the addresses pointed to by p1, so I want to change p2 with another pointer: p1 -> p2 -> o2 roptat: I guess I can dereference p1, but then how do I updatte p2 to point somewhere else? civodul: roptat: actually branch-fold & co. are not based on the C "foreach" function, but rather on iterators civodul: in case it's easier civodul: otherwise yes, you can have an extra pointer indirection like you wrote leoprikler: I think you'd typically have p2 as a bytevector and write arbitrary pointers into it :) civodul: p2 = (make-bytevector (sizeof '*)) wingo: good evening :) civodul: hey wingo roptat: so, I can transform a pointer to a bytevector? roptat: sounds scary, do I simply copy the address to the bytevector? leoprikler: yep, there's pointer->bytevector and bytevector->pointer leoprikler: for writing you need pointer-address and a number-writing func roptat: well, that's not what I want it seems, bytevector->pointer returns a new pointer to the bytevector, not a pointer that points to the address contained in the bytevector roptat: but I'll manage :) roptat: mh, actually I'll get different sizes of pointers, so how do I write an address (a number) to it? civodul: roptat: bytevector-uint-set! civodul: sorry for the bumps on the road, i didn't expect it to get tricky roptat: ok, I think I have all the elements I need now, thanks :) roptat: now I wonder if the garbage collector will play nicely roptat: I mean, in the callback, I create a new pointer to the new value of the payload, and put its address inside a bytevector... won't the GC be able to collect the payload? That could cause a segmentation fault, right? soda__hobart: you can use the tree *** matching syntax from ice-9 match on an alist, right? i am trying: (match '((#:a (#:b . 1) (#:c . 2))) ((p *** 1) p) (_ #f)) which gets me #f, but i must be messing something up, because i tried something similar the other day and got '(#:a #:b) for the output soda__hobart: well, actually it was like this: (match '((#:a . [(#:b . 1) (#:c . 2)])) ((p *** 1) p) (_ #f)) soda__hobart: this works: (match '(#:a (#:b 1) (#:c 2)) ((p *** 2) p) (_ #f)) jadedctrl: hey, does anyone know of a way to change site-dir? daviid: jadedctrl: you may decide where guile is installed, but not the fact that the site-dir is 'computed' based on guile's effective version, iiuc your question jadedctrl: daviid: alright, thanks daviid: jadedctrl: what are you trying to do? wingo: moin abcdw: Hi guile! Is there a function in guile similar to interpose in clojure? https://clojuredocs.org/clojure.core/interpose wingo: getting the details of inlinable exports right has been a pain and the pandemic is not helping! wingo: also the fsf board shenanigans are not helping :P leoprikler: abcdw: well, there is string-join, but I don't think that counts ;P zzappie: abcdw: if you are after transducers there is srfi-171 btw abcdw: leoprikler, zzappie: Thank you for tips, implemented it myself https://git.sr.ht/~abcdw/rde/tree/master/item/gnu/home-services-utils.scm#L192 zzappie: I also went for fold :) zzappie: https://paste.debian.net/1191963/ zzappie: oops it doesnt work with '() leoprikler: Same as string-join, but without join and string, so "-"? zzappie: leoprikler: didnt get you. I'd expect it return '() for '() input leoprikler: twas but a silly pun zzappie: ah I sometimes bad at parsing puns leoprikler: well, puns are context-sensitive, so LALR won't get you anywhere :) zzappie: leoprikler: well this was a nice one :D abcdw: zzappie: Your implementation is a good one! abcdw: leoprikler: (: Both puns are great) dsmith-work: UGT Greetings, Guilers civodul: roptat: hey! re , could you add tests? civodul: OrangeShark, mbakke: i'd like to make a Guile-Git release shortly, presumably 0.5.0 according to semver lampilelo: is having a global struct with data and then accessing, reading and writing to its fields from all over the place is common in c? omg i want pure functions lampilelo: i'm trying to extend a program but it's kinda difficult to understand this spaghetti code *: dsmith-work hands lampilelo a pasta-friendly comb lampilelo: i think i'll have to use it and redesign some stuff, at least it's not a big project lampilelo: straighten things, if you will dsmith-work: Back in the DOS days, I was using a bbs that had uucp capability (which is why I was messing with it). Was all globals everywhere. dsmith-work: Some functions were merely to set globals. dsmith-work: Was just about impossible to reason about. dsmith-work: The docs even said that the author breaks it all the time when touching it. lampilelo: wow, yeah, sounds like fun dsmith-work: Ugh dsmith-work: I thought I had successfully suppressed those memories. lampilelo: :D zzappie: I was given bunch of industrial electronic units to do factory process automation. Those things were programmed in STX language... zzappie: This is the last thing you want to learn. All tools are proprietary and terrible zzappie: In fact I found it so unusble that I coded up code generation in python for an enourmous state machine with bunch of globals zzappie: This might sound clever but boy it was my first coding job and that was a real monster :) zzappie: amazingly this thing still works roptat: civodul, sure :) spk121: . daviid: .. rlb: ... wingo: heyoo manumanumanu: ahoy! manumanumanu: Is there any b-tree implementation for guile? I need an ordered map, and my old b-tree implementation is lost to the sands of time (and my current Red-Black tree is for some odd reason very very slow. 2 seconds to add 10k elements is pretty bad). amirouche: in-memory or on-disk? amirouche: manumanumanu: ^ amirouche: anyway, I do not know on-disk b-tree implementation using scheme (I am very interested to find one!) amirouche: otherwise there is https://github.com/ar-nelson/schemepunk#schemepunk-btree amirouche: mit/scheme and SCM have a well balanced binary trees chrislck: how would one define a (define (xor a . rest) ...) recursively for an arbitrary number of arguments? Note logxor handles unlimited args. chrislck: something better than (define (xor . args) (not (zero? (apply logxor (map (lambda (elt) (if elt 1 0)) args))))) lloda: chrislck: lloda: (define odd? (compose not even?)) lloda: (import (srfi :1)) lloda: (define (xor . a) (odd? (count identity a))) lloda: I think? flatwhatson: (define (xor . args) flatwhatson: (let loop ((ls args) (res #f)) flatwhatson: (cond ((null? ls) flatwhatson: res) flatwhatson: ((and res (car ls)) flatwhatson: #f) flatwhatson: (else flatwhatson: (loop (cdr ls) (or res (car ls))))))) flatwhatson: chrislck: ^^ chrislck: cool. any takers, eg case-lambda magic? civodul: lloda: (negate even?) looks nicer than (compose not even?), and it's also a bit more efficient (one less procedure call) lloda: fair fair lloda: it's simple enough that i'd write (not (even? (count ...))) prolly lloda: but it's peculiar that even? is defined and odd? isn't civodul: it's odd, even civodul: actually odd? is defined civodul: or is that an R6 issue? lloda: oh it is lloda: i think i tried odd and not odd? and then I defined odd? which is odd lloda: ha lloda: they are in (guile) even chrislck: you're even then civodul: odd lloda: lol chrislck: flatwhatson: (logxor 1 0 1 0 1) -> 1, but your (xor #t #f #t #f #t) => #f flatwhatson: chrislck: Yeah I implemented "Exactly one of these things must be true" instead of "An odd number of these things must be true", it seemed sensible. lloda: logxor is 'A bit is set in the result if it is set in an odd number of arguments.' lloda: but i'd agree that makes more sense as 'exclusive or' lloda: then you could do (define (xor . a) (any identity a)) flatwhatson: Then you'd get (xor #t #t) => #t lloda: right :-/ lloda: (= 1 (count identity a)) then lloda: (logior) is 0 flatwhatson: Yes, but and/or return the last truthy input instead of #t, which is often useful. lloda: (import (ice-9 match) (srfi :1)) lloda: (define (xor . a) (match (find-tail identity a) (#f #f) ((x . rest) (and (not (any identity rest)) x)))) dsmith-work: Wednesday Greetings, Guilers flatwhatson: lloda: Nice! Now this one: flatwhatson: (define (xor . args) flatwhatson: (let loop ((ls args) (r #f) (n 0)) flatwhatson: (cond ((null? ls) (and (odd? n) r)) flatwhatson: ((car ls) (loop (cdr ls) (car ls) (1+ n))) flatwhatson: (else (loop (cdr ls) r n))))) rekado_: I would replace the car and cdrs with a match expression wingo: are we golfing? :) wingo: (use-modules (srfi srfi-1)) wingo: (define (xor . args) wingo: (fold (lambda (arg res) wingo: (if arg (not res) res)) wingo: #f wingo: args)) flatwhatson: Very neat, but it doesn't return the last truthy value wingo: ah indeed. wingo: i guess s/not res/if res #f arg/ chrislck: ah the master chrislck: we're O(small)ing chrislck: fold is underrated... chrislck: thanks boss! dsmith-work: I was going to suggest a fold. No really, I was.. lloda: fold always runs over the whole list. For xor = only one, you don't need that dsmith-work: So what should the value be with no args? One? Does that even make sense for XOR ? lloda: (logior) returns 0, so (xor) should return #f lloda: (or) returns #f which makes sense lloda: ie 'zero' != 'exactly one' so #f dsmith-work: s/One?/One arg?/ lloda: same as (or) lloda: sorry (xor a) = (or a) manumanumanu: amirouche: that one from adam is exactly what i'm looking for. Not on disk, as you might guess :) dsmith-work: Ok. lloda: i like the exactly one definition, wonder why logior is defined like that flatwhatson: The "odd" thing is because that's how (xor a (xor b c)) behaves manumanumanu: amirouche: it looks portable enough, and porting schemepunk to guile seems rather straightforward. dsmith-work: "schemepunk" sounds like a genra of fiction amirouche: I like the name manumanumanu: amirouche: and the srfi-166 implementation seems a lot more efficient than the reference implementation. basing it on generators seems like a generally good idea amirouche: (: amirouche: I never touched srfi-166, even if I like the idea. manumanumanu: srfi-166 is, hands down, the nicest string format utility I have ever used. manumanumanu: I had a compiler for it, that compiled the (ice-9 format) subset of it to more efficient scheme. it was lost in a fire though manumanumanu: I have thought about writing an implementation for it for guile. manumanumanu: not based on the reference implementation (which uses call/cc for the columnar formatting) manumanumanu: which schemepunk show does not. manumanumanu: but it uses it for some of the trimming formatters manumanumanu: which seems odd amirouche: Arthur published a Post Finalisation Note (PFN) SRFI-167 (okvs) and SRFI-168 (nstore), saying do not use them, among many problems those SRFI have, there is one I could not avoid: ALL okvs libraries made the same mistake sheeping the original BerkeleyDB design, I asked the maintainer why it was not possible to count the number of keys, they replied: it is a design mistake amirouche: => next iteration on okvs will have that procedure, that makes coding query optimizer much more easy. amirouche: That is why I need an on-disk b-tree (even if it will be slow) amirouche: at least the design will be correct, and *maybe* people will start adding the function in their C implementations. manumanumanu: Correction: the reference implementation stopped using call/cc for columnar formatting, and things look like they could be faster! amirouche: key count allows to implement key subspace statistics. amirouche: manumanumanu: some implementation have fast call/cc faster than Chez IIUC. amirouche: SRFI-180 should use make-coroutine-generator, it is much more readable. amirouche: the code without call/cc was a pain to write, and I guess a pain to read, it is manual CPS. amirouche: s/manual/explicit/ samplet: Does Guile offer a way to do locale-dependent character classification? samplet: SRFI 14 (char-sets) is locale-independent, and I don’t see anything in section 6.25 (Internationalization) of the manual. dongcarl: Hi all, if I have guile packages in my /usr/local prefix, is it enough to just do GUILE_LOAD_PATH=/usr/local/share/guile/site or do I have to do the full GUILE_LOAD_PATH=/usr/local/share/guile/site/2.2 ? manumanumanu: amirouche: the only implementations where call/cc is fast is cheney on the MTA based where call/cc is free. They are all slower than chez, though :D Anyway, the delimited continuations you can get in chez if you go under the hood are a lot faster than both call/cc and call/cc1 in chez. wingo: good evening amirouche: manumanumanu: by the way, why do you favor b-tree instead of a binary tree? manumanumanu: better cache locality manumanumanu: a left-leaning red black tree is simpler to implement, but whatever I hacked together a couple of days ago is too slow because I fudged something amirouche: I guess I will go with scheme punk b-tree, it will be less work. amirouche: the thing is that implementation will run in the browser, so i do not know how cache localit works in that setting. manumanumanu: if you have access to srfi-146, the non hashing one is a red-black tree leoprikler: samplet, what would locale-dependant classification look like? leoprikler: [also would it be impractical to first convert those characters to UTF-8 and classify them after the fact?] samplet: leoprikler: When I ask (for example) if a character is a digit, it should tell me the answer according to LC_CTYPE. leoprikler: I think there are some locale-dependent regular expressions somewhere (e.g. for detecting yes/no), but I forgot where and I don't think they do numbers leoprikler: See (guile)Accessing Locale Information leoprikler: jlicht: guile-json/guile-yaml come to mind, but on the high level you're on your own i fear wheeler: Having trouble following the examples from https://www.gnu.org/software/guile/manual/html_node/Symbol-Keys.html wheeler: In my REPL, I get an error for assq-set! wheeler: when running (assq-set! car1-properties 'seat-colour 'black) wheeler: Wrong type argument in position 1 (expecting mutable pair): (seat-colour . red) wheeler: Where did I go wrong? wheeler: Is this because I'm running v2.2.7 and not 3.0.X? wheeler: OK, it's not the version. Getting the same result in v3.0.5 wheeler: Am I missing an rnrs? flatwhatson: Seems to be picky about how the pairs are created. If you use assq-set! to add the initial value, and then to modify it, it seems to work? wheeler: flatwhatson: That's right. It works if I set values manually with assq-set! for initial value but not if I use define or set! for the whole alist. wheeler: strange wheeler: but the examples at https://www.gnu.org/software/guile/manual/html_node/Symbol-Keys.html *should* work.... or at least they seem very sensible :D flatwhatson: (define props '((foo . bar))) flatwhatson: (set! props (assq-set! props 'foo 'baz)) ; fails flatwhatson: (set-cdr! (assq 'foo props) 'baz) ; works wheeler: Sounds good -- I'll use set-cdr! and assq for now wheeler: Thanks, flatwhatson! flatwhatson: I agree the examples should work. Guess it's a bug? wheeler: Must be. wheeler: Perhaps the examples were from an older version daviid: wheeler: somewhere in guile's evoution, '(a . b) becomes immutable, as opposed to (cons 'a 'b), this is a manual bug - this will work daviid: just a min daviid: (define car1-properties `(,(cons 'colour 'red) ,(cons 'transmission 'manual))) daviid: (assq-set! car1-properties 'colour 'black) flatwhatson: But why does the set-cdr! version work? daviid: on a immutable pair, that soundfs like a bug, not sure this will work using 3.0 (i was testing the above using 2.2.7 flatwhatson: Above is from 3.0.5 wheeler: daviid: The quasi-quote example also worked in 3.0 daviid: flatwhatson: i meant to say i did test what i wrote using 2.2.7 flatwhatson: Interesting! Confirmed set-cdr! on immutable pair fails in 2.2.7, but doesn't fail on 3.0.5. flatwhatson: Weird thing is that assq-set! calls scm_set_cdr_x, which is aka set-cdr!. When called from C, it errors (correctly), but called from scheme, it works. leoprikler: flatwhatson: I believe in some of these cases the pair isn't actually immutable (that immutability is gained through compilation) dsmith-work: Tuesday Greetings, Guilers lloda: RhodiumToad: thx re primitive-exit MeRaZi: greetings everybody leoprikler: avp_: You can document generics (including accessors) in the code itself and snarf it, but for slots you'll have to manually write them (assuming you use slots without accessors) leoprikler: Also have a look at (texinfo reflection) soda__hobart: with ice-9 match, what is the argument for the predicate func in the (? predicate pat_1 ... pat_n) pattern? is it each item or the entire list? leoprikler: (match '(a b c) ((? pair? (a b c)) a)) leoprikler: I hope this answers your question :) leoprikler: Interstingly, you can also do (= pair? a) to get #t :) soda__hobart: hmm ft: Also, maybe: (match '(a b c) ((? (lambda (x) (format #t "-> ~a~%" x) #t) (a b c)) a)) leoprikler: the predicate is evaluated on the entire things leoprikler: thing* leoprikler: that's why you have to write cute to smuggle other stuff in :P soda__hobart: bluh, i had this figured out before and i forgot haha soda__hobart: i have some relations with logic variables that start with a "?" and i'm trying to pick them out leoprikler: leading question marks sound like your asking for trouble (and make it double) soda__hobart: haha yeah, they're just strings though soda__hobart: it's all just strings at the end of the day, and they're all going to the same place leoprikler: now you've lost me soda__hobart: it's a bad joke, but i mean binary is just string operations, basically, right? leoprikler: if you mean, that you can implement a binary turing machine in terms of label rewriting systems, then yeah, but I think you might be going for something else? soda__hobart: mathematical formalism or something? leoprikler: explain what you mean when you say "binary is just string operations" soda__hobart: like at low-level, the instructions and data and stuff are arrays of bits or whatever, which is like a string? leoprikler: well, at the lowest level, binary can be just a single bit, which a string can't soda__hobart: what about a string in the abstract sense of the term? soda__hobart: it can't be a single piece of information? leoprikler: well, by its very nature, a string is more than a single piece of information leoprikler: it is at least two: where to start, and where to end leoprikler: although where to end can sometimes be confusing :P soda__hobart: haha yeah i'm gonna have to go read gödel or wittgenstein or something leoprikler: Well, Gödel talks about numbers at great lengths, you can even reduce strings to numbers if you really want to. soda__hobart: yeah, i was helping my roommate study for a placement exam the other day and we were reviewing factoring polynomials and i guess it is a string operation basically leoprikler: back to the original question, what is "just a string" in your context? the variable name? soda__hobart: oh yeah, i have an alist with bindings in it, and the keys are strings leoprikler: "bindings" as in procedures generated through FFI/Schmutz/what have you? soda__hobart: no, bindings just as in bound variables soda__hobart: i'm evaluating each term in a clause, like it's a really simple prolog-style rule language leoprikler: so you have rules like "string-operation BINARY_ARITHMETIC." leoprikler: "string-operation INTEGER_FACTORIZATION" leoprikler: oops, missing the dot leoprikler: "string-operation HALT." soda__hobart: no, i suppose i could, but my domain doesn't really require those soda__hobart: it is not quite a life-or-death thing, i'm just trying to make a crude framework for using an equally crude clausal language for making 2d games... but i've been reading a lot of cool books like norvig's PAIP and this algorithms textbook wingo: o/ civodul: hey wingo dsmith-work: Monday Greetings, Guilers lloda: remind me how to exit the Guile repl from any number of nested prompts other than exiting from each one in sequence RhodiumToad: exit the repl, or the whole process? RhodiumToad: (primitive-exit) works to exit the process, but I think everything else is caught and only unwinds one level leoprikler: raghavgururajan: I have great trouble parsing your table. It looks like everything is up-to-date? :D raghavgururajan: leoprikler: Its a navigation list for where to start and where to end. srandon111: hello guilers! stis: tja guilers! wingo: heyyyyyy jlicht: Seeing as OpenAPI/Swagger is hip and happening, does anyone here know of ways to create and/or consume specs for it in guile? lle-bout: hello has behavior changed in incompatible ways between Guile 3.0.2 and 3.0.5? dsmith-work: lle-bout: Look in the NEWS file. Changes are documented there. dsmith-work: Sure would nice if the NEWS file dsmith-work: "Changes in xxx (since yyy)" had the top level *. dsmith-work: Then it would be much nicer to view with org-mode lle-bout: dsmith-work: thanks but does it mean major versions of GNU Guile can introduce incompatible changes? dsmith-work: lle-bout: I belive that's the goal, but sometimes mistakes happen. And other times there is no other way to fix something. dsmith-work: lle-bout: I'm sure the devs try very hard not to let that happen. lle-bout: dsmith-work: basically GNU Shepherd with GNU Guile 3.0.5 doesnt work and I'm trying to fix it dsmith-work: Well, the only onces I see are: dsmith-work: `call-with-output-string' closes port on normal exit dsmith-work: `copy' read-option removed dsmith-work: lle-bout: What doesn't work? lle-bout: dsmith-work: the test suite, here's logs: https://paste.debian.net/plain/1191601 - I don't know GNU Guile's Scheme much.. lle-bout: I verified that with GNU Guile 3.0.2 it works, but not 3.0.5 lle-bout: raghavgururajan: about to rebase, so next time git pull --rebase lle-bout: raghavgururajan: no big deal it's just the commit is the same now I guess, don't know if you rebased or cherry-picked lle-bout: raghavgururajan: looking at shepherd btw lle-bout: oops sorry wrong channel leoprikler: Is there a way to determine the RTD of a record (assuming it's not opaque)? janneke: maybe struct-vtable, struct-ref? avp_: Hello, Guilers! Is there any good examples of how GOOPS classes are documented in Texinfo format? I mean I surely can write the docs on my own but I'd love to learn from the masters. ;-) stis: Hello guilers! roptat: probably a stupid question, but how do I fully expand something like @datarootdir@ with autoconf? I have a conf.scm.in file where I use that, but it get expanded to a string that contains "${prefix}", so that doesn't work as expected janneke: roptat: you can use make to create conf.scm from conf.in using sed -e 's,[@]datarootdir[@],$(datarootdir),g' ... roptat: ok, thanks morganw: I think technically you only need one [@] as it only needs to break the original pattern match chrislck: guix's guile-next's guile --version is UNKNOWN lol dsmith-work: Happy Friday, Guilers!! BitPuffin: Happy fri cheim0: rlb: cheim0: to close bug 34457 on the bug tracker, is access to the server control at debbugs.gnu.org restricted to lead developers? Or is it unrestricted, allowing any user to tag or close a bug? apteryx: cheim0: unrestricted cheim0: thanks manumanumanu: ahoy hoy! wingo: hey hey :) manumanumanu: wingo: I don't know if you are subscribed to srfi-announce, but immutable integer mappings just got a SRFI draft. They seemed an awful lot like intmaps, so I am digging through the intmap source to see if I can implement that srfi on top of intmaps. wingo: neat stis: hey guilers! dsmith-work: UGT Greetings, Guilers wingo: hej :) lle-bout: this backtrace is showing quite unhelpful because it trims strings: https://paste.debian.net/plain/1190976 wingo: something to fix for 3.0.7, yeah wingo: i mean it's been like that for a while but we need to fix it lle-bout: thanks wingo! manumanumanu: hej stis! how is python coming along for you? It is a project that fills me with awe, while making me disappointed with myself because I can't stand python :P daviid: lle-bout: can you try ,bt [#:full? #f] #:width 1000 lle-bout: daviid: in that scenario I cannot because the error is issued by GNU Guix where I have no control over GNU Guile options daviid: lle-bout: hum, i thought it was possible to do 'something', even though ... like export COLUMN=1000 before to run your guix script - https://lists.gnu.org/archive/html/guile-user/2019-03/msg00007.html lle-bout: daviid: interesting will try next time! lle-bout: thanks stis: manumanumanu: it's moving slowly forward, a lot of things works well, especially the parser which can handle a big chunk of python 3.6 code stis: currently I'm working to get the typing working manumanumanu: stis: like a proper type checker?? stis: just making sure that you can quiry type information for variables in classes stis: I need it for dataclasses which i am implementing stis: manumanumanu: ^^ manumanumanu: that shit go way beyond me. I am trying to implement a red-black-tree, and it is very slow. Creating 10000 integer mappings takes 2.5 seconds... manumanumanu: what are python dataclasses? stis: structs with inherritance but interoperates with python normal classes soda__hobart: ok, my "delete-my-struct" function does not appear to be actually freeing any memory soda__hobart: like if i allocated 500mb, and i see the memory usage in htop tick up by 500mb, and then i call my delete function on all those structs i just made, i should be able to see the memory usage drop in htop, right? leoprikler: Not necessarily. The operating system can let you keep that memory if it feels you're just going to use it again anyway. leoprikler: you should really do a valgrind there soda__hobart: yeah, i think valgrind will help me get to the bottom of it leoprikler: [that said, 500mb feels large and the operating system would likely want that memory back if you're not using it] soda__hobart: bluh... i think the problem is because i make this lcrs binary tree recursively, and then flatten it into an array so it can be serialized, but it looks like i'm only freeing the root node of the original tree soda__hobart: yay, it worked! i'm still leaking memory, but a lot less now :] wingo: o/ rekado_: I’ve got a little server here that produces a long stream of binary data rekado_: https://elephly.net/paste/1616572710.html rekado_: the client uses “echo '"something"' | nc ip 2904 > foo” to receive the stream rekado_: I notice that the data stream is always truncated on the receiver rekado_: a couple dozen trailing bytes are missing rekado_: I got closer to the full data stream by disabling buffering rekado_: my guess is that the server kills the connection before everything has been sent. rekado_: shouldn’t “(force-output client)” do the right thing here? rekado_: or is it perhaps buffering in the command that generates the data stream…? rekado_: (the actual code doesn’t use “display” but the Guix API) ArneBab: does someone have a package for wrk? wingo: rekado_: do you need to read the newline off the input or something? wingo: is there some kind of nagle algorithm in effect? *: rekado_ doesn’t know rekado_: I note that on the same host everything is received rekado_: across the network the last bytes are missing rekado_: it’s not always the same amount that’s missing wingo: weird rekado_: wingo: setting TCP_NODELAY on the socket seems to have fixed it, so it seems that your nagle algorithm guess was spot on rekado_: thanks! wingo: yay wingo: oddly guile's core web server doesn't set that flag but the fibers one does wingo: :unicode_shrug: ArneBab: wingo: are you looking into the fibers server right now? ArneBab: (if not, please just say no — I don’t want to clobber your context, it’s just that I have some longstanding questions about small parts of it) lle-bout: hey, is there a way to speed up GNU Guile checking for .go files? lle-bout: All these stat calls on startup dsmith-work: UGT Greetings, Guilers civodul: lle-bout: you can read at issues.guix.gnu.org what i did for the 'guix' command produced by "guix pull" civodul: in the future we could imagine a mechanism similar to ld.so.cache lle-bout: civodul: thanks will look! soda__hobart: in C, how can i look up a procedure that i loaded and evaluated with scm_c_primitive_load? i have a little test func: (define (say-hi) (display "hi\n")). i tried using scm_c_lookup ("say-hi"), but when i try to use scm_call_0 using the output of scm_c_lookup, i get this error: Wrong type to apply: #> RhodiumToad: so as I understand it, scm_c_lookup returns the variable, not the value RhodiumToad: scm_c_private_ref or scm_c_public_ref might be better? dsmith-work: ISTR using SCM_VARIABLE_REF soda__hobart: oh, that makes sense... i don't see SCM_VARIABLE_REF in the procedure index (dunno if i could use it runtime anyways?)... but for scm_c_public_ref, what would be my module name? is it strictly necessary to define a module or can i just use the evaluation environment created with scm_init_guile? RhodiumToad: you could use scm_public_ref(scm_current_module(), scm_from_utf8_symbol(name)) to look up in the current module soda__hobart: oh cool. looks like scm_variable_ref (scm_c_lookup ("say-hi")) worked too RhodiumToad: yes, that's the same thing under the hood soda__hobart: well thanks! i would have been running around in circles for a while dsmith-work: SCM_VARIABLE_REF is a macro. No error checking like in the scm_*_ref functions. soda__hobart: IM_NOT_YELLING_THIS_IS_A_MACRO stis: hey guilers! stis: just got python 3.10 match statement working stis: in guile prolog *: stis is a match fan stis: in guile python it should be dsmith-work: stis: Is the new Python match anywhere near close to the match in Rust? stis: not so familar with rust. but it is a wecomed addition to python. probably there will be a lot of improvemets to it in the nextreleases stis: took me a day to implement it stis: it has ... or,and sequence and mapping and class matching stis: not =,? stis: a guard as well stis: not =,? is missing in ice-9 mtch lingo stis: much cleaner code in many instances already soda__hobart: there's guile prolog? stis: soda__hobart: yes stis: pretty big and targetting swi-prolog compability but with fun extensions dustyweb: pkill9: I'm not sure what you mean by list metadata pkill9: eg list in the metadata pkill9: like you have title, date pkill9: one of those but instead of a string, a list chrislck: have a list of records instead of strings rekado_: pkill9: a common way to annotate lists is to use keyword lists rekado_: e.g. '(#:title "My Title" #:date (current-time) #:text "Once upon a time…") rekado_: sorry, needs quasiquoting: `(#:title "My Title" #:date ,(current-time) #:text "Once upon a time…") pkill9: oh nice pkill9: so how would you use that? leoprikler: depends on what you're planning to do in the end leoprikler: e.g. format, write to sxml, … nly: hi dsmith-work: Tuesday Greetings, Guilers ArneBab: wingo: is there a way for the lilypond folks to change the optimization level (to maybe benefit from the baseline compiler)? it looks like they are using compile-bytecode from module/language/tree-il/compile-bytecode.scm Bumblehorse: Is there a function for adding up a list of integers? Right now I am doing something like this: (fold + 0 '(1 2 3)) which returns 6. RhodiumToad: (apply + '(1 2 3)) Bumblehorse: Oh geez, I thought that worked like map. Thank you RhodiumToad: + takes any number of args and returns the sum lle-bout: hello! how can I get more precise line information for syntax errors? lle-bout: I get something like this: https://bpa.st/raw/QHPA lle-bout: I am unable to find the error manually stis: sometimes you are left with commenting out stuff in the scm file stis: guile is lacking sometimes whenerror reporting janneke: to state the obvious...sometimes git diff helps stis: yes all these debugging skills are useful when the tool is not supporting you lle-bout: janneke: I have been using git diff to find it for hours already :-S lle-bout: I can't comment stuff there's too much janneke: lle-bout: oh, that's terrible lle-bout: I would need something like bisect but for individual patch hunks lle-bout: janneke: going to commit everything and bisect lle-bout: commit everything as individual commits lle-bout: what a rough day janneke: lle-bout: sometimes it's just that way, good luck wingo: evening lle-bout: wingo: hello! :-D wingo: hi :) *: wingo pokes at cross-module inlining RhodiumToad: I see that FSF can't resist playing with the foot-howitzer again wingo: it's amazing isn't it pinoaffe: RhodiumToad: if it wasn't oh so deeply saddening I would be laughing right now lle-bout: wingo: in JIT? wingo: lle-bout: no, AOT zzappie: RhodiumToad: Im too curious not to ask what are you refering too wingo: for a subset of declarative definitions davexunit: RhodiumToad: yup, the board is hopelessly out of touch. I feel bad for the staff. wingo: zzappie: apparently rms is back on the fsf board of directors. a bit of a confusing situation, with no official communication from the fsf afaik, but private communications that appear to confirm this is the case lle-bout: janneke: weirdly after committing it seems the error has disappeared wingo: there is a fair amount of organizing about it, cf https://rms-open-letter.github.io/ lle-bout: I discarded some commits that didnt apply though.. davexunit: my experience is from 6 years ago now, but working at the fsf was eye opening in an unfortunately bad way. lle-bout: I mean, did apply in the patch sense but were incorrect zzappie: wingo: oh! Wow this is unexpected. At least for me davexunit: fsf staff are unionized but there's no power there. it basically just kept rms from arbitrarily firing people when he was president. janneke: lle-bout: good :) lle-bout: janneke: my wrist hurts lle-bout: GNU Guile lack of error reporting caused actual physical pain, I have at least one documented case janneke: well... wingo: lle-bout: apologies! we should make a point release that focusses on improving errors :) lle-bout: janneke, wingo: it was a it of a joke heh do as good as you can but better error reporting welcome :-) wingo: :) lle-bout: wingo: I wonder what the tooling is for inline documentation in GNU Guile code, I feel like that's the best way to maintain documentation, e.g. how Rust communities do it lle-bout: It would be awesome if we got self-documented GNU Guix core if not package code janneke: lle-bout: yes, i got that...and i know the experience of feeling glued to the computer until it's fixed janneke: i feel a lot better, though, when i manage to break such a streak and take a break in time lle-bout: I mean I got my wrist hurting due to making so many commits manually to use bisect lle-bout: hands moving around in repetition lle-bout: 117 commits janneke: wow daviid: janneke: I have a copy of define-method*, slightly changed, it was written by Mark ... daviid: changed to use receive, not let-values, which unlike others :),I do find much better then any other *values forms ... daviid: janneke: here https://git.savannah.nongnu.org/cgit/grip.git/tree/grip/goops.scm#n62 (a comment to credit Mark at the beginning of the file, line 26 ... daviid: i should add this and other goops utilities to guile-lib really ... one day i will janneke: daviid: thanks, yes that't it! janneke: fwiw, i also liked receive best until i discovered srfi-71 ;) janneke: iwbn to have this in goops daviid: janneke: Mark was a maintgainer when he wrote it, I think that it is because it is not part of the (clos) protocol, that he didn't want to add it in guile 'proper', don't know mbakke: srfi-71 changed all my scripts overnight :P leoprikler: lle-bout: there are a few ways of leveraging texinfo to do your formatted/unformatted inline documentation soda__hobart: ok, i have a guile procedure defined in C/C++ where i allocate some memory on the heap to initialize a struct, and return a SCM pointer object using `scm_from_pointer`... i do some stuff with it (serializing to bytevector and sending thru socket), then i call another guile procedure (also defined in C/C++) where i call scm_to_pointer on the SCM pointer obj, and then free this pointer and return SCM_UNDEFINED. soda__hobart: am i leaking memory there? it seems that i am soda__hobart: i initialized the struct with regular malloc, not scm_gc_malloc leoprikler: I think in that way it should be safe, but you ought to think about non-local exits. leoprikler: I.e. if you go the full way of malloc → scm_from_pointer → scm_to_pointer → free, there should not be a leak, but note, that the second half seems to be manual in your case (which we don't really like here in garbage collector land) leoprikler: also I'm assuming here, that "free" is an appropriate way of deallocating all the resources acquired by your struct soda__hobart: i think it is, but i need to do more research on that soda__hobart: i have a char* data element, but just using htop, it looks like i'm leaking even when i don't initialize that member soda__hobart: however, for the C/C++ program that receives that data, i know from using valgrind that i'm leaking memory leoprikler: I think you have two potential leak sources here and you should focus on each individually leoprikler: First, check the malloc to free route on its own, then do the socket stuff extra. soda__hobart: yeah, i think that is a good idea leoprikler: also manually invoking (gc) might help detect cases in which the memory is only growing because you're too lazy to recall it :P Formbi: hi Formbi: why isn't the default map tail-recursive? civodul: Formbi: mostly because it's unnecessary with expansible stacks civodul: they achieve the same thing as having an explicit accumulator civodul: the downside is that backtraces with 'map1' are a bit ugly Formbi: doesn't it use more memory? chrislck: more memory in the stack, less memory in accumulator chrislck: accumulator also uses memory Formbi: hmm, I think the memory consumptions should be compared chrislck: plus, the accumulator will need to be reversed when completed. not so when using the stack. wingo: good morning civodul: o/ janneke: \o lampilelo: \o/ chrislck: /o\ mbakke: o7 *: wingo has a design for cross-module inlining, whee davexunit: wingo: exciting! sneek: Welcome back davexunit, you have 1 message! sneek: davexunit, manumanumanu says: I have been working on a wrapper around srfi-64 that implements a large chunk of (chibi test)... dsmith-work: Hey Hi Howdy, Guilers leoprikler: Am I the only one, who finds it funny, that the reference implementation of SRFI 223 contains exactly the kind of bug they were supposed to defend against? davexunit: oopsy daisy Aurora_v_kosmose: rip manumanumanu: leoprikler: which one? leoprikler: (low + high) / 2 rlb: I'm wondering why something like string-append has to scm_remember_upto_here_1 the individual strings, i.e. how could we lose track of them if they're in the argument rest list? rlb: (Asking because preserving that wrt utf8 strings might be a little more work.) manumanumanu: leoprikler: It has been a long time since I implemented a binary tree (I have two implementations I wrote about 11 years ago; one functional and one imperative). Should it floor? Shold it add 1? I don't remember. leoprikler: manumanumanu: (low + high) can overflow. This is typically not an issue in Scheme, because it just gets promoted to bignum, but the key is, that it shouldn't need to be promoted leoprikler: rlb: the rest list itself – or at least parts of it – could be discarded as you iterate manumanumanu: oh, but for a reference implementation clarity is king. rlb: I thought anything that was a C side argument was preserved throughout the call. rlb: i.e. if we have foo (SCM x) { ... } anything referred to by x will persist until foo returns? rlb: And since it's a rest list, no one should be able to destructively modify it to drop refs? leoprikler: uhm, no? leoprikler: you can drop x if it's no longer on the stack at any point leoprikler: the C optimizer can do that rlb: At least in our docs: "Guile's garbage collector will automatically discover references to 'SCM' objects that originate in global variables, static data sections, function arguments or local variables on the C and Scheme stacks, and values in machine registers." leoprikler: *on the C stack* is important here rlb: SCM is "function argument" in this case. leoprikler: if you pass arguments through registers and the compiler decides that the argument is no longer used → boom leoprikler: arguments on the stack is a full sentence :) leoprikler: why else would the example have scm_remember_upto_here_1 (file); // file is an argument leoprikler: the manual explicitly tells you, that this can happen RhodiumToad: personally I'm not convinced that the gc can actually operate correctly in all cases, given the amount of freedom the compiler has RhodiumToad: in particular the compiler can (and modern optimizers actually do) represent a pointer value by means of some offset rlb: Yeah, I wasn't looking at that page -- and clearly I've misremembered part of the requirements. Though I still wonder about a rest list to a SCM_DEFINE, i.e. I'd have assumed that pointer is held on to throughout the call by the caller. rlb: i.e. the code that constructed the rest list, but that might also just have been a vague incorrect guess. rlb: Is it at least a safe assumption that a rest list can't be modified (from outside) during a call? rlb: (I *think* that's probably true?) RhodiumToad: why are you bothering about this? RhodiumToad: you should probably assume that the compiler and optimizer will actively break things, and be as defensive as possible about it rlb: because with utf8 strings, it'd be more efficient if we can compute the strinbuf offsets (start and end) for each string as we make the first pass in string-append and then use those to build the final result, than if we have to do that twice (if we can't assume things won't change) rlb: (we have to compute the offsets in the first pass to get the total byte count -- similar to the approach for current strings) leoprikler: how can you be sure that the strings themselves won't change between computing the offset and concatenating the strings? leoprikler: [in an MT environment] rlb: Yeah, that's what I'm working on -- one option I was thinking of was to capture the stringbufs and offsets up front, and then traverse that. Since the stringbufs are immutable. rlb: Of course if I do that, then some aspects of my other questions don't matter. pkill9: dustyweb: how can I add a list metadata? with a quote? e.g. '("listitem1" "listitem2") ? pkill9: hmm actually the nicest would be yaml mwette: /quit dustyweb: pkill9: hm, I haven't actually demonstrated it anywhere in my own stuff... I've been putting tags in the markdown files but not actually exposing them dustyweb: so... not really :) dustyweb: but I know Haunt does recognize them chrislck: are the mingw hackers targetting mingw-w64 by any chance? spk121: chrislck: there's a patch on guile-devel we're working on for mingw-64. If you want to see how it is going, or try it out janneke: spk121: i can't find a link to it, but wingo suggested instead of janneke: > 813 - unsigned long bit_count; janneke: > 813 + scm_t_unum bit_count; janneke: in arrays.c, to use [s]size_t (and not uintptr_t) janneke: which makes sense, i think janneke: while doing such a big change, iwbn to get it right, and not have to change it again ;-) fnstudio: hi, i'm taking the first steps into the world of design for flexibility and i have a question around "(lambda (args) ..." vs "(lambda args ..." fnstudio: minimum example: https://paste.debian.net/1190238/ (it's a simple example, no spoiler alert needed with regard to the book's exercises) fnstudio: i suppose that "lambda args" may be preferred in so far it gives more flexibility with regard to the number of arguments? whereas with "(args)" then args has to be exactly one value? stis: Hi guilers! rekado: fnstudio: yes, (lambda (args) …) requires exactly one value, wherease (lambda args …) binds the argument list (even if it is empty) to “args”. fnstudio: rekado: i see... thanks, yes i think i can see it more clearly now, and "args" probably makes things a bit easier down the line fnstudio: also explained very well here: https://www.gnu.org/software/guile/manual/html_node/Lambda.html fnstudio: "formals" can be "(arg1 ...)", "args", or "(arg1 ... argn . argn+1)" spk121: janneke: yeah, size_t there makes sense,. That's what that array macro returns janneke: i'll change that janneke: spk121: but now i'm wondering about the laest: scm_i_inum => intptr_t, unsigned long long => uintptr_t janneke: shall we use size_t and ssize_t instead? spk121: what are your thoughts? spk121: If one were to try to take advantage of the implied meaning of the C types, intptr_t would be held specifically for integers that might contain pointers, while size_t would be only for indicating the memory size or count of things. janneke: ah, yes -- seen that way, intptr_t makes more sense spk121: For those things that were neither integers-holding-pointers, nor the memory size of things, it should really be long, long long, int64_t, or whatever spk121: Theoretically, if we janneke: yes, i agree spk121: have disambiguated everything into int-holding-pointer, size, or "regular" integer, it should not be a problem to keep the "regular integer" longs in most cases. It is just that, from my point of view, doing that disambiguation is rather tricky janneke: yes janneke: changing some intptr_t back to long is going to be somewhat tricky, we'd have to be very careful not to truncate on mingw 64bit spk121: For 32-bit platforms, those longs do work. I still build guile on at least one 32-bit platform. It is the truncation of integers that is a problem, as you say spk121: Can we get a compiler to do the hard work of detecting improper casts of integer size? Some combination of warning flags? leoprikler: w.r.t. cross-compiling Guile libraries, how does detection of $(host) work? leoprikler: i.e. for guild compile --target janneke: in an autoconf setup, configure just picks up --host janneke: then you do something like janneke: if test "$cross_compiling" != no; then janneke: GUILE_TARGET="--target=$host_alias" janneke: AC_SUBST([GUILE_TARGET]) janneke: fi janneke: and use something like guild compile $(GUILE_TARGET) ... spk121: janneke: so here I am digging into gcc options, and I came across one called "-mlong64" which forces longs to be 64 bits janneke: spk121: that's interesting... leoprikler: hmm, I just figured, I'd always get $(host) set if I use AC_CANONICAL_HOST janneke: regtur asked me about that, and i dismissed him saying that all system headers/libraries would be incompatible with the rest of mingw/windows then, but... leoprikler: just compile all of it with -mlong64 and it's fine :) leoprikler: inb4 short long leoprikler: alias long short janneke: yeah, it may just work janneke: but makes you wonder, if there's such an easy and obvious solution, why would gcc not have that option on by default spk121: doh! Looks like it is MIPS only janneke: there surly must be a strong case (use case) for th long=4bytes thing janneke: ah janneke: yeah, i mean it's extra work for the gcc folks to make long=4bytes on mingw tohoyn: janneke, leoprikler: may be you should see dpkg-architecture janneke: they cant' be all totally mad? leoprikler: I think "long"=32 bits is historical, since back then int=16 bits spk121: 32-bit long will still be allowed by the upcoming C23 standards janneke: leoprikler: yes, you can probably use --target=$(host) leoprikler: Well, the C++ committee can't really single-handedly decide Microsoft to be stupid, when Microsoft sits in the committee :) leoprikler: hmm leoprikler: would be funny if someone invented a programming language, where all data types are just bit fields of size 2^N. leoprikler: N defaults to 32 and you double it by declaring something "long" and halve it by declaring it "short". leoprikler: but you have to declare at least one :) leoprikler: so to have a default int you'd have to write "long short foo" *: janneke puts up arrays.c change for wingo https://gitlab.com/janneke/guile/-/commit/b587e04e6b0e0fe37cb8774609a51ac7e04127a5, also mailing v3 fnstudio: hi, is there any particular channel that's being used for discussing and "socialising around" the new book "software design for flexibility"? spk121: ok, new plan. Let's re-write Guile in ADA. janneke: oh great! be sure to also write an ADA compiler that can be bootstrapped, so that we can have the new Guile in Guix ;) spk121: no problem! fnstudio: what's the difference between define and let when locally defining a procedure within another one, eg in this example https://paste.debian.net/1190256/ fnstudio: i thought i have some background on what the difference is, at a general level fnstudio: but then i found a snippet where "define" is used where i'd have used a "let" instead leoprikler: local defines are equivalent to letrec with less indentation fnstudio: leoprikler: oh ok, great, thanks, so no differences in terms of scope for instance, etc; would it be sensible to say that one is syntactic sugar for the other? leoprikler: pretty much, yeah leoprikler: if you observe anything else, that's a bug fnstudio: leoprikler: i see, fantastic, tx! fnstudio: (oh today i learned mit/gnu scheme is not guile, how naive of me) roptat: any idea where this guile.am comes from? It seems to be copied from project to project, but there's no copyright/license information: https://github.com/wingo/fibers/blob/master/build-aux/guile.am leoprikler: reverse git search ;P civodul: roptat: probably from 'am/guilec' in Guile civodul: there's little originality in this file though (the main criterion to decide whether it's copyrightable) roptat: ah right, I recognize some of it, slightly modified roptat: I just watched the talk about reuse this morning at libreplanet, and they were copyrighting even .gitignore rlb: Right now a "shared" string has a start index, and that start index has to be added to the underlying shared string's index to compute the real offset in the underlying buffer, but can those indexes (offsets) ever change? If not, I thought I might just add them when creating the shared string, so we don't have to repeat the computation all the time. i.e. shared strings would have an absolute index into the (indirectly) underlying rlb: stringbuf. *: stis is improving the guile python repository. Bug after bug after bug .... *: janneke may have fixed the "Fix 'absolute-file-name?' and others..." spk121: I'm not sold on the idea that we have different 32-bit and 64-bit representations of a hash. (actually 30 and 62 bit). Either 30 bits is enough, or it isn't RhodiumToad: it usually isn't janneke: i wondered about that too janneke: i tried without patchin hash.c, but that "didn't work" janneke: i figured that it may have to do with the sizes of fixnum having to be equal to the hash size, for some reason, but i don't know janneke: it's "interesting" that "long" was used before, and not "int", if 30 bits are always ok? spk121: anyway, when guessing semantic meaning to the various integers in Guile that appear in your patch, one big category is 'hash value' which apparently needs to be scm_t_inum sized. It is inum sized when created by JENKINS_LOOKUP3_HASHWORD2 spk121: or rather it is *intended* to be scm_t_inum sized, but is actually unsigned long size when passed around janneke: hmm; it has this janneke: janneke: if (sizeof (ret) == 8) ret = (((uintptr_t) c) << 32) | b; janneke: and if there isn't uintptr_t, but long, shift is problematic spk121: yeah janneke: but possibly we can change the caller, i.e. "ret"? janneke: hmm, that's only narrow_string_hash and wide_string_hash janneke: and it's a whole chain... janneke: could it be that (something like) this: janneke: case scm_tc7_pointer: janneke: return scm_raw_ihashq ((uintptr_t) SCM_POINTER_VALUE (obj)); janneke: is why we need the hash bits to be pointer-sized? spk121: I think, for symbols, it is because it gets packed into an scm_t_bits size word in scm_double_cell in scm_i_make_symbol spk121: for scm_tc7_symbol janneke: ah, that makes sense spk121: So there are two hashers. JENKINS for string-like things, scm_raw_ihashq for everything else. Both return unsigned long intending to an scm_t_inum spk121: I think, just for fun, I'll see what happens if I make an scm_t_hashval type and trace it through the code janneke: that's great, thanks for looking into this! wingo: o/ janneke: \o stis: \o/ wingo: haha, just realized that all the tree-il accessors are procedures-with-setters wingo: that's special :) wingo: hooo, it seems that the accessors also don't check the type of their operand wingo: yolo janneke: initially, mes didn't check anything, not even the if the parameter count to procedures matched janneke: i would test everything by running it on guile anyway, right? janneke: that was one on the worst decisions and it cost me a lot of time until i corrected that ;-) spk121: fun fact. in weak-table.c, hash values are converted to buckets by using modulo. In cache-internal.h hash values are converted to buckets by using a mask of the low bits *: wingo writes a tree-il codec wingo: yaaargh, i managed to unify three record type representations in guile (conditions, r6rs records, core records) but not (system base syntax) records wingo: gah wingo: ah no it's that the "core vtables" mechanism doesn't produce vtables of the right shape... wingo: yarr rlb: wingo: and goops instances? *: rlb still hopes to unify records and class instances wrt method specializations. wingo: goops instances are not unified right now rlb: progress at least, perhaps. rlb: I imagine we're not changing the long/intptr_t/etc. stuff in any public apis, or that'll just go into 3.2 or 4.0? wingo: yeah at least going in the right direction. goops is so peculiar that it would be nice if it could somehow absorb records -- i.e. treat a record type as a class in all places -- but without forcing the class representation down into core records. but i don't know what would be needed. wingo: rlb: yeah exactly janneke: no public apis are changed rlb: cool rlb: wrt classes, yeah, I'm not very knowledgeable there yet, just mostly experienced that bit from the end-user perspective. janneke: i believe i saw a patch that added keyword parameters to methods, any ideas where that might be or who wrote that? janneke: spk121: just a heads-up, my latest patch doesn't compile on mingw, mini-gmp.c needs to include stdint.h explicitly *: janneke pushes a fix and starts another guile-patched,guile-mingw build janneke: fun, i was attempting to test my absolute-file-name? fix spk121: janneke: sadly, I've run out of time for this for now, but, I've learned a lot about guile's hashes and hash tables today janneke: spk121: while it would be nice to have this in 3.0.6, i'm not at all in any hurry janneke: thanks a lot for looking into this, there is time *: janneke -> zZzz alextee[m]: im reading guile's website and it says: In addition to Scheme, Guile includes compiler front-ends for ECMAScript alextee[m]: is this like javascript? alextee[m]: and does this mean that if my C code supports running Guile scheme I can also pass it a piece of javascript code and it will run as well? alextee[m]: also "support is underway for Lua" this sounds great too but same question alextee[m]: my code basically does scm_call_0() on a function returned by scm_c_lookup() daviid: alextee[m]: ECMAScript - https://en.wikipedia.org/wiki/ECMAScript alextee[m]: heh, was just reading that alextee[m]: so is it like scheme so that if you define a function in ECMAscript like "myfunction" then scm_c_lookup() on "myfunction" and scm_call_0() will work? daviid: alextee[m]: no idea, others will shime in hopefully ... rlb: alextee[m]: I'm not sure how easy it'll be to do whatever specific thing you have in mind, but yes, guile does support different dialects, including elisp and "javascript", though I suspect the dialects vary in features/completenes. In case you hadn't seen, you can switch languages at the repl:. rlb: $ guile rlb: ... rlb: scheme@(guile-user)> ,L ecmascript rlb: Happy hacking with ECMAScript! To switch back, type `,L scheme'. rlb: ecmascript@(guile-user)> rlb: ecmascript@(guile-user)> 2 + 2; rlb: $2 = 4 rlb: alextee[m]: I see rlb: Of course integrating that with whatever else you're doing may require more. alextee[m]: well I'm mostly interested in extensibility for my app using user scripts rlb: I'm familiar with some of it since I've been working on a clj dialect, but I don't know much about the ecmascript support. alextee[m]: i already support scripts written in scheme and it seems to work pretty well rlb: Right, that should "just work". alextee[m]: but is the scm_call_*() api targeted at only scheme? or is it supposed to work with user scripts in other languages like ECMAscript? rlb: Not sure for js -- for my dialect, it'll work perfectly. rlb: i.e. the way I arranged things, a clojure namespace *is* a guile module. alextee[m]: yeah I'd assume if this worked you'd have to write the code in a specific way to mimic modules and stuff rlb: And there's no difference atm between a clojure defined function and a scheme defined function in terms of binding, invocation, etc. They just do different things when called. alextee[m]: would be nice to have example scripts somewhere in various languages rlb: There might be, just don't know too much about the js side. rlb: atm rlb: But you could also probably use the "language tower" functions, but I'll have to go look that up for you, and might not get to it until later, but feel free to ping me if I don't get back to you in a day or so (assuming someone else doesn't). rlb: Oh, and if the js side just binds the js functions in a guile module, then the call functions might work fine, plus or minus getting the right data types for args (if any of those are special). rlb: (after you get the fn ref from the right module) rlb: alextee[m]: bits in the general area: https://git.savannah.gnu.org/cgit/guile.git/tree/test-suite/standalone/test-language?id=de5d1a7f99b8e952b115237ebc29633062f99bb https://git.savannah.gnu.org/cgit/guile.git/tree/test-suite/tests/ecmascript.test?id=de5d1a7f99b8e952b115237ebc29633062f99bb rlb: And the implementation is here, which might or might not be useful: https://git.savannah.gnu.org/cgit/guile.git/tree/module/language/ecmascript?id=de5d1a7f99b8e952b115237ebc29633062f99bb rlb: But yes, completely agree we could do with more elaborate documentation on that front. alextee[m]: rlb: these give some clues, thanks! rlb: also definitely https://www.gnu.org/software/guile/manual/html_node/Using-Other-Languages.html alextee[m]: my idea of guile (at least from the website and GNU pushing it as an extensions language) is that it's main purpose is for extending programs so yeah it would make sense to have some more docs on that front rlb: And note that guile can compile not just to a file (for future execution), but also to an actual "live" function, etc. that you can call. I believe that's mentioned in the info pages somewhere too. rlb: alextee[m]: yeah, as a simple example, this works: rlb: scheme@(guile-user)> (use-modules ((language ecmascript parse) #:select (read-ecmascript))) rlb: scheme@(guile-user)> (compile (call-with-input-string "2 + 3;" read-ecmascript) #:from 'ecmascript #:to 'value) rlb: $1 = 5 rlb: rlb: Basically just a distilled version of what ecmascript.test is doing, but perhaps gives you a general idea. alextee[m]: ah, maybe i could just wrap scripts written in ecmascript in a guile script that does that with the string.. rlb: ...worst case, you could perhaps do a read-compile-eval loop on the input file, but there might be a better way. rlb: rather read/compile/call or whatever. rlb: But assuming js supports it (and it may), you could also compile to files first (timestamp based or wahtever as scheme and the clj dialect do), and then load the compiled code. That'll be more efficient for static files of course, if it suits. rlb: alextee[m]: here's how lokke does that (in a very hacked up way) right now: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/ns.scm#L170 rlb: The real work happens, after the timmestamp checking, in "compile-it". alextee[m]: interesting, i'll dig around a bit more, thanks! rlb: certainly apteryx: daviid: hi! by the way, what was the reason you didn't like this patch? https://mail.gnu.org/archive/html/guile-devel/2021-03/msg00009.html apteryx: that change was catering to Guix, which is more demanding in terms of Guile path installation customization: it uses a versioned site dir (e.g.: share/guile/site/3.0) that is non-standard apteryx: interesting this gets it right without any configuration, even on Guix: https://github.com/aconchillo/guile-redis/blob/master/configure.ac apteryx: it relies on pkg-config apteryx: with guile-lib, I don't currently have a mean to configure it for Guix without resorting to hacking the build system files; out of the box it installs the souces to the non-versioned $datadir/guile-lib; when using --with-guile-site=yes it tries to install to Guile's own location, which fails on Guix as packages are individually prefixed and not writable apteryx: anyway, I'm happy with the release, but I thought I'd try to explain the rationale behind the patch 6 linked above apteryx: thank you! daviid: apteryx: did you read the commit message and comment about the changes introduced in 0.2.6? apteryx: Yes I've done so before writing the above; perhaps I've missed an important bit? apteryx: it's late here... daviid: apteryx: hum, the reason, I was hoping, for the changes i introduced in 0.2.6, based on a few valid users claims, fix the situation, which your patch would bring us back to, which for me, is a severe gregression daviid: apteryx: *regression apteryx: the patch didn't change the default behavior of the configure script but provided more knobs to tweak, or at least that was the idea daviid: apteryx: the problem is, in the absence of any configure option, that the package isntalls itself following the gnu coding standard, that is outside guile's tree and in $prefix blabla, all this is weel explained in the commit, the release and in the daviid: INSTALL file apteryx: I agree that the default when not specifying any configure flag should following the GNU standards, but unless I'm missing something the patch was not touching that default *: apteryx checks daviid: apteryx: there is no need to patch guile-lib wrt to all this daviid: it is perfect as it is - the only discussion we may have is about the versioninng or none versioning location when the option is given, i think any guile scheme code that is agnostic must be installed in the guile's global site dir, hence what i did apteryx: OK; I see flexibility as a win, but perhaps the added complexity was not worth it if Guix is the only user, this I can understand. apteryx: We'll have to keep a simple patch in Guix, that's all. apteryx: thanks for the discussion daviid: apteryx: let's agree to disagree, and hack on more important things, but thanks for the patch - on the form though i thought it wuld have been nice if you did talk to me or us here, it would also have saved a of your pressious time ... apteryx: sure, I can check here before writing something new in the future, to gage the interest/pertinence of it. apteryx: bed time here :-) apteryx: o/ daviid: apteryx: tx, talk to you later... daviid: good night manumanumanu: sneek: later tell davexunit I have been working on a wrapper around srfi-64 that implements a large chunk of (chibi test)... sneek: Got it. apteryx: daviid: I've made one last check with a fresh mind, to make ensure what I said yesterday is accurate, and it seems to be: the default install directory is unchanged with patch 6: https://paste.debian.net/1190139/; so even withouth the new switches, at least you may want to drop the m4/guile-ext.m4 file, which appears redundant with guile.m4. mwette: apteryx: I have some examples of running multiple lang's in guile. git://git.savannah.nongnu.org/nyacc.git or https://download.savannah.gnu.org/releases/nyacc/ mwette: apteryx: unpack, cd examples; source env.sh; then start guile; ,L nx-javascript or ,L nx-mlang or ,L nx-tcl ; mwette: apteryx: I also have an old patch to support loading files in different languages: https://github.com/mwette/guile-contrib/patch-2.2.4/load.patch yoctocell: Hi, has anyone had exprience with guile-wm? I looks like a cool project but doesn't seem to be maintained anymore :( mwette: yoctocell: yea looks cool, but also requires xcb, which looks cool too mwette: and guile-xcb has xcb/xml/sample/tiny-wm.scm which is a sample WM yoctocell: mwette: Nice, are you running it? mwette: no, just took a look inspired by you mentioning it yoctocell: ah, ok stis: ' stis: Hi guilers! stis: Hi prologurs! spk121: hello janneke spk121: janneke: I'm about to pull these patches, and I wonder if the mingw patch might be simpler if scm_t_inum -> intptr_t spk121: although I guess a lot of these functions are SCM_API, so that would be a theoretical, (but not real) API break spk121: I take that back. You didn't change any SCM_API functions, so that makes it simpler daviid: apteryx: i won't remove guile-ext.m4, which holds aditional defs that are not in guile.m4 ... gurjeet: Any guile + Nix[OS] experts, can you please take a look at this issue I'm experiencing. https://github.com/NixOS/nixpkgs/issues/117042 gurjeet: ^^ I'm essentially trying to build GnuTLS _with_ Guile bindings, but the build command fails. spk121: gurjeet: this is a known problem with 3.0.5, and there is a patch for it in the soon-to-be-released 3.0.6 mwette: gurjeet: I had issues w/ gnutls --enable-guile on macos. I ended up needing to first build/install w/o --enable-guile then redo w/ --enable-guile. I think when libgnutls.so is in the build dir the guile module does not see it. gurjeet: spk121, the latest in nixpkgs is 2.2, I believe. Even if it is some other version, I am explicitly asking for 2.2 to be used in my patch to Nixpkgs. spk121: gurjeet: oh, sorry. I've got no idea then mwette: IIRC gurjeet: mwette, thanks for the hint. Given that nix-env command tries to build in a clean environment, so I don't know how to make the second invocation of nix-env command to use the output of the first invocation. apteryx: mwette: thank you for the multiple lang examples! apteryx: daviid: OK! mwette: gurjeet: Can you maybe update appropriate env vars (e.g., LD_LIBRARY_PATH) to point to where the file is built prior to install? mwette: apteryx: yw gurjeet: spk121, sorry I misunderstood your message. I'm trying to use _Guile_ version 2.2. The GnuTLS version being built is 3.6.15. gurjeet: Did you mean to say 3.0.5 has a known issue. Did you mean to say 3.5? Which latest version of GnuTLS is known to produce Guile bindings? I'll try to use that specific version of GnuTLS. apteryx: daviid: guile-ext.m4 provides these two macros: GUILE_GLOBAL_SITE_DIR and GUILE_SITE_CCACHE_DIR; the first one can be replaced by GUILE_SITE_DIR from guile.m4, and the second one by GUILE_SITE_CCACHE from guile.m4. Seems we're covered? apteryx: the only difference is in how they are implemented; guile-ext.m4 queries guile itself, while guile.m4 uses pkg-config lispmacs: hi, I was looking for an easy way to plot 3d plots of complex functions of time lispmacs: I was wondering if anybody had any ideas with guile or some other tool lispmacs: I was checking with the maxima guys in another channel lispmacs: like f(t) = e^(st) where s is a complex number rlb: lispmacs: no idea specifically, but of course there's gnuplot, matplotlib, and the whole python/jupiter notebook world. rlb: ...wrt to "jupiter" that might be https://jupyter.org though I think it may have become somewhat of a more generic term. lispmacs: lispmacs: lispmacs: durned kids lispmacs: kl dfs wingo: :) *: wingo grumbles that gitlab seems to prohibit icecat users civodul: wingo: oh yeah, i noticed that too heloaoba1: is there an equivalent in scheme/guile to python's os.path.join for safely joining path components? wingo: apparently installing a user-agent-switching extension and pretending to be firefox 82 or 83 rather than 78 is enough to get by civodul: good to know! janneke: spk121: if intptr_t makes it simpler, then by all means wingo: janneke: do you mind if i review your patch on gitlab? janneke: wingo: i'm not sure how that works, i think i would prefer emacs/email; i'm a bit clumsy with webby clicky things; but please do what works for you! janneke: wingo: also, please feel free to "just change things" as you like, if that makes it easier for us janneke: i'm primarily happy that i found a way that works wingo: ok. well i guess a first-order feedback would be that when converting SCM inums to C integers, intptr_t is the good type i think wingo: civodul: does that sound ok with you? janneke: sure, i doubted between long long and intptr_t janneke: it seems sometimes "long" means: an int where a void* (or int*) fits, and on other times it seems to mean: the largest integer type (something like: long long) wingo: yeah what a mess janneke: on the one hand, the extra types do not help, on the other hand i liked having a signed and unsigned pair wingo: there is uintptr_t fwiw janneke: (unsigned long long) => scm_t_unum, (long long) => scm_t_inum janneke: okay...yeah janneke: so yuck in a way to scm_t_inum,/unum; nice in an other way... yes, a mess wingo: :) wingo: fwiw i think unum is probably not a good name because of https://en.wikipedia.org/wiki/Unum_(number_format) janneke: and then we also have scm_t_bits and scm_t_signed_bits! wingo: :) janneke: ah...hmm wingo: i guess i am generally hoping that stdint.h types can satisfy our needs. it's hard enough doing C integers without introducing new types whose definition isn't obvious janneke: yes, i agree janneke: so, we go for scm_t_inum => intptr_t, and scm_t_unum => uintptr_t civodul: wingo: fixnums to intptr_t sounds good to me wingo: janneke: sounds like a plan! janneke: great, i'll do that first and see how that goes! janneke: i'm kind of happy that we don't have to introduce new types, feels a lot better if that works janneke: thanks! *: janneke wonders whether that will also work for mini-gmp, intptr_t and uintptr_t; guess i'll try to do it there too pkill9: dustyweb: do you have an example of how to organise pages into categories and/or tags in haunt? daviid: apteryx: there is no need to change anything there, and certainly not removing guile-ext.m4, i told you yesterday, please move on to something else, tx janneke: wingo, spk121: updated patch, sent v2 to guile-devel spk121: janneke: of the patches, the only one I don't think could be pushed is "Fix 'absolute-file-name?' and others for cross-build" There some sort of order dependency. If I modify boot-9 after and rebuild, it fails. The rest could go, after pulling out _mingw_debug_p. I'm so glad you took the time to work on this sad errand. spk121: You're amazing spk121: Building on MinGW is slow, so testing the patches took forever... janneke: spk121: yes, i just found that "Fix 'absolute-file-name?' " is broken, at least partially janneke: i'm pretty sure it worked it the mingw cross build, but i could have fooled myself there... janneke: maybe it only breaks while BOOTSTRAP'ping? janneke: before, i had this "HACK boot-9.scm: hard-code absolute-file-name? ..."; i was so glad i thought i fixed it properly...oh well :) spk121: janneke: it would not surprise me if it were different in bootstrap janneke: yeah, i only tested it out-of-band, in a foo.scm file spk121: But let's get the rest of patches is master. I'll try it all again after dinner. janneke: lovely, thanks janneke: enjoy your dinner, ... *: janneke -> zZzzz stis: sneek later tell manumanumanu: https://gitlab.com/guile-scsh/guile-scsh sneek: Okay. stis: \me is working on guile python again, trying to find bugs and follow spec as close as possible stis: wondreing if I shall use type hints to improve speed as well apteryx: is this a valid let*? https://git.savannah.gnu.org/cgit/guix.git/tree/guix/import/utils.scm#n454 apteryx: seems to me like it should have been a let*-values or something daviid: apteryx: the module uses srfi-71 ... manumanumanu: ahoy sneek: Welcome back manumanumanu, you have 1 message! sneek: manumanumanu, stis says: https://gitlab.com/guile-scsh/guile-scsh manumanumanu: ooh manumanumanu: apteryx: you should have a look at srfi-71. It is really neat. manumanumanu: nd it is included by default janneke: spk121: ah good, this year's potluck is looking very nice *: janneke is testing 2.2 compatibility... janneke: hmm...no code for module (ice-9 copy-tree) janneke: guess i'll have to patch it out for 2.2 wingo: there is copy-tree in 2.2 in default env wingo: iirc wingo: 3.0 as well fwiw janneke: yeah, upgrading to 3.0 gives a warning; so i blinly added a use-module janneke: this 3.0 upgrade has been pretty smooth, considering how much has changed janneke: and a factor 2 better performance for time-consuming scenarios, "for free", just terrific wingo: yassss spk121: wingo: did you check out janneke's mingw patch replacing all longs with scm_t_inum? should it be pushed? apteryx: daviid: ah, I see, thank you! apteryx: manumanumanu, civodul: I've now read srfi-71. It's great! Thanks for the pointers. talin: hello. i am trying to figure out what are the main practical differences between guile and racket talin: whether either of them have any particular limitations and such davexunit: I'm not a racket user, but what I've observed is that racket has a bigger userbase, more libraries, and their own IDE. talin: thank you davexunit davexunit: that said I still like Guile more, personally. davexunit: it has more of a minimalist vibe and we have the Guix project which is amazing. dsmith-work: Happy Friday, Guilers!! davexunit: both seem to have friendly communities. civodul: wingo: i've just pushed two minor improvements to (web client), taken from Guix wingo: civodul: great. now do NEWS :) wingo: no good deed goes unpunished, etc ;) civodul: wingo: heh :-) it's not even NEWS-worthy though, it's not "user-visible" wingo: fair enough :) civodul: pffeww ;-) davexunit: does anyone know how to reliably integrate srfi-64 tests with automake? I'm updating an old project written during the guile 2.0 days and what used to work no longer does. the tests themselves are fine, it's the exiting with a proper status code to tell automake if the tests passed/failed that is unreliable. wingo: spk121: haven't looked at it yet, but i would like to :) civodul: davexunit: you can take the "test driver" from build-aux/ in Guix wingo: davexunit: did you see that somethign changed in 3.0.5 ? civodul: apteryx tweaked it recently and it's become pretty flexible davexunit: I can get 'make check' and 'make distcheck' to pass locally, but then I tried building in guix and 'make check' fails because of an exception that is unrelated to the tests themselves. like srfi-64 is behaving differently for some reason. wingo: there was a fix to make the test runner comply with the spec which sadly broke lots of users wingo: davexunit: do a git log and grep for srfi-64, you'll find it davexunit: wingo: was it commit de5d1a7f99b8e952b115237ebc29633062f99bb9 davexunit: I was looking at it yesterdsay davexunit: "Fix bug #42713: srfi-64: Reset test-runner-current if done" apteryx: daviid: congrats for the guile-lib release! davexunit: I used to rely on calling (test-runner-current) after (test-end "foo") to get the results, but now that returns #f. then I discovered that test-end returns the test runner, so I wrote a test-end* that calls test-end and then exits with status code 0 if the tests passed. that works locally. davexunit: but when guix runs make check, test-end returns unspecified and all the tests fail as a result. davexunit: civodul: I looked at that test runner but it was quite complex civodul: davexunit: true, but consider it a black box ;-) *: civodul isn't used to giving that type of advice davexunit: I didn't really understand everything it was doing so I didn't want to add more confusion on top of my existing confusion. davexunit: I'm having trouble finding the right way to check test runner results once all tests have been completed. davexunit: every way I try breaks in a different context for mysterious (to me) reasons davexunit: here I was thinking I was making a quick update to an old project ;) apteryx: davexunit: I've already swaped out lots of details, but if you need to inspect test results post test run, perhaps you could look into the .trs files? apteryx: that's what Automake post-processes davexunit: apteryx: that seems like the wrong layer. I want to inspect the srfi-64 test runner within guile so I can return 0 upon success or 1 on failure. apteryx: Then you have to do so before calling test-end, persist that value, and return it post test-end apteryx: I had to do something like this for some guile library, I forgot which one, let me try to find it out apteryx: ah, perhaps guile-ssh apteryx: this: https://github.com/artyom-poptsov/guile-ssh/pull/27 tohoyn: talin: IMHO GOOPS is better than Racket's object system davexunit: apteryx: so that's what I thought I had to do, but it doesn't work in all contexts as far as I can tell davexunit: but if it's working for guile-ssh then maybe something else is wrong davexunit: apteryx: a-ha! I found the issue. thank you for showing me that this strategy works. apteryx: great! davexunit: it was an issue in something completely unrelated that wasn't obvious in the error messages I was seeing davexunit: I forgot to include my test wrapper script in the release tarball -_- apteryx: hehe talin: tohoyn: i see. thank you apteryx: does wrapping a multi values returing procedure with lambda* transparently passes on these values? Seems not. davexunit: nope. tohoyn: why is it so that a lambda in tree-il has to consist of lambda-case definitions? davexunit: lambda* is for optional args and keyword args, it doesn't do anything special with multiple return values. call-with-values and let-values are your friends for this. tohoyn: would it be more efficient if lambda consisted only of a single procedure body? apteryx: davexunit: thank you davexunit: apteryx: feel free to share example code and I can take a look if you're still stuck wingo: tohoyn: in terms of compuied code? doesn't matter a whole lot with guile's current compilation strategy. a procedure needs to check its arg count, and if the count is unexpected, jumping to the next case is just as cheap as throwing an error tohoyn: wingo: ok wingo: but it would be nice if we could skip arg count checks in many cases. unless a function is contified, we don't do that right now tohoyn: wingo: yes, I meant the efficiency of compiled code apteryx: davexunit: I believe this will do, but it's a bit verbose for just wanting to specialize a multi-valued procedure: https://paste.debian.net/1190010/ davexunit: let-values may read a bit nicer than receive lloda: with srfi-71 it almost always reads cleaner than either let-values or receive lloda: only with a rest arg (let (((values a . b) f) ...)) looks worse lloda: also apologies for the srfi-64 breakage :-/ lloda: what i do myself is (define error-count (test-runner-fail-count (test-runner-current))) lloda: before (test-end) lloda: then return error-count lloda: crude i suppose but it works davexunit: that's essentially what I'm doing davexunit: srfi-64 to me feels like low-level infrastructure that needs a friendly wrapper davexunit: I wish it was Schemier. like a set of combinators that can be composed to form a test suite that you then pass to a test runner. davexunit: and the return value is the results lloda: yeah agreed apteryx: is there no non-capturing group support in libc (Guile)'s implementation of regexp? such as (?:something|something-else) dsmith-work: apteryx: Guile's regex is the C libs regex dsmith-work: apteryx: So, No. apteryx: thank you dsmith-work: apteryx: I think irregex does: http://synthcode.com/scheme/irregex#SECTION_3.3 rlb: davexunit: sounds like you may have gotten it sorted? Here's what I did fwiw: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/scm/test.scm#L9-15 And then just used that at the end of each file instead of test-end: https://git.sr.ht/~rlb/lokke/tree/main/item/test/lokke-scm-atom#L90 davexunit: rlb: that's essentially what I did. I've now seen at least 3 different versions of this same concept. :) davexunit: as if I needed another project (can't even maintain the ones I already have properly), I want to make a testing library that is actually good. jlicht: davexunit: you are an amazing maintainer! We just need there to be 6 of you :) apteryx: dsmith-work: thanks about irregex, didn't know about it davexunit: jlicht: heh, thanks. :) davexunit: I've been pretty burnt out for the last couple of years jlicht: sorry to hear that mwette: lispmacs: tree-fold, as in (sxml fold) and https://wingolog.org/pub/fold-and-xml-transformation.pdf wingo: rlb: looking at it again -- what happens now if you write a wide char into a narrow SH_STRING ? wingo: am wondering how all views onto that stringbuf would get updated janneke: hmm, my guile-websocket make check fails with 3.0.5 wingo: rlb: evidently it works tho :) wingo: ah no, i am mistaken. seems (substring/shared s 0) just returns s, as an "optimization" i guess? wtf janneke: how do i run one srfi-64 test? janneke: hmm, or even find out which one fails? *: wingo does not know *: janneke goes to bisect janneke: the backtrace is probably better if the test were compiled janneke: hmm, it seems that this doesn't work anymore in 3.0.5 janneke: (exit (= (test-runner-fail-count (warn "current"(test-runner-current))) 0)) janneke: hmm...it was a feature janneke: Fix bug #42713: srfi-64: Reset test-runner-current if done civodul: i disovered Gitile by roptat -> https://git.lepiller.eu/ civodul: the ultimate thing for those who want all-Guile services :-) *: janneke resets wip-mingw again with nicer fix for cross-compile bug wingo: janneke: yeah that one should have had more NEWS noise wingo: civodul: nice!! janneke: wingo: np, it was easy to fix -- i still need to become friends with srfi-64 ;-) wingo: rlb: ah yeah, SH_STRINGs already point to another string. ok, no problem wingo: rlb: so relative to current status -- stringbufs would have the byte indices. strings themselves stay the same i think relative to current status -- SH_STRING or normal string. is that right? wingo: and stringbufs would hold total byte count and have an index appended (one byte per each N codepoints or so indicating how many bytes that segment takes) wingo: where N is i guess floor(256/6) or so. could make the index be a uint16_t, maybe; dunno if dividing by 42 can be optimized to a multiplication :P wingo: could have a multi-level index for big big strings. but that would be an optimization that could come later rekado_: oh, gitile is written in Guile, I didn’t realize when I first heard of it. *: rekado_ goes to replace the default perl thing on git.elephly.net janneke: ugh, 8sync has the same srfi-64 problem rekado_: janneke: I had to remove that line in at least one package when building with Guile 3.0.5 (guile-commonmark, it’s already fixed in the upstream repo) janneke: rekado_: yeah, i'm moving (test-exit) inside/before (test-end) for 8sync manumanumanu: ahoy hoy! ArneBab: wingo: from Lilypond there’s te question whether it would be viable to make the reader-rewrite reason to move to 3.2 — what do you think? wingo: there's always a tradeoff for changes within a stable branch vs starting a dev branch. what is the argument? wingo: if we start a dev branch, then i do no more work on 3.0 wingo: i can't do both wingo: as there is no incompatibility, afaiu, i see the balance as favoring continuing to work in 3.0 as long as possible ArneBab: Just found: https://idiomdrottning.org/fancy-defines — I didn’t know about (define ((add a) b) (+ a b)) (map (add 3) '(1 3 6)) ArneBab: wingo: the argument is worries about stabilitiy, my answer was that as long as there’s full compatibility, we need no new minor release. Only if there should be a reason to favor 3.0.6 over 3.0.7. manumanumanu: ArneBab: there was a SRFI released about that recently, iirc. manumanumanu: 219 manumanumanu: the srfi source is amazing. A three-clause syntax-rules macro. *: janneke found a GOOPs problem trying to upgrade 8sync to guile-3.0 jlicht: Does anyone know of a guile/scheme library similar to clojure's garden? I would describe it inaccurately as sxml-for-css davexunit: jlicht: I don't think so. I've looked for something like that before and even thought about building it myself but never did. janneke: davexunit: i have some patches for guile-websocket over at https://gitlab.com/janneke/guile-websocket, just updated for guile-3 davexunit: it's an interesting topic. I've been working on a set of exercises from a book about creating a combinator language and compiler for regular expressions. writing something for CSS would be like a much bigger version of this. :) davexunit: janneke: neat. thanks. davexunit: I haven't looked at this library in a long time. davexunit: janneke: pushed all your patches to my repo. thanks again! dsmith-work: UGT Greetings, Guilers janneke: davexunit: oh great, thanks :-) roptat: rekado_, :) davexunit: janneke: what do you use this for? I wrote this library for fun many years ago but never did a proper release or anything. davexunit: I didn't expect people to actually use it ;) roptat: rekado_, if you really want to use it, I have a service definition: https://git.lepiller.eu/system-configuration/tree/-/modules/services/gitile.scm davexunit: perusing the code again and I'm quite pleased with myself. pretty clean with good references to the spec! lol janneke: davexunit: i'm playing/test with 8sync atm jlicht: davexunit: tbf, I would mostly want to manipulate s-expressions instead of mucking around with SASS/LESS, so a 'proper' library might even be overkill. Which book do you happen to be reading? davexunit: jlicht: software design for flexibility. new book from one of the SICP co-authors. civodul: jlicht: there's https://nongnu.org/scss/ (i haven't tried) davexunit: ooooh civodul: roptat: could you contribute that service definition to Guix? :-) ArneBab: wingo: some time ago you made it posssible to do definitions after expressions in functions. Could that also be done inside non-function defines? ⇒ (define (foo x) (display x)(define 'bar) bar) works. Can we get (define foo (newline)(define 'bar) bar)? Would that then be compile-time execution? davexunit: civodul: looks pretty basic, which is still more than I knew was available. jlicht: civodul: the documentation is a bit terse, but it might do the trick! Thanks :-) davexunit: sass/less are their own languages that add some significant improvements for the humans writing stylesheets. davexunit: a good s-expression -> css translator should cover up the warts of css and allow for easier abstraction roptat: civodul, at some point :) janneke: davexunit: in 8sync, we wrote some more frame fragment handling code, sending/receiving fragmented frames davexunit: janneke: if anyone wants to incorporate that into the websockets library directly, I would gladly accept such a patch :) janneke: davexunit: right! roptat: OrangeShark, ping :) I have a MR for guile-git (sorry for the noise if you received a notification for each change I made, I think it's stable now ^^') davexunit: websockets are fun. wish I had a use-case to use them more. I can't even remember why I wrote the library in the first place... davexunit: hmm... I think they were rather new at the time and I was using them for a project at work. janneke: yes, it's fun to play with guile and a browser using websockets davexunit: then somehow I looked at the spec, which was well written, and realized it wasn't all that complex. pkill9: cool civodul pkill9: that would be good with huant pkill9: haunt* pkill9: my blog has an scss file pkill9: I'm not sure how to have haunt call an external file on rebuild so I can generate the css file each time pkill9: but a native solution would be even better roptat: pkill9, I think you just need a builder for that css file roptat: which for haunt is a function that takes some arguments (I don't remember which exactly, but I think it's documented, or at least not too difficult to find out from existing builders) davexunit: I don't remember either, but if it's not documented I'd sure accept a patch to document it ;) davexunit: another one of my projects I haven't give much attention to in a long time davexunit: I have patches sent to me going back to 2019 :| oopsies davexunit: I will put out a haunt release... eventually pkill9: the builders return something produced by make-page, I'm wondering how it decides where to place these pages *: civodul cheers davexunit davexunit: pkill9: pages have a file-name field that says where they go davexunit: so they're pretty low level. pkill9: so i assume that the builders use a record davexunit: builders are just procedures, actually davexunit: they take 2 arguments: a object (the thing that has all the site-wide config), and a list of posts pkill9: ah ok, so builders arne't what I would need for this pkill9: seems builders are tied to pages pkill9: there's a procedure for static files davexunit: builders aren't tied to pages davexunit: builders return pages or assets pkill9: but if they take a list of posts, then how can you use them for non-post objects? pkill9: ok davexunit: pages and/or assets, I should say. davexunit: those are the 2 primitive, low-level data types davexunit: an asset is just a file on disk that will be copied verbatim davexunit: a page is something that is programatically generated and serialized to a file on disk pkill9: ahh there is a make-asset procedure pkill9: which you can use to specify source and destination davexunit: yup, that's all there is to that. davexunit: use it for images and stuff pkill9: so i could make a procedure that calls sass or whatever and outputs to /tmp, then calls make-asset using that /tmp/css file davexunit: I wouldn't recommend that. davexunit: assets are for files that need no processing davexunit: it's a bit hacky, but pages would be more appropriate for this. pkill9: but the CSS file is an asset, not apage davexunit: but the css file isn't being copied verbatim, right? pkill9: it will be, after I call scss to the scss file pkill9: which will generate a css file, which then gets copied verbatim davexunit: I wouldn't consider that an asset davexunit: because it's a derivative of another file pkill9: hmm ok pkill9: I suppose it makes more sense of rnow just to generate it outside of haunt pkill9: for now* davexunit: haunt should be the thing taking care of processing something and writing it to the proper destination davexunit: I generate all of my site's code with scheme, not external tools, so there isn't a ready-to-use solution here. davexunit: but the concept of a page fits the bill, if in a sort of hacky way. davexunit: the "contents" of a page could be simply the name of the .scss file. pkill9: but why would it generate a css file? pkill9: if it's a page davexunit: and the "writer" procedure could arrange for opening a pipe to sass via (ice-9 popen) and redirecting the output stream to the output port that the writer procedure receives. pkill9: oh i see i think davexunit: the "page" metaphor kind of falls apart here, which is why I'm saying it's hacky. davexunit: but essentially all a page is doing is taking some scheme data and applying a procedure to it, with the expectation that the procedure will use the output port it has been given to populate the destination file. jlicht: so page means computed-asset, in most cases? davexunit: in haunt an asset means a file copied verbatim, so I would say no. davexunit: a page is a programatically generated file wingo: ArneBab: cost of a minor release is very low fwiw. if there is a bug in 3.0.6, we'll just make a 3.0.7, no prob davexunit: it represents a single file that has an arbitrary program generate its contents davexunit: perhaps a future version of haunt could change the name "page" to something more generic, and have all the plumbing for applying an external program and writing the output to the destination file. jlicht: haunt-contrib ftw, I guess :-) davexunit: I'm just making this shit up as I go ;) pkill9: maybe split the the raw-file concept of the 'page' into it's own thing, and rebuild the 'page' to use that pkill9: idk pkill9: also, that SCSS module is confusing, because it means "Scheme CSS", it's not a reference to the extended css type "scss" pkill9: this https://sass-lang.com/documentation/syntax pkill9: that said, all the functionality of sass is provided by scheme jlicht: It predates scss pkill9: it's just amore programmatic form of CSS pkill9: ok pkill9: you could have an importer of scss (SASS) into scss (Scheme CSS) davexunit: pkill9: here's an untested example of what I mean: https://gist.github.com/davexunit/a4d8011b09e0b9c7afc95bc17f14abbb davexunit: if sass can't dump the generated css to stdout, then yeah you could use a temp file, but the important thing would be that you had some abstraction that makes all these gross details transparent davexunit: I guess transparent isn't the right word, but you get what I mean ;) davexunit: and would probably make more sense as generalized low-level data types. *: davexunit is getting lots of ideas :) pkill9: it can dump to stdout pkill9: i think actually it only dumps to stdout pkill9: you have to redirect it to a file i think davexunit: ah okay davexunit: well then the code I provided should be kind of what you'd want manumanumanu: Is there anything other than the process redirection language that people miss from SCSH? manumanumanu: There is a pretty complete implementation of that for chicken that could be ported to guile with ... moderate effort davexunit: I've never used it so dunno manumanumanu: the egg in question: http://wiki.call-cc.org/eggref/5/scsh-process manumanumanu: the repo is here: https://code.more-magic.net/scsh-process rlb: wingo: yeah, that's right, though at least at the moment the index "width" is set up to be dynamic, based on the length of the string, i.e. < 256 has a byte width index, < 2^16 has a uint16_t index, < 2^32 has a uint32_t index, etc. And the "stride" is also dynamic, i.e. we'd currently skip 16 chars between offsets for < 256, 32 chars for < 2^16, 64 for 2^32, etc. rlb: That allows us to maintain roughly the same index overhead for all strings if we like. wingo: coo coo civodul: manumanumanu: never used scsh either but Gash provides a bunch of niceties in this area: https://savannah.nongnu.org/projects/gash/ davexunit: this scsh-process thing is making me wonder: I have chickens, but I don't use chicken scheme nor do the chickens. davexunit: something doesn't add up! pkill9: davexunit: thanks, that works, how do i output that to the assets subdirectory? pkill9: nevermind, i have an example davexunit: pkill9: just in case it helps: the first arg is the output file name *: pkill9 wants to make a service similar in goals to wordpress but using haunt pkill9: not really sure who would use it though, just would like that to exist davexunit: are there any static-websites-as-a-service services out there? I've never looked pkill9: there is write.as, not sure of any others davexunit: the reason I don't use wordpress or similar is because it's a dynamic web application full of issues pkill9: I don't know of any others, that one, and possibly another i heard of, is focused around just content though pkill9: yea, heard about it's problems pkill9: what I want is something that lets you theme and edit your blog, but produces a static site davexunit: static site generators tend to have the drawback that they are for a more technical audience, and haunt is no different. davexunit: a friendly UI for one would be cool pkill9: yea, I'm not really even sure I'd use it when I can just generate the site and host it myself, I just think it would be cool to have pkill9: and I'd make it easy to download/upload the markdown files pkill9: wordpress requires a plugin just to export as markdown davexunit: a service that separates the task of editing and publishing (dynamic) with the finished product (static) would be good. surely there's something like that already out there. pkill9: yea pkill9: oh yea this looks like it does that https://getpublii.com/ davexunit: nice pkill9: oh it's a desktop application pkill9: here's one i think online https://www.siteleaf.com/ davexunit: good. now I can happily stay in my niche of "scheme programmers with blogs" knowing that there's more user friendly tools for other people. *: janneke stumbles upon another guile-3.0 thingy dsmith-work: sneek: botsnack sneek: :) dsmith-work: goodbot apteryx: daviid: by the way, if you need a hand with anything for the next guile-lib release, let me know! manumanumanu: civodul: Well, I just think this kind of process handling should be available more easily in guile. Whether it is using EPF from SCSH or something else. It is something that is hard to get right, and that many people want - especially when writing quick scripts. manumanumanu: EPF might not be the best idea (I reluctantly admit, since I have used it quite a bit), but something that allows for the power of scsh redirections and process notation would be amazing. I will have a look at gash and see if I can maybe use it as a starting point. civodul: manumanumanu: i agree; Rutger contributed 'pipeline' in (ice-9 popen) some time ago civodul: i think we could have more of those manumanumanu: I saw that and was very happy! manumanumanu: I will give porting SCSH-process a try... I will have to make some small changes to the syntax, since it will collide with some other syntax (r6rs | I believe), but most things should be possible to keep intact. *: davexunit figured out how to redirect external program output into an output port davexunit: specifically, an output port connected to a file davexunit: primitive-fork, then in the child process (close 1) (dup2 (fileno port) 1) (execlp "the-program") manumanumanu: had you asked your chickens they would have told you to install the scsh-process egg :) manumanumanu: These things are just horrible to debug though. If it doesn't work, at best it just hangs and produces no output. manumanumanu: giving you no help whatsoever manumanumanu: I remember trying to imlement the pipeline just added to (ice-9 popen) in pure scheme about 8 years ago. I had to give up. rekado_: sometimes I want to generate inline JavaScript in SXML, but the entity encoding gets in the way. Is there a way to inject text without having the (web server) machinery change it? wingo: yeah somehow. you want cdata i think wingo: hmm wingo: rekado_: this is what i use https://github.com/wingo/tekuti/blob/master/tekuti/page-helpers.scm#L153 wingo: NB, produces html, not xml wingo: i looked at the living html spec when i wrote that, fwiw rekado_: thank you! apteryx: seems I'm misunderstanding call-with-values: (define p (lambda (x y) (format #f "~a, ~a" x y))) (call-with-values (values (cons (list 'a "v1.0.2") '()) '()) p) -> Wrong type to apply: ((a "v1.0.2")). Ideas? apteryx: ah, the first arg is supposed to be a procedure, not the application of the procedure (or its result) apteryx: this works: (call-with-values (lambda _ (values (cons (list 'a "v1.0.2") '()) '())) $17) RhodiumToad: right. call-with-values is a bit low-level, the other mechanisms for it are usually preferable apteryx: right; the name mislead me :-) This is indeed clearer in this case: (receive (x y) (values (cons (list 'a "v1.0.2") '()) '()) (p x y)) wingo: define-values is also a good option wingo: (define-values (x y) (values 1 2)) apteryx: neat! civodul: or srfi-71 for 'let' bindings RhodiumToad: does the fact that define-values expands into something that does set! cause any issues? wingo: RhodiumToad: not sure tbh. without heroics from the compiler i can imagine the result is suboptimal wingo: we should have a better implementation i reckon RhodiumToad: hm. maybe I misread how it expands wingo: racket has values-defining forms as primitives afair RhodiumToad: it looks like it does a (define t-blahblah ...) that gets a list of values, then a series of (define a (car t-blahblah)) (set! t-blahblah (cdr t-blahblah)) RhodiumToad: so at least it doesn't do set! on the things it's supposed to be defining, only on the temporary variable wingo: yeah exactly. not pretty tho wingo: the optimizer could optimize out the vector in (define t (call-with-values (lambda () expr) (lambda (a b c) (vector a b c)))) (define a (vector-ref t 0)) (define b (vector-ref t 1)) (define c (vector-ref t 2)) ...) wingo: but that happens late; not available at peval time civodul: if it can optimize it out, that'd be a nice option wingo: pretty sure that optimizes out; i remember checking (match (vector a b) ((a b) (+ a b))) and it folded as expected wingo: er #(a b) for the pattern, rather wingo: yeah that optimizes civodul: really nice wingo: janneke: hey :) what's the mingw64 timeline? wingo: i.e. if patches ready for review by monday i would wait for it before making 3.0.6 wingo: assuming review and landing will take a week wingo: otherwise i would release 3.0.6 sooner and follow up sooner after wingo: heh, unclear wording wingo: anyway i just mean we can make a 3.0.7 within another 4 weeks or so if we want wingo: lloda: regarding autocompiling and no source locations -- is that a change relative to 3.0.5 ? wingo: davexunit: hey where was your goops patch wingo: sorry i keep forgetting things daviid: wingo: here https://lists.gnu.org/archive/html/bug-guile/2021-01/msg00028.html daviid: apteryx: no need, tx alextee[m]: Will the new release finally work with mingw64? \o/ *: alextee[m] is patiently waiting for an msys2 package for libguile janneke: wingo: i posted to guile-devel this afternoon wingo: great tx janneke: i'll be sure to ping you here next time ;) *: janneke had a very busy day doing all kinds of guile-3 package updates janneke: also, i was hoping that spk121 would glance through my other mingw patches/fixes and cherry-pick some of them davexunit: daviid: thanks for sending wingo the link. I was afk daviid: davexunit: np, iwas here and with the link in my browser still ... ArneBab: did you receive my email-forwards from Lilypond to guile-devel? spk121: janneke: this weekend, after I finally get to Potluck, I should have time to work MinGW. In real life, these have been a crazy busy couple of weeks, phew *: spk121 wonders how life can be busy whilst in a quarantine flatwhatson: did anyone make progress rebasing the wip-elisp branch to 2.2.x or beyond? rekado_: flatwhatson: here’s my stalled attempt: https://git.elephly.net/?p=software/guile.git;a=shortlog;h=refs/heads/wip-elisp *: janneke -> zZzz flatwhatson: rekado_: thanks, do you recall any of the challenges around it? rekado_: flatwhatson: when the rebased Guile Emacs uses it there’s a segfault. rekado_: flatwhatson: I’m not sure if it’s because of changes to wip-elisp or Guile Emacs *: rekado_ –> zzzZ davexunit: daviid: the bug has been filed and the patch is included: https://lists.gnu.org/archive/html/bug-guile/2021-01/msg00028.html daviid: davexunit: oh great, sorry for the noise, tx davexunit: np :) davexunit: I don't know if anyone is going to merge it before the release but we'll see daviid: davexunit: yes, we'll see :) ... this 'noise' of mine might serve as a gentle ping after all :) ... davexunit: ;) *: davexunit gets back to working on exercises in "software development for flexibility" davexunit: er, I mean "software design for flexibility" lispmacs: in guile-sdl2, there is keyboard input procedure (key-pressed? key) lispmacs: but I'm having trouble figuring out what is the format of KEY lispmacs: simply passing in the ASCII doesn't work, and I tried passing the name of the SDL constant davexunit: lispmacs: it's a symbol. 'a, 'b, 'c, etc. davexunit: lispmacs: see https://git.dthompson.us/guile-sdl2.git/tree/sdl2/input/keyboard.scm#n36 for the mapping of scheme symbols to sdl2 key constants lispmacs: davexunit: I'm expect (while (not (key-pressed? 'q)) '()) to block until the letter q is pressed, but this doesn't seem to work davexunit: lispmacs: it doesn't block. it simply returns the state of the key at the time of the call. davexunit: if you want to be notified of key presses, you'll want to poll for input events instead. lispmacs: davexunit: right, but just for understanding: if I have a while loop that does nothing until (key-pressed? 'q) returns true, shouldn't my program block until the letter q is pressed? lispmacs: or held down flatwhatson: you would need some theoretical "wait for something to happen" function inside that loop flatwhatson: aka. polling for events davexunit: lispmacs: it will block in the sense that it will loop as fast as possible, doing nothing but burning cpu davexunit: (while (key-released? 'q) #t) would create a loop that would use 100% of a CPU doing nothing until the Q key is pressed lispmacs: davexunit: makes sense, but it doesn't. davexunit: then your code is wrong davexunit: ah, hold on davexunit: I see the confusion. davexunit: so, SDL2 doesn't update input state unless you ask it to lispmacs: ah davexunit: so if you're stuck in a loop nothing will ever change lispmacs: which procedure does that? davexunit: poll-event in (sdl2 events) lispmacs: there we go davexunit: I recommend reading sdl2 tutorials to get a hang of the basics and then translate the C code to scheme. guile-sdl2 tries its best to provide a 1 to 1 mapping from the C API to Scheme procedures. davexunit: poll-event will return #f when there are no more events left to process. you will want to call poll-event in a loop every so often until it returns #f lispmacs: davexunit: i tried that but got bored way too quickly. and I've already got 200 lines of scheme code lispmacs: anyway, thanks davexunit: np davexunit: and now that you're polling for events, you can replace a loop that would burn 100% of a CPU with an event callback :) ArneBab: Can you estimate whether it would be viable to get a guix.scm package-dependency-resolver that usess guildhall under the hood for pure Scheme dependencies when the user has no Guix installed? janneke: spk121: okay, finally got the new mini-mpz approach to work; now to clean-up the patch set janneke: in order to get it to work, /me probably changed too many instances of long => scm_t_inum and such... wingo: janneke: would be happy to review the patch on gitlab btw *: wingo likes the clicky web patch review things janneke: wingo: great, i'll let you know once i cleaned it up a bit wingo: thumbs up *: janneke missed "typedef long SCM_STACKITEM;" all night yesterday, and this morning until just now... janneke: that was probably it wingo: humm, is that a problem? wingo: ah pointers are 64-bit wingo: ok :) wingo: yes that sounds like a problem :) janneke: yeah, i went to eradicate all instances of "long", just to be sure; i hope most of that can be reverted rekado: ArneBab: I’m not sure I understand. Do you want to extend a “guix.scm” file containing a Guix package definition, so that it can be used to install the package when used without Guix? How would that be used? ArneBab: rekado: I’d like to have some dependency mapping, so guildhall can check whether it has packages matching the guix packages. wingo: sounds excruciating, janneke. highfives for doing the work ArneBab: rekado: that would allow me to just provide a guix.scm file with dependencies, and for all plain Scheme dependencies just tell people "if you don’t run guix, just use guildhall [some way …] to install dependencies" ArneBab: that would provide a single point of dependency information janneke: wingo: thanks, ... i'm at least somewhat ambivalent about this work wingo: janneke: why do you say that? you think we are taking the wrong strategy by making 64-bit fixnums on mingw64 ? janneke: wingo: ah no, this is the right approach; it's just, throwing good enegry towards supporting something as stupid as windows, that needs to die ;-) wingo: haha yeah wingo: ~ users ~ wingo: you are doing $deity's work tho :) janneke: yeah thanks---just hoping it may inspire some people leave that all behind wingo: need to get it working on wine eventually for it to not bitrot dsmith-work: Wednesday Greetings, Guilers lloda: when there is an error while autocompiling there is no source info printed out lloda: i have to resort to (compile-file ...) by hand to see that lispmacs: did somebody have a procedure that is the same as `map', but that works on lists with arbitrary nesting? I.e., applies the procedure to the non-list elements? tohoyn: lispmacs: see https://paste.debian.net/1189759/ (the procedure is not my own) dsmith-work: tohoyn: ISTR the ssax stuff having something like that. Not sure.. rlb: wingo: OK, so if we switch stringbufs to be say ~6% index or whatever (i.e. sparse byte offset index followed by the chars), that means that we can swap the entire content by swapping the stringbuf (pointer), and I *think* that also means that we'll still want shared strings as a separate type that points to another string, so we can swap that other string's stringbuf to affect them all. Sound vaguely plausible offhand? rlb: (I've gotten some of that roughed in and then got around to the shared string bits.) daviid: davexunit: great, is this part of chickadee? apteryx: wingo: hey, I had somehow missed your message about now having the OK to push patches to guile-lib at my leisure ;-). Sounds good! I'll take the opportunity to merge the recent changes I proposed. Thank you. daviid: apteryx: please don't, i am worji daviid: i am working on those, in devel, and almost ready to release daviid: but have a problem with the web pages ... daviid: I would also ask you (or any one else) to send parches to guile-devel for review first - tx apteryx: daviid: OK, no worries flatwhatson: is there an easy way to run a unit test under gdb? apteryx: also OK to send any new patches I make for guile-lib to guile-devel for review first apteryx: thank you for working on a new release! daviid: apteryx: ok great, tx - I think it is important to give us (all) a 'window' for review(s), but we could agree on somehting like if no answers in say, 2 weeks (just like in/for guix iiuc), then ok to push ... daviid: apteryx: fwiw, and as an example, i disagre with your patch-6 :), but didn't have time to write about this yet, because i first wanted to work on a release including all other patches, especially the long awaited htmlprag fixes ... daviid: it seems savannah gnu/nongnu git servers are unaccessible at this time apteryx: I'm having the same problem daviid: ok, tx for the confirmation apteryx: I'll let you work through it and comment on any email feedback you may have; just make sure I'm CC'd on your replies so that I don't miss them. daviid: apteryx: I am the release prep final steps, as soon as this is done ... wingo: moin janneke: o/ civodul: hi there! janneke: so, i got 64bit mingw running yesterday on guile master :-) janneke: not sure yet how correct it is, or even if it's what we want, how we want it spk121: janneke: that's awesome janneke: spk121: thanks :) spk121: janneke: is it still that wip-mingw branch? janneke: spk121: yes, i reset https://gitlab.com/janneke/guile/-/tree/wip-mingw janneke: and rebased on your jit (wow!) -- didn't test that here just yet spk121: janneke: since the "Support for x86_64-w64-mingw32" patch is a bit serious, I guess the next step would to get wingo or civodul to ponder https://gitlab.com/janneke/guile/-/commit/b54432212aa8f8e957c670bb6df6fe7266842dd0 janneke: yes sure, i merely said "it works"... wingo: why wouldn't we want uintptr_t fixnums ? janneke: also, i haven't attempted running the test suite yet janneke: hmm, i must have had a wine hack/setup for wip-mingw-guile-2.2, thanks for listening spk121: wingo: because GMP works on long? wingo: does gmp work on long even on mingw64 ?? wingo: dunno why they wouldn't define a word-sized digit type janneke: i think the comment in numbers.h hints to that and it seems to be the case wingo: but in guile #define SCM_T_SIGNED_BITS_MIN INTPTR_MIN wingo: and #define SCM_T_SIGNED_BITS_MAX INTPTR_MAX janneke: yes, that makes more sense wingo: how about typedef intptr_t scm_t_inum on mingw64 wingo: ah mpz. hummm wingo: sorry, this is the denial,anger,acceptance thing wingo: mingw64 grief is a process :P janneke: yeah, tell me! janneke: why don't you just run wsl, if you must have an insecure backdoored, proprietary platform? wingo: janneke: ok here's a bonkers idea, what about on mingw64 we require minigmp and define MINI_GMP_LIMB_TYPE spk121: wingo: I was actually just about to go there, too janneke: wingo: that's a nice idea wingo: hehe wingo: nice to commiserate with friends ;) *: janneke likes this janneke: too bad we're too late for the potluck :) wingo: haha wingo: leftovers :) janneke: hehe spk121: so it would just be some configure stuff and then setting MINI_GMP_LIMB_TYPE to long long for __MINGW64__ I guess? wingo: yeah i think so. could add '-DMINI_GMP_LIMB_TYPE=long long' in configure, that way source needs no changes wingo: and we eliminate that source of potential bugs (different mini-gmp users defining or not that definition) janneke: and then change instances of "long" to some typedef MINI_GMP_LIMB_TYPE some_gmp_type? wingo: which instances of long ? wingo: in numbers.c you mean? wingo: i guess you would change any long which is a GMP digit to mp_limb_t wingo: humm wingo: but in numbers.h wingo: i think you could just use intptr_t and somewhere we make a compile-time assert that the size of mp_limb_t is the same as the size of intptr_t wingo: wdyt? wingo: just an idea janneke: ah yes janneke: i was wondering about things like hash.c, e.g. unsigned long scm_ihashq (SCM obj, unsigned long n) janneke: spk121: couldn't you recycle scm_t_inum instead of creating a new mp_limb_t type? Is there a meaningful difference between those terms spk121: nevermind, I see where mp_limb_t lives wingo: janneke: for scm_ihashq or anything that returns something that should be an inum, i guess scm_t_inum would not be a bad choice wingo: note though that scm_ihashq could continue to return a long on mingw64 wingo: just wouldn't be optimal wingo: so it probably makes sense to separate necessary changes from optimizations janneke: okay, thanks spk121: OK, so it is just, (1) -DMINI_GMP_LIMB_TYPE=long long for mingw64 (2) make scm_t_inum and mp_limb_t the same type (3) assert that sizeof(void *) == sizeof(mp_limb_t) == sizeof(scm_t_inum) spk121: ? wingo: (2) make scm_t_inum be scm_t_signed bits i guess wingo: because with mini-gmp, users won't have access to mp_limb_t spk121: what about #ifdef MINI_GMP_LIMB_TYPE / typedef MINI_GMP_LIMB_TYPE scm_t_inum; #else typedef long scm_t_inum. spk121: oh right, numbers.h is a public header. janneke: hmm, the new locale check fails for me wingo: janneke: yeah me too, will look at it janneke: wingo: ah "good", thanks wingo: :) *: janneke does another round of builing x86_64-w64-mingw32 jonsger: :) davexunit: daviid: to answer your question from yesterday: no it's not part of chickadee. chickadee is more low-level and doesn't use goops. civodul: i suppose one can test with: guix build guile-next --with-branch=guile-next=master --target=x86_64-w64-mingw32 davexunit: I'm doing some more experimental work with high-level "game engine" style abstractions in an unpublished project and I use goops there. civodul: my modest contribution :-) janneke: hmm, what's a mp_limb_t janneke: janneke: oh, that should be our MINI_GMP_LIMB_TYPE janneke: hmm *: janneke uses --keep-failed to heat-up their laptop a bit civodul: :-) dsmith-work: UGT Greetings, Guilers janneke: hello dsmith-work janneke: spk121: hmm, --enable-jit segfaults for me, at least in combination with the new approach for x86_64-w64-mingw32 spk121: janneke: pity. It definitely isn't well tested. I'm not even sure what a proper JIT test should look like janneke: well, without JIT i get a familiar error with the new approach: unexpected syntax in form ((@ (ice-9 control) %) spk121: janneke: did you rebuild your *.go now that they should be identical to the linx x64 *.go files? spk121: (well, not so sure about identical, but, more similar?) *: spk121 is off to work spk121: good luck janneke: thanks! janneke: yeah, i use guix to rebuild everything *: janneke goes to check .go equivalence dsmith-work: spk121: Upstream lightening has some tests: https://gitlab.com/wingo/lightening/-/tree/main/tests wingo: upstream lightening even has ci :) dsmith-work: On multiple archs too! rlb: ...I'd pondered pushing here for some extra testing (even if I just did it for myself), fwiw: https://man.sr.ht/builds.sr.ht/compatibility.md If I got that working, I suppose we might be able to set up some kind of mirroring from savannah if that were feasible/desirable. rlb: Though I haven't really tried the CI there yet much myself, so was just contemplating. janneke: hmm, mini-gmp uses long and unsigned long in signatures, wondering if that's a problem janneke: e.g.: int mpz_cmp_ui (const mpz_t, unsigned long); manumanumanu: ahoy hoy! 3.0.6 looks like it is going to be a fine release whenever it is ready! manumanumanu: and from what I can see there is some work done towards working under cygwin manumanumanu: What was it Andy said? Mike for president? davexunit: would be cool if my goops patch could be included in 3.0.6 :D manumanumanu: davexunit: which one? davexunit: manumanumanu: fixes an issue with redefinable classes. it's the only bug I have open in the bug tracker davexunit: manumanumanu: https://lists.gnu.org/archive/html/bug-guile/2021-01/msg00028.html daviid: davexunit: ah ok, i asked because i was interested to look at your solution/the code, whenever it becomes public, let me know ... wingo: janneke: are there many of those cases? (using long to indicate an immediate int) janneke: wingo: yes, it seems long is taken to be == MINI_GMP_LIMB_TYPE, if i understand the code correctly; of which i'm not entirely sure manumanumanu: davexunit: thanks! goops is a powerful beast... I mostly use a home-rolled predicate-based system, which is faster for my use case (dispatching on a few elements, with a few methods). I lose specialisation, but gain that in lines of code janneke: i tried replacing long and long int with xlong and then #define xlong long long for mingw, which did not make any difference wrt the "unexpected syntax in form ((@ (ice-9 control) %)" problem janneke: so, i'm kinda lost with this new approach atm janneke: the fixnum patch seems more attractive atm, as "it works" ;-) wingo: civodul: i18.test:282 or so, testing "STRASSE" etc. are we failing to pass the de locale parameter to the comparator? *: wingo fixed the i18n test probs that he introduced; "yay" janneke: \o/ wingo: zzz civodul: wingo: indeed, the Straße example lacks the 3rd arg to string-locale-ci=? davexunit: daviid: the project is unpublished, but the code is available. here's the relevant section: https://git.dthompson.us/starling.git/tree/starling/node.scm#n65 davexunit: context: is the base class for all objects in a game. is 's metaclass. an "asset" represents anything loaded from disk like an image or audio file. janneke: hmm, long2big, ulong2big all need to do inum2big, unum2big i guess janneke: and the mpz_set_si, the mpz_set_ui probably need to take similar custom types daviid: davexunit: oh, tx *: janneke introduces mp_long and mp_ulong for mini-gmp daviid: davexunit: beautifully written, congrat! daviid: davexunit: I think you should file a bug report with your patch for (compute-slots (class )), so the fix might make it to 3.0.6 - unless andy tells us it's not a bug but i don't think so rlb: wingo: another option - I could take part of what I'd be contemplating wrt immutable texts, i.e. we could have "sparsely indexed stringbufs", which would allow us to swap atomically, and would help with other indexing operations. e.g. we could keep an array of sparse char offsets in the stringbuf, say every 32nd char or something. Then strings would go back to just using char offsets (not also byte offsets). rlb: We'd have to hunt though about half the sparseness on average to find a char offset, but that's way better than the whole string for arbitrary stringrefs, etc., and maybe it's good enough for the normal, most common, string operations. They won't be as fast as an exact offset, but pretty fast. rlb: I also imagine we *could* heavily optimize utf8 operations if we wanted to (if libunistring doesn't), i.e. tricks with wider ints, or even gcc/llvm intrinsics or vector ops, etc. rlb: i.e. the "finding part" rlb: We could even have more than one flavor, i.e. a uint8 offset index for shorter strings, uint32 or 64 for longer ones, etc. rlb: I wonder just what fraction of strings is typically < 256 bytes, utf-8 encoded (and isn't ascii). davexunit: goops woe: it's easy enough to define a custom setter for a slot accessor, but since each class defines getter/setter methods for all of its slots, there's no way to define a setter method for a superclass that also applies to the subclasses. sneek: Welcome back davexunit, you have 1 message! sneek: davexunit, wingo says: that's like racket's "prefab" structs. would be nice to support that davexunit: I think I remember the context for this... neat. davexunit: back to the goops thing: it feels reasonable to want to hook into a slot setter method to add custom behavior, but maybe I'm thinking about it wrong. davexunit: one solution is to define a new method entirely for this purpose, but it feels better to have the code look the same as any other slot modification. daviid: davexunit: fwiw, slot-set! is procedure, the only situation where you can customize slot-set! is for virtual slots, afaiu davexunit: yes I know but I'm talking about (set! (foo obj) bar) davexunit: using slot accessors and the generalized set! syntax davexunit: my current path of exploration is to use some metaclass magic to add a new slot option that specifies a post-set! callback method. davexunit: compute-setter-method can detect that and generate a special instance. daviid: right, i don't think it is possible to customize the 'default' accessor(s), except as you said, using the mop or simply defining a method ... davexunit: I want the post-set! stuff to be transparent. I want the code to read like any other set! call daviid: davexunit: then i'd use the mop, and define a new slot-type daviid: a new slot allocation type i meant davexunit: I think a custom slot option will suffice davexunit: I tried messing with allocation types and it gets real hairy real fast davexunit: goops doesn't publicly export the procedures that allow you to get the struct field index for a slot, so implementing an allocation type that uses instance level storage is not possible without hacks. daviid: yes, it's not exactly 'a piece of cake' (to answer your previous sentence) - maybe a slot option would be enough, never tried, i use the mop and allocation type (in g-golf) davexunit: does your allocation type store data on the instances of that class? daviid: no, all are precisely not allocating, but using/refering to GObject properties davexunit: got it davexunit: yeah a new allocation type makes perfect sense there davexunit: for my case, I want to use the #:instance allocation type, but decorate the accessor methods davexunit: well, that's enough playing around for one night. thanks daviid. byeeee daviid: davexunit: right, I think the best route is to define a metaclass and detect treat the new allocation type in a customized compute-slots methods, then decorate slot-set! (note that you would not decorate the accessor method(s), but slot-set!) rlb: wingo: do you happen to know if we have many/any free bits in the stringbuf tag field (cell_0)? tohoyn: hello tohoyn: what's the status of Guile Potluck? manumanumanu: ahoy! wingo: o/ wingo: janneke: why does mes need a gc? would a bump-pointer allocator that never reclaims memory be sufficient? wingo: i guess it means bootstrap allocates lots of memory :) janneke: wingo: yes, i even tried it without, initially; minding the remarks in SICP about memory janneke: wingo: also, bootstrap is x86, 32bit wingo: ah yeah. ArneBab: rlb: that sounds like a useful fix: O(1 + something-32-chars) would be great. davexunit: daviid: just fyi, what worked for me was adding a new slot option #:watch? that my metaclass knows how to handle. any slot with #:watch? #t has a special setter that calls an on-change method when a new value is set. davexunit: for example, I have a class that draws text on screen. by watching for changes to the slot that contains the string, I can now automatically recalculate text alignment based on the new dimensions of the text. wingo: heya davexunit davexunit: hi wingo leoprikler: Yeah, GOOPS has some nice features like that. leoprikler: If you deal with raw records, things can get ugly pretty fast. spk121: wingo: w.r.t JIT. Yeah I set the threshold=0 and ran it on MinGW. Seems OK. wingo: grand davexunit: spk121: jit on mingw? that rules! davexunit: now, do threads work? am I asking for miracles? ;) spk121: davexunit: maybe? building with threads enabled does succeed and the test suite does run. I haven't hit it enough to check if threads are actually working or if it will hang eventually like before davexunit: well that's promising, at least. davexunit: I'll have to revive my guix mingw code sometime spk121: the last remaining huge hurdle is disambiguating sizeof(long) vs sizeof(void *) in the VM and in numbers.c spk121: (or alternately rewriting VM an numbers.c to use uint64_t for long) chrislck_: spk121: :-O janneke: spk121: sounds awfully related to the x86_64 work janneke: i've been trying to port my 2.2 patches this weekend spk121: janneke: I do mean the work you're doing, of course. I did peek at your tree to see what you've done janneke: great! janneke: https://gitlab.com/janneke/guile.git @ wip-mingw now cross-builds on guix, janneke: but running it fails in an interesting way janneke: unknown location: unexpected syntax in form ((@ (ice-9 control) %) (begin ((@@ (ice-9 command-line) eval-string/lang) "(display \"hello\\n\")") (quit))) janneke: not sure how to go about that spk121: janneke: are you running on wine? davexunit: I had issues back in the day where the resulting exe would fail on wine but work on windows spk121: yeah, I can't get it to run on wine, but, my understanding of how to use wine is rudimentary janneke: spk121: yeah, i do my testing on wine civodul: looking at the Guile code, i'm wondering how one can get: Wrong type (expecting finalized smob): # civodul: (from ) civodul: looks like finalized_smob_tc16 is private, never used anywhere in type checks civodul: what am i missing? wingo: civodul: ot wingo: it's the first smob type and has value 0 wingo: when a smob is finalized, its smobnum is reset to 0 wingo: see clear_smobnum wingo: civodul: if you get "expecting finalized smob", that means that somehow the scm_assert_smob_type is getting passed 0 as the smobnum wingo: hum, i wonder if you have somehow hit the smob limit wingo: more than 255 smob types defined, overflow to 0 civodul: and tags would wrap and you'd get a zero tag? civodul: uh wingo: i mean i would expect there to be an error wingo: but it's a way i could see that to happen civodul: though memory corruption may be more likely in this case wingo: yeah that is what i am thinking wingo: weird to think it though :P civodul: i'll see if i can reproduce *: civodul feels like a fire fighter these days :-) wingo: or somehow something overwrote that tc16 value with a value for which (v & 0xff00) == 0 civodul: yeah, so many possibilities jackhill: , jackhill: oops, soory jackhill: civodul: thanks for looking at that bug. Somehow I have a nack for turning up wierd errors :) [-_-]: hello [-_-]: http://ix.io/2SWp [-_-]: Can someone tell me what those display statements doing in that file? [-_-]: i can't understad what to expect [-_-]: This is where i got the file [-_-]: https://www.nongnu.org/xbindkeys/xbindkeysrc-combo.scm.html rekado: [-_-]: “display” prints a string to a port rekado: if no port is given it prints to stdout tohoyn: [- -]: the display statements seem to be some debug output to the console rekado: or it could be called within a (parameterize ((current-output-port …)) …) context and write these things to a file [-_-]: oh... rekado thank you for explaining rlb: wingo: I roughed in the indexing approach, so far it looks promising, if the (tunable at powers of 2) index overhead is acceptable, i.e. say ~6% size and the cost to regenerate it after changes (plus the code complexity). And wrt your more general utf8 question, another thing I imagine we might get with utf8 is much more heavily optimized paths for things like memchr, etc. rlb: wingo: for now I packed the index inline in front of the string bytes, but we could do "something else". rlb: ...and I also set up dynamic "widths", i.e. one-byte index entries for strings < 256 chars, two-bytes for < 2^16, etc. For now I didn't cover the case of size_t > 64-bit :) rlb: (and the index skip-factor is also dynamic -- larger for longer strings) *: rlb shrugs, not sure, and only roughed in the creation -- haven't touched the rest of the code yet, so there'd sill be a lot to do... davexunit: random note: I started reading "software design for flexibility" and I encountered examples code that looked like (define ((iterate n) f) ...). this syntax appears to be mit/gnu scheme's way to create curried procedures. anyone ever implement this for guile? davexunit: example* davexunit: to work with the example code in guile I've just been manually expanding like (define (iterate n) (lambda (f) ...)) so I can keep my focus on the book itself leoprikler: ice-9 curried-definitions IIRC dsmith-work: Monday Greetings, Guilers sneek: It's the 15th of March. Look out for ides dsmith-work: davexunit: Guile used to have curried definitions by default. Removed in 2.0. davexunit: leoprikler: will check there, thanks. davexunit: dsmith-work: do you remember any context around why it was removed? leoprikler: It was not removed it was simply made non-default. leoprikler: So you need to explicitly say that you want them now. dsmith-work: Nope. It's in the NEWS file. I noticed becuse scwm used that in some places. dsmith-work: The NEWS doesn't say why. davexunit: so I guess there's no scheme standard that includes them janneke: WINEPREFIX=~/.wine64 wine64 cmd /c guile.cmd -c '(display "hello\n")' janneke: hello janneke: \o/ leoprikler: nice janneke: yeah -- i was about to give up, and of course, more interesting tests fail janneke: oh wait, my scripts have 2.2 hardcoded, it's not that bad wingo: moo lampilelo: so arch still didn't upgrade to guile 3 wingo: lampilelo: is it because it just didn't happen yet, or was there a reason? lampilelo: wingo: i don't think there's an actual reason, probably just because there's not much push for it from the community fnstudio: hi, sorry, i suppose there's no way around this but just in case... in terms of the shebang string at the start of my guile script... /usr/local/bin/guile doesn't seem to do it (guix on a foreign distro here and guile is elsewhere) lampilelo: or maybe the fact that autogen, a dependency of gnutls, doesn't compile with guile3 because the version in the repos is from 2018 and it has a hardcoded check for guile version fnstudio: i wouldn't be very keen to hardcode my home path, on the other hand i suppose there's no other option that maintains generality fnstudio: (generality = a standard path like the one in /usr) fnstudio: unless i create a symlink which also doesn't look clean fnstudio: yeah there must be no alternative i guess lampilelo: fnstudio: does '#!/usr/bin/env guile' work? fnstudio: lampilelo: brilliant, that works :) although i had to get rid of the "-e main -s" bit fnstudio: but there might be a way of putting it back if i escape things properly fnstudio: also i don't think i need -e main -s now fnstudio: lampilelo: so that works brilliantly for me, thanks! :) wingo: fnstudio: if you want to preserve the ability to load the file and not "run" it, you can end the file in (when (batch-mode?) (apply main (program-arguments))) lampilelo: fnstudio: no problem wingo: batch-mode? returns true when you would want to run main lampilelo: wingo: i think it's just too much work for the maintainer, and my guess is it's the autogen problem, they use a version from the website, which didn't get any updates since a long time, they release new versions only on savannah lampilelo: i marked autogen as out of date some time ago but i see that the flag was removed lampilelo: i have no idea how to make this happen lampilelo: probably write and email to maintainers lampilelo: an* wingo: sounds frustrating lampilelo: maybe i'll get around to doing that if i ever get tired of compiling guile and gnutls by hand ;) wingo: :) wingo: rlb: scheme@(guile-user)> (use-modules (ice-9 i18n)) wingo: scheme@(guile-user)> (list "⇒a" "⇒b") wingo: $1 = ("⇒a" "⇒b") wingo: scheme@(guile-user)> (map (lambda (s) (substring/shared s 0 1)) $1) wingo: $2 = ("⇒" "⇒") wingo: scheme@(guile-user)> (apply string-locale-ci=? $2) wingo: $3 = #f wingo: you found a nice bug :) civodul: does string-locale-ci=? compare beyond the end of string? wingo: yep civodul: compares the stringbuf instead of the string or something wingo: because it uses u32_strlen civodul: uh wingo: so could read anything civodul: woow, good catch wingo: very exciting stuff :P civodul: yup civodul: does string-take use substring/shared actually? civodul: seems not civodul: if we had immutable strings, it could, and that'd be nice... wingo: related bugs in string-locale=? and friends civodul: ouch wingo: but that's the extent of it afaiu wingo: rlb: regarding use of u32_strcoll which doesn't have a variant that takes a number of codepoints -- wingo: i wonder if u32_normcoll could substitute wingo: i don't know much about normalization tho wingo: maybe that doesn't work, normcoll has a different interface wingo: interestingly the implementation of u32_strcoll just converts to the locale encoding and calls strcoll wingo: so i suppose we should do that. rlb: is there a strncoll or something? rlb: Oh, though I guess if we're converting it doesn't matter. rlb: i.e. we can null terminate, unless we're supposed to dtrt even with embedded nulls? rlb: i.e. unicode null is a thing. rlb: U+0000 *: rlb has had to deal with that before, elsewhere. rlb: (in json contexts -- pg does *not* support it, but unicode does) rlb: pg -> postgresql rlb: hah "(This is really a POSIX/C problem, but that doesn't mean we can't solve it out-of-spec) It would be nice if there were a variant of strcoll() that took a length, "strncoll()", or didn't use null-termination at all. Then PostgreSQL wouldn't have to allocate extra copies of strings just to call strcoll() in some scenarios where it has a non-NT string. ICU can do this." rlb: -- https://wiki.postgresql.org/wiki/FreeBSD *: wingo nod rlb: I'm a little surprised glibc doesn't have something like strncoll... wingo: so many layers of bad rlb: :) wingo: hum i wonder why the test i added fails ArneBab: on building community and momentum (a view on Clojure by a former user): https://gist.github.com/wildermuthn/c783ed4f6735fa66c4e7ad34830b3977 flatwhatson: re: Guile 3 on archlinux, I think a number of people are using Guix for this flatwhatson: it's not so different to using rustup or nvm/npm or pyenv etc. (if you squint) leoprikler: Except you can install Guile without Guix and (partially) use Guix as replacement for rustup, npm and pyenv :) leoprikler: Arch folk ditching pkgbuilds for Guix sounds kinda out of character as well. Where's the fun in breaking your system if you can trivially recover? flatwhatson: Arch folks playing with shiny toys is perfectly in character :P spk121: does anyone know a way to test if the JIT is working correctly? I'm trying to figure out if my MinGW JIT hack is running right civodul: spk121: you can set GUILE_JIT_THRESHOLD=0 to force jitting everything spk121: civodul: so if I to that and run ./check-guile and it passes, does that mean that JIT is working? civodul: yup, i think so! *: civodul -> zZz civodul: happy hacking! :-) spk121: huh. I did not expect to be able to get that working civodul: well done rlb: Is the 'h' in scm_struct_init documented anywhere? (Maybe I missed it.) fnstudio: hi, suppose i want to glue a few strings together into a url, eg "://://" fnstudio: is there a guile-y way of doing this? fnstudio: i'd like to avoid string-append since a few bits are sort of scaffolding that'd make the use of string-append very verbose rekado: fnstudio: (web uri) has build-uri to build URIs fnstudio: rekado: oh great, i'll look at that then, thanks! fnstudio: hi, i'm struggling with a http-post request: https://paste.debian.net/1189371/ fnstudio: there's a header that i'm supposed to add to the request that doesn't seem to be recognised/accepted fnstudio: and the request generates a "Bad value for header" error mdevos: fnstudio: maybe replace the symbol test with the string "test"? mdevos: I dunno fnstudio: mdevos: hey thanks, i'd actually tried that but it didn't help, but thanks for suggesting it mdevos: I found something relevant, let me post a link ... mdevos: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/scripts/publish.scm#n665 fnstudio: let me see mdevos: --> declare-header! fnstudio: mdevos: hm true, it must be that fnstudio: although i've just tried with "declare-opaque-header!" and that didn't work, i'm going to try with "declare-header!" but that means i need to dig a little bit deeper and get a grasp of what the parser/validator/writer should be fnstudio: thanks a lot, that's definitely put me on a good track iv-so: what is current state of elisp in guile? fnstudio: mdevos: this seems to work now https://paste.debian.net/1189380/ fnstudio: i can see the request to be generated and sent to the server fnstudio: so i'm now past that error fnstudio: although i got into another one immediately downstream of that fnstudio: the server doesn't seem to like the request and the connection is closed straightaway fnstudio: with a 401 fnstudio: it works with curl fnstudio: this is no longer about guile though, it might be that i'm missing a header or something ArneBab: fnstudio: can you watch the network with wireshark? fnstudio: ArneBab: yes, that's what i did, i was able to compare the two requests, curl vs guile fnstudio: that gave me a hint fnstudio: as the curl one contained a authorization header fnstudio: i thought that guile would transform the userinfo argument into a auth header (by calculating the hash of username + password) fnstudio: (or whatever... i might have misphrased the above, but you get what i mean) fnstudio: but i was wrong fnstudio: and i can actually read: "But since passwords do not belong in URIs, the RFC does not want to condone this practice" fnstudio: (https://www.gnu.org/software/guile/manual/html_node/URIs.html) fnstudio: so the userinfo is actually just the username fnstudio: so i added the auth header "manually" and that... did the trick! fnstudio: so i now have a working request, filed under small wins :) fnstudio: i actually copied the authorization header over from the curl tcpdump fnstudio: as a test fnstudio: so i now need to actually build it programmatically in guile wingo: good evening wingo: spk121: nice work getting jit enabled on mingw!!!! wingo: works with GUILE_JIT_THRESHOLD=0 then ? ArneBab: wingo: do you know offhand how the Lilypond-folks could switch between optimization levels? On the lilypond list there are now benchmarks of Guile 1.8 vs. 2.2 vs. 3.0.6 that do not look all bad — 3.0.6 is still slower for them than 1.8, but less so than 2.2 wingo: ArneBab: these benchmarks, i guess they are about time to load a file from source and then read and local-eval some expressions, is that right? ArneBab: https://lists.gnu.org/archive/html/lilypond-devel/2021-03/msg00054.html wingo: i assume that compile time is not part of the benchmarks ArneBab: https://lists.gnu.org/archive/html/lilypond-devel/2021-03/msg00049.html ArneBab: I’m not sure — it could well be, because Lilypond has lots of code embedded in ly-files. wingo: right. so what is happening here is a few things at once. it would not appear that the change to the reader is significant. the biggest difference between 1.8 and 2.x/3.x is that we run psyntax eagerly on the input, then eval, instead of just starting eval directly. and in 1.8 eval is in C, and 2.x/3.x it is in scheme mdevos: wingo: have you received my mail on a (fixed) wait-until-port-readable/writable patch for guile-fibers? (I don't need a response to it yet, just checking :-) as some people have inboxes with >4K unread mails). ArneBab: But 3.x is much faster than 2.2 again ArneBab: It’s just not yet at the level of 1.8 again wingo: depending on whether eval is called from c or scheme will affect lilypond's experience; calls from scheme faster than calls from c rlb: Hmm, I'm likely misunderstanding something, but i18n.c's SCM_STRING_TO_U32_BUF uses scm_i_string_wide_chars which strings.h says doesn't guarantee null termination, but it then calls u32_strcoll, which requires null termination? rlb: s/requires/depends on/ wingo: ArneBab: anyway i guess good that 3.0 on the same order as 1.8, and good to know reader isn't big issue. might make sense to think about time-to-eval in future but no significant perf regressions in 3.0.6 afaiu for lilypond wingo: though i guess they don't test 3.0.5, so i can also assume that our general direction towards better perf will be fine for them, given that they don't track it on the day-to-day ArneBab: it’s still not back at the performance of 1.8, but I think we’re getting closer to enabling them to switch. wingo: hard to beat the latency of a pure-C interpreter with lazy macros wingo: lazy macros. what a bonkers thing ArneBab: 3.0.5.116-85433 "eating a little more memory than with guile-1.8.8 but far less than guile-2.2.6" fnstudio: (any obvious module for base64-encoding/decoding?) wingo: fnstudio: there is one in guile-lib ArneBab: fnstudio: I only have some base32 encoding wingo: ~/src/guile-1.8$ ./pre-inst-guile wingo: guile> ((if 42 if list) #f 10 'hey) wingo: hey *: wingo shakes head fnstudio: wingo: excellent, thanks, looking that up in guile-lib now civodul: wingo: wat?! wingo: civodul: :) mdevos: wingo: likewise?! wingo: the good old days weren't so good! civodul: what if, in fact, this captured the essence of programming?... civodul: fnstudio: guile-gcrypt has base32 and base64 ArneBab: civodul: I didn’t know … fnstudio: civodul: super, i'll give that a try immediately, thanks wingo: incidentally john shutt of the kernel language died recently. i always thought fexprs were bonkers but enjoyed reading him in the golden days of lambda-the-ultimate civodul: oh wingo: yeah. fellow traveller of weird languages; things are more boring without him wingo: mdevos: no attachment on that mail? rlb: wrt i18n.c and u32_strcoll, fundamentally I'm wondering if we might have a potential buffer overrun there. wingo: rlb: humm i think we probably do wingo: i agree with your reasoning rlb: OK, and I don't see any way to fix it (trivially) with libunistring -- don't think they have non-null-terminated versions. wingo: really! wingo: that's weird wingo: anyway, ok. wingo: i guess we mangle SCM_STRING_TO_U32_BUF then wingo: are you on it? :) rlb: (As an aside, I ended up fully converting strings.c to utf-8 -- in a very blunt manner (would need clean up), and saw that when I started working on the other code that calls into strings.h.) wingo: !!! rlb: I'm not, but I could be -- obviously a very expensive approach would be to just duplicate the wide strings and null terminate them. wingo: yeah but it's reasonable imo rlb: Another would be to put a secret null at the end of all wide strings? Could we get away with that? wingo: i.e. it fixes the problem. for latin1 strings it's already like that rlb: i.e. just stop not null-terminating strings. wingo: can't put a secret null in, doesn't work for shared substrings rlb: ooooooooooooooooooooooooooh rlb: :) rlb: of course -- I should know better. rlb: been staring at that code off and on for days, of course. wingo: :) wingo: how do you see the latin1 / utf-32 / utf-8 tradeoffs? rlb: Oh, and not sure if this is OK either (and could be changed), but I got rid of SH_STRINGs, i.e. strings just point into their buffers, and always know their fully computed offset. wingo: i.e. is utf-8 a clear winner for you? rlb: Well, I think it's a good bit easier to deal with in some ways, since I changed it to have ascii and non-ascii strings, the former are fixed-with, but *all* bytes are utf8. rlb: i.e. we can pass the string bytes from either string to the u8_... functions. rlb: The biggest cost I've seen so far is (unsurprisingly) any use of set_x rlb: or ref rlb: say in a loop. wingo: yeah rlb: Code like that will need to change (where possible) to use traversals/transformers/folders of various sorts. rlb: and sorry, didn't get rid of shared strings, just changed them to hold a pointer to the original *string* not the string's buffer since non-ascii strings now have byte-start and byte-length memebers. fnstudio: (thanks civodul, gcrypt did it!) rlb: That's a trade off I made for perf in the common cases, i.e. non-ascii strings keep the computed byte offsets too. rlb: (into the buffers) rlb: And of course, imagine it's all buggy -- can't run any of it yet, and need to review for remember_upto_here use (once I remember the rules), etc. wingo: sounds tricky from a threadsafety POV wrt string-set! rlb: yeah, I'm not even sure I understand what our expectations are there yet, and/or what we promised before. rlb: unless it's an ascii string and an ascii char, then you have to just copy/rewrite it. wingo: races are possible, crashes are not, is the basic thing. means that if you need to change the "shape" of a shared mutable string, you need to be able to allocate a new one and atomically swap it in; from that POV, any byte offset would be invalidated rlb: wingo: I think maybe any of the libunistring functions with "str" in the name require null termination, so this could find other places we might want to review: git grep -E 'u[138][^_]+_.*str' wingo: logic is in scm_i_string_ensure_mutable_x rlb: Hmm, I'll have to think about what that might mean for sharing -- i.e. we can't update all that atomically the way I have it when there's sharing? Not sure. I'll think about it. wingo: yeah something to mull over rlb: Maybe we can't do that without an immutable "shared offset" table or something? rlb: that we can swap in atomically, i.e. one pointer would have to cover both the stringbuf and all the shared offsets rlb: or we'll have to "do something else" wingo: generally speaking character offsets can persist; byte offsets are tricky rlb: shared strings and multibyte... wingo: for utf8 rlb: right I meant the byte offsets wingo: so if you can detect that the underlying object changed, you can invalidate a byte offset rlb: but if we don't cache those, it's going to be much uglier perf-wise. rlb: hmm, yeah, maybe that's better -- come up with a lazy approach wingo: and if you need to make an atomic change that might alter the byte size of a character, either you realloc or serialize through a mutex rlb: but may still have some tricky data races if we're not careful... rlb: mutex would make it much easier (of course) wingo: but tricky without string buffers as an indirection wingo: nb, i am not arguing for string buffers civodul: fnstudio: actually weinholt is the original author of the base64 module and the one to thank :-) rlb: oh, I kept string buffers. wingo: just pointing out an aspect of the current arrangement wingo: rlb: mutation-sharing substrings are not an important perf case -- imo anyway wingo: so simple and correct >>> complicated and faster wingo: in that regard rlb: suppose we could just use more of a sledgehammer for the first version then, and optimize later if it turns out to be worth it. rlb: i.e. think that's roughly what you said. wingo: sure. as long as we can avoid a mutex for most instances of string-set! fnstudio: right, thank you civodul for the tip and weinholt for a library that's just been extremely useful (gcrypt) wingo: or maybe that's not even a requirement, dunno rlb: (...looks like most of the cases that might involve null termination questions are in vasnprintf.c and i18n.c) rlb: well in any case, ascii strings don't have that problem, so that's another chunk of the time we won't be affected either way. wingo: well, goldurnit, should probably fix that before 3.0.6 wingo: but is my only current blocker in that regard fwiw wingo: the null-termination issue i mea wingo: n rlb: well, it's been that way for a *long* time. rlb: I'd guess. wingo: yeah sure but now that i know it, i hate it :P rlb: Heh - I might be able to help, but depends on the timetable - I might or might not have time in the much shorter term. rlb: Anyway, and wrt the utf8 stuff it's all so far a *hack* - I just clobbered code freely (deleting, rearranging, reformatting), in ways that might be pretty eyebrow-raising for an upstream submission, so aside from actually getting it working, I might also have to do a *lot* of clean up, deprecations, properly documented removals, etc. rlb: (So still might not go anywhere...) wingo: yeah regarding utf8, is definitely in the 3.2 category wingo: not a 3.0 thing rlb: Oh, *no doubt* :) wingo: :) rlb: btw, I'd started using utf8_t* for the bytes (as does libunistring), but of course a lot of apis have char* -- in terms of the public strings.h api, would we stick with char* and coercions, or...? wingo: good question :P wingo: publicly, no change IMO wingo: there is very little good that would come from change to the string C API :P wingo: (initial reaction, obvs) wingo: internally -- hoo dunno. initial reaction is uint8_t* is sufficient, not char*, but not sure about utf8_t*; though note that FOO_t is reserved by the c standard wingo: so would hesitate to define one locally *: wingo zzz rlb: we already get one via libunistring. stis: hello guilers! tohoyn: stis: hej allan[m]: stis: hello! spk121: I wonder if anyone ever uses Guile on Cygwin? I'm expecting Cygwin to die off because of WSL, even though it is still actively maintained for now spk121: It is telling that there a like a half-dozen different ways to deal with how non-POSIX windows is, and how each one has its adherents. A maintenance nightmare rlb: Is the comment above SCM_MAKE_CHAR in chars.h really just noting the behavior for negative values? i.e. latin-1 is a subset of unicode? spk121: rlb: it is trying to handle casting signed char, unsigned char, and uint32_t into codepoint values rlb: right - just wanted to make sure that the "latin-1" bit wasn't particularly relevant. rlb: i.e. every latin-1 code point value is the same utf-32 code point value rlb: so it's mostly just worried about < 0, I think? spk121: true rlb: And thanks. rlb: wingo: yes, wrt utf8 and say pcre, though the main issue there is actually latin-1, not utf-32, fwiw, i.e. pcre doesn't do latin-1, only unicode or raw bytes iirc. rlb: i.e. it only does bytes and utf-{8,16,32} rlb: so latin-1 is expensive rlb: (also have to compile matchers per-encoding, so having a single encoding is more efficient and easier) lispmacs: hi, my Guile skills are a bit rusty. When I am in the interpreter, how do I load in a file from the cwd? mdevos: lispmacs: (load "stuff.scm") mdevos: or (include "stuff.scm") (semantics are somewhat different) lispmacs: thx Noisytoot: mdevos: What are the differences? rlb: If it were feasible, and unless scheme regex's are likely to have competitive performance, I'd also love to have an easy "standard" option for regexps. Were I to do it, that might mean built-in support for maybe pcre. (And if there's interest, I'd be happy to try to help there -- already did it for lokke.) rlb: flatwhatson: plese let me know if you figure anything further out wrt the gnutls issues -- debian's next freeze level begins on the 12th, so much easier to get a fix in now if we need it, than after... flatwhatson: 12th of March? rlb: yep :/ rlb: https://release.debian.org/bullseye/freeze_policy.html#hard rlb: wingo: fwiw, this might well not actually go anywhere, but for no good reason I can discern, I'm still poking at utf-8 strings, and have made non-trivial progress reworking strings.c, etc. i.e. I might not finish, but if I do I'll shout... flatwhatson: rlb, wingo: I have a fix! https://paste.gnome.org/pjara0uwz flatwhatson: setting scm_install_gmp_memory_functions = 0 *does* work, but only if you don't later set it to 1 rlb: doh!? *: rlb contemplates warming up sbuild daviid: dsmith-work: done, see bug#47084 spk121: janneke: in guile spk121: janneke: in guile's master branch, I've checked in a lot of the 32-bit mingw patches from that guile 2.2 branch. It would be cool if you could adapt your 64-bit mingw patch for master janneke: spk121: great, i'll have a look wingo: flatwhatson: !!!!!!! wingo: wow :) wingo: must be why my tests didn't show changing it to have any perf impact wingo: rlb: in any case i would think that utf8 strings would be useful for possibly adopting external regexp libraries wingo: spk121: haha that mingw libpath thing is horrible :) wingo: ah well civodul: hi there! civodul: i'm looking for testers of https://notabug.org/guile-zlib/guile-zlib on a non-Guix distro; any takers? :-) civodul: basically building and running "make check" mdevos: how can I run a single test of guile's test suite? mdevos: (make check TESTS=tests/$THE_TEST.test recurses into test-suite/test-suite, which doesn't have the test) mdevos: civodul: will do in my Debian VM wingo: mdevos: ./check-guile foo.test wingo: or are you trying to run one of the standalone tests mdevos: wingo: no, a Scheme test wingo: spk121: would be interested to hear about the read-line changes fwiw spk121: wingo: yeah, that is the sort of controversial one< I guess spk121: I started out just wanted it to handle CRLF as well as just LF spk121: And while I was there, I threw in the Unicode line endings that almost no one uses for pedantry's sake wingo: what would be the disadvantage of ending lines at CR ? wingo: and then slurping a LF if the delimiter was CR wingo: just wondering how to get back the perf advantages of port-fold-chars spk121: Well that's the way it had been. The disadvantage could be seen in reading web headers, which expectes CRLF, which is where you'd actually done exactly that spk121: I guess it is a matter of expectation. If you are reading a utf-8-unix file and do read-line, you get a line. If you are reading a utf-8-dos file, you don't get a line. You get a line + return, which is neither a line nor a line + terminator spk121: If I wanted to appeal to authority rhetorically, I could point to https://www.unicode.org/reports/tr14/#BreakingRules , but, I didn't really follow those rules exactly either, because literally nobody uses NEL spk121: But OTOH, it isn't a need for Guile on MinGW to work, and reverting it is not a problem wingo: just for info, did you do any perf testing of those functions? wingo: i guess if we really want to have \r not followed by \n as part of a line and not a delimiter, i would be more inclined to keep %read-line be a bit dumber, and make read-line do a read-delimited of "\n\r", and possibly repeat if \r not followed by \n wingo: you know, string-append and recurse, etc wingo: but, am interested in any thoughts you had there spk121: wingo: the lack of benchmarking is definitely a valid criticism. I could try to put something together. spk121: But, if I were at work, I would probably say that first we need to decide what are the actual requirements of 'read-line' and do we meet those requirements. And then afterward meeting the requirements, one would work on optimization spk121: So what are the requirements of a 'read-line'? spk121: But I do want to stress how *mild* any argument I'm making right now is, and how I'd be happy to go with whatever wingo: for me the requirements are: as good perf as possible. allows further port optimizations. keep compatibility with old code. wingo: reads \r\n is a nice-to-have, but it can conflict with compatibility wingo: like people could have code out there that relies on the old behavior. dunno how to mitigate that wingo: i am on board with reading \r\n but i just wonder about compat. perhaps less of an issue considering how sub-par guile's windows story is atm wingo: would be good to see what read-line has done in the past, if it always just read to \n spk121: wingo: read-line has always just be \n or . I don't know if you open file ports in text mode if they do any CRLF chomping spk121: I tried to come up with a benchmark. As near as I can tell, the performance before/after seems in the noise spk121: if I've done it correctly spk121: https://paste.debian.net/1189001/ wingo: yeah perf looks good, tx *: wingo still wants to improve the suspendable-ports results... wingo: but that concern is from before :P spk121: well, we could punt on this and revisit for version 3.2.x, if there is the possibility of code out there actually parsing CRLF with read-line and depending on old behavior. I'm not sure how likely that is, but, who knows? spk121: if you revert it in git, the patch will still remain in tree for posterity, so it can be reintroduced later mdevos: sneek: later tell civodul: guile-hall is not packaged for Debian, so you might run into trouble there sneek: Got it. mdevos: sneek: later tell civodul: never mind, I see configure.ac & Makefile.am exist sneek: Will do. stis: Hi guilers! mdevos: sneek: later tell civodul: "make check" fails with guile-2.2 (I opened a bug) sneek: Will do. mdevos: sneek: tell mdevos: feed me sneek: mdevos:, mdevos says: feed me mdevos: sneek: botsnack sneek: :) civodul: mdevos: thanks! sneek: civodul, you have 3 messages! sneek: civodul, mdevos says: guile-hall is not packaged for Debian, so you might run into trouble there sneek: civodul, mdevos says: never mind, I see configure.ac & Makefile.am exist sneek: civodul, mdevos says: "make check" fails with guile-2.2 (I opened a bug) civodul: spk121: a possibly useful tool is "./benchmark-guile read.bm" (or similar) manumanumanu: stis: Tjenare! What are you up to? mdevos: quick status update: fchmodat, renameat, mkdirat & symlinkat have been defined and readlink, chdir & utime accept file ports now! To be continued civodul: mdevos: guile-zlib should be fixed now, thanks! civodul: mdevos: re *at, nice! mdevos: I'm wondering, should I define a rmdirat even though it doesn't exist in C? The (rmdirat dir name) would actually be implemented as (unlinkat dir name AT_REMOVEDIR) mdevos: I dunno why rmdirat doesn't exist and folks decided for AT_REMOVEDIR instead civodul: i'd say stick to POSIX, so provide unlinkat and AT_REMOVEDIR but not rmdirat mdevos: I would prefer defining a rmdirat, but whatever. I'll add a comment to rmdir explaining there's no rmdirat civodul: ok mdevos: (I see no reason to stick exactly to POSIX, as long as the POSIX<->Guile mapping remains clear) civodul: yeah well civodul: i think we can have POSIX at one layer, and possibly higher-level interface on top of that civodul: but "rmdirat" looks like POSIX, but it's not POSIX civodul: dunno, i'm nitpicking i guess :-) mdevos: Counter-nitpick: The procedure "open" isn't exactly POSIX either, as it returns a port (POSIX equivalent: FILE *) and not a file descriptor. mdevos: But we can always define a new bike shed later :-) civodul: true :-) mdevos: but does anyone have an idea why there isn't a rmdirat? RhodiumToad: the SUS rationale section doesn't say RhodiumToad: probably someone just didn't want to add another function dsmith-work: Happy Friday, Guilers!! civodul: Happy Friday! civodul: mdevos: could you "git pull" guile-zlib and retry "make check" (on Debian)? mdevos: civodul: will restart the VM civodul: ah, sorry for the extra work mdevos: ... apparently closing GNOME boxes doesn't stop the VM, it just suspends it civodul: handy, i guess mdevos: the clock is an hour behind now. mdevos: Also, something I noticed: you can 'unsuspend' a suspended VM even after the host system rebooted mdevos: PASS: tests/zlib.scm civodul: yay! civodul: thanks, mdevos! mwette: civodul: re guile-zlib, I forgot how to generate configure. autoreconf? sneek: mwette, you have 1 message! sneek: mwette, nly says: ill be more than happy to test guile libfuse mwette: sneek: later tell nly: lost track re libfuse, here is the ffi file: https://paste.debian.net/1189035/, you just get nyacc and type "guild compile-ffi ffi/fuse.ffi" sneek: Will do. mwette: civodul: I get a configure error: syntax error near unexpected token '3.0' , for 'GUILE_PKG(3.0 2.2 2.0)' mwette: civodul: I used 'autoreconf -vif' before configure civodul: mwette: hi! that means you're missing guile.m4 (provided by Guile) in ACLOCAL_PATH civodul: if you installed Guile under /usr/local, you probably need something like: ACLOCAL_PATH=/usr/local/share/aclocal mdevos: mwette: I think I had to "apt-get install guile-2.2-dev" civodul: ah right mwette: ah, I have my own guile installed, no apt, and build process is not happy. I did fix ACLOCAL_PATH nd see that guile.m4 is there mwette: now getting "configure error: No Guile development packages were found." mwette: oh: PKG_CONFIG_PATH -- lemme try that mwette: OK. That works now. all pass mwette: ubuntu 2.10 x86_64 dsmith-work: daviid: Closed civodul: mwette: yay, thank you! civodul: i guess we should at least improve the build instructions... mwette: civodul: yw dsmith-work: Ok, cool hack of the day. Non-guile though. Got a long-running process on another machine I'm not looking at. (a build or a dd or something) dsmith-work: Have a script there with: echo "$*" | nc -u -w 0 -b 192.168.1.255 7478 dsmith-work: And on the machine I'm looking at: dsmith-work: while true; do notify-send -t 0 -u critical -- "$(nc -l -u -p 7478 -W 1)"; done dsmith-work: Sends a upd packet with netcat and does a notiification. mdevos: Would a ‘statat’ binding need a ‘exception-on-error’ argument? 'stat' has one, but ‘lstat’ doesn't. wingo: heyyy wingo: spk121: would you be ok if i reverted the read-line things for the moment? spk121: go for it wingo: how much does it affect mingw usage? wingo: like if you run on mingw, without that patch, do tests start failing or something, or do "normal" uses not work? spk121: It only matter for people using Guile on native windows that want to parse text files. It doesn't affect the test suite or the build, I think spk121: Also, the test suite still has 20 ish failing tests, so it was never going to be perfect for this build anyway wingo: i guess the impact would be having a trailing \r on returned lines for ports not opened in text mode wingo: (apparently O_TEXT eliminates the \r, fwiw) spk121: wingo: yeah O_TEXT is supposed to have that effect. Don't think I've ever tried it, though wingo: so many moving parts :P spk121: Guile could use some better CI/CD. The old hydra.nixos would build guile on a bunch of platforms / OS's wingo: yeah agreed wingo: we have a lot of great synergies with guix but moving closer to guix has moved us a bit farther away from many platforms common with users wingo: no complaints, nb, just a note, and a thing to work on in future civodul: there's also been a lot happening on Debian civodul: and Aleix working on Homebrew civodul: overall, i think Guile packaging has gotten much better over the last couple of years civodul: even for those not using Guix :-) civodul: (not that it helps for MinGW tho) wingo: good points! spk121: for a bit I was trying to build Guile on MinGW as a step in trying to build Guile-GI on MinGW. This was on Github/Azure, so it is many different levels of non-free badness wingo: apteryx: welcome to guile-lib wingo: plz push whatever patches you see fit :) if you need feedback, me civodul daviid and rotty are project admins and would be happy to give feedback wingo: careful, if you make too many good patches, you too will be admin & release manager rgherdt: good evening! I opened a bug report and submitted a patch 284 days ago, due to an implementation error in hash-table-merge! (currently it basically "merges" the first ht with itself, ignoring the other one) rgherdt: Here the ticket: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41131 rgherdt: Could someone please take a look at it? wingo: good evening :) wingo: rgherdt: applied, tx for ping :) rgherdt: wingo: thanks, you're welcome wingo: i wonder what kevin ryde is doing these days wingo: he did great guile maintenance in the 1.6 times *: wingo zzz wingo: night! daviid: dsmith-work: if you don't mind, we should close bug#43025 - the bug msg is inadequate, and the answers gives the impressinon it is a 'problem', instead of a high severity bug, a regression imo, related to a guile core supported functionality that somewhere somehow, got 'broken' susequently to module and/or compiler changes - i'd re-open it with a proper message and the above snipset to reproduce ... wdyt? rlb: wingo: don't know if this is interesting, but thought I'd point it out to you in case it is: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977223#22 rlb: sneek: later tell civodul guile-3.0 3.0.5-3 is in debian unstable now, with the gmp fix -- thanks again sneek: Got it. akira121: Hello, how can I split my code in multiple files? I've been trying to `define-module` and `use-modules` but it says `no code for module (prefix)`. flatwhatson: Hi, I saw recently a fix was pushed regarding Guile vs GnuTLS vs GMP corruption. I have some code which is affected by this bug: https://github.com/flatwhatson/guile-gemini flatwhatson: Problem is, I'm still seeing the corruption occurring with the latest guile from git. Likewise if I build 3.0.5 patched with scm_install_gmp_memory_functions = 0 flatwhatson: Running with guile 3.0.0, everything works correctly. So I'm not sure the current fix is sufficient? wingo: flatwhatson: that's... odd! wingo: flatwhatson: what about guile 3.0.4 ? wingo: i don't really know how to isolate this issue without bisecting wingo: unless you want to record in RR, set a hardware watchpoint on the bad address, and then run backwards flatwhatson: Ah sure, I can test against other release builds, I'll get back in a few hours. flatwhatson: I don't understand "record in RR", happy to try to pin things down in gdb but I'll need some hand holding. ArneBab: daviid: ah, it’s been reported already — sorry. civodul: hey there! civodul: rlb: thanks for the Debian upload with the GMP fix! wingo: ArneBab: not a bug -- gperf is only used if you are building from git wingo: the output of gperf is included in tarballs wingo: in the same way we don't have a way to check for e.g. autoconf wingo: so, if you build from git, you'll need gperf, is all ArneBab: wingo: would a patch be accepted that checks in configure whether we are building from git? ArneBab: (and if yes, checks for gperf) ArneBab: the shortest version: we need at least one of .tarball-version and gperf wingo: i would not add a check in configure, fwiw civodul: perhaps we can use AM_MISSING_PROG or whatever it's called for gperf wingo: but it's not needed when configure is run wingo: or does that make autoconf itself check for gperf? wingo: anyway to me is a non-problem RhodiumToad: for comparison, what postgres does for bison/flex is check for them in autoconf, but if they're not found, it just gives a warning about how you only need them if building from git or modifying the grammar civodul: wingo: yeah i agree it's a non-issue civodul: AM_MISSING_PROG is just to display a nice message in case the thing is not found lloda: now in Guile every error gets reported as lloda: "ice-9/boot-9.scm":1686:16: In procedure raise-exception: lloda: ... lloda: no matter where it happens lloda: i don't remember when the change happened, I think 3.0? but it was different before lloda: it would tell you where the error actually happened civodul: lloda: the backtrace should have more info though, no? lloda: sure, but before you'd know where the error happened without needing to look at the bt lloda: i mean that line is always the same boot-9.scm point lloda: it doesn't say anything useful civodul: right civodul: we could cut the last frame or so flatwhatson: re: gnutls, i've confirmed that 3.0.1 and 3.0.4 are also showing the bug flatwhatson: was struggling to reproduce, but remembered i'd turned off gnutls debug logging flatwhatson: all the extra garbage from printing gnutls logs makes that error apper much sooner lloda: i've lost track a bit of the different kinds of exceptions there are now tbh lloda: i just use throw and catch RhodiumToad: in 3.x there's only one kind of exception now, iirc? lloda: i need to do some reading then lloda: i'm used to just throwing symbols lloda: if throw/catch are out and raise-exception/with-exception-handler are in, i'd say we've lost something in quality of naming RhodiumToad: they're both now variants of the same thing, no? lloda: the manual seems clear, i just never looked at this section before lloda: i'd say there's some redundancy? if you were doing this from scratch, you probably wouldn't have so many functions RhodiumToad: well yeah tohoyn: lloda: there is also the guard form you can use instead of with-exception-handler flatwhatson: is there some trick to using rr with guile? flatwhatson: replay fails with "Assertion `ticks_now == trace_ticks' failed to hold. ticks mismatch for 'SYSCALL: mmap'" wingo: flatwhatson: when i have used it it works for me fwiw wingo: no tricks wingo: flatwhatson: are you on amd, perhaps? wingo: i assume you're on amd64 but wondering if you are on intel or amd hardware wingo: lloda: yeah the exception situation is a bit of a mess wingo: maybe that can be part of 3.0.7, to improve a number of specific errors, and possibly to switch more things to structured exceptions wingo: while still guaranteeing throw/catch compat wingo: but still the source location should be fixed, i agree wingo: flatwhatson: if you run with GUILE_JIT_THRESHOLD=-1, does the problem still show up? wingo: flatwhatson: i wonder if possibly you are running into section 3.4 of http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.10.4159&rep=rep1&type=pdf flatwhatson: wingo: i'm on intel, using guix environments for testing flatwhatson: do you specify something for --syscall-buffer-sig? wingo: i don't, no flatwhatson: "Tracee is using the syscallbuf signal (SIGPWR)" "Try recording with --syscall-buffer-sig=" wingo: could be i haven't used rr in a while wingo: in that case yeah you might have to choose another signal, as libgc is using SIGPWR i think flatwhatson: it's happy with --syscall-buffer-sig=12 (USR2) wingo: same thing as https://github.com/rr-debugger/rr/issues/2294 i guess flatwhatson: then on replay it bombs out with this: https://paste.gnome.org/ptjwtfqgn flatwhatson: attaching gdb gives backtrace: https://paste.gnome.org/pvtbkyzlz flatwhatson: seems there have been a few similar-looking issues on rr, i probably just need to report it wingo: sounds like a frustrating experience civodul: flatwhatson: FWIW i have to pass -n to "rr record" flatwhatson: on the bisection front, 3.0.0 works and 3.0.1 doesn't flatwhatson: patching 3.0.1 with scm_install_gmp_memory_functions = 0 doesn't work flatwhatson: completely reverting 00fbdfa7 works! flatwhatson: looks like scm_install_gmp_memory_functions actually only controls installation of a finalizer, and not installation of the custom gmp allocation routines flatwhatson: oh, derp, it does control installation of those routines... wingo: but probably if !scm_install_gmp_memory_functions, we should allocate pointerless data... wingo: humm wingo: i wonder if scm_i_clonebig needs a scm_remember_upto_here_1 wingo: of src_big wingo: flatwhatson: try that? flatwhatson: wingo: tried this, doesn't work: https://paste.gnome.org/p6twdtev8 flatwhatson: also tried 3.0.0 with scm_install_gmp_memory_functions = 0 and that *does* work flatwhatson: struggling to see what the difference between that and the patch i linked would be... wingo: flatwhatson: the problem exhibits itself with stock gnutls ? wingo: i.e. just with guile-gnutls? wingo: flatwhatson: regarding scm_install_gmp_memory_functions = 0 or not, perhaps try using scm_gc_malloc_pointerless instead of scm_gc_malloc if !scm_install_gmp_memory_functions flatwhatson: wingo: isn't that this patch? https://paste.gnome.org/p6twdtev8 wingo: ah yes sorry wingo: i thought you tried adding scm_remember_upto_here_1 (src_big) to scm_i_clonebig flatwhatson: and yes, I get the problem running under guix environment --pure guile gnutls guile-fibers wingo: --ad-hoc i guess flatwhatson: ah yep! flatwhatson: that's since evolved into a manifest with various versions & patches of guile wingo: yeah dsmith-work: Hey Hi Howdy, Guilers dsmith-work: daviid: Sounds good to me flatwhatson: civodul: that works!! rr record --no-syscall-buffer --syscall-buffer-sig=12 guile path/to/script.scm ... flatwhatson: then rr replay seems to be quite happy! civodul: \o/ daviid: dsmith-work: ok, could you close it then, then i'll re-open a 'more specific' bug report, tx! dsmith-work: Ur? Did I open that? Sure. dsmith-work: daviid: If you open a more-specifc report first, I could reference that. daviid: dsmith-work: ah ok, let's do that indeed, will ping you, have to go afk for 1h or so ... bbl dsmith-work: daviid: Er, what bug was that again? dsmith-work: Ah, https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43025 manumanumanu: Good evening! mdevos: Why are directory streams called "directory port" in filesys.h mdevos: (SCM_VALIDATE_DIR) even though they aren't ports? (port? (opendir mdevos: "/")) --> #f manumanumanu: cruft? :D civodul: mdevos: probably no good reason :-) wingo: ~~ spk121 for president ~~ wingo: ahaahahahahahahahaha gnutls.scm ends with ";;; arch-tag: 3394732c-d9fa-48dd-a093-9fba3a325b8b" wingo: appendarchitis civodul: souvenirs :-) manumanumanu: explain it like i'm 5 wingo: imagine ";; this file ends here", but including the name of the file to "help" your version control system manumanumanu: which VCS then? wingo: TLA wingo: 2003 was wild spk121: dude. I remember arch. That was crazy wingo: what is the largest .c file in guile, if you had to guess? *: wingo looked fwiw, but maybe people want to guess manumanumanu: unicode codepoints? manumanumanu: I don't know C, but that doesn't seem completely unreasonable wingo: in terms of bytes, it's numbers.c, almost twice as big as jit.c leoprikler: Fools, it's guile.h post macro-expansion :P wingo: :) manumanumanu: why is that? Noisytoot: wingo: What's ";;; arch-tag: 3394732c-d9fa-48dd-a093-9fba3a325b8b" for? wingo: lots of different kinds of numbers, a bit of combinator explosion of interactions civodul: numbers.c is crazy wingo: the right thing for bignums is really the MPN API and inline digits; but it's distressing to think about implementing wingo: i had a hand in causing some fun security bugs in firefox implementing similar things there wingo: aaah distressing *: wingo averts gaze wingo: i am missing a kind of prioritization effort for guile i think. like where are we going. lots of fun things to do, lots of unglamorous maintenance, dunno what next tho spk121: wingo: next could a proper ci/cd over GNU/Linux/BSD and the various configure flags. Unglamourous, as you say spk121: but of course, srfi-14 in scheme would be a fun project for someone wingo: scope sets, new garbage collector, AOT compilation, register allocation, fixing the compilation-time cliff when you have more than fixnum bits of live locals, mpn, identifying ways to be closer to racket wingo: inline caches for top-level calls, perhaps spk121: maybe there is some sort of wishlist ranking webform someone could whip up RhodiumToad: what's the deal with the module issue that daviid is always complaining about? spk121: High on my wishlist would be linking the core *.go files into single *.a file to improve embeddability wingo: the re-export-modules thing? need to look at that i guess wingo: there does appear to be a user-space workaround tho on the bug https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43025 wingo: spk121: yeah that would be fun wingo: dunno how much to double down on system-specific linkers, or whether to implement a multi-.go packer in scheme wingo: with corresponding loader changes too wingo: or what. luajit seems to manage to get their bytecode into .a files portably, so perhaps there is a simple option wingo: ... converting exceptions to structured exceptions... wingo: optimizations to prompts so you can contify them away wingo: cross-module inlining (https://lists.gnu.org/archive/html/guile-devel/2016-03/msg00026.html) dsmith-work: Moving from libc regex to a Scheme regex? spk121: I apologize in advance for the libpath commit I'm about to make. If anyone knows a better way, please fix it wingo: dsmith-work: yeah that would be good. regexp literals also. and struct literals wingo: having some kind of interface in a running guile process that can allow you to profile as you go wingo: like generating timelines in the format that chrome's devtools can read dsmith-work: So sexp regex and working with scheme strings (instead of C strings) RhodiumToad: is the ssax fix incorporated yet? wingo: RhodiumToad: no, which one? :) RhodiumToad: the one for > in CDATA wingo: i think i haven't seen it wingo: if you would like to help getting obvious patches in, it would be very welcome :) wingo: needs an eye for detail which i think you have dsmith-work: I don't know what's involved: Adding the debugging features needed to allow geiser to be as awesome as slime. Or just be able to do slime with Guile. RhodiumToad: ssax author did post a new version on their site but iirc no changelog or announcement, so now I can't find it at all RhodiumToad: here's the racket version: https://github.com/jbclements/sxml/issues/7 RhodiumToad: that has links to guile-devel post and also to upstream version wingo: first bug in ssax in a decade or so! dsmith-work: Well, that says something! *: RhodiumToad is good at finding ancient bugs dsmith-work: (people don't use xml anymore?) RhodiumToad: most people probably wouldn't notice corruption of > inside cdata RhodiumToad: I think the oldest bug I found is one in the BSD pom(6) program from the '80s manumanumanu: RhodiumToad: it is in upstream RhodiumToad: yes manumanumanu: dsmith-work: there is a pretty nifty SRFI for scheme regular expressions. That, and srfi-166 manumanumanu: Ashinn is a saint! dsmith-work: manumanumanu: irregex? manumanumanu: yes dsmith-work: http://synthcode.com/scheme/irregex This is what I was thinking of. manumanumanu: dsmith-work: it is codified in a srfi now manumanumanu: and, even better, "show" is now srfi-166. manumanumanu: I had a half-finished compiler for srfi-166 uvw manumanumanu: until lightning killed my computer and my local backup manumanumanu: with the goal of making the subset of srfi-166 that implements the features of ice-9 format as fast as ice-9 format. manumanumanu: I was making good progress, but I lost some steam when my drive became charcoal. manumanumanu: imagine: a powerful, user-extensible formatter. dsmith-work: Ah!, srfi-115 manumanumanu: srfi-115 is easily portable. Getting something like the reference implementation of srfi-166 to work means implementing something like 5 other SRFIs. manumanumanu: oh, look at the time! ArneBab: wingo: for me the gperf thing is a problem, because it just costed someone half an hour to figure out who tried to test whether there are regressions for Lilypond. If there hadn’t been a quick reply on the mailing list, that could have well ended that check. And if that happened once where I saw it, we can be sure that it already happened many times where I did not see it. ArneBab: wingo, civodul: What I would like to do is to check at configure time whether the things in the tarball are available, and only to check for gperf if they are not. civodul: ArneBab: typically "configure" does things when building from a tarball civodul: when building from a checkout, it's expected that there are additional dependencies civodul: we should document it, but it's not something "configure" should check for civodul: since forever you also need Flex when building from a checkout, and Autoconf, etc. ArneBab: I didn’t expect that the configure generated from git doesn’t do the checks needed to build ArneBab: I need autoreconf, and it tells me what else I need ArneBab: and the person who tried to check whether there are regressions from guile 3.0.6 for lilypond didn’t expect it either. lispmacs: hi, I'm trying to relearn how to use cooperative repl servers (in 3.0.5) after a year or two away. Something I'm trying to figure out: if I don't connect to the coop-repl-server, and just exit my application, the port is left bound for a while at least. lispmacs: but it isn't obvious to me from the documentation how to properly close a coop-repl-server without connecting to it and running (exit) lispmacs: My system: https://bpa.st/XUPA lispmacs: does David Thompson still haunt this channel? lispmacs: had a Chickadee question. Probably in bed ArneBab: wingo: ah! Nice :-) terpri_: sneek, seen davexunit sneek: I last saw davexunit in #guix 7 days ago, saying: figured it out but boy is the solution ugly. terpri_: lispmacs, ^ ArneBab: manumanumanu: would it help you to get write access to https://hg.sr.ht/~arnebab/wispwot/ ? dsmith-work: lispmacs: Could be becuse of not using SO_REUSE* socket option dsmith-work: ? lispmacs: dsmith-work: okay, I'll look into that, thanks roptat: is there a way to prevent regexps from reading the whole string after the first match? pkill9: roptat: look up lazy vs greedy regex, might be what you're looking ofr pkill9: for* roptat: I mean, (string-match "a+" (string-append "aa" (make-string 500000000 #\b))) should return the first "aa", and I don't care if there are matches after that roptat: (the regexp is taking a few seconds to match that) roptat: (not counting the time it takes to create the string) roptat: to explain, I'm trying to write a lexer, and I use regexps as a simple way to express what it should match. But with big source codes, I have to run regexps multiple times on big strings, which makes it very slow taw10: roptat: You mean you want the first substring? Wrap your expression in (match:substring ..... 0) and it does what you want roptat: (define s (string-append "aa" (make-string 500000000 #\b))) (match:substring (string-match "a+?" s)) is slow, how to make it fast? :D taw10: (tip: reduce the number 500000000 for testing :) roptat: below that number it's hard to see it's slow roptat: my code works well on small files, but it's just taking ages on bigger files taw10: Ah, then I misunderstood the question. Afraid I don't have any suggestion of how to make it faster, except perhaps not using a regex matcher roptat: so, I think it's trying to get every possible matches in the string, and not only the first one, so it goes through all the bs. for what I want, executing the regex would just go through the as, fail at the first b and return the match roptat: no reading an absurd amount of garbage :) roptat: so should I just come up with my own implementation of regexps for that? dsmith-work: roptat: You probably want to write your own lexer instead. wingo: spk121: the posix-w32.h patch described in recent commit wasn't part of the changeset, fyi *: wingo added mkstemp, finally spk121: hmm spk121: oh, since I was pulling in from different PC's that commit was already included from fedb65b98. I could 'force' the commit to remove that, if you want, or just let it go wingo: nah, all fine wingo: just fyi in case you forgot to add something that you wanted to add *: wingo grumbles at gnu copyright assignment procedure civodul: wingo: i reported the -Wunbound-variable issue at https://issues.guix.gnu.org/47031 but haven't yet taken the time to investigate manumanumanu: daviid: I don't have a mouse, and haven't set up my computer for mousle-less navigation, what is the expansion of the macro? manumanumanu: of the bug manumanumanu: the big unanswered question is "what is the use-list of a module?". Why did module-use! re-export the bindings in 2.2 but not in 3. The expansion is not the problem. manumanumanu: now good night again ArneBab: First result from the Lilypond folks testing Guile 3.0.6: The error about the missing gperf command comes during make instead of during ./configure. Could someone check whether the check for gperf is missing from configure.ac? daviid: manumanumanu: forget bout the macro, the macro is fine :) - it is there only to allow users not to have to quote each module name(s) ... the problem is deep downin the module system (the changes that has(ve) been made in 3.0, and/or the compiler, which breaks module-use! daviid: ArneBab: tell them when build from source, they need ti install gperf daviid: the gperf and/or gperf-dev module i don't remember ArneBab: They already found that and are retrying. The point is just that the error should be thrown during configure, not during make. daviid: no, because the cinfigure from the tarball works fine ... daviid: works fine without gperf ArneBab: can we do that check during autoreconf? daviid: manumanumanu: let me paste a smaller example daviid: ArneBab: you'd have to talk to our maintainers, who are aware of this, it's been reported here a couple of times already ... but i don't think it is important enough that they will do something about this 'now' - maybe they'd accept an autoreconf (bootstrap/autogen.sh) patch though, i don't know - but i'd rather have them solve the module-use! bug, which imo is a regression, and/or any other bug(s), 'spurious warnings' ... then work on daviid: 'this' minor problem, not even a bug ... daviid: manumanumanu: here https://paste.debian.net/1188771/ daviid: wingo: here is a much 'better' snipset/report for bug#43025 - https://paste.debian.net/1188771/ daviid: in the above, the define map-a is totally useless, and does not even use the srfi-1 map 'extension', just there to have a define in (a) - the important thing is module-use! is 'broken' in 3.0 daviid: apteryx: the htmlprag patch, did you write it 'alone' or were you also helped by others? asking to mention their name if ... i kind of remember others did propose at least part of the solution, but i am not sure ... chrislck: if anyone can assist -- how exactly do I use srfi-180 reference implementation in guile? it's written as .sld chrislck: is there a magic (enable-sld-read #t) mode? roptat: mh, I'm having troubles with a regexp: (string-match "[^()\\[\\]]+" "text") doesn't match anything roptat: (with or without "\\" roptat: I'm trying to match anything that is not a parenthesis or square bracket apteryx: daviid: for the htmlprag patch, I wrote it alone, but tweaking the parent-constraints idea was suggested by Ricardo Wurmus and authored in Guix as commit 7854bbeb3f88ad4747b0a4ca01021ef2741f7b4e by Ludovic (as a very localized hotfix) daviid: apteryx: ok, I will mention their contribution then, thanks apteryx: thank you! cousin_itt_: Is there a procedure call that you can put in source code that will cause you to enter the "backtrace" environment? I suppose I could type something silly like "(sqrt)" ... but is there some more elegant thing I could do? cousin_itt_: Is there a procedure call that you can put in source code that will cause you to enter the "backtrace" environment? I suppose I could type something silly like "(sqrt)" ... but is there some more elegant thing I could do? dsmith: roptat: Try "[^][()]+" See: man 7 regex. The key to get a ] in a character class is have it first or right after ^ dsmith: scheme@(guile-user)> (string-match "[^][()]+" "text") dsmith: $1 = #("text" (0 . 4)) dsmith: scheme@(guile-user)> (string-match "[^][()]+" "[(text)]") dsmith: $2 = #("[(text)]" (2 . 6)) spk121: dsmith-work: fixed dsmith: spk121: Nice! mdevos: Is it posible to define keyword argument functions in C? I can't find the documentation sneek: Welcome back mdevos, you have 1 message! sneek: mdevos, lloda says: one thing I do when editing Guile code is disable trailing whitespace removal. Unfortunately Guile code has a lot of that and if you have autoremoval on, the diffs will be very dirty. civodul: mdevos: i think you'd have to manually fiddle with rest arguments civodul: anyhow, i recommend doing the heavy lifting in Scheme civodul: keeping as little as possible in C civodul: as a rule of thumb :-) roptat: dsmith-work, thanks a lot! mdevos: Problem is, I'm trying to bring openat, fchmodat, ... to guile, and my plan is to introduce a ‘file-in-directory object’ (essentially a directory port + name pair), and the constructor would take keyword arguments mdevos: like this: (make-file-in-directory DIR NAME #:follow? #t/#f) mdevos: I guess I could define the 'file-in-directory object' & constructor in Scheme in boot-9.scm (or something included from there) mdevos: and define a C function for C users that's less keywordy and just calls the Scheme procedure? civodul: dunno, you could omit the C function civodul: as another rule of thumb, for POSIX bindings, i recommend first providing functions that are a 1-to-1 mapping to the C function civodul: before building abstractions on top of it mdevos: civodul: I suppose I could do that mdevos: I'll write binding to openat, fchmodat, fchownat, utimensat, readlinkat, fstatat and fchdir. Any requests? civodul: sounds good! civodul: wingo: looks like custom binary input ports are buffered by default; perhaps a mistake? mdevos: btw, I've written a patch for O_NOFOLLOW and others: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46220 dsmith-work: UGT Greetings, Guilers wingo: civodul: why a mistake? civodul: wingo: i was expecting it to be unbuffered by default since it's a "user port" civodul: but i think it's always been this way anyway wingo: that doesn't follow, for me civodul: ok civodul: another question: looks like 'drain-input' doesn't clear the putback buffer, amiright? wingo: humm, not sure wingo: appears to clear the putback buffer, for me mdevos: civodul: may the "chdir" / "scm_open" procedure be extended to allow ports as well? That's technically not a 1-to-1 mapping from C<->Scheme, but there's precedent with "chmod" and "chown" wingo: ah interesting civodul: mdevos: yes, probably wingo: no, seems to work properly for me wingo: scheme@(guile-user)> (open-input-string "bc") wingo: $8 = # wingo: scheme@(guile-user)> (read-char $8) wingo: $9 = #\b wingo: scheme@(guile-user)> (unread-char #\a $8) wingo: $10 = #\a wingo: scheme@(guile-user)> (drain-input $8) wingo: $11 = "ac" civodul: hmm wingo: basically drain-input collects and returns buffered input. but having a mental model on what's buffered is a little tricky wingo: buffered input includes the putback buffer and may include a portion of a read buffer wingo: afair wingo: (but drain-input is a funny procedure, i can't think of many ways to use it correctly) civodul: yeah it's only useful to ensure there's no buffered input IME wingo: why would you want to ensure that? :) civodul: in cases where i then pass the underlying file descriptor to some other piece of code civodul: usually not a great situation to be in, but that happens :-) wingo: ah indeed wingo: yep :) civodul: https://notabug.org/guile-zlib/guile-zlib/src/master/zlib.scm#L157 civodul: anyway i'm fighting with a situation along these lines, looking for extra buffering in a maze of ports :-) wingo: civodul: is it necessary to buffer on the zlib side? i guess so, given that you don't know how much input corresponds to how much output wingo: ideally you buffer only on the guile side fwiw wingo: when guile needs more it will call the read function with the number of bytes it can take mdevos: how can I verify whether an object is an open input port with a file descriptor from C? I don't quite understand the "object = SCM_COERCE_OUTPORT (...)" assignement in scm_stat and I would rather not cargo cult copy wingo: SCM_VALIDATE_OPFPORT (SCM_ARG1, port); mdevos: (I also need the fd, would SCM_FPORT_FDES on the port itself work?) mdevos: wingo: I'll just use that, though I wonder what SCM_COERCE_OUTPORT is supposed to do in scm_stat wingo: right, so that is a strange thing that is not well tested -- there is a thing called a "port with a print state" wingo: which is a little object that wraps a port and includes a hash table of what's been written wingo: to allow circular data structures, i think wingo: but i have rarely had to touch that wingo: anyway sometimes you can pass these to port-using procedures, and SCM_COERCE_OUTPORT can take either a port or a port-with-print-state, and returns just the port wingo: i don't think scm_stat needs to do that fwiw wingo: and i don't think mkdir would need to do so either wingo: a crufty thing from days of yore :P civodul: wingo: guile-zlib doesn't actually buffer; it makes sure the user's port is unbuffered before passing the underlying FD to zlib mdevos: To check whether readlinkat is supported (and work around some platform-specific bugs), I thought of using gnulib's readlinkat module at first, but it's GPL and Guile is LGPL mdevos: any particular reason it's not just GPL? leoprikler: if Guile was GPL, all Scheme code written in Guile would need to be GPL as well, which is not very feasible civodul: "not very feasible"? :-) mdevos: leoprikler: do you know any such code? leoprikler: SRFIs? leoprikler: civodul: "not very feasible" is my personal way of saying infeasible. leoprikler: feasibility gets casted to a C boolean :) civodul: it's not about feasibility, it's about choice civodul: it's a choice some may not like, but it's entirely "feasible" mdevos: leoprikler: all SRFI's implemented in Guile are LGPL or GPL, or compatible, I hope civodul: (not saying we should do it) leoprikler: mdevos: they're at least LGPL/GPL-compatible, but if you write your reference implementation in Guile, you need to license that under the SRFI license, which is the same as Expat IIRC taw10: A GPL Guile wouldn't require all Scheme code to be GPL - that's total rubbish. See https://www.gnu.org/licenses/gpl-faq.html#IfInterpreterIsGPL taw10: Think about it: would all the code in SICP suddenly need to be GPL just because it can be run with Guile? leoprikler: "When the interpreter just interprets a language" mdevos: Guile is more than an interpreter for a language, it also comes with a few libraries of procedures leoprikler: If you use any of Guile's own facilities not specified by RnRS, e.g. its module system, you're effectively in GPL enforcement territory. mdevos: What I was originally asking for, was there any particular reason for using the LGPL instead of GPL for Guile in? (And would there be compatibility problems if guile would switch to GPL) civodul: mdevos: it dates back to 25+ years ago, so we can't say for sure, but it's probably the same reasoning as for making libc LGPL mdevos: (I haven't ever heard of propietary applications build on guile. I don't care about those, they can find another Scheme interpreter/compiler + library implementation.) mdevos: I don't think the same reasoning applies to Guile (I didn't find the original reasoning; I'm basing mysef upon ) leoprikler: Well, there are more Scheme implementations than C libraries, so a naive interpretation of that statement would hold. mdevos: Hmm, all the *at gnulib modules are all GPL: readlinkat, chmodat, chownat, faccessat, fchmodat, fchownat, fstatat, linkat, mkdirat, mkfifoat, openat, opendirat, renameat, statat, symlinkat, unlinkat, utimensat mdevos: (except careadlinkat) mdevos: Would it be possible somehow to only import m4/readlinkat.m4 from gnulib, but not gnulib's C replacement / wrapper, without messing up the build system? mdevos: (make dist & future gnulib-tool --add-import) mdevos: (m4/readlinkat.m4 itself has a permissive license) dsmith-work: In ages past, Guile was GPL, with a special permission/exception/something. This is from before there was a LGPL. dsmith-work: It was to promote using Guile everywhere. mdevos: ... that didn't actually happen (Guile everywhere). The only propietary software I've seen it in were personal pet projects, and all the free software I've seen it in are GPL or compatible dsmith-work: Yep mdevos: (LilyPond, TeXmacs, GnuCash, some librariesà leoprikler: "All the free software are GPL or compatible." Because people don't really want to make GPL-incompatible software? leoprikler: GPL-incompatible free software. mdevos: leoprkler: in case I wasn't clear: ‘All the free software **I've seen it(Guile) in** are GPL-compatible’. dsmith-work: https://mail.gnu.org/archive/html/guile-user/2002-06/msg00011.html leoprikler: Most people, who write non-GPL free software, choose a more permissive license (e.g. Expat). mdevos: I guess my argument is (1) switching to GPL wouldn't cause trouble for anyone and (2) it's convenient to be able to use GPL modules from gnulib *: mdevos afk rlb: If I'm reading it right, I'm wondering why/if shared mutable substrings really need to keep the extra indirection through the source string, i.e. could they just point directly to the source string's buffer... taw10: Hmm, any other examples of the license status of a program depending on which extensions you use in that language? Because I don't think it works that way. e.g. the GPL FAQ I linked to doesn't say "... as long as the interpreted program only uses some standard-compliant subset". Do your programs need to be GPL because you used a GCC extension, for example? On a quick look, the GCC manual doesn't warn taw10: that using certain extensions come with strings attached. I'm not talking about the GCC runtime exception - that's different because it's about code actually getting copied into your executable taw10: What I do agree with, however, is that making non-GPL *extensions* to Guile (i.e. linking against libguile) would be impossible if it were GPL, which could be regarded as a bad thing. leoprikler: That does not apply here, because you can execute a GPL program to do anything. leoprikler: If you only used Guile to compile to Guile bytecode and then ran your Guile program on your own proprietary Guile VM, you wouldn't violate the GPL. taw10: Of course, what you do in private is irrelevant. I'm reading all of this under the assumption that we're talking about publishing an "interpreted program" under a proprietary license leoprikler: I meant that as in "if you published your proprietary Guile VM and used standard Guile to compile your proprietary Guile code". leoprikler: … which you also published but only the output. taw10: Your logic seems to be that using Guile-specific features makes your "interpreted program" become a "derivative work" of Guile. Did I misunderstand that part? taw10: If I did misunderstand, then I don't follow where the GPL requirement for the "interpreted program" comes from taw10: If I didn't, then I don't understand why publishing a proprietary program running on a proprietary VM would be OK civodul: a GPL'd Guile would be like Emacs: one can publish non-GPL code (in practice, extensions or users of Guile-provided modules), but it must be GPL-compatible and the combination is GPL civodul: that said, i think this so-far theoretical discussion is going a bit far :-) leoprikler: which is different from LGPL, which lets you publish derivative work under any license (without limitations to compatibility and combination) mdevos: unless Guile's LGPL / GPL situation changes, I'll just copy m4/readlinkat.m4 and use that (that's under a permissive license) & #ifdef HAVE_READLINKAT, and ignore gnulib's replacement functions *: mdevos pretends to be afk again leoprikler: that should be possible since we're already in the posix-specific part mdevos: leoprikler: I don't follow? leoprikler: Guile's filesystem stuff has two versions depending on whether you have the 'posix feature. mdevos: leoprikler: I follow even less know. scm_readlink is in filesys.c, not posix.c -- and now I see _POSIX_C_SOURCE is not always defined due to reasons (stime.c). grrr incompatibility dsmith-work: I think "posix" stuff in Guile is legacy from SCM: https://people.csail.mit.edu/jaffer/scm/Posix-Extensions.html#Posix-Extensions wingo: good evening :) ArneBab: mdevos: from my perspective, now running Guix, Guile is pretty much everywhere I look :-) wingo: g.r.e.a.m. ArneBab: gream? wingo: https://en.wikipedia.org/wiki/C.R.E.A.M. manumanumanu: wingo: saw you merged the patch. I should really update my name in my git config. Even I react when I see my first name in a commit log manumanumanu: :D wingo: :) wingo: tx for patch! manumanumanu: did you see my other comment? That the two (map ...)s of rnrs base and (ice-9 boot-9) do the same? manumanumanu: The r6rs one is much nicer, but slightly slower (because of being pure gulie. Not by much, though. manumanumanu: The question was, do we really need two of them? manumanumanu: anyway, I have to drill things tomorrow. The heavy responsibility of owning a house and all that. Good night! wingo: manumanumanu: is the r6rs one the same? wingo: i didn't see the other comment btw wingo: anyway we can follow up later :) manumanumanu: yup. same constraints and everything. the one in (r6rs base) has better error reporting and is much nicer manumanumanu: but ever so slightly slower manumanumanu: if you pass the boot-9 one an non-proper list you get an error in (length ...), whereas (rnrs base)-map has a correct error message and everything. Regarding the speed: my test was a simple repl test: ,time (rnrs:map 1+ a-long-list-from-iota). manumanumanu: wingo: but today the map from rnrs base is faster on that benchmark of a 10000000 element list manumanumanu: i might have been wrong. if so: the map from (rnrs base) is sliiigtly faster and produces better error messages. wingo: map benchmarks are squirrely, depends on heap size, whether a collect happens or not, etc manumanumanu: It seems boot-9 map has a wider run time (0.32-0.7s), but averages lower than rnrs:map, which consistently scores 0.43-0.45s manumanumanu: anyway: they are functionally the same manumanumanu: boot-9 map transverses the list more times (doing more or less (= (length l1) (length l2) ...) which conveniently errors on improper lists), whereas (rnrs base)-map is more elegant manumanumanu: now, good night! wingo: hummmmmmm wingo: civodul: my release to-do is currently just mkstemp, and preparing for mkstemp! deprecation (not yet tho as not enough time) wingo: everything else done, except any mingw things that spk121 would like to land civodul: wingo: ah great! civodul: i'd need to look at that -Wunbound-variable thing now wingo: what is that? :) wingo: anyway i look forward to the patch ;) civodul: it's about false positives civodul: new in 3.0.5 daviid: wingo: what about bug#43025? civodul: re -Wunbound-variable: https://issues.guix.gnu.org/47031 avp_: Hello Guilers! logs.guix.gnu.org/guile gives "Resource not found: http://127.0.0.1:3333/guile/search" when I try to perform a search. tohoyn: avp_: are you sure IP address 127.0.0.1 is correct? avp_: I'm using the search form located on the top of the page http://logs.guix.gnu.org/guile/ tohoyn: avp: could you check if URL http://logs.guix.gnu.org/guile/search?query=nick%3Atohoyn works for you? rekado: avp_: the problem is a wrong redirect rekado: you will see that it redirects you to http://logs.guix.gnu.org/guile/guile/search?query=foo instead of http://logs.guix.gnu.org/guile/search?query=foo rekado: remove the extra /guile and it should be fine avp_: tohoyn: This URL works. rekado: I’ve been meaning to fix this, but there’s always something else to be done… rekado: maybe today wingo: moo manumanumanu: apteryx: if that approach becomes a bottleneck, you could try transducers. They merge (remove (map (filter ...))) into one pass over the list, which - if the list is large - might become expensive. (list-transduce (compose (tremove string-null?) (tmap string-trim-both) (tfilter (node-typeof? '*text*))) rcons (cdr node)). It is included in guile-3 as (srfi srfi-171). manumanumanu: the overhead is pretty small, and even on "cheap" lists of things like chars or integers it is usually beneficeal to use transducers if you have more than one step, ie: replacing (map ... (filter ....)) means faster code. Replacing a single (map ...) is not. manumanumanu: apteryx: the caveat is that some transducers have hidden mutable state where the list tools do not, making them not multi-shot-continuation safe. Instantiating a transducer(like: ((tmap 1+) rcons) and using it over several threads is also not a good idea. As long if you are not using multi-shot continuations, or using the same transducer simultaneously over different threads you are fine, though. leoprikler: ewww, hidden mutable state wingo: eww, multi-shot continuations ;-) lloda: hehe *: wingo finally fixed blog spam issue civodul: wingo: hey! when were you planning to release? *: civodul adds a "guile-next" package to Guix wingo: civodul: hi :) dunno, maybe two weeks? have to finalize the gmp issue, then make a sweep of patches on guile-devel, and possibly pull in mingw stuff from spk121, notably regarding dlopen wingo: wdyt? civodul: wingo: ah cool, SGTM! civodul: i'll try to do some testing and bug reporting/fixing by then wingo: great :) spk121: hey wingo, civodul: on the topic of mingw, the two other things in that mingw branch are having read-line handle CRLF and a hack to file tree walker for when inodes are useless. MinGW's a long way from feature parity, but, it would at least be capable of running the test suit w/o hanging or crashing spk121: (32-bit, non-JIT) wingo: sounds like things that would be good to push to master! ArneBab: wingo: do we already have a note from lilypond folks how the change affects their performance? wingo: ArneBab: do you refer to the reader? no we do not wingo: i don't know if they are on guile 3 tho ArneBab: there are some who tried it, shall I ask for testing? wingo: anyway i think it will be fine. we are within 1x of optimized C and there are some more optimizations to make ArneBab: wow, 1x! wingo: well. i mean to say if C runs at 15 MB/s we are within that order of magnitude wingo: currently like 10 MB/s or so Aurora_v_kosmose: Ah, not bad. wingo: but will get better over time civodul: really nice, and probably a pretty good "C vs. JITted Guile" kind of benchmark wingo: civodul: dunno, i think we might take different tactics to get it faster (get-chars-while, drop-chars-while) wingo: like there are some aspects related to the optimizer and code generation, and some aspects related to being able to think of different solutions rlb: wingo: yeah, seems plausible - I might try to follow along a bit (i.e. rewrite along similar lines) the edn reader I wrote. And I'm almost certainly going to rework it away from the string readers given your other observations. rlb: (for now the clj reader is still just C -- worry about that later) manumanumanu: leoprikler: I don't think the srfi-171 spec disallows visible mutable state. I experimented with it when writing the reference implementation (before standardisation), and visible mutable state was too slow in many implementations. Visible immutable state is of course also doable, but without something like C++ move semantics it becomes hideously expensive manumanumanu: The Atria transducers for c++ are _amazing_ though. manumanumanu: immutable, visible state without giving up much (any?) performance. Juanpe used to hang out here iirc. He also wrote Immer, the c++ persistent vector library which has a super efficient rrb-tree implementation. manumanumanu: which I am sadly too stupid to implement in guile :( civodul: manumanumanu: yeah Immer is quite impressive and it may be a case where we can't achieve the same performance without the static typing and templating machinery wingo: hmm wingo: civodul: apparently there has been some activity on the 1.8 branch :) civodul: :-/ civodul: i suppose they have upload rights, too civodul: i'm not happy with this situation wingo: an attempted revival of the 1.8 branch would be a bad thing for guile, that's for sure wingo: not sure how much i care about it if it's just those patches, tho. perhaps mail ttn ? wingo: otherwise we can revert & revoke commit rights if you feel strongly enough about it; certainly after such a long hiatus, an email would be the polite thing civodul: wingo: did you see ttn's messages on guile-user a month ago or so? civodul: an email sounds like the right first step, yes wingo: no i didn't see that civodul: lemme see civodul: https://lists.gnu.org/archive/html/guile-user/2021-01/msg00026.html wingo: ag wingo: ah civodul: short continuation: https://lists.gnu.org/archive/html/guile-user/2021-02/msg00000.html wingo: humm wingo: wdyt should happen here? civodul: well, i understand LilyPond/TeXmacs might want to update 1.8 for their own use wingo: does lilypond still default to guile 1.8 ? civodul: but... i feel this is no longer "Guile", or not the same Guile civodul: yeah wingo: funny that when we were on 1.8, ttn was on 1.4 :) civodul: right! civodul: it's Conway's law: these tools use 1.8 for technical reasons, but probably also for a lack of will to cooperate civodul: or for lack of a shared vision civodul: anyway, for now an email to ttn sounds right, so we at least know where we're going civodul: fancy emailing them? :-) wingo: i think that a new 1.8 release would be bad for the guile project. i am unhappy that ttn is pushing on the release branch without getting approval from you or me civodul: yeah civodul: they didn't even answer my message wingo: let's assume ttn would like to work on a guile 1.8 fork. where should that happen? wingo: in some other repo, or in a branch in guile git? civodul: (ttn metioned having commit rights: https://lists.gnu.org/archive/html/guile-user/2021-01/msg00040.html) civodul: hmm civodul: i think it's okay to use that branch on the Savannah repo civodul: but i wouldn't want to see a 1.8 release at ftp.gnu.org & co. civodul: so it would probably make more sense to have a separate source code hosting solution wingo: you think it's ok to use the official release branch? i wonder civodul: well yeah, it'd be more consistent to do everything elsewhere, i guess wingo: right, like there are api/abi guarantees to ensure, etc wingo: i don't think it's a branch for development or maintenance any more. only hotfixes if necessary and i don't think it is necessary civodul: yeah wingo: if ttn wants to open a new dev cycle, it doesn't really fit in guile plans, so i think hosting elsewhere is the right thing civodul: right civodul: i think it comes down to that civodul: it's a project, not just a code hosting site, after all :-) wingo: and i think any release they might make would not be official. i don't see a need for one atm wingo: so it would not be gnu guile 1.8.x. fine of course to be nongnu guile 1.8.x wingo: & maybe some users switch to nongnu guile 1.8.x if that's useful to them. no problem there civodul: yes, like in the ttn Guile 1.4 days civodul: spk121: re Potluck, if you want you can publish the blog post on the Guile web site, by dropping a Markdown file at https://git.savannah.gnu.org/cgit/guile/guile-web.git/tree/posts civodul: no obligation but it'd be nice to promote it that way civodul: (and thanks again for organizing it!) wingo: sent civodul: wingo: thank you! manumanumanu: regarding texmacs, I helped someone port an old guile1.8 file to 3.0. The complete lack of phases was a fantastic mindeff: a macro expansion refering to a function that would have only been available at compile-time in anything post-2.0. "So... you ... expect this to work????" wingo: yeah it was kinda cool :) wingo: different mental model wingo: "you can unquote function values into the macro output????" wingo: but having the reader be on the hotpath for program startup?? ughhhh manumanumanu: Hey, who is it that has the good implementation of srfi-64 that actually follows the spec? manumanumanu: I am tired of having to re-implement test-runner-simple every time :( wingo: doesn't guile follow the spec ?? manumanumanu: nope. manumanumanu: the reference implementation hasn't done ever iirc manumanumanu: test-runner-simple should not write a file. yet it does. manumanumanu: in every scheme. Someone fixed it, but I can't remember who manumanumanu: Taylan! https://notabug.org/taylanub/scheme-srfi manumanumanu: wingo: (test-runner-simple) is the default, and is only specified to write to stdout. It is not forbidden to write files, though manumanumanu: The spec says the default is implementation defined, but that (test-runner-simple) should write to stdout. manumanumanu: (test-runner-simple) writes files. In every implementation I have used, because everyone uses the reference implementation. manumanumanu: Look at the time! good night! wingo: haha yeah me too soon :) wingo: spk121: civodul: fixed the mini-gmp exposed to users issue i think wingo: testing welcome dsmith-work: wingo: Nope. I'm seeing this error: dsmith-work: CC libguile_3.0_la-options.lo dsmith-work: ../../guile/libguile/numbers.c:176:40: error: 'SCM_ENABLE_MINI_GMP' undeclared here (not in a function); did you mean 'SCM_SNARF_INIT'? dsmith-work: int scm_install_gmp_memory_functions = SCM_ENABLE_MINI_GMP; dsmith-work: ^~~~~~~~~~~~~~~~~~~ dsmith-work: SCM_SNARF_INIT dsmith-work: I'm running configure out-of-tree dsmith-work: (if that matters) dsmith-work: v3.0.5-106-g5f1778781 muffindrake: Looks like I'll have to look into that, then. And yes, guile is obviously already installed apteryx: a new evening; new SXML adventures! I'm trying to convert nodes from one form to another, using the following: https://paste.debian.net/?pnew=1188193, but it seems to add new nodes rather to replace them. Any clues? apteryx: I guess map is what I want rather than xpath here; xpath seems to be designed to seldom select content, not modify it leoprikler: apteryx: I think when it comes to active rewriting, you'd probably prefer sxml-match/tree-fold rekado: apteryx: I’d use pre-post-order rekado: we even have an example in (gnu packages java) tohoyn: sneek: botsnack sneek: :) pkill9: does anyone know why guile is saying string-match is an unbound variable? pkill9: if i run guile repl, i can run it without importing anything pkill9: ah it's in ice-9 regex according to help command pkill9: i must've put an import somewhere or something leoprikler: IIRC the REPL comes with more bells and whistles than you'd typically have inside code. leoprikler: (which is good – you want to be explicit when you're writing such stuff to file) apteryx: rekado: oh, that pre-post-order looks interesting, thanks! apteryx: I'm now trying to match nodes which are both paragraphs ('p') and *text* at the same time; or is this always the case by definition? apteryx: the idea is to skip the (p 1) that doesn't contains text as can be found on this page: https://pkg.go.dev/github.com/google/go-cmp rekado: nodes cannot be *text* and p at the same time. rekado: *text* is the text content of a node; it’s not a tag. rekado: the *text* of
this is text
is the string “this is text”. rekado: you can, however drill deeper and get at the *text* inside a “p” and then jump out and return the matching paragraph. rekado: you can’t use a short-hand like (p 1) then, though rekado: you could use a filter procedure to check on the contents of the node wingo: moooo wingo: spk121: what in the world could #b#b0 mean ? :) wingo: i am thinking it is a bug in the old reader, yes? wingo: spk121: regardinng #\11# that's quite curious wingo: weird that # is a synonym for 0 somehow??? wingo: seems to be in r5rs syntax but not r6rs wingo: weird weinholt: i believe "#" in place of a digit was used in inexact numbers to show that there's no significant digit there wingo: yeah and could only be in trailing digits wingo: i suppose the r6rs way is "we're using ieee floats anyway" sh4rm4^bnc: wingo, i'm interested in lightening, especially how it differs from lightning, but documentation is sparse. especially it's been hard to figure out what actually changed between lightning 1.x and 2.x weinholt: i think r7rs removed it as well wingo: tx for info weinholt wingo: sh4rm4^bnc: briefly, afaiu -- lightning 1 was a very direct codegen library. you write jit_movi (JIT_R0, 42), it emits mov rax, $42 wingo: lightning 2 didn't do that. instead you write jit_movi, that adds a node to a graph wingo: then when you finish, lightning runs optimizations over that graph, including a kind of register allocation, and then emits code sh4rm4^bnc: how good is that optimization ? wingo: lightening (what a confusing name) goes back to a more lightning 1 kind of approach. wingo: not sure tbh. i don't think it's very extensive. but for guile it conflicted with how we wanted to use a codegen library sh4rm4^bnc: ok, and are there any other differences ? like same api? (also, why does e.g. the mips backend need work to become compatible) wingo: similar but not same api. see lightening.h for the api wingo: lightening's anyway wingo: need to update the manual, but not a high priority atm sh4rm4^bnc: my main interest is in using light(e)ning as a universal backend for a lightweight C compiler-i.e. write backend once, let lightning do the rest wingo: takes work to add more backends. probably 40-60h or so. lightning 2 has lots of backends, if it suits your purposes and that's your most important factor, use it over lightenig wingo: *lightening wingo: otherwise a port of a backend from lightning to lightening takes time sh4rm4^bnc: i guess one could also just add an option to turn optimization off to lightning wingo: sooooo wingo: spk121: civodul: anybody else: how to describe the motivation for mini-gmp? wingo: "more convenient in some circumstances" ? wingo: allows Guile GMP uses to use a different allocator than other GMP users? rlb: I mean it's really "because we have to"? RhodiumToad: avoids breaking GMP for the host environment rlb: (or perhaps I misunderstand) rlb: i.e. we're designed to be embedded, so we can't mess with gmp's allocation globally RhodiumToad: can't /safely/ mess with gmp's allocation globally rlb: heh, ok, well... wingo: hummmmmm wingo: if it's a must, then shouldn't we default to having it on ? RhodiumToad: probably, yes? wingo: i still want to rewrite guile's bignums to use the mpn API rather than mpz rlb: I think it might always need to be on? Unless you're never going to link something else aginst guile. wingo: which would allow us to use external GMP again rlb: (something that might load anything else that uses gmp I mean) manumanumanu: Ahoy! sneek: manumanumanu, you have 1 message! sneek: manumanumanu, leoprikler says: yeah, there are a lot of instances, when Guile's supposedly immutable things are actually mutable. I sadly can't recall a way of debugging this. wingo: i fixed many of these instances btw, could be that in 3.0 i messed something up tho rlb: And one of the more significant concerns afaict is whether or not this causes ABI breakage that means we'll need to bump the soname, and affect what kind of release we can put it in. wingo: well rlb: i.e. is it ok for a Z release, etc. wingo: a mini-gmp option is always possible if off by default wingo: but you are wondering for debian i guess wingo: whether it's possible to ship a 3.0.6 with mini-gmp rlb: it's not a fix if you can't use it, and debian, for example, can never change that option if it breaks the abi (during a stable series) wingo: and does that break ABI relative to 3.0.5 rlb: but I guess we might just have to leave things broken for the lifetime of the release... manumanumanu: wingo: was that a reply to me and leoprikler's conversation? If so, I was replying to a question on reddit on (set-car! '(0) (list 1 2 3)) actually producing a (weird) result and not erroring rlb: not sure, first I'd just like to know what the constraints are, i.e. does it actually break the abi, etc. manumanumanu: I went in and said "oh no, that is a literal list. it is an error". It turns out guile did not raise an error wingo: so what is the argument that it breaks ABI? would a user be able to link to Guile and then use GMP without explicitly linking to GMP, is that the issue? wingo: manumanumanu: i think 2.2 raised an error in that case, and that i messed up during the switch to 3.0 wingo: so, is a bug manumanumanu: except when calling through C (assq-set!) manumanumanu: I will write a bug report wingo: great manumanumanu: and maybe try some older builds and see if it works there rlb: I think it may depend on what kind of "breakage" it is, and what fixing it entails. i.e. a bunch of stuff in debian (as an example) has been built against the current arrangement, and if a new 3.0 were to come out that say changed the size of a function argument, then we couldn't make that change because as soon as the new version was uploaded, everything else would of course start crashing until it was recompiled and distributed. leoprikler: w.r.t. light(e?)ning, would there be a way to make the switch from the guile fork to lightning 2.x (perhaps disabling some optimizations for better throughput or whatever)? wingo: rlb: we certainly do not change the size of a function argument rlb: Oh, sure. I'm just describing a clear case where it'd be a big problem, and the question is, what does this case look like exactly... spk121: wingo: #b#b0 and others in that family are a recursion bug in the old reader. The 2nd #b0 is processed to mean zero, and then simplifies to just #b0, which simplifies to 0 *: rlb is remembering the difficult time when we broke the threading abi more like that back in the 1.6 era? Was awkward... leoprikler: I think it's probably going to be a mismatch in symbol tables. rlb: (accidentally did iirc) wingo: leoprikler: i don't see the way to do that, fwiw. i started with lightning 2 but ran into a lot of bugs rlb: (I also wonder if we might have any additional flexibility wrt versioned/named symbols if that's common enough...) rlb: (and if we need it) wingo: i did not have the feeling that lightning 2 could be a good fit for guile's needs wingo: hummmmmmmmmmmmm wingo: ok so now i see that with the mini-gmp work, we expose mini-gmp.h to users wingo: i think that is an error wingo: yeah. ok that's big wingo: will see if i can change to include it only when BUILDING_LIBGUILE or so rlb: In any case, I'm just speculating -- would need to know exactly what the differences are, i.e. do we expose gmp data structures, and if so, are mini-gmp's an exact match, and can we guarantee that throughout 3.0, etc. spk121: wingo: doh! didn't think about problem w/ exposing header wingo: yeah good thing we have rlb here to ask the good questions :) wingo: rlb: we expose mpz and mpq data structures via numbers.h wingo: mini-gmp's data structures are an exact match spk121: perhaps we should remove gmp-using api completely w/ mini-gmp in use wingo: but, i think that if we build with mini-gmp.h, perhaps we should not export the MPZ / MPQ functions wingo: yeah wingo: what you said :) rlb: Hmm, can we remove functions in a Z? rlb: (public functions -- I'd guess not?) wingo: if you explicitly enable a nonstandard config option -- yeah sure rlb: oh, ook rlb: s/ook/ok/ wingo: dunno, maybe we could keep those functions... tricky rlb: also have to think about what happens if libgmp changes and we don't. wingo: like if they would effectively do mpz_copy() or whatever on their arguments, then we would be good rlb: i.e. wrt the data structures rlb: during 3.0 spk121: you could make the return (void *) and push struct-matching responsibility to the user spk121: not ideal, of course wingo: i really doubt gmp changing mpz_t / mpq_t wingo: they have a lot of users, it would be a mess rlb: since we'll be in a situation where we're producing gmp datastructures, and so will whatever libgmp the app is linked against. wingo: and those are simple data structures rlb: sure, but they could go to libgmp N+1 during 3.0 and the app could rebuild against the newer release of gmp rlb: so now it has two sources of incompatible gmp_foo rlb: "two incompatible sources" rlb: or maybe that wouldn't compile (still leaves runtime dynamic linkage I guess, unless we have ersioned symbols?) rlb: Anyway, not sure what the questions are yet, just suspect there are some :) wingo: so concretely the question is about mpz_t and mpq_t. with mini-gmp, these data structures have the same size as they did but may have a guile-specific allocator. it would not be safe to call mpz_clear on an mpz value that you got from Guile. spk121: OK. Maybe the thing is that w/ minigmp enabled, we define our own scm_mpz_t which is identical to the included version mini-gmp, and if stuct changes in future, we can rev or rename our scm_mpz_t et al spk121: only for external API wingo: let us discard the possibility for now of a change in upstream GMP mpz_t size rlb: we can't change those without changing our soname? rlb: i.e. we'll change any code compiled against our changed spec, so our abi changed rlb: i.e. we couldn't be 3.0.x anymore? wingo: i think what spk121 was getting at was a different name for a type but which would have the same layout wingo: so API would change but ABI not. not sure if it solves the problem but soname version would not be the problem afaiu rlb: What I'm getting at (if I'm thinking straight) is that we can't change to track upstream changes without changing our own soname? rlb: wrt gmp upstream (if that's what's being contemplated) wingo: honestly rlb i would really discard the idea of gmp changing their struct sizes for mpz or mpq rlb: we *could* if we made minigmp a separately versioned shared lib? ArneBab: manumanumanu: that sounds great! You can just truncate the csv wingo: what i want to avoid is a user calling mpz_clear on a value produced by Guile. rlb: basically all I'm thinking is that this may put us at risk wrt potential upstream soname changes, but that might be a risk we're willing to take through the lifetime of 3.0 rlb: s/thinking/wondering/ wingo: which to me says, if mini-gmp is enabled, then we should not export scm_to_mpz / scm_from_mpz manumanumanu: ArneBab: cool! I really do think I can cut the time in half without much fuss. wingo: which is an ABI change. so --enable-mini-gmp should be off by default. spk121: wingo: +1 on not exporting *: rlb wonders what we're going to do (and will be allowed to do) wrt debian bullseye... wingo: if debian thinks it's more important to enable mini-gmp than to keep ABI, it will have to bump library version, because it will be changing the build config in an incompatible way rlb: we can't change the soname ourselves, or at least that's a huge mess iirc. rlb: the core problem right now of course is that gnutls is broken ArneBab: manumanumanu: that sounds awesome! spk121: Couldn't you bump lib version while still calling it 3.0.x? rlb: but to fix it, it's going to be a hard sell wrt the release managers that we need to upload a new guile and rebuild *everything*, particularly if it'll also break anything people have built themselves against guile testing during the past year or two. ArneBab: manumanumanu: thank you! spk121: do there exist any programs that use Guile's mpz api in debian? rlb: spk121: that might be fine as long as we do it upstream, more difficult iirc otherwise, but it might also mean I'd have to rework the guile packaging, since we only have guile-3.0-libs. rlb: no idea. rlb: And I'm not sure how you'd really do it sensibly, i.e. if debian picks some new soname, now it's not compatible with *any* other distribution or build? rlb: and we'd have to pick one that was guaranteed not to be one that we're going to move to upstream eventually? rlb: Ideally perhaps, build options maybe shouldn't affect the abi, or that should be rare and clearly called out (plus or minus things like enabling support for extra functions, etc.). spk121: rlb: for ncurses, there are tons of build options that change the ABI, and ncurses is in debian rlb: I suppose as long as the build system picks the same defauts "everywhere it matters", then perhaps that's fine. But I think the general expectation is that a binary linked against ncurses 5 on debian should also work against the ncurses 5 on redhat... spk121: really? I wonder if that is actually true rlb: I thought that had historically been true, but maybe not. wingo: rlb: alternate fix for debian, lower risk: set scm_install_gmp_memory_functions to 0 wingo: keep using external GMP, but guile doesn't use libgc functions to allocate gmp memory wingo: problem solved rlb: I guess the main thing for us is just that ./configure have stable behavior on that front during a Y series... wingo: i mean, if ABI is the paramount thing rlb: Hmm, ok, what's the disadvantage to that? wingo: or maybe Guile should change to default that value to 0 if mini-gmp isn't enabled wingo: rlb: hard to say. broad strokes, Guile can be faster if it allocates mpz values with libgc. but are there external users that depend on not having to mpz_clear their memory? i think unlikely. but if so, they might have a memory leak, if this changes rlb: (Oh, and of course, this isn't really debian specific, we'll need to make sure that the other distributions know about the situation if we end up requiring accommodations.) wingo: spk121: summary proposal: if --enable-gmp, we don't expose scm_to_mpz etc. if not --enable-gmp, we keep same API / ABI but don't install custom allocators wingo: then people can choose their constraints as they see fit civodul: wingo: re mini-gmp, the two motivations can be: one less dependency, no interference with other GMP users (the alloc thing) spk121: wingo: sounds fair. And don't expose mini-gmp.h in libguile.h rlb: ...you mean external users that were *relying* our messing around with the allocators? civodul: and i agree we shouldn't expose mini-gmp.h wingo: civodul: wdyt about my summary proposal (last thing i said) wingo: rlb: yeah rlb: (And if so, would it even have been sensible or likely for them to be relying on that?) *: rlb wonders wingo: users do the darndest things :) rlb: Heh, true, but if we didn't document that we were doing that, and that people could/should take advantage of it, then I think I'm not too worried on that front either... wingo: s/--enable-gmp/--enable-mini-gmp/ civodul: wingo: yes, proposal sounds good to me! wingo: great wingo: followup question would be, i guess we default to --disable-mini-gmp wingo: i.e. require explicit --enable-mini-gmp civodul: yes civodul: so that by default things are like before wingo: great rlb: OK, so if we do that, then other than the corner case wrt leakage, we'd need a new debian version, and things might be a touch slower, but nothing else would break, and gnutls, et. al. should be fixed? rlb: If so, I'll have to talk to the release managers (and the sooner the better) -- not sure whether they'd accept all of 3.0.6, or if I'd need to try to backport the change. wingo: rlb: you can make this change already with a patch wingo: numbers.c:162, change 1 to 0 rlb: And do we know what the *actual* risk is wrt enabling mini-gmp, i.e. if I were to do that, then do we expect anything to break, other than the previously public mpz functions disappearing? rlb: Hmm, ahh, right. rlb: So maybe that's what we need to do for debian bullseye. rlb: for "right now" at least. wingo: probably your least-risky bet considering that 3.0.6 has things that should be fine but may introduce bugs (dlopen rewrite, reader rewrite) wingo: yeah spk121: Just out of curiosity, looking at the big code search sites, the only client using scm_to_mpz is Sorts Mill Tools and the Rust Guile bindings rlb: do we have any idea if the performance impact is more likely to be minor or major? wingo: ok i think i am evaporating for the evening -- tx all. spk121 if you feel like poking this tonight feel very free, otherwise i can fix tomorrow evening spk121: OK, g'night wingo: rlb: usually no impact. sometimes causes 80% slowdowns, when compiling specific large files wingo: ask civodul for more info rlb: ok, thanks civodul: rlb: re the Guile/GMP/Nettle/GnuTLS issue, i recommended in the Debian report that Debian built Guile with scm_install_gmp_memory_functions = 0 civodul: the only case where performance degrades is for bignum-heavy applications rlb: Will do. Thanks. civodul: such as when compiling large files as -O2 civodul: it's a use case that matters to Guix, but not so much for regular people :-) civodul: (actually Guix compiles most of its large files with the baseline compiler nowadays) rlb: Not sure exactly what our Y release policy requirements are, but is this the kind of thing we'd be allowed to change in 3.2? rlb: i.e. make mini-gmp the default civodul: yes, could be civodul: but really, the default doesn't matter that much IMO rlb: ...sounds like we'd be removing functions, but maybe that's fine for *our* Y releases (i.e. doesn't require an X) civodul: in the sense that we have a solution for Debian (& co.) and one for Guix apteryx: rekado: that's how I understood *text* too, but info '(guile)SXPath' has this procedure: 'node-typeof?', which can supposedly "tests if the node is text via the '*text*' symbol (criterion). rlb: Sure, though I'd guess if nothing else, if perf is better, we'd rather switch the default as soon as it's reasonable... rlb: (say 3.2 rather than 4.0, if that's acceptable) civodul: ah sure civodul: mini-GMP is supposed to be slower than GMP, for arithmetic operations civodul: it doesn't have all the fine-tuned asm civodul: but again, it's "good enough" for most applications rlb: and I suppose maybe we could eventually borrow some asm for common cases if we liked... civodul: hmm not sure it'd be reasonable :-) manumanumanu: Forking things like mini-gmp seems like a lot of not fun. rlb: yeah, I didn't really know what'd be involved -- might well be ill-advised spk121: aside from avoiding the gmp allocation problem, the use case for mini-gmp is a more portable build or a more embed-friendly build. The real GMP is better computationally, and will likely always be so rlb: Out of curiosity, do we happen to know if replacing the allocator increases performance because libgc's approach is faster than malloc/free here, or...? apteryx: rekado: I ended up using the filter approach, as you had hinted about: https://paste.debian.net/1188344/. Seems to work OK! Thanks again :-). roptat: I spent the week-end improving my gitile project (https://git.lepiller.eu/gitile), that displays git repositories, I'm pretty happy with what I did :) roptat: added support for showing diffs, for showing readmes and markdown (https://git.lepiller.eu/gitile/commit/d665efa786cc6f0ece0c29fe98b94300075a4d26 for instance) spk121: here's fun bug with the new reader. What to you think #\11# should be? Or #\x11# ? tohoyn: how shall the Potluck proceed? spk121: tohoyn: the plan is that I'll send out an e-mail to guile-user calling it closed. Then I'll write a series of blog posts on planet.gnu.org about the entrants. tohoyn: spk121: ok spk121: and the best one wins $1,000,000 dollars!! spk121: (sadly, not true) apteryx: rekado_: would you know if there's something already available to convert HTML to Texinfo? apteryx: htmlprag's html->sxml is nice, but when extracting the *text*, it looses all the hyperlinks, formatting, etc. pinoaffe: apteryx: as far as I'm aware there's nothing ready-made in guile itself, shelling out to pandoc might be the most reliable way pinoaffe: if you want to, you could probably do some tree matching/tree transformation on the sxml to generate skribilo-markup-sexprs, which you could convert to Texinfo, but it'd be up to you to write a converter that preserves the markup you're interested in apteryx: Thanks for the pointers, pinoaffe! It seems if I have to do some manual transformation to skribilo markup, I might as well do the sxml->texi for my simple case. mdevos: In e.g., scm_tcgetpgrp (and plenty of other functions), there doesn't seem to be any code preventing the port from being garbage-collected, leading to the file descriptor being closed before the tcgetpgrp. Is there an automagical "don't GC arguments to SCM_DEFINE procedures" or something, or is this an actual bug? mdevos: (This shouldn't be a real issue as long as one remembers to close the port eventually) leoprikler: mdevos: scm_remember_upto_here or how it's called mdevos: leoprikler: I'm sprinkling these around now (searching with "git grep -F _FDES" for appropriate places) leoprikler: other than that, if the SCM is still on the stack (definitely) or in a register (IIUC), it won't be garbage collected mbakke: I have a script that execl's another process and leaks its own file descriptor (the script name) into it. I'd like to set FD_CLOEXEC on the FD, but can't figure out how to access it. Ideas? mdevos: mbakke: fdopen perhaps? mdevos: leoprikler: I don't think there's any guarantee the compiler won't optimize out the "SCM port" variable right in between the "fd = ..." and if ((pgid = tcgetpgrp (fd)) == -1) STUFF. mdevos: so I'm guessing this is a bug? leoprikler: Yeah, in that case sprinkling some remembers might be a good idea. mdevos: leoprikler: ok, expect a patch on the mailing list sometimes soonish I hope! mbakke: mdevos: but I don't know which fd to open short of doing heuristics on /proc/self/fd mbakke: seems like I can reach it through 'port-for-each', but perhaps there is a shorthand for accessing the 'input script port'? :) mdevos: mbakke: perhaps the "another process" can be modified to allow an --input-script-fd=the-file-descriptor argument? spk121: mbakke: (port->fdes (current-input-port)) perhaps. but only if your current input port is a file port mdevos: The script can use "fileno" to figure out the value of "the-file-descriptor" to pass mdevos: mbakke: for clarification: do you want to leak the file descriptor, or do you want to *not* leak it? mbakke: the port I'm trying to FD_CLOEXEC is the "script filename", i.e. /bin/guile-execl-wrapper, typically FD 7 or so. The execl'd process should only inherit FD's 0-2. rlb: Is it the case that all unicode normalizations preserve the character count? mbakke: spk121, mdevos: here is a reduced version of the script: https://paste.debian.net/1188140/ RhodiumToad: rlb: no? mbakke: it essentially pretends to be bash unless some conditions are met, so it's important to not leak file descriptors to the actual shell. RhodiumToad: rlb: though it may depend on what you think a "character" is mbakke: I'm using it as my login shell (!!). It increases the startup time of "bash" 3x, but I'm fine with that as long as I don't have to fiddle with bashrc :P rlb: I mean a the unicode "character count", or more importantly, whatever we call a character, not the unit count. rlb: i.e. (string-length x) ngz: b ngz: oops RhodiumToad: rlb: then no, because the whole point of the different normalizations is to control whether certain sequences are represented in precomposed form (single codepoints) or decomposed (multiple codepoints) rlb: Hmm, I guess I probably "knew that", just wasn't thinking about it carefully enough, i.e. that say a decomposed umlaut is in fact two code points... Thanks. rlb: (Hmm, and more specifically, can normalization ever change the ascii set...) RhodiumToad: change in what way? RhodiumToad: decomposition can produce new codepoints in the ascii range, and composition can remove ascii codepoints rlb: any way? Just thinking about potential optimizations there, i.e. if you pass an ascii only string to u8_normalize() can there be changes? RhodiumToad: as far as I know, no rlb: That's what I was guessing too... RhodiumToad: checking the unicode data tables, all of 7-bit ascii (0x00-0x7f) has Yes for all the NF*_QC properties RhodiumToad: which means any 7-bit ascii string is automatically in all 4 of NFC, NFD, NFKC, NFKD RhodiumToad: note, many codepoints 0xA0-0xFF (the latin1 range) are not in NFD/NFKD rlb: Thanks, and right, I'd expected that wouldn't be true for > 127. mbakke: comparing (port-filename) with (car (program-arguments)) within port-for-each and setting FD_CLOEXEC on those does the job for now. I wonder if Guile itself can/should set FD_CLOEXEC on the "script port". *: rlb wonders where functions like mem_iconveh are documented. mdevos: mbakke: https://paste.debian.net/1188150/ mdevos: perhaps use current-load-port sh4rm4^bnc: wingo, i'm interested in lightening, especially how it differs from lightning, but documentation is sparse. especially it's been hard to figure out what actually changed between lightning 1.x and 2.x manumanumanu: ahoy! RhodiumToad: good evening manumanumanu: RhodiumToad: are you doing anything exciting lately? RhodiumToad: not especially mdevos: How do guile hackers setup Emacs for hacking on Guile's C code? mdevos: (Do I configure emacs to insert tabs, or spaces, or ....) civodul: mdevos: spaces only :-) civodul: as in: (setq indent-tabs-mode nil) civodul: ah well, that's for Scheme civodul: for C, nothing special i think? mdevos: The C code seems inconsistent in space vs tabs civodul: just GNU formatting style civodul: yeah, possible adhoc: so when you hit the Tab key to indent it only uses spaces to do so? mdevos: adhoc: when the preceding code uses spaces, then yes civodul: for C i usually do indent-tabs-mode t, meaning that Emacs chooses tabs or spaces adhoc: mdevos: thanks, I declared emacs dot file bankruptcy about a year ago and now slowing putting back useful snippets... mdevos: it seems like Emacs always inserts spaces for me. mdevos: whatever, I'll just send my patch as-is manumanumanu: Didn't guile forbid mutation of literal pairs? manumanumanu: There is a discussion on reddit, and I went in and pointed with my whole hand, but trying things at the REPL makes me feel like a fool. rekado: manumanumanu: this fails as expected: (define a '((moo . mean)))(assq-set! a 'moo 'oom) rekado: the error is: In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): (moo . mean) manumanumanu: (define a '(1 2 3)) (set-cdr! a 'bleh) works for me. manumanumanu: is that supposed to work? manumanumanu: rekado: I am feeling lost in an evil universe. What is the difference? *: rekado does not know lloda: sneek: later tell mdevos one thing I do when editing Guile code is disable trailing whitespace removal. Unfortunately Guile code has a lot of that and if you have autoremoval on, the diffs will be very dirty. sneek: Will do. manumanumanu: rekado: something odd is going on: (define a '((1 . 2))) (set-cdr! (car a) 22) => works fine manumanumanu: I am too confused now. Good night. leoprikler: sneek later tell manumanumanu yeah, there are a lot of instances, when Guile's supposedly immutable things are actually mutable. I sadly can't recall a way of debugging this. sneek: Okay. muffindrake: Hiya, how does one actually use the packages installed with guix in a program? I'm trying to use the chickadee module, but I'm kinda stuck at this step, since it's not found apparently. leoprikler: For chickadee, you need to install guile as well. I personally prefer to use environments, either ad-hoc or defined by a project's guix.scm. rlb: wingo: perhaps for now, might be better to just change my code to collect a list of string fragments and then join them at the end (reverse!ing if necessary). Guessing that might be reasonably competitive... rlb: i.e. no reason I actually need a string port... rlb: (basically I think a chunkier version of what you described if that was just operating on chars) apteryx: does guile has a debbugs tracker for patches? apteryx: have* apteryx: seems no apteryx: daviid: I've sent the guile-lib patches to guile-devel; if they don't show up feel free to ping me apteryx: otherwise there's an exact copy here: https://notabug.org/apteryx/guile-lib daviid: apteryx: ok tx- i'll look asap leoprikler: wingo, civodul: w.r.t. Guile 3.0.6, would it be possible to include my patch to https://bugs.gnu.org/45131? wingo: leoprikler: sure. will scrape patches from guile-devel between 1 dec and now wingo: will let you know when i am done so you can check leoprikler: thanks civodul: hey Guilers! wingo: moin :) lloda: would it break anything to accept '#0datum' or '#0 datum' for #0(datum) in the reader? lloda: well I guess it would break '#0(datum)' :-\ lloda: other than that wingo: lloda: there are a number of weird productions that guile accepts that would be nice to "fix" -- but ideally 3.0.6 goes out the door with the same quirks as 3.0.5 wingo: just so we can make sure not to make too many changes at once, and can fix up accidental incompatibilities (which would be bugs) lloda: right right spk121: wingo: my updated list of nits from fuzzing the new vs old reader https://paste.debian.net/1187964 chrislck: wingo: wouldn't you want to issue-deprecation-warning these quirks? wingo: chrislck: eventually yeah, not in 3.0.6 tho wingo: spk121: thanks!!! lloda: those (quote #) are funny chrislck: I'd have thought someone who codes using quirks is pointing a gun at their feet pkill9: is there a snippet or something for guile-commonmark that creates tables from markdown? leoprikler: chrislck: although they certainly do, you don't want to pull the trigger for them without warning them first chrislck: leoprikler: i'm not saying remove support, just point the trigger via issue-deprecation-warning chrislck: It help a lot to us e.g. modules changes, removal of _ use. dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work, happy Friday! *: dsmith-work does the Friday dance soda__hobart: does anyone have any suggestions for debugging a "symbol not found" error when using dynamic-link? soda__hobart: the shared library object loads, but then i cannot access any of the functions with dynamic-call or dynamic-func soda__hobart: i did LD_DEBUG=symbols and i saw this: "symbol=libguile_msg_muncher_LTX_init_muncher_guile; lookup in file=./libguile_msg_muncher.so [0]" soda__hobart: soda__hobart: i haven't been able to figure out what LTX is, or if it is relevant soda__hobart: wait, i think the names are still getting mangled by C++. maybe i need to use extern lloda: you def need to use extern "C" for any exports that will be accessed by Guile lloda: else you have no control of what the export name is soda__hobart: yeah, all the names are _Z19scm_from_P12... etc. sounds like payton manning hiking the football soda__hobart: if i'm only trying to use one function, can i get by with only putting extern "C" around that one definition? lloda: should be enough soda__hobart: yup, it worked, haha, sorry for the dumb question soda__hobart: or easily checkable question, i guess lloda: nw lloda: if you have a module init function in your library then you can define the exports there and they don't need to be extern "C" lloda: that's how i did things before there was an ffi soda__hobart: oh? i need to read that part of the documentation then lloda: i suppose the ffi way is easier now, plus it makes the function available to anyone and not just Guile soda__hobart: i will try to write something up about this and other stuff i've learned about mixing guile and cpp and put it on the web or something soda__hobart: ok, here is another question: is it bad to store a datagram socket in a closure? soda__hobart: like this: https://paste.debian.net/1188010/ soda__hobart: i guess i wouldn't be able to close the socket? *: civodul surprised to see srfi-1 'member' in gcprof RhodiumToad: the socket would be closed when the closure is gc'd, I assume RhodiumToad: which might of course be arbitrarily far in the future RhodiumToad: civodul: why is that surprising? civodul: RhodiumToad: because 'member' isn't supposed to allocate (at most one closure) civodul: i often find myself running statprof, then gcprof, then statprof #:count-calls? #t civodul: IWBN if there was a tool to aggregate all that info civodul: + Geiser support to navigate profiles civodul: and a pony, too *: sneek wants a pony rekado: I have this “language” specification that compiles JSON to Scheme. In the past I could do “guild compile my.json --from=my-language --to=scheme”, but now it prints a backtrace. rekado: the backtrace suggests that find-language-joint returns #false rekado: there are two problems here: 1) the language definition is a compiler to scheme, so this should work and 2) #false is just propagated until it causes an unrelated error (In procedure symbol->string: Wrong type argument in position 1 (expecting symbol): #f) leoprikler: Does the same happen if you do --to=bytecode? leoprikler: If not, it might be a differently flavoured #45131. rekado: no, with “--to=bytecode” it compiles the file correctly. rekado: I don’t know what a joiner is leoprikler: a joiner is a sequence of compilers between from and to. leoprikler: if there's a direct compilation from from to to, you don't need a joiner (that'd be at least one step removed) leoprikler: so applying my fix to #45131 *should* resolve that issue (please test it, so that we have something else than Tree-IL to base that information on) wingo: moo dsmith-work: Heya wingo. "it can record remembers the file name" Might want to adjust that in api-debug.texi wingo: tx for the tip, saw your pm :) will fix dsmith-work: wingo: Ah good. Sometimes those go unnoticed.. wingo: yeah tx for repeat wingo: wtf is #b#b0 ???? manumanumanu: Ahoy! manumanumanu: ArneBab: It would be nice to have some smaller data to work on with wispstate. Something that takes max 10 seconds. manumanumanu: can I just truncate the csv? manumanumanu: or will that give me invalid data? manumanumanu: ArneBab: If I take the algorithms you are using at face value, there is still quite a lot that can be done. manumanumanu: and moving to vectorlists would make vector-append amortized O(1) instead of o(n), which - since it is called a billion times. manumanumanu: and, if you migrated the whole thing to vector-lists you would get rid of those pesky vector->list manumanumanu: and, if anything you could probably use transducers to fuse most of those (append (map (remove ...)), and I do believe that the delete-duplicates in that is more efficient than the one built into guile (which does a full rest-transverse of the list) manumanumanu: anyway, good night! rlb: lloda, dsmith-work: looks like it's there in newer debs rlb: $ dlocate gmp.pc rlb: libgmp-dev:amd64: /usr/lib/x86_64-linux-gnu/pkgconfig/gmp.pc rlb: rlb: $ dpkg --status libgmp-dev | grep Version rlb: Version: 2:6.2.1+dfsg-1 rlb: spk121: ok, I pushed a patch for configure so it works like it did before without using the gmp.pc spk121: I verified it works on fedora 33 and ubuntu 20.04 so hopefully that works for debian spk121: this multi-platform autoconf stuff is always a pain spk121: I'm pretty embarrassed that I broke the main branch. If this was $dayjob pre-covid, I'd owe the team doughnuts rlb: mmm doughnuts... daviid: spk121: you should be proud, not embarrasted, you are doing so much for guile, 'all over the place' ... this lack of pkg-config for mini-gmp, really, we all would have 'falled in the trap', and you fixed it at the speed of light, so really, congratulation for all this work ... spk121: daviid: aww, thanks! dsmith: spk121: Hah! Another donut protcol. dsmith: spk121: So far, so good. got though all the C compiles. chrislck: +1 agree with daviid o/o/o/o/ spk121 dsmith: FAIL: srfi-105.test: curly-infix: (equal? (quote a) (quote ($nfx$ a . z))) dsmith: FAIL: srfi-105.test: curly-infix: (equal? (quote a) (quote ($nfx$ a . t))) dsmith: FAIL: srfi-105.test: curly-infix: (equal? (quote (a b . t)) (quote ($nfx$ a b . t))) dsmith: Expected? (at this time) rlb: wingo: vaguely wondered if strports string_port_write might be able to use (and get any potential benefit from) a realloc. wingo: dsmith: yeah expected atm wingo: rlb: i doubt it; overhead isn't in the strport write function wingo: rather it's in all the interactions in the port layers wingo: and general VM overhead (poor regalloc, calls are still a bit too expensive) wingo: rlb: while i am thinking about it -- i think there is room for significant speedup in readers if we get "closer" to the port buffers. like for whitespace, you should be able to do (port-drop-while p (lambda (ch) (case ch ...))), which should be able to dig down and operate directly on the port buffers wingo: similarly for strings, one should be able to do (port-take-while p pred), which would avoid consing intermediate chars, instead just leaving them in the port buffer wingo: some questions to resolve relative to concurrent reads but i think you see where i'm going -- in the end in many cases we could bottom out to (utf8->string buf start len) wingo: i.e. no intermediate character collection wingo: would have to add args to utf8->string of course ;) wingo: for iconv i think you would need to use the same strategy as we currently have tho wingo: obvs if we change string representation to utf8 then that means making a token will usually be just a number of predicate invocations, then malloc + memcpy chrislck: there's no sscanf in guile :-/ wingo: on the other hand, there are no sscanf vulnerabilities in guile ;-) chrislck: exactly :) lloda: thanks for the quick fix spk121 dsmith-work: Thursday Greetings, Guilers ArneBab: wingo: to test the reader with a few edgecases, you could run the wisp testsuite wingo: if there are any edge cases guile should care about, they should be in the guile test suite i think wingo: would you mind running the wisp test suite with guile from git ? ArneBab: can I get that directly from guix? ArneBab: is guile-next already guile from git? wingo: probably not the latest wingo: you check it out from git, and then to build: wingo: guix environment guile --ad-hoc autoconf automake texinfo gperf libtool gettext readline -- autoreconf -vif wingo: guix environment guile --ad-hoc autoconf automake texinfo gperf libtool gettext readline -- ./configure wingo: guix environment guile --ad-hoc autoconf automake texinfo gperf libtool gettext readline -- make -j40 civodul: we're missing guile-next, it'd be nice to have civodul: we could use --with-branch & co. ArneBab: thank you! ArneBab: Why don’t we have guile-next anymore? ArneBab: /home/arne/eigenes/Programme/guile/meta/guile --version → guile (GNU Guile) 3.0.5.92-bd93e ArneBab: Test suite passes ArneBab: wingo: how can I verify that this has the new reader? spk121: wingo: readers differ about what to do when reading expressions that are just one single-quote character or just one backtick character spk121: new reader is probably more correct. error instead of (quasiquote ) spk121: wingo: same for syntax and quasisyntax and unsyntax on lines by themselves spk121: also, there is this "#tR" apteryx: what can I use to discover the target a .go file was built for? the 'file' utility on a .go doesn't yield information about that apteryx: perhaps the architecture flag of the ELF? e.g., objdump file.go | grep architecture -> architecture: UNKNOWN!, flags 0x00000150: soda__hobart: blargh, i cannot figure out why i can't use dynamic-link with this shared library i created. it keeps telling me file not found, but i know that i used the correct absolute path. can you not dynamic-link with a shared lib that defines SCM procedures with scm_c_define_gsubr? soda__hobart: i compiled another file in my project as a shared lib, and dynamic-link worked just fine--the main difference i can see is that the lib that worked properly didn't include libguile spk121: soda__hobart: the infamous 'file not found' error is a famously unhelpful error message from libltdl. What it usually means is that a dependency of your shared library is not in the shared library path. if you re-run, add the environment variable LD_DEBUG=all, somewhere near the bottom of all that spew will be your answer spk121: likewise, you could try running with 'strace', e.g. strace guile myfile.scm soda__hobart: cool soda__hobart: libtldr ;) dsmith-work: Which should be much improved as of Guile 3.0.5 dsmith-work: (the file-not-found nonsense) soda__hobart: i'm using guile 3.0.5 dsmith-work: Hm. Maybe my version memory is mixed up. rlb: wingo: regarding utf8 - would you think that (at least non-ascii) strings might add a byte-count(s) in addition to the existing char count(s)? (that's one option I was toying with here -- adding a byte count to non-ascii substrings and maybe for the (sub)string offsets). soda__hobart: i'm pretty sure that cmake is responsible for messing everything up haha dsmith-work: There are changes in git to no use libltdl (libtldr, nice!) soda__hobart: cronenberg's existenz is on tv! fun movie to do some game programming to :) civodul: fun fact: if you do ",break current-error-port" or similar, you set a breakpoint on all the parameters, not just that one civodul: (which makes sense in hindsight, but that got me surprised) spk121: wingo: also try "#fa" soda__hobart: so i'm seeing this: "./libmuncherguileapi.so: error: symbol lookup error: undefined symbol: _ZTIN2sf6SocketE (fatal)" in LD_DEBUG=libs spk121: soda__hobart: that looks like a C++ mangled name to me. I could be that you've mixed C and C++ soda__hobart: ah, yup that is the case soda__hobart: it probably doesn't like the namespaces? soda__hobart: dang it, now i got a name collision haha soda__hobart: libguile does not love namespaces so much? nly: Does this output site-dir? 'pkg-config --cflags --libs guile-2.2' spk121: nly: pkg-config guile-2.2 --variable=sitedir spk121: fuzzing the reader has been fun. here's the rest of the nonsense I found https://paste.debian.net/1187900/ spk121: g'night nly: thanks manumanumanu: I remember that we were talking about applicable structs not too long ago. I lost my logs though. Where should I go digging to find out how to use it? lloda: anything you call from Guile should be extern "C" soda__hobart lloda: i have a library that uses applicable structs. e.g. https://github.com/lloda/guile-newra/blob/ee633920bd779463e43510ed07db17ce296eb85d/mod/newra/base.scm#L179 lloda: manumanumanu lloda: i asked wingo for how to use it so that's your best bet civodul: "newra" heheh :-) justin_smith: manumanumanu: oh wow, I was interested in applicable structs a while back, but I didn't even know that was the correct terminology (in clojure it would be defrecord implementing IFn) rlb: manumanumanu: it may be sufficient to add as a superclass and then (slot-set! 'procedure (lambda (x) ...)) in an initialize method. rlb: iirc manumanumanu: can I do it without goops? lloda: i don't use goops so yes manumanumanu: great manumanumanu: lloda: thanks a thousand times! that is exactly what I want. lloda: my pleasure! rlb: And of course it won't help right now for things like or (which a clojure dialect also needs -- i.e. no way currently to make existing types "applicable"). manumanumanu: you could do it like racket using an %app macro? manumanumanu: which would incur a dispatch cost, of course wingo: we already have a dispatch cost fwiw wingo: like applicable structs and applicable smobs aren't free wingo: the same mechanism could allow keywords to be applicable leoprikler: applicable lists :) manumanumanu: i didn't mean like that: I was telling RLB to use something akin to %app to sense whether something is in the current module and dispatch anything in there at runtime manumanumanu: since something like clojure-on-guile probably already has it's own reader it shouldn't be too much of a fuzz manumanumanu: together with syntax-local-binding it should be about 100 LOC max manumanumanu: not counting the hard stuff manumanumanu: :D :D manumanumanu: the more I think about it the less I want to implement it leoprikler: btw. since smobs have been deprecated for a while now, when will applicable smobs be replaced by applicable foreign objects? manumanumanu: how do you mean applicable foreign objects? wingo: leoprikler: truly, the galaxy brain take :) wingo: wrt applicable lists leoprikler: it's like Scheme within Scheme! lloda: fortran uses () for indexing arrays lloda: nobody thinks that's bad leoprikler: doesn't octave do that too? wingo: so smobs & foreign objects.... dunno. honestly i think both will coexist for another 10 years at least :p lloda: yeah octave is based on fortran lloda: well m****b but you know lloda: same thing lloda: it makes a lot of sense to think of certain data structures as functions leoprikler: All data structures are functions. leoprikler: Booleans and integers included. wingo: ah booleans, the best data structure manumanumanu: wingo: btw, the patch I submitted with an updated vector-map cuts about 10% from the quicksort.scm benchmark from ecraven. manumanumanu: and doing what some other schemes do and not check for cycles in (map ...) is a pretty good strategy over all :D :D wingo: manumanumanu: i will apply it! wingo: need to make a guile-devel sweep wingo: just finished with the reader stuff. only a couple more NEWS things to flesh out lloda: i still have to change all of my 20 year old code to use fobs instead of smobs dsmith-work: No more smobs! Oh no! I guess it must happen sooner or later. Probably *much* later. manumanumanu: just out of curiosity I am now running some benchmarks just to see how much better guile fares if I don't check for equal length lists or cycles. manumanumanu: not done yet though manumanumanu: I need to investigate further, but some speedups for sure - not surprising as none of the benchmarks make heavy use of map apteryx: ah, the memory explosion when attempting to run the test suite is caused by Guile bug https://bugs.gnu.org/39251 apteryx: the test suite of guile-lib* daviid: apteryx: the devel branch patches the autotool chain so md5.scm using -O0 apteryx: OK. Altertively we could use the work around in the Guix package, which is to define redefine f-add and f-ash as (define f-add (@ (guile) +)) and (define f-ash (@ (guile) ash)), respectively. daviid: apteryx: well, I 'merely' reproduced the patch offered by the guile-lib debian maintainer - I need to find soemtime to merge those in master and release apteryx: OK. By the way, where should I send patches for guile-lib to? daviid: which patch? daviid: apteryx: anyway, guile-devel apteryx: some commits I've made to allow more configuration of the htmlprag tokenizer apteryx: commit* apteryx: thanks daviid: ah, great - could you make sure to also include the patch rekado_ wrote for guix, related to this 'more then once' reported

related problem? apteryx: it addresses it daviid: apteryx: i mean coordinate your work with what is in guix, and/or recently proposed by rekado_ , fnstudio ... because i don't know enough ablut htmlprag and will have to 'blindingçly' apply what is offered ... daviid: ah ok, perfect, tx apteryx: yep, I'll make sure no more local hacks remain in Guix rather than upstream apteryx: do you want to be cc'd when I send the patches? daviid: apteryx: no need tx, guile-devel is fine - did you write those patches on top of the devel branch? daviid: apteryx: i don't think the 3 patches i pushed would change anything, but i'd rather apply yours to devel, check 'make distcheck' and then merge to master and release asap (not before march the 6th though, i am overloaded as it is ... apteryx: alright, will rebase my stuff on devel daviid: apteryx: if what you just wrote in #guix, Unbound variable: #{\#t}# is related to guile-lib, it is fixed on the devel branch apteryx: OK! Cool. apteryx: thanks apteryx: great eyes keeping track of many channels btw ;-) daviid: np, you may tx Göran Weinhold apteryx: Thank you, Göran :-) wingo: sneek: later tell davexunit that's like racket's "prefab" structs. would be nice to support that sneek: Got it. roelj: I'd like to define 'string-replace-substring' when it's not provided by Guile. Is there a way I can test this, and define the alternative if it isn't bound? This is similar to the #ifndef bits in C. roelj: So, I can use ‘defined?’ and then define it with ‘primitive-eval’? rekado: roelj: can you use cond-expand here? rekado: I think most uses of primitive-eval are icky and have better alternatives. roelj: Yeah I thought there must be a better way roelj: So, does cond-expand only work for the predefined Guile core features? roelj: I now have this: https://paste.debian.net/1187609/ roelj: But I'm not sure if that's the best way to do it either. rekado: do you need to check whether it’s defined at all? If you know when it was added you can cond-expand the definition only for older versions of Guile wingo: (unless (defined? 'foo) (define! foo ...)) wingo: but yeah you can unconditionally provide the definition apteryx: rekado: early preview for a parameterizable parent-constraints in guile-lib: https://notabug.org/apteryx/guile-lib lloda: ok to use srfi-71 in Guile source? civodul: lloda: i'd say yes lloda: alright wingo: civodul: consider (let ((p (open-input-string p))) (set-port-encoding! p "invalid")) -- currently this doesn't error wingo: as the iconv descriptors are only loaded when characters are decoded wingo: which is fine to me wingo: er i meant: wingo: civodul: consider (let ((p (open-input-string ""))) (set-port-encoding! p "invalid")) -- currently this doesn't error wingo: anyway wingo: now consider (let ((p (open-input-string ""))) (set-port-encoding! p "invalid") (read-char p)) wingo: there are no bytes available from P, thus EOF wingo: but, with the C code we make sure to check that the iconv descriptors can be opened, if we return EOF. for suspendable ports we fail to do this wingo: thinking about it, it seems to me that it would be better for C ports to adopt the suspendable-ports strategy wingo: wdyt? wingo: is a minor change but wanted to check lloda: on last master, is there more than one reader being used? lloda: e.g. lloda: > (call-with-input-string "#f64:3(1 2 3)" read) lloda: = #f64(1.0 2.0 3.0) lloda: vs lloda: > #f64:3(1 2 3) lloda: = #1f64@3(1.0 2.0 3.0) lloda: the latter is a bug wingo: lloda: yeah the compiler uses read-syntax and the scheme reader wingo: the "read" procedure is still the old one tho wingo: i have a patch to unify these so there is only one reader lloda: i see lloda: i'll try to fix the new one then wingo: hey thanks for the diligence on the reader fixes, & apologies for my bugs lloda: it's just self interest ;-) lloda: and rather it's I who should thank you for everything civodul: wingo: at first sight, i think not checking encoding in this case is fine civodul: not allocating the iconv descriptors is a win, too wingo: great civodul: thanks for asking, as always :-) wingo: currently i am seeing scheme reader + suspendable ports running at about 50% speed relative to C reader + C ports civodul: ok wingo: which to me sounds pretty reasonable. will improve as compiler improves of course civodul: what about Scheme read + C ports, which i guess is the most common case? civodul: (is it really something the compiler can help with?) wingo: last i checked, C reader with positions ran at about 15 MB/s, whereas Scheme reader runs at 10 MB/s or a little more wingo: with c ports civodul: ok wingo: C reader of course only uses C ports civodul: Scheme reader always has positions, right? wingo: no, you can run the scheme reader either way civodul: ah ok wingo: three ways actually wingo: without positions, with source-properties (i.e. `read'), and with syntax objects (read-syntax) civodul: ah neat wingo: the compiler uses read-syntax. perhaps we can retire the source properties thing in some future, but who knows wingo: sometimes people use them in their compilers civodul: yeah, source props are probably quite entrenched civodul: but it's good to have a way out! wingo: it would be sufficient to just make them used less :) civodul: advertising and recommending 'read-syntax' would be a first step civodul: BTW, are you planning for a 3.0.6 soonish? wingo: yeah. been working on docs, & as usual it makes me rethink code abit wingo: a bit wingo: yeah i think 3.0.6 can come whenever the reader is finished. probably should pull in spk121's dlopen work, and make a sweep of guile-devel civodul: great wingo: (reader is finished == documented and everything, makes sense, etc) wingo: will be a good release i think civodul: i'd use guile-on-minigmp on Guix core-updates civodul: definitely! civodul: there was also an issue with spuriouis unbound-variable warnings i wanted to look at civodul: haven't got around to it yet civodul: *spurious daviid: wingo: before 3.0.6, please try to look at and hopefully fix #43025 (where the first message has the snipset to reproduce the bug ...) - tx wingo: lloda: just pushed a patch replacing "read" in (guile) wingo: will make a followup to make C reader available as primitive-read or so wingo: and eventually will remove all reader options from primitive-read lloda: noted lloda: the mini-gmp patches broke my build lloda: /usr/bin/ld: ./.libs/libguile-3.0.so: undefined reference to `__gmpz_cmp' lloda: how does this work lloda: ok it seems --enable-mini-gmp=no lloda: seems not :-\ lloda: halp :-( spk121: lloda: darn, I didn't get that on my boxes. What are you running? lloda: debian buster lloda: seems gmp isn't in pkg-config --list-all lloda: checking for GMP... no lloda: I get this without any options: lloda: ../../src/guile3/configure: line 50004: =yes: command not found spk121: OK, I think I see it lloda: this is the config.log piece https://paste.debian.net/1187692/ spk121: well since it didn't find gmp, it should have fallen back to mini-gmp. So that logic is broken. I think I see the problem, let me test... spk121: lloda: on debian, is GMP's pkg config file named 'gmp'? lloda: no lloda: apparently it doesn't have a pkg-config file spk121: no even if you install a gmp-dev or libgmp-dev or something like that? lloda: those are installed ofc lloda: but they don't seem to include a pkg-config file lloda: the debian package is libgmp-dev spk121: well then. this may take a moment lloda: libraries have been slowly getting that lloda: i remember when glfw wasn't in pkg-config and then there was an update and it was lloda: :-\ civodul: spk121: in GMP 6.2.0 upstream, it's gmp.pc, FWIW lloda: i tested the fix i just pushed on the commit before the gmp one, shouldn't make any difference dsmith-work: Ya, current git is failing to build for me with or without --enable-mini-gmp dsmith-work: v3.0.5-82-g9516a10ab dsmith-work: Debian stable spk121: dsmith-work: :-< I think I've got a fix. I'm testing now on Fedora, and will try Debian next dsmith-work: Cool. No worries. Just adding a datapoint. wingo: moo wingo: well, still a bug or two in srfi-105 support *: wingo grumbles *: civodul had to look up srfi-105, {doh!} jgart: https://www.gnu.org/software/guile/manual/html_node/Web-Client.html jgart: Hi, the link in the above manual page to guile-tls is broken. jgart: This link: https://www.gnu.org/software/guile/manual/gnutls-guile/Guile-Preparations.html#Guile-Preparations jgart: The package is called gnutls-guile jgart: What should the link point to instead? jgart: Should it point to this link instead? https://www.gnutls.org/manual/gnutls-guile.html#Guile-Preparations jgart: I'll be happy to send a patch for the updated link if someone can confirm if I should use the one I linked above. rlb: leoprikler: that was just a "hack", i.e. in the current code narrow is iso8859-1 and wide is UTF-32, but one way I was playing with migrating to utf-8 was to change narrow to be ascii, and "wide" to be utf-8 (i.e. seemed like some of that transformation might be fairly easy (fsvo easy)). And then, all strings would be utf-8 format, but some (the narrow ones) could still use the optimized fixed-with code paths. rlb: (...and of course if we did go that route, we might well want to change some of the terminology in the code eventually, I was experimenting.) rlb: "was just" apteryx: rekado_: wow, thank you! I'll try and study your solution now that my son sleeps ;-) apteryx: rekado_: I like both of your examples and accompanying explanations; I was missing the concept that the filter takes the node expression as an input and how to match on children with sub-expressions, among other things. Thank you, you've made my day! leoprikler: rlb: IOW "narrow" strings are char* containing only ASCII values, whereas "wide" strings are char* encoded in UTF-8? leoprikler: (after your transformation) wingo: moin lloda: wingo: the new reader fails to read stuff like #2f64:0:3() lloda: it thinks f64:0:3 is all a type tag dsmith-work: UGT Greetings, Guilers wingo: lloda: just for reference, does it read #2i32:0:3() ? wingo: tx for report, btw wingo: there are weird things for the f32 / f64 cases apteryx: is there a way in sxpath to express the following: 'select the first node of type P coming after any node having attribute X' ? apteryx: more concretely, I want to match the first paragraph (p ...) appearing after a div with attribute class="UnitDoc" from this page: https://pkg.go.dev/github.com/dgraph-io/badger/v2; that is, the paragraph starting with "BadgerDB is an embeddable, persistent and fast key-value [...]" apteryx: my best idea so far is to define a procedure that I will put on the sxpath, that will take the nodeset corresponding to the children of body, find the position of the element which has the UnitDoc class attribute, then use return the node at position + 1. mwette: apteryx: using sxpath or the low-level routines: there is take-after wingo: lloda: fixed lloda: wingo: sry it didn't read that either lloda: oh great thx wingo: was a little typo lloda: really the sizes are only necessary when you have zeros in the size vector that you cannot deduce the array body lloda: i mean from the array body lloda: once i spent a couple days chasing a bug lloda: i had written 2,0 someone where i meant 2.0 lloda: i looked at the file till i nearly went blind lloda: i think having the sizes on the default output format would be useful lloda: well i do that because i often have to truncate the output so the sizes are the more interesting part *: spk121 hates working on patches that modify configure.ac and Makefile.am spk121: wingo: as long as you're patching guile, this vector-map patch from linus should go in, I think. https://lists.gnu.org/archive/html/guile-devel/2021-02/msg00006.html rekado: apteryx: there is a way, but I don’t think it would help you. rekado: apteryx: that website comes with empty documentation tags; they are filled with JS wingo: spk121: tx for note, will try to make a guile-devel sweep before releasing rekado: apteryx: oh, looks like I’m wrong rekado: apteryx: the “

Package badger implements…

” is actually a grand-child node of
. rekado: but htmlprag misunderstands the

. rekado: when you patch htmlprag to remove

from the parent-constraints alist you should be able to get the paragraph lloda: wingo: there's anoher one in line 527 lloda: another wingo: lloda: plz fix :) lloda: roger apteryx: rekado: oh, that's unfortunate, that htmlprag would do that. I'm going through the go importer patch for Guix, and trying to mash some changes from https://github.com/0x2b3bfa0/guix-go-modules/commit/5defe897065c5d3e63740932b360474132c77877 in, such as licenses and description scraping from that site; in their code they wrote "pkg.go.dev doesn't close some tags", that must have what htmlprag apteryx: struggles with. apteryx: that must be* lloda: wingo: pushed wingo: grand rekado: apteryx: with the patched htmlprag this gets you the first paragraph in the UnitDoc container: (begin (use-modules (srfi srfi-1) (htmlprag) (sxml xpath) (ice-9 pretty-print)) (define shtml (call-with-input-file \"/tmp/lic/v2\" html->sxml)) (pretty-print (first ((sxpath '(// (div (@ (equal? (class "UnitDoc")))) // (p 1))) shtml)))) rekado: to enter an environment with the patched htmlprag: guix environment --pure --ad-hoc guile -e '(load "guix.scm")' rekado: and here’s the guix.scm: https://elephly.net/paste/1614694637.scm.html rekado: the xpath isn’t as pretty as it could be because we use “//” before (p 1), i.e. the first paragraph; the “//” allows us to ignore the structure of the children of the div, but it also flattens all elements, so (p 1) returns the first paragraphs of all children. rekado: hence the need for “first” to take the first of all first paragraphs. apteryx: thank you, I'll try it! I wonder why

would appear in this parent-constraints list; is this arbitrary, or following some W3C standard? rekado: apteryx: I think it’s just from the old days when

was often used as an alternative to
rekado: htmlprag intends to be pragmatic, so I guess it must have been a good idea when it was written. rekado: I remember people would often just use single

tags without ever closing them. apteryx: does that mean if

tags are not closed the patch would prevent this from being parsed leniently? chrislck: latest commit: autoconfigury... y is rather far from e... apteryx: it's a diagonal key away from it on dvorak chrislck: someone hacks guile on dvorak? apteryx: perhaps :-) spk121: chrislck: yeah, that was me. autoconfigury is a real term for the whole collective autoconf/make nonsense spk121: at least, if you google for it, it has been used fairly often chrislck: :) TIL rekado: (I use dvorak, but I don’t commit to the Guile repo) chrislck: most cases of autofigury is from 9+ years ago on google chrislck: spk121 is fronting a retro resurgence rekado: apteryx: I don’t know how the patch would break other uses of htmlprag; perhaps it could be made configurable spk121: chrislck: I am really old, so checks out rekado: apteryx: both Guix and the GWL use the patched variant to post-process their online manuals. apteryx: I see, in doc/build.scm. apteryx: Perhaps we can move the fix to the proper guile-lib package, and if nobody complains, submit the fix upstream? rekado: apteryx: I don’t know how best to make this change in behavior optional. rekado: but making the change upstream is the correct way forward apteryx: rekado: perhaps an easy thing would be to define and export a %default-parent-constraints alist, and a %parent-constraints parameter to allow easily overriding it *: apteryx tries apteryx: and then perhaps a higher level use-parent-constraints? parameter switch that could be set to #false to disable it completely. mdevos: I made some changes to guile's source code (exporting extra O_* flags). Can I open a guile REPL for the modified guile without installing the modified guile? lloda: meta/guile in the build dir? mdevos mdevos: lloda: thank you, that works lloda: or maybe | 11013 No, it isn't. But if you are careful you can often arrange things to lloda: sorry about that :-( lloda: maybe 'meta/uninstalled-env guile' mdevos lloda: i think that takes care of paths & modules as well daviid: lloda: would that set the necessary env vars, ./meta/build-env guile lloda: yeah lloda: thx daviid daviid: lloda: uninstalled will import installed .go files, as opposed to build-env, i think mdevos: I'm writing a patch that adds exports some extra O_* flags, any requests? *: spk121 O_O_O_O_O_THERIGHTSTUFF sneek: O_IWANTAPONY civodul: sneek: botsnack sneek: :) mdevos: Sorry, O_PONIES is not yet supported . Otherwise I would add an export in guile. mdevos: Are ‘round quotes’ allowed in the changelog? lloda: wingo: there is something else wrong there :-\ lloda: > #2f64:0:3() lloda: #2f64@0@3() lloda: indeed > (array-dimensions #2f64:0:3()) lloda: = (0 (3 2)) lloda: should be (0 3) lloda: the test i wrote is just a read what you wrote test and doesn't see that lloda: i'll have a closer look mdevos: I have a patch for a ‘bug‘ (well, a missing future), should I send a message to (a) the bug tracking, or (b) to guile-devel? mdevos: (Bug report: https://lists.gnu.org/archive/html/bug-guile/2021-01/msg00029.html) mdevos: *future -> feature rlb: leoprikler: exactly, and then there's the question of whether we want to store the character count *and* the byte count for the utf-8 strings -- for now I was leaning that way, i.e. the non-ascii strings have an extra word with the byte count to avoid strlen in some copying operations, etc. rlb: I got the narrow strings -> just ascii, not latin-1 working fine and passing all the tests fwiw, but that's the easier part of the work. rlb: Also a bunch of questions about naming in the code in any final version, i.e. would we replace narrow with ascii, and/or wide with something else, or just leave them with good documentation (the latter of course might avoid as much api/abi churn). rlb: anyway, I was just curious - might not pursue it much further right now, since I suspect there may be a lot of work/issues created by the switch from fixed-width to variable width, particularly perhaps given our support for shared mutable strings -- not sure if we allow people to capture internal pointers, but if we do... spk121: rlb: I bear a lot of the blame for the current wide/narrow char implementation. Back in the 1.9 days, the wide/narrow provided an upgrade path from 1.8, where 8-bit chars were expected. I actually prototyped it a few different ways: utf-8, utf-32, and the current wide narrow system, inspired by Python's then implementation. The reason I gave up on utf-8 back then was because of how every loop and API had to be disambiguated w spk121: hether the intention was bytes or codepoints. Also there was the r5rs demand that all lookups by constant time. (R7RS doesn't prescribe this now). On the plus, tho, these days string representation is internal, so should be easy to modify w/o breaking API rlb: ahh, right -- I was mostly "worried" about cases where modifying a shared mutable (sub)string might shift offsets, and if that might be incompatible with current apis (not sure, just wondered). rlb: i.e. (string-set! ...) of course might change the width of a char, and require moving all the subsequent bytes... rlb: (but I haven't looked at what we really support wrt mutable sharing right now) spk121: rlb: with current apis, should be okay if a string-set! caused a shift underneath. It is just that things like string-set! would no longer be constant time lookup. They'd be O(n) probably. manumanumanu: are we talking updating the string representation? manumanumanu: There is _LOADS_ of useful discussion in the newer string srfis and the r7rs string discussions spk121: Yeah. I haven't looked at any string representation stuff in a decade, so I'm obsolete. I do like Perl's utf8 that also does raw bytes. That's cool dsmith-work: sneek: botsnack sneek: :) davexunit: I'm not sure I'm going to explain this well but is there a way to "inline" custom data types? like how '(1 2 3) isn't eval'd every time you call the procedure that contains the code so it's only allocated once. davexunit: my experience says "no, there isn't" but I figured I'd ask anyway. wingo: o/ rlb: spk121: yeah, I think the plan is to eventually switch to utf-8 across the board (plus or minus any ascii optimization) but I suppose there would also be the possibility for additional indexing (always, (or as an optional type?)) to restore O("1") operations as per https://srfi.schemers.org/srfi-135/srfi-135.html Though, as mentioned, I might well not pursue this much more right now. rlb: manumanumanu: figured that might be one of the srfis you suggested. manumanumanu: rlb: yeah. However, I don't think I have ever needed o(1) indexing of strings. I hated cursor based string, but thinking about it I have decided that is probably what I would chose (together with immutable strings). manumanumanu: the ship has sailed for immutable strings by default though manumanumanu: davexunit: if you are not going to mutate it, why not a closure? That is not what you are asking for, and it is probably too simple. If I understand why not, maybe we can hack something together :D apteryx: does someone know what tools I need on top of guile, pkg-config, autoconf and automake to build guile-lib? apteryx: ./configure says: configure: error: cannot find required auxiliary files: missing install-sh apteryx: guix environment guile-lib --ad-hoc autoconf automake -- ./autogen.sh --> configure:3252: error: possibly undefined macro: AC_LIB_LINKFLAGS_FROM_LIBS. I guess I need to update the build system to use a newer autoconf, perhaps. apteryx: Seems 'gettext' is the one missing: /gnu/store/rqb80gdyrx2q1ff2pmmyg11j7s5bm4cd-gettext-0.20.1/share/aclocal/lib-link.m4:705:AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], apteryx: ok, it works now! *: apteryx wonders if it's normal the guile-lib test suite uses 2 GiB of RAM apteryx: Running test case: test-default-port roelj: Why does this segfault? https://paste.debian.net/1187553/ taw10: roelj: initialise lst to SCM_EOL, not NULL wingo: wow, i didn't see it wingo: nice eyes taw10 manumanumanu: lets rename null so not to confuse us when reading C! taw10: Hehe, thanks roelj: taw10: Wow, thanks! I totally didn't know this :) dsmith-work: Basically, never NEVER let a SCM be NULL. Bad things will happen. ArneBab: wingo: thinking of lilypond with their reliance on a fast reader: Is it possible to turn off all advanced features of the scheme-reader to just get maximum speed? apteryx: hello! Is it possible to match child nodes without specifying their parents in an sxml-match pattern? apteryx: ah, maybe by using recursion apteryx: the so-called catamorphism feature of sxml-match *: apteryx tries apteryx: ah, fun: https://paste.debian.net/1187303/ apteryx: but recursing this way doesn't seem to be a good replacement to SXPath, which I'm now reading on wingo: moin ArneBab: moin spk121: wingo: any concerns with me pushing mini-gmp (off by default)? wingo: spk121: if off by default, no concerns at all wingo: u r a hero spk121: OK cool. Tonight then morganw: May I ask, are there any CI systems building off of release or development branches? civodul: spk121: yay! wingo: morganw: that would be nice :) in practice there are downstreams doing that (debian, guix, etc) wingo: but not off master, i don't think civodul: we should restore that morganw: wingo: is that because of lack of resources to setup or run them, or for more technical/organisational reasons? wingo: it used to be that it took a lot of resources to build guile every time it or one of its dependencies changed; we used nix's hydra wingo: but guile builds faster these days and so that is less of a concern. more that gnu itself doesn't host such services wingo: so we have to build it downstream somewhere wingo: and we don't use something like github or whatever that would have it set up already for us wingo: but otoh, the guix technology is pretty good and getting better, so i reckon that's the right place to do it morganw: I've never been quite sure whether http://hydra.gnu.org/ is specific to guix itself, or available for use by other GNU projects that could build using guix. rekado: morganw: that is an old name for ci.guix.gnu.org, which is for building the collection of packages offered by Guix. morganw: it seems confusing to refer to the build system and instances under a single name https://lists.gnu.org/r/emacs-devel/2013-04/msg00271.html morganw: But either way, I think Guix is Linux only so that probably means that you cannot do builds for other platforms unless cross-compiling (maybe that is OK for Windows though) dsmith-work: Hey Hi Howdy, Guilers roptat: hi! I'm looking for more info on the bootstrap status of guile. I think civodul mentionned the macro expander was not bootstrap? do you have more info on that? wingo: well -- module/ice-9/psyntax.scm is the expander. it's written already in the language that has syntax-case. so to load it, we have a pre-expanded version of the expander in module/ice-9/psyntax-pp.scm -- every time psyntax.scm is changed, we have to regenerate psyntax-pp.scm wingo: i.e. we load ice-9/psyntax-pp.scm when bootstrapping. but later when all of guile is compiled, we load the compiled version of psyntax.scm instead of the compiled version of psyntax-pp.scm roptat: so, that would be the only pre-generated source file in guile? roptat: and it's only used to build itself? rlb: wingo: I'd imagine this might have already been considered, but while poking at the utf-8 question a little I realized one option would be to just switch wide strings to utf-8, and narrow strings to ascii, and then we'd keep fixed-width in some common cases with utf-8 content everywhere. roptat: wingo, thanks by the way :) rlb: (And of course, we might or might not want to change the name "wide" -- I mean some of the chars there would be wider than others :) ). roptat: wingo, since I'm interested in bootstrappable builds, I've learned that racket used to have a macro expander written in C. Do you think adapting it for guile would be relatively easy? roptat: or maybe it could be done from mes? leoprikler: what's with this assumption, that "wide strings == UTF-8"? avp__: Hello Guilers! http://haunt.dthompson.us/ seems to be down, but https://www.gnu.org/software/guile/libraries/ still refers to that page. leoprikler: davet's pages are all in a pretty sad state, sadly avp__: FWIW, I'd love to give Haunt a try. There's also Artanis, but it might be an overkill for some tasks. davexunit: avp_: https://dthompson.us/projects/haunt.html davexunit: that link you're trying to use hasn't worked for a long time and will not be restored. morganw: The git repository link on that page seems to go to an empty cgit site. davexunit: my cgit setup stopped working recently and I'm not sure why, sorry. davexunit: all official release tarballs are still available wingo: good evening :) avp_: davexunit: Oh, it seems that after 'make install' (haunt reader commonmark) is missing from '/usr/share/guile/site/2.2/haunt/reader' avp_: There's only 'texinfo.scm' avp_: Ah, I see. This module only available if Guile-Commonmark is installed in the system. davexunit: avp_: yup, that's it. avp_: davexunit: I'm trying to follow your basic Haunt example, but now I'm getting 'invalid metadata format: ""' error on 'haunt build'. avp_: I'm using guile-commonmark-0.1.2 on Ubuntu GNU/Linux avp_: https://paste.debian.net/1187388/ davexunit: sorry, I can't help there. avp_: Never mind, I found the source of the error. I mistakenly pasted an empty string at the top of the metadata part in 'hello.md'. davexunit: perhaps the docs are out of date. I haven't looked at this code in almost 2 years. davexunit: ah, glad you found it. avp_: Thanks for help. ;-) davexunit: I'm pretty useless at the moment ;) avp_: You wrote the Haunt, that's a big deal on its own. davexunit: thanks :) *: wingo pondering how to wire up read-in-scheme to primitive-load leoprikler: primitive-load-in-scheme 😉️ wingo: hehe leoprikler: Guile 4 will have scheme-in-scheme bootstrapped from Mes. apteryx: is someone familiar with Guile's sxml module? The doc is sparsed and I'm struggling to figure out how to do some xpath selector. apteryx: sparse* wingo: sxpath is waaaay underdocumented wingo: there are a couple old papers about it that are the best documentation apteryx: :-) will try to find them out, thanks for the suggestion apteryx: one thing that I can't seem to do is an equivalent to 'findall' as found in Python's xml libraries; something that fully recurses the tree matching on some predicate. apteryx: re-reading the Guile Reference manual perhaps that'd be node-closure apteryx: oh yes, that seems to be it manumanumanu: apteryx: I just fought with it! What are you trying? manumanumanu: I was pretty bummed about expanding one pre-post-tree to several elements. There seems to be no way to splice the results, instead of ending up with ((double lists)). That conflicted with something I had to do further down the line. I was able to work around it though. manumanumanu: * one element to a list of elements. manumanumanu: apteryx: John Clements is a saint, and did quite fine docs over here for the racket port of sxml: https://docs.racket-lang.org/sxml/sxpath.html manumanumanu: so something like '(// element-to-find) apteryx: manumanumanu: what I`m trying to do: match all the `div` node which have the element id starting with "#lic-"; here's how I can get it by specifying the full path: ((sxpath '(html body div div div section h2 div)) sbody) -> ((div (@ (id "#lic-0")) "Some text")); but I'm trying to do the same without having to rely on the fixed path. apteryx: thanks for the link! manumanumanu: jbclements is a saint apteryx: manumanumanu: nice, the 3rd example is what I'm after if it works the same in Guile manumanumanu: it should be apteryx: hmm sadly it seems not: ((sxpath "//p[contains(@class, 'blue')]/text()") '(*TOP* [...]) -> In procedure car: Wrong type argument in position 1 (expecting pair): "//p[contains(@class, 'blue')]/text()" apteryx: OK, it doesn't like the string pattern. If I split it into a list like this: ((sxpath '(// p)) ... it returns all the p nodes, which is already something. manumanumanu: why not just filter all div elements and then filter using srfi-1 filter? :D manumanumanu: good night! apteryx: hehe, good night! rekado: apteryx: can you share an example data structure you’re working with? rekado: I have performed a fair amount of sxpath abuse in the past apteryx: I'm using htmlprag to convert the html to sxml of this page: https://pkg.go.dev/github.com/golang/protobuf?tab=licenses apteryx: it looks like this: https://paste.gnome.org/pqlj1drz8 apteryx: then I want to extract the list of licenses apteryx: basically, I need a filter that matches 'all the div nodes with id element whose values starts by "#lic-"' rekado: uhm, the paste says “The page you are looking for does not exist.” rekado: but that’s okay, I use (call-with-input-file "the.html" html->shtml) rekado: apteryx: is this what you want? —> ((sxpath `(// (div (@ id ,(filter (lambda (value) (string-prefix? "#lic" (cadr value)))))))) shtml) rekado: it returns ((div (@ (id "#lic-0")) "BSD-3-Clause")) for the given page rekado: or if you just want the license name: ((sxpath `(// (* (@ id ,(filter (lambda (value) (string-prefix? "#lic" (cadr value)))))) *text*)) shtml) rekado: though perhaps it would be clearer if you matched on the “License” class instead rekado: like this: ((sxpath `(// (* (@ (equal? (class "License")))) h2 // *text*)) shtml) rekado: the documentation really misses a key explanation: the meaning of parenthesis inside a path expression rekado: I had to look at the test suite to be reminded of it rekado: without the sub-expressions you would merely drill deeper and deeper into a node; you wouldn’t be able to match on children of a node of interest. rekado: apteryx: in the first solution I’m using “filter”, which takes a “node” — it’s always (id …), so I’m using cadr on the value to work with the id string. rekado: in the last solution I’m using the built-in “equal?” which takes a node (such as “(class "License")” and compares it with the incoming node at this level. rekado: once I actually got a node with any tag (*) that has (class "License") among its attribute set I continue to drill into *that* node (and not its attribute set) with “h2”, followed by any text node. rekado: if you left off the “h2” you’d also get surrounding whitespace (unless your html->shtml invocation filtered it) kamen: Has anyone managed to get Geiser to connect to a remote Guile REPL over SSH? I'm trying to do it with an Rpi I have that's running guile --listen, and I have an SSH tunnel into it, TRAMP works fine, but Geiser won't connect to it. 'Connection refused'. kamen: (Or do I need to install guile-ssh and use that on the remote REPL?) pkill9: does anyone know of a web service that provides most functionality of wordpress, but creates static sites and uses markdown files? pkill9: actually nvm kamen: Ok, it seems like when I do C-c C-z from a remote Guile buffer, it *does* fire up a remote REPL. Good, good. So now I just need to work out how to connect to an existing remote REPL. kamen: Holly Molly, no, Geiser actually connected to the already running 'guile --listen' on the remote machine. Just like that. Happiness and beaty all round. \o/ kamen: *beauty pkill9: does haunt store the metadata of the directories posts were found in? contrapunctus: I cloned the Guile repo from Savannah, and the file HACKING links to guile-devel, which 404s. contrapunctus: Should I change that to https://lists.gnu.org/mailman/listinfo/guile-devel ? contrapunctus: Also, can anyone extend getopt-long to contain docstrings and create a function to generate help text from that? That way there won't be two option specifications in the code which the developer will have to remember to keep in sync. (This is what I cloned the repo for, but I don't think I'll get the time to do it.) mdevos: I've encountered some odd behaviour involving #:re-export and syntax transformers, and I'm not sure whether it's a bug: ... mdevos: (define-module (test) #:re-export ((or . or/scheme))) mdevos: Now try ((@ (test) or/scheme) #f #t) mdevos: Apparently or/scheme isn't exported as syntax mdevos: (@ (test) or/scheme) returns # RhodiumToad: right, but that's the _value_ of (@ ...), there is no syntax for it in scope mdevos: RhodiumToad: I don't understand your response? If I can export the syntax defined with define-syntax, why can't I simply re-export syntax from (guile) under a somewhat different name? mdevos: What I want to do is import (test) from another module and use (or/scheme X Y) mdevos: (or and or/scheme are placeholders here. What I'm actually trying to do is exporting a Common Lisp "case" syntax as 'case, and the ‘old’ Scheme 'case as 'case/scheme) RhodiumToad: you can export it, but I don't think you can reference it with (@ ...) RhodiumToad: at least you can't use (@ ...) as though it was itself the syntax in question RhodiumToad: checking, sec mdevos: I'l use (define-syntax-rule (case/scheme . rest) (case . rest)) in (test) and export case/scheme from test (using #:export) for now until this has been figured out RhodiumToad: does it work if you just import it? mdevos: RhodiumToad: nope. I'll prepare a minimal test case ... RhodiumToad: I just tried it and it worked RhodiumToad: i.e. I did a module that had just your re-export in it, and imported it in the repl, and it worked as expected mdevos: what's the guile version? Mine is 3.0.5 RhodiumToad: 3.0.4 with patches, I can try a 3.0.5, sec RhodiumToad: https://dpaste.org/Eea9 RhodiumToad: (works the same with use-module instead of import) mdevos: RhodiumToad: well, that is interesting. Now I wonder what's the technical difference between (@ (test) or/scheme) and (@ (guile) or), and why the latter results in "source expression failed to match any pattern in form or" and why the former results in #. mdevos: In any case, I wasn't actually using (@ ...) in the code I was trying to debug. RhodiumToad: oh. RhodiumToad: so the whole question was pointless? mdevos: No, it's not pointless. I thought it didn't matter whether I used (@ ...) or #:use-module, so I used the former for a smaller test case mdevos: Btw, using import & #:re-export ((case . case/scheme)) works without trouble, but I'm using some other constructs as well. I'll be back ... RhodiumToad: so... I tried a module that has #:replace ((case/mymodule . case)) #:re-export ((case . case/scheme))) RhodiumToad: (replace rather than export to silence the warning about overriding a core binding) RhodiumToad: the module has a (define-syntax case/mymodule ...) in it RhodiumToad: and that all worked as expected RhodiumToad: i.e. after importing it, (case ...) got the module version, while (case/scheme ...) got the original guile version mdevos: RhodiumToad: that's also the case for me. But I still have weird syntax errors ... RhodiumToad: I'm betting those are real mistakes on your part :-) mdevos: RhodiumToad: I found a defun that, if I comment it out, all the code compiles, and if I copy it to the beginning of the source file (well, after (define-module (...) #:use-module ...) and comment out the original, the code still compiles, but if I don't comment the original out, then I get a syntax error. RhodiumToad: and does the body of this function refer to any syntax defined in the file? mdevos: (Yes, it's a defun and not a define. I'm porting some CL code to Scheme and I have defined some syntax code) mdevos: RhodiumToad: that's a good question ... Will be back later mdevos: RhodiumToad: yep, something like that is the case. The use of case (case/common-lisp) is correct, but the expressions inside have some issues. *: mdevos adds line to $PROJECT/THANKS rlb: I did end up adding a re-export-and-replace! - https://github.com/lokke-org/lokke/blob/main/mod/lokke/compat.scm#L7 though I can't recall if I thought that might be appropriate to consider for guile proper, or just a hack I needed at the time... manumanumanu: Do we have any preferred pastebin? leoprikler: people usually do debian paste, but gnome paste and some others are also accepted manumanumanu: Is anyone good with delimited continuations? manumanumanu: I have a very strange error manumanumanu: replacing (abort-to-prompt-tag tag stuff) with (receive vals (abort-to-prompt-tag tag stuff) (apply values vals)) does not work manumanumanu: The issue is more involved, but it is stil strange. manumanumanu: The issue is more involved. I will try to make a minimal viable example. manumanumanu: now off to bed! manumanumanu: Damn. My bad. I was returning a value to a continuation that expected none. manumanumanu: I am stupid. manumanumanu: It was such an elegant solution to a problem I didn't have. leoprikler: heh leoprikler: mv prompts are fine and dandy but I like prompt thunks harder somehow civodul: would be nice if hashq could be inlined in Scheme, somehow civodul: maybe not actually inline since that would make it harder to change it, but rather a VM instruction? wingo: a builtin, rather wingo: why do you want that tho? i doubt it would change much wingo: currently anyway wingo: i guess you could make it give an unboxed number wingo: but hash codes are known to be fixnums anyway wingo: fwiw the table-switch optimization does effectively inline some aspects of symbol hashq wingo: civodul: hey :) wingo: wdyt about the read-syntax thing civodul: hey wingo :-) civodul: the reason i think it'd make sense is that i have vhash-based caches that are probed very often civodul: a hashq is called many times civodul: which is quite some overhead for a just a few bit-twiddling instructions in the end civodul: WDYT? mdevos: The Scheme implementation of "read" seems useful beyond read-syntax to me civodul: s/a hashq/and hashq/ civodul: the read-syntax thing? wingo: ah :) mdevos: (Fiber suspension on blocking I/O from a socket in guile-fibers, for example wingo: re: hashq, i am not sure if it's an important speedup. but maybe so! if so, an intrinsitc civodul: ah yes, an intrinsic, makes sense wingo: civodul: i made (language scheme spec) use (ice-9 read)'s read-syntax civodul: i'll need to try civodul: neat! wingo: which returns a tree of syntax objects with no scope information but with source locations civodul: so read-syntax returns a syntax object right away, right? civodul: ah i see civodul: that sounds nice civodul: i have yet to catch up on that! wingo: it is a little slower -- because it has more source information. civodul: on every symbol, etc., right? wingo: i.e. for symbols, numbers, strings, etc civodul: neat civodul: did you measure the run time and GC impact of this? wingo: compiled file sizes slightly larger because more source info, and because syntax objects now have a source location info field wingo: i measured run time for a read benchmark. about 60% as fast as the C reader wingo: with a slightly higher GC load. i don't have e.g. bootstrap time differences tho civodul: i guess it uses a bit more memory, but maybe not that much since the source property table isn't that big either civodul: er wingo: yeah dunno. probably some more tweaks to make wingo: but, it bootstraps in what seems to be a reasonable time. i should probably measure civodul: i mean that the source property is quite sparse wingo: and you end up with more location info in the compiled code, which is good at least wingo: well, please do run through the commits, at least the descriptions, and see if there's anything that sounds off to you wingo: feedback welcome rlb: not sure it helps in this case, but I also tried to optimize the storage for scm-set-source-properties! established props: https://lists.gnu.org/archive/html/guile-devel/2021-01/msg00010.html rlb: i.e. convert it to the "packed" representation when possible wingo: rlb: ah yeah that sounds useful!!! wingo: rlb: please do land :) rlb: OK, had just been waiting to see if anyone found any trouble, and/or if we thought it needed any additional tests. wingo: rlb: incidentally, i found that just consing up a list of characters was faster than a string port *: civodul looks at the commits wingo: i think i found the same when implementing read-delimited in (ice-9 rdelim) rlb: Hmm, not good news for my parser :) civodul: wingo: using vectors instead of alists is a good idea! rlb: Seems like it should be possible to do better than consing chars, given how big that is memory-wise atm, if I'm thinking straight. civodul: i think eventually we could come up with an even more compact representation, with a side table rlb: i.e. amortized string growth should potentially be better? civodul: wingo: is it safe to change the prototype of datum->syntax in 3.0? wingo: civodul: if it's a compatible change (e.g. adding keywords, expanding domain of arguments, etc) then yes civodul: ah yes, that was private civodul: right civodul: got it :-) rlb: (Only semi-related, I've wondered how hard it'd be to add utf-8 as a storage format, or maybe we'd just want a wholesale replacement, were we to head that way.) wingo: rlb: asymptotically probably yes. but what is 95th percentile identifier / string length? wingo: i think probably less than 20 wingo: rlb: re: utf-8 -- is a long discussion but i think we agreed at one point that it is the right thing. but would take lots of careful work rlb: Sure, but even there, that's ~20bytes in most cases if/when we support utf-8? And we could always start off with a min ubffer size? rlb: wrt string port rlb: And 20 cons pairs is a lot bigger? wingo: i was just thinking that for low N, constant factors dominate rlb: ahh rlb: I also wondered if there might be a chance we could add utf-8 incrementally (and would that help at all), i.e. make it a new storage format, and expand it outward... rlb: But was just idle musing. wingo: yeah is a good question for musing :) rlb: Also wondered how/if the immutable string srfi might fit in to the eventual plan... rlb: (i.e. if that allowed us to provide a way to maintain "O(1)' indexing, etc. when important, with some extra overhead -- of course might also be plausible to add the srfi, and worry about anything fancier on that front later on) rlb: and yeah, as mentioned, utf-8 would have been a lot better for my interop with pcre2, for example. rlb: iirc pkill9: I just gotta say haunt is sweet mdevos: Would it be complicated to support immutable pairs? Or perhaps that would cause slow-downs due to extra type-checking, as pair? wouldn't imply that set-car! can be used anymore? rlb: (In theory I'd wanted that for lokke, and/or built-in support for immutable goops classes.) wingo: mdevos: i think it would be hard :) mdevos: (I'm feeling somewhat inspired by the paper on the lambda calculus as a security kernel. A lack of immutable pairs isn't insurmountable (‘just’ redefine pair?, cons & co), but is sometimes irritating) wingo: basically i think we would follow in racket's path in that regard mdevos: wingo: fair enough ... rlb: wingo: can't recall if I mentioned it do you, but one thing I've also thought I wanted is record/goops-class unification. i.e. could we have records "work fine" as define-method specializers. wingo: rlb: i have wanted that for a long time too rlb: (define (class-of some-record)) seems to work, but is at best awkward... rlb: (class-of (make-dummy-record-instance)) I mean. wingo: looked at it off and on but never managed to really sketch a solution rlb: Ahh, ok. rlb: I assumed friendly support immutable classes would be a lot easier than immutable pairs :) rlb: (immutable class instances, I mean) rlb: For now, you just don't have access to slot-set! (trivially) on the clojure side, and we're done? :) mdevos: If I write (quote (list stuff)) in a source file that is computed, would it be possible for the pair to end up in a read-only section (or whatever's the terminology)? mdevos: You would need install a signal handler for SIGSEGV though wingo: mdevos: depends :) '(1) goes in the read-only section because it's a pair of (1 . ()), and both 1 and () are immediates and thus need no run-time relocation mdevos: (I vaguely recall causing guile to crash by using set-car! or set-cdr! on an pair from a compiled something) wingo: but (1 2) is different -- it's (1 . _) and (2 . ()) rlb: ...hmm, well I guess it's pretty trivial (guile.oop.goops/slot-set! ...). Don't do that then? manumanumanu: civodul: To be frank, I think the equality of the hash table should not be a thing for the accessor at all. srfi-69 is so much nicer to work with. Associating an equality with the hash table at creation is probably the best way to go about it. I have never wanted to suddenly use another eq?, but I have been bitten by guile's default behaviour about 10 times. wingo: the latter goes in read-only, and the former's cdr gets patched up at load-time to point to the latter wingo: so the former bit can't be in read-only memory wingo: rlb: i think there are a lot of things like that fwiw wingo: there are quite a number of unsafe capabilities like struct-set! that don't compose with encapsulation boundaries mdevos: wingo: thank you! I can cause guile to crash with a "Segmentation fault" again now! wingo: mdevos: doh :) for set-cdr! / set-car! there should be a mutability check wingo: if that's not the case, there is a bug somewhere mdevos: (Should ideally be caught with a SIGSEGV handler that throws a guile exception when it's caused by modifying read-only pairs) mdevos: There's a mutability check??? rlb: wingo: yeah. In the docs I just said "For now, types are implemented via GOOPS which means that you can actually modify them via slot-set!. We may eventually pursue immutable GOOPS classes in Guile, but of course you can modify anything on the JVM too, if you really set your mind to it." rlb: (i.e. I believe via reflection on the jvm, if you have access to it) wingo: mdevos: see scm_is_mutable_pair in pairs.h rlb: Though I also believe they do have security boundaries, etc. wingo: mdevos: tho i think a SIGSEGV handler would be a nice solution fwiw wingo: anyway, zzz :) wingo: night all leoprikler: rlb: what can you modify via slot-set!? leoprikler: fields? civodul: manumanumanu: re hash table, agreed! mdevos: do I need to formally submit a bug report for the segfault? civodul: manumanumanu: i was looking at vhashes, which are in Scheme, and thus call 'hashq' from Scheme leoprikler: vhashes and hashqs are not the same tho (at least not in Guile) ATuin: hi civodul: leoprikler: i'm referring to the procedure called 'hashq' civodul: all this is confusing :-) leoprikler: ahh, okay leoprikler: the note on hashq is weird as well leoprikler: using internals sounds like hash tables actually need to be recomputed on GC? manumanumanu: civodul: ah, sorry. That is one interesting corner of guile! manumanumanu: How much slower would hashq be in scheme? :D That, and define-inlinable and you are set... manumanumanu: (that wasn't a serious suggestion) rlb: leoprikler: yeah, you can modify goops object fields, even if no accessor has been defined. rlb: i.e. field set! for goops objects. *: mdevos Zzz leoprikler: rlb: yeah, you can do the same with jvm bytecode, reflections are just much more verbose cousin_itt_: what might prevent (dynamic-link) from opening up a full path to a library? cousin_itt_: I verified that it wasn't a symbolic link. The library is "/usr/lib/x86_64-linux-gnu/libgpiod.so.2.1.1 pkill9: the 'i' is gone :3 pkill9: I cleaned up the theme directory and it's way more organised pkill9: I want to make a web service like wordpress, except for static sites and editing markdown text files pkill9: and using haunt pkill9: and have themes able to be switched like wordpress cousin_itt_: Ok - I built Guile 3.0.5 from scratch, and tried (dynamic-link "/usr/lib/x86_64-linux-gnu/libgpiod.so.2.1.1"), and it worked just fine. Guile 3.0.1 from the Debian repo gives me "file not found." Where might I look to figure out what the problem is? daviid: cousin_itt_: what debian version are you using? testing has 3.0.5-2, and stable still uses 2.0, afaict daviid: actually stable also has 2.2.4 cousin_itt_: The (dynamic-link) issue does appear to be fixed with a newer Guile package. I tested on a different computer (Lubuntu 20.10) which had guile-3.0.4 installed, and it worked fine as well. cousin_itt_: Thanks daviid for the suggestion. daviid: np, welcome! Rovanion: How do I open a file relative to the Scheme files directory rather than the shells $PWD? Rovanion: Wrote up a longer, more detailed versino of the question on SO: https://stackoverflow.com/questions/66396681 pinoaffe: Rovanion: (current-filename) gives you the path of the current guile script, (dirname (current-filename)) gives you the directory its in pinoaffe: that should do the trick pinoaffe: ah it seems like rekado already answered your stackoverflow question :) Rovanion: pinoaffe: Thank you either way :D mdevos: I am wondering if defining multiple modules in a single source file mdevos: is supposed to work? (ice-9 ports) & (ice-9 ports internal) do that, mdevos: but perhaps it should not be relied upon. mdevos: (I'm converting a CL code base to Scheme and now I have many tiny modules, I'm wondering if creating only a limited few .go for space efficiency would be possible) spk121: mdevos: I don't think it is supposed to work that way mdevos: spk121: you mean it's not going to help with space usage? spk121: mdevos: I'm more concerned about Guile being able to locate your *.go files correctly mdevos: I'll re-export the variables from (mach tiny-module) in the large module (mach), and always import (mach) itself and not (mach tiny) from other modules mdevos: Perhaps I should first check whether this actually results in space savings ... leoprikler: Well, assuming that consumers should not (use-module (something something internal)) directly, you can get away with it. leoprikler: but if you want it for public api, just write another file chrislck: it's result in definitive cognitive savings... mdevos: leoprikler: ok. I'm just wondering if there are plans to change Guile's module system that would break this. leoprikler: plans in what way? mdevos: leoprikler: no idea, that's why I'm asking (-: leoprikler: nah, you can use modules for whatever, they're not intrinsically linked to the filesystem or anything leoprikler: same as you can use variables wherever, they're not intrinsically linked to modules leoprikler: you just don't get the benefits of the association, that's all mdevos: thanks for the responses! Sheilong: Is there any like map procedure that extract two items per time from a list? mdevos: Sheilong: I don't think so (and I've spent some time looking at (srfi srfi-1) closely in the past) mdevos: shouldn't be much trouble to implement it yourself, though. (define (map2 proc list) (if (null? list) '() (cons (proc (car list) (cadr list)) (map2 proc (cddr list))))) mdevos: Would map2 suit your purposes? RhodiumToad: or even using (match) Sheilong: Is there any implementation of sets that permits to add elements to a set? Sheilong: mdevos: Yes. But I just figured that I need to work with sets will make my life easier. RhodiumToad: you can add elements to hash tables... rlb: If the sets are small, a list, cons, and memq, member, etc. might be fine. RhodiumToad: srfi-1 has functions for treating lists as sets rlb: oh, right, that :) Sheilong: I seen srfi-1, but did not found a way to add the elements RhodiumToad: lset-adjoin RhodiumToad: or just cons Sheilong: RhodiumToad: I have a list whose elements are bytevectors of the same size. I need to eliminate repeated elements and then compare the original size of the list with the one with removed elements. Sheilong: So I thought when transforming it into a set would do the job of removing the duplicates dongcarl: sneek: later tell zimoun Thanks for following up in the "Extending package transformation options" thread, I'm not familiar enough with Guix internals to comment but I'm reading every email and learning a lot! :-) sneek: Okay. dongcarl: sneek: botsnack sneek: :) *: dongcarl realizes he posted in the wrong channel, OH NO linas: Mixing C and scheme: I've defined functions in C, but then get "warning: possibly unbound variable" when I use them in scheme ... linas: How do I avoid/silence this error message? rlb: I think I used to work around that, but for the moment, just let it go. I can't remember for sure, but I thought I was able to define the var first on the scheme side to avoid it or something. Also wondering (don't have time to check right now) if it might be suppressed for any bindings you're exporting from the scm side (if this is a scm module wrapping a C .so). rlb: bbiaw leoprikler: linas, rlb: I think you want to load your extension at compile time linas: ? linas: The extension is in a libwhatever.so and that lib is loaded by the "actual" module. guile tries to byte-code-compile the whatever.scm module, which is calling functions from the libwhatever.so and that's when the error hits. rlb: leoprikler: that's when it complains. rlb: iirc (but I'd need to double check) linas: hi rlb! Long time no talk! rlb: hey linas: For my own use, I can ignore the messages; but I have users and I dislike scaring them with spurious error messages. rlb: might try a (define foo #f) before the load -- I forget if that's what I did before I stopped worrying and/or if it works. linas: Yeah... I guess I could try that. Vaugely worried that the optimizer might look at the #f and do something foolish. linas: OK, so a completely different question: what is the best/fastest/easiest way to port srfi-194 to guile and have it accepted for inclusion? linas: oh, shoot, right, I forgot, srfi-194 depends on some other srfis which guile doesn't have and are maybe more complicated to port... mdevos: how am I supposed to define a setter of an accessor (8.6.1 Accessors, define-accessor)? mdevos: Never mind, the documentation of "define-method" explains it pkill9: is there a repository of themes for haunt available? adhoc: pkill9: https://www.gnu.org/software/guile/libraries/ lists the no longer existing; http://haunt.dthompson.us/ pkill9: i'm on the homepage but there is nothing https://dthompson.us/projects/haunt.html pkill9: i guess there isn't pkill9: i wish it was easy to import themes from other static site generator pkill9: hmm actually it might not be too difficult adhoc: is there not a default theme you can modify ? pkill9: well I want some fancy theme adhoc: find one, adapt the .css ? adhoc: trick seems to be to avoid .js as much as possible and do all the clever stuff directly in .css pkill9: yea that's what I'm gonna do, also you need to port the layout stuff pkill9: but porting it seems easier than i thought adhoc: well, yes, hopefullly there are enough of the required html5 tags in the template output ? adhoc: as long as the div tags have the right classes and id's you can do quite a lot with very little. pkill9: looking at this it seems fairly straightforward https://github.com/johno/pixyll/blob/master/_layouts/post.html pkill9: infact it's mostly just the layout you need to port I think, as that will have all the relevant CSS tags pkill9: although jekyll has plugins that do things like pagineate, so i dunno pkill9: what's wrong with using .js stuff? adhoc: I'd like to figure out how to do something like the lowtech magazine solar site generator adhoc: damn, looks like it is down adhoc: ok, so if you are aiming to generate a static back end web site, you are not using .js to generate dynamic things ? pkill9: nah, i'd rather not use js anyways adhoc: is there a point to use .js for loading content and styling with the extra cpu overhead pkill9: everything can be done in css really i think adhoc: when .css does a fantastic job of layout and styling? pkill9: there was one really nice static site template example i saw pkill9: it was very nice adhoc: ther eis a place for .js, absolutely pkill9: looked like a magazine style pkill9: all in css i think adhoc: I took inspiration from many wordpress themes a while back, lots of good ideas there adhoc: especially for mobile first kinda layout =) tohoyn: sneek: botsnack sneek: :) pinoaffe: hi folks, I want to parse some date-time strings, is there some sort of module for this? pinoaffe: oh hey, strptime does the trick daviid: pinoaffe: srfi-19 as well, fwiw wingo: i landed a fun patch last night wingo: everything gets compiled through read-syntax, so symbols have source location info lloda: i'm tempted *: spk121 is annoyed at all the extra gotchas in Gtk4's introspection leoprikler: It's more than just the new fundamental type? spk121: well for one, the new fundamental types need to hook up to GValue as well wingo: spk121: hey question, did you have a mingw dlopen branch somewhere? spk121: wingo: I've got some rough stuff, not pushed anywhere. I should get back to that spk121: there is a mingw branch with other patches that need to be considered first spk121: wingo: if you're thinking about releasing soon-ish, I think the mini-gmp stuff could be made ready. The MinGW stuff is no fun, so I keep getting distracted from it, but, with an actual deadline, maybe I could motivate wingo: well up to now there are three interesting changes that need testing -- the ltdl replacement, the gnulib update, and now the read-syntax change wingo: and we'll only get that testing if we release, so prolly should do that within the next few weeks wingo: i wish we had a web site to review patches spk121: Yeah. I'll try to get to MinGW (bleh). I think Civodul is still interested in mini-gmp, but, it is up to him.You should consider pulling in the vector-map and vector-last patches sitting in guile-devel@ They seem solid. tohoyn: spk121: is it ok to participate into Potluck with several projects? *: wingo should be a more responsible maintainer wingo: ah well, we do what we can wingo: will get to guile-devel before the release dsmith-work: Happy Friday, Guilers!! spk121: tohoyn: well since there is no judging and no real rules, I guess so spk121: tohoyn: but in future, maybe I should have thought it out better, because I do want to make sure I try out everything, and I may have bitten of more than I can chew, hahahaha tohoyn: spk121: I have made a patch to fix the cumulative time measurement in statprof. is this two tiny to be a Potluck project? tohoyn: s/two/too/ spk121: tohoyn: the end product of all this should be a blog post where I talk about trying everything, and (if I can pull it off) some Guile stickers or postcards to mail out to participants. So I could imagine blogging about it, so I guess so. tohoyn: spk121: ok tohoyn: spk121: BTW I have posted the patch to guile-devel. What do you think about it? spk121: I remember seeing and a thinking it looked okay at first glance, but, honestly I never evaluated it spk121: If you are 100% positive that it correct and fixes a real problem, and if you can write a test case, you should push it into the tree spk121: (says me, a non-maintainer) spk121: tohoyn: with regards to statprof... If you could write a script that demonstrates statprof, it would be easier to blog about tohoyn: spk121: done and sent to guile-user rlb: wingo: fwiw, debian's in soft-freeze https://release.debian.org/bullseye/freeze_policy.html#soft so bar is higher and will be getting higher still, soon, wrt including any new version in bullseye (next stable). I was also wondering about mini-gmp. Is that actually going to break abi compat, and if so, does that require a 3.2? wingo: rlb: i haven't looked into it. right now there are problems linking guile and non-guile gmp users because of scm_gc_malloc -- so things are already broken in a particular way spk121: rlb: minigmp only affects the dependencies on which Guile relies, but, does not change the ABI that Guile presents to the world wingo: spk121: though, there is still scm_to_mpz rlb: Hmm, I thought civodul had said that it broke the abi (maybe indirectly?). wingo: which might change to need freeing or not rlb: It'll be unfortunate if we end up stuck with the broken 3.0 throughout bullseye, but might or might not be much we can do about it -- i.e. not sure I could get a transition like that into bullseye at this point even if we were ready (if one ends up being needed)... rlb: I can ping civodul later. spk121: rlb: at the moment, if we did incorporate it, there would be no need to enable that configure option in the debian build, unless debian is having the same problem w.r.t gnutls that mini-gmp is trying to fix rlb: It is. rlb: That's how it was discovered. rlb: I think, i.e. debian buildds wrt gnutls rlb: In any case, if we can figure out what the plan is, I can see what's plausible and/or talk to the release managers (depending). rlb: (See what's feasible.) civodul: rekado_: thumbs up for the Guile-Studio and Picture Language web sites! pkill9: i've started porting a jekyll theme to haunt, and now I want to create an importer for jekyll themes :) pkill9: it's easier than I thought, the only real thing that needs importing is the html layouts pkill9: which also have some jinja-style conditionals rlb: civodul: was wondering earlier if we knew for sure whether or not the mini-gmp changes were in fact going to break the abi, and if so, what the plan might be, i.e. are we going to have to have a 3.2, or...? Also wondering in the context of the debian release https://release.debian.org/bullseye/freeze_policy.html#soft We'll be increasingly limited in what we might be able to get in there for the next 2 years, if it matters... mdevos: does someone know of a Common Lisp -> Scheme compatibility layer? mdevos: I'm porting some Common Lisp code to Scheme rekado: mdevos: it’s really far out there, but yale-haskell is written in Common Lisp and the Haskell implementation sits on top of a compatibility layer that looks close to Scheme. mdevos: I just asked #lisp, and they don't know a compatibility layer either mdevos: Also, I discovered Common Lisp allows docstrings in more places. E.g., variables and condition types can have docstrings. Perhaps something to consider rekado: this is about the CL Hurd bindings, right? mdevos: rekado: yes rekado: this had been on my “do this eventually” list for a very long time… mdevos: rekado: when there's something to see, I'll post a link to a repo mdevos: (and announce to the hurd mailing list) rekado: what always held me back was the difficulty of setting up a Hurd development environment, given the confusing state of the upstream repositories rekado: I’d be happy to check it out! mdevos: rekado: I actually have never developed anything on the Hurd, and never installed any development tools in the childhurd! mdevos: rekado: the initial porting is happening on Linux. Let's first make the code compilable by guile ... wingo: moo mdevos: A while ago, I was surprised that syntax splicing (#,@) works with lists of syntaxes, and not only with syntaxes that have a list inside. Can I rely on this? mdevos: (Actually I prefer to use only the latter, but sometimes the former is convenient) wingo: mdevos: you can rely on it. not documented, but if we changed, many things would break i think mdevos: wingo: ok. I probably won't rely on it myself, though. civodul: rlb: re mini-gmp, i'm not sure it'd be ABI-compatible, we need to check sneek: civodul, you have 1 message! sneek: civodul, mdevos says: substituter patch -> https://issues.guix.gnu.org/46800 civodul: oh! mdevos: civodul: /me is going afk, unless there are questions you would like to ask now? wingo: ah a civodul sighting wingo: trains passing in the night, methinks :) civodul: wingo: heheh :-) lloda: tried master and everything looks fine +1 dsmith-work: Make check on master works for me. (Debina stable) pkill9: this is so freaking annoying, there is a'i' appearing int he top-left of this website generated by haunt civodul: in general, in 3.0, private bindings can be inlined civodul: it probably just worked by chance with 3.0.x, x < 5 civodul: instead, you can only monkey-patch public procedures of (web http) civodul: or private procedures that have not be inlined, but again, that's risky rekado: I’ll try to re-declare the header definition with declare-header!, because that allows me to pass a writer rekado: thanks for confirming! daviid: anyone knows where guile-rsvg resides these days? daviid: the guix package piints to https://wingolog.org/projects/guile-rsvg/ which poin ts to gitorious ... lfam: Maybe here? https://gitlab.com/wingo/guile-rsvg daviid: lfam: many thanks! spk121: daviid: absolutely daviid: spk121: ok tx, will try bjoli: Good morning! tohoyn: daviid: will there be substantial changes in the g-golf alpha release? daviid: tohoyn: no tohoyn: daviid: shall we publish the alpha release in debian (and ubuntu)? daviid: tohoyn: i wouldn't - the alpha release won't even be mentioned to gnu yet, just guile users ... g-golf in distro, except guix which already has a package, should wait the first none alpha/beta release, imo daviid: tohoyn: also, don't forge that it doesn't work with guile 3.0, unless maintainers fix the module-use! bug, related bug, g-golf will not work with 3.0 - this will soon become a blocker to any distro but guix tohoyn: daviid: ok leoprikler: Does "resolve-module" transparently handle other languages supported by Guile (brainfuck, JS, Wisp)? leoprikler: Or is special code needed for that? mdevos: I don't know about automatic compilation, but otherwise it should be transparent IIUC, yes mdevos: (unless the non-Scheme language uses a separate module system) leoprikler: I'm assuming Guile's module system here. fnstudio: hi, there seems to be a small problem with htmlprag, which is part of guile-lib fnstudio: (htmlprag is a html parsing library) fnstudio: the problem seems to be about the `

` paragraph tag fnstudio: and it's kind of known already fnstudio: eg http://gnu-guile.7481.n7.nabble.com/guile-lib-lt-p-gt-handling-td26828.html fnstudio: this seems to be the culprit: https://git.savannah.nongnu.org/gitweb/?p=guile-lib.git;a=blob;f=src/htmlprag.scm;h=3bd352b11fc39203828f56cf79246291ad41a273;hb=HEAD#l1102 fnstudio: i suppose the best way to approach this would be writing a patch (a test + the fix) and submitting it to one of the project maintainers? fnstudio: just asking this here in case any discussion around this had already happened leoprikler: so I just found out, that resolve-module really forces you into Scheme leoprikler: that is unless you set the current reader from the file itself, which could be an option leoprikler: so, has anyone an example for that, preferrably with wisp? leoprikler: okay, I think I got it fnstudio: when trying compile (make distcheck) guile-lib, i get this error: texi2dvi: texindex failed fnstudio: anyone has any idea what that could be? fnstudio: well actually, a more meaningful piece of info: ERROR: In procedure %resolve-variable: Unbound variable: #{\#t}# fnstudio: (well not that i need it so badly, i can simply run tests with make check afterall) daviid: fnstudio: you need to checkout devel before to patch guile-lib ... i pushed 3 patches (based on someonelese suggestion,as mentioned in the patch themselves) that haven't made it to master (and release) yet, sorry fnstudio: oh daviid thanks so much, that's great to know - well, not the fact that it's kind of stuck upstream :) but great that there's some work done on this already fnstudio: i'll have a look at the patch and see if that includes the change/fix i was hoping for daviid: fnstudio: no, those 3 do not address 'yours' - and i know next to nothing about htmlprag, but someone said earlier here the bug was in the html file? have to afk, and probably i won't be able to do much on this for the next few weeks - but send the patch if you think it is a guile-lib bug ... i certainly can apply it to devel, if ok ... but master/release will take a little while ... fnstudio: daviid: that's super, thanks! fnstudio: yes, i'd tend to think it's a htmlprag issue, as opposed to a malformed html file; i've found a couple of posts that would support this (including the one pasted above) jlicht: running some long running task using `system*', how can I make sure that SIGINT is passed along? Take e.g. `(system* "sleep" "10")'. rekado: jlicht: I’ve had the same question, but have not found a good answer. rekado: I ended up using open-pipe* instead of system* pkill9: is there a way to display tables in haunt? pkill9: i don't htink it supports that feature of markdown pkill9: for now I put it in code tags rekado: haunt uses guile-commonmark for markdown rendering rekado: it doesn’t seem to support tables jlicht: rekado: makes sense, yet somehow not what I wanted to hear. Thanks nonetheless! rekado: jlicht: this might be a bug rekado: strace showed me that SIGTERM is received and handled, but then the code simply resumes rekado: see also bug #46403 dsmith-work: Hey Hi Howdy, Guilers jlicht: rekado: I just read your bug report: I don't have original thoughts, clearly :) rlb: leoprikler: fwiw, here's how I handled that for lokke (though it's early, fairly awkward code I likely need to revisit): https://github.com/lokke-org/lokke/blob/main/mod/lokke/ns.scm#L121 rlb: And whether this, or something else there are definitely some dialect-related facilities I noticed we might want to improve at some point (recall some reader-related issues in particular, but forget the details offhand). jlicht: rekado: I worked around this issue for now by using "system" and writing some glue; in "scm_system_star", it seems we explicitly ignore both sigint and sigquit, so it makes sense that we see what we see rlb: ...one thing, if it's feasible, might be some way to teach guile how to map file extensions to dialects, so that we don't have to write all that code each time. fnstudio: ouch i was fixing the

issue in htmlprag (https://lists.gnu.org/archive/html/guile-user/2020-03/msg00059.html) but it seems i was being naive... fnstudio: the fix i was thinking of is super easy, i.e. to simply relax (as in "delete") a constraint on

's allowed parents fnstudio: currently allowed parents: body, td, th fnstudio: so that things break if

appears within, say, a

fnstudio: now that i think of it, though, that might need some proper rearchitecture as opposed to deleting a single constraint to fix the issue around

fnstudio: what i mean is that, if

is not listed maybe the entire thing was conceived for an older html specs? rekado: fnstudio: there’s a patched version of htmlprag that we use for the Guix and GWL manuals: https://elephly.net/paste/1614268485.scm.html dsmith-work: fnstudio: Probably. htmlprag existed years (decade(s)?) before html5 fnstudio: rekado: lol! it's exactly what i was looking for! thanks! (i will need to figure out how to cleanly use the snippet in my guix setup but that's a separate issue :)) fnstudio: dsmith-work: yeah, probably, a bit sad, it seems an important library, but i suppose there's many important libraries that need care, so totally understandable leoprikler: rlb: that's certainly interesting, but would you want to write a Visual Novel in Clojure over Guile? leoprikler: I don't feel as though it would make that great a difference if you're already used to parentheses. rlb: Hmm, not sure I follow you (wrt visual novel?). leoprikler: I'm writing a VN engine in Guile, but want to be able to write the novels themselves in any other language supported by it (e.g. wisp) leoprikler: By design, the engine reads certain things from a module (resolved via resolve-module) and then does stuff. leoprikler: so I need to parameterize the reader in user code if I want to use e.g. wisp in lieu of guile rlb: leoprikler: hmm, well on a technical level, I think we might still want to make some improvements with respect to the handling of the reader/writer and dialects, e.g. from the repl it reverts to the scheme reader/writer in any recursive error prompt, doesn't go back to the "correct" reader/writer until you exit the nested levels. leoprikler: intersting rlb: leoprikler: and I suppose I'd just think of clj like any other dialect, i.e. if it makes sense to support, elisp, it might also make sense to support clj -- I think the syntax similarities/differences between scheme and clj might not be nearly as interesting as the other distinctions. leoprikler: so if you raise an error after ,L lokke, it switches back to guile? rlb: right -- the clj printer is gone until you hit C-d to go back to the top level. leoprikler: that sounds painful rlb: If no one beats me to it, I'm planning to look in to it later. rlb: ...and for what it's worth, I've quite enjoyed working in both scm and clj -- I find that some things "fit" a lot better in one or the other (since right now in lokke I can write a given module/namespace in either one, interchangeably). rlb: (Of course right now, performance-wise, I think scm's likely to win, when that's more important.) rlb: (in guile) leoprikler: Hmm, going back to my original problem, I'd really like for Guile to either know in advance or let me configure at runtime the language of a given script file. leoprikler: E.g. so I can do (inside foo.scm) (switch-to-lokke!) ;; now writing lokke code leoprikler: As far as I understand, I can swap out the reader, but not the compiler. leoprikler: Hmm, I think I'll have to roll my custom solution like you did then rlb: Hmm, I'll have to think about per-file ("inline") markers. As yet, I'd mostly just been thinking about auto-compile mappings via file extensions. rlb: At least for typical clojure code (i.e. namespaces), the first form of a namespace will be a (ns ...) form (paralleling define-module), but that's almost certainly too shaky to rely on. bjoli: I wrote some proper coroutine generators: https://git.sr.ht/~bjoli/awesome-coroutine-generator if anybody is interested. leoprikler: Extension mappings are fine imo, but -*- mode -*- would also be nice. bjoli: they are, I believe, feature complete with pythons generators bjoli: with the addition of multiple values, of course leoprikler: rlb: preferrably, one could make the mapping part of the language spec, so that adding support for more extensions becomes trivial rekado: leoprikler: racket has #lang followed by the language name rekado: this solution seems to have come up here repeatedly as something Guile could benefit from dsmith-work: Yeah, Racket seems to have quite a few language flavors. How well does that work for them? (#lang) dsmith-work: Do they do anything with filename extensions too? rekado: dsmith-w`: I don’t know. I don’t use Racket. Do you have any particular problems in mind? Name collisions perhaps? *: rekado migrates old game to latest version of Chickadee dsmith-work: Sheesh. dsmith-work: can't change my nick back when banned on a quieted channel? And can't identify unless I change the nick? Harsh. rekado: davexunit: do you happen to have an example of using a “source” as background music in Chickadee? rekado: audio-play works fine for me, but source-play remains mute, and I don’t know if that’s because the source is too far away from the listener by default dongcarl: leoprikler: create autotools as in configure.ac, Makefile.am and friends? leoprikler: yep leoprikler: dsmith-work: TERM=dumb? dsmith-work: leoprikler: I have some capture/log files. Just want to clean them up a bit so I can actually read/diff them. leoprikler: ansi2txt? dsmith-work: In the colorized-logs package... dsmith-work: yey! dsmith-work: leoprikler: Seems to work! dsmith-work: leoprikler: Much Thanks! spk121: OK. In the world of meta... Here is a guile GTK app with a custom console widget rendered using guile cairo that is accepting text input and passing it to guile for evaluation. https://pasteboard.co/JPKOmsY.png spk121: bitmap fonts forever! rekado: dsmith-work: many applications also respect the NOCOLOR environment variable leoprikler: is this the newest workaround in a series of Vte not allowing to hook the process itself up to a terminal? spk121: leoprikler: nah. I just thought it would be fun. I do have another console app with VTE talking to guile leoprikler: i.e. a guile process spawning a vte to talk to itself? spk121: yup. That took some work leoprikler: I'd imagine. I once tried but gave up. spk121: I think it was guile spawning an VTE, creating custom ports to read/write to VTE, and then using those custom ports as I/O in a new guile spawned in a different thread Formbi: hi Formbi: how to disable escaping newlines with «print-set!» Formbi: ? cousin_itt: Formbi - it seems like you would just type (print-set! escape-newlines #f) ... but that doesn't work. It does work for (print-set! quote-keywordish-symbols #f) though. Strange behavior for that macro. spk121: Formbi: (print-disable 'escape-newlines) works dsmith-work: Wednesday Greetings, Guilers daviid: spk121: if i succeed, no promise yet (but i'd try 'hard'), would an alpha release of g-golf be a valid candidate for a potluck participation? rekado: in Guile < 3.0.5 I used module-set! to patch (web http)’s default-val-writer procedure to appease AWS. This no longer works. rekado: is there another way to override this private binding? rekado: here’s some context: https://logs.guix.gnu.org/guile/2020-07-07.log#155403 civodul: rekado: i'm afraid no leoprikler: probably a dumb question, but do you have the context info to do sorting yourself? leoprikler: you could also try this bottom up – first match the sublists (a . b) or (c . d), then propagate their stuff up into a list/record to do a match-let on that leoprikler: or as always sxpath chrislck: probably difficult becuase s-exp from json will be 'top down' chrislck: here's a top-down drilling into the required sublists https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/html-chart.scm#L103 chrislck: the preceding function is the sublist setter zzappie: leoprikler: I got away with assoc-ref's but this not the first time I comming accros this zzappie: thanks for sxml tips btw zzappie: chrislck: in terms of drilling I also foud *** patern in (ice-9 match) chrislck: ooh do pastebin, never understood its use zzappie: chrislck: (match '(a (b (c (d)))) ((x *** 'd) x)) will return '(a b c) zzappie: so then you could treat it as nested list position zzappie: oops I supposed to be (match '(a (b (c (d)))) ((x *** '(d)) x)) zzappie: so it finds position of match in a nested list. Probably the first occurernce mwette: In dealing with trees (aka nested lists) I like to use (sxml fold). I think the tfold procedures should work for non-sxml trees also. Here is a ref: http://wingolog.org/pub/fold-and-xml-transformation.pdf. dsmith-work: Tuesday Greetings, Guilers spk121: dsmith-work: greetings. What are you working on, today? dsmith-work: Only $DAYJOB stuff. The place I work makes these: https://www.avnet.com/shop/us/products/avnet-engineering-services/avtse-rpi-iiotg-3074457345641639780 dsmith-work: I did some kernel drivers for it, and a node-red node. spk121: dsmith-work: nice dsmith-work: So my days are currently full of Shell, Python and Nodejs. spk121: Today for $dayjob, I'll be mostly drawing in Python w/ MatPlotLib. My free time hack today is console widget in Guile civodul: hmm if i civodul: hmm? civodul: hmm! civodul: so, if i do: guile -c '(parameterize ((current-error-port (%make-void-port "w"))) (throw "x"))' civodul: the current-error-port binding is ignored when the backtrace is displayed civodul: weird no? civodul: spk121: sounds fun; it has to do with ipython, right? dsmith-work: spk121: The latest free-time hack for me was making a firefox extension to popup a list of mdns services spk121: civodul: nah. It is more like a graphical log file report of hardware resource usage dsmith-work: If anyone is interested: https://addons.mozilla.org/en-US/firefox/addon/mdns-discover/ https://bitbucket.org/dalepsmith/mdns-discover/src/master/ spk121: dsmith-work: neat dsmith-work: sneek: botsnack sneek: :) dsmith-work: Had some power glitches yesterday. Good to see the bot survived. bjoli: Ahoy hoy! dongcarl: Hi all, I'm wondering about building the guile-zlib and guile-lzlib packages, their HACKING file seems to indicate that they need to run `guile-hall`, however, it seems that just doing `autoreconf -vfi && ./configure && make` works well enough dongcarl: Is there an actual need? leoprikler: guile-hall should create autotools from the hall.scm. Assuming that upstream generates the former upon make dist somehow, you don't need that. leoprikler: Otherwise yes, invoke guile-hall first dsmith-work: Sheesh. I'm getting old. A few weeks ago, I found a command to strip out escape sequences (ansi color stuff) but not I just can't remember what it was. dsmith-work: Anyone know something like that? Pretty sure it was just some debian package... soda__hobart: hi guileful ones, i'm trying to figure out how to use these guile procedures as callbacks in a C++ program soda__hobart: i tried this: SCM proc = scm_c_eval_string("(match-lambda ( ((1 . a) _n+1 ooo) a ))"); soda__hobart: but it seems to evaluate the procedure right then and there (presumably with nil as the argument) soda__hobart: what i need is a pointer to that procedure so i can call it later spk121: soda__hobart: well there are lots of ways. But if you want something like scm_c_eval_string, you could do SCM proc = scm_c_eval_string("(lambda () match..... soda__hobart: i did that too! same thing spk121: and later call proc with one of the scm_call_1 family of procedures soda__hobart: like i did: scm_c_eval_string ("(lambda (x) (match x ( ((1 . a) _n+1 ooo) a )))"); soda__hobart: and it did the same thing as before, evaluated it right away soda__hobart: do i need to use scm_procedure_to_pointer ? spk121: I think scm_procedure_to_pointer is probably not the way to go soda__hobart: i know that eventually i'm going to be using a file as input and compiling the procedures from that, but for right now i'm just trying to hardcode it in as strings to test out how it works with the inputs soda__hobart: i could have sworn that i did this before and it worked as expected, so i wonder if it has something to do with how i'm calling scm_boot_guile and scm_init_guile spk121: something like this, perhaps... https://paste.gnome.org/pvepnm2hq soda__hobart: hmm, yeah, i can get something like that to work, but i'm trying to be able to add them at runtime soda__hobart: so you can use the api and be like add-event-handler (lambda (x) blah blah...) spk121: pretty sure it works at runtime. In this example, the proc is defined and evaluated at runttime https://paste.gnome.org/pifbspfbr spk121: anyway, good luck! soda__hobart: thanks! i will get it working eventually, but before i can work on it i have to do some "real work" :( Formbi: isn't there a command-line switch? Formbi: ah, nevermind Formbi: for some reason root owned my ~/.cache/guile and auto-compile of course couldn't write there apteryx: how can I access the element following a symbol in a tagged list? chrislck: whats a tagged lst RhodiumToad: you mean like (#:foo 123 #:bar 456) ? RhodiumToad: or ('foo 123 'bar 456) RhodiumToad: if you know that the symbol will not appear as a value, (and=> (memq 'bar lst) cadr) but that's a bit sloppy RhodiumToad: goops has a function for doing it with keywords, it uses a loop and match apteryx: Hmm in my current example the former (an args list) apteryx: ah, memq. Thanks. apteryx: chrislck: I think it's synonym with plist or property list apteryx: e.g., (list 'some-tag some-value 'some-other-tag some-other-value ...) chrislck: (let lp ((plist plist)) (match plist (('sym elt . _) elt) ((_ _ . rest) (lp rest)))) apteryx: that's a bit more involved than I'd like; I was hopping for primitive similar to assoc-ref ;-) but thanks apteryx: I guess: (cadr (memq #:ta '(#:bo 1 #:ta 3))) -> 3 is the simplest so far chrislck: you'd want some handling for such things like '(#:foo 1 #:bar) apteryx: in my specific case, I can rely on the specific arg of interest always being passed and initialized to a default value daviid: apteryx: fwiw, (use-modules ((oop goops) #:select (get-keyword))), then (get-keyword #:ta '(#:bo 1 #:ta 3)) apteryx: daviid: oh, neat! RhodiumToad: I did say goops has a function for it :-) daviid: RhodiumToad: indeed, i should have added 'as suggested by ....' tx daviid: rekado_: (or other musician) do you happen to know of a free s/w lib that displays a (lilypond) score (one line at least), plays it according to a user defined tempo, instrument 'timbre' and user feedback (a progress vertical bar that 'follows' the playback - and that could be embedded in a gtk widget? fnstudio: hi :) there's this procedure that returns multiple values and i think i'm interested in one (and only one) of them fnstudio: i can use `receive` to collect the returned values fnstudio: eg (receive (first-value second-value third-value) ...) fnstudio: is there a convention for how to name the variables i'm not interested in fnstudio: (in Python that'd be an underscore `_`, i suppose) rekado: daviid: frescobaldi has a GUI that also supports playback; not sure about following notes in the score. leoprikler: fnstudio: _ should work, but I'm not sure if you can list it twice leoprikler: if not, you can do (match (compose list your-function) ((v1 _ v3 ...) your code here)) leoprikler: or even (compose (match-lambda ((v1 _ v3 ...) your code here)) mv-function) fnstudio: super leoprikler, very helpful, as usual fnstudio: hi :) i have this html page that contains a certain number of entries that i want to parse and save in a list; i think i can start by using html->sxml but i'm a bit lost at that point fnstudio: i see there's something called make-parser in the sxml library but i don't seem to be able to find a simple example chrislck: ,use (sxml xpath) ,use (sxml simple) chrislck: (define xpath '(// td // *text*)) (define html "
blafoo
") ((sxpath xpath) (xml->sxml html)) spk121: wingo: question. For a guile app's stack which is a mix of scm and gsubr frames... Is a stack of scm->c->scm->c->scm->c in some sense worse than a stack that is scm->c->c->c->scm->scm. Do I gain anything by grouping C and scheme layers in a mixed app fnstudio: chrislck: amazing, thanks, let me try rekado: fnstudio: sxpath takes an XPath (represented as a list) as its argument and returns a procedure. Applying that procedure to an SXML tree returns the filtered result. rekado: the XPath in chrislck’s example begins with “//”, which effectively flattens the tree – it takes the root and all its decendents as the starting point rekado: from there it looks for elements with tag name “td”, (the following “//” is not needed) and then extracts the text node inside of each “td” node. rekado: there are fancy things you can do with this, e.g. to dynamically select nodes (not just nodes with a tag name that is known in advance), but this quickly becomes unwieldy rekado: luckily you can compose XPaths leoprikler: dynamic sxpaths sounds like a beast from the eight layer of hell leoprikler: s/eight/eighth/ taw10: Conjure (https://github.com/Olical/conjure) now has a Guile client, if anyone is interested in trying it out, check out branch "develop" from the repo fnstudio: rekado: hey that's a very clear explanation, thanks! yes, i got things work in a minimum example, but it doesn't seem to work in the actual HTML, currently debugging that fnstudio: so... i'm trying to match all entries from the (minimum) example: https://paste.debian.net/1186333/ fnstudio: using this sxpath: ((sxpath '(// (div (@ class (equal? "entry"))))) html-above) fnstudio: what puzzles me is that sxpath does find the entries fnstudio: but it doesn't seem to take the inner content fnstudio: that might be a bit obscure, let me add some more context :) fnstudio: the result of the sxpath procedure above is something along the lines of `(div (@ (class entry)))` (repeated as many times as the num of entries) fnstudio: no mention of the inner content, eg `Lorem Ipsum 0` fnstudio: i'd have expected all the node children to be matched fnstudio: weird, it seems to be an issue with paragraphs... `

...

` fnstudio: hm there seems to be a problem with the initial sxml fnstudio: the html looks fine to me, but when i convert it to sxml (via `html->sxml`) it then looks broken fnstudio: divs seem to be truncated whenever a paragraph `p` is used daviid: rekado: frescobaldi won't work - i'm really looking for a lib that would have a widget that display a score/staff, allows a few parameter settings foor timbres, tempo ... let the user start/stop/pause/resume while offering a vertical cursor feedback ... let's forget about lilypond, any format ... if yu happen to know, ping me ... fnstudio: ok, here's a minimum (non-)working example of my problem, in case someone has any idea https://paste.debian.net/1186340/ fnstudio: this is a slightly improved version: https://paste.debian.net/1186341/ fnstudio: with some more context in terms of the result i get on my machine vs what would be expected fnstudio: ah found it! it seems to be a known bug? http://gnu-guile.7481.n7.nabble.com/guile-lib-lt-p-gt-handling-td26828.html#a26829 leoprikler: You probably want to go up a few steps using a parent function. fnstudio: oh ouch, so i swapped html->sxml (from htmlparg) with xml->sxml (from sxml simple), but unfortunately it seems my xhtml file doesn't seem to be fully compliant and xml->xsml throws an error related to a & char leoprikler: Don't worry, htmlprag produces sxml as well, so that's not an issue fnstudio: leoprikler: parent function of html->sxml, you mean? leoprikler: no, from xpath fnstudio: ok, let me try leoprikler: For instance, once as a part of finding album covers from musicbrainz, I used the following: leoprikler: (compose ... parent (xpath:sxpath `(mmd:metadata mmd:release-list mmd:release (equal? mmd:title ,album))))) leoprikler: where parent is defined as (xpath:node-parent sxml) RhodiumToad: fnstudio: what error exactly? leoprikler: since you dig into @ class, you probably need parent twice fnstudio: RhodiumToad: this error https://paste.debian.net/1186349/ RhodiumToad: ok, so the input looks like it has an & which isn't an entity RhodiumToad: I asked because the bug I found in sxml still has not been fixed anywhere that matters, as far as I know fnstudio: RhodiumToad: yeah true, frustrating though as there's little i can do to fix the page upstream :( RhodiumToad: but that only applies to CDATA, which isn't involved here fnstudio: leoprikler: thanks for that, i'll look into that as an alternative in a min *: wingo has an implementation of read-syntax wingo: whee, source info for symbols & numbers... ATuin: hi ATuin: wingo: I have been looking at the code and I think now i understand how it works and why/where it fails (the async web client) ATuin: i could identify the (port-read ...) call that makes the fiber to fail (the one in the custom binary port). It uses the gsubr ATuin: but also before that the web code uses get-bytevector-all which is not wrapped by the suspendable-ports, so that also needs a fix ATuin: dunno why it's used since we should know the exact lenght for the body wingo: ah indeed ATuin: i guess it's to allow the weird case where we dont have that info but i guess that according to the protocol it should be known ATuin: anyway, that looks like a simple detail, the big change is that the custom port returns the gsubr instead of the scm ATuin: wingo: I saw this function in the API: trampoline_to_scm_read/write but it's not used anywhere ATuin: looks like the opposite to the c trampoline ATuin: just wrapping the c call into an SCM ATuin: ahh sorry the API call seems to be this one: scm_set_port_scm_read/write wingo: right ATuin: there is something i don't really understand well, maybe you can help. I can see in ports.c that there is a gsubr created call port-read on scm_init_ports (this one returns just the c trampoline) but I also see an SCM_DEFINE called also port-read that seems to return the (port)->scm_read ATuin: where (port) is the port-type ATuin: which one is used when doing (port-read port) in guile? ATuin: they have different signature :D 1 vs 4 wingo: yeah ATuin: desc->scm_read = read ? trampoline_to_c_read_subr : SCM_BOOL_F; ATuin: seems that's the default ATuin: when the custom port is created, so by default it will return the subr wingo: ok so a subr is a function defined in c. can be bound to a name or not. also called a gsubr wingo: the gsubr named port-read implements a Scheme function that just calls the C read function wingo: and it is the default value of port->scm_read wingo: er wingo: port_type->scm_read ATuin: yeah, i was getting confused with port-type and port wingo: understandable wingo: right i was sloppy even above: when i said "the gsubr named port-read", well there are two of those wingo: the one i was talking about was trampoline_to_c_read_subr ATuin: yes, that gets 4 args and calls the c code so no suspendable wingo: then there is the Scheme function "port-read", also a gsubr, though implemented via SCM_DEFINE; that returns the scm_read of the port's type ATuin: i guess we need a c function that calls eval or something like that right? ATuin: ok i see wingo: you mean for custom binary ports? ATuin: in general ATuin: i see that for custom ones the read_scm just points the trampoline c code wingo: right that is the wrong thing ATuin: so i understand why it can not be used by fibers ATuin: what i dont see is the magic part that happens with other ports, where the scm one is returned ATuin: at some point the scm_read field should be changed in the code if i understand it correctly ATuin: then i could try something similar in the custom port, for the web client code is fine since it just wraps a real socket wingo: for custom binary ports (r6rs-ports.c) instead the port type should have scm_read be a (lambda (port dst start count) ((%custom-reader port) port dst start count)) or something wingo: i.e. a little closure in scheme that just calls the custom read procedure to fill the port's buffer ATuin: yeah, how are the fields of the port type exposed in guile? wingo: i think you don't have access to custom port internals from scheme; would need to expose that somehow ATuin: can i use someting like set! to set that field? or needs to be done in c code when the port is created ATuin: aha wingo: you would use scm_set_port_scm_read when the port type is defined wingo: i.e. once for all custom ports ATuin: yeah i was thinking that ATuin: since aactually some other set_port stuff is called ATuin: and the funciton is there wingo: then that trampoline in scheme would somehow invoke the specific port reader ATuin: would be nice to have that in guile though wingo: in a first patch, you can just make a new accessor on custom ports defined in whatever the default environment is, to get the read function ATuin: aha ATuin: well at least now i think i know enough about the port internals to try something, if it's not good enough it can be fixed later ATuin: i also needed to patch the fibers server to be able to reproduce the client block :D ATuin: so i forced it to send the body in 2 steps with a sleep in the middle, hacky but functional ATuin: thanks again for the help wingo: :0 wingo: er wingo: :) rlb: wingo: be curious to see what you've done with read-syntax (when I get some time freed up again) -- wondering if it might indicate better ways to handle some things I just hacked to get started... wingo: still some bugs wingo: works fine until you get to quoted data; dunno how that should work wingo: right now 'foo is compiling as '# wingo: which ain't right ;) rlb: I might actually need "something more", unless you can sublass syntax objects to add fields :) rlb: (or types) rlb: i.e. the fundamental thing I needed was the ability to add new "literals" i.e. for hash-maps, sets, vectors, and so I cheated, but being able to teach the syntax pattern matcher how to handle them somehow would be brilliant. rlb: e.g. [1 2 3] {:foo 1 :bar 2} and #{1 2 3} (vector, map, set) rlb: Need to be able to work with them directly during compilation. wingo: syntax objects for me are about two things -- source location info, and lexical info for the expander rlb: (better example of the issue I guess #{(foo ...) (bar ...)}) wingo: dual-purpose wingo: usually applied to the "container" and the "elements" -- e.g. vector and elements, list and elements (or pair and head and tail), etc rlb: The key issue is of course just that I need the macroexpander to "look inside" (traverse) those collections, just as it does for lists. wingo: i pushed my broken read-syntax rlb: which kind of lexical-info do you mean? wingo: will fix up later rlb: right wingo: rlb: wraps and marks for hygienic expansion wingo: gnarly stuff wingo: could switch to scope sets like racket does, in some future rlb: Hmm, not sure I'm up to speed there atm :) wingo: anyway wingo: yeah i page it in every couple years but am currently not up to speed either :) rlb: heh wingo: night! rlb: night terpri: i like cl's readtables but they're not a perfect fit for scheme's syntax anymore, mainly because #random-word is used for a lot of things chrislck: noticed this a long time ago but still cracks me up: (number? +nan.0) => #t ATuin: (* +nan.0 0) => +nan.0 uh ATuin: weird, yes RhodiumToad: what would you expect? RhodiumToad: on the other hand, (expt 1 +nan.0) => 1.0 ATuin: ahh well i guess the * makes sense yes tohoyn: ATuin: this is weird: (= +nan.0 +nan.0) => #f tohoyn: chrislck: IMHO the behaviour of number? with nan's is ok tohoyn: chrislck: although NaN is an abbreviation for "not a number" chrislck: tohoyn: exactly. it's semantics vs r5rs. ft: I think equality between two nans is undefined in the standard. tohoyn: ft: according to R7RS if any of the arguments for procedures =,>,<,<=,>= is NaN the procedure returns #f tohoyn: ft: page 36 in R7RS ft: tohoyn: Interesting. So = and eqv? are different in that regard. Didn't expect that. tohoyn: anybody participating in Guile Potluck? tohoyn: I'll participate with Theme-D rekado: tohoyn: is the idea to present Guile projects? If so I’ll submit the picture language, Guile Studio, and Guile DRMAA. tohoyn: rekado: see https://lists.gnu.org/archive/html/guile-user/2021-02/msg00041.html rekado: yeah, I read that, but it’s not clear to me if it should be just one submission per person ¯\_(ツ)_/¯ *: rekado never participated in a game jam leoprikler: game jams are usually 1 per person leoprikler: or 1 per team ATuin: uhh it's confusing with nan :D tohoyn: oh. I submitted three projects related to Theme-D. leoprikler: also the theme is mostly to push new or recently completed stuff out in the world ATuin: what's Guile Potluck? tohoyn: ATuin: see the link I just posted ATuin: ahh sorry i did not see it ATuin: ahh nice ATuin: maybe for next one i can participate, still learning guile :D leoprikler: Basically, your Guile software will get a shoutout as in https://www.gnu.org/software/guile/news/guile-20-just-turned-3-years-old.html spk121: Yeah, for the potluck, the hope is to get some buzz and visibility for the entries. Try to get others to check out the work. I'm also trying to make some physical swag for participants: probably postcards or stickers. spk121: In a game jam, usually there is a winner, but, since there are no strict limit here -- like you can only work on it for 3 weeks -- it would be impossible to make those comparisons wingo: good evening wingo: civodul: what is needed to switch from "master" to "main" ? do you have much CI stuff that depends on "master" ? fnstudio: hello! i need to do some web scraping and i found this brilliant guide https://lists.gnu.org/archive/html/guile-user/2012-01/msg00049.html fnstudio: which is based on (use-modules (web client) (web uri) (htmlprag)) fnstudio: the post, however, is from 2012 and i was wondering if that was still more or less up-to-date civodul: wingo: nope, nothing depends on it (for Guile), i guess we could switch "right away" civodul: for Guix it's more difficult leoprikler: fnstudio: more or less, yes leoprikler: I personally tend to use sxml over htmlprag, but that can break as not every site is xhtml leoprikler: depending on your use case, you might also want to add guile-json, particularly if you can talk to some json api instead of weird html fnstudio: leoprikler: fantastic, thanks v much Formbi: hi Formbi: is it possible to choose the auto compile directory? leoprikler: Formbi: indirectly yes, Guile honors XDG wingo: manumanumanu: historical garbage :) ATuin: any idea where should i start looking at to be able to use non blocking io on custom ports? ArneBab: ATuin: I think that’s a question for wingo ATuin: yeah, i'm reading the code to try to get used to how it's implemented. I could try to redefine how (web response) get's the body but it would be really nice if the code could be reused wingo: sneek: later tell ATuin how would you know that the port is readable or writable? i guess we'd need to make it so that custom ports can return an FD to poll on sneek: Got it. wingo: sneek: later tell ATuin otherwise i think you arrange so that the port's read or write functions return -1 when EWOULDBLOCK sneek: Will do. wingo: i think that's all you would need, after having installed suspendable ports spk121: who drew the logos for guile on its main webpage? rlb: spk121: debian at least, should version guild, i.e. guile-2.2, but it also provides an unversioned name which is controlled by update-alternatives (i.e. defaults to on X.Y, but can be overridden locally). rlb: And may be well known, but if you have say guile-2.2-dev and guile-3.0-dev installed, then you should be able to pick one via the guile macros when building another project via "GUILE_EFFECTIVE_VERSION=X.Y ./configure ...". At least that's worked for me in some cases. rlb: daviid: your paste expired before I could see it. rlb: I'll also note that if you have a locally installed guile (at some --prefix), then I suspect GUILE_EFFECTIVE_VERSION may not work, and/or you'll need a number of other envt var settings to use it. I had someone report that, and I was planning to investigate more carefully. I know with homebrew, someone said for lokke, at least, they had to set PATH, PKG_CONFIG_PATH, and ACLOCAL_PATH. Not sure if that's relevant to your situation. rlb: (The homebrew info fwiw is at the end here https://github.com/lokke-org/lokke/blob/main/INSTALL ) rlb: (Oh, and lokke uses guile's autoconf/automake stuff in a fairly pedestrian way I think, so suppose might apply elsewhere...) rlb: wingo: also wondered how cpu load comares between the scheme and C readers... wingo: moo wingo: rlb: similar GC overhead; the overhead is on main thread wingo: when guile's native codegen is better things will improve rlb: Ahh, right, I also wondered about overall "instruction cost", since of course one might have a fast enough cpu to give similar runtimes for something like that, even if one is more expensive cpu-wise. rlb: (depending on the io) rlb: wasjust curious rlb: ...though I suppose if all the input files are cached, then maybe that wouldn't be a question. wingo: my tests were effectively with all input files cached wingo: well. cached by the OS roptat: is this a bug: https://paste.debian.net/1186153/ ? roptat: I used the same match, but the second one, inside the catch throws 'match-error roptat: have I done something wrong, or is my use of match breaking some sort of assumption? rekado: spk121: the illustrations were drawn by Luis Felipe López Acevedo (aka sirgazil), https://luis-felipe.gitlab.io/ ATuin: wingo: I'm playing with fibers and the module (web client) but seems at some point i reach a continuation barrier when reading the response body. What do you think is better as an attempt to get an async web client using fibers, rewrite the client from scratch or try to use guile's one? sneek: Welcome back ATuin, you have 2 messages! sneek: ATuin, wingo says: how would you know that the port is readable or writable? i guess we'd need to make it so that custom ports can return an FD to poll on sneek: ATuin, wingo says: otherwise i think you arrange so that the port's read or write functions return -1 when EWOULDBLOCK spk121: rekado: thanks ATuin: ahhh sorry i see you replied to me before wingo: roptat: not a bug, oddly wingo: roptat: the intervening _ binding from the body thunk shadows the _ that the match macro recognizes roptat: ok, thanks for the explanation wingo: ATuin: yeah i am going to vanish shortly but looking into this again -- have you seen ports-internal.h ? wingo: basically describes the abstract interface that ports implement ATuin: i was looking at the code implementing the make-custom-*-port wingo: suspendable ports need the scm_read / scm_write functions to be present -- that's what suspendable-ports calls to fill/flush the guile-side buffers ATuin: anyway i tried fibers with a dummy custom port (aborting the continuation) and it did work, probably blocking ofc wingo: then i see we have read_wait_fd and write_wait_fd port type methods, which is good wingo: means a custom port can plumb those through somehow ATuin: ok, so then the only problem with custom ports is to know when we are blocking, i guess the continuation barrier problem i got it's not even related to custom ports wingo: yeah i don't recall, am looking into this wingo: you are referring to make-custom-binary-*-port ? ATuin: my poc is very hacky (using `(set! (@@ (web response) symbol) my-symbol)` I guess at some points it's not using the suspendable port calls ATuin: wingo: yes ATuin: `(web response)` uses then when reading the body from responses ATuin: *them wingo: ok i see wingo: so the intention is that (port-read port) returns the read procedure for the port ATuin: yes wingo: if it's implemented in scheme, there will be no problem if that custom port ends up reading from another port and suspending wingo: however ATuin: i think so at least, it's scheme yes wingo: right now i see that the port_type->scm_read member seems to never be overridden wingo: it is always a subr that trampolines through the read function implemented in C wingo: which would prevent suspend & resume wingo: so even for custom binary input ports, we don't manage to hit the good suspendable path wingo: does that match what you are seeing? ATuin: yes, looks like ATuin: i got `Attempt to suspend fiber within continuation barrier` from `read-bytes` ATuin: the `read-bytes` implemented by suspendable-ports, and that code is inside the custom-binary-port used to read the exact len of the body response wingo: so you have two options :) one is somehow to make those functions be scheme for the custom binary ports. you don't have to worry about the read_wait_fd methods of scm_t_port_type because it won't be the generic custom port that causes a wait -- it may be the read function though, and we would be suspending then wingo: ATuin: yeah and it's calling ((port-read port) ...) ATuin: yes, the web code is calling that wingo: and (port-read port) on your port is returning a C subr instead of a scheme function ATuin: let me check the line wingo: the (port-read port) call is in suspendable-ports.scm ATuin: ahhh yes, right wingo: so your other option is to do something gnarly, make a new web server, make a new ports implementation, dunno wingo: i just mention that because it may be expedient wingo: but the right solution is to make it so that (port-read port) and (port-write port) for custom ports returns a scheme function, not a subr wingo: subr == scheme function implemented in C ATuin: aha ATuin: so it's not a problem as long as the read/write function is the defined in scheme ATuin: even it's it's later created using the make-custom-binary-*-port (which seems to be implemented in c) wingo: so it's scm_set_port_scm_read, which needs to be called on the port type (not the port) wingo: so it's something to implement in r6rs-ports.c, where the custom binary port type is defined ATuin: that's the code i was reading this morning ATuin: ok, I will get confident with that code and with fibers and let's see if i can do something wingo: that needs to be passed some kind of scheme function, which would then dispatch to the specific reader for the specific port wingo: good luck :) if more questions, tag my name & i will answer sometime tomorrow. happy hacking :) ATuin: ok, thanks for your time :D derelict: is there a way to do something like this? (apply or '(#t #f #t)) basically, I want to "or" a list. derelict: I just started learning scheme a few days ago... RhodiumToad: (or) is a special form because it doesn't evaluate all its args, that's why apply won't work on it derelict: I though it must be something like that RhodiumToad: if you already have a list, you can think of it this way: the result of or is true if the list contains any element which is not #f derelict: So, what you are saying is I need to write a proc to do it? rekado: derelict: srfi-1 has “every” rekado: and “any” derelict: I'll check it out rekado: (any identity '(#t #f #t)) RhodiumToad: (any identity yourlist) chrislck: took me a while to understand or-map = any, and-map = every RhodiumToad: btw when considering which of (any) or (every) to use in cases like this, always bear in mind that (any) is always false on an empty list and (every) is always true on one derelict: Works perfectly! derelict: I don't quite understand the identity part RhodiumToad: identity is a function that just returns its arg unchanged chrislck: (define (identity x) x) RhodiumToad: another subtlety is that using (any) that way actually returns the first value that isn't #f, RhodiumToad: but you could instead do (not (every not yourlist)) which will return #t or #f RhodiumToad: (any identity '(#f 1 2)) => 1 whereas (not (every not '(#f 1))) => #t derelict: Ok, I think I get it. Makes my head hurt a little. derelict: Thanks for the help! wingo: moin adhoc: evening spk121: another vector patch in guile devel. There was 'vector-last' a week or two ago. and now speedup patches for vector-map and vector-for-each. I guess the vectors need some love manumanumanu: spk121: the fact that doing (list->vector (map f (vector->list vec))) has overhead within 2x is pretty damning I would say. manumanumanu: compared to a proper vector-map dimaugh: would any kind soul help me understand how to load my own modules? (non compiled nor packaged yet, just a .scm file internally defined as a module) rekado: dimaugh: you need to add the directory containing the module to GUILE_LOAD_PATH manumanumanu: dimaugh: try first with guile -L . (which adds the current dir to the load path) rekado: if the module name is (my module) and is located in /home/dimaugh/code/guile-stuff/my/module.scm then GUILE_LOAD_PATH should contain “/home/dimaugh/code/guile-stuff” dimaugh: mhm dimaugh: but is GUILE_LOAD_PATH a variable, a hash...? dimaugh: i mean, excuse my noobness, how do i add anything to GUILE_LOAD_PATH rekado: sorry, it is an environment variable rekado: you can use “guile -L the-directory” first; it does the same thing, really rekado: or you can set the variable like this: export GUILE_LOAD_PATH=/path/to/my/directory:$GUILE_LOAD_PATH dimaugh: in a terminal, in the .scm file where i'm calling the module? tohoyn: dimaugh: in a terminal tohoyn: dimaugh: more precisely, in the terminal where you run your guile program dimaugh: i see dimaugh: but i normally use emacs for development dimaugh: now i see geiser has the option "add to load path" spk121: dimaugh: yeah, in that case use geiser add to load path dimaugh: but is this then something i'll have to do everytime, or is it permanent once you add a new path to your load_path? tohoyn: dimaugh: in emacs you can set variable scheme-program-name to contain the guile arguments tohoyn: dimaugh: for example, I use (setq scheme-program-name "guile -q") in my emacs init file dimaugh: aha tohoyn: dimaugh: I don't know about geiser but setting environment variables is not permanent dimaugh: and in this case, how would i add this load-path to my init file? dimaugh: sorry for being so obtuse tohoyn: it's probably (setq scheme-program-name "guile -L YOUR_DIR") tohoyn: the init file is .emacs in your home directory dimaugh: where scheme-program-name is the .scm file that is attempting to load the module dimaugh: i assume tohoyn: dimaugh: no tohoyn: dimaugh: scheme-program-name is "as it is". it's a variable name. dimaugh: aaah dimaugh: so then it's global dimaugh: i mean, i won't have to do it for each program that tries to load a module from that folder tohoyn: dimaugh: probably yes tohoyn: dimaugh: if you define it once in .emacs it is used for all programs run under emacs dimaugh: i hope so, because apparently my emacs crashes when i click on "add to load path" tohoyn: dimaugh: note that changes in .emacs take action only after you restart emacs dimaugh: yes, i'm gonna try that dimaugh: thanks very much tohoyn: dimaugh: you're welcome dimaugh: i couldn't understand the documentation for this issue tohoyn: dimaugh: in guile info pages? dimaugh: yes tohoyn: dimaugh: where there? dimaugh: coming from racket, i'm finding guile a bit difficult, but it might just be getting used to it dimaugh: modules > creating Guile modules dimaugh: by the way, i'm using #:export (provide-all-defined-out), which i know from racket dimaugh: (sorry, i meant (all-defined-out)) dimaugh: but i'm not sure if that's the proper way to export everything defined in the module, didn't give me any error so i assumed it was proper guile tohoyn: dimaugh: it's ok. but you can also use a separate (export ...) statement tohoyn: dimaugh: or define the exported variables with "define-public" dimaugh: yes, but as i'm still changing the module, i figured it would be easier that way dimaugh: doesn't seem to work dimaugh: it doesn't mind, i have plenty of other things to do for today dimaugh: thank you very much for your patience dimaugh: (also, now i know where to look in the guide, in load paths) civodul: how would you arrange so that GC runs more frequently, so that gcprof gets more sample? civodul: looks like GC_FREE_SPACE_DIVISOR=10 or so can help *: civodul is always amazed at the efficiency of simply asking questions :-) wingo: :) chrislck: thus, enlightenment :) wingo: so wingo: with read in scheme, we can more easily use fibers for repls civodul: nice! spk121: civodul:planning to send out potluck e-mail today. I was delayed by the apparent war on imap and plain text e-mail by all my apps and providers spk121: hey everybody - I sent an e-mail about the 2021 Guile Potluck, which is a sort of hack jam. Please consider participating! https://lists.gnu.org/archive/html/guile-user/2021-02/msg00041.html narispo: I love code potlucks manumanumanu: spk121: would my goof-loop be something for that? I believe, apart from maybe Olin's seemingly lost loops, that they are the most flexible looping facility for scheme, beating even that of racket. manumanumanu: spk121: https://git.sr.ht/~bjoli/goof-loop/ ?? manumanumanu: not quite done, yet, but as of this week I hope to get the last syntax things in place. morganw: Possibly this is an annoying beginner question (sorry), but is compiled code portable between different platforms as long as the Guile version remains the same? spk121: manumanumanu: That'd be great spk121: morganw: I believe it should, but, it also requires the same CPU family and the same 32-bit or 64-bit width morganw: OK, thanks! manumanumanu: wingo: Regarding (rnrs base): map in boot-9.scm seems r6rs compatible: errors on circular lists, doesn't support lists of uneven length (due to using length, which gives confusing error messages) etc. It is also a bit faster than map in (rnrs base). Is there a reason they are separate other than historical garbage? ATuin: ArneBab: I made a little poc to try fibers with the current (web client) code in guile :D ATuin: The socket stuff seems to work but deep in the code seems to be a call somewhere within a continuation barrier that makes the threads to raise an exception when suspended ATuin: i guess that part needs some tricks also ATuin: `make-custom-binary-input-port` ahhh it uses a custom binary port when reading the response body, I think that's the problem ATuin: `However notably non-blocking I/O is not supported for custom binary I/O ports, not yet anyway. If you need this, get it fixed in Guile :)` From fibers' manual :D ArneBab: I transferred my wisp-project-site to my org-mode based page, and while doing that I added a link-list for projects using wisp: https://www.draketo.de/software/wisp#wisp-users ArneBab: (the old link https://www.draketo.de/english/wisp#wisp-users is redirected to the new one, so your links should keep working) ArneBab: I would like to extend the list, so if you played with Wisp and you’re not in the list yet, please drop me a note so I can link you! chrislck: Wednesday greetings wingo: "read" in scheme currently at 0.45x the speed of "read" in C wingo: C read goes at around 16.6 MB/s, Scheme read at around 7.8 MB/s wingo: with source positions enabled. wingo: with source positions disabled, it's 23 MB/s vs 9.8 MB/s wingo: i think C is recording more source positions than Scheme tho right now dsmith-work: Wednesday Greetings, Guilers dsmith-work: wingo: Were the branch-chain->table updaes made in anticpation of the read rewrite? wingo: dsmith-work: yeah was thinking about that. though, not sure how impactful they are for this wingo: there are a few table-jumps in read.go wingo: but, it is comforting to know that it is there dsmith-work: Also, does the new reader provide source positions for more than lists? wingo: fwiw the old one did too for any heap object other than symbols wingo: but the idea is to have two modes for the reader, one where we return datums and one where we return syntax objects wingo: which will allow e.g. numbers and such to have source locations dsmith-work: Yey wingo: golfed perf up to 10.8 MB/s wingo: still short of C's 15.6 or so wingo: with source positions wingo: without source positions it's C 23 MB/s, Scheme 14.3 MB/s narispo: wingo: what are source positions? wingo: file/line/column info for each read datum narispo: You are rewriting GNU Guile in Scheme? wingo: since the last 15 years or so, yes :) narispo: wingo: doesnt that reduce performance progressively or you have a plan? chrislck: narispo, meet the one and only premier guile maintainer, and his masterplan for guile... https://wingolog.org/archives/2020/06/03/a-baseline-compiler-for-guile wingo: hehe wingo: generally speaking things have been getting faster as they move more to scheme. speed is an important dimension but not the only one tho tohoyn: New debianized version 0.1.0v3 of G-Golf has been released. See http://tohoyn.fi/g-golf-debian/index.html. tohoyn: daviid: your changes to didn't require any action in Theme-D-Golf ArneBab: wingo golf-master! :-) Thank you! (sidetopic: where does the name “golf down” come from?) wingo: usually it's for golfing down a time, like getting a better score in gold wingo: *golf dsmith-work: Doesn't that come from editors? Like getting some editing task done with the minimum number of (key)strokes. tohoyn: wingo: have you found any use for the improved statprof? daviid: rekado: for info, when i try to search the logs, it says Resource not found: http://127.0.0.1:3333/guile/search - may be there is service to restart? ATuin: hi, is there any async http client ready to use using fibers? manumanumanu: Ahoy! manumanumanu: wingo: Sorry to bother you, but what is the current practice of reporting errors for new code? I have some code that will make one of the scheme benchmarks a little faster :) manumanumanu: I mean for code in the guile project. manumanumanu: I have a 3x improvement for a function used in two of the benchmarks manumanumanu: oh. more like 2x. rekado: daviid: the problem is with the redirect rekado: it should not be http://logs.guix.gnu.org/guile/guile/search?query=foo but http://logs.guix.gnu.org/guile/search?query=foo rekado: (i.e. remove one “/guile”) rekado: I haven’t been able to make enough time to fix this, but it’s on my list and I’ll get to it eventually rekado: sorry about that! daviid: rekado: it's ok, tx no problem - i also wanted to sugest, if/when possible, to add a (similar) search facility to https://guix.gnu.org/packages/ manumanumanu: I just learned something about guile, folks. Using (unless can result in a lot slower code compared to if manumanumanu: which gets me to another point. wingo: the function is now 6x faster :D :D ArneBab: dsmith-work: ah, yes, that rings a bell! Thank you! ArneBab: dsmith-work: also code golf with the minimal number of characters (where some people actually have dedicated programming languages to facilitate it) ArneBab: manumanumanu: \o/ ArneBab: manumanumanu: do you mean that unless is a lot faster now? ArneBab: ATuin: I only know about the http server dsmith-work: Or replaced unless with if to get the speedup? ArneBab: ^ that’s the part I left out, yes :-) ArneBab: I wonder why unless is slower — and if we could speed up that *: ArneBab tries to resist ArneBab: … in vain dsmith-work: heh manumanumanu: ArneBab: no. Switching from "(unless test MUTATION (loop (+ index 1))) result" to (cond (test result) (else MUTATION (loop (+ index 1))) => 3x faster ATuin: ArneBab: yeah, i saw that part. I'm investigating how difficult could be to wrap the (web client) provided by guile to use async ports instead dsmith-work: Because there is an extra not, and it's single-armed? manumanumanu: I suspect branch prediction? manumanumanu: or something magical. I haven't looked at the disassembly dsmith-work: magic was the very word I was thinking. ArneBab: this is unless: (define-syntax-rule (unless test stmt stmt* ...) ArneBab: (if (not test) (begin stmt stmt* ...))) ATuin: seems like the port stuff is done in http-request in that module ArneBab: boot-9.scm ArneBab: ATuin: would be cool if you could get that going! leoprikler: manumanumanu: i don't think those forms are equivalent manumanumanu: leoprikler: that was just for illustration leoprikler: assuming this is (let loop ((result 0)) ...), one of the forms is tail-recursive, the other not ArneBab: manumanumanu: in cond the … ArneBab: what leoprikler said ArneBab: :-) manumanumanu: the "result" form is outside the loop manumanumanu: it is the thing being mutated manumanumanu: whereas returning it from within the loop as the exit condition meant 3x speed improvement manumanumanu: leoprikler: what I did was take the code for vector-map in srfi-43, adapt it to conform to (r6rs base) and rewrite the unless to a cond. leoprikler: even if there's a set!, that can probably be transformed to something more efficient in the cond case ArneBab: very cool! manumanumanu: leoprikler: well, it is vector-set!, which I doubt has any boxing overhead. ArneBab: manumanumanu: do you by chance have the disassembly of both? manumanumanu: I'll just submit the patch and then I'll have a look. ArneBab: thank you! manumanumanu: leoprikler, ArneBab, dsmith-work: jesus. Forget what I said. I'll go and hang myself. manumanumanu: out of shame. leoprikler: what happened? manumanumanu: At least I didn't post any code. manumanumanu: I ended up doing about a third of the work due to a repl error for the code I tested. manumanumanu: It is still 2x faster, though. manumanumanu: but the unless stuff didn't really make any sense at all. leoprikler: typical case of "optimized the wrong thing"? manumanumanu: Nope. I just tested something and the overhead dropped by a lot. The code was correct. The repl session was not manumanumanu: I couldn't figure out why the tested thing was faster, and the only change was the unless -> cond. I checked another expr, and the result was valid. I wasnt benchmarking the same thing :P ArneBab: manumanumanu: hey, 2x faster! ArneBab: and no worries, it’s still awesome :-) manumanumanu: It is not very impressive, though. I was just spelunking through some guile modules and happened to find (rnrs base). Have a look at vector-map :D :D manumanumanu: I am surprised it was only about 2-3x overhead to that approach. ArneBab: nope, it is impressive — what you’re doing is exactly what Guile needs to become faster. It’s the many little things that create an enjoyable performance story. dsmith-work: Life by a thousand cuts.. manumanumanu: How do I run a guile without instaling it using make install? manumanumanu: meta/guile, got it spk121: ArneBab: I think I already know the answer is no, but, you can't have a function named ':' in wisp, right? ArneBab: spk121: yes, you can, but you have to either use parens or escape it: ArneBab: define (:) #t ArneBab: \: . spk121: ArneBab: thanks! jgart: https://paste.debian.net/1185651/ jgart: does someone happen to know what the syntax error is above? any help is greatly appreciated RhodiumToad: was that supposed to be (define (ski se) ...) ? jgart: oooops jgart: yes jgart: thanks RhodiumToad! RhodiumToad: and yeah, that kind of syntax error can be massively unhelpful daviid: tohoyn__: I just pushed to the g-golf devel branch, an important change to the , interfaces that may affect your code - when you have some time, please pull, make ... you may want to read the commit 'Interface changes - , ', 49f2d4a5b206ba3f9c0e886c69490ee6a82a460a, and/or the 'Support - Flags' (updated) documentation and adapt your code if necessary ... tohoyn: daviid: ok daviid: or any other g-golf user of course ... str1ngs ^^ civodul: hello! it's Guile 2.0's birthday! civodul: uh 10 years already dsmith-work: Morning Greetings, Guilers leoprikler: wooo! spk121: civodul: for the birthday, we could announce another Guile potluck, maybe for three weeks from now civodul: spk121: yes, why not! civodul: would you like to send a message? civodul: i feel like i'm drowning in various tasks so i may not participate, but i'd certainly enjoy looking at what others have done :-) spk121: civodul: ok will do civodul: spk121: thank you! civodul: we had lots of fun with potlucks in the past ArneBab: civodul: wow — 10 years! \o/ dsmith-work: Wow indeed! tmtvl: Hello! daviid: fnstudio: do you have a repo we can look at to help you wrt autool chain quiz we made? daviid: fnstudio: *you made :) daviid: sneek: later tell tohoyn fwiw, as i mentioned already, 'finding' guile and its files, when multiple guile install, has nothing to do with g-golf sneek: Will do. daviid: sneek: later tell tohoyn if you think you found a bug related to guile.m4, please build a foo/bar super tiny project, which uses the latest guile.m4, write a target that prints all guile related variable and report a bug to bug-guile ... sneek: Got it. daviid: sneek: later tell tohoyn ' ... nothing to do with g-golf ...' after I fixed am/guile.mk - in aa405f16b42498054f390a32036a11bb67f93a2b (May 2020) that is .. sneek: Will do. daviid: fnstudio: fwiw, unlike said above, I would highly recommend you use guile.m4, together with a few other autotools chained project settings, it is the safe route to distribute either a guile lib or a guile app ... i'd be happy to help, if you are interested of course ... daviid: fnstudio: and use the autotools chain to 'generate' the script that launches your app, if/when your are writin and app, which'd be installed in $prefix/bin (with no auto compile settings) ... that merely start guile then import your modules and calls the 'animate' procedure of your project ... daviid: rlb: right, i do not have virtualbox installed here, tx for the tips though, i'll seee if i can fix the libvirt/qemu approach first, tx rlb: Understood, and fwiw, I don't know if the official debian images will also work with (or are produced for) the qemu/kvm backend, i.e. this is what my instructions rely on: https://wiki.debian.org/Teams/Cloud/VagrantBaseBoxes daviid: rlb: ah ok, tx - rlb: Of course you can always just grab the installer, etc. But then you have to run the installer -- with the vagrant images, they just come up with "vagrant ssh" support (same for freebsd). daviid: rlb: fwiw, I just tried on another (remote) machine I have access to, it runs bullseye (with no additional experimental repo, just 'bullseye') and it fails with the same error then here daviid: i'll try buster right now (another machine as well ...) daviid: rlb: not that what I am writing gives us any better info then earlier to debug, but at least it is not just my machine (which I updated to be able to install gtk-4.0, so it could have been the origin of the problem ...) rlb: And lokke is failing, or just g-golf? daviid: i only tried g-golf so far, i'd have to install lokke there to *: rlb just got a primitive clj defrecord working... rlb: No worries, just wanted to make sure I understood the situation. rlb: So this might just be something g-golf specific... rlb: (defrecord, ->Type, and map->Type -- should help run more existing code) *: rlb hugs syntax-case... daviid: maybe, but i doubt - unless something in the libg-golf.c[h] file maybe? don't think so, but ... rlb: Well, I just mean if lokke and guile build and work fine with the newer libtool, then there's likely "something else" going on with g-golf *somewhere*, either directly or indirectly. rlb: (For anyone interested: https://clojure.org/reference/datatypes -- in the longer run, we might want something more efficient, and more immutable, but for now I'm just letting a simple goops translation handle the heavy lifting -- and don't have any support for the optional protocol methods yet.) *: rlb likely wanders off soon. daviid: rlb: i'll try lokke on that remote machine, i am now doing the updates, in a few minutes, we'll know daviid: :) daviid: ah, this guile.m4 related error - you ahould add guile.m4 to lokke, imo daviid: rlb: ok, lokke also fails on that other 'unmodified' debian bullseye machine daviid: rlb: so, after i manually added guile.m4 in lokke/m4, here is the configure and make 'report' - https://paste.debian.net/1185511/ daviid: rlb: could it be that i have to rebuild guile? because the common 'thing' on these machines is it uses a manually com piled installed guile rlb: I've never tried manually adding anything -- see the lokke readme, for now it's just "./setup && autoreconf -fi && ./configure && make -j5 check". rlb: Oh, hmm, don't know -- I'm relying on the guile-2.2, guile-2.2-dev and guile-3.0, guile-3.0-dev packages. daviid: rlb: this guile.m4 problem is 'very common', and is AC_LOCAL related, it almost always fails on users, hence i now (for the last decade or so) always provide guile.m4 in all projects i work on daviid: providing guile.m4 also make sure the message, if users do not have guile at all, is 'nice', not an unreadable message ... daviid: now, back to this error, it weas my impression that 'that part', building the c lib, has nothing to do with guile, the error happens far before compiling g-golf, it happens at building the shared lib for libg-golf, liblokke ... but i'll recompile guile and see, will let you know ... daviid: rlb: it works - with manually installed 2.2, after I uninstalled, pulled, run the danse ... recompiled/installed guile, both lokke and g-golf now build there respéctive shared lib ... and compile till the end :(, and make check pass for both as well - daviid: daviid: rlb: here is the lokke test suite report - https://paste.debian.net/1185514/ spk121: so if you ever wanted to write makefiles in Guile Scheme, now you can. :-) https://github.com/spk121/potato-make daviid: spk121: impressive! tohoyn: daviid: here is what I get from g-golf configure: https://paste.debian.net/1185523/ sneek: Welcome back tohoyn, you have 3 messages! sneek: tohoyn, daviid says: fwiw, as i mentioned already, 'finding' guile and its files, when multiple guile install, has nothing to do with g-golf sneek: tohoyn, daviid says: if you think you found a bug related to guile.m4, please build a foo/bar super tiny project, which uses the latest guile.m4, write a target that prints all guile related variable and report a bug to bug-guile ... sneek: tohoyn, daviid says: ' ... nothing to do with g-golf ...' after I fixed am/guile.mk - in aa405f16b42498054f390a32036a11bb67f93a2b (May 2020) that is .. tohoyn: daviid: I just did "git pull" for it daviid: tohoyn: that has nothing to do with g-golf daviid: you can build a seperate project that just check for guile, it will display the same messages tohoyn: daviid: so is it a bug in guile.m4? daviid: i think you have multiple guile installs, but wrong local vars ... nobody on earth can debug but you daviid: tohoyn: it is a problem on your machine, your config, and/or your distro ... not g-golf or any other projects fwiw - as i said, just generate a foo/bar project, minimal, just configure.ac and what it needs, and see (for yourself) tohoyn: daviid: ok daviid: tohoyn: maybe there is such a minimal project out there, a 'hello-world' guile based autotool chained minimalist project ... daviid: tohoyn: yu may also try to purge one of the guile, really aptitude purge, not a manual 'clean or hide' thing daviid: then re-run ./autogen.sh, then ,/configure ... tohoyn: daviid: does g-golf configure work for you if you have both guile 2.2 and 3.0 installed? daviid: i don't use debian guile packages spk121: tohoyn: and daviid. For my Ubunu Bionic CI builds for some projects, I have to do "GUILD=/usr/bin/guild ./configure ..." because Ubuntu's guild is not named according to the naming scheme expected in Guile-2.2's guile.m4 spk121: maybe debian is similar daviid: spk121: no idea, but GUILD is set by guile.m4, i mean if you call GUILE_PROGS in your configure of course tohoyn: spk121: I've got guild, guild-2.2, and guild-3.0 in my Ubuntu tohoyn: spk121: Ubuntu 20.10 daviid: spk121: i was saying the above thinking that if you call GUILE_PROGS in your configure.ac, would that not erase your 'pre setting' as in "GUILD=/usr/bin/guild ./configure ..." ? don't know tohoyn: daviid: I just filed a bug to bug-guile@gnu.org tohoyn: daviid: bug #46527 daviid: tohoyn: i would have sent the bug to ubuntu first, but it's ok - ATuin: hi, i'm trying to convert some lambdas into syntax using datum->syntax but i get this error: unhandled constant (s). s is the parameter to the lambda. Any idea why? leoprikler: I think it'll be easier if you use raw expressions instead of lambdas. ATuin: mmm how can i do that? ATuin: i'm kind of new to macros, so i'm playing with them leoprikler: Depends on what exactly you're trying to achieve in the end. ATuin: ok, this is the idea: I'm doing a macro do define enums, it creates som hashmaps between symbols and ints and then defines several functions using define-values ATuin: the idea is that having an optional #:flags keyword the macro will create an extra function that or the arguments passed to it ATuin: i can paste what i have now leoprikler: Handling optional arguments puts you deep into syntax hell, but you can look at stuff like use-modules for pointers on that. ATuin: https://paste.debian.net/1185542/ leoprikler: For a proof of concept it'd probably be easier to do define-enum and define-flags separately ATuin: without the optinal flag it works ATuin: since i create the lambdas inside the macro, so no problems ATuin: https://paste.debian.net/1185543/ <- this almost works, but the recursive call to the macro adds a new symbol like `test-iXXXXXXX` :D ATuin: i will look at use-modules then leoprikler: Ehm, do you actually produce the same amount of names and values? ATuin: yes, that was a test ATuin: just to test that i could get the same identifier at the end ATuin: there is left to add the new name and value ATuin: the first paste produces an extra value when running with macroexpand but it fails when compiling the expression leoprikler: Probably because define-values is itself a macro, which then fails to compile leoprikler: or maybe not, the number of values is taken from runtime leoprikler: but to be frank, couldn't you just syntax-quote or syntax-quasiquote those lambdas? ATuin: inside the macro you mean? leoprikler: inside functions ATuin: aha, can i do that? leoprikler: yep ATuin: instead of using the datum->syntax leoprikler: #' or #` leoprikler: yep ATuin: ok, i will play with that then leoprikler: you just need to be careful of where to unquote, so that you get the actual hashtables ATuin: yeah, those should be created at compile time right? ATuin: i mean i know the symbols at compile time so unless they change in the source they should be always the same ATuin: it's quite confusing (but fun) this macro thing :D mwette: ATuin: I use macros w/ keywords, but some I process some I pass. Perhaps the code can help. https://git.savannah.nongnu.org/cgit/nyacc.git/tree/module/nyacc/lang/c99/ffi-help.scm#n2186 ATuin: mwette thanks! looking at it ATuin: `(eq? (syntax->datum #'key) #:use-ffi-module)` ahhh you can have guards in macros also, nice mwette: they are called `fenders'; for syntax-case, not for syntax-rules ATuin: yeah, i see ATuin: i also see that you use the code generated by a syntax-case in the syntax-rule later, nice ATuin: i think i can learn one or two things with that ATuin: actually my problem now is that i'm confused when merging the code from one macro into another, since i get symbols that are not resolvable in the final code mdevos: does someone have a guix environment for building guile from git (for development)? leoprikler: mdevos iirc it was --ad-hoc autoconf automake pkg-config texinfo, maybe texlive mdevos: leoprikler: thanks! Will try later vagrantc_: rlb: well... one issue down, but now i get some presumably non-deterministic segfaults in various test suites: https://buildd.debian.org/guile-ssh ... so far only ppc64el, s390x, riscv64 and ppc64 ... but they're segfaulting in different tests *: vagrantc_ wonders if running tests in parallel could be an issue vagrantc_: oh, apparently i run the tests in serial already... rlb: vagrantc_: note that there's a current known issue exposed by gnutls. rlb: not sure if it's related, hang on... rlb: "if it could be" vagrantc_: yeah ... vagrantc_: maybe the gmp thing ludo mentioned? rlb: yep rlb: https://bugs.debian.org/982217 https://debbugs.gnu.org/38041 and also noticed very old https://debbugs.gnu.org/10519 rlb: Might have nothing to do with the current issue, though. vagrantc_: i can try to schedule a giveback, but that seems poor form :/ rlb: I suppose if you have the time, might try to reproduce it in a loop on one of the porterboxes or similar... fnstudio: i followed this guide (https://www.draketo.de/proj/with-guise-and-guile/guile-projects-with-autotools.html) to create a GNU Build System / Autotools package fnstudio: it seems to work, as it configures/builds/install with no errors fnstudio: however, there might be something fundamental that i'm missing rlb: vagrantc_: since s390x is a segfault, if we can reproduce it, suppose gdb might be able to tell us something more interesting, if we're lucky... vagrantc_: rlb: all of the failed builds are segfaults fnstudio: at the end of the installation i see a hello.go file is save in and made available from a lib folder in my home; should i expect a `hello` binary to be also saved anywhere? fnstudio: *is saved vagrantc_: wonder why they're not getting this issue on guix's guile ... vagrantc_: oh, i guess if it's actually architecture-specific... they test on fewer architectures ... but i suspect it is more non-deterministic than architecture related ... maybe specific architectures might trigger the issue vagrantc_: more easily vagrantc_: i'm going to try in a loop on x86_64 and see if i can trigger it ... rlb: fnstudio: I don't know anything about those project setup recommendations, but no, I wouldn't think you'd end up with a binary. You'll generally run your program via a #!/.../guile script. rlb: vagrantc_: suppose x86 does have some substantially different memory/cache/etc. behaviors from say arm64, so it may be notably different on some fronts. fnstudio: rlb: oh i see, excellent, thanks - i'll have a look at some other project to see how this is handled when things are packaged rlb: fnstudio: see also https://www.gnu.org/software/guile/manual/html_node/The-Meta-Switch.html rlb: fnstudio: or actually perhaps start at https://www.gnu.org/software/guile/manual/html_node/Guile-Scripting.html rlb: bbiaw fnstudio: thanks rlb very good pointers daviid: rlb: back to trying vagrant, I try to follow the steps you kindely pasted, quite blindingly I must say, didn't have time to look at any doc yet, here is what happens daviid: rlb: after vagrant init debian/testing64, i edit the file but can't find any entry for vm.memory, nor vm.cpus (which were optional, but can't find them ...) daviid: rlb: then vagrant ssh fails ==> default: Domain is not created. Please run `vagrant up` first. daviid: i try vagrant up, it also fails, here - https://paste.debian.net/1185414/ daviid: i 'have' ssh the .ssh/id_rsa file exist, and the ssh daemon is running, fwiw daviid: rlb: (or any vagrant user who would know ...) i'll read/search (not exactly now, but will do) to solve this (small) problem of course, just reporting that i prob miss some (libvirt ?) set-up here ... but in case you'd be 'here' and know the missing step(s) let me know ... rlb: daviid: sorry, right, I forgot the vagrant up command, and it's vb.memory and vb.cpus (not vm) -- you should see a section commented out near the bottom of the Vagrantfile that includes vb.memory, and you can just add vb.cpus there too if you want to. rlb: daviid: oh, and sorry, another assumption, I'm using virtualbox (the default vagrant provider here), i.e. "apt install vagrant virtualbox", though that might require (in debian) testing or sid -- iirc one of them might not be in stable... So I suppose it could be this is more hassle than it's worth for you, depending on your situation. rlb: I don't know that I've ever used vagrant with libvirt/kvm/qemu -- I do use kvm/qemu/libvirt for less throwaway servers (mostly just use vagrant for testing), but in those cases, I use kvm/virsh/etc. more directly. rlb: And if you don't have virtualbox available to vagrant, I guess that might be why you didn't see the section in the config file (didn't realize that's how it works). fnstudio: briefly following up on my question re packaging a guile executable with the GNU Build System / Autotools, i understand i need to add a script that wraps my guile program, as it's done here for instance https://github.com/alezost/guile-daemon fnstudio: (the project comes with a lot of useful docs and comments, by the way, very useful to understand what's going on with the different files) fnstudio: i still need to understand how it can make it away without importing the guile.m4 file that seems to be used in all other packaging-guile-with-the-GNU-Build-System projects i've looked at fnstudio: ah... this might explain the lack of guile.m4: https://www.gnu.org/software/automake/manual/html_node/Local-Macros.html fnstudio: where it explains that, in certain circumstances, the file guile.m4 is automatically copied over from the system by aclocal fnstudio: although that doesn't seem to apply to guile-daemon... as it doesn't make use of GUILE_FLAGS... fnstudio: i'm looking at https://github.com/alezost/guile-daemon/blob/master/scripts/guile-daemon.in and i wonder if there's a simpler way for me to wrap a shell script around my guile module fnstudio: if i understand it correctly, the script above has to figure out the paths where the guile module has been installed fnstudio: if i simply use (use-modules (my-mod)), then the script doesn't seem to be able to find the library fnstudio: i'll go and see if i can find another simple guile program (not a library) that i can get some insight from mwette: fnstudio: my distribution is all scheme, I did away w/ guile.m4 and ginned up a configure.ac the works for me. I ran into too many issues with the other stuff. Look here, it may give some ideas: https://git.savannah.nongnu.org/cgit/nyacc.git/tree/ mwette: you'll want to look in etc/ directory fnstudio: mwette: this is priceless, thanks so much!! tohoyn: I have had problems with guile.m4. It does not detect the guile version correctly when both guile 2.2 and 3.0 are installed. tohoyn: This was with G-Golf. ATuin: Hi, I have a weird problem when creating a binding for libzip, seems to be GC related. Basicaly i create a source from a bytevector to be added later into the resulting zip. When the script is compiled first time, it works properly but when i run it a second time the output produced by that source is messed up (a mix between txt from other files and random characters) ATuin: is there anyway to debug the GC ATuin: if i register those bv in a hasmap before creating the source seems to work fine when running it several times so it looks for me like a GC tihng ATuin: any idea? ATuin: https://paste.debian.net/1185466/ ATuin: tht's the code ATuin: yeah, seems to be the GC, when using a guardian on the data before adding it to the source record it works. ATuin: why is guile not knowing that i have a reference for that bv as a field in the record ? tohoyn: ATuin: are you using g-wrap for the library bindings? ATuin: nope, just ffi ATuin: i pass a bv, i get the pointer for it and i pass it to a ffi function ATuin: then i save the pointer returned by that function (and the bv to keep a reference to the original guile data) into record (kind of wrapper basically) ATuin: but for some reason guile is not aware of that data and it collects the bytevector ATuin: ttps://paste.debian.net/1185466/ ATuin: see there the function bytevector->source ATuin: lzip/source-buffer-create is a call to the c library tohoyn: ATuin: g-wrap has type qualifier "aggregated" for this kind of situations ATuin: mmmm what's g-wrap? ATuin: maybe i can take a look at it ATuin: but still why guile is not aware of the bv field in the record? ATuin: or is just that the whole source is GC tohoyn: ATuin: warning: I'm not sure if g-wrap is actively maintained anymore tohoyn: ATuin: guile-gnome uses g-wrap ATuin: aha mwette: guile allocates space for bytevectors using scm_gc_malloc_pointerless ATuin: interesting, adding the guardian to the whole source record (the one that wraps the bytevector and the low level pointer) makes it work as well mwette: so if the bytevector is not referenced the contents will be freed, I believe ATuin: so i guess the whole source record is GC (and whatever is inside) ATuin: mwette: yeah, that makes sense but i save it as a field inside the wrapper mwette: "space for" => "space for payload" ATuin: seems that it's the wrapper the one that is collectec then mwette: the bytevector itself or the pointer? ATuin: i store the bytevector itself ATuin: and the pointer returned by the c call ATuin: see the code above ATuin: first function ATuin: I guess the problem is that the function that adds the source to the resulting zip does not keep a reference to the source, so when the zip is closed (it's then when the sources are saved) then some data has been collected. Interesting :D ATuin: finally I added a reference to each source added into the archive record (everytime archive-add-source! is called), seems to work as well mwette: and you are saving the returned "source" record I guess? ATuin: mwette: yes, the archive record keeps track now of the sources added to it ATuin: that was the main problem, since i was doing everything in one rec funcion i was not saving the sources and they are used when the zip is closed ATuin: once i implement replace and delete I will made the code to remove them or replace them from the hash-map ATuin: *make wingo: moo wingo: my reader seems to work?? weird rlb: excellent? wingo: haha i was testing the wrong thing, n/m :) rlb: heh wingo: interesting production in guix/scripts/lint.scm: (cons* #\\ #\"result) wingo: ok now (ice-9 read) has the same results as C read for all scm files in my ~/src/ wingo: soon will make sure errors are same. source locations would be a bit gnarly to get exactly the same tho roelj: woohoo! leoprikler: ngz: fwiw (and (string? v) v) should work ngz: leoprikler: Yes, but then I need to evaluate v twice. leoprikler: ahh, so you want it to expand to (let ((v exp)) (and (string? v) v)) mwette: RhodiumToad: typing lots of commas RhodiumToad: yeah, value-if-string could have been defined as (and (string? v) v) but I don't think that's any improvement over (if) RhodiumToad: oh, I found another way RhodiumToad: (cond ((foo) string? => identity) ((bar) string? => identity) (else "")) ngz: Nice. RhodiumToad: that is apparently from srfi-61 but it's built-in syntax in guile dftxbs3e: I don't understand why GNU Guile is slow some times without consuming 100% CPU or I/O daviid: rlb: thanks! will try vagrant asap, many tx for the steps in the debian paste ... i was not aware it was that easy to create and use other deb env to test ... cool! sneek: daviid, you have 1 message! sneek: daviid, rlb says: I can set it up and try with 2.2 tomorrow. Also, if you have access to vagrant, I can give you trivial steps to reproduce whatever I find. Oh, and if I forget, certainly feel free to ping me. rlb: Yeah~. rlb: I just use vagrant for testing for the most part, but it's quite useful there. rlb: Happy we have the debian images too. rlb: (Oh and there are freebsd images which have been very useful for tracking down compatibility issues.) rlb: dftxbs3e: what's the context? dftxbs3e: rlb, I don't know for sure, I can't say anything so what I said is not very useful. If I find anything I'll be sure to share. daviid: rlb: it all seems very powerful - tx again, will ping when i have some results ... rlb: dftxbs3e: if you can reproduce it, might check "atop 3" or attach via "strace -p PID ..." or, similar if you haven't already. Might see something relevant. dftxbs3e: rlb, didnt know about atop, how does it work exactly? what's 3? rlb: That just tells it to refresh every 3 seconds rather than the default 10, and it's a little unusual in that how much you see is determined by the size of the window, so you may want to make the terminal it's in largeish. rlb: And it provides a broader overview than top or htop, i.e. it includes various cpu, io, and network metrics, among other things. dftxbs3e: I use netdata to monitor dftxbs3e: At this point I am thinking a remote service might be bottlenecked dftxbs3e: I am also pondering file system metadata performance rlb: Right, I'd wondered if it might be blocked on disk or the network. rlb: You may well be able to see that in atop, or a similar tool (dstat, vmstat, iostat, etc.) rlb: iotop might also be interesting or jnettop dftxbs3e: Basically I am running an instance of guix-build-coordinator-agent to build GNU Guix packages. It seems to run slower than on x86_64, as I am on PowerPC 64-bits dftxbs3e: netdata provides all the information for all these tools combined in a nice way rlb: Ahh, ok. dftxbs3e: rlb, http://[2a01:e0a:2a2:1351::1ec]:19999/ rlb: dftxbs3e: 2.2 or 3.0? dftxbs3e: 3.0 latest dftxbs3e: But at this point I am thinking it might be cbaines's scheduler that is the bottleneck and I don't have access to that to monitor or change. dftxbs3e: rlb, can you access the URL above or..? rlb: Doesn't look like it. dftxbs3e: rlb, do you have IPv6 networking? rlb: guessing not dftxbs3e: if your GNU/Linux distribution has a "miredo" package you can just run that as root it'll get you a teredo 4to6 tunnel set up without any configuration, unfortunately it didnt make it to Debian buster but it's in stretch and bullseye. rlb: Ahh, thanks. dftxbs3e: Do you know why interpreting Scheme code directly would be slow? Also why interpreting vs byte code compilation makes such a difference in performance? solrize_: lol: solrize_: Who wrote it? solrize_: Mu Lei AKA NalaGinrut, a Certified Scheme Nut - someone who would rather face death than not use the Scheme programming language to build a website. rlb: dftxbs3e: substantial topic, but one perhaps notable reason is that compiling to byte code can allow work to be done in advance. dftxbs3e: rlb, in the case of GNU Guix for example, you cannot run it without compiling, it's just not practical due to speed. vagrantc: hi, looking into a failure in the guile-ssh testsuite on debian after upgrading guile from 3.0.4 to 3.0.5 ... any wild guesses? https://bugs.debian.org/982728 rlb: vagrantc: hmm, not sure - is it easy to reproduce? rlb: (if you've gotten to that yet) *: rlb hopes it's not the gmp issue... vagrantc: rlb: it consistently fails with guile 3.0.5 with multiple different tests vagrantc: rlb: and consistently works with 3.0.4 vagrantc: haven't reduced it down to a minimal reproducer yet vagrantc: and not sure i even really know how :) rlb: mostly be nice to see more of the backtrace... rlb: Do you see more if you run it directly (if you've tried that)? rlb: (Of course, don't know if you *can* easily run guile-ssh tests "directly"...) vagrantc: yeah, trying to figure that out wingo: humm weird wingo: could be something broken with the "case" optimization, but that would surprise me... wingo: i guess you are compiling the same package in the same way, just with different guile? rlb: Looks like one of the culprits is "ice-9/eval.scm:155:9: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f". vagrantc: fwiw, the tests also pass with guile-2.2 vagrantc: the guile-ssh package builds with both guile-2.2 and guile-3.0 ... when i downgrade the guile-3.0 packages to 3.0.4 the tests pass ... vagrantc: got a local build running to see if i can't get an environment set up to more easily manually run tests vagrantc: and if we're lucky, find more detailed failure logs rlb: great vagrantc: here's one log: https://paste.debian.net/1185368/ vagrantc: not sure how to make it more verbose vagrantc: that's just dist.log rlb: If their test suite has the ability to run individual test files like guile does, that might speed things up. i.e. in guile "./check-guile asyncs.test". rlb: And then suppose you might try commenting out tests to narrow it down to hopefully a single test that triggers it... *: vagrantc tries parsing the autotools generated Makefile rlb: (Then we could see if we can move that to a more standalone file that can be run more directly or something...) vagrantc: gah. can't even figure out how it actually runs the tests :/ rlb: it's using autotools rlb: i.e. if you just set TESTS, then automake "handles it". rlb: See "info automake" for details. rlb: https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html rlb: And I think we can just set it to narrow. vagrantc: ok, i can "make TESTS=dist.scm" vagrantc: er, "make check TESTS=dist.scm" rlb: right *: rlb is trying popen.scm rlb: vagrantc: if you're in the top-level after a "fakeroot debian/build" looks like this may allow us to run guile using the package modules/libs: rlb: LD_LIBRARY_PATH=debian/build/guile-3.0/libguile-ssh/.libs guile -L modules rlb: and then, for example, (use-modules (ssh auth)) should work. rlb: Assuming that's accurate enough, then we can copy and narrow down something like popen.scm, running it via "... guile ... foo.scm" rlb: Oh, and here, "guile" is guile-3.0, but of course you could also just say that explicitly. vagrantc: check rlb: oh rlb: I know :) rlb: maybe wingo: what is it? :) rlb: Testing... rlb: (may be that change to test-end) vagrantc: this didn't work ... LD_LIBRARY_PATH=debian/build/guile-3.0/libguile-ssh/.libs guile-3.0 -L modules debian/build/guile-3.0/tests/popen.scm rlb: i.e. they're doing the same thing I was. rlb: (in lokke) rlb: Getting the test-runner fail count to decide what the exit code should be *after* the final test-end. rlb: In 3.0.4 that worked fine. In 3.0.5, the runner is gone. rlb: i.e. it's just #f vagrantc: this sounds promising :) rlb: yep rlb: wingo: fix is something like this: rlb: (let ((result (test-runner-fail-count (test-runner-current)))) rlb: (test-end "popen") rlb: (exit (= result 0))) rlb: rlb: But I wonder if we should revert that change. This is at least the third test-suite we know of that's been broken in a Z release. rlb: (though not sure what caused the change) rlb: vagrantc: if you patch all the test files to do something like that at the end, rather than just "(exit (= (test-runner-fail-count (test-runner-current)) 0))", I think it'll stop crashing. rlb: vagrantc: so, is the test suite poorly written, or is that a workaround for otherwise correct code? rlb: cf. https://github.com/lokke-org/lokke/commit/164cd30032670a3cf2be7bb2734bfb1693893608 rlb: vagrantc: I'm not sure the behavior is defined by srfi-64, but previously, even after you exited the top-level test-group, you could still access the runner, but after 3.0.5, the runner is #f once you exit the top-level group. vagrantc: so the test suite is relying on undefined behavior, at least *: rlb looks at the srfi-64 spec again... wingo: rlb: is there a bug for this? wingo: srfi-64 didn't change fwiw vagrantc: ok, cargo-culting your suggestion seems to have worked :) vagrantc: at least for popen wingo: so it could be a bug introduced by the compiler. or i dunno, i would like to know tho rlb: from a quick skim, i could see an argument that 3.0.5 is actually correct. rlb: "It is an error to invoke test-assert if there is no current test runner." rlb: and rlb: "Additionally, if the matching test-begin installed a new test-runner, then the test-end will de-install it, after reporting the accumulated test results in an implementation-defined manner." rlb: So yeah, if there is no runner, the first test-begin should create one, and then that ^ says, that it has to "de-install" it... rlb: wingo: no bug yet, that I recall. rlb: But maybe it's not a bug... wingo: but what could have caused the behavior change wingo: ? rlb: If it's a parameter, then maybe we're cleaning those up better or something? *: rlb guesses wildly wingo: don't think so wingo: i mean the change list in 3.0.5 was small rlb: (Though it would be nice to have some "normal" way to do what I do in that commit, and what someone else commented on the other day -- they had to come up with something similar.) rlb: Yeah, not sure. wingo: aaaahhhh rlb: otoh, it's not *that* big a deal - just have to wrap the final test-end in a let. wingo: there was de5d1a7f99b8e952b115237ebc29633062f99bb9 wingo: not in NEWS :( rlb: Hah, there we go :) wingo: https://git.savannah.gnu.org/cgit/guile.git/commit/?id=de5d1a7f99b8e952b115237ebc29633062f99bb9 rlb: Yeah, so my current inclination is to think that my srfi-64 code was buggy. rlb: i.e. that the current behavior does in fact match the spec better... wingo: well, i am happy at least it is not the compiler :) rlb: nodoubt rlb: maybe at least add something to the NEWS (in the 3.0.5 section) for the next release rlb: vagrantc: won't be surprised if that ends up being the whole problem. vagrantc: rlb: so for guile-ssh i patch the tests and submit it to guile-ssh upstream? rlb: Sounds plausible to me. Currently seems like we were actually fixing a variance from the spec, and so whether now or later, they'd likely need to address it. wingo: i regret to inform yall that i am back on my bullshit wingo: (call-with-input-string "(#*101010101012)" read) wingo: $1 = (#*10101010101 2) rlb: haha wingo: hahaha (call-with-input-string "#*2" read) => (#* 2) *: rlb vaguely wonders about a generative tester for read... rekado: wingo: I get $1 = #* wingo: ah wingo: i meant wingo: hahaha (call-with-input-string "(#*2)" read) => (#* 2) wingo: sry vagrantc: hrm. applying those patches fixed all but one of the tests... wingo: #* is a weird datum *: vagrantc double-checks to make sure the patch for that test wasn't botched RhodiumToad: a bitvector of length 0? wingo: RhodiumToad: yep vagrantc: ah, missed one of the tests... vagrantc: rlb: doh! apparently this was already fixed in guile-ssh upstream git... should have looked there first :) rlb: heh, oops vagrantc: rlb: thanks for all your help, though :) wingo: (call-with-input-string "#:#|foo|#bar" read) wingo: $1 = #:bar *: wingo glares at read.c RhodiumToad: uh RhodiumToad: oh, #|foo|# is a comment? wingo: yeah. and for some reason the reader skips whitespace between #: and bar wingo: ease of implementation i think spk121: all bugs are features spk121: also, what do you think should happen if you change the first colon in your example into a semicolon wingo: spk121: should happen? input-error wingo: unexpected EOF while reading # object wingo: aaah wingo: hum wingo: spk121: i take it back :) #;EXPR skips EXPR as a comment wingo: in this case it skips the single expr #|foo|#bar wingo: so the result is simply EOF wingo: #|foo|# itself being a comment wingo: indeed wingo: hey totally unoptimized, essentially untested (ice-9 read) is in the repo wingo: sometime soon I will run it against read.c for all .scm files in guile, to verify it does the same thing wingo: night! roelj: wingo: It's amazing to see how you've been hacking away at this for more than a week! fnstudio: hi, i'm having a look at https://www.gnu.org/software/guile/manual/html_node/Creating-Guile-Modules.html and, particularly, at the syntax for creating a new module, eg `(define-module (ice-9 popen))` fnstudio: the fact that the module name can contain multiple keywords (in the case above `ice-9` and `popen`), is that a form of namespacing? fnstudio: is the idea that i can have another file where, say, `ice-9 pclose` is defined? fnstudio: and then there's maybe a way for importing all modules in a group (ice-9) together at the same time by just importing ice-9? rekado: fnstudio: no. (ice-9 popen) basically corresponds to “ice-9/popen.scm”. fnstudio: rekado: oh i see rekado: if you want to re-export things in a file “ice-9.scm” you’d have to do that manually rekado: you can do that, but it’s not done automatically purely based on the name fnstudio: could i have something like `ice-9/pipes/open.scm`? rekado: sure, the module name would be (ice-9 pipes open) fnstudio: and, if yes, would that be imported via ... fnstudio: right fnstudio: you were faster fnstudio: cool rekado: but it’s unusual to have one module per exported definition fnstudio: in that case, what would i get if i imported (ice-9 pipes)? rekado: nothing fnstudio: oh rekado: because you didn’t define a module called (ice-9 pipes) in ice-9/pipes.scm fnstudio: ah i se fnstudio: *see rekado: you can do that, though, and have it load (ice-9 pipes open) and re-export its bindings. fnstudio: (i might be wrong but that reminds me of when submodules are re-exported via Python's __init__.py if i may make a comparison here) fnstudio: ok, that was very helpful rekado, many thanks rlb: Should a guile/scheme UUID implementation provide them as a record/class? What I have now is just a 128-bit int, but of course that doesn't allow you to distinguish it in any way. rlb: daviid: tested lokke against current bullseye (in a vm) and "make check" works fine with libltdl-dev 2.4.6-15 rlb: (guile-3.0) daviid: rlb: hum, i use guile 2.2 but i don't think it should matter daviid: i didn't try make check, i tried make, just make daviid: which fails daviid: here make check fails, both g-golf and lokke daviid: with the same message ... the only diff with a 'normal' just bullseye distro is i added experimental repo in the source list and installed _only_ gtk-4 and dependencies daviid: rlb: do you still have the file '/usr/lib/x86_64-linux-gnu/libltdl.la' or not? daviid: rlb: could it be one of the autoconf, automake, autotoolsdev ... ? daviid: rlb: something is diff in between your bullseye 'vm' and bullseye 'regular' - on of the above, gcc* maybe ... don't know what, but somehting is diff, i wish i knew - have to leave ... sorry for the 'fasle positive report', tx for your help, if you have any idea of what could cause such a problem, ping me ... rlb: sneek: later tell daviid I can set it up and try with 2.2 tomorrow. Also, if you have access to vagrant, I can give you trivial steps to reproduce whatever I find. Oh, and if I forget, certainly feel free to ping me. sneek: Okay. chrislck: It's Friday \o/o\o/ wingo: woo :) spk121: wingo: mini-cmp seems to work okay in Guile. Qualitatively, times to build, run make check, and run benchmarks seem ballpark the same AFAICT spk121: Probably should write some benchmarks that really exercise GMP spk121: *mini-gmp wingo: spk121: how does choosing between gmp and mini-gmp work? spk121: wingo: there's a 'use=minigmp' branch in git which adds an --enable-mini-gmp configure option. civodul and I have been playing with it a bit spk121: the autoconfigure could be better spk121: pro: one less dependency. con: possibly slower, more C code in tree chrislck: maybe wingo can convert gmp to scheme dsmith-work: Happy Friday, Guilers!! pkill9: what does guile offer over common lisp? dsmith-work: pkill9: Scheme dsmith-work: ;^} leoprikler: rare lisp ;) dsmith-work: Hygenic macros! rlb: language tower? :) dsmith-work: Does not have restartable exceptions. :( ngz: Hello. I'm looking for an idiomatic way to write the following: (cond ((string? (foo ...)) (foo ...)) ((string? (bar ...)) (bar ...)) (else "")). Of course, I could let-bind (foo ...) and (bar ...) to avoid calling them twice, but I wonder if there's something more elegant (e.g., which doesn't require to evaluate (bar ...) if (foo ...) returns a string). RhodiumToad: you have a number of forms which you want to evaluate in sequence until one returns a string, then stop? ngz: Yes ngz: or return the empty string if none returns a string RhodiumToad: maybe something like (define (value-if-string v) (if (string? v) v #f)) then use (and (value-if-string (foo ...)) (value-if-string (bar ...)) "") RhodiumToad: er, or not and ngz: I see. ngz: That is better indeed. Thanks. RhodiumToad: you could of course hide it behind a syntax rule, but it seems clear enough without ngz: Besides, at the moment, I only need this once. wingo: moo RhodiumToad: oom spk121: omo rlb: daviid: just re-tested and tested 2.2 too. Here's what I did: https://paste.debian.net/hidden/ff084bd5/ You should be able to more or less exactly replicate in a similar throwaway vm if you have vagrant handy. So there at least, building and testing lokke works fine with libltdl -15 and no libltdl.la. brown121407: Is there something like ,@ but for a list created with `list'? I want to expand a list inside another one. rlb: brown121407: hmm, depending on what you need, apapend-map might be useful, or concatenate, or (apply append ...). brown121407: I was interested if I can translate something like this in a call to `list': `(a b ,@(if #t '(c d) '()) e f) rlb: (cons* 'a 'b (if ...))? rlb: oh, there's the e f brown121407: That gives me something a bit weird for what I need: (cons* 'a 'b (if #t '(c d) '()) 'e 'f) => (a b (c d) e . f) ... The result I want to achieve is (a b c d e f). rlb: Yeah, I think you might need to wrap it in an apply append or concatenate or... brown121407: I'll look into those ideas, thank you :) rlb: which is just fine for programmatic applications, but perhaps not if your goal is to keep it readable. rlb: i.e. for that quasiquote/splicing is likely preferable rlb: wrt append: (apply append '(a b) (if #t '(c d) '()) '((e f))) rlb: or whatever rlb: (Which is one way to implement splicing if you're trying to write a reader or macro expander that does splicing...) mwette: (define-syntax list/@ (syntax-rules (@) ((_ '()) '()) ((_ @ l r ...) (append l (list/@ r ...))) ((_ x r ...) (append x (list/@ r ...))))) mwette: probably much better to implement w/ cons RhodiumToad: what's the benefit over ` ? daviid: back to this libtool related bug, which drives me crasy :) - so, the second make encantation works, but i now see make install fails - https://paste.debian.net/1185023/ daviid: rlb: are you useing bullseye as well? jgart: Hi, Is ash the same as the 2k-ary method? jgart: https://www.gnu.org/software/guile/manual/html_node/Bitwise-Operations.html nalaginrut: I think ash is the same with << or >> in C, not sure about what is 2k-ary rlb: daviid: I'm somewhere between bullseye and sid, generally, but right now I'm still on libltdl-dev -14. rlb: Are we thinking that guile and/or lokke builds may break as soon as I upgrade? If so, maybe I should test in a vm first, and/or file a bug or badger the maintainer... daviid: rlb: ok so you have libtool -14 stil - i thought i should try to unpack libtool -14 somewhere, then manually copy this .la file and see if at least i can work til a better solution ... not ideal of course, but maybe worth a try daviid: because it seems it is libtool -15 the problem, not libltdl-dev, iiuc jgart: nalaginrut, thanks! spk121: morning wingo wingo: heya spk121 wingo: good late evening to you :) spk121: yeah, can't sleep spk121: wingo: I would like to add a C func to guile to help out guile-gi. A func to call that says if a thread has been initialized for Guile. Could just patch scm_current_thread to not SEGV if called on an un-guile thread wingo: spk121: sure. how would it work for scm_leave_guile ? wingo: i would have it be scm_c_current_thread and have it return either struct scm_thread* or NULL wingo: i assume you would want to use it from C, right? i guess it makes no sense to use it from the ffi wingo: because at that point you are already in guile spk121: well, the actual need it to know if a C callback should scm_with_guile or scm_init_guile to install the top-level continuation, because if someone uses guile to call the glib functions that spawn non-guile C callbacks in other threads, hijinks ensue wingo: isn't scm_with_guile sufficient in both cases? spk121: Not exactly, since I'd like errors to be caught at a higher level if there is guile -> callback -> guile, but at a lower level for newly_spawned_c_thread ->guile spk121: and it is not easy to tell which case has occured because of bastard api like g_task_run_in_thread wingo: spk121: how about a thread-local parameter in scheme? you would set it in your "main" threads wingo: and in aux threads it would be #f wingo: so you can know in Scheme whether to install a catch-all for threads spawned by C, or whether to propagate the exception on if there is pending Guile handlers on the stack spk121: wingo: so if I use scm_with_guile in a callback, I can check that variable to see if I can re-throw errors caught at scm_with_guile's local continuation barrier? wingo: the idea would be more that you install your own catch-all trampolien that invokes the callback in question, which would run inside the continuation barrier. if (in-gobject-thread) then the trampoline just invokes the callback and lets any existing exception handler handle exceptions. otherwise you invoke the thread in call-with-error-handling wingo: er, invoke the callback wingo: or whatever other error-handling strategy you want spk121: hmm, I'll give it a try wingo: dunno, just a thought pkill9: does there exist a desktop launcher similar to kupfer (which allows you to select actions) written in guile and supporting extensions written in guile? solrize_: hi is the guile compilation command really supposed to be guild? i don't get many search hits. i'm trying to use it on debian and i don't know what package to install. thanks leoprikler: solrize_: "guild compile" to be exact solrize_: leoprikler, thanks yeah, but i didn't see how to install guild leoprikler: guild is a part of the guile package leoprikler: on debian you probably want the -dev variant solrize_: hmm ok will try that thanks rlb: solrize_: yeah, that's it rlb: $ dlocate /usr/bin/guild rlb: guile-3.0-dev: /usr/bin/guild-3.0 rlb: guile-2.2-dev: /usr/bin/guild-2.2 rlb: rlb: daviid: note that libltdl-dev is a binary package produced by the libtool source package, and at least here, the .la file is in the former (in -14), iirc. rlb: not sure if that helps (assuming I *am* recalling correctly) daviid: rlb: i did clone lokke, setup, autoreconf, confugure fails with ./configure: line 13402: syntax error near unexpected token `3.0'\n ./configure: line 13402: `GUILE_PKG(3.0 2.2)' daviid: solrize_: how does guile do bignum arithmetic? i notice it's lots slower than python or sbcl daviid: rlb: which admittedly isn't the cause of the error, your configure.ac entry GUILE_PKG([3.0 2.2]) is correct, afaict, it be an error 'above' maybe? daviid: rlb: so, i copied the latest guile,m4 in lokke/m4, and configure pass daviid: rlb: so, lokke make fails as well, expected of course but wanted to confirm daviid: rlb: here https://paste.debian.net/1185124/ daviid: rlb: yes to your above comment wrt libltdl-dev, after i wrote i checked that the 'missing' .la file is in libltdl-dev rlb: daviid: ok, if I get a chance I might investigate this weekend. rlb: Do we already have any idea if guile (and/or building guile C extensions) currently depends on having that file available, either because it's a hard requirement, or perhaps because of the way guile's m4 macros are currently arranged? rlb: wingo: i.e. does the building of guile C extensions currently depend on the availability of libltdl.la? (if you, or anyone else, knows)? wingo: rlb: i don't think so but i could be wrong wingo: how could it depend on libltdl.la ? wingo: you can build guile extensions against installed guile with all .la files removed wingo: so i would think, no problem ArneBab: solrize_: where do you see GUile slower than Python? Do you compare against numpy? ArneBab: GUile→Guile narispo: efraim: hey, so I will try patching cargo to disable mtime checking for .rlib, maybe that's the issue, since incremental compilation (what .rlib is in part for AIUI) relies on mtime narispo: And since we reset mtime in the store.. daviid: rlb: fwiw, libg-golf is not a guile C extension, it is a 'simple' C (tiny) lib, a few functions only, mainly implementing as a function, those macros in GLib/GObject that I couldn't 'do without', and that g-golf bind using the ffi ... daviid: rlb: so, starting with libtool 2.4.6-15, the autotool chain can't build/make any C shared lib, in its first incantation ... and although any subsequent incantation seems to work, then make install fails (for that C shared lib we are trying t build I mean) solrize_: ArneBab, this takes around 0.5 sec in guile 2.0: solrize_: (define a (expt 2 (expt 3 (expt 4 2)))) solrize_: (display (remainder a 1000000000)) solrize_: (display "\n") solrize_: equivalent in python 3.7 is about 0.25 sec and in sbcl is around 0.15 sec iirc efraim: narispo: sounds like a good idea solrize_: sorry 0.041s sbcl --script solrize_: i didn't try numpy which i thought was mostly for arrays narispo: efraim: there was quite fruitful discussion with them I could have rekado: uhm, 0.5s is fine. I get a segfault with Guile 3.0.5. rekado: sometimes it finished rekado: sometimes it segfaults rekado: and sometimes it takes forever solrize_: none of that sounds good ;) rekado: no! rekado: when it segfaults it takes less than 0.5s ;) solrize_: haha narispo: efraim: someone just suggested we could get rid of cargo and use rustc directly, reimplementing parts of cargo within GNU Guix to fit our needs, we could even dynamically link stuff this way. What is missing is build script handling when doing that, so maybe we can rewrite build scripts in Scheme or reimplement that part as well. narispo: efraim: do you know where the other guy we had spoken conversation with is? rekado: narispo: (this is #guile, #guix is next door) narispo: oooppss! Didnt notice narispo: zorry *: rekado submitted a bug report rekado: I get the same segfault in 3.0.2 ArneBab: wingo: is there a way to get inner defines not only in (let () ), but also inside (begin …), when and in cond-clauses? (basically everything that starts a multi-element body)? rekado: and with 2.2.7 rekado: for reference: it’s bug 46447 solrize_: where is the tracker? solrize_: ah nm its in topic solrize_: is there a guile builtin for reduce or foldl or sth like that? RhodiumToad: see srfi-1 solrize_: thanks solrize_: ah nice spk121: civodul: hmm. Well, it is hard to get m4/autoconf right on the first try daviid: spk121: fwiw, I received great and friendly help on ##workingset, when i was patching guile-lib to use -O0 for guile-3.0, compile src/md5.scm (only this file ...) daviid: spk121: not the same problem of course, but as we quickly get rusty when it comes to autotools, worth asking for help there (and #autotools as well) rlb: What's a preferred representation for a 128-bit value in guile right now? Just a 128-bit integer, or a homogeneous vector or...? (I forget how 128-bits is arranged by guile/gmp.) wingo: rlb: depends on how you want to use it -- if you want to use it as an integer or as bytes wingo: former case would be integer, latter is bytevector wingo: on 64-bit machines, 128 bits will be two machine words for the data plus an additional 3 or so of overhead rlb: In this case I was toying with uuids, so bit-ops, so maybe integer? rlb: (Though easy to manipulate as #u64 too...) leoprikler: does guile have an array->bitvector or int->bitvector function? lloda: bitvectors are arrays so you can use array-copy! between them lloda: but this is conversion, not casting lloda: for bytevectors and arrays there are a bunch of ways to cast contents such as pointer->bytevector, or scm_take_xxx in the C API lloda: these are unsafe tho lloda: but i don't think there's a way to make a bitvector out of 'memory' lloda: in the public API that is mwette: lloda: Long ago I submitted a bug report asking for more bitvector routines, but later closed it. If important to you maybe open again. I needed bitvector-copy (e.g., copy first 100 bits into new bitvetor sized 200 bits), bitvector-tas, etc. I ended up rolling my own C code. lloda: wingo refactored the bitvector stuff a few months ago lloda: so now could be a good time to add stuff lloda: but slicing can be done with arrays, so imo it's not the best idea to add slice args to every vector type out there mwette: The slice-copy part for me ended up just wanting to extend a bitvector by 1 bit. I had 10,000 bits and needed one more. lloda: i miss a -resize sometimes but i'm not sure if it would make sense to have that in the API lloda: i mean if there's an advantage to use the internals to implement that as opposed to just make- & -copy mwette: with 32 (now 64) bit increments the chance of adding one bit w/ ~zero cost is 31/32 (63/64) lloda: if you remember your bug number we could reopen it and have a discussion there mwette: lloda: 29845 lloda: array-copy from (ice-9 arrays) can be used to copy bitvectors lloda: the result will be a bitvector lloda: but really having bitvector-copy looks like a no brainer mwette: I don't need it anymore, so don't open for my sake. lloda: ok manumanumanu: mwette: ok, so I see no mention of any limits of the optimizer, at least not in the DCE. I am just curious if it has some kind of limit to how much it does for an expression. An (if #t ...) should be a pretty obvious optimization candidate. dsmith-work: Hey Hi Howdy, Guilers fnstudio: hi! anyone has any recommendation in terms of guile and autotools (in the context of a guile toy project)? i know there's hall, which automates large part of the tasks (and which looks great in many regards), but i think i'd be more interested in a minimalist (and purely manual) approach, to familiarise myself with the mechanism fnstudio: autotools - or any recommended build mechanism, but i suppose autotools is the recommended one ruffni: hmm.. logs.guix.gnu.org says: Resource not found: http://127.0.0.1:3333/guile/search when searching for a string ruffni: anyhow, reading through "Guile Implementation" in the docs and scripting on a dependency-graph tool i'm wondering where in guile code is (load) defined? where and how is guile-code lexed? i have this strong feeling in my gut that i'm reinventing major parts of the wheel (which is kinda unnecessary) rekado: ruffni: it’s a faulty redirect to http://logs.guix.gnu.org/guile/guile/search?query=foo rekado: (there’s an extra “/guile”) ruffni: rekado: this doesn't work either ruffni: mysterious rekado: http://logs.guix.gnu.org/guile/search?query=foo certainly works rekado: (with the extra “/guile” removed) rekado: it looks like the search index is a little outdated, though ruffni: nvm got it ruffni: thanks! wingo: good evening wingo: so you know the usual keyword syntax, #:foo wingo: also the prefix syntax, :foo wingo: and the postfix syntax, foo: wingo: but did you know about the spaced-out syntax, #: foo ft: Gold. :) RhodiumToad: wtf *: RhodiumToad actually likes using the postfix syntax and the usual syntax together - #:foo when referring to the keyword "foo" itself, and foo: when actually _using_ the keyword to identify something else ft: wingo: so you're going for bug-for-bug compatibility, rewriting the reader? :) wingo: yeah unfortunately, bug-for-bug compat for now RhodiumToad: (e.g. init-keyword: #:mything ) ft: Probably for the better, you never know what depends on all those precious bugs. :) ft: But I can see how that's frustrating. rekado: wingo: I met the spaced-out syntax recently when trying to extend wisp for the GWL. Had to scrap it all because it would clash with wisp’s use of “:” as wrapping the rest of the line in parentheses. rekado: http://logs.guix.gnu.org/guile/2021-01-16.log#081007 rekado: it’s bug 45914 wingo: rekado: tx for that wingo: honestly i think it is just a bug and we should fix it wingo: i am keeping a list of things to fix once i get out of this hole wingo: > #@-(1 2 3) wingo: $3 = #(1 2 3) davexunit: is the reader being rewritten? davexunit: C -> scheme, I presume? rekado: it works with primitive-fork and execlp rekado: this works: guile -c '(for-each (lambda (n) (if (zero? (primitive-fork)) (begin (display n) (execlp "sleep" "sleep" "3")) (begin (waitpid WAIT_ANY)))) (list 1 2 3 4))' civodul: rekado: waitpid(2) in the parent gets automatically resumed civodul: not sure why civodul: perhaps a genuine bug *: civodul -> zZz civodul: ttyl! rlb: ruffni: that may be a known issue... https://salsa.debian.org/rlb/deb-guile/-/blob/deb/guile-3.0/d/sid/master/debian/patches/0005-Mark-test-out-of-memory-as-an-expected-failure-for-n.patch ruffni: yeah, i found a couple of older mentions of this test failing. some a couple of years old. i wasn't sure if it might be a new bug failing the old test or the same issue as mentioned here: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29884 chrislck: maybe guile needs a ReadLikeGuile2.2 option wingo: i suppose if scheme read is the "real" reader, we can remove support for all reader options in read.c civodul: probably civodul: will scm_read call the Scheme read? wingo: civodul: yeah i think so wingo: i guess the bootstrap reader used by C would call an internal function or so civodul: ok *: wingo constructs bespoke hydroponic bug farm civodul: :-) *: spk121 started a build script that is nearly *: spk121 a full 'make' at this point civodul: spk121: i checked out the mini-gmp branch but i keep being interrupted since then :-) civodul: i'll report back soonish! spk121: civodul: no worries spk121: plus, you had a pretty busy weekend! mwette: glib stretches the C PP to the limit. How is this C?: GLIB_DEPRECATED_FOR('G_TYPE_VARIANT') mwette: rlb: mwette: https://github.com/Hirrolot/datatype99 which appears to depend on https://github.com/Hirrolot/metalang99 -- have not delved :) rlb: "Metalang99 is a functional language aimed at full-blown C99 preprocessor metaprogramming.~... mwette: rlb: thanks. The C99 parser in my ffi-helper can't parse that because it thinks it's a broken character literal. For now I just have to stop using glib as a test case for the ffi-helper. RhodiumToad: ah, I see that macro is just stringifying its arg, that's why it works mwette: What's the type of the argument literal? RhodiumToad: type? RhodiumToad: at least in the file I'm looking at, there are two versions of the macro; one ignores the arg entirely (for old compilers), RhodiumToad: the other is: RhodiumToad: #define G_GNUC_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead"))) mwette: Scheme <-> C: "foo" <-> "foo" ; #\c <-> 'c' RhodiumToad: so in this case the "f" argument is never actually interpreted as any kind of C code RhodiumToad: it's just converted to a string literal and then spliced into a compile-time attribute mwette: Right. I see now. mwette: Thanks. RhodiumToad: macros that use stringification or token pasting aren't really possible to interpret without expanding them mwette: Exactly. In a standalone case my parser works on that. I need to dig further into why updated glib is not getting parsed. RhodiumToad: er, that was the wrong #define I pasted above, but the right one is actually identical to it barring the name mwette: Confirmed it's choking on the attribute version expansion shown above. manumanumanu: wingo: btw, weinholt has a scheme reader that is r6rs conformant I believe. It is called "laesare" which means "reader". I think it is hosted on github, and unless I'm mistaken it is permissively licensed. manumanumanu: oh yes: https://github.com/weinholt/laesare mwette: RhodiumToad: when I try to isolate a simple case, it works: https://paste.debian.net/1184741/ RhodiumToad: mwette: what if you do char *s = bar('abc'); ? mwette: same result RhodiumToad: hmm RhodiumToad: or if bar(X) is defined as "blah " #X " blah" ? mwette: char *s = "blah " "'abc'" "blah "; mwette: b RhodiumToad: well that's correct manumanumanu: karlosz: are you the guy who committed the riscV port of SBCL? karlosz: yes manumanumanu: nice job! manumanumanu: I'm still waiting for my sifive board, but sbcl is one of the things I expect to try on it karlosz: ah, i just used a vm mwette: RhodiumToad: I found the bug. When macro reference is "dead code" I was just letting it pass through. I needs to read the arguments first. manumanumanu: so, does anyone have any idea of how far the optimizer goes? I have a case where ,opt does _not_ do dead code elimination. I end up with (if #t do-this (failure)) in the output. manumanumanu: pretty deep in a deeply nested loop, though. mwette: module/language/cps/dce.scm manumanumanu: thanks spk121: wingo: with you talking about bootstrapping the reader... One evil idea would be to port the Guile compiler to janekke's mes, compile the reader and the rest of BOOTSTRAP with mes. And just use the .go file from that. eduardore: Hello? My first connection to #guile, can anyone read me? :) RhodiumToad: we see you eduardore: ah! great thanks for answering mwette: manumanumanu: which sifive board? HiFive Unmatched? dsmith-work: {appropriate time} Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) dsmith-work: goodbot joshuaBPMan: I think it took me about three months on hanging out on irc before I realized that sneek was a bot... civodul: spk121: just built --enable-mini-gmp and it went all fine civodul: so i guess i'm all for it! civodul: perhaps one thing we could do is automatically enable mini-GMP support when GMP is not found dsmith-work: civodul: Ah, cool. dsmith-work: civodul: So mini-gmp is only a subset of gmp, right? Does Guile not use the "extra" stuff in (maxi-)gmp? civodul: dsmith-work: it's a subset and simplified (pure C) implementation, AIUI civodul: Guile doesn't need more than that feature-wise dsmith-work: Ok, very cool. chrislck: would guile(mini-gmp) pass same benchmarks as guile(gmp) but only slower? spk121: civodul: I did already put in the logic to enable minigmp if gmp not found, I think. But I didn't test it spk121: chrislck: it should be identical but slower, as I understand it spk121: dsmith-work: I did have to re-implement one function having to do with double to integer conversion, but that was it civodul: spk121: ah ok, i didn't look at the diff in detail, but that logic didn't work for me civodul: anyway, we'll see what wingo thinks but it could be a 3.0.6 thing IMO chrislck: \o/ some more benchmarks would be very welcome. rekado: I have a loop that spawns processes; I want to abort it on SIGINT. rekado: this is the test: guile -c '(begin (for-each (lambda (n) (display n) (system* "sleep" "3")) (list 1 2 3 4)))' rekado: I tried adding (sigaction SIGINT (lambda args (pk 'got-signal))) but it seems to never be triggered leoprikler: could sigint already be intercepted by something else? iirc there was a repl server that did that rekado: changing it from SIGINT to SIGCHLD works rekado: or… well, I probably *always* get SIGCHLD when a child process terminates leoprikler: you could make it sigusr *: rekado rediscovered (ice-9 runq) daviid: rlb: i am surprised to read, in the link you pasted yesterday https://metadata.ftp-master.debian.org/changelogs//main/libt/libtool/libtool_2.4.6-15_changelog - that libtool (2.4.6-15) unstable; urgency=medium - that it says 'unstable', but i amrunning bullseye daviid: if i search debian packages, libtool (2.4.6-15) is part of testing daviid: nothing important, just curious daviid: it still fails ... on the first 'make' incantation, then works on the second and following ones ... which is ok to work 'locally', but i can't run 'make distcheck' daviid: spk121: I think i should keep the change you suggested, about using libg_golf_la_LIBADD instead of libg_golf_la_LIBS daviid: I probably used libg_golf_la_LIBS as a 'copy' of what I did look at when starting to need lib*, guile-cv also has a mini C lib ... but not because of any knowledge to justify it on my side spk121: daviid: yeah, I think the docs say to prefer _LIBADD, daviid: ok, perfect, thanks for the tip daviid: have to go afk, bbl dftxbs3e: hello, how would you append to a '("list" "of" "strings") inline? '("list" "of" ,@(if #t '("more") '()) "strings") ? RhodiumToad: in what context? RhodiumToad: ,@'("more") works, btw dftxbs3e: RhodiumToad, here: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/tex.scm#n2508 dftxbs3e: RhodiumToad, thanks a lot for trying to help, your solution doesnt work if I put a condition there, it says: Expecting string got if dftxbs3e: RhodiumToad, I had another mistake.. messy, I finally got it thanks a lot! '("list" ,(if (string-prefix? "powerpc64le" dftxbs3e: (or (%current-target-system) (%current-system))) dftxbs3e: "luajittex") "of" "strings") dftxbs3e: is there an Emacs extension to toggle background coloring escape "layers" of Scheme code? wingo: aaaah delightful, chicken also does the #t1 thing wingo: #;1> (begin #t1) wingo: 1 wingo: #;2> #true wingo: #t wingo: #;3> wingo: Error: unbound variable: rue wingo: very good. wingo: scheme is ridiculous sometimes leoprikler: is #true a guile-only thingß wingo: it is an r7rs thing wingo: i think somehow the chicken i ran didn't support r7rs out of the box ruffni: i ran into some weird bugs which apparently i introduced into my projects with circular imports (which i can clearly see: is an issue). so i started looking for a tool to visualize my dependencies, because things start to get messy as soon as you have more than a couple of modules (this might also be due lack of ability from my side). reading in the docs there is this sentence: "However Guile does not yet do proper dependency ruffni: tracking[...]". does "not yet" refer to an actual plan? leoprikler: I'm not sure whether there are plans already, but it most certainly means that those plans have reached a point of maturity where they'd be advertised in greater detail (e.g. "but Guile 3.2 will have it") ruffni: do you know if such information stored on the (open) web? the branch names and last commits on savannah don't give any obvious hints leoprikler: If it is, then it'll likely be mentioned in the guile-devel mailing list. ruffni: i'm already looking into that but i'm not sure about the keywords i should be searching. "dependency tracking" yields results ~10yrs old... ruffni: i guess i'll search some more and post to the list if still needed wingo: ruffni: no plan, sadly wingo: well. i am not sad about it ;) but it would be nice to fix & is important rlb: I've also noticed that the error message when you have a dep cycle is a bit mysterious, i.e. I just generally saw "foo undefined" for some foo, and had to learn what that meant. Be nice if we can arrange it to be able to just say that we've hit a cycle. rlb: (Assuming what I saw wasn't a result of some of my other mess...) wingo: yeah. many things to fix wingo: aaaaaaaaaahhhhhh wingo: i am back on my bullshit wingo: (call-with-input-string "(#true1)" read) => (#t 1) wingo: i hate it leoprikler: That's fine leoprikler: Golfers unite! leoprikler: sneek: seen davexunit sneek: davexunit?, pretty sure was seen in #guile 10 days ago, saying: it uses the slot args to make a new slot with #:virtual allocation, but it only copies over the standard args. my understanding is that slots should be able to accept arbitrary initargs that metaclasses can use to do custom things.. wingo: AAAAAAAAAAAAAHHHHHH wingo: scheme@(guile-user)> (call-with-input-string "(#fa)" read) wingo: $3 = (#f a) wingo: scheme@(guile-user)> (call-with-input-string "(#f3)" read) wingo: ice-9/boot-9.scm:1669:16: In procedure raise-exception: wingo: #:1:6: missing '(' in vector or array literal wingo: i hate it so much!!!!!!!!!!!!! rlb: Heh - maybe "amusing"/related I found that the jvm clj reader decides something is a number if the first char is a unicode "digit", but then rejects the number if all the digits aren't [0-9]... wingo: gosh this is so distressing it's funny ;) well, better reproduce the bugs :P davexunit: leoprikler: hi I'm here if you have a question leoprikler: Ah, yes, it seems your git is down wingo: aaaaaaaaaaaaaaaaaaaaaaa wingo: (call-with-input-string "(#true #True #tRue #false #False #fAlse)" read) wingo: what does it produce wingo: (#t #t #t #f #f #f Alse) wingo: :-)))))))))) RhodiumToad: wtf wingo: that is "just" a bug, but yes wtffff leoprikler: the bug is that Rue is not included as well :) wingo: leo trolling :) davexunit: leoprikler: hmm... seems you are right. ruh roh leoprikler: honest question though, should those things be case insensitive? leoprikler: what about #fаlse? manumanumanu: wingo: that vector one is nice! wingo: leoprikler: seriously speaking -- guile parses #true and #false case-insensitively wingo: there is a problem with #f because guile doesn't know if it starts a #f32() or #f64() wingo: or is false wingo: so there are some hacks, and one part is checking that the next char is "a", but it neglects to check case-insensitively wingo: which is the bug. but there are a few behaviors in this area that would be nice to improve (requiring a terminating delimiter, notably); i know you talk about golfing but (#t1) is... not nice :) civodul: wingo: uh, what's the deal with #fAlse?! civodul: ah #f32 wingo: read.c:1242 civodul: try_read_ci_chars (port, "lse") civodul: ooooh civodul: :-) civodul: you're making interesting discoveries in the process! civodul: there's nothing like hand-writter lexers :-) wingo: :) RhodiumToad: eh. a hand-written lexer may be preferable to "flex with a lot of horrible coding hacks" which I've dealt with in the past RhodiumToad: I found an O(n^3) loop in postgresql's lexer at one point civodul: uh civodul: i remember hacking on read.c as an optimization of the program *run time* in 1.8 civodul: that gives an idea of how much has changed rlb: civodul: hah, I have that same thing in the scheme based edn parser I just wrote, but it's even "worse": (read-symbol-or-literal-remainder port (strbuf c) 3 #(#\e #\s #\l #\a) #f)) rlb: (For "false"...) wingo: i think a reasonable path might be the compiler using "read" in scheme instead of c, then having the scheme read implementation be instead "read-syntax" and returning properly annotated syntax objects for every datum, including symbols and numbers civodul: heheh wingo: not sure if we will be able to transpile read-in-scheme to read-in-c; but it would seem we don't need to. read in c already exists and we have to make the same bugs civodul: wingo: you mean instead of using source properties? wingo: we can remove source properties from the C reader wingo: civodul: yeah rlb: wingo: that's more or less what lokke does, I think, fwiw, i.e. the top-level is read or read-for-compiler, and the latter is a slightly different, more complex representation... civodul: but you'd like to keep the C reader? for bootstrapping? wingo: exactly civodul: makes sense wingo: the only unsatisfying thing is that it doesn't necessarily reduce the amount of C that we have :P rlb: :) civodul: true civodul: we could generate it... but then that's a bootstrapping headache civodul: (and more code, too) wingo: yeah. but perhaps useful, if the generated code is editable wingo: related to the psyntax question of course :P civodul: or we could evaluate it during bootstrap? wingo: there is a tension there. you would like to be able to write the reader with all the modules and macros you want wingo: but for bootstrapping, you want minimal deps wingo: so i think a way forward can be to just write (ice-9 read) that uses whatever modules you want. then we think about bootstrapping etc later civodul: i see civodul: keeping read.c alongside (ice-9 read) sounds like a reasonable first step, then wingo: reproducing dumb bugs is painful tho :) wingo: (the right thing for the time being tho) wingo: anyway, zzzz, night! ArneBab: wingo: that reminds me why I moved from the direct string parser to using (read) in wisp wherever possible. There are so many edge cases … thank you for tackling them! I feel your pain. rekado: I’d be happy to hear any suggestions regarding SIGINT handling of SYSTEM* invocations rekado: I have this: guile -c '(begin (for-each (lambda (n) (display n) (system* "sleep" "3")) (list 1 2 3 4)))' rekado: and I cannot abort the loop with C-c civodul: rekado: presumably, SIGINT arrives during the waitpid(2) call? civodul: what does strace say? RhodiumToad: standard behavior for system() at the C level is to ignore sigint in the parent leoprikler: and if one were to use system* or fork/exec manuallyß ruffni: make check on master branch fails test-out-of-memory. is it bad? is it a bug? should i report? rekado: civodul: I see this: https://elephly.net/paste/1612825100.html rekado: it sleeps, gets interrupted, but then resumes sleeping rlb: wingo: I recall hitting some thing surprising wrt keyword syntax and modules -- but might be orthogonal to your reader work (and might have been intentional), I'll try to remember what it was, but maybe it was that the syntax doesn't reset at the end of a module? rlb: Not sure. At the time I was trying to set it to 'prefix before the define-module in a file so I could use :use-module etc. rlb: But then iirc it stayed 'prefix even after that module was loaded... rlb: (which did not end well :) ) daviid: rlb: I think setting 'prefix is global, always has been I think rlb: Guess that means you can't easily use it in that situation since you'd need to capture the current setting to restore at the end, and you'd need to capture/change the value outside the define-module... rlb: Dpesm rlb: In any case, I just stopped trying to use prefixed keywords. daviid: rlb: i did use it a very log time ago, a little, but because of the above, stopped, because if you use it, then you also force your users to have to use it as well, there is no way to us it in say, g-golf, and not in a g-golf user module ... fwiw, not a critic to guile or maintainers, just it is the way it is rlb: Ahh, right, it also affected the reader for all the :use-module loads. rlb: which I definitely didn't want. daviid: exactly rlb: Seems like it might be more useful if it were a per-module setting. rlb: but haven't really thought it through all that carefully daviid: it surely would, but i never dig in the reader to offer contributrion, so i kept 'silent' rlb: Yeah, I just thought of it given wingo's recent work... daviid: sure daviid: spk121: tx! i may report, or wait - having a tiny shared lib produced by autotools, i guess i am not the only one on bullseye doing this ... and any other will have more knowledge then muself to report and follow ... but if in afew days nothing popo-up as a solution, i will report - tx anyway roptat: what's the file containing guile history when using (ice-9 readline)? roptat: ah found it :) roelj: Sometimes I wish Scheme had multi-line string support like Java and Python. (with """, and the automatic prefix whitespace removal so that code indenting can be done as one expects), wingo: hungry-eol-escapes reader option seems close to what you want wingo: that is part of r6rs string syntax leoprikler: Well, at least Scheme strings are multiline by default :) tohoyn: roelj: I prefer string-append to multiline string constants roelj: Is there a compile-time equivalent for string-append (for when the arguments passed to string-append are all constants)? tohoyn: roelj: probably not, but that would be convenient roelj: the hungry-eol-escapes reader option looks fairly close indeed! :) But I don't know how to enable it when compiling Guile modules wingo: roelj: #!r6rs in your file will enable it wingo: and not set the global reader option roelj: wingo: Thanks. Does that work per file/module? wingo: per port wingo: which usually maps to per file roelj: I'll just have to try I guess :) roelj: wingo: I enjoyed the WASM talk today. I was wondering.. can we already execute Guile code in the browser to manipulate the DOM like one would with JavaScript? wingo: tx :) no, guile doesn't really have a good web story right now wingo: TIL that (call-with-input-string "#\\ " read) => #\space ArneBab: wingo: I missed the talk :-( — do we have Guile→wasm compilation now? roelj: wingo: Hah, I had to try this in the REPL as well. Interesting wingo: ArneBab: no :) was more a talk about wasm than about guile, fwiw ArneBab: ok :-) — still I hope it will be online as recording, soon. I want to share it in the company :-) rlb: wingo: wondered if it could make any sense to have some way to set reader opts just for the current module (e.g. keyword style, etc.)? Though not sure how we'd want do to that (and no longer all that important for me at least right now). ArneBab: (since I’m doing Javascript dev at work now (and Java), and looking for good ways to use wasm is clearly interesting — and be it only to preserve memory; I’ve killed quite a few browser tabs already when testing the limits of what we can do :-) ) rlb: wingo: also on the parsing front, it's perhaps not pretty, but https://github.com/rlbdv/lokke/blob/edn/mod/lokke/scm/edn.scm https://github.com/rlbdv/lokke/blob/edn/test/lokke-scm-edn wingo: rlb: i think it can make sense but also is a low priority for me rlb: Just got that working, and I'd be happy to contribute it to guile if it becomes interesting. rlb: "is or becomes" wingo: neat rlb: I'm going to see how it compares to my existing lokke-reader.c (derived directly from guile's reader), and will likely switch if I can. rlb: But that module is completely clojure-independent, i.e. scheme only, almost rnrs only. wingo: fwiw eqv? will be faster than char=? rlb: So could go in guile if we want an edn reader. rlb: orly? :) wingo: when comparing to a literal character rlb: thanks wingo: yeah guile's optimizer doesn't know anything about char=? rlb: I also didn't know if the char set operations for the smaller sets (contains?) would be comparable to a big case or memv... wingo: no idea there RhodiumToad: char=? has to worry about throwing errors for wrong types, eqv? doesn't rlb: For now I used sets, but could easily rewrite as a case or memv. RhodiumToad: I'd expect sets to win in most contexts RhodiumToad: bicbw rlb: I also matched the jvm reader in some cases where the standard wasn't clear or in one case where the jvm contradicted the standard (since I'm sure the jvm reader is by far the most common one). rlb: RhodiumToad: ok, thanks rlb: (Aside from anything else, personally, find edn a bit nicer as a config file syntax than say json, or even plain sexps...) spk121: rlb: the char-sets are stored internally as a set of ranges lo..hi lo..hi. So the efficiency of char-set gets worse for higher codepoint values, since it scans those ranges numerically. For text that is usually ascii, it is quite performant spk121: but I don't know how it compares to memv or whatever rlb: spk121: thanks -- I also figured I'd perf test and/or profile at some point and see what's going on, but likely not today :) I did pull out the "guessing likely chars": https://github.com/rlbdv/lokke/blob/edn/mod/lokke/scm/edn.scm#L83-L86 rlb: i.e. so we didn't match againt the entire unicode letter set in the (maybe) common case. spk121: rlb: if you get curious about how char-sets are represented internally, there is a %char-set-dump procedure rlb: Interesting. rlb: The reader's also configurable wrt what kind of containers you get for the various collection literals (vectors, sets, maps, lists). For scheme it defaults to vector, deduplicated-list, alist, and list, fwiw. rlb: (because of course I need "something else" for clj) rlb: I'll probably also add #inst (instant) and #uuid support at some point, either via goops classes if that's acceptable for the scheme side, or srfi-9 records if not -- fine either way if there's a strong preference. rlb: (What I already have for the clojure side uses goops https://github.com/lokke-org/lokke/blob/main/mod/lokke/time.scm#L25 ) rlb: Hmm, not critical, but just noticed and I'm curious -- what determines the bulk of the size of our .go files? Or even just the minimum, or example, looks like there's an approximately 70kb base here for a module with just a few trivial defines in it. spk121: rlb: objdump -x works on *.go files, mostly rlb: oh, right, thanks. wingo: rlb: page alignment between read-only versus read-write pages wingo: minimum is 64kB wingo: binutils manages to avoid having so many zeroes (that aren't paged in in any case) with they way it does it; perhaps there is an improvement to make RhodiumToad: where does that requirement come from? rlb: Ahh, ok - thanks, and in any case, happy to have noticed. Not a big deal, but might nudge some of decisions regarding granularity. *: rlb forgot 2.2 rejects #:declarative?... rlb: Is there some way conditionally specify #:declarative? i.e. I'd use cond-expand, but it doesn't seem like that's allowed inside a define-module... rlb: I imagine I can just duplicate the whole define-module in two cond-expand arms, but be nice to have something better at some point... manumanumanu: rlb: sorry, I haven't been following the discussion: but where do you want to turn off #:declarative? rlb: I want to include it with guile-3.0+ and omit it for guile-2.2. manumanumanu: But do you want #:declarative? #f rlb: guile-2.0 chokes on #:declarative rlb: 2.2 manumanumanu: Yes, but why do you want to turn it off in guile3? rlb: I want it set to #t in 3.0+ manumanumanu: it is #t by default rlb: but I thought the default was #f? rlb: Hmm... rlb: If so, then nevermind... rlb: (and thanks) manumanumanu: I suspected you were trying to do that, and if that was not the case, you can actually work around it by abstracting whatever you want to set! away rlb: OK, yeah, I just misremembered the default... manumanumanu: with boxer or whatnot manumanumanu: boxes rlb: Thanks again. manumanumanu: I am in the middle of moving currently, so I am not here very often. I really think you are doing a noble thing! I hope to be able to help you more in the future, but I probably wont have _any_ computer time until march :( rlb: No worries, I'm not intending to go anywhere anytime soon :) And good luck with the move. manumanumanu: rlb: are there any problems with lokke you haven't figured out how to solve? Or is there anything you want to solve better? rlb: All kinds of things -- some are listed in the README and DESIGN, and also "git grep FIXME" might or might not be interesting... If you decide to attempt something more ambitious, suggest badgering me first on the list, or in #lokke, or... so we don't duplicate efforts. rlb: (the section in DESIGN might be more interesting than the README there I suppose, looking back at it...) manumanumanu: rlb: I am the author of srfi-171, btw. The design is based on the information I could find about clojure's transducers rlb: ...nontrivial things are still missing like (clj) records, protocols, agents, refs, any number of functions, and/or data structures like sorted-set, and I'd imagine there are performance and/or concurrency issues we'll eventually notice. manumanumanu: They are implemented the same. rlb: hah, or that -- no support for transducers at all yet. rlb: (or "chunked sequences", etc.) rlb: e.g. I just short-circuited some of that in the code borrowed from clj/jvm (most of the code is ours, but some is from upstream (with a different license of course)) rlb: cf. (lokke ns clojure core epl) manumanumanu: The difference is that where clojure's mutable state is often implemented as atomics (or "volatile"), the ones in srfi-171 are all just (set! ...). I couldn't understand the reasoning behind the volatile thingies, but I suspect it is probably the most comfortable way to do mutation in clojure manumanumanu: I'll join #lokke :) rlb: Another random technical thing that'd likely require changes to guile/goops to improve is the performance impact of support for "applicable types". We *might* be able to support vectors/sets/maps just using guile's existing applicable-struct feature, but clj also requires that say *keywords* behave like functions, e.g. (filter :valid? some-collection) wingo: this is exciting: (call-with-input-string "#t1" read) => #t wingo: i.e. no delimiter needed manumanumanu: This is the second read error I see you talking about here, and I have been here a total of 15 minutes over the last three weeks rlb: For now, lokke just wraps *all* procedure applications during compilation, i.e. (foo ...) turns into (invoke foo ...) at the tree-il level, but it'd be nice if we could avoid paying that penalty all the time (if there's some better approach). wingo: rlb: yeah that is a really good question how to do that rlb: hah, I'd planned to sneak that one in front of you more carefully at some point :) rlb: wingo: and wrt the reader, interesting, and of course I hit the same bit wrt edn. I just handled it via lookahead-char for now: https://github.com/lokke-org/lokke/blob/main/mod/lokke/scm/edn.scm#L99-L104 wingo: i am not sure how (#t1) should read wingo: looking at the r5rs anyway wingo: maybe it should read as '(#t 1) wingo: which is what guile does rlb: Yeah, edn's specific there I think (and/or I just see what the jvm does :) ). wingo: :) rlb: Suspect at least for now, you might need to mostly just match read.c... rlb: Unless this is going in to a guile-4? wingo: oh yes certainly rlb: not sure... wingo: this is a behavior of read.c rlb: I guess we could have a "strict reader" option or something. wingo: all these weird things i find are read.c things rlb: if we end up wanting/needing it wingo: dunno, nobody will enable any non-default read option wingo: to a first approximation anyway rlb: yeah, I just remembered to remove || symbol support (not something you'd expect/want to work in clj :) ) wingo: better not to muck with lexical syntax wingo: i.e. lexical syntax for which there are many unknown productions out there rlb: (remove it from lokke's version) If the perf holds up, I'll probably just broaden (lokke scm edn) to replace the C version. rlb: wrt the (:foo something) support I wondered if there might be some way to add that to goops (perhaps opt-in if that helps), such that it'd be more efficient than the global wrapper... rlb: i.e. (define-method (invoke (x ) ...) ...) or something rlb: where "invoke" was some special method we support... wingo: yeah i don't know. there are a lot of missing MOP pieces for generic application spk121: I wonder if we fuzzed the reader, we could make it crash *: rlb would guess so wingo: rlb: on the lower level what you need is a function from non-procedure to procedure manumanumanu: spk121: I have crashed the reader back in goile 2.0, but I didn't report it because I was a n00b wingo: (procedure in the tc7 program sense) rlb: Of course I don't actually know how much the current invocation wrapper costs -- maybe it's not all that bad... wingo: ideally with some kind of cache, probably per instruction site manumanumanu: rlb: guile has applicable structs??? wingo: guile has applicable structs! rlb: I figured it might be more palatable if it could be opt-in, and for my purposes, goops only would be fine. manumanumanu: OMG rlb: yeah, I got them working for hash-map, hash-set, etc., but wasn't useful because I still had to have the wrapper for other things i.e. keywords manumanumanu: where is that documented? spk121: manumanumanu: yeah. it happens. I find bugs I don't report because I don't have the energy to diagnose make a minimal test case. manumanumanu: rlb: does clojure still dispatch on something like (define a #:a) (a hash-map) ? That seems like a great source of confusion wingo: hopefully if we manage to switch to a reader in scheme, we won't be able to segv the reader rlb: wingo: I also wondered about the awkwardness between records/structs and goops classes, i.e. you have to (define foo-class (class-of )) in order to be able to (define-method bar (x foo-class) ...). rlb: heh rlb: manumanumanu: in clojure a number of things like keywords, vectors, sets, maps, ... also act as functions. spk121: guile's analog of SEGV is any backtrace that has psyntax in it. ;-) manumanumanu: rlb: I only thought the keyword thing was for literal keywords rlb: It's quite handy (though I can see why it could be viewed as "too clever") for some constricts -- composes nicely with various other operations. wingo: hehe spk121 :) rlb: $ clojure -e '(def a :a) (a {:x 1 :a 2})' rlb: #'user/a rlb: 2 rlb: wingo: scheme@(guile-user)> (call-with-input-string "(#true)" read) wingo: $1 = (#t) wingo: scheme@(guile-user)> (call-with-input-string "(#truf)" read) wingo: $2 = (#t ruf) rlb: oww quit it :) *: rlb did a very hacky thing to parse the literals... manumanumanu: Where can I find info about applicable structs? I thought local-eval was peak fun for me, but now I am not so sure. rlb: manumanumanu: I had to dig around in the source tree iirc, and mirror what guile does in a place or two -- not sure I found much documentation. spk121: wingo: I actually have a tool that may be of use to you. https://github.com/spk121/token-io-test rlb: manumanumanu: if I get a minute later, I'll see if I can find the code, if I kept it. RhodiumToad: I found exactly no documentation of applicable structs, other than a mention that they existed manumanumanu: rlb: if you can, please PM me. I am going to bed now. RhodiumToad: they're not hard to use in GOOPS ArneBab: how can I use them? wingo: spk121: noted, thanks! rlb: manumanumanu: found it -- I'll either put it somewhere in a bit, or if I forget, just ping when you're back. RhodiumToad: in goops you can just define a class as being a subclass of or manumanumanu: Thanks! Good night everyone. wingo: manumanumanu: ,apropos applicable -- then search for uses of those identifiers wingo: yeah wingo: night manumanumanu :) ArneBab: RhodiumToad: does it also work without GOOPS? *: wingo zzz also ArneBab: manumanumanu: sleep well :-) ArneBab: you both :-) RhodiumToad: I believe it does, though I've not tried it RhodiumToad: one thing that seems slightly weird is that the procedure of an applicable struct is not passed the struct, though the procedure of an applicable SMOB _is_ RhodiumToad: I assume this is for weird historical reasons rlb: yeah, that was a problem too... rlb: I forget how I dealt with it... RhodiumToad: well the obvious thing is for the procedure to be a closure over the struct rlb: Yeah, I think that's probably what I did. RhodiumToad: one can do a goops class that just invokes a specific method from the procedure, and then use that as a parent of other classes rlb: Yeah, though at least for my current purposes, I need it to work on built in s etc. leoprikler: wingo: please keep #t1 that way, it's useful for golfing ;) mwette: wingo: Any notes on how to add port (e.g., riscv) to lightening? I did the trivial part of cp lightning/* lightening/* now running into jit_node_t gone. (I have riscv-gcc and looking at emulators -- so many of them.) spk121: civodul: ok I tried building with mini-gmp. AFAICT, only one missing function, mpz_get_d_2exp, which one could approximate using mpz_get_d for the mini-gmp case spk121: no time to day to write a func to convert mpz_get_d to mpz_get_d_2_exp, so that's all I've got spk121: *today chrislck: spk121 - thx for your work -- following with great interest. what's wrong with gmp that requires mini-gmp? what are the limits of mini-gmp? chrislck: spk121 - are you targetting mingW 32-bit only? spk121: chrislck: as I understand it, there are functions that one call in gmp that changes its behavior, so if a program loads guile (expecting behavior #1) and gnutls (expecting behavior #2) hijinks ensue. Not sure of the details. But I got interested in it because it would get rid of a dependency, and these dependencies are a bit of a pain when trying to port Guile spk121: mini-gmp has no assembly and may be as much as 10 times slower for some cases spk121: Plus it is missing that one function that we use mpz_get_d_2exp chrislck: thx for details, grateful for the work mwette: I've had issues with libgnutls for guile as well. Can I ask what issue is going on w/ guix? mwette: I see; the memory allocation issue. spk121: g'night. Have a nice weekend mwette: So one ugly workaround based on what I often use for loadable .so's is to do something like this: build libgnutls.a and libnettle.a w/ -fPIC then link guile-gnutls.so with something like "ld -o guile-gnutls.so guile-gnutls.o libgnutls.a libnettle.a". (This allows me to distribute the .so to a few close friends w/o all the dependent libxyz.so's.) RhodiumToad: arguably it's extremely rude for an embedding library like guile to mess with the global state of a library that the app itself might be using RhodiumToad: that ... doesn't actually help rlb: chrislck: the issue is that we currently change gmp to use libgc for allocation (good for performance) but that may then lead other things (i.e. libraries) in the process to unknowingly allocate (directly or indirectly) pointers libgc that they then stick into normally malloced blocks. libgc won't know anything about them, and so won't sweep when collecting. (I think.) dadinn: hi all dadinn: I am looking for a built-in / SRFI function which does something similar to this bda (hash ret) dadinn: (or ret (hash-ref hash key))) dadinn: oop copypaste error :P dadinn: I am looking for a built-in / SRFI function which does something similar to this: https://termbin.com/ir20 RhodiumToad: called with a key and some variable number of hashtables, you want to return just the first match? RhodiumToad: might be easier to do as syntax dadinn: RhodiumToad: yes dadinn: you mean macro? RhodiumToad: (define* (hash-ref* key #:rest hash-maps) (any (cut hash-ref <> key) hash-maps)) ;; any is from srfi-1, cut from srfi-26 dadinn: if I macro-expand it into nested hash-ref (with defaults) calls, that wouldn't be the same... bacause of eager evaulation, it would try to evaluate on all hash-maps RhodiumToad: not with defaults, expand it into an (or ...) dadinn: this way with the fold, it quits on the first hash-map it finds a result chrislck: rlb: sounds like quite a challenge dadinn: hmm, the or thing doesn't sound bad actually! RhodiumToad: dadinn: so does the (any) version I just gave RhodiumToad: the hard part of the macro version is to not multiply evaluate the key dadinn: I am not too much of a pro with define-syntax :/ dadinn: what does the <> stand for in the any example? RhodiumToad: (cut foo <> bar) is shorthand for (lambda (x) (foo x bar)) dadinn: ah, cool RhodiumToad: so the <> is where the parameter is substituted in dadinn: RhodiumToad: thank for the recommending `any` it's actually much nicer RhodiumToad: a macro version could avoid evaluating unneeded hash-maps expressions, fwiw RhodiumToad: I'm thinking something like, dadinn: RhodiumToad: and I already depend on srfi1 so why not RhodiumToad: (define-syntax hash-ref* (syntax-rules () ((_ key hash hash* ...) (let ((key key)) (%hash-ref* key hash hash* ...))))) RhodiumToad: (define-syntax %hash-ref* (syntax-rules () ((_ key) #f) ((_ key hash hash* ...) (or (hash-ref hash key) (%hash-ref* key hash* ...))))) RhodiumToad: (except the other way round) dadinn: hmm, I don't really understand how syntax-rules works :/ RhodiumToad: it's basically just pattern matching for syntax dadinn: it does some pattern-matching thing and then the ... always confuse me :P RhodiumToad: here the %hash-ref* one is the one that does the work, the other one just wraps in a (let) to avoid multiple evaluation RhodiumToad: so (%hash-ref* key) expands to just #f RhodiumToad: and (%hash-ref* key hash blahblah...) expands to an (or ...) expression RhodiumToad: so the result is like (or (hash-ref key hash1) (or (hash-ref key hash2) (or (hash-ref key hash3) #f))) dadinn: hmm, but what if your hash-ref* like this: (let ((or #nil)) (hash-ref "hello" map1 map2 map3)) ? dadinn: how does it avoid variable the variable capture by or? RhodiumToad: the joys of hygenic macros :-) RhodiumToad: the "or" in the macro means the binding in effect for or at the time the macro is defined, not at the time it's expanded dadinn: RhodiumToad: but don't you have to declare in the syntax-rules somewhere that or shouldn't be captured? RhodiumToad: no RhodiumToad: everything is lexically scoped, even macros RhodiumToad: this isn't lisp :-) dadinn: RhodiumToad: if i remember correctly define-syntax takes some argument of symbols... and I don't know what it's for :/ RhodiumToad: the () in those syntax-rules is a list of identifiers that are to be treated as syntactic atoms, like "else" or "=>" are dadinn: RhodiumToad: yeah that's what I meant... what does "syntactic atom" mean? dadinn: RhodiumToad: what are they used for? RhodiumToad: well, consider "else" as an example dadinn: ah I see, so you declare them, so that they don't throw an error as undefined symbols in the lexical scope, but you can use them for pattern matching! RhodiumToad: yes, and they match themselves literally, rather than binding the way that other symbols in a pattern match do dadinn: ah, maybe not just to not throw an error as undefined, but to don't actually capture anything from the context where the macro is defined? dadinn: cool, got it. RhodiumToad: (_unless_ the symbol has a different lexical binding in the macro definition and the point of expansion, and then they don't match) RhodiumToad: anyway, most of the time you just put () there RhodiumToad: the point is that unless you deliberately break the hygiene rules (e.g. with datum->syntax etc.), every symbol in the macro refers to its lexical binding _where the macro is defined_, not where it's used dadinn: I am more used to gensym+syntaxquote common-lispy style, but with namespaces (a'la Clojure) dadinn: when you say "every symbol in the macro" you mean: every symbol in the macro *definition*? RhodiumToad: yes RhodiumToad: and the symbols in the macro arguments always refer to their lexical bindings at the point of use dadinn: ok RhodiumToad: i.e. it all Just Works and you never have to worry about stuff being accidentally bound to the wrong thing RhodiumToad: (except for a small issue with top-level identifiers, for which you can read the gory details in the docs) dadinn: what do you think about Clojure's macro system? It is more common-lisp style, but due to namespaces, it kinda achieves hygiene, no? *: RhodiumToad not clojure expert *: rlb would say (very roughly) that clojure is pretty close to common lisp or guile's define-macro macros, but the automatic symbol expansion (i.e. namespacing) handled maybe surprisingly by the *reader* in clojure jvm, helps in many cases make sure you get the binding you probably meant. dadinn: anyways, thanks for the `any` suggestion... it definitely looks much better: (define* (hash-ref* key #:rest hash-maps) rlb: But in a lot of cases, I'd think scheme syntaxes are likely a lot "better". dadinn: hah, copy paste malfuction again: https://termbin.com/1w9w RhodiumToad: dadinn: the thing I'd be wary of there is that rest args always end up consing a new list. rlb: dadinn: if you want to see some fairly frightening bits (that likely need improvement): https://github.com/lokke-org/lokke/blob/main/mod/lokke/base/syntax.scm RhodiumToad: the advantage of a macro here is that you can have a variable number of hash-maps without needing to cons a list on every single call rlb: (many of clojure's macros written as scheme syntaxes) rlb: Though some of it you'd want to ignore for a pure scheme version of them (i.e. the support for set/map/vector literals). RhodiumToad: I wrote a set of macros here a while back for someone who wanted a cartesian-product apply / fold for variable numbers of lists; avoiding consing was a key requirement dadinn: RhodiumToad: what do you mean by consing? Does it have too cons together the args 1-by-1 to get a list argument? dadinn: is this some behind-the-scenes detail? RhodiumToad: the rest args end up as a new list in the function RhodiumToad: i.e. a list which is guaranteed not to share structure with any other, and therefore all the cons cells have been newly allocated dadinn: hmm, true... never thought about it! So on every function call, a new list is created? RhodiumToad: yes dadinn: hmm... RhodiumToad: premature optimization is the root of all evil, and so on, but it's still worth bearing in mind the possible overhead dadinn: so if I would map trhough a list of a trillion triplets of hashmaps, calling my hash-ref* on each triplet, then that would create a trillion lists :/ dadinn: "calling" i mean applying :P dadinn: yeah, I think I will put the premature optimization genie in the bottle for now... if it ever gets out, I know how to put it back ;) daviid: wow chrislck: huh daviid: on debian testing (bullseye), after the last updates, i now get this error trying to compile g-golf - https://paste.debian.net/1184232/ - even if i autoreconf -vif, configure, clean ... make fails rlb: daviid: hmm, does that file exist? rlb: here it's in libltdl-dev rlb: (at least according to dlocate) daviid: rlb: i have libtool-dev:amd64 installed, it is not part of the package it seems daviid: dpkg -L libltdl-dev:amd64 -> ... /usr/lib/x86_64-linux-gnu/libltdl.so ... but no .la daviid: this is a 'new' error, never happend before daviid: and the error disapeared, 'alone', no idea what happened daviid: but running make a few times failed, then it worked again daviid: macumba! rlb: hmm, interesting. daviid: i just did run another aptitude update U, g, g, but didn't see anything related to this daviid: the file still does not exist, but the error disapppeared rlb: Oh, and I uploaded 3.0.5-2 which marks that sigprof asyncs.test as unresolved. Looks like that should be enough to allow 3.0.5 into bullseye: https://paste.debian.net/1184232/ rlb: fwiw fnstudio: hi all, `guix environment --container ...` gives me an error (unprivileged user cannot create user namespaces), which i think is expected since i'm running guix on debian fnstudio: i understand this can be fixed by `echo 1 > /proc/sys/kernel/unprivileged_userns_clone` fnstudio: ooops sorry, this was meant for #guix... fnstudio: please ignore and sorry for spamming *: ioa join #guix ioa: :) ioa: s/join/joins/ spk121: civodul: I did a build of Guile w/ mini-gmp here. https://git.savannah.gnu.org/cgit/guile.git/log/?h=use-minigmp . The patch needs some cleanup and testing and maybe benchmarking, but, it passes 'make check' civodul: spk121: awesome! civodul: i can give it a try ArneBab: in the current Guix wisp seems not to work. It installs its language files in .guix-profile/share/guile/site/3.0/language/ — should this be guile/3.0/language? civodul: ArneBab: no, it looks correct to me civodul: that matches the GUILE_LOAD_PATH spec of guile rlb: wingo: any notable likely perf difference between a char-set:contains?, memv? and a case guard? rlb: (for say ~1-20 possibilities) leoprikler: ArneBab: guile vs. guile/site is to distinguish between guile itself vs. other packages built on guile daviid: rlb: fwiw, the error re-appeared, running make distcheck, here - https://paste.debian.net/1184299/ rlb: Are you running the build as root? rlb: If so, then random guess -- maybe something in the g-golf build is messing with that .la file. rlb: Also, what version of libltdl-dev do you have (i.e. dpkg --status libltdl-dev) rlb: and what does "dpkg -S libltdl.la" say? daviid: rlb: (a) not running as root, (b) don't know, but not that i would be aware of, (c) here https://paste.debian.net/1184303/ and daviid: dpkg -S libltdl.la -> dpkg-query: no path found matching pattern *libltdl.la* daviid: daviid: rlb: so, if i run make clean, make fails, then another make incantation runs fine daviid: i am trying to get some help on #debian-next, but they didn't answer my yesterday's msg, nor the ones i sent today ... (til now, but there are generally very responsive and quick ... let's see) rlb: hmm, I have 2.4.6-14 -- let's see if we can see what changed... rlb: heh rlb: https://metadata.ftp-master.debian.org/changelogs//main/libt/libtool/libtool_2.4.6-15_changelog rlb: They dropped it. daviid: it is really strange, that 'make clean', 'make' fails, then 'make' again pass rlb: Not sure what that means wrt expected usage. RhodiumToad: why is that strange? likely a bug in the makefile daviid: RhodiumToad: it always look strange, to me, that something fails, then pass ... rlb: I'm very rusty wrt libtool, la files, etc. -- do you have to have it? And if not, does something else need adjustment? daviid: with no manual changes in between i mean ... rlb: (I'm hoping the removal was approprate/viable.) daviid: i have zero knowledge about all this daviid: and zero experience rlb: Or rather, I suppose either g-golf or something else needs an update, or that removal isn't viable... rlb: No idea offhand which one. rlb: daviid: if you're in a hurry, and want to defer, I suppose you might be able to grab -14 from snapshot.debian.org and manually install it (or set up the relevant sources.list). spk121: daviid: if you recreate the error using "make V=1" it could provide more information daviid: spk121: tx, here is what it says https://paste.debian.net/1184318/ rlb: daviid: just a random guess -- I wonder if there's any chance that you might need newer versions of the relevant auto* sources and/or an "autoreconf -fi" or similar, i.e. if libtool changed to support not having .la files or something (assuming this isn't just currently unworkable situation). rlb: and/or a newer libtool, etc. rlb: (Completely wild guess...) spk121: daviid: can you point me to the makefile.am file, so I can take a look. Sorry for jumping in at the end of this conversation... daviid: spk121: here http://git.savannah.gnu.org/cgit/g-golf.git/tree/libg-golf/Makefile.am?h=devel daviid: rlb: i did run autoreconf -vif, it doesn't seem to solve the problem daviid: rlb, spk121 - tx both of course, i am just 'blind', and #debian-next keep quite :) rlb: Another option might be to file a bug against libltdl-dev and have a discussion there -- since I don't see any rationale in the changelog entry. Of course it might also be that g-golf could change. And/or if there's a repo for the deb, might look at the recent commit messages. rlb: Might also look at https://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=0;dist=unstable;ordering=normal;repeatmerged=0;src=libtool though I didn't see anything obvious after a quick look. rlb: And also found https://lists.nongnu.org/archive/html/libtool/2009-08/msg00085.html fwiw rlb: (old discussion, maybe or maybe not related) daviid: rlb: i don't understand the last part of the setnence above '... Of course it might also be that g-golf could change. And/or if there's a repo for the deb, might look at the recent commit messages.' - and wrt reporting, i feel totally unconfortable because i don't understand enough, even to just express 'things' rlb: I just meant if libtool has a repo on say salsa.debian.org, and the maintainer keeps it up to date, might be some additional information in the recent commits leading up to -15. rlb: But I didn't see a Vcs header in the --status output, so not sure if there is a repo. spk121: daviid: I have a possible fix to test. In your Makefile.am for libg-golf, you're using the _LIBS target. Try swapping _LIBS for _LIBADD spk121: so it would be libg_golf_la_LIBADD = $(GUILE_LIBS) etc daviid: spk121: trying now, tx daviid: spk121: it didn't seem to solve the problem daviid: after i changed, fiwiw, i did clean, run autoreconf -vif, configure and make daviid: spk121: so, only one change right? here is what i have daviid: libg_golf_la_LIBADD = \ daviid: $(GUILE_LIBS) $(GLIB_LIBS) $(GOBJECT_LIBS) daviid: daviid: then the autogen, configure make danse daviid: here what make V=1 says 'after' - https://paste.debian.net/1184327/, afte the change daviid: spk121: rlb, tx again, have to go afk, bb in an hour or so ... tx for the help, if any other suggestion pings while away, yoiu may write, i'll read when back ... spk121: daviid: sorry, out of ideas. Good luck! ArneBab: leoprikler, civodul: thank you for your answer! I’m helping someone find out why wisp does not work. I now turned to strace to dig deeper: strace wisp |& grep wisp *: wingo has "read" port to scheme almost done, respecting reader options and everything civodul: woo! civodul: nice ArneBab: cool! ArneBab: wingo: worried question: does wisp still work? wingo: ok zzz, see yall tomorrow @ fosdem wingo: ArneBab: the bits that are in read.c should still be there wingo: i assume there are tests; haven't banged at this thing in anger yet ArneBab: thank you! ArneBab: and sleep well :-) civodul: night! dongcarl: In a scheme file foo.scm, I did `(add-to-load-path (dirname (current-filename)))` at the top of the file, then in (use-modules) I started adding other files in the same directory as foo.scm, such as (use-modules (bar)), which should point to bar.scm, correct? dongcarl: Unfortunately I'm getting: ice-9/eval.scm:159:9: In procedure scm_to_utf8_stringn: Wrong type argument in position 1 (expecting string): #f tohoyn: dongcarl: try leaving add-to-load-path away and giving command "export GUILE_LOAD_PATH=." before running the guile code. xelxebar: Noob question. Say you're writing a guile script and have a ~10KB file that you need to know whether any of the lines beginning with "foo" contain the string "bar". tohoyn: xelxebar: grep ^foo myfile.txt | grep bar xelxebar: What are your preferred ways of going about this? If I was in shell, I'd just reach for sed/grep/awk. xelxebar: tohoyn: So you'd call out to an external tool for this? tohoyn: xelxebar: maybe not tohoyn: xelxebar: read all the lines with read-line and use string-match to do the match xelxebar: Yeah, I'm mainly interested if there is some sensible pure Guile approach to this problem space, in the spirit of replacing sed/grep/awk for general sysadmin tasks. tohoyn: xelxebar: have you ever heard about scsh? xelxebar: tohoyn: That's the naive approach I originally conjured! Just not sure whether it's considered non-idiomatic, overly naive, etc. xelxebar: Yes, have actually lightly played around with it. tohoyn: xelxebar: the last release of scsh seems to be from year 2006 xelxebar: I actually have a concrete problem I'm working on, though. It needs to be in guile, and I'm currently just using sed to find whether there's a match. Would like to replace that sed line with pure Guile. rekado: xelxebar: here’s a definition for you: https://elephly.net/paste/1612514897.html rekado: it reads a file line by line, checking for every line if it starts with the given prefix. rekado: if it does then it escapes via “throw” and returns #true. rekado: if it does not it will eventually hit EOF and return #false rekado: actually, this can be simplified some more, removing the “if” and doing more in “match” xelxebar: rekado: Thanks. This is a very direct/naive approach. Since you are suggesting it, can I take that to mean that it's relatively idiomatic? rekado: or without match: https://elephly.net/paste/1612515162.html rekado: xelxebar: I don’t know if it’s idiomatic or idiotic. But in the truest sense of the word, I *am* an idiot and this is how I’d do it, so I guess with the right definitions this can be considered idiomatic :) xelxebar: The Haskell in me wants to do something like split-on-lines -> map regex on lines -> reduce. xelxebar: Haha. Nice verbal sleight of hand. rekado: you can do that, but Scheme is not lazy by default, so you will in fact compute all lines first. xelxebar: Thanks for the concrete code. It's really helpful! rekado: you can go the Haskellish route if you used streams, but that’s a lot of complexity for something done so simply. rekado: glad to be of help! rekado: note that this is not the *fastest* way of doing this xelxebar: Okay, that might be a fun problem to play around with :) rekado: it would likely be faster to implement one of the well-known string search algorithms instead; that would require reading chunks from the file port. rekado: s/likely/definitely/ rekado: the question is just if it’s worth the hassle rekado: with read-line you’re going over the characters once until you hit a newline; then you go over the characters again to determine if there’s a match xelxebar: Yeah, that could also be a nice homework problem. I imagine that sed/grep are doing something in that regard. Might be fun to try translating their algorithms. rekado: this may be of interest: https://lists.freebsd.org/pipermail/freebsd-current/2010-August/019310.html xelxebar: Oh! Very nice! civodul: has anyone considered writing a TLS 1.3 implementation in Scheme? wingo: i wonder what the constant-time story would be civodul: you could still call out to one of these C libraries for crypto dsmith-work: Happy Friday, Guilers!! civodul: happy Friday! civodul: wingo: continuing on this guile-gnutls theme, here's my "bench" with and without GMP/libgc hooks: https://web.fdn.fr/~lcourtes/pastebin/guile-without-gmp-memory-functions.html civodul: looks like scm_install_gmp_memory_functions = 0 is not an option wingo: well... i mean, when it comes to silent breakage of crypto libs, surely it is a better option? civodul: heh civodul: to me it's not a viable option civodul: which doesn't mean a broken GnuTLS is any better :-) wingo: hoo, i have a clear hierarchy for which is worse :) wingo: of course we need to fix the bignum issue :) rlb: civodul: is there a summary of the situation somewhere, i.e. what the problem/constraints are? rlb: Hmm, does PyUnicode_DecodeFSDefault hit the bug you found? I mean that's not a deal breaker, i.e. even if it does, perhaps fine to just require that people not install bup under too crazy a path until/unless python/libc fixes the issue, but just curious... rlb: oops wrong channel spk121: wingo: I'll take a stab at dlopen for MinGW this week. maybe. Then the 32-bit, single threaded, non JIT, MinGW guile will be ready to integrate wingo: great!!!! janneke: spk121: oh, great! civodul: rlb: i've just opened a bug on the Guix side: https://issues.guix.gnu.org/46330 rlb: civodul: thanks rlb: civodul: I'm not sure I remember the relevant GC semantics correctly. Is the issue there that nettle is using malloc, and storing gc (libgmp) allocated pointers in the malloced blocks? dsmith-work: What's a current url for mini-gmp ? civodul: rlb: GnuTLS calls Nettle, which allocates via libgc; but GnuTLS stores pointers in malloc'd memory, which is not scanned by libgc spk121: dsmith-work: there is a mini-gmp in the main gmp tree rlb: Oh, ok, so the reverse, but still the underlying issue is just that it's storing gc pointers in malloced memory. Thanks. civodul: wingo: i realized we can do "scm_install_gmp_memory_functions = 0" in Guix's own 'guile' executable (yes, that exists) civodul: that looks like a reasonable workaround until we have Guile on mini-GMP rlb: And sounds like the main drawback to mini-gmp would be performance, but maybe that's something we could try to improve over time for the paths that affect us, I suppose... civodul: yeah, we'll have to check how it affects performance; i suspect it's not that bad dsmith-work: spk121: Thanks civodul: and few applications make heavy use of bignums rlb: (guessing, particularly now that 64-bit archs are so common...) civodul: was there initial work on adding mini-GMP support? Niels Möller maybe? spk121: civodul: I doubt it is more complicated than pulling the two files into the Guile tree, and adding the configure options. (If you're willing to pull the files in tree). GMP itself doesn't have the autoconfigury/make to build mini-gmp into a library spk121: (of course, when a software manager says things like "I doubt it is complicated..." it always goes wrong) Rovanion: I'm feeling incompetent but I can't wrangle split to work as I like. I want to read a file and split it into a list of lines. Rovanion: (string-split my-string #\n), but with newline instead. Rovanion: hyperpolyglot.org/lisp should have a guile column. spk121: Rovanion: try #\newline instead of #\n Rovanion: Thank you spk121! civodul: spk121: that'd be really nice civodul: are you giving a look already? :-) civodul: it'd be nice to add the mini-GMP option for 3.0.6, making it opt-in (because it'd be ABI-incompatible) spk121: civodul: well I did take a quick look. Haven't actually coded anything. rlb: hmm, so I guess it might not fix the debian gnutls problem, i.e. we can't change the abi, I think... We'd need a new libguile soname? rlb: Well, or just the next Y release, since we have libguile-X.Y.so... spk121: rlb: mini-gmp solves a specific problem in Guix, so they may want to enable such an option, but, if we do add mini-GMP, we can make full GMP as default for a while via ./configure rlb: right, but the current arrangement also breaks on the debian buildds. rlb: i.e. it's broken even outside guix rlb: I think? spk121: rlb: huh. I didn't know that. Was it something about also using libgmp in gnutls or something? Anyway, if you did enable such an option, I guess debian *would* need a new soname. It is probably complicated to really figure out how to do sonames with configure options rlb: It's gnutls itself, I believe, i.e. its test suite fails. rlb: sometimes rlb: i.e. if I understand it correctly, guile's just broken right now for programs that might use libgmp? rlb: (that's just not all that common, and we've been fairly lucky?) rlb: But that's just my current understanding - I might have misread the situation. civodul: rlb: yes, the problem was first identified in Debian civodul: and now we realize we're all suffering, Debian & Guix alike :-) rlb: So I think for debian at least, we'll probably have to wait for the >= 3.2 to make the switch. rlb: (of the setting) rlb: wingo: nice. rlb: wingo: and I wonder if another option is to release the ltdl changes, with a plan to have a low-threshold followup release to revert it if it's too disruptive... rlb: If I had a bit more time I could test it in debian experimental across the buildds, but even if I don't, we'll find out right after the release when I'll upload to sid. rlb: (though debian's heading shortly to stage 2 freeze...) rlb: I'm planning to at least re-upload 3.0.5 with the async test marked flaky in the next few days. rlb: terpri: well at a minimum, the fact that you can crash python before it even gets goint with the wrong argument is probably a bug *somewhere*... rlb: s/goint/going/ rlb: imo rlb: i.e. the wrong sequence of bytes in an argv element -- it can't even put them into sys.argv without crashing iirc. ryanprior: Is there a good book or long-form tutorial about Guile that takes you through most of the useful SRFIs and language constructs? justin_smith: ryanprior: there are many great scheme books, I know of nothing guile specific but also haven't felt the need to look for it justin_smith: racket might have the best language docs period, and for the base language nearly everything is the same as guile mwette: http://www.draketo.de/proj/py2guile/ mwette: ^ book on guile rlb: Is there a way to get a test to show a backtrace on failure rather than just rlb: rlb: ERROR: asyncs.test: preemption via sigprof - arguments: ((wrong-type-arg #f "Wrong type (expecting ~A): ~S" ("resumable continuation" #) (#))) Sheilong: Is there a object +infinity in guile such that I could use in a procedure to find the minimum element in a set of values? rlb: Sheilong: +inf.0 and -inf.0 rlb: more info: https://www.gnu.org/software/guile/manual/html_node/Reals-and-Rationals.html Sheilong: thanks spk121: hello guile macro masters. How I define a syntax (aaa x) that converts to (bbb "x")? spk121: ok, figured it out. Had to wade into the weird world of syntax and datum. spk121: OK, I've read the docs a couple of times and scanned the source code, but, I still can't figure out the new exceptions. How do I do a wrong-type-arg message in the new exceptions? Or more generally how do I make an exception with a message and some parameters? I wish there were examples civodul: spk121: you can still write (throw 'wrong-type-arg "proc" ...) civodul: (which itself was never quite documented) tohoyn: spk121: do you mean R6RS exceptions? you can raise an exception of any type, but it is better to use condition types. wingo: spk121: yeah the situation is not great, that would probably be a good place for us to spend effort over the next 6 months or so spk121: tohoyn: in the manual for 3.0.x, it says the new way to do exceptions is (ice-9 exceptions), which hopes to replace throw/catch wingo: getting everything converted over to a new exception system with good fallbacks for try/catch *: wingo tries to remember where things were going wingo: spk121: so exception objects are like mixins, you can have an exception object composed of other exception objects wingo: to translate an exception object to the "kind" and "args" that are passed to a throw handler or a catch handler, there are two ways wingo: one is if the exception is a compound exception which includes &exception-with-kind-and-args wingo: which explicitly specifies how the exception should map to throw/catch wingo: otherwise the kind is %exception and the args is (list exn) wingo: where exn is the exception object wingo: in the future it would be nice to make a more implicit mapping for specific exception kinds wingo: or it might be nice, anyway -- not sure wingo: there is one more moving piece here, which is what happens at "throw" wingo: in that case guile builds a new exception object including &exception-with-kind-and-args wingo: and probably some other exception types as well; there is the alist of exception converter procedures in (ice-9 exceptions) wingo: spk121: does that clarify things? currently for wrong-type-arg if you want "catch" to see wrong-type-arg the best way is to continue using "throw", until we define exception types for wrong-type-arg spk121: wingo: hmm, kinda. Let me try to code up a minimal example to see if I get it spk121: gah! the mkdtemp tests are wrong and are leaving temp directories in 'make check'. Let me fix that. ecraven: if I wanted to get things like (eof-object) (which should just return #!eof) into guile --r7rs, what should I approximately look at? just the source code of `install-r7rs!'? ecraven: or is that only for syntax? that's what it seems to do now wingo: is (eof-object) missing? RhodiumToad: apparently it is weinholt: ecraven, is this the repl? you might need (import (scheme base)) lloda: master doesn't build, seems to require gperf (?) RhodiumToad: does it build if you have gperf? :-) lloda: it does civodul: wingo: in 3.0.5, if you use, say, 'condition' from (srfi srfi-35), you get an unbound-variable warning about 'make-compound-condition' civodul: i think that's a regression civodul: does that ring a bell? rekado: I’m seeing the same since 3.0.5 rekado: it doesn’t seem to hurt at run-time, but at compile time I see the warning. chrislck: the unbound-variable warnings are weird -- in gnucash date-utilities.scm there's compilation warning about missing set-tm:mon and friends ecraven: ah, sorry, I had an old (define-syntax import ..) left over from guile2 :-/ ecraven: is this valid code, assuming no such library is defined at all? (cond-expand ((not (library (lets-hope-no-one-defines-a-library-like-this))) (assert #t)) (else (assert #f))) ecraven: i.e. shouldn't this work exactly if it is *not* defined? tohoyn: I get plenty of warnings about possible undefined variables when I use guile-3.0.4 Tree-IL as an intermediate language for programming language Theme-D. Here is the code used to import the module causing problems: https://paste.debian.net/1183972/ tohoyn: the compiled code gets executed correctly despite of the warnings tohoyn: can anybody help? tohoyn: i.e. how do I get the warnings away chrislck: tohoyn: something like (set! %auto-compilation-options chrislck: '(#:warnings (arity-mismatch format duplicate-case-datum bad-case-datum))) tohoyn: chrislck: I compile the Tree-IL to bytecode using guild tohoyn: why do these warnings occur at all? the variables that guile complains are defined and the code using them gets executed correctly. chrislck: tohoyn: beats me (I'm just a lvl.2 hacker) but in our code it indicated missing use-modules tohoyn: chrislck: ok chrislck: here's a snippet from gnucash compilation: https://pastebin.com/raw/jNvs7buS chrislck: a weirder warning because set-tm:mon is in core tohoyn: chrislck: does the code using the complained variables run ok? chrislck: no trouble at all tohoyn: chrislck: this looks like a bug in guile chrislck: blasphemy, we don't complain about guile here chrislck: haven't been able to replicate this warning in repl chrislck: it may be in guild tohoyn: chrislck: I tried to reproduce the bug with a small code snipped but it didn't succeed. tohoyn: s/snipped/snippet/g mwette: Are set:tm-mon etc defined in a loaded extension? I get warnings for procedures declared in a loaded .so file. chrislck: mwette: they're in boot.scm! chrislck: boot-9.scm ArneBab: wingo: I don’t think that Pythons string/bytestring thing is a disaster. The disaster is to enforce changing from "string is standard encoding" to "you have to do an explicit conversion", because that breaks lots of codebases. In short: py2->py3 broke lots of existing code. I have tools that have not yet been ported today. In all fairness: I’m the maintainer (but not the original creator). I already spent two weekends on the migration. ArneBab: That’s a cost an update should never incur. dsmith-work: {appropriate time} Greetings, Guilers rlb: Not sure if/when I'll get to it, but considering trying to add some additional support for unicode categories: https://www.gnu.org/software/libunistring/manual/html_node/Object-oriented-API.html#Object-oriented-API i.e. some way to ask if a character is in a given 'Zs category, etc. weinholt: rlb, is it different from char-general-category in r6rs? rlb: hmm, no idea... rlb: Oh, if you mean what we already have, I need (char-general-category? ...) too. rlb: ...or rather want, or rather really want to be able to combine say Zs Zp ... into one union category and then test against that. rlb: maybe -- I suppose for my current purposes, all I really want is decently fast dispatch for a set of categories, and maybe (case (category c) ((Zs Zp ...)) would do that now? I'll need to think about it further. spk121: rlb: there is a char-set:whitespace that is all of Zs Zl and Zp, if that helps mwette: So in posix-regex does \s map to (Zs Zl Zp) or #\space? apteryx: is there a way to set the exit status of a Guile script, prior to calling exit? apteryx: else to cause a srfi-64 test module to exit non-cleanly when there were failures? apteryx: or otherwise a way* rlb: apteryx: don't know if it's helpful, but for now in the scheme-side tests, I just used this hack: https://github.com/rlbdv/lokke/blob/main/test/lokke-scm-atom#L93-L96 rlb: But I have to copy/paste that into every test, which is perhaps not ideal. rlb: spk121: hmm, perhaps that's exactly what I want -- thanks. rlb: I'll check later. apteryx: rlb: yes, that's how it's done in guile-ssh, but that breaks in Guile 3.0.5 apteryx: you have to move the test-runner-fail-count call before test-end there, as the test-runner objects gets reset to #f apteryx: (at the time of calling test-end) apteryx: something could be done using a Scheme test driver I believe, but the quick hack so far is just making a binding for the exit status before calling test-end apteryx: then calling exit with it rlb: Ahh, right, forgot - I've fixed that locally, but haven't pushed yet. rlb: wait, I *did* fix that -- something odd's going on... *: rlb will check later -- may have pushed something wrong rlb: wrong repo... rlb: https://github.com/lokke-org/lokke/blob/main/test/lokke-scm-atom#L90 rlb: so yeah, similar hack: https://github.com/lokke-org/lokke/blob/main/mod/lokke/scm/test.scm#L9-L15 rlb: similar to what you suggested I mean rlb: I just wrapped it all up. wingo: did 3.0.5 introduce a breaking change? rlb: not sure -- i.e. not sure if it's breaking anything documented, but the change was that the test runner was no longer available after the top-level test-end, where previously you could get at the (arguably leftover) one. rlb: bbl spk121: speaking of srfi-64, one item on my wishlist / hacklist is to get our srfi-64 to properly expand error messages, instead of printing strings with format characters like (("wrong type ~S") . (bleh)) civodul: spk121: ah sometimes it's good to see the raw throw arguments civodul: i wouldn't want it to be too smart ;-) dsmith-work: sneek: botsnack sneek: :) Sheilong: Hello. How can I convert an integer to a bit vector chrislck: example? RhodiumToad: that actually looks surprisingly hard Sheilong: transform an interger in the range 0-255 into a bitvector of 8 bits. E.g (convert 15) => #*00001111 justin_smith: yeah, I was surprised to see that isn't built in justin_smith: you might find that bit-extract helps, it gives the value of some range of bits inside an int Sheilong: I wrote a procedure to calculate the hamming distance between two string, so I have had to write a procedure to count the bits on given an integer, but since I saw that there was a bitvector with a builtin bitcount I've been trying to figure out how to convert an int to that. RhodiumToad: there's logcount for integers, no? spk121: if you just want the count of the 1 bits, there's a 'bit-count' in srfi-60 RhodiumToad: that's the same as logcount in core Sheilong: spk121: Yes. But bit-count expects a bitvector as input RhodiumToad: bit-count in srfi-60 is not bit-count in core RhodiumToad: speaking of bit operations, I noticed when doing those hex routines a while back that using srfi-60 came with a substantial performance hit RhodiumToad: it looked like the builtins were being compiled to bytecode primitives while the exact same functions used from srfi-60 were not Sheilong: How do I compare equality among characters? Sheilong: (= #\a #\b) :2798:0: In procedure =: Wrong type argument in position 1: #\a Sheilong: Just found on documentation RhodiumToad: eqv? or char=? Sheilong: char=? Sheilong: I did some bitwise on 8bit integers but I am getting results that are bigger than 8 bits RhodiumToad: chars are not bytes RhodiumToad: what did you do? Sheilong: I convert a base 64 string to a list of chars, then convert the chars to integers, and save them in a bytevector. After that, I try to decode it back to original base. Sheilong: But I think I did something wrong in the bitwise operations Sheilong: https://paste.ofcode.org/Q3AUgzVRckzBgfddwRUQ9Y RhodiumToad: you know you can convert a string straight to a bytevector? Sheilong: RhodiumToad: I didn't RhodiumToad: for something like base64 (or hex) where you know all the valid data is plain ascii, use string->utf8 Sheilong: I confess that I looked by it in the documentation but did not found it before. RhodiumToad: that gives you a bytevector with the utf8 representation of the string, which will be all-ASCII if the original string was Sheilong: Ahhh, I used that before, but I got an error when I needed to do a xor operation with a key against a set of strings. RhodiumToad: what has that got to do with it? Sheilong: RhodiumToad: Is there a way to work with integers as 8-bit ints? When I extract an int from the bytevector it lost the 8-bit representation. RhodiumToad: when you extract it, it becomes just an integer RhodiumToad: scheme integers don't have a size as such Sheilong: So the only way would be using a MASK RhodiumToad: you want to do things like left shifts discarding all but the low 8 bits? RhodiumToad: then yes, use a mask Sheilong: RhodiumToad: That's it Sheilong: RhodiumToad: I am too stupid! When I encoded a string to base 64, the result of bitwise operations were indexes to the base 64 character table. Now to do the reverse operation, I was doing the bitwise operation on the decimal character representation instead of the index... theruran: can Guile 3.0 handle the nanopass framework Scheme code? Sheilong: Is there a built in procedure that counts occurrences of character in a string or in a list? RhodiumToad: yes RhodiumToad: string-count for strings RhodiumToad: for lists you could use a fold if there isn't any specific function for it RhodiumToad: ah, srfi-1 has a (count) Sheilong: RhodiumToad: Thanks so much. String-count suffices for now. RhodiumToad: so (string-count str #\a) or (count (cut eqv? <> #\a) lst) Sheilong: I am detecting how much padding is there Sheilong: Now I have how much padding I need to remove, it would be nice if there is a built in function to remove the last n characters from a string daviid: rnrs bass has length daviid: ]*base Sheilong: I am wrong. I want to remove the n last elements of a bytevector not from a string daviid: ah occurrences of ... forget length, i missunderstood the quiz RhodiumToad: bytevectors can't have their length changed, you'd need to copy it to a new one RhodiumToad: you might prefer just to keep track of the effective length Sheilong: bytevector-copy! is what I need, thanks guyu Sheilong: s/guyu/guys daviid: Sheilong: fwiw, ,use (ice formnat), then daviid: (format #t "~8,'0b~%" 15) -> 00001111 daviid: have to run, bbl Sheilong: It is ugly but seems to work lol https://paste.ofcode.org/QTyULvB3rm4Skeh6si9KFf rlb: Including the recent compiler changes, any general guidelines wrt choosing character classes vs case for parsing, e.g. if you're parsing something s-expression-ish? wingo: rlb: i would use case (or match, or whatever) wingo: match is nice because you can use character classes if you want to rlb: So for things like "digits" or a fixed set of delimiter chars, should character sets and case perform close enough to the same to not likely matter? rlb: (if you have any impression offhand) wingo: yeah i think they are similar wingo: the tradeoff as i see it is: "case" (or other chains of comparisons) can be more optimal. charsets allow to you be more abstract when specifying the set of characters, and potentially more extensible as unicode evolves wingo: i started rewriting guile's reader in scheme yesterday wingo: hoping to be able to write an ad-hoc tree-il -> C compiler for use in bootstrapping wingo: so i have been thinking about these questions as well wingo: one nice thing about case is that effectivel the dispatch to the clauses happens in parallel -- i.e. it's not test literals for this clause, otherwise the next, otherwise the next, etc wingo: it's o(1) dispatch to the right clause wingo: only matters sometimes tho *: rlb was toying with a scheme edn reader rlb: Thanks for the summary. rlb: (which might also if it performed well enough eventually grow to replace the current C clj reader -- which itself was stolen wholesale from guile's reader and adapted) rlb: (And if I finish it and it seems good enough, I also thought I might submit the pure scheme edn reader for consideration for guile -- if there's interest...) rlb: I'll be curious to see what you come up with -- what I'm currently doing is not very optimized. wingo: i am aiming to make a more-or-less faithful translation of the C reader to Scheme wingo: so as to preserve the same behavior. am trying not to optimize too much in the beginning wingo: i know the reader is important but maybe optimization payoffs are different in scheme vs c rlb: Indeed. rlb: Do we have a way to ask for a character set for a given unicode general category like "Zs" "Zl" and "Zp"? rlb: (wrt not optimizing (or maybe not optimizing), I'm using string output ports to accumulate pending text, i.e. unfinished symbols/strings/etc...) rlb: (Though I planned to go look and see how they currently work, i.e. are the good enough wrt cost right now.) *: rlb will head off soon wingo: rlb: wrt Zs etc, oddly i think not wingo: interesting choice, string output ports; hadn't thought of that. not sure how well it would perform; good expandable buffer, but they do round-trip to UTF-8 wingo: perhaps if we ever switched to utf-8 strings internally in guile, that would be optimal tho xelxebar: Okay, I'm stumbling myself through some guile and would like some general advice on approach. xelxebar: My goal is to essentially grep for a string in a file. xelxebar: The brute-force way I'm working on is to loop through the lines in the file and run a string-match on each. xelxebar: Another approach could be to slurp up the entire file into a string, and just do a single string-match, but this seems mildly dangerous in general. I don't want to put a 4GB string in memory by accident. xelxebar: Is there a more idiomatic approach here? Am I missing something obivous? chrislck: xelxebar: this is a hard(TM) problem. best solved via tools like ripgrep. chrislck: https://blog.burntsushi.net/ripgrep/ xelxebar: Haha! Fair enough. This is largely an pedagogical exercise in guile for me. I was wondering if there's a Guile-y way to do the equivalent of string-match on a file. chrislck: the guile way is exactly the same as the C/C++ way - consider buffer size, pointers, memory allocations, etc chrislck: you can limit your buffer size easily in guile just as in C rekado: xelxebar: this will become as complicated as you’ll allow it chrislck: in guile the national sport is minimising m in O(N^m) rekado: if you want to look up a fixed string (instead of a regexp) this will become somewhat simpler. rekado: but it still involves reading chunks of the file and being smart about matching rekado: here’s an entry point to the rabbit hole: https://en.wikipedia.org/wiki/String-searching_algorithm civodul: uh, srfi-64 (test-equal label value exp) behaves as if EXP returned #f when it actually threw xelxebar: Hrm. The level of abstraction that I'm thinking at here is "shell scripts". I'm trying to write the equivalent of some script I have in guile. If I'm understanding you correctly, it makes sense to just call out to grep/ripgrep/whatever in this case. I.e. there's not some short, idiomatic pure Guile replacement. mwette: wingo: While you are looking into strings, maybe look at how Python3 handles them. There are two literals, for example: b'hello' and u'hello'. The first is a bytearray and the second is a unicode string. wingo: using utf-8 as a string backing store wouldn't change api fwiw on the scheme side wingo: i thought most people thought of the python string / bytestring thing as a disaster rekado: xelxebar: there is no single search-string-in-file procedure in Guile. Which implementation is best depends very much on your use case. wingo: i would probably loop over calling "read-line" then calling "string-contains" but that's just me mwette: I was getting at clarifying the relationship between strings and {bytearray, encoding}. But going back and reading the Guile manual it is consistent. My problem is that I needed to read "character" as code-point and not byte. mwette: /quit rlb: wingo: hmm, I'll have to make sure I understand you better later -- If I have a string port and a char and then (put-char port c), I'd have assumed it just appends c to the string in some "reasonable" way. (And if not, we could fix it.) rlb: But I hadn't stopped to think about it hard yet or investigate. rlb: And wrt string vs bytes -- let's *not* do what python did, but most importantly by that I mean the backward incompatible break. But I'd say that having functions that can handle either bytes or strings might be (part of) a plausible solution. Though of course issues there too, i.e. (readlink x) could decide to return bytes or a string based on the type of x, but that doesn't help for something like (gethostname). rlb: In any case, I'd love to eventually have a plan there, and be happy to help implement it if I can. rlb: (Also be happy to help with utf-8 related work -- that was a stumbling block wrt lokke's use of pcre2 for #"foo" regexps since pcre2 does not support utf-32 (only 8 and 16).) mwette: Guile has (ice-9 regex) which operates on Guile strings. I assume it's basd on posix regex. So conversion currently uses locale but shouldn't the regex routines accept an optional encoding? mwette: (ice-9 regex) another target for implementation in scheme? leoprikler: iiuc all guile strings are UTF-8. If you need anything else, use bytevectors :) RhodiumToad: the problem with that is with reading strings from, say, filenames mwette: I believe, strings are arrays of code points, not encoded byte arrays. mwette: Files are arrays of bytes. So you need an associated encoding to turn those bytes into code points (aka characters). RhodiumToad: the more serious problem is file _names_ RhodiumToad: everyone expects a file name to be a string, but the OS is treating it as bytes mwette: Ah. I remember the issues. I'll bet they are, especially because LC_LANG(?) is volatile. RhodiumToad: well, LC_* might say that the locale is UTF8, but the filename might not be valid UTF8 mwette: exactly mwette: no encoding designation in DIR type? RhodiumToad: nope rlb: I believe internally strings are either "latin-1" (more or less) or UTF-32, neither of which pcre2 supports. rlb: And wrt (ice-9 regex), it's not guaranteed to be available, and when available "does whatever the platform does", and I wanted lokke to have well defined regexps (and they have to be available all the time, so couldn't rely on guile's support anyway) rlb: (and of the options pcre seemed like a reasonable choice) rlb: And wrt bytes vs strings, yeah, on many platform (i.e. linux), paths/hostnames/etc. are *bytes* not strings -- and there are additional potential complexities, since depending on how the unicode is handled, normalization and/or canonicalization can even mean that the string changes in a way that makes it impossible to find the original file, i.e. if you were to readlink something, then normalize/canonicalize the string, and then try to rlb: open it, it might fail. rlb: Or I suppose user and group names are perhaps a better example than hostnames... rlb: It can be quite fraught to pretend they're not. rlb: (or at least to *only* support pretending they're not) terpri: utf-8b, as i think it's called, is a fairly clever solution to the random bytes -> almost-utf-8 problem without losing information: https://web.archive.org/web/20090830064219/http://mail.nl.linux.org/linux-utf8/2000-07/msg00040.html terpri: iirc it's what python uses for things like posix pathnames (or a very similar trick) wingo: moo terpri: 🐮💬μῡ terpri: ah, this refers to python's usage, introduced as a "surrogateescape" error handler in pep 383: https://en.wikipedia.org/wiki/UTF-8#Derivatives rlb: Can't actually rely on it though, at least if you're using glibc because there's an issue/bug in glibc that it doesn't look like they're going to address, and python hasn't appeared willing to work around it either: https://bugs.python.org/issue35883 rlb: https://sourceware.org/bugzilla/show_bug.cgi?id=26034 rlb: So you can't use that to handle arbitrary paths -- have to stick to bytes. rlb: or you may crash your program on the wrong path rlb: (I've (unfortunately) had had an extraordinary amount of time consumed by the python upstream choices in this general area over the past few years...) Sheilong: Do you know how I read all lines from a file but without keeping the \n character? ATuin: Sheilong: see `(ice9 rdelim)` terpri: rlb, interesting, thanks for the links terpri: tricky to determine whether it's a genuine "bug" or not without diving into several standards (posix, iso c, unicode/iso 10646, ...) ecraven: hm.. why is guile on arch linux still guile 2? wingo: rlb: neat trick: (define (f ch) (define numeric '(#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)) (define (numeric? ch) (memv ch numeric)) (cond ((eof-object? ch) #f) ((numeric? ch) (- (char->integer ch) #\0)) (else 42))) wingo: the numeric? check optimizes to a table switch wingo: unfortunately guile is very stupid about eof-object? right now; need to fix that ecraven: that ignores almost all of unicode :P wingo: depends on what your definition of numeric is wingo: some languages define numeric in that way wingo: civodul: you ok with excise-ltdl? wingo: currently missing the mingw dlopen shim, but can fix up in master; i know mike gran has some work in this area wingo: apparently guile is broke on mingw anyway right now wingo: mike suggested simply pulling in the dlopen shim from cygwin into posix-w32.[ch], which sounds about right to me civodul: wingo: sounds good to me; that's for master, not 3.0, right? wingo: master is currently 3.0 fwiw wingo: no stable-3.0 branch yet civodul: right, that's why i'm asking :-) wingo: i was thinking we could do it in 3.0 actually civodul: ah wingo: :) civodul: heh :-) civodul: i'm just wondering about possible breakage civodul: i don't have any clear scenario in mind tho wingo: yeah. i thought about it and i don't know of anything that's not just a minor bug that can be fixed up in 3.0 wingo: but i know that's not quite watertight :) wingo: i would rather not branch off 3.2 at this point civodul: yeah wingo: if necessary, sure, but we don't have that kind of energy atm wingo: nor any kind of 3.2 value proposition, currently anyway civodul: i guess you can go ahead and then we'll test on a few packages wingo: cool :) wingo: ok done wingo: with an optimization to eof-object? :) civodul: so it can be inlined? wingo: yeah, inlines to (eq? x the-eof-object) wingo: aaah the optimization of that "f" above is really good now wingo: 3 (immediate-tag=? 0 255 12) ;; char? wingo: 5 (jne 21) ;; -> L2 wingo: 6 (untag-char 1 0) wingo: 7 (usub/immediate 1 1 48) wingo: 8 (mov 0 1) wingo: 9 (jtable 0 #(13 13 13 13 13 13 13 13 13 13 26)) wingo: L1: wingo: 22 (tag-fixnum 1 1) at (unknown file):3:159 wingo: 23 (reset-frame 1) ;; 1 slot wingo: 24 (handle-interrupts) wingo: 25 (return-values) wingo: if it's a char, it untags it, subtracts off #\0 already, then does a table jump. if untagged value is <= 9, it tags as fixnum and returns directly wingo: in this case we could compile to (< untagged-biased-value 10) instead of the table jump, which would be even better wingo: probably should get that together. but still, yay civodul: neat! daviid: it occurs to me that 3.0.5 depends or indirectly depends on gperf, which is not checked by configure and make fails (here, gperf was not installed) - should we not add a configure.ac check for it? RhodiumToad: depends on gperf? RhodiumToad: I build the freebsd port in a clean jail with only the declared dependencies, which don't include gperf tohoyn: I remember encountering a gperf dependency, too. wingo: gperf only needed when building from git rlb: Hmm, hit a problem in lokke -- clj allows interleaving defs and expressions like 3.0, but I forgot 2.2 didn't. Unless I can think of a reasonable way to adapt for 2.2, I suppose I might just mark interleaving as a known issue if you're using 2.2... ArneBab: sounds good. ArneBab: → go for 3.x? rlb: Yeah, currently support/test both, but lean against diverting too much effort to accommodate 2.2 if/when something requires more work there, as compared to other improvements. Realized it last night, and think I'll probably just mark it as a known issue for now. apteryx: is there no ,continue in the Guile debugger? apteryx: I guess ,finish should do the same manumanumanu: rlb: I have a macro that shadows the basic built in forms manumanumanu: so that you can have definitions in expression context manumanumanu: rlb: https://hg.sr.ht/~bjoli/guile-define daviid: davexunit: http://haunt.dthompson.us is down? daviid: that's the link that is on http://sph.mn/foreign/guile-software.html, let me know if it needs to be changed ... manumanumanu: rlb: Note however, that guile 2 does _NOT_ optimize letrec very well. Using those macros, define in expression context is slower than using let and let* manumanumanu: and forms that do not import that module still don't allow defines in expression context. Say you import srfi-9, 11 or (ice-9 match), those bodies wont be transversed for inline defines. davexunit: daviid: correct link is https://dthompson.us/projects/haunt.html manumanumanu: rlb: it was in guile-3 when guile started optimizing letrec to be as fast as let and let*. Using define instead of (let ...) in guile prior to 3.0 means a measurable overhead. You'd think it wouldn't be that much, but I had code that got a 10% speedup be rewriting 4 defines as let*. daviid: davexunit: ok tx davexunit: np rlb: manumanumanu: ahh, interesting -- thanks. That might explain some of the notable performance improvements I've seen with 3.0, since at the moment the clojure fn expansion involves letrec. wingo: fun bug: (read-disable 'square-brackets), then (call-with-input-string "]" read) wingo: gives EOF rlb: oops... rlb: wingo: any idea if it's intentional that when you hit an error in the repl, the prompt and printer (at least) switch back to the default (assuming you'd specified some other one for a dialect)? wingo: not intentional wingo: i suspect there are many ways multi-language support can be improved rlb: i.e. in lokke, after an error, you're in a new prompt, still (current-language) -> lokke, but the printer is the scheme printer, and the prompt is back to the default guile prompt. wingo: sounds like a bug :) rlb: exiting the recursive repl of course returns to the lokke printer and prompt. rlb: ok, thanks - I might look in to it later if I have time. *: rlb has encountered a handful of things like that, but still, overall it's worked plausibly well. cybersyn: hiya guilers! i'm really more of a racketeer, but i'm on guixos, a big fan of what i've come to know of guile, and thought of something that would be more "guile" in general cybersyn: so, over the past decade i've made my living as a new media artist -- working on commission to create various installations for the events of big brands (not what i want to do, just the way i figured out how to make money while also pursuing philosophy) cybersyn: since the pandemic, i started picking up gigs in UX design, cybersyn: i was just thinking that, with all of this awful "learn to code" marketing thats happening, if there was a counter campaign, complete with nice designs that perform a sort of /Verfremdungseffekt/ on the concept of "learn to code", with some sort of message: software is labor, if you're going to work you might as well work on means of production that you own after the job is over cybersyn: anyway, sorry for the sudden intervention, i was just thnkng about things and that crossed my mind as a nice way to turn crowds that might be learning to program right now to Dasein-oriented-programming cybersyn: (go on with your days, please don't mind me) cybersyn: /wallops cybersyn: sorry marusich: In scheme, what is the intent behind using % at the start of some variables? I can't quite tell. rlb: marusich: just generally at least in guile, I think, an indication that the thing is intended to be "private". mdevos: marusich: in Guix, it's also used for read-only arbitrary constants (e.g. /location/of/key/file, /location/of/cache/dir) marusich: I see. Thank you rlb: yeah, I suppose %load-path isn't really meant to be private either? So maybe I'm mischaracterizing... daviid: fwiw, it also starts some proc names, like %global-site-dir ... leoprikler: % means "implementation detail" in some way or another most of the times rlb: Is there a good description somewhere about the behavior of syntax-case literals, i.e. (syntax-case x (literal ...) ...)? rlb: I ask because I've have some slightly mystifying instances where the correct clause won't match if the term is listed as a literal, but will if I rewrite the clause to explicitly check for it via a guard like (eq? 'something (datum->syntax #'x)). rlb: (I strongly suspect my mental model is just inadequate.) rlb: (And yeah, I'll try to create a smaller example later -- most of the cases I've noticed were in very complicated broader environments.) rlb: But I'd assumed that syntax-case literals would *always* match. mwette: I thought %var convention was used in GUile to denote a global variable. soda__hobart: uh... does scheme have a way to define a partially applied function? soda__hobart: oh, i guess it's called "cut" and it's from srfi-26. haha, that took a while to find marusich: So % is read-only, private, an implementation detail, or global. I suppose it depends upon the context :) marusich: At the end of the day, it's good to remember that it's just the first character of a variable name... rlb: OK, I had a chance to to create an example https://paste.debian.net/hidden/876bfcc8/ If you use that module, and then try (something syn #t), it should behave as described in the comment. rlb: Is that the expected behavior? i.e. that a syntax-case literal isn't supposed to match in a clause if the symbol is both bound to a syntax in the module containing the define-syntax and the literal's symbol isn't also exported from that module. rlb: (I'd thought that literals always matched, irrespective of any bindings in the enclosing environment.) rlb: s/thought/imagined/? rlb: (I mean the definition environment, I know that the *expansion* environment can override them.) rlb: (let ((else #f)) (cond (else 'nope)) wingo: moin wingo: rlb: for better or for worse, literals to syntax-rules / syntax-case match by binding rlb: So it captures the current "value" or something? wingo: if the literal is unbound when the macro is defined, it will match against that name as long as it isn't defined at the use wingo: otherwise if the literal is bound, then the name matches only to the same identifier (possibly exported / re-named / etc) wingo: the good thing about that is that you get to rename literals on module boundaries, if you want wingo: but it requires a different mental model. matching by binding, not matching by raw name wingo: fwiw this changed in guile to match the scheme spec in 2.2.0 rlb: OK, much appreciated -- that unconfusesme about a lot of things I'd seen. I thought if I said "else" it meant *else* (i.e. the symbol else) unless the expansion environment had it bound. rlb: For a while I'd just assumed I was probably doing something ill-advised somewhere in my giant pile of macros/hacks. rlb: When you say "same identifier" are we effectively talking about the variable, or what it refers to at the time, or something else? rlb: Ahh, I guess likely what it refers to at the time. rlb: (given what else you said) rlb: (and what I've seen) *: rlb thanks wingo again - and wanders off rlb: (So it's syntax bindings that matter wrt literals, i.e. an established define binding doesn't affect the matching.) leoprikler: yep, that's why you have (syntax-rules (else) ...) for example leoprikler: [and similarly syntax-case] leoprikler: marusich: for more context https://www.cliki.net/Naming+conventions says "%foo: low-level, fast, dangerous function, or Lisp system specific implementation of foo" leoprikler: in other words: "%" means "no touching unless you know what to do" rlb: Right, and if I want else to always match the symbol else, unless someone overrides it locally, then I need to make sure else is not bound as a syntax when I define-syntax cond. rlb: (or I suppose you can use an (eq? 'else (datum->syntax #'x)) guard...) leoprikler: lemme code something up real quick leoprikler: rlb: see https://paste.gnome.org/p6z6tbiib, you need to locally bind else leoprikler: if you want to match symbols, you can apparently just quote them as well, dunno about keywords rlb: Right, my question was about what happens when else is defined as a syntax just before whats-this?, etc. If it is, and else isn't exported alongside whats-this?, then else won't work in an importing modules. That's what I was just trying to verify as expected (and make sure I understood). *: rlb wanders off again for a while mdevos: Why does wait-condition-variable require a condition variable? I'm using condition variables for signalling, without any data access requiring locks. RhodiumToad: rlb: note that there's a syntax binding for 'else by default RhodiumToad: mdevos: do you mean, why does it require a mutex? RhodiumToad: the main thing to understand is that condition variables are subject to spurious wakeups, so you need to test a value (which is itself protected by the mutex) to know whether the wakeup is real mdevos: RhodiumToad: I didn't know spurious wakeups are possible, thanks! mdevos: there was no menton of spurious wakeups in the manual, however RhodiumToad: that said, guile (at least in the guile3 code I'm reading) is using its own wrapper around the actual pthread primitives, with another layer of mutexes RhodiumToad: so it may not in fact be subject to spurious wakeup wingo: i think it is subject to spurious wakeup fwiw wingo: like guile has no way to know whether the wakeup would be spurious or not wingo: afaiu anyway wingo: *afair :) RhodiumToad: I'm reading threads.c, and it looks like guile is representing a condition variable as a mutex and a queue of guile threads, mdevos: the (im)possibility of spurious wakeups should be mentioned in the manual I think RhodiumToad: and a thread sleeping on one puts itself on the queue and sleeps on its own condition var RhodiumToad: hm mdevos: as this is apparently not a trivial issue, and varies with platform *: mdevos writes bug report RhodiumToad: but block_self doesn't actually check RhodiumToad: so... maybe spurious wakeups are possible, I wouldn't bet against it RhodiumToad: anyway, you should use the mutex as intended to protect the condition you're actually sleeping for mdevos: Sent! mdevos: IIUC, I should run (let loop () (wait-condition-variable!) (with-mutex MUTEX (if VARIABLE-SET DO-STUFF loop)) until the VARIABLE-SET is actually true? mdevos: (I've one thread A that initializes a data structure D then notifies another thread B that D is ready) mdevos: Actually, I think I don't need a full-fledged mutext, inserting the initialized data into an atomic box should be enough. mdevos: s/mutext/mutex RhodiumToad: no, the with-mutex goes outside the wait-condition-variable RhodiumToad: you have to be already holding the mutex when you wait on the condition mdevos: RhodiumToad: I just noticed (-: RhodiumToad: you should acquire the mutex, check the variable, if not set then wait on the condition variable and loop wingo: mdevos: depends on your use case, but you might like fibers & channels a bit better RhodiumToad: (loop back to checking the variable, that is) mdevos: wingo: I like fibers & channels better, but I'm hacking on an (ice-9 threads) code base now (tests/publish.scm from Guix) *: wingo nod wingo: i wonder if we should move fibers into guile at some point; dunno wingo: cc civodul mdevos: wingo: you might want to consider documenting the difference between ‘fibers conditions’ and ‘(ice-9 threads) conditions’ ... mdevos: in ‘fibers condition’, you can signal a condition, then wait for it. As the condition stays signalled, the wait returns mdevos: but with (ice-9 threads) the wait blocks forever untill the condition is signalled again (I think) wingo: yeah, different cultural lineages there (pthreads vs concurrent ml) *: mdevos almost introduced a concurrency bug in Guix test suite wingo: probably deserves a notes wingo: *note civodul: hi! civodul: wingo: i enjoy Fibers but i think we need to do a bit more polish work civodul: it's too easy to shoot oneself in the foot by calling something that happens to be blocking civodul: mothacehe has experienced it the hard way with Cuirass wingo: mostly ports-related I guess? mdevos: are there still continuation barriers in "soft ports" and "R6RS custom binary port callbacks"? Maybe (fibers)Barriers needs an update wingo: i haven't done any work in that area for a little while so i suspect that documentation is indeed up to date mdevos: wingo: while we're talking about Fibers, would a ‘wait-until-fd-readable-operation’ and ‘wait-until-fd-writable-operation’ be possible? mdevos: I worked around its absence by using a pair of fibers using current-read-waiter and current-write-waiter and condition variables. mdevos: But ideally, I would be able to write something like ‘(choice-operation (wait-until-fd-readable-operation A) (wait-until-fd-writable-operation B) more-stuff-unrelated-to-fds)’ wingo: yes i think it is probably possible to build those with the current api -- lemme see wingo: might not be an ideal coordination mechanism tho, because the fd being readable at operation wakeup time doesn't mean that it will be readable when you go to do something with it mdevos: wingo: I can live with that, spurious wakeups aren't problematic for my usecase mdevos: wingo: also, these fds in my use case are only written to and read from from a single fiber. Let me find the source code URL ... mdevos: https://notabug.org/mdevos/rehash/src/rehash/scheme-binding/rehash/fibers.scm mdevos: it ents GNUnet's task scheduler on top of fibers (all tasks are still run in a single fiber, however, as the GNUnet libraries do not expect concurrency). wingo: mdevos: something like https://gist.github.com/wingo/74d9c708ef3d2c5e884df254e9392974 civodul: wingo: it's about things that block in general: could be i/o like 'read', which is blocking, or guile-sqlite3 procedures (we ended up setting up a "database server" running as a thread, which we would send messages to) wingo: database server as a thread totally makes sense civodul: prolly Cuirass was kind of an extreme case though wingo: i get what you are saying about blocking in general but some specifics can help guide future work civodul: these are two specific examples of problems we had civodul: read and guile-sqlite3 operations civodul: it's not "fibers' fault" in a way civodul: but it does mean bad surprises and extra work for someone not familiar with the internals *: wingo nod wingo: maybe lookahead-u8 isn't the right check there in that operation wingo: would need to replace with char-ready? i think wingo: which, and this is wild, doesn't actually ensure that a char is ready... just a u8 civodul: heh, it comes from the old times :-) mdevos: wingo: looks much nicer than the workaround I've cobbled up! Can you add a copyright+license header? mdevos: When I get around to also implementing wait-until-port-writable-operation and testing both operations, I'll submit a patch wingo: done wingo: great ex_nihilo: I just installed Guile 3.0.5 and did sudo ldconfig after, getting the error: ex_nihilo: "ldconfig: /usr/local/lib/libguile-3.0.so.1.3.0-gdb.scm is not an ELF file - it has the wrong magic bytes at the start." ex_nihilo: This happened when I did an ldconfig some time after installing Guile 3.0.4, too. ex_nihilo: Both times I just renamed the offending libguile file, and then ldconfig worked, but this doesn't seem right. RhodiumToad: what OS? ex_nihilo: Are other people having this problem? Is renaming or removing libguile-3.0.so.1.3.0-gdb.scm going to cause any problems? ex_nihilo: Debian Linux mdevos: wingo: did you receive my PM? The IRC client made a sound suggesting it couldn't be send andrzejku: hello andrzejku: :) spk121: ex_nihilo: that file is a scheme file, so the error is right spk121: ex_nihilo: if you have a version of GDB with Guile extensions enabled, it uses that file to add functions to gdb. I guess the real question is if it is being installed in the right place for gdb to use it spk121: but feel free to remove it if you don't use GDB in that fashion civodul: i'm getting more and more frequent peaks of anxiety regarding this GnuTLS/GMP issue, after trying to stay calm for a while :-) civodul: wingo: you proposed disabling custom GMP allocators in Guile to work around it civodul: did you have "local" workarounds in mind too? spk121: civodul: selfishly, for the sake of portability, I think now would be a great time to pull mini-gmp into the Guile tree and get rid of another build dependency for Guile. wingo already started w/ working to eliminate libltdl spk121: assuming mini-gmp is up to the task, and is not too slow civodul: spk121: yes, definitely civodul: mini-gmp is apparently a bit slower, but we don't rely that much on bignums[*] civodul: [*] except in the compiler civodul: to me that's clearly a medium-term goal civodul: but i'm also looking for a workaround to that problem that we could deploy easily, even with current Guile versions dsmith-work: Monday Greetings, Guilers ex_nihilo: spk121: on my system GDB was looking in /usr/share/gdb/guile/ for Guile scripts, so I moved libguile-3.0.so.1.3.0-gdb.scm to that directory. ex_nihilo: That gets it out of the way for ldconfig, and GDB can still use the Guile extensions. ex_nihilo: I still don't really understand why it got dropped in the /usr/local/lib/ directory to start with, though.... spk121: ex_nihilo: might be a bug in guile/libguile/Makefile.am maybe. It looks like there is some hackiness there with regards to how that file is installed. But I don't know ex_nihilo: spk121: it looks like this is the same issue, a few years ago-- https://bugs.mageia.org/show_bug.cgi?id=19659 ; there is a link to a solution there that is just a script that removes the file ex_nihilo: The first time I tripped over this I had run somebody else's Makefile to install something, and it used ldconfig at the end and failed ManDay: Hi, I got a strange e-mail from the devel list sayinv ManDay: Your membership in the mailing list guile-devel has been disabled due ManDay: to excessive bounces The last bounce received from you was date ManDay: What'S that about? ManDay: I haven't written anything to the list in a long time, and certainly not bounced anything either wingo: ManDay: dm me your email and i will check mdevos: that means the mails from the mailing list to YOU have bounced, I think wingo: there is a program that automatically manages the mailing list, more or less ManDay: wingo: send notice ManDay: *sent ManDay: mdevos: does that mean the server replied with "send it instead"? wingo: indeed you are marked as subscribed but not receiving mail delivery because of excess bounces from your mail provider mdevos: ManDay: I don't know what that means wingo: check with your mail provider, perhaps? and check that you actually receive recent guile-devel mails mdevos: I haven't ever gotten such a notice wingo: when you have it fixed lmk and i will re-enable delivery ManDay: from the archives it looks like I've only received a fraction ManDay: I don't know what "excess bounces" means, though ManDay: do you think my mail provider knows? mdevos: bounce = X tries to send a mail to Y, the mail server replies with "Nope!" (or mail server is offline, idk). As you didn't send any mail yourself, I believe X = guile-devel and Y = ManDay mdevos: maybe the mail provider hasn't heard of the concept ‘mailing lists’, multiple accounts at the provider are subscribed to guile-devel@gnu.org mailing lists and now the provider thinks guile-devel@gnu.org is a spammer due to the many e-mails sent? mdevos: only speculation, though ManDay: well, vfemail has had some pecularities in the past, but I doubt that that's it ManDay: So Rick from vfemail replied and he said you should have error messages on the mailing list server which explain this better ManDay: let me paste ManDay: Well, The maintainers should have the error messages to your address - ManDay: that's the easy way to find out. ManDay: " ManDay: He also explained something about something called RBL list and UCEProtect hits and said he adjusted some settings to see that it doesn't happen again, but I guess if you had some sort of error message it would be helpful to return to him ManDay: if you have anything, please e-mail me with it or leave an memo so I can forward it, thanks! wingo: moo spk121: is there a library for n-ary trees and doing depth-first traversal, such as for a tree of build events with prerequisites wingo: prolly not, i guess only (let visit ((node node)) (if (leaf? node) (visit-leaf node) (for-each visit (branch-children node)))) or so wingo: for appropriate values of leaf? visit-leaf? and branch-children wingo: a bit of a sloppy answer, clearly i should go to bed spk121: thx. Go sleep. rlb: OK, thanks, and right, so our Z is not at all "bugfix only". rlb: Just realized I hadn't thought carefully about it in a while, though I also hadn't been in a position to need to as much :) spk121: I know we've added API in 3rd level fairly often, as I recall rlb: Right, I suppose past a certain point, that might make my job with the debian stable release managers harder, in theory, but it hasn't yet been an issue in practice. spk121: And again, I'm not a maintainer, just a long time lurker, haha RhodiumToad: mwette: my version actually uses a bytevector rather than a plain vector, for speed rlb: I noticed that when I set up a custom repl for a dialect, it works fine until there's an exception. Then, when it enters the new prompt, it's back to the default repl. I wondered if that's considered preferable, or if there's a way I should be specifying that new prompts should also be custom? rlb: e.g. rlb: lokke@lokke.user> (x) rlb: ;;; : warning: possibly unbound variable `x' rlb: ... rlb: Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. rlb: lokke@(lokke ns lokke user) [1]> rlb: rlb: You can see that the initial prompt has the module name reported in clojure namespace syntax i.e. lokke.user, but after the error it's the guile module name list. rlb: iirc the printer's back to the scheme printer too, which is a bit more of an issue, i.e. when debugging. RhodiumToad: that's presumably an artifact of what the exception handler is doing? rlb: Sure - it looks like it happens right here: http://git.savannah.gnu.org/cgit/guile.git/tree/module/system/repl/error-handling.scm?h=v3.0.5#n77 And so I'd want start-repl to start a lokke repl, not a scheme repl if that's feasible. rlb: (I think?) plattfot: Hi, already asked this in the #guix channel, so sorry in advance for double posting. But I didn't get much help, and therefore I'm testing to ask here as well. The issue I've is with that I'm trying to stamp in the load and compile path for my script. What I did was to use `(eval-when (load expand eval) (set! %load-path (cons "@guilemoduledir@" %load-path)) (set! %load-compiled-path (cons "@guileobjectdir@" %load-compiled-path)) plattfot: @guilemoduledir@ and @guileobjectdir@ are set in the configure.ac file. plattfot: I thought it was working as my package worked fine on my machine, but turns out it only works on my machine and everyone else gets an error about guile not finding the module. plattfot: Here's the error message: https://github.com/plattfot/pinentry-rofi/issues/13 plattfot: Here is the patch I submitted to guix: https://issues.guix.gnu.org/46148 plattfot: Ok, think I got something that works. It's not as elegant I was hopeing but it seems to work. rlb: top rlb: heh, oops leoprikler: how do I create an immutable vector? (other than reading it) civodul: leoprikler: use a vlist! rlb: leoprikler: there are also wingo's fector.scm (though I think there may be a bug in the pop method I haven't tracked down yet), and lokke's vector (both are O(log_32(N)) bagwell-style structures: https://hypirion.com/musings/understanding-persistent-vector-pt-1 The latter's a C extension, though, so perhaps not worth the complexity. And both are I think intended to be thread-safe. I know lokke's is. RhodiumToad: (read) doesn't return immutable vectors. RhodiumToad: I _believe_ it's the process of compiling it that makes it immutable leoprikler: That's all a bit too high for what I actually need (which would be closer to static arrays, but I solved the problem in which I've used them through other means). leoprikler: Still, I feel as read-only array( view)s are something guile lacks RhodiumToad: (let ((v (with-input-from-string "#(1 2 3)" (lambda () (read))))) (vector-set! v 1 4) v) ;; #(1 4 3) RhodiumToad: (let ((v (compile (with-input-from-string "#(1 2 3)" (lambda () (read)))))) (vector-set! v 1 4) v) ;; error RhodiumToad: (let ((v (compile #(1 2 3)))) (vector-set! v 1 4) v) ;; error RhodiumToad: (let ((v (compile (vector 1 2 3)))) (vector-set! v 1 4) v) ;; also error leoprikler: heh, nice rlb: ...I've thought I'd also like to have good support for immutable goops class instances with some way to copy/change one fairly quickly, i.e. to make a fast copy with a few specified slots changed. rlb: (ideally in a way that promises to be "thread safe", i.e. final pointer isn't visible to any thread unless the fully initialized contents are) daviid: rlb: goopd itself isn't thread safe, class-redefinition ... daviid: but someone wrote slot-fset, dustyweb i think rlb: That's potentially I separate issue? i.e. whether or not you need thread-safety for class redef might be different from whether or not you need thread-safety for creating new instances? rlb: But either way good to know -- thanks. rlb: s/I/a/ rlb: For me the latter would be more important in the short/medium term. daviid: i think i have a copy, let me see daviid: rlb: here https://paste.debian.net/1183483/ - rlb: Ahh, thanks -- I suspect I'd eventually want a bulk operation, but that's a great starting point. daviid: what is a bulk operation? rlb: modify multiple slots at once for one clone. rlb: i.e. (foo object 'bar 1 'baz 2) or something daviid: ah ok, i wrote a syntax to do that in g-golf rlb: or rather (adjusted-clone object 'bar 1 'baz 2) or something daviid: actualy it is a proc :) daviid: here daviid: http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/support/goops.scm?h=devel - lines 127 ... rlb: I wonder how close the current compiler can get that to a "memcpy followed by some assignments" in perf, or maybe it can (or eventually can be taught to) do even better. rlb: (But first of course, have to see whether it's already "good enough" before worrying about it.) rlb: And thanks again. mdevos: I'll propose exporting extra O_* flags. Should the e-mail go to bug-guile@gnu.org or guile-devel@gnu.org? rlb: Personally, I'd be inclined to say patches to guile-devel, for review, but if we'd rather do that somewhere else, then no worries. daviid: rlb: actually, I forgot that in 3.0, classses are non redefinable 'by default', so if you' using 3.0 and use slot-fset, or mslot-fset, then it should be thread safe mdevos: rlb: it's not a patch, only a description of what O_* flags I would like to see in new versions of guile. rlb: Ahh, then maybe a bug at least, i.e. might be more likely to not forget about it. rlb: (I suspect I'm in favor of the additions.) rlb: fwiw mdevos: rlb: gah, I accidentally sent it to -devel instead of bugs. rlb: that's fine too, though we might still want a bug for tracking unless someone has time to work on it more immediately. mdevos: rlb: will do ruffni: is it possible to get the value of a variable by querying a symbol? reference manual on "Binding Reflections" intends to inform (subtitle: Querying variable bindings) but there's only method (defined?) mentioned.. chapter 6.6.6.3 (Symbols as Denoting Variables) mention unquoting a symbol (but `(unquote 'my-symb)' fails). daviid: ruffni: there is no "Binding Reflections" entry in the manual, there is a Module System Reflection entry, which has all the answers to your quiz, i thing :) daviid: module-variable, module-ref ... ruffni: i saw that, but what is this "module" object? ruffni: is `(chickadee math)' such an object? daviid: (resolve-module '(chickadee math)) ruffni: btw sorry, it's referred to as "Binding Reflection" in 6.12 "Definitions and Variable Bindings", but the page is called differently (Querying variable bindings) ruffni: aha! thanks! daviid: welcome Sheilong: I am having trouble to import custom file module Sheilong: https://paste.ofcode.org/37QEjaWduPm3zDe27JX2uyi Sheilong: :39:7: In procedure module-lookup: Unbound variable: brute-force-xor Sheilong: I managed to fix it. tohoyn: any opinions on the improved statprof (see guile-devel mailing list)? Sheilong: How do I convert something like this ("49" "43" "45") to this "494345"? I tried with (list->string) but In procedure string: Wrong type (expecting character): "49" RhodiumToad: string-join? RhodiumToad: (string-join '("49" "43" "45") "") -> "494345" Sheilong: RhodiumToad: I want to concatenate them without adding spaces Sheilong: RhodiumToad: I just want to convert a string in the hexadecimal representation RhodiumToad: uh Sheilong: well, if I can concatenate those values I am done. RhodiumToad: you mean, given a string, you want to construct another string of the hex values of the bytes? RhodiumToad: that's more complex than you think because of encoding Sheilong: RhodiumToad: acually I am converting it to decimal ascii and then enconding as hexadecimal RhodiumToad: converting it how? Sheilong: RhodiumToad: With these procedures https://paste.ofcode.org/pHiJZJHcn4uUnww962GRaR RhodiumToad: so the problem there is that characters aren't bytes, and that a character might have a value > 0xFF mwette: maybe string->pointer, pointer->bytevector, bytevector-ref, number->string Sheilong: Yeah. I just want to work with raw bytes Sheilong: It was just a matter of converting the characters of the text to a 8 bit representation. mwette: bytevector-u8-ref, that is RhodiumToad: a while back I wrote optimized versions of hex encode/decode of bytevectors RhodiumToad: in particular, lookups tables for the hex to bytes conversion can give a fair speedup RhodiumToad: https://github.com/RhodiumToad/scheme-bits/blob/master/hex/hex.scm mwette: sneek: later tell wingo What is JIT_TMP0? mwette: sneek: botsnack mwette: wingo: what is JIT_TMP0? Is that the arch always-zero register? RhodiumToad: looks like sneek is AWOL again mwette: slacker RhodiumToad: iirc, JIT_TMP0 is just a temporary RhodiumToad: get_temp_gpr returns it RhodiumToad: it's not an always-zero register since many arches don't have one of those mwette: RhodiumToad: thanks *: RhodiumToad spent some time grovelling around inside lightening to track down the arm bugs mwette: Ah. I'm taking a rookie shot at the riscv target. DadeBonetti: Hi! DadeBonetti: how can I aplly an "and" to a list of booleans? DadeBonetti: (define mylist '(#t #f #t #f #t #t)) DadeBonetti: (apply and mylist) DadeBonetti: returns: DadeBonetti: Wrong type argument in position 1: # RhodiumToad: hm, tricky that and is a macro and not a function RhodiumToad: ah, it's because it doesn't evaluate unneeded args RhodiumToad: anyway, the "and" of a list is false if and only if the list contains #f, so you could use memq maybe? RhodiumToad: (assuming you want to treat an empty list as true, which is usually what you want) rlb: (...or srfi-1 every if you need more flexibility) ft: There's also ‘every’ in srfi-1. *: ft high-fives rlb rlb: :) DadeBonetti: (memq and mylist) seems to work. DadeBonetti: no, (memq and mylist) returns #f even if mylist is '(#t #t #t), so I'm doing something wrong ft: (every identity '(#t #f #t)) RhodiumToad: (not (memq #f mylist)) rlb: (not (memq #f mylist)) ft: :) DadeBonetti: (not (memq #f mylist)) is perfect DadeBonetti: thanks a lot DadeBonetti: (every identity mylist) also DadeBonetti: :) ft: ‘every’ short-circuits, btw. When something in the list doesn't fulfil the predicate, it returns #f and disregards the rest. RhodiumToad: presumably memq also stops at the first match. rlb: wingo: fwiw excise-ltdl (assuming I wasn't accidentally picking the system guile, and I think I probably wasn't) works fine with lokke too. rlb: civodul, wingo: wondering about https://debbugs.gnu.org/46001 -- it's preventing 3.0.5 from migrating to testing in debian since it sometimes fails on the buildds. Assuming we don't track it down soon, wondered if you have any opinion offhand about the risk of marking it flaky for now. rlb: Hmm, I guess I could/should try that test loop against the current debian version -- i.e. if it fails there too intermittently, then perhaps I have my answer. civodul: rlb: oh, that one doesn't ring a bell civodul: i remember the stack-overflow test is flaky, but i don't remember seeing this one before civodul: but yeah, maybe you could mark it as such rlb: First time I saw it was the 3.0.5 upload, but it'd easy to reproduce (see the one-liner in the bug). civodul: ah yes Sheilong: (number->string b 16) converts to base 16 but does not add a 0 before the first character Sheilong: I can't reproduce a string here because this zero is lacking RhodiumToad: why would it add an 0? Sheilong: RhodiumToad: I need to convert a numeric bytevector to a string hexadecimal representation. I can get the same resulting string as here https://cryptopals.com/sets/1/challenges/5 but the 0 at the first position is missing. However, in python with 'hexlify' it does return the string with that 0. I know that zero is meaningless... RhodiumToad: it's not number->string's job to pad the result or otherwise do formatting RhodiumToad: you can do the padding yourself in many different ways rlb: Maybe it was already mentioned, but depending on what you need, (ice-9 format) might also be interesting... RhodiumToad: e.g. using (ice-9 format), you could use (format #f "~2,0x" b) RhodiumToad: the code I linked above instead uses a lookup table for performance RhodiumToad: sorry RhodiumToad: (format #f "~2,'0x" b) Sheilong: the previous one added two zeros Sheilong: RhodiumToad: thanks so much. Sorry for being noob Sheilong: https://paste.ofcode.org/WppmKt2pLfTm2gjzMrVCFY mwette: Sheilong: if you are doing one at a time you can also do (define (hx->st ch) (vector-ref #("00" "01" ... "FF) ch) ; I think RhodiumToad suggested that, maybe. *: mwette is still working riscv port, wondering what happened to jit_node_t *: mwette sees that there is lots to do still ... rlb: Where do we document our versioning policy? I wanted to make sure I follow it, and I *think* we're not being strict with respect to Z releases? i.e. we may well add (and have added) new features in Z releases? rlb: I guess we just added mkdtemp, without a new Y so perhaps that answers my question... spk121: rlb: major releases have usually coincided to changes to the VM rlb: Are you talking about "X" releases or "Y" releases? rlb: I'm just trying to make sure I understand what's allowed without needing a Y increment. rlb: wrt X.Y.Z spk121: 1.x was no VM and no unicode, 2.x was VM and unicode 3.x was JIT rlb: Right. spk121: the 2nd level is fuzzier but associated with breaking existing code spk121: the 3rd level should not break existing code, but, sometimes they do spk121: historically daviid: davexunit: I'd be hapy to try to help, no garantee but i'd be happy to try - it would be easier if '... put together a contrived example that doesn't use all the special library code I have ...', so i can try here ... daviid: davexunit: the proper route is, imo the mop indeed, exactly what you did, using #:allocation ... daviid: you don't need to allocate, guile-gnome and g-golf GObject subclass properties are not allocated on the scheme side ... daviid: *you don't need to allocate using the default goops allocator i mean ... davexunit: daviid: I feel like I'm on the verge of getting it, but I'll ask a question tomorrow if I'm still stuck. thanks. spk121: lol. I got a mingw guile 3.0 to run a gtk3 example app. I'm really surprised it actually worked davexunit: wow davexunit: jit enabled? spk121: davexunit: nah. unthreaded, non-jit, 32-bit only. I think I'm getting close on jit, though spk121: today, I reimplemented a version of a C procedure called 'ffs' for the jit. I'd never heard of it, but, that's not what I think of when I see those 3 letters. davexunit: spk121: lol! davexunit: me either davexunit: I'm no good at figuring out windows build issues, but a windows build with threads and jit would be great davexunit: oh and 64 bit spk121: janneke figures out the 64-bit problem for guile 2.2 on mingw, but, his patch doesn't apply directly to 3.0, since the VM has changed a bit davexunit: oh cool davexunit: hmm... throws away custom slot init args. davexunit: it uses the slot args to make a new slot with #:virtual allocation, but it only copies over the standard args. my understanding is that slots should be able to accept arbitrary initargs that metaclasses can use to do custom things. vimacs: guile 2 seems to be wrong with call/cc, I haven't tested on guile 3 yet: https://paste.debian.net/1183158/ Sheilong: The datatype of my hash's key is string. But I am getting an error right here Sheilong: In procedure string-downcase: Wrong type argument in position 1 (expecting string): #\esc Sheilong: I can't access hashtable elements with single char, it only accepts strings. Is there a way to threat chars as strings? Sheilong: How do it convert char to string? spk121: Sheilong: (string #\esc) Sheilong: spk121: thanks. dadinn: hi all dadinn: Is there a way to check a binary is available from Guile using `system`? dadinn: I am currently using calling (system "which" bin) and checking the result, but I assume there is a more reliable/efficient way to do this without relying on external binaries dadinn: anyone around at this time? spk121: mostly no. It is early in Europe spk121: I couldn't think of a clever answer to your question dadinn: spk121: I am in Europe too... early riser it seems, couldn't sleep because this question kept bugging me ;) dadinn: spk121: I am looking at `execlp` but I am not sure how it really works dadinn: when using it from REPL, if the executable exists, then it quits from the REPL... if it doesn't then it throws an error, and goes into debug :/ dadinn: I am using it with no arguments to the executable, like: (execlp "lsblk") spk121: dadinn: if you want to spawn a new process, you use API like fork, system, or popen. execlp and friends replace the current process with something new. If you want to use execlp and don't want to replace your current process, you do a fork then an exec spk121: I'd stick with 'system' and 'which'. It is not so bad. Otherwise you could (system "/usr/bin/guile --version"), or you could check if the file exists using 'stat' and friends dadinn: spk121: stat would be ok, but i need the PATH lookup done via execvp system call :/ dadinn: spk121: also `which` is not available on some Linux distros dadinn: spk121: hmm, it seems maybe I should be using (system* "command" "-v" myexecutable) instead of "which" dadinn: spk121: actually just realised that `which` itself is a just another shell script, at least on Debian! :O leoprikler: yep, one can implement path lookup pretty easily in a scripting language as well leoprikler: is it worth it? probably not spk121: this is a brute force solution just checking filenames https://paste.gnome.org/ppodsjkne dadinn: (system* "command" "-v" "lsblk") returns an error saying "In execvp of command: No such file or directory" dadinn: weird because outside the guile REPL the that works :/ dadinn: khm, `which command` obviously doesn't work... `type command` says it's a shell built-in! Fuckin shit! dadinn: of course `type type` is a shell built-in too! dadinn: spk121: how do I do this fork+execlp thingy? dadinn: is it with the primitive-fork? spk121: dadinn: yes, but, are you trying to actually launch the program? or do you just want to know where it is? dadinn: spk121: I am just trying to know where it is, or maybe even the fact that it exists, and I could run it with system* spk121: dadinn: then I'd just go with something like in the paste I did above. Fork/exec is for actually running something spk121: IMHO leoprikler: dadinn: if it's a shell built-in, then system* probably won't work, because it's a thin fork/exec wrapper dadinn: Ahh... when you have this feeling that something is fundamentally wrong with the universe! :( dadinn: spk121: I will look into the fold solution, it actually might be what I am looking for leoprikler: I think gash might have command or type, but at that point you're bundling a full shell with your application :) rlb: dadinn: if you just care about finding a file in a path, then there's search-path, but if you want to find the executable that system would run, then yeah, perhaps command -v, which is posix, but you'll have to run it via sh, e.g.: rlb: (use-modules ((ice-9 popen) #:select (open-pipe*))) rlb: (use-modules ((ice-9 rdelim) #:select (read-line))) rlb: (display (read-line (open-pipe* OPEN_READ "sh" "-c" "command -v guile"))) rlb: (newline) rlb: Of course you may also want more error handling, close-pipe, etc. *: rlb thinks we might want to add a posix compatible string escaping function if we don't already have one. dadinn: how do I test for an executable file? stat:perms returns 493 for something which should be 755 AFAIK spk121: dadinn: you have to think of the number as octal. #o755 spk121: octal 755 is 493 spk121: probably the last remaining use of octal numbers, hehe dadinn: spk121: dadinn: spk121: argh! dadinn: is there a way to convert decimal to octal? :P dadinn: spk121: actually if the decimal is odd, then the octal will be odd too :/ spk121: dadinn: true. the executable bit is (logtest 493 #b01000000) spk121: wait, i need two more zeros #b100000000 dadinn: spk121: actually I think I would rather need to use (access? "/usr/bin/lsblk" X_OK) spk121: probably more sensible spk121: anyway, g'night everybody dadinn: spk121: wait, it's almost morning! :D spk121: 22:30 out my way spk121: zzz spk121: shit, 23:30. I've gotta get up in 7 hour wingo: civodul: regarding https://lists.gnutls.org/pipermail/gnutls-help/2020-December/004676.html -- i think the long-term solution is to rewrite guile's bignum support to use the lower-level API wingo: i.e. the nails api wingo: then we would be responsible for allocation wingo: would take a bit of time tho wingo: me and terpri worked on somethign similar in firefox a while back civodul: hi wingo! civodul: yes, that and using mini-gmp civodul: would be nice to have a workaround in the meantime, but i've run out of ideas wingo: mini-gmp supports the nails api afair so there is no risk there civodul: yes wingo: probably we should switch off the install-allocators thing civodul: we can't do it in an extension though wingo: yeah but in guile wingo: i know it's suboptimal but at least it doesn't bugger your gmp civodul: i'm afraid it could have a terrible performance impact for things like the compiler civodul: we could test wingo: yeah lemme do that here wingo: i'll do a make -j4 with no prebuilt go files *: davexunit sends mail to guile-user davexunit: can't tell if I found a goops bug or the problem is me RhodiumToad: btw I was looking at your metaclass question from yesterday RhodiumToad: one issue seems to be that the docs are flat wrong about some of the functions davexunit: I have noticed some issues there davexunit: I hope what I've found is just a bug in redefinable classes and not a shortcoming of GOOPS itself RhodiumToad: guile2 or guile3? davexunit: 3 davexunit: redefinable classes were introduced in 3, iirc davexunit: used to be that all classes were redefinable davexunit: but for performance reasons no longer has that functionality davexunit: which makes sense, because it's an additional layer of indirection. davexunit: I have a developer mode flag in my project. when it's set I use as the metaclass, otherwise I use . RhodiumToad: I must say that looking at problems like this makes me miss ephemerons RhodiumToad: weak hashes just don't cut the mustard mdevos: Am I missing something, or does guile not have an equivalent to openat(2)? davexunit: my problems yesterday were compounded by this redefinable class issue. once I used instead I was able to get a working implementation of what I was after. davexunit: RhodiumToad: I'm not familiar with ephemerons. I use weak hashes often, though. RhodiumToad: mdevos: afaik it doesn't have any of the *at() functions in the posix module RhodiumToad: davexunit: the distinction between a weak hash and an ephemeron is that in an ephemeron, the key is only considered reachable if it can be reached without going through its own value. mdevos: RhodiumToad: I should use the FFI mechanism then, I presume? RhodiumToad: mdevos: if you want to use those functions, that would probably be the simplest way, yes RhodiumToad: davexunit: obviously the snag is that this requires a bit more assistance from the GC than a simple key-weak hash davexunit: interesting RhodiumToad: using them lets you associate arbitrary properties with objects without having to worry about creating reference loops chrislck: Hello, Fridayyyyy davexunit: RhodiumToad: that sounds nice. RhodiumToad: I've used them quite a bit in lua (>= 5.2), and find it frustrating when other languages have key-weak hashes but not ephemerons :-) davexunit: oh lua has them? that's cool. didn't expect such a minimalist language to have something like that. leoprikler: doesn't guile have completely weak hashes though? RhodiumToad: yes, but those aren't the same thing RhodiumToad: an ephemeron differs from a both-weak hash in that the value references are strong as long as the key is reachable RhodiumToad: and it differs from a key-weak hash in that the key is not considered referenced if all of its references come through its own value mwette: wingo: Is converting lightning to lightening simple or not simple (e.g., for riscv)? I'm toying with the idea of buying a riscv box. wingo: mmm, i would not say it is simple. or at least it takes a bit of time. lightning tends to be really macro-heavy and i really tried to get away for that in lightening, which results in quite some refactors *: wingo looks wingo: i can't find a link but you can do "git log" on the other architectures to see what kinds of things need to be done wingo: would be nice to have a riscv backend mwette: got it wingo: civodul: i got a thing for you wingo: https://git.savannah.gnu.org/gitweb/?p=guile.git;a=commit;h=9e6ac923bfdcc89b1b97851f9be53371bf4b5b86 wingo: wdyt? wingo: will need the dlopen shim from cygwin wingo: the docs diff is hard to read because of some reorganizations wingo: https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=module/system/foreign-library.scm;h=6945fca538dcffd32c18b3c31e5a9fbcefea3da4;hb=9e6ac923bfdcc89b1b97851f9be53371bf4b5b86 is pretty fun wingo: another question -- libffi. not strictly necessary for platforms with lightening support. could be implemented directly by JIT code generation wingo: i wonder if that is worthwhile. rlb: Would it be plausible to add a superclass argument to make-foreign-object-type? I ended up just adding it in a copy for now (presumably not sustainable): https://github.com/lokke-org/lokke/blob/main/mod/lokke/scm/foreign-object.scm#L18-L23 *: davexunit sent bad example code to guile-user davexunit: just sent a fix. and a patch. davexunit: my confidence grows that this is a goops bug wingo: rlb: sure why not. feel free to commit to guile rlb: wingo: oh, ok - thanks. wingo: davexunit: yeah that looks about right wingo: at a quick glance anyway dsmith-work: Happy Friday, Guilers!! davexunit: wingo: from a design pov: slots are intended to be extendable with new options, right? wingo: davexunit: yep davexunit: thanks civodul: wingo: neat! so there's removing ltdl, and there's also providing new facilities like 'foreign-library-function', right? civodul: i think the two can be considered independently of one another civodul: code meant to work with 2.x/3.0 and 3.2 will keep using dynamic-link/dynamic-func i guess civodul: but anyway, it looks like a good move to me! davexunit: what would be the path towards getting a patch merged? submit it to guile-devel? I did copyright assignment paper work years ago. *: rlb tries the current excise-ltdl rlb: Is readline expected to work now? davexunit: getting rid of ltdl? exciting :) rlb: ...I suspect there's history I don't know about, but regarding the recent autotools concerns (the broader discussion), and given that I've observed that languages like python and guile have to figure a lot of that stuff out for themselves anyway, I've wondered if one "nicer" arrangement might be just having a guile (or "guile-core") based tool that could handle configuration in most cases. (Naive, I'm sure...) civodul: davexunit: prolly; i guess rlb is one of the persons paying the most attention to guile-devel :-) RhodiumToad: kill it with fire *: rlb has likely been more useful lately, but still somewhat intermittent. davexunit: civodul: I don't know who would be the "owner" of goops that would know if my patch is good or bad. I don't want to send it to a black hole. civodul: davexunit: as for most things, it's probably wingo rlb: (I think guile-devel is the right place, but I'm (personally) definitely not a goops internals expert yet.) rlb: wingo: can verify that excise-ltdl gets further here now (i.e. readline works, and all the tests pass). davexunit: okay I'll send the patch over to guile-devel rlb: davexunit: and/or file a bug if it seems that's appropriate now? davexunit: yeah I'll do that davexunit: thanks Sheilong: Is there a builtin argmax procedure? I have a list with some numbers such that I need to get the index of the biggest one rlb: (apply max numbers), or do you need more than that? RhodiumToad: hm, you want the position of the biggest one, not the biggest value? rlb: oh, oops, didn't read that right. tohoyn: wingo: are you going to merge the patch fixing #45131 and the patch improving statprof to upstream? Sheilong: that's right, I need the position, the index in which the biggest happen in the list RhodiumToad: finding positions of things in lists does rather suggest that maybe it shouldn't have been a list RhodiumToad: if there are equal largest values, do you care which one you get? rlb: Sheilong: yeah, haven't thought of anything built-in that's quite right offhand, but could of course use a loop, or fold, or reduce, etc. RhodiumToad: doing it with a fold or reduce looks like it would require consing on each step rlb: sure RhodiumToad: in order to keep track of both the current and largest-value index rlb: if perf matters mwette: (let loop ((mxv -1) (mxi -1) (ix -1) (ls my-list)) (if (null? l) mxi (if (> (car l) mxv) (loop (car l) (1+ ix) (1+ ix) (cdr ls)) (loop mxv mxi (1+ ix) (cdr ls))))) mwette: s/l/ls/ rlb: In clojure it might be something like rlb: (second (max-key first (map-indexed #(vec %&) numbers))) rlb: fwiw rlb: with "lots of 'consing'" :) davexunit: bug filed. I guess guile-user just ended up being my rubber duck. sorry for the noise there. rlb: got that backward... rlb: lokke@(lokke user)> (first (apply max-key second (map-indexed #(vec %&) '(5 1 7 2)))) rlb: $5 = 2 rlb: tohoyn: here is a simple implementation for vectors: (let ((res-ind 0)) (do ((i 1 (+ i 1))) ((>= i len)) (if (>= (vector-ref v i) (vector-ref v res-ind)) (set! res-ind i)))) tohoyn: tohoyn: (vector-ref v res-ind) could be cached in order to improve performance RhodiumToad: I'd probably have gone with vector-fold rlb: wingo: testing the current excise-ltdl after a make install to a random dir (~/opt/guile-ltdl) and augmenting PATH PKG_CONFIG_PATH and ACLOCAL_PATH, I see "guile" crash: rlb: In ice-9/boot-9.scm: rlb: 2103:25 0 (in-vicinity #f "guile-readline") rlb: rlb: ice-9/boot-9.scm:2103:25: In procedure in-vicinity: rlb: In procedure string-length: Wrong type argument in position 1 (expecting string): #f rlb: rlb: Have you tested installed trees yet? i.e. should I expect that to work, or might that still be pending? *: rlb double-checks his path settings... rlb: These were the settings: rlb: export PATH="$prefix/bin:$PATH" rlb: export PKG_CONFIG_PATH="$prefix/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" rlb: export ACLOCAL_PATH="$prefix/share/aclocal${ACLOCAL_PATH:+:$ACLOCAL_PATH}" rlb: I *think* that's all you normally need for current guile. wingo: rlb: tx, can fix wingo: thanks for testing :) mwette: wingo: sent (untested) riscv patch to guile-devel Noisytoot: nalaginrut: Why does GNU Artanis's Dockerfile use the non-free repository? wingo: rlb: fixed that excise-ltdl issue rlb: wingo: readline works fine now, though I hit that statprof asyncs error again -- will test it against lokke next (later this weekend). rlb: i.e. I hit https://debbugs.gnu.org/46001 dadinn: hi all dadinn: can someone please help me understand how the chroot procedure works? dadinn: It doesn't have an executable argument to execute once chrooted :/ mdevos: dadinn: chroot changes the root procedure in the *current process*, IIUC mdevos: you could of course combine it with fork and exec dadinn: mdevos: so to "exit" the chroot I would have to change back to the original working directory? dadinn: mdevos: ... I mean, with another chroot call? mdevos: dadinn: I think so, presuming the original working directory was also the original root / mdevos: working directory = $PWD, which is often not /. In my case, $PWD is often $HOME dadinn: mdevos: ah, yes you are right, that's what I meant mdevos: dadinn: idk if stashing away the old root directory in a file descriptor, to be chrooted back into, is supported. mdevos: According to the manual, chroot accepts an argument PATH. That doesn't seem like it allows file descriptors dadinn: mdevos: wait a moment, that would mean that chrooting from / to /mnt/blabla ... then I wouldn't have a way to chroot back to the original / because from /mnt/blala there is no path to refer to the original / mdevos: dadinn: but perhaps it's possible to play tricks with the /proc filesystem? See open(2) dadinn: mdevos: ah, I see what you mean, holding a reference with a file descriptor, I could revert back to the original / dadinn: mdevos: you have mentioned the fork & exec maneuver, i've heard about it couple of times yesterday... how would this look like? Do you happen to have an example maybe? mdevos: dadinn: I don't have an example. If you're looking for examples in the wild, you could look at guix and shepherd's source code dadinn: mdevos: haha actually I am putting together a LinuxOnZFS installer script specifically with Guix support as end goal: https://github.com/dadinn/system-setup dadinn: ;) dadinn: particularily I am replacing the debian-setup shell scripts with a guile implementation, and actually quite happy about it so far... the shell scripts were doing ellaborate shit with chrooting in-and-out... looks much simpler with guile! mdevos: explanation of primitive-fork in terms of call-with-current-continuation: https://paste.debian.net/1183293/ dsmith-work: Yeah, one of the purposes of chroot is to keep a process in it's own little bubble univere. dadinn: hmm, not sure i get that primitive-fork vs call-with-cc example :/ dadinn: dsmith-work: as mentioned before, in my debian-setup shell script inside the bubble universe have to communicate back to the main process, which is done with ugly FINISH scripts... nasty ugly but kinda worked dsmith-work: I think the orignal use (what I ever used it for) was for booting from some initial boot filesystem and then chrooting to the "real" root filsystem. dadinn: dsmith-work: my use-case is that set up a root filesystem using ZFS, bootstrap Debian on it, then chroot into the directory and install the kernel modules and configure grub from inside, then come out, and unmount everything and reboot dadinn: dsmith-work: regrding mdevos's example here: https://paste.debian.net/1183293/ Do you know how this primitive-fork works? dadinn: mdevos: do you happen to have any material on primitive forks? *: rlb vaguely wonders if guile works fine in WSL on the windows side... (Someone just reported that bup "works fine" there.) daviid: fwiw, on win, guile works quite well on msys2 - 2.2.7 (64bits vers), not sure there is a 3.0 yet, didn't check in a while - so, not a 'native' version, but it has threads, which i need daviid: sneek: later tell tohoyn G-Golf depends on module-use!, which 'indirectly' raises exception(s) (see bug#43025 - the first message, the attempt to solve is a 'naive work arround', that would only work for static modules ... G-Golf needs a 'real' module-use! fix (under the f sneek: Got it. daviid: *a real fix 'under the hood', the module-use! code hasn't change, but changes have been made in 3.0, to the module system, that 'breaks' module-use! ... DadeBonetti1: Hi! wingo: probably easier to extend something like "fmt" with that chrislck: Thursday greetings o/ apteryx: I just had the following test failure, building Guile 3.0.5 on Guix: https://paste.debian.net/1183102/ apteryx: It's probably non-deterministic, as I've built 3.0.5 many times in the past. civodul: apteryx: o/ could you see higher in the log which test failed? apteryx: hmm, perhaps something happened on the machine during the build; the build log appears truncated apteryx: or reused? it said 'changed on disk' when I tried to view the log file in Emacs. apteryx: (I've relaunched the build after it first failed) apteryx: sorry! I'll be more careful if it occurs again civodul: heh np! Sheilong: Hello Sheilong: I am trying to import a procedure from a file to another, but I am always getting the error ERROR: In procedure scm-error: no code for module xyz... tohoyn: when statprof reports the total time is the time spent in GC excluded from it? sneek: Welcome back tohoyn, you have 1 message! sneek: tohoyn, daviid says: G-Golf depends on module-use!, which 'indirectly' raises exception(s) (see bug#43025 - the first message, the attempt to solve is a 'naive work arround', that would only work for static modules ... G-Golf needs a 'real' module-use! fix (under the f tohoyn: Sheilong: do you have the module and the file using it in the same subdirectory? Sheilong: tohoyn: I do. tohoyn: Sheilong: do you have a linux system? Sheilong: tohoyn: Yes. tohoyn: Sheilong: try "export GUILE_LOAD_PATH=.:" tohoyn: before you run the guile code Sheilong: First file I did (define-module (xyz...) #:export (abc); Second file I did (add-to-load-path "./") and (use-modules (x y z)) tohoyn: Sheilong could you paste the files to Debian pastezone? Sheilong: tohoyn: https://paste.debian.net/1183110/ and https://paste.debian.net/1183111/ tohoyn: Sheilong: tx tohoyn: Sheilong: guile probably searches files 1-1.scm and 1-2.scm in subdirectory cryptopals. is this correct? tohoyn: Sheilong: I mean, do you want this behaviour? tohoyn: Sheilong: what filenames do you have for these modules? Sheilong: tohoyn: the directory name is Set1 and the filenames are c1 c2 c3... tohoyn: Sheilong: do you execute the code in directory Set1 or in the parent directory of Set1? tohoyn: Sheilong: the module names should be the same as the file names without the .scm extension Sheilong: tohoyn: I execute in the directory Set1 Sheilong: tohoyn: something like (define-module (Set1 c1))? tohoyn: Sheilong: you should ensure that the files have the extension .scm and change the module names so that the module name for file MOD.scm is (MOD) tohoyn: Shielong: maybe without Set1 Sheilong: It looks like it did work with (add-to-load-path "./") and Set1 c1 tohoyn: Sheilong: ok Sheilong: I exported only one procedure but it seems like when I import c1 module it runs all code tohoyn: Sheilong: I think that is the correct behaviour if you have executable statements (not definitions) in your modules tohoyn: Sheilong: are we talking about module 1-1? Sheilong: I defined it as (define-module (c1) #:export (encode-hex)); Shouldn't only encode-hex be imported? tohoyn: Sheilong: yes but... tohoyn: Sheilong: if you have other definitions than encode-hex in module c1 they are not imported tohoyn: Sheilong: but if you have executable statements in the moduled they are executed when the module is imported even though you don't export them tohoyn: s/moduled/module/ tohoyn: Sheilong: what is the code you think should not be run? tohoyn: Sheilong: the assert statements? Sheilong: tohoyn: that's right Sheilong: tohoyn: When I use #select they are not executed Sheilong: tohoyn: Thanks so much for your help tohoyn: Sheilong: I recommend putting the tests in to a procedure / some procedures instead of having them in the toplevel tohoyn: Sheilong: you are welcome manumanumanu: DadeBonetti: You should probably have a look at srfi-166 (not yet implemented in guile what I know of, though... sorry). That is an extensible string formatter manumanumanu: I had a repo somewhere of the precursor of it, but that is dead currently DadeBonetti: @manumanumanu thanks manumanumanu: I don't know if any scheme has it built in yet (except chibi), but it is probably the future standard formatting utility for guile manumanumanu: s/guile/scheme manumanumanu: I did _not_ mean to say anything about guile there. manumanumanu: What it is lacking is that the reference implementation is about 3x slower than (ice-9 format). If one can make (show ...) a macro, one can then make a "compiler" that makes the common cases fast. manumanumanu: much like (ice-9 format) does manumanumanu: I don't think there is anything that has to make srfi-166 slow, except the overhead of the combinators and the environment monad, much of which can be removed. DadeBonetti: I just take a look to srfi166, but id don't seems to have formatters for cardinals and ordinals numbers, like ice-9 has manumanumanu: (famous last words?) how hard can that be to implement? leoprikler: it's a long chain of modulo 10 combined with LUTs leoprikler: s/modulo/div-mod/ manumanumanu: leoprikler: now internationalize it! :D :D leoprikler: there is no i18n with latin numerals leoprikler: but you *could* do the same approach for other counting systems, e.g. japanese manumanumanu: I only know languages where it works as in english, but there must be others. Danish? 75 = "five and half-eighty". I don't know about ordinal numbers leoprikler: hmm, perhaps I can implement something, that just needs ahash table manumanumanu: And that is still indo-european manumanumanu: or heck, germanic. leoprikler: I'm not talking about stuff like einundzwanzig here leoprikler: We use arabic numbers here in Europe. manumanumanu: BBL: reading about internationalizing ordinal numbers :) leoprikler: but for instance in Japan you can write 2021 as 二千二十一 leoprikler: and in Roman it would be MMDDI if I'm not mistaken RhodiumToad: MMXXI leoprikler: thanks davexunit: any GOOPS MOP wizards here? trying to make a metaclass that automagically does special things in a slot's getter and setter. I've tried a few different things that haven't worked. justin_smith: in danish they count by twenties rather than ten, with some features reminiscent of roman numerals (eg. using "-5" to indicate 15) leoprikler: heh, that's how we count hours in German. "Halb neun" = 8:30 RhodiumToad: davexunit: what did you try? davexunit: the most promising thing was adding a special #:allocation type and handling it in compute-get-n-set, but for instance allocation you have to return a struct field index and can't use a getter and setter. RhodiumToad: davexunit: and do you have an example of the kind of magic you want to do? manumanumanu: leoprikler: the more I think about this the more I get vertigo :) I remember that there are so many slight differences between swedish and german. Regarding the clock, many things are similar (viertel nach/vor), but I got bitten once or twice just after I moved there due to slight inconsistencies. davexunit: RhodiumToad: I need to put together a contrived example that doesn't use all the special library code I have. the gist of the problem is: I want the slot to store a box, and have the slot getter and setter transparently handling boxing/unboxing. davexunit: it sounds silly when explained that way, but in the context of the real project it makes sense to introduce this indirection. davexunit: (define-class () (bar #:allocation #:boxed #:accessor bar) #:metaclass ) leoprikler: davexunit: can you not define your accessor as a method with setter? leoprikler: Doing so from a metaclass might still be hard tho. davexunit: leoprikler: the trick is in doing this automatically without every slot that is like this having to repeat tons of boilerplate. leoprikler: ah, I see leoprikler: how about a macro? davexunit: maybe, but I want to exhaust my other options first. leoprikler: [you can tell I'm not very used to GOOPS and want to avoid it as much as possible] davexunit: leoprikler: since you are a fellow game dev, this might make sense: I have a data type called for storing data loaded from the file system (textures, audio, etc.). the asset system places watches on asset files via inotify and automatically reloads them when the file is modified. so, is a box with some inotify goodies tacked on. RhodiumToad: and you want normal accessors to transparently unbox it RhodiumToad: ? davexunit: yes, that is one desired feature. there's another thing I want in the setter but we don't need to get into it. davexunit: now, I *can* get this to work but I'm not happy with the implementation. leoprikler: ahh, so everywhere you use an asset as a field type, you want to directly unbox it davexunit: yes. davexunit: the other feature is that the asset has a hook that runs when the asset is reloaded. this can be used to say, recompute a bounding box when a sprite's texture is reloaded (the image size may be different) leoprikler: Chickadee is adding some crazy features I see. davexunit: so far I've been unable to store the data in the instance itself. I've had to create a weak key hash table keyed off the instance. davexunit: leoprikler: this is actually for a library on top of chickadee. I stay away from goops entirely in chickadee. leoprikler: Okay, makes sense. davexunit: since it's kind of divisive. some use it, some don't. leoprikler: FWIW you could implement your own slot-ref leoprikler: wait, how do accessors work again in guix? there's no direct slot-ref, is there? leoprikler: s/guix/goops/ davexunit: there is slot-ref leoprikler: okay, but people are not expected to call it, are they? davexunit: but to go that route would require a lookup table in the class that has all the slot names leoprikler: No, it wouldn't davexunit: I don't think a slot getter/setter/accessor uses it leoprikler: you first do a slot-ref and then typecheck the result – if it's an unbox it, otherwise return as is davexunit: assuming the getter/setter/accessor methods used slot-ref/slot-set! under the hood (not sure they do), there's the big downside of adding overhead to every slot access. leoprikler: I think if you generically implement all your accessors in terms of this supposed slot-ref*, you'll have an easier implementation. Question now is how to insert custom accessors into fields leoprikler: That is true, but it's the overhead you already have for access anyway, is it not? davexunit: the goops implementation is a little tricky to decipher, since it has to go through this whole bootstrapping sequence. davexunit: leoprikler: but that overhead would now apply to all slots that inherit from the base class, the vast majority of which are not asset slots. davexunit: I'd rather keep using a weak key hash table, but there's overhead in that, too, so I'd really much prefer just storing the data I need in the instance itself. leoprikler: okay, so you need to distinguish between asset and non-asset slots by some heuristic and on top of them install accessors transparently leoprikler: But I still think my proposal has some value: First try to find out how to override all accessors. Once you got that figured out, filtering based on a predicate should be comparatively simple. davexunit: leoprikler: it should be possible without a heuristic. you can use slot options to mark the slots with a special keyword that the metaclass can discover and do the right thing with. that part turned out to be pretty easy. it's storing the data in the desired location that is hard. I'm a MOP noob so I'm sure I just haven't leveled up enough to see the solution. leoprikler: The documentation seems to have add-method!, but not much on fields. davexunit: the docs are good for an overview but the goops source is the best resource once you know the basics leoprikler: Okay, so it seems if you want to define the setter of an accessor, you want to do (define-method (setter accessor) something) leoprikler: I suggest following the path that this setter syntax takes inside GOOPS. leoprikler: perhaps it invokes a primitive, that you can use from your metaclass leoprikler: cross your fingers, that it's also exported davexunit: I've done custom setters that way. (define-method ((setter my-accessor) (object ) ...) ...) davexunit: that's good for one-off specialization. davexunit: thanks for the brainstorm. I'll just keep digging into the source and fiddling after work. leoprikler: Hope you get that to work. On another note, what is the rationale behind allowing the asset to change at runtime in your case? Sheilong: Is there a way to populate a bytevector with values fom a list at creation? RhodiumToad: uint-list->bytevector RhodiumToad: or sint-list->bytevector leoprikler: there are conversions from lists, as RhodiumToad posted, but if you need to splice them you'll have to trick the reader RhodiumToad: or u8-list->bytevector davexunit: leoprikler: it's a "development mode" feature so I can, say, edit a tileset in an image editor and have the game instantly update when I save changes. davexunit: it's been really useful to have that (when I actually try making a game, that is) davexunit: and besides the hot swapping, I like having syntax like (define-asset tileset (load-tileset "foo.png")) for defining all the external assets. leoprikler: Interesting. I just abuse Tsukundere's save states :) davexunit: whatever works :) leoprikler: but yeah, novels are of course very different from RPGs davexunit: the 3 big productivity features I have, though in rather primitive form, are 1) live asset reloading 2) emacs-like minibuffer and 3) in-game repl leoprikler: sounds rad davexunit: I also want to take advantage of goops features to add an inspector/editor where you can click on game objects and see all their fields and maybe even edit them davexunit: for those times where it's a lot easier to edit visually than fiddle with numbers in code. davexunit: using a metaclass I'll be able to add special slot options that mark a slot as inspectable/editable. goops is very cool. 8) leoprikler: I must admit it is, and yet I'll probably prefer handcrafted records for the rest of my life. leoprikler: Don't ask me why. davexunit: I like those, too :) *: leoprikler → afk for about an hour *: davexunit wishes goops had before/after/around methods like clos rlb: bubbler: hmm I don't know offhand - haven't used the debugger in a good while. bubbler: rlb: ok thx... so it might still be real a bug and not just my installation (or me ;) ) rlb: Not sure, but if you have a straightforward way to reproduce it, I'd be happy to test against my local 2.2 later. bubbler: rlb: Ok... guess it's is really me. Just added "(display "Hallo")" in between my expressions. It looks like before but it threw "Hello" on the output in between. bubbler: rlb: I just expected more visible information while debugging. As i said i am really new to Scheme. Thx a lot for your help. :) bubbler: rlb: Have a good day and I'll start my good night... justin_smith: bubbler: oh yeah, the debugger doesn't throw as much info in front of you as most, but there are commands to look at locals / source etc. - and hey you can script it with the same extension language gdb uses justin_smith: :D tohoyn: wingo: I think that the patch fixing bug #45131 should be applied to the upstream guile in git tohoyn: daviid: do you have any plans for upgrading g-golf to guile 3.0? dsmith-work: UGT Greetings, Guilers bubbler_: justin_smith: jepp... Getting excited :) zimoun: hi! morganw: Hi, apologies if this is a common question but is there a list anywhere of supported platforms that can run Guile 3? joshuaBPMan: morganw   I don't know about an exhaustive list:   but GNU/Linux, Windows, Mac, I think the BSDs, and the GNU/Hurd can run guile. joshuaBPMan: Thought guile is currently have some portability issues with compiling on Windows from what I've heard. morganw: I had read that about Windows. But also it seems that most (all?) of the BSD package systems aren't including Guile 3. morganw: Admittedly I haven't tried to build it to find out why that might be... RhodiumToad: I have a draft port for guile3 for freebsd RhodiumToad: I haven't submitted it yet beyond a review draft because of the problem that guile.m4 conflicts with the guile 2.2 version RhodiumToad: some minor patches are required for freebsd morganw: Are there enough tests to verify it as 'working'? RhodiumToad: the tests passed last I tried morganw: OK. Thanks! RhodiumToad: earlier 3.0.x for x<=4 was broken on freebsd on arm platforms RhodiumToad: the fixes needed are mostly minor: buildstamp is generated by a `date` command that's not valid on freebsd (uses linux-specific parameters), RhodiumToad: one of the makefiles uses sed -i in a way that freebsd doesn't support (another linux-ism), RhodiumToad: and gen-scmconfig doesn't understand that off_t might be 64 bits on a 32-bit platform without largefile flags (which is true of freebsd on 32-bit arch, since off_t is always 64 bits and there is never any concept of a "large file") RhodiumToad: https://reviews.freebsd.org/D24325 <-- that's what I have so far morganw: thanks (and thanks for updating it) apteryx: ah, true! Thank you. tohoyn: wingo: I made an initial version with corrected cumulative time support. Would you like to try it? tohoyn: wingo: initial version of guile statprof wingo: tohoyn: neat :) i would send it to guile-devel to see what people think tohoyn: wingo: please give me your email address wingo: can you send it to guile-devel@gnu.org ? wingo: it is a mailing list wingo: would be nice if we had some sort of patch review thing like phabricator or gitlab or so :P tohoyn: wingo: may I add my own copyright to the new statprof.scm file? tohoyn: wingo: whatever is your policy wingo: patches that go into guile itself need to be assigned to the FSF tohoyn: ok tohoyn: wingo: I just sent the patch to guile-devel@gnu.org wingo: great tx tohoyn: wingo: some time ago I reported a bug in guild (--from=tree-il does not work). I just made a pull in guile git directory and it seems that this bug has not yet been fixed (the bug remains in ./uninstalled-env bash environment). Is somebody going to do something with this? tohoyn: wingo: this is bug #45131. it seems that there is a patch for it. tohoyn: wingo: I think that the patch should be applied in guile git tohoyn: wingo: do you have any idea what causes this: Pre-boot error; key: misc-error, args: ("primitive-load-path" "Unable to find file ~S in load path" ("ice-9/boot-9") #f) tohoyn: wingo: its from the latest git version of guile tohoyn: wingo: the error is probably caused by setting GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH in uninstalled environment dsmith-work: Tuesday Greetings, Guilers ruffni: so, i hacked a bit and wrote a somewhat generalized serializer for GOOPS objects in about 25 LOC. is there interest for such a thing? it's not complete at all, but for my pet-project it seems to be enough. bubbler_: hi there. I am new to guile and I don't know if this is a known bug (could not find a bug report for this problem): I seems that i cannot debug any guile programm by using ',break PROCEDURE' then calling that PROCEDURE '(PROCEDURE)' and then a couple of ',next' commands. bubbler_: All i get are a couple of 'Step into #' output with a changing hex value for each ',next' command and finally a 'While executing meta-command: In procedure vector-ref: Value out of range: 0' bubbler_: I am using Guile 2.2.7. Is there something known like that? bubbler_: I am on Gentoo Linux x86_64 bubbler_: please answer to my alternative username 'bubbler' because i have to leave this machine... sgssgene: Hey, I'm trying to contribute to libfive-studio which uses guile. It takes a user input (script) and runs it in an sandbox. sgssgene: ``` sgssgene:     auto result = scm_call_1(scm_eval_sandboxed, sgssgene:             scm_from_locale_string(script.toLocal8Bit().data())); sgssgene: ``` sgssgene: Now it can (obviously) happen that `script` is malformed, not a valid scheme program. This causes basically causes that a function `sandbox-backtrace stack` is being called where `(define stack (make-stack #t))`. sgssgene: What I would like to do is to get the line number of the individual parts of the stack that involve my error. I have already sliced out the frames of the stack concerning my script. But it is unclear to me sgssgene: how I can retrieve the line number from the stack (retrieving filename seems easy with `frame-source`, but I can't figure out how to get the fileline. Can someone give me anyhints? tohoyn: are there any plans to fix statprof so that "cumulative seconds" works correctly for recursive functions, too? wingo: tohoyn: what would that mean? :) wingo: kcachegrind for example has the same behavior as guile tohoyn: wingo: if we have a procedure PROC the cumulative time is the total time spent in PROC and all the procedures it calls tohoyn: wingo: perhaps we could have both tohoyn: wingo: I mean both kinds of cumulative times wingo: it is certainly possible to do; the analysis happens after the profile wingo: all the data is there tohoyn: wingo: can you give some hints how that could be done? wingo: i would suggest opening module/statprof.scm and reading from top to bottom. statprof enables a signal that is fired by the OS after a bit of time has elapsed. when it fires, statprof takes a sample of the entire stack. tohoyn: ok tohoyn: tx wingo: when statprof stops, it analyzes those samples to map the stack frames to function names and locations tohoyn: wingo: so basically we should check if different stack frames belong to the same procedure? chrislck: It's Mondayyyyy {groan} RhodiumToad: you don't like mondays? dsmith-work: Morning Greetings, Guilers apteryx: does someone know how to specify an exact error condition with (srfi srfi-64) and Guile? apteryx: I want to catch such codition: &store-protocol-error message: "build of `/gnu/store/n9a8lqx0gaxkd5hrfmrcw5pjdsaccvlw-python-dummy-fail-console-script-0.drv' failed" status: 100 apteryx: hm, perhaps not possible yet. A comment in testing.scm: ;; TODO: decide how to specify expected error types for Guile. lfam: I still have a gcroot of "/root/.config/guix/latest" lfam: Time flies! lfam: Sorry, wrong channel! civodul: lfam: good'ol times ;-) civodul: (not that good tho because "guix pull" was terrible back then) lfam: It's much better now :) lfam: I guess it's probably wasting some space on my computer! rekado: apteryx: it’s possible, just not with test-error rekado: apteryx: you can test-equal instead, catch the error yourself and compare it justin_smith: Sven_vB: that should be (req #:key foo bar) Sven_vB: thanks for the confirmation. someone should fix it then. leoprikler: I don't think that FAQ will be updated soon ;) Sven_vB: in https://www.gnu.org/software/guile/libraries/ chapter "hashing", there's an odd "<*ENTITY*>hellip" rekado: Sven_vB: this comes from the texinfo conversion rekado: I fixed the same bug in the converter for the Guix website rekado: here’s the commit: https://git.savannah.gnu.org/cgit/guix/guix-artwork.git/commit/website?id=ef4c897b919fcfba5db4225d175b8de7e55b4e70 rekado: I don’t know how the Guile website is generated, but AFAIK the libraries section is generated from Guix packages. spk121: janneke_: I got a basic mingw guile 3.0 checked in a branch of the upstream Guile repo.I'm going to try to pull in some of your mingw guile 2.2 patches alextee[m]: anyone know if there are windows binaries for guile somewhere? alextee[m]: one of those click click install things spk121: alextee[m]: probably doesn't exist alextee[m]: well i can't build my software with msvc then, it needs guile to generate some stuff alextee[m]: maybe I should switch to another scheme for that spk121: you can still get a pre-build guile 2.0 from eli over at https://sourceforge.net/projects/ezwinports/files/ spk121: a fork of guile 2.2 is known to build on windows, but, I don't know of a package of it alextee[m]: what are the main differences between guile 2.2 and 2.0? alextee[m]: it looks like i set a strict requirement to >= 2.2, don't remember why alextee[m]: let me try with that prebuilt 2.0 spk121: better VM, better Unicode mostly alextee[m]: it should be fine then i think, I only need it to run a couple of scripts to generate some files spk121: It appears that I'm the one who is furthest along in a windows build for Guile 3.0. I really should get that finished but, it is not fun. alextee[m]: yeah anything windows related is very frustrating alextee[m]: but a lot of users there alextee[m]: how can I fix this? Throw without catch before boot: alextee[m]: Throw to key misc-error with args ("primitive-load-path" "Unable to find file ~S in load path" ("ice-9/boot-9") #f)Aborting. alextee[m]: I copied the bin/ stuff in my path but I'm not sure where to copy the lib/ stuff to maek guile find it alextee[m]: i guess i can pass GUILE_LOAD_PATH alextee[m]: didn't work, I guess I'll stop here lol terpri: spk121, is there an eli5-level explanation for what makes it so un-fun? i would've guessed mingw and similar would be useful, but guile seems like the sort of program that would hit the margins of what it can handle gracefully... terpri: (i was able to do guile-emacs testing probably back in the 2.x days, using mingw iirc, but that was a while ago. i generally don't use windows at all except for $work) spk121: terpri: there are a couple things. The MinGW version of gcc doesn't handle Ctrl-C for break. spk121: sorry I meant gdb terpri: oof spk121: Also, configure is just much slower on Windows because it is running on MSYS which is itself running on a emulation layer. I get so bored of watching configure run, haha spk121: And also, at least back when Mark W was active maintainer, he'd insist that OS-dependent code should be fixed in Gnulib, not in Guile, so that is a lot of stop energy right there. leoprikler: tbf guile development would probably be easier if all portability woes are taken care of through gnulib joshuaBPMan: leoprikler  May I ask how much work is involved in doing that?  Also would that mean adding more C code to guile's code base? leoprikler: well, it would mean moving some stuff from guile's C and Scheme code to gnulib, but I don't really know how much joshuaBPMan: gotcha. leoprikler: For instance, file-is-directory? is implemented purely in scheme and does a weird hack when posix is not defined leoprikler: (basically, the non-existence of stat itself is why we can't have a C++-like filesystem library) joshuaBPMan: Would it be fairly easy to replace the scheme code for file-is-directory with the gnulib version?  I'd be happy to submit a patch. joshuaBPMan: also what's a C++-like filesystem library?  A library that has objects? leoprikler: Not quite, I just mean procedures that more or less cover the range of std::filesystem joshuaBPMan: hmmm... spk121: leoprikler: the difficulty with a gnulib-only approach is that gnulib doesn't implement windows versions of posix calls that don't map 100%. So instead of having approximate versions of 'ttyname' or 'getuid' or a dozen other things, gnulib doesn't bother. So Guile on Win32 just doesn't define a bunch of posix calls. And thus the test suite is full of '(if (defined? '...)' special cases leoprikler: well, perhaps having an approximate getuid is asking a bit much, but an approximate file-is-directory? should be possible leoprikler: (implemented through stat on linux and through something else on windoof) ruffni: is there an easy way to save a program state (eg some variables) as the scheme code to produce those objects in a file? is `quote' laying in the right direction? ruffni: hmm. i doubt this was understandable. i'm exploring chickadee and would like to (optionally) read game state from a file at startup and save the modifications i make when the program exits. internally i'm handling data with GOOPS objects. should i write methods to handle the transformation from goops-object to string manually (format) or is there an "easier" way? rlb: ruffni: many options, and imagine it depends on your needs, i.e. could define your own serialize/deserialize methods, or you could consider just specializing write, or... ruffni: ok, but manual labor is required :) rlb: Not sure how many people would want it, but if I get time, I'd like to propose a module providing some kind of edn support. (That could allow type-specific reading via tagged literals.) rlb: but still requires "manual labor" to define the tag handlers. ruffni: EDN? rlb: There might be one, but I don't know of any automatic goops serializer/deserializer helpers. Though I suppose you could probably create a limited one automatically via reflection... ruffni: :) but what does "EDN" stand for/mean? rlb: i.e. one that prints an object-specific tag, walks any objects slots, serializes them, etc. rlb: But you'd have to define the protocol, etc. ruffni: with protocol you mean binary or characters? rlb: https://github.com/edn-format/edn ruffni: yeah, i was thinking exactly in this direction rlb: basically just slightly fancier sexps rlb: (and a bit more succinct) rlb: I mean it could be binary, but I just meant that if you're going to produce something that can be read by the normal scheme reader, you'd have to come up with conventions for the serialization. rlb: (object 'something #:slots ((foo 5) (bar 6))) etc. rlb: for a really naive approach, etc. ruffni: what conventions do you mean? naming? or more like white-spacing? rlb: (edn is just a subset of clojure syntax) rlb: No, I just mean the s-expression structure and semantics of your serialization. *: rlb would stick to s-expressions or json or... i.e. not interested in writing a new syntax. rlb: lexer, etc. ruffni: i'm not sure if i'd change *anything* about the syntax. just the same as i'd do within the code ruffni: maybe save it as a hash with names for the different loadable parts of the program rlb: Put another way, if you have an object with two slots, what does the serialized representation look like, i.e. what's the s-expression representing that object? rlb: (see #:slots above for a vague example) rlb: that's all I meant ruffni: (make my-obj #:slot1 13 #:slot2 12) ruffni: so that my program will simply create equivalent objects from the definitions saved to the file rlb: Ok, could be fine -- and if there are any security concerns, you might still want to write a function to handle parsing/unseralizing instead of relying on eval. rlb: if you're needs are simple enough, might be able to use (ice-9 match) to handle it. Of course if you have no security concerns, then maybe eval is fine. rlb: s/you're/your/ rlb: (i.e. eval (and load) are completely unsafe, fsvo "unsafe") ruffni: by unsafe you mean anything could be executed by guile? well... i guess that's ok. it's not about parsing unknown input but about creating a scriptable utility ruffni: and being in the creative domain it should have to hold up too high security standards rlb: Right, just mentioning it in case we're talking about a config file or something that shouldn't be able to erase your home directory :) ruffni: yeah no :) but thanks for the hint! leoprikler: ruffni: kinda different from what you're trying, but in Tsukundere I simply use pretty-print :) ruffni: but just for preferences and history? leoprikler: well, yeah, but that's my entire game state ruffni: so you reinterpret all of the history? ruffni: that's cool! leoprikler: not quite leoprikler: on devel, we can actually skip parts of it leoprikler: because devel has a script stack mechanism ruffni: so you're figuring out which parts are necessary for the ultimate game state to load? leoprikler: more or less leoprikler: by default, we first init the history and then skip towards the script position leoprikler: (skipping meaning we call the resume thunk without an UI) leoprikler: however, this position is nested leoprikler: e.g. you can have stuff like (0) => (0 0) => (0 1) => (1) => (2) leoprikler: if you load (1), then it will evaluate (0) and (0 0), but not (0 1) and then (1) leoprikler: Moreover, Tsukundere allows games to set their own state. leoprikler: e.g. if you need to save variables outside the history, you can synchronize them as #:ruffnis-variable value, assuming you can (read (write value)) leoprikler: In one of my games I use that to detect whether someone has loaded the game already. leoprikler: you can also count how many times someone has saved the game with such a mechanism ruffni: huh! this project sounds fun! i'll check that out sometime soon rlb: wingo: correct to assume the excise-ltdl branch shouldn't pass all tests yet? rlb: wingo: also perhaps expected, but my ~/.guile readline setup crashes rlb: file: No such file or directory" rlb: rlb: oops rlb: In procedure dlopen: file "guile-readline.so", message "guile-readline.so: cannot open shared object rlb: file: No such file or directory fnstudio: hi! i need to serialise some data in and out of a guile script; i'm aware there's a guile-json module that i could use but i was wandering if there's any more scheme-y way of doing this, eg with s-expressions? rlb: Sure, maybe? If you can just read and write? rlb: i.e. that'll produce/consume s-expressions. rlb: consume/produce, rather :) fnstudio: cool, i'll give that a try, thanks rlb mwette: I think you need to reduce to literals. e.g., records won't work I think rlb: Yeah, though if your domain is restricted enough, suppose you might set-record-type-printer!, and then traverse the input on read to rebuild them... leoprikler: real pro hack: extend the read syntax to read your records :) rlb: ...read-hash-extend leoprikler: but assuming you get everything down to lists, it's just read and write/pretty-print rlb: Any idea if our pretty-printer is decent wrt performance? The clojure one *expensive* (or was). rlb: (last time I noticed) leoprikler: I wouldn't call it a million times per second, but if you just need to write to a file now and then it should be fine. leoprikler: pretty-printing is an expensive operation by definition fnstudio: leoprikler: yes, i'm not worried about performances in this particular case but i'd still like to do it in a good way; in other words, i'm looking for what in python would be a dump to json leoprikler: I think write is closer if python json dumps don't do formatting. fnstudio: leoprikler: excellent, thanks leoprikler: I'm just suggesting pretty-print in case you want people to be able to meaningfully edit your dumps. fnstudio: i see, makes sense, yes it'd be a good nice-to-have Sven_vB: hi :) Sven_vB: in https://www.gnu.org/software/guile/docs/faq/guile-faq.html Q5 code example there's (req #&key foo bar), should that "amp;" be there? joshuaBPMan: hey guile people. I've got a lot of records for my sway service...What's the sly way to iterate over all of the fields of a record? joshuaBPMan: I'd rather not have to hardcode how to access every record. It would be coolier if I could somehow turn every record into a list. joshuaBPMan: I'd hate to have to make 5 functions like so: joshuaBPMan: (emit-sway-bindsyms) joshuaBPMan: (emit-sway-basic-bindsyms) joshuaBPMan: (emit-sway-workspace-bindsyms) joshuaBPMan: (emit-sway-layout-bindsyms) joshuaBPMan: It would be nice to just have 1 function for all of that. rekado: record-type-field-names might be helpful joshuaBPMan: rekado: thanks manumanumanu: rekado_: I submitted this: https://github.com/OrangeShark/guile-commonmark/issues/21 manumanumanu: anything that works with more than one block fails for me (or at least, I believe that is the issue) manumanumanu: I offload everything to pandoc right now, though. manumanumanu: rekado_: I am not using guix on this machine though. dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work! civodul: happy Friday! mwette: sneek later tell nly, with fix to nyacc ffi-helper I was able to generate a guile wrap for libfuse. If you want to try I would need to send it to you as oto big (at 200 kB) to paste. I'm guessing it would need some front-end work to make useful. sneek: Okay. wingo: ok i have a rewrite of dynamic linking that seems to work, except for one case -- loading .so files from build trees wingo: e.g. guile-readline.so, which is in guile-readline/.libs/ and not guile-readline/ wingo: still working on how to deal with that. have i mentioned that i hate libtool wingo: probably it would be sufficient on most systems to add .libs/ to each entry in LTDL_LIBRARY_PATH wingo: since that var is essentially only used in an uninstalled context spk121: wingo: Sounds like a sensible idea w.r.t. paths. My frustration with libtool is great, and has been leading me to dump automake in some projects for autoconf-only builds wingo: sadly the path of least resistance may be making a special loader for .la files wingo: as i think we have what we want with the "dlname" and "installed" fields wingo: spk121: is in the excise-ltdl branch in git, fwiw wingo: at least that code can be in scheme tho rlb: wingo: will LTDL_LIBRARY_PATH augmentations still work for both build and install trees, or is there some other approach? *: rlb will also try to get some time this weekend to tests against that branch... dsmith-work: wingo: How do you make auto* tools *not* use ltdl ? *: dsmith-work looks at the excise-ltdl branch spk121: dsmith-work: wingo's talking about excising the libltdl dependency from guile itself and instead just trying to use dlopen() directly when loading guile extension libraries, since most OS's have a dlopen() these days spk121: but with regards to autotool builds, libtool is the only way to make *.so shared libraries if you are using automake spk121: (only supported way, anyway) dsmith-work: Ok, that's what I thought. (re libtool) spk121: Lately, I've been exploring using only autoconf + make and skipping automake just to avoid libtool. Probably a waste of time, but, the '.libs' directory stuff and the many configure tests that libtool does annoy me spk121: GNU ncurses, for example, skips automake and does only autoconf dsmith-work: I had some issues cross compiling something. I think it was guile, but now I'm not sure. I just rm'ed all the .la files and it made things all better. dsmith-work: Pretty sure I was updating to guile 3.x in buildroot. dsmith-work: wingo: Please if you can, somehow provide different errors for the .so not being found, and the init function returning an error. wingo: hehe adding on .libs works wingo: neat wingo: dsmith-work: yes that is one of the reasons. pretty sure i got that right dsmith-work: wingo: Sweet! Thank you! *: sneek cheers soda__hobart: is there an easy way to import a C enum into a guile program's symbol table or whatever it's called? wingo: soda__hobart: no that turns out to be hard -- either you parse the C or you parse the DWARF. i think luajit has the nicest interface in this regard soda__hobart: hmmm... what to do? i guess i will just cut-and-paste the variables for right now. davexunit: I just copy/paste fwiw justin_smith: there's likely some $EDITOR magic to make that easier davexunit: usually I make a one-off emacs macro for doing the text transformation davexunit: for enums with lots of entries soda__hobart: yeah, there's a few dozen when it's all said and done justin_smith: editor macros are like the 80/20 version of having a parser, except it's more like 95/5 wingo: soda__hobart: honestly that is what i would do soda__hobart: maybe i can try using sed or awk or something rekado: I’m using Emacs macros a lot, but I often wish I could figure out how to replace “M-x zap RET” in the macro with the thing that was selected (zap-to-char, for example). davexunit: often the approach is: wrap line in parens, downcase the name, replace underscores with dashes davexunit: my approach, that is. I use C-x ( to record the actions needed for one line then F4 to replay it for the rest of the lines. soda__hobart: yup, maybe be real fancy and make it of of those special variables with the asterickses davexunit: often enough there are things I have to do manually but a macro handles the bulk of the work. davexunit: and once it's done you never have to deal with it again leoprikler: soda__hobart: you might want to take a look at nyacc leoprikler: it can parse the header files and generate ffi code for you, including enum handling leoprikler: thing is, in its current configuration it does really much, so if you want to limit it to a select few enums you have to code that up on your own wingo: leoprikler: neat! i should look more into nyacc one day justin_smith: iirc that's what luajit has right? it uses a parser of the h file to code gen? leoprikler: so should I :) dsmith-work: Anyone ever use emacs multi-cursor stuff for those kinds of mass edits instead of macros? wingo: not me wingo: that's kinda like C-x r t tho mwette: I use C-x ( ... C-x ) to record macro then C-x e ... dsmith-work: And newish emacs you can then just keep doing e e e e .. davexunit: or F4 rekado: (I use F3 to record and F4 to play back) rekado: dsmith-work: I always forget which of the mc/ commands are the right ones and waste too much time there. rekado: but for me macro playback with F4 is terribly slow because it doesn’t record the command I invoke with M-x but instead records that I invoked M-x … dsmith-work: rekado: Yeah, I've never figured it out either. dsmith-work: Seems like it would be useful, but not used enough for me to remember how. leoprikler: multi-cursors are weird leoprikler: particularly, I always spawn one to many when I try to use them rekado: same here! ArneBab: rekado_: sorry for not being able to come back to you earlier :-) wingo: gnulib update seems to have gone ok ArneBab: wingo: did you get to re-check the compiler tasks? https://wingolog.org/archives/2016/02/04/guile-compiler-tasks — also asking because summer of code is coming up. wingo: no time yet ArneBab: then I won’t take up more — happy hacking! And thank you for your work on Guile! wingo: tx :) brine: Hey, I am trying to use libguile.h in a program but unable to because a file libguile/scmconfig.h is missing. I looked in the /usr/include/guile/2.2/libguile/ and scmconfig.h is right there. This is an error thrown by gcc when the C program is compiled. I am on Linux, guile version 2.2.6, gcc 10.2.0. Any help would be appreciated. Thank you. rekado: brine: how do you set up the CPATH or C_INCLUDE_PATH? brine: I havent set up any paths, I am including with #include brine: rekado: That did it! I set up CPATH. Turns out gcc wasn't able to find libguile.h. Thank you spk121: do y'all feel that you reached consensus on having mkstemp/mkdtemp just return the name of the temp file/directory and not mutate any string arguments? leoprikler: to add one more take to the mix: leave it with ! now, make it no ! in 3.2 :) nly: any library for FUSE? dsmith-work: {appropriate time} Greetings, Guilers civodul: hi! civodul: nly: there's https://github.com/sph-mn/guile-fuse but it seems to have a somewhat arcane build system (and dependencies) davexunit: does anyone know what kind of overhead is associated with define*? I'm wondering if it's a good idea to use it in performance sensitive code. wingo: davexunit: it makes procedure entry more costly. optionals are almost free. keyword arguments are more expensive. but measure, if it matters. wingo: inside the function there is no difference tho davexunit: wingo: cool, thanks. that's the kind of stuff I was looking for before I go benchmarking. I'm using optionals, in this case, so that's good news. nly: thanks rlb: spk121: I think maybe we were leaning toward switching to the non ! variants, and either deprecating mkstemp! (or really, could just leave it around for backward compat indefinitely, with suitable, docs suggesting you prefer mkstemp). i.e. it's not much code, and then we don't have to push work off on to all downstreams. rlb: (that are using it) spk121: rlb: I think that is sensible. I've got time today to take that action, if everyone's okay with that spk121: I guess the question now is what should non-mutating mkstemp return? Just the filename string? Or return the filename string and the port as multiple values wklew: Hi Guile, I had trouble finding an answer to this online: are promises thread-safe? wklew: if the promise itself makes no mutations spk121: because the analog between the two isn't perfect in C either. in the C mkstemp returns a FD, the C mkdtemp does *not* return a DIR handle leoprikler: wklew: everything in guile should be thread-safe to the extent that it does not crash, promises included leoprikler: however, there's no safety as to whether you're producing garbage or not leoprikler: if your promise does not mutate anything however, there's no way it would ever be thread-unsafe manumanumanu: davexunit: a define* where you don't use the extra features over define is free, since a define* without #:optionals or #:key becomes a regular define manumanumanu: wingo: regarding define*: is a define* using only optionals any different from case-lambda? davexunit: manumanumanu: I wouldn't use define* if I wasn't going to have optional or keyword args. manumanumanu: davexunit: I have ended up with define* without any extra features when refactoring, and noticed that it becomes define at expansion. I sometimes write some functions as define* when I maybe intend to extend them. I'm just lazy, and I thought of it as a simple FYI :D davexunit: it's good to know. I didn't know that the trivial case would do that. spk121: wingo: ok I'm going to push a mkdtemp! -> mkdtemp patch. We can do mkstemp! -> mkstemp later once there is consensus about what mkstemp should actually return. spk121: civodul: ^ manumanumanu: anyone here have guile-commonmark installed? manumanumanu: I built the current master, but now I can't use lists. manumanumanu: oh, this seems to be a known thing. guile 3 is unsupported civodul: spk121: sounds good! civodul: spk121: what we discussed yesterday is that we could deprecate mkstemp! and provide mkstemp civodul: so mkstemp! would be removed in 3.4, i think spk121: civodul: the question for mkstemp, though, it what it should return. Just the filename? or both the filename and the file port? The mutating mkstemp! returns an open file port rlb: both rlb: I think? i.e. the fd is important -- perhaps just (values ...)? spk121: rlb: I think both via values is the way to go with the port being primary, so that if you just do (define pt (mktemp "XXXXXX")) it picks up the port spk121: And then you could just implement it in (ice-9 posix) without having to write any new C wklew: leoprikler: I wasn't sure of the interaction between forcing promises in different threads, maybe thread-safe is not the right word but i was wondering if people have run into issues with it leoprikler: forcing promises in different threads should be safe leoprikler: if not, that's a bug and should be reported wklew: analogously, I was wondering about how promises interact with delimited continuations, like throwing away a continuation or resuming it more than once wklew: does each thread have its own cache of forced promises? sorry if im asking basic questions i wasnt sure where to look leoprikler: once forced, the value always stays the same leoprikler: that's documented wklew: ok, i guess that's all i was wondering wklew: thanks! rekado: manumanumanu: works for me rekado: I built guile-commonmark with guile 3.0.5 rekado: needs to changes: one is in configure to allow building with 3.0, the other is to remove the (exit …) forms at the end of every test file. rekado: *two changes rekado: sneek later tell nij There’s a CSV (and more) parser: guix install guile-dsv sneek: Okay. rekado: Is it expected that a “compound condition” (SRFI 35) does not satisfy the condition-type? predicate? rekado: say I (raise (condition (&my-error) (&message (message "Oh no")))), shouldn’t this satisfy all of “my-error?” “message-condition?” and “condition-type?”? rekado: another thing worth noting: at the location where I construct the compound condition I get a warning “possibly unbound variable `make-compound-condition'” rlb: wingo: not sure it's relevant, but in case it is, civodul and I recently discussed the possibility of adding a GUILE_EXTENSIONS_PATH and corresponding %extensions-path so that things building on guile could use them instead of LTDL_LIBRARY_PATH. I forget the exact details (can go figure that out if it seems interesting), but it's something I hit while working on lokke, which has it's own shared libs. wingo: rlb: hey would you mind if we changed "mkdtemp!" to be "mkdtemp" and instead return the path as the result? wingo: re: GUILE_EXTENSIONS_PATH, sgtm wingo: rlb: fyi i would like to make a quick 3.0.6 to get the new gnulib out, but there is room for other fixes wingo: has been 3 or 4 years since we updated gnulib RhodiumToad: did that thing with the interrupts get tracked down? wingo: RhodiumToad: nope, not to my knowledge spk121: wingo: FWIW, I also think returning the path for mkdtemp instead of mutating the string is more scheme-y. But rlb liked it the current way because that's how C's mkdtemp and Guile's mkstemp work spk121: we went back and forth a bit on it. leoprikler: Well, mkstemp! and mkdtemp! are not without side-effects in multiple ways, so... spk121: Maybe we rename mkdtemp! to something like make-directory-from-template so no one expects it to act like C's mkdtemp civodul: spk121: i agree that mutating the string is not pretty, but in this case i'd value consistency with mkstemp! civodul: all the POSIX bindings in libguile are very close to their C counterpart civodul: i think it's good to stick to that civodul: one can always build higher-level modules on top of that spk121: civodul: fair. Well, if someone wants me to rework the patch, just let me know. Of if you just want to revert it to get 3.0.6 out, and then revisit the question, that's fine too wingo: civodul: honestly i would rather change to deprecate mkstemp! in that case wingo: mutating string arguments is terrible, it will always cause problems for new users that expect string literals to be mutable, etc wingo: like deprecate in favor of "mkstemp" which returns two values or something wingo: (all this said, progress > perfection, so if there is no agreement i am happy to continue with what we have) rlb: wingo: I'd just favored consistency for now, with the option of having immutable wrappers on top. Could then either publicize the friendly versions more and leave the ! versions as lower-level, or eventually get rid of them. Don't feel strongly about it though -- mostly just thought we'd want the two to match, whichever we pick. rlb: And of course in this case, the underlying operations are heavy-weight enough that there might not be much justification for the ! versions, so no substantial argument in *favor* of keeping the ! versions in the long run. wingo: well let's put it this way -- mkstemp! is a terrible interface and we'll avoid problems in the future if we migrate to something that returns results as return values. if that's the case then we should add mkdtemp instead of mkdtemp! rlb: bbl wingo: but -- i can handle that migration e.g. to mkstemp, if we agree about it dsmith-work: UGT Greetings, Guilers joshuaBPMan: so I think the guile manual for set-field in records doesn't work when you try to run the code. joshuaBPMan: anyone have a link to some set-field examples? civodul: wingo: ah yes; actually i guess my argument was more about the obscure name than about mutation civodul: so yes, we could have non-mutating mkstemp/mkdtemp (no bang) civodul: and deprecate mkstemp! while at it wingo: great civodul: :-) rekado: joshuaBPMan: can you give us a reference to the manual section in question? joshuaBPMan: sure. just a moment. joshuaBPMan: https://www.gnu.org/software/guile/manual/html_node/SRFI_002d9-Records.html joshuaBPMan: Down toward the bottom of that page is a reference toward "set-field". joshuaBPMan: The example of rms I can't get to run for me. joshuaBPMan: maybe I'm doing something really stupid. RhodiumToad: what happened when you tried? joshuaBPMan: here's my code of trying to out: http://paste.debian.net/1181937/ joshuaBPMan: I get an error that says wrong number of arguments in form (lunch-food). joshuaBPMan: RhodiumToad: unknown file:206:7: address: Wrong number of arguments in form (address person-address set-person-address) RhodiumToad: joshuaBPMan: missing parens? RhodiumToad: (set-field dine-out (lunch-food "sandwich")) joshuaBPMan: RhodiumToad: ;;; :224:0: warning: possibly unbound variable `set-field' leoprikler: joshuaBPMan: normally you'd write that as (food lunch-food set-lunch-food!) would you not? RhodiumToad: sorry, (set-field dine-out (lunch-food) "sandwich") joshuaBPMan: leoprikler: I have no idea what I'm doing bro. :) I just learned about set-field this morning :) joshuaBPMan: Do you need to specify set-lunch-food! ? According to the guile manual, "In addition, the generic set-field and set-fields macros may be applied to any SRFI-9 record." leoprikler: tbf I'm not doing too much with SRFI-9 records either RhodiumToad: also I think you meant (define (dine-out-2) (set-field ...)) RhodiumToad: or maybe not joshuaBPMan: RhodiumToad: Your latest attempt (set-field dine-out (lunch-food) "sandwich") results in this error: joshuaBPMan: unknown file:225:21: lunch-food: Wrong number of arguments in form (lunch-food) joshuaBPMan: don't feel bad. That's the code I tried earlier. joshuaBPMan: RhodiumToad: (define (something) ...) defines something as a procedure that accepts no arguments. RhodiumToad: ok. you just forgot to use (srfi srfi-9 gnu) RhodiumToad: (in addition to (srfi srfi-9) that is) joshuaBPMan: oh. joshuaBPMan: let me try that then. leoprikler: https://paste.gnome.org/p9senqmsn joshuaBPMan: awesome! Thanks gentlemen! joshuaBPMan: that'll make my cookbook image api patch a little coolier. joshuaBPMan: hopefully. rlb: wingo: yeah, to be clear, I think it's just fine (and likely preferable, since perf isn't a question) to have mkstemp and mkdtemp as opposed to mkstemp! and mkdetemp! -- was really just leaning against a mismatched mkstemp! and mkdtemp. civodul: cbaines: did you find more clues regarding the exception handling issue we discussed yesterday? cbaines: I tried using with-throw-handler rather than with-exception-handler (with #:unwind? #f), and that seemed to not break things cbaines: I think you correctly diagnosed the problem that somehow with-exception-handler breaks false-with-exception cbaines: which is ironic because I'm running in to this when pretty much copying code from the docs https://www.gnu.org/software/guile/manual/html_node/Pre_002dUnwind-Debugging.html#Pre_002dUnwind-Debugging civodul: did you manage to boil it down to a simple example? *: civodul can never remember which one of with-exception-handler and with-throw-handler is the new one cbaines: civodul, the example I had was quite simple cbaines: I don't know why it didn't work for you though civodul: cbaines: oh actually i did manage to reproduce it civodul: yeah sorry civodul: could you report a bug civodul: ? cbaines: yeah, will do civodul: i've been debugging a weird exception-related issue with inferiors today civodul: my mind is all foggy now rekado: I’m guessing “with-exception-handler” :) rekado: just because the manual says that “throw” is old but here to stay civodul: yeah with-exception-handler (the core one, not the R6 one :-)) is the new one rekado: ArneBab: can you recommend a way to load a wisp file? I’m using a copy of (language wisp spec)’s “read-one-wisp-sexp” with “load”, but I see that the return value of (wisp-scheme-read-chunk port) doesn’t have any source properties. dsmith-work: UGT Greetings, Guilers rekado: ArneBab: never mind: it was all my problem! dukester: Learning scheme using guile. Noob question OK? justin_smith: I was *just* about to type out "just go ahead and ask" tohoyn: sneek: botsnack sneek: :) dsmith-work: dustyweb: Always. dsmith-work: dustyweb: Bah. Sorry justin_smith: dsmith-work: once again we fail to meet the SLA for random IRC drop ins dsmith-work: heh dsmith-work: "Don't ask to ask, just ask. Then wait. Hours maybe." justin_smith: on some topics, I've gotten great time saving advice after a 48 hour wait on IRC leoprikler: Still higher throughput than carrier pigeons, though. justin_smith: and far less coordination overhead leoprikler: not to mention the emissions dustyweb: no worries dsmith-work :) dustyweb: leoprikler: carrier pigeons are high latency, but with TB+ sized microsd cards, they nonetheless may have incredible averaged bandwidth rates leoprikler: Perhaps, but those may not be suitable for transportation under all conditions (e.g. heavy rain) dustyweb: leoprikler: indeed, high packet loss :) leoprikler: though I suppose the same could be said for paper nij: Hello! nij: There was an article in the CL circle a few years ago, claiming that CL is finally an (acceptable) scripting language (link: http://fare.tunes.org/files/asdf3/asdf3-els2014.html). To be honest, I don't understand that article well. But hoping to use Guile as my scripting language, I wonder if Guile satisfies what the article says? Is Guile "an acceptable scripting language" as well? dustyweb: nij: it's heavily used as a scripting language here, yes justin_smith: nij: historically it's been advocated as a replacement for other scripting languages, and it's designed to be embedable nij: Thats my impression is, and also is what I hope for :D dustyweb: nij: also "scripting language" is only vaguely defined, but yes, Guile can be used for every definition of it justin_smith: nij: I don't know if it's "the official embedded scripting option for gnu" any more, but it's used in many programs dustyweb: even in the case of writing manu-scripts for plays, as ArneBab has demonstrated ;) nij: justin_smith: it might not be the case any more :(? nij: dustyweb: reference please :D :D ?!?! justin_smith: nij: I haven't checked so I'm being cautious in what I claim :D dustyweb: nij: https://www.draketo.de/english/wisp/shakespeare justin_smith: "Guile is the GNU Ubiquitous Intelligent Language for Extensions, and the official extension language of the GNU project." - https://www.gnu.org/software/guile/ justin_smith: so it's still the case, officially at least dustyweb: nij: more specifically, you should ask dustyweb: "what do I want to do?" dustyweb: or, we should ask you ;) nij: I mean ArneBab's showcase leoprikler: I have no idea, what they mean by an acceptable scripting language either. leoprikler: Like why would a scripting language even need a build system? nij: to run faster ? leoprikler: What about a build system makes a scripting language run faster? justin_smith: in order to use a language that isn't portable without a build system? justin_smith: lol leoprikler: Isn't that a bit circular, though? justin_smith: yes, it was a joke justin_smith: I may be skewed here, but I think the actual motive for that paper is "we want our build system to be as general and able to leverage the OS as much as make" justin_smith: with a minor side effect of demonstrating you could also do other random portable system stuff with cl if you jump through those same hoops nij: maybe I should just go to #lisp and ask "What's the point of this paper.. [link]" :P leoprikler: I think there's a nicer way of phrasing that question, but yeah, I somewhat agree with justin's reading. nij: Yeah I won't do that.. leoprikler: Tbh. it is more of an example why *not* to have a language/tool-specific build system. justin_smith: as an aside, it's amazing how much languages can build little galapagos of closed of evolution - cl people know a lot of things the rest of us can learn from, and they also have conventions that are absolutely nuts justin_smith: (of course I could say that about haskellers, or people who are forced to use c++, or clojurists, or...) nij: (or nonprogrammers) nij: (again just a joke. sorry) leoprikler: to be fair, C++ has some features that I greatly miss in Scheme, like templates leoprikler: GOOPS just isn't the same :( ecraven: the one thing I'm coming to miss most is type declarations, that I can use at compile-time to decide things.. ecraven: but templates are like macros, not like goops, aren't they? justin_smith: ecraven: macros used to parameterize code over types though leoprikler: templates are smart macros justin_smith: leoprikler: have you ever used ml / ocaml? I like their version - parameterized modules which take one or more types as arguments, returning a namespace of functions over the specified types ecraven: justin_smith: the problem [well, trade-off really] is not the calculation, but that you are fundamentally *missing* the actual type information. leoprikler: I have so far only heard of ML, never used it. ecraven: for example, I was playing around with some opengl stuff.. I'd like to just pass around bytevectors, which contain vec2, vec3, vec4 and so on. these could efficiently be passed along to OpenGL. but now, they don't have any more type information than "bytevector", so I cannot actually use them well in code Anonymous____: Someone can gimme a help to solve an exercise? im completly lost** justin_smith: ecraven: right, but in ocaml that's mixed with inference (which automatically figures out the types) and introspection (that tells you the types), plus (usually optional) declaration justin_smith: Anonymous____: you can always just ask Anonymous____: https://a.uguu.se/EBpRYhRr.png leoprikler: To be fair, I like types as predicates actually. Anonymous____: Its from an exercise from The Scheme Programming Language Ed4 leoprikler: It's conceptually close to C++ concepts 😉️ Anonymous____: I never have seen any kind of loop being possible withouth recursion or iterative construction using "gotos" internally Anonymous____: So i have no idea what the author means in this exercise ecraven: justin_smith: yea, maybe I'd like a Scheme that works like ocaml :P ecraven: I haven't looked at ocaml in a decade or two, I should do that again ecraven: probably what I want is just plain impossible :D justin_smith: ecraven: most ocaml code *can* work as sexps even (it's just considered weird to write it that way) justin_smith: eg instead of "f(x)" they use "f x", and "(f x)" is the same ecraven: what's a good book? Real world OCaml? justin_smith: Anonymous__: we have looping constructs in scheme, eg. "do" leoprikler: Anonymous__: You're supposed to use call/cc to create a loop in a similar way to setjmp/longjmp. justin_smith: ecraven: yeah, that one is decent ecraven: which other would you recommend? justin_smith: ecraven: the official language doc written by the compiler authors is actually good https://ocaml.org/releases/4.11/htmlman/index.html justin_smith: it's a full book, not just a manual Anonymous__: justin_smith: i already did while and other using define-syntax, but i dont think author want this, because all of those have recursive means in his internals justin_smith: Anonymous__: yeah, leoprikler has your actual answer here justin_smith: call/cc is just pretentious goto anyway, right? Anonymous__: leoprikler: hmm, trying to think how to do this ecraven: justin_smith: thanks! leoprikler: I'm trying with you, I'll let you know once I've figured it out Anonymous__: I just have seen about call/cc today, it seems like a goto with steroids because the state is back again justin_smith: Anonymous__: right, which means you can do the thing with goto you initially said wasn't allowed Anonymous__: I have read some examples in wiki too.. its very strange for me, but im thinking this cool also Anonymous__: the author dont explicit says that iterative syntax is not allowed, but its dont seem to be what he wants Anonymous__: the book have an answer leoprikler, but im not going to read it yet Anonymous__: Will keep trying justin_smith: ecraven: also, I would be remiss not to mention that rust borrows a *lot* of good features from ml, while being more mainstream and having a much more active community these days ecraven: yea, but rust is an entirely different sort of language than Scheme, to my limited knowledge at least leoprikler: Okay, I got it justin_smith: ecraven: that's true - the first version of ml was written in a lisp, and in many ways it shows, rust is further away and tries to be more like c++ dsmith-work: While Rust has some FP-like stuff in it, it is very much an imperative language. cbaines: Am I doing something wrong here, or is Guile just really broken? https://paste.debian.net/plain/1181804 cbaines: Calling (backtrace) is something you can see in the Guile manual https://www.gnu.org/software/guile/manual/html_node/Pre_002dUnwind-Debugging.html cbaines: Yet Guile seems to crash, inside (backtrace) ! Anonymous__: leoprikler: I did it with the help of ecraven in #scheme Anonymous__: https://a.uguu.se/rGvGZKdm.png leoprikler . thats the final result, o almost just followed the idea ecraven give me, you solution is similar? leoprikler: that's the same as your previous one, just different brackets, no? leoprikler: but why sleep? Anonymous__: I just put sleep so i can see the count slowly Anonymous__: its not needed Anonymous__: I have missed the first step the last one because i will be not bounded.. i tried to use i in lambda passed to call/cc in the other version Anonymous__: thats the answer in book https://paste.ofcode.org/39eKWvCzdS5KViPRpW56Myz dukester\0: is this a guile developer channel only? justin_smith: dukester\0: no dukester\0: So noob learner questions OK? justin_smith: right dsmith-work: dukester\0: But answers might be slow.. Don't worry about waiting a day or two. dukester\0: "Teach Yourself Scheme in Fixnum Days" says that (define foo bar) defines a global variable. AND to use (set! foo bar) changes the value. However, I can change the value by just re-defining foo. Is that normal? civodul: cbaines: your example works for me; that is, it displays two backtraces: the first one from the 'backtrace' call, the second one due to non-continuable exception civodul: that's with 3.0.5 cbaines: civodul, so you don't get the same output I do? civodul: nope civodul: which is weird in itself cbaines: what value is printed for COLUMNS? cbaines: is it? cbaines: ;;; ("COLUMNS" #f) civodul: 119 civodul: no no, it's set cbaines: Right, that'll be why civodul: otherwise that'd mean 'getenv' is broken civodul: yeah if i unset COLUMNS, i get the same error as you cbaines: I'm pretty sure that's a sure sign that this is a bug in Guile joshuaBPMan: Hello, I'm considering adding the (decode) module to guile's default (web ) module and friends.  So it would be (web decode). civodul: the error comes from the 'terminal-width' fluids cbaines: I'm also getting more confident that this is a weird but, as the string->number call is wrapped with false-if-exception joshuaBPMan: code is from here: https://stackoverflow.com/questions/46656074/how-to-read-post-data-in-the-guile-web-server civodul: cbaines: right, *that* is weird joshuaBPMan: would ya'll be ok to add this to guile's web implementation? joshuaBPMan: I'm not asking you to do it, I'll make the patch... cbaines: civodul, you're definitely testing using a script, rather than a REPL? cbaines: the behaviour is different in a REPL civodul: cbaines: yes; and indeed, at the REPL, i can call (terminal-width) with COLUMNS unset, and it returns 72 civodul: hey but wait! civodul: you're using a pre-unwind handler here civodul: whereas false-if-exception only sets a post-unwind handler civodul: so yours gets to run first civodul: oh that's interesting cbaines: what, so the Guix Build Coordinator code is not responsable for error handling inside of (system repl debug)... cbaines: ... no one told me! cbaines: s/not/now civodul: hmm cbaines: hmm, what you said made sense initially, but I'm not so sure now ft: dukester\0: There is also a way to use define inside of another definition, introducing a name within another scope. Using set! always modifies the value of the symbol that's in scope. It doesn't introduces a new binding. dukester\0: ft: Got it - I think. Going to read on. Thx. ft: dukester\0: On the top-level, using (define foo ...) after a previous (define fo ...) will replace the earlier definition. So in that case it'll seem similar. set! modifies the previous definition. ft: What I said isn't really limited to the top-level either. dukester\0: ft: ok will play with it a bit and see. justin_smith: also, set! works with bindings created by let, and unlike calling let again it actually changes the variable rather than hiding it justin_smith: I guess that's a variation on what ft already mentioned dukester\0: justin_smith: Got it. thx cbaines: civodul, maybe it is with-exception-handler that's breaking false-with-exception within (system repl debug)... cbaines: I switched out with-exception-handler for with-throw-handler, and (backtrace) doesn't crash wingo: good evening cbaines: o/ *: wingo looks at removing ltdl dep, for the nth time *: dsmith-work applauds wingo: i am assuming that these days, .la files are useless wingo: do people agree? wingo: i know that fedora/redhat/etc delete them from their packages wingo: i see that debian removes them as well wingo: this may be a 3.2 change tho so i guess i should branch :/ wingo: civodul: thoughts welcome ^ wingo: maybe we could drop the dep in 3.0 tho, if functionality isn't changed nij: Are there ql/asdf equivalents for guile? wingo: not really :/ most guile hackers end up using guix for that, as a more general user-space package manager wingo: there was an attempt a while back to make a guile-specific thing but afaiu it did not succeed wingo: but guix does it better than guile could have done in many ways nij: hmmmm daviid: wingo: hello! is there any hope that module-use! bug in 3.0 can be solved? nij: so I just want to write a little script that deals with csv files.. nij: how would guix help in this case? wingo: daviid: link? nij: (I noticed that it's not as easy as in CL to find a package that helps deal with csv) daviid: wingo: sure, just a sec daviid: it was first reported (not by me but that does matter) here bug#43025 wingo: nij: if guix packaged a csv package, it would be as simple as "guix install guile-csv" :) wingo: but as-is, i would recommend copy-paste fwiw :/ e.g. https://gitlab.com/wingo/guile-charting/-/blob/master/charting/csv.scm nij: OH! I didn't know it's under "guile-charting" :-( sorry for that nij: Any tips on searching packages? ft: Some are here: https://www.gnu.org/software/guile/libraries/ - Other than that: Salt. Wounds. :) nij: Also, I heard that comparing to CL, guile might lack of many packages. Would you recommend me to use cl as my main scripting lang as opposed to guile? nij: ft: I checked that page, and searched "csv" with no luck. wingo: CL may well have more packages! ft: I wasn't trying to suggest that it was complete in any shape or form. :) nij: ft: sure :-) I get that. Thanks for the suggestion anyway!! wingo: yeah library availability is getting better but not like python-level :) daviid: wingo: g-golf needs module-use!, not a works around 'as proposed' - no pun, there is a real problem with the work around, which offers a 'static' re-export, unlike module-use!, which does the right thing ... let me know if you need more info - the bug report (first message) has a snipset daviid: sneek: guile-software? sneek: guile-software is http://sph.mn/foreign/guile-software.html wingo: daviid: can look a it at some point, sur wingo: e daviid: ft: nij, ^^ wingo: not tonight *: wingo pleased that gnulib is still a thing daviid: wingo: thanks you very much. I bleive it is the only 'stopper' for g-golf to work with 3.0 nij: wingo: is python-level >>>>>>>> CL-level? daviid: *believe wingo: nij: yes :) nij: sad civodul: wingo: Debian has "always" removed .la files :-) civodul: are you considering not using libtool? spk121: wingo: re libltdl. These days dlopen() is available on BSD, Linux, Cygwin. The only holdout is Windows Native or MinGW, but, cygwin has Windows Native to dlopen conversion code civodul: or ltdl? civodul: ah ltdl civodul: yeah, it's probably okay to remove civodul: i hit a .so/.dylib issue a couple of weeks ago, which i thought didn't exist anymore civodul: but if that's the only problem, that should be manageable civodul: https://notabug.org/guile-zstd/guile-zstd/pulls/1 spk121: also, once I replaced ltdl with gmodule to see if I could. There's a tree in the repo (wip-replace-ltdl-with-gmodule) not that you'd want to add a gmodule dependency civodul: (and ltdl didn't help in this case anyway) wingo: spk121: that would be really nice if we just had to have a special case for mingw. wingo: our needs are not so complicated so perhaps we could locally define just the parts of dlopen/* that we would need, and otherwise just code to the dlopen api spk121: wingo: IMHO, that is what you should do. Code to dlopen. Borrow Cygwin's dlopen for posix-w32.c should MinGW or Windows Native be resurrected. davexunit: windows native build would be nice :) wingo: spk121: tx very much for feedback. (does mingw not work right now??) daviid: ecraven: ywrt opengl, are you aware of guile-opengl? daviid: ecraven: for info, here http://git.savannah.gnu.org/cgit/guile-opengl.git/tree/ dsmith-work: If ltdl goes away, will that fix the long standing misleading error message that happens when it can't find the .so OR the init func returns an error? spk121: wingo: MinGW on 3.0.x is broken. The patches to get it up and running, but not fully featured, are here. I keep meaning to clean the patches and commit them some day. https://github.com/spk121/guile/commits/wip-mingw-guile-3.0 wingo: spk121: weird that it differs from 2.2, as i don't think much OS-related changed. but ACK. obviously working on windows would be good! wingo: & please feel free to commit anything that's upstreamable *: wingo will update gnulib soon; have a half-done update locally rekado: I haven’t really investigated this much, but I’m having a problem with reported error locations when using load. rekado: I’m loading a wisp file and any errors triggered by that file prints something like “ice-9/boot-9.scm:1669:16: In procedure raise-exception: …” instead of the location in that file. rekado: it’s probably my fault, because I’m setting a prompt tag before using “load”, and I’m walking up the stack in the error handler. mwette: rekado: I get that all the time, with Scheme code. mwette: Sometimes works better if you compile relevant code w/ -O0. rlb: ...given the recent compiler changes, is say (memv x chars) likely to perform much differently from an equivalent case clause for say 10-20 characters? spk121: . apteryx: is there a way to have format ignore some characters (e.g. ascii color escape codes); I'd like padding to work as expected even when coloring output. RhodiumToad: you mean when formatting a string? apteryx: yes RhodiumToad: you want it to treat the string's length as something other than what it really is for padding purposes apteryx: one of the components gets decorated by an ANSI escape code, which format rightly treats as characters. Since they're invisible though, that visually doesn't work well with the usual padding mechanism. RhodiumToad: that suggests you need your own function to get the "display length" of a string, and compute the padding from that apteryx: I see. Thank you. apteryx: :-) RhodiumToad: which of course requires knowing what sequences are escapes apteryx: indeed apteryx: another thing I was wondering about: is string-match really inefficient compared to regexp-exec? Wouldn't the byte compiler already be able to preprocess (e.g., compile) the regexp when it's static, else cache the result from a first compilation at run time? RhodiumToad: does the compiler do that, though? apteryx: I don't know. apteryx: The doc suggests that no, but I'm curious whether there technical reasons for such limitation. spk121: Over the years, I have written a few fairly elaborate parsers for escape codes (ECMA48 and other associated standards) but sadly I don't have one in Scheme to offer you terpri: apteryx, dunno if it's "really inefficient" compared to regexp-exec, but typical uses of string-match don't compile static regexps during byte-compilation terpri: e.g. compare ',x (lambda (x) (string-match "a*b" x))' and ',x (let ((a*b (make-regexp "a*b"))) (lambda (x) (regexp-exec a*b x)))' terpri: (i'd guess it's because string-match or regexp-exec could be redefined by the user) wingo: moin civodul: hey wingo! rekado: with srfi-64 can I use test-error and test-read-eval-string to not only detect that a syntax error is reported, but also match on the error message? rekado: mwette: I was hoping to avoid compilation, because it’s an extra step, but I’ll give it a try in the pursuit of better error messages. civodul: wingo: i have a few commits at https://notabug.org/civodul/guile-charting that you might want to take civodul: trivial fixes wingo: i should maintain it better :P i always have 2 or 3 WIP checkouts around for experiments in progress that i haven't gotten around to publishing wingo: civodul: want to have privs on https://gitlab.com/wingo/guile-charting/ ? or we could put it somewhere else wingo: i have a moderate goal of not breaking back-compatibility, but if there are real improvements that can apply generally then i'm fine with breaking changes wingo: generally speaking that means added functionality always ok, changed functionality possible but good to avoid wingo: sound good to you? wingo: i keep meaning to take a few months and do a proper grammar-of-graphics thing :P rlb: wingo: not sure if you saw, but if not, noticed a possible fectors bug: https://paste.debian.net/hidden/94dc9c6c/ After enough popping, ref returns internal structure rather than the value. rlb: wingo: oh, and it's not at all urgent, I was just toying with a perf test against the C vecs. rlb: (when the test suite hit that) civodul: wingo: as you prefer, i'm happy with you pulling or with me pushing if you don't mind giving me access civodul: and yes, these were just basic fixes civodul: but actually, perhaps i forked off an older branch at wingolog.org? civodul: re grammar of graphics, don't miss rekado's guile-picture-language :-) civodul: ah, better :-) rlb: rekado: also https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/SRFI_002d71.html apteryx: is it possible to use apply on macros? RhodiumToad: obviously not apteryx: So to compose macros one is forced to use macros, corrects? RhodiumToad: yes apteryx: there's this in srfi-64: (define (%test-match-any . pred-list) which is what I need, but it's not public apteryx: instead it is exposed as a macro like: (test-match-any pred ...) apteryx: I have my preds as a dynamically computed list RhodiumToad: computed at run time? apteryx: yes apteryx: it's the custom scheme srfi 64 test runner used in Guix; I'm trying to add a --select / --exclude arguments to allow filtering on individual test cases: https://paste.debian.net/1181459/ apteryx: the part to fix is this line: (test-specifier (apply test-match-all test-specifiers)) *: RhodiumToad shrugs apteryx: thanks anyway. Bed time here :-) apteryx: I tested this cheat just for fun: (define %test-match-all (@@ (srfi srfi-64) %test-match-all)); works. apteryx: good night! rekado: apteryx: can’t we already restrict the tests to run with “make check TESTS=only-this”? rekado: rlb: yes, I used SRFI 71 and SRFI 11 before. rekado: but compose is nice and short leoprikler: rekado: that only limits to files afaik sneek: leoprikler, you have 1 message! sneek: leoprikler, raghavgururajan says: I have remove recursive for tg_owt in v13. :-) leoprikler: evil sneek, that's the wrong channel 😡️ apteryx: rekado: not at the finer grain level of test cases (you can only select individual test files) apteryx: so if you are interested in a single test case in packages.scm, you can only run 'make check TESTS=tests/packages.scm' (or copy paste stuff at the REPL). apteryx: (I mean, with the above make check command, *all* the test cases of packages.scm get run, which takes quite some time). apteryx: rekado: moving conversation to #guix as we're new off topic :-) Rovanion: How do I join two lists? Just attach the second to the end of the first. Rovanion: Like Clojure's concat: https://clojuredocs.org/clojure.core/concat rekado: Rovanion: append Rovanion: Thank you! rlb: civodul: maybe ok to cherry-pick the symbol hashing fixes to stable-2.2 if it's fairly easy, so they'll be there if we end up making another release? rlb: e.g. 8b3cad618314f02ad3921fa104f17ca0f721dfcb and perhaps your couple of follow-on commits with tests. rlb: civodul: oh, and I'm also fine leaving 2.2 alone wrt anything non-trivial if we'd prefer. Obviously more work/risk whenever we try to handle both branches. civodul: rlb: sure, it doesn't hurt to cherry-pick fixes to stable-2.2 rlb: OK, thanks -- I might backport some of the changes I just pushed to 3.0 too. And I was goingg under the assumption that the symbol hashing is ok for a Z release under the bugfix category. civodul: yeah rlb: Oh, and I was also trying to figure out when I should post patches to guile-devel. i.e. I had been intending to do that more, but during the push I was reminded that there's a commits list, so maybe that's often sufficient? rlb: I mean of course I'll still post patches for review when that's appropriate, but perhaps not things like simple doc fixes, etc. rekado: ArneBab: it seems that I can break wisp by (read-set! keywords 'prefix) rekado: “let\n : hello” is read as “let #:hello” jgart: Hello! `local-file` is a record that is then shadowed by the macro local-file (using define-syntax). Is my thinking correct on that? I'm reading the code in this file: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/gexp.scm#n406 sneek: Welcome back jgart, you have 1 message! sneek: jgart, leoprikler says: (system vm disassembler) leoprikler: now that's an old message jgart: macro local-file https://git.savannah.gnu.org/cgit/guix.git/tree/guix/gexp.scm#n445 leoprikler: jgart, the record is called leoprikler: and the constructor for it is %%local-file, because it has both %local-file and local-file as sugar jgart: so in this example the macro local-file is being called? https://paste.debian.net/1181323/ rlb: do we not provide a (documented/supported) function equivalent to the repl ,time? i.e. so you can use it from casual benchmark programs? If not, wondering if we might want to. spk121: rlb: i use the 'times' procedure for casual benchmarking. You can difference the output of 'times' before and after Bumblehorse: Is there a simple way to make the full pathname of guile in a script portable? RhodiumToad: there's the usual trick with /usr/bin/env Bumblehorse: Wow... I didn't know about that Bumblehorse: Is this why guix has env in /usr/bin? rekado: ArneBab: the problem with prefix keywords is with “read” itself, not with the wisp reader. (call-with-input-string ": hello" read) results in “#:hello”, so if wisp wanted to support prefix keywords it couldn’t use read for them. RhodiumToad: allowing spaces between the : and the name in prefix keywords seems ... surprising, and arguably a bug in itself rekado: yes, I submitted a bug report ArneBab: rekado: thank you for the info! This hack "foo" → (identity "foo") has been done in readable, but it results in lots of problems down the line, because you now need syntax to specify that you actually want to call something, so you start adding parens about the newline call ArneBab: rekado: there is one thing so: In discussions about getting wisp-derived syntax into racket, there was the proposal to use .. instead of . as line-prefix, which is much more visible while being consistent with ++ being the vector-equivalent of + (so .. would be the list-equivalent of .) ArneBab: rekado: what are prefix-keywords? ArneBab: rekado: in readable they added newline() for the no-arguments use-case which is only ever required because they interpret single-element lines as "no function application" ArneBab: rekado: do you use wisp-mode? It’s highlighting should already help a lot in avoiding the missing . problem (because then the first element gets highlighted as procedure) rekado: ArneBab: is there ever a case where one would *want* to apply a string literal, though? rekado: a prefix keyword looks ilke this: “:hello” ArneBab: in macros you might want to give it as first element ArneBab: ah, prefix is like common-lisp keywords then rekado: but wouldn’t the macro have to appear first right after indentation? ArneBab: when you’re in alists that can happen, too ArneBab: list ("foo" . "bar") rekado: how would I write this with "foo" appearing as the first thing after indentation, though? ArneBab: in macros you sometimes assemble list elements one by one ArneBab: list\n "foo" . "bar" ArneBab: quote\n "foo" . "bar" ArneBab: (sorry) ArneBab: list evaluates the content, but quote does not rekado: ah, I didn’t realize this was possible. I assumed that in Wisp *anything* appearing first after indent would become an application of that thing to the rest of the line. rekado: but I see now that (quote ("foo")) is perfectly fine. *: rekado has to leave for a while ArneBab: That’s the result of building wisp as a general syntax for a language as powerful as Scheme :-) rekado: ArneBab: I do use wisp-mode but it does not change the color of strings that appear in the first position. rekado: I regularly forget about the leading dot when splitting string-append expressions ArneBab: rekado: ah, I see the problem … ArneBab: should have initial-element be the stronger fontification than string civodul: hey ho! civodul: wingo: i get suspicious unbound-variable warnings with 3.0.5 civodul: namely, when using a macro from (foo) that expands to a reference to a binding in (foo) civodul: for example, "unbound variable `make-compound-condition'" when using 'condition' from (srfi srfi-35) civodul: does that ring a bell? rlb: wingo: on an unrelated note, I'm not sure, but it looks like fector might have a bug when popping, i.e. https://paste.debian.net/hidden/a3e4bb71/ The ref at the end there, returns te internal structure, rather than the value. rlb: (Revealed by some of the lokke vector tests, fwiw...) *: rlb was attempting to compare the performance against what we already have... rlb: Is there a generally preferred way to handle implementation-specific bindings that need to be shared between two modules? i.e. they're considered "private", but of course can't actually be private. rlb: e.g. a shared (foo internal bar) module, or symbols prefixed with % or sneaking around via @@ or... civodul: rlb: hey! i recommend against @@: that may not work with declarative modules civodul: a (foo internal) module sounds good to me rlb: heh, yeah, I figured that was the least likely :) rlb: @@ I mean civodul: yeah rlb: And OK, thanks. civodul: Fibers has such a module, for instance civodul: Guile-Gcrypt too civodul: we can almost see a pattern here :-) rlb: perfect apteryx: is it possible to control failure on redirect-port ? apteryx: I have it causing a script to exit with status 1, without apparently raising an exception whatsoever, nor exit code (as documented: the return value is unspecified). Still, there must be a way to prevent the script from exiting and report the problem? apteryx: haha, I'm just silly, and the actual error is probably logged in the file the port was redirected to ;-) apteryx: indeed leoprikler: Tsukundere is a very special case in that I selectively export "public" bindings only from (tsukundere). leoprikler: That being said, I couldn't resist having (tsukundere game internals) regardless :) apteryx: is there a default output port corresponding to /dev/null in Guile apteryx: ah, (%make-void-port mode) mfg: Hi, how do i capture the output of for example (remainder/ 13 5) in a single list? mfg: i meant (euclidean/ 13 5) not remainder :D pinoaffe: mfg: I'd do ((compose list euclidean/) 13 5) leoprikler: 👆️ mfg: pinoaffe: thx! i didn't know compose :-) pinoaffe: mfg: compose it's great, it allows for simplifying some code a lot, and multiple values can improve this even more, I usually only ever use multiple values with compose pinoaffe: *is pinoaffe: I think the first time I used multiple values with compose was when I turned https://github.com/words/syllable/blob/master/index.js#L287 into https://gitlab.com/pinoaffe/guile-words/-/blob/master/words/syllables.scm#L318 rlb: Hmm, interesting, I'm surprised compose works with multiple values (as an implicit adapter) like that. rlb: not unpleasantly, just surprised... rekado: pinoaffe: wow, I didn’t know compose handled multiple values! I’ll remember this the next time I’m annoyed by having to use call-with-values pinoaffe: happy to help! pinoaffe: I always thought that compose was the raison d'etre of multiple values :) rlb: does pkgconf not provide a (sensible) way to shadow/override existing config files? i.e. say I have a system (deb) install of guile-3.0, and then I ./configure --prefix=/home/foo/opt/guile-test. It looks like I can't just say PKG_CONFIG_PATH=/home/... because that doesn't override the /usr/lib/... guile-3.0.pc file? rlb: If not, then wonder if we might want some kind of --with-guile support in GUILE_PKG... rlb: i.e. so a project using GUILE_PKG can just ./configure --with-guile-pc=/some/specific/guile-foo.pc, perhaps using pkgconf's --with-path option. rlb: "perhaps implemented using" tohoyn: daviid: G-Golf builds ok now sneek: tohoyn, you have 1 message! sneek: tohoyn, daviid says: I pushed a fix, please pull, clean, and try again, let me know ... daviid: tohoyn: ok great, let me know how further testing this new 'version' goes, in particular, instances, signals and proccessing (accessors) ... tohoyn: daviid: I'll make a new g-golf-debian release first and check that Theme-D-Golf works with that daviid: tohoyn: make sure you remove the dependency on gtk-3 in the updated debian package tohoyn: daviid: ok daviid: tohoyn: can't you check theme-g-golf against a local g-golf before to work on the g-golf debian package? leoprikler: rlb: you'll also have to put a valid package configuration in that path, but other than that it should work tohoyn: daviid: I'm already building the g-golf-debian package so I'll use that. However, I won't make a g-golf-debian release before I have checked it with theme-d-golf. leoprikler: how else would GNU Guix be able to use Guile correctly? tohoyn: daviid: so g-golf shall not have a gtk3 dependency at all? leoprikler: You could probably make it a suggested dependency, but G-Golf does not depend on Gtk3 in any way. This is somewhat important, as you can now also load Gtk4 with it. daviid: tohoyn: right, though 'make check' currently uses gtk-3.0 - i hope to update the test-suite to not depend on anything but glib, gobject and gi - but building g-golf does not depend on gtk-3.0 anymore tohoyn: daviid: so g-golf shall not have any GTK dependency at all? daviid: right, except, currently, to run 'make check' tohoyn: daviid: if "make check" needs GTK then the GTK dependency can't be removed tohoyn: daviid: If I remove the dependency the sbuild environment shall not have any GTK library at all => build fails daviid: tohoyn: not depending on gtk for the checks is on th todo list tohoyn: daviid: I suggest that we remove the GTK dependency when make check has been fixed daviid: the dependency is removed - but commented in configure.ac, if you still need it to build the debian package, till i fix the test-suite, just uncomment the line tohoyn: daviid: ok. I'll check how the g-golf-debian build works. tohoyn: daviid: theme-d-golf works with the new g-golf daviid: tohoyn: ok great - tx wingo: moin manumanumanu: God morgon! rlp10: How do I compile to a binary executable file? I think that guild compile -o hello hello.scm gives me a file which still requires guile to run. RhodiumToad: currently, you don't rlp10: RhodiumToad: Understood; no wonder I was having difficulties finding how to do it then! rlp10: That said, the auto-compile feature does seem to conveniently produce pretty fast binaries. wingo: yeah guile can't produce standalone binaries right now wingo: the only native code compilation it does is just-in-time tohoyn: daviid: I was wrong. The g-Golf debian build worked without the GTK dependencies. tohoyn: I released new version of debianized G-Golf. See http://www.iki.fi/tohoyn/g-golf-debian/. manumanumanu: rlp10: So, what currently is going on is that the compiler produces bytecode, which when run in jit-compiled using a template JIT. No fancy-pants tracing jit, but a template JIT which more or less "just" translates the bytecode into native code without using any information at run-time to do optimizations. The obvious benefit is simplicity with the added bonus that generating native code directly at compile manumanumanu: time becomes a smaller step if the guile maintainers decides that is a good idea. "Native code" still might mean you need guile to run it. Chez scheme, for example, produces very fast native code, but you still need to run it through chez or using a binary that bundles chez in some way. manumanumanu: s/in/is in the first sentence wingo: moin civodul :) wingo: happy friday! civodul: hey wingo, happy Friday! :-) chrislck: Fridayyy dsmith-work: Happy Friday, Guilers!! chrislck: any (ice-9 match) gurus here? what's a good example of the set! clause? civodul: chrislck: not a guru but a happy (ice-9 match) user and... i've never used that clause! chrislck: I do too, just think it's probably magic for something chrislck: eg consider (match people (() #f) ((? spouse-name this) . rest) ...)) chrislck: ^ I'm well aware 'this' can be used, but can the spouse-name also be used somehow? civodul: did you mean (= spouse-name name) ? civodul: '=' applies 'spouse-name' to the match object civodul: whereas '?' matches if the predicate does chrislck: no: (define (spouse-name person) (and (married? person) (get-name (get-spouse person))))) chrislck: looking how to use both 'person' and 'spouse-name' in the resulting expression pizzapal: is person a record? rekado: chrislck: you can use (and …) chrislck: uh this is not relevant to the match query rekado: I do this often where I use “and” to apply different match queries to the same thing and use all the bindings in the clause chrislck: ok here's a better example: https://pastebin.com/raw/H7LkFhGq rekado: (and (? get-nato this) (= get-nato nato)) chrislck: ohhhhhhhhhhhhhhhh chrislck: oh, ohhhhhh chrislck: not bad..... still ends up with 2 calls to get-nato *: chrislck was looking for a => style trick chrislck: civodul: uh this is exactly what you were trying to say..... rekado: ArneBab: I’ve been working a lot with Wisp today and I keep stumbling upon missing leading dots when splitting up expressions over multiple lines. rekado: this got me thinking: can we avoid the need for a dot before string literals, numbers, and keywords? rekado: isn’t it obvious at read-time that string literals and numbers will never be applied to anything? civodul: rekado: at read time there are no semantics civodul: you can't tell if it's a call or a literal list or something else rekado: but we have sufficient context to know if a string literal is in applicative position, don’t we? civodul: but what about: '("s" 1 2) civodul: is "s" in applicative position? civodul: or: (define-syntax-rule (kwote (lst ...)) '(lst ...)) (kwote ("s")) rekado: right… rekado: so… I wonder if GOOPS would let me specify a #:procedure for the class and have that affect string literals. civodul: i think this would be super evil, if i may civodul: papering over syntactic issue through run-time tricks, uh! rekado: ¯\_(ツ)_/¯ civodul: that's actually my understanding of what Ruby does, but maybe it's unfair? rekado: is it really “super evil”? Or is it just icky? civodul: "super evil" in my book, but YMMV :-) civodul: leading dot is when splitting a list? like (a b c) and you want "b c)" on the continuation line? rekado: I guess I’m the text-book example of someone slipping on a slippery slope. rekado: leading dot is to prevent application civodul: :-) civodul: like quote? rekado: normally, anything that begins a line is considered application rekado: more like “identity” civodul: ooh, i see civodul: dunno if wisp can address it on its side rekado: my hack would be to assume that you mean (identity "foo") if you just write "foo" on a line by itself. civodul: yeah civodul: since wisp is just surface syntax, i wonder if it can make such assumptions civodul: probably not, just like 'read' cannot civodul: dunno, but surely ArneBab will find out :-) rlp10: manumanumanu: Thanks for your answer earlier regarding compilation of guile programs into binaries. I appreciate your response. rlb: rlp10: and I suspect this might not be the case, but if you really do need a top-level binary, then you can build that via a likely very small bit of C code. rlb: (linking against libguile) mwette: I wonder what is meant by "compile to binary". Does that mean the binary does requires only the guile distribution to run? lloda: binary is such a meaningless word in that context :-\ lloda: but i don't see how Guile programs could run independently of Guile since you can call compile at anytime lloda: maybe a restricted language rekado: I think the GOOPS hack might not work. (make "foo") is different from just "foo". rekado: I suppose I could implement this in the wisp reader instead. rlp10: rlb: Interesting. I don't know any C I'm afraid, so I'm not sure I would even know where to begin. The main reason I was interested in having a top level binary was so that I could distribute it without installing guile on the target machines, or worrying about which version they might have installed. rekado: rlp10: you can use “guix pack -RR” for distributing standalone binaries rlp10: rekado: So I would need to code a guix package which included by script, right? And then guix would package up guile and anything else I needed along with my script all into a single binary? rlp10: I'm reading the "Invoking guix pack" page now from the Guix documentation. This seems like clever stuff to me. rlb: dsmith-work: I've wondered exactly the same thing, but haven't had a chance to investigate -- hopefully we'll be able to reproduce this and find out... rlb: wingo: This reproduces the crash in short order here: while ./check-guile asyncs.test; do sleep 0.1; don rlb: s/don/done/ rlb: on v3.0.5 rlb: i.e. rlb: ERROR: asyncs.test: preemption via sigprof - arguments: ((wrong-type-arg #f "Wrong type (expecting ~A): ~S" ("resumable continuation" #) (#))) rlb: rlb: usually in ~5 iterations RhodiumToad: the ERROR: blah - arguments: ((...)) thing comes from the test suite harness RhodiumToad: it catches all exceptions and reports unhandled ones that way RhodiumToad: (making no attempt to format the error) wingo: rlb: interesting, thanks for the report! tohoyn: sneek: botsnack sneek: tohoyn, you have 2 messages! sneek: tohoyn, daviid says: I pushed a series of (very important) patches, devel branch, so g-golf doesn't depend on libgdk-3 anymore (with these changes, you may prepare and remove the configure.ac dependency entry for gtk+-3.0 on the debian package def) - please pull and tell me if everything is ok ... sneek: tohoyn, daviid says: the class is defined (then redefined 'on the fly') - Gdk 3.0 only, in Gdk 3.0, GdkEvent is not a class - with virtual slots and accessors for all gdk-event-get-* methods, then these additinak ones: keyname, x, y, root-x and root-y, with their accessors, !x, !y ... when it applies (that is if the event diefines the getter, otherwise, g-golf raises an exception) sneek: :) apfel: hi there, with-output-to-file i try to use it with fork and exec, similar to what somebody would do in C using dup(). https://pastebin.com/hHhWuY3N - but it does not work, at least the way i am doing it. Any ideas what i am doing wrong? leoprikler: Guile Syntax Gods, how do I define (define - "-") as a syntax rule/case? civodul: leoprikler: you don't! civodul: any other questions? civodul: :-) leoprikler: but… why not? civodul: it's "unhygienic" civodul: meaning that it introduces identifiers that do not appear in the source civodul: so you cannot do it with syntax-rules civodul: but you can do it with syntax-case civodul: you have to use the evil datum->syntax to do that leoprikler: okay, I think I got it leoprikler: having defined first and second as datum->syntax, I still need #`(define #,first #,second) though leoprikler: Is there a more beautiful way of writing this? civodul: not really civodul: you could use 'with-syntax' to avoid #, civodul: but that's not really "beautiful" either leoprikler: fair enough, with-syntax would break my careful indentation dsmith-work: UGT Greetings, Guilers leoprikler: good afternoon dsmith-work dsmith-work: RhodiumToad: Hrm. Ok. taw10: leoprikler: here is my solution to a very similar problem: https://git.bitwiz.me.uk/nanolight.git/commit/?id=ec502e06c5a0d6df91ee9b44f3694a9a5ecd0643 - It "works", except that Guile mangles the names of top-level bindings introduced by macros taw10: (... where the macro is provided by a module, that is. See https://www.gnu.org/software/guile/manual/html_node/Hygiene-and-the-Top_002dLevel.html) leoprikler: I don't think that's going to be an issue here. I only use this syntax locally to save some typing. apfel: ok, dup2 is available, i can work with that tohoyn: daviid: G-Golf fails to build. see https://paste.debian.net/1181136/. rlb: wingo: certainly - once we figure that out, 3.0.5 should be able to migrate from unstable to testing in debian. daviid: tohoyn: hum, could you run a 'git clean -dxf' in the source tree, and also clear your .cache/guile/ccache/2.2... of any g-golf related entry, then ./autogen.sh, ./configure ... tohoyn: daviid: same result tohoyn: daviid: I use "./configure --prefix=/usr --with-guile-site=yes" tohoyn: daviid: I also had to change GUILE_PROGS([2.0.14]) to GUILE_PROGS([2.2]) in configure.ac daviid: tohoyn: you shouldn't make that last change, and it is anyway irrelevant to the problem, which i have to think about, will ping when i have some solution, tx daviid: sneek: later tell tohoyn I pushed a fix, please pull, clean, and try again, let me know ... sneek: Got it. leoprikler: dongcarl: could this be a guile 2 vs guile 3 version difference? applicability of syntax transformers has been an issue when porting daviid: sneek: later tell tohoyn I pushed a series of (very important) patches, devel branch, so g-golf doesn't depend on libgdk-3 anymore (with these changes, you may prepare and remove the configure.ac dependency entry for gtk+-3.0 on the debian package def) - please pull and tell me if everything is ok ... sneek: Okay. daviid: sneek: later tell tohoyn the class is defined (then redefined 'on the fly') - Gdk 3.0 only, in Gdk 3.0, GdkEvent is not a class - with virtual slots and accessors for all gdk-event-get-* methods, then these additinak ones: keyname, x, y, root-x and root-y, with their accessors, !x, !y ... when it applies (that is if the event diefines the getter, otherwise, g-golf raises an exception) sneek: Okay. daviid: sneek: later tell str1ngs please track/read 'today's logs - 2020-01 13th - for what i just wrote to tohoyn, and please try and let me know if nomad works fine with this new 'version' - sneek: Will do. daviid: later tell str1ngs thse patches also fixes the get-tls-info bug you add, re-run your code and let me know, but here, the following snipset - https://paste.gnome.org/pk9j16pxz - displays ;; #t #< 7fd0bfa0c5c0> () - when button clicked ... daviid: sneek: later tell str1ngs thse patches also fixes the get-tls-info bug you add, re-run your code and let me know, but here, the following snipset - https://paste.gnome.org/pk9j16pxz - displays ;; #t #< 7fd0bfa0c5c0> () - when button clicked ... sneek: Okay. daviid: have to go afk, bbl rlb: 3.0.5 should be in debian unstable now. manumanumanu: dsmith-work: what is peak syntax-rules? I would say that the pure syntax-rules version of foof-loop by taylor campbell is pretty darn close. I chicken out and use syntax-case for the most hairy syntax-rules macro (and also because I wanted to bend hygiene): https://git.sr.ht/~bjoli/goof-loop/tree/master/item/goof.scm manumanumanu: The only reason I could write that is because I read that syntax-rules primer you linked to manumanumanu: it is amazing chrislck: uhhh. (ice-9 match) module is from 2016. there are a couple changes in http://synthcode.com/scheme/match.scm in 2020. how to get core guile to update? dsmith-work: Wednesday Greetings, Guilers dsmith-work: manumanumanu: Oh. I am no macro wizard. rlb: Haven't had a chance to check yet to make sure debian/patches aren't involved, but 3.0.5 failed on the buildds, and i wanted to see if there are any known issues with asyncs.test. https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=amd64&ver=3.0.5-1&stamp=1610521112&raw=0 rlb: ERROR: asyncs.test: preemption via sigprof - arguments: ((wrong-type-arg #f "Wrong type (expecting ~A): ~S" ("resumable continuation" #) (#))) rlb: Only happened on amd64.. rlb: (presuming from the test name, it might be timing sensitive) rlb: s/name,/name/ dsmith-work: So why do so many error message like the above show a format string instead of formatting the error? dsmith-work: Is there a bug in the error printer? Or is the error function being called incorrectly? Or is it just bitrotten code that hasn't been updated? soda__hobart: hey everybody. does anyone know of an example of a cmake CMakeLists.txt demonstrating how to link with libguile in a cmake project? soda__hobart: i don't really care about it being portable to other systems or anything like that, i am only using cmake because i am using lsp-mode for emacs soda__hobart: nm, i think i figured it out... turns out to not be very complicated, though you wouldn't know that from the cmake documentation :) ft: how'd you do it? CMake's pkg-config module? soda__hobart: bluh... it's not quite working soda__hobart: i think i am getting close, though soda__hobart: i'm trying to link libguile like this: target_link_libraries(${PROJECT_NAME} lguile-2.2 lgc) soda__hobart: this is what the whole CMakeLists.txt file looks like: http://paste.debian.net/1181014 soda__hobart: oh shoot, i think i need to do stuff to make it compile as a shared library since i don't have a main loop soda__hobart: ok, for the purposes of being able run cmake and use the IDE features from lsp-mode, at least, this worked: http://paste.debian.net/1181019 wingo: so, weird thing -- call-with-input-file and call-with-output-file will close the port on normal return from the proc wingo: but the same procedures for strings won't wingo: i think that is probably just a bug. wingo: i even have a few call-with-output-string* definitions in guile that are there just to close the port leoprikler: IIRC none of those functions guarantee immediate closing, though, am I right? wingo: if the proc returns normally, call-with-*-file guarantees the port is closed wingo: from r5rs leoprikler: Ah, right, the guarantees just don't extend to non-local exits dsmith-work: UGT Greetings, Guilers surpador: Is there a way to cause Guile to enter a debugging REPL at a specific point in a script? Kind of like python's `pdb.set_trace`? rekado: surpador: in a REPL you can use ,break and ,break-at-source surpador: Ah ok. Is there no way to set a breakpoint in source without doing it from the REPL? I don't really have a use case in Scheme yet but I know with a Python project I was working on setting a breakpoint in source was nice since I wanted to break during execution of a much larger program of which the target file was one small part spk121: surpador: you could always at "(error)" where you want to break spk121: assuming you aren't catching errors mfg: Hi, i'm trying to invoke a (syntax-rules) macro like this: (my/macro (make-list 32 0)), i get that the macro literally works with "(make-list 32 0)". Is it possible to actually evaluate the make-list before the macro gets expanded? dsmith-work: mfg: You would need to do that in the macro I guess. Maybe your macro should really be a function? dsmith-work: The whole point of macros is that the args are NOT evaluated. So you can make new syntax. surpador: spk121: ah true, I could try something with that, maybe install whatever the repl uses as the exception handler or something manumanumanu: mfg: not with syntax-rules, unless you are hard-coding every case for make-list manumanumanu: ((_ 3 val) '(val val val)) (_ 4 val) '(val val val val)) etc. manumanumanu: but with correct syntax manumanumanu: with syntax-case you can get the values of make-list if they are constants (or using syntax-local-binding (???) you can get values from other modules) and programmatically build the syntax object you want. mfg: dsmith-work: Makes sense. I'm just starting out with macros and know not much about them :D apteryx: is there a way to assert in Guile? mfg: manumanumanu: Hm, i will have to read the documentation about syntax-case :) ft: You can always do this: (define-syntax-rule (my-macro x) (let ((v x)) v)) -- which will make the value accessible as ‘v’ when the thing runs. But I agree, sounds like that thing doesn't have to be a macro. apteryx: silly me; there's 'assert' apteryx: it's in rnrs base mfg: but you are right, i shouldn't use macros for this :D manumanumanu: mfg: the best docs is the tspl4 (the r6rs part of the chez scheme manual) and "fear of macros" for racket. manumanumanu: fear of macros is incompatible enough for it to be a PITA. dsmith-work: sneek: macros? sneek: Last time I checked macros is http://hipster.home.xs4all.nl/lib/scheme/gauche/define-syntax-primer.txt dsmith-work: That is "JRM's Syntax-rules Primer for the Merely Eccentric" dsmith-work: sneek: botsnack sneek: :) mfg: Thank you for the links/tips :) sneek: sneek: later tell dsmith-work Hello dsmith-work: hmm sneek: Welcome back dsmith-work, you have 1 message! sneek: dsmith-work, dsmith-work says: Hello dsmith-work: Heh sneek: sneek: later tell sneek Testing dsmith-work: sneek: botsnack sneek: :) dsmith-work: heh. Nope. mwette: sneek: later tell surpador, It's been years since I tried to put together a guile version of pdb.set_trace() but look at this: https://paste.debian.net/1180849/ where usage is pdb.set_trace() => (jump-to-debugger) sneek: Got it. mwette: surpador: stripped down it's: (start-repl #:debug (make-debug (stack->vector (make-stack #t)) 0 "trap!" #t)) mwette: surpador: mwette: ah nice, that makes sense, thanks! I'll have to play around with it a bit :) sneek: surpador, you have 1 message! sneek: surpador, mwette says: It's been years since I tried to put together a guile version of pdb.set_trace() but look at this: https://paste.debian.net/1180849/ where usage is pdb.set_trace() => (jump-to-debugger) dongcarl: Grateful if anyone can help with: https://gitlab.com/guile-git/guile-git/-/issues/22 ruffni: does anyone here use emacs and geiser and define load-paths in a .dir-locals.el? my config looks like this: https://dpaste.org/Tka0 but the geiser repl won't add the load path. Aurora_v_kosmose: ruffni: I suspect the "~/" is the problem. Aurora_v_kosmose: ruffni: Not every package uses `expand-file-name" ruffni: doubt. if i s/geiser-repl-mode/nil/ the path is loaded in the .scm files in that directory, but it isn't set in the Guile REPL buffer... Aurora_v_kosmose: Huh, maybe attaching it to just "geiser-mode" might work better? ruffni: nope Aurora_v_kosmose: How puzzling. ruffni: pretty sure the Guile REPL mode doesn't inherit the current-directory portion from where it's called ruffni: indeed Aurora_v_kosmose: ruffni: From within the REPL buffer, can you describe-variable and check if it has the value you want? ruffni: yes i can ruffni: and it doesn't Aurora_v_kosmose: Hm, I wonder if perhaps the directory-local variables aren Aurora_v_kosmose: *aren't registering for some reason. ruffni: but when i manually `M-x geiser-add-to-load-path' it works just fine ruffni: they are with the .scm files in that directory marusich: Is changing the geiser-guile-load-path at runtime supported...? I tried it and it didn't seem to alter the place it was using. marusich: I did try closing the Geiser repl and starting it again, but I didn't restart Emacs. Aurora_v_kosmose: I don't think restarting Emacs would be necessary. Aurora_v_kosmose: Restarting the REPL itself I'd think would be. wingo: moin ruffni: ich: setting geiser-guile-load-path doesn't change a thing (at ruffni: marusich: run-time), but M-x geiser-add-to-load-path actually works at run-time spk121: wingo: good morning. rob and I have chatted a bit on guile-devel about adding mkdtemp! for temp directory creation. I'm going to clean and push his patch if there's no objection wingo: spk121: great! spk121: cool ATuin: has guile-gcrypt library support to decrypt RSA data? dsmith-work: UGT Greetings, Guilers leoprikler: ATuin: it seems to have sign and verify, but I don't see a decrypt ATuin: leoprikler: yeah, i saw the same ATuin: I will try to use it at least to get a sexp expression for the key ATuin: and then just ffi the decrypt function Aurora_v_kosmose: Is Chikadee basically the one Guile game engine? Aurora_v_kosmose: *Chickadee spk121: pretty much. There are a couple of versions of SDL bindings if you want to go low level spk121: I wrote my own weird game engine once, but, it is too idiosyncratic for use by anyone else Aurora_v_kosmose: I see. Well, good to know for sure. mwette: try "ln -s foo .; cp -r . /tmp" mwette: oops "ln -s . foo; cp -r . /tmp" a_v_p: Hello Guilers! When compiling, Guile-Gnome on Ubuntu 20.04 wants the X11 DISPLAY variable to be set to correct display number, otherwise the compilation fails. Does anyone figured out how to fix that? CI of my Guile project fails due to that because there's no X11 in a Docker container. (I know that Guile-Gnome is somewhat deprecated, but I'd love to stick with it unless Guile-Gi/G-Golf will be available in the repository.) a_v_p: Here's my make output: https://paste.debian.net/1180413/ leoprikler: a_v_p: g-golf is making its way into debian at least, so that's that leoprikler: Aurora_v_kosmose: depends on what you mean by "game", but if you're only considering generic engines, then yes Aurora_v_kosmose: Right, that was what I was going for. tohoyn: sneek: botsnack sneek: :) mwette: a_v_p: is Xvfb an option? Xvfb is an X11 server that operates on a frame buffer in virtual memory, no graphics required. mwette: It is in the ubuntu repo. a_v_p: mwette: Wow, thanks, that worked out! mwette: yw ATuin: hi rlb: lokke should work with FreeBSD now too. chrislck: i.e. how to access a binary buffer from C and convert to SCM RhodiumToad: you need to do it all from C? RhodiumToad: and you want a list of numbers, not characters? RhodiumToad: simplest method is probably to just cons it up backwards from the end chrislck: hmm not super elegant but ok chrislck: scm_from_utf8_string is not right because of these '\0' obviously chrislck: hoping for similarly concise chrislck: alternatively how to convert/case char* into #vu8 RhodiumToad: converting a char* to #vu8 should be simple RhodiumToad: where's the char* coming from? chrislck: libqrencode RhodiumToad: do you want a bytevector that copies the bytes, or that aliases them? RhodiumToad: looks like scm_pointer_to_bytevector is of interest RhodiumToad: you could easily do an extra copy if you want a copy chrislck: ah looks like it chrislck: now need to look into scm_gc_protect and stuff RhodiumToad: well making a copy is probably the easiest way to avoid gc complications chrislck: Thanks! ArneBab_: rlb: lokke looks like the perfect tool to get a colleague to Guile — thank you! rlb: ArneBab_: hah, you're welcome, though it's definitely early days. apteryx: how do I match a pair? (match pair ((a . b) ...)) or (match pair ((a b) ...)) ? apteryx: the earlier (thanks, REPL :-)) rlb: When working on lokke, remembered that if you want to make a dialect for guile that has it's own #! interpreter, you may have to generate binaries to be portable, i.e. solaris and darwin derivatives don't allow the #! target to be another #! script. RhodiumToad: what systems do allow that? RhodiumToad: freebsd certainly does not, for example amirouche: leoprikler: + re fash better name amirouche: +1 leoprikler: apteryx: for pure pairs you probably want (match pair ((a . (? (negate pair?) b)) ...)) leoprikler: not sure if that works, but you can try RhodiumToad: or ((a . (and (not (? pair?)) b)) RhodiumToad: missing ) there somewhere manumanumanu: rlb: if you want a C extension with fectors, I would suggest c-rrb. I think it is permissive, and is probably the fastest implementation of rrb-vectors around. They will be faster than fector, but also have fast concatenation, splitting and in-the-middle insertion. manumanumanu: the cost of rrb-trees over, say, fector by andy, is a small check: (if (split-or-concatenated? fector) (sliightly-more-expensive-lookup fector index) (regular-fector-lookup fector index)) manumanumanu: whereas splitting and concatenating is o(1)-ish instead of o(n). manumanumanu: the other known implementation of them are arximboldi's immer c++ library which comes with basic guile bindings. That one has regular fectors (called vector) and rrb-trees called flex_vector. He reports a worst-case slowdown of 2x, but only after _excessive_ splitting and concatenating. rekado: I’ve been playing with guile-rsvg and noticed that an error is thrown when closing an rsvg handle immediately after writing a non-ASCII character to it. rekado: the rsvg API expects you to close the handle to indicate that no more writing will occur. rekado: there is no such problem when using rsvg-handle-new–from-file (which does not require writing to and closing of the handle) ArneBab_: rlb: that’s a good point … ArneBab_: RhodiumToad: there are systems that re-target binaries to #!-scripts ArneBab_: RhodiumToad: for example check `head $(which guix)` chrislck: RhodiumToad: thx a lot for your help! https://github.com/Gnucash/gnucash/pull/845 pinoaffe: hi folks, a while ago I asked about the guile repl, didn't really get a clear answer, so I'm going to ask again: does the guile repl support on-the-fly modification of state (followed by resuming execution) when an exception is raised, along the lines of the workflow described in http://mikelevins.github.io/posts/2020-12-18-repl-driven/ ? I read the article, and figured if guile support this, it could make my repl-interaction pinoaffe: quite a bit easier pinoaffe: I read the repl command documentation bit didn't really understand how those commands relate to eachother dsmith: pinoaffe: Guile (and Scheme) doen't have restartable exceptions like CL does. dsmith: pinoaffe: Also, doesn't save the in-memory image to be reloaded later. So you can't type in definitions at the repl, save, type in, save ... dsmith: Instead, you use geiser/emacs and type in a new def in a file, and then send that def to a running Guile. Run, Edit, Repeat. dsmith: Very similar workflow, but you have the code in a file. manumanumanu: pinoaffe: you could write restarts using continuations if you want to manumanumanu: but other than that, the answer is no :) pinoaffe: dsmith: thanks, thats what ive been doing pinoaffe: manumanumanu: thanks to you too manumanumanu: pinoaffe: whoa. I just stumbled on something fun, that is tangential to what you are doing. (ice-9 local-eval). Trying to do something like what you are asking for is going to be fun in the bad sense! manumanumanu: pinoaffe: https://www.gnu.org/software/guile/manual/html_node/Local-Evaluation.html manumanumanu: but you could write something where an error gives the error handler access to the lexical environment of the error, which means you can set! to your hearts desire manumanumanu: as long as things are not inlined, of course manumanumanu: (define meh 6) (define e (the-environment)) (local-eval '(set! meh 11)) (display meh) => displays 11. manumanumanu: and it works badly with the dynamic environment, so parameters are not the same. manumanumanu: hihi. I haven't had this much fun since the city burnt down. rlb: RhodiumToad: sounds like #! targets can be interpreters in the minux and linux worlds (and can "recurse". Guessing the solaris/darwin claim extends to the broader *bsd world too: https://en.wikipedia.org/wiki/Shebang_(Unix)#Syntax rlb: manumanumanu: thanks - I'll put that on the investigation list, though clojure vectors explicitly don't support concatenation or insertion if that makes a difference. rlb: (but even if so, might be interesting to have variants that do -- have to think about it) manumanumanu: rlb: as I said, they are a superset of clojure's persistennnt vectors. The difference is that the rrb-trees relax the balance requirement, which makes you use a lookup table whenever you have done a concat/split. if that LUT is not present, use the regular pvector lookup :) rlb: Oh, I just meant that clojure has no operations that will allow vector concat or insertion atm. manumanumanu: so it is really (if (LUT? fector) (more-expensive-lookup fector index) (fast-lookup fector index)) manumanumanu: yeah manumanumanu: you have to manually copy it rlb: Hmm, though I suppose maybe concat or into might be optimized to take advantage in some cases, *if* that were deemed to be acceptable wrt the actual documented behaviors. manumanumanu: o(log n) is pretty much o(1) in these cases manumanumanu: anyway. good night :) rlb: night rlb: I suppose perhaps concat shouldn't actually... RhodiumToad: rlb: so I wonder what happens on linux if a file's #! points to itself *: rlb guesses that linux has something like the symlink count limit at least... *: rlb guessed right :) rlb: $ ./foo rlb: bash: ./foo: ./foo: bad interpreter: Too many levels of symbolic links rlb: rlb: after an echo -e "#!./foo\nsomething\n" > foo dsmith: I wonder how many is "too many"? RhodiumToad: probably about 32 *: rlb guesses a power of 2 rlb: Apparently "_POSIX_SYMLOOP_MAX is 8" (at least). dsmith: https://man7.org/linux/man-pages/man7/path_resolution.7.html dsmith: "As currently implemented on Linux, the maximum number of symbolic links that will be followed while resolving a pathname is 40." RhodiumToad: that's a strange choice RhodiumToad: anyway, #! interpreters may have a different limit dsmith: Right. I was looking there the error message mentioned symlinks. dsmith: there because ... RhodiumToad: can't imagine why they would choose 40, though remby: who has guile 3? I usually see guile22 in distros Aurora_v_kosmose: remby: I'm surprised that this is the case even in Arch. The only Guile 3.0 is in AUR remby: yeah rlb: remby: 2.2 and 3.0 are in debian, though maybe to your point, 3.0's not in debian stable yet, only testing. Aurora_v_kosmose: Well, Guix has up-to-date Guile, but that's to be expected. rlb: Hah, didn't know a release was coming -- still have some (minor) fixes accumulated here for 3.0 (and maybe 2.2) that I haven't pushed yet. I'll try to do that in soonish. rlb: wingo: noticed your fector.scm doesn't have a copyright, and didn't know if that might be unintentional (assuming it's suitable for consideration/consumption). rlb: ...I was wondering how it might compare with 3.0 to the C version I have (didn't know about yours when I started) -- much rather have scheme if it's competitive or better. rlb: (of course) Aurora_v_kosmose: For my own projects I'd probably use Guile or CL anyway unless I really needed the edge in speed/resources rlb: Oh, mine is also guile, it's just a C implemented rlb: C module/extension. remby: Aurora_v_kosmose: what is CL ? rlb: common lisp, I'd assume Aurora_v_kosmose: Yep remby: ah rlb: For anyone interested https://github.com/lokke-org/lokke/blob/main/lib/lokke-vector.c -- of course some bits you'd want to remove from that if it were just for guile (e.g. the metadata perhaps). And while hopefully not broken, it's not all that pretty (probably needs further clean up/reworking)... rlb: (And if the scheme implementation is competitive, then it can just go away instead.) Aurora_v_kosmose: Guile 3.0 has better performance characteristics than Cpython and Ruby, I find. Anonymous__: Gratz for Guile 3.0.5 wingo: rlb: regarding fector, i think lack of copyright was probably unintentional wingo: manumanumanu: lmk how it works out in practice :) chrislck: curious about the 3.0.5 nested-if speedup -- which guile commit is responsible for it? chrislck: It's Friday!!!! wingo: chrislck: 03998db647546df017feb19c0d5912e7451a61fc, and surrounding commits tohoyn: sneek: botsnack sneek: :) chrislck: wingo: thx! wow, >5 months since 3.0.4 wingo: not much happened tho :) chrislck: nowadays, that's a good thing! O_o dsmith-work: Happy Friday, Guilers!! rlb: wingo ok, when you get a chance, if you'd like to put a copyright in there, I might see about testing it against the C version as a possible replacement later. wingo: lgplv3+ work for you? rlb: sure, and/or just match fash (presumably I thought that was fine earlier :) ). wingo: other things possible too rlb: lokke is dual lgpl+epl (so it's available to both communities -- was the thinking) rlb: fwiw, but pieces of it aren't, like fash. rlb: https://github.com/lokke-org/lokke#license fwiw wingo: done rlb: oops, mispelled fash in that list... rlb: wingo: thanks much -- assuming I get time, very curious to see how they compare. wingo: aaah i need to catch up with lokke :) rlb: well, I'm perfectly happy for you to work on making guile better too :) wingo: hehe i don't think i have time to work on lokke but i want to know what is happening there :-) leoprikler: tbh fash could really have used a better name rlb: Fair enough -- and I'll probably have some questions at some point. Already a few things I had to hack around in a less than ideal way that might suggest enhancements to guile... wingo: no doubt! i trust your judgment fwiw as regards committing anythign you like to guile rlb: I'm also not sure yet, but if nothing else, I've contemplated creating a project somewhere for fash and fector to provide a place separate from lokke to get any fixes, and I do have a few bug fixes for fash, and the addition of a fash-update procedure. wingo: happy to give feedback too, irc pokes can work well wingo: yes please do, if you want to take those files and run with them, be my guest :) *: wingo steps out dongcarl: Hi all, I'm trying to fix the guile-git-lib package on arch linux right now, and running into this issue with the tests. Wondering if anyone has a clue? Here's the test-suite.log: https://termbin.com/ojl3h chrislck: how would I convert a char* buffer into a list of bytes? the buffer may include '\0' chrislck: (from C) chrislck: char *buf = ' \0\1' chrislck: output = (list 32 0 1) hugo: I actually "needed" #:hide a few days ago... oh well wingo: moin wingo: civodul: i just pushed my rewrite of the unbound-vars analysis pass wingo: bugs welcome wingo: i figure we should release civodul: hi wingo! civodul: neat civodul: apologies for not taking a look wingo: oh np wingo: i hadn't posted it before ;) wingo: just managed to find spare time to get it into shape this morning civodul: ah good :-) civodul: i'm lagging behind and i've come to assume i've likely missed something civodul: but yeah, a new release would probably be welcome wingo: haha i am lagging behind too, just assuming that people commit anything that's important ;) wingo: anyway this pass will warn when compiling md5.scm civodul: nice wingo: md5.scm:71:0: warning: non-idempotent binding for `+'. When first loaded, value for `+` comes from imported binding, but later module-local definition overrides it; any module reload would capture module-local binding rather than import. wingo: md5.scm:72:0: warning: non-idempotent binding for `ash'. When first loaded, value for `ash` comes from imported binding, but later module-local definition overrides it; any module reload would capture module-local binding rather than import. civodul: woow that's pretty fancy tohoyn: sneek: botsnack sneek: :) *: wingo starts a fresh rebuild wingo: 10 minutes on a laptop; could be worse civodul: not bad civodul: that's with the pre-built .go files, right? wingo: civodul: no, that was without prebuilt .go files wingo: baseline compiler ftw i guess *: wingo runs a distcheck wingo: woo wingo: ============================================= wingo: guile-3.0.5 archives ready for distribution: wingo: guile-3.0.5.tar.gz wingo: guile-3.0.5.tar.lz wingo: guile-3.0.5.tar.xz wingo: ============================================= leoprikler: is there a way of still squeezing 45131 into the release? :) chrislck: hmm will the new unbound-var also suggest (use-modules ...) perchance? wingo: leoprikler: it is already out, sorry :/ but happy to make a new one wingo: leoprikler: do you have commit access? if so feel free to push that patch leoprikler: nvm, no need to rush 3.0.6 wingo: otherwise happy to add you leoprikler: I do have commit access to Guix, but I don't think that extends to Guile. wingo: what is your savannah user name? leoprikler: leoprikler, same as in IRC wingo: in the year of our lord 2021 my upload speed is... 80 kB/s :/ civodul: wingo: yay, thanks for the release! civodul: chrislck: no, it's not entirely clear to me how to integrate it, as discussed on guile-user chrislck: umm ok, guix does a fine job as it is. first time seeing it was a pleasant surprise. chrislck: (unless it's not obvious yet - I don't need it, but believe it'll significantly lower the entry bar) faLUCE: hello, given the following list: ((x-ref-of-1 . true) (blabla . true)) how can I check if (blabla . true) is in the list ? leoprikler: ((@ (srfi srfi-1) member) '(blabla . true) list equal?) chrislck: faluce: (1) you probably forgot the ' (2) guile usually uses #t instead of 'true (3) plain member works well faLUCE: chrislck: yes, but it has to be a string faLUCE: chrislck: leoprikler how can I obtain the same with memq ? faLUCE: or memv? leoprikler: faLUCE: (let ((needle '(blabla . true)) (haystack (list '(x-ref-of-1 . true) needle))) (memq needle haystack)) leoprikler: or with srfi-1 member by passing eq?/eqv? instead of equal? faLUCE: leoprikler: thanks. Sorry for the dumbass question: I hat to (display "found\n") if (blabla . true) is inside and "not found\n" if it is not. How can I put that into an if statement? faLUCE: (s/I hat/I have) chrislck: (display (if ... "found\n" "not found\n")) where ... is your conditional of choice faLUCE: sorry again: what if I have to (set! somevar "foo") if (blabla . true) is inside ? leoprikler: civodul, chrislck: how would the following sound: when an unbound variable occurs, guile first checks the core modules for a definition, then checks GUILE_LOAD_PATH if some fluid (e.g. %unbound-variable-extensive-search) is #t? leoprikler: faLUCE: (when (member '(blabla . true) list) (set! somevar "foo")) faLUCE: great thanks Anonymous__: (and (member '(blabla . true) l) (set! somevar "foo")) civodul: leoprikler: the "problem" discussed on guile-user is that it's unclear where/how Guile would print that civodul: in the exception printer? but that seems hacky civodul: with specific handling at the REPL? but then you won't see it in other cases leoprikler: Hmm leoprikler: I think you could make it so that --debug also sets up the same handler, that the REPL would use, no? leoprikler: Then you'd still have to use --debug, but you'd have an easy way of debugging your code, when such an exception occurs leoprikler: faLUCE: note however, that Scheme much prefers the functional style, and the more functional your program becomes, the less set!s you will have leoprikler: specifically the act of setting a variable to some value if something is found appears rather imperative in nature. In functional values, you'd say (let ((found? (and (member ...) #t))) ...) dsmith: wingo: Did that recent fix in lightening make it into 3.0.5 ? wingo: dsmith: yes dsmith: sweet chrislck: civodul: not sure why it's hacky to print in the exception printer. unbound-variables are bound to fail loudly... so what's the harm in being a little louder (and much more helpful) chrislck: I thought the dilemma was to search the core modules, or core modules + load-path. wingo: ok release all done i think chrislck: (IMV, either... or use a fluid like leoprikler says) civodul: chrislck: conceptually, the exception printer should do just that: print the exception (in less than a line, etc.) civodul: also, it should not fail, preferably :-) civodul: dunno maybe i'm too conservative/cautious faLUCE: thanks all chrislck: civodul: as a (not anymore) beginner I sincerely disagree... a hard fail is the best way to learn chrislck: (like C's core dumps) leoprikler: But what exactly is the "hard" fail in this case? leoprikler: I agree with civodul, that the printer itself should just print the exception record. chrislck: huh easy, your .scm has a (vector-for-each) somewhere in the middle of a function, you forgot too include relevant srfi, and run leoprikler: Though tbf. we could also special case unbound variables in the uncaught exception handler leoprikler: that way we wouldn't even need --debug dsmith-work: Thursday Greetings, Guilers chrislck: https://pastebin.com/L9jE2Tnd manumanumanu: wingo: Oooh! cool job with the comparison chains. I have the perfect use-case if you want to show off some benchmarks. It is a 100-clause case with about a thousand elements each. All symbols, characters and integers. I am expecting a spectacular speedup manumanumanu: :D :D manumanumanu: "guile-3.0.5 - up to 100x faster" drakonis: https://github.com/lokke-org/lokke drakonis: neat. drakonis: clojure for guile Aurora_v_kosmose: Huh, fancy tohoyn: sneek: botsnack sneek: :) pinoaffe: hi guilers! if I'm in a guile repl, and something causes an exception, is there a way to do a fixup and then continue execution from just before whatever caused said exception? roelj: pinoaffe: Like ",q" and then execute something again? pinoaffe: roelj: no, more like pretending there was a breakpoint just before the exception, going back to that point, modifying state, and then continuing roelj: Ah, like that. I'm not aware of a method to do that. :( dsmith-work: Wednesday Greetings, Guilers roelj: \o ManDay: Hi, what was the correct way to prevent the "imported foo overrides core binding bar" warning? Specifically for imports of rnrs where I do not want to import *except* bar but rather have guile forget about its core binding. rlb: ManDay: depending on what you want, a #:hide (...) might work, or an explicit renaming #:select (bar . %scm-bar). rlb: oops rlb: #:select ((bar . %scm-bar) ...) rlb: in your use-modules form daviid: ManDay: also, in '6.20.3 Creating Guile Modules', define-module ... #:duplicates ... ManDay: daviid: what does have define-module to do with that? I'M not the one defining anything here ManDay: rlb: Is #:hide something from master? I can't find it in my guile's docs ManDay: i don't understand your other answer, either ManDay: Can you give an example what I should put into my (import) (preferably...) or (use-modules) form such that I can use rnrs' `map` without a collision warning ManDay: ? justin_smith: ManDay: what you choose to make visible from outside modules (including the default core bindings) can be considered an aspect of your module definition daviid: ManDay: it explains what options are available, related to how to handle duplicates, which you may then apply in a repl if you don't define any module, calling default-duplicate-binding-handler ManDay: what do you mean "make visible from outside modules"? ManDay: i don't want to set up any handlers. I just want to import rnrs and use it's `map` function without guile interfering and warning me that guile would like to give me guile's map instead... daviid: then you have to set default handlers, please read the manual ManDay: jeez. can't guile make anything just simple ManDay: why does it always have to get in the way daviid: it is dead simple ManDay: simple, in my opinion, would be if it didn't try to shove its own "core bindings" into my program in the first place ManDay: the *next* simple thing would be if I could import rnrs and make clear that it takes precedence ManDay: setting up "handlers" for that is plain awful ManDay: well, thanks for the answer, though ManDay: (though I may not like it) justin_smith: ManDay: in the module definition, you can specify #:duplicates and a behavior for handling duplicate imports daviid: that '... import and make it clear ...' is precisely described in the section of the manual i pointed :) ManDay: justin_smith: *what* "module definition"?? I don't have any module definition! I'm not the person who wrote the rnrs module or the guile core bindings module justin_smith: ManDay: in your module, you specify what happens when you put things in it ManDay: I DO NOT have a module! justin_smith: including what happens if an outside module replaces something you already see defined daviid: ManDay: it seems you don't really understand what namespace have been inveted for and how to manage those (very common) situation, but everything you need to know to understand and correctly lead with those ccording to your oen nedds is described in that little section of the manual justin_smith: correct me if I'm wrong, but I don't think it's possible for guile code to not have a current module- you're module is the one you are modifying when you import something justin_smith: *your ManDay: justin_smith: Maybe that's how it's interpreted in the background. My code, though, does not contain any explicit module definition. it's a plain script justin_smith: I don't understand what "importing" a binding would even mean without a module to put it in justin_smith: ManDay: OK, then you are in the default starting module ManDay: for which, there is no "define-module" form anywhere for me to modify justin_smith: which means you can change how that module handles conflicts, or create a new one and configure it daviid: in these situations, it is expkained in the manaul, you must call default-duplicate-binding-handler daviid: you may call it without arg, it returns the default settings, or with an argument, it sets it to your needds ... ManDay: daviid: Yes, I got that. And personally, I find that a clusterfuck of set up ManDay: And yes, I agree that in a more general setting, the collision handling would be sensibly handled like that ManDay: but not if I have never asked for Guile's "core" crap in the first place daviid: ManDay: it just shows you do not understand or 'get the all picture', which is fine, but all this is explained in the small section of the manual i poiinted - guile handles this absolutely perfectly and simply ManDay: matter of perspective, perhaps. but I'm approaching guile as an interpreter of rnrs, first. I don't approach it as "Guile is Guile and if you want it to work like rnrs you have to make an effort" ManDay: daviid: I can't find any documentation of default-duplicate-binding-handler other than a sidenote in (guile)Creating Guile Modules daviid: all options are described in the #:duplicates option of the define module, i wrote this in my very first sentence to try to help you ManDay: Well, I don't get it to work. I tried (set! default-duplicate-binding-handler (list 'last)) but I still get a warning. ManDay: And I can not at all see anything in the docs which would explain why you mentioned "calling" it, earlier ManDay: oh I may have to set it to a procedure, perhaps... (set! ddbh (lambda () (list 'last))) ... ManDay: no success either ManDay: well, guile won. I'll just use its "core binding" then daviid: ManDay: the call is like this (an example, you need to adjust to your own needs) - (default-duplicate-binding-handler '(merge-generics replace warn-override-core warn last)) daviid: Mandau you d'ont call set! ... just (default-duplicate-binding-handler '(...)) ManDay: daviid: thanks. but honestly: how could I have read this out of the documentation? daviid: have to go afk a bit bbl ... other will help i hope ... ManDay: i hope you already gave me all the help I need ManDay: i think ^ daviid: others will help, just try to find the proper set of options to satisfy your needs ... bbl ManDay: well, thanks again ManDay: bye leoprikler: Interesting, so there's #:hide as well? Since when does that exist? civodul: since forever! dsmith-work: It's hidden of course.. *: davexunit had no idea about #:hide dsmith-work: So a quick C-x v g in boot-9.scm shows: dsmith-work: 67b8b6fb06 module/ice-9/boot-9.scm (Wilfred Hughes 2016-09-05 3280) #:hide BINDINGS jlicht: wow, lokke is already really fun to play with! leoprikler: I think #:hide should be documented. It would certainly help some cases, where you don't actually want core stuff to be changed. dsmith-work: Only 3.5 years ago... dsmith-work: But it was probably in before that dsmith-work: c614a00b8c ice-9/boot-9.scm (Mikael Djurfeldt 2003-03-11 3301) dsmith-work: 17 years civodul: jlicht: d'you have a package? :-) jlicht: civodul: not yet, but all the easy nitpicks have already been picked up by somebody else on the issue tracker ;-) civodul: heh :-) marusich: Is it easy to set breakpoints and walk through code in Guile like it is in some other languages? For example, in Java, using most modern IDEs, it is very easy and there are many simple guides describing how to do this. I have been using Emacs and Geiser for a while, but I have not yet really figured out what I should do to debug Guile programs step by step. I often wind up just using the undocumented "pk" or printing stuff myself, instead. marusich: I feel like I'm missing something that everyone else knows about. leoprikler: You can set breakpoints and traps using stuff from (system vm) leoprikler: For instance, if you want to trace procedure calls, you can use call-with-trace from (system vm trace) fnstudio: hi, my little guile program grew to a point that i'd feel more comfortable if it could be split across multiple files fnstudio: does that mean that i should package different parts as modules? fnstudio: in other words, is "splitting across files" a synonym of "you need to create your own module"? maav: fnstudio: not necesarily, you could load the files directly... but any modularity facility is very useful in the long term maav: for guile you only need a matching file name for the module, e.g. (module name) must be placed on module/name.scm maav: and the forms define-module and use-modules fnstudio: maav: ok, cool, thanks; so i could technically split things up in different files and load them, but otherwise there's nothing wrong in using a module even if it's a small program fnstudio: excellent, thanks v much fnstudio: :) maav: you're welcome, and using modules is a good practice on all-sized programs (with the exception of launching scripts and throw-away code) maav: the module system is just an interface over loading manually the files and some cool enviroment modifications (as adding a prefix to the imported names) fnstudio: and when i write `(define-module (ice-9 popen))` fnstudio: ooops sorry, i meant `(define-module (my-module my-proc))`, i then need to make sure that's saved as file `my-proc.scm` in a `my-module` folder maav: exactly, the only bit missing at runtime is that you have to ensure that %load-path can access to it fnstudio: which seems to create a bit of coupling (between the module and the file path) but i suppose that's needed for a more general case fnstudio: *more general cases maav: yes, the coupling is intended, you always can create (my-module) too and don't use a subdirectory fnstudio: hm interesting fnstudio: vvv helpful, thanks maav maav: fnstudio: you're welcome :) leoprikler: you can decouple modules from filenames, but you're on your own if you do that leoprikler: for instance, the '(guile) module itself is merely defined in code. There's no (ice-9 boot-9) module. fnstudio: thanks leoprikler, good to know fnstudio: now... it seems i do have a little problem with %load-path, if i print that out from a repl, that doesn't seem to include my current dir fnstudio: is that expected? fnstudio: i think i found the answer fnstudio: GUILE_LOAD_PATH fnstudio: from here: https://www.gnu.org/software/guile/manual/html_node/Load-Paths.html *: fnstudio experimenting with that now fnstudio: ok, redefining the env variable seems to fix it; i wonder if there might be any downside in adding the current folder to my bashrc definition of GUILE_LOAD_PATH... renken_: I think it's either that or installing your modules in a standard path that already exists in %load-path/GUILE_LOAD_PATH fnstudio: renken_: cool, thanks for confirming, brill fnstudio: so, i now have a `my-module.scm` file that commences with `(define-module (my-module) #:export '(my-proc))` fnstudio: and a `main.scm` file that imports it, via `(use-modules (my-module))` fnstudio: guile seems to be complaining about `my-proc` not being defined though... fnstudio: ah, it seems it works now renken: I'm curious about what the problem was fnstudio: after replacing `#:export '(my-proc)` with `#:export (list my-proc)` fnstudio: let me confirm that, brb fnstudio: yeah, it seems it was that... using `'` instead of `list` fnstudio: this is very nice, i now have my small program nicely split up in different modules, thanks everyone for helping rekado: so… this is an old problem, but I still haven’t figured out how to avoid it: (web server)’s “run-server” can only be cancelled after hitting C-c twice rekado: is there a known recipe to get around this? maav: fnstudio: it is #:export (my-proc), not a quoted nor a list call, but a literal: (define-module (name) #:export (exported1 exported2)) maav: with that definition you're exporting the name "list" too renken: how come this doesn't cause the evaluation of (my-proc)? maav: because it's a macro, not a normal evaluation fnstudio: maav: oh... i see... thanks for pointing that out fnstudio: maav: lol that my (buggy) version was still working!! fnstudio: maav: i can only imagine the headache that this could have caused in the future... fnstudio: tx :) maav: yes, some modules override procedures found elsewhere: e.g. (ice-9 format) maav: but it must be intentional, if you override list and also use a library that extends it, it will certainly cause issues fnstudio: yeah easy to imagine... renken: rekado: it could be because of the procedure call-with-sigint, check /usr/share/guile/3.0/web/server.scm renken: you can see that sigaction restores the C handler which is probably causing such a behavior lloda: imo the override of format is a mistake, the simpler proc should have a different name lloda: and i think that's the case for most overrides, really leoprikler: fnstudio: you normally don't want the current directory to be expanded into load-path leoprikler: what if you start guile in $HOME? Bad things happen leoprikler: the recommended way of setting GUILE_LOAD_PATH is through a build system, typically the GNU Build System renken: is adding $HOME/.share/guile to %load-path a common thing to do for local development, leoprikler? leoprikler: no, it's not leoprikler: The most common approach I've seen is to add a pre-inst-env.in script file to configure. leoprikler: then you can do ./pre-inst-env guile my-script.scm fnstudio: leoprikler: yeah, i thought that could be risky depending on the current working dir... but then i thought i was just being extra paranoid... i was not... :) leoprikler: since it's generated through autotools, you'll get absolute paths fnstudio: leoprikler: "GNU Build System" as in Makefile, as well? leoprikler: i.e. you can do /tmp/some-other-guile-project/pre-inst-env /tmp/my-guile-project/pre-inst-env guile something leoprikler: GNU Build System aka autotools means Autoconf, Automake etc. fnstudio: leoprikler: excellent, thanks! rekado: renken: thanks for the pointer! rekado: renken: it looks like registering *any* SIGINT handler with sigaction leads to this problem. chrislck: rekado: I'm glad I'm not the only one who can't terminate the webserver programmatically chrislck: see https://github.com/Gnucash/gnucash/pull/769 rekado: interestingly, “guix publish” does not suffer from this problem. dsmith-work: Tuesday Greetings, Guilers dsmith-work: fnstudio: "." is not in the GUILE_LOAD_PATH for the same reasons "." is not in your PATH. fnstudio: dsmith-work: yeah, i see, thanks for reiterating it but yes, i see the point rekado: davexunit: found a little bug here: https://git.dthompson.us/guile-syntax-highlight.git/tree/syntax-highlight/scheme.scm#n31 rekado: the variable %default-special-regexps should be %default-special-prefixes rekado: davexunit: rekado: I saw you mentioned a bug of mine but then my irc client lost connection. rekado: davexunit: https://logs.guix.gnu.org/guile/2021-01-05.log#181011 davexunit: rekado: thanks davexunit: forgot about the new log location. haven't been paying attention to the channel topic. davexunit: rekado: that's an easy fix. pushed to master. rekado: thank you! davexunit: looks like refactoring gone wrong spk121: daviid: thanks. I can't take too much credit because I personally didn't contribute too much aside from some CI/CD stuff hugo: Whelp... sneek died when I started talking to him... hugo: Has anyone seen OrangeShark? I'm wondering if any work is done on the guile-git documentation RhodiumToad: sneek: botsnack RhodiumToad: huh adhoc: hugo: is that related to; http://orangeshark.github.io/ or https://github.com/OrangeShark?tab=repositories ? hugo: adhoc: https://gitlab.com/guile-git/guile-git hugo: But the same repo, albeit older is at https://github.com/OrangeShark/guile-git rlb: ...regarding some of my possibly odd questions over the past while: https://github.com/lokke-org/lokke / https://github.com/lokke-org/lokke Though it's almost certainly still broken in any number of ways. rlb: oops, one of the links should have been https://git.sr.ht/~rlb/lokke rlb: (And of course, if any of that is of interest to guile proper (no idea if it will be), more than happy to help if I can.) daviid: rlb: very impressive - you should post this on #scheme, someone recently did ask about that, not exactly '... to provide a full dialect of Clojure for Guile' but if anyone did implement clojure on some scheme ... rlb: daviid: thanks, and ok, I'll try to remember to do that later, though feel free to yourself if too you like. daviid: rlb: if you are interested, i can post a link and a sentence 'right now', let me know rlb: by all means *: rlb is getting food daviid: rlb: ok, will do in a min, and i'll send an email to ask add the project to the guile-software list as well rlb: Hah, ok, though it *is* really preliminary, but if that's still suitable for the list, then great. daviid: rlb: done, both posted on #scheme and sent an email rlb: thanks much daviid: np! spk121: new guile-curl version released, with guile 3.0 support daviid: spk121: the front page seems to point to the previous version daviid: http://lonelycactus.com/guile-curl.html spk121: daviid: Yup. I'm working on it daviid: ah ok, sorry :) daviid: spk121: i sent an email so it will be on the guile-software list as well ... spk121: cool a_v_p: FWIW, I implemented audio recording and mixing from a system playback and/or microphone: https://gitlab.com/gkaz/finger-frame tohoyn: sneek: botsnack renken: is there a way to instruct guile to print the file it just read through (load "file.scm")? context is that I lost the file post-load and I want to recover it from guile if possible renken: further reading of the reference manual, guile uses fluids for load and from my understanding of https://www.gnu.org/software/guile/manual/html_node/Fluids-and-Dynamic-States.html, there is no way to recover the source code as the fluid is terminated the moment (load) is done being evaluated renken: I am thinking same thing for anything inputted to the REPL. example, you define a function, clear the screen and want to review the implementation again, you simply can't. renken: I'm new to both scheme and guile so correct me if I'm wrong leoprikler: renken: An easy out would be to define your own load, which first prints the file and then proceeds to call core load. Would that be sufficient in your code or do you need an Emacs advice-style solution? leoprikler: If so, you can set %load-hook to a procedure to be called with the single argument being the file that is loaded. renken: leoprikler: yeah that's a good solution for the future, thank you. However the issue I'm faced with currently is retrieving the source code I already loaded. I assume it's not possible, correct? leoprikler: Mhh, I'm not sure it's impossible civodul: hi! has anybody written FUSE bindings? leoprikler: renken: Unfortunately, there doesn't seem to be a general solution to it however. leoprikler: you might want to try procedure-source, but it can return #f leoprikler: you might also want to try module-filename and look up that file in %load-path, but that assumes you have a module and %load-path hasn't changed since leoprikler: civodul: apparently there's https://github.com/sph-mn/guile-fuse, but it's old and without release renken: leoprikler: yeah, procedure-source indeed returns #f. As for module-filename, I was testing stuff locally and only used (load file). I decided to give up and simply rewrite the source code, thank you very much for you help! civodul: leoprikler: ah yes, thanks! dsmith-work: Morning Greetings, Guilers dsmith-work: Aww, is sneek gone again? justin_smith: sneek: boop dsmith-work: sneek: botsnack sneek: :) dsmith-work: Yey! hugo: sneek: who is OrangeShark tohoyn: sneek: botsnack sneek: :) dsmith-work: ~uptime dsmith-work: !uptime sneek: 11:51:26 up 2:11, 0 users, load average: 0.00, 0.01, 0.05 rlb: By the way, working on lokke has made me feel like guile has done a pretty good job of providing the "base for dialects" it advertises. There are certainly some rough edges, and I have any number of questions about things I just hacked around that likely either suggest I was doing it wrong, or might suggest improvements, but in general, I'd say nicely done. dsmith-work: rlb: lokke? dsmith-work: Ahh! dsmith-work: Cool fnstudio: hi, i'd like to create a simple game-of-life implementation and i was wondering if there was a library to help me with the graphic part fnstudio: ideally, i'd like this to be as much text-interface oriented as possible fnstudio: as opposed to a purely graphical library or a game kind of engine fnstudio: is ncurses something that could be stretched to cover this? (i.e. to display a grid of cells that get coloured alternatively, etc...) fnstudio: or maybe i should be creative and think of something like... i don't know... exporting to svg every single iteration and then look for a viewer? chrislck: https://www.gnu.org/software/guile-ncurses/ chrislck: xpm is easier ;) fnstudio: chrislck: thanks, what do you think of ncurses for this? too much of a stretch? fnstudio: right, xpm over svg you mean, i guess? RhodiumToad: ncurses doesn't give you a very large resolution RhodiumToad: but you could certainly use it fnstudio: RhodiumToad: right... i was thinking that maybe it could be possible to use a large viewport (but maybe i'm wrong) fnstudio: chrislck: right, XPM would be very straightforward... i refreshed it from my rusty memory with the help of wikipedia fnstudio: although with svg/xpm/... then i'd need to figure out a tool to visualise things RhodiumToad: a gui version probably wouldn't be hard. fnstudio: RhodiumToad: cool, any library in particular that you think i should look at? fnstudio: just as a first pointer, if you have anything in mind RhodiumToad: g-golf and (iirc) guile-gi are gobject-introspection libs for guile that let you use gtk etc., or there's the old (but probably still ok for this use) guile-gnome RhodiumToad: guile-cairo exists for doing stuff with a cairo surface for the actual drawing, or you can use a canvas widget RhodiumToad: if you're on windows or mac I have no suggestions to offer fnstudio: RhodiumToad: that's a great tip, excellent, thanks! (and nope, i'm not on win/mac :)) rlb: Hmm, I thought guile always supported (setlocale ... "ISO-8859-1"), but that's not working here anymore with 3.0.4, i.e. I have to specify "en_US.iso88581" or similar... RhodiumToad: the list of valid locales is up to the OS RhodiumToad: locale -a should show them rlb: Yeah, maybe that changed here -- for some reason, I'd thought guile special cased that one. rlb: It'd be handy to have a guaranteed portable "pass through" LC_CTYPE until we really fix the problem. rlb: (if we don't already) rlb: And iirc "C" isn't (really) it, since technically it doesn't guarantee that? *: rlb is talking about arbitrary binary paths again (wrt context) rlb: (so you can write portable apps with guile that won't crash on some paths) daviid: rlb: I think one should always catch the result of setlocale call in an app, and fallback to C, sending a warning to users ... rlb: maybe in the short run, or just exit with an error, but of course in the longer run, we just need to provide a way to handle binary data. i.e. tar can/should always be able to save/restore the correct paths. rlb: no matter what locales are available daviid: hum, is this even possible? but i thought you were talking about a guile app you were developing, that would be available in diff languages ... rlb: I'm talking about writing any general-purpose filesystem-related utility in guile. I imagine we'll eventually want to do something isomorphic with supporting byte-vectors in addition to strings in all the relevant functions like open, mkdir, etc. (i.e. that, or something functionally equivalent). rlb: Or rather, one way to do it is to just change all the relevant functions to take a string or a byte-vector. rlb: But that still leaves questions wrt what functions like readdir should return. rlb: Anyway, I believe it's been discussed, but not settled. I just thought I had a solid work-around with "iso-8859-1", but may have been relying on something that's changed locally or in debian, i.e. it's not special-cased/guaranteed in guile, apparently. leoprikler: Eww, ISO-encoded paths. leoprikler: Doesn't Guile automatically use the same character encoding as your system, which should be equal to the character encoding of your filesystem? Zelphir: Hello :) I have a Scheme SRFI question: Why is `first` in srfi-1 but not `rest`? Zelphir: When I use `first` from srfi-1 and then use `cdr`, it feels a bit uneven. ZelphirKaltstahl: server irc.euirc.net spk121: i tagged a point release of guile-gi Zelphir: (sorry, I wrote in the wrong text input) RhodiumToad: leoprikler: at least on unix-like filesystems, there is no such thing as "the character encoding of your filesystem" RhodiumToad: a filename is a nonempty byte string not containing 0x00 or '/' leoprikler: Well, sure, but filenames are encoded a certain way, usually UTF-8. RhodiumToad: only as a matter of convention leoprikler: If you have a filename that's not UTF-8 and it contains non-ASCII data, tools won't handle that well. RhodiumToad: and if some program expects filenames to be utf-8, there is still no guarantee that other programs will agree RhodiumToad: which tools? RhodiumToad: _sane_ tools will handle it. leoprikler: insane tools such as ls won't display the name you want them to display RhodiumToad: they will display the bytes of the filename. what that means is not up to them ft: Reminds me of my favourite cups bug (https://github.com/apple/cups/issues/2812). Closed wontfix, of course, because it works as designed... stis: manumanumanu: back pain blocks me from doing much now spk121: stis: :-( I know how that is stis: but I play a little with riemann's zeta function for fun manumanumanu: stis: :( That stinks. manumanumanu: the human back is the worst. Zelphir: Back is like cable tangle – There is not a lot you can do against it. rekado: https://elephly.net/downies/guile-studio.png rekado: New version of Guile Studio manumanumanu: rekado: where can I read more? rekado: manumanumanu: https://git.elephly.net/?p=software/guile-studio.git;a=summary and https://git.elephly.net/?p=software/guile-picture-language.git;a=summary rekado: there’s no blog post or anything manumanumanu: thanks! a_v_p: rekado: Wow, looks nice. :-) rekado: the motivation is this problem: a motivated person wants to learn Guile. We tell them to use Emacs for the best experience, because it has Geiser. manumanumanu: "to install guile-studio, just use guix" :P rekado: The motivated person gets confused by Emacs and stops learning Guile because Emacs needs to be learned first rekado: manumanumanu: at some point I’d like to make it work without Guix, but… this is so tedious. rekado: maybe I should just dump a “guix pack” somewhere for download manumanumanu: I understand. I just thought it was funny manumanumanu: not to piss on your hard work. this really looks amazing a_v_p: The more I work in software development, the more I understand that software must be easy to use to be useful for the end users. rekado: (I also updated the picture language and documented more shapes) manumanumanu: I didn't know geiser could do that! rekado: I read in the geiser manual that it supports image display for Racket. Then I read the sources and realized that we could make Guile do the same. rekado: when a value prints as # Geiser will replace it with the actual picture. rekado: that’s all there is to it a_v_p: rekado: Recently I learned (to my surprise) that there is a course based on SICP in our local university (Lobachevsky University). They use Racket in classes. rekado: the picture language is a collection of sxml functions to generate and compose SVG snippets rekado: a_v_p: I think Racket is great for teaching rekado: when I saw the Racket picture language I knew I had to have it for Guile a_v_p: One UNN student asked me to help with a homework, and I used Emacs/GNU Guile in my examples. ;-) rekado: :) a_v_p: Yeah, Racket seems to be more user-friendly. I'd love to see Guile develop in that direction a bit. a_v_p: Thanks for your work on Guile Studio, rekado a_v_p: Guix is cool, but not so many people use it yet; and usually I recommend Ubuntu when a novice asks me what distro they should choose as the first, just because Ubuntu is IMO friendlier for the users than a great deal of other distributions. rekado: I uploaded a relocatable Guix pack: https://elephly.net/downies/guile-studio.20210103.pack.tar.gz rekado: inside is ./bin/guile-studio, which seems to work fine (haven’t tested all that much) Zelphir: guile-studio looks great. If I did not have a working Emacs setup with everything I personally need, I would install it right away and try it. Now if only we could expand macros like in Racket, inside guile-studio ... (or can we?) daviid: spk121: congrat for the guile-gi release! daviid: Aurora_v_kosmose: did you send an email to the guile s/w list maintainer about nomad? Aurora_v_kosmose: daviid: I haven't. Working on other stuff atm. (And I haven't setup my email for this nick yet with Emacs) daviid: sneek: a_v_p nice! this is because gtk3, window do not have an alpha channel, so you have to ask gdk to instantiate and give you sucn a window - but both clutter and gtk4, all window, have a de-facto alpha channel - sneek: Got it. daviid: sneek: later tell a_v_p nice! this is because gtk3, window do not have an alpha channel, so you have to ask gdk to instantiate and give you sucn a window - but both clutter and gtk4, all window, have a de-facto alpha channel - sneek: Got it. daviid: Aurora_v_kosmose: ok, I just sent a message for nomad .. Aurora_v_kosmose: I have to set it up eventually, given I want to actually contribute some things to Guix holri1: is there a library for web scraping? ryanprior: The best web scraping library is still beautiful soup. You can use Python sexpdata library to read s expressions directly from Guile and send them back. Or you could use JSON to serialize or whatever. Aurora_v_kosmose: You could use xmlrpc to have Guile control a Python blob doing the parsing parts. Aurora_v_kosmose: Oh, that was 3 hours ago. wleslie: I don't think beautifulsoup has been worthwhile since python 3. use lxml, which has a typesafe interface, has non-confusing reprs, and uses the native unicode support. Aurora_v_kosmose: I personally use lxml which has very nice css-selector support. Aurora_v_kosmose: elfeed has something similar which could probably be used as the basis for a Guile/CL implementation. Aurora_v_kosmose: "xml-query" wleslie: don't forget to turn off the SSRF features if your network isn't ocap-safe Aurora_v_kosmose: ocap? wleslie: "object-capability" - resources you have authority to access are precisely those you can name. Aurora_v_kosmose: Ah, right that. Aurora_v_kosmose: SSRF features? Aurora_v_kosmose: Though to secure the xmlrpc server, the easiest way would probably be to simply use unix sockets. wleslie: I forget precisely which ones. I guess lxml disables them by default now. basically you could send it a document and get it to load other resources from the parser. Aurora_v_kosmose: Ah... https://owasp.org/www-community/attacks/Server_Side_Request_Forgery https://cheatsheetseries.owasp.org/cheatsheets/XML_Security_Cheat_Sheet.html This sorta thing Aurora_v_kosmose: I don't think those would work if you use the HTML parser included with lxml, would they? wleslie: https://lxml.de/resolvers.html#i-o-access-control-in-xslt Aurora_v_kosmose: https://lxml.de/validation.html This seems to be the option you mean? wleslie: maybe it's specific to xslt wleslie: it's pretty rare to get served an xslt template, I doubt lxml.html would even handle it; but old browsers used to Aurora_v_kosmose: So namespace-away your xml parser and communicate on a unix socket should cover most issues. Aurora_v_kosmose: Still needs explicit consideration though, which is a gotcha. Zelphir: Hi! Is there any comprehensive guide to creating Guix packages? What I mean by "comprehensive": How to write all the required GNU Guile files, how to write your Makefile, how to use auto(tools?), etc, for a pure GNU Guile library. Last time I tried to write one, I hit my non-existing autotools knowledge and gave up again. Zelphir: I sometimes see a git repository and then in that there is some ac files and makefiles, which do not look like manually created. I think that is what autoconf or autotools or how it is called actually does, but I have no idea how to use that. Zelphir: Here is an attempt I made: https://notabug.org/ZelphirKaltstahl/guix-package-manager-tutorials/src/master/make-a-package Zelphir: I've also seen repositories without ac files and only Makefiles. I would like to learn a minimal setup, which enables me to add something as Guix package. RhodiumToad: autoconf is what takes configure.ac and creates configure RhodiumToad: autoconf is horrible, but the alternatives are often worse Aurora_v_kosmose: hah Zelphir: I'd be happy with writing a makefile, that I can understand. Zelphir: For example the recently released shapefile library seems to get by with only a makefile. wleslie: I don't know of a comprehensive autotools primer, but I refer to the diagram on wikipedia a lot wleslie: oh, specifically for a pure guile library, good one stis: Hey guilers! a_v_p: Hello stis sneek: a_v_p, you have 1 message! sneek: a_v_p, daviid says: nice! this is because gtk3, window do not have an alpha channel, so you have to ask gdk to instantiate and give you sucn a window - but both clutter and gtk4, all window, have a de-facto alpha channel - manumanumanu: stis: tjena! manumanumanu: what are you up to? Aurora_v_kosmose: Zelphir: https://www.amazon.com/Autotools-Practioners-Autoconf-Automake-Libtool/dp/1593272065 This is a fairly good primer. Though it requires some effort to obtain. Aurora_v_kosmose: It also requires intent to invest the time in autotools, which you might not feel liek. Zelphir: Oh hey, thank you. Does this explain what is required on the make/autotools/etc. side to make everything fit for a Guix package? Aurora_v_kosmose: Zelphir: Unfortunately no, it's purely autotools centric. Aurora_v_kosmose: It'd give you a pretty good idea of how the tools work together and how to get the result you'd want. Zelphir: Ah right, M4 was another thing in that area of expertise. Zelphir: So many things I do not have a firm grasp of ^^' daviid: Zelphir: https://www.lrde.epita.fr/~adl/autotools.html daviid: we may help you of course, just start by copyiong the files from one of our projects, then ... note that you dongcarl 1t need autotool to package for guix, and pure guile project (no C code/libdependencies), you should may be start usig guile-hall Zelphir: Right, hall was also a thing. daviid: https://www.erikedrosa.com/2017/10/29/guile-projects-with-autotools.html daviid: Zelphir: where is the source code of your project? Zelphir: Thank you people for all the pointers! I think part of the problem before for me was also, that different projects seem to do things differently and I don't know, which way to go, while not knowing the tools well either. (Never used guile-hall for a project yet, seemed intimidating, not yet looked into autotools, at least somewhat looked into GNU Make). Zelphir: The guile-projects-with-autotools link looks interesting. daviid: Zelphir: yes, a good start, it lacks the set-up for the tests and the doc, but you may add those later Zelphir: I found Make quite useful already even at the job as a partial replacement for docker-compose, which I usually want to avoid and replacement for the poor thing that are npm scripts in package.json. Things like that. And this directed acyclic graph structure comes up quite often. daviid: Zelphir: I would not 'just' use make, but ... Zelphir: Lets see how it looks when I get through that tutorial. I like to keep things minimalistic. Not too many tools to rely on etc. Zelphir: Perhaps I'll then be an autotools enthusiast :D daviid: Zelphir: I would read the above guile-projects-with-autotools, then copy the config files from one of our projects, like haunt (test-suite uses srfi-64), g-golf (test-suite uses guile-lib unit-test) ... clean and adapt those to your own projects of course, push and publish, so we can look at it and help ... Zelphir: Have used SRFI-64 before and that is the testing lib I am most familiar with, so haunt then seems like a good point to start with. daviid: Zelphir: perfect daviid: Aurora_v_kosmose, str1ngs - Nomad has been added to the guile-software list dongcarl: daviid: That Autotools Tutorial you linked is a work of art daviid: dongcarl: yes, I agree Zelphir: Bye for now and thanks again! dissoc: is it possible to call a function from a module that wasnt declared with define-public or exported? dissoc: from another module amirouche: you can import it with @@ look it up in the manual dissoc: i must've missed it. thank you. i will take a look tohoyn: sneek: botsnack sneek: :) chrislck_: sneek: happy new year! a_v_p: Good morning, Guilers! I need to create a full-screen window that I can draw on. I suppose that it can be achieved by means of Guile Gnome. I managed to show a GTK window with Guile, but it seems that I should use GDK to make a drawable window. Is there any examples of how to do that? Aurora_v_kosmose: Hm, Guile Gnome docs seem to not be particularly rich in examples. a_v_p: Yes, that's the problem. a_v_p: I read the docs, but there's no examples either. *: Aurora_v_kosmose looked for guile programs using it but failed to find them a_v_p: Well, if I manage to do what I want, it may serve as a Guile Gnome usage example... Aurora_v_kosmose: That would be quite nice to have. a_v_p: Hmm, the last commit in the Guile Gnome repository was more than 3 years ago. a_v_p: Too bad. What is the official way of making GUI in GNU Guile now? a_v_p: I found some examples in Guile Gnome repository: https://git.savannah.gnu.org/cgit/guile-gnome.git/tree/gtk/examples Aurora_v_kosmose: There doesn't seem to be much up to date. Aurora_v_kosmose: This is an unfortunate state of GUI stuff wleslie: guile-gi is the gnome prefered way wleslie: oh and guile-clutter wleslie: daviid: you've got some new guile-gnome release recently? a_v_p: wleslie: Okay, I try it. But there's no Guile-Gi in the Ubuntu 20.04 repository yet. ManDay: https://www.gnu.org/software/guile/manual/html_node/Pipes.html doesn't seem to mention what open-pipe returns (only visible in the example) or what am I missing? Aurora_v_kosmose: ManDay: It mentions it as the output of the currently-shadowed current-(input|output)-port ManDay: I don't understand what you mean. Which line are you referring to? Aurora_v_kosmose: "For an input pipe, the child’s standard output is the pipe and [...]" ManDay: At least to me that doesn't make it immediately clear that open-input-pipe returns a port. Aurora_v_kosmose: Ah, nvm, I got the question wrong. Aurora_v_kosmose: It returns a pipe handle. Aurora_v_kosmose: Well, handle/port ManDay: Given that there is no mention of "handle" on the page, I still think it's not documented. Aurora_v_kosmose: close-port’ (*note Ports::) can close a pipe, but it doesn’t reap the child process. ManDay: (at least not that I can see) Aurora_v_kosmose: ManDay: In your repl, run (use-modules (ice-9 popen)) (let ((b (open-pipe "ls" OPEN_READ))) (display (port b)) (newline) b) Aurora_v_kosmose: The page isn't very well documented, but the close-pipe procedure clarifies it closes a port. (And doesn't directly manage the process) Aurora_v_kosmose: *does wait out the process ManDay: Yes, I know ManDay: I only came here to ask whether there is some logic to the documentation which I missed or whether it's indeed unclear that it returns a port. Aurora_v_kosmose: It's an awkwardly written documentation page. *: Aurora_v_kosmose accidentally'd a ? after that (port a_v_p: Hmm, I tried to build Guile-Gi on Ubuntu GNU/Linux 20.04 and './configure' fails with "No package 'gobject-introspection-1.0' found" error. a_v_p: I have 'gobject-introspection' installed. a_v_p: It seems that stepped on a recursive path of solving problems to solve problems. a_v_p: Basically I want to build an application in GNU Guile, that shows a semi-transparent window upon all other windows and allows me to track button clicks and movements. a_v_p: At least Guile Gnome is present in the official Ubuntu repository so it means less problems for the end users. daviid: a_v_p: you should consider using g-golf or guile-gi for new development on/using the gnome platform daviid: sorry to be a bit late in the party but ... both guile-gi and g-golf are on guix, and there is a g-golf debian package here - http://www.tohoyn.fi/g-golf-debian/ daviid: wleslie: i won't release guile-gnome[clutter] anymore - you can use clutter from g-golf daviid: fwiw, here is how one creates a clutter stage in g-golf - https://paste.gnome.org/pu1fvm0q3 - note that it comes (is displayed) without window decorations, to get window decoration one need to declare an environment variable, which I forgot the name of ... a_v_p: daviid: In my case I want to make sure that a user can use my application with a minimally possible burden. So Guile Gnome still can be a better choice, given that it can be readily installed through the official repositories. leoprikler: Dunno, being limited to Gtk2 and olde versions of Guile is very much a burden. daviid: a_v_p: using guile-gnome is the last thing you want to do, you will have been warned - not only is it being removed from debian, other distro will follow, but you will be programming using a 20y old (more then 15y out dated) system, while you have g-golf and guile-gi, ready to let you work in gtk4 as well ... usig guile-gnome is total heresy daviid: leoprikler: not only that, it actually binds gtk 2.16 ... daviid: or 2.10, GLib 2.16, Gtk 2.10 leoprikler: sounds like necromancy a_v_p: Okay, I see -- thanks for the warning. I'll do my best to use Guile-Gi (or G-Golf) for my project later. Currently I want to make a proof-of-concept and I made some progress with Guile Gnome. daviid: a_v_p: ok, note that both guile-gi and g-golf are in guix, by the time you have a well designed/working/tested app, i bet they will be in debian as well - there is g-golf debian package available already - and meanwhile, you can use guix pack to provide a ready to be used 'package' with your app daviid: in the example above, if you want clutter win decoration, add export CLUTTER_BACKEND=x11 a_v_p: Nevertheless, it would be nice to have Guile-Gi in the Ubuntu repository! I guess many of us maintain GNU Guile projects just-for-fun so all I can do is politely ask the Guile-Gi/G-Golf maintainers to add my wish somewhere to your TODO list. ;-) mwette: a_v_p: not sure what you application is but xev will capture all events in a window mwette: s/you/your/ a_v_p: I want to make a GNU Guile application that allows a user to select an area on a screen with the mouse and record everything inside to a file with FFmpeg. a_v_p: Akin to the Shift+PrintScreen behavior in Ubuntu, only for video instead. a_v_p: I already can record a selected window with the application. leoprikler: Doesn't GNOME already come with a screen recorder? daviid: a_v_p: i am the g-golf author and maintainer, feel free to ping me (which doesn't mean I can answer/statisfy any request, but I'll try ...) there is a debian package already, and it will be updated and very well maintained but being in the official debian repo will take a lot more time, and that doesn't depend on me (at all) a_v_p: leoprikler: Usually I use SimpleScreenRecorder -- it's great, but one need to perform recorder configuration each time and it can be a bit cumbersome I think. daviid: a_v_p: I did ask the gnome team for some pointer on how to acheive your goal, here is what they answered: "They will need to get the RGBA visual: https://developer.gnome.org/gdk3/stable/GdkScreen.html#gdk-screen-get-rgba-visual and set it on the GtkWindow: https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-set-visual" daviid: "... Then they can use a transparent background, or set the opacity of the window Of courswe, they'll need to either use Wayland, or use a compositing window manager under X11" a_v_p: daviid: Thanks! daviid: welcome daviid: a_v_p: fwiw, here is a transparent clutter stage example using g-golf - https://paste.gnome.org/pzo7xhvil daviid: paste link valid one day only ... daviid: it only works if you do _not_ set CLUTTER_BACKEND=x11 a_v_p: daviid: Copied the code, thanks. Aurora_v_kosmose: We should probably setup something like Cliki for Guile, because it's become quite obvious that this page (https://www.gnu.org/software/guile/libraries/) isn't sufficiently updatable. Some "awesome guile" listing would also work, I suppose. daviid: sneek: guile-software sneek: Someone once said guile-software is http://sph.mn/foreign/guile-software.html daviid: Aurora_v_kosmose: ^^ Aurora_v_kosmose: daviid: Oh nice, that's definitely more up-to-date. daviid: it is up-to-date, I email the mainainer every time i find a new project daviid: need to email the recent guile-shape project Aurora_v_kosmose: Seems like email is the only option indeed, the git submodule with the repo's content seems to be a private repo. Aurora_v_kosmose: daviid: You might also want to mention Nomad Aurora_v_kosmose: https://www.nongnu.org/nomad/ daviid: Aurora_v_kosmose: feel free to send emails to the author - sph dot posteo dot eu - just sent one for guile-zstd and guile-shapefile - i thought nomad was there alreasy ... rekado: I find layout configuration in Emacs to be really difficult. rekado: Guile Studio now tries to provide better defaults, but I’d really like to reserve Emacs windows for certain files. rekado: there’s a package called Purpose, but making it work with side windows and display-buffer-alist is tricky. rekado: I’d be happy to hear your comments on the latest version of Guile Studio rekado: I’m not sure I’ll keep the toolbar; maybe it’s better to move the contents to the mode line. terpri: i'm pretty sure someone updated scwm since 2000... terpri: sph.mn's list is cc-nc-sa so not a good starting point for licensing reasons :( it's a good list contentwise though terpri: neat, someone's working on guile-scsh rlb: RhodiumToad: I spent a little time toying with syntax-parameterize after your suggestion, and it turns out it's *almost* viable for the purpose, but (I think) the limitation is that syntax-parameters have to (always) be bound at the top-level to work, so you can't (define recur #f) and then still have (loop [x 5] (when (pos? x) (recur (dec x)))) still work rlb: i.e. recur should only exist within the loop form. rlb: (and when it does, should always start off as the special syntax (but can be shadowed afterward) rlb: ) rlb: In any case, thanks for the suggestion -- it's otherwise cleaner, and possibly more "correct". a_v_p: So finally I managed to implement what I wanted. Here's the project: https://gitlab.com/gkaz/finger-frame a_v_p: For now it records 5s as video everything that is inside a selected window/area on the screen. a_v_p: The most trickiest part for me was to implement a simple graphic top-level semi-transparent window for sure. a_v_p: The goal is to make the screen recording as simple as "hit a hot key and select a window or a region on the screen, hit another hot key to stop the recording." rekado: hugo: you can see the commit here: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=e47a5711f0734d96238fb873288d4158b9030f00 rekado: and this is with context: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile-xyz.scm#n4270 *: spk121 is only 31 test-suite failures away from having a minimally function MinGW Guile 3.0.4 chrislck_: spk121: \o/ \o/ \o/ Aurora_v_kosmose: Thanks again for dumb-jump. Awfully helpful. tohoyn: sneek: botsnack sneek: :) amirouche: hello, is there a way to decompress .gz on the fly using guile? RhodiumToad: other than running gzip -dc with a pipe? RhodiumToad: you could probably load libz via the ffi and call it... amirouche: I think I was looking for https://notabug.org/guile-zlib/guile-zlib amirouche: libz and zlib are the same, no? amirouche: RhodiumToad: I would like to avoid that :) RhodiumToad: if someone has already done a binding then that's probably easiest. jonsger: amirouche: If you want to go fast, have a look at https://notabug.org/guile-zstd/guile-zstd amirouche: jonsger: thanks for mentioning zstd, I am wondering where do you use it? guix does use zstd? amirouche: zstd is used in guix publish and guix substitute: https://issues.guix.gnu.org/45460 Aurora_v_kosmose: https://guix.gnu.org/blog/2019/substitutes-are-now-available-as-lzip/ There's also this nice little format. Aurora_v_kosmose: Oh wow, 4 days ago? That's recent. rekado: Guile Studio finally has a reasonable definition of display-buffer-alist, so the layout is more predictable. rlb: Anyone know what the FUNC_NAME was meant to be for scm_i_has_source_properties in srcprop.c? i.e. it's currently "%set-source-properties" but that looks like a typo (and is a duplicate with the function below it). I'd guess maybe it was supposed to be "%has-source-properties?". tohoyn: sneek: botsnack sneek: :) fnstudio: hi! (map + list-a list-b) works with lists, but the same approach fails for pairs (as far as i can tell) fnstudio: eg this returns an error: (map + (cons 0 0) (cons 1 1)) fnstudio: as it says it expects lists as input fnstudio: not pairs fnstudio: of course i can be a tad more verbose and do things manually here, eg (cons (+ (car cons-a) (car cons-b)) ...) fnstudio: but i was wondering if there's a cleaner way of doing this chrislck: cleaner way to do what? chrislck: you want the result to be (cons 1 1) ?? fnstudio: yep chrislck that'd be ideal chrislck: your manual method is the best fnstudio: chrislck, oh great, thanks fnstudio: it did feel pretty simple and easy to read, but good to have confirmation tohoyn: sneek: botsnack sneek: :) tohoyn: fnstudio: (define (pair-map fn p1 p2) (cons (fn (car p1) (car p2)) (fn (cdr p1) (cdr p2)))) fnstudio: tohoyn: oh that looks even prettier and more sleek - although in my case i need it just once, so it may not be worth the extra abstraction fnstudio: but thanks for mentioning that! rekado: here’s another implementation for an arbitrary number of pairs: rekado: (define (pmap f . pairs) (match pairs (((first second) ...) (cons (apply f first) (apply f second))))) chrislck: (let lp ((pairs pairs) (kars 0) (kdrs 0)) fnstudio: rekado: uh, that's very clever, thanks - it's now saved in my useful snippets toolbox chrislck: (match pairs chrislck: (() (cons kars kdrs)) chrislck: (((kar . kdr) . rest) (lp rest (+ kars kar) (+ kdrs kdr))))) fnstudio: is there a "best-practice" way to compute min and max of a list in one go, without having to scroll through it twice? fnstudio: i think i'd know how to implement it with a simple procedure fnstudio: but i'm wondering if there's a standard way of doing this fnstudio: what i mean is to get (apply min lst) and (apply max lst) in one go Zelphir: Probably a list eater, which carries 2 extra values, one for the max and one for the min, as arguments to the recursive call, plus of course the list or rest of the list .you still need to go through Zelphir: Perhaps not using apply min or apply max. Zelphir: You might need to go through the list in a recursive function, keeping track of min and max. fnstudio: Zelphir: that makes sense, thanks, very helpful Zelphir: But don't take this as law, I am just guessing :D fnstudio: Zelphir: yes i also thought of a "manual"/from-scratch approach based on a list-eater Zelphir: Perhaps one can abstract from that and make a more general, high-order thing out of it. fnstudio: yeah, that's also a good point, thanks Zelphir: To which one then gives min and max as procedures and it will accumulate for each given procedure or something. fnstudio: i suppose my concern here is a combination of computational complexity (to try and avoid extra loops) and code readability (to keep the code as "conventional" as possible, therefore easier to understand) Zelphir: You could use apply with a procedure, which tracks both, I think, and accumulates both. Zelphir: You could use fold with a procedure, which tracks both, I think, and accumulates both. Zelphir: *corrected. fnstudio: Zelphir: ah fold... right, let me have a look - thanks RhodiumToad: (fold (lambda (e m) (cons (min e (car m)) (max e (cdr m)))) (cons +inf.0 -inf.0) '(40 30 20 10)) RhodiumToad: though that loses exactness RhodiumToad: (fold (lambda (e m) (if m (cons (min e (car m)) (max e (cdr m))) (cons e e))) #f '(40 30 20 10)) fnstudio: RhodiumToad: v clever - and good exercise for me to digest it Zelphir: Does it lose exactness? Zelphir: I was just about to post the same code with different names for the bindings ^^ Zelphir: (fold (λ (num accumulated) Zelphir: (cons (min num (car accumulated)) Zelphir: (max num (cdr accumulated)))) Zelphir: ;; initially +inf as min, so that any number will be lower Zelphir: ;; initially -inf as max, so that any number will be higher Zelphir: (cons +inf.0 -inf.0) Zelphir: '(1 -2 9 -3 4 0.2 -3247.2)) RhodiumToad: it looks like e.g. (max exact inexact) returns an inexact result, which may or may not be desirable Zelphir: Ah I see! In my example it would give 9.0 instead of 9. Zelphir: OK, I guess one could add some additional logic to handle that and compare with < and >. RhodiumToad: the second version I gave is exact if all values in the list are exact and inexact otherwise RhodiumToad: also it might make sense to avoid consing if the list might be large Zelphir: Try the second version with input: '(40 30 20 10 0.9 -8.1 123 342.1 -434.2) Zelphir: Result: (-434.2 . 1000.0) Zelphir: I think you need to do something like the following: Zelphir: (fold (λ (num accumulated) Zelphir: (let ([prev-min (car accumulated)] Zelphir: [prev-max (cdr accumulated)]) Zelphir: (cons (if (< num prev-min) num prev-min) Zelphir: (if (> num prev-max) num prev-max)))) Zelphir: ;; initially +inf as min, so that any number will be lower Zelphir: ;; initially -inf as max, so that any number will be higher Zelphir: (cons +inf.0 -inf.0) Zelphir: '(1 -2 9 -3 4 0.2 -3247.2)) Zelphir: The inexactness can stem from the input itself as well, as from the +inf.0 and -inf.0. RhodiumToad: I did just say that :-) RhodiumToad: "the second version I gave is exact if all values in the list are exact and inexact otherwise" Zelphir: Oh, sorry, overlooked that^^' Zelphir: Was a bit distracted. :D Zelphir: So many possibilities and nuances already for this procedure! hugo: Hi! I just released my library for parsing shapefiles with Guile. Check it out! https://github.com/HugoNikanor/guile-shapefile rekado: hugo: it’s available in Guix now (with commit e47a5711f0) hugo: rekado: Nice! How do I view it...? laikq: Ahoj! Does someone know if guile has self-documenting capabilities? I've seen `(define (...) "Documentation string!" ...)` being used, but is there a way to extract the documentation string? surpador: laikq: you can use `,d PROC` at the repl or (procedure-documentation PROC) in code surpador: ,d is short for ,describe. Not sure if there's other ways, others might know! laikq: Wonderful! surpador: The module (ice-9 ls) doesn't seem to be documented in the reference manual- is it documented anywhere yet besides the source? Looking at the code for the `ls` procedure, but I can't seem to figure out how to invoke it correctly. It seems like it gives a list of names defined in a given module, which seems like it would be really useful at the repl, but calling it as e.g. (ls '(ice-9 popen)) doesn't seem to work. Aurora_v_kosmose: ArneBab: Do you tend to use dumb-jump with geiser? Aurora_v_kosmose: Oh, it has a minor-mode to help with conflicts, that'd work. chrislck: any one knows magic to dump all available modules? Aurora_v_kosmose: chrislck: You'd probably have to tap into whatever whatever functions & packages guile uses to search your load path. Aurora_v_kosmose: Anyone knows what feature guile-fibers required that wasn't available in earlier versions? Aurora_v_kosmose: https://www.gnu.org/software/guile/news/gnu-guile-217-released.html Ah, non-buggy migration of coroutines between threads. Aurora_v_kosmose: Probably fluid-ref* too, given what it seems to do. surpador: chrislck: Not sure if there's an official way to do it but here's a janky way using (ice-9 ftw): https://paste.debian.net/1178674 RhodiumToad: rlb: isn't that kind of thing one of the examples of syntax parameters? rlb: hah, maybe? I fixed the immediate issue, but I forgot about that. Thanks, I'll refresh. tohoyn: sneek: botsnack sneek: :) tohoyn: is anybody going to do something with the following bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45131 tohoyn: just made "git pull" in guile subdirectory. the bug still exists. leoprikler: tohoyn: in 63:11 why is language #f? tohoyn: leoprikler: I don't know leoprikler: try inserting (peek 'compute-compiler from to optimization-level warning-level opts) in system/base/compile.scm (compute-compiler) leoprikler: should be line 251 in the release source, dunno if something changed since tohoyn: leoprikler: see https://paste.debian.net/1178731/ for the output leoprikler: chotto matte, network being quite slow today leoprikler: interesting, so tree-il is resolved to a language, but bytecode is resolved to #f leoprikler: for reference, what'd be the trace if you compiled scheme to bytecode in one go? tohoyn: leoprikler: you mean from scheme to bytecode? leoprikler: yep leoprikler: currently stuck at BOOTSTRAP GUILEC ice-9/psyntax-pp.go, so it'll take some time before I can experiment on my own tohoyn: here: https://paste.debian.net/1178733/ manumanumanu: Ahoy people emacsen: manumanumanu, hola spk121: I wonder collectively how many days my computer has spent compiling psyntax-pp chrislck: it's a strange state of affairs when C is slower than guile oni-on-ion: eh. ffi and whatever else in beween ryanprior: Y'all how do I accomplish a negative lookahead in Guile regex? I want a pattern that matches any string not ending in ".v" ryanprior: I tried ".*(?org-converting SRFIs² on-demand). ¹: https://github.com/alphapapa/org-rifle ²: https://srfi.schemers.org/srfi.tgz rekado: somebody didn’t check if a project with a certain name already existed: https://github.com/adam-mcdaniel/wisp justin_smith: if there's one thing a programmer loves, it's being the nth+1 person to make the same joke ane: is there a way to force some guile code enter the debugger we see in the repl? leoprikler: ane: what exactly do you mean by that? You can trigger the debugger by throwing an exception etc. but what are you trying to accomplish? ane: well, something like (break) ane: instead of having to call some code that's guaranteed to go boom rlb: Imagine this might be intentional, but when trying to write some syntaxes that introduced some recursive bindings, noticed that #nil has no syntax, i.e. (syntax 5) is fine but (syntax #nil) crashes. Is that intentional? rlb: This complicates things when (for example) trying to get the first form from a "body" to use via say (datum->syntax (car body) 'foo). i.e. that works unless the body was (#nil ...). leoprikler: ane: No direct solution, but have a look at (system vm traps) leoprikler: rlb: depending on what you work with, that might very well be. leoprikler: I suppose #nil is undefined outside of the Emacs bindings. rlb: Wonder if it'd be reasonable for it to behave like "everything else" there... leoprikler: what'd be "everything else" in this case? leoprikler: would "#(1 2 3)" be acceptable in that position? leoprikler: what about other custom reader syntax? leoprikler: I think you might be able to add #nil as a special case in the usally empty arglist after syntax-{case,rules} leoprikler: e.g. (syntax-rules (=> #nil) (...)) rlb: I just meant that if (syntax #f) is valid, then perhaps (syntax #nil could be too). rlb: For what it's worth, the broader context was trying to figure out how to introduce an unhygenic binding for say 'foo to an arbitrary "exp ..." matched set of "body" expressions. rlb: i.e. foo should be in scope for those forms, and nothing else. leoprikler: An anaphoric macro? rlb: (and just randomly, this was in a context where #nil might appear, so I noticed, when #nil ended up being the thing pulled out of the body for the (datum->syntax ... 'foo) call. rlb: ) rlb: "noticed the issue" rlb: yes, i.e. "break" for a loop, or... RhodiumToad: was there a good reason for the unhygenic binding, rather than a hygenic one or a syntax parameter? leoprikler: And the issue is specifically with #nil? leoprikler: In my personal experience, getting such macros to properly expand in the first place is not a trivial task. rlb: leoprikler: the problem was that given that "exp ..." body I was trying to use something from that body as the context/template argument for datum->syntax in order to establish the 'foo with the right scope. That works fine if you grab a symbol, etc. but nil crashes datum->syntax because it's not (and can't be) a syntax. rlb: But I suspect my approach may not be entirely sound to begin with. leoprikler: yeah, that sounds like an ugly hack rlb: I guess the fundamental question I had is, given an "arbitrary" syntax object, can I introduce a binding that's visible to everything in the object (i.e. wrap it in a let(rec) for that unhygenic binding, and if so, how -- i.e. where do I get a suitable context for datum->syntax. rlb: RhodiumToad: as an example, imagine trying to implement clojure's loop syntax: https://clojure.org/reference/special_forms#loop rlb: It's a much weaker form of our "let loop" rlb: and one where the only name available is 'recur rlb: (loop [n 0] (while (pos? n) (recur (dec n)))) rlb: oops :) [n 10] leoprikler: hmm, a compiler from clojure to tree-il daviid: ruffni: here it failed with a 1020 error (iirc - I run tor with a few extensions, no-script did block one or more script(s) on that page ... I had to restart tor since and now it worked - no idea why, but debian and gnome are much better services, no script, no tracking, no none free js ... and, last but not least, they have a 'scheme' language renderer ... daviid: ruffni: anyway, others did help i see ... daviid: ruffni: the snipset you pasted is incomplete, your code already triggers error compiing, then you do not shoe the class intantiation, nor the method call, and did not pste the error either .. :):) spk121: civodul: what's the best strategy for making patches to Guile happen these days? daviid: ruffni: to much to guess :) - no pun, but I kindely invite you to write complete, smallest possible 'self contained' examples, so one can copy/paste(drop in a tmp file, compile/execute and reproduce the error ... daviid: ruffni: fwiw here is goops tutorial - https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ daviid: sneek: goops? daviid: sneek: goops-tutorial? sneek: Someone once said goops-tutorial is https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ daviid: ruffni: fwiw as well :), gauche (scheme), which also implements a (large) subset of the clos protocol (also based on stklos, like guile), precisly uses a <2d-point> and <2d-vector> classes for its introduction manual - http://practical-scheme.net/gauche/man/gauche-refe/Introduction-to-the-object-system.html#Introduction-to-the-object-system (the syntax used by gauche, is (sometimes) a bit different, but you should be able to easily daviid: adapt, ask for help otherwise ...) tohoyn: sneek: botsnack sneek: :) fnstudio: hi :) if created with make-vector or vector-copy, a vector seems to be modifiable at a later stage; if created with `#(0 1 2 ...)` however, it seems it can't be modified? fnstudio: i've tested this with vector-move-left!, for example fnstudio: if i try to "move-left" onto a #()-created vector, i get "Wrong type (expecting mutable vector)" fnstudio: things seem to work as expected (as *i* expected :)), if trying with a "make-vector-created" vector RhodiumToad: yes, literal things constructed by the reader are not supposed to be mutable leoprikler: it should also work if you create your vector using (vector ) leoprikler: but maybe that's just in the interpreter ._. RhodiumToad: that should work too, (vector ...) is like (list ...) in that it returns a new object fnstudio: RhodiumToad: i see, that makes sense (well, not yet completely as i still need to wrap my head around these details, but i think i'll get there) fnstudio: thanks chrislck: '() and #() create immutable objects chrislck: IIRC there are optimization opportunities but I'm likely wrong RhodiumToad: because if they were mutable then it would be weird to have the program scribbling on its own literals fnstudio: chrislck: right, i see fnstudio: there don't seem to be much procedures to search values within a vector, by looking at the docs here https://www.gnu.org/software/guile/manual/html_node/Vector-Accessors.html chrislck: the lack of vector search api means it's probably the wrong data structure to use chrislck: did you read The Little Schemer? RhodiumToad: fnstudio: srfi-43 RhodiumToad: though that doesn't necessarily make it the right data structure. fnstudio: chrislck RhodiumToad: very interesting... yes i was just wondering whether i should use a vector or a list or a hashtable fnstudio: and i thought of trying and familiarising myself with vectors a little bit fnstudio: but i might have chosen the wrong case fnstudio: to be honest, it's for this exercise https://adventofcode.com/2020/day/23 fnstudio: i need a data-structure to handle 10 numbers (actually 0-9) and to modify it and iterate on it fnstudio: i suppose everything would do, as it doesn't seem to be a very resource intensive exercise fnstudio: but i wanted to take it as an opportunity to use the most suited structure fnstudio: s/most/best fnstudio: i also thought of a circular list chrislck: for 10 agree any is ok; vector is simplest fnstudio: chrislck RhodiumToad: cool, tx! i'll give it a try with vectors plus SRFI-43 then *: chrislck waits to hear of AOC D24 whereas 10 numbers get upgraded to 10,000 numbers... fnstudio: ROFL fnstudio: that's exactly my feeling when starting this kind of exercises... especially AOC where exercises always come in two parts... i always brace for the intractable part coming in the second half lol surpador: fnstudio: for what it's worth, I did that one with a circular list, and it worked really well surpador: Especially for the second part, you might need the linked list representation :) surpador: Also, any chance you have your solutions posted somewhere? I've been trying to find someone else who's doing them in Guile Scheme to conpare solutions with fnstudio: surpador: i'm very much a beginner but i'd be very glad to share them with you and exchange some feedback/ideas fnstudio: surpador: if you tend to hang out here pretty regularly i could send you a follow up / DM you once i've put them somewhere online surpador: fnstudio: that sounds great! Yep, I'm on here pretty regularly just lurking :) surpador: My code is up here if you want to compare for anything you've already done: https://github.com/jakeleporte/advent-of-code-2020/ surpador: I'm just learning too so should be useful for both of us! fnstudio: surpador: excellent, thanks! i'll try and put things online asap fnstudio: i don't seem to be able to find min / max "built-in" procedures fnstudio: i suppose it's therefore a matter of sorting + car? fnstudio: am i missing something? RhodiumToad: (max ...) and (min ...) work at least for numbers, I think? fnstudio: ok, then i must have done something wrong... hm fnstudio: apply... i guess :) surpador: Yeah, should be like (apply max list) I think RhodiumToad: won't work for circular lists obviously. fnstudio: RhodiumToad: sure, thanks for mentioning that - luckily it was for another part of the exercise fnstudio: is there any substantial differnece between take (from SRFI-1) and list-head, or is it just the name? civodul: fnstudio: it's just the name, and also 'list-head' is implemented in C so it might be slightly slower fnstudio: civodul: fantastic, thanks! fnstudio: hi, i need a 2d matrix, which i understand i can implement using an array; there are a couple of things, however, eg filtering, that don't seem to be provided fnstudio: am i missing anything? is there any addition to the core set of array-related procedures in any SRFI? fnstudio: or maybe everything i need is there (https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Array-Procedures.html) already, it's just me not knowing how to use it RhodiumToad: what kind of filtering? fnstudio: RhodiumToad: the kind of operation you'd do with a filter-map, i think - but i feel i need to think this through more carefully fnstudio: i mean, a filter-map, if it were a list daviid: fnstudio: docs-1.8 ? are you not using a more recent guile version? fnstudio: daviid: yes, i must be on a very recent one, if not the most recent - well spotted, 1.8 must be the result of a web search fnstudio: daviid: i'll double-check on a recent version fnstudio: thanks RhodiumToad: how would a filter-map make sense with a rectangular array? fnstudio: RhodiumToad: not sure, something that returns a list would work in my case i think - however if i use array->list i then miss the indexes fnstudio: array->list forgets the info about the x, y where my values come from RhodiumToad: you want to iterate over the array while knowing the indices, but the result would be a list rather than an array itself? RhodiumToad: (if you want to delete elements from the result, the result won't be an array because in general it would not be rectangular, no?) fnstudio: RhodiumToad: correct re iterating knowing the indices and then getting a list justin_smith: in clojure I would use map-indexed, passes two values two the function mapped over, an index and the item at that index justin_smith: if that doesn't exist in guile I don't think it would be a hard function two write justin_smith: *two values to the function ... daviid: fnstudio: what are the matrix content type? (if homogeneous) daviid: *matrices fnstudio: daviid: ideally a list but an integer could also do fnstudio: justin_smith: thanks, that's true; i thought of asking to make sure there wasn't anything else i was missing (eg thinking that i might be misusing the concept of array in the first place) ruffni: how can i define-method to have the first argument an object of my pre-defined class "point" and take a second argument (chickadee's vec2 type) ? when i (define-method (angle-to (p point) vector)) i get a "No applicable method for (...)" error ruffni: btw chickadee seems amazing and exactly what i was looking for! daviid: ruffni: great! wrt the error, if you paste (debian, gnome or any none tracking, no javascript, tor compliant ...) the class definition, the method definition, and a call together with the full error message ... then we can (maybe) help ruffni: https://dpaste.org/ZLRL ruffni: and here in "Plain Code" format: https://dpaste.org/DExj daviid: ruffni: this is not a tor friendly site, but I'll have to let others help, hopefully someone will shime in, I am too busy at the moment ... tohoyn: ruffni: should you have (define-method (angle-to (p point) (vector vec2)) ? tohoyn: ruffni: is vec2 a goops class? jadzi: Hi, Guilers! I'm playing with (sdl2) and need some help with a problem. Debian 10 machine, same on guile v2 v2.2 v3. Tried both with (sdl2) version 0.5.0 and master branch. (sdl-version) is (2 0 12). I've illustrated the code with an exception backtrace here: https://gist.github.com/denyadzi/29783ddae315e0bd5b2bb31fd135bddb. I want show a piece of image on the window with this code ruffni: daviid: not sure what you mean by "tor friendly", but i created that snipped with torbrowser (and am able to see it with "safest" torbrowser settings)... ruffni: tohoyn: vec2 is defined in chickadee, i think it's a (define-record-type), not a goops class. leoprikler: ruffni: should this be the angle between two points? leoprikler: Either way, I'd suggest you do a match-lambda* leoprikler: (((? point? p) (? vec2? vector)) ) leoprikler: the benefit of match-lambda is, that it also works outside of goops classes leoprikler: that said, your method *should* accept a point + anything, are you sure, that you're passing a point? chrislck: Happy SRFI-111 day!!! ruffni: yes, this is supposed to be the angle between to points, but one is a point as defined by me in a GOOPS class and the other is just a 2-dimensional vector. i'll give match-lambda* a try! ruffni: so GOOPS define-method only works if all the arguments are instances of GOOPS classes? leoprikler: ruffni: nah, you can have inputs of arbitrary type, but idk about type matching record types ruffni: i don't care too much about type matching (as long as the first argument is a point), so define-method would work for me.. but how do i define a method without type-checking the second argument? leoprikler: again, your syntax *should* be correct, it's probably failing to match your point or you have wrong number of arguments leoprikler: debugging define-method is sadly everything but simple leoprikler: you could try (define-method (method . args) (error "wtf?" (map class-of args))) as a catch-all ruffni: thanks! spk121: wingo: I've got a patch to the ports test I'd like to push. https://github.com/spk121/guile/commit/9c886644d05d0d7a052555b7e0bbc067c7e140c7 leoprikler: Speak for the standard library, https://gitlab.com/leoprikler/guile-filesystem has it ;) chrislck: (greet "merry xmas") leoprikler: (gettext "Happy holidays!") sneek: Merry Christmas, Guilers! tohoyn: Debianized version of software library Theme-D-Golf has been released. See http://www.iki.fi/tohoyn/theme-d-golf/. ArneBab: tohoyn: \o/ surpador: Anybody else here been doing Advent of Code? In case anyone else is working on it this year/interested/has Scheme style pointers, here are my Guile Scheme solutions so far: https://github.com/jakeleporte/advent-of-code-2020/ I'm a bit behind but most of them are there! ruffni: u huh.. so is there some kind of graphics library in guile ready for such a thing? daviid: ruffni: as rekado_ mentioned, but here is the link https://elephly.net/posts/2018-09-01-guile-picture-language.html daviid: ruffni: if you need dynamic graphics, you might wana look at Chickadee, https://dthompson.us/projects/chickadee.html daviid: ruffni: or clutter, we have guile-clutter - a bit old but I wrote some examples, here https://www.nongnu.org/grip/learn.html - Grip Clutter Examples - and I should port all those examples using G-Golf, both using the clutter typelib, then using gtk4 (gsk4) - but if anyone beats me, I'd be very happy :):) daviid: ruffni: if you also need image processing, which you may combine with the above, you should consider aiscm and/or guile-cv daviid: ruffni: here is aiscm - http://wedesoft.github.io/aiscm/, here is guile-cv - https://www.gnu.org/software/guile-cv/ tohoyn: sneek: botsnack sneek: :) tohoyn: Hyvää joulua - Merry Christmas! rekado: ruffni: the code for the picture language: https://git.elephly.net/gitweb.cgi?p=software/guile-picture-language.git ruffni: nice! thank you all for those links! i'll look into those libs! mwnaylor: /leave rlb: is there some reason, aside from "no one's gotten to it yet", that we don't have mkdtemp? rlb: civodul: wrt libgc/gnutls - does the current arrangement mean that any other code that uses libgmp will also be potentially broken? If so, I'd think we might want to avoid that since we're intending to be somewhat universally embeddable rlb: Not sure which option that suggests, though -- sounded like mini-gmp was intentionally potentially slow... rlb: (whatever that means) civodul: rlb: mini-gmp would be a reasonable option for Guile *: civodul -> zZz civodul: later! leoprikler: rlb: "intentionally potentially slow", perhaps w.r.t. side channels if TLS is a concern? spk121: if guile pulled allowed minigmp as an option, it would improve its cross-platform portability surpador: Hey, I've been having trouble sending messages to freenode- any chance anyone can see this? lfam: Gotcha surpador surpador: Cool thanks so much! surpador: So, I've been trying to use the procedure `peg-string-compile` from (ice-9 peg), but it turns out that even though it's in the documentation, the procedure isn't exported by (ice-9 peg) or (ice-9 peg string-peg)- does anyone know if that's intentional? lfam: Not sure... hopefully someone else can help! surpador: Sounds good, I'll look through the code a bit more :) daviid: surpador: I don't know the answer either, but mean while, you may refer to unexported bindings from a module using @@, like (@@ (ice-9 peg string-peg) peg-string-compile) - if (ice-9 peg string-peg) is where is it defined, don't use peg, didn't check ... surpador: Ah ok that's super nice, thanks! daviid: surpador: np! you may also want to locally bind it if you use it more then once ... (define %peg-string-compile (@@ (ice-9 peg string-peg) peg-string-compile)) - the % is totally optional of course, I (and others) do that to visually 'mark it' as 'special' so to speak ... surpador: Ok, that makes sense- funny enough, I tried to ask about the meaning of the % a few days ago but I think that message didn't go through either XD surpador: daviid: just to push my luck, any chance you know of a way to evaluate an expression before passing it to a macro? I'm using a macro that is expecting a literal string and I'd like to pass it a variable daviid: surpador: % has more then one 'use case' in guile itself, i do use it in my own code (with caution, not 'everywhere') to somewhat mark the binding as 'special', but it is not a justification fort why and where it is used in guile core surpador: Ah ok, noted daviid: surpador: not sure what you are trying to acheive (wrt your macro quiz, there could be more then one way to interpret what you wrote, i think) can you be a bit more precise, and give an example - what a call would look like, what the transformation should acheive ... surpador: Yep, sorry: I'm trying to use the macro `define-peg-string-patterns` from (ice-9 peg) surpador: The behavior is like this: https://paste.debian.net/1178029 surpador: I'm not sure I entirely understand what's going on, but it looks like the macro is expecting a string literal and not a symbol that evaluates to a string maybe? surpador: And so I guess I'm asking if there's a way to substitute the value of the string variable in before the macro gets expanded daviid: surpador: you'd need to surround the(se) call(s) with another (your own) syntax, which would expand in a proper call daviid: that would acheive the same as `(define-peg-string-patterns ,pat) in a repl surpador: Aaah ok, I think it's working! I totally forgot quasiquote and unquote were things, thanks so much! daviid: welcome! tohoyn: sneek: botsnack sneek: :) cybersyn: hallo "geilers" cybersyn: i am sure this is something you get all the time, but i have found myself caught between guile, gerbil, and racket cybersyn: but really more guile and racket tohoyn: cybersyn: IMHO guiles object system is better cybersyn: the deeper I get into guix (its now my main OS), the more I want to focus on Guile. I really think guix is a beautiful demonstration of the practical elaboration of the concept of freedom, and Guile is obviously a progenitor here cybersyn: but I am also a recovering philosophy of mathematics PhD, and the ease with which Racket allows you to explore deep concepts like type classes or dependent types, while also being a very useful language, is probably the most important thing I could ask for tohoyn: cybersyn: do you mean Typed Racket? tohoyn: IMHO it looks interesting cybersyn: that said, I haven't had any experience with the other Schemes, but it seems like Racket does a great job of streamlining metaprogramming for quick and easy experimentation with difficult concepts. cybersyn: tohoyn: I just mean racket and its ecosystem of languages in general rlb: If you need to define goops methods on an applicable struct type, I see you can (define (class-of (make-an-instance)) and then specialize , but is that the the preferred way? ruffni: leoprikler: i haven't really abstracted at all and am still wondering about the terminology and what should do which job.. has anyone any resources that might help? should i get acquainted with SDL first? ruffni: what's a 'texture', a 'surface' in context of sdl? leoprikler: Ah, sorry, perhaps I jumped a bit too far ahead. ruffni: i've come across (racket based) fluxus and really like it, but am intending to do other stuff than what fluxus is intended for ruffni: np leoprikler: That's a good pointer, what *are* you intending to do? leoprikler: I suppose your interest in Fluxus means you want to use it for some kind of game, right? ruffni: well, not exactly.. i've played with fluxus and really like it! and i think i figured it out to a reasonable degree :) but i had this idea of a very specific kind of drawing application and since i love guile i thought i'd do it with GOOPS and ... probably sdl2 bindings library? the thing is: i have absolutely no experience with graphical stuff in programming (except command line output and ncurses). ruffni: the drawing software should draw lines and fill shapes defined through those lines... nothing too fancy (not even gradients, just solid fills) rekado: ruffni: are you aware of the picture language? rekado: it is a simple language in Guile that allows you to create 2D drawings (as SVGs) rekado: (it’s not meant for dynamic graphics) ArneBab: I created a small commandline->optargs parser, thought you might be interested: (apply hello (parsestrict args)) → https://hg.sr.ht/~arnebab/optargsparse ArneBab: It uses optargs to define commandline arguments ArneBab: There’s no help yet, but that’s something for another day (plan: use (program-arguments-alist hello) dustyweb: cool ArneBab :) ArneBab: thank you :-) iv-so: spk121: turns out I can just remove unwanted test files, lol, even reconfiguring unnecessary civodul: hi! civodul: wingo: stumbled upon a case where our GMP custom allocation functions interfere: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964284#58 civodul: would be curious to hear your thoughts on how to address this! civodul: i can't really think of a short-term workaround and the longer-term solutions that come to mind aren't very nice either RhodiumToad: if A is a library that's intended to be embedded into other programs, and A references B, then it's A's responsibility not to do things to B that would mess up if the host application also uses B ruffni: leoprikler: thanks! i already managed to figure that part out (skimming the docs), but i don't know how to get a "writable surface" or whatever i need to keep a window open and drawable. right now i'm using (render-copy ren (surface->texture ren (load-bmp "hello.bmp"))) to get me starting.. ruffni: (that's from the project page's "hello world") leoprikler: ruffni: that's bad leoprikler: You're allocating a new texture on each render call, which is not something you should do leoprikler: Or perhaps you haven't even abstracted to that level yet? leoprikler: It feels like you're in need of a game loop, that calls your render function at regular intervals first. leoprikler: Writable surfaces are perhaps a thing when doing software rendering; for hardware-accelerated stuff you should set your texture as render target. fnstudio: is there a more compact version of list-index that does this? `(list-index (lambda (x) (equal? x 2)) '(0 1 2))` fnstudio: should have said... a more compact way of using it dsmith: SOoo. looks like SISC is MPL and/or? GPL. But the sarahbot code is under "contrib". Still looking. chrislck: fnstudio: find chrislck: oops list-index if you need the index fnstudio: chrislck: yes, i need the index in this particular case lampilelo: fnstudio: if you want it to be less verbose you could use cut from srfi-26, instead of the lambda you'd have (cut equal? 2 <>) lampilelo: saves you whole 8 characters, wooo leoprikler: lampilelo: it may just be 8 characters, but it saves you the trouble of naming 1 argument! chrislck: (list-index (cut = <> 2) test-list) if you're 100% certain the list has numbers only. fnstudio: lampilelo leoprikler: excellent, that's definitely an improvement, tx *: daviid xross his fingers so that dsmith finds the time to solve, if possible, this bot code 'problem' and publish the bot code ... dsmith: daviid: Looks like the original code is GPL. Currently writing a README and getting ready to put it in git somewhere. daviid: tohoyn: i have nothing special to say, i'm happy you did produce a debian package for g-golf 'in the first place' of course, and I am glad you did find my suggestion to upload it, rather then send it by email, a good suggestion ... daviid: tohoyn: it should help debian users - that are afraid or do not want to src install - to try and possibly really use g-golf ... daviid: tohoyn: I would, however, as I already mentioned in my email to you, explain why you (had to) do that, and add some (extreme) caution notivce , both the debiaj package and g-golf itlsef are still experimental, and explain that g-golf itlsef isnt even released ... daviid: tohoyn: finally, I would not use a date as a debian release package name, but something like g-golf-0.1.0-pre-alpha-1.deb, then g-golf-0.1.0-pre-alpha-2.deb ... till I start to release of course ... my 2c do as you wish of course daviid: sneek: later tell civodul that define-method creates a generic if it does not exist is part of the (clos) protocol, changing that would be a very serious break (in the protocol) - also note that it is an error to redefine a generic, and unfortunately guile did break the protocol wrt that, guile does not raise an exception if one redefines a generic (very unfortunately, I have no idea why it breaks that fundamental part of the protocol) daviid: - the combination of the later with the change you proposed will lead to 'explosive' bugs, I mean bugs that are nearly impossible to debug, imo sneek: Okay. daviid: wingo: I don't believe you when you say are not a goops user :), you even wrote guile-gnome - which is the most advanced piece of goops code 'we have out there', that uses up to details of the mop that only few understand ... it seems to me, but i only had a quick superficial look, that the (language ecmascript function) imports (language ecmascript base) which defines the generic and so the compiler should add the method to that daviid: generic and not raise a warning sneek: Ooo! Look at this: https://gitlab.com/dalepsmith/sneek daviid: wingo: the (language ecmascript array) module import both, and so depending on 'implementation details' (I mean implementation details of the module system in guile, like does it resolve the import first so array only sees one generic, or not ..) ) you might (have to) add #:duplicates (merge-generics replace warn-override-core warn last) - I definetaly would do that, add #:duplicates (merge-generics ...) as a precaution anyway, in daviid: every module that uses goops andnimport other 'goops' modules ... unless there would be a good reason not to (a good reason by someone who so much know what they are doing, like you or a few others on the planet ... everybody else should rely on the protocol and merge generics daviid: wingo: that define-class redefines (merge) class(es) (definitions) is also part of the protocol, fwiw, although I thought guile did break that protocol as well, I never tried that (never had to ...) daviid: dsmith: great, thanks! dsmith: So. I don't really know much about goops and CLOS, but CL and Guile have very different module and naming systems. I suspect that originally goops tried really hard to be as close to CLOS as possible. All these magic redefintions and macros doing things behind your back don't seem very Schemey. dsmith: To me. dsmith: But as I said, I really don't know much here. daviid: dsmith: as I already had the oportunity to say a long time ago, goops is clos, and should not break the protocol, without a very good reason daviid: 'not scheme' is not even a reasom, imo dsmith: There are already differences. Scheme is a lisp-1 and CL is a lisp-2. The namespace in CL is different than the modular system in Guile. dsmith: I need to learn CL. daviid: dsmith: they should be no interference of the module (or package system in CL) and clos/goops - that is described (and explained in detail) in the protocol itself - which is why guile (has to have) 'offers' to merge-generics ... but anyway, it is very 'dangerous' to break that protocol, unless you are so knowledgeagble that you could have been part of the protocol desiogner board daviid: dsmith: those who do not 'like' clos/goops, just have to not use it :) - that is easy enough I think :) dsmith: Yeah, I never had a need. dsmith: Never did "get" the whole OO craze either. daviid: i think that it's like football, politics and religion, use it if you like it, but let's not discuss it - not using clos, for me, is like telling me you'd rather cross the ocean by swimming, cool, i'd rather take a plane ... :) daviid: and I'd rather avoid to 'discuss the protocol' as well, unless you (as in the person who speaks, not you personally) know as much as the protocol designers - otherwise we end-up re explaing the basics, and why it is not 'message passing' (oh my god!), not about encapsulation (oh my god!), not about (module) protection (oh my god!) ... all this is in the protocol, and well explained in tons of papers, the fruit of 20 to 30y of research daviid: and designed by the best s/w engineers the planet has ever had ... tohoyn: daviid: I updated the debian package, see http://tohoyn.fi/g-golf-debian/ tohoyn: daviid: I use versions of the form 0.1.0v- because I'm not sure if dashes are allowed in the upstream package name. leoprikler: daviid: "You know nothing, John Snow. We don't talk about the protocol." feels like a weird excuse tho, imo. leoprikler: Like, I get that similarity to CLOS is a selling point from people, who come from that, but in my personal opinion, integrating well into the language is of a higher priority. leoprikler: s/from people/for people/ leoprikler: And people prefer records over GOOPS features all the time, sadly. tohoyn: are you planning to integrate GOOPS into the Scheme standard? ArneBab: wingo: did you get to update the compiler tasks article? https://wingolog.org/archives/2016/02/04/guile-compiler-tasks ruffni: is there any tutorial for guile sdl2? the example works just fine, but how do i for example set the background to a solid color and draw some lines/rects? i found the according functions, but when i don't render-copy the bitmap it's all black on black.... thankful for any advice i can get! lampilelo: there is an info manual but it's just a reference, not a tutorial Noisytoot: dsmith: The sneek source code contains references to your home directory several times (search for "/home/dsmith"), you should change that, because people are unlikely to have exactly the same files as you do Noisytoot: dsmith: (specifically: "/home/dsmith/.bobotpp/logs/log2.log" at scripts/log2.scm line 7, "/home/dsmith/.bobotpp/scripts" at scripts/sneek line 6, and "/home/dsmith/sarah.db" at scripts/bot/sql.scm line 20) dsmith: Yep. It's just a dump of what I have. *: spk121 wonders why, after bootstrap, (language value spec) is the first to compile leoprikler: ruffni: set-render-draw-color, render-draw-line, render-draw-rect(s) leoprikler: In 0.5 at least leoprikler: 0.6 IIRC simlifies the latter to draw-line and draw-rect(s) while the former becomes set-renderer-draw-color! remby: running at the repl, `(use-modules (ice-9 textual-ports))` errors with `ERROR: no code for module (ice-9 textual-ports)` remby: what am I doing wrong? mwette: remby: what version of guile? does not exist in 2.0 remby: yeah 2.0.14 remby: ok, I see there is also a guile22 remby: in my repos iv-so: Guys, should Guile 3.0.4 work with musl? spk121: iv-so: I don't know if the maintainers have committed to musl as a dedicated target, but, it probably works with musl or is very close to building with musl. The only c libraries I know it gets built with regularly is GNU libc and Cygwin Newlib. iv-so: I built it for musl, but a lot of tests fail iv-so: encoding-escapes, encoding-iso88597, i18n, iconv and some other dsmith: I *think* I tried building 3.0.x with musl on buildroot once. IIRC it didn't work out too well. iv-so: Thanks for the answer. I expected some failures because of musl localeless, but there are just too many. spk121: iv-so: that is to be expected, with regards to the encoding. musl only handles one encoding, which is UTF-8 spk121: latin1 will fail. iso885987 (greek) will fail. Any Guile built with musl just can't do those obscure encodings, because musl can't do them spk121: But the test suite could be improved to mark those SKIP or XFAIL, I guess iv-so: Ok iv-so: I forgot that UTF-8 includes ASCII, but not Latin-1 iv-so: spk121: how can I mark tests as XFAIL? spk121: in the test suite, if a test quits early by (throw 'unresolved) or (throw 'unsupported) or (throw 'xfail), it'll show up as SKIP or XFAIL during make check spk121: I don't know if there is a way to do it without actually modifying the tests, though. Maybe there is. spk121: oops, throwing xfail doesn't work, the other ones do iv-so: It's fine, I will modify them anyway dsmith: So what is the advantage of musl? Small size? mwette: apt info musl says "musl is lightweight, fast, simple, free and [...]" dsmith: Looks like a re-implementation, but aims to be compatible. spk121: dsmith: musl is usually quicker to be standard's compliant. For example, it picked up C11 threads much quicker than other implementations spk121: but in general for most people, no real advantage other than avoiding 'vendor lock in' I guess dsmith: Interesting. https://wiki.musl-libc.org/functional-differences-from-glibc.html civodul: oooh civodul: gnutls uses nettle, which uses gmp civodul: but guile changes gmp's allocation functions to use libgc civodul: crap spk121: civodul: I never got around to trying Guile with minigmp, but, you could make a special build of either nettle or of guile to use minigmp so that they're not stepping on one another ? civodul: yeah sneek: Yey! tohoyn: sneek: botsnack sneek: :) tohoyn: str1ngs: What do you think about the debianized G-Golf? See http://tohoyn.fi/g-golf-debian/index.html. taw10: Make a histogram of the number of times each number has appeared (should fit into memory, 16Gb or so if the full range is seen), then split the density of the histogram into two halves taw10: Sorry, mis-paste! str1ngs: tohoyn: just tested the .deb works perfectly! can we get the source into git? I'm not familiar with debian development. wingo: civodul: regarding warning pass -- getting interesting warnings, e.g. GUILEC language/ecmascript/function.go wingo: language/ecmascript/function.scm:34:0: warning: non-idempotent binding for `pput`. When first loaded, value for `pput` comes from imported binding, but later module-local definition overrides it; any module reload would capture module-local binding rather than import. wingo: a bogus warning in the context of that module, as pput comes from an import, and the expansion of the `define-method' is something like (unless (defined 'pput) (define-generic pput)) or something wingo: but still, an interesting warning. i wonder if we couldn't move that "if" to compile-time wingo: i.e. determine whether we need a local define-generic or not based on the import structure of the module. dunno. goops vs modules, episode LXVIII wingo: maybe we need a goops-specific warning pass wingo: the warning as emitted (in my draft pass) is bogus because the definition doesn't always happen; it's in an if wingo: so i can detect that and avoid the warning in that case. but the goops question stands, i think civodul: wingo: interesting! civodul: catching issues with define-generic is definitely worthwhile civodul: it's a common mistake wingo: more with define-method i guess civodul: oh yes, define-method wingo: i.e. the implicit define-generic in define-method civodul: another approach would be for define-method to not define a generic if it's not already there civodul: yes civodul: but of course that's a breaking change wingo: yeah that's a harder thing to do civodul: perhaps we can do both: have a warning pass, and also start recommending explicit define-generic wingo: i mean, a harder change to manage :) civodul: yeah wingo: honestly i don't know what the right thing is -- i am not really a goops user civodul: me neither :-), but i think explicit is good wingo: we could emit a warning in the pass that causes the implicit define-generic wingo: s/pass/arm of the conditional/ civodul: that would be a run-time warning though, right? civodul: i think we should avoid run-time warnings civodul: because they reach the wrong audience wingo: at the REPL it would be useful, but i guess that's compile-time too wingo: but yeah, *nod* wingo: problem would be in code that is designed to be reloaded wingo: unless we made define-generic expand to (define-once foo (make-generic 'foo)) wingo: rather than just "define" wingo: haha funny, turns out you can have a module (foo) that defines and exports a class , then you can have (bar) using (foo) which also has (define-class ) -- what do you think that does wingo: redefines in (foo) :) wingo: may error if the class isn't redefinable, but still, gnarly gnarly stuff civodul: oh, fun :-) civodul: yeah it's the same kind of issue civodul: you never know if you're referring to the local thing or to some imported thing wingo: maybe we can solve it for generics by issuing compile-time warnings when define-generic is missing and there is no import. wingo: for classes, that define-class can redefine another module's class sounds like a bug to me wingo: hum, with generics there is the whole primitive-generic thing :/ wingo: and extending "raw" procedures wingo: something to think about another day, methinks civodul: :-) Noisytoot: Does anyone know where sneek's source code is? RhodiumToad: iirc it's not published? bandali: iirc dsmith operates it and would know bandali: i seem to recall it being mentioned that sneek was born from http://community.schemewiki.org/?sarahbot dsmith: I finally found this https://github.com/igorhvr/bedlam/tree/master/sisc/sisc-contrib/irc/scheme/sarah dsmith: I munged that to work with guile, bobot++ and sqlite. Need to dig into copyrights and legal stuff. Maybe I do something these next two weeks? Who knows, maybe it can happen. bandali: nice. that would be much appreciated :-) tohoyn: sneek: botsnack sneek: :) lampilelo: can anyone reproduce this? i don't know if it's a bug or if my environment is messing things up: https://dpaste.com/3EK9NY3DR RhodiumToad: what guile version? lampilelo: 3.0.4 RhodiumToad: what I get is an unending stream of "In procedure %readline: readline is not reentrant" RhodiumToad: oh, you expect it to be run non-interactively? lampilelo: no, interactively RhodiumToad: whatever, I can reproduce it at the REPL by using guile -q and omitting the (activate-readline) lampilelo: something's up, definitely, this example should just work, or am i using it wrong? lampilelo: this works for me: https://dpaste.com/7D9BLJCFV RhodiumToad: aha. RhodiumToad: well, I can't see how that could ever have worked RhodiumToad: basically, filename-completion-function is simply not handling the NULL return from rl_filename_completion_function at all lampilelo: yeah, i wasn't sure if it's a bug because it seemed that the completion function wasn't getting called with state set to false at all, and from what i gathered it should on the first call lampilelo: if you manually call (readline-completion-function "" #f) and then call (readline-completion-function "" #t) it works fine, the error appears if the call with #t is the first one RhodiumToad: it doesn't work fine RhodiumToad: keep calling the #t one repeatedly RhodiumToad: it'll iterate through the files in the dir, and then error out after the last one lampilelo: that's because a higher level function should check if the result of the completion function is a string or #f, on #f it should stop iterating, so it's expected behavior lampilelo: an* RhodiumToad: but it never returns #f lampilelo: oooooooohh, you're right, so the lack of the check for NULL is THE bug lampilelo: i lampilelo: i'll test it later and send a patch to bug-guile tohoyn: daviid: any comments about the debianized G-Golf? soda__hobart: what would be the best way to create a SCM list from the contents of a small C array of primitive datatypes, using the C api? soda__hobart: i've looked at the documentation and i'm not quite clear on what to do RhodiumToad: C array of values of some common type, like ints? soda__hobart: yep soda__hobart: maybe like a dozen elements, in most cases soda__hobart: in a few cases, maybe 100 or so RhodiumToad: hm, for a really long array then making a bytevector and converting to a list might be good, but that may be overkill for a dozen soda__hobart: yeah, the bytevector thing was the only thing in the docs that i could find constructors and stuff for soda__hobart: well, i found the C function to create a scm list RhodiumToad: scm_list_n ? soda__hobart: but i got confused by the `lstlst` parameter in the list append function RhodiumToad: honestly for a short list you'd probably just want to cons it up from the end soda__hobart: yeah, i thought of that too soda__hobart: should i do it recursively? RhodiumToad: I'd just iterate soda__hobart: cool RhodiumToad: something like lst = SCM_EOL; for (i = n-1; i >= 0; --i) lst = scm_cons(whatever,lst); soda__hobart: go from the back, yeah soda__hobart: cool, thanks a bunch soda__hobart: yeah, it would have taken me a minute to figure out that SCM_EOL terminator, i appreciate that RhodiumToad: it's in the manual under "General Libguile Concepts" soda__hobart: oh yeah, i have that handy. i'm pretty new at C, so it's a bit much to assimilate at tmes soda__hobart: it seems pretty easy and straightforward on the whole, though. soda__hobart: i like learning C, too, it has taught me a lot about the unix-style systems, like what file descriptors and sockets are, and why EVERYTHING_IS_UPPER_CASE soda__hobart: sweet, it works daviid: yep, 18000 commit in 5y! I 'pre-announced' here (that they would release 4.0 in 10 days - and they did :)) - https://blog.gtk.org/2020/12/16/gtk-4-0/ - the blog image in the annoucement is ... very 'clutter like', it feels like a clutter release :):) (which is perfect, all we need is clutter :):) rlb: hmm, is there a way to "rethrow" an exception caught by catch, preserving the original backtrace? RhodiumToad: with-throw-handler ? tohoyn: Debianized G-Golf has been released. See http://www.iki.fi/tohoyn/g-golf-debian/. jmarciano: which module can process skribe markup on command line, is it skribilo? dsmith-work: Happy Friday, Guilers!! civodul: happy Friday! :-) dsmith-work: Vacation for me next two weeks! Woo! civodul: nice, enjoy! wingo: civodul: idea: wdyt about "load-extension" causing a module to be marked as non-declarative wingo: or causing a warning, perhaps wingo: dunno civodul: wingo: you think extensions typically rely on being able to access the module's top-level bindings? civodul: i don't remember encountering issues of that sort, but i can imagine it happening wingo: dunno, i was thinking about reasoning about top-level bindings; if there are definitions the compiler can't see, it doesn't know if any given reference is a local definition provided by load-extension or something, or an import wingo: context is that i have a rewritten pass that combines macro-use-before-definition and unbound-variable analysis, adding detection for those weird (define old-+ +) (define + -) cases wingo: and it would be nice if it could reason more precisely civodul: oh nice civodul: i see civodul: yeah in a general sense, the compiler doesn't see the big picture when load-extension is used civodul: so it'd be safer to make modules non-declarative in that case mwette: extensions should convert volatile top-level bindings to fluids? mwette: I just upgraded to ubuntu 2.10. Packages include "guile-3.0" and "nyacc". mwette: (guile-3.0.4 and nyacc-1.00.2) civodul: neat rlb: RhodiumToad: ahh, thanks. I'll take a look. ArneBab: manumanumanu: nice! tohoyn: sneek: botsnack sneek: :) seeg123: hello, how can i get directory of the current script? This is different from (getcwd) rekado: seeg123: perhaps (current-filename) is what you are looking for? seeg123: ah indeed!~ chrislck: manumanumanu: for-each is ingrained in my muscle memory... chrislck: Happy Thursday, guilers! civodul: :-) dsmith-work: UGT Greetings, Guilers chrislck: if a C snippet allocates eg. SCM scm = scm_list_2 (SCM_BOOL_F, SCM_BOOL_F); how does the bdmgc know when to gc scm? chrislck: there's no let() clause to define the scope chrislck: is there a periodic sweep that somehow mops up all SCM objects, whether allocated in guile or C? RhodiumToad: in that example what's being allocated are cons cells, and those will be freed when there's no reference to them from anywhere that the GC knows about RhodiumToad: scope isn't relevant, anyway RhodiumToad: the GC scans the C stack and registers of all threads, so any C local variable reference to the value will normally stop it from being GC'd chrislck: ah chrislck: thx chrislck: mark-and-sweep civodul: wingo: hi! i stumbled upon this define-syntax-parameter redefinition issue: https://issues.guix.gnu.org/27476#35 civodul: i thought we had fixed it, but apparently not; does that ring a bell? civodul: (there's a workaround in Guix so no rush, but i was considering getting rid of it) wingo: in theory 61a8c9300daeb730fe5094f889bf13241942be84 fixed it wingo: is there still a problem? civodul: no no, i was just wondering whether i could remove the workaround *: civodul tries wingo: cool :) wingo: fixed in theory on 2.2 as well (not sure which release, but after feb) wingo: feb 2019 i mean civodul: wingo: confirmed, it all looks good! wingo: yay fnstudio: hi, suppose i want to create a generic function, say it's called `get-data`, and then i want it to behave differently by means of passing an `import-proc` fnstudio: so that'd be `(define (get-data input import-proc) ...)` fnstudio: can i simply use `import-proc` straightaway in my function definition? "straightaway" as in `(import-proc ...)` fnstudio: or should i instead use something specific... eg `( import-proc ...)` RhodiumToad: normally the first of those fnstudio: RhodiumToad: excellent, thanks RhodiumToad: scheme is a lisp_1, that is symbols have only one value, not separate value and function slots RhodiumToad: the form (func arg1 arg2 ...) evaluates all of its elements the same way, then applies the first value to the remainder RhodiumToad: so you only need constructs like (apply func args) where the number of args is not fixed fnstudio: RhodiumToad: thanks (and it looks very elegant) RhodiumToad: you can even write things like ((lambda (x) ...) arg) ;; but you usually shouldn't fnstudio: ah right, yes, i think i've seen it - at least as an example dsmith-work: ((if (some-predicate) + *) 3 4) => either 7 or 12 depending on (some-predicate) ane: not to mention doing something silly as (let ((+ -)) (+ 1 2 3)) RhodiumToad: all good candidates for "don't do this" dsmith-work: heh jkossen: hello, i'm trying to sort a list of integers. Reading https://www.gnu.org/software/guile/manual/html_node/Sorting.html but what should i put in place of 'less'? joshuaBPMan: Hello guile people! dsmith-work: scheme@(guile-user)> (sort (list 9 1 2 8 3) <) dsmith-work: $1 = (1 2 3 8 9) dsmith-work: jkossen: ^^ dsmith-work: jkossen: See the descripton for sorted? for what "less" looks like. dsmith-work: So dsmith-work: scheme@(guile-user)> (sort (list 9 1 2 8 3) >) dsmith-work: $2 = (9 8 3 2 1) jkossen: Thanks dsmith-work. I did try that, but since it works for this simple list I guess i'm doing something wrong elsewhere... joshuaBPMan: I'm thinking about building a dating web app for 25,000 users or so. (That is I hope to inspire 25,000 people from my city to use it. That's a big IF). jkossen: ah d'oh. thanks dsmith-work, i was indeed looking in the wrong place pinoaffe: I just realized I've always been doing (sort '(3 2 1) <=) rather than (sort '(3 2 1) <), even though the variable name suggests a "less" function pinoaffe: probably because using a less-or-equal is often a more "basic" operation in mathematics dsmith-work: Watch that ' pinoaffe: ? jkossen: Advent of Code day 5 solved. Yay :-P pinoaffe: jkossen: nice! pinoaffe: I've been doing all of them in guile this year jkossen: still feels like i'm talking to aliens when writing scheme though :P jkossen: could have solved 5 a lot easier too. Oh well, it works pinoaffe: I always "cheat" and edit the input manually so it's an s-expression :) jkossen: heh, ok that's one cheat I didn't use. And i didn't peek at tips or other solutions :P jkossen: pinoaffe: you've solved them all up to now? pinoaffe: yeah jkossen: awesome RhodiumToad: pinoaffe: sorting functions usually need < and if written to use < may well explode if you pass a <= function instead dsmith-work: pinoaffe: Using quote in newish Guile makes a constant expression. And so could be read-only. And errors if you try and write. Hmm. dsmith-work: Does sort return a new list? dsmith-work: Well, it doens't yell at me... dsmith-work: Rght. "NeverMind" RhodiumToad: sort is not destructive *: dsmith-work goes back to arguing with nodejs and node-red... dsmith-work: Yeah, sorry for the noise.. jkossen: don't all destructive functions end with a ! ? dsmith-work: Ah, but sort! *does* get angry at a quoted (and so non-mutable) list. dsmith-work: jkossen: If not, they ought to. pinoaffe: RhodiumToad: yeah, so I should probably change my habit :) spk121: oh hey, GTK4 is officially released daviid: fnstudio: fwiw, the best list of guile (none core) libraries and apps is here http://sph.mn/foreign/guile-software.html daviid: fnstudio if par-map and friends do not fulfill your needs you may look at 8sync, fibers and guile-a-sync (which is for guile 2.0, bu but the author page, you'll find versions for 2.2 and 3.0 as well, guile-a-sync2 and guile-a-sync3) dsmith: sneek: botsnack sneek: :) dsmith: goodbot fnstudio: daviid: thanks, great tip re the sph.mn page fnstudio: plenty of interesting links and things to explore str1ngs: daviid: forgive the late reply. I probably only use it with things like key-press-event. I think that is an interface? daviid: fnstudio: welcome! str1ngs: daviid: I would say I use the accessors like (!state event) and (!type event) str1ngs: daviid: str1ngs: np! ok, the thing is :) I need work on g-golf to make it transparently support gdk3/gtk3 or gdk4/gsk4/gtk4 and things radically changed in the way users manage events - the GdkEvent struct hasn't changed much, but everything above that changed radically str1ngs: daviid: understandable. I know things have changed with key events with GTK4 but I have not had time to look at it myself. daviid: str1ngs: these accessors, I added to g-golf to offer some 'sort of' compatibility with guile-gnome, and that some requires some C code, and I am gona have to change that (the C part, the accessors, I think I can manage to still offer them, although in gtk4, likely users won't use them anymore ... we'll see) str1ngs: daviid: okay, I have not been able to work on nomad at all. I was able to get g-golf updated in guix to 0.1.0-839.ef83010. but my farther is ill and I'm more focues on that right now. str1ngs: father* daviid: str1ngs: oh, I am sorry to hear that, I understand of course, np daviid: str1ngs: just to complete the conversation, there are two accessors that depends on C code, ahich are !changed-mask and !new-window-state - these do not exist in gdk4 anymore and since you are my 'only' user, together with tohpoyn, I want to get rid of the C code str1ngs: daviid: if I don't respond via IRC you can use mike.rosset@gmail.com just encase. I will try to work on things early next year probably. str1ngs: daviid: as far as I know I dont use those accessors and if I do I can work around it. so it's safe to break API str1ngs: well don't worry about braking nomad I mean. daviid: str1ngs: ok, i actually don't need you to 'work' - i did assume you were not using those, nor tohoyn - so reallt no big deal - I'll meke these important changes and will inform you, but on your side, it should ask for any change, just test my work by, as usual, run the pull/make/check dans str1ngs: daviid: no worries, by work I meant on nomad and indirectly using g-golf. fnstudio: i was trying to regex-match "test[012]" expressions, while capturing the number 012 in a regex group fnstudio: the matching plus grouping would imply enclosing square and normal parantheses though fnstudio: and that seems not to be very easy with POSIX regex, if i understand it correctly? fnstudio: normally i'd do something along the lines of `test\[([0-9]+)\]` fnstudio: (i guess...) spk121: . srandon111: spk121, ..-.. tohoyn: sneek: botsnack sneek: :) tohoyn: I'm planning to publish some source code in the internet. What platform do you suggest? SourceForge? Gitlab? spk121: github is most popular but free software people avoid it. gitlab seems to be the most popular for free software people. sourceforge has a reputation of being obsolete, but, actually it is getting fixed up. leoprikler: If you want to go full GNU, you can also use Savannah ;) dsmith: Also bitbucket and sr.ht. dsmith: sourceforge was *it* back in the day. Feels very spammy now. tohoyn: is there some wrong with sourceforge as some people don't like it? tohoyn: s/some/something/ leoprikler: I'd start from the top with the layout. leoprikler: Getting to a usable download on Sourceforge always feels like a slog. fnstudio: hi! any built-in procedure to convert an integer to a different base? eg base-2 -> base-16 fnstudio: found it, i think, eg some variation of `(number->string (string->number num 10) 2))` should do it chrislck: sneek: botsnack sneek: :) leoprikler: fnstudio: that's assuming your "number" is a string in its input, but yeah fnstudio: leoprikler: cool, thanks! dsmith-work: Wednesday Greetings, Guilers justin_smith: leoprikler: that's a given, since numbers don't have bases per se, but string representations do manumanumanu: tohoyn: Sourceforge has been trying to clear their reputation for some time now. They were doing some hinky stuff about 5-10 years ago manumanumanu: I do believe they are OK now. I myself pay for sr.ht and am happy. manumanumanu: Ladies and gentlemen, I believe I might be finally entering beta of goof-loop! That concludes my hacking for tonight, if you are interested go check out https://git.sr.ht/~bjoli/goof-loop manumanumanu: good night! remby: I'm working with guile for aoc, but I noticed that if will "die" if the program runs out of resources https://termbin.com/0ozy remby: as it seems I can't have both of those nested loops run togethor remby: oh oops I called exit! :P dsmith-work: That'll do it tohoyn: sneek: botsnack3 tohoyn: . fuukshiit: hello all RhodiumToad: good morning fuukshiit: RhodiumToad, how are you ? RhodiumToad: about average fuukshiit: RhodiumToad, why it's not great? Rovanion: I read in https://guix.gnu.org/manual/en/html_node/Running-Guix-Before-It-Is-Installed.html that I should run ./configure at the root of the main Guix Git repo, but I don't see any in my repo or in the web view of the repo: https://git.savannah.gnu.org/cgit/guix.git/plain/ RhodiumToad: configure files are often not stored in repos, but generated for distributions (I have no idea about guix specifically) RhodiumToad: notice that there _is_ a configure.ac, which would be processed by autoconf to create ./configure Rovanion: Found it, you need to run ./bootstrap and then ./configure. Rovanion: I've got two documentation patches that I want to submit but the only working email client I've got is Gmail. I'm working up to mu4e but that seems far away now. Is it possible to submit patches using Gmail as an email client or is there some other procedure I can use until I get mu4e set up? pinoaffe: Rovanion: It's probably better to use something other than Gmail (an imap client like thunderbird or claws-mail that supports plaintext compose mode should do the trick), but as with any other mail client it should work as long as it sends plaintext mail along with whatever HTML the client makes up and as long as it doesn't automagically break lines for you RhodiumToad: surely even gmail should be able to send a plain-text attachment pinoaffe: yup pinoaffe: I'll have to admit I've sent a couple of mangled patches myself when I didn't use the correct settings in the mail client chrislck: Tuesday Greetings, guilers! dsmith-work: Hey Hi Howdy, Guilers dsmith-work: I know I've seen instructions on using git send-mail wit gmail, but I don't remember where. dsmith-work: Maybe in the uboot or buildroot project documentation? tohoyn: Theme-D-Golf version 0.8.6 has been released: http://tohoyn.fi/theme-d-golf/index.html tohoyn: I changed the example programs to use fnstudio: hi! if i wanted to parallelise some little script i have written in guile, is there any obvious way to go / anything i should have a look at in terms of libraries or tools? fnstudio: the script does some number crunching fnstudio: which i suppose i could parallelise by simply "manually" partitioning the domain fnstudio: or maybe there's some framework/library/tool that is language agnostic (as in "it takes a generic binary as input") and i should look into that leoprikler: fnstudio: the standard library already has some valuable stuff like parallel-map, that might be useful to you leoprikler: other than that, you might want to look into asyncs fnstudio: leoprikler: amazing! very helpful thanks! leoprikler: Oops. it's par-map fnstudio: ah, good, par-map - thanks mwette: there is also futures fnstudio: mwette: i'll look into that as well, thanks chrislck_: you can do it manually nixo_: chrislck_: thanks, I hoped there was something less error prone nixo_: Also, I would need to modify the copy procedure if properties are added with make-object-property chrislck_: you can automate it chrislck_: nixo_ https://pastebin.com/raw/Pxdm1QTG nixo_: chrislck_: thanks a lot! chrislck_: question for experienced guilers: is (apply proc lst1 ... lstn) slow if lstn is a very large list? daviid: chrislck_: it is always difficult to answer these quiz, what is 'very large' in your case ... and, if you are concerned, you should measure (,time ...) and as well, try vectors (using list->vector to start with, but specializing if yu have a type ...) ... and, if you receive lists 'in the first place', you'll have to take into account the transformation time as well of course ... chrislck_: daviid: thx more of a hypothetical question. given eval/apply are the source of all things lisp, I'd think apply should be fast. but not sure whether it does inefficient list traversals internally. daviid: chrislck: you'll rarely need eval, and apply is not slow daviid: apply is nearly as fast a 'direct' procedure call, if that what matters to you daviid: the problem is your proc :), and the size of the lists, of course ... chrislck: thanks, it's about creating habits, writing good code, more than exact performance daviid: chrislck: i know you are working with/upon gnucash, my advice is write clean code, first and above all, very clean, very readable and highly maintanable code, then where you see 'bottleneck', measure and see what/how yu can improve ... chrislck: I remember wingo's report about inefficient string-append vs string-concatenate for instance; this is not obvious reading manual chrislck: (apply string-append list-of-strings) vs (string-concatenate list-of-strings) chrislck: (2nd one was much much faster) (this may be obsolete) chrislck: thx gnucash is already in a much better state than a few years ago daviid: chrislck: ok, but exactly when does the later starts to be faster then the former ... although in that particular case, even the 'write clean code' would suggest to use string-conactenate ... daviid: and yes, it probably is 'obsolate' daviid: chrislck: i know it is in a much better state, contragt and thanks! you've done an impressive work daviid: though i don't use it, i read here and there ... so i did see your work ... daviid: somehow chrislck: lol latest work finally does (use-modules) correctly https://github.com/Gnucash/gnucash/pull/831 daviid: i did read recently about you gor rid of the warnings, use-module ... daviid: ah, cross typing ) chrislck: and I'll shamelessly copy from civodul's fine work at https://github.com/Gnucash/gnucash/pull/836 daviid: chrislck: well done, you may and should shamelessly copy any of free s/w work, especially our maintainer's and other 'advanced' guiler's work of course :) - daviid: I do that to of course, we all do ... daviid: str1ngs: do you use the class and accesors in nomad(g-golf)? daviid: I mean the accessors, the class is instantiated for users whenever an event is propageted ... apteryx: any clues how to prepend a line to a file using Guile? RhodiumToad: write the line to a new file, copy the old file content after it, close new file, rename over old file srandon111: folks, any good book similar to practical common lisp for guile ? leoprikler: sneek later tell srandon111 many people learn Scheme through SICP mwette: sneek: later tell srandon111 search for "The Scheme Programming Language", ; I like that book a lot, available on scheme.com/tspl4 dsmith: sneek! sookablyat: leoprikler, yes i know SICP but it's not similar to practical common lisp at all! leoprikler: tbh I've read neither, so ¯\_(ツ)_/¯ dsmith: sneek: botsnack sneek: :) tohoyn: sneek: botsnack sneek: :) daviid: anyone has a module they maintain in several diff versions? reading the doc, i fail to understand what file name the module should have a_v_p: Hello Guilers! a_v_p: I implemented 'diff' procedure for Metabash that compares two data streams. Here's an usage example: https://github.com/artyom-poptsov/metabash/blob/master/examples/kernel-release-diff.scm daviid: so, i thought i'd have a file named mod-1.scm containing (define-module (mod) #:version (1)), then (use-modules ((mod) #:version (1))) but that fails tohoyn: "cumulative seconds" in statprof output does not work tohoyn: I get cumulative seconds 30000 in a program with total 870 seconds tohoyn: sneek: botsnack daviid: i also tried to create a mod dir, with a 1.scm file in it, but (use-modules ((mod) #:version (1))) equaly fails with "no code for module"(mod) daviid: i fail to understand how to create and maintain several versions of a module - leoprikler: daviid: (define-module (mod) ) => mod.scm leoprikler: for version, you need to put #:version into the define-module RhodiumToad: I think the question is whether it's possible to have multiple versions of a module and let the client module ask for the one it wants RhodiumToad: (to which the answer seems to be no) leoprikler: Well, you can, but you'll have to manipulate load paths in order to do so. leoprikler: also IIRC Guile does not support loading multiple versions of the same library RhodiumToad: I think the answer is if you want different versions of a library with different interfaces, maybe they should be different libraries, possibly re-exporting from a common source RhodiumToad: but my experience is insufficient to know whether that's a good idea tohoyn: sneek: botsnack daviid: leoprikler: RhodiumToad is right, the question was, and it doesn't seem you tried :), since it does not work, to have a module created and maintinaed in diff version - of course the user would load one version only :) daviid: and i was looking for builtt-in functionality, not a hacky hack of mine ... which i can always do of course that was not the question leoprikler: well, the "built-in" functionality would be one based on load paths daviid: I actually missundeertood the purpose and associated functionality of #:version in guile's module system, it is just a number and guile will check that what is defined is >= to what the user ask ... daviid: but it is not a way to acheive what i need leoprikler: guile-gnome once did this, perhaps because the had the grand idea of at some point doing gnome-3, but that turned out to have been a bit too eager daviid: leoprikler: i am a guile-gnome co-maintainer :) - in guile-gnome, it is in the module name daviid: I could do that though, of course leoprikler: for the record, what exactly are you trying to achieve here? leoprikler: btw. version is not only >=, it can also be <= and = leoprikler: just supplying a number will do = IIUC daviid: leoprikler: hum, i'll try and check =, i thought it would always check for >= RhodiumToad: eqv? is the default test according to the docs leoprikler: tbf eqv? is a more reasonable default than >= daviid: it won't work in guile because there can be only one mod def (in memory) with a given name, since the version is a field, not a key to retreive the module def ... daviid: so the only way is to use a diff module name, g-golf, g-golf3, g-golf-3, g-golf4 g-golf-4 ... which is ok i guess, sqlite3 does that to :) daviid: or i can opt not to support gt3/gdk3 as well, since g-golf somehow 'does not really exists out there yet' - RhodiumToad: what would it support then? daviid: gdk4/gsk4/gtk4 leoprikler: GI does not support loading Gtk-4 and Gtk-3 in parallel either, but if you did want to be "future-proof" you could do it like Guile-GI and simply name your modules (g-golf gtk-3) (g-golf gtk-4) etc. leoprikler: As long as you only load those modules on request, everything should be fine daviid: leoprikler: ther are no such gtk-xx module in g-golf daviid: that is not the roblem leoprikler: what's the problem then? daviid: anyway, i will think about it daviid: leoprikler: no bindings on earth can support loading -4 and -3, this is by typelib anf gi desiugn,m it is not a property or a lack of prtoperty of the binding daviid: and fwiw, g-golf is future proof, it already import and runs gdk/gsk/gtk4 ... leoprikler: Exactly, hence why you can translate GI typelibs <=> modules just like that. daviid: what id not future proof is gnome daviid: no, not just like that, but ... leoprikler: wdym? daviid: because :) leoprikler: w(hat) d(o) y(ou) m(ean)? nixo_: Hi! I cannot figure out if there's a way to make a deep copy of a record in guile 3. I thought copy-tree would work, but then changing a field in the copy changes the original chrislck: is there an opposite for (use-modules) ? chrislck: (unuse-module ...)? apteryx: spk121: the one equivalent to ,compile at the REPL I guess apteryx: What's the modern, best practice way to raise an exception in Scheme? apteryx: reading the manual, that'd be raise-exception. apteryx: What are continuing exception handlers typically used for? Report about an error, then let the exception bubble up? I'm a bit puzzled why this mode is the default. It seems more common that an exception handler should abort the error condition. Am I missing something? :-) apteryx: ah, srfi-34 adds more convenient sugar on top of these primitives leoprikler: chrislck: there is no unuse-module, that'd be silly. If you need to overwrite an established binding, you can simply define it, otherwise try to limit your imports with #:select or use #:prefix to rename them leoprikler: apteryx: not sure what exactly you mean, but I believe the default exception handler terminates the program (or lets you backtrace when in REPL) chrislck: leopriker: it's not silly. I want to test some old code which does (use-module ...) want wish to 'reset' the environment from time to time. it's ok there's no need to write the test. rekado: dustyweb: in a new project using webutils I found that delete-session does not reliably delete the session cookie. rekado: I haven’t been able to find a minimal example yet, but I’ll keep trying. tohoyn: sneek: botsnack sneek: :) tohoyn: What do you think about https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45131 dustyweb: rekado: oh, hm dustyweb: yeah that should be fixed pinoaffe: hi folks, could someone take a look at https://lists.gnu.org/archive/html/bug-guile/2020-09/msg00008.html ? RhodiumToad: what about it? RhodiumToad: with-output-to-string isn't supposed to affect subprocess output mwette: I think peeps want something like Python's subprocess module: https://docs.python.org/3/library/subprocess.html mwette: maybe try open-pipe rather than system pinoaffe: RhodiumToad: ok, that makes sense, but it's still counterintuitive imo (I've encountered several others that tried (with-output-to-string (system "blarg"))) fnstudio: hi, i don't seem to be able to use a `case` conditional as my key is not being matched with its value fnstudio: the key is a string RhodiumToad: case uses eqv? for comparison fnstudio: and i can see it correctly contains a string, say "foobar" RhodiumToad: two strings with the same characters which are not the same object are not eqv? fnstudio: RhodiumToad: right, i think i hit this the other day as well fnstudio: ah fnstudio: i see RhodiumToad: basically, for objects that are composed of many parts, only equal? compares the parts for equality fnstudio: ok, fair enough, i got it now - thanks for putting me back on track, i thought i was going crazy fnstudio: :) RhodiumToad: eqv? compares simple values like numbers RhodiumToad: eq? compares only identity of objects fnstudio: RhodiumToad: right, makes sense - hope my brain will eventually digest that :) fnstudio: RhodiumToad: thanks v much fnstudio: ok so it boils down to use `cond` when it comes to string-based keys RhodiumToad: if these are constant strings, you might consider whether they would be better handled as symbols instead chrislck: fnstudio: learn (ice-9 match) fnstudio: hm... interesting fnstudio: chrislck: let me check that RhodiumToad: and yeah, match can handle strings RhodiumToad: but there are many cases where string->symbol and comparison of symbols may be more efficient than doing lots of equal? or string=? on strings fnstudio: (i must admit i ended up using `cond`... lazy me) fnstudio: (but i bookmarked string->symbol and match) tohoyn: sneek: botsnack sneek: Welcome back tohoyn, you have 2 messages! sneek: tohoyn, daviid says: this is a sign that in the 'context' of the execution that triggers these warnings, you are not following the recommendations given in the manual wrt merging generics - sneek: tohoyn, daviid says: I actually added a manual subsection for ths - https://www.gnu.org/software/g-golf/manual/html_node/Configuring-Guile-for-G_002dGolf.html#Configuring-Guile-for-G_002dGolf sneek: :) apteryx: is there a way to expand the parameters of a list in-place; that is, not inside a quasiquote list? apteryx: there's this thing in Guix called 'invoke'. It wants arg1 + arglist, then passes does with it (apply system* arg1 arglist). I'm trying to figure a way to do (invoke arg1 arg2 ... (expand-args %list-of-default-args)). apteryx: s/passes// apteryx: perhaps using apply on it... apteryx: alright, this works: (apply invoke "echo" "a" "b" '("c" "d")) dsmith-work: Happy Friday, Guilers!! RhodiumToad: yo fnstudio: hi, what options do i have if i want to terminate my program in case something unexpected happen, as in "we only got here because of some corrupted input data" fnstudio: something that one would normally handle by throwing an exception i guess RhodiumToad: do you want to terminate regardless of any exception handler? fnstudio: i'm happy for my program/script to simply terminate abruptly fnstudio: RhodiumToad: yeah, a quick and dirty termination would be fine RhodiumToad: in order of increasing dirtiness, maybe (exit), (primitive-exit), (primitive-_exit) ? fnstudio: RhodiumToad: (exit) looks interesting... maybe i should have thought of it? :) RhodiumToad: (quit) and (exit) are the same, and apparently unwind the scheme context first RhodiumToad: whereas (primitive-exit) does not, and (primitive-_exit) does not even flush i/o or run atexit functions lloda: if you never catch #t, then you can just throw a unique exception RhodiumToad: in 3.x, (quit) will be caught by a with-exception-handler RhodiumToad: so for example (let/ec ret (with-exception-handler (lambda (e) (ret 1)) (lambda () (quit))) will just return 1 and not actually quit RhodiumToad: or (with-exception-handler (lambda (e) 1) (lambda () (quit)) #:unwind? #t) euandreh: As I get my hands more and more dirty with Guile, I'm impressed by its documentation rekado: euandreh: I had the same experience, though towards the “weirder” modules the documentation becomes a little sparse. rekado: (e.g. sxml or peg) dsmith-work: "weirder" is usually docs imported from upstream. euandreh: I actually liked the peg, but I was already familiar with peg parsing euandreh: coming from CL, elisp and Clojure I'm enjoying Guile euandreh: the C interop is fantastic spk121: hello guilers. Is there a way to set a hard limit to the maximum memory Guile can allocate? davexunit: piggy backing on spk121's question: what's the best way to get general diagnostic information out of the guile runtime? davexunit: memory usage and stuff like that. would be nice to pull this information into a time series chart to monitor application performance. civodul: spk121: no, there's no way to do that (apart from the OS rlimits) civodul: davexunit: yeah, it would be nice to have a heap profile civodul: *profiler davexunit: agreed. I do a lot of application monitoring at $dayjob and that's pretty crucial stuff. euandreh: autotools question: I have scripts/assert-shellcheck.sh that runs on the repo, but it shouldn't be included in 'make dist'. How can I run it with 'make check' but not on the final dist tarball? euandreh: I expected that the 'check-local' target would not be included in the final dist euandreh: what happens is that 'make distcheck' says doesn't exist, but that is desired euandreh: I wanted a 'check-local-dev-only' target, or something similar leoprikler: euandreh: you could try to use conditionals to simply not expand your check-local when called from make dist-check leoprikler: for instance make it so you have to pass --development-mode to configure for the option to become visible apteryx: hm, in which module is the compile procedure defined? spk121: apteryx: the compile from 'guild compile'? It is actually in 'scripts. module/scripts/compile.scm in the tree. or /usr/share/guile/3.0/scripts/compile.scm in the install chrislck: ok further adventures in warnings: previously we had lots of warnings (unbound-variables) that we've fixed by using modules appropriately. but there were also some (format #f "~d" ...) and macro warnings. these warnings have all disappeared. wingo: moo tohoyn: sneek, botsnack sneek: :) tohoyn: daviid: I get following warnings from g-golf: tohoyn: daviid: WARNING: (g-golf): `!direction' imported from both (g-golf hl-api gobject) and (g-golf hl-api function) tohoyn: daviid: WARNING: (g-golf): `delete' imported from both (srfi srfi-1) and (g-golf hl-api gobject) wingo: the md5 bug is fun wingo: the source has: wingo: (define f-add +) wingo: (define f-ash ash) wingo: (define (+ . args) wingo: (modulo (apply f-add args) #x100000000)) wingo: (define (ash x n) wingo: (modulo (f-ash x n) #x100000000)) wingo: you can't even compile the file twice, because the second time you compile it, + has the new definition :P weinholt: peculiar wingo: cons that one onto "the top-level is hopeless" :) wingo: could probably write a warning pass to detect (define A B) (define B ...) weinholt: there is something for that in "fixing letrec" wingo: yeah but top-level definitions aren't currently always treated as the top-level letrec* expansion wingo: if we were sure to give something like the r6rs program semantics then it would be clearer wingo: dunno civodul: wingo: that reminds me of https://issues.guix.gnu.org/39251 civodul: might be the same issue? wingo: civodul: it's very similar! wingo: however even at -O0 you can't compile the file twice wingo: i.e. do (compile-and-load "md5.scm" #:optimization-level 0) twice in a row, then (md5-finalize (md5-init)) wingo: it will hang wingo: because in the second compilation, + in the md5 module already has the new definition civodul: ah yes civodul: the approach used in that file was kinda risky in the first place :-) wingo: (i'm not sure precisely the mechanism for how it fails but already this error is.. not good!) wingo: so i think the pattern to detect would be when it can be proven that you are referencing a top-level variable which is defined later in the file wingo: *which has not yet been defined in the compilation unit, and which is defined later in the compilation unit wingo: *which does not have a top-level definition earlier in the compilation unit, and which does have one later in the compilation unit civodul: heh, that's a complex pattern wingo: not so bad wingo: relatedly i think weinholt is right, that there is a particular bug about referencing not-yet-initialized letrec bindings that could be caught by part of the fixing letrec translation wingo: which is i think why a single -O2 compilation shows buggy behavior wingo: whereas it takes multiple compilations for -O0 to show buggy behavior euandreh: Is there a way to produce a single file Guile executable? davexunit: euandreh: unfortunately, no. rekado: there’s the old self-extracting perl script approach, but it’s not pretty wingo: should make a guix pack option to make a single executable :) dsmith-work: Hey Hi Howdy, Guilers dsmith-work: sneek: botsnack sneek: :) civodul: wingo: actually AppImage is single-executable IIRC, so we could have a backend for that civodul: food for thought :-) ane: is it possible to get the documentation for a method? ane: as in via procedure-documentation ane: yes, if you can find the method via goops introspection leoprikler: ane: that + you can set the object-documentation for the generic function itself if you want to daviid: sneek: later tell tohoyn this is a sign that in the 'context' of the execution that triggers these warnings, you are not following the recommendations given in the manual wrt merging generics - sneek: Will do. daviid: sneek: later tell tohoyn I actually added a manual subsection for ths - https://www.gnu.org/software/g-golf/manual/html_node/Configuring-Guile-for-G_002dGolf.html#Configuring-Guile-for-G_002dGolf sneek: Okay. daviid: sneek: later tell tohoyn I will provide you with a binding to g_set_prgname and g-set-prgname asap - sneek: Okay. daviid: sneek later tell tohoyn G-Golf won't let users gi-import GLib, nor GObject, by design - these are manually binded for what G-Golf - and users, upon request if something is missing - needs, for boostrap reasons ... to allow users to 'later import' those using g-golf itself would give me far to much work (mostly unecessary) to put the right barriers in the right place to avoid conflict with the boostrap manual bindings ... sneek: Will do. ane: civodul: ok. I have a patch sitting in guile-devel, I should probably send it to bug-guile daviid: sneek later tell tohoyn I pushed a patch (to the devel branch) with the two new interfaces, g-get-prgname, g-set-prgname, documentation and tests sneek: Got it. tohoyn: sneek, botsnack sneek: tohoyn, you have 3 messages! sneek: tohoyn, daviid says: I will provide you with a binding to g_set_prgname and g-set-prgname asap - sneek: tohoyn, daviid says: G-Golf won't let users gi-import GLib, nor GObject, by design - these are manually binded for what G-Golf - and users, upon request if something is missing - needs, for boostrap reasons ... to allow users to 'later import' those using g-golf itself would give me far to much work (mostly unecessary) to put the right barriers in the right place to avoid conflict with the boostrap manual bindings ... sneek: tohoyn, daviid says: I pushed a patch (to the devel branch) with the two new interfaces, g-get-prgname, g-set-prgname, documentation and tests sneek: :) tohoyn: str1ngs: If you are there I could send you the G-Golf debianization files as DCC SEND ArneBab: ecraven: chez is a compiler? ArneBab: ecraven: I thought that chez runs code interractively ArneBab: (with compiler I meant: creates C that gets compiled non-interactively) ArneBab: ecraven: besides: thank you for keeping your benchmarks up-to-date! fnstudio: hi, i have a list of values and need to see whether any of them is true, should i concoct something with reduce+or? fnstudio: i thought of something along the lines of `(reduce (lambda (x y) (or x y)) #f '(#f #t))` wingo: (or-map identity ls) fnstudio: but it feels terribly complicated fnstudio: wingo: oh great fnstudio: that seems better fnstudio: thanks! ecraven: ArneBab: chez compiles to machine code, it is one of the fastest compilers I know (and it also produces really fast code) RhodiumToad: or-map? ecraven: it does *not* go through C (which is not related to whether it is a compiler or not anyway) ecraven: sorry about not updating the benchmarks in the last few months, I don't have access to that machine any more, I need to find a good way to run them now ;) fnstudio: RhodiumToad: yes, thanks, super - or-map is what i was looking for RhodiumToad: didn't find that in the docs RhodiumToad: yes, it does look like what you need RhodiumToad: but it is notably absent from the docs chrislck: civodul: good news, we managed to modularise gnucash code properly, removing all traces of load-from-path... https://github.com/Gnucash/gnucash/pull/831 chrislck: no more unbound-variable warnings chrislck: next question: if rnrs is the future, would it be wise, or premature, to change use-modules to import? chrislck: (is rnrs the future??) lloda: i've been using import for years, you don't even need rnrs for that lloda: i don't think there's anything use-modules can do that import cannot but i might be wrong RhodiumToad: I recall some issue with using import RhodiumToad: let me check logs lloda: i did have problems with library so i still use define-module tho RhodiumToad: right, the thing I was recalling is that (library) loses all source location info from the library body RhodiumToad: so in the event of an error, it's impossible to track down where the error was tohoyn: fnstudio: I suggest using 'exists' instead of 'or-map'. 'exists' is defined by R6RS. tohoyn: fnstudio: similarly 'for-all' instead of 'and-map' lloda: still define-module & import work fine together, i haven't had any issues with that leoprikler: SRFI 1 also has "any" and "every" chrislck: lloda thx the idea is to be more future-proof/standard-oriented leoprikler: define-module will always be future-proof leoprikler: [in guile] civodul: ane: just saw https://ane.github.io/programming/lisp/goops-virtual-slots-and-ffi.html (from you, right?) civodul: looks pretty cool! civodul: are the bindings part of recutils proper? civodul: when using the C API, you'd generally use "foreign objects" (or SMOBs, for the old style) rather than pointer objects and define-wrapped-pointer-type (which are rather for the FFI) wklew: does anyone know if the pfds (purely functional data structures) package has a maintainer? the canonical github repo at https://github.com/ijp/pfds has a breaking bug and hasnt been updated in 6 years wklew: its a shame because its a really important package wklew: implements a lot of common functional data structures like finger trees, HAMTs, etc civodul: wklew: hi! ijp hasn't stopped by this channel for a while already civodul: so it may be unmaintained civodul: sneek: seen ijp sneek: I think I remember ijp in (here?) 9 months ago, saying: CherryMan: slots are the fields in foreign objects. civodul: ah well, i thought it had been more time civodul: perhaps you can get in touch with them and see if they're interested in handing it over? wklew: civodul: thanks that's helpful, wasn't aware he visited here wklew: er, they wklew: i actually did send them an email asking if they were looking for a maintainer, havent heard back yet civodul: in the meantime you can always have your branch containing the fixes civodul: surely others will be interested in using it :) wklew: there is a github fork which fixes it, and I believe the guix package recipe also includes a patch wklew: unfortunately that github repo is still referenced in most places civodul: it sounds suboptimal wklew: i have been thinking about reimplementing some parts of it in more modern guile, so maybe I will take a stab at that soon wklew: it is still a shame to see it succumb to bitrot though leoprikler: some bits rot quicker than others, sadly wklew: and sadly it isnt always the least significant ones :p leoprikler: Bit 13 tends to get hammered quite quickly. ane: civodul: yes ane: civodul: still being worked on, but it's going to ship with recutils ane: civodul: I'm not sure about foreign objects, given that librec only exposes opaque pointer types ... one interacts with the C structs only using the functions and pointers manumanumanu: wklew: and the data structures in pdfs are not very fast, at least not the general ones (like fectors). Andy wrote a fector library which I have planned to develop further, but I am easily distracted. His source can be found here: https://hg.sr.ht/%7Ebjoli/guile-fector (he gave me permission to do this). note that this is a mercurial repo that hasn't been moved to git yet wklew: manumanumanu: thanks, I will check that out wklew: speed is important in this case wklew: OTOH I've made heavy use of the sequences and hamts in pfds to good results, and have no knowledge of alternatives manumanumanu: Andy's fectors are just like the ones in clojure. I wanted to add a small constant overhead and make RRB-fectors with support for fast inserts, splits and joins, but my brain seems to work extra slow when trying to think about how :P manumanumanu: Anyway, I ended up with that repo after benchmarking andy-fectors against my own, and found that the overhead was A LOT lower. almost 30%. manumanumanu: now, sleep! Todays manumanumanu: mental exercise was to add skip-wheels to https://git.sr.ht/~bjoli/wheel-utils (not in the readme yet). Nothing big, but fun anyway. ane: civodul: actually I think I will just do without the wrapped pointers, since I can just hide the raw pointer object in a slot alextee[m]: CHICKEN is a compiler and interpreter for the Scheme programming language that compiles Scheme code to standard C alextee[m]: am i reading this correctly :o alextee[m]: i thought it wasnt possible to generate C from scheme ane: there are many scheme compilers that do that alextee[m]: oh wow alextee[m]: is chicken the most popular? ane: hard to say, it is popular though alextee[m]: kewl ane: off the top of my head gnu scm and cyclone scheme do this I think, there are many ane: many implement something called "Cheney on the MTA" to be compilable to C justin_smith: alextee[m]: nb. - it compiles to C but isn't especially performant alextee[m]: oh i see alextee[m]: how does it compare to guile wrt embedding in C code? alextee[m]: SCM sounds pretty nice too: SCM includes Hobbit, a Scheme-to-C compiler written originally in 2002 by Tanel Tammet. It generates C files which binaries can be dynamically or statically linked with an SCM executable ane: well, it compiles to c, which compiles to machinecode. guile on the other hand uses a JIT compiler. ane: that is, your scheme-to-c is already machine code when you run it alextee[m]: interesting, thanks dsmith: Heh. Guile started out as SCM turned into a library. jsoo: I am trying to use nyacc for a toml parser and it would be very useful to be able to define character ranges jsoo: Is there a better option that I should be using? daviid: leoprikler: and others ... glad to tell you that g-golf works fine with gtk-4.0 daviid: those interested, guile-gi and g-golf users, gtk-4.0 will have one more snapshot, then released, within the next 10 days - here is a fundamental links to help you migrating/learning from gtk-3.0 to gtk-4.0 - https://gnome.pages.gitlab.gnome.org/gtk/gtk/gtk-migrating-3-to-4.html oni-on-ion: also Gambit =) oni-on-ion: daviid, is there feature summary for 4.0 ? daviid: oni-on-ion: https://developer.gnome.org/gtk4/3.99/gtk.html oni-on-ion: hmm. i don't know gtk 3 well enough to do a mental diff. daviid: oni-on-ion: that would be the previous link jyst above daviid: if you have a gtk-3.0 app i mean, if you start, jst start using 4.0 oni-on-ion: ah true. i have not decided on UI toolkit yet daviid: fwiw https://developer.gnome.org/gtk4/3.99/gtk-question-index.html offers a 'how do i get started with gtk ... mwette: jsoo: did you look at nyacc/lex.scm ? Several reader use char-sets tohoyn: sneek, botsnack sneek: tohoyn, you have 1 message! sneek: tohoyn, str1ngs says: that would be very useful. sneek: :) spk121: . ArneBab: alextee[m]: for a speed comparison between schemes, look at the benchmarks by ecraven: https://ecraven.github.io/r7rs-benchmarks/ — you’ll note gambit at the top (scheme to C compiler), closely followed by chez (not a compiler). This page also shows that the different Schemes have vastly different performance-stories: The first 10 Schemes in the list are all the fastest implementation in at least one test (but what is more important for the ArneBab: general case is in how many of the tests it is in the top10). g0d_shatter: shot in the dark, but does anyone know of parser of C code, like ANSI C, written in guile? sneek: g0d_shatter, you have 1 message! sneek: g0d_shatter, str1ngs says: make sure you only have guile-2.0-dev installed it will install what it needs. for gdb it does not acutally need guile-2.0 the interpreter. after that confirm with pkg-config it finds guile-2.0 libs with . pkg-config --libs guile-2.0 . make sure you don't have PKG_CONFIG_PATH set to something else just in case too. ArneBab: see nyacc oon https://www.gnu.org/software/guile/libraries/ ArneBab: g0d_shatter: see nyacc oon https://www.gnu.org/software/guile/libraries/ g0d_shatter: outstanding thank you ArneBab g0d_shatter: oh man, it looks like its still actively developed too, wonderful leoprikler: daviid: thanks for the link, can't wait to get started once GTK4 hits Guix daviid: leoprikler: anyony on guix actively working on gtk-4.0 packaging? daviid: *anyone leoprikler: Not sure, it's been a while since it was a topic. daviid: leoprikler: maybe you could ask ... which would act as an incentive, so to speak - gtk-4.0 will be released in 10 days daviid: i could ask to :), but not even a guix user so ... i know you're active in #guix as well ... spk121: GTK4, w00t. I haven't tried it, but, it seems exciting from the blog posts leoprikler: Was much work needed in g-golf to get GTK4 working? I'd imagine not, since those API changes should not affect GI all that much. daviid: spk121: hello! are you on debian? spk121: daviid: I use Ubuntu for the nightly builds stuff, but, mostly I hack on Fedora. spk121: Windows 10 for work daviid: leoprikler: zero work, but a manual op that I need to automate, so nearly zero work .. daviid: spk121: ok, well if debian (ubuntu maybe very similar), i can help you to install and try it in a few minutes :) daviid: spk121: for info https://packages.debian.org/source/experimental/gtk+4.0 - then there is a litle trick to 'force' the installation in a specific order for two packages, then the rest smoothly follow spk121: daviid: I've got a JHBuild setup, so I should be able to build from source when I have free time. Most of my limited hack time right now is trying to make Guile 3 build natively on windows using microsoft's compiler w/o cygwin or mingw. spk121: I somehow started revisiting this problem because I wanted to add Windows to the guile-gi continuous integration build daviid: spk121: ok fine - my 'route' was/is to use the experimental prebuild packages, that is nearly instantaneous - good luck with guile on win10 of course! spk121: daviid: windows 10 is dumb. I should have never started this, but, I'm halfway there, I think. leoprikler: Once Guile-GI builds on MinGW, I'll snatch that recipe for Guile-SDL2-binaries tohoyn: daviid: any comments about the debianized G-Golf? daviid: tohoyn: no, it's nice you did the work of course, I just assume you did a good job :), I have too many things to work on to actually look into it, i'll leave that to debian 'pro', your sponsor and mentors .. fnstudio: hi, i need to match a series of strings that all comply with the same structure; "match" as in "extract information from the strings depending on position of certain keywords, etc" fnstudio: i think this can be done with a (slightly complicated) regex fnstudio: but i also found this mechanism called pattern matching under guile fnstudio: https://www.gnu.org/software/guile/manual/html_node/Pattern-Matching.html fnstudio: is it possible to use it to match/manipulate strings as you'd do with a regex fnstudio: and if so, is there something in particular where you would definitely use one instead of the other approach? tohoyn: fnstudio: can't you just use string-match? fnstudio: tohoyn: hm, maybe, let me see tohoyn: fnstudio: see https://www.gnu.org/software/guile/manual/html_node/Regexp-Functions.html fnstudio: tohoyn: ok, yes, that'd be the regex way - which is fine, i was wondering whether the other mechanism would apply to my case, but possibly not, i might be mixing things up tohoyn: fnstudio: but you can compute e.g. (string-match "world" "hello world") tohoyn: fnstudio: and you get the position of "world" in "hello world" fnstudio: tohoyn: excellent, yes, i think that'll do it - thanks! tohoyn: how can I access function g_set_prgname after I have done (gi-import "GObject") and (gi-import "Glib")? tohoyn: g_set_prgname and g-set-prgname are not defined tohoyn: correction: (gi-import "GLib") tohoyn: is it good programming practice to handle the initialization of a program by defining a signal handler for the 'activate' signal of the application object? tohoyn: G-Golf and GTK leoprikler: tohoyn: yes leoprikler: that's the GTK+ sanctified way tohoyn: leoprikler: ok. tx. leoprikler: though actually you want startup before activate in some cases leoprikler: (activate is only to show UI, startup can allocate data before that if you need it) civodul: rr no longer works with Guile, pity :-/ wingo: why not? :) wingo: civodul: what changed? civodul: wingo: i don't know, but "rr replay" now fails to replay mmap of sched events civodul: i hadn't used it in months, so not sure what happened wingo: weird wingo: works on my ubuntu 20.04 system civodul: ah wingo: rr 5.3.0 civodul: it could be some special version combination civodul: 5.4.0 here davexunit: wingo: random thing but thanks for writing define-packed-struct in guile-opengl. I couldn't use it directly in my project but it was an invaluable reference to make something similar. using syntax-case to generate a syntax-rules macro was blowing my mind but I understand it now. :) wingo: not many commits between the two: https://github.com/rr-debugger/rr/compare/5.4.0...master wingo: ah that's not the right diff wingo: not many commits between the two: https://github.com/rr-debugger/rr/compare/5.3.0...5.4.0 wingo: haha that's a lot more commits :) civodul: heh *: civodul time-machines to 5.3.0 wingo: davexunit: nice! *: wingo would like to hack scheme again ;) civodul: fails as well wingo: in the meantime i have slid further into perdition; been hacking on llvm :P civodul: -> Assertion `buf.data.size() <= t->syscallbuf_size' failed to hold. civodul: wingo: d'oh! ;-) civodul: does it have to do with emscripten? wingo: yeah. working on various parts of the webassembly gc proposal civodul: fun wingo: ubuntu 5.4.0-54-generic, fwiw wingo: for my rr test civodul: hmm didn't we have to pass an obscure --whatever-syscall option? civodul: i have a vague recollection civodul: yay --no-syscall-buffer seems to do the trick! civodul: can rr follow child processes, that's not clear ecraven: ArneBab: chez is not a compiler? jsoo: mwette: oh! That would help! alextee[m]: ArneBab: thanks, that's very useful civodul: i was toying with a GC profiler at the C level, from within GDB: https://web.fdn.fr/~lcourtes/pastebin/gdb-gc-profiler.scm.html civodul: that spits call counts like so: https://web.fdn.fr/~lcourtes/pastebin/gdb-gc-profile.html civodul: which is rough on the edges compared to what gcprof shows civodul: but i think it could be useful, for example to see if the disappearing links table is eating memory ane: how do people get bug numbers for mails sent to bug-guile? by mailing debbugs with package: guile and so forth? civodul: ane: you send a message to bug-guile@gnu.org, and you receive a notification with the bug number fnstudio: hi, may i ask what's the difference between `null?` and `null-list?` from srfi-1, other than the type-checking done by the latter? justin_smith: fnstudio: (null? (cons 1 2)) => #f (null-list? (cons 1 2)) => ERROR: In procedure scm-error: not a proper list in null-list? RhodiumToad: the difference is exactly the type-checking justin_smith: fnstudio: oh you said "other than the type-checking" justin_smith: I think not-pair? is related, and most usages of null? can be replaced with either null-list? or not-pair? for clarity Formbi: hi Formbi: is it possible to show the source of a particular procedure automatically? Formbi: like Emacs' 'help-command h v Formbi: h f* Formbi: 'help-command f* Formbi: I should probably go to sleep :p fnstudio: justin_smith RhodiumToad: oh brilliant, thanks for confirming that dsmith: chrislck: Heh tohoyn: sneek, botsnack sneek: :) tohoyn: daviid: configure works with both guile-3.0 and guile-2.2 installed when I change GUILE_PROGS([2.0.14]) to GUILE_PROGS([2.2]) tohoyn: daviid: I think there is a bug with the m4 macros. GUILE_PROGS([2.0.14]) should work, too. tohoyn: daviid: I think GUILE_PROGS should use the version determined by GUILE_PKG leoprikler: tohoyn: yep, it's GUILE_PKG([3.0 2.2]) followed by GUILE_PROGS tohoyn: leoprikler: GUILE_PROGS without arguments? leoprikler: yep leoprikler: At least that's how I do it in guile-filesystem leoprikler: GUILE_PKG([3.0 2.2 2.0]) leoprikler: GUILE_PROGS leoprikler: Does not work with 1.8 tho IIRC. civodul: i think it does! civodul: but... who cares :-) leoprikler: In that case guile-filesystem simply can't be ported that far back leoprikler: ./configure: line 2401: syntax error near unexpected token `3.0' leoprikler: ./configure: line 2401: `GUILE_PKG(3.0 2.2 2.0)' leoprikler: civodul: so unless you pack your own guile.m4, that won't work civodul: what won't work? leoprikler: autoreconf -vif; configure; make; when building against Guile 1.8 civodul: oh yes, you have to use today's guile.m4 civodul: the one that ships with Guile 3.0 civodul: the macro in that guile.m4 deals with 1.8 daviid: tohoyn: the actual g-golf configure.ac file is correct daviid: GUILE_PKG([2.2 2.0]) daviid: GUILE_PROGS([2.0.14]) daviid: the arg of the GUILE_PROGS macro is to determine the minimum version required to compile/run g-golf, so for example, it wouldn't worj if it finds you have 2.0, but version 2.0.13 daviid: the g-golf guile.m4 macros is 'nearly the latest' :), the only diff is in comments and the default required version if unspecified - but the machinery that checks for major, minor and micro version is identical (that 'machinery' was patched before, g-golf has that patch) dsmith-work: UGT Greetings, Guilers spk121: hi, does anyone happen to know if Guile will build using only minigmp, instead of the full gmp? wingo: spk121: we should certainly make it possible! wingo: i don't know tho :) civodul: +1 civodul: minigmp was designed largely so Guile could use it wingo: i would really like to rework our GMP usage to use the "nail" API directly civodul: yes, we could do better civodul: rlb: are you able to reproduce the GnuTLS hang as described at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=969672#48 ? spk121: wingo: if no one has tried it, maybe I'll give it a go to see what happens wingo: thumbsup dsmith-work: :thumbsup: dsmith-work: Hah! Worked *: dsmith-work has emojify minor mode enabled civodul: neat civodul: :smile: janneke: (y) rlb: civodul: yes, it's straightforward (should be), and glad you pinged me. I'd been meaning to ping you and kept forgetting. rlb: I can get you better instructions later, but here I can see it in a debian (bullseye I think) vm after an "apt build-dep guile-3.0/experimental" (with some pins to avoid pulling in much else -- suspect that's mostly just relevant for the libgc dep), then put the src tree in /dev/shm as /dev/shm/gnutls/gnutls-X.Y (as apt-source does -- you could just apt-source from /dev/shm/gnutls too), then (cd /tmp && ln -s /dev/shm/gnutla .) and then rlb: just build normally and then try running the tests with "... < /dev/null". Hangs every time in reauth.scm. rlb: I haven't had time to check for example, whether you really need to be in /tmp/ with the symlink, etc., but that arrangement (which I guess is one some of the build deps use) reliably hangs. rlb: s/build deps/buildds/ rlb: I toyed with it a bit, but also didn't have time to track it down. It appears to be swallowing an exception when it hangs. rlb: (from gnutls maybe, something about the keys/files) rlb: I don't remember for sure. rlb: Feel free to shout and I can set it back up tonight or tomorrow night (CST) and get better/additional information. civodul: rlb: hi! civodul: i was looking for instructions not involving Debian, if possible civodul: i cannot reproduce it on Guix civodul: alternatively, if you can attach gdb to the two reauth.scm process and grab a backtrace, that could help! rlb: Even with the same libgc and guile version and with those steps (i.e. from /tmp/ symlinked to /dev/shm)? rlb: also of course critical to "... < /dev/null" rlb: when running the build/test, though I can reproduce it afterward with just that single test an d< /dev/null, so might not need < /dev/null for anything other than that bit. rlb: Certainly, happy to help -- I'll look later, but I can't recall how I managed to get the error output last time, i.e. everything's silent on the terminal. I can't recall whether I found it in a log, or hacked up the test to stash it somewhere. civodul: ah, lemme check civodul: /tmp -> /dev/shm and "< /dev/null" make no difference for me rlb: OK, I'll try to capture the error later, and also double-check the process. fwiw in addition to the buildds, I was able to reproduce it in a vagrant vm (sometimes use those for quick testing) via "vagrant init debian/testing64"... If you have that available somewhere, I could likely provide fairly precise reproduction steps. (Or of course for any debian bullseye host you didn't mind mangling a bit wrt package installs.) rlb: Suppose of course the debian package build process/flags/whatever might also be involved, but as yet it "feels" like a race of some sort. tohoyn: str1ngs: I have made initial debianized version of G-Golf. I can send the files to you if you want them. str1ngs: sneek: later tell tohoyn that would be very useful. sneek: Okay. fnstudio: hi, i have a list of lists (of lists) like this https://paste.debian.net/1176003/ and i'd like to find the intersection of each group fnstudio: i know lset-intersection but not sure how to use it in this particular case fnstudio: as if i go through the (outer) list with `apply` then that will result in `lset-intersection` being fed a list of lists instead of the unpacked elements fnstudio: is there an idiom/approach to this that i should look up/into? justin_smith: fnstudio: call apply intersection on each sublist, or use map across them to get the list of intersections justin_smith: fnstudio: also you have too many ', ' is not a syntax for "make a list", it prevents evaluation recursively and only needs to be used once justin_smith: fnstudio: (map (lambda (l) (apply lset-intersection eqv? l)) '(((1 2 3) (1 3 4 5 6)) ((1) (1 2 8) (1 9)))) => ((1 3) (1)) justin_smith: (that's after running (use-modules (srfi srfi-1)) of course) fnstudio: justin_smith: that's awesome! thanks so much justin_smith: fnstudio: I'm realizing what I said about single-quote "'", would have been more clear if i'd, um, quoted it fnstudio: justin_smith: :D, no that's fine, thanks, i'm still awkwardly moving my first steps with quoting/quasiquoting/etc justin_smith: fnstudio: the idea is '(1 2 3) and ''(1 2 3) are not equal, and justin_smith: ' is a reader syntax, ''(1) expands to (quote (1)) leoprikler: Is it expected, that s32vector-ref does not work on array slices, but array-cell-ref works on s32vectors? leoprikler: [array slices of the kind #1s32] RhodiumToad: array functions are supposed to work on anything array-like sneek: Welcome back RhodiumToad, you have 2 messages! sneek: RhodiumToad, mwette says: That looks nice. Clever job! sneek: RhodiumToad, mwette says: I need a fold also: (cartesian-fold proc 1 '(a b c) '(d e f) '(g h i)) -- I will take a shot but you might get it faster. RhodiumToad: and an array slice is not an s32vector even if it was sliced from one RhodiumToad: so yes, it is expected leoprikler: ahh, I need array-contents? daviid: sneek: later tell tohoyn I asked on #debian-next and they say you should ask on #debian-mentors sneek: Will do. daviid: sneek: later tell tohoyn they also suggested the test, in the debian packaging, be patched so it is run under xvfb-run, adding a test to check and depend on xvfb ... sneek: Okay. ces: How do i seed random? I use random in a loop but it seems to be deterministic... RhodiumToad: (random-state-from-platform) to get an arbitrary seed from platform-dependent entropy sources RhodiumToad: e.g. (set! *random-state* (random-state-from-platform)) RhodiumToad: (to set the default seed) dsmith: Hey dsmith: https://ane.github.io/2020/10/05/between-two-lisps.html ces: RhodiumToad: Thanks! davexunit: dsmith: just saw this elsewhere. says some pretty nice things about guile. dsmith: yep RhodiumToad: https://dpaste.org/MqgX <-- cartesian-fold and cartesian-apply RhodiumToad: mwette: ^^ RhodiumToad: sneek, later tell mwette https://dpaste.org/MqgX <-- cartesian-fold and cartesian-apply sneek: Okay. mwette: RhodiumToad: thanks! sneek: Welcome back mwette, you have 1 message! sneek: mwette, RhodiumToad says: https://dpaste.org/MqgX <-- cartesian-fold and cartesian-apply RhodiumToad: one open question is the order in which you want the fold to work RhodiumToad: right now, the first argument list is the one that varies fastest, i.e. '(1 2) '(a b) visits 1a, 2a, 1b, 2b in that order RhodiumToad: this is a consequence of a double-reverse in the building of the nested loops and the argument lists mwette: For me, there is no requirement on the order. RhodiumToad: ok. RhodiumToad: I put the accumulator argument to the fold procedure at the end, i.e. it's (proc blah blah ... accum) because that's how (fold) does it, but it might be neater to put it first RhodiumToad: otoh consistency is good mwette: I do like that order. I use fold a lot and expect to see it. tohoyn: sneek, botsnack sneek: Welcome back tohoyn, you have 3 messages! sneek: tohoyn, daviid says: I am afraid I can't help you, it is a debian 'package building environment' problem, which I know nothing about, but it appears that the building environment does not to have a X11/Wayland server available, hence gtk-init fails ... you should ask for help to 'debian', maybe #debian-next (irc.oftc.net), might help or suggest 'where' to ask ... sneek: tohoyn, daviid says: I asked on #debian-next and they say you should ask on #debian-mentors sneek: tohoyn, daviid says: they also suggested the test, in the debian packaging, be patched so it is run under xvfb-run, adding a test to check and depend on xvfb ... sneek: :) tohoyn: I get lintian error "bad-distribution-in-changes-file unstable". Why is lintian complaining about unstable? tohoyn: I have Ubuntu on my computer. tohoyn: I build the package with debuild. tohoyn: sorry for wrong channel ane: the moment you wake up and your blog post about common lisp and guile is all over the internet RhodiumToad: heh spk121: That feeling when the initially simple task of building Guile on Windows has somehow lead to writing a GCC-like front end to to the CL compiler in c++. tohoyn: I get the following error when I try to build g-golf with sbuild: configure: error: found development files for Guile 2.2, but /usr/bin/guile has effective version 3.0 tohoyn: I've got dependencies guile-2.2 and guile-2.2-dev in debian/control tohoyn: There is no direct dependency to guile 3.0 tohoyn: I suppose that the m4 scripts for guile have a bug daviid: tohoyn: I think you have multiple guile installed, byt your distro, and although dependenciesseems satisfied, $(GUILE) point to /usr/bin/guile, and that is the 3.0 version, just a guess - this is a common problem with multiple installations, if the distro does not rename by postfixing guile with the version, and locale both guile and guild and any guile related script in $prefix//bin, the last installed win ... this has nothing to do daviid: with the guile.m4 macros mwette: The debian issue is that one of the tools -- guild-2.2 or guile-tools-2.2? -- is not included. I think it will be fixed in the future. I ended up generating a configure that works around it. tohoyn: why is guile 3.0 installed in the chroot environment at all? I don't have any dependency for it in debian/control. daviid: tohoyn: you shouls ask all these questions to #debian-mentors tohoyn: daviid: ok daviid: even #debian-next mentioned to me that they ask questions on #debian-mentors to ... if they say there is a bug in g-golf, then i'll trust them and fix it ... daviid: mwette: where is this configure.ac with the work around? tohoyn grab that, try it, and then tell the #debian-mentors about it, it will 'speeds things up' in fixing the problem i guess ... tohoyn: daviid: Is it ok to you if I make an ITP (Intention to Package) for the debianization of G-Golf? tohoyn: daviid: see https://wiki.debian.org/ITP daviid: tohoyn: yes, it is ok, but very likely will be rejected by debian rules, i see, among reasons to reject a packege, '... The software is very immature (version 0.1-alpha or something like that). ...' tohoyn: daviid: ok. I'll think about it. daviid: g-golf doesn't even have an alpha release yet :) - another reason is debian wants to get rid of guile-2.2l as I mentioned to you these last few days ... daviid: tohoyn: since you seem to be in such a 'hurry', probably because you want a 'presence' no matter what for your theme-D packages, here is what I would do if I were in your shoes: I'd package theme-D and theme-D-Golf for guix, then run guix pack to generate a 'self contained' bundle for each, then upload that on your site and recommand your users to grab those, until g-golf works with guile-3.0 and is(may be) in debian jkossen: this probably has to do with the newbie way i use to structure my code, but is there a less ugly way than (+ cnt 0) as a last statement to get the value of cnt as a return value from a function? manumanumanu: jkossen: just cnt is fine jkossen: manumanumanu: ah thanks! Never even considered using less parentheses :S chrislck_: jkossen: you can always fake it: (define return identity), and (return cnt) fnstudio: hi, i was experimenting with some (very basic!) scheme and wrote this https://paste.debian.net/1175655/ fnstudio: i was expecting it to terminate when it gets to 100, but it does not fnstudio: my (clearly mistaken) expectation is based on some (only apparently) similar pattern that i've seen elsewhere fnstudio: ah, no, wait, i think i see it now... it never leaves the recursion mwette: misplaced paren maybe the (counter ....) should in the (if ...) mwette: (if (> ...) '() (counter ...)) fnstudio: mwette: true! fnstudio: thanks! RhodiumToad: so I did another attempt at that cartesian product macro, using only syntax-rules RhodiumToad: https://dpaste.org/pqhr RhodiumToad: I'm pretty sure this doesn't have the memory allocation issues of the previous attempt. daviid: weinholt: (and any guile-lib users) hello! I pushed 4 patches to guile-lib devel branch, so make distcheck pass with both 2.2 and 3.0.4 daviid: I didn't solve the deprecated related msg yet, nor the other 'unbound variable c warnings' (as it appears in 2.2 'as is' as well daviid: there are quite a few additional warnings running make (when building the doc) while using guile-3.0, but make distcheck pass - so, please feel free to check, clone and checout the devel branch ... when everything is proved ok, i could merge to master, bump to 0.2.7 and release sookablyat: what's the use of most commonly used ssrf ? sookablyat: i can't wrap my head around this guys leoprikler: sookablyat: did you mean srfi? leoprikler: RhodiumToad: magic tohoyn: sneek, botsnack sneek: :) fnstudio: hi i'm having some troubles with a case statement, here https://paste.debian.net/1175708/ if anyone has the time to give a look fnstudio: the underlying problem is that i'm not sure i've a clear understanding of the way strings and expressions are handled fnstudio: so, there's something that's printed on the screen as `abc` but then apparently that doesn't match with `abc` in a case statement fnstudio: but i'm having similar problems beyond case-statements so i must be missing some understanding fnstudio: updated version https://paste.debian.net/1175709/ fnstudio: ok, i think i see what the problem is or what it is related to at least fnstudio: `(equal? key "number")` returns true fnstudio: but `(eqv? key "number")` returns false fnstudio: i suppose case uses eqv? instead of equal? tohoyn: fnstudio: What is the value of 'item'? tohoyn: fnstudio: according to R6RS 'case' uses 'eqv?' fnstudio: tohoyn: item has form `(number 42)` fnstudio: tohoyn: `number`, in particular, is shown as above, with no quotes fnstudio: however, if i display (string? key) i'm told it's a string fnstudio: (and thanks for confirming case uses eqv?) fnstudio: so i guess i now have two questions: the first is whether there's a common pattern to use case with a different equality tohoyn: fnstudio: define an own macro for that fnstudio: the second would be about investigating why key and "number" are not reported as eqv but only as equal fnstudio: tohoyn: ok, thanks, i'll try a macro tohoyn: fnstudio: eqv? returns #t for two strings if the strings are the same object, i.e. they have the same address fnstudio: tohoyn: wasn't that eq? tohoyn: fnstudio: both eq? and eqv? tohoyn: fnstudio: see R6RS section 11.5 fnstudio: tohoyn: oh ok, i see, thanks tohoyn: The debianized version of g-golf gives the following error with test-case test-g-property-object: FAIL: tests/hl-api.scm tohoyn: Unable to init server: Yhdistäminen ei onnistunut: Yhteys torjuttu tohoyn: (guile:10754): Gtk-WARNING **: 12:34:21.150: cannot open display: tohoyn: sorry for flooding tohoyn: error message in English: "Connecting did not succeed. Connection rejected." tohoyn: all the tests work fine when run normally (not building a Debian package) fnstudio: and might there be a way of reducing two strings to a canonical form so that they result eqv? (not just equal?) tohoyn: fnstudio: what should the reduction return if the strings are not equal? fnstudio: tohoyn: what i mean is that the strings are equal? but reported as not eqv? (probably for the reason you explained above); i was wondering if there's a way to reduce both strings to a third "thing" so that they'll then be reported as eqv? fnstudio: i'm not sure i'm making sense, sorry tohoyn: I tried to build the Debian package with debuild. I suppose it does not use a chroot environment. tohoyn: fnstudio: (if (equal? str1 str2) str1 ...) fnstudio: tohoyn: yeah, i'm probably overcomplicating it, i suppose i can switch to an if-statement and use equal? straightaway tohoyn: fnstudio: I suggest using a hash table with equality predicate 'equal?'. fnstudio: i just thought there might be an idiom to do this with case tohoyn: fnstudio: when you use hash-ref for that kind of hash table you always get the same object for two identical strings fnstudio: ok, thanks tohoyn i'll look into it tohoyn: see section 6.6.22 in the guile 2.2 info pages fnstudio: cool, more in general, you mentioned R6RS above, what do you think my points of references should be when learning scheme? http://www.r6rs.org/ ? together with the guile docs? tohoyn: fnstudio: R6RS is the most important document. You should also look at R7RS. fnstudio: excellent, thanks, v helpful tohoyn: does anybody have an idea why GTK can't open a display? tohoyn: could it be missing X server? tohoyn: fnstudio: BTW, look at http://tohoyn.fi/theme-d/index.html tohoyn: fnstudio: Theme-D is a strongly typed language resembling Scheme fnstudio: tohoyn: impressive, thanks RhodiumToad: leoprikler: do you mean that in a good way or a bad way? :-) leoprikler: both kinda leoprikler: it's nice to have this in pure syntax-rules, but the let-bindings are super confusing if you don't know what Scheme does to keep them hygienic tohoyn: daviid: could you help me with the failing test case? RhodiumToad: leoprikler: this seemed to me to be a case where the hygienic stuff could be used to advantage RhodiumToad: so, yes, the inner call ends up as (proc i i i) or whatever, but the i's are different bindings (and this is visible if, for example, you decompile the tree-il back to scheme) leoprikler: a good example for why macros should wash their hands and wear masks :) tohoyn: daviid: the problem is that gtk-init fails to make a connection fnstudio: i have this long chain of if-s that i would like to transform in a case statement fnstudio: the main reason for that is that i'd like my procedure to return the value provided by the first matching if statement RhodiumToad: what are the conditions? fnstudio: say if key is aaa do this, if key is bbb then do that fnstudio: in a long series fnstudio: but i'd like it to terminate as soon as key is matched with, say, aaa RhodiumToad: you can use case as long as all the conditions are (eqv? key someconstant) euandreh: case does terminate fnstudio: i don't seem to be able to use case because of its reliance on eqv? as opposed to equal? - at least i think that's the issue there RhodiumToad: if the conditions are more general, then cond rather than case would be the thing to use fnstudio: RhodiumToad euandreh, ok, cool, that's great, i'm going to give cond a try then fnstudio: thanks! *: RhodiumToad first learned lisp on an implementation where cond was literally the only conditional construct, so tends to use it fairly often leoprikler: if conditions are really dire, you should try ice-9 match leoprikler: RhodiumToad: now you know how to implement case in terms of cond :) sookablyat: RhodiumToad, i learned lisp on a dragonflybsd on powerpc64le where i had to code my lisp interpreter in powerpc assembly RhodiumToad: I admit to not having coded the interpreter myself. RhodiumToad: but it was on a 6502 cpu with 32kB of ram spk121: . sneek: Welcome back spk121, you have 1 message! sneek: spk121, leoprikler says: the documentation for scheme bindings has apparently been merged sookablyat: RhodiumToad, meh sookablyat: RhodiumToad, start to hack with the DragonFly on A powerPC dude sookablyat: you will discover the wonders of using a REAL unix mwette: RhodiumToad: that looks promising but when I copy and try to run I get: Unbound variable: #{\x200b;}# spk121: mwette: #x200b is ZERO WIDTH SPACE (U+200B) which usually means that you copied an HTML line break or something like that mwette: Got it now. The display had some junk. mwette: RhodiumToad: Clever. Looks nice. mwette: sneek: later tell RhodiumToad That looks nice. Clever job! sneek: Will do. mwette: spk121: thanks mwette: I didn't have javascript enabled for dpaste.org. Enabled, now the copy works. mwette: sneek: later tell RhodiumToad I need a fold also: (cartesian-fold proc 1 '(a b c) '(d e f) '(g h i)) -- I will take a shot but you might get it faster. sneek: Got it. daviid: sneek: later tell tohoyn I am afraid I can't help you, it is a debian 'package building environment' problem, which I know nothing about, but it appears that the building environment does not to have a X11/Wayland server available, hence gtk-init fails ... you should ask for help to 'debian', maybe #debian-next (irc.oftc.net), might help or suggest 'where' to ask ... sneek: Got it. fnstudio: hi, can anyone suggest an obvious "translation" of python's group-by to guile? (i'm not even sure the question makes sense, maybe i'm supposed to use a particular idiom/pattern instead of a function) ArneBab: fnstudio: what do you mean by group-by? fnstudio: ArneBab: i have a list of pairs and would like to group them together, depending on one of their elements fnstudio: actually, i'd be fine in just counting them, i.e. how many there are for each coordinate x (suppose the pairs are (x, y)) ArneBab: do you mean something like '((1 . 2) (1 . 5) (2 . 4) (1 . 3)) to '((1 2 5 . 3) (2 . 4)) ? fnstudio: ArneBab: i was thinking of '(1 . 1)(1 . 2)(1 . 3)(2 . 1)(2 . 2) to '(1 . (1 2 3))(2 . (1 . 2)) fnstudio: (not sure if i got the formatting right though) ArneBab: that’s what my version boils down to, only with less overead :-) fnstudio: ah... cool fnstudio: sorry :) ArneBab: no problem :-) ArneBab: Scheme is typically somewhat more low-level than Python, or rather more abstract ArneBab: and there might be things I miss fnstudio: yeah it looks great, i find it very interesting for that reason fnstudio: but there's so much i've got to learn ArneBab: maybe I can save you some time with this: http://www.draketo.de/py2guile ArneBab: it’s not complete and 2-3 years out of date on my own progress, but it should get you over the initial bumps fnstudio: that's fantastic! fnstudio: "You must unlearn what you have learned" :) fnstudio: (may i ask if you're the author?) ArneBab: I am, yes — and I’m glad you like it :-) fnstudio: great stuff, thanks, i'll let you know how it goes with that ArneBab: thank you! ArneBab: fnstudio: you might be able to do something elegant with a map ArneBab: or reduce ArneBab: One more hint that I learned after py2guile: Use info (standalone or info-mode in Emacs) and look for tools with full-text-search. ArneBab: fnstudio: how much efficiency do you need? Is memory an issue? fnstudio: ArneBab: i was able to find a quick and dirty solution - for now ArneBab: (define (assoc-increment! key alist) ArneBab: "Increment the value of the key in the alist, set it to 1 if it does not exist." ArneBab: (define res (assoc key alist)) ArneBab: (assoc-set! alist key (or (and=> (and=> res cdr) 1+) 1))) ArneBab: (fold assoc-increment! '() (map car xydata)) ArneBab: (define xydata '((1 . 1)(1 . 2)(1 . 3)(2 . 1)(2 . 2))) ArneBab: fnstudio: this should do the counting fnstudio: ArneBab: this is amazing fnstudio: ArneBab: thanks, efficiency is not a major concern, it's more using this an excuse to get a bit more familiar with guile fnstudio: which includes the fact that i want to improve, therefore also aim for efficiency, but it's not top priority ArneBab: sounds great! fnstudio: ArneBab: thanks for your snippet - i'm going to save it and study ArneBab: I’ll put it on my site — that’s an issue that will come up more often. In Python I’d have used collections.Counter fnstudio: thanks for the tips about reduce and emacs/info as well, by the way, i didn't miss those as well ArneBab: glad to help :-) ArneBab: Have fun on your path to Guile! ArneBab: fnstudio: https://www.draketo.de/software/guile-snippets.html#org3f2212c fnstudio: it's very rewarding; i really wish i had encountered lisp earlier in my life fnstudio: wow, that was quick! :) well done ArneBab: would you like to be referenced as person who asked? fnstudio: ArneBab: well, i'm totally happy with that, but i feel i have contributed so little! :) ArneBab: Asking a question at the right time is a skill of its own :-) fnstudio: ArneBab: feel free to reference my name and this bit of the chat (if logged) if you like, but don't feel obliged fnstudio: :) ArneBab: the name fnstudio is ok? (that’s all I see from you) fnstudio: yes, fnstudio is fine ArneBab: thanks :-) — will be updated in a few minutes leoprikler: mwette: my implementations creates one list of N vectors + 2 lists for indexing leoprikler: well, apart from the temporary lists for the function calls, but those are the same for every implementation I'd guess leoprikler: tbf my inc could probably be optimized with vectors tho chrislck: leoprikler: no: older records. (define (make-record-type 'person '(name addr dob))) (define (addr-getter (record-accessor 'addr))) (export addr-getter) chrislck: IIUC this is a change guile-2 to guile-3 whereby getter is now a macro mwette: /quit leoprikler: chrislck: I assume you mean (define addr-getter ...)? leoprikler: Also, Tsukundere does that without error. leoprikler: e.g. in (tsukundere text) #:export (... text-string set-text-string! ...) leoprikler: (define text-string (record-accessor 'string)) leoprikler: (define set-text-string! (record-modifier 'string)) chrislck_: leoprikler: thx for pointer. not sure why mine isn't behaving. will check again. chrislck: funnily enough using guile-3.0.4 in gnucash theres unbound-variable warning for set-tm:mon and friends. these functions are core! leoprikler: are they? leoprikler: perhaps you're forgetting an srfi chrislck: try in repl leoprikler: repl is not reliable for that kind of check chrislck: they're in boot.scm leoprikler: try in script chrislck: no probs inscript lloda: if help says they're in (guile) module they are in core chrislck: importing (guile) doesn't reomve the warning. lloda: what happens if you import specifically that, like (import (only (guile) set-tm:mon)) chrislck: still unbound lloda: hmm leoprikler: could it be that they override stuff in the (guile) module or load their own guile? chrislck: they? no, gnucash tries no such dirty tricks chrislck: all .scm code loaded via libguile.h chrislck: and updating to 3.0 was painful, but done chrislck: now updating to 3.0.4 is showing some warnings... leoprikler: bitvectors am i right? chrislck: nonetheless this set-tm is harmless (for now) and I'll try figure out how to export record getters/setters tohoyn: sneek, botsnack sneek: :) dsmith-work: Happy Friday, Guilers!! tohoyn: daviid: How is the file doc/version.texi generated? tohoyn: str1ngs: do you know about doc/version.texi? tohoyn: I'm trying to debianize g-golf and file version.texi is not found leoprikler: doc/version.texi should be generated by autotools leoprikler: I believe on ./configure leoprikler: but may be sooner tohoyn: ./autogen.sh does not generate it tohoyn: neither does autoreconf -vif tohoyn: ./configure --with-guile-site=yes does not generate leoprikler: $(srcdir)/doc/version.texi: $(srcdir)/doc/stamp-vti leoprikler: $(srcdir)/doc/stamp-vti: … $(top_srcdir)/configure leoprikler: so it should be created by make tohoyn: which Ḿakefile? leoprikler: top makefile leoprikler: the code for generating it should be generated by autotools leoprikler: specifically automake creates Makefile.in, then Makefile.in → Makefile through configure leoprikler: I think automake does that when it sees info_TEXINFOS and the like leoprikler: meaning you'd need texinfo for that to work tohoyn: I can't find the code for version.texi in the top makefile leoprikler: do you have texinfo on your machine? tohoyn: yes, and building g-golf normally works fine leoprikler: hmm does g-golf have subdir make? leoprikler: in that case the code should be under doc/Makefile tohoyn: I found the code in doc/Makefile tohoyn: In the debianized version I found the following: $(srcdir)/version.texi: # $(srcdir)/stamp-vti tohoyn: so there is extra # tohoyn: which is probably the reason why the code does not work leoprikler: how did this get there? tohoyn: no idea tohoyn: I use debuild to build the package tohoyn: I generated the debian files with debmake tohoyn: found the following in doc/Makefile.in: $(srcdir)/version.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/stamp-vti tohoyn: so the key seemns to be @MAINTAINER_MODE_TRUE@ tohoyn: it seems that the debianized version is not configured in maintainer mode tohoyn: added --enable-maintainer-mode to the configure commmand in debian/rules. now the documentation builds ok. tohoyn: Now I get "4 of 6 tests failed" tohoyn: In non-debianized code it is 3 of 6 tohoyn: It seems that I don't have the Clutter library tohoyn: In which package the Clutter introspection files are located? tohoyn: already found srandon111: anyone running guile on dragonflybsd ? chrislck: leoprikler: thx for pointers -- you gave confidence that modularisation could progress and it did leoprikler: I did? Modularisation of what? leoprikler: Either way, I'm honoured :) chrislck: leoprikler: modularise gnucash. it started 20yrs ago when guile was nowhere as strict on modules and stuff dsmith-work: srandon111: No. But I've always been interested in dfly. Seems like some *very* good ideas in there. davidl: Can you do say sleep 60 in guile in some native way without using for example (system "sleep 60") ? davidl: I want to run some procedure at a specified interval davidl: (and also background the script, or daemonize it) mwette: (sleep 60) davidl: mwette: thanks, not sure how I missed that, I have auto-complete for it even xD ane: what would be a name for a guile program's equivalent of the site-lisp directory ane: ane: $prefix/program/scheme $prefix/program/guile ? ane: i.e. distributed scm files in the program's load path ane: gdb seems to use $prefix/share/gdb/guile rekado: ane: $prefix/share/guile/site/3.0/$program rekado: and for compiled files: $prefix/lib/guile/3.0/site-ccache/$program/ leoprikler: well, that's assuming that you can name all your modules (program something) leoprikler: if you need your own namespace for whatever reason, gdb's way is also sane mwette: $prefix/share/guile/site and $prefix/share/guile/3.0/site civodul: i wonder if we should ignore GUILE_LOAD_PATH until after scm_load_startup_files has been called civodul: it's annoying that we're stat'ing so much when GUILE_LOAD_PATH is set dsmith-work: I don't remember, can guile load a module from it's .go file *without* having the .scm file? civodul: i think so though we're not doing that anywhere civodul: yeah it's a bit ridiculous that we're stating .scm files and then not opening them civodul: this is to allow for the timestamp-based auto-compile logic dsmith-work: Right. dsmith-work: Just wondering if it knew to look for a compiled file if there was no source. dsmith-work: Thinking about embedded systems with limited "disk" space. mwette: I have done this using load-compiled, IIRC. I can check ... mwette: ... not clean. I ran guile with --no-auto-compile, then load-compiled the .go files, then (use-modules ...). dsmith-work: So pre-load the .go files? And then use-modules just uses them? mwette: This was years ago, but I'm guessing I tried to get it to load .go files automatically but didn't make it. mwette: I think so. It's been a while. That was with 2.0.13 IIRC, and worked with 2.2 IIRC. dsmith-work: Thanks. I think I'll give it a try this weekend. civodul: yeah load-compiled does the trick, but plain use-modules does not leoprikler: It's great to see how far in the past Wikipedia can be at times: "PyGTK will be phased out with the transition to GTK version 3 and be replaced with PyGObject." dissoc: what is the proper way to write code for multiple functions to dissoc: execute on a data structure to keep the code more readable?? dissoc: (do-something-1 (do-something-2 (do-something-3 %my-list)))? is there something similar to threaded macros like in clojure? leoprikler: (define do-something-big (compose do-something-1 do-something-2 do-something-3)) dissoc: excellent. thank you very much leoprikler: daviid: https://gitlab.gnome.org/Infrastructure/gtk-web/-/merge_requests/104 daviid: leoprikler: nice, where do i click to see the change you proposed, in that page 'request?' leoprikler: you can either go to the changes or browse the pipeline daviid: i really think, if that is not the case yet, that we shgould refer to "Guile Scheme" in the titles, every where, thenin the apropos before G-Golf and Guile-GI, saying thet guile scheme is, and is par t of gnu (so is G-Golf by the way ... daviid: ahok, you did call it guile scheme, excuse my note then ... leoprikler: I did not yet write "GNU G-Golf" though daviid: leoprikler: great, because now, the parent page will list 'us' as is, if the change is accepted, thanks so much, let's see daviid: leoprikler: it's not important, at least not for now daviid: leoprikler: the important thing is "Guile Scheme", in there, in the parenbt page, and hopefully in the front page ... then users who are interested will end-up visitig guile-gi and/or g-golf pages ... but you may add GNU G-Golf if you wish, for me it's ok either way ... daviid: i'd say let's wait to see if they accept this change request first ... leoprikler: I have a bad experience with changing merge requests post initial commit, so I'll let it sit until someone responds anyway. daviid: leoprikler: i totally agreee with you, let's wait leoprikler: FWIW people will notice that you're hosted on gnu.org since links come in full text daviid: leoprikler: right this to ... so now, can I sea a 'renedered' version of your request, or is it just waitit till it rebuilds? daviid: *see :) leoprikler: the CI pipeline did already finish leoprikler: https://leoprikler.pages.gitlab.gnome.org/-/gtk-web/-/jobs/1020723/artifacts/public/docs/language-bindings/guile.html daviid: leoprikler: perfect, tx daviid: leoprikler: does one has to proporse a change of the parent page as well, or this is all auto when accepted? leoprikler: I'm not sure what you mean by "parent page" daviid: I mean the 'Language Bindings' on the left, is the page users land when they click 'other bindings' on the front gtk.org page leoprikler: that sidebar is likely auto-generated daviid: ok, so i guess the page as well, this page i mean - https://www.gtk.org/docs/language-bindings/ leoprikler: nope, that is hand-written daviid: hum i see that page lists "Scheme' on its left menu, then not in the page itself ... maybe a bug in tehir CI, don't know leoprikler: I don't have enough experience with Guile-GI or G-Golf to claim that either support Gtk 4 leoprikler: no it's not leoprikler: they also mention D and Go, but those don't have subpages daviid: leoprikler: i am prety sure they do, but i can't compile gtk4 now, i tried ... it will be in debian testing soon, it is in experimental, but the gnome team told me it is too old to be usefull to try anything with it daviid: leoprikler: right i did see that too, and i thing these D and Go are recent leoprikler: Go is at least older than the Scheme subpage daviid: ok, anyway, we need to be on this page as well, in the menu on the left (I guess it will be update after your last request is accepted, if it is ...) and in the page itself ... would that be a manual change we need to provicxe them with as well then? leoprikler: you say that, but how exactly do you want me to do this? leoprikler: the format is daviid: leoprikler: hum, i guess Guile Scheme v3 not v4, we will update with v4 asap leoprikler: and simply link to the subpage instead of the impls? daviid: leoprikler: or maybe we should wait then, not sure anymore :) leoprikler: I mean, it would make sense if *all* the table entries could link to their respective subpages, buuuuuuuuut… daviid: let's wait for that page then, they told me they are reforming thing for 4.0, i don1t you to loose too much time on this, you have done much already ... tk again leoprikler: no problem, let's see how things look after 4.0 hits leoprikler: btw. any news on that 0.1 release for Guile 2.2? leoprikler: or are you planing to do 3.0 compat before that? daviid: leoprikler: yes, let's wait their 4.0 pages reform(s) daviid: compat with 3.0 depends on guile maintainers, i need to fix one more important bug, complete the user manual, then i'll release, but i don't want to promise any specific time, i am on it, all i can say ... daviid: leoprikler: i have to go now, bbl, tx leoprikler: I should sleep too daviid: good sleep then daviid: dsmith-work: hey, nice Gtk/Scheme 1997 quote :), once they will have accepted all our request, if they do ..., and everybody is cool, relax, 'in peace', i'll ask them 'what happened? why on earth aren't all (gnome team written) applications written using guile? :):) - and post the quote, then suggest they ask that question to the 'hitch hickers guide to the galaxy computer' :) tohoyn: sneek, botsnack sneek: tohoyn, you have 1 message! sneek: tohoyn, daviid says: you can certainly prepare things, and I will be pleased when G-]Golf is in debian, but I have to warn you that it might take more tjime and be more dificult then it seems - (a) g-golf doesn't not work with guile 3.0 (which introduced changes in the module system, that breaks module-use!) and debian wants to withdran guile-2.2 from bullseye sneek: :) ArneBab: daviid: as an example of two implementations you can note xlib and xcb leoprikler: daviid: GObjectIntrospection happened. leoprikler: IOW they used XML instead of Scheme, probably so that they wouldn't have to fire up an interpreter in an interpreter leoprikler: it would be worth to adapt some existing code to use guile, however, e.g. replace Script-Fu in GIMP srandon111: people let's admit it... guile is a failed project sneek: Welcome back srandon111, you have 1 message! sneek: srandon111, catonano says: no sorry i don't recognize you ! Who are you on the fediverse ? 😀️ srandon111: sneek, what's up ? leoprikler: srandon111: how so? ArneBab: srandon111: I disagree srandon111: leoprikler, give a look at the docs srandon111: most of the stuff is cryptic srandon111: no examples srandon111: difficult to advertise the language davidl: leoprikler: thx, delete-duplicates works just as well. RhodiumToad: it certainly failed at the goal of being the extension language for everything. srandon111: RhodiumToad, yeah davidl: srandon111: is guile not a revived project thanks to Guix? davidl: srandon111: you are certainly right though regarding examples in the manual. leoprikler: I don't really know about "most of it", but yeah, some of it certainly is. leoprikler: That being said, I've found the manual useful more often than not. leoprikler: as far as being a universal extension language is concerned, so did tcl and every other language that wants to claim a huge market share ArneBab: srandon111: there are too few examples, that’s true. But Guile is a language in practical use. ArneBab: It is also continuously improving and I use it for most of my personal tools. leoprikler: even Javascript, the de facto language of current year and all years to come due to browsers is replaced with other languages all of the time davidl: srandon111: have you tried emacs+geiser+guile? It's really nice, hard to leave. With some updates to the manual I think it could slowly gain a significant amount more attraction than it seems to have done so far, also thanks to Guix. srandon111: ArneBab, wht do you mean in practical use? srandon111: davidl, yes the problem is still updates to the manual also the fact that there are no cookbooks book srandon111: but only the single manual srandon111: as i said it makes the experience more cryptic and frustrating ArneBab: I mean that nowadays my whole system is controlled by Guile (via Guix) and I write most of my tooling in Guile. ArneBab: The experience is less smooth than with Python, and there are fewer libraries, but it is similarly nice to use. ArneBab: (after a more rocky start) leoprikler: cookbooks for a language are hard to get right leoprikler: it might work for DSLs like Ren'py, but even Vala, which limits itself to "just" the GNOME ecosystem can't possibly cover all use cases in a cookbook ArneBab: We don’t have to cover all use cases. We just have to cover the common ones. For the rest there’s the reference manual. ArneBab: srandon111: did you already have a look at SRFIs? Those are an essential part of Guile. srandon111: i wasn't brave enough ArneBab srandon111: after having given a look at the docs ArneBab: srandon111: try it with this? http://www.draketo.de/py2guile srandon111: ArneBab, wow thanks that surely helps! ArneBab: My first step into Guile Scheme was http://www.phyast.pitt.edu/~micheles/scheme/ srandon111: ArneBab, are you aware of other books made as cookbooks or similar to these ones for other schemes? e.g., chez/chicken ? srandon111: ArneBab, i actually know some scheme srandon111: i used to do something with racket srandon111: although it's not considered a pure scheme now ArneBab: srandon111: I wrote py2guile — I wrote it while moving to Guile srandon111: ok thanks ArneBab ArneBab: (just so you know that it’s subjective) srandon111: i think that people like is what the guile community needs davidl: leoprikler: I tried to write some slightly advanced SXPath expressions with guile - and the manual section on that is really crypic. I had to find this from 2004: http://okmij.org/ftp/Scheme/lib/SXPath.scm and half-way through there is a test suite showing the corrsponding SXPath expressions. Things like that should be in the manual. ArneBab: srandon111: I’m not aware of other cookbooks davidl: ...or in some cookbook. srandon111: ArneBab, ok ihavee to popularize yours then *: ArneBab is happy :-) srandon111: davidl, that's the thing there are no cookbooks ArneBab: I have a (still) handwritten article how I develop with Guile Scheme nowadays (with records, let-recursion and inner defines) — but I’ve been planning to type it for more than a year now … davidl: srandon111: yeah its unfortunate. Im still hopeful though :-) ArneBab: records are what’s mostly missing from py2guile, because I only understood them much later — but they should be introduced very early. ArneBab: srandon111: and you can do things with Guile that I have not seen anywhere else. These two are my examples: ArneBab: - https://hg.sr.ht/~arnebab/dryads-wake/browse/dryads-wake.w?rev=c677727bbd2c#L1219 — see https://archive.fosdem.org/2017/schedule/event/naturalscriptwritingguile/ ArneBab: - https://hg.sr.ht/~arnebab/wisp/browse/examples/hamming.w?rev=ad2b1867648a#L64 ArneBab: But do look at Guix ArneBab: It’s a distro that doesn’t break if it loses power during an update ArneBab: (and it is more idiomatic Guile than what I do) leoprikler: Do Guile's hash table handles remain valid for as long as the table is not cleared? leoprikler: (or well, remove is called) civodul: leoprikler: what do you mean by "valid"? civodul: ah sorry civodul: by "handle", you mean the key/value pairs? civodul: i would not attempt to capture them civodul: resizing the table may invalidate those pairs civodul: and resizing can happen "anytime" leoprikler: thanks for clearing that up leoprikler: if I use something mutable as cdr, that will stay the same throughout resizing, though, right? leoprikler: e.g. (hashq-create-handle myhash key (make-variable value)) => $1 leoprikler: (let ((var (cdr $1)) ;; capture var … civodul: sure, values associated with keys remain valid civodul: fortunately :-) dsmith-work: daviid: When Gnome was just a hacker project, Scheme was cool, but as soon as all the paren-phobic commoners arrived, it fell out of favor.. chrislck: question: Why does (export ) fail with Bad symbol to module-add: is a make-record-type getter/setter? leoprikler: Ehm, what does the full code for that look like leoprikler: do you have (define-record-type ... (field field-getter field-setter)) (export field)? mwette: I have a macro for the iteraction over cartesian products I asked about yesterday. The format is `(for-each-combo proc l1 ...)' where l1 ... are N lists and proc is a procedure taking N arguments, one from each list. See here: https://paste.debian.net/1175480/ mwette: it's not quite working yet, but getting close mwette: correction it is working -- I left 1st line off expected output. leoprikler: small comment regarding the variable names: I think arg and i would be a little clearer RhodiumToad: surely there must be an easier way RhodiumToad: you don't care about the return values? fnstudio: hi! what's the equivalent of `(filter even? '(1 2))` if i want to filter true values? fnstudio: basically, what's the idiomatic/right way to check `true?`? fnstudio: actually, i'm interested in `count`, i think fnstudio: as in `(count true? a-false-true-list)` to count the times true occurs in the list fnstudio: but i'm the feeling i'm missing something very obvious RhodiumToad: (count identity blah) ? RhodiumToad: note that anything that isn't #f counts as true fnstudio: let me try fnstudio: thanks, noted with regard to all that's not #f is passed as #t fnstudio: RhodiumToad: (count #t my-list) doesn't seem to work RhodiumToad: because #t isn't a procedure fnstudio: oh fnstudio: you actually meant identity fnstudio: sorry RhodiumToad: count applies the procedure to each list element and counts the number of times that the application returned a true result fnstudio: and identity is a procedure... cool RhodiumToad: yes, (identity x) just returns x fnstudio: very cool fnstudio: thanks RhodiumToad that solved my problem, much appreciated! RhodiumToad: (map (compose not not) somelist) will take a list and change all the true values to #t, leaving #f alone fnstudio: that sounds like something that will come in handy at some point, good to know, thanks fnstudio: is there an exclusive or available somehow built-in? RhodiumToad: one that works with arbitrary values, not just #t and #f ? fnstudio: RhodiumToad: just #t and #f RhodiumToad: (not (eq? a b)) works for that, whereas (eq? (not a) (not (not b))) works in the more general case fnstudio: excellent, i should have thought of that fnstudio: thanks dsmith-work: RhodiumToad: Didn't see the double not on the second example. dsmith-work: Had me tied up in nots thinking about how it's not the same.. RhodiumToad: (not (eq? (not a) (not b))) also works RhodiumToad: so with regard to cartesian product macros, how about https://dpaste.org/spD1 RhodiumToad: (but if I needed a cartesian product, I'd think twice about making it a macro) leoprikler: RhodiumToad: That creates N lambdas, which might not be what you want leoprikler: mwettes solution is better in that regard, since it only uses a few lets leoprikler: though I'm not sure how it compares performance-wise to mine or foof-loop + generators RhodiumToad: I wouldn't do it as a macro except perhaps as an optimization. seems to be no reason for it leoprikler: sure, just wanted to point out that you can optimize it as procedure mwette: I think non-macro solution is preferred, but I could not think how w/o generating a single list-of-lists first, and that not scale well wrt memory usage. RhodiumToad: what memory usage are you concerned about? RhodiumToad: are you going to be calling this a very large number of times on small lists, or fewer times on very large lists? mwette: prod of ten lists of ten items would generate 100 lists of ten items. mwette: vs my macro which generates no extra lists, just lots of references to pairs mwette: (lots = ~ twenty) mwette: weakness of my macro design is that null? is evaluated a lot RhodiumToad: how many lists do you expect to be using? mwette: but I can fix that mwette: three RhodiumToad: always? mwette: If I design an algorithm, I want to be able to use it later for other purposes. RhodiumToad: sure leoprikler: ane: I don't think so. What if you are loading a compiled module without sources? leoprikler: though I have little knowledge over with-coverage-data and its intrinsics remby: is r6rs complete? remby: yeah I suppose so, the html docs say so, but the info says otherwise ryanprior: How do you read the Guile reference materials in Emacs? ryanprior: Found my answer: C-u M-x info, then select the guile info docs remby: info, search guile remby: that too ryanprior: :) ryanprior: How often are vectors used in idiomatic Guile? ryanprior: Coming from Clojure I make heavy use of vectors by habit. But comparing SRFI-43 to SRFI-1 it seems like Guile supports a much richer API for linked lists than for vectors. chrislck: well... guile is a lisp, not vecp ryanprior: I appreciate that chrislck =D chrislck: depends how you tend to use your data... sequential? random? need to append constantly? ryanprior: Random, few appends chrislck: if length is <100 likely equivalent performance but lisp/guile does teach you/require that you use lists well ryanprior: I do work with enough data that using linked lists is not an option ryanprior: Some typical operations might be to take a slice of from some offset to another, or from the offset searching forward until a predicate returns false, or every nth element. ryanprior: I'm looking for ways to do those things in Guile :) ryanprior: How do you look for features you want to use in Guile? ryanprior: For example, I'd like to partially apply a function. I tried searching the info docs for "partial" but there's a ton of hits, hard to know how many total, and I looked at a couple dozen that didn't apply before giving up. ryanprior: I tried searching for "partial appl" and there's no hits. ryanprior: I tried searching DuckDuckGo for "site:gnu.org guile partial application" and all the hit are for packages in Guix that do partial application in some other language like common lisp or python ryanprior: So regardless of whether you know how to partially apply a function in Guile, if you're in my shoes and don't know and want to find out, what's the winning strategy? remby: ryanprior: is that also known as currying? remby: if it's a general concept it might just do to search with "scheme language" instead of guile RhodiumToad: there is srfi-26 ryanprior: They are related but not the same! With currying, every function takes exactly 1 argument, so for n arguments you do n applications. With partial application, you can specify multiple arguments per partial application. remby: oh I see RhodiumToad: (cut foo 1 <>) returns a function of one arg which calls (foo 1 x) on that arg ryanprior: Okay srfi-26 does look helpful, I can get some mileage out of that. In general though how do you find which srfi gives you what you want? There's hundreds of em, do you have the most useful ones memorized? RhodiumToad: I have found that frustrating ryanprior: There's a list of implemented ones in the info manual, but beyond just scanning the one-line descriptions in that list, I don't know how to search in info manuals very well. RhodiumToad: it's often not at all obvious that some srfi applies to some task, and also there are often several srfi's to do exactly the same thing RhodiumToad: e.g. srfi-8, srfi-11, srfi-71 RhodiumToad: (of which srfi-8 is a bit limited, srfi-11 is paren hell even by lisp standards, and srfi-71 relies on redefining standard syntax) ryanprior: lmaoooo the entry for sfri-8 says "documented in 'Multiple Values'" and the entry for Multiple Values says "(see SFRI-8)" ryanprior: [pointing spider mans intensifies] RhodiumToad: srfi-8 is the (receive) syntax defined under "Multiple Values" RhodiumToad: it's provided by including either (ice-9 receive) or (srfi srfi-8) ryanprior: Unfortunate that srfi-26 implements cut but not partial or right-partial. And cut can be used in place of partial, sure, but it can't be used in place of rpartial with a variable number of arguments. RhodiumToad: that seems harder to do efficiently ryanprior: The implementation would be something like ryanprior: (defmacro (right-partial f #:rest args) (lambda (#:rest more-args) (apply f (append more-args args)))) RhodiumToad: I think append! would be safe there ryanprior: Yes that would make sense RhodiumToad: I'm pretty sure a rest-args list is always a new list, even if it came via apply RhodiumToad: but I'd have to check that ryanprior: Yeah I tend to go with copying by default unless I've identified a specific performance concern :) ryanprior: Especially when I'm working with persistent immutable data structures, which are also on my list of things to find or implement for Guile RhodiumToad: r7rs-small, at least, explicitly specifies that a rest-args list is newly constructed RhodiumToad: haven't checked r6rs or r5rs tohoyn: sneek, botsnack sneek: :) tohoyn: daviid: is it time to debianize g-golf? tohoyn: daviid: I've got a sponsor for Debian packages. tohoyn: daviid: BTW, does g-golf work for guile 3.0 now? leoprikler: daviid: The documentation for Scheme bindings has apparently been merged leoprikler: sneek later tell spk121 the documentation for scheme bindings has apparently been merged sneek: Got it. leoprikler: ryanprior: I think those SRFIs do not solely speak for Guile, but for what you can reasonably expect from *any* Scheme. leoprikler: Guile does have its own array API, which works on vectors, bytevectors, etc. leoprikler: I haven't looked into Clojure, but perhaps you could port some of the stuff you really need into a compatibility library? cairn: I love the illustrations on the homepage. =) lloda: ryanprior: srfi-71 replaced almost all my uses of srfi-8 lloda: some srfis are very standard, others have been superseded by newer ones, it's a very mixed bag lloda: often there are 3 or 4 that do the same thing in slightly different ways chrislck: Ongoing Queries wrt trying to clean up modules: I see in guile-json the convention to have a toplevel module (json) which re-exports publics from submodules (json builder) (json parser) etc chrislck: Question: what's the convention if the submodules must access each other? (@@ (top sub1) func1) must access (@@ (top sub2) func2) chrislck: (apart from complete refactoring) chrislck: Constraint: all .scms for this modules will be in the same folder. mwette: I'm looking for a solution to this problem: I want a way to evaluate a procedure of N arguments against all combinations of elements in N lists of unknown length. Any hints? mwette: ^unknown at compile time, that is chrislck: import itertools :) leoprikler: mwette: unknown fixed length? leoprikler: chrislck: @@ is an option, so is autoload leoprikler: other than that you can of course introduce another layer leoprikler: e.g. (package foo) (package bar) (package foobar-common) mwette: meaning the lists are any length (e.g., not the same length) but (length l1) mwette: works leoprikler: okay and it should give all pairs of 1 each, e.g. (1 2) (a b) => ((1 a) (a b) (2 a) (2 b)) mwette: yes, like https://docs.python.org/3/library/itertools.html#itertools.product mwette: yes, if you meant ((1 a) (1 b) (2 a) (2 b)) leoprikler: oops yeah leoprikler: hmm, you could make that a generator, but I assume you want a list as result? chrislck: nested named let loops? leoprikler: not really leoprikler: first you (map length lists) leoprikler: then you get something like (2 2 3 ...) leoprikler: and then you have a running index with all 0s of (length lists) leoprikler: hmm let me code that quickly mwette: I guess just a cartesian product of lists would work on for-each: (for-each (lambda x) (apply proc x)) (c-prod l1 l2 ...)) leoprikler: what is c-prod in this case? chrislck: cross-product I guess leoprikler: the function your looking for, right? mwette: yes mwette: cartesian product -- cross-product can mean something else I think davexunit: does guile have anything built-in to mark a procedure as deprecated? chrislck: I'm thinking "nested for-loops go brrr" lloda: i like outer product, like in apl chrislck: oh yeah cross product needs ,use (geometry 3d) lloda: i have this https://notabug.org/lloda/guile-ploy/src/master/ploy/basic.scm#L93 lloda: it doesn't keep the structure, meaning that the result has rank 2 and not rank (number of arguments) lloda: you can fix the amend-map! if that's what you want mwette: OK -- thanks lloda: append-map! i mean sry leoprikler: Probably too smart for its own sake, but: https://paste.gnome.org/pon8aaabn mwette: leoprikler: thanks, i'll take a look later dsmith-work: Wednesday Greetings, Guilers lfam: I wonder, does anyone have a Guix package of the Glimpse image editor (fork of GIMP)? lfam: Sorry, wrong channel mwette: not working, but this is what I was thinking: https://paste.gnome.org/psvwrj0m8 leoprikler: mwette: expanding in-place to get the compiler to do the dirty work for you? leoprikler: If not, just modify mine to take a callback as first argument instead of returning a list. mwette: Well, I think it will be more efficent than building up the list of combos. It probably also scales better. leoprikler: mwette: fair enough, but what about https://paste.gnome.org/ptjeq0vie manumanumanu: lloda, ryanprior : srfi-71 is really the king of multiple values! I have started using it all the time, except for when I want to use letrec, since the expansion doesn't seem to be optimized the same way as guile letrec manumanumanu: I have an extension to it that does pattern matching using (ice-9 match) somewhere manumanumanu: Since everything not (values bla bla bla) can be assumed to be a pattern manumanumanu: I never nailed the semantics down fully, which is why I never quite released it though. manumanumanu: (let* ...) was easy. RhodiumToad: wait, why would something other than (values bla bla) be a pattern? manumanumanu: Since srfi-71 let is more or less void of extra parentheses, I made a version where a everything in parens except (values ...) which is already special syntax in srfi-71 an (ice-9 match) pattern manumanumanu: meaning I could potentially do (let (((fst snd thrd . rest) _ (list-partition odd? my-list))) ...) to bind the first three values in the list satisfying odd? in list-partition RhodiumToad: oh I see manumanumanu: or (let (((fst1 . _) (fst2 . _) (list-partition ...))) ...) manumanumanu: to get only the first values satisfying and not satisfying the predicate manumanumanu: but I am easily bored, and I got some problems where I couldn't figure out how to make it act like a let instead of let*. manumanumanu: so I left it. The code is easily 10 years old, and I was not that good with macros. leoprikler: speaking about ice-9 match, wouldn't match-values be a good addition? manumanumanu: like in racket? leoprikler: dunno, I rarely look at other schemes leoprikler: though matching hash-tables and list-no-order seems fun manumanumanu: guile already has a list-no-order-like matcher in (sxml match) (???) manumanumanu: but extending (ice-9 match) means breaking with upstream. manumanumanu: BUT: doing it in a backwards compatible manner is actually doable! You can check with syntax-local-binding is an identifier is bound as a valid pattern matcher and only then do something other than upstream manumanumanu: which brings the other problem: racket has named pattern matchers. To match a list you need to do (List a b c), which lends itself well to extendibility. leoprikler: but, but… that's more typing! manumanumanu: but it is extensible in a way that isn't a hack :) Trivia in Common Lisp went the same way IIRC ,but with even better pattern compilation. Trivia beats racket when it comes to generating good matching manumanumanu: Tonight's hacking done! good night! davidl: is there any srfi module that has basic list things like unique or flatten operations on lists? dsmith-work: davidl: srfi-1 has basic list stuff, but not unique or flatten, IIRC> davidl: dsmith-work: thx. I wrote my own unique. davidl: for posterity: (define (unique lst result) davidl: (if (equal? (length lst) 0) davidl: result davidl: (if (not (member (car lst) result)) davidl: (unique (list-tail lst 1) (cons (car lst) result)) davidl: (unique (list-tail lst 1) result)))) leoprikler: w.r.t. unique, what about delete-duplicates tho? daviid: leoprikler: hello! yes I did see that, thanks, I was actually talking to one of the reponsible person for the site yesterday and he didn't mention but it ars he merged while we were conversing about this ... leoprikler: Ah, I see. leoprikler: Though to be fair, we are still waiting for GNOME to notice us. The next step would be to get either g-golf or guile-gi into peas. daviid: leoprikler: I actually initially asked them to be on the front page, and that is, surprisingly, quite a lot more difficult then i thought, but ... leoprikler: Imagine writing plugins for Gedit, Totem or Builder in Scheme. dsmith-work: As it was *supposed* to be. dsmith-work: https://mail.gnome.org/archives/gtk-list/1997-August/msg00123.html dsmith-work: "We plan to use GTK/Scheme bindings for coding small utilities and applications. When these bindings are more mature, it should be possible to write complete applications in Scheme." daviid: well, that is not what that page is for, it is for wrinting your own app in your own language, guile scheme is actually quite a lot superior to other choices imo, but let me focus on something i wanted to share with you ... daviid: and let's focus on trying to appear on the front page daviid: i wanted to suggest we rename that page "Guile Scheme", and not talking about any other scheme, nor what scheme is, how mny impl there are out there ... for two main reasons daviid: two reason to try to be i the front page i mean- (a) because on the parebnt page, the one users will see when they click 'language bindings', i'd like to appear as "Guile Scheme" (and others may want to appear as, say, "Racket", Chibi ... daviid: the second reason is because then that name can be on the front page, if they accept to add guile scheme to the front page ... daviid: the oother comment he made was: it is unlikely to happen because you have more then one implementation ... to what i asnwered - no problem, you add (ask to add) "Guile Scheme" to the front page notebook as a tab, with that title, and then a @subheading (a la texinfo, justr strong font) with "G-Golf", then velow the example, then another @subheading with guile-GI, then its example, or, did i say, anything other way to present that the daviid: gnome designers would prefer leoprikler: Even if we limit ourselves to Guile Scheme, though, there is the problem of having two warring implementations leoprikler: So you need nested tabs and everyone hates nested tabs daviid: so here we are, the last comment he made was 'he will ask, but nothing will change within the next few weeks, because they are reformating things for 4.0 leoprikler: Also, some of those other Scheme implementations do come with Gtk bindings OOTB, they're simply not documented as part of GNOME. leoprikler: (and probably of questionable quality too, but eh…) daviid: they are not warring, and i don1t by that argumewnt (of them), 21st century, gnome team designers ca't think of a nice way to presnet more then one example (GI binding impl) for one language ... that doesn't make sense to me, even I, with no particular design habilities, could come up with some descent way to presne things ... daviid: anyway, i wanted to ask you to change the title page, that way the parent page will list Guile Scheme" and I can ask after 4.0 redesign is out ... daviid: forget about evaluation of G-Golf and Guile-GI, that is for users to make, not the gnome team, nor anyone of us, i defend that G-Golf is of excellent quality, with room for improvements of course, but the design anbd what is there is prety good (not perfect, but very good) daviid: but anyway, we will have asked ... and thanks for your work! leoprikler: no problem daviid: sneek: later tell tohoyn, you can certainly prepare things, and I will be pleased when G-]Golf is in debian, but I have to warn you that it might take more tjime and be more dificult then it seems - (a) g-golf doesn't not work with guile 3.0 (which introduced changes in the module system, that breaks module-use!) and debian wants to withdran guile-2.2 from bullseye sneek: Okay. daviid: by the way i thought python had more then one GI binding as well, just curious leoprikler: there is pygtk IIRC, but that has been deprecated since ages daviid: ah ok, so they really have one set of bindings then leoprikler: I'm also sure that between guile-gi and g-golf one of them will claim "victory" at some point and the features of the other might somehow be merged. dsmith: sneek: botsnack sneek: :) dsmith: goodbot dsmith: sneek: goops? dsmith: daviid: No remembered things matching that I guess dsmith: sneek: goops-tutorial? sneek: Someone once said goops-tutorial is https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ dsmith: sneek: goops-tutorial sneek: Last time I checked goops-tutorial is https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ dsmith: Ahh. dsmith: query sneek daviid: dsmith: great, i think i did try goops, GOOPS, and goops tutorial, but didn't try goops-tutorial ... :) - my bad ... dsmith: It's nice to be able to find something, if only I could remember what it's called.... dsmith: naming is a hard problem. dsmith: sneek: hard problem is There are two hard problems in CS: cache invalidation, naming things, and off-by-one errors. sneek: Okay. daviid: dsmith: yeah, the usual ... 'problem', i thought we did add the sneek help on the name 'goops' and also thought it could search on more then one word, hence my attempt on 'goops tutorial' ... but i's ok, i'll try to remember it is 'goops-tutirial' for the next occurrence :) dsmith: daviid: The bot does accept SQL wildcards: dsmith: sneek: goops%? sneek: goops-tutorial is https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ daviid: ah great daviid: but it needs the ? dsmith: sneek: goops% daviid: sneek: goops* sneek: goops-tutorial is https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ dsmith: Nope dsmith: The wildcard is % not * daviid: ah ok dsmith: select field from table where key like '%wild%'; daviid: yeah, i forgot my sql 'knowledge' ... a while i didn't have to sql daviid: foliot extensively uses it, but it been ages i use it and did not program .. but soon, i'll port it to g-golf, so i'll get a bit of sql knowledge back .. dsmith: I have only the most rudimentary knowledge. Never quite got the different kinds of joins. dsmith: https://martinfowler.com/bliki/TwoHardThings.html weinholt: daviid, yeah, no need to patch Makefile.in wingo: weinholt: good news, the md5 bug would seem to be a peval bug wingo: so it should be easy to pin down chrislck: more unbound-variable madness: warning: possibly unbound variable `set:tm-mon' -- I thought set-tm:mon was core weinholt: wingo, cool tohoyn: sneek, botsnack sneek: :) dustyweb: o/ ane: ugh, isn't it enough to just (use-modules (foobar)) for with-coverage-data to "see" it when instrumenting code? daviid: 3 warnings and it fails when it enters 'doc', with 0 (%resolve-variable (7 . #{\#t}#) #) ... Unbound variable: #{\#t}# daviid: I actually didn't write any of the guile-lib code, nor the doc, and so far only did 'admin maintaince' - so if any one wants to help, welcome ... weinholt: daviid, i have some patches for guile-lib, one of them fixes that #{\#t}# problem weinholt: daviid, and i'm sure i don't know what goops tutorial you're talking about :) daviid: weinholt: i need to rest, but talk tomorow ... tx chrislck: civodul how to remove unbound-variable new between 3.0.2 and 3.0.4 ? compiling gnucash with 3.0.4 causes too many warnings. civodul: chrislck: hi! i don't understand the question civodul: "new" is unbound? chrislck: "new" warnings chrislck: https://github.com/Gnucash/gnucash/blob/maint/bindings/guile/utilities.scm#L20 shows %auto-compilation-warnings was set precisely to remove unbound warnings for a very long time chrislck: since I upgraded ubuntu to 20.10 ie 3.0.2 to 3.0.4 there are now numerous warnings all over the place chrislck: IOW up to 3.0.2 no warnings, and now too many warnings civodul: oh, what kind of warning? civodul: i don't think there are new warning types in 3.0.4 civodul: however, there's a new "warning level" interface civodul: see NEWS chrislck: https://pastebin.com/raw/M8i4E30L chrislck: I saw that NEWS, didn't understand the interface civodul: settings %auto-compilation-warnings like you do should work, though civodul: oh but wait, that's when running "guild compile", right? chrislck: yes %auto-compilation-warnings didn't need to be set for each every .scm so far civodul: "guild compile" doesn't care about %auto-compilation-warnings chrislck: is this a bug then? leoprikler: I don't think so. You should be able to pass -Wno-unbound-variables to suppress the warning IIUC. leoprikler: or rather passing any set of warnings manually will trigger guild to use your set instead of the default chrislck: is there an ENV var we could set to suppress warnings wit guild? chrislck: dont want to touch 100s of .scms leoprikler: Okay, -Wno does not exist, but -W0 does leoprikler: So simply do -W0 in front of your other compilation options and you should be a-ok. chrislck: let's try chrislck: works \o/ chrislck: wouldn't be useful to suppress *all* warnings though leoprikler: in my personal opinion unbound-variable is one of the most important ones. leoprikler: But if you have a module, that does higher tier magic, you may end up using it regardless. chrislck: the structure of .scm in gnucash makes it tedious chrislck: is it possible to disable unbound-variable alone? leoprikler: As I said previously, there sadly is no -Wno leoprikler: You'll have to -W0 and then enable all the warnings you want chrislck: hm ok chrislck: I've filed bug in gnucash: https://bugs.gnucash.org/show_bug.cgi?id=798034 not sure what is the best option leoprikler: chrislck: you are missing some obvious options in your listing leoprikler: the option to compile gnucash in a manner that makes these variables bound as they should be! dsmith-work: Monday Greetings, Guilers dsmith-work: daviid: need to add a '?' to query the bot. Hmm. Sadly, it's offline at the moment. :( daviid: dsmith-work: ok, i'm pretty sure I didn't use ? when i asked for guile-software, but ... daviid: weinholt: ok, I am available, when you are, let me know, we'll fix guile-lib with those patches you have ... tx dsmith-work: daviid: You may very well be right. I don't remember right now. weinholt: daviid, it's just some small things: https://salsa.debian.org/debian/guile-lib/-/tree/master/debian/patches weinholt: daviid, also interesting perhaps is that i compile md5.scm with -O0 for guile 3.0, because otherwise the tests fail wingo: yeeps! weinholt: indeed daviid: weinholt: ok tx, will look at those - and yes, i did see that the test fails, did you patch the unit-test/Makefile.am, how do you ask to compile -00 for only one file? weinholt: daviid, it's a hack in debian/rules (easier to manage than a patch file): https://salsa.debian.org/debian/guile-lib/-/blob/master/debian/rules daviid: weinholt: I wonder how to do that using the autotool chain, i guess it is possible, if anyone knows ... weinholt: daviid, i'd try to copy the ".scm.go:" rule as "md5.go:" and add -O0 in the copy. just a guess. daviid: weinholt: i'll try that tx *: daviid is abit on and off, sorry, but will get there, i hope :) daviid: wingo: hello! on another subject, I need your personal help :), g-golf doesn't compile/run using 3.0.4, because module-use! fails - the module-use! code hasn't changed, but things changed in the module system that make it fail ... daviid: wingo: it has been somewhat reported, by dsmith-work, and leoprikler (and dsmith-work ) offered a somewhat 'naive' work-around, but g-golf needs the good old module-use!, could you look at it and tell me if you can and wiil fix the problem? many thanks, the bug is bug#43025 daviid: wingo: the 'naive' work around is to copy and add the public interface (of a module to another), but 2.2 is a lot more clever :) and holds a pointer to the obarray, so one can dynamicalluy add bindings to the public interface ... g-golf inherently does 'just' that, it reads a typelib, and add bindings to its (g-golf) high level api modules ... daviid: wingo: many thanks, i hope you'll find a bit of time, i think this is the only problem g-golf has wrt 3.0.4 - i can't be sure yet, but i think it will work if module-use! works as in 2.2 daviid: weinholt: do you have asavannah account? would you not prefer to patch guile-lib upstream directly 'yourself' (not being lazy here, just offereing you appear in the upstream git maintaince logs ... weinholt: daviid, too busy, writing a USB stack daviid: ok, I'll name you of course ... tx daviid: weinholt: shall i add you as the copyright author of these patches? daviid: in the files themselve i mean weinholt: daviid, no, i think the changes are too small for that daviid: ok ArneBab: we wingo daviid: weinholt: in the patch you wrote about using $(GUILD), you also patch Makefile.in, but that file is generated, isn't it the case on debian as well? daviid: *src/Makefile.in but i don't think we should do that ... ryanprior: Has anybody written a book about Guile? spk121: I did, once, sorta. Haha. I sent a chapter to O'Reilly and they said no because Lisp-related books never sell. RhodiumToad: bleh spk121: OK, I've figured out how to call the Microsoft CL Compiler from WSL and LLVM Clang-CL on Windows 10, so my foolish quest to make a native (non-cygwin, non-mingw) Windows Guile can begin. But inauspiciously, it starts with trying to fix libtool and libltdl. spk121: libtool, which has only accepted 10 patches in the last four years RhodiumToad: does libtool serve a useful purpose any more? spk121: I don't think so. I would never use it except that it is hooked into autoconf/automake RhodiumToad: it's possible to use autoconf without using libtool... spk121: I've assumed it would be. If there's a doc out there somewhere about it, I'd love to see it RhodiumToad: my point of reference here is that postgresql, for example, has an architecture of dynamically loaded modules, but doesn't (and I think never has) used libtool RhodiumToad: (and yes, we have a native windows build) RhodiumToad: (we use autoconf for non-windows builds, too) spk121: good to know. I'll check it out RhodiumToad: doesn't use automake, though chrislck: Dear esteemed guilers... many warnings "warning: possibly unbound variable" have returned with guile-3.0.4 (and were not present in 3.0.2) -- any idea how to disable globally please? spk121: chrislck: you need to avoid passing --warn=unbound-variable to guild compile chrislck: spk121: it doesn't have --warn=unbound-variable anywhere spk121: oh, apologies for not noticing that chrislck: hmm some info in NEWS since 3.0.3 chrislck: no idea how to use these though leoprikler: GUILE_AUTO_COMPILE=0 guix environment --pure --ad-hoc guile -E GUILE_AUTO_COMPILE -- guild compile -Whelp | grep unbound leoprikler: `unbound-variable' report possibly unbound variables leoprikler: GUILE_AUTO_COMPILE=0 guix environment --pure --ad-hoc guile@2.0 -E GUILE_AUTO_COMPILE -- guild compile -Whelp | grep unbound leoprikler: `unbound-variable' report possibly unbound variables leoprikler: So yeah, that has been around for a while ;) chrislck: leoprinkler: yes but something has changed guile-3.0.2 and 3.0.4 chrislck: sneek: later tell civodul how to remove unbound-variable new between 3.0.2 and 3.0.4 sneek: Okay. distopico: Hi, I'm starting ethics guile, I have a question, guile have something like hot reload for development, to recompile and reload ? ArneBab: distopico: you develop in the REPL, then you can simply replace top-level functions during runtime daviid: distopico: most of us use emacs/geiser - https://www.nongnu.org/geiser/geiser_5.html#Cheat-sheet contrapunctus: So the Guile manual says that Guile supports the SRFI-64 unit test API, but I'm not sure I understand how one runs these tests once they're written. The SRFI mentions a test runner, and all I found was ggspec (~7 years old) and a SRFI-64 snowball (not sure if it actually is a test runner?) contrapunctus: How does everyone run them? chrislck: contrapunctus: here's a test-runner: https://github.com/Gnucash/gnucash/blob/maint/bindings/guile/test/srfi64-extras.scm chrislck: here's the running: https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/reports/standard/test/test-transaction.scm chrislck: gtg, good luck euandreh: How to list files in a directory? I see srfi-170 has directory-files, but I don't see implementations of it yet leoprikler: chrislck: perhaps have a look at %auto-compile-options? It's the same for both versions tho. leoprikler: euandreh: you can do it low-level using readdir or high-level using (ice-9 ftw), Guix' find-files and some others daviid: distopico: you may also look at and maybe prefer to use guile-studio - https://git.elephly.net/gitweb.cgi?p=software/guile-studio.git;a=blob;f=README.org;h=3dde643773ca18af0d44ea6f685ffd804e8aba5a;hb=HEAD ane: contrapunctus: if you use autoconf, there's a test-driver.scm file that will then output automake compatible .trs files for `make check` catonano: contrapunctus: if you set up your project with guile-hall, you have the unit testing set up for you contrapunctus: chrislck, ane, catonano: thanks for the suggestions :) contrapunctus: catonano: I'd never imagined such a thing could exist for a Scheme 😀 catonano: contrapunctus: it's a pity that nobody ever brings that up catonano: euandreh: there's a paragraph in the manual named "File Tree Walk" ane: I think guile hall is now guild hall contrapunctus: Or just "Hall"? contrapunctus: ane: oh, apparently "GuildHall" was a predecessor - https://rednosehacker.com/hall-a-project-manager-for-the-guile-programming-language distopico: ArneBab: thanks catonano: euandreh: did that help ? distopico: daviid: yes, I have geiser already setup, I'm Emacs, user, I tried guile-studio just curious but it not worked to me from guix rekado: distopico: oh, it’s broken? I’ll take a look later. daviid: distopico: so, geiser offers all you need to reevaluate s-expr 'on the fly', from your source code emacs buffers of course ... don't you do that? ask here as i said, we almost all use it ... i am not a very good geiser user myself, but we have experts here .. distopico: when it start require company, I have it installed in my .emacs.d, I tried installing from guix distopico: but didn't work distopico: daviid: I just started a few day ago, so I will try that, I think that is what I'm looking for euandreh: leoprikler, catonano: I was expecting to find something more ready. euandreh: ty for the manual reference, I'm reading it more closely leoprikler: What do you mean by "ready"? leoprikler: (system* "ls")? euandreh: hmm, but that would return a 0, and I would have to get the string and parse it euandreh: I mean more ready as in: like scandir, but without the ".." "." parts euandreh: maybe I could filter them out catonano: I suppose they were hoping for a procedure that used the machinery illustrated in File Tree Walk to simply list a directory catonano: what I can say is that copying the example and adjusting it to adhere to your needs is not that hard but I undertsand you feeling euandreh: how about this: (scandir path (lambda (p) (not (or (equal? "." p) (equal? ".." p))))) catonano: euandreh: why not ? 🤷‍♂️️ rlb: I was looking at the module version docs and wondered if there were any provisions for multiple versions of a module. i.e. can you have (foo #:version (1)) and (foo #:version (2)) available at the same time so that other code can chose the one they want? rlb: Of course I can go check the code, but I was also wondering about the broader standard, i.e. are there any requirements or existing conventions there. weinholt: rlb, http://www.r6rs.org/final/html/r6rs-rationale/r6rs-rationale-Z-H-9.html#node_sec_7.9 rlb: weinholt: hah, thanks. Though I'm really wondering about even allowing their existence, i.e. can you have two versions *available* even if the program only picks one, as with libguile-2.2 and libguile-3.0. i.e. where would the (foo #:version (1)) and (foo #:version (2)) module files go in the filesystem, etc. weinholt: rlb, plt-r6rs in Racket has a convention for mapping the combination of library name and version to a filename, but everyone else just ignores the version in the mapping, so two versions of a library would get the same file name, meaning only one version can be installed in a directory weinholt: (speaking from my R6RS experience here, maybe there are others out there that do as Racket) rlb: OK, so that leaves you with the boil-the-ocean upgrade problem for library upgrades. Or just don't break backward compat in your apis... rlb: In any case, thanks -- definitely answers my question. weinholt: i guess a workaround is to put the major version in the library name. i haven't seen anyone do that yet. rlb: yep, I think that's likely often a good inclination rlb: Just perhaps the potential to be a little nicer asthetically, to have the platform recognize that and provide a built-in mechanism. rlb: civodul: odd behavior right now wrt gnutls28 and building against guile 3.0. If you build in a dev/shm tmpfs in exactly the right way (found via debian buildds), the reauth.scm test will hang forever. Re-running the test without " set-certificate-credentials-x509-keys!) rlb: FAIL tests/reauth.scm (exit status: 1) rlb: rlb: It also doesn't always hang after I enable debug logging -- sometimes it actually fails and umps the log to the terminal, so I imagine it's a race of some sort. daviid: rlb: why in such a 'hurry', since both are in debian already, it doen't cost much to keep them, or does it? rlb: Well, as mentioned, we may end up keeping 2.2, but doing so has potentially significant costs. As one example, unless we know we'll continue to produce bugfixes here (upstream), particularly for security bugs, for 2.2 for the next 3+ years, then keeping 2.2 in debian is shifting that potential work onto someone else. rlb: i.e. me or the debian security team, or the lts team, or... rlb: So it's (as often) a cost/benefit tradeoff. rlb: And keeping any given older Y around longer decreases the resources available to package and maintain the next Y. Similar considerations of course apply upstream as well. daviid: rlb: right, I understand - I can't answer for our mintainers of course, but my experience is, so far at least, they have been very good at offering support for older version - then of course guile has zero security bug :) weinholt: rlb, in #969703, are you asking me to remove guile-2.2 support or to build for both 2.2 and 3.0? (i found a workaround for the miscompilation of md5.scm with 3.0) weinholt: rlb, g-wrap is a reverse dependency, so i'm leaning towards building for both versions daviid: weinholt: g-wrap? I thought only guile-gnome used it daviid: guile-gnome will be removed from debian, i think g-wrap should be removed as well weinholt: guile-gnome2-dev has reverse depends from theme-d-gnome, though dustyweb: o/ dustyweb: hm dustyweb: magit is listing the latest tag as v2.2.3 dustyweb: but that can't be right dustyweb: (of guile master) dustyweb: I'm guessing tags just haven't been pushed up daviid: weinholt: all I can tell you is they will be no maintaince upstream on guile-gnome, nor on g-wrap - thene-d-gnome should be removed as well, as anything that depends on guile-gnome and/or g-wrap daviid: dustyweb: i have a proper v3.0.4 master tag in magit here, is it not a mater of 'git fetch --all' on your side maybe? dustyweb: daviid: ah that's probably it dustyweb: that fixed it dustyweb: thanks daviid daviid: dustyweb: great dustyweb: I forgot that the F operations only pull the necessary branch :) daviid: yeah, i'm not very good at all this either, but what you wrote 'did ring a bell' here, so i looked in my notes ... :) rlb: weinholt: so, not sure? My current concern is just to try to make it so that we have the option of removing guile-2.2 from bullseye, which means we have to get everything migrated to at least work with 3.0 before the freeze (in a month or two). weinholt: rlb, alright, i'll go with support for both versions initially, and we can drop 2.2 when that seems ok, which might be tomorrow or in 11 years weinholt: daviid, thanks for the info! rlb: Sounds good -- and thanks much. daviid: weinholt: np! what debian packages are you working on? daviid: weinholt: excellent goops tutorial by the way, I would like to suggest that the title 'Further remarks' become a clear 'Dynamically adding methods' or something like that ... daviid: weinholt: ah, guile-lib daviid: hum, it's been a little while I didn't compile guile-lib, let me try now, using master I mean daviid: I know it works with 'early' 3.0, but i didn't try the very latest Formbi: daviid: do you maybe know how to add something to the guile software list? daviid: Formbi: yes, you send an email to the author and maintainer of the list - Tantalum, sph at posteo dot eu Formbi: thanks daviid: np! what would you like to add? just curious manumanumanu: ArneBab: not umless I have the enery to write a srfi. these things are better kept outside the main distro unless it becomes standsrdised. even then I would bot be sure. manumanumanu: john asked me about the for loops, but those were so unportable and full of ad-hoc design decisions. I dont think I would have survived the srfi process manumanumanu: whereas everything in goof-loop is trivially portable except one 10 line macro. ArneBab: manumanumanu: by that logic (only standardized), Guile would be missing lots of useful ice-9 functionality. We wouldn’t even have define* Formbi: hi Formbi: how to make a script go into a REPL if a command-line argument is passed? ArneBab: manumanumanu: though shipping them in Guix would already help my usecase a lot :-) ArneBab: Formbi: I use -i, see https://hg.sr.ht/~arnebab/dryads-wake/browse/dryads-wake.w?rev=c677727bbd2c#L6 ArneBab: (this is a much more complex commandline that you’d need for a scheme program) Formbi: how to use it in a non-wisp script? chrislck: ubuntu 20.10 has guile-3.0.4 \o/ Formbi: ok, I figured it out ArneBab: Formbi: I saw your question only now … good to know you figured it out! manumanumanu: ArneBab: well... in ice-9 I dont think i use much more than match and things that cannot be portably implementef anyway. open-process and such. manumanumanu: there are thibgs there that have been left to rot as well. gap buffers? lineio? q? poe? those would have been better outside of the main tree. had the packaging situation been better (like, day, chicken-install) these things would have been better off as guile-eggs. ArneBab: manumanumanu: I use pipe-open and such. ArneBab: manumanumanu: can you package goof-loop for Guix? manumanumanu: ArneBab: i will! i am planníng on releasing 0.1 soon. some small adjustments to the iterator protocol, some small error checking and then I'm done. docs and tests, of course. docs are soon done. manumanumanu: 1.0 will surely be on guix ArneBab: Cool! Thank you! roelj: In Guile 2.0, how can I access the "call-with-new-thread" from C? For Guile 2.2 and later I'm doing 'scm_c_public_ref ("ice-9 threads", "call-with-new-thread");', but in Guile 2.0 it seems that this procedure is not in the "ice-9 threads" module. ArneBab: wingo: did your wingolog certificate expire? contrapunctus: o/ contrapunctus: I'm running a command using the `system` procedure, but I'm not sure how to get the value it returns. `(receive (val) (system ...) ...)` just binds the exit code. `(receive (code val) (system ...) ...)` results in an error - `(vm-run "Wrong number of values returned to continuation (expected ~a)" (2))` 🤔 RhodiumToad: by "value it returns", do you mean you want to capture the stdout of the invoked command? RhodiumToad: because if so, you're probably looking for open-pipe contrapunctus: RhodiumToad: ah, I see. Thanks! ArneBab: manumanumanu: so I could use (in-file "path" read-line) ? wingo: manumanumanu: two ways: LICM and loop peeling + CSE wingo: vector-length will generally be hoisted out of a loop, if not by LICM then by peeling. but compile and disassemble to see. wingo: the issue is that vector-length can throw an exception and may not always be executed in the loop body. in that case it won't be hoisted unless it is always evaluated the first time through the loop (that's the effect of peeling) roelj: What is the difference between 'get-bytevector-n!' and 'get-bytevector-some!'? civodul: hi roelj! civodul: roelj: the former waits until it has read N bytes or EOF has been reached civodul: while the latter reads as much as can be read without blocking ane: is it possible to throw 3.0 style exceptions from C? ane: oh, scm_raise_exception civodul: :-) anon9002: With GOOPS, I noticed that if I add a new method to the generic add-method!, it will stop working properly even if all I did was just calling (next-method). More specifically, it will always raise an exception in the form "X is not a valid generic function". Is this a bug, or I'm just doing something wrong? anon9002: Example: anon9002: (import (oop goops)) anon9002: (define-method (add-method! (generic ) (method )) (next-method)) anon9002: (define-method (foo x) x) anon9002: After that point, the exception is raised. daviid: anon9002: you don't (shouldn't) (re)define add-method!, it is part of the protocol (unless you really know what you are doing), you should 'just' use it daviid: sneek: goops daviid: sneek GOOPS daviid: bah, i will never ever remember how to talk to our bot :):) daviid: dsmith-work: help, goops tutorial please ... tx daviid: anon9002: here https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ daviid: anon9002: in the last part of the tutorial, 'Further remarks', there is an example of what you are trying to acheive ... anon9002: My use case is actually a bit unusual. I'm working on Guile bindings for a game engine (godot), and the engine wants to know where each method is defined in the code. I'm trying to get this information by capturing the stack each time add-method! is called and inspect frames to figure out where each method is being defined. Is there a better way to do this? anon9002: I think I figured out what went wrong. I thought that when you define a method, and another method with the same set of specializers already exist, the new method will be added to the list of methods for that generic. What actually happens is that the new method just replaces the old one. So I tried looking up the original add-method! manually and call it instead of (next-method), and this time everything anon9002: works as expected. manumanumanu: ArneBab: Yes, exactly. manumanumanu: ArneBab: You may also do, at least in my private branch: (:for enumerated-lines (in-enumerated (in-file "path" read-line))). That will give you pairs of (0 . line-1), (1 . line-2) etc. That however has the cost of reading the file through a generator. Everything that cannot be easily done in the iterator protocol is handled through generators. Currently that is (in-cycle ...) for things that are not lists and manumanumanu: (in-enumerated ...) manumanumanu: wingo: thanks! ATuin: hi, is there any library to encrypt/decrypt using RSA for guile? daviid: sneek: guile-software sneek: guile-software is at http://sph.mn/foreign/guile-software.html daviid: ATuin: ^^ ArneBab: manumanumanu: enumerated lines sounds great! Are you going for getting merged into guile proper? euandreh: How do I read the content of a file as a string? I did (call-with-input-file "f" read), but I get a symbol instead euandreh: I see that (read) returns a value euandreh: But there isn't a (read-string ...) spk121: euandreh: one way is to use read-delimited, but, then to have an empty string for the 'delim' parameter spk121: read-delimited is in (ice-9 rdelim) spk121: (read-delimited "" (open-input-file "filename.txt")) daviid: euandreh: there is also (use-modules (ice-9 textual-ports))- then get-string-all input-port ... justin_smith: euandreh: the "read" function is the "R" in repl, its job is to turn input streams into symbols and lists and numbers elliotpotts: evenin folks sneek: elliotpotts, you have 2 messages! sneek: elliotpotts, leoprikler says: have a look at scm_c_define_gsubr and perhaps pointer->procedure sneek: elliotpotts, leoprikler says: ah you're already using define_gsubr. You probably want to write your bind helper in a module like so (define (bind1 fn arg) (lambda args (apply fn arg args))), then refer to it from C++ using module-ref et al. Having a look at pointer->procedure would probably still be helpful tho, especially if you can resolve argument types at compile time euandreh: I'll go with daviid solution, and use (call-with-input-file "f" get-string-all) ArneBab: manumanumanu: wow, nice! (in-file "…") with auto-closing is cool! ArneBab: manumanumanu: can it also process files line-by-line? manumanumanu: ArneBab: sure. (in-file "path" [reader [eof?]]) where reader is a unary procedure that is passed a port (defaults to reach-char) and eof? defaults to eof-object? manumanumanu: I could even wrap it in dynamic-wind to close the port on a non-local exit manumanumanu: I wont, since you might want that. manumanumanu: I believe guile-fibers could potentially suspend the thread there, for example manumanumanu: wingo: sorry to bother you, but I was wondering about how guile hoists variables out of loops: Would a (if (= (vector-length vec) index) ... benefit by having the vector length moved out of the loop body, or is that done automagically? leoprikler: https://paste.gnome.org/pyz78vwuj/5bqjqn https://paste.gnome.org/pzmamaut9/xn93gs leoprikler: in both cases the loop was completely unrolled (for a statically known vector of length 3) leoprikler: I assume Guile will optimize for you when it can reason about the length of the vector. manumanumanu: leoprikler: which password? leoprikler: your name ;) manumanumanu: leoprikler: that is just peval and inlining, which is not the same thing manumanumanu: or am I reading the assembly wrong? manumanumanu: I want to know whether (vector-length v) is called at every loop, or if the call is hoisted manumanumanu: I suspect it is. leoprikler: I think it depends. leoprikler: Obviously the semantics differ if you have a procedure, that could potentially mutate the vector. leoprikler: But assuming you don't, the call is likely hoisted manumanumanu: The call is definitely hoised in this case. the person writing the code can't access the underlying variable holding the vector. manumanumanu: (in-vector ...) gives the vector a temporary name for that reason. The loop shouldn't fail because the user mutates the original binding manumanumanu: (this is part of my endeavour to create the love-child of racket's for loops and Alex Shinn's foof-loop. leoprikler: well, assuming the vector comes from outside and you call an arbitrary proc (in-vector), that may not always hold, but should hold most of the time leoprikler: [of course you can also copy the vector, then it will hold all of the time] manumanumanu: the length won't change :) leoprikler: oof, yeah leoprikler: it's a vector leoprikler: My implementation of vector-looping, that assumes it can change: oof-loop. leoprikler: s/it/its length/ manumanumanu: leoprikler: the reason it's called goof loop is because I goofed in the issue tracker of chibi scheme believing I understood the iterator protocol when I obviously didn't :D manumanumanu: oof-loop was one name i had thought of :D leoprikler: I thought it was goof loop because goof follows foof [g follows f] leoprikler: Which of course presupposes the existence of doof-loop :) leoprikler: the next logical steps would of course be hoof-loop, loof-loop and poof-loop leoprikler: though poof-loop has the nasty tendency of sometimes swallowing your data manumanumanu: The thing is... I'm done. Now I'm just writing docs, and polishing the implementation. The only thing I have left is to ensure that the body is executed at least once. ie: (loop () 1) => 1 and (loop/list () 1) => (1). Currently I believe it either returns unspecified or loops forever. leoprikler: well, time to write hoof-loop, which loops forever *and* returns unspecified leoprikler: Alan Turing will hate you manumanumanu: :P RhodiumToad: why should the body be executed at least once? lampilelo: i'd rather die in my sleep than be executed lampilelo: so i hope my body won't get executed, not even once ArneBab: If you die in sleep, you likely got terminated :-) lampilelo: maybe i just hibernated and didn't really die? leoprikler: my personal intuition would be to not execute anything for empty input either and just return *unspecified* too leoprikler: executing stuff one sounds like do(of-loop) ane: not sure if guile uses bison but bison had an backwards incompatible change recently that breaks old gnulib ane: if someone installs bison >=3.7 they won't be able to compile gnulib *: wingo doing a very poor maintenance job these days lloda: should make check work before make install? spk121: lloda: yes lloda: ok that makes sense lloda: sneek: later tell aleix i tried your guile-cairo patch and it makes make check fail before make-install sneek: Got it. zzappie: logs search doesn't seem to be working zzappie: I get 'Resource not found: http://127.0.0.1:3333/guile/search' *: janneke does a lookahead-u8 and blocking read; and sees (guile 2.2.7): janneke: GC Warning: Repeated allocation of very large block (appr. size 1073741824): janneke: May lead to memory leak and poor performance janneke: haven't looked into this yet; ring any bells? lloda: i see that all the time janneke lloda: have for years now janneke: lloda: thanks...guile eats through my memory very fast -- never seen that lloda: normally i just shrug it off lloda: i've needed to use GC_INITIAL_HEAP_SIZE=16G or something like that a few times for something to complete janneke: hehe janneke: yeah, well this is supposed to be a daemon, and within a minute it's on 5GiB and rising ;) lloda: there have been leaks in the past, so i suppose that's always a possibility lampilelo: is it possible to create a new lexical context inside a function, so that it doesn't know that function's arguments? but without creating a new top-level definition, like a let or something dsmith-work: {appropriate time} Greetings, Guilers dsmith-work: lampilelo: If you never refernce the outer function arguments, does it matter? lloda: yeah if you want to make sure you don't use the context, better define the block outside the context lloda: only thing that comes to mind is maybe using eval lampilelo: dsmith-work: i'm asking a very specific question, my rationale is irrelevant dsmith-work: So what I'm suggesting is if you never reference them, you can't reference them... dsmith-work: And the compiler makes sure they are not there. lampilelo: lloda: right, it works, thanks lampilelo: dsmith-work: i want to be able to use the same identifier inside of this new lexical context but without a function parameter coming in a way dsmith-work: Ahh. Ok. lampilelo: getting* lampilelo: i have everything i need between eval and unquoting lloda: you can reuse identifiers simply with (let ((a ...)) (let ((a ...)) *inner-a-here*)) lloda: i've never needed eval in ~20 years of using Guile tbh lampilelo: doesn't work with parameterize chrislck: eval is evil lampilelo: i don't think i'll do it, but i wanted to know how dsmith-work: It's spelled "eval", but it's pronounced "evil". lampilelo: you hate eval, so what do you have to say about eval-string, huh? chrislck: devil-incarnate lampilelo: (eval-string (read-line socket)) *: chrislck sets mode +b *eval* lampilelo: cheap way to do RPC! lampilelo: lloda: you use guile at work? as an extension language or plain guile? lampilelo: i'm curious what do people use guile for in production sneek: Just me lloda: i use it as an extension language lloda: but the shell isn't much removed from vanilla Guile lloda: it just gives me a gl window and some other stuff lloda: i've wanted to move all of the libraries that are compiled in the shell to external Guile modules for a while lloda: but i never have time to do it lloda: when i started using Guile there wasn't even an ffi, so it was in a way more natural to use Guile as an extension language lloda: that has changed over the years lampilelo: i mostly use it for writing scripts lampilelo: and i extended mocp with it, but only for one thing pretty much lloda: i rarely need to go to C these days lloda: well C++ in my case roelj: Does anyone have any experience with Guile packages on CentOS 8? I can only find guile 2.0, and no guile-devel package.. manumanumanu: roelj: doesn't redhat package everything in their packages? so guile-devel should be part of guile. manumanumanu: or am I completely out? manumanumanu: I haven't used fedora since it was called fedora core something, so I might be off roelj: Well, running ./configure for my program doesn't find the development libraries for Guile. spk121: roelj: there is a guile-devel package for CentOS8, but, it is just version 2.0 spk121: guile-devel-2.0.9-5.el7.x86_64.rpm spk121: sorry, it is guile-devel-2.0.14-7.el8.x86_64.rpm roelj: spk121: And how do I install it? "yum install guile-devel" doesn't seem to find it roelj: Perhaps I should ask in #centos instead :) manumanumanu: ArneBab: so! The protocol is finished for goof-loop! Now we have finalizers for :for clauses, which means (:for ch (in-file "test.txt")) closes the file handle correctly. Everything should be properly propagated to subloops as well. Now I only have some minor cleanup, som tests and some docs to do :) manumanumanu: ArneBab: ooh... I need to figure out some inlining behaviour as well. (in-file ...) produces a bit suboptimal code manumanumanu: anyway. The daily chore is done. spk121: roelj: I'd imagine centos is "dnf install", but, I'm not sure dsmith-work: Happy Thankgiving to those in the US.. roelj: spk121: Seemed to need to add "--enablerepo=PowerTools". :) Problem solved. Rovanion: Hi, this may be the wrong channel but I'm trying to use Geiser for Emacs to do some REPL-driven development. I've got a form here in the Guix code base that I want to evaluate. I've compiled the whole file with C-c C-k and am trying to eval a form (parse-requires.txt "/path") with geiser-eval-last-sexp, but nothing happens. The REPL shows no output but if I press enter in it the number has been Rovanion: incremented. roelj: Rovanion: The number indicates something went wrong. Rovanion: Figured out that an exception was thrown and that I could get the backtrace by typing ,bt. But that was pure guesswork. roelj: Good guess! Formbi: hi Formbi: I'm getting «Fatal error: glibc detected an invalid stdio handle» when trying to (import (srfi srfi-1)) bsima: does anyone know how to tell guild to look for a shared lib in a non-standard path? bsima: and if so, how do I hook that sort of thing into the usual ./configure workflow? bsima: for context: I'm packaging inspekt3d for nixpkgs and it's failing to find libfive during the buildPhase mwette: bsima: try LD_LIBARY_PATH=/path/to/lib guild compile foo.scm bsima: mwette: thanks, i'm trying that but overwriting LD_LIBRARY_PATH just leads to other compilation errors bsima: In procedure scm_lreadr: #:410:18: unknown character name ?? bsima: make: *** [Makefile:768: inspekt3d/library.go] Error 1 bsima: I'm looking for a way to prepend to the var in nix currently mwette: can you do this? LD_LIBRARY_PATH=/path/to/lib:$LD_LIBRARY_PATH bsima: no the $ gets escaped, anyway i learned in #nixos that the correct way to do this is using the autoreconfHook functions they give you bsima: has anyone seen 'unknown character name ??' when compiling guile code? bsima: I found at least one other person that has had this problem https://lists.gnu.org/archive/html/guile-user/2020-05/msg00048.html bsima: unfortunately it was not solved :) but it's the same library inspekt3d that i'm working on daviid: bsima: the message tells you to lok at the specific line and column, identify what is the character there, and that, very liely, the guild process does not 'know' that character because it is being run under a 'wrong' locale ... you really have food for thought there ... daviid: *look bsima: i found that adding glibLocales to buildInputs fixed that bsima: Also there are more issues with packaging inspekt3d in nixpkgs, here is more info for anyone interested https://github.com/NixOS/nixpkgs/pull/87281 bsima: i think the guile support in nixpkgs just needs a bit of work ryanprior: Can you use define-public inside a let form? ryanprior: My feeling is no, but maybe I'm just doing something wrong. lloda: ryanprior: you can use define outside and export inside if that doesn't work leoprikler: ryanprior: no, because you can't top-level (define ) inside a let IIRC spk121: janneke: have you done any more work on guile mingw? janneke: spk121: it depends, i have my work on gitlab: janneke: https://gitlab.com/janneke/guile/-/commits/wip-mingw janneke: https://gitlab.com/janneke/guile/-/commits/wip-mingw-i686 janneke: janneke: that's all on top of "your" 2.2.3 branch spk121: janneke: lol okay. I've been working on this again. Today I got a 3.0.4 to complete 'make check' with many many failures. But at least it ran to completion spk121: janneke: you got an x86_64 mingw guile to work? If so, that's awesome! GewaltDisney: hi everyone, i'm hoping to give Guile Emacs a try, but when trying to DL from guix it always gets stuck in the build phase. does anyone have any advice on this? leoprikler: I don't know anything about getting stuck in the build phase, but Guile Emacs as a project has sadly collected a lot of dust and would need to be revitalized. gagbo: wasamasa wrote a little snippet that can act as a good starting point for a test suite : https://emacsninja.com/posts/state-of-emacs-lisp-on-guile.html dsmith-work: Hey Hi Howdy, Guilers GewaltDisney: leoprikler: yes, it would be cool for this project to be revitalized, some folks in #emacs said that terpri was discussing crowdfunding it, so i've offered my ux/ui design skills to make a slick presentation if thats desired GewaltDisney: ran through the guix install again in verbose and heres where it hits a snag if anyone is familiar GewaltDisney: Generating /tmp/guix-build-guile-emacs-0.0.0-0.41120e0.drv-0/guile-emacs-0.0.0-0.41120e0-checkout/lisp/international/uni-name.el... rekado_: GewaltDisney: I’ve got some WIP that at least lets the build pass. rekado_: but the resulting Guile Emacs is very prone to segfaults, so there’s something I must have missed rekado_: GewaltDisney: this is the latest Guile wip-elisp branch I’m using: https://git.elephly.net/?p=software/guile.git;a=log;h=refs/heads/wip-elisp GewaltDisney: sweet thank you rekado civodul: you can try it with --with-git-url and --with-branch maybe rekado_: I had started to rebase the Guile Emacs commits on top of the nearest Emacs release, but gave up half way through rekado_: it may be easier to port the required changes “manually” GewaltDisney: yeah, i'll probably give it a go for a few hours this weekend. its obviously a match made in heaven! GewaltDisney: thanks guys GewaltDisney: i'll be back when i have some updates rekado_: GewaltDisney: if there’s any value in looking at my rebase attempts I’ll gladly make the mid-rebase state of my repository available for download janneke: spk121: oh 3.0.4, that's great! janneke: spk121: yes, guile 2.2 assumed that sizeof (long) == sizeof (void *) janneke: which is true on all sane systems and breaks on mingw janneke: 64bit davexunit: is guile 3 better on mingw? davexunit: awhile back I tried using guix to build guile for mingw but the resulting binary never worked janneke: guile 2.2 builds fine from my tree; it broke ootb after 2.0.9 or so janneke: i haven't looked at spk121's 3.0.4 work yet davexunit: a guile 3 build that worked on windows would be really great. janneke: i'd much rather have people stop using windows, but yeah davexunit: of course :) leoprikler: I think there are some Guile 3 builds for windows out there davexunit: I'd like to know how they were built so I can replicate it with guix leoprikler: Ah, yes, cygwin has guile 3. davexunit: that's promising. I should try it out sometime. davexunit: if I could get that + builds of all the C libraries I use I just might be able to ship a game written in guile. leoprikler: based on chickadee? davexunit: yeah leoprikler: oh, i just now realized, there's a 0.6.0 release davexunit: if I could cobble together a runtime base for chickadee games for linux, macos, and windows then it would make writing games in guile a lot more appealing. davexunit: a tool could just combine the game's source, .go files, and assets with the various platform bases and bam, ready to ship. leoprikler: Why not just `guix pack` a docker container? :D davexunit: won't work well on windows or macos davexunit: and the user would need docker leoprikler: true davexunit: for games, anything more than "extract and run executable" is asking too much leoprikler: I get that, but that mindset leads to some very questionable decisions. leoprikler: See renpy and node-webkit. davexunit: I don't like it, but it's the way it is. davexunit: binary bundles are just the convenient option, not the sole means of distribution. leoprikler: How about using a CI to do that, though? spk121: davexunit: I only just started playing with guile 3.0.x mingw yesterday. Largely the same patches as janneke has for 2.2 spk121: so I've got nothing ready for inspection davexunit: leoprikler: sure, but that seems orthogonal to the general topic? davexunit: however you produce it, it's a big ol' binary bundle that can be dumped onto the target system leoprikler: Well, sure, but in my opinion who produces those bundles does make a difference. leoprikler: In the CI case, you get a machine running your target OS doing the job for you. davexunit: I don't know how this turned into a debate or what we're debating spk121: davexunit: this monstrosity was my build script to package up a win32 guile game for some jam a few years ago... https://github.com/spk121/psychic-guacamole/blob/master/build.sh davexunit: spk121: wow. so this was run on a windows machine as opposed to being cross compiled from linux? spk121: Yeah. On the mingw32 environment that msys2 provides davexunit: does guile's jit work in a 32bit environment? leoprikler: it should but I don't know about the specifics on windows where a 32bit binary is run on 64bit arch all of the time spk121: davexunit: Guile 3.0.x jit on mingw doesn't work for me. But I've barely worked on it. davexunit: ah, okay. davexunit: yeah that's a blocker for me. I feel like I just don't know enough about windows/mingw to work through the issues. davexunit: like I need to educate myself on the differences between mingw and cygwin, because apparently cygwin has a guile 3 build spk121: I'm hopeful that all that you need is to add the fastcall patch from https://lists.gnu.org/archive/html/guile-devel/2020-02/msg00057.html spk121: davexunit: here's big difference. Cygwin maintains a bit library that emulates posix with win32 calls, so getting cygwin to run is easier. mingw links to directly to a Windows library, so you have to replace a lot of posix calls with win32 calls. For example, mingw doesn't have pthreads davexunit: spk121: so does that mean that threads don't work when you build guile for mingw? davexunit: I vaguely remember seeing a mingw pthreads library before. do you know about it? spk121: davexunit: yes, so far, as far as I know, there is no mingw guile where threads work right. davexunit: got it. spk121: I'm aware of mingw's winpthreads library, but last time I tried it with guile (and it has been some years) there was a difficult to debug crash. I suspected GC problems, but, never really ran it to ground davexunit: makes me wonder how other programs deal with this? davexunit: pthreads are pretty commonly used davexunit: I guess cygwin is the direction I'd want to explore, then. spk121: if you can figure out which DLLs you need to bundle up, cygwin could work. I can't say I've worked on Cygwin much beyond patching Guile for cygwin (and cygwin for Guile). davexunit: spk121: do you happen to know if dynamic-link works in cygwin? davexunit: ^ if anyone else knows, chime in. spk121: davexunit: yes, they dynamic-link test passes on cygwin spk121: but, the difference is that on linux shared objects, you can link a top-level library and it will search recursively to other libraries. For DLLs, you need to dynamic link to the specific DLL to find a symbol. (If I recall correctly) leoprikler: meaning you won't get glibc symbols from mylib.dll? spk121: leoprikler: again going from memory, here, I think so leoprikler: Interesting davexunit: I'm trying to compile my guile-sdl2 project and it fails to find libsdl2. the directory is correct, it's in /usr/lib. going to try something... davexunit: (dynamic-link "/usr/lib/libSDL2") and (dynamic-link "/usr/lib/libSDL2.dll.a") fail davexunit: what's up with the .a after the dll? in linux land that would mean it's a lib for static linking. is it the same here? leoprikler: I don't think dll.a is something that exists leoprikler: .dll is roughly equal to .so davexunit: right I know that davexunit: I installed libwhatever packages with cygwin, so presumably that gives me the shared libs davexunit: every single library file in /usr/lib is a .dll.a leoprikler: interesting, perhaps that's a cygwin convention then leoprikler: tbf i know nothing about cygwin davexunit: join the club :) spk121: davexunit: the *.dll.a files contain the information that you need to link to a dll, they are like a table of contents for the DLL davexunit: spk121: thanks for the explanation davexunit: I don't understand what I'm doing wrong. spk121: they are used at link time spk121: You probably just need to add the directory where the actual DLLs live to you LTDL_LIBRARY_PATH or LD_LIBRARY_PATH. On cygwin this might be something like /usr/bin davexunit: the pkgconfig files for the libraries say /usr/lib is the libdir davexunit: so I guess I have to ignore that on windows davexunit: libraries in /usr/bin? what a world. davexunit: thanks I'll take another stab at it spk121: I'm probably giving you bad info, since I'm not sitting in front of a windows box davexunit: spk121: weird! they are in /usr/bin but prefixed with "cyg" instead of "lib" spk121: davexunit: oh right! Cygwin. Yeah dynamic link to "cygxxx.dll" davexunit: spk121: for sdl2, I need to do this: (dynamic-link "/usr/bin/cygSDL2-2-0-0") davexunit: now if I could figure out how to make my configure script figure this out... davexunit: the pkg-config file doesn't refer to this file or /usr/bin at all leoprikler: Does the lib.a refer to this file? leoprikler: If so you could add a --cygwin switch leoprikler: [and then parse the lib.a] davexunit: it's a binary file that I don't know how to read spk121: objdump -x libxxx.dll.a will tell you what's in it, mostly davexunit: seems very complicated. this can't be how other people handle this. spk121: just go with (or (dynamic-link "libsdl") (dynamic-link "cygsdl")) or something like that davexunit: I tried but it didn't work davexunit: after hardcoding some library file names into the libraries I was building, I got everything to compile. davexunit: unfortunately, sdl2 is unable to open a window. says there is no available video device. davexunit: a quick search lead to discourse thread where someone says the cygwin sdl2 is broken davexunit: so ends another windows build adventure. leoprikler: how does renpy do it then? davexunit: leoprikler: probably a more native build? davexunit: I really have no idea leoprikler: Yep, Visual Studio davexunit: if guile could just build on windows natively then it would be smooth sailing davexunit: I'm just going to guess that it would be a ton of work otherwise someone would have done that by now leoprikler: Perhaps not a ton, but probably still a decent amount. davexunit: I think it would get hairy pretty quickly. davexunit: any parts that use pthreads would need an alternative implementation, for example. civodul: i think nobody wrote the three magic letters: WSL leoprikler: Is the only Windows implementation of pthreads in MinGW/Cygwin? oni-on-ion: WSL^ leoprikler: Okay, but how do you package WSL for a game? ;) davexunit: civodul: hehe ;) davexunit: WSL does not yet work well for graphical programs davexunit: for optimal performance, a native port would be best. oni-on-ion: hmm distro the libs in a kind of package, likely theres way davexunit: but like... I'm not really a windows person. I just want to publish to windows. oni-on-ion: WSL is near native or is native. davexunit: yes but there are some caveats oni-on-ion: a lot faster than Cygwin for sure (which is layers) and mingw is already itself as close to the "windows metal" as possible leoprikler: MinGW is lacking Guile 3 currently, though oni-on-ion: ah. guile sure does depend on many unixisms davexunit: lots of languages have native windows ports. python, ruby, common lisp (sbcl at least) davexunit: guile should too :) civodul: to me, WSL means that "porting" is no longer a thing, or at least for non-graphical programs civodul: (i know nothing about Windows but this time i take Microsoft's word :-)) spk121: civodul: I think that is a fair statement. WSL works well. But, I think WSL makes cygwin obsolete. davexunit: there's issues when it comes to graphical programs. those programs need to talk to an x server and the whole darn linux graphics stack. davexunit: all this compatibility layering is no substitute for a native port. davexunit: it's a problem of my own design but sometimes it sucks that everything I depend on compiles natively on windows... except guile. civodul: yes, but, let's say you're a Guile maintainer, it's very tempting to say goodbye to Cygwin/MinGW and all, isn't it? :-) oni-on-ion: ocaml still has some trouble as a windows port, from what i hear davexunit: civodul: that would be the case with WSL and a native port :) oni-on-ion: yeah dave, that X11 stuff can be quite heavy and is mostly the worst of it. not sure if wayland helps, but i can imagine non-issues with SDL or Raylib civodul: can't you mix the POSIX/Linux/glibc API and the native graphical API? oni-on-ion: well thing is, UNIX is essentially the C VM. just that most systems already come with all of it civodul: "the C VM", that's very 2020 parlance, no? ;-) davexunit: my fear is that it's not just guile that would need porting, probably some of the libraries do as well. spk121: davexunit: sdl is maintained on windows, of course, as are all of Guile's dependencies davexunit: spk121: libunistring, libgc, etc. can compile with msvc? davexunit: that's good news davexunit: just verified that libunistring has build instructions for msvc leoprikler: but what about gnulib? spk121: leoprikler: gnulib is great when there is actually underlying win32 API that can be mapped to POSIX API. For some things, the models are so different that they don't sync up. But largely we're using gnulib already to provide missing functionality for mingw spk121: as an aside, the gnulib that guile is using could use a refresh. There have been some decent bugfixes since it was last updated tohoyn: sneek, botsnack sneek: :) roelj: I have a Guile program that has been running for a week, and upon inspecting the memory allocations with pmap and gdb, I found that most memory regions are simple zeroed chunks. Is this something the garbage collector allocated and doesn't give back to the system? civodul: hi roelj! that would be surprising civodul: is resident size increasing? roelj: No. It's stable. But when I stress-test it, the memory expands (it's supposed to do that, since it then spawns more threads), and it never contracts afterwards. civodul: is it the resident set size that expands? civodul: i think the GC can increase its working set and not return things to the OS civodul: so if you have a peak, resident size will go down afterwards, but virtual memory size may not civodul: wingo could probably confirm roelj: Yes it's the resident size that expands. roelj: virt and shared seem stable. That makes sense because it doesn't load any new libraries, and it doesn't mmap files. roelj: Hm, so what could be going on in my case then? civodul: it may be a leak on your side civodul: the way i'd debug it is by looking for a stress-test pattern that makes memory usage grow civodul: then you look at the code involved wingo: hi civodul: also, while it's in theory okay to leave ports open, it's much better when you explicitly close it civodul: because they have a lot of memory attached to them, like iconv descriptors civodul: hi wingo! wingo: i think by default, bdw-gc will never give pages back to the system civodul: yeah so virtual size can only increase roelj: Can I see a list of open ports? In /etc//fd there's not much. civodul: it could be string ports etc. though wingo: looking at the defines, i think libgc needs to be built with USE_UNMAP wingo: there are also some run-time knobs but you need to check that compile-time setting first roelj: civodul: Grepping for "(open" I found only one code path and there I explicitly close the string port. All other interfaces (like "call-with-..." should automatically close, right? wingo: see README.macros in bdw-gc for info on USE_UNMAP, and also see GC_UNMAP_THRESHOLD and GC_FORCE_UNMAP_ON_GCOLLECT wingo: those latter two are environment variables roelj: wingo: Thanks! civodul: would be interesting to build it with USE_UNMAP and see wingo: yeah i've never tested it that way lloda: tohoyn: i am now civodul: roelj: open ports are just a possibility, but really i'd suggest finding a pattern that triggers the issue roelj: civodul: Sure. I just don't think there's a leak in the program, because as long as I don't create a peak bigger than the previous stress-test's peak, the memory doesn't grow. roelj: Would the environment variable GC_FORCE_UNMAP_ON_GCOLLECT have any effect on the Guile compiled with Guix? civodul: libgc in Guix is not compiled with USE_UNMAP, so you would first need to define a libgc variant that does that roelj: Okay. tohoyn: lloda: did you receive my email about the public GPG key of guile-cairo? ane: when writing extensions in C, what's the best approach for making wrapper interfaces for the C stuff on Scheme side? ane: what I'm planning on doing is that the C side will define rather crude procedures and I'd like to avoid writing too much C and then "refine" the outputs on Scheme side ane: to this end, I'm thinking of something like scm_c_define_module("foobar internal") from C code and then in Scheme do something like (define-module (foobar)) ... (load-extension "foobar" "init_foobar_internal") and then re-export those things that don't need to be "wrapped" ane: but I'm confused of how this would look like ane: what's the correct order here? 1. define-module foobar 2. load extension 3. re export things from the extension ane: so are steps 2 and 3 just about like this (load-extension ...) (use-modules (foobar internal)) (export (foobar-nice)) ane: is the last export even needed? can't I do that in the define-module using #:re-export leoprikler: ane: you typically shouldn't do define_module from C unless you know what you're doing ane: hm, reading the manual, it's suggesting I don't scm_c_define_module ane: and just load the extension on scheme side into the current module leoprikler: exactly ane: and if I have multiple "modules" on C side ane: I can just have multiple init functions leoprikler: yep leoprikler: If you are able to, you might also evade the C side completely. leoprikler: Have a look at (system foreign) for that. leoprikler: The problem with it however is, that it only really works well for functions and some struct types. leoprikler: If you have something fancier than that, you might still need your extension. leoprikler: [or if you need to access #defines for example] ane: yeah, I had a look at that ane: but I find it easier to work with it directly from C, since this would be distributed alongside the C library itsef ane: so the same make install installs both leoprikler: Okay, in that case [optionally] linking against libguile does make sense. dsmith-work: Hey Hi Howdy, Guilers mwette: ane: I do this: (define-module (foo) #:export (bar)) (load-extension "baz" "init_baz") where "baz" provides define for "bar") mwette: ane: and my code uses (eval-when (expand load eval) (load-extension )) though I don't remember why I have that leoprikler: probably because you need (eval-when ... (load-extension)) for byte-compilation dsmith-work: ane: Yes, it's typical to provide a thin scheme module that just loads the .so and then exports things. dsmith-work: Pretty sure it's no longer possible to direcly load a .so as a module. lampilelo: i have a problem compiling gnutls for guile-3.0, it errors out on the bootstrap script saying there's incompatible bytecode kind (while trying to load eval.go from guile 3), does anyone know how to debug it? something clearly is using guile 2.2 and doesn't like my guile 3 files and i don't know what it is lampilelo: there are some .go files in the boringssl submodule, maybe that's it? lampilelo: ok, i ran the script with guile 3 specific environment turned off and it worked, i hope it won't affect compilation with guile 3 lampilelo: of course it didn't work... lampilelo: these .go files aren't guile files, so that's not it lloda: I have to check tohoyn. I'll get back to you in a couple hours dsmith-work: lampilelo: Often strace is helpful when debuggging which files are being opened from where. dsmith-work: lampilelo: So you have both 2.2 and 3.0 installed? From packages or from source? Do you have *-dev packages installed? lampilelo: 3.0 is not available on my distro lampilelo: so i have 2.2 for stuff that depends on it dsmith-work: Ok. Do you have the 2.2 -dev package installed? Remove that. I'm guessing when conpiling/configuring gnutls it's finding the 2.2 dev stuff first. ane: can this be used to disable exception catching in the guile repl? if I throw exceptions inside the repl I always end up in the debugger, I'd like to avoid that ... https://www.gnu.org/software/guile/manual/html_node/Standard-Error-Handling.html lampilelo: dsmith-work: there's no dev package dsmith-work: Hmm. ok lampilelo: the problem seems to be autogen that is trying to use guile 2.2 and segfaulting in the process when it tries to load guile 3 files dsmith-work: RIght. Why is it trying to use guile 2.2 ? lampilelo: the last release for aurogen is from 2018 dsmith-work: Oh. autogen lampilelo: #if (GUILE_VERSION >= 200000) && (GUILE_VERSION <= 200003) lampilelo: # error AutoGen does not work with this version of Guile lampilelo: nice lampilelo: ah, not that one dsmith-work: I read that as autotools. lampilelo: i'll try to compile it with guile 3 lampilelo: i don't have high hopes lampilelo: autogen did compile fine and gnutls compilation doesn't seem to segfault anymore lampilelo: so i know who's at fault here lampilelo: my distro has a wildly out of date version of autogen dsmith-work: lampilelo: What distro is that? lampilelo: belive it or not, it's arch lampilelo: the package manager points to an old autogen website and the version from there is the version arch has, even though the development is still happening on savannah dsmith-work: I suspect not many arch users require autogen.. lampilelo: sure, the older version worked fine with their toolchain lampilelo: i reported it though lampilelo: maybe next time i won't have to remember to use manually compiled version lloda: tohoyn: i haven't received any message. That email used to be my main account but i changed isp and now i only get some 'free' tier service on it and it barely works. Could you resend to lloda at member fsf org instead? tohoyn: lloda: done lloda: thx, replied tohoyn: lloda: "gpg --import" does not work for the key you sent lloda: hmm. I used gpg --export-ssh-key key! lloda: is that wrong? tohoyn: lloda: try gpg --export --armor key lloda: tohoyn: ok resent tohoyn: lloda: now it works. thx. lloda: thank you! leoprikler: sneek: later tell a_v_p heads up "gdbus" is already claimed by the GNOME people IIRC (although potentially deprecated in favor of gio) sneek: Will do. daviid: sneek: later tell a_v_p nice, fwiw GNOME offers a low-level and high-level D-Bus support API, part of the Gio library, which guilers can (should be able to - might trigger a few bugs but ...) access using guile-gi or g-golf - see https://developer.gnome.org/gio/stable/ch01.html, https://developer.gnome.org/gio/stable/gdbus-lowlevel.html and https://developer.gnome.org/gio/stable/gdbus-convenience.html sneek: Got it. ane: how can I make a thunk like "(foobar)" in the C API? a_v_p: Good , Guilers. sneek: Welcome back a_v_p, you have 2 messages! sneek: a_v_p, leoprikler says: heads up "gdbus" is already claimed by the GNOME people IIRC (although potentially deprecated in favor of gio) sneek: a_v_p, daviid says: nice, fwiw GNOME offers a low-level and high-level D-Bus support API, part of the Gio library, which guilers can (should be able to - might trigger a few bugs but ...) access using guile-gi or g-golf - see https://developer.gnome.org/gio/stable/ch01.html, https://developer.gnome.org/gio/stable/gdbus-lowlevel.html and https://developer.gnome.org/gio/stable/gdbus-convenience.html a_v_p: leoprikler: I'm using "gdbus" prefix only internally in Guile-DBus for now, public (Scheme) procedures are all start with "dbus-". Do you think it may lead to issues? a_v_p: daviid: Alright, that's a good point. Although I don't think that my work and Guile-GI/GNU G-Golf fully overlap, because my library does not depend on Gnome and GTK. a_v_p: Also as I found recently there's AC-D-Bus, pure Scheme implementation of DBus protocol: https://gitlab.com/weinholt/ac-d-bus/ daviid: a_v_p: you don't need to use gtk to access the dbus low or high level ai from gio, just gio, and you may even selectively import stricktly what you need ... i mentioned becaue writing and maintaining a good binding is difficult, dbus even more I think ... using the gio low/high levelapi is nearly 'free', if you do so using guile-gi or g-golf ... daviid: youalso have zero maintaince cost,since the gnome team does it for us ... daviid: a_v_p: anyway, do as you wish of course, but 'in your position' I would definitely at least try, before to further implement, either guile-gi or g-golf and see how your needs go using either the low, the high or both api's provided by the gio library - daviid: or ac-d-bus indeed ... too many options :):) tohoyn: sneek, botsnack sneek: :) tohoyn: lloda`: are you there? mwette: a_v_p: I ran my ffi-helper on libdbus a few years ago. I have some demo's for that, which might be helpful. See https://git.savannah.nongnu.org/cgit/nyacc.git/tree/examples, looking at system/dbus.scm, and nyacc/lang/ffi-help/dbus*. mwette: a_v_p: ^-these examples use the auto-coded ffi from ffi/dbus.ffi. To get the associated .scm you'd have to download and run the ffi-helper. I think your approach will yield a more efficient, memory safe and portable implementation. a_v_p: mwette: Thanks! mwette: yw manumanumanu: Ahoy folks! manumanumanu: ArneBab: fyi, goof-loop just got :final expressions that work like in racket. Now I only want to add finalizers to :for -clauses so that I can do (in-file "path/to/file") that actually closes the file. I also added a generator-based interface so that I can do (in-indexed ...) and (in-cycle ...). That only has the same overhead as srfi-158 styled generators, which means it is pretty fast. manumanumanu: which was my chore for the day! good night everyone. bsima: Does anyone know how to get a guile + libraries on nixos? Something like 'nix-shell -p guile -p libfive' doesn't automatically work unfortunately bsima: i guess the libfive derivation in particular isn't written to support compiling with guile support oni-on-ion: strange, is it not required for something like libfive::Studio ? bsima: i get a libfive-guile.so in the nix closure but i'm not sure how to use that bsima: 'configure: error: Guile bindings for libfive are missing; please install them.' bsima: got that error while trying to use another library that wraps libfive bsima: so, i guess i have to figure out how to compile libfive guile bindings oni-on-ion: hmm. i've no experience with guix myself bsima: i'm on nixos not guix bsima: but i'm kinda too tired to really firugre this out bsima: maybe i'll do it tomorrow oni-on-ion: ohh, sorry, i've gottent hem mixed up right there bsima: oh i just had to add libfive to buildInputs lol oni-on-ion: ah =) RhodiumToad: is it intended that guile3 header files don't compile on c99 but require c11? RhodiumToad: (they redefine typedefs) civodul: hi! civodul: RhodiumToad: it must be a bug RhodiumToad: libguile/scm.h defines, for example, typedef struct scm_dynstack scm_t_dynstack; where struct scm_dynstack is not yet defined RhodiumToad: then libguile/dynstack.h defines it again as typedef struct scm_dynstack { ... } scm_t_dynstack; RhodiumToad: that's a warning, but then guile-cairo tries to build with -Werror a_v_p: Hello guillers! FWIW, I'm writing bindings to libdbus for GNU Guile: https://github.com/artyom-poptsov/guile-dbus wingo: moin :) civodul: hey wingo! wingo: hoi chrislck: \o/ lloda: thx daviid i appreciate that lloda: tohoyn: please check http://download.savannah.gnu.org/releases/guile-cairo/guile-cairo-1.11.2.tar.gz tohoyn: lloda: already done and debianized lloda: thx! dsmith-work: Happy Friday, Guilers!! spk121: dsmith-work: happy Friday oni-on-ion: daviid, ah i see. i also did that as well, to remove any system guile (which was not used by anything) daviid: oni-on-ion: you mentioned you 'manually' removed things (in /usr, that could be a debian install - and /usr/local, that would be a manual installation), i think you should try to unistall properly, in both cases, but especially the former (possible debian previous install) - and make sure you don't have 'old' config in /etc/ld.so.conf (or its subdirs) wrt guile, as well as checking your bash and/or other env vars ... and clean 'for daviid: sure' ... daviid: oni-on-ion: if there was a debian package, you may try 'dpkg -l | grep guile' then use 'aptitude purge ...' upon those you don't want anymore ..., if any daviid: manually, you'd need to find the source dir, configure using the prefix, appears to be /usr/local, then run 'make uninstall' - if you manually updated /etc/ld.so.conf, update and run ldconfig as root ... for env vars, I guess you know how to ... daviid: oni-on-ion: are you on debian testing or stable? oni-on-ion: daviid, hey sorry. testing i think. but i have not updated any system software since the summer. i tried 'make uninstall' from the existing guile git repo i had cloned, which was not a target. then removed anything from debian packages (guile 2.2) and then scored all /usr/local for any guile related (share, lib, include, bin) oni-on-ion: strange, doing dpkg -l command, i see some 3.0 ... purging oni-on-ion: GNU Guile 3.0.4.38-64c894 oni-on-ion: this is the current install from git. i've no idea where the dpkg came from, was not aware that 3.0 was even in repo, especially since i havent used this PC since august. so this is my fault for sure... =) daviid: oni-on-ion: i think you should uninstall/purge everything, then re install the one you wish to use - worth the time it will take i think, and make sure to visit your bash or whatever env vars, /etc/ld.so.conf ... with calm and being cautious, taking notes for yourself on those steps to purge/clean/track and remain 'the boss of the situation' :) daviid: oni-on-ion: after you uninstall/purge everything (related to guile I meant), i recommend you run a 'serious debian updates', I use aptitude, but ... even if yu still wana install from from a git clone, but if not, the then you should be able to just install the latest guile-3.0, guile-3.0-dev and guile-3.0-libs oni-on-ion: i do install most things from git clones, for the stuff i use most often. the version above is from yesterday's git install oni-on-ion: i should probably do dist-upgrade for apt *: aleix waves aleix: wingo: gentle reminder, s'il vous plaît :-) https://github.com/wingo/fibers/pull/42 daviid: tohoyn: it just occured to me that you are the debian guile-cairo maintainer, could you update the package? there has been a few releases upstream, and debian still points to 1.10.0 ... if you have questions about guile-cairo itself, the current co-maintainer hangs here as well :), his nick is lloda ... it would be nice to have a recent guile-cairo package in debian ... tohoyn: lloda: Hi. Are you a maintainter of guile-cairo? tohoyn: sneek, botsnack sneek: :) oni-on-ion: i hear cairo is officially dead =( tohoyn: is it the same thing with guile-gnome2? spk121: pretty sure neither cairo nor guile-cairo are dead. There have been commits to both repos recently oni-on-ion: ah, hmm oni-on-ion: tohoyn, no spk121: the main cairo project is seeking a new maintainer, though. Bryce wants to step down oni-on-ion: ahh oni-on-ion: i've got cairo going real time with opengl i'd hate to change things up lloda: hi tohoyn lloda: i guess i am A maintainer lloda: i did the last release 1.11.1 tohoyn: File build-aux/git-version-gen is not present in http://download.savannah.gnu.org/releases/guile-cairo/guile-cairo-1.11.1.tar.gz. tohoyn: consequently autogen.sh does not work lloda: i got an email about that, was that you? tohoyn: probably yes lloda: i checked it was in git so that confused me lloda: an error in building the tar maybe lloda: actually, why does autogen.sh need to work from the .gz? that should have configure already lloda: tohoyn: ? tohoyn: lloda: I think it would be good if autogen.sh worked tohoyn: lloda: for example, if you need to make patches in the debianization lloda: is that all you need? tohoyn: for now, yes tohoyn: there may arise other issues in the debianization lloda: ok lloda: i'll put out a new .tar.gz later lloda: it always takes me time to remember how to sign the thing :-\ ayys: I am working with large numbers in Guile. When I try to convert these numbers from string, I get this error - In procedure string->number: Value out of range: -865. I am not sure how to catch this exception. The usual throw catch method doesn't seem to work here. RhodiumToad: do you know what the input string is? RhodiumToad: I'm guessing the input is a float with too large an exponent ayys: Yes. I know the input string. 887.678e-865. RhodiumToad: right. the exponent there is out of the representable range RhodiumToad: catch seems to work for it ayys: Can you share an example catch expression for this? RhodiumToad: old style, (catch 'out-of-range (lambda () (string->number "1e-865")) (lambda _ 0)) ayys: Thanks! This seems to work fine. dsmith-work: Hey Hi Howdy, Guilers chrislck: Rhodium: how does modern catch look like? RhodiumToad: see with-exception-handler chrislck: NaiveQu: what was wrong with catch? chrislck: ah the manual says catch is more complex chrislck: good manual RhodiumToad: well RhodiumToad: the problem was that between guile's old throw/catch and the rnrs exceptions, there were two (or more?) incompatible error handling systems RhodiumToad: so the point was to unify them RhodiumToad: so now catch can catch an rnrs exception and with-exception-handler can catch a throw chrislck: nice, thx dsmith-work: In the past, a common probelm in Guile is that the back trace printer throws an exception, giving a very misleading error report. Hopefully, the new exception code will do better. *: janneke adds set-mode procedure for mingw aleix: lloda: posted this message a while back with some tweaks to autoconf/make (in case you missed it) https://lists.gnu.org/archive/html/guile-user/2020-06/msg00021.html lloda: oh i missed it now :-/ lloda: sneek: later tell aleix sorry I missed it I'll try to have a look asap sneek: Okay. lloda: maybe if i'm forced to make a few releases in a row it will stop being such a pain daviid: lloda: do you need help? for the release I mean daviid: lloda: to sign nongnu releases, I use gpg -b --use-agent daviid: (gnu releases are signed as part of the automatic things done while uploading ...) daviid: lloda: to verify, gpg --verify daviid: then, chmod 644 the tar and signature files before uploading daviid: to upload, scp * (that will grab the taball and the signature files) llloda(or your savannah username if it differs)sv@dl.sv.nongnu.org:/releases/guile-cairo daviid: *lloda@dl.sv.nongnu.org:/releases/guile-cairo (or yourusername@dl.sv.nongnu.org:/releases/guile-cairo) daviid: lloda: I think :), but if you need more help let me know ... aleix: anyone attending any Guix discussions on Sunday? sneek: aleix, you have 1 message! sneek: aleix, lloda says: sorry I missed it I'll try to have a look asap daviid: tohoyn: nice, you might want 'to move' your "Hello World" example so it uses the gtk-application/g-application-run paradigm - then you also might want to add some more examples, and make screenshots ... my 2c chrislck: ice-9 is unusual places https://www.youtube.com/watch?v=thOifuHs6eY&t=319s (5:15s) oni-on-ion: ohh i like this oni-on-ion: how do i debug this? when i start guile, this is the only line it gives: oni-on-ion: Pre-boot error; key: misc-error, args: ("load-thunk-from-memory" "incompatible bytecode version" () #f)aborted oni-on-ion: not sure how to trace it. the binary will not even accept arguments justin_smith: oni-on-ion: I don't know that specific error, but an easy thing to try is using -q to disable your config (if any) justin_smith: if it's not your config, your packaging / install is likely bad, and it's trying to load objects compiled by a different guile version oni-on-ion: hmm, tried -q (same error) . and i think you are right oni-on-ion: i've removed all traces of any guile, i've had 3.0 previously (august). and rebuilt, hmm justin_smith: google indicates this is a problem that comes up with guix mixing root and user configs justin_smith: oni-on-ion: yeah, it would be the .go files (which are automatically generated) causing this problem, so you might want to look at where it's finding those oni-on-ion: hmm. on debian here. i will hunt down these files in system ~ oni-on-ion: it works ! just manually deleted everything all over /usr/local/ and /usr/ related to guile. oni-on-ion: thanks for the help =) hope you are having a great day! blessings ArneBab: wingo: theres a Guix talk that talked about problems using Fibers in Cuirass. Are you in contact? ArneBab: https://xana.lepiller.eu/guix-days-2020/guix-days-2020-mathieu-otacehe-fixing-the-ci.mp4 dsmith-work: {appropriate time} Greetings, Guilers spk121: dsmith-work: good morning justin_smith: oni-on-ion: that makes me wonder if the debian package definition for the latest guile (or the one before it) are broken? oni-on-ion: justin_smith, i could have had some guix things happening? i do not remember installing it on this debian system daviid: justin_smith: very unlikely (the latest debian package definition for guile ... literally impossible), but multiple installations with bad user config, very likely, imo daviid: oni-on-ion: guile is a dependency of some pacjages ... not many, but a few ... those who do not want the debian package (like myself) have to track and uninstall those ... daviid: uninstall/not install and keep an eye, while runnig the updates, once in a while it re-appears, so to speak ... daviid: sneek: later tell tohoyn thanks for the report, I fixed the problem, please pull, make/check/install and confirm that it indeed fixes the problem, tx sneek: Got it. tohoyn: sneek, botsnack sneek: tohoyn, you have 1 message! sneek: tohoyn, daviid says: thanks for the report, I fixed the problem, please pull, make/check/install and confirm that it indeed fixes the problem, tx sneek: :) tohoyn: daviid: Are you sure you updated the repository? The example does not work and git reported "Already up to date". daviid: tohoyn: the devel branch? tohoyn: daviid: I had the wrong branch. sorry. daviid: it's ok tohoyn: daviid: I get the following error with make: https://paste.debian.net/1172797/ tohoyn: I first gave the git clone command and then git checkout devel daviid: tohoyn: ah, sorry, I was working on the 'getting started with G-golf' while I switched to fix your bug report ... let me push the manual, then it will work :) daviid: just a min daviid: tohoyn: pushed, please pull and try again tohoyn: daviid: the example works now ok daviid: ok daviid: tohoyn: note that when you are using the gtk-application/g-application-run 'paradigm', you don't need to call gtk-init daviid: i have another few comments, if you are interested, but I have to go afk, it will be for another day ... tohoyn: daviid: yes, I'm interested tohoyn: daviid: I made a new release of Theme-D-Golf, see http://tohoyn.fi/theme-d-golf/index.html dsmith-work: UGT Greetings, Guilers tohoyn: daviid: it seems that gtk-tree-model-get-value is implemented as a generic function. Is it possible to access the nongeneric version of the function? leoprikler: tohoyn: you can always use GOOPS internals to access specific methods leoprikler: (generic-function-methods FUNC) yields a list of s, which you can then further inspect tohoyn: ok tohoyn: another thing: gtk-tree-model-get-value does not accept a value returned by gtk-tree-view-get-model as an argument tohoyn: see https://paste.debian.net/1172669/ tohoyn: daviid: see https://paste.debian.net/1172669/ leoprikler: tohoyn: you mean it does not accept the model? leoprikler: can you paste the method specializers and the class-of model for me? leoprikler: I suspect it has to do with interfaces still being rather fresh randart: Morning guilers! Can anyone tell me why (and (file-exists? "guile.rc") (load "guile.rc")) randart: doesn't work? randart: (trying to have a local rc in my current project directory) randart: Fails with "no such file or dir: "my/home/dir/./guile.rc" leoprikler: is this "/my/home/dir" or is the first slash really missing? leoprikler: you might want to try when instead of and randart: Fails with "no such file or dir: "/my/home/dir/./guile.rc" randart: sorry, bad mousing! randart: (when ... : same result. leoprikler: but guile.rc does exist, does it not? randart: I don't understand why file-exists finds the file, then load looks in the wrong place (~) for it. randart: Yes, it exists. leoprikler: try (let ((guile.rc (canonicalize-path "guile.rc"))) (and (file-exists? guile.rc) (load guile.rc))) randart: Wow, that worked! Can you explain why? leoprikler: Because guile.rc is an absolute file name and therefore no relative lookup will take place leoprikler: whereas "guile.rc" is a relative one randart: but file-exists? finds it nonetheless leoprikler: it's not about file-exists?, but load leoprikler: IDK what exactly load does here randart: so some inconsistency between the behaviour of f-e? and load leoprikler: you might also try (string-append (getcwd) "/guile.rc") instead, that should also work leoprikler: I don't think load is supposed to be used that way leoprikler: hold on a sec leoprikler: Okay, I've got nothing. randart: I just want the convenience of loading some relevant modules into the repl. The f-e? test need wrap the let incase the local.rc does not exist, but this solves my problem. Thx for the help. leoprikler: Again, it should work fine as long as you supply absolute file names to both. leoprikler: btw. for projects you might also want to do recursive lookup (i.e. find local.rc in the project root) tohoyn: leoprikler: yes, the model is not accepted as an argument tohoyn: leoprikler: what information do you need? tohoyn: leoprikler: I was away for some time leoprikler: tohoyn: (map method-specializers (generic-function-methods get-value)) leoprikler: tohoyn: (class-of model) tohoyn: (class-of tm) gives: #< 7f0977f7cd80> tohoyn: leoprikler: (map ... gtk-tree-model-get-value) gives: ((#< 7f096f0613c0> #< 7f0977f53bd0> #< 7f0977f53bd0>)) tohoyn: leoprikler: it seems that (class-of tm) is incorrect leoprikler: yep, probably not correctly handled in the return dsmith-work: UGT Greetings, Guilers chrislck: \o ManDay: Not a day goes by that I don't get at least one entirely incomprehensible error message from Guile :-( ManDay: I mean, look at this... It doesn't even mention any of my source files where the error occurs: https://dpaste.com/3KXJPZWCU civodul: not accessible over Tor :-/ ManDay: What is one supposed to do with this kind of error? emacsen: ManDay, wow, that is indeed a doozy ManDay: emacsen: Glad to hear I'm not the only one puzzled by that emacsen: I mean one could probably read it and figure it out, but not something you can read and just know off hand civodul: ah, probably the only thing related to your code in this backtrace is the "eval" stack frame civodul: meaning that the error comes from interpreted code civodul: interpreted code leads to terrible debugging because the backtrace shows source code locations of the interpreter, not locations of the interpreted code ManDay: I'm not sure whether it's the things that I'm doing (they really aren't anything that much out of the usual; perhaps complicated but entirely pure and without exotics like call/cc), or why I am so tormented by Guile's debug output, almost every single day RhodiumToad: the "wrong type to apply" thing I guess means that something that should have been a procedure was actually #f ? ManDay: RhodiumToad: Yes, I admit I didn't go into any depth, I just stopped when I got perplexed by the meaninglessness of that error ManDay: I should probably be able to figure it out, let me see... ManDay: Well, nope. It's not as easy as I thought. At least on the top level, where I invoke (test), `test` is a procedure indeed (and not #f) ManDay: So this error happens somewhere deeper in the code ManDay: civodul: I don't have any (eval)s in my code. Do you suggest I'd get a better output by invoking guile (or guild, to come back to that) differently? maav: ManDay: i think so, 'GUILE_AUTO_COMPILE=0 guild compile -o mod.go mod.scm' and adding that to %load-path should give better info leoprikler: Somewhere deeper in your code, you invoke #f and you have no idea where that might be? I do have to wonder at which point your libraries become big enough for you to consider compilation in advance. ManDay: leoprikler: Perhaps now... Though honestly, if just Guile would support an adequate set of options to perform compilation accordingly that would suffice ManDay: (i.e. pass on the -O0 or what it was) ManDay: maav: I'll try maav: ManDay: you already have -O[0123], what do you mean? ManDay: maav: W.r.t to what leoprikler said, we had that discussion recently about whether I'm using Guile wrongly (I typically only invoke 'guile' and let it compile for me). leoprikler insists that the correct way to develop with Guile is to invoke the compiler directly (usually via a build system), which I find too tedious (and Guile actually already acts as a build system to figure out *what* to ManDay: recompile, it just doesn't allow to specify -On on the command line like guild) leoprikler: just because gcc doesn't warn without -Wall doesn't mean your code is correct ManDay: what? ManDay: Ok, so I compiled with -O0 with guild and now the backtrace looks like this: https://dpaste.com/BQDPZX4YF maav: so that's the file calling #f as a procedure maav: it's being used through use-modules or with a direct load, so you can check that ManDay: I do not understand maav: that file is being loaded, and that file is calling #f, as in (#f something), but usually through some variable and so on leoprikler: You might want to increase COLUMNS to see the full file name maav: (or even with apply) leoprikler: and it seems to be a top level problem ManDay: Well, no and no ManDay: This is a piece of code: ManDay: (display "I am here") (newline) ManDay: (display "test = ") (display test) (newline) ManDay: (test) ManDay: And this is the output: https://dpaste.com/6C4VGHXYF maav: which means that your error is before that ManDay: If I remove the three lines of code, no error happens maav: i've added a (define (test) (#f)) line before your example and the exception is shown after, not before, the I am here line maav: it could be an autoload, perhaps maav: but no, your code doesn't provide enough info ManDay: I don't know what it is that you are saying. ManDay: Are you still saying it's a top-level problem? I'm calling #f? leoprikler: Between you unintentionally calling #f and Guile deliberately calling #f because it hates you, which is the likelier one? ManDay: Given this evidence, the latter? This code `display "Hello ") (display test) (newline) (test)` produces this output: https://dpaste.com/9USHL6TA8 leoprikler: I'm sure that's all of the code and there's nothing else to it. ManDay: I can give you the entire code, if you like, but you're entirely besides the whole point here ManDay: The error message of Guile is complete bollocks leoprikler: I'm pretty sure #f is not something you should apply. ManDay: And quite honestly (like usual) there is nothing out of the ordinary in my code. How am I supposed to work like that? ManDay: leoprikler: Sorry but you're being the opposite of helpful here ManDay: I think we're done leoprikler: I don't think "My code is correct, the interpreter is messed up." is a sane approach to debugging. ManDay: I never said any such thing. I do not dispute that there is an error my code. leoprikler: Okay, given that there might be an error in your code, would it not be helpful to know which file it is in [perhaps by increasing COLUMNS]? maav: ManDay: i've tested the code you have provided and it doesn't throw the error you say, the error message is really useful; the thing is that you don't provide a case to reproduce it ManDay: maav: I'll upload the entire code (obviously not a test-case), it's three files, hold up please maav: ManDay, that's asking us to do your job, which some people can do, but it isn't fair at all maav: you provided code, three lines, and it doesn't raise the issue ManDay: Obviously it doesn't. It was just meant to prove that I am, indeed, not calling (#f) maav: i told you what did i used to show the exact same message you get, but after the lines, not before maav: no, you are maav: you simply don't know where, that's the issue ManDay: Well, yes, sorry. ManDay: Not on the toplevel, I mean. ManDay: And the problem here is Guile's incomprehensible and thoroughly broken diagnostics maav: how am i so sure you're calling #f if they are incomprehensible? ManDay: I don't understand your question. maav: that you should be more polite if you're requesting help maav: it wasn't a question, but a pointer to start being a bit more helpful ManDay: maav: I think you mistunderstand. There isn't any help that I'm requesting other than Guile be fixed. We figure out this error and I fix it? Fine. That doesn't mean anything because in three hours from now Guile will produce another incomprehensible error. ManDay: The problem is not that I have an error in my code, I will be able to find that. The problem is that Guile is unsuited for developing if you can't go 2 hours on fairly simple code without Guile's diagnostic messages blowing up in your face. ManDay: I'm not saying it's easy to get that right; I'm not saying it's an easy fix to Guile. I'm simply observing that it's an immense problem. ManDay: And frankly, to get back at your all attempt's to help here, although appreciated, your allegation that this was caused "top-level", just because the error message is as incomprehensible as to infer any deeper level, as well as the allegation that I would be calling #f on top-level and be incapable of isolating it there, this is not productive and not at all helpful. leoprikler: I doubt there is a deeper level you can go without it showing up in the backtrace. leoprikler: Of course the "true root" of the issue is elsewhere, but it affects something at the top-level of your module. leoprikler: E.g. you (define something ) [...] (something [possibly arguments]) ManDay: no, I am not. If you don't believe me you can look at the code, but that you refused. So be it. maav: ManDay: I refused, not leoprikler, don't bundle us together ManDay: Apologies *: RhodiumToad would like to see the code leoprikler: W.r.t. the tone, requesting that Guile "be fixed" is (in my opinion) a rather rude way of asking for help. ManDay: RhodiumToad: Sorry took a moment https://gist.github.com/ManDay/8757ed9c42eaeee43c35af37ca770c44 ManDay: leoprikler: It's true, I shouldn't be "requesting" anything. But it would be the help that I need. taylan: ManDay: FYI link seems to require a GitHub account. (I have one but others might not.) a fairly good pastebin that requires no account is paste.ubuntu.org. ManDay: taylan: Thanks, I'd like to be able to delete the files afterwards (I don't want them to float around without control), that's why I put it on Github taylan: I think paste.ubuntu.com lets you set a time limit taylan: oh and it's .com not .org, my bad ManDay: Ah good, if anyone w/o GH account would like to have a look please let me know taylan: ManDay: what error message do you get again? (I joined in the middle of the discussion) leoprikler: FWIW I can download a zip without an account ManDay: taylan: If I pre-compile using guild -O0, I get this: https://dpaste.com/9USHL6TA8 taylan: ManDay: this is when you load the module, right? don't know if others said this already but "Wrong type to apply: #f" means that at some point, the code tries to use "#f" as if it were a procedure. if it's while loading the module, then it ought to be one of the definitions at the bottom, since they're the only ones that will execute code during module load. taylan: ManDay: nevermind the module load question, didn't notice it was two files ManDay: it's 3 taylan: indeed ManDay: one code, idg.test.ss and 2 modules which are being used leoprikler: oya oya? https://dpaste.com/98EUWDE76 dsmith-work: echo '(#f)' > /tmp/foo; guile -c '(primitive-load "/tmp/foo")' taylan: ManDay: my suggestion would be to add some type checks to your code. i.e. make some of the procedures explicitly check if the arguments they're getting are of the types you'd expect. like via (if (not (procedure? my-arg)) (error "Should be procedure." my-arg)) taylan: I agree that it's pretty bad that Guile doesn't give more details on where exactly the error occurs. not sure if there's a way to make it tell more. leoprikler: the error comes from tree-iterator-init leoprikler: I have no idea what it's supposed to do, but the cdr of this thing is called as a function. RhodiumToad: I think the cdr is supposed to be the iterator function, but that can be returned as #f by an earlier call RhodiumToad: in this case current is (6 . #f) RhodiumToad: so I guess the question is, how should that have shown up in the backtrace taylan: it's a good idea to use SRFI-9 record types instead of cons/list to store data. causes much less confusion. leoprikler: [or srfi-41 streams instead of home-baked iterators] ManDay: leoprikler: RhodiumToad: Let me just say it again: I don't expect you to find my error. I can manage that. ManDay: The code should just prove that the error is not inferrable from Guile's output RhodiumToad: how are we supposed to investigate why the error is not being reported more clearly without finding it first? ManDay: RhodiumToad: Well be my guest, I'm just saying I'm not asking you for that. You can wait until I found it, if you like ManDay: But I think it's symptomatic of a severe Guile problem. Every other day I have a problem like that with Guile. dsmith-work: One issue with building informative error messages is that not all objects in guile have source properties. leoprikler: It could also be a symptomatic problem of your code base. I can't blame the Guile numeric tower for my broken implementation of Peano arithmetics. taylan: leoprikler: well I think Guile should certainly tell during which procedure call the error arises taylan: if at all possible, that is. I have no idea what other implementations do in a situation like this. leoprikler: taylan: that's going to be super difficult with optimizations though, especially inlining leoprikler: wait, I'll try again with -O0 RhodiumToad: Exception thrown while printing backtrace: In procedure frame-local-ref: Argument 2 out of range: 1 RhodiumToad: that can't be good leoprikler: Okay, there is not much information to be gained here. leoprikler: The difference between 2.2 and 3.0 is one layer of TCO. lampilelo: what we need is a debugger for guile RhodiumToad: so as I see it, part of the problem here is that it's calling #f in tail position, which means that the details of where it is called from have already been thrown away leoprikler: exactly leoprikler: lampilelo: you can debug guile at C level with GDB, so that should not be an issue leoprikler: *Understanding* Guile at the C level on the other hand… takes time. RhodiumToad: well there's ,break ,step etc. in the repl leoprikler: okay, but that won't work if your problem is at the top level ;P dsmith-work: Oh how wonderful it would be to have that emacs stepper/debugger thing in Guile! Never even knew it existed. dsmith-work: You needed to instument the function in question, IIRC RhodiumToad: maybe the debugger (at least the debug version of the VM) should keep a trace history of tail calls RhodiumToad: after all, scheme code that does really long strings of tail calls wouldn't exactly be unusual or considered bad ManDay: dsmith-work: There is a letrec alright, but that's about as complicated as it gets. My program is purely functional, it can't get anymore stupid than that: Step into a function, calculate arguments, step into a function, calculate arguments. If a problem occurs, report back where in the stack you are. That's the absolute basis of scheme or any programming language. And yet Guile, with any ManDay: optimization turned off!!!, can't figure out how to do this correctly. This gives a very poor impression of Guile to me. leoprikler: You give a very poor impression of yourself to me. RhodiumToad: ManDay: tail calling always presents a problem for reporting errors leoprikler: IIUC tail call optimization is *required* by RnRS, so there's little Guile can do with that. dsmith-work: Yeah, Guile has lots of rough edges. And growing pains. Some of the old clothes^code don't fit right anymore... leoprikler: Perhaps -Ono-tco -Oplease-make-my-code-worse RhodiumToad: right, and tail-calling has to be done properly even when all optimization is disabled RhodiumToad: because otherwise perfectly correct code would just blow the stack and die dsmith-work: I've heard some Schemes (Racket?) keep a circular log of last tail calls for debugging. RhodiumToad: that's essentially what I just suggested above. leoprikler: I think a better way of figuring out the problem would be to begin tracing at a given point. leoprikler: [to stderr] RhodiumToad: no. the need for some kind of tail call trace is clear ManDay: leoprikler: Here is your well-deserved medal for personal attacks. Now please stop it or stop talking alltogether. Thanks. ManDay: That RnRs requires tail-recursive optimizations is very poor excuse, if errors in tail-recursive functions can't be properly traced by the interpreter. ManDay: The lack of stack context is in no way a reason that no source location is being associated with an error on -O0 RhodiumToad: uh, well it is if the stack is being examined to find the source location. terpri: dsmith-work, mit scheme is such a scheme, iirc (it would make sense if racket had it too, given its use in education) ManDay: RhodiumToad: You don't need the entire stack to do that, obviously. ManDay: If I, a thinking person, step through the program, I also tail-optimize and yet I know where the fuck I am RhodiumToad: you do that by remembering where you tail-called from. ManDay: No, I remember that by know which line of source code I'm currently reading. terpri: i think mit scheme is where i learned of that technique ManDay: Note this is not even about showing the correct stack, but only a source location! dsmith-work: ManDay: And that is sometimes not available. ManDay: dsmith-work: it is in a trivial example as mine. ManDay: If there is no source location, then so be it. ManDay: But this is the most simple programs of all, like I said: All verbatim in source code, step into a func, calc, step, calc, return. ManDay: And Guile butchers it terpri: dsmith-work, edebug works in guile-emacs fwiw :p but only for elisp, as i believe it depends on a code-walker for instrumentation RhodiumToad: you're not thinking about how tail calling has to work from the VM's perspective dsmith-work: terpri: yes! That's the thing I used. Very cool. ManDay: RhodiumToad: I'm thinking about how I'd implement it: The way that I'd do it as a person. And there is no excuse whatsoever for me to forget where in the source (or the stack, as far as it has not been optimized out) the error occurs. ManDay: On -O0, that is leoprikler: Your example is not at all trivial. RhodiumToad: it's probably not hard to construct a trivial example. terpri: ManDay, do you think a partial history of tail calls might be useful? ManDay: leoprikler: Yes it is, as far as the involved programming semantics are concerned. There is no eval, no explicit continuations, etc. Just a chain of functions. I can rewrite this in C, I WILL get tail-optimizations, and I promise you: GDB will debug this just fine. ManDay: terpri: you mean only show what's left of the stack after proper-tail recursions? If that's what's left, of course that's better. What's obligatory though is the source location. ManDay: FWIW, GDB is a good example. You may wanna look at this for a proper tail recursive call. ManDay: You will see, GDB does it correctly. Of course it does. It's damn trivial. ManDay: That's why I can't fathom how Guile breaks over it. leoprikler: (define (tail-call thunk) (thunk)) leoprikler: ((@ (system vm trace) call-with-trace) (lambda () (tail-call #f))) leoprikler: there we have our MWE. RhodiumToad: ManDay: hm? gdb can't show tail calls in a backtrace ManDay: RhodiumToad: What I'm saying is it does't break. You will get the stacktrace (with tail-recursions pointed out) and a source location. ManDay: PLUS you can turn off optimizations, if you like. then you get the entire stack. ManDay: (which also, Guile can't do, apparently) ManDay: (which, fair enough, you may blame on RnRS though that's a matter of taste, I'd say) RhodiumToad: in C, tail calling is a relatively rare optimization; in scheme, it's how most things work justin_smith: turning off TCO in a scheme isn't really viable outside toy situations justin_smith: it's not just "tail call", it's the rewriting of the stack RhodiumToad: I mean things like the named-let loop rely on it justin_smith: and yeah, that means you end up with garbage traces justin_smith: RhodiumToad: exactly, you'd stack overflow so fast terpri: ManDay, do you have a small example that makes guile forget the source location? i have a good guess at what might cause that (apologies if you already posted a test case, i only skimmed the scrollback) leoprikler: The other day we had the library syntax thing. ManDay: terpri: no i don't. i will probably have one when I found the error leoprikler: Today it's TCO ManDay: which is what I will do now leoprikler: @terpri: (define (tail-call thunk) (thunk)) leoprikler: ((@ (system vm trace) call-with-trace) (lambda () (tail-call #f))) leoprikler: I'm not sure if call-with-trace is even allowed on a file context to be honest. leoprikler: ah, okay, it needs --debug davexunit: calling it an "optimization" is misleading. tail calls are part of the semantics of Scheme. it's not an optimization be toggled on and off. davexunit: maav: exactly, it's like calling java class inheritance an optimization justin_smith: davexunit: sorry, that's the term I learned in the context of comparing languages, I can see how it can mislead in the scheme context leoprikler: You're not the only one at fault here. It's been taught that way in universities too. leoprikler: Or rather being, present tense. maav: justin_smith: i have the same issue, but i guess ellision it's more appropiate lampilelo: this is the simplest example of the error ManDay has: ((lambda () (#f))) davexunit: wasn't trying to call anyone out or anything. everyone calls it TCO so it's confusing. people think it could be disabled. lampilelo: how would you debug that? leoprikler: lampilelo: call-with-trace and --debug leoprikler: also prepare to pipe this into head -n5, because it's going to throw a huge trace at you ManDay: lampilelo: Nice! Thanks very much! ManDay: Was that an actual question or rhetorical? ManDay: I.e. are you suggesting that it is reasonable for Guile to not being able to associate the error with a source location? leoprikler: From what I understand, Racket's trace works similar but with slightly different syntax. leoprikler: And it probably doesn't blow up in your face when an exception occurs. davexunit: guile is not without its issues in the debugging department, but I work on rather large guile programs and real world backtraces have always lead me to my problem. ManDay: davexunit: my problem also comes from the real world ;) RhodiumToad: I have to say, finding the error in ManDay's actual example from the backtrace was not at all trivial davexunit: there's certainly improvements to be made ManDay: RhodiumToad: Did you find it (as in: the line of source)? RhodiumToad: yes leoprikler: I already told you the location, did I not? RhodiumToad: last line of tree-iterator-strip is the one that actually generates the error RhodiumToad: which is ((cdr current)) where current is (6 . #f) ManDay: RhodiumToad: Thanks very much. How did you do it? Just following the code along in your head? RhodiumToad: I used (pk) a lot. terpri: i wonder if read.c has anything to do with this, in particular maybe_annotate_source, scm_i_set_source_properties_x, etc. ManDay: RhodiumToad: I see. Well thanks a lot, again. It wouldn't have been necessary but you helped me a lot! terpri: because guile cannot set source properties on all data types dsmith-work: Exactly lampilelo: ManDay: i mean, you have a point that these backtraces often aren't very helpful, but the problem doesn't seem to be trivial to solve dsmith-work: Another thing that sometimes happens, is an error happens when attempting to print a backtrace. Causes lots of confusion. terpri: that's always fun leoprikler: If backtracing doesn't work, you need to forward trace ;) dsmith-work: It's the lack of implmenting "come from" that's the realy problem. ManDay: lampilelo: It might not be given the way Guile was designed (I don't know anything about its internals so I can't judge that, but I readily believe it), but it should be, because it's the most basic concept, so I dare to say it's a design flaw. davexunit: we can say anything if we're just going to wildly speculate. dsmith-work: For example: http://paste.debian.net/1172744 terpri: hm, if i have bad.scm with (define foo '(() . ())) (define (bar) (foo)), the backtrace isn't terrible helpful (only refers to ice-9/boot-9.scm) leoprikler: try compiling first leoprikler: then you should get the same issue as everyone else here dsmith-work: ISTR that Guile could only associate source positions with cons cells. Not sure about newish Guile. terpri: but i suspect that's a consequence of calling something uncallable rather than source location tracking per se leoprikler: the point here is, that we would like to know, that (foo) is the uncallable thing terpri: right dsmith-work: This shows a bit better errror location: http://paste.debian.net/1172746 terpri: it's a bit of an edge case, but surely an annoying one if you run into it unexpectedly leoprikler: dsmith-work: because read errors happen before anything else leoprikler: I don't think procedures are being formed at that step yet. dsmith-work: Yep. The reader got that one, and reader knows where it's reading. leoprikler: The compiler could catch ((lambda () (#f))) through symbolic execution, but that's it. terpri: https://paste.debian.net/1172748/ even for literals to which source properties can be attached, it doesn't help the backtrace leoprikler: is there a way of disabling terminal echo (as with stty) for password reading et al.? dsmith-work: Hmm. Maybe using something in readline? Or. Isn't there a curses interface for Guile? Maybe someting in there.. RhodiumToad: seems a surprising omission from the posix module RhodiumToad: it has tcsetpgrp/tcgetpgrp but not tcgetattr/tcsetattr RhodiumToad: of course there is the FFI... _sfiguser: hello all ManDay: Is guile-devel moderated? My message doesn't seem to get through ManDay: (I'm subscribed) leoprikler: ManDay: I know for a fact, that at least Guix is moderated, but it might be debbugs.gnu.org as a whole which does the moderation leoprikler: Moderation is only done on posting, not on reading ;) ArneBab: manumanumanu: that was you who effectively caused Guile 3 to gain the ability to have repeated defines by prodding Andy? cool! manumanumanu: ArneBab: I think it was purely an accident :) elliotpotts: does anybody know how to improve on this grizzly thing: https://gist.github.com/elliotpotts/6887af1bf43d0ca4955f54dede676631 ? leoprikler: sneek later tell elliotpotts have a look at scm_c_define_gsubr and perhaps pointer->procedure sneek: Got it. leoprikler: sneek later tell elliotpotts ah you're already using define_gsubr. You probably want to write your bind helper in a module like so (define (bind1 fn arg) (lambda args (apply fn arg args))), then refer to it from C++ using module-ref et al. Having a look at pointer->procedure would probably still be helpful tho, especially if you can resolve argument types at compile time sneek: Got it. plattfot: Hi guile users. I got an odd issue. The repl finds a procedure (pipeline) but my module does not. Both are using (ice-9 popen). I wonder if someone might know what's wrong? plattfot: I figured it out. I'm using guile-hall as the build system. And when running "guix environment -l guix.scm" it was picking up guile-3.0.2 which then was used to build and run my tests. My repl is using guile-3.0.4. Bumping the guile version in my guix.scm to 3.0.4 (guile-3.0-latest) fixed my issue. holri1: scheme@(guile-user) [14]> (help format) holri1: No documentation found for: holri1: (guile): format holri1: on debiab stable, why is there no doc? guile-2.0-doc is installed. holri1: what is the difference between 'a and "a" ? ayys: Has anyone implemented a language on guile using the PEG parser? RhodiumToad: holri1: 'a is (quote a) which results in a symbol, "a" is a string ayys: RhodiumToad: I'd like to add that 'X is a shorthand for (quote X) RhodiumToad: isn't that what I said? RhodiumToad: (I think you missed the question which I was answering) ayys: Oh Okay RhodiumToad: (the question was "what is the difference between 'a and "a" ?") holri1: ok thank you. comming from python there and learnig scheme... is there a difference in (let ((x 5)) x) and (let () (define x 5) x) RhodiumToad: not in that example. (define) is more like letrec than let, in that the body of the definition can refer to itself by name RhodiumToad: some people prefer local (define) as a matter of style, some don'r RhodiumToad: *don't holri1: I would have expected to write (define 'a 1) instead of (define a 1) because according to eval rules a would be evaluated if it is not 'a . But I guess that define is a special form that does not eval its first parameter. correct? RhodiumToad: define is indeed a special form RhodiumToad: (as is set!) manumanumanu: holri1: (define ... ) has the same semantics as letrec, i.e: (define a ...) (define b ...) can reference eachother. (let ((a 5)) (+ 5 a) is the same as ((lambda (a) (+ 5 a) 5) manumanumanu: in some schemes (let ...) will produce faster code, but guile is able to optimize letrec (and by extension define) manumanumanu: at least since 3.0 manumanumanu: (let () (define a 5) a) => ((lambda () (letrec ((a 5)) a))). (let ((a 5)) a) => ((lambda (a) a) 5) manumanumanu: (if I didn't fudge that up) manumanumanu: and, if letrec is implemented as a macro (which I believe it is not in guile), the expansion gets even more involved. The expansion in chibi scheme would be something like: ((lambda () (define a #f) (set! a 5) a)) manumanumanu: which is why local defines are slower in many schemes: it turns into mutation, which often means boxing, which means slow code. manumanumanu: In guile 2.2 (??? at least in 2.0) a local define will be slower than a let block. RhodiumToad: really? manumanumanu: RhodiumToad: ? manumanumanu: yes. I ported a piece of racket code to guile 2.2 a long time ago, and the overhead of defines was more than measurable. manumanumanu: RhodiumToad: iirc, that is really the point of the letrectification pass of guile (which as a bonus allows for defines in body context) manumanumanu: or is it the fix-letrec pass? manumanumanu: can't remember. manumanumanu: anyway, something happened in the 2.9.x releases that made internal defines magically faster. manumanumanu: the paper is aclled "fixing letrec (reloaded)". manumanumanu: and I think Dybvig is one of the authors. ArneBab: manumanumanu: thank you for the details on define! ManDay: I'm back at struggling with debug output of guile. How come that a "warning: possibly unbound variable" is marked with the line of the parent define, and not actually the line in source where the variable is mentioned? ManDay: I understand that under certain conditions scheme isn't the easiest language to produce stacktraces from, but this is so trivial, even guile should get that right, right? ManDay: Different subject: What would you recommend for a method to test a library with internals (e.g. test the library and symbols not exported by the library)? leoprikler: ManDay: location information tends to get optimized away unless you're using the right options ManDay: leoprikler: I use --debug, what else should I use? leoprikler: Not sure, but -O0 is a start ManDay: wait what ManDay: guile has an -O switch ?!? leoprikler: Well, guild has ManDay: that might just be something worth mentioning in the documentation guys... leoprikler: By the way, what is your workflow currently? ManDay: guile has driven me close to insanity with its incomprehensible debugging output for years, and i never heard (or can't recall) having heard of a -O switch leoprikler: Because Guile has no -O switch leoprikler: Do you even compile? ManDay: I just run guile . is that not how one is supposed to use guile? ManDay: i let guile do the compiling, i thought that's the idea leoprikler: Depends, but usually no ManDay: wow, okay leoprikler: If you just have mini scripts, doing that is fine. ManDay: so... how *are* you supposed to use guile correctly then? ManDay: And, sorry, but isn't that a bit of misleading design? I think it was reasonable of me to assume guile is to be used like that leoprikler: You'd usually invoke `guild compile -O... -W... -o OFILE FILE` and then invoke guile with GUILE_LOAD_COMPILE_PATH set ManDay: i don't even know where the documentation for guild is leoprikler: that way compilation and execution is split into two phases ManDay: it's crazy that that's how you're supposed to use it leoprikler: Again, it depends on your use case. ManDay: As I understand what you have explained, anyone whose use case is "developing" (as in: encountering bugs and debugging) is supposed to do this ManDay: So basically, everyone. leoprikler: It's like Python. You can either build one-line scripts that you barely glance at or huge ass libraries (and anything in between) leoprikler: Well, by the point you're "developing", you should already have a build system set up. ManDay: the comparison to python is very far fetched imo. you are telling me using "guile" without "guild" is unsuitable for development. that is not the case with python ManDay: you're pretty much disqualifying guile as an interpreter and scheme as a scripting language ManDay: which is fair, but absolutely unexpected ManDay: a scripting language (python, javascript) is notoriously fully functional without a build system or invoking the compiler explicitly leoprikler: Using python without setuptools is like asking to be murdered. leoprikler: You can do it, but the result is likely going to be unpleasant. leoprikler: Python and Javascript are not in anyway complete without build systems. leoprikler: Python does ship its own and we all know the story of NPM. leoprikler: You *can* use all of them just as interpreter, but power lies in the knowledge, when you ought not to. leoprikler: Also for reference, guild is mentioned in the manual: leoprikler: info '(guile)Using Guile Tools' ManDay: i very much disagree. for developing code alone, nothing but the python interpreter needs to be invoked ManDay: well in any way, I'm admittedly not benefining from this debate about python. i can't stand python ManDay: yes, I've read these 20 lines in the texinfo manual ManDay: but frankly, this is not how this should be documented. it might have been a mistake on my part to approach the development like this, but it is far from obvious what is the correct way to do it leoprikler: I'm pretty sure one would use a number of supplementary tools for serious™ Python development. RhodiumToad: ManDay: fwiw, I see the "possibly unbound variable" error on the form that contains the reference, is that not where you see it? RhodiumToad: i.e. not at the top level define, but on the innermost containing form ManDay: RhodiumToad: for example: I get the HELLO_THERE error on line 1: https://dpaste.com/4NUBQME6B RhodiumToad: using what guile version and invoking it how? ManDay: guile-3.0.4 --debug ... RhodiumToad: I get errors on lines 5,6,7 all pointing to the ( immediately before the unbound var ManDay: hm RhodiumToad: https://dpaste.org/Wfpp ManDay: leoprikler: I haven't been using guile (and not guild to compile things explicitly) all this time, because guile very much suggests that's the correct way to do it. It performs the auto-compilation. Just, as we have seen, it doesn't pass on any -O flag. So here is my question: Why can't do guile what it already does (act as the build system), but do it correctly? leoprikler: for the record, I get the same without --debug ManDay: Correctly, as in: To an extent which is usefull to a programmer ManDay: s/haven't/have leoprikler: "It doesn't pass any -O flag." Are you sure about that statement? ManDay: RhodiumToad leoprikler I was not correct. If I compile it as-given, I also get errors on line 6, for example ManDay: leoprikler: No, I'm not sure. But do you understand what I'm getting at? leoprikler: Autocompilation is a wild beast and for the purpose of compiling and testing libraries it is best disabled. ManDay: So what you're saying is that Autocompilation is effectively broken in parts leoprikler: No, I honestly don't. Guile is in no way a build system on its own and treating it as such will yield subpar results. ManDay: If it's no build system then why does it do the auto-compilation etc? ManDay: It's like a half-arsed build system ManDay: (which I fell for) ManDay: just you're telling me now, it's not good enough ManDay: okay, nvm. So what build system DO you suggest I use? ManDay: honestly, I've decided for scheme (and thus guile) for prototyping because I thought I would not have to put up with this stuff leoprikler: Perhaps you're confusing it for (guix build guile-build-system), which invokes guild? ManDay: i haven't needed a build system (i.e. a thing which figures out dependencies and re-makes things accordingly) because *I THOUGHT* guile does the job. leoprikler: Pardon my French, but the snippet you've posted seems far from a prototype to me. ManDay: and it does. but you're telling me it only works to a certain extent and I shouldn't rely on it ManDay: leoprikler: i don't understand what you mean ManDay: i'm just disappointed I have to concern myself with these things now. leoprikler: Well, neither do I, but at least now we can admit that we're talking besides the point. leoprikler: What are "these things" that you need to "concern yourself" with? leoprikler: There is a good reason, why few people write web servers in a REPL. leoprikler: For one, sooner or later processes tend to terminate. ManDay: establishing a build system. which, according to what I have learned, I only have to do because I can't use guile for development properly, which in turn I have only seen by example because optimizations happen which potentially screw with debugging ManDay: in repl? I'm not writing anything in repl? ManDay: i'm not using guile interactively ManDay: can I pass an -O through while using guile as my "build system"? leoprikler: You can set the autocompilation options, but at that point I have to wonder why you're not invoking the compiler explicitly? leoprikler: Like what's the point? ManDay: leoprikler: you mean, manually (as opposed to writing a Makefile)? ManDay: Because it's tedious to recompile all the files manually which I have changed. If guile wouldn't (allegedly) do it for me, I'd write a Makefile leoprikler: Guile is pretty easy to set up with Automake and there's tools to help you. ManDay: Which is kind of annoying, because I really haven't done this for a very long time. As a *real* build system I normally use CMake RhodiumToad: using guild directly is likely to be very inconvenient since there's no simple way to turn all the warnings on RhodiumToad: why in the nine hells would you use autotools when you don't need it ManDay: leoprikler: autotools only over my dead body leoprikler: Pretty much all serious Guile libraries use Autotools tho? RhodiumToad: ManDay: I would say, ignore leoprikler and do it as you were. ManDay: RhodiumToad: Thanks for the encouragement. What I will do though is follow leoprikler's suggestion about setting the default compile options ManDay: (just looking for how to, currently) RhodiumToad: I'm not sure those are even relevant leoprikler: I've searched for some libraries using Guile+CMake, but nothing useful shows up. leoprikler: I have some personal experience with Guile+Meson, but Autotools feels better imo. ManDay: ''' For help on a specific command, try "guild help COMMAND" ''' ManDay: Well, that doesn't work.... ManDay: leoprikler: I can't find how to set the default compile options, could you help me please? RhodiumToad: %auto-compilation-options is probably the thing you're looking for leoprikler: I'm not sure if those can meaningfully be set outside of a REPL. ManDay: i see RhodiumToad: possibly in ~/.guile ? ManDay: i think .guile only applies to the repl leoprikler: You can of course do it via --eval, but that's kinda cheating and debugging support is worse than repl ;) leoprikler: "debugging support" meaning if you type your sexp incorrectly ManDay: i already use a wrapper script to run my guile things https://dpaste.com/AM4RC8SBB ManDay: so adding more cheats wont hurt ^^ leoprikler: I think that'd make a little more sense if you wrote it as a guile script ManDay: heh, yeah, probably leoprikler: ManDay: just for fun, try "guild compile **/*.scm" in your source directory and tell me what you end up with. RhodiumToad: note that guild compile seems to default to no warnings enabled, which seems silly RhodiumToad: and there's no -Wall to turn them all on RhodiumToad: you'd have to -W each of them individually leoprikler: I think the default is some warnings, but not the same as in auto-compilation RhodiumToad: not as far as I can see. leoprikler: Default is -W1 ManDay: leoprikler: I'm still trying to figure out at which point the error jumps from "line 6" to "line 1" and I am, indeed, trying to compile the scm directly now, but I'm having some trouble with load paths give me a while pleae leoprikler: -L. for the current directory should suffice in most cases ManDay: urgh nvm, I edited the wrong file (adding 'add-to-load-path') lol RhodiumToad: there is no -W1 leoprikler: uix environment --ad-hoc guile -- guild compile -W1 foo.scm leoprikler: foo.scm:5:7: warning: possibly unbound variable `context.valid?' leoprikler: s/uix/guix/ leoprikler: guix environment --ad-hoc guile -- guild compile -W3 foo.scm leoprikler: foo.scm:1:0: warning: possibly unused local top-level variable `tree-iterator-increment' ManDay: ah, i found the problem. It stops working as soon as you put it into a library definition. i.e. try with this file: ManDay: https://dpaste.com/GQT8HM82K RhodiumToad: leoprikler: whatever's handling that -W1 is not guild ManDay: the error moves to "line 1" (now line 5) leoprikler: RhodiumToad: scripts/compile.scm? RhodiumToad: oh, maybe it is in 3.0x? RhodiumToad: 2.2 does not allow it leoprikler: guix environment --ad-hoc guile -- guild compile -O0 -W3 foo.scm leoprikler: foo.scm:5:0: warning: possibly unbound variable `context.valid?' RhodiumToad: ok, I do get unbound-vars warnings from guild 3.0.4 by default *: RhodiumToad does not use guix leoprikler: So optimization levels do not help here. ManDay: Should I write this as a bug to the mailing list? leoprikler: hmm, I'll try to figure something out real short leoprikler: ManDay: It's at least related to the library syntax. RhodiumToad: ManDay: does it behave the same if you use a guile module rather than the (library) wrapper? leoprikler: If you don't wrap the define in (library ...), it vanishes as well. leoprikler: Also for guile modules, @RhodiumToad leoprikler: So it's the BODY parameter of library. leoprikler: If I add an additional (begin ...), it becomes ManDay: great, lol leoprikler: does RnRS have include? :D ManDay: For a good Subject choice, what would you call that? Loss of line annotations? leoprikler: Loss of location information in RnRS library forms leoprikler: or loss of location leoprikler: (i.e. information might be superfluous) ManDay: aight leoprikler: Though chances are it lands on top of the big pile of RnRS incompatibilities only to be documented ;) ManDay: so you suggest I say it happens for modules? ;) leoprikler: no, it doesn't happen if you use (define-module) ManDay: What did you mean when you said: ManDay: <19:54 leoprikler> Also for guile modules, @RhodiumToad leoprikler: What I meant was (library ...) (define x) – location info is there leoprikler: (define-module ...) (define x) – location info is also there [this is what you'd usually write] ManDay: oh you mean if you put it outside of the library leoprikler: (library ... (define x)) – location info gets lost [this is what you'd write in RnRS] ManDay: yep ManDay: thanks leoprikler: Yes, but notice, that you can't put stuff outside the library form in RnRS ManDay: yes, i learned that the hard way leoprikler: For the record, Guile already documents its deviation from the RnRS standard in something closely related to that (multiple library forms) RhodiumToad: presumably the loss of location info is an artifact of how the (library ...) macro is dealing with the body leoprikler: hmm, I'd have to look at that more closely leoprikler: fwiw, (begin (define )) on its own retains line info ManDay: mail sent to guile-devel leoprikler: (@@ @@ (name name* ...) body) leoprikler: Now if anyone can tell me what that is and what it's supposed to do… ManDay: it's not an RnRS incompatibility as much as it is another screwed up debugging output/location ManDay: compatible with rnrs it is, fortunally ManDay: leoprikler: I think that looks pretty self-explanatory leoprikler: it does? ManDay: i'm joking, i have no idea what @@ @@ does ManDay: urgh, I just noticed I mis-edited my email. Now it says something about an "rnrs module or guile library"... ManDay: got to send a follow-up asap leoprikler: heh RhodiumToad: (@@ module binding) accesses binding from module even if not exported, but I have no idea what the @@ @@ does RhodiumToad: ah RhodiumToad: it's an undocumented thing to support the r6rs library macro... RhodiumToad: and bingo, it uses syntax->datum RhodiumToad: hm, not on the expressions though leoprikler: not directly leoprikler: but it gets expanded like so (@@ @@ (name name* ...) body) ... leoprikler: so each expression gets syntax->datum'd RhodiumToad: each name does, the body shouldn't? RhodiumToad: but I'm betting that the stuff in (remodulate) messes things up leoprikler: RhodiumToad: Without executing it, what does https://dpaste.com/DFWPRVUW2 do? RhodiumToad: uh, expands into (begin (peek (cons 'a 'b)) (peek (cons 'c 'd))) and executes that? leoprikler: exactly leoprikler: now, what does (@@ @@ (name name* ...) body) ... expand to? RhodiumToad: something far too complicated to work out by hand RhodiumToad: but it matches this form (_ @@ (mod ...) exp) and you will notice that syntax->datum is called on #'(private mod ...) RhodiumToad: note that exp is not in that RhodiumToad: so if exp (the body form) is getting mangled, then it's in the (remodulate) call leoprikler: well, there are two things here leoprikler: (remodulate #'exp mod) leoprikler: (source-annotation #'exp) ManDay: is "(remodulate)" something a normal person should know about? RhodiumToad: absolutely not ManDay: okay, that makes me feel better :) RhodiumToad: it's a local definition buried in the guts of an obscure macro RhodiumToad: (one which definitely deserves a "beware of the leopard" sign) ManDay: thanks guys for the help with my issue. guess tomorrow I'll spend on converting my libraries to modules and hope this will work better ManDay: gn leoprikler: good night leoprikler: ManDay: it seems remodulate constructs a new syntax from the old one bound to a different module leoprikler: oops, meant RhodiumToad leoprikler: the key here seems to be, that the source annotation seems to get lost, don't you think? leoprikler: there is only a source-annotation on the outermost expression [the one that ManDay reports to be the one they get during debugging] RhodiumToad: remodulate seems to be doing syntax-expression to get the content of a syntax object and then making a new syntax object around it RhodiumToad: I'm betting that loses the annotations RhodiumToad: yup. leoprikler: so the key would be to deal with the current-module-problem in r6rs libraries thereby eliminating the usage of @@ @@ leoprikler: then at some later point we could completely remove @@ @@ manumanumanu: ArneBab: I actually wrote a macro that youcan use to have defines in expression context in guile 2. I like to believe that andy saw the code, barfed, and implemented it properly manumanumanu: ArneBab: https://hg.sr.ht/~bjoli/guile-define . but not in the same way that guile3 does, so it is not a backport, sadly manumanumanu: Whereas guile3 turns everything in a body to letrec, that macro only turns successive defines into a letrec, so (define a 1) (define b 1) (display "what!") (define c 3) ... => (letrec ((a 1) (b 1)) (display "what!") (letrec ((c 3) ...) manumanumanu: it should be a trivial fix, though. civodul: hi! civodul: i have a line/column position within a C file civodul: how tricky would it be to determine the surrounding function boundaries using nyacc's C99 parser? civodul: hey, mwette, right in time :-) civodul: i had a question about nyacc: http://logs.guix.gnu.org/guile/2020-11-13.log#141914 dsmith-work: Happy Friday, Guilers!! civodul: happy Friday, dsmith-work! mwette: civodul: just saw your message; thinking ... ; happy Friday BTW civodul: i figured it might make more sense to do that with something like GNU GLOBAL civodul: because the c99 parser may want to do "too much" mwette: the c99 parser does not now capture location info ; I don't know what GNU GLOBAL is civodul: it's a tool similar to ctags/etags mwette: thanks civodul: ah too bad location info isn't captured mwette: probably not hard using source-location info in Guile -- lexer would add it to the terminals and parser would propagate through production rules ; but it's more code and more time to parser civodul: yeah manumanumanu: wingo: yeah... I noticed that it happened with ,expand as well as with ,opt. leoprikler: manumanumanu: it is tail recursive, but the return value in the else case changes from *unspecified* to #f leoprikler: oh, wait, the return value already is #f wingo: manumanumanu: in fact that's just the pretty-printer rendering it as "and". the expressions are equivalent dsmith-work: Thursday Greetings, Guilers lloda: is it normal that (isatty? (current-input-port)) is #f in the repl in a regular gnome terminal? tty -s returns 0 lloda: oh that is after activate-readline lloda: nvm manumanumanu: My internet stinks :( manumanumanu: Happy Wednesday! manumanumanu: I am seeing a weird reductionn a tail-recursive loop: (if (arbitrary-expression) (continue-loop) #f) becomes (and (arbitrary-expression) (continue-loop)). I am used to seeing and defined the other way around, and I am pretty sure they are equal, but my eyes are screaming that this is not tail recursive :D RhodiumToad: at least in r7rs-small, last expression in an (and) is in tail position, though that's because and is defined as syntax for if RhodiumToad: actually it defines explicitly that the last arg is in tail position too libfud: lazy evaluation is incredible manumanumanu: Happy Tuesday/Wednesday, guilers! manumanumanu: wingo: did guile 3's optimizer start doing more loop unrolling? I am getting 12 unrolls at the repl for my new try at writing a looping facility, whereas my previous one got me at most 5 (but that was for guile 2.2 iirc) manumanumanu: for a _very_ simple loop, I must say wingo: manumanumanu: humm i don't know. i don't think the peval limits were changed manumanumanu: (loop ((:for a (up-from 0 12)) (b (in-cycle (in-list '(1 2 3))))) (display b)) => (let ((b (gen))) (display b) (let ((b (gen))) (display b) ... ) wingo: yeah peval is the same. could be loop peeling, but i think that is also unchanged wrt 2.2 manumanumanu: strange. I'll try the code in 2.2 whenever I am done. manumanumanu: But any kind of accumulator turns into a let loop directly manumanumanu: (loop ((:for a (in-list '(1 2 3))) (:acc acc (summing a))) => acc) (let loopy-loop ...) manumanumanu: whereas something like (loop name ((:for a (up-from 0 10))) => 0 (+ a (name)) correctly pevals to 45. manumanumanu: It is very different code, though. daviid: leoprikler: I was re-reading our msgs of yeterday, then your first answer to bug#43025 ... daviid: leoprikler: as you said, module-use! does things, in 2.2 at least, in a way that when a module a import the public interface of a module b, there is no 'copy' (which is obviously the thing not to do, my bad but I have been too quick to patch g-golf for 3.0 doing this ...), rather it somehow points to the public interface of the imported module, which is exactly, afaic, what should be done leoprikler: daviid: Not sure how you want to work around the copying portion in 3.0, but okay wingo: ArneBab: i should do that :) wingo: moin civodul: o/ ArneBab: \o/ nckx: seen sneek? ArneBab: moin apteryx: what's the best way to combine predicates? apteryx: with a logical or apteryx: chaining of predicates with or within a lambda would be one, but I was thinking there might be something more specific that can be done. RhodiumToad: not sure what you mean? civodul: a higher-level procedure that combines predicates civodul: i think some Schemes have "conjoin" (?) RhodiumToad: wouldn't that be for and? a composed or would be disjoin, surely civodul: yes, conjoin and disjoin: https://docs.racket-lang.org/reference/procedures.html#%28part._.Additional_.Higher-.Order_.Functions%29 civodul: we should add them to Guile apteryx: civodul: I see, thanks :-) dsmith-work: Monday Greetings, Guilers dsmith-work: sneek! where ae you? wingo: moo :) dsmith-work: Can someone look through their scrollback to see when the bot went AWOL? RhodiumToad: 2020-11-08 21:11:36 <-- sneek (~sneek@cpe-65-185-85-154.neo.res.rr.com) has quit (Remote host closed the connection) RhodiumToad: timestamps in Europe/London, i.e. +00 at that date dsmith-work: RhodiumToad: Thanks muchly dsmith-work: Ok, that was about 4:11 pm for me I think. dsmith-work: Yesterday. daviid: leoprikler: I don't want to 'work around', this is a bug in 3.0, I hope it will be fixed daviid: leoprikler: ok, did you try? asking because iiuc you wrote a snipset to reproduxe the problem ... leoprikler: I contributed to the re-export code you're currently using for Guile 3. leoprikler: What I didn't account for at the time was the information you've just given me, my personal intuition was, that it was just supposed to copy the state as-is at the time of invoking leoprikler: With module-observe, you can add an "observer" to the module, which gets called whenever that module changes. daviid: right, although related, these problems/bugs in 3.0 are not the same - hence my quiz if you did try to 'observe', because i thought, reading your message of yesterday, that you understood the problem and even wrote a snipset to reproduce it on your side ... but I'll look into it, I was just curious to understand 'how far' you went wrt the later ... tx daviid: leoprikler: very good that you added guile-gi, and the table as well - wrt 'how far g-golf is to work with guile-3.0, I don't know, but I would think not too far :) - here is what I know: daviid: (a) we solved the re-export public iterface, thanks to both dsmith and your contribution, so that is out of the way; (b) I have identified another problem, which is that re-exporting the public interface of a module is 'static' in 3.0, dynamic in 2.2, so to speak, so adding a binding to a module, even doing so to the public interface of a module, doesn't seem to 'propagate' as it does in 2.2 - I know how to write a tiny snipset so I can daviid: ask on guile-devel, and possibly open a bug if maintainers say so ... daviid: but it could be that there is/are other problem(s), so telling how far I can't, but I would think not too far, let's see, no promises - but I have hope that every 'obstacle' will fall ... elliotpotts: afternooon RhodiumToad: mornin' leoprikler: daviid: I think I know why this is the case: The Guile 3.0 snippet only re-exports the currently bound symbols, so if you want to re-export stuff again, you'd have to listen on module changes and then re-export those too leoprikler: There are some functions for doing that, but they don't seem too well documented. emys: mwette, I typed up my findings here with regards to the module problem https://lists.gnu.org/archive/html/guile-user/2020-11/msg00003.html rlb: civodul: for cases where I don't care about competition/visibility, do you know if set! is promised to at least be atomic/safe wrt concurrent executions? I have some cases where I don't need the extra promises/overhead of an atomic box and wondered if I could just use set!. i.e. just need to be sure the assignment won't tear, and one of the competing set!'s will eventually win wrt visibility. rlb: As one example, idempotent caching. rlb: (idempotent, and deferred until requested, say for expensive (large) object hash codes) rlb: Though I suppose you could argue that if the computation is expensive, and atomic-box-refs are cheap enough, then that example isn't a particularly compelling one. civodul: rlb: yeah, i don't think set! is guaranteed to be atomic; and atomic box may be safer civodul: then again, if you know set! happens at a "safe time", it's prolly good enough rlb: I imagined as a practical matter, set! should end up always(?) being a pointer assignment, and if those are always "safe" (to the extent I described) on all the relevant architectures, then it's likely fine. civodul: emys: so you want to replace the current-reader fluid with another fluid? rlb: (But of course if you write a lot of code with that assumption, and then eventually we changeit, it could be *painful* to find/fix all the right places.) rlb: "change it" civodul: yeah RhodiumToad: pointer assignments aren't really safe RhodiumToad: though if you don't care about visibility they might be close enough rlb: Yeah, that's what I was wondering about, i.e. (unless cached-code (set! cached-code (compute-hash obj)). Don't care when other threads can see that, as long as they do "soon". Worst case, the code will be computed more than once. rlb: (And as long as no one can see a "torn" pointer.) rlb: Anyway if it's not something we're really confident about, probably just avoid it, or use some alias that'd be easy to find/change later. ArneBab: wingo: do you have an updated version of your “improve compiler”-thread? https://wingolog.org/archives/2016/02/04/guile-compiler-tasks daviid: leoprikler: what functions/procedures 'for doing that, but they don't seem too well documented', were you thinking of/refering to? leoprikler: module-observe[-weak] daviid: I did ask, here is what they answered: daviid: The website is a static site: https://gitlab.gnome.org/Infrastructure/gtk-web/, You can open a merge request for it, you can edit this page https://gitlab.gnome.org/Infrastructure/gtk-web/-/blob/master/_docs/language-bindings/index.md daviid: but i don't even have an account, nor a third party account (it seems you can't register anymore), and i'd be happy to clone and send an sxml patch to a ML, but ... they don1 thave ML anymore and don't use sxml :):) so, if anyone here has the knowledge, time, an account ... it'd be nice, let me know leoprikler: It appears you can convert boring old Github/Gitlab accounts to GNOME Gitlab accounts, so that works out for me. leoprikler: Okay, I've managed to get a local checkout, but I'll have to stop here and continue later ArneBab: manumanumanu: cool! Thank you for the info! daviid: leoprikler: cool, whenever you can of course, here is the commented code snipset I posted for inclusion - https://paste.gnome.org/pxegc8rak leoprikler: daviid: https://gitlab.gnome.org/leoprikler/gtk-web/-/blob/master/_docs/language-bindings/scheme.md leoprikler: Let me know if there's something I should add. daviid: leoprikler: nice! for the 'About' subsection, I would copy the one on the g-golf website, or the guix synopsis - otherwise, it's seems good to me, tx again daviid: going afk to rest, bbl ... leoprikler: hmm, I think that neither are quite fitting for the context of Gtk-Web. leoprikler: That it's GI-based is already clear from its inclusion in language-bindings. leoprikler: And that it uses GOOPS does not differentiate it from the other GI bindings for Guile, that are out there ;) daviid: leoprikler: please, take the g-golf about text, or the guix synopsis daviid: tx leoprikler: daviid: https://leoprikler.pages.gitlab.gnome.org/-/gtk-web/-/jobs/974042/artifacts/public/docs/language-bindings/scheme.html daviid: leoprikler: perfect, many thanks leoprikler: daviid: For the sake of completeness I also mention Guile-GI and include a Guile version compatibility table: https://leoprikler.pages.gitlab.gnome.org/-/gtk-web/-/jobs/974182/artifacts/public/docs/language-bindings/scheme.html leoprikler: How far away is G-Golf from Guile 3.0 compatibility? spk121: hi leoprikler: Hi RhodiumToad: mornin' elliotpotts: evening folks civodul: hey spk121 elliotpotts: anybody managed to replace setjmp/longjmp with c++ exceptions before? elliotpotts: I suppose being able to do it myself is the whole point of the GPL :D RhodiumToad: hm, guile uses setjmp in an illegal fashion RhodiumToad: the setjmp call in vm.c is undefined behavior elliotpotts: well that's no good elliotpotts: even in C, you mean? RhodiumToad: C allows setjmp to appear only in very specific contexts. elliotpotts: gosh elliotpotts: how is it acceptable that guile has UB? maybe gnu c has an exception or something? RhodiumToad: setjmp(...); can be a statement by itself (with optional (void) cast), or you can have setjmp(...) with an optional comparison to an integer constant or an optional ! operator as the expression in a conditional statement or switch() RhodiumToad: all other uses of setjmp, including the resume = setjmp (registers); in vm.c, are undefined elliotpotts: that's disappointing elliotpotts: it looks like I can't use guile RhodiumToad: why not? RhodiumToad: if you're going to modify it to use exceptions, then you'd be changing that anyway elliotpotts: I mean, I'm not sure I can be bothered to put the effort in to change it to exceptions, though :P elliotpotts: I'm not familiar at all with setjmp/longjmp RhodiumToad: setjmp returns 0 when called normally, but longjmp makes the corresponding setjmp call return again with a value other than 0 RhodiumToad: so if (!setjmp(&x)) { /* this part happens normally */ } else { /* this can only happen if something in the normal part did longjmp(&x) */ } RhodiumToad: if you don't mind limiting yourself to gcc or llvm, then you could do what luajit does and use libunwind-based exception logic RhodiumToad: that's probably more of a project, though elliotpotts: yeah, sounds like a bit of a project ... elliotpotts: really all I wanted scheme for was to eval some sexprs with quoting elliotpotts: I was thinking of using quoting to replace what is essentially JSX-esque stuff elliotpotts: I want to define my UI with sexpr elliotpotts: `(label (:text ,(get-name))) elliotpotts: ^this sorta thing. So any lisp will do really, I just thought it'd be nice to use gnu guile elliotpotts: brb, installed a new kernel chrislck: very ominous: "brb, installed a new kernel" RhodiumToad: the longjmp thing is only likely to be a problem if you call into c++ code from guile and throw exceptions mwette: while on the setjmp issue, is setcontext more typical than setjmp these days? spk121: mwette: setcontext hasn't made it into the WG14 standard for C2X. I don't have a feel for how popular it is out in the real world spk121: of course the actual C2X standard is pretty weird: thousands of obscure math functions but no way to list the files in a directory RhodiumToad: I wouldn't say it's more typical elliotpotts: the problem is if I call guile from c++, destructors will be skipped over if the guile code throws RhodiumToad: so catch anything thrown by guile at that point dsmith-work: Happy Friday, Guilers!! civodul: yay, happy Friday! spk121: a happy friday indeed mwette: thx all mwette: enjoying RDO Friday today chrislck: \O FRIDAY chrislck: (dance) spk121: RDO? dsmith-work: So if you call guile code from C++, you need to wrap the call in a catch handler to get controll back. dsmith-work: elliott_: ^^ (if you are elliotpotts) dsmith-work: Yes. It's tedious. leoprikler: FWIW I wrote a wrapper once, that catches Guile exceptions and stores them in GErrors, with the code only being a rather short switch case leoprikler: converting them to std::exception should not be a big deal leoprikler: RhodiumToad: is the return value of setjmp after longjmp not defined as "the argument that was passed, or 1 if it's 0"? RhodiumToad: yes, that's how it's defined RhodiumToad: why? mwette: RDO = regular day off : work 9 days every two weeks dsmith-work: So is that 5+4 or 9 straight? *: dsmith-work wants a RDO dsmith-work: Today would be perfect! mwette: wk1: 4x9hr + 1x8hr; wk2: 4x9hr spk121: three day weekends would be nice mwette: You get used to it. rlb: Does guile allow us to assume anything wrt set! and threads, i.e. maybe that all threads will eventually see the change, and that the underlying word change will be atomic? (I suspect that's true, but wondered if we're allowed to depend on it.) justin_smith: rlb: I'm not sure of the details here, but a pattern I have learned that simplifies this a lot is using an immutable data structure, plus a mutable box - it's much easier to ensure that the one mutation (changing the box) never puts the data in an invalid state justin_smith: guile has immutable sets and hashes, and and it's easy to pretend lists are immutable and just not use the mutation function on them rlb: Oh, certainly - I just have a special case in some testing code where it'd be easier to rely on mutating the let vars. rlb: I can easily rewrite it to use atomic boxes or something similar (the code is actually testing some race conditions, so rewriting it more functionally would invalidate the test :) ). spk121: it would be cool if there were a procedure like 'eval-string' that processed a line of text as if you were typing it into the REPL leoprikler: you mean completely with meta commands like ,L? leoprikler: there is (run-repl* repl prompting-meta-read) leoprikler: [unexported, of course] leoprikler: similarly start-repl*, which is used by coop-server even though it's not exported emys: so, I am implementing my own language using the guile compiler tower. emys: now I have a weird issue, in the spec I set the #:make-default-environment parameter to a custom function so that I start from a clean-slate environment (and not use the scheme environment). emys: If run a script using `guile --language=my-lang my-file' everything works as expected (my test is the `write' procedure which isn't present in my lang). emys: I mean `guile --language=my-lang -s my-file' emys: If I run the repl via `guile --language=my-lang' the `write' procedure seems to still be in the namespace emys: so I am fairly confident that in the repl, the environment-generating thunk is not called mwette: You are setting #:make-default-environment in your lang/spec.scm file to something appropriate? emys: mwette, think so, I had a look at make-fresh-user-module and went from there, its a thunk in which I use (make-module) to create a new module and `module-define!' for adding the builtins emys: if I ad an `(error "test")` call, `guile -s` doesn't work anymore because an error is raised but I can still use the repl with my language emys: also I have verified that in the repl it indeed uses my compile-tree-il code because the forms I implemented there are correctly treated. mwette: What if you run guile and use ,L my-lang ? emys: same as guile --language=my-lang emys: maybe its something about the "#:evaluator" keyword? emys: Its not documented in the docs so I didn't use it emys: but I don't thats the reason mwette: I use '#:evaluator (lambda (exp mod) (primitive-eval exp)) mwette: but I'm including the scheme env in my lang's emys: yeah, adding this doesn't change anything. emys: ,L ecmascript also features scheme stuff on the repl mwette: maybe try '#:evaluator (lambda (exp mod) (eval exp mod)) emys: I guess REPL is using (current-module) or something emys: mwette, will try mwette: Your compile routine is returning the env it was passed? (values tree env cenv) mwette: It's been a while since I worked on this stuff. *: mwette afk for a bit emys: mwette, it does emys: in the REPL, (current-module) is $1 = # emys: outside the REPL its # mwette: check this: (use-modules (system base compile)) mwette: sorry: (decompile (compile '(write 1) #:from 'scheme #:to 'tree-il #:env (make-module)) #:from 'tree-il #:to 'scheme) mwette: maybe that is not good because scheme will pull in it's default. But you may be able to decopile inside your compile-tree-il to see what's going on mwette: or try the (deompile (comile #:from my-lang #:to tree-il) #:to 'scheme) with use of write in my-lang mwette: maybe this: in (system repl repl) meta-reader is called with (current-module) daviid: I am going to add the traditional 'hello world' example the g-golf user manual, which I pasted here a few times, but the guile/g-golf code I pasted is some what a more complete version then those exposed at https://gtk.org/, the python code for example - which I could entirely 'mimic', if I wanted to 'compete' for the none less traditional 'contest' for the minimum number of lines of code, maybe - but even though, I have a question for daviid: a pythonist daviid: this python code, at https://gtk.org/, does not have a #!shebang ... so do i understand correctly that a python user could paste the code in a pythobn repl, but how would a python user drop the code in a file, chmod a+x and ./hello-world.py, what would be the missing lines to ne added if someone wanted to do that? pure curioisity, just to compare with our daviid: #! /bin/sh\n# -*- mode: scheme; coding: utf-8 -*-\nexec guile -e main -s "$0" "$@"\n!# wleslie: #!/usr/bin/env python daviid: wleslie: and what about the entry point, would the python code have to be changed to have a main function? daviid: the entry pojnt and command line args wleslie: to meet common code standards, you could put the last line in an `if __name__ == '__main__':` block daviid: wleslie: ok, thanks wleslie: if you want to accept command line arguments you'll need to import sys; which makes them available at `sys.argv` daviid: wleslie: although i prob won't be able to tun it here, could you kindely complete this snispet for me, so it does have an entry poin t and honour comannd line args ... if it's ok for you of course - https://paste.debian.net/1170009/ wleslie: what do you want to do with the arguments? daviid: wleslie: nothing, just printf, or maybe passing the 'hello world' string so - just curious to compare with guile ... daviid: wleslie: the important thing is I'd be able to conpare, but i a a real example, those args would be passed to the run procedure, daviid: wleslie: in a real app, a real gtk app, the call would be daviid: (run (length args) args), args beig the command line args daviid: wleslie: here is the scheme code - https://paste.debian.net/1170010/ daviid: the entry point is main (as you know), the args processing is on the last line ... wleslie: here's how I'd change it as a start https://paste.debian.net/1170011/ wleslie: you can access sys.argv within the function of course but that's not really good practice daviid: wleslie: ok, many thanks wleslie: no worries daviid: wleslie: just for info, one can not change the on_activate arg list (nor any signal arg list), so i guess the correct thing you be to change the last line to call daviid: app.run('length'sys.argv[1:], sys.argv[1:]) - what ever would be the right syntax in python ... daviid: wleslie: but that is a detail, thanks again, now I can compare and make usefull comments in my g-golf manual ... wleslie: daviid: that's why I used connect_data, which I found using help() daviid: ah ok, i missed that change, great! daviid: I also can entirely 'mimic' the python code, without any decoration, box, label, shebang, entry point and arg processing, and even ask the gnome teram to post it at https://gtk.org/ wleslie: lists know their length, so there's no equivalent to argc wleslie: sounds good daviid: wleslie: ok great - I could do that in scheme as well, but had so many other more important things to so that I did stick to the original args for those gtk-init, clutter-init, g-appication-run ... maybe for 2.0 :) wleslie: the never-ending fun of adapting APIs to a different paradigm wleslie: I have a python library that wraps the libfirm C compiler backend and just kind of hand-waves away the fact that the underlying C library uses global variables for a bunch of state daviid: wleslie: agreed, the only effort I wanted to and did dedicate wrt 'subject', while working on g-golf, is to 'hide' GValue initialization, because it really is difficult for users to 'do that' ... with time, I may also dedicate a bit of time to auto list length, but not know and not in the near future ... chrislck: \o/ hello-world.scsm civodul: hi! wingo: o/ takside: hey there, anybody have experience with guile pipes or gnutls that would mind clarifying a couple of things? dsmith-work: {appropriate time} Greetings, Guilers mwette: howdy manumanumanu: stis: Hej! daviid: procrast time :) - I have a hello-world minimal example 'style' related quiz, if I succeed to get it on https://gtk.org/, let me paste daviid: here https://paste.gnome.org/pls21g4aq - would you prefer to publish as it is, or remove 12 to 14 and uncomment 16 ...? daviid: also, for the language of your choice, would you prefer I ask for "Guile" or "Guile Scheme"? str1ngs: daviid: use 12 and 14 and guile scheme. imho daviid: str1ngs: ok tx, anybody else has an opinionated opinion on this exesitential vital quiz :)? manumanumanu: I agree with str1ngs, but I know nothing about GTK. manumanumanu: but comment the sexpr properly with ;;. Not even the syntax-highlighter likes sexpr comments. daviid: manumanumanu: ok, tx for your opinion, wrt the commented code, I actually will remove it, justadded to ask here ... leoprikler: daviid: "Guile Scheme" leoprikler: I think you might want to present both variants in slightly different contexts. leoprikler: (run (let ())) is closer to Scheme, but (let () (run)) is closer to Gtk daviid: leoprikler: ok - to ask the gnome team to publish the example on https://gtk.org/, I'll keep one variant only, it really is 'just' an invitation to search/read about Guile and G-Golf - in the G-Golf manual, I will present it and other examples in a more complete and 'realistic' manner, as well as how one should build a real app ... daviid: I'll justr add some comments, just like they did for the python code ... leoprikler: Okay, then the latter so as to keep with their style leoprikler: i.e. (let () (run)) daviid: ok, you all agree for "Guile Scheme" and the launch using the code as lines 12 - 14, so I'll do that, tx chrislck: AFAIU, CPS macro writers are voodoo practitioners leoprikler: Not sure, I think it's harder to write the macro without passing continuations manumanumanu: leoprikler: If I got to chose between writing goof-loop using syntax-case and passing state using parameters and handling everything explicitly using syntax-rules, I would definitely use syntax-case. The reason I don't is to make it more portable. Using syntax-case and programmatically expanding the sequence macros I could actually write the sequence creators as procedures instead of the cluster-fudge it is manumanumanu: now. leoprikler: Is syntax-case not standardized? manumanumanu: in r6rs, yes manumanumanu: but programatically exanding macros is not. leoprikler: Ahh, so this is for r5rs compatibility. manumanumanu: and r7rs leoprikler: Oh, r7rs drops syntax-case? manumanumanu: no. the jury is still out on r7rs-large manumanumanu: but don't get your hopes up manumanumanu: I think the neatest thing if people are willing to break backwards compatibility would be srfi-72 (not sure about that number), which is sort of an amalgamation of syntax-case and explicit renaming manumanumanu: That more or less completely removes the need for gensym/generate-temporaries in syntax-case leoprikler: Hygienic macros? manumanumanu: syntax-case is hygienic unless you tell it not to be. The guarantee is just that any identifier introduced within a macro won't clash with any outside identifiers. That means if I have 2 (in-list identifier) macros that I expand programatically within my loop macro, their binding 'cursor' will collide leoprikler: I think you've misread me, the question was supposed to be "SRFI 72 Hygienic Macros"? manumanumanu: yes, that one manumanumanu: I had a look at guile's quasisyntax to see if I could maybe hack a way to add a (syntax-unquote/hygienic ...), but I never got far. manumanumanu: or a (quasisyntax/hygienic ...) where each unquoted syntax object is guaranteed to be unique. manumanumanu: but then psyntax.scm happened. manumanumanu: or rather, I don't really know to hack quasisyntax.scm. it seems manageable, but jeez... RhodiumToad: speaking of weird macros, I've been vaguely poking at trying to find a way around the r7rs letrec-syntax booboo RhodiumToad: (i.e. that letrec-syntax makes a lexical contour, so you can't use it at top level, as you can in guile currently) RhodiumToad: my somewhat vague thoughts were to do something that expands into a define-values RhodiumToad: (anyone have any thoughts on that?) manumanumanu: RhodiumToad: do you have more info on this booboo? manumanumanu: a discussion somewhere? RhodiumToad: uh, jcowan I think mentioned it to me here a while back manumanumanu: you can't use letrec-syntax at the toplevel? ... RhodiumToad: in guile you can. manumanumanu: I don't really understand where that is specified in the r7rs-small document manumanumanu: and it seems to work in my chibi install RhodiumToad: my understanding of r7rs, and jcowan's, is that it creates a lexical scope and therefore you can't put top-level (define)s in it manumanumanu: aaah RhodiumToad: let me find it in the logs RhodiumToad: http://logs.guix.gnu.org/guile/2020-04-08.log#195800 manumanumanu: RhodiumToad: We need to figure out if any scheme actually does that. Chibi splices. manumanumanu: guile as well elliotpotts: evening folks elliotpotts: still haven't found any clue about catching errors during scm_read :( leoprikler: same is with other procedures,through scm_catch elliotpotts: huh, I guess leoprikler: *same as, of course dsmith-work: {appropriate time} Greetings, Guilers prussian_blue: welp, as somebody mentioned earlier prussian_blue: exception handling is implemented with setjmp, totally incompatible with c++ prussian_blue: unless some wizard is familiar with the implementation... it could be possible to throw a c++ exception instead of doing a jmp dsmith-work: I suspect the only way is to always catch all C++ exceptions on the Scheme->C++ return boundary. dsmith-work: And probably the same if calling C++->Scheme. RhodiumToad: or use libunwind *: dsmith-work looks up libunwind.. dsmith-work: Interesting RhodiumToad: luajit uses it on some platforms/compilers to make its exception handling interoperable with c++ exception dsmith-work: Doesn't newish Guile have non-contiguous Scheme call stacks? RhodiumToad: (a fact I recently became aware of due to having to track down a bug in same) RhodiumToad: the scheme call stack isn't on the C stack though. dsmith-work: Indeed jlicht: does anybody happen to have some guile snippets around to read and write YAML? leoprikler: There seems to be https://github.com/mwette/guile-libyaml jlicht: leoprikler: nice, that looks exactly like what I'm looking for leoprikler: The guix.scm sadly feels a little incomplete dustyweb: hi hi manumanumanu: ArneBab: goof-loop is now pretty much feature complete! No module definition yet, also no tests nor documentation, but done enough to play with. manumanumanu: ArneBab: goof-loop is now pretty much feature complete! No module definition yet, also no tests nor documentation, but done enough to play with. manumanumanu: ArneBab: https://git.sr.ht/~bjoli/goof-loop ... The code produced by the macros is nicer than guile-for-loops, and the iterator protocol is nicer. I believe I can actually implement something like (in-cycle (in-list '(1 2 3)) without much fuzz, using macro rewriting for the common cases, and srfi-158-style generators for the rest manumanumanu: anyway, good night! *: chrislck_ in admiration of macro hackers ArneBab: "goof-loop" — nice! :-) elliotpotts: is there a c equivalent of `lambda`? I asked the other day about a userdata sneek: Welcome back elliotpotts, you have 1 message! sneek: elliotpotts, str1ngs says: . Hello, you can also catch error/exceptions with C. see https://www.gnu.org/software/guile/manual/html_node/Exceptions-and-C.html elliotpotts: I'm solving my lambda problem in a rather horrible way: elliotpotts: scm_c_eval_string(format("(define foo (lambda args (dispatch (make-pointer {}) args)))").c_str()) elliotpotts: essentially serialising my captures to scheme terms elliotpotts: sneek: thanks, I did see that page, it sounds like it's outdated? if it's not, I guess I'll use that leoprikler: if this is C++, why not use C++ lambdas? catonano: lloda: did you find anything about filename completions in the REPL ? lloda: catonano: no... I didn't configure anything, and i haven't had time to really look into it. I've seen https://www.gnu.org/software/guile/manual/html_node/Readline-Functions.html but i haven't touched any of that in my config lloda: it's nice to have filename completions inside a (load "... form lloda: but having them everywhere, it's very annoying catonano: lloda: well I'm interested in the issue. Should you find anything, I'd appreciate if you would share it lloda: I will catonano: lloda: thanks lloda: otherwise it bothers me that (let () (define a 0) a) is ok but (when #f (define a 0) a) is an error :-\ lloda: ok, i can see why that is lloda: still ArneBab: lloda: that bothers me, too. it’s no longer as bad as before Guile 3 (you can now do (define (foo)(define a 5)(write a) (define b 6) b) ), but it still feels not-so-nice that I sometimes have to explicitly start a let-scope ArneBab: (when #f (define a 0) a) ;; fails ArneBab: (when #f (let ()(define a 0) a)) ;; works ArneBab: so the let in when should be implicit if there’s a define ArneBab: It’s also strange that this does not work: (when #f (begin (define a 0) a)) ArneBab: Are there compiler-theory reasons for that, or is it just simplicity? elliotpotts: leoprikler: the problem is it's difficult to register them as scheme functions elliotpotts: since they cannot be cast to function pointers leoprikler: Neither can std::function, I assume? leoprikler: ArneBab: (when #f x) is already short for (if #f (begin x)), is it not? lloda: imo it's kinda wack that (begin (define a 0) a) is ok, but (if #f (begin (define a) a)) is not lloda: sorry (define a 0) ofc lloda: altho thinking about it it seems unavoidable. Sometimes you need to group and not scope lloda: would be easier if these two were one and the same ArneBab: leoprikler: hm, yes ArneBab: begin just pulls the code back into the outer scope, AFIK ArneBab: AFAIK leoprikler: I'm not completely sure about that either leoprikler: I think part of it is, that "if" bodies are no longer seen as top levels leoprikler: otherwise (when feature (define-public (yay) 'yay)) would make sense leoprikler: but it seems you need cond-expand for that topoi: I'm using OpenBSD as enddevice and suddenly (since 6.8?) my dhclient doesn't seem to get an IP from a specific router. The non-OpenBSD devices I'm using still get their IP's. Any Idea? topoi: Sorry. Wrong channel. =3 elliotpotts: leoprikler: correct, they can't manumanumanu: chrislck: don't you like Continuation-passing syntax-rules macros? :D :D manumanumanu: I didn't make that shit up, though. Alex Shinn has been the source of almost all my WTF-syntax-rules?! moments... dsmith-work: UGT Greetings, Guilers elliotpotts: so, I'm still quite confused about exception handlers elliotpotts: if I'm implementing what amounts to a REPL, I need to: elliotpotts: 1. take user input elliotpotts: 2. read it elliotpotts: 3. evaluate it elliotpotts: for 2, I can use scm_read, but how to I catch exceptions raised during this? dsmith-work: Need to call things within the context of an exception handler. https://www.gnu.org/software/guile/manual/html_node/Catching-Exceptions.html dustyweb: huh dustyweb: nomad is impressive dustyweb: also I didn't know about emacsy. dustyweb: seems useful civodul: yeah both are pretty cool! roelj: Is there something link valgrind for Guile? I'd like to see why my program's memory slightly expands as days pass by. civodul: roelj: there's no heap profiler, but there's 'gcprof', an allocation profiler civodul: it can give you hints as to what's leaking roelj: civodul: Alright, can I log the output of gcprof to a file? roelj: Oh, I can just pass #:port. That doesn't seem to be documented in the manual. roelj: civodul: Thanks! I think I've got it now. It'll take a few days before I know whether this gave me the information I was looking for :) civodul: roelj: maybe you can stress your program so it consumes memory more quickly roelj: civodul: Trying indeed. I do get a lot of ";;; (what! #)", and "anon #x17bc1a8" in the summary table.. civodul: hmm lloda: what would cause the Guile REPL do do filename completion instead of the normal command/identifier completion? mwette: lloda: Do you have an ~/.inputrc file? maybe a readline option lampilelo: TIL guile uses longjmp for non-local exits, so c++ destructors aren't being be called lloda: I don't mwette lloda: it's bizarre because it only happens from the embedded REPL, in plain Guile i get the normal completion lloda: i've wished before to have filename completion and now i have it when i don't want it :-( leoprikler: so, how did you end up getting filename completion? mwette: (ice-9 readline) does export make-completion-function. Is there something in ~/.guile ? wingo: lampilelo: yeah. i feel like we should document that better. wingo: i.e. for c++ embeddings, either don't have data with destructors on the stack if guile can throw, or otherwise you need a kind of DynamicWind<> template or so that will call the scm_dynwind functions to ensure the destructor runs dsmith-work: Monday Greetings, Guilers prussian_blue: oh what's this about destructors? I feel like I should investigate this .. leoprikler: That makes some kind of sense for unwind, but I feel like one would be hopelessly lost in the rewind case. leoprikler: IOW I feel as if scm_dynwind_unwind_handler (MyObj::~MyObj, myobj, 0); is the only meaningful interaction for C++ code, which could probably be abstracted into scm_dynwind_destructor(T obj); leoprikler: Well, T& obj actually lampilelo: wingo: i made a custom unwind handler that calls destructors on non-local exits and just install them like other handlers lampilelo: it* wingo: leoprikler: you can prohibit rewinds wingo: i think that's probably what you want to do wingo: rewinding through c++ is probably a bug farm. from guile's POV it doesn't matter of course, but from POV of what C++ programmers expect, it's... unexpected! lampilelo: when you call scm_dynwind_begin with 0 flag it should prohibit rewinds wingo: yep leoprikler: wingo: Reminds me of that one talk about exception handling with optionals. "You can't expect the unexpected." lloda: leoprikler: I don't know how it happened. I didn't do anything. I had to kill gnome for some reason and then it was like this :-( str1ngs: daviid: Hello. I mailed some patches to guix to upgrade the nomad stack, this includes g-golf. Pending review guix g-golf declaration will be at 0.1.0-839.ef83010 daviid: str1ngs: great, tx manumanumanu: ArneBab: regarding foof-loop: I am pushing something to a repo tonight. foof-loop is already plenty fast. What I have written is a very modified foof-loop with support for subloops, and with added restrictions that that adds. manumanumanu: I also removed the while and until clauses and added when and unless manumanumanu: and added break clauses. manumanumanu: The problems have been the following: accumulating clauses needed to be distinguished from regular for clauses to play well with subloops. That also means that regular for- and with-bindings are _not_ visible in the final expr. Since a loop with a subloop can exit in the outermost loop, the bindings in the innermost loops are not visible there. Thus, this is restricted for regular for clauses, but not manumanumanu: accumulating clauses. manumanumanu: Almost all of this in syntax-rules. ultra-oof. manumanumanu: ArneBab: I am currently thinking about one thing... Currently I want to distinguish between accumulating and driving clauses (loop ((:for driving-clause (in-list lst)) (:acc accumulating-clause (listing (+ 1 driving-clause))) => accumulating-clause). Distinguishing them means I could add finalizers for for-clauses, but I am not sure I think it is a good idea. The only thing I see that could use in is a manumanumanu: potential (in-file ...), but I am not planning to implement any support for controlling non-local exits using dynamic-wind, so I am not sure I want to. manumanumanu: so there are two major regressions compared to foof-loops: only accumulators are visible in the final expressions, which in turn means: no way to finalize regular for-clauses. in-file is thus not possible. manumanumanu: ArneBab: https://git.sr.ht/~bjoli/goof-loop manumanumanu: Lots of bugs still. Maximum subloops depth is 2, and named update is buggy. Small changes. leoprikler: inb4 hoof-loop maketo: hello! I have been tinkering with scheme for a while now (as a hobby) - was wondering how people progress to a higher level. Book recommendations? Code to read? Thanks! maketo: (have worked through "the little schemer" and about to move on to "seasoned schemer") mwette: maketo: maybe look into macos, like Chap 3 & 8 of https://www.scheme.com/tspl4/; if that suits you check out .../share/guile/X.Y/system/base/pmatch.scm mwette: pmatch is somewhat similar to (ice-9 match), which is documented in the Guile Manual, but is simpler; it shows how to write CPS macros *: chrislck_ wonder what the name kanren stands for RhodiumToad: apparently japanese for "relation", "to be related to" RhodiumToad: https://en.wiktionary.org/wiki/%E9%96%A2%E9%80%A3#Japanese chrislck: Kanren code looks so foreign :( maketo: @mwette: thanks :) lampilelo: leoprikler: a dangling pointer to data pointed by the bytevector already bit me in the ass, i made a function and then proceeded to use it not as i intended, took me a day to do it, lol prussian_blue: evening folks prussian_blue: how do I take a c function and create a lambda from it, applying it's first argument? (i.e. such that it can be called from guile with zero arguments later on) seepel: prussian_blue: I think it depends on whether you want to do it from the c side, or the guile side. I think the relevant section of the manual is here: https://www.gnu.org/software/guile/manual/html_node/Foreign-Function-Interface.html prussian_blue: the full story is, I have a c program, I want to take user input and evaluate it as guile code prussian_blue: but, I want to catch exceptions that occur, so my main thread doesn't get aborted prussian_blue: in order to catch exceptions, I need a handler function prussian_blue: but I at least need a userdata pointer to make this practical, or something seepel: Hmmm, I've mostly only dabbled in the FFI, so others folks probably know more. Have you seen this section (https://www.gnu.org/software/guile/manual/html_node/Extending-Dia.html#Extending-Dia) about extending a c application with guile? It may be more applicable to your situation. prussian_blue: I have read that part of the manual (and indeed everywhere else) but it doesn't mention any error handling prussian_blue: there is a section on the old style of error handling in C mwette: lookup scm_catch prussian_blue: right, I've found scm_catch, but in order to write a reasonable handler, I need to be able to partially apply it before sending it to scm_eval prussian_blue: *scm_catch prussian_blue: the problem is that there seems to be nowhere to provide userdata or anything like that, in any of the guile api functions mwette: I'm guessing you will need to have inputs and output from scm_eval as globals and define your thunk and handler. prussian_blue: that's a little disappointing prussian_blue: needing to use globals, I mean. mwette: Yes. C function scope is limited. mwette: Just looked. Gcc does provide nested functions. prussian_blue: but I would have thought that guile would provide an API where some userdata can be associated with a function? seepel: I would think you could create a guile module that loads the user code, and call the module's exported functions from c providing the necessary data. It would also give you a convenient place to wrap everything using with-exception-handler. prussian_blue: hmm yeah prussian_blue: a shim module wouldn't be a bad idea prussian_blue: thanks folks, :D bedtime for me now seepel: good night, and good luck! matijja: Hello Guilers! matijja: Why is this not working as expected? http://paste.debian.net/hidden/08a39ef5/ leoprikler: matijja: Because this behaviour was changed between Guile 2.2 and 3.0. I believe the rationale was that changing this so that classes couldn't be overwritten willy-nilly allowed for some optimizations. leoprikler: See `info '(guile)Redefinable Classes'` johnjay: question. why doesn't gimp use guile instead of tinyscheme? johnjay: is there some incompatibility between the different scheme versions? leoprikler: Probably historical reasons. I don't know what would happen if you were to pitch Guile to them. matijja: leoprikler: Thanks. rekado: civodul: congratulations on releasing Skribilo 0.9.5! civodul: rekado: heh thanks :-) civodul: mostly a long-overdue update to Guile 3 civodul: but i must say also i envy Scribble! civodul: would be interesting to explore Guile Studio integration str1ngs: sneek later tell elliotpotts . Hello, you can also catch error/exceptions with C. see https://www.gnu.org/software/guile/manual/html_node/Exceptions-and-C.html sneek: Got it. lampilelo: Is there an easy way of interfacing a c array with guile code? I found you can cast the c pointer to scm pointer with scm_from_pointer() and then scm_pointer_to_bytevector(). Is this the preferred way? scm_from_pointer takes a finalizer as an argument so i guess it takes ownership of the data, is there a way that doesn't do that? mwette: lampilelo: why not (pointer->bytevector (make-pointer addr) size); also, check out https://github.com/TaylanUB/scheme-bytestructures/ lampilelo: the thing is i'm writing a wrapper for a c++ library so i'm not doing that from scheme mwette: lampilelo: I see, from C. leoprikler: lampilelo: it optionally takes ownership, but if you destroy the data from C you might have a dangling pointer from scheme, which would be bad mwette: Ah Maybe use guardians? Not sure that has a C interface. leoprikler: if you can ensure, that these scheme pointers will be invalidated in the destructor of your class, that should be fine lampilelo: leoprikler: that's not a problem, the pointer will live shorter than the data leoprikler: in that case just pass NULL as finalizer leoprikler: That should be a documented option lampilelo: yes, i found it after asking the question lampilelo: do you have any experiences with mixing guile and c++? will guile try to manage my c++ memory? leoprikler: Not exactly, but I did some Guile+Vala and it's very doable. Guile won't claim ownership until you instruct it to. lampilelo: hm, ok lampilelo: prepare for segfaults lampilelo: something's off, it's just working str1ngs: when you cringe but all the tests pass? lampilelo: when you write a lot of code and there are 0 problems with it lampilelo: when you finally run it, that is leoprikler: There are two stages of software development: leoprikler: 1. It doesn't work, and I don't know why. leoprikler: 2. It works and I don't know why. stis: Hi guilers! emys: hi, is it possible to somehow pass a specific environment to `macroexpand' ? I mean in common-lisp its an optional parameter, in guile there seems to be none.. emys: is the something like (with-module-as-current-module (macroexpand '(let ((x 1)) x)))? mwette: maybe look at compile. Maybe like this: https://paste.debian.net/1169392/ mwette: but replace (current-module) with your env emys: hmm, maybe its ok if I explain some more context. I am trying to compile s-expressions to tree-il for a language I am implementing. Since I read in the docs that the scheme->tree-il compilation is basically just macroexpansion, I wondered whether I could implement my compliation using macro definitions. But for that I would need some way to pass in a fairly clean environment I guess. Dunno if this is plausible actually for emys: a non-scheme language to use the macro system for this. leoprikler: If you already have s-expressions, wouldn't the natural thing be to perform some pattern matching on them, so that the result is Tree-IL? leoprikler: but regarding your question, you can (save-module-excursion (set-current-module my-module) ...) emys: leoprikler, yeah thats what I am doing right now, but I guess using syntax-case for hygienic transformations has some appeal leoprikler: oops, of course you'd need to wrap that in a lambda emys: I guess I'll figure that out, having the procedure names will help me tremendously leoprikler: Of course, you can just implement your own language as a set of syntax-cases on top of scheme, but that'd be a step higher on the compile tower if I'm not mistaken. mwette: did you look at language/scheme/compile-tree-il.scm ? It uses (set-current-module env) then calls macroexpand mwette: ^ under (save-module-excursion ....) rekado: emys: if your language can be transformed to s-expressions you can build a simple compiler extension like leoprikler mentioned. rekado: that’s what guile-xcb does, and how guile-aws compiles JSON to .go mwette: but guile's scheme->tree-il is just calling macroexpand, so maybe emys has something there mwette: Also, (ice-9 match) may be useful. emys: ice-9 match is what I currently use in the procedural transformations that I do mwette: I have done several lang's in Guile and use: lang --[parser]--> sxml --[(sxml fold)+(sxml match)]--> tree-il emys: I guess looking at constructors like (let names gensyms vals exp) I do wonder how scheme implementation is capable of transforming into an expression that makes use of the original name of a symbol and the gensyms, a bit hard to tell when looking at psyntax.scm emys: mwette, that sounds like an interesting transformation path. mwette: https://git.savannah.nongnu.org/cgit/nyacc.git/tree/examples/nyacc/lang/javascript rekado: emys: here’s how guile-aws does it: https://git.elephly.net/?p=software/guile-aws.git;a=blob;f=language/aws/spec.scm;hb=HEAD rekado: during compilation of a JSON file it converts the JSON to Scheme modules. emys: thanks for these examples! *: civodul recommends the latest Foss & Crafts episode: https://fossandcrafts.org/episodes/14-digital-humanities-workshops.html civodul: rekado: ↑ emys: rekado, I think your guile-aws code is fairly similar to the structure I have now. mwette: civodul: thanks for that link emys: I guess I found out how guile uses syntax transformations for let/letrec in the transformation to tree-il, its in psyntax-pp and to me it seems like the syntax transformations are hardcoded directly by providing a lambda function instead of using the syntax-case DSL daviid: str1ngs: I pushed everything to master, maybe a good time to update the g-golf guix package, when you have some time to do so of course ... tx! wingo: o/ str1ngs: daviid: I'm almost ready to update emacsy and nomad will submit a patch for g-golf at the same time. should be very soon. one quality of life thing. if you can add a tag to master. something like 0.1.0-alpha that would make updating g-golf easier, using git describe. refcfar: I can't find any module reflection procedure to get a list of all symbols in a module's interface. Is there one such hidden somewhere? refcfar: Basically something like the REPL's `,binding` but in the context of a given module leoprikler: yes, there is str1ngs: refcfar: think you want 'resolve-interface and also there is 'module-uses refcfar: `resolve-interface` gives me a module object but I don't know how to extract bound symbols from it leoprikler: module-for-each str1ngs: (module-for-each (lambda (sym var) (list sym var) (resolve-interface module)) str1ngs: pseudo code str1ngs: I broke some parenthesis pasting to :( refcfar: Thank you both 🙂 I get a nice list with `(module-for-each (lambda (sym var) (display sym)) (resolve-interface '(the-module)))` leoprikler: yep refcfar: err, `(module-for-each (lambda (sym var) (begin (display sym) (newline)))ace '(other-module)))` refcfar: err, you get the idea leoprikler: newlines are cosmetic ;) refcfar: butchered it leoprikler: indeed, now you just need to know, what you want to do to those variables refcfar: Yeah, I could do something like `(map (lambda (sym) (help sym)) the-symbols)` leoprikler: What exactly is your use case here? Yet another doc-snarf for libraries? leoprikler: or quick introspection in the repl? refcfar: It's just for debugging. I'm trying to learn about creating readers, so I'm following the documentation of `guile-reader` which mentions a bunch of token readers supposedly available in `(system reader library)` but apparently do not. First step I figured is to see all of them in there so I know whether it's an API change or if the module is entirely wrong and has none of them. refcfar: Specifically the token readers listed here: https://www.nongnu.org/guile-reader/doc/guile-reader.html#Token-Reader-Library refcfar: So I have the package available and the module loaded. I run `(define sys-read-lib-syms (module-for-each (lambda (sym var) (begin (display sym) (newline))) (resolve-interface '(system reader library))))` and there are no tokens at all in there. So now I know I'm looking at the wrong module :) *: refcfar sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/PmpLlilayrUuXQLciVLGQtcy/message.txt > leoprikler: According to the docs, those should be defined in (system reader), no? refcfar: * So I have the package available and the module loaded. I run `(module-for-each (lambda (sym var) (begin (display sym) (newline))) (resolve-interface '(system reader library)))` and there are no tokens at all in there. So now I know I'm looking at the wrong module :) refcfar: (fixed the pasted code - copied the wrong thing) refcfar: All that's in there is: refcfar: Of course I don't think I'm taking into account the re-exports? leoprikler: ah, no make-alternate-guile-reader is indeed exported from library only leoprikler: could it be that they flubbed their re-exports? refcfar: Is there a way to get a list of all available modules available to import? refcfar: (I know I can go scour through the package source for all its modules, I just like an easy, clean and reusable procedure to do these things for me) leoprikler: not really, but you might get close to it refcfar: It would also be useful in general to get an overview of what you've got available lloda: iiuc that would require trawling through the load-path and if the modules are deep inside you need to search the whole tree lloda: so i don't think it's feasible really, unless i understand you wrong refcfar: Yeah I was just thinking refcfar: Is there a "list files in directory" procedure? refcfar: like `ls` lloda: yeah lloda: https://www.gnu.org/software/guile/manual/html_node/File-Tree-Walk.html refcfar: then I could `(map ls %load-path)` and go from there lloda: scandir leoprikler: ((@ (ice-9 pretty-print) pretty-print) (append-map (compose (lambda (x) (if x (remove-stat x) '())) file-system-tree) %load-path)) leoprikler: for remove-stat see `info "(guile)File Tree Walk"` leoprikler: alternatively, you can use guix' (find-files d ".*\\.(scm|sls)") chrislck: Friday greetings, guilers! *: janneke writes SIGINT handler for mingw that "somewhat works" wine janneke: *in wine dsmith-work: Happy Friday, Guilers!! emys: hey, I am trying to compile guile from git (on debian testing) and I get weird gc header issue. https://pastebin.com/73p7E6iP emys: I kind of feel like I have the wrong garbage collector installed emys: hmm, was able to set a build environment with guix civodul: emys: "guix environment guile" should give you a valid environment, with the right version of libgc civodul: but here the conflicting header is in /usr/include, so not Guix emys: the pastebin was from completely without guix emys: civodul, thats sth I still don't quite understand because the environment I get from `guix environment guile` doesn't let me build guile, next time I make notes what was missing. I think I did `guix environment guix` `guix engironment guile` and then it worked. emys: (maybe flex was missing, don't recall) civodul: emys: ah true, that's because to build Guile from a checkout, you need more stuff than when you build it from tarball civodul: including flex, texinfo, etc. civodul: you can add those with: guix environment guile --ad-hoc flex texinfo ... emys: I think it might be worth adding that to the guile manual emys: question: when I submit a patch to guile, would that need signed paperwork? daviid: emys: fwiw, you don't need guix to buld guile on debian :), and guile-3.0 is in testing already, but if/when you want build from the source, what you can do is running 'apt-get build-dep guile-3.0' - this should install everything you need to build the upstream guile-3.0 from the tarball or a git clone emys: daviid, cool, didnt know about `apt-get build-dep' dsmith-work: Yep. build-dep dsmith-work: emys: The HACKING file does mention what is needed to build from a git checkout dsmith-work: emys: Looks like the README does also civodul: emys: yes, you'll need to assign copyright for "legally significant" contributions (~15 lines or mroe) civodul: *more elliotpotts: hi folks, I can't seem to find any documentation on how to handle errors occurring on the C api, e.g. how do I detect if `scm_from_locale_string` (etc. etc.) failed? If anybody could give me a link, that'd be grand sneek: Welcome back elliotpotts, you have 2 messages! sneek: elliotpotts, lloda says: check http://logs.guix.gnu.org/guile/2020-05-27.log sneek: elliotpotts, lloda says: easiest solution is to compile your code with -DSCM_DEBUG_TYPING_STRICTNESS 2 tohoyn: sneek, botsnack sneek: :) tohoyn: daviid, str1ngs: anything new with g-golf? mwette: . daviid: tohoyn: see http://logs.guix.gnu.org/guile/2020-10-27.log dsmith-work: {appropriate time} Greetings, Guilers seepel: Hello guile, I've been hacking on the ecmascript implementation a bit and I'm wondering if I should try to merge my changes upstream. If so, is there somewhere I should look for instructions on how to do so? I read the section on the home page about contributing a bug fix, but I haven't contributed before and still have some doubts about how exactly I would go about it. rlb: seepel: I'm not positive, but I think maybe you can post the patches to guile-devel@gnu.org for review if they're not giant (and maybe even if they are?). That said, if you want to check back here when civodul is handy (generally earlier), he should be more qualified to answer. seepel: rlb: Thanks, I was wondering if guile-devel might be the place but wasn't sure. When you say earlier, do you have a suggestion how much earlier? Like which timezone? I guess the other question I have is if multiple commits is better or one big commit. And if the git-send-email defaults are good. I have things broken up into four commits, probably a few hundred changed lines total. rlb: I think generally European-ish, maybe? rlb: And, I'd assume git-send-email is fine. rlb: You can also ask sneek to ask :) rlb: i.e. /msg sneek help, and I think the command may be "later tell civodul ..." or something. *: rlb thanks dsmith leoprikler: yep, later tell/ask civodul leoprikler: As far as commits goes, it should be fine if each commit makes a logical change, e.g. changing one function, adding one function, etc. leoprikler: While it is possible to split things up too far, I don't think that's what you've meant when you ask the question. rlb: seepel: and for the final version, I think the convention will probably include the changelog style entries you can see in the git history (in the commit meesages). I think there may have been some contemplation of eventually automating that, but not sure. rlb: But perhaps get the code itself settled first? :) leoprikler: Either way, the worst that can happen is someone pointing out your guideline violation (*gasp*), perhaps even fixing the issue for you if it's something minor. seepel: No, I think each commit is pretty logical, one fixes function prototypes, one adds try/catch, etc. When I sent myself the changes it sent them each as a separate email, so I wasn't so sure. Looking through the archive I didn't really see many examples of multiple commits. rlb: --annotate --cover-letter can be useful too (you may already know) rlb: If you want to add an overall summary, etc. seepel: I do not, I'm pretty new to git through email, but that is exactly what I'd like to do. rlb: So that will open EDITOR for each commit, and a "cover letter" mail, and it'll thread them all (email-wise). rlb: You can put your own comments (asides, whatever) in the section after the commit message and before the --. And of course edit the Subject: of the cover letter to be a suitable overview. rlb: Also, if you get cold-feet, you can just hit C-c in the terminal where you ran send-email to cancel the process. *: rlb recommends EDITOR=emacsclient for all that, and then it's "C-x #" to finish editing and go to the next mail. seepel: I'm the one crazy lisper that can't quit his vim habit... rlb: Heh - evil-mode, spacemacs (no experience) or...? *: rlb is a bad influence rlb: emacsclient and --daemon mode can definitely help with the startup time issue that some vi users (understandably) have. seepel: I keep trying, but it never seems to jive quite right. And that is saying something, because it is truly more painful to do this stuff in vim. rlb: Yeah, plenty of things in emacs I'd find it very hard to give up, but I can sympathize. And happy to help if I can, but also imagine I'm reasonably well off topic :) justin_smith: seepel: for vim, fugitive works quite well seepel: I've scratched the surface with fugitive, but haven't managed to really dig in quite yet. justin_smith: fwiw I used emacs for over a decade, and am quite happy with neovim today seepel: I still use vim mainly because I can ctrl-w directly out of a terminal, though neovim has a reasonable repl plugin that I miss. seepel: I was also wondering how the FSF copywrite assignment would go, I'm assuming I probably wrote just enough code that I'd need to do that. justin_smith: seepel: what they usually ask for is that you assign copyright to them https://www.gnu.org/licenses/why-assign.en.html seepel: I did see that, but wasn't sure about the process. In other words, what will I need to do in order to assign copyright? justin_smith: seepel: wow, looks like it uses actual physical paper forms https://www.gnu.org/prep/maintain/html_node/Copyright-Papers.html - I assume once per contributor per project justin_smith: aha, there's one form that assigns copyright for future work on the same project rlb: Generally, you just mail them your form, and then they'll have it on file, and "that's it". rlb: They might have other options, but regular post is what I've used. seepel: Ahh, yeah, this looks like what I was curious about. seepel: Thanks all! refcfar: In the Guile manual, in the section "Source Properties" it reads: refcfar: Shouldn't it then be possible to reconstruct the source expression? It doesn't have to be exactly as originally defined, but being able to read the definition would be useful regardless refcfar: Err, I mean it could then retrieve the source expression from said location refcfar: And even if not, can't an S-expression be constructed (decompiled) so as to give at least something even if not always very readable? leoprikler: There is at least a decompilation from Tree-IL. leoprikler: But there seems to be no decompiler from bytecode refcfar: Is there a quick and standard way to just use/import a file that isn't really a module? Something like `(use-file "./my-script.scm")`? refcfar: Ah, found it refcfar: `(load-from-path "./my-script.scm")` leoprikler: load-from-path, but if you use "./some-path.scm" in a script, you might even want plain load instead leoprikler: alternatively, you can determine the path of the current script as (dirname (current-filename)) and then use (load (string-join %dir "/my-script.scm")) leoprikler: either way, you're throwing a compilation, that isn't auto out of the window, which might not be what you want for library use refcfar: What about simply parsing a file as syntax or quoted? refcfar: I realised that I'm not really looking to load but rather just read from it. I see that I can open a stream from input but there are a lot of extra steps just to parse it as a sequence of S-exprs mwette: refcfar: I have done that. I use a loop to read one sexp at a time. Check out Guile's 'read' procedure chrislck: Wednesday greetings! refcfar: chrislck: greetings! refcfar: mwette: I was thinking of wrapping the file contents in "(list " ")" or something and then I thought I had found a string->s-expr but now I appear to have lost track of it refcfar: (or "(begin " ")") mwette: You can also just (define form '()) and then load refcfar: Yeah the tricky part is converting the string to s-expr mwette: refcfar: (with-input-from-file filename (lambda () (let loop ((forms '()) (form (read))) (if (eof-object? form) (reverse forms) (loop (cons form forms) (read)))))) seepel: refcfar: You can use the read procedure to read an s-expression from a port (read (open-input-string "(foo bar baz)")) => (foo bar baz) mwette: ^ above will return a list of the forms in file with name filename seepel: Or what mwette said :) dsmith-work: Wednesday Greetings, Guilers refcfar: Huh.. I wouldn't have expected `read` to do.. whatever it is it's doing there refcfar: It's reading a single character at a time and somehow producing single-char s-exprs that, by `cons`ing into a list creates a complete s-expr? refcfar: Oh it's not single characters is it refcfar: Each `(read)` invocation takes a newline-terminated s-expr? refcfar: No, not newline, just a single s-expr refcfar: I did wonder when I tried using `read` and only got one expression rather than the entire content of the file but I didn't think you could read several times and get different results refcfar: Anyway, it all makes sense to me now refcfar: Using that expression you gave + `pretty-print` I have a basic auto-formatter. Heh. leoprikler: refcfar: `read` and other functions forward the position of the port they read, so at the next time they're invoked, that'll be different leoprikler: hence why looping `read` until you get # gets you all s-exprs in a file, string, you-name-it refcfar: Yeah I figured it out after thinking about it daviid: str1ngs: and other g-golf followers/users, I just pushed all (14) patches that I was working on - str1ngs, you'll have to checkout the files that were updated by the patches you mannually applied before to pull ... daviid: with those patches, g-golf fixes a few bugs and most importantly, now offers full support for GIInterfaces, as goops classes/instances that, for the former, are inherited when applicable, such as GtkBox and GtkOrientable - or not, like in/for the 'open signal (second argument) daviid: here is such a (minimal/useless) 'open signal example - https://paste.debian.net/1168790/ daviid: here is a 'hello-world' example that shows an inherited GIInterface use, the 'orientation slot (note that the orientation may also be dynamically changed, calling set-orientation ... - https://paste.debian.net/1168793/ leoprikler: Isn't GtkBox a normal class tho? leoprikler: Ahh, this is about GtkOrientable, right? wingo: o/ str1ngs: daviid: great thanks. I'll test with nomad now see how things go. str1ngs: daviid: looks good so far 👍, only thing I had to change was add 'query %gi-method-short-names-skip. I'll know more once I port my to . dsmith-work: UGT Greetings, Guilers mwette: howdy Labu: Hi mwette mwette: Hi Labu refcfar: Is there a way to search for a particular function from external libraries a'la Haskell's hoogle? refcfar: I see for example `substitute*` being used in some module (or online example) and I want to know where that comes from str1ngs: refcfar: for external modules that are not currently being used that is very hard to do. in the context of substitute* you could use git grep "(define-syntax sub". I used emacs with helm-git-grep since it handles fuzzy greps. for modules that are loaded though you can use 'help from a REPL and also apropos is helpful. refcfar: I'll try `git grep`. A searchable online library documentation database would be nice though str1ngs: refcfar: it sounds useful. but in practice I'm not sure it's required. try this for examples . guix repl. then (use-modules (ice-9 session)) and (help substitute*) here you can see it's found in (guix build utils) refcfar: Well that was useful! refcfar: So, newbie question: what exactly is ice-9? A base library shipped by default with guile? How can I discover the available submodules? str1ngs: refcfar: also if you use Emacs and geiser and geiser is setup properly. geiser will contextually show where a definition is found if geiser-autodoc-mode is enabled. I think it is enabled by default. refcfar: I'm a kakoune convert I'm afraid. Hard to go back. str1ngs: refcfar: ice-9 is a fictional state of water. but really it really it just indicates a guile internal functionality. thing of it as a standard lib names spacing for gulie. str1ngs: err guile* dsmith-work: sneek, where are you? refcfar: I hadn't heard of ice IX. Wikipedia makes no mention of it being fictional though https://en.wikipedia.org/wiki/Ice_IX refcfar: Ohh, I should have read the top part about there being a novel refcfar: Hmm, how do you use a module in an expression passed to `guile -c`? `use-modules` is apparently unbound str1ngs: refcfar: use-modules should be bound try for example guile -c "(use-modules (ice-9 session))" . refcfar: Woops. Silly mistake refcfar: I wrote `use-submodules` for some reason lloda: i use import :p dsmith-work: sneek: ice-9? sneek: Someone once said ice-9 is "a nod to the fictional substance in Kurt Vonnegut's novel, Cat's Cradle, capable of acting as a seed crystal to crystallize the mass of software" refcfar: I'm confused about `source-properties`. Isn't it supposed to return useful data about the expression? No matter what identifier or expression I give it I always get `()` returned refcfar: `(source-properties identity)` => `()` refcfar: `(supports-source-properties? identity)` => `#t` refcfar: I seem to remember a really cool thing in Clojure where you could run `source` on any expression and it would return the actual source definition justin_smith: refcfar: it's very hacky but it exists - it uses metadata on the variable to store the file / line justin_smith: err, the metadata store it, the source macro uses that metadata (usually there for debugging / error messages) to read and print it justin_smith: so it doesn't work for values input in the repl (you can't go back and read that document again) dsmith-work: I think old interpreted guile used to be able to regen/recover the Scheme source of a procedure. refcfar: How is it used? `(pretty-print (source identity))` (in a source file) returns `#f` dsmith-work: But not anymore. dsmith-work: The source properties are used in error messages. dsmith-work: https://www.gnu.org/software/guile/manual/html_node/Source-Properties.html dsmith-work: The example with (xxx) and xxx is not up to 3.x guile though dsmith-work: scheme@(guile-user)> (xxx) dsmith-work: ;;; :1:0: warning: possibly unbound variable `xxx' dsmith-work: ice-9/boot-9.scm:1669:16: In procedure raise-exception: dsmith-work: Unbound variable: xxx refcfar: But so how do I get it to return something useful? dsmith-work: {appropriate time} Greetings, Guilers cbaines: divoplade, o/ divoplade: Hello! divoplade: Ha! divoplade: It works! divoplade: sneek, botsnack sneek: :) divoplade: So, I was trying to write a patch to provide a recursive mkdir function, but I have open questions divoplade: Like: where should I write it? Where should I document it? How do I test it? leoprikler: For the record, have you tried https://gitlab.com/leoprikler/guile-filesystem yet? ;) divoplade: I'm only interested in the recursive mkdir function divoplade: As far as I can see, this is the same function as mkdir-p from guix, right? divoplade: Not really, in fact leoprikler: Not quite, but it should be have similar to it. leoprikler: s/be have/behave/ leoprikler: It also differs from your recursive mkdir in that it doesn't create (getcwd) divoplade: I've updated this divoplade: In fact, if the current working directory does not exist, (getcwd) throws divoplade: So it's not possible to fix leoprikler: Interesting. divoplade: And as suggested, I wrote it as scheme leoprikler: Okay, as a bit of bikeshedding I really don't think you need to modify all procedures, that might open an output file to have an mkdir parameter leoprikler: Most programs ensure that those directories exist once at the start of execution. divoplade: I've re-written the mkdir to be closer to yours divoplade: For the mkdir parameter in output files, that's what emacs org-mode uses divoplade: When tangling, you can pass :mkdirp t, so that org-mode will create the directory if it does not exist before tangling leoprikler: Okay, but that's a specific use-case of emacs org-mode. leoprikler: There is a large class of programs, that do not need to call mkdir-p on demand. divoplade: For a more general view, I think it is more consistent with the behavior of these functions to create the file if it does not exist leoprikler: Hence why you see this function in org-mode and not the emacs core. leoprikler: "Create the file" != "Create the entire directory structure" divoplade: I have a hard time thiking of a case where you would want to create the file if it does not exist, but fail if the directory does not exist leoprikler: Okay, assume the following: leoprikler: You begin extracting some files from an archive, and that takes a long time. leoprikler: While you are doing so, someone recursively deletes the directory you're working in. leoprikler: I think it is perfectly acceptable to error hard in such a scenario. divoplade: And what if someone deletes just a file? divoplade: Or overwrite it z0d: you cannot defend against all errors z0d: what if someone kills your extracting process? leoprikler: Then they're free to do whatever. z0d: yeah leoprikler: Still I'd reason that the person who just deleted your extraction directory does not want you to recreate it on the next file. divoplade: Now consider this. You want to create a server, but you let the caller tell you where to write the log file. So for instance, it's /var/log/fancy/directory/structure/file.log. You want to call open-output-file, but create the directory recursively. leoprikler: divoplade: Calling (mkdir-p (dirname logfile)) is not a huge code overhead for the server. divoplade: That's right, so it's not too heavy to put in guile! divoplade: Also, if you look at open-output-file, you will see that it's just a wrapper for open-file divoplade: So I'd reason that open-output-file should not be included in guile! divoplade: (well, I would not say that of course) leoprikler: I think you're strawmanning here. divoplade: The situation is quite similar divoplade: There are a few case where you want open-output-file, and a few cases where you want another open-file than open-output-file leoprikler: "quite similar" is a matter of interpretation. leoprikler: You actually rarely want to interact with either of them. leoprikler: Instead, you'd like to have clean functions like call-with-output-file that set up the file descriptor etc. and close it when no longer needed. leoprikler: open-output-file and open-file exist for those cases where you need to do something very different. divoplade: That's just moving the discussion, as I propose to add the mkdir argument to call-with-output-file too. divoplade: For log files, it's even the with-output-to-file level that's relevant. divoplade: (and with-error-to-file) leoprikler: Perhaps, but do you not realize how it makes your patch needlessly larger? divoplade: It's not needless divoplade: I've been annoyed by a lot of errors of "cannot create file" when I wanted to create a file, because the parent directory in fact did not exist divoplade: That's very puzzling for newcomers libfud: is that a bad thing? libfud: not the puzzling part divoplade: I think so. libfud: sure, a more descriptive error would be good libfud: but creating a file is different from making a directory divoplade: "a more descriptive error would be good": no, because this error would need to be handled by the programmer, not the user libfud: mkdir will make a directory if the parent directories preceding it exist, but requires the -p flag to create those parents when they don't exist libfud: sorry libfud: I just barged into a conversation without reading much of the preceding context libfud: it's been a long few weeks for me leoprikler: https://paste.gnome.org/pgew7gmis leoprikler: Not exactly the same behaviour due to the slightly better error as libfud suggest, but still divoplade: leoprikler, precisely. Now imagine that it happens because the user wanted to save some data to a file in a hierarchy that did not exist yet. leoprikler: "Oh no, we need to change the Python standard library, because I'm too lazy to call mkdir(parents=True) divoplade: My point is, you want to call that mkdir function every time you open a file for output. divoplade: Why not make it easier? leoprikler: In most contexts, the user will ensure that this hierarchy exists as they select the save file (GUI applications) or the software can call (mkdir-p (dirname f)) before saving. divoplade: (or nearly every time, agreed) leoprikler: It does not make things easier. libfud: you can add your own abstraction libfud: we are talking about calling a function in a programming language right? libfud: why not make your own function to handle non-existent directories and put it in your own library leoprikler: Because that single-function library won't be included in Guix. libfud: oh, that's what this is about libfud: I need to go to bed leoprikler: divoplade: Anyway, changing all open-file wrappers to add mkdir-p to them makes the functions (and your patch) needlessly larger for little (if any) benefit. divoplade: So the user does not need to care if the file does not exist, but it will need to jump through hoops of mkdirs (and, as I know users, "sudo mkdir") if there is a backtrace. leoprikler: why should anyone want to invoke "sudo mkdir" on a backtrace? leoprikler: wtf are you on? divoplade: What does that mean? leoprikler: What I am saying is that adding mkdir-p and *just* mkdir-p already covers all the cases in which a library might want to first ensure that a directory exists before calling (open-file) or any of its variants. leoprikler: As such it is not needed to directly modify open-file etc. leoprikler: It then follows, that mkdir-p as a variant of mkdir can be put closely to where that is defined, i.e. in posix.scm and documented along with mkdir under POSIX > File System leoprikler: Alternatively, were you to add a large number of non-standard filesystem extensions, you could write that as (ice-9 filesystem), like I am currently doing. refcfar: How do you document code? I've tried websearch but come up with nothing *: refcfar sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/japIgkUJIGomeyrlvXOJicwV/message.txt > leoprikler: refcfar: There seem to be multiple solutions. leoprikler: One is to just put plain "docstrings" as the first expression of a function. leoprikler: Another is to do the same, but with Texinfo markup. You can use (texinfo reflection) to access that. leoprikler: A third is to use comments with texinfo markup. This one can then be processed by `guild doc-snarf'. leoprikler: Hope that helps you out. refcfar: I see, thank you! civodul: hey! civodul: i'm looking at read-bytes in (ice-9 suspendable-ports) civodul: it seems to me that this always blocks civodul: there's an "else" case that would wait for data to be available, but i don't see how it can be reached civodul: or is it reached if the fd is non-blocking and we get EAGAIN? civodul: ah yes, that's it civodul: talking helps understand things better civodul: thanks for listening :-) weinholt: glad to help! *: chrislck too civodul: heheh mwette: howdy all! civodul: o/ chrislck: {friday dance} dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work! happy Friday! :-) dsmith-work: it's a stunningly beautiful day here. I should be home instead! ArneBab: leoprikler: I wanted to say „sure, just use r7rs symbols!“ but I think I just found a bug: ArneBab: (print-enable 'r7rs-symbols)(write #{1 2 3}#) → Unbound variable: |1 2 3| wingo: i think you need to write '#{1 2 3} wingo: i.e. quoted ArneBab: ok ArneBab: that isn’t clear to me on API Reference > Data Types > Symbols > Symbol Read Syntax ArneBab: but it works, yes ArneBab: So using symbols as immutable strings basically means '|what I wanted to write' here| ArneBab: (print-enable 'r7rs-symbols)(read-enable 'r7rs-symbols)(write '|what I wanted to write' here|) leoprikler: I do still want to have all the string functions available, at least the read functions. leoprikler: Therefore I'll be using read-only substrings of copies. leoprikler: the copy guarantees, that the string that is passed won't be manipulated and the /read-only guarantees, that the result is not modified. leoprikler: hmm leoprikler: it appears that substring/read-only already takes care of that matijja: Hello Guilers! matijja: Why (nftw "/" (lambda* (file #:rest args) (format #t "~A~%" file) #t)) don't do it's job? matijja: But, "//" or "/../" do... RhodiumToad: bug in nftw, or more precisely in one of the functions it calls RhodiumToad: (lambda () (go (clean filename) 0 0)) ;; but (clean "/") returns "", which is clearly wrong RhodiumToad: (clean) is removing any excess trailing /, but it doesn't have the required special case for filenames that are just "/" and nothing else matijja: Thanks for explanation. RhodiumToad: bug still exists in 3.0.4, so you might want to report it matijja: ok RhodiumToad: btw, (nftw "/" (lambda* args (apply pk args) #t)) shows better what happens RhodiumToad: or (nftw "/" (lambda args (apply pk args) #t)) RhodiumToad: it shows that the lambda was called with ("" #f invalid-stat 0 0) RhodiumToad: (pk) is a handy diagnostic function that prints all its args and returns the last one matijja: I have searching for something like that. Thanks. leoprikler: how is (lambda args (apply pk args)) better than (nftw "/" pk #t) tho? ;) RhodiumToad: return value is wrong in your version RhodiumToad: or at least not predictably correct RhodiumToad: pk returns the last arg, but we want a function that always returns #t leoprikler: ahh, messed up the brackets RhodiumToad: (nftw "/" (compose (const #t) pk)) RhodiumToad: if you want to get all functional about it leoprikler: now that I like *: dsmith-work shakes fist angrily at python *: ft helps *: libfud summons Apollo wingo: o/ wingo: just popping in to say that i find the guix discussion of #t/#true extraordinarily amusing civodul: hey wingo! civodul: isn't it? :-) wingo: looking forward to the syntax-of-comments phase :) https://wiki.haskell.org/Wadler%27s_Law civodul: heheh we're really talking about the color of the bikeshed civodul: but the color is the first thing passersby see wingo: yeah to me it's a fine change, either way, i am just amused there is opposition to it civodul: yeah wingo: and that the argument is essentially about confusion, which i find weird wingo: or about what guile does, and that's precisely the reverse of how it should go: guile can change civodul: right wingo: anyway :) civodul: thanks for sharing your thoughts! wingo: haha it nerdsniped me :) *: wingo has not had any guile time recently :P civodul: heh wingo: how is guix going these days? seems pretty good but hard to tell civodul: working on the next release! civodul: it's been a long time coming civodul: and now there are so many big changes compared to the previous one civodul: i think it's doing well civodul: people have been preparing the on-line Guix Days too, that's great wingo: yeah that looks pretty cool :) civodul: i think we're at the stage where we're starting to reach out to people who are much less on the "geek" side of things, so to speak civodul: and i can feel that things we never bothered properly documenting before now need to be documented, for instance civodul: for packaging in particular civodul: BTW, we'll have to do Guile 3.0.5 someday to enjoy the new case dispatch! brendyyn: civodul: i was thinking for such code style changes, are there any code refactoring tools for scheme/guile or would you just find a way with emacs? civodul: Emacs or even sed should be good enough for that task :-) ArneBab: wingo: short experience about Guile I had the past weeks: I’ve written a quick static site generator for a family member, and due to some design choices (ordered permutations of keywords in URL) it had grown somewhat slow. Since switching to Guile 3, it is easily fast enough again. You made a real impact here. wingo: i am a dinosaur and i still do perl -ipe 's/foo/bar/' $file wingo: ArneBab: thanks!! wingo: glad things are going well :) i like it when compiler improvements can paper over algorithmic problems wingo: like "i know i'm doing this wrong but i am happy it works" ;) ArneBab: Same for me :-) — though I’m not actually doing it wrong. The decision „we want gallery pages for all ordered permutations of these keywords“ enforces an expensive algorithm (to the best of my current knowledge). This was no problem while the content conformed to the original decision (5 keywords). Then new keywords happened … and luckily the improved compiler was ready to compensate ;-) ArneBab: I said „yes, we can make that, up to X keywords, and yes, this will be clean“ ArneBab: lay-people just cannot judge how the cost changes if you add a single element to a permutation. I’s just one keyword, right? ;-D ArneBab: maybe I should add a check that errors out at >8 keywords :-) — but still: that we could go up to 8 is great! ArneBab: Thank you for that! ArneBab: (if we go higher, the filesystem will become a limiting factor for page access) ArneBab: ⇒ with the improvements in Guile 3, it provides sufficient performance that the filesystem will be a bottleneck before Guile. And that’s awesome! *: ArneBab is aware that filesystem layout optimizations can fix the filesystem bottleneck, but then the site will require a migration path, and this still is a side-project for family :-) lloda: i do ctrl-r on the guile prompt and instead of the regular readline reverse search i get a bizarre bck? prompt. Anyone seen this? leoprikler: btw. does guile have immutable strings yet? leoprikler: Probably (substring/read-only (string-copy s) 0) is what I want mwette: lloda: did you (activate-readline) ? lloda: mwette: yeah, it's in my .guile lloda: even after doing it manually on the repl i still get the bck? prompt :-\ lloda: anyway without readline i wouldn't get a bck? prompt, i'd just get ^R (i think?) mwette: hmm there is a c function rl_get_keymap_by_name lloda: think i switched modes inadvertently mwette: ah lloda: don't know how to switch back tho. I'm used to having to ctrl-e now and then, but that doesn't work for this lloda: i've also lost tab completion... lloda: actually i get tab completion for directory files in cwd even in the guile repl lloda: ?!? dsmith-work: {appropriate time} Greetings, Guilers str1ngs: lloda: do you have an ~/.inputrc ? lloda: i do str1ngs lloda: i don't remember writing it myself, but maybe i did (?) lloda: it's empty tho lloda: both lines commented str1ngs: lloda: okay that should not effect anything then. And you are using guile from command line and not say geiser? lloda: command line yes str1ngs: lloda: does M-r work instead of C-r? str1ngs: also which terminal do you use? lloda: gnome-terminal, M-r doesn't work lloda: guile works fine by itself, it's my embedding of it that has the problem lloda: didn't ever happen before today tho lloda: think i'll just reboot everything :D str1ngs: strange, C-r should show (reverse-i-search)`': then. the only time I've seen a back prompt is when using geiser. in which case you need to use M-r str1ngs: can you past the actual prompt you get with C-r? str1ngs: paste* lloda: Enter `,help' for help. lloda: scheme@(guile-user)> lloda: bck: lloda: that's it lloda: bck: appears when i press C-r str1ngs: lloda: does bind -P | grep history-search-backward output anything? lloda: nope str1ngs: lloda: see if bind -P show that C-r is bound. lloda: re-read-init-file can be found on "\C-x\C-r". lloda: reverse-search-history can be found on "\C-r". lloda: revert-line can be found on "\e\C-r", "\er". lloda: ^ that's what i get from bind -P | grep C-r str1ngs: lloda: looks right to me. str1ngs: I've never seen bck: that's just really odd. are any of the vi bindings bound when you list them with bind -P lloda ? lloda: bind -P | grep vi | grep -v 'not bound' lloda: previous-history can be found on "\C-p", "\eOA", "\e[A". lloda: ^ lloda: that's all i get str1ngs: reverse-search-history is not actually bound for me. though yours is bound to C-r which is correct anyways. str1ngs: you can try reloading .inputrc see if it helps with C-x C-r str1ngs: but I suspect it's not an issue with your ~/.inputrc str1ngs: anything in ~/.guile that changes readline behavior at all? lloda: i have (import (ice-9 readline)) (readline-set! history-length 50000) (activate-readline) that's all lloda: C-x C-r didn't do anything btw str1ngs: C-x C-r is silent so maybe start a new terminal just encase lloda: new terminal is the same. lloda: gtg, thanks for the help str1ngs str1ngs: lloda: ahhh this only happens when you embed. need to think more on this dsmith-work: UGT Greetings, Guilers roelj: Hi dsmith-work! civodul: hi there! emys: Hey, I submitted a bug report against Ubuntu 18.04 for their guile 3 build. https://bugs.launchpad.net/ubuntu/+source/guile-3.0/+bug/1900708 emys: seems like its not a bug in the upstream codebase but their build process, just thought you might be interested roptat: I'm trying to make some changes to a guile module (in guile's git checkout), what would be the best way to test it? leoprikler: I'm not sure if it's the "best" way, but you can actually run the guile you've built. leoprikler: there's also "check-guile" in the top directory assuming your functionality has a test case terpri: "Every test suite failure should be a complete, mysterious surprise, never a possibility you were prepared for. Any other attitude indicates that you're using the test suite as a crutch, which you need only because your understanding is weak." -- test-suite/README terpri: jim (blandy?) isn't/wasn't a TDD fan, apparently leoprikler: Well, I can see where they're coming from. leoprikler: If you do repeatedly break your own tests, chances are that the code is really brittle. leoprikler: ane: what kind of snarfing do you mean? it's actually a bit of an overloaded term leoprikler: there are various forms of doc snarfing, i.e. extracting docstrings from source code, but there is also "function snarfing", which generates C code to define scheme procedures from C functions ane: ah I mean the doc snarfing ane: not the magic snarfer for .x files ane: the doc snarfing that happens during building guile leoprikler: Yeah, that probably goes towards guile-procedures.txt leoprikler: And yes, if you read (ice-9 documentation), you can see that guile searches for such a file in various places and fetches procedure-documentation from there. apteryx: rekado: thanks ArneBab: manumanumanu: you’re working on making foof-loop cleaner and faster? jlicht: civodul: (very late) thanks for the pointer to the r5rs formal syntax page, it confirmed my suspicions :-) civodul: heh jlicht: the tldr of it is that guile-reader's read-hash-extend replacement does not work when using existing reader-macro characters for the reader macro. So for my use-case, using a different character should work just fine :D ArneBab: jlicht: you can extend via read-hash-extend. Then you get # literals liltechdude: hello, can I create static link executable from guile program, which can run on machine different from linux? liltechdude: game based on checkadee game engine in particular davexunit: liltechdude: not currently possible, I'm afraid. jlicht: ArneBab: using guile-reader's version of read-hash-extend (the one that only affects the current module using fluids?), that doesn't work for stuff that re-uses an existing character: See https://lists.nongnu.org/archive/html/guile-reader-devel/2020-09/msg00000.html for my specific snippet jlicht: using 'normal' read-hash-extend works, of course dsmith-work: Monday Greetings, Guilers dsmith-work: zzappie: Yey! wirehark (or at least tcpdump) is one of those invaluable tools. strace is another. ArneBab: jlicht: ah, I understand. Thank you! manumanumanu: I just got a prototype for my foof-loop derived looping system working (at least for the simple case where there are no subloops), but that should just be a long-and-tedious syntax-rules session away! emys: is there a way to expand an s-expr with a given set of macros? I.e. its not Scheme code, just s-expressions and I think macros might be an nice way how to transform them. mwette: emys: look at module (ice-9 match) -- it's covered in the manual as well: https://www.gnu.org/software/guile/manual/guile.html#sxml_002dmatch leoprikler: emys: use an otherwise empty environment (you can spawn that with null-environment), define your syntax and then call macroexpand ;) mwette: oops wrong one: https://www.gnu.org/software/guile/manual/guile.html#Pattern-Matching mwette: look at the procedure repl-expand in share/guile/3.0/system/repl/common.scm, which implements; then use your own env to pass to compile apteryx: is it a common convention to use ? at the end of the name of a boolean variable? I know that's true for predicate, but wasn't sure anymore about boolean vars. rekado: apteryx: that’s what I do. rekado: especially for procedure arguments libfud: it makes sense to me at least libfud: what is the convention for using *? emys: is there a way not to truncate stack-traces in guile? emys: like I get 619:8 5 (_ #(#(#(#(#(#(#(#(#(#) �) �) �) �) �) �) �) �)) and I wouldn't mind this to be a bit longer tbh civodul: emys: you can set the COLUMNS environment variable to something wider civodul: like COLUMNS=200 civodul: thought of the day: we should give the stexi modules some love so we can do away with "makeinfo --html" rekado: civodul: I had the same thought when I read the discussion about maybe using (X)HTML for Info in the future. civodul: that discussion is misguided IMO in addition to happening behind closed doors civodul: clearly Scribble is our horizon here, for Guile, Guix, etc. civodul: at least the rendering and tight integration it provides are enviable ane: what does the snarfing process do when building guile? is it extracting the docstrings for guile-procedures.txt? what is that file used for, is it for the (procedure-documentation) stuff? libfud: I asked this in #scheme as well but it's still relevant here libfud: are there any popular (within the scheme community) algebra libraries? libfud: it's one of those things that I percieve as the simple rules as being trivial to implement in any LISP but a "whole package" kind of thing as being a huge undertaking chrislck: libfud: r5rs leoprikler: That really depends on what you mean by "algebra". leoprikler: For basic maths RnRS should have you covered, for vector/matrices or symbolic maths, ehh... libfud: algebra like sympy or wolfram alpha, symbolic manipulation rekado: scmutils exists, but it’s tied to MIT Scheme and the latest version doesn’t build. rekado: see http://groups.csail.mit.edu/mac/users/gjs/6946/refman.txt wleslie: probably someone has ported axiom or fricas, but I can't recall one zzappie: dsmith-work: hey! thanks for wireshark tip :) I found out what was ther root of the problem. I was adding Content-Length header manually and I ended up in duplicating headers, but also I forgot to truncate input from terminal (access token header) and thats why "\r\n" was shifting the body by two bytes mwette: symbolic : http://people.csail.mit.edu/jaffer/JACAL.html hackyhacker: Hello has anyone used the guile-sdl2 bindings before? hackyhacker: I'm trying to render some text in a rectangle but I can't get the render-copy function working jlicht: is there a list of all {existing,reserved} reader macro's in guile? E.g. `#b101011', `#e20'? civodul: jlicht: those are part of R5RS (i think?), and there are also a few additional ones in R6 civodul: you can see them in r5rs.info civodul: info "(r5rs) Formal syntax" civodul: there's also things like bitvectors which are Guile-specific leoprikler: hackyhacker: Hi, I'm using guile-sdl2 in Tsukundere (a visual novel engine I'm developing). AMA leoprikler: Seems like I missed them. leoprikler: sneek, later tell hackyhacker I'm using guile-sdl2, AMA sneek: Will do. apteryx: wingo: it's not news anymore, but just wanted to say that the baseline compiler helps a ton in keeping the Guix sources workable; thank you! spk121: hello guile civodul: Hello Guilers! civodul: wingo: interesting review of the "binary security" paper! wleslie: ooh, a new wingolog.org post, about object capabilities in wasm wleslie: oh right, I think I dismantled this paper somewhere too wleslie: I boiled it down to "I can also express this vector using javascript modules" lloda: what causes guile to build with UNKNOWN version :-/ lloda: what's the fix for this to work on guile-3 lloda: https://github.com/davexunit/guile-zlib/blob/master/Makefile.am lloda: not that it doesn't work, but it installs in the wrong place lloda: davexunit: oh lloda: i miss a call-with-input-bytevector :-/ RhodiumToad: then make one? lloda: indeed civodul: lloda: note that there's another guile-zlib, now used by Guix civodul: and the plan is to absorb davexunit's :-) davexunit: oh hi civodul: https://notabug.org/guile-zlib/guile-zlib davexunit: I wrote that one so long ago I forgot I even did it civodul: heheh davexunit: when I barely knew anything about guile lloda: thx both civodul: lloda: if you'd like to copy the bits from davexunit's guile-zlib to the other guile-zlib, that'd be welcome civodul: we were planning to do that davexunit: what bits? civodul: the low-level "compress" API civodul: the other guile-zlib only has the high-level gzip API davexunit: ah okay civodul: davexunit: i should say: WDYT? :-) davexunit: I haven't actually used this library in years, please take anything that's useful. civodul: heh awesome civodul: i was shamelessly planning to do just that :-) davexunit: I will update the github project description to point to the new lib davexunit: hey, it's free software civodul: yup lloda: civodul: your version has the stream functions so it's closer to what i wanted lloda: i'll see if i can send a patch later davexunit: I forgot why I ended up wrapping zlib... it was 8 years ago, though. civodul: we're a bunch of old-timers by now! dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work, happy Friday! dsmith-work: Yes! lloda: civodul: https://notabug.org/guile-zlib/guile-zlib/pulls/1/commits lloda: didn't merge so much as copy the relevant bits from davexunit's repo, since i'd would have had to delete almost everything. I hope it's ok lloda: i'd/i civodul: lloda: excellent, thanks! civodul: Mathieu or myself will take a look lloda: np thank you both civodul: and we can prolly add you and davexunit there davexunit: civodul: no need to add me at this time. thanks, though. davexunit: one bit of feedback for that test: I would avoid randomized data in a test suite. civodul: yeah, or print the seed lloda: fixed seed, yeah lloda: fair lloda: it's the same as for the other test tho davexunit: oh okay so there's precedent davexunit: fair enough civodul: oops :-) zzappie: Hello guile! zzappie: I'm having problems whith creating http-post request... No mater what I do I always get the 400 bad request error even though I cheched the http request whith nc and it seems fine. zzappie: Its application/json request and I've tried making requests to httpbin.org/post with same result. Don't even know what to do next. Has anyone encountered something like this? zzappie: I guess it probably has something to do with tls dsmith-work: zzappie: Wireshark it and see what looks funny. Compare with something else that works there. dsmith-work: zzappie: By "nc" did you just check connectivity? Or did you acntually make an http post? zzappie: dsmith-work: I ran 'nc -l -p 8080' and made request to localhost:8080 to see whether all headers and body of the request look fine dsmith-work: zzappie: Well, something is wrong somewhere. Do you have some other app or something that *does* work that you can compare with? dsmith-work: Like a working example in some other language? dsmith-work: zzappie: So your immediate goal is find out something more specific that "bad request"... zzappie: dsmith-work: curl :) dsmith-work: yes indeed libfud: reason #84023823452085 why managed languages are nicer: you don't get bizarre, inexplicable segfaults from destructors when your build scripts don't properly rebuild/relink a module's objects rekado: 84023823452085 looks like an overflowed number. That’s another reason why Guile is nicer ;) libfud: rekado: I'm not sure if it is libfud: maybe it's a bigint :) libfud: (< 84023823452085 (expt 2 63)) --> #t dsmith-work: scheme@(guile-user)> (number->string 84023823452085 16) dsmith-work: $1 = "4c6b522647b5" libfud: dsmith-work: now format that with uppercase letters with in 8 character segments with leading zeros libfud: working in C++ is such a PITA libfud: I can never figure out the signature for functions or closures as parameters so I always wind up doing template foo(Fn1 bar) izh_: how to use http-request to read body from a URL that redirects?, e.g. "https://qa.debian.org/cgi-bin/popcon-data?packages=bash" izh_: (http-request "https://qa.debian.org/cgi-bin/popcon-data?packages=bash") returns just empty #vu8() instead of expected json dsmith-work: scheme@(guile-user)> (format #f "~17,'0,'_,8:x" 84023823452085) dsmith-work: $14 = "00004c6b_522647b5" dsmith-work: dsmith-work: uppcase dsmith-work: scheme@(guile-user)> (format #f "~:@(~17,'0,'_,8:x~)" 84023823452085) dsmith-work: $15 = "00004C6B_522647B5" libfud: I was being flippant but that's actually pretty illustrative of formatting so thank you libfud: uppercase hex always looks a lot better to me libfud: why does the upcase version need a the ~ sigil after x? libfud: nvm libfud: dsmith-work: in my instance of guile (2.0.14... wait, why is it 2.0.14?) the second is still lowercase dsmith-work: The ~:@( ~) uppercases stuff in between. Wack. But probably from CL. libfud: which version of guile are you using? dsmith-work: 3.0.4 libfud: which distro are you using? dsmith-work: Debian Buster, but guile built from source tarball. libfud: yeah I don't see it in fedora libfud: when did 3.0 come out? dsmith-work: June 24, 2020 for 3.0.4 dsmith-work: https://lists.gnu.org/archive/html/guile-sources/2020-06/index.html dsmith-work: Jan 16 for 3.0.0 dsmith-work: Ya, I like 0xFF: small x, uppercase hex dsmith-work: I really like how Rust (and others) allow _ in numbers. dsmith-work: Like 0xFFF_FFFF libfud: yeah, that's something I wish more languages had dsmith-work: Kind of like commas dsmith-work: Make it *much* nicer to read large numbers.. libfud: your example works in 3.0.4 but not 2.0.14 or 2.2.whatever-it-is libfud: I didn't test prior versions of 3 but I'd hazard a guess that it wouldn't change the result dsmith-work: Hmm. Unfortunaely, it doesn't add separators in the padding: dsmith-work: scheme@(guile-user)> (format #f "~:@(~19,'0,'_,4:x~)" 84023823452085) dsmith-work: $18 = "000004C6B_5226_47B5" dsmith-work: Hah! CL does the same. (sbcl anyway) libfud: the last time I actually worked extensively with Hex as output (and inputs to some degree) was a MOS6502 emulator I made while trying to make a NES emulator libfud: grouping it is essential to reading it dsmith-work: Ahh. the 6502 dsmith-work: First thing I did on my C64 was make a disassembler. libfud: It was fun, I liked that I could understand everything it did (after learning about it's quirky behaviors that don't match the spec) stis: o/ dsmith-work: {appropriate time} Greetings, Guilers sp1ff: Hello Guilers, does anyone know of Guile bindings to libmagic (the core implementation of the `file' command)? emys: so, implementing a language on top of guile emys: I think I understand the basics of tree-il, parsing, etc. Can compile simple expressions to tree-il or scheme. emys: now I wonder how I can supply runtime functionality for use by some compiled code. emys: As far as I understand it, compile-tree-il is being served the expressions for compilation in the small batches that the reader reads emys: I'd like to 'import' at the beginning my runtime library with some procedures that I can refer to with `toplevel' in the tree-il I generate emys: ah, I think I should have read closer the docs for the scheme compiler because there stuff is explained mwette: emys: examples in https://savannah.nongnu.org/projects/nyacc examples/nyacc/lang/calc ; and also javascript, mlang, tcl mwette: emys: Once you have tree-il I believe you want to compile to a value (i.e., #:to 'value), IIRC. dsmith-work: Hey Hi Howdy, Guilers RhodiumToad: yo str1ngs: hello, I'm deriving some work form (ice-3 session) it's not an exact copy but I'd like to add guile's copyright just encase. can I just include portions of this file are copyright FSF to the top my header copyright? my code is GPL 3 str1ngs: ice-9* RhodiumToad: for a modified work, you're required to attach a notice saying you modified it (and when). you should preserve any existing assertion of copyright and add your own str1ngs: okay thanks RhodiumToad: but I'm just a random opinionated person who reads licenses, don't take this as official dsmith-work: sneek: seen civodul? sneek: I last saw civodul in #guix 6 minutes and 13 seconds ago, saying: zimoun`: i think tcc has a built-in linker, so i'm not sure it makes sense. civodul: hi! :-) matijja: Hello Guilers! matijja: Why Guile3 can'n display unicode characters? https://paste.debian.net/hidden/330d8332/ matijja: Maybe I shouldn't ignore the locale warning... matijja: Jup, `guix install glibc-locales` does the trick. dustyweb: o/ matijja: \o libfud: ‾\o/‾ numerobis: Hi everyone! Is it possible to write a guile extension in C++? The documentation documents how to do this in C, but is C++ supported too? brendyyn: numerobis: ive never done it but ive heard its possile, only that guile can conflict with c++ exceptions if you use them. lilypond is an example of a c++ program that uses guile numerobis: brendyyn: Thanks for your answer. My goal is not really to use guile in C++, but rather to create bindings in guile for a C++ library. More precisely, I was pondering the idea of creating qt-poppler bindings in guile. Do you think this would be possible? brendyyn: i remember asking a similar question and was pointed to guile-gi. as a possibility for creating qt stuff numerobis: brendyyn: Thanks for the pointer, this looks interesting! str1ngs: I have written some experimental QT bindings for GI and I use g-golf. the exposed interface is in C though internal it uses C++ str1ngs: but it's not exactly a guile extension though it does expose C functions as scheme procedures so the effect is the same. brendyyn: str1ngs: did you manage to build an example qt gui that opened? str1ngs: yes of course str1ngs: numerobis: if qt-poppler is a widget then it should work wit giqt. in theory str1ngs: brendyyn: see https://github.com/mrosset/giqt/blob/master/examples/hello.scm.in numerobis: brendyyn, str1ngs : thank you very much! str1ngs: I don't know how much I can support giqt because I may not need it for nomad. str1ngs: numerobis: if you are looking for something in more scheme see http://git.savannah.nongnu.org/cgit/nomad.git/tree/qt/webview.cpp?h=0.1.2-alpha str1ngs: pure scheme* str1ngs: numerobis: you need to snarf though with this method see. http://git.savannah.nongnu.org/cgit/nomad.git/tree/qt/Makefile.am?h=0.1.2-alpha numerobis: str1ngs: cool! didn't know about snarfing and didn't know about the nomad web browser! str1ngs: numerobis: nice, I'm not sure what you need to do with qt-poppler if its non graphical library then snarfing should be fine. str1ngs: numerobis: I have an experimental variant of nomad that can use either webkit or qtwebengine web buffers. str1ngs: though I probably won't go this route because it uses X11 embedding. str1ngs: numerobis: when I say use either I mean at the same time. numerobis: str1ngs: thanks! My project (in the pretty long term) is to write a PDF viewer with vim-like keybindings but a bit more complete than Zathura. I am only at the stage where I just look at the available technology, and the question I'm at now is whether to use python or guile for the high-level stuff. There's a lot more stuff available in Python, obviously, but guile is more fun, so I still don't numerobis: know. ;) str1ngs: cool leoprikler: numerobis: when in doubt, try python on guile ;) dsmith-work: Tuesday Greetings, Guilers z0d: hi dustyweb: cbaines: aroun? dustyweb: around? dsmith: sneek: botsnack sneek: :) dsmith: goodbot libfud: sneek: help libfud: sorry, just wanted to see if I could poke the bot libfud: neat bot, that's another project on my todolist rgrmrts: I'm working through SICP right now and in the first chapter there's a part about re-implementing `if` using `cond`, it goes on to ask what happens to our square root implementation using this new-if and using guile it never terminates. I'm trying to understand why. gist with code: https://gist.github.com/rgrmrts/af34bc6e778176feb87c2cdca59fac3d, any clues? rgrmrts: I realize this isn't related to guile specifically, sorry if this is a wrong channel ft: You can't implement if as a function in languages that evaluate eagerly, like Scheme. The function only gets applied after *all* its operands have been evaluated. libfud: if is a special form libfud: the interpreter treats it differently than procedures libfud: (to rephrase what ft is saying) rgrmrts: thank you both for the response! libfud: what's the motivation behind comma commands in guile? ft: In the recursive case, your new-if gets its predicate, consequence and alternative arguments, and scheme evaluates all of them. The alternative has the recursive call, so it never can terminate, even if the predicate returns #t. libfud: e.g. why ,apropos foo instead of (apropos foo)? rgrmrts: was just typing up: so if this weren't a recursive function, the "new-if" would have probably been fine ft: (apropos foo) would be subject to the namespace that's currently active. (I guess - I have no insight into the design decision) rgrmrts: makes sense! I haven't quite processed _why_ the recursive call doesn't terminate but I can think on that. rgrmrts: thanks! libfud: well libfud: it actually does matter regardless of it it's recursive or not libfud: for example (if predicate (set! foo (+ foo 1))) ft: Yeah, mutation can be a problem. I/O can. Lots of things can. libfud: nothing recursive about that, but you only want to evaluate it on the predicate being true ft: Also, vasted CPU cycles. :) rgrmrts: hmm rgrmrts: ohhh rgrmrts: okay, making more sense now libfud: I think the purpose of the exercise is to introduce the idea of special forms behaving differently, and why it's desirable for them to behave as much libfud: *as such rgrmrts: word, I was curious about why special forms exist in some cases libfud: to translate it in terms of assembly instructions, conditionals are branching instructions that operate on the program counter, "skipping" over instructions ft: In the case of ‘if’, its purpose is to break the usual evaluation rules. :) libfud: define and set! are also special forms rgrmrts: eureka :) rgrmrts: thank you libfud and ft! dsmith: libfud: The comma commands at the repl are convenient magic syntax because normally commas are only used in quasi-quote. libfud: dsmith: so just a feature of convenience to save some keystrokes? libfud: *me is not complaining, just curious libfud: er, /me, not *me libfud: whatever dsmith: I'm just guessing. ft: If you're in a module that implements a function or macro called ‘apropos’, (apropos foo) won't work anymore. ",apropos foo" always can, because its a meta-command, independant of the currently active module. dsmith: Not so much saving keystrokes. More like (ab)using invalid syntax to provide repl-specific commands. ft: And dsmith is probably right about why the comma was chosen. libfud: ft: so even if in the global environment I bind apropos to something else, it will still work? libfud: or am I mistaken in calling the environment that you start out the REPL in the global environment? ft: libfud: ,apropos probably calls out to the global definition, so that probably won't work. ft: Yeah, (set! apropos identity) breaks it. ft: I wonder if a local definition would shadow this. Hum. libfud: it's fun to break things and play in the mud :) ft: I tried. It calls out the the global one. ft: And only if you override that one using set! things break, understandably. ft: So it's more than just convenience. libfud: hmmmm... since i'm going over SICP myself, could you implement if as a function with force and delay? ft: If you force your users to obey that, yeah. ft: That's why you can implement if as a function in lazy languages like Haskell. libfud: ah, right, because you can't delay the input expressions in the body libfud: is literally everything in haskell lazily evaluated? ft: There are ways to force eager evaluation for selected expressions. ft: But the default is lazy evaluation. libfud: since I don't see this in SICP and it just says "cons-stream is a special form defined so that (cons-stream ) is equivalent to (cons (delay ))" libfud: is the following a good way to express that? libfud: (define-syntax cons-stream (syntax-rules () ((cons-stream a b) (cons a (delay b))))) rekado: libfud: I don’t know if there’s anything else to it, but you can also use define-syntax-rules here RhodiumToad: define-syntax-rule is a very useful shorthand for simple macros rekado: (define-syntax-rule (cons-stream a b) (cons a (delay b))) rekado: libfud: Guile has srfi-41 for streams, though, so you could use that instead :) dsmith-work: Hey hey Guilers leoprikler: Just a heads up, I think make-variable-transformer is not working correctly in the case of (set! (alias arg ...) value) emys: how can I invoke guile for executing a compiled .go file directy (instead of refering to the source file?) libfud: guile can execute Go? libfud: or is that the extension of compiled guile code? justin_smith: libfud: it stands for "guile object" and predates the google funded programming language ArneBab: libfud: my guess about the comma-commands is that a comma is always illegal in toplevel-scope, so it can be used to start arbitrary parsing without breaking anything in the very moldable scheme. libfud: justin_smith: yeah I figured that out after looking at the documentation justin_smith: see also cmucl which has a compailer called "python" emys: another question: can I somehow get the 'type' of an object / variable? rekado: emys: guile -c '(load-compiled "foo.scm.go")' emys: thanks rekado rekado: emys: if you’re using GOOPS you can do rekado: class-of rekado: ,use (oop goops) rekado: (class-of "hello") rekado: but that’s perhaps a little heavy justin_smith: I've often wished the logic of "class-of" existed outside goops emys: rekado, that will do for me, its just for debugging purposes dsmith-work: emys: Outside of goops, you need explicitly check for the type. dsmith-work: emys: Like with string? number? pair? etc. emys: emys, full story is I did two mistakes, the first one led to the wrong behaviour, the second meant that (write x) debugging did show a different variable, so I didn't realize I was actually using the list/pair instead of the list-element in my code emys: class-of gave me the info that I was dealing with a pair, then I realized I was writing out the wrong value and I was able to see what I did wrong emys: dsmith-work, thats what I was using class-of for :-) and in this case goops was fine peanutbutterandc: How does one define a 'tuple' in guile? libfud: depending on what you want to do I think a list will probably suffice chrislck: or vector chrislck: or cons peanutbutterandc: it's for guix. packages->manifest peanutbutterandc: and it takes: 'package/string tuples denoting a specific output of a package' peanutbutterandc: i'll give cons and vectors a shot peanutbutterandc: list, sadly didn't suffice libfud: oh libfud: can you link to the page where you see that? libfud: it might be talking about a dotted pair peanutbutterandc: if you have guix installed, $ guix repl libfud: probably something like (cons 'package-name 'package-output) but I'm not sure what it means exactly libfud: I don't, it's something I've been meaning to try peanutbutterandc: ..... oh.... hmmm... okay.... i'll try it out peanutbutterandc: It's been saying this: peanutbutterandc: guix/inferior.scm:352:18: In procedure inferior-package-field: peanutbutterandc: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): (glib . "doc") libfud: just throwing this out there, but there is a #guix channel on irc as well peanutbutterandc: libfud, Yes, somebody is answering there too. I asked here too because I'm running out of battery. peanutbutterandc: But thank you for your help (: libfud: np libfud: my guess for the wrong type argument is that you're passing the wrong argument into that tuple libfud: idk though peanutbutterandc: I'm a relative beginner so it must be some minor error on my part, yes. let's see... libfud: is there some guide you're following? I'm guessing you're trying to contribute a package peanutbutterandc: No, for now, I'm just trying to set up a dev env to learn some gtk. guix makes setting up dev envs a breeze. I think you'd love it too libfud: peanutbutterandc: it's been on my to-try list for a while but I'm swamped with work and I have another personal project i'm working on in the off-hours I have when I feel like programming libfud: also I prefer Qt to gtk peanutbutterandc: libfud, Hmmm.... I see. Perhaps once you do start using guix, you'd love how easy it is to set up a qt dev env using a mere `guix environment --ad-hoc qt and other packages here` rekado: hmm, I must be missing something. I put everything in a global guardian but sometimes it crashes and sometimes it doesn’t. rekado: according to gdb the crash happens when the library tries to copy the vector. leoprikler: maybe the library estimates a wrong size? stis: hey guilers! mwette: Ah, in the manual the copied string generated by string->pointer is freed when the pointer becomes unreachable. I think we need to change make-cstr-array to take an array of pointers and use (make-cstr-array/ptr (map string->pointer str-list)) mwette: Well, (define spl (map string->pointer str-list)) (my-guardian spl) ... rekado: I’ve done that but it doesn’t seem to make a difference rekado: (I put everything in that global guardian: the pointers, the strings, the list of strings, the addresses, the bytevector itself) mwette: yikes rekado: https://paste.debian.net/1166611/ mwette: Hmm. mwette: there are undocumented commands gc-enable and gc-disable, I just saw in the sources rekado: with gc-disable at the beginning of the file it does not crash, even when calling the C procedure 100 times rekado: it does crash when the file has just been modified and needs to be compiled rekado: but after auto-compilation: no crashes libfud: is there a generic string conversion function? libfud: like what's used by display? RhodiumToad: converting non-string values to strings, you mean? libfud: yes libfud: hey, I recognize you from #lua, you get around RhodiumToad: it looks like display is actually the primitive, and if you want a string representation of the result you wrap it using call-with-output-string libfud: ah, thanks RhodiumToad: using a string port like that is how (format #f ...) works for example *: RhodiumToad doesn't get around all that much, just has an interest in languages, especially embeddable ones libfud: I think it's actually with-output-to-string, but I could be doing this wrong RhodiumToad: with srfi-26 you can do: RhodiumToad: (define (obj->string obj) (call-with-output-string (cut display obj <>))) RhodiumToad: which is equivalent to RhodiumToad: (define (obj->string obj) (call-with-output-string (lambda (port) (display obj port)))) libfud: ah libfud: almost all of my use of scheme has been in the context of the REPL and doing pretty simple things RhodiumToad: with-output-to-string is similar, but has to use a dynamic context to change the default output port RhodiumToad: whereas call-with-output-string just passes the new string port to the function libfud: is there an "assert" function or macro defined in any of the srfi or ice modules? RhodiumToad: I didn't find one when I looked, so I did my own RhodiumToad: (define (assert-fail e) (error (format #f "Assertion failed: ~A" e))) RhodiumToad: (define-syntax-rule (assert e) (unless e (assert-fail (quote e)))) libfud: ah, I didn't know about unless either RhodiumToad: ~S might be better leoprikler: there should be a ->string libfud: https://0paste.com/101937 libfud: that's what I had made RhodiumToad: oh, yes, looks like object->string exists leoprikler: okay, it's called object->string libfud: so it's just that the price of object->string is probably significantly higher than ->string RhodiumToad: object->string uses write by default rather than display RhodiumToad: either way, object->string is just a C wrapper that does the call-with-output-string thing libfud: well, that makes sense RhodiumToad: (object->string obj display) is the same as (call-with-output-string (cut display obj <>)) in all respects other than being implemented directly in C libfud: is unless part of one of the scheme standards or is it specific to guile and some other implementations? RhodiumToad: I don't think it's in r5rs. not sure about later versions, but it's a trivial macro: RhodiumToad: (define-syntax-rule (unless test stmt stmt* ...) RhodiumToad: (if (not test) (begin stmt stmt* ...))) RhodiumToad: actually defined as that in ice-9/boot-9.scm apteryx: hello, what's the most idiomatic form to have some code execute no matter what (something called `finally` in other languages' execption handling?) apteryx: useful in cleanup code RhodiumToad: unfortunately continuations make that concept a bit tricky RhodiumToad: a given block of code might be exited more than once, do you want to run the cleanup each time? rekado: apteryx: dynamic-wind? RhodiumToad: dynamic-wind can and will execute the "outgoing" thunk multiple times if need be apteryx: rekado: that seems like it. I was looking up how call-with-temporary-directory cleans up in (guix utils) and that's what it's using apteryx: RhodiumToad: hmm, it wouldn't matter in my case even if it's ran multiple times apteryx: s/it's/it/ apteryx: but thanks for the caution about that interesting bit (continuations meaning the same procedure might be exited multiple times) RhodiumToad: I don't personally approve of arbitrary continuations, but delimited continuations have some interesting uses afidegnum: i'm new in guile, what utility do i need to implement 2d graphics? i.e diagrams, graphs, interractions between them ? RhodiumToad: do you want to make a GUI app, or something that renders to output files? afidegnum: something that renders to output files, i guess, emacs could be a better bridge, I will be ok for a custom GUI too afidegnum: RhodiumToad: what do you think? RhodiumToad: so there's probably a bunch of ways depending on what you want to output and what tools and formats you prefer RhodiumToad: it's not hard to use sxml to output svg for example afidegnum: ok, in the nutshell, i wanted the built diagrams to output in json, which will be integrated into emacs, still reading on till i discover something handly stis: Amazing just compiling the python libs reveals bugs there as guile checks and warns for non bounded variables stis: love this feature of guile and I spen a lot of effort in copying that feature over to python-on-guile rekado: mwette: turns out it was my fault for misunderstanding the documentation of the library: it says that the vector must be NULL-terminated rekado: I assumed that it meant that the elements must be \0-terminated strings. rekado: but they actually mean that the last element must be a pointer with address 0 rekado: after adding this extra element I cannot reproduce any crashes rekado: sorry for misleading you rekado: (and thanks again for your patience and help!) mwette: rekado: good result, then ; that is awesom; glad to see someone thrashing on the ffi-helper mwette: rekado: I think I can fix. Can you file a bug report? The issue with unsized arrays is fixed. (bytestructures guile) does not support but I added to ffi-help-rt. mwette: I will look soon (this weekend latest). mwette: rekado: Can you try this: (define unwrap~array unwrap~pointer) mwette: I had struggled with how to handle unsized arrays like foo_t x[]. (bytevectors guile) does not deal with this case, so I extended the bs:pointer case to handle integer dereferences (i.e., (bytevector-ref x '*) works but so does (bytevector-ref x 0) mwette: s/bytevector/bytestructure mwette: sneek: later tell rekado, try (define unwrap~array unwrap~pointer) sneek: Got it. mwette: sneek: botsnack sneek: :) chrislck: you guys are very clever with guix and srfis, but down on earth it's not easy :) leoprikler: chrislck: I think the writer of SRFI 180 simply expects you to add /path/to/git/checkout to your load path rekado: mwette: I tried (define unwrap~array unwrap~pointer), but I’m not sure what to provide as the vector. When I give it a mere list of strings it says “expecting pointer type”. sneek: rekado, you have 1 message! sneek: rekado, mwette says: try (define unwrap~array unwrap~pointer) mwette: rekado: thanks -- I will look into it. I think there is a similar glib arg somewhere. mwette: sneek: later tell rekado: try https://paste.debian.net/1166490/ sneek: Will do. nerdypepper: hiya, what exactly does `>` do when you supply more than 2 args? RhodiumToad: > is true if all the args form a strictly descending sequence mwette: sneek: later tell rekado: needs pointer-address: https://paste.debian.net/1166491/ sneek: Will do. RhodiumToad: i.e. (> a b c ...) is (and (> a b) (> b c ...)) nerdypepper: ah i see, ty RhodiumToad, where can one find/read implementations of these functions? RhodiumToad: well, for primitives they're in C code in libguile/* in the sources RhodiumToad: for non-primitives, mostly in the (ice-9 boot-9) module lloda: nerdypepper: (help >) does work, surprisingly lloda: i believe there are still many primitives without online help lloda: like (help cons) doesn't give anything chrislck: Hellllooo Fridayyyy nerdypepper: lloda: ah, thanks *: mwette is using (system vm elf) to convert microcontroller machine code to modified asm (i.e., CPS asm) for model-checking. stis: hej guilers! RhodiumToad: good evening rekado: mwette: thank you for the definition of make-cstr-array! sneek: Welcome back rekado, you have 2 messages! sneek: rekado, mwette says: try https://paste.debian.net/1166490/ sneek: rekado, mwette says: needs pointer-address: https://paste.debian.net/1166491/ rekado: Unfortunately, bv-set! is undefined because (sizeof '*) returns 8. rekado: (I don’t know if that’s unexpected) rekado: I suppose I could use bytevector-u64-native-set! for now rekado: so, this creates a bytevector that is big enough for n pointers, where n is the number of strings. rekado: it then stores the address of a pointer for each string in the bytevector, eventually returning a vector of pointer addresses. mwette: the cases should be (4) and (8) not (32) and (64) mwette: yes. I think that is what the C code is expecting rekado: I think bv-set! should use (* (sizeof '*) index) instead of just the index rekado: (just by looking at the resulting bytevector) rekado: unfortunately, when I pass this to the C procedure Guile crashes, but that might be an unrelated mistake rekado: I’m passing it with (pointer-to (make-cstr-array (list "hello" "world"))) after defining unwrap~array as unwrap~pointer rekado: oh, it worked with (make-char* (bytevector->pointer (make-cstr-array (list …)))) mwette: Oh. I thought unwrap~pointer dealt with bytevectors. I will add that. mwette: Ah, the index is byte offset. I fill fix. Thanks. rekado: FWIW this is the variant of make-cstr-array that I’m using now: https://paste.debian.net/1166540/ mwette: and you don't need make-char*, unwrap~pointer is meant to be forgiving rekado: okay mwette: And I will use your version in next release, if OK w/ you. I'm only changing the doc-string. rekado: sure! rekado: for some reason the C procedure triggers a crash sometimes, when I run it often enough. rekado: let’s see… mwette: I wonder if something is being gc'd? Try executing (gc) just before the C function call. rekado: seems so rekado: with (gc) it crashes reliably rekado: maybe I need to copy the strings? mwette: Hmm. I don't know. rekado: I’ll play with this mwette: Ah. Yes. When the pointers are converted to integers and stuffed into the bytevector the reference to the strings goes away. mwette: s/integers/integer addresses/ mwette: maybe add a guardian for the list of strings mwette: bytestructures provides deals with substructures nicely (you can generate a scheme object that references a structure buried within a structure) mwette: s/provides // chrislck: leoprickler: thx will dig into guile sources chrislck: I found (install-r7rs!) -- not sure what it does -- then tried (load "srfi-180.scm") still no go chrislck: ^ srfi-180 requires srfi-145; copied&pasted srfi-145 still no go. leoprikler: guix environment --container --ad-hoc guile guile-srfi-145 -- guile --no-auto-compile -L . -c '(use-modules (srfi srfi-180)) (json-write #("hello" "world"))' civodul: that's an elaborate but elegant way to say "hi" leoprikler: Don't know about "elegant", given that we already have guile-json, but it serves to illustrate the point ;) civodul: also interesting is the fact that it's a "least-authority hi" given the use of --container civodul: no harm is done to your environment by saying "hi" leoprikler: There is also no outside influence, that could make it say anything else but "hi". civodul: right davexunit: didn't know about srfi-180 davexunit: the api strikes me as... weird davexunit: I don't love guile-json either, so I guess I'll stick with my own implementation leoprikler: btw. davexunit, could you be Dave Thompson? rekado: the C API I’m working with has a procedure to allocate an object and another to destroy it and free its memory. Is there something I can do to detect if a C object has been freed already? rekado: I want to prevent the users of the Guile bindings from accidentally destroying the object more than once. rekado: though perhaps I should not expose this procedure at all and use a finalizer instead…? civodul: rekado: yeah, don't expose it and use finalizers rekado: okay davexunit: rekado: I second what civodul said *: rekado reads up on finalizers civodul: Schemers don't expect to do manual memory management rekado: yes, this is for the “low” bindings rekado: I indent to add another layer on top of this. davexunit: pointer objects accept a function pointer as a finalizer. davexunit: I recently wrapped some stuff in libfreetype and used that feature in a couple places. davexunit: you can build whatever high-level interface you want on top and guile is going to make sure that when the low-level pointer is finally ready to be GC'd that it will be cleaned up in C land. civodul: finalizers put pressure on the GC tho, so they're quite expensive civodul: so if your library has an option that lets you replace the allocation routines it uses, it's better to do that and avoid finalizers altogether civodul: that's what libguile does with GMP for instance leoprikler: internally swapping malloc for scm_gc_malloc? civodul: yes leoprikler: hmm, is there a way to do this even without such an option? leoprikler: e.g. through patchelf civodul: glibc used to have malloc hooks civodul: they were removed, but i think there were discussions about reintroducing them davexunit: reading the docs on the new exception handling stuff and uh... I have no idea how to handle exceptions anymore. davexunit: I just want to print out a backtrace after catching any error in a form. RhodiumToad: is the stuff in the docs under Debugging > Programmatic Error Handling > Pre-Unwind Debugging any help? davexunit: RhodiumToad: ooh this is helpful, thanks. RhodiumToad: yw davexunit: trying to make a custom repl davexunit: aaaaand it blows up trying to print the backtrace :) roptat: again, silly question... how to compare to srfi-19 date objects? roptat: I saw time<=?, but I get TIME-ERROR type incompatible-time-types RhodiumToad: comparing what to them? roptat: comparing two dates, which one is older RhodiumToad: ok, so a date object in srfi-19 is broken-down components of a timestamp, whereas a time value is on a continuous time scale? RhodiumToad: so to use time<=? you'd need to convert using date->time-utc (or date->time-tai) roptat: thanks ATuin: hi ATuin: is it possible to match nested records using '(ice-9 match)'? ATuin: trying something like this did not work: "(($ id1 #nil ($ id2 msg data))" ATuin: ah, seems in need to use "(= pat)" d4ryus: davexunit: i wrote a (very) basic display-backtrace replacement since it prints function arguments which, if they contain records with custom printers, breaks fibers yield: http://paste.debian.net/1166399/ maybe you find something usefull davexunit: d4ryus: thank you I'll take a look at it. leoprikler: did i miss something w.r.t. exception handling? leoprikler: for all intents and purposes I'm still mostly stuck on 3.0.2 rekado: mwette: a C procedure takes a “const char* values[]”; the generated FFI code calls unwrap~array, but then fails because of “Unbound variable: unwrap~array” rekado: I see that (system ffi-help-rt) exports unwrap~array but doesn’t define it. rekado: the FFI helper guide indicates that this is an open issue. Aurora_v_kosmose: manumanumanu: Incidentally, I found out you don't need full paths for open-pipe*. kahiru: hey efraim: having a slow brain day, in the guile REPL (getcwd) returns a path, what magic am I missing from guile -c '(getcwd)' to have that same path printed in the terminal? wleslie: '(display (getcwd))' daviid: efraim: guile -c "(display (getcwd)) (newline)" efraim: thanks. I knew it wasn't printf or echo RhodiumToad: grumble. just had guile randomly abort when run from configure. for no reason I can detect RhodiumToad: https://dpaste.org/5XHb RhodiumToad: unfortunately this was in a bulk build and the core file was deleted rekado_: hmm, Guile keeps crashing when I use char*->string on the result of (make-char*) that has been modified by a procedure in C. janneke: hmm, not a good day for Guile lloda: finding bugs is good janneke: lloda: yes, thanks for the heads-up *: janneke has just bisected the first bug, and now hit another one, a hang janneke: combine that with rekado's efforts and i guess it's our lucky day rekado: I’m pretty sure it’s just my failure to understand the DRMAA C API and how the Guile FFI works. civodul: janneke: compiling your reproducer with -O1 is another to make the bug go away :-) janneke: civodul: ah, that's a nice trick! janneke: already pointing sharper janneke: civodul: somewhat reminds me of https://bugs.gnu.org/33216 janneke: yay, /me got the hang'er reproduced with static input janneke: now to bisect civodul: janneke: further reduced: https://web.fdn.fr/~lcourtes/pastebin/guile-wrong-arg-num.html civodul: the GOOPS thing could be a different issue, no? civodul: apparently it's the call to 'fk' that triggers the miscompilation janneke: (yeah, GOOPS is probably different -- it just reminded me of juggling with optimizations) janneke: ah nice, you went into expanding pmatch *: janneke sends another bug report jlicht: what is the goal/purpose of `procedure-source'? All of the procedures on which I called it give `#f', unless I specifically set the property using e.g. `(set-procedure-property myproc 'source ...)' miha: hello, can I work directly with unsigned integers in Guile? Or is everything wrapped in SCM? chrislck: ok annoying that there's no searchable answer: if I (load "srfi-180.scm") from srfi-180, it won't work. srfi-180 is written in r7rs which is not default guile. How on earth do I import srfi-180 if I'm using regular guile?? rekado: chrislck: --r7rs chrislck: the idea is to integrate with gnucash. it uses libguile. lispmacs[work]: hi, does Guile have any special facilities for working with POSIX shared memory (shm_open, mmap, etc.)? lispmacs[work]: I was doing this project in C where I was opening a shared memory segment and then mapping it out with one big struct in a header file lispmacs[work]: mapping->organizing lispmacs[work]: so multiple programs that are not parent/child could refer to the same "variables", i.e., fields in the struct in the shared memory lispmacs[work]: was wondering if something similar could be done in Guile lispmacs[work]: I'm sure I could figure out on the C side of guile how to access shared memory but suppose then there might be some messy FFI work or something for accessing the fields of the struct leoprikler: as long as you got the struct parsing right, shared memory should not be much of a problem in Guile leoprikler: you will probably have to deal with the pointer type, though leoprikler: but you *can* use wrapped pointers as well as define your own records on top (though the C world will not see them) leoprikler: chrislck: have you tried using a small wrapper, that sets up r7rs and then loads the actual source file? leoprikler: guile does similar things for other SRFIs and stuff too IIRC mwette: lispmacs[work]: https://www.nongnu.org/nyacc/nyacc-fh-ug.html rekado: so, the segfault unsurprisingly happens because Guile says it can’t access the memory at the specified address. stis: hey guilers! rekado: I do (let ((message (make-char*))) (the-c-proc (pointer-to message)) (char*->string message)) rekado: I see that “message” is a bytestructure; when I use bytestructure-ref on it I get an integer that corresponds to the memory address that Guile says it can’t access. mwette: rekado: the-c-proc arg type is char* or char** ? If char**, is it allocating memory? rekado: the procedure signature is “int the-c-proc(char* message)” rekado: do I need to do something to allocate the char buffer first? mwette: rekado: It looks like that to me. There is nothing automatic for strings, IIRC. Maybe make-bytevector, bytevector->pointer, (make-char* ) mwette: then just pass the output of (make-char* ) where is what you get from bytevector->pointer davexunit: bytestructures or something similar should really be part of guile core. it's a real weak spot of the ffi right now. davexunit: python and ruby both have a way of defining classes that encapsulate C structs. davexunit: wrapped pointer types are nice for libraries that mostly give you "handles" to things, but if anything expects you to pass in a big struct or retrieve data from a big struct then good luck because you're going to be mining bytevectors. civodul: davexunit: or you could use 'parse-struct' & co. but that's pretty inefficient stis: python on guile impemetns ctypes rekado: mwette: thank you very much! This helped a lot! rekado: this is fun! rekado: C feels so much like assembly with more complicated syntax davexunit: civodul: I use that sometimes when I can get away with it. it works, but getting a list dumped out isn't particularly structured and yeah it also performs badly. davexunit: I can use it in places where allocation isn't a big deal. davexunit: I want a record type-like interface that does all the C struct building/parsing for me. davexunit: so I don't have to think about padding (which I always mess up) and stuff davexunit: I wrapped part of libfreetype recently and I wrote some horrible code to get offsets into bytevectors with struct data to pull out the bits I needed. rekado: davexunit: wouldn’t (bytestructures guile) help with that? civodul: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/syscalls.scm#n188 has code similar to bytestructures but less sophisticated, expansion-time only, and more compact davexunit: rekado: yes it would, but my needs haven't been enough to merit the dependency burden. davexunit: guile core should really have something. davexunit: I guess like that syscalls.scm file, but public. davexunit: my game dev stack so far has wrappers for sdl2, freetype, openal, inotify, libvorbis, libvorbisfile, mpg123. davexunit: most of the these don't require a lot of struct fiddling. civodul: yeah struct fiddling is often for libc and old-style libs civodul: newer libs often use opaque pointers guix-vits: Hello daviid. This segfaults when button clicked (not mine code): http://paste.debian.net/1166073. Can i gather more info somehow? daviid: guix-vits: will look into this asap, tx for the report guix-vits: daviid: Thank U. mwette: greetings! Blukunfando: Guileful greetings. kahiru: hi guilers! manumanumanu: kahiru: my response latency is too large! hello! manumanumanu: what are y'all up to? sneek: sneekn manumanumanu: yes you are, sneek Aurora_v_kosmose: Do pipe ports use file descriptors? Aurora_v_kosmose: Trying to determine if gc will do the right thing, or if I should explicitly close them. Aurora_v_kosmose: nvm me, manual says it takes care of it. manumanumanu: Aurora_v_kosmose: the GC will close any pipes left dangling manumanumanu: but why leave them? Aurora_v_kosmose: manumanumanu: Mostly aesthetics, no particular reason in this case. Aurora_v_kosmose: manumanumanu: Is there something to shell-quote a bit like Elisp's `shell-quote-argument'? manumanumanu: Aurora_v_kosmose: do you have an example of the elisp version? Aurora_v_kosmose: (shell-quote-argument "This one's a \"bit\" (forced) & all") => "This\\ one\\'s\\ a\\ \\\"bit\\\"\\ \\(forced\\)\\ \\&\\ all" Aurora_v_kosmose: In the end... it may or may not be necessary depending on how open-pipe* passes the arguments. manumanumanu: Aurora_v_kosmose: open-pipe* does not use the shell, so you don't need to quote them. open-pipe, however... Aurora_v_kosmose: Alright, sounds like less trouble then. manumanumanu: but then you need to know the full path to whatever you are trying to run. Aurora_v_kosmose: In this case that works out reasonably-well. dsmith: Aurora_v_kosmose: gc usually happens because of memory pressure. Not really good to rely on that to clean up fd's. You could run out, depending on memory allocations.. dsmith: I think it's a good idea to always clean up non-memory resources when you can. Aurora_v_kosmose: Pipes don't count as fd's though, do they? Aurora_v_kosmose: Ah I see. Aurora_v_kosmose: We're missing quite a few with-x-from-y helpers ManDay: I'm not sure whether it's a lack of understanding on my part, but I'm frustrated with Guile's CLI. There appears to be no way in the world to simply run a script and debug it (c.f. gdb on a C program)! If I run the script and it has an error, Guile prints a (more or less comprehensible) error to the terminal and then just quits. And there appears to be no way from debugging it UNLESS I *manually* ManDay: execute the command in an interactive session. I've tried everything from -c -s and -e switches to even crafting a temporary .guile, either things don't execute or I'm not getting the interactive debugger. Is this design on purpose? It just doesn't seem to be thought-trough for practical usage.... :-/ ManDay: Judging from the title, I guess I should update before speaking... The newest in Gentoo is 2.2.6 and the titles mentions something 3.0.4. Though I suspect an update wont change that particular issue rekado: ManDay: for Guile applications I find it helpful to start a REPL server alongside the application lloda: tbh i just do (load ...) on the repl to get the debugging prompt, that hasn't bothered me. But yeah 3 behaves in the same way rekado: e.g. with (spawn-server (make-tcp-server-socket #:port repl-port)) rekado: I also wrap the application in call-with-error-handling to enter a debugger when an error occurs in the thunk ManDay: ok, I'll take a look into that. lloda that's what I've been doing so far but I find it completely pointless, that should be a feature of the binary. I'll do a PR if I can figure out how to make it work (never looked into guile) rekado: these two options together make application development and debugging rather convenient ManDay: so using call-with-error-handling, how would I apply that *without* modifying my source code? ManDay: I don't even care if I have to write a shell wrapper around it, I just want to be able to type "guile-with-debug some-file.sh" on the command line and get a working debug ManDay: for god's sake guile seems to be throwing every rock it can find into my way ManDay: it can't be that difficult *: ManDay tries generating a script which encapsulates the file into call-with-error-handling on the fly ManDay: well that kind of works. not exactly the same prompt i get interactively but it will have to do ManDay: thanks roptat: mh... I'm trying to define this macro: https://paste.debian.net/1165971/ but I get source expression failed to match any pattern in form (modify-as-document d (remove id)) roptat: the macro works well for set and remove* roptat: (initially, I named them set, delete and delete*, but though there could be a conflict with delete, but I had the same issue) mwette: embedded control character you don't see? -- retype the form maybe roptat: I tried moving remove and remove* around by only deleting * and adding it, but that didn't change anything roptat: also renaming remove to removee works, so I'm wondering if the * is interfering somehow? lloda: that's very strange, * is just a character lloda: is remove* defined before? roptat: the order doesn't seem to be important lloda: i mean defined in the environment, not by yourself roptat: neither set, remove nor remove* are defined mwette: try to retype the entire second form, from ((_ doc to spec ...)) mwette: invisible (control) characters can get you sometimes dsmith: Does it matter if you move the "replace* before the "replace"? roptat: no, it doesn't roptat: ha! actually remove is defined in the context of the definition *: janneke stumbles over (ice-9 rdelim)s write-line and sends a patch mwette: How is remove defined in the context of the definition? mwette: It's a keyword, right? dsmith: I don't understand what that macro expands into. Looks recursive, but I don't see how it terminates. But my macro-fu is weak. Especially syntax-case. roptat: dsmith, it terminates in the first case roptat: (only doc, but no additional spec) roptat: at the definition point, I use (srfi srfi-1), which defines remove roptat: if I copy the macro to a point where remove is not defined (in a fresh repl for instance), I don't have that issue at all dsmith: Doh! dsmith: Now I see. In the base case, "doc" can be a whole expession. dsmith: roptat: So what version of Guile? dsmith: ISTR some changes in 3 about macros dsmith: Ahh nevermind dsmith: ** Define top-level bindings for aux syntax: `else', `=>', `...', `_' dsmith: That's what I was attempting to remmeber roptat: 3.0.2 ManDay: The guile texinfo manual says the warning about replacing a core binding would be prevented by a define-module option #replace. I get warnings about (display) and associates being overriden by r6rs - apparently the r6rs module does NOT use #replace... Can these warnings be prevented? ManDay: (they print right into my output, messing everything up) ManDay: worked around it with (import (except (rnrs (6)) newline display)) leoprikler: ManDay: you could register your own warn-core-override-no-rnrs, which works just like warn-core-override but does not do anything if one of the modules starts with rnrs ManDay: thanks, a bit an overkill but I get the idea leoprikler: does anyone know if guile has a string i/o port that can be both read and written to? leoprikler: pipes are probably close to what I'm looking fore leoprikler: hmm, output-strings could probably also do similar things, but they don't seem to handle #\delete well dsmith: leoprikler: Do you want #\delete to remove a character? leoprikler: either that or #\backspace leoprikler: but both just get appended to the string with put-char, which tbf one would expect dsmith: What you are probbaly needing is a pty or something else that has a line-discipline. dsmith: Or maybe readline? leoprikler: I get my inputs through keyboard events, though. leoprikler: See https://gitlab.com/leoprikler/tsukundere/-/blob/devel/tsukundere/script/utils.scm#L121-151 dsmith: Hmm. Probably need to implement that by hand then.. leoprikler: I could probably implement something similar based on bytevectors, but I'm not sure how much I'd gain from doing so stis: hej guilers! leoprikler: hi stis manumanumanu: tjena stis! manumanumanu: what kind of exciting saker are you up to today? stis: my long term goal is to test and test and test the python implementation, it's a huge task stis: not only the language. but actually getting the batteries to work as well. mwette: leoprikler: maybe something lurking in https://git.savannah.nongnu.org/cgit/emacsy.git/tree/emacsy text.scm manumanumanu: stis: do you feel motivating or just insurmountable? manumanumanu: does it* leoprikler: mwette: hmm, it seems like (ice-9 gap-buffer) is a good place to search leoprikler: perhaps that should be documented manumanumanu: I though tthat was deprecated... manumanumanu: the documentation was removed before 2.0 iirc. manumanumanu: leoprikler: https://www.gnuvola.org/software/guile/doc/Gap-Buffer.html manumanumanu: that is the old docs leoprikler: yeah, it seems to use soft ports, which IIRC is the "old" way of doing custom ports civodul: sneek: seen OrangeShark sneek: OrangeShark was in (here?) 7 months ago, saying: oni-on-ion: it is a package on guix https://guix.gnu.org/packages/guile-studio-0.0.2/. stis: manumanumanu: I've just want something to do and why not make the python implementation a little better. It is a daunting task though manumanumanu: I have a similar feeling. I spent a little time looking at foof-loop asking "why the eff did he do it like that?!". Now I am trying to write a similar thing, but with support for racket-like subloops. I have had to start over 2 times so far after going "oooh, that's why!" stis: yeah I know the feeling davexunit: leoprikler: yeah I looked at soft ports recently for a similar reason. prob not worth building something on something so old and crusty. davexunit: I haven't gone down the rabbit hole yet, but a custom binary port with a wrapper around it that does utf8->string could work. spk121: leoprikler: in (ice-9 readline), you can use the 'readline' function spk121: would that work? leoprikler: I'm not sure, but probably no. manumanumanu: mwette: regarding the syntax hygiene: I am having a look at quasisyntax to see if I could make a hygienic version of it. srfi-72 is based on explicit renaming, which I suspect will be hard to bolt on :) manumanumanu: srfi-72 is really an amazing work by André. mwette: manumanumanu: Good luck. Looks very non-trivial. stis: hey guilers! mwette: o/ RhodiumToad: good afternoon *: rlb thinks our tests should print the expected and actual values when there's a failure. r7rs.test doesn't yet (I think). dsmith: rlb: That's a very good idea dsmith: For any test error reporting in general. rlb: (Also want line numbers or distinct names right now...) roptat: mh... Undefined symbol #f jonsger: roptat: where? spk121: Hmm. This is a new one. guild compile bombs with ... spk121: ice-9/boot-9.scm:1669:16: In procedure raise-exception: spk121: Throw to key `numerical-overflow' with args `("ash" "Numerical overflow" #f #f)'. rekado: mwette: I’m working on Guile bindings to DRMAA. The implementation of that library is usually not available at build time. When I add “#:library '("libdrmaa.so")” to the FFI file it will try to find it at build time. rekado: is there a way to appease compile-ffi that the library will be available at runtime? mwette: I think so ... rekado: I’m now using (list (or (getenv "GUILE_DRMAA_LIBRARY") "GUILE_DRMAA_LIBRARY unset")) rekado: it’s probably not a good idea, but it’s enough to continue hacking mwette: in the .scm, by hand change (define ffi-drmma-llibs ...) to (define ffi-drmma-llibs (delay (list ...))) and in the rest of the file replace ffi-drmmalllibs with (force ffi-glib-llibs) mwette: Maybe that should be the default behavior. roptat: jonsger, when compiling some of my own code roptat: loading the module in the repl and using that code is fine though, so I'm not sure what's wrong mwette: or maybe there is an eval-when solution mwette: rekado: can you try 'guild compile-ffi -X drmaa.ffi' That will not compile the generated .scm file. (Also, try 'guild compile-ffi -h') mwette: s/glib/drmaa/ rekado: mwette: thanks for the hints mwette: yw mwette: rekado: I've made the promise wrapper around dynamic-link the normal behavior now. It should appear in v1.03.1 (no release date planned yet) rekado: excellent! laertus: is there an r5rs equivalent of "format" (ie. a function that does string interpolation) ? laertus: or.. how does one do string interpolation in guile? leoprikler: laertus: you mean stuff like "Hello, {world}\n", where {world} takes a value, e.g. Earth? laertus: right leoprikler: my guess would be ice-9 regex leoprikler: (alternatively peg) laertus: wow.. that seems a bit low-level leoprikler: well it is leoprikler: there also is SRFI-48, but since guile has its own format, I guess you won't find that here leoprikler: if you already have string-typed variables, you can also use string-append laertus: yeah, string-append seems easiest laertus: but it's not really string interpolation per se leoprikler: hmm, let's see some more SRFIs laertus: is there a list somewhere of all ice-9 modules and what they do? leoprikler: Kawa seems to have SRFI-109, but that also has a lot of other baggage leoprikler: you can list directory trees with ice-9 ftw leoprikler: "what they do"… perhaps extract the commentary? dsmith: srv:send-reply dsmith: https://www.gnu.org/software/guile/manual/html_node/Transforming-SXML.html#index-SRV_003asend_002dreply dsmith: "Output the fragments to the current output port. dsmith: The fragments are a list of strings, characters, numbers, thunks, #f, #t – and other fragments. The function traverses the tree depth-first, writes out strings and characters, executes thunks, and ignores #f and '()." dsmith: That's kind of schemey interpolation dsmith: laertus: ^^ laertus: how would i actually use that? dsmith: laertus: Pass it lists and strings and thunks and stuff. Never used it but seems useful. dsmith: laertus: Also format in (ice-9 format) Pretty much the same as Common Lisp format. (it's like printf) laertus: ahh... there we go laertus: that's probably what i want laertus: thank you dsmith: Does *all* *kinds* of stuff. laertus: https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Formatted-Output.html dsmith: Roman nummerals! dsmith: Plurals! dsmith: Iteration! laertus: nice :) laertus: time to convert all my program's output to roman numerals... dsmith: laertus: https://srfi.schemers.org/srfi-13/mail-archive/msg00073.html About srv:send-reply laertus: thanks, but i think ice-9 format looks like more what i had in mind dsmith: Ya. It's for when you want to control spaceing, number of decimals, leading +, etc. dsmith: Different bases. laertus: i've been testing out using guile from gnu make... laertus: and when i do $(guile (load "foo.scm")) it works, but make spits out annoying messages about compilation laertus: like: "note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 or pass the --no-auto-compile argument to disable." laertus: well, i guess i can try "GUILE_AUTO_COMPILE=0 make" laertus: but say i do want to have guile do the compile, but just not tell me about it, in this particular case? laertus: anyway, "GUILE_AUTO_COMPILE=0 make" doesn't seem to work laertus: even when i don't modify my "foo.scm" file, make keeps warning me "note: source file foo.scm newer than compiled foo.scm.go" dsmith: Yeah, that's annoying. laertus: i must say that it's really nice to be able to use guile from make, though laertus: i've been bashing my head against its obtuse and convoluted syntax all day laertus: it'll be such a relief to use a sane language for a change apteryx: hello! how can I round a decimal number to the first digit, e.g.: 1.3234343 -> 1.3 ? apteryx: I need to use format? apteryx: this seems to do it: (format #f "~,1f" 1.32) -> 1.3 laertus: does guile have something like emacs' #' operator, which in emacs is used to prefix quoted functions, like #'foo ? leoprikler: guile does not have quoted functions laertus: ah leoprikler: but it does have #:keywords laertus: so how do you pass a function to map? leoprikler: by variable leoprikler: (map fn list) laertus: ok, so you just don't quote it laertus: in that case, still, i'd expect it'd be useful to differentiate between any old variable and one which contains a function laertus: which is what #' vs ' in elisp do leoprikler: guile doesn't have function slots leoprikler: you can check, whether something is a procedure using procedure? leoprikler: but i'd advice against making that into a reader syntax like e.g. #p(fun) laertus: i guess for me the use of something like #'foo would be more a visual hint for the human reading the source that the intent here is that this thing is a function laertus: kind of like using $foo for variables leoprikler: if that really is important to you, try (define (ensure-procedure x) (if (procedure? x) x (error ...))) leoprikler: of course you can make up your own conventions for procedure and variable names within your library leoprikler: but hungarian notation is typically not adored by many laertus: it's not full hungarian notation laertus: but, yeah, it's a matter of taste laertus: i've personally found it useful to instantly see the intent of the programmer with sigils like #'foo, $foo, or @foo leoprikler: yeah, but that can get cluttered leoprikler: what would you do e.g. if you found (($mapper) $proc $list)? laertus: there are always tradeoffs laertus: you could have "clean" looking code, with no indication of what type something is, but then it's more error-prone dsmith: laertus: Guile/Scheme is a lisp-1, emacs lisp (and common lisp) is a lisp-2. one namespace or two namespaces. dsmith: in a lisp-2, a binding has a variable slot and a function slot. You access them differently dsmith: In a lisp-1, it's just a variable. dsmith: In scheme you can do ((if flag + *) 3 4) is 7 or 12 depending on flag. dsmith: laertus: Guile *does* have a #' but it's used in macros. laertus: dsmith: thanks for clearing that up leoprikler: is there a way of programmatically setting the duplicate handlers of a module? leoprikler: i know, that (define-module ...) has some syntax around that, but I need to get to the nitty gritty of how that's implemented, because I can't define-module in that place leoprikler: nvm i'm stupid and fail at typing laertus: why does (simple-format #f "~S/~S" "foo" "bar") eval to "\"foo\"/\"bar\"" and not to "foo/bar" ? laertus: simpler test case: i expect (simple-format #f "~S" "foo") to "foo" but it instead evals to "\"foo\"" laertus: ice-9 format behaves pretty much the same way d4ryus: laertus: You are looking for ~a, which outputs its argument like display. ~S will output them like write, this is handy if you want to read them back. Also note that ~a will prevent you from distinguishing symbols from strings. laertus: because of this, it doesn't seem like either can be used for string interpolation like i wanted laertus: ah... ok d4ryus: e.g. (format #f "symbol: ~a string: ~a" 'test "test") => "symbol: test string: test" while ~S would return "symbol: test string: \"test\"". *: laertus nods laertus: thanks, makes sense laertus: another question: does guile have something like flatten? str1ngs: leoprikler: (default-duplicate-binding-handler '(merge-generics replace warn-override-core warn last)) assuming you are using this in a none module? also you may not need merge-generics if you do not use goops leoprikler: there are some flatten procedures (e.g. context-flatten from (ice-9 peg)) but afaik no "flatten" str1ngs: leoprikler: https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Creating-Guile-Modules.html has more does on default-duplicate-binding-handler. just kinda have to read the fine print laertus: what about some way to append one list on to the end of another? leoprikler: (append (list 'a 'b 'c) (list 'd 'e 'f)) laertus: thank you leoprikler: str1ngs: I prefer the direct setter, but I just typo'd myself str1ngs: leoprikler: I think that should work too. laertus: is there a way to join a list of strings in to one string delimited by a user-supplied delimiter? leoprikler: string-join laertus: thank you laertus: does guile have something like system* but which returns the stdout of the process back to guile? dsmith: laertus: ya. can't remember the name right now. is in the piping module laertus: ok, ok, thanks laertus: open-pipe, maybe dsmith: https://www.gnu.org/software/guile/manual/html_node/Pipes.html dsmith: open-input-pipe laertus: thank you laertus: does guile have a function like "nth", which evals to a certain element of a list? laertus: nevermind.. found it... (list-ref '(a b c d) 3) dsmith: https://www.gnu.org/software/guile/manual/html_node/List-Selection.html#index-list_002dref laertus: in a scheme-mode buffer, i typed (define abc 'def) and then eval'ed it in guile repl i have hooked up through geiser, then with point on "abc" i did: M-x geiser-edit-symbol-at-point and got these errors: "Geiser:cannot edit symbol at point" "Symbol error message:Couldn't find edit location for 'abc'" and "Module error message:Couldn't find edit location for '(define abc 'def)'" apteryx: could someone explain what the (= field pat) pattern form of an (ice-9 match) match works? apteryx: the doc says it matches "a ``field'' of an object". apteryx: in Guix, I see this pattern used as: (= string->number transferred) apteryx: where string->number is a procedure and transferred, a pattern that becomes a binding, apparently. apteryx: I guess it just binds transferred to the result of applying string->number to the item at that position, but that'd make the doc lie, no? dsmith: laertus: Did you eval the expression, like with C-x C-e ? laertus: dsmith: i used (geiser-eval-definition) laertus: but i was just reading https://nongnu.org/geiser/geiser_4.html where it said "M-. (geiser-edit-symbol-at-point) will open the file where the identifier around point is defined and land your point on its definition." laertus: but in my case there was no file associated with the scheme-mode buffer i was editing laertus: so i have a feeling the error i got was due to that dsmith: Yes. Geiser just passes the code to be eval'ed to the guile repl. Guile has no source file property for it. ane: apteryx: if you compile the file C-c C-k then Guile should understand the source location leoprikler: Is there a way of referring to the (- depth N) value of a fluid? leoprikler: I could probably (save-current-state) somewhere and restore it, now that I think of it mwette: Maybe fluids are not what you want ? Are you using with-dynamic-state or threads? leoprikler: Neither, really leoprikler: I'm kinda using them like boxes, but with a bit of manual set-current-dynamic-state leoprikler: I think I'll be using https://paste.gnome.org/pz0xffttn leoprikler: [context: Writing a game engine, want to load everything with variables in their initial state] leoprikler: hmm, that seems to do too much mwette: fluids provide thread-local bindings leoprikler: There is no other thread to care about, though, except maybe GC. leoprikler: also wouldn't that be thread-local fluids? mwette: Say you create a module-level binding (define x (make-fluid 1)). Then create two threads. In the first you eval (fluid-set! x 2), in the second you eval (fluid-set! x 3). x will be 2 in the first thread and 3 in the second thread: the assignments won't stomp on each other. dsmith-work: Happy Friday, Guilers!! civodul: happy Friday! dsmith-work: civodul: That reminds me. Got some emacs-wiki list spam the other day about guix. https://lists.nongnu.org/archive/html/emacs-wiki-discuss/2020-09/msg00000.html dsmith-work: Hasn't been a previsous message on that list since 2012! dsmith-work: No, I did not follow the provided link. civodul: yeah, Guix has been the target of spammer(s) recently :-/ dsmith-work: civodul: Know anything about this? Spam? civodul: and not just Guix apparently civodul: i know that i'm tired of it :-) *: dsmith-work sighs dsmith-work: Tis a real pain civodul: but yeah, the Guix list admins and IRC moderators know more civodul: it's literally taken hours of hacker time to deal with this over the last few weeks leoprikler: mwette: interesting leoprikler: still, fluids are perfectly fine for my purpose, since everything is single-threaded leoprikler: meaning I won't have the problem, that some variable gets stuck in a thread and can't escape leoprikler: perhaps thread-shared fluids would make sense for some language implementations (like elisp), but I doubt that civodul: leoprikler: fluids/parameters are per-thread leoprikler: Is this due to how fluids are implemented or due to how threads are implemented? leoprikler: I suppose somewhere in the thread startup routine with-dynamic-state is called, is that right? mwette: leoprikler: check out pthread_key_create on the interwebs leoprikler: so fluids are fancy wrappers around a pthread_key_t? leoprikler: brb. file-roller `guix build guile -S` str1ngs: why not just tar xf $(guix build guile -S) :P leoprikler: because tar xf unpacks everything when I really just want to get to fluids.h and fluids.c str1ngs: gotcha so you use file-roller to cherry pick the files? leoprikler: yep leoprikler: okay, it seems each thread has its own dynamic-state and fluid-ref accesses that of the current thread leoprikler: IOW to implement thread-shared fluids you'd only need a thread-shared dynamic state str1ngs: file-roller is probably still better for this if the tarball is unknown. a hack to do this with tar would be something like. tar --wildcards -x "*/libguile/fluids*" -f $(guix build guile -S) leoprikler: except that file-roller cleans up after me and everything leoprikler: okay, so I've learned, that while fluids aren't exactly pthread_key_ts, they are indeed not more than lookup keys to a dynamic-state structure leoprikler: [which is probably similar to how pthread_key_t operates leoprikler: ] str1ngs: leoprikler: gotcha, I'll may try this workflow myself. I have a tendency to use a terminal too much. RhodiumToad: "thread-shared dynamic state" seems to be rather a contradiction civodul: in bytestructures, what's the way to ask the offset of a field in a descriptor? leoprikler: RhodiumToad: it probably sounds less exciting if I just call it "nested hash table" RhodiumToad: you just want a hash table shared between threads? that's possible but requires using a mutex leoprikler: it would require a mutex if I had threading leoprikler: but nah, what I actually mean is something like (( . ) ( . ) ...), which may or may not require a[n array of] mutex[es] if I were to actually use it leoprikler: or even just (list ...) leoprikler: maybe (( . ) ...) leoprikler: But again, no threads so I can use fluids just fine. leoprikler: And if I ever need threads, I'll have my nested hashtables and call 'em... solids cjv: Is there an alterative to creating a binding to TIOCGWINSZ for getting the width and height of the terminal? leoprikler: maybe there are guile bindings to ncurses? leoprikler: `guix search guile-ncurses` says yes leoprikler: Procedure: cols leoprikler: Procedure: lines leoprikler: These procedures, if called after initscr has been called, will return the size of the screen at the time initscr was called. cjv: yeah, I was trying to avoid using ncurses, but that would definitely be the easiest leoprikler: if not, you should probably adhere to the "COLUMNS" environment variable leoprikler: scheme@(guile-user)> (getenv "COLUMNS") leoprikler: $1 = "196" leoprikler: scheme@(guile-user)> (getenv "COLUMNS") leoprikler: $2 = "194" leoprikler: same for LINES leoprikler: heh cjv: COLUMNS and LINES are as shell variables, they aren't exported by default cjv: (it will only work in the REPL) cjv: that's the first thing I tried :P leoprikler: you're right leoprikler: hmm cjv: I tried to figure out how guile's repl grabs them cjv: but I didn't find anything leoprikler: okay, it's time to tar xf `guix build guile -S` leoprikler: there is (@ (system repl debug) terminal-width) cjv: thanks for taking a look cjv: seems like that's the closest we can get to a native solution mwette: civodul: look at bytestructure-unwrap* - I think that might help dsmith-work: Rows and Cols? Beware of SIGWINCH nckx: dsmith-work: Is sneek all right? dsmith-work: Aww dsmith-work: sneek! Where are you! dsmith-work: I'll try to revive the little guy once I get home. nckx: I didn't expect so many random people to ask in #guix the past few days, but (s)he is missed. Yay! dsmith-work: nckx: When did the bot leave? nckx: I can look that up. Sec. dsmith-work: (I don't have leave/joins in my chat buffer) nckx: [2020-09-30 04:46:39] *** Quits: sneek (~user@95.181.110.196) (Client Quit) dsmith-work: Had a brief power glitch the other day. dsmith-work: That was probably it. brettgilio: !seen #guile sneek brettgilio: lol that didnt work nckx: sneek: seen sneek? nckx: Hmph. nckx: Unrelated: is it possible to get sneek to drop messages I know I have waiting, either to /dev/null or (say) a private query buffer? brettgilio: ;;seen sneek nckx: Say it might be nasty stuff that needn't be repeated. dsmith-work: nckx: Maybe if you /query it. dsmith-work: But I don't think so. nckx: I'll try but I doubt it to. nckx: )o nckx: Or invite them into a temporary ##sneek-insults channel? Does sneek accept them? dsmith-work: It really ought to replay the message in the #chan where it was sent. nckx: Oh, I thought that was a feature. dsmith-work: nckx: No. It's only in #guile and #guix nckx: At least betwixt #guix & #guile. nckx: OK. dsmith-work: *ought* to. Not sure if I got that working. dsmith-work: Or rather, even looked at it. dsmith-work: I'm off all next week (furlough!) so maybe I can put in some bot work. dsmith-work: Probably not though. str1ngs: dsmith-work: hello, sneek has been on holidays for some days. would it be okay to ping you when that happens in the future? nckx: Well, these botsnacks are starting to smell, so I look forward to sneek's return. Thanks! nckx: sneek: smelly botsnack xxx dsmith-work: str1ngs: Absolutely! nckx: str1ngs: I just did above 😛 Poor dsmith is going to be inundated next time. nckx: By the way: I probably asked this before, but sneek is privately owned & operated, right? No viewsource & pullhub? dsmith-work: Right dsmith-work: Maybe I'll get to that too. dsmith-work: nckx: It's mostly the old sarahbot that was on #scheme long ago ported to Guile and bobot++ *: nckx not cool enough to remember ‘#scheme long ago’. dsmith-work: It was part of some scheme on top of java dsmith-work: sisc civodul: prehistory! ;-) dsmith-work: http://community.schemewiki.org/?sarahbot nckx: Heh, yep, at least that help message is familiar. Thanks for the background. nckx: (Did sneek support the .repl? If so, sneek, I hardly knew ye.) dsmith-work: No. I did have an eval enabled for a bit, but just for my nick. dsmith-work: Guile didn't have the sandboxing then that it does now. dsmith-work: Just too scary nckx: I was expecting that answer, but it was too cool not to try. nckx: sneek: Zomg! sneek: Welcome back nckx, you have 2 messages! sneek: nckx, raghavgururajan says: The system freeze I was telling you about, it happens like this https://disroot.org/upload/mG8Id0mqHB9ubZLc/2.mp4 sneek: nckx, GooGooKnox says: Hey honey! I am going for vacation. Take care my sweet-heart! dsmith-work: sneek: botsnack sneek: :) dsmith-work: goodbot! nckx: Oh neat. sneek was already gone when the worst happened. nckx: sneek: missed ya. dsmith-work: I had my wonderful wife brave the dark and mysterious basement, fraught with scary electronic things, a powercyle the bot's box. nckx: For a brief moment I wondered ‘...wait why send your wife that's horrible’ but then I remembered to read your nick. dsmith-work: heh nckx: Thank her, and I'll let you get back to actual work now. dsmith-work: bah. I'm in short-timer mode anyway. Off all next week. dsmith-work: str1ngs: And bot down pingage is best applied to dsmith. str1ngs: dsmith-work: thank you, we do miss the little guy :) *: sneek blushes rekado: with the nyacc built with Guile 3 (instead of 2.2) I see this error when doing “guild compile-ffi ffi/drmaa.ffi”: “failed to create path for auto-compiled file "ffi/drmaa.scm"” rekado: I see the same with “guild compile ffi/drmaa.scm” mwette: rekado: is the path ffi/drmaa.scm consistent with the module name (ffi drmaa) ? mwette: and I can't find that error message source rekado: yes. It works with the older nyacc from Guix that was built with 2.2. rekado: but the problem here appears to be with Guile’s “guild compile” rekado: not with nyacc rekado: I’ll investigate tomorrow mwette: OK. Good. mwette: rekado: yqw stis: Hej guilers! laertus: are there any guile packages for writing MIDI files? jonsger: laertus: lilypond supports converting to MIDI files, so maybe you can use stuff from them... laertus: thanks jonsger: laertus: what are you wanna do? laertus: jonsger: i'm starting a project to do some algorithmic composition using l-systems, genetic algorithms, and fractals... the result is to be written to midi files which i intend to import in to a DAW and then proceed to manually assign to synths/instruments, add effects, and whatnot... jonsger: oh nice :) laertus: i haven't completely decided on a language, but if i could use any language at all it would be a scheme, as the scheme family is my favorite laertus: but i don't want to write low-level stuff from scratch myself... would much rather use existing libraries laertus: so might be reluctantly dragged in to using a non-scheme/non-lisp language laertus: if they have the library support i need laertus: and if no scheme does laertus: also, as i'm going to be using genetic algorithms, performance might be important spk121: laertus: I once wrote a Guile program to read midi files rekado: MIDI is *very* simple and using an existing non-Scheme library may be overkill rekado: dependent on whether you want to generate arbitrary pitches (in cents) you would need to translate from your generated sequence to something that MIDI can handle (base note + pitch bend offset) anyway laertus: spk121: what happened to it? also, did you ever write one to write midi files? spk121: laertus: found it. It is here https://github.com/spk121/furry-nemesis laertus: nice name spk121: it converts midi into wave spk121: I never tried to write a midi file, so I guess I can't help you there. dsmith-work: UGT Greetings, Guilers laertus: are there any guile-aware emacs major modes? laertus: or is scheme-mode about the best i'm going to get? laertus: nevermind... just found geiser davexunit: geiser is great. enjoy it. :) laertus: thanks dsmith-work: laertus: And to make it even better, also use paredit laertus: ah laertus: i've never actually used paredit.. and not completely sold on it yet dsmith-work: I avoided it for a long while. But it really is great once you get used to it. laertus: because when i develop i often deliberately keep my parenthesis open to mark where i'm editing, so that i can remember where i was if i switch away to something and back laertus: then, if i try to eval the function i'm working on, it'll fail, and be pretty clear where and why dsmith-work: Only bad thing is I have some old muscle memory that do weird things in paredit. So I undo a lot.. laertus: also, i'm an evil user... not sure how well paredit works with evil dsmith-work: Well, that's your problem right there! ;^} laertus: heh dsmith-work: Yeah, not sure. laertus: i've heard of some paredit-like packages for evil users laertus: not sure if geiser is flexible enough to use one of those instead of paredit proper laertus: or, i'd be perfectly happy without paredit-like editing right now, as i'm not sure if i'm ready to change my whole editing style just to use geiser dsmith-work: Don't need to use paredit with geiser. jlicht: laertus: I use lispy+lispyville with evil, it works fine most of the time laertus: great luis-felipe: One thing I noticed in the documentation for pre-post-order is that it doesn't say in which module it is defined, which is "(sxml transform)". stis: hey guilers! dsmith: stis: Heya stis. How goes the Python? stis: I fix bugs daily. Improving a lot I would say. ft: This is for running python programs on guile? Or to use python modules? Both? stis: you can do both ft: Cool! ft: Not the biggest python fan, but some of their batteries are rather good. :) stis: yeah, i can compile most of the library modules, but remains to get them functional stis: also great interoperability between python and guile modules stis: there is a macro package so that you can access classes etx from guile scheme stis: and a looping macro so that you can loop with python's generators ft: Sounds fun. I might give it a try, next time I'm jealous of matplotlib. ;) stis: it's python3 ft: Shouldn't about everything these days be python3? stis: yeah it should ft: Hehe chrislck: guile needs an (import 'anigravity) chrislck: guile needs an (import 'antigravity) apteryx: hello Guilers! I was thinking; is it possible to pass from one language (say, Elisp) to another (say, Scheme) as part of the same execution? apteryx: I'd like to read some Elisp "data" and use it in a Scheme program. RhodiumToad: apteryx: data is data ArneBab_: RhodiumToad: I just tried with ,L elisp (setq foo (+ 1 1)) ,L scheme (display foo) ;; Undbound variable: foo ArneBab_: RhodiumToad: am I missing something? ArneBab_: I know that I can import procedures from other languages after they have been compiled (that’s what I routinely do in wisp), but I don’t know how to pass them in the running REPL. RhodiumToad: I'm guessing other languages store their globals somewhere other than the usual scheme module RhodiumToad: this works: (define get-foo (compile '(lambda () foo) #:from 'elisp)) ,L elisp (setq foo 123) ,L scheme (get-foo) RhodiumToad: elisp global variables are actually fluids, but I don't know where they are kept RhodiumToad: more generically you can do (define get-elisp-var (compile '(lambda (sym) (symbol-value sym)) #:from 'elisp)) leoprikler: you could also use (symbol-value 'sym) from (language elisp runtime) lloda: why do assq and assq-ref take their arguments in different orders lloda: smh mwette: lloda: my only guess is this: assq is RnRS; assq-ref is not, it is Guile-custom(?); whoever designed the guile routines decided that order made more sense. mwette: in the example nyacc languages I use the user module for variables; see https://paste.debian.net/1165267/ apteryx: RhodiumToad, ArneBab, leoprikler re elisp -> scheme; thanks for the enlightening answers! dsmith-work: Wednesday Greetings, Guilers str1ngs: hello dsmith-work. cloveistaken: How can I process time in Guile ? cloveistaken: For example getting current time or converting between time format ? cloveistaken: Oh I found it, SRFI19 dsmith-work: cloveistaken: Did you see my response about call-with-input-file and with-input-from-file ? cloveistaken: Shit I missed it cloveistaken: Ah I see cloveistaken: They are quite different indeed cloveistaken: So if I call with-input-from-file, I can't get user input from original stdin anymore right ? dsmith-work: Right. And by "stdin" I mean (current-input-port) dsmith-work: s/mean/meant/ cloveistaken: $s/mean/meant/ is better cloveistaken: I'm having some weird bugs with srfi-19 in guile-2.2 cloveistaken: I'm not sure should I just go full one bleeding edge or fix the bug myself cloveistaken: The source i mean leoprikler: w.r.t. input-port: you can save the current input port in some other variable, but what would be the point in doing that? dsmith-work: Of course, current-input-port is back safe and unharmed after with-input-from-file returns rekado: mwette: the FFI helper is amazing! rekado: I realized that I always wanted to have Guile bindings for DRMAA and the FFI helper gets me very close to that goal ArneBab_: RhodiumToad: ok — thank you! ArneBab_: RhodiumToad: https://www.draketo.de/software/guile-snippets.html#org7973ba7 str1ngs: Hello, how do I copy a ? leoprikler: you mean a ? str1ngs: leoprikler: my bad I meant though I don't need it any more I can parent a emacsy from the constructor. RhodiumToad: maybe something like (alist->hash-table (hash-map->list cons myhash)) str1ngs: RhodiumToad: I think that would work if I need to copy a at some point. RhodiumToad: or (let ((newhash (make-hash-table))) (hash-for-each (cut hash-set! newhash <> <>) oldhash) newhash) RhodiumToad: (replace hash- with hashq- or hashv- as applicable) str1ngs: gotcha thanks RhodiumToad str1ngs: also why do I have such a hard time groking cut? is that just me and years of procedural programming? RhodiumToad: mutation loop is kind of ick, but the alist way is a lot of consing... str1ngs: yeah, actually this mutation issue stems even farther into how (emacsy minibuffer) is designed. I might need to redisgn it sligtly. for example the minibuffer is global binding and it's hard codeed in many places. I'm thinking of making it a fluid or a parameter cloveistaken: Small question, how do I install gnutls on Debian stable ? cloveistaken: I have this error message: Throw to key `gnutls-not-available' with args `("(gnutls) module not available")'. cloveistaken: I downloaded guile-2.2 from repo, not compiled from source leoprikler: there seems to be a guile-gnutls in bullseye and sid, but not buster str1ngs: I normally just build gnults to /usr/local with guile support cloveistaken: I'll try to compile from source later then cloveistaken: The link in the official docs is dead cloveistaken: Btw speaking about that cloveistaken: What is the different between guile 2 and guile 3 cloveistaken: Big differences I mean RhodiumToad: guile 3 has a JIT RhodiumToad: (but the version that fixes nasty bugs in the 32-bit arm support is not released yet) RhodiumToad: guile 3 unifies a bunch of record and exception types that are annoyingly distinct in guile 2 RhodiumToad: not sure what other changes would be considered "big" cloveistaken: JIT seems like a huge deal cloveistaken: guile seems to have new versions like every 3 months or somemthing cloveistaken: Is it considered ready for production yet or not ? cloveistaken: Compare to Racket for example erkin: Hmm erkin: `dynamic-link' seems to ignore symlinks. erkin: On my machine, `libc.so` does not exist and `libc.so.6` is a symlink to `libc-2.30.so`. I can (dynamic-link "libc-2.30") but I would prefer not to tie my code to a specific glibc version. RhodiumToad: why would you try and link something that's already loaded? erkin: Well, it doesn't work for anything else either. leoprikler: cloveistaken: guile-3 is stable enough for Guix, but you'll have to live with the awkward 3.0.2 vs. 3.0.4 API difference leoprikler: erkin: does (dynamic-link "/full/path/to/lib") work for you? leoprikler: if so, then just make "/full/path/to/lib") something that you get from your build-system through parameter or pkg-config erkin: Nope leoprikler: so /path/to/libc.so.6 fails? erkin: Yeah erkin: /usr/lib/libc.so.6 RhodiumToad: the theory of .so filenames is that libfoo.so.4 represents an ABI version, so libfoo.so.3 or libfoo.so.5 might not be compatible with it erkin: "libc-2.30.so" works both relatively and absolutely. erkin: I wouldn't mind linking to .so.6 but fixing to glibc v2.30 is a bit overkill. leoprikler: Hmm, mine seems to resolve symlinks fine leoprikler: scheme@(guile-user)> (dynamic-link "/run/current-system/profile/lib/libunistring.so") leoprikler: $1 = # erkin: This is Guile v2.2 by the way. erkin: I should've specified it earlier. leoprikler: okay, trying guile-2.2 erkin: v2.0 has the same behaviour erkin: On Fedora 31 erkin: Hmm RhodiumToad: dynamic-link just calls libtool's lt_dlopen leoprikler: could you make another symlink to libc-2.30 in your current directory or /tmp (call it "libd.so") and try to dynamic-link that? erkin: Yeah erkin: Nope. erkin: Should I add cwd to LD_LOAD_PATH? leoprikler: either that or full path again ;) erkin: It works with full path now. erkin: Strange. erkin: Hmm erkin: Oh erkin: Symlinking to test.so works but test.so.6 doesn't. leoprikler: seems guile hates suffixes erkin: The suffix throws it off even with non-symlinked libraries. RhodiumToad: what part of "just calls libtool's lt_dlopen" wasn't clear? leoprikler: does lt_dlopen hate those too? erkin: I would be surprised, because `ldd' shows clear links to /usr/lib/libc.so.6 RhodiumToad: so what libtool is doing is this erkin: I whipped together some C code. erkin: And `dlopen' works with `libc.so.6' RhodiumToad: when you lt_dlopen some filename, it checks whether it already ends with the system's shared lib extension RhodiumToad: (i.e. ".so" in this case) cloveistaken: leoprikler: where can i see the 3.0.2 vs 3.0.4 api thingy erkin: Hm RhodiumToad: if so, it just dlopen's that RhodiumToad: otherwise, it tries sticking .so on the end erkin: I wish Guile documentation mentioned that. RhodiumToad: dlopen on the other hand will try the exact filename first, regardless. erkin: The example at the bottom just opens "libc.so" so I assumed I could do the same: https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Low-level-dynamic-linking.html RhodiumToad: so basically dynamic-link won't work on file names that don't end in the system's shared lib extension erkin: I see. RhodiumToad: opening libc.so will work if a file (or symlink) of that name exists on the system erkin: Hmm erkin: It might be too intrusive to ask the user to make a /usr/lib/libc.so symlink. RhodiumToad: for the specific case of libc, you can just assume it's already linked in, though? RhodiumToad: and its symbols will be visible via (dynamic-link) with no filename erkin: That's true. erkin: oh what erkin: I made a symlink from /usr/lib/libc.so.6 to /usr/lib/libc.so erkin: And (dynamic-link "libc.so") fails. erkin: So do (dynamic-link "libc") and (dynamic-link "/usr/lib/libc.so"). RhodiumToad: huh RhodiumToad: hm. RhodiumToad: it fails for me too but for a completely different reason I think. erkin: I considered /usr/lib64 but that also has libc.so.6 and libc.so str1ngs: for libraries that are already linked to guile you don't need to pass a file argument. IIRC str1ngs: for example say you want the printf function something like (dynamic-func "printf" (dynamic-link)) should work. str1ngs: erkin: ^ cloveistaken: I was wondering cloveistaken: What is the different between with-input-from-file and call-input-from-file cloveistaken: I checked the doc and they look very similar to me luis-felipe: Hi, what's this notation called? https://www.gnu.org/software/guile/manual/html_node/Transforming-SXML.html#Transforming-SXML luis-felipe: The notation to describe what kind of arguments the procedure takes, for example. rekado: some of the SXML documentation has Haskell-like type annotations rekado: the stuff after “where” is a grammar luis-felipe: rekado: Thanks. dsmith-work: cloveistaken: One takes a thunk, the other a procedure of one argument. dsmith-work: cloveistaken: call-with-input-file passes the port to the proc dsmith-work: cloveistaken: with-input-from-file changes stdin to the file luis-felipe: The notation after the "where" seems like BNF notation (Backus–Naur form or Backus normal form)... dsmith-work: luis-felipe: Yes, I believe so. daviid: str1ngs: I fixed the method specializers bug, but as you know, I don't wana push untill I complete the GInterface work ... so 'in the mean time', here is paste with a git format-patch [devel branch] - https://paste.debian.net/1164940/ str1ngs: daviid: thank you, just to clarify this relates to the append-page method when passing #f? rekado: will the FFI helper also work for C++ code? rekado: I will need Guile bindings for https://github.com/zeroc-ice/ice ArneBab_: (define-syntax-rule (log-variable var) (format #t "~a: ~A\n" (quote var) var)) — just a useful shard of ice I just found :-) daviid: str1ngs: yes, that's the one iv-so: I have a problem with cross-compiling iv-so: does it make sense to ask about it here? str1ngs: daviid: great glad that's fixed. I can wait for that change with the GInterface work. also I found another issue but I believe GValue is not supported in the context of signal arguments yet? civodul: rekado: i guess nyacc has a full-blown C parser, which is already quite an achievement, but not a C++ parser :-) daviid: str1ngs: GValue generally need an override - but it dpends ... and so far, I only have overriden functions, afaict, no signals yet but ... I need a snipset/example/bug rep, what ever called ... spcially because i don't use and know webkit ... str1ngs: daviid: it's not related to webkit. its GSimpleAction 'activae single the signal signature is user_function (GSimpleAction *simple, GVariant *parameter, gpointer user_data) daviid: str1ngs: wrt webkit_web_view_get_tls_info, the last two args are 'out args, so you shouln't even pass them, therefore no initialization is required str1ngs: get-tls-info flat out seg faults str1ngs: also it takes one argument so I assumed g-golf creates the out arguments internally. str1ngs: I shouldn't assume but I tend to treat g-golf as a black box. since emacsy and nomad take up alot of time. daviid: str1ngs: yes, ok, i said this because you refered to initalization in the comment you made ... i need a code snipset to invstigate daviid: str1ngs: g-golf create the 'space for 'our ags' , so to speak ,... daviid: as other lang binding of course ... daviid: as for GSimpleAction ... again, a need a code snipset ... str1ngs: well I mean in the cause of get-tls-info it takes one argument then which would be a view. so create a view browse to a SSL site and that call the get-tls-info method with the view. that should produce a segfault daviid: i need a code snispt, sorry daviid: i don't use and don't know webkit str1ngs: I don't have a problem making snippets I have a problem when they get bike shed. so I mean that has to stop str1ngs: I can't waste time on snippets just to report a bug. and the discuss the merits of each snippet. daviid: i need a snipset based on the template i pasted, whe it is possible - no gtk-appk, no g-app-run ... str1ngs: well that's bike shedding and I don't have time for that sorry. str1ngs: also you have biased opinion of GtkApplication and I don't have time for that either. it's hard to conform got GTK best practices one minute. and then have someone tell you not to the next minute. daviid: unless you report a bug relatd to gtk-app/g-app-run, please use the template daviid: to much drama for nothing here rekado: ArneBab_: ever since I learned about it I always use (pk …) civodul: we could have testimonials at gnu.org/s/guile about pk rekado: civodul: I only know that writing bindings for C++ libraries is tricky; something about name mangling, perhaps? Will writing an extension still work for C++ things? Or is the answer that it depends…? str1ngs: daviid: the drama is produced by you. any valid snippet that produces the bug is valid. what you are asking for is snippets that conform to your debugging practices which have nothing to do with demonstrating the bug. This is unreasonable we spent 3 hours working on something and you had remove the relevant code that produced the bug because you are more concerned with how the snippet is layed out. no offense I don't have time for str1ngs: that. str1ngs: so my bug report is get-tls-info segfaults period in and snippet you want to use. no need for a snippet or drame. daviid: I need a code sniset, please use the template I provided to you (and any other g-golf users), thanks str1ngs: what snippet is require it segfaults when use. I don't even have to report this. I already have a fix in C. I'm letting you know for the betterment of g-golf and anyone else that wants to use g-golf. daviid: drama, drama .... pleas write and past a code snipset, using the template i rovidd, thanks daviid: going away from the kb, bbl str1ngs: you are deflecting. the drama is about snippets. and not actually fixing bugs. so no I don't need to create more snippets that you are not satisfied with despite them generating the bug being reported. it's not a good use of my time sorry. civodul: rekado: i guess you'd have to write those bindings in C++, using the libguile API civodul: or you could try to implement name mangling in Scheme and use the FFI, but that's risky and doesn't address issues like C++ exceptions wingo: what c++ project actually uses exceptions? :) civodul: heh, dunno, are exceptions no longer in fashion in C++? str1ngs: fashion always has exceptions :P lloda: my main use of C++ exceptions is to catch them in Guile, curiously wingo: dunno, i have been doing c++ since 2008, and no project i have worked on besides gdb uses exceptions dsmith: Now Python, on the other hand, is quite exceptional! wleslie: "don't use exceptions" sounds like good C++ wisdom, until you realise there's no other way to indicate error within a constructor mwette: The ffi helper does not work on C++. Maybe try swig. I'm guessing writing a parser for C++ is not easy. mwette: di ArneBab_: rekado: (begin (define foo 'fom)(pk foo)) gives ;;; (fom), but I want both foo and fom ArneBab_: rekado: the use-case is minimal print debugging: I just wont to see the variables with their values. dsmith-work: Monday Greetings, Guilers ArneBab_: rekado: (log-variable (list foo bar baz)) RhodiumToad: should be easy to make it work for (log-variable foo bar baz) dsmith-work: So is that supposed to be logging a "variable" or an "expression" ? *: dsmith-work likes the idea of logging an expression better.. RhodiumToad: I think it actually logs expressions just fine dsmith-work: Right. Just looking at the name: "log-variable". It's actually better than that. RhodiumToad: (define-syntax-rule (log-exprs exp ...) (begin (format #t "~a: ~A\n" (quote exp) exp) ...)) ArneBab_: RhodiumToad: that looks nice! Thank you! ArneBab_: (define-syntax-rule (log-exprs exp ...) (begin (format #t "~a: ~S\n" (quote exp) exp) ...)) ArneBab_: RhodiumToad: slight improvement: Use write for printing the argument instead of using display ArneBab_: (log-exprs foo bar (list "hello")) ArneBab_: foo: bar ArneBab_: bar: baz ArneBab_: (list hello): ("hello") ArneBab_: RhodiumToad: is it ok if I put that on my website? How can I acknowledge you? ArneBab_: RhodiumToad: do you have a website to which I can link? RhodiumToad: by all means put it on your website, no need to acknowledge me for something that small dsmith-work: "format" seems to have inherited ~% from lisp (CL?). I can imagine back in the '60s that starting a new line on an output device could be complicatd and differ greatly between systems. Most stuff today understands "\n" to mean newline. dsmith-work: Any real advantage in using "~%" ? spk121: dsmith-work: no real advantage on linux machines to using ~% RhodiumToad: gmake[3]: *** [Makefile:2279: language/brainfuck/compile-tree-il.go] Segmentation fault (core dumped) dsmith-work: Only thing I can think of is you can do ~10% for 10 newlines dsmith-work: Just wondering if there was something obvious I was missing. dsmith-work: RhodiumToad: Ouch. On a bsd? (the "gmake" indicates it) RhodiumToad: yeah, but it's a cross-build so it might be a qemu-user-static bug liltechdude: Hello liltechdude: What the best method to obtain web page body in guile? liltechdude: I`m try (use-modules (web client))(http-get "https://2ch.hk/pr/res/1800721.json") liltechdude: but this doesn`t work rekado: ArneBab_: I always just do (pk 'whatever-i-want the-variable); that shows me not the “the-variable” and its name, but “whatever-i-want”, which sometimes is more instructive than just the name. rekado: I also keep adding intermediate values to the pk expression rekado: as long as it ends on the right thing it doesn’t alter the behaviour ArneBab_: dsmith: maybe output on a mac or windows? ArneBab_: rekado: I sometimes did (pretty-print (cons 'name variable)) ArneBab_: rekado: but the extra word was overhead for something I don’t usually need (since I often already know where I’m logging from) rekado: just tried to use https://gitlab.com/joolean/r6rs-protobuf to generate code from Mumble’s RPC protobuf declarations, but then (while looking through bug reports) found https://gitlab.com/weinholt/mummel rekado: no audio support, though *: rekado sees a herd of yaks, eyes scissors str1ngs: a *hurd* of yaks... get it! :P *: dsmith-work hands rekado an electric-yak-scissors, bound to C-x Y S rlb: Is stable-2.2 a "spur" branch now, or is the intent to merge it up to 3.0 now and then? rlb: In the THANKS, what's the full distinction between the first and last sections? i.e. trying to figure out what contributions go in which section. iv-so: hello, I have troubles with guile3.0 cross-compilation (host: x86_64, targets: aarch64, armv7l; host: x86_64-musl, targets: aarch64-musl, armv6l-musl) iv-so: builds are failing at langauges/elisp/boot.el, I found two mentions of the same error in GNU debuggs, but no sign of solution iv-so: here are the build logs https://travis-ci.org/github/sirikid/void-packages/builds/730638985 stis: Hej guilers! mwette: Hey stis, and all other lambda-heads! roptat: hi! I'm trying to use guile git roptat: I have a commit object, and when I try (commit-author commit), I get a signature object, but I have no idea how to get the name of the author roptat: ha, signature-name dsmith: iv-so: Interesting. Trying to open file #f manumanumanu: Hej stis ! manumanumanu: and everyone else of course! rlb: civodul: did you happen to see my questions yesterday? i.e. is stable-2.2 merged up to 3.0, or is it a "spur" branch now? And "In the THANKS, what's the full distinction between the first and last sections? i.e. trying to figure out what contributions go in which section." manumanumanu: I just got bitten by the unhygienicness of procedural macros: I had no idea that bindings introduced within the scope of a syntax-case macro can collide. If I insert #'temp into a macro, and then another #'temp later on, but still within the same expansion, they can collide :( manumanumanu: srfi-72 maybe isn't a bad idea civodul: rlb: i hadn't seen your questions, sorry civodul: stable-2.2 hasn't changed much if at all since 2.2.7, but we could consider cherry-pick some changes from "master" and releasing 2.2.8 civodul: as for THANKS, i think the headings are quite clear, but i wonder if it makes sense to keep it like this civodul: we tend to credit people (for bug reports, etc.) directly in commit messages civodul: or as commit authors rlb: Oh, the context was just wondering whether if I have some (small/appropriate) changes to apply that could go in both, what's the criteria/process, i.e. should I cherry pick to both, add it to 2.2 and then merge up, etc. civodul: oh i see civodul: well, it's not well defined i guess :-) rlb: say that trivial doc change, or... civodul: i'd start by cherry-picking things that landed in master after 2.2.7 was released civodul: there may be a few interesting commits rlb: I could leave the doc change off of 2.2, and I might, but just wanted to make sure I knew whether 2.2. was still intended to be merged up, or if it was already considered a "spur" branch, etc. rlb: And wrt THANKS, I was mostly just trying to figure out if the last section was "all authors ever", or if the first section was for people who actually contributed code, and the last section was for things like bug reports, etc. rlb: s/authors/contributors/ rlb: In this simple case, it was the commit sent to restore a single comment line that was accidentally dropped in the past. Do they go in the first section or the last section... rlb: (a comment line in guile.c, fwiw) civodul: yeah, stable-2.2 is not merged to master because nothing happens there :-) rlb: OK, just wanted to make sure I knew what the intentions were -- sounds like it's intended to be a spur branch for now. civodul: i'm actually unsure what "spur" means in this context, but i'd say it's a dormant/stale branch rlb: I mean a branch that's not merged up (sorry, railroad terminology I think). rlb: https://en.wikipedia.org/wiki/Branch_line rlb: i.e. it doesn't connect back to anything else. rlb: And so wrt THANKS is the "rule" that any commit author goes in the first section, and everything else (other than libs) goes in the last section? (And is the last section, "since the last release" or covers the whole project history (in which case I guess the first section merges into the last eventually)? civodul: ah i see, thanks :-) civodul: so yes, it's a spur branch rlb: The fact that the last section didn't say "since the last release" explicitly is one thing that made me wonder. civodul: rlb: i'd say do as you see fit for now, and let's discuss with wingo about deprecating it altogether civodul: make sure to credit people (bug reporters in particular) in commit logs civodul: so that we can then maybe have THANKS point people to the Git history civodul: (or the generated ChangeLog) rlb: Oh, I'm putting it in the commit messages too (always try to do that), but just wanted to make sure I followed HACKING's request to update THANKS correctly as well. rlb: i.e. I was assuming that my commit should *also* update THANKS (thought that is a potential source of merge conflicts). Was that not right, i.e. should I just put the info in the commit message? rlb: s/thought/though/ civodul: rlb: i think it's right to do that, but i think we should consider changing the rule going forward :-) rlb: OK, so I'll assume the first section is for any commit authors, the last is for anything else, and I'll let y'all worry about the rest of what the last section means :) rlb: Thanks. rlb: (at release time) manumanumanu: psyntax.scm :'( spk121: Gtk is a aggravating toolkit. I had the Stockholm syndrome, but, after months away from coding and looking at it anew, ugh. :-) civodul: spk121: :-) rekado: extending Guile is fun! rekado: this mumble thing seems to work fine rekado: I do need to keep updating the avatar location, even if it hasn’t changed, because if it’s not updating anything my “game” is kicked out of mumble rekado: but that’s okay rekado: I’m not a fan of delegating setup of mumble to users; perhaps there’s a config file I can generate to take over some of that work. rekado: some of the work will need to be done by an extension of the murmur server, e.g. to enforce muting in certain locations rekado: it’s a bit annoying that none of this can be extended with Guile… rekado: yet civodul: rekado: we'll have to hold an on-line event to test drive whatever you come up with! mwette: manumanumanu: I was bitten by the syntax hygene issue also. I wonder if somehow gensyms could be module-unique during compile and then relocated (in the elf sense) during load. leoprikler: so you need a game interface for mumble? iv-so: i think log search is misconfigured iv-so: > Resource not found: http://127.0.0.1:3333/guile/search stis: tja guilers! rekado: leoprikler: yes, I’ll just need to write a minimal game and call some C code to update the positional data for mumble. rekado: log search has a tiny bug: it keeps adding the channel name to the URL, so it becomes /guile/guile/search instead of /guile/search rekado: should be easy to fix roptat: mh... I have a variable, say (define val 0), then I try something like this: (case 0 ((val) #t)) but I get # instead of #t roptat: I understand it compares with the symbol, but how can I make it compare with the value of the variable? dsmith-work: roptat: Probably better off using cond justin_smith: case needs to build a dispatch table and only uses compile time literals - (case 'val ((val) #t)) -> #t dsmith-work: https://www.gnu.org/software/guile/manual/html_node/Conditionals.html#index-case-1 dsmith-work: It expect one or more "datum"s dsmith-work: Effectively, a literal constant. roptat: thanks dsmith-work: Pretty much like a case in a C switch statement. If you are familiar with C. (Seems like most people are not these days...) justin_smith: in some implementations case compiles directly to a hash table lookup (it works the same way in clojure, and there they construct a hash table from the matching values to the byte code to run) dsmith-work: And in Guile, wingo recently added table lookups. In git, not yet released. (Woo!) justin_smith: fun leoprikler: roptat: out of interest, what were you trying to achieve here? leoprikler: comparing 0 against a bunch of variables to find the first one that's 0? roptat: no, I have a type variable (an integer), and depending on that type, I want to return a specific function that handles that type roptat: I'm trying to implement the netlink protocol, so I need to match the type with e.g. NETLINK_ROUTE or NLMSG_ERROR, etc roptat: I managed to do what I want, now I can see all the attributes of a link, by its id roptat: so I'm pretty happy :) roptat: I still need to decode errors properly though ^^' spk121: hello guile. Can I safely ignore this warning "WARNING: Use of `load' in declarative module (gi core-generics). Add #:declarative? #f to your define-module invocation." ? daviid: spk121: i don't have any valuable experience with 3.0, and although it compiles g-golf, any attempt to use it fails - but I think you only may ignore if the load does not affect any (gi core-generics) to-level binding, and checks pass as in 2.2 - a tiny 2c :) sneek: Welcome back daviid, you have 2 messages! sneek: daviid, str1ngs says: Hello, I think this is a limitation with WebKitView and not g-golf. But to use webkit_web_view_get_tls_info it requires GTlsCertificate and I don't think there is a way to do that with g-golf or GI in general? unless I'm missing something. see https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#webkit-web-view-get-tls-info sneek: daviid, str1ngs says: I mean there is no way to instantiate a GTlsCertificate spk121: daviid: thanks roptat: oh, is there a way to get a string from an errno number? spk121: roptat: strerror roptat: ah thanks daviid: str1ngs: i did see your msg and itented to answer ... I think it should work in g-golf, and probably is a g-golf limitation/missing feature or bug - let's work on it asa I finalize my fix for the methods related bug you found ... I am on it, almost done, i think :) but still a 'corner case' daviid: str1ngs: if you can prepare a minimal example ... that also uses gtk-init / gtk-main, for debugging purposes - the main reason is that when using gtk-application and g-application-run, we totally loose the 'dynamic' characteristic of lisp/scheme, you can't re-compile something in g-golf and launch the app, it complains it already exists one app ... then you have to quite guile, make make install g-golf, start again, import g-golf, load daviid: the app and call main ... a real pita daviid: str1ngs: fwiw, here is what i wrote to debug the notebook/append-page bug you found - which I am still working on ... if/when possible, please re-use it as a 'template', for the webkit_web_view_get_tls_info related bug or any future 'debugging snipset', many tx! daviid: str1ngs: here https://paste.debian.net/1164592/ - yes, i could have refactored part of the button1/button2 callback, but that's ok ... daviid: str1ngs: with that kind of 'debugging snipset', I can load the code, call (main '()), demand a full backtrace, work on g-golf, hit C-x C-e (emacs/geiser) and call (main '()) again ... daviid: like i could, using lucid, nearlye 30y ago :):) str1ngs: It's not as much of PITA then having to write a whole program just to report a bug. I wouldn't even mind these making these examples if there were actually going to be used as examples at some point. but you refused that contribution even. daviid: str1ngs: the notebook code you padsted was unusable - as a debufgin snipset daviid: and gtk-application, g-application-run is a problem, as i explained ... i actually didask the introspection authors, if there wa a way to de-register dynamically, but they told me you'd better quit and restart your environment daviid: it's noty a whole program, it's a fewe lines of code, most already written, by myself ... daviid: the pita is to loose the dynamic environment daviid: please re-use that snipset in the future, tx str1ngs: I'm not giving examples giving examples anymore then. They are for my benefit not yours. I'll report the bug you do with it as you will. your turning my bug reports into the examples themselves without actually dealing the bugs. dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work, happy Friday all! *: sneek does the friday dance civodul: sneek: botsnack sneek: :) mwette: Yes. Happy Friday! leoprikler: spk121: regarding that question, if it's about guile-gi there is not even an actual use of `load' IIRC leoprikler: The complaint stems from wrapping `load' in a GOOPS method spk121: leoprikler: heh, interesting. I didn't actually check for a 'load' in the module. It is just a new warning I noticed when I moved the Docker build from guile-2.2 to guile-3.0 roptat: I'd like to have a macro to define an enum (or maybe that already exists in guile?) so that I could do (define-enum message-type NLMSG_NOOP NLMSG_ERROR NLMSG_DONE (RTM_NEWLINK 16) RTM_DELLINK) etc, and it would define NLMSG_NOOP=1, NLMSG_ERROR=2, RTM_DELLINK=17, etc civodul: roptat: there's define-enumerate-type in Guix civodul: in several places actually... roptat: oh RhodiumToad: how does an enum differ from just defining a bunch of symbols? civodul: but it's only 6 lines civodul: RhodiumToad: you get macro-expansion-time checks roptat: I'd like also to have the reverse: (get-message-type RTM_DELLINK) -> 'RTM_DELLINK civodul: you can't make a typo in a symbol and notice it only at run time RhodiumToad: oh, defining them as macros? *: rekado <3 define-enumerate-type roptat: so what I understand from define-enumerate-type is that it does symbol->int, but not the other way around civodul: yes civodul: you can find more elaborate variants elsewhere :-) civodul: it's ridiculous, i think i've implemented it ten times civodul: guile-gcrypt has one that's pretty cool rekado: I’m just started playing with OpenAL, which I want to use as a glorified audio mixer. rekado: I’m thinking about whether to extend Guile or link the application with Guile rekado: all I want is to be able to control the core of the application from the outside civodul: extend! rekado: I knew you’d say that :) civodul: :-) rekado: as I envision it, the application will listen for connections on a socket, which tell it to add, remove, or reposition audio sources and listeners. rekado: extending seems like more work str1ngs: extending means you can use a REPL tough :) civodul: more work because it's harder to do from Guile than from C(++)? rekado: more work because I’d have to wrap more OpenAL things civodul: ah yes civodul: try nyacc's ffi generator while mwette is around :-) rekado: I’m afraid of GC issues, to be honest. Like some object disappearing too early, causing crashes. rekado: so the prototype needs to remain simple, leaving me time to learn more. rekado: (and to shed fear) rekado: I’ll try extending rekado: manually first rekado: if that all works I might give the ffi generator a spin civodul: sounds reasonable rekado: I know I really shouldn’t play with all this, but I just can’t help it. rekado: this might be fun civodul: i know that feeling civodul: i've come to the conclusion that sometimes you just need to go ahead and scratch your itch rekado: I’m writing this surrounded by three to four 70-90% finished projects… (a drum synth, a pre-amp / effects box, a shelf, and unfinished ethernet cabling in the walls…) rekado: productive procrastination civodul: next you can start a "museum of unfinished stuff" project! civodul: i could contribute a few pieces :-) rekado: hah :) dsmith-work: So many projects, so little time.. rekado: neato, this works! civodul: as in it makes sound? rekado: yes rekado: and I can attach sound sources rekado: from the REPL civodul: nice civodul: rekado: that was fast! mwette: once you download nyacc, you an do this: https://paste.debian.net/1164672/ mwette: or install, create the .ffi file and run guild compile-ffi stis: tjena guilers! leoprikler: is there a nyacc for guile-3 yet? mwette: I'm running w/ guile-3.0.4. Is there any issue identified? Or are you talking about guix? civodul: the nyacc package in Guix is still on Guile 2.2, but perhaps there's no good reason for that mwette: I don't (really) use guix so I don't know. rekado: that was fun, but maybe OpenAL is not the right tool for me after all. civodul: heh rekado: looks like Mumble/Murmur has a plugin for positional audio. Perfect! So I guess it’s just a matter of adding enough chewing gum between these parts and see if that works. pinoaffe: dsmith-work: so I'd have to use something like (define-syntax macro-apply (syntax-rules () ((macro-apply macro exp* ...) (primitive-eval (list macro 'exp* ...)))))? or is there a better option? roptat: is there a way to define a macro that generates multiple top-level expressions? roptat: I'm trying to do something like this: (define-syntax do (syntax-rules () ((_ a b) (define a 1) (define b 2)))) roptat: then (do one two) would define two variables, one and two to 1 and 2 respectively RhodiumToad: generate a (begin ...) roptat: ah yes, I just saw that roptat: I thought that would create a scope out of which one and two would not be defined RhodiumToad: at top-level, (begin x y) has the effect of splicing in x and y at top level, rather than creating any new scope bitwiz: You could also make a recursive expansion, but if you know there are only two defines, that's total overkill roptat: I actually don't know how many defines there will be roptat: what's a recursive expansion? bitwiz: i.e. something like where your 'do' expands to (define a 1) (do b) -> (define a 1) (define b 2) roptat: ah, ok :) RhodiumToad: often not needed, considering you can use ... RhodiumToad: e.g. ((_ def ...) (begin (define def somestuff) ...)) bitwiz: Do the variable names get passed in to your macro, or do you generate them in the macro? If the latter, watch out for https://www.gnu.org/software/guile/manual/html_node/Hygiene-and-the-Top_002dLevel.html leoprikler: quick question regarding (ice-9 i18n): (gettext ...) can handle multiline strings, yes? dsmith-work: Hey Hi Howdy, Guilers dongcarl: HI all, any way to get the path of the .scm file being run in guile? RhodiumToad: (current-filename) RhodiumToad: in particular, (add-to-load-path (dirname (current-filename))) is a useful trick dongcarl: RhodiumToad: That's great, many thanks! catonano: sneek later tell thchr no, I don't know, sorry sneek: Got it. tohoyn: sneek, botsnack sneek: :) jlicht: thanks RhodiumToad! spk121: . pinoaffe: is there an "apply" for macros? dsmith-work: {appropriate time} Greetings, Guilers dsmith-work: pinoaffe: Well, there's a macroexpand, but that's probably not what you are looking for. dsmith-work: RhodiumToad: Can you explain to me?: (and (x . y) (not (? list?))) dsmith-work: "(? predicate pat_1 ... pat_n) if predicate true and all of pat_1 thru pat_n match" dsmith-work: What is the predicate applied to? I don't understand from the doc dsmith-work: I would think it would be applied to pat_1 ... pat_n, but your example just has list?, with no pat_s rekado: pat_1 … pat_n are extra patterns to deconstruct the argument rekado: the predicate is applied to the whole structure rekado: (match '(foo bar) ((? list? (first . rest)) first)) rekado: this will return 'foo rekado: because (list? '(foo bar)) is true the next pattern is applied, which splits '(foo bar) into (first . rest), with first bound to 'foo rekado: you can have multiple patterns following the predicate: rekado: (match '(foo bar) ((? list? thing (first . rest)) (cons first thing))) rekado: results in '(foo foo bar) dsmith-work: rekado: Thanks! That helps a lot. dsmith-work: Never used match. Seems like a whole new language. civodul: note that 'list?' is implied in patterns like (a b c) civodul: beware of 'list?' though, it's linear in the size of the input civodul: actually (a b c) does not expand to calls to 'list?', but (a b ...) does str1ngs: sneek: later tell daviid. Hello, I think this is a limitation with WebKitView and not g-golf. But to use webkit_web_view_get_tls_info it requires GTlsCertificate and I don't think there is a way to do that with g-golf or GI in general? unless I'm missing something. see https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#webkit-web-view-get-tls-info sneek: Got it. str1ngs: sneek: later tell daviid. I mean there is no way to instantiate a GTlsCertificate sneek: Got it. ane: are the Guile manual docstrings auto generated from code or do people maintain both the docstring and the texinfo manual separately? dsmith-work: ane: Seprately. dsmith-work: The docstrings go into the builtin help. The manual is all in texinfo off under doc/ref/ manumanumanu: dsmith-work: to build on what ludo wrote: what he means is that (match blah ((a a* ...) do-stuff-with-a)) will check whether blah is a proper list. That is an O(n) operation, whereas (match blah ((a . rest) do-stuff-with-a)) is O(1). If blah is 1000 elements long, the first example will be a lot less efficient. dsmith-work: So now I'm more confused. As far as I know, the only way to check if a list is proper, is O(n) checking the last cdr is '(). manumanumanu: dsmith-work: but (a . b) does not check if the list is proper. it only matches a cons pair manumanumanu: that would match (cons 'a 'b) dsmith-work: The original quesiton by wanted to only match proper lists. dsmith-work: s/proper/improper/ manumanumanu: dsmith-work: then I suspect he/she wanted to match all elements, where my concern about ... is pointless anyway. I usually say this quite quickly in discussions about match, because people tend to write clauses that make algorithms quadratic instead of linear by not understanding ... . dsmith-work: manumanumanu: So does ... being quadratic also apply to syntax-rules ? manumanumanu: ... is not quadratic, but if you use it to bind the rest of the list you can quite easily end up with quadratic algorithms. And yes, that is the case also in syntax-rules. But it matters very little, because macros rarely have that many clauses. manumanumanu: dsmith-work: https://pastebin.com/jR4XhYay a short example jlicht: The stuff I used match for was limited to lists of length ~100 tops, so complexity that is still in O(n^x) for normal x is fine ;-) manumanumanu: jlicht: but did you want to match improper lists of that length, or did I understand dsmith wrong? jlicht: In theory, yes. In practice, most of them are shorter that ~5 elements jlicht: s/that/than dsmith-work: manumanumanu: Eww. Yeah, that looks really wrong. alextee[m]: is guile lib finally working in msys2 yet? alextee[m]: someone's asking for zrythm scripting support on windows but i build my packages using whatever msys has. iirc guile lib was broken so i had to disable it alextee[m]: hmm dont remember when was the last time i tried, this was updated in april: https://packages.msys2.org/package/libguile-devel?repo=msys&variant=x86_64 alextee[m]: seems to contain a lib, gonna try this i guess janneke: alextee[m]: i don't know about msys but i would be surprised; guix could/can build guile-2.0.13 for mingw alextee[m]: janneke: i think i need 2.2 or above janneke: alextee[m]: there is a whole bunch of patches on 2.2.3 -- https://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-mingw-guile-2.2 janneke: additional patches for 64bit here, still 2.2.3 => https://gitlab.com/janneke/guile/-/tree/wip-mingw-guile-2.2 alextee[m]: janneke: thanks! *: alextee[m] boots up the VM to try stuff janneke: (see also guile-devel) alextee[m]: getting this with msys' version: *: alextee[m] uploaded an image: Screenshot from 2020-09-22 06-27-26.png (117KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/HFvMskxacvaqYUKszyjvYBpx/Screenshot from 2020-09-22 06-27-26.png > alextee[m]: gonna look for a relevant patch janneke: alextee[m]: no idea, i only do cross builds from guix alextee[m]: janneke: are there any precompiled libs somewhere? alextee[m]: i only need the .dll, the link-time .dll (i guess .dll.a?) and the headers, and maybe a pkgconfig file alextee[m]: i wish i could cross build but cross-building gtk is complicated.. i tried using cerbero and managed to cross-build most dependencies but im stuck on gtk/gdk-pixbuf (also librsvg needing a rust compiler is a big blocker) RhodiumToad: windows link time files for dlls are .lib alextee[m]: i think most of them in msys are .dll.a *: alextee[m] uploaded an image: Screenshot from 2020-09-22 06-36-36.png (120KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/XwxmbZjLbxFNZyDwryHpYjaD/Screenshot from 2020-09-22 06-36-36.png > alextee[m]: i think it uses .a for static libs like on gnu and .dll.a for shared libs alextee[m]: then there's separate .dll's in the bin dir for distribution janneke: no, i don't know -- oh my librsvg -- that sounds problematic tohoyn: sneek, botsnack sneek: :) matijja: Does (ice-9 regex) supports look ahead/behind? leoprikler: I don't think so, but (ice-9 peg) may have what you're looking for dsmith-work: {appropriate time} Greetings, Guilers ane: I was building a guile program a while back and decided to put together some sort of a template for one https://github.com/ane/guile-example-program/ ane: I hope people will find it useful! bits of it are from wherever (various projects), I managed to track a few origins for some of the m4 stuff, but the rest is pretty much anyone's guess ... this brings me to the license issue, does GPL make sense for such a template project? dsmith-work: Martin Grabmueller (sp?) did something like that a long time ago. A template for a guile project. I think it's gone missing.. ane: I was also thinking about building a guile template project for a (large) C application embedding Guile dsmith-work: It's a great idea. ane: I actually got ctags working so that it had tags for the guile library, so you could jump to the Guile C API definitions in e.g. emacs dsmith-work: Seems like lots of other langs are doing things like that. (cargo init/new) ane: and, getopt basics for doing a --repl=[37146] or something like on the command line stis: hi guilers! stis: 3.0.4 is speedy. thchr: I need to read a large CSV file of floats (~1 million rows) in Guile: are there any recommendable packages that would do this job? thchr: I can see there's https://docs.racket-lang.org/csv-reading/index.html for Racket - but I guess that won't help me for Guile, per se? thchr: Ah, this seems to be a good starting point: https://github.com/artyom-poptsov/guile-dsv catonano: thchr: there's also https://github.com/NalaGinrut/guile-csv/blob/master/csv/csv.scm thchr: Do you know what the parsed structure is like? I.e. are rows stored as elements of a list? jlicht: Can ice-9's match match an improper (dotted) list? I keep running into the fact that a normal list is actually '(1 . ( 2 . ( 3 . ()))), which in my case I'd rather not match. RhodiumToad: you mean you want it to match only if the last cdr is an atom? RhodiumToad: (and (x . y) (not (? list?))) Aurora_v_kosmose: The newest Hall is interesting. daviid: do we have or has anyone written a procedure I could reuse. to compute all combinatorial possibilities, given a list of items, where an item either is an atom or a list? daviid: for example daviid: (a b b) -> ((a b b)) daviid: (a b (b c)) -> ((a b b) (a b c)) daviid: and so on .. nalaginrut: ,use (ice-9 control) nalaginrut: (define (either lst) (shift k (for-each k lst))) nalaginrut: (let ((a '(a b)) (b (either '(b c)))) (display `(,@a ,b))) nalaginrut: hmm...(define (either lst) (shift k (map k lst))) is better nalaginrut: then you don't have to `display' daviid: nalaginrut: great, let me try, tx daviid: nalaginrut: though you did change the input arg, in a way that i'd need to parse it to fill your 'either', and i'd rahter avoid to use shift ... isn't really any combinaytorial procedure available 'as is'? nalaginrut: daviid: I don't know if anyone wrote such thing. Out of topic, if folks all use guile-hall for packaging, it's easy for Guix, so we can collect the contribution easier wingo: moo civodul: hey! :-) wingo: really nice blog post on compiler design: https://cfallin.org/blog/2020/09/18/cranelift-isel-1/ civodul: Julian Seward, that name rings a bell :-) wingo: haha yeah wingo: among many other things, i think he focused on the register allocator there matijja: Hello Guilers! leoprikler: Scheme is magical. leoprikler: 1/0 != (/ 1 0) stis: changed the for semantics, now this hack works stis: (for ((x : l)) ((c 0)) (+ c (1/0 (f x)))) stis: special case, returns final value of c stis: manumanumanu: did a python for loop with less set! and more pure as we do not assume python variable semantics anymore. Much cleaner. stis: yielding values and dynamic-wind and try/catch finally ideom typically yo would not want to execute finally when you yield over it stis: take as an example where you close a file in the final statement of a with statement daviid: . sneek: Welcome back daviid, you have 2 messages! sneek: daviid, str1ngs says: Hello I found another bug in g-golf see this example https://paste.gnome.org/pw0t0lrhr. Essentially (append-page (make ) (make #:label) #f) should work. but the method to handle #f does not exist. sneek: daviid, str1ngs says: appropriate append-page documentation. https://developer.gnome.org/gtk3/stable/GtkNotebook.html#gtk-notebook-append-page daviid: str1ngs: the https://paste.gnome.org/pw0t0lrhr link xpired, could yu repaste it, tx (I could write one, but ... since you have a snipset I'll use it) str1ngs: daviid: should work I updated it for one week. https://paste.gnome.org/pw0t0lrhr str1ngs: daviid: on sec, maybe I wrongly reported this. str1ngs: daviid: I revise the example if you need a simpler test case let me know. I was just testing some other things as well. dsmith: leoprikler: I mean, you can't define 2/3, but you can 1/0 dsmith: scheme@(guile-user)> (define (1/0) (display "Hello 1/0\n")) dsmith: scheme@(guile-user)> (1/0) dsmith: Hello 1/0 dsmith: scheme@(guile-user)> (define (2/3) (display "Hello 2/3\n")) dsmith: While compiling expression: dsmith: Syntax error: dsmith: unknown file:3:0: source expression failed to match any pattern in form (define (2/3) (display "Hello 2/3\n")) RhodiumToad: 2/3 is a number, but 1/0 is a symbol? that seems like a bit of a gotcha marusich: Is there any "IDE" for Guile besides Emacs+Geiser? Like, maybe a generic scheme IDE that can be plugged into Guile? DrRacket is neat for Racket, but I haven't heard of anything for Guile. johnjay: i didn't know geiser was an interface for guile, thanks for letting me know that *: johnjay tfw you read a stackexchange question but don't even need to see the answer daviid: str1ngs: another good catch, tx. Although I know what to do, effectively implementing the fix needs some thoughts and a bit of time, will ping you when I have something to test str1ngs: daviid: no worries, this is easily worked around with the last argument being (make-label (format #f "Page ~a" (1+ (get-n-pages notebook)))) so it's still usable unlike the 'parent-set issue. str1ngs: daviid: is there a dynamic way to check if a parameter is [allow-none] which I guess is NULL or as a scheme type #f. daviid: str1ngs: yes there is leoprikler: dsmith: interesting leoprikler: it seems that "/0" doesn't count rekado: marusich: when I had more time I thought we could offer a pre-configured Emacs with Geiser, Flycheck, the picture language, etc. This exists now, but is not complete. “guix install guile-studio” gives you that thing. marusich: Amazing. Thank you for pointing me there! I was looking at the way you packaged it, and it's quite a nice little bag of tricks :) I will give this a try the next time I want to mess with Guile code. rekado: marusich: great! If you notice something that’s especially annoying about it, please do let me know. I don’t have much time to polish it, but I’d like to remove as many big annoyances as possible anyway. dsmith: leoprikler: It's just not rational leoprikler: Well 2/3.142 is also unset leoprikler: as is 2/3.0 leoprikler: or even 2/3. and 2/3? leoprikler: Back to my questions about syntax, how do I use stuff like '=>' and 'else' in syntax rules? RhodiumToad: what kind of thing do you want to do? leoprikler: A variant of "if" with slightly funny syntax RhodiumToad: both syntax-rules and syntax-case take a list of "keywords" which are to be treated literally RhodiumToad: so e.g. syntax-rules (=>) ..stuff.. leoprikler: (if* key then else) should look up the key in a hash-table and run then/else based on it leoprikler: (if* (test => key) then else) should save the result of test in the hash-table under key and run then/else leoprikler: I tried matching with (_ (test => var) then else) ...) but regardless of whether I have (=>) in syntax rules I get: leoprikler: unknown location: =>: bad use of '=>' syntactic keyword in subform => of => RhodiumToad: can you show a whole definition? leoprikler: hmm leoprikler: the following should do it: https://paste.gnome.org/puv9qjjiv RhodiumToad: https://dpaste.org/ziVc leoprikler: Ahh, I forgot my quotes RhodiumToad: order of rules matters RhodiumToad: (_ var then else) will match (if/table (a => b) x y) with (a => b) bound to var leoprikler: nice, two errors for the price of one RhodiumToad: so you need to test the => version first RhodiumToad: is var supposed to be just a symbol? leoprikler: yep RhodiumToad: you might want a clause ((_ (x . y) . z) (syntax-error ...)) in there somewhere then leoprikler: oof, I just realized i renamed the syntax peanutbutterandc: Is there any way in emacs to see 1. which module a certain procedure comes from and 2. the definition of the procedure - all while the .scm file is loaded? rlb: Do we expect risc-v builds to work yet? (Looks like all the debian release architectures built fine after the ports.test fix, but a number of non-release architectures are failing. Of them, I suspect risc-v is the one that's most likely to eventually be required to work, so I wondered: https://buildd.debian.org/status/package.php?p=guile-3.0&suite=sid ) rlb: guile always auto-compiles to XDG_CACHE_HOME or HOME/.cache? i.e. it never compiles to any kind of shared dir, right? rlb: And am I correct to think that since auto-compilation knows nothing about macro-derived dependencies, any changes at that level have to be considered API breaking changes, i.e. you might have to change the module's major version if you're following semantic versioning? And if so, is that fairly well understood/respected? rlb: I'm asking because we're discussing debian's scheme packaging arrangements right now, and I want to make sure I'm thinking straight about the constraints. rlb: (on the new debian-scheme list, fwiw) apteryx: how can I query the available physical memory of the system? apteryx: doesn't seem to something directly available to use apteryx: seems I want to query PAGE_SIZE from sysconf: https://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html rlb: From guile? Don't know of a built-in function offhand. If course you could run "free -m" or equivalent and parse the output. apteryx: yeah, from Guile rlb: If nothing else, I'd likely just exec sysconf if that has what you want. rlb: oh, wait, I was thinking there was a posix util for that (is there?) apteryx: seems more like a standard C lib rlb: yeah, though sometimes there's a corresponding utility, but I'm likely just misrememvering. rlb: "remembering" rlb: Might be plausible for guile to add sysconf wrappers... apteryx: guix doesn't know about a sysconf package at least rlb: getconf apteryx: ah! rlb: $ getconf PAGE_SIZE rlb: 4096 rlb: apteryx: I have to multiply the number of pages by the page size *: rlb is not entirely crazy, or at lest this doesn't add any evidence. rlb: There's also /proc/meminfo if you don't need to be as portable. rlb: And free *might* be sufficiently portable, not sure. manumanumanu: leoprikler: (regarding the loop) the problem with set! is that it involves implicit boxing. you will get a "mutation" penalty for that, which will most certainly not produce optimal code. The beauty of foof-loop (or my own racket for loop clone) in that they are not much more than pretty versions of fold and fold-right. leoprikler: rlb: regarding compilation, yes autocompile goes to XDG_CACHE_HOME, but it also reads compiled code from GUILE_LOAD_COMPILED_PATH, which on traditional Linux distros includes /usr/lib/yadda/yadda rlb: OK, thanks, and that's what I thought, and this is in the context of "What should happen when someone runs 'apt install slib'"? stis: manumanumanu: I redesign the pytyhon for loop macro much less set! and cleaner now. manumanumanu: stis: do you have the code somewhere? rlb: i.e. since slib works with multiple schemes, it may need to compile at install time, and/or (re) compile all child dependencies, etc. (because macro changes). leoprikler: slib code should get compiled for $GUILE_VERSION and put into the right /usr/lib/yadda/yadda stis: https://gitlab.com/tampe/scheme-python/-/blob/master/modules/util/scheme-python/for.scm rlb: We're just thinking through some of the issues. rlb: right, but we also can't let anything *use* slib before that happens, or we'll end up auto-compiling as root, etc. leoprikler: IIRC apt handles version changes e.g. python2-numpy vs python-numpy rlb: So we have to get the dep order right, etc. rlb: The python packaging tools have to handle that. rlb: (which end up being called or producing artifacts for apt, but apt itself doesn't know anything about it) stis: manumanumanu: but the protocal means that you throw StopIteration to end the loop and to know the value in the error handler you need set! due to ellse you need to to a catch on each iteration which is way more expensive rlb: (And so we're starting to discuss what we might want to do (if anything new) for the debian scheme "add on" packages, and may end up with something like whatever python does, or debian-emacs-policy, or... Not sure yet.) leoprikler: rlb: GUILE_AUTO_COMPILE=0 usually during `make' invocations (i.e. developers set that) stis: but much cleaner now manumanumanu: stis: it still looks a lot cleaner. not much code :) My guile for loops is the result of me learning syntax-case as I go... manumanumanu: stis: I added a generalized right fold btw. Now you can express for/list as a chain of conses. https://hg.sr.ht/~bjoli/guile-for-loops leoprikler: IIRC debian usually distributes the binaries (i.e. the already compiled files), so that's that rlb: It doesn't for emacs or python, and likely other ecosystems. manumanumanu: The code is horrible though, and the approach was bad, since you cannot express something like (for/stream ((a (in-transform 0 b)) (b (in-transform 1 (+ a b)))) a) for a stream of fibonacci numbers. rlb: In the limiting case, we also likely need to rebuild *all of the .go files for all of the add on packages in the right order, every time guile-X.Y is upgraded. rlb: *all* rlb: Which is what debian emacs does. rlb: (given the concerns wrt macro changes) manumanumanu: stis: what you want to look at is for/emit in loop/source if you want to know what the loops outputs :D With what I know today I could probably just implement it in half as many lines. stis: manumanumanu: i always redesign things that are not much used constantly improving, to stck with a bad design is too easy it should be better to do retrys as today i see way too much overdesigning from the beginning to avoid redoning things manumanumanu: yeah! manumanumanu: I find sharing things with the world makes me critical of it in ways that are positive. The transducers srfi, and moreso the inclusion in guile, would never have gotten anywhere unless arthur asked me to make a srfi out of it, or if I knew andy or ludo would look through it. manumanumanu: the srfi process is scary to someone like me. mostly in a good way. stis: processes and documentation is well worth to have well implemented stuff that goes in peanutbutterandc: Hey there peanutbutterandc: Is it just me, or does emacs-geiser not work well for someone else too? peanutbutterandc: Or, perhaps I am just not able to figure out it's usage.... peanutbutterandc: But, I did try following the manual. Did M-x run-guile, and then M-x geiser-eval-buffer and yet, I can't get any documentation peanutbutterandc: I'm using guile 3.0.4 and emacs-geiser 0.11.2, both from gnu guix peanutbutterandc: any ideas, please? Maybe I'm missing something? leoprikler: rlb: I'm on Guix, so I don't really see the problem with rebuilding anything str1ngs: sneek: later tell daviid, I found a bug in g-golf please see https://paste.gnome.org/pmnrilthc sneek: Got it. rlb: ok, so this is repeatable on s390x: rlb: Running suspendable-ports.test rlb: UNRESOLVED: suspendable-ports.test: non-revealed port is closed rlb: ERROR: suspendable-ports.test: revealed port fdes not closed - arguments: ((system-error "seek" "~A" ("Bad file descriptor") (9))) rlb: rlb: Any ideas? If not, I'll delve if I get time. RhodiumToad: in guile3? rlb: 3.0.4 RhodiumToad: is it sensitive to whether jit is enabled or not? rlb: noidea yet RhodiumToad: a syscall trace would likely be enlightening too rlb: but I can test without if we think that might matter. RhodiumToad: since it's clearly closing some file descriptor at the wrong time rlb: You mean strace -f ...? If so, should also be easy to provide. rlb: Also, it doesn't happen *every* time, just often. rlb: Hmm, I'll need to look at the test more carefully, but it looks like the error complaining about the fseek is expected because it gets a EBADFD for a seek right after a close(that_fd) rlb: Might not have anything to do with the arch, specifically, of course. RhodiumToad: the question is why did it close that fd rlb: Not sure - don't know which test (what it's doing yet), but yeah, might be some issue with gc or something too I suppose. rlb: All this is also in the context of a big migration in debian wrt libgc. rlb: (newer libgc, which might or might not be relevant) RhodiumToad: hm. yes, gc timing might be relevant. RhodiumToad: if it's incorrectly concluding that something isn't reachable, it might be closing the fd too soon rlb: right, or the test isn't guarding the thing sufficiently, or... rlb: though I guess without weak refs, if it has a ref, then shouldn't be closed that way. rlb: (prematurely) rlb: I'll perhaps also try without the jit, just to see if that makes a difference, since it's easy. daviid: . sneek: daviid, you have 1 message! sneek: daviid, str1ngs says: I found a bug in g-golf please see https://paste.gnome.org/pmnrilthc daviid: str1ngs: nice catch, I fixed but i can't push because i have a series of pending push related to my work on GInterfaces ... but in the mean you can make the folling 'local change' rlb: RhodiumToad: same errors with --enable-jit=no, fwiw. daviid: will paste in a sec RhodiumToad: rlb: I suspect a GC issue. daviid: str1ngs: here (g-golf hl-api closure) (I made the paste valid for one day, if it expires beofre you could grab it let me know ... daviid: str1ngs: sorry, i meant here - https://paste.gnome.org/pgioqsebs ... johnjay: daviid: i've never seen the !# syntax before. johnjay: cool str1ngs: daviid: thanks will try this out now. daviid: str1ngs: ok. one unrelated thing, in you scripts, you must import )oop goops) before to call (default-duplicate-binding-handler daviid: '(merge-generics replace warn-override-core warn last)), otherwise, the merge-generics is not known by gule, and silently ignored daviid: str1ngs: another tiny thing, maybe you know already, but you do not need to import "Gtk" "Container", since it is in the class precedence list of other things you import ... str1ngs: daviid: I get this back trace with that new snippet. https://paste.gnome.org/pmhl2sk6n daviid: johnjay: fwiw, 6.18.1.3 Block Comments str1ngs: daviid: I was fiddling with gi-import because remove was showing srfi1 in geiser for some reason. so GtkContainer got orphaned there. daviid: str1ngs: ok, i assumed you did know already, but just wanted to make sure :) johnjay: daviid: ah ok it's a guile only thing daviid: johnjay: i asume it is, in CL, we uswed #|| ... ||# str1ngs: daviid: no problem this is just an test case anyways. I should probably start a new geiser now and again. I tend to evaluate to much that way. :( daviid: johnjay: but i don1t know about other schemes johnjay: ah str1ngs: daviid: I'm not sure why that new snippet doesn't work either. should we wait for this? it's not a huge rush. daviid: str1ngs: make sure you quit any other sessino that ru that example daviid: it works here daviid: str1ngs: you did patch (g-golf hl-api closure) right? str1ngs: daviid: yes I did it a couple of times. and uninstalled g-golf an just use ./pre-inst-env. are you sure that's the right snippet? daviid: str1ngs: yes, can you run git diff and paste? daviid: or i can paste you may compare, here str1ngs: well diff won't help because tabs get mangled which I can next get just right. can you paste a patch would be easier str1ngs: cant get just right* daviid: str1ngs: after you changed the def, git diff should say https://paste.gnome.org/prlfz8p3t daviid: str1ngs: here is git format-patch - https://paste.gnome.org/pesefw7v9 str1ngs: thank patch is easier. or if I can get your tab/space settings right. which I can never do daviid: str1ngs: i should check my .emacs setting, there should be no tab ... i think i did solve that a while ago but ... str1ngs: it's probably my setup daviid: str1ngs: i think it's mine because gnome paste does indent my code wrong sometimes ... which is the symptom of tab instead of spaces .. daviid: but anyway, that patch fixes the bug, so let me know str1ngs: there is no ancestor for that patch lol. either way the change is trivial it should be if (or #f (null-pointer? value) not ( if (null-pointer? value) correct? daviid: correct daviid: you can see thatr in the 'original' paste i posted earlier today str1ngs: right, still not working. if its fixed for you that's fine we can revisit this later since I'm missing ancestry due to your interface work probably. and this is not a big rush daviid: str1ngs: definitely working here, is there a bug in my ./pre-inst-env maybe? str1ngs: I don't there would be one in ./pre-inst-env . it's using the in tree g-golf fine str1ngs: ./pre-inst-env nomad even works flawlessly with no g-golf installed daviid: str1ngs: that it doen't work after you patch scares me :) str1ngs: I hear ya, I'm confident if it's fixed on your end with history probably will be fixed for me. so lets not rush it. str1ngs: I'm using it for something highly experimental won't probably see sight of day lol daviid: str1ngs: is this using guix? maybe you can try your ubuntu, and do a full patch, make, make check, make install daviid: str1ngs: but it is a good catch, there will be other 'similar' situations ... daviid: str1ngs: here https://imgur.com/a/StlxIFC - 3 screenshots str1ngs: daviid: no I use ~/local . only time I use guix is for testing an making packages str1ngs: the g-golf hash I used is pinned to the guix declaration str1ngs: use* str1ngs: daviid: does clicking click me work? str1ngs: should say done after. daviid: str1ngs: yes, see the 3 screenshots, scroll ... daviid: scrol down daviid: str1ngs: but the bug made it so it would not even display the first screen anyway ..., so that is the fix, when there is no parent str1ngs: ah missed that sorry.. nice. also in my example I'm not sure if I need g-object-ref . since you have to explicitly use destroy anyways? daviid: yet str1ngs: right that's why I make sure the button was added after the signal. to show lack of parent would cause the bug. daviid: i didn't look deeply, but ig remove (the gtk method) lower the object ref, then yes, you'd need to do that str1ngs: probably if you remove that the button will go away? str1ngs: good way to test daviid: str1ngs: i ust say it is a veru weird example :), but i wanted to fix the g-golf bug, and i think is is fixed daviid: too bad you can't locally patch daviid: or locally test, it is a rare situation where i have other pending pushes that needs furthjer work ... shoulkd be there very soon now, but not today :) str1ngs: (dimfi (or #f (null-pointer? value))) gives me https://paste.gnome.org/py9vo7983 str1ngs: daviid: ^ does that help at all? daviid: the bug, lines 26, 28 and then 31, the report, is as if you did not patch c and g-closure-marshal-g-value-ref daviid: so your pre-inst-env is playing games with you daviid: you should make, make check, make install and not use pre-inst-env ... and see str1ngs: here is my g-closure-marshal-g-value-ref https://paste.gnome.org/pcgzgwd26 . str1ngs: I just added a dimfi to make sure it was working. daviid: str1ngs: yes, but that is not the proc that is called daviid: something is wrong with you pre-inst-env, or mine (g-golf) daviid: you did see the screenshots, i can't possibly make those 'manually' :):) str1ngs: I'm not doubting it's fixed on your end. So I'm okay with that. we can revisit this when my history catches up with yours? WDYT? daviid: str1ngs: ok, but are you not interested to understand why it does fix it here and not on your side? i couldn't even sleep :):), but as you wish, let me just paste the exmaple (that i updated for 'cosmetic' taste, so to speak, but what if it did 'fix something else' ...) str1ngs: daviid: it's not that I'm not interested. it just that you have a different git history so later when I'm on par we can follow up. I'm assuming it's fixed as you have noted. daviid: here https://paste.gnome.org/prcznkqeq daviid: str1ngs: nothing here influences that fix daviid: at least i don't think so str1ngs: oh you don't have the 'parent-set signal? daviid: i don't? daviid: that's a mistake here str1ngs: https://paste.gnome.org/pmnrilthc see the connect button 'parent-set . str1ngs: I could have made this example simpler sorry. but later I need to actually test that the signal works when changing the button's parent. daviid: ok, let me see what's wrong still str1ngs: daviid: okay no rush on that I'm using it for some highly experimental work. see the modeline here https://bufio.org/images/2020-09-18-215517_2048x2110_scrot.png . that's qtwebengine using nomad guile and g-golf \o/ daviid: cool daviid: i hope g-golf will have nice images like guile ... :):) str1ngs: I know that that guile image is great. daviid: oh my god str1ngs: daviid: maybe g-golf can have a gopher mascot. often you can find a gopher on a golf course :P daviid: maybe, the manual drawing, sort of scifi characters of the guile's web site are cute str1ngs: yes, the artist did a very good job. daviid: str1ngs: can you try this patch (on top of the previous, keep the previus to apply this one ...) https://paste.gnome.org/puzth0tfz str1ngs: daviid: sure one sec daviid: str1ngs: or this patch on th clone you had - https://paste.gnome.org/pthn5gfx7 str1ngs: daviid (or (not value) (null-pointer? value)) is working daviid: str1ngs: perfect, sorry for the previous bad patch daviid: str1ngs: so, we can sleep :):) str1ngs: no problem. get some sleep haha str1ngs: thank for the fix. I'll play around with this now daviid: str1ngs: welcome, that was a very good catch, i am glad we fixed it str1ngs: parent-set is kinda useful for nomad. though not sure how many people use that. daviid: str1ngs: actually from my perspective, it is not so much the parent-set, but the fact that a signal that expect an instance as one of its argument can sometimes receive NULL - that was the catch str1ngs: aye, does GI indicate that somehow in terms for a language binding? str1ngs: sometimes it's odd because using GTK from C I don't have to worry about some subtitles. daviid: although i did use parent-set in the past, but not in this context, rather, when you create an instance from a glade (xml) file, it is unparented, and you need to parent it ... str1ngs: err I mean subtleties daviid: yes and no, to the last quiz, this really was a bug in g-golf anyway str1ngs: understandable. often times NULL is in GTK functions or methods but I can't think of any other instance where NULL could pass to a signal closure other then maybe user-data. though in this case it makes sense that the parent could be NULL of course. str1ngs: daviid: (setq-default indent-tabs-mode nil) seemed to str1ngs: help* with diffs daviid: i have this: (set-default 'indent-tabs-mode nil) daviid: so is it a bug and should be (setq-default 'indent-tabs-mode nil)? str1ngs: this the effect is the same. it never uses tabs though #:duplicates still have tabs. which you can see with white-space-mode str1ngs: it's not a huge deal, as long as I can replicate your settings to some degree. I can handle diffs better. leoprikler: Is there a way of inserting expressions between expressions with a syntax-rule/syntax-case? leoprikler: I want to do something like (trace (foo) (bar)) → (begin (display "(foo)" (foo) ...) leoprikler: (display "(foo)") (newline), of coure leoprikler: *course RhodiumToad: sure RhodiumToad: but it'd probably be easier to use (pk) RhodiumToad: (pk a b c) prints the values of a,b,c and returns c leoprikler: well, tracing is just an intermediary step in something larger leoprikler: after that, I want to be able to "step" through the code one-by-one (using prompts) leoprikler: so I'd insert abort-to-prompt in-between the expressions leoprikler: or something like that RhodiumToad: something like, RhodiumToad: (define-syntax-rule (trace-int exp) (let ((v exp)) (format #t "~A ~A" (quote exp) v) (newline) v)) RhodiumToad: (define-syntax-rule (trace exp ...) (begin (trace-int exp) ...)) RhodiumToad: or you can merge them into one: RhodiumToad: (define-syntax trace (syntax-rules () ((_ exp) (let ((v exp)) (format #t "~S ~S" (quote exp) v) (newline) v)) ((_ exp0 exp1 ...) (begin (trace exp0) (trace exp1) ...)))) leoprikler: killed by Emacs leoprikler: that's a nice trick, though RhodiumToad: to insert an abort-to-prompt you'd do something like ((_ exp) (begin (abort-to-prompt whatever) exp)) as the single-arg case RhodiumToad: yes, that would expand to (begin (begin a b) (begin a c) ...) but that doesn't matter RhodiumToad: and the multi-arg case can be ((_ exp0 exp1 ...) (begin exp0 (trace exp1) ...) if you don't want to insert an abort-to-prompt before the first one leoprikler: yeah, I don't worry about (begin (begin)) leoprikler: I'll have lot's of (begin)s in the code being stepped through anyway RhodiumToad: the tree-il for (begin a b c d) and (begin (begin a b) (begin c d)) is the same anyway RhodiumToad: both become (seq a (seq b (seq c d))) leoprikler: hmm, that works for the trace, but I think I'm having some troubles with the prompt leoprikler: In procedure abort: Abort to unknown prompt RhodiumToad: how did you pass the prompt tag? leoprikler: (abort-to-prompt prompt-tag handler) leoprikler: The prompt-tag is not exported from the module however leoprikler: which is a bit weird, because the tree-il seems to correctly use @@ to load everything from the correct module RhodiumToad: how did you establish the prompt and the tag? RhodiumToad: I'm wondering whether you really need shift/reset instead, because those re-establish the prompt when calling the continuation, whereas call-with-prompt does not leoprikler: So if I say (define prompt-tag (make-prompt-tag 'tag)) leoprikler: and then (call-with-prompt-tag prompt-tag ...) twice, what happens? RhodiumToad: twice consecutively, or twice nested? RhodiumToad: call-with-prompt puts the tag into the dynamic context when executing the thunk. abort-to-prompt aborts to the nearest outer context that has that tag. RhodiumToad: you can reuse one tag as many times as you like, nested or not leoprikler: ah, but it needs to be within the same scope leoprikler: i.e. i can not do (call-with-prompt-tag ...) (abort-to-prompt) RhodiumToad: you can only abort to a prompt while inside the thunk invoked by call-with-prompt RhodiumToad: i.e. (call-with-prompt prompt-tag (lambda () ...stuff... (abort-to-prompt prompt-tag ...) ...stuff...) (lambda (k . args) ...stuff...)) RhodiumToad: the subtlety is that if you invoke (k), the prompt is not automatically re-established, so if the thunk contains more than one abort in sequence, you need to re-establish the prompt each time leoprikler: ahh, but in (lambda (k . args) ... stuff ...) there should already be a call-with-prompt-tag leoprikler: [hence my earlier comment about calling it twice] RhodiumToad: where? leoprikler: (lambda (k . args) (call-with-prompt-tag (lambda () ... more stuff ...)) RhodiumToad: there is no call-with-prompt-tag RhodiumToad: call-with-prompt has a first argument which is the tag leoprikler: oops, that's my fault, I meant (call-with-prompt prompt-tag ...) whenever I wrote call-with-prompt-tag RhodiumToad: (letrec ((handler (lambda (k v) (format #t "cont ~A\n" v) (% mytag (k) handler)))) (% mytag (begin (format #t "point 1\n") (abort-to-prompt mytag 1) (format #t "point 2\n") (abort-to-prompt mytag 2) 3) handler)) stis: hey guilers dsmith: Yarr str1ngs: here be pirates! str1ngs: sneek later tell daviid, Hello I found another bug in g-golf see this example https://paste.gnome.org/pw0t0lrhr. Essentially (append-page (make ) (make #:label) #f) should work. but the method to handle #f does not exist. sneek: Okay. str1ngs: sneek: later tell daviid. appropriate append-page documentation. https://developer.gnome.org/gtk3/stable/GtkNotebook.html#gtk-notebook-append-page sneek: Will do. rlb: civodul: I might have found the 390x test issue (and if so it's not arch specific). In ports.test in the "non-revealed port is closed", if the port isn't gc'ed, we just close-fdes the file descriptor and mark it unresolved. The problem is that the port still has a reference to that fd, whcih the next test then starts using, and when the next test calls (gc), the port from the *previous* test closes the fd, breaking that next test. rlb: At least that's my theory. See if I can find some way to disable that lingering object's close of the fd it should no longer "own", even via a hack, to see if that makes the failures go away. rlb: I suspect for the "non-revealed port is closed" test we need something like (port-forget-fd ...) to call after we call close-fds in the catch handler... rlb: But in the end that test is perhaps just trying to do something a bit shady... rlb: Also noticed that we may not be checking overflow in places wrt the port revealed counts. rlb: i.e. it's a C int and we may have some unchecked "revealed += adjustment" code, etc. rlb: OK, I think I might have a plausible hack/fix. I'll send a patch later. rlb: I take it back. I don't see a way yet to avoid the possibility that that test will just break subsequent tests if/when its port isn't gc'ed during the test, and then is later, randomly closing the fd that another test is trying to use. rlb: I think for now I'll just comment out that test for Debian, and I'll file a bug suggesting we might want to do the same in guile proper unless we can come up with some way to really force the gc, or alternately, maybe a way to sneak around behind the gc's back. manumanumanu: leoprikler: if you want to know how much fun you can have with syntax-rules you should go read the source of taylor campbell's foof-loop implementation. leoprikler: CL-style loops are too much fun imo leoprikler: In my case it was really just an issue about not trying to be smart with syntax-case and just sticking to syntax-rules with helpers leoprikler: Although I still kinda wish I could rewrite this as a syntax-case manumanumanu: leoprikler: you could implement something akin to implicit renaming using syntax-case if you miss the more CL-styled loops leoprikler: I don't leoprikler: I prefer myself some map/for-each, even (let loop (())) manumanumanu: leoprikler: I had a brain fart, sorry. loops became macros in my brain. foof loop is actually quite schemey. Not magic and mutating like loop or iter. You can treat it as syntactic sugar over a named let, just using the homogenous looping over various collections. leoprikler: I get (part of?) that from the documentation, but I'm still not vibing the syntax, is all. leoprikler: the initial example was "count-matching-items" and that to me is (length (filter pred list)) leoprikler: which is shorter than any of the presented alternatives ;) leoprikler: even if I used for-each so as to not construct a new list, I'd only need one lambda in there plus the correct for-each for the datatype manumanumanu: how would you do that with for-each? manumanumanu: You'd have to use fold to do it in one pass. manumanumanu: (fold (lambda (elt acc) (if (pred? elt) (+ acc 1) acc)) lst). Which in guile would _still_ be slower than a named let since I don't think it does any inlining of the fold to be able to remove the function call. manumanumanu: (loop ((for elt (in-list lst)) (for c (summing 1 (if (pred? elt))))) => c). Still longer, but not nearly as bad. I am racketifying it to provide subloops and loop/sum-styled loops, which means you could potentially write (loop/sum ((for elt (in-list lst)) (when (pred? elt)) 1) manumanumanu: that fold is too short, sorry :) manumanumanu: i leave it as an exercise to the reader to figure out why stis: i did some examples for scheme-python sent it to guile-user maillist (or go to https://gitlab.com/tampe/guile-persist) stis: err should be https://gitlab.com/tampe/scheme-python civodul: hey stis! civodul: stis: this is roughly the run-time support library of python-on-guile, right? stis: yes, I have a macro layer in scheme so I figure it would be nice to have it in a repo of it's own as python-on-guile is heavy stis: civodul: ^^ stis: it's also heavy on goops leoprikler: manumanumanu: (let ((count 0)) (for-each (lambda (elt) (when (pred elt) (set! count (1+ count)))))) civodul: stis: ok, i see leoprikler: but yeah fold would also work stis: (let lp ((l l) (c 0)) (if (pair? l) (lp (cdr l) (+ c (if (f (car l)) 1 0)) stis: (let lp ((l l) (c 0)) (if (pair? l) (lp (cdr l) (+ c (if (f (car l)) 1 0)) c) leoprikler: I feel this has devolved into code golfing stis: :) stis: (for ((x : l)) ((c 0)) (+ c (if (f x) 1 0)) #:final c) leoprikler: can be made into (+ c (f x)) if x is supposed to return C-style booleans ;) leoprikler: *if f stis: yes, assuming intify we can use (for ((x : l)) ((c 0)) (+ c (intify (f x))) #:final c) stis: or in python stis: yes, assuming intify we can use (for ((x : l)) ((c 0)) (+ c (int (f x))) #:final c) stis: assuming f retruns only bool values leoprikler: or have a conversion proc 1/0 leoprikler: which is defined as (define (1/0 x) (if x 1 0)) dsmith: Can you define "1/0" ? That's syntactially (lexically?) a rational, though not a valid one. dsmith: You can! nalaginrut: morning guilers~ nalaginrut: I see, if I want to install guile with readline, I need to install readline first, then install guile, it'll be detected. However, it'll compile locally nalaginrut: btw, guile3 need readline7, in case someone care nalaginrut: oh, forget about it, it's wrong answer. Installing readline7 can pass guile3 compiling, but it still complains no readline wleslie: did ./configure pick it up? wleslie: I mean: did you re-run configure, and did it detect readline? str1ngs: ArneBab: nice. str1ngs: ArneBab: I've been meaning to see if I could use wisp as a kinda DSL for nomad's mini buffer. tohoyn: sneek, botsnack sneek: :) ArneBab: str1ngs: that would be cool! ArneBab: str1ngs: a problem I can see for that would be, however, that wisp terminates with two newlines. What you could do is to define return as ending the input and shift-return as continuing it. Then you would have something like a shell with full scheme semantics that doesn’t need an opening or closing parenthesis. mwette: sneek: later tell matijja, instead of parameter use (define *x* (let ((xval '())) (case-lambda (() xval) ((x) (set! xval x))))) mwette: sneek: Okay. ArneBab: str1ngs: all you need to read wisp code is to have language/wisp.scm and language/wisp/spec.scm in your load path, similar to here: https://hg.sr.ht/~arnebab/wispserve/browse/language?rev=4541f36df0b0 str1ngs: ArneBab: I will play with it some time. but would be cool to do something like. find-file "~/.nomad." right from the minibuffer. with completions ArneBab: that would be pretty cool, yes! str1ngs: or load-uri "http://gnu.org" str1ngs: right now optional arguments are handled like emacs with minibuffer prompts ArneBab: that should actually work, just pass the minibuffer-content to (wisp-scheme-read-string STRING) or as port to (wisp-scheme-read-all PORT) ArneBab: (import (only (language wisp) wisp-scheme-read-string)) ArneBab: I have not yet tested that embedded in another application, though ArneBab: readline from Guile actually works on that (because the procedures are all the same) ArneBab: (so completion matches) str1ngs: nice, would make the minibuffer more flexible I think. with less abstraction. also I wouldn't mind having some nomad extensions in wisp just as an example of alternate language. ArneBab: please tell me when you test this (and how it goes)! *: ArneBab needs to be AFK; taking kid to sport str1ngs: will do, good luck at sport ArneBab: thank you — I’ll tell her (I only walk there and back) ArneBab: (still need to work) matijja: Hello Guilers! sneek: Welcome back matijja, you have 1 message! sneek: matijja, mwette says: instead of parameter use (define *x* (let ((xval '())) (case-lambda (() xval) ((x) (set! xval x))))) matijja: mwette: Nice! manumanumanu: Ahoy! matijja: o/ matijja: I see. But not understand much. Why not just (eval-when (compile) (define compile-date (current-date))) ft: I don't use that thing much, so I'm not an expert. I'd take the advice at the end of the section, or slowly work yourself into it. matijja: With same technique I can get program-name/version from environment (with is available at compile time) into untime, i think... matijja: This example in info doesn't works for me. The time is changing every time I run the program. RhodiumToad: is it being recompiled each time though? matijja: I don't think so, only first time show me the info of compiling. matijja: Here is my example: https://paste.debian.net/hidden/ea7b70c7/ RhodiumToad: hm *: RhodiumToad also hasn't used that thing much (if at all) matijja: I solved the problem with defmacro: https://paste.debian.net/1164130/ mwette: sneek: later tell matijja, use syntax-rules rather than defmacro sneek: Got it. nalaginrut: morning guilers~ matijja: Morning. sneek: Welcome back matijja, you have 1 message! sneek: matijja, mwette says: use syntax-rules rather than defmacro matijja: mwette: I will try again, but I didn't have luck with syntax-rules... *: spk121 considers entering tomorrow's Lisp Game Jam daviid: spk121: fun! will you propose something using guile-gi? spk121: I've got my own weird game engine in a repo somewhere. C Gtk layer + guile scripting daviid: ah ok spk121: daviid: haven't tried to code anything in months because of real life. I wonder if I still know how? haha daviid: :) - i am sure you know,but i understand the feeling :) daviid: spk121: while you were 'in real life' :), i managed to get GInterface as classes and 'just using multiple inheritance' to implement this weird java 'way of things' that GObject itself inherited :) daviid: so far so good, but i have some finalization work to do still - so i didn't push yet spk121: daviid: impressive. GObject is a strange beast daviid: spk121: here is an example that uses that newly implewmwented 'way of things' in g-golf - https://paste.debian.net/1164139/ daviid: in previous versions, i'd have to use VBox HBox, and line 33 would have raised an exception ... the 'orientation g-property is writable as well, so now, one can change the oientation 'on the fly' spk121: looks like it is all there, congrats daviid: tx, almost, the last thing i need to fix is when signal(s) expect an interface as one of there argument, like the 'open signal for GApplication, so far, g-golf still 'uses ... daviid: still 'uses'(expect and returns) pointers ... daviid: I hope to finalize this the next few days now - today i fixed another very annoying bug related to 'promoting' guile core procedures (and user procs) as gf ... that consumequite a bit of time the last two to three weeks :), but i think i 'really' did fix it daviid: so i' just offered myself a glass of wine :):) daviid: haha - then i won't be able to code either :) spk121: daviid: it has been quite a long haul, and now you are in the home stretch spk121: (to mix driving and sports metaphors...) daviid: spk121: :) - I wish good luck and more importantly good fun with the lisp game jam, let us know how it went ... ArneBab: Do we already have some linting for Guile? I’ve been wishing for that for a long time, and now I have one more reason to ask here :-) https://news.ycombinator.com/item?id=24501803 dsmith-work: Hey Hi Howdy, Guilers rlb: New upload of guile 3.0.4 failed to build on s390x with: rlb: Running suspendable-ports.test rlb: UNRESOLVED: suspendable-ports.test: non-revealed port is closed rlb: ERROR: suspendable-ports.test: revealed port fdes not closed - arguments: ((system-error "seek" "~A" ("Bad file descriptor") (9))) rlb: rlb: Known issue by any chance? rlb: The other release architectures were fine, but a few of the older ones were not: https://buildd.debian.org/status/package.php?p=guile-3.0 nalaginrut: civodul: may I request the progress bar or percent of `guix refresh`? nalaginrut: sometimes I thought it's halt ;-) civodul: nalaginrut: ah, true civodul: you run it without arguments? civodul: it's often not very useful to do so IMO nalaginrut: wat? guix refresh needs a specific package? nalaginrut: then maybe it should just throw a simple usage and quit ;-O nalaginrut: civodul: how can I install guile with readline from guix? nalaginrut: it seems no readline support by default manumanumanu: matijja: The problem might be that your modules are declarative. That means they do very agressive inlining of variables, and a set! might not work as you expect. manumanumanu: matijja: at least since guile 3. manumanumanu: If you want to hold state in a module, you either make it #:declarative #f, or you store the state in a box or use parameters. The box will make it faster, whereas you will get a more dynamic behaviour from parameters, where users can change parameters in dynamic extents of (parameterize ((your-parameter 'no-logs-please)) ...). your-parameter will have the value 'no-logs-please for everything in the body, manumanumanu: even in procedures called by the body manumanumanu: but outside the body, it will be whatever value it was before. manumanumanu: boxes will be slightly faster, but have all the downsides of mutation: threads might not work. RhodiumToad: I think the question was how to compute something at compile time that would then be treated as constant manumanumanu: RhodiumToad: i missed that part of the discussion. the defmacro solution is adequate then! RhodiumToad: why doesn't the docs example for it work, though? manumanumanu: I only saw "can guile modules hold state" manumanumanu: RhodiumToad: link? RhodiumToad: see under "eval when" in the doc RhodiumToad: https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Eval-When.html#Eval-When manumanumanu: dang manumanumanu: because %date expands to (date) RhodiumToad: I think that example _shouldn't_ be compile-time constant, but it certainly gives the impression that it should be manumanumanu: i never had any luck with eval-when, but that documentation really does seem to imply that that stores the compilation date in *compilation-date* manumanumanu: it clearly does not manumanumanu: neither at the repl, nor if run as a file. RhodiumToad: so the question is, how would one do that manumanumanu: syntax-case manumanumanu: and return the correct syntax object. simple manumanumanu: (datum->syntax #'stx (date)) RhodiumToad: seems reasonable manumanumanu: We could probably even do rudimentary constexpr using syntax-local-binding manumanumanu: just error on anything else than 'global manumanumanu: lets not... manumanumanu: I am an idiot. manumanumanu: we need eval. manumanumanu: RhodiumToad: https://paste.debian.net/hidden/c5c3d5e4/ fails spectacularly if the thing cannot eval properly at compile time. manumanumanu: not spectacularly, but with an unknown variable and a world record backtrace manumanumanu: RhodiumToad: you need to quote the output, otherwise it fails on (list 1 2 3) manumanumanu: RhodiumToad: https://paste.debian.net/hidden/d861657a/ matijja: Hello Guilers! matijja: How can I make global variable, which is shared per threads? RhodiumToad: you mean there's just one value that all threads see? that's the default case RhodiumToad: but you have to be aware of concurrency issues if you try and mutate it with multiple threads in play manumanumanu: matijja: if the variable is in scope when the threads are created, it will be visible to all threads. Mutating it will be problematic though. If you use parameters, any change to them will be thread local (I THINK). You can also use atomic boxes, or mutexes. RhodiumToad: parameters are fluids, which are thread-local (and respect dynamic scoping too) matijja: So, I may have another problem. I'm using parameter as global variable in package for storing all opened sockets. http://paste.debian.net/1164221 RhodiumToad: that shouldn't be a parameter then RhodiumToad: that should probably be a hashtable or something matijja: Are parameters thread local? RhodiumToad: they are RhodiumToad: however, threads inherit the values of parameters from their creators RhodiumToad: changes are local to the changing thread (actually local to the dynamic scope) matijja: Ok. Ordinary lists works fine. Thanks for info. RhodiumToad: btw you can use (with-mutex ...) to execute forms with a mutex locked RhodiumToad: if you use lock-mutex directly, you have to think about what to do about errors RhodiumToad: whereas (with-mutex) will unlock in the event of a nonlocal exit (and relock in the event of a nonlocal entry) matijja: I didn't know that with-mutex already exists. manumanumanu: matijja: if you are mutating a list, you _need_ to use locks. guile is not like python. things execute in parallel :D RhodiumToad: you could prepend to a list without locking by using an atomic box to hold it, I guess? RhodiumToad: you'd need to use a compare-and-swap to update it and retry on failure matijja: manumanumanu: lock/unlock-mutex is there for that reason. matijja: And how atomic-box works without mutexes? RhodiumToad: using atomic update primitives, presumably RhodiumToad: the main thing about atomic boxes is that you can do a compare-and-swap - i.e. "if the value is currently X then replace it with Y, otherwise do nothing" RhodiumToad: (returning the old value in either case) RhodiumToad: and the comparison/swap is atomic with respect to other threads RhodiumToad: the advantage is not needing locking, the disadvantage is that you have to do your own retry logic for the case when some other thread gets in there first matijja: This should be used for more frequent operations I think. matijja: I doesn't expect an army of sockets... RhodiumToad: not sure why you're not using a hashtable though matijja: Because I don't need mapping. Maybe I could use hashmap as hashset. ArneBab: guile-wisp 1.0.3 is now in Guix: It ships a wisp binary that starts a Guile with wisp as language and can directly execute wisp files. Also it includes wisp2lisp which takes a wisp file and writes a plain Scheme file to stdout. civodul: ArneBab: yay, congrats! ArneBab: Thank you! ArneBab: my patch was merged (and cleaned up!) by rekado nalaginrut: morning guilers~ lloda: guile-json : scm->json #pretty #t prints non-record fields in a single line, even very long arrays of arrays lloda: pretty printing should be applied to any nested structures that are longer than X imo lloda: not just records dsmith-work: Morning Greetings, Guilers ftknox: howdy! chrislck: lloda: https://github.com/aconchillo/guile-json/ is very responsive to bug reports lloda: thx chrislck i will matijja: Hello Guilers! matijja: One odd question. Can Guile modules holds state? matijja: I want to write something like that: https://paste.debian.net/hidden/8ff2d670/ Is there any better approach? mwette: matijja: but you should use parameter (or fluids) mwette: (define *config-processors* (make-parameter '())) mwette: (set! *config-processors* ... ) => (*config-processors* ...) mwette: mutating top-level bindings (e.g., (set! *config-processors* ..)) is discouraged mwette: ^ in modules, that is matijja: mwette: Thanks. matijja: How can I save into variable date, when program was compiled? ft: I think there's an example in the manual. But in the interest of reproducible builds, I'd refrain from it. :) ft: If you must, take a look at the eval-when section of the manual. leoprikler: jlicht: you probably want get-bytevector-some leoprikler: (likewise put-bytevector for writing) jlicht: leoprikler: thanks! Binary I/O is where it's at, I guess :-) leoprikler: you could also try line-delimited stuff from textual IO, but lines are overrated imo Bob131: Hi. I'm working on a parser-generator that takes regexes encoded in S-expressions and produces a DFA represented as a table for a table-driven scanner. I was hoping to do the table generation at compile-time, but that plan came undone when I found that the Guile VM assembler can't intern procedures Bob131: I'm a little bit stumped as to how to salvage the situation. I'm curious as to how some seasoned Schemers might approach the problem? apteryx: hello! are guile syntactic extensions (define-syntax-rule ...) global? apteryx: e.g., if something uses the module they are defined within, they'll be available even they were not "exported", correct? daviid: apteryx: no, you must export or re-export or re-export-and-replace apteryx: OK! Thanks for clearing that up. That's better. apteryx: :-) daviid: np! jlicht: If I use read-elisp to read some elisp (surprising, I know), how do I get it written as a 'pretty' string again? Currently, elisp's backtick ("`") gets turned into "#{`}#", which can't be read by normal Emacs. jlicht: likewise for elisp's vector notation: "[x]" -> "#(x)" xelxebar: Does guile have any procedure for getting cpu info of the executing machine? xelxebar: Something like the moral equivalent of lscpu or /proc/cpuinfo? *: nalaginrut had identify the nick, now he can speak nalaginrut: xelxebar: (current-processor-count), however, it's only for cores nalaginrut: wingo: could you take a look at my mail about record in the mailing-list? xelxebar: nalaginrut: Thanks. Really want to inspect the flags. xelxebar: Actually, I *really* want to detect avx/avx2 support. nalaginrut: maybe someone should write a small lib for cpuinfo nalaginrut: dunno if someone made it nalaginrut: hmmm...maybe bind libcpuinfo would be a good idea https://github.com/anrieff/libcpuid rekado: I wonder if we should reconsider the decision to only implement the bare minimum of elisp in Guile. nalaginrut: xelxebar: if you just want an oneshot program, maybe you can just parse it with regex rekado: it made sense to just do a little and hand over to Emacs as soon as possible, but I wonder if it would make sense to get more of elisp into Guile. xelxebar: nalaginrut: Hrm. That might be a fun project. In this case, I know the script will be executing on linux, so parsing /proc/cpuinfo is an option, but I thought there might be a ready-made solution already. nalaginrut: rekado: I haven't followed for a while, didn't it support elisp smoothly? nalaginrut: xelxebar: well, folks are too low-profile in Guile community. Sometimes I thought there was not any existing solution, then I wrote it, then I realized there's some good solution in certain corner. nalaginrut: I do think we should have a better way to publish folks' projects to avoid redundant work nalaginrut: it's better to let them publish by themselves. I think there's someone who are collecting existing projects occasionally, but it's not an very efficient way. wingo: nalaginrut: is that the one about "match" and r6rs records? sneek: wingo, you have 1 message! sneek: wingo, nalaginrut says: could you take a look at my mail about record in the mailing-list? nalaginrut: wingo: yes wingo: yeah :/ i didn't realize that change was user-visible, i.e. i didn't know that people used match on r6rs records wingo: the 3.0 behavior is better for performance and memory fwiw. but i sympathise with it being an unexpected change that causes needless work for you nalaginrut: I use it a lot, actually, it's very convenient, I'd like to advocate about this usage wingo: if you prefer to match on "hierarchies" via composition rather than inheritance, it would be possible to use a different record facility that preserves the old behavior wingo: like a non-r6rs define-record-type that includes "parent" record types via a has-a relationship rather than an is-a relationship, from a struct point of view wingo: like, that could be a good solution to allow your existing match invocations to keep working wingo: dunno, there are tradeoffs all around of couse wingo: *course nalaginrut: wingo: how can I make such a non-r6rs record? or is there any existing facility that I can use? wingo: so, do you use the procedural introspection interface on records at all? wingo: like (record-type-fields rtd) and similar nalaginrut: I used a little, not vary familiar with it wingo: you mostly use define-record-type, is that it? nalaginrut: yes wingo: and then the defined interfaces wingo: lemme take a look at it. nalaginrut: btw, I'm also using record matching in my compiler design, I think it's very convenient to parse the IR and processing the pass. Well. actually, I thought everybody use it like me, sadly, it seems not. nalaginrut: it saves a lot of code wingo: i use record matching all the time :) i just don't use inheritance wingo: nalaginrut: ok so one easy option is to make a local copy of (rnrs records procedural) from 73d0a3bccb3c2b79d7f0e3aaca88a84f3a5c3f43 wingo: you'd have to copy the syntactic layer as well wingo: that has the old behavior of "nested" inheritance rather than flat inheritance wingo: disadvantage of course is that accessing a field from the Nth ancestor is O(N) wingo: another possible option would be to change the source program -- instead of specifying record type B as inheriting from A, make A the first field in B wingo: but that's more of a structural change that it sounds like you didn't want to make nalaginrut: does it mean the (parent ...) field is useless for matching now? wingo: nalaginrut: hmm, no it just makes it be the first field wingo: either of the changes i was suggesting keep your `match` expressions the same nalaginrut: is it too hard to set its parent to be the first field in 3.0? wingo: even if it were a good idea, it can't be changed in 3.0 for compatibility reasons wingo: i don't think it's a good idea though. the 2.2 behavior for "nested" inheritance was worse from both performance and memory points of view wingo: i don't know of any language implementation that has inheritance that uses a nested-separately-allocated-instances approach wingo: they do what we do in 3.0. that goes for racket as well btw wingo: note, other kinds of match facilities are also possible wingo: i can imagine match facilities that take a more structured approach; guile's though is quite low-level nalaginrut: should I consider it's a permanent change? Fortunately, Artanis uses a little record matching. I just use a lot of matching with parent in my new compiler, if it's a problem, then I can pin this project to 2.2. nalaginrut: I think it's good to confirm it wingo: yeah, i think you should probably consider it a permanent change. really sorry that it's causing probs for you nalaginrut: well, that's alright, at least we have solution to make the least change. Can you update the parts in doc? In case others encounter the same issue. nalaginrut: thanks for reply ;-) nalaginrut: and I will reply my mail to explain it for a memo jlicht: is there a way to make `read-hash-extend' only work for the current file/module? rekado: jlicht: AFAIK it’s a global change. civodul: yeah, it's global, so use with care (or don't use) civodul: "syntactic sugar causes cancer of the semicolon" jlicht: again, trying to parse snippets of elisp code embedded in guile, so if there is some better way I'd love to know ;-) civodul: ah! civodul: so this is "real" elisp code, not elisp code that you generate yourself? civodul: in the latter case, you could use a syntactic subset common to elisp and Scheme, i think wingo: there is an elisp reader in guile wingo: in (language elisp) wingo: gotta spelunk around to figure out how to use it tho wingo: relatedly, i would like to convert read.c to scheme, and write a little compiler to then compile it to c for bootstrapping purposes jlicht: wingo: I know! I'm using it! I'm now writing a hacky `elisp-write' so I can actually use Emacs' elisp interpreter on serialized S-expressions wingo: dunno if that's reasonable tho wingo: jlicht: ah, fun :) civodul: wingo: re read.c, why not! civodul: performance might not be as good, but it'd certainly be nicer jlicht: it keeps me off the streets :-) wingo: jlicht: hehe :) civodul: and perhaps the compiler to C could be used to implement the GC that's on your mind... wingo: hehe wingo: dunno, that might be a different kind of program wingo: but i did think that generating c from scheme might allow the compiler to ensure that gc integration is correct wingo: if we did ever end up changing to a moving GC, for example wingo: anyway it would let `read` be interruptable wingo: which would be sweet jlicht: I found `(system reader confinement)' in guile-reader: it seems to allow file-local modification of the reader :-) civodul: ah yes, it might still work nalaginrut: civodul: btw, is it possible to support rsync to download guix packages now? ;-) civodul: nalaginrut: no idea! i know rekado looked into it back then, but that's all nalaginrut: sign~I believe it's the only obstacle to advocate guix in China... nalaginrut: of course, I'd be more patient civodul: we'd have to check why that stalled, but maybe you can help? nalaginrut: well, usually we believe it's interfered by the national firewall, the only solution is to provide rsync, and I can tell my friends in university to mirror it periodically. chrislck: nalaginrut is doing god's work :) nalaginrut: they've been maintaining many mirrors of big FOSS projects, so it's piece of cake for mirroring guix packages nalaginrut: well, no matter if you believe, it's the way how Chinese IT industry relies on rekado: civodul, nalaginrut: still the same problem: “guix publish” needs to be modified to create files with more relaxed permissions. That’s really all that’s needed. rekado: such a small thing, but I never got around to fixing it. nalaginrut: rekado: sounds a good news ;-) civodul: rekado: oh that rings a bell dsmith-work: Tuesday Greetings, Guilers wleslie: Happy Tuesday, dsmith! matijja: Hello Guilers! matijja: I have problem with guile-json library. It does not process following example: https://paste.debian.net/hidden/c5486fb2/ matijja: I'm using Guile v3... v2 works fine RhodiumToad: is it supposed to process it? it's clearly not valid json matijja: It should read object by object, I guess? RhodiumToad: looking at the code, it expects to read one single document and then find an end-of-file RhodiumToad: if the data starts with an object (as in this case), it reads one object, skips any whitespace, and then throws error if it's not at EOF matijja: As I see, `json-read' call `json-read-object' Which read object until read # matijja: .. #\} character RhodiumToad: but you didn't call json-read RhodiumToad: you called json->scm RhodiumToad: json->scm calls json-read and then checks for end-of-file matijja: I see. So I should call json-read directly. RhodiumToad: it even has a comment ;; If there's anything else other than the end, parser fails. RhodiumToad: json-read isn't exported, it's not intended to be public matijja: Is there any other way to read stream of json objects? RhodiumToad: why do you have a stream of json objects? RhodiumToad: that said, json->scm's interface could be better thought out, a function to read one value leaving the stream positioned just past the end of it would be of more general use matijja: Logstash sending them to me... matijja: Do you have an idea, why it work with Guile v2? RhodiumToad: are you sure it does? RhodiumToad: the code seems quite explicit that it's intended to produce an error for this case matijja: https://paste.debian.net/hidden/1576fa24/ matijja: With Guile 2.2.6 ... matijja: Maybe it use other version of library... manumanumanu: civodul: so maybe just a clarification that these procedures are in the global environment? I'll submit that. matijja: RhodiumToad: (procedure-arguments (@@ (json parser) json-read)) gives me ((required parser) (optional) (keyword) (allow-other-keys? . #f) (rest . #f)) ... insead of (port and null). How can be procedure arguments changed from these in source? RhodiumToad: not sure what you mean? matijja: If I get refernce to procedure with @@ it requires other arguments from those in library code. matijja: Is guile compiler capable of modifying intern procedures signature? manumanumanu: matijja: json-read got the null argument in a recent release. are you reading the github code or the code you are actually using? matijja: I'm reading code from ~/.guix-profile manumanumanu: nalaginrut: it does not solve your problems right now, but my plan is to write an optimizing pattern matcher based on the algorithm by balland and friends (from 2006) that is also user-extensible (syntax-local-binding to the rescue!). That is probably a year away from being finished, but I have the internal pattern matcher representations done mostly. I _will_ however depend on (ice-9 match) for it. Having a manumanumanu: pattern matcher is very comfortable when writing a pattern matcher. The big upside of the guile implementation compared to the one in the paper is that guile already handles a lot of the things they spend a lot of time doing (DCE, inlining, partial evaluation). manumanumanu: matijja: then I don't know. you seemed to have issues where 2 versions were not playing along well, so I just suspected you had one distro-packaged guile and guile-json and one guix. The one in my distro is at 3.2, whereas the null change was sometime in the 4.0 release manumanumanu: evaluate %load-path manumanumanu: `which guile` in the terminal might give some info as well. matijja: manumanumanu: Load path: (./modules/ /gnu/store/dm6l1jzr5d0sl5z76hk496asnjrxqhg9-logs-0.3.1/share/guile/site/2.2 /gnu/store/6s765nvcy77cla92wxzwhakglzlpv362-guile-json-3.5.0/share/guile/site/3.0 /gnu/store/18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2/share/guile/3.0 /gnu/store/18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2/share/guile/site/3.0 /gnu/store/18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2/share/guile/site matijja: /gnu/store/18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2/share/guile) matijja: ... so I building with wrong version. manumanumanu: yup. that is guile-json 3.5 manumanumanu: 4.0 (or even better git-master) is a _lot_ faster than 3.5. I think we measured something like a 9x speed increase for large json files. matijja: Good. I need a minute to find it in the Guix repo... matijja: RhodiumToad, manumanumanu: Thank you for help. No it works. :) manumanumanu: great! wingo: o/ civodul: hey there! civodul: how are you, wingo? wingo: heya wingo: good! wingo: how you? :) civodul: i'm fine :-) wingo: v little free time these days :P perhaps that will get a little better civodul: heheh xelxebar: Looking for a way to detect avx/avx2. Is there a standard procedure for this? Or should I just be platform-specific and grovel around in /proc/cpuinfo? wingo: you have to do it at run-time; either you emit assembler that calls cpuid and reads the appropriate flags (see lightening's x86.c), or you grovel in /proc/cpuinfo dsmith-work: {appropriate time} Greetings, Guilers pancak3: How do you guys access documentation? I did ,describe copy-file in a repl and it helpfully returned '#f' str1ngs: pancak3: (help copy-file) is useful and (apropos "copy-file") str1ngs: actually (apropos "copy") is more helpful pancak3: help and apropos aren't bound. What module should I import? str1ngs: strange what version of guile are you using? pancak3: 3.0.4 str1ngs: does ,d copy-file work? str1ngs: also ,a "copy" pancak3: ,a copy works but ,d copy-file returns #f str1ngs: use ,d "copy-file" but apropos works better when you give it a lest broader search so ,d "copy" for example dsmith-work: pancak3: Usualy read the guile manual as info from within emacs. dsmith-work: pancak3: But also often use (help ...) at the repl. pancak3: dsmith-work: but help is unbound :'( pancak3: str1ngs: ,d "copy-file" is also #f pancak3: ,a help doesn't show the help function. should it? dsmith-work: pancak3: Hmm. Well, shows how much I've been using it lately. str1ngs: pancak3: does ,h a return anything? str1ngs: pancak3: also ,h should list meta commands. pancak3: maybe you guys could help me with my specific problem. I want to do (copy-file "file-*" "file") where * is a wildcard. str1ngs: pancak3: guile does not support wild cards. pancak3: ok not like a proper wild card. I have a thing that's like blah-28.0.0 and I want it to be blah pancak3: ,h seems to work str1ngs: you would have to do something like (system* "cp" "file-*" "file") which is not ideal I know. I have not tested this just in theory. RhodiumToad: maybe scandir is what you're after? RhodiumToad: see ice-9 ftw str1ngs: can scandir support regex? RhodiumToad: it supports an arbitrary predicate str1ngs: good to know thanks. dsmith-work: pancak3: Are using the wildcard to select lots of file, or just because to lazy to type the full name? str1ngs: that would be more ideal then my system* example pancak3 pancak3: dsmith-work: not lazy, just flexible. There will always be one file to one file copy, but the version will change over time dsmith-work: Yeah, that's what I meant by "lazy". ;^} str1ngs: I did create this witch used wordexp so it supports wildcards and word expansion. http://paste.debian.net/1163780 str1ngs: but this assumes you have a really good use case :P RhodiumToad: wordexp is a horrible thing that forks a shell dsmith-work: From within guile, your are prob just going to have to read/scan the directory and find the match(es) you want. str1ngs: so does system whats your point? RhodiumToad: see also file-system-fold in ice-9 ftw for another method pancak3: OH ,d scandir works! RhodiumToad: I find that ,d isn't working on builtins but does work on functions brought in by use-module pancak3: so ,d scandir gives me way to little info. How can I get more? pancak3: oh, actually it seems to give all the info except the arguments. I kinda want it to give me the arguments though :P RhodiumToad: just type scandir RhodiumToad: $3 = # pancak3: ok ya, but shouldn't it also give me that when I do ,d scandir? pancak3: also I'm realizing it didn't actually give me all the info in the manual after all. It really doesn't seem that great. RhodiumToad: it gives you whatever is in the docstring of the function pancak3: ok, so this works but I want to make sure this is how I'm supposed to do it: (scandir "." (lambda (x) (string-match "emacs-" x))) RhodiumToad: that'll match *emacs-* pancak3: Thanks for pointing that out! I'll need a ^ at the beginning. I was kinda meaning the lambda thing though. That's how you do a predicate? RhodiumToad: yes RhodiumToad: string-prefix? might be of more use pancak3: thanks so much! You guys are very helpful :D pancak3: oh ya string-prefix? is helpful! RhodiumToad: srfi-26 lets you do (cut string-prefix? "emacs-" <>) in place of (lambda ...) pancak3: actually I'm going to go with (string-match "^emacs-[0-9.]*$" x) to make sure it has a version number pancak3: oh that cut thing is really cool. I do hesitate to add to many dependencies to stuff though. is srfi-26 pretty standard? RhodiumToad: haven't tried it, but maybe (cute regexp-exec (make-regexp "^emacs-[0-9.]*$") <>) avoids compiling the regexp each time. pancak3: this line of code should only be hit once so I don't think that would make a difference? but your thing runs with no complaints RhodiumToad: with string-match, you'll be compiling the regexp for each file scanned pancak3: oh that makes sense. RhodiumToad: cute (unlike cut) evaluates the args once initially and returns a closure pancak3: Thank you so much for your wisdom! I'm much more confident in this snippet now :D RhodiumToad: like doing (let ((re (make-regexp ...))) (lambda (x) (regexp-exec re x))) pancak3: Ok, just one more related question. How would I go about finding a directory that's something like "/foo/[0-9.]*/bar". Obviously I could just shove a scandir in the middle, but I'm wondering if there is a better way RhodiumToad: hm. you could split off a prefix of as many directory components as don't have wildcards, and use file-system-fold for the rest pancak3: how do I match a literal .? \. is apparently an invalid character in escape sequence? pancak3: ah, the classic \\. pancak3: I should've known dsmith-work: Does guile have a "raw" string syntax? In an srfi? dsmith-work: https://github.com/lloda/guile-raw-strings manumanumanu: civodul: hi ludo, there is a documentation bug I want to correct, but I just want some input on what would be the preferred way to do it: port-column, port-line and their setters are documented in (ice-9 textual-ports), but are defined in the default environment. There was a reddit question regarding it, and I helped the user hunt down the issue. Should we either 1. just re-export it from (ice-9 textual-ports) manumanumanu: and live with the wart of having it documented in a place where it is not really defined, OR 2. deprecate it in the default environment and move it into (ice-9 textual-ports)? Number 1 is easy. Number 2 means I am in very deep water WRT to making a patch. manumanumanu: civodul: btw, that user was struck by the very same thing that was mentioned in bug-guile today: that the r6rs library form only imports (rnrs), and does not show any bindings from (guile). I am not a native english speaker, and if I had had that issue I don't think I would have understood what the manual says about it. civodul: manumanumanu: hmm i don't see port-line in (ice-9 textual-ports), am i missing something? civodul: you mean (ice-9 ports)? dsmith-work: civodul: "port-column, port-line and their setters are *documented* in (ice-9 textual-ports)" dsmith-work: I guess that means in the Guile manual. dsmith-work: In in api-io.texi: @subsection Textual I/O civodul: dsmith-work: ooh, i see civodul: well in the manual it makes sense to have them under that section civodul: but indeed, they're in the global environment civodul: (the bindings) stis: hey guilers! str1ngs: hello stis! jlicht: Is there any way to copy all bytes (till EOF) from an input-port to an output-port? Blocking as required for either the reading and/or writing? jlicht: My current (read-char) -> (display) loop seems a bit suboptimal :-) rlb: If civodul responded wrt the i386/i686 numbers.test failures, I missed it (got disconnected), but I have a plausible patch now that makes just those tests unresolved there for the time being, and I'll likely replace the blanket test suppression in the most recent NMU with that soon. sneek: Welcome back rlb, you have 1 message! sneek: rlb, civodul says: re https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43262 disabling the test on i386 seems ok rlb: hah rlb: excellent rlb: (and almost certainly better than ignoring all test failures, which is what the nmu did) rlb: Understandable, since marking them unresolved is not entirely trivial if you're not used to guile, etc. rlb: I wondered if the examples/Makefile.am really means to fully expand all the vars based on the configure time values. i.e. if it's intended for use with GNU make, then I could easily see wanting to leave $(CC) as $(CC), not as /usr/exciting/bin/gcc-x86... rlb: cf. https://bugs.debian.org/953407 rlb: i.e. Fully expanding creates an example/Makefile that won't work at all if the system that the package is installed on is different (say wrt usrmerge) from the build system. rlb: Course maybe it's only intended to "give the flavor" with respect to what's required... leoprikler: After reading a bunch of stuff on usrmerge: "There is no way to reliably bring up a modern system with an empty /usr". Uhm, yes, there is? You simply need to put your stuff into /{gnu,nix}/store str1ngs: leoprikler: or you can just init=/opt/emacs/bin/emacs :P leoprikler: heh stis: Ahh got python-on-guile working for 3.0.4. I willnot support the earlier 3.x.x versions ruffni: how can i read the output of (system "foo") call (for example as string into a variable)? i figure it's some kind of port-redirection? pinoaffe: ruffni: usual port redirection directives don't work with system, you can do something along the lines of (let* ((pipe (open-pipe* OPEN_READ "echo foo")) (string (read-line pipe))) (close-pipe pipe) string) pinoaffe: ruffni: I recently ran into the same issue, see https://lists.gnu.org/archive/html/bug-guile/2020-09/msg00007.html ruffni: sooo, did you manage to find a solution? in your example above i can't see where the (system) call would fit in.. pinoaffe: ruffni: rather than use the system function, you use the open-pipe or open-pipe* command ruffni: ah, i see pinoaffe: as far as I can tell, there's no way to redirect the output of system ruffni: ok. thank you for your help! pinoaffe: no problem manumanumanu: oh my god. syntax-local-binding is amazing. manumanumanu: If I define a procedure in _the same module_ in an (eval-when (expand) ...) syntax-local-binding can resolve it! I am a very happy man. civodul: :-) manumanumanu: civodul: this saves me sooo much work. I thought I would have to write a utility to fully expand all macros within a syntax object manumanumanu: whereas I can now cheat and just have people not define loop clauses for my looping facility as procedures. manumanumanu: The option would be to write CPS syntax-rules macros, which is 1. bad for error reporting and 2. insane. civodul: very Kiselyov-y though, no? :-) manumanumanu: which is fine for foof-loop, but I am adding subloops and explicit accumulators. The amount of state I would have to throw around in the macros would have been unbearable. my first semi-working draft had this (loop-next ((lets ...) . lets-rest) ((fors ...) . fors-rest) ETC ETC. lets, fors whens, breaks, finals, accs, withs. manumanumanu: civodul: oh yes! That's where i first got the idea. first response was "nah. not practical", then I found out that both alex shinn and taylor campbell did it, and it was the only way to do it in a low level macro facility. I almost cried. manumanumanu: but syntax-local-binding together with some serious parameter abuse lets me hide most complexity apart from 2 places, which is manageable. civodul: heh, i see manumanumanu: the macro for just parsing the clauses had over 20 clauses itself, and that made use of quite a bit of auxiliary macros to handle complexity. I ended up being scared to touch it, even though it was just barely in a usable state. manumanumanu: anyway. Good night½ manumanumanu: the racket for loops has a much simpler iteration protocol. You just leave the hard part to the inliner. But then you lose the ability to do direct transformations. In racket you can't do (for/stream ((a 0 b) (b 1 (+ a b)) a) to get a stream of fibonacci numbers. You will have to do it as a fold. civodul: hmm stis: I think I found a serius bug in guile 3.0.4, not sure but the result is strange RhodiumToad: specify stis: I want to investigat more but inlining of funcitons may be corrupt str1ngs: leoprikler: (enum->value (gi-cache-ref 'enum ) ) should work as daviid mentioned. but it's nothing like what the GTK documentation has. so defiantly this needs some higher level code to make it easier to use. take gtk_window_set_position(window_p, GTK_WIN_POS_CENTER); vs scheme (set-position window (enum->value (gi-cache-ref 'enum 'gtk-window-position) 'center)) also as daviid mentioned about my example (gi-cache-ref 'enum str1ngs: 'gtk-window-position) should be throw an error if the enum is not found. it returns #f when it can't find something. daviid: str1ngs: wouldn't (set-position window 'center) work? str1ngs: actually it does, but that's inconstant with (gtk-button-new-from-icon-name "gtk-go-back" 3) which takes a int str1ngs: 3 should be an enum value of GtkIconSize . so in C you would use GTK_ICON_SIZE_SMALL_TOOLBAR pinoaffe: Hi Guix! so I want to run some shell command and capture its output in a string, I think something along the lines of (with-output-to-string (lambda () (system "echo bar"))) should do the trick, but it's not working (bar is still just printed, and the expression returns the empty string) - what am I doing wrong? daviid: str1ngs: the inconstance is in the gnome/gtk designm these run-dialog, and gtk-button-new-from-icon-name are exceptions though, in my xperience and for the alter, you should b able to use make #:image ... or something close ... str1ngs: pinoaffe: maybe this would be better? (read-line (open-pipe* OPEN_READ "echo" "bar")) ? you will need to (use-modules (ice-9 rdelim) (ice-9 popen)) pinoaffe: str1ngs: aight, that seems to work pinoaffe: any idea why with-output-to-string doesn't? brendyyn: the output is not what is echot but the return value 0, i think brendyyn: looks like it ends up as the empty string pinoaffe: oh, I think with-output-to-string doesn't redirect stdout, it just ensures that guile functions such as write and display write to a temporary port rather than to the regular stdout str1ngs: daviid: I just use my helper functions. pinoaffe: in other words: subprocesses don't necessarily get assigned the current output port, I think that that's a bug RhodiumToad: subprocesses can't be assigned the current output port if it's not a file manumanumanu: stis: Ahoy! You should take all the lessons learned from the python bytevector-as-strings and dive head first into the discussion over at: https://srfi.schemers.org/srfi-207 leoprikler: it's 2020 and people still talk about ISO 8859-1 leoprikler: when will this nightmare stop? str1ngs: only when morale improves leoprikler. stis: manumanumanu: well noted. I compiled a tiny repository of scheme-python tools in https://gitlab.com/tampe/scheme-python stis: this is standalone and should not need any dependencies apart from guile itself stis: contains the python string operations for bytevectors. stis: I do have a regular expression library for bytevectors as well, but that needs dependencies so I skiped that stis: for doc see http://c-lambda.se/python-on-guile/ manumanumanu: leoprikler: they were wonderful times, at least for the person doing teh programming. manumanumanu: imagine! o(1) efficient random acces into strings, without having to do anything extra manumanumanu: no indexing structures, no wasted space. manumanumanu: the downside was of course that people had huge issues communicating with eachother, but to be frank: unicode only solved the superficial part of that problem leoprikler: which is "only the superficial part"? manumanumanu: leoprikler: it removed all the weird stuff that arose from people having different character encodings. As a species, however, we seem utterly incapable of understanding eachother... leoprikler: Well, true, but at which level do you stop when considering shallow vs. deep? leoprikler: My computer is able to talk to any Japanese computer without producing mojibake. Doesn't help me if I suck at Japanese tho. leoprikler: And even if both I and a person I talk to both fluently speak a language, there can still be misunderstandings [not least to the type 2 nature of human languages]. manumanumanu: What I jokingly tried to imply was that it wouldn't matter if you knew japanese, the people you spoke to would still misunderstand manumanumanu: i should have added an emoji, but the interpretation possibilities of those seem endless. manumanumanu: Anyway: what are you guys up to? leoprikler: Misunderstandings at the human level can typically be resolved through effort, though 😉️ leoprikler: still reading SRFI 207 comments leoprikler: tbh I'm not vibing that syntax at all manumanumanu: why not? It is just a simple extension of the already widely supported #vu8(...) syntax. manumanumanu: minus the v manumanumanu: I am mis-using parameters. manumanumanu: and macros. leoprikler: IIRC vu8 doesn't have string literals inside tho manumanumanu: Well #u8"A" is the same as #u8(65). It is the same as racket bytestrings, but with a slightly different reader syntax. leoprikler: u8"A" might be u8(65) in most most encodings, but in my hypothetical troll encoding, lower and upper case are swapped, so u8"A" is u8(97) manumanumanu: Meh. IIRC srfi-207 mandates ASCII-characters only, which sort of implies you would in your case be left with the bytevector syntax. leoprikler: srfi 210 has some nice things leoprikler: i like multiple values :) RhodiumToad: any of the gobject-introspection experts around and willing to answer an off-topic question, to whit: how do I stop g-ir-scanner from deleting its temp files on failure? leoprikler: GI_SCANNER_DEBUG=save-temps stis: Yeah scheme-python compiles and runs, quick as a fox to install RhodiumToad: leoprikler: thanks! manumanumanu: stis: ? stis: just the scheme part of python-on-guile stis: in a repo of its own stis: https://gitlab.com/tampe/scheme-python stis: doc: http://c-lambda.se/python-on-guile/ stis: manumanumanu: ^^ rekado: stis: for packagers does this mean that python-on-guile depends on scheme-python? manumanumanu: stis: great! stis: rekado: not for now, but I think that it is logical next step to take to avoid duplicating development manumanumanu: still can't get over the fact that the for loops are so... mutable. is there a reason you don't express them as a kind of fold? I guess it is a python thing. stis: it is a python thing, mutability is deep in the design stis: but if we can find a way to do it in another way then great manumanumanu: I will play with it and have a look. I just discovered foof-loop. It is amazing, and I believe it is at the very limits of what someone would want to express using syntax-rules :D stis: lol stis: yea foof loop is a great lib stis: hes the one behind ice-9 match stis: and also the fmt library manumanumanu: srfi-166 is my new favourite srfi. manumanumanu: irregex, show, foof-loop. r7rs small chair? He's amazing manumanumanu: stis: you should have a look at taylor campbell's syntax-rules implementation. it is madness manumanumanu: I am extending and changing it slightly, with support for racket-like subloops, but I am writing it procedurally with parameters to pass the syntax objects around. stis: cool manumanumanu: That way, we need explicit accumulators instead of (for a (listing ...)). Hopefully I can clean up the iterator protocol a bit manumanumanu: (for a (listing ...)) becomes (accumulate a (listing ...)). manumanumanu: good night. stis: looks ok, good night. rlb: sneek: later tell civodul I'm leaning toward just suppressing this test on i386 for now. Please let me know if you happen to think that's not OK for the shorter term: https://debbugs.gnu.org/43262 sneek: Got it. rlb: (For the debs I mean.) daviid: str1ngs: users are expected to retreive instances they are interested in, just as you are doing in your last paste - and then use the interface provided (use enum->value, enum->symbol ... see the doc for a complete list) str1ngs: ahh probably can just use enum->value here str1ngs: no it takes a enum. str1ngs: either way it's quite the boiler plate to use a enum. hence my suggestion. for enum-ref daviid: str1ngs: in that last past, i would first retreive the gi-enum and use or to raise an error if it's not find - ... (let* ((gi-enum (or (gi-cache-ref 'enum 'gtk-response-type) (error "Missing import: " "Gtk" "ResponseType") or something like that daviid: then as leoprikler sugge3sted, i would use case, not (when (= response 'ok) str1ngs: right I had thought to handle exceptions str1ngs: no here I do not need case. it's not the case example it is either 'ok or it should not do anything at all. str1ngs: not the best example* I meant. str1ngs: either way he main point is symbols scales better with symbols and I agree. str1ngs: scales better with case* str1ngs: another use case for enum-ref btw (gtk-button-new-from-icon-name id (enum-ref 'gtk-icon-size 'small-toolbar)) str1ngs: much easier then having to get the enum from the cache then looking up the value. str1ngs: id is a string like "gtk-go-back" daviid: str1ngs: it definitely won't happen in g-golf, enum-ref I mean, as imo, it would be an api design mistake, but if you do that in nomad, i would use another name and probably use a macro (so users don't have to quote), a good name would make it clear that this api has nothing to do with the , api ... dsmith: rlb: About that 386 test failure. I'm curious how the expected and actual values differ. dsmith: rlb: And I wonder if the jit compiler is involved. daviid: wrt 'no here i do not need case', then you should use eq?, not = str1ngs: daviid: I don't only use g-golf with nomad. so if I have to make a module to get an enum. I would imagine that others would suffer from this unneeded boiler plate as well. that's my feed back. rlb: dsmith: yeah, haven't really investigated so far, but I also wondered if it could be x87 (80-bit) related somehow. rlb: (perhaps triggered by compiler changes) dsmith: rlb: Ya, newer compilers sometimes interpret specs differently. If the code is expecting/relying on the old behavior... daviid: str1ngs: do you remember which of your examples uses an interface as one of its signal argument? str1ngs: not off hand, I'd really need to go through this C code one by one. str1ngs: in C it's hard to distinguish an interface since they all appear like classes. it's more relevant to GI str1ngs: well structs daviid: str1ngs: no worry, i'll find it here, it is a scheme example iirc, i think it was a file signal argument or something like that str1ngs: daviid: maybe nomad_app_set_style. GtkCssProvider is an interface. str1ngs: http://paste.debian.net/1163386 daviid: ok, but i was thinking about a scheme example i used already, i think it was a gio based example, for which one of the signal has an interface as one of its args - but no worries, tx str1ngs: that's the only one that stands out. daviid: it's ok, tx str1ngs: I will take notes of something that does not work and why in the future. at-least anything I work around. leoprikler: would (enum->value (gi-cache-ref 'enum ) ) not be correct here? leoprikler: btw. daviid in case enum->value doesn't take lists, you should maybe consider that as syntactic sugar for the flags case civodul: Hello Guilers! civodul: sneek: later tell rlb re https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43262 disabling the test on i386 seems ok sneek: Got it. daviid: leoprikler: yes to the first question, using appropriate values for and - to the second, you prob know, but use gi-gflags->integer and gi-integer->gflags - i'll keep things 'as is' for now seepel: . leoprikler: ah, okay, so enum and flags are different types leoprikler: is there a reason you use enum and gi-gflags like this? (i.e. why not enum->value and flags->integer)? seepel: Hi, I was perusing the jvascript implementation and encountered some syntax I am very unfamiliar with on line 84 of compile-tree-il.scm (https://git.savannah.gnu.org/cgit/guile.git/tree/module/language/ecmascript/compile-tree-il.scm). Could anyone help me understand what this does? daviid: leoprikler: no, maybe i should change that leoprikler: seepel: you mean the "->"? It might be bound to something in one of the modules it uses seepel: In particular there is a let form that begins (let '(return) (list tag) ...), at the repl anything similar that I try results in a bad syntax error. leoprikler: (define-syntax-rule (-> (type arg ...)) `(type ,arg ...)) leoprikler: -> strips away the type, so the result looks more like (let return (tag) ...) leoprikler: btw. tag gets expanded, so I'm not sure what this ends up as either seepel: Oh really? I would expect the syntax rule to expand to `(let (return) ...), though maybe that does explain a little bit. I think my brain silently removed the quasiquote by thinking in terms of common lisp. So maybe the syntax-rule actually returns a list that is interpereted later? leoprikler: it does compile to tree-il, which is a little different than guile leoprikler: tbf I'm not sure how ,'(return) would be handled seepel: Well, I think you've confirmed my suspicion that something else is going on here. I was mostly worried that some module was importing some kind of enhanced let that I was unaware of. seepel: Thanks for taking a look with me! leoprikler: (let NAMES GENSYMS VALS EXP) leoprikler: that's a TREE-IL let seepel: oh... leoprikler: so yeah, return is the name, tag is the gensym, make-prompt-tag is the value and the prompt stuff is the expression seepel: Ahhh, I understand now. It could equally by (let (list 'return) (list tag) ...). Thanks so much, that would've taken me ages :) seepel: Ah yeah, this makes so much sense -> returns the external representation of tree-il dsmith-work: Happy Friday, Guilers!! mwette: o/ mwette: smokey today civodul: hey there! spk121: smokey here, too str1ngs: sneek later tell daviid. Thanks to some review from the guix maintainers. The g-golf guix declaration is now at 84e894e. Also the package reflects the 0.1.0 autotools version as discussed. And thanks to rekado we might have found the major culprit for GdkPixBuf errors. I'm Happy to report g-golf is looking good in regards to nomad a guix right now. sneek: Okay. daviid: . sneek: Welcome back daviid, you have 2 messages! sneek: daviid, str1ngs says: very nice, I think I have some C code that I can switch to using g-golf directly when this is ready. also is a guile primitive? sneek: daviid, str1ngs says: Thanks to some review from the guix maintainers. The g-golf guix declaration is now at 84e894e. Also the package reflects the 0.1.0 autotools version as discussed. And thanks to rekado we might have found the major culprit for GdkPixBuf errors. I'm Happy to report g-golf is looking good in regards to nomad a guix right now. daviid: str1ngs: excellent, tx to all involved in the guix/g-golf package updates - I'll let you know when I commit/push the GInterfaces patches, do you have a link of the C code you are using wrt this? curious, and maybe I could use that to write a check ... str1ngs: daviid: here are the C declarations http://git.savannah.nongnu.org/cgit/nomad.git/tree/typelib/util.h?h=devel . and you can find the code in util.c . Let me found one that actually uses interfaces first though. Save you having to dig around. I'll get back to you. str1ngs: daviid: these get imported into the Nomad typelib namspace btw. so nomad_get_version is (get-version) str1ngs: daviid: also some of name namiing is weird do to port from C to guile. they made more sense when the GOjecct classes were in C. str1ngs: s/do/due* encase you are wondering why there is nomad_app and then just nomad_ daviid: str1ngs: i would be interested 'just' to look at an example of your interface 'usage' - that forced you to use C instead of scheme, so a simple property get/set! or method call that is/are defined by the interface daviid: str1ngs: but don't worry 'too much' either, I already have examples ... daviid: and tests str1ngs: daviid: I need to go over these anyways. And I'll document why I need those C bits and find out if it even applies anymore. str1ngs: daviid: hello, something like this might be useful in g-golf http://paste.debian.net/1163255 . Unless I missed some higher level enum procedures? Right now there seems to much boiler plate to get something that would normally take one word. str1ngs: WDYT? str1ngs: daviid: here it is in practice. (gtk-button-new-from-icon-name "gtk-go-back" (enum-ref 'gtk-icon-size 'small-toolbar)) leoprikler: str1ngs: IIRC you should be able to pass 'small-toolbar and have g-golf work out the numeric value of that str1ngs: I have seen that leoprikler but only in the context of goops keyword constructors leoprikler: okay, but you're invoking a constructor here leoprikler: would it kill you to use the keyword-style ones? str1ngs: in the case of gtk-button-new-from-icon-name it technically a function. leoprikler: technically yes, but in GLib terms it is a constructor str1ngs: though it is used as a constructor it's not the same as a goops contructor leoprikler: my questions is why you use this constructor over the goops one str1ngs: because this is not a constructor its a helper function. leoprikler: okay, and what does this helper do besides constructing things? str1ngs: GLib constructor looks like this g_object_new(GTK_TYPE_WIDGET, "visible", TRUE, NULL). _new function are syntax sugar around that. with goops we don't nee to use new constructors functions we an use make with keywords for properties which tend to take symbol enumerators. in the case gtk-button-new-from-icon-name I'm just using it for it's sugar really. str1ngs: anyways putting constructors sill need the values of enums and flags for example check the value of response dialog. str1ngs: constructors aside* leoprikler: true, though in this case you could probably convert the value to a symbol and then use pcase leoprikler: *case str1ngs: the value are enums so you need to know what what value GTK_RESPONSE_YES is that could change you cant expect it to be 3. in the case of g-golf you it needs to be looked up in the cache like my helper function enum-ref does. For enums that are traditionally one word it would be helpful to have a higher level way to retrieve there values. so that was my proposal to daviid. leoprikler: my point is if you use (enum->symbol [enum-type] [value]), you should get the symbol. So if you need to parse a Gtk response, that would be the way I'd prefer it leoprikler: you're correct in that symbol[s]->enum is missing and I have no idea why str1ngs: yeah, needs a little bit of a higher abstraction. str1ngs: lets see what daviid says. I's possible it's on his TODO or it just hasn't been needed yet. str1ngs: leoprikler: this might be useful test case. http://paste.debian.net/1163258 str1ngs: see the constructor takes a symbol enum. but then later we need to get response tyep str1ngs: err type* leoprikler: instead of matching the response against ok, why not assoc-ref response and then compare against the ok symbol? str1ngs: not sure what you mean by that. str1ngs: enum-set is an alist the keys are symbols str1ngs: so the values are integers str1ngs: also I don't need nested let here. :P leoprikler: you already have a let* leoprikler: so you know response by then str1ngs: leoprikler: (run dialog) returns a signed integer. maybe that is the confusion str1ngs: ? leoprikler: so? leoprikler: ahh, you'd need a reverse lookup str1ngs: probably we can do that with some tweaks to umm lets call it 'enum->value ? str1ngs: or 'enum->int I guess guile treats signed ints as ints. str1ngs: actually if we did reverse lookup then yeah it can be 'enum->symbol leoprikler: you already have enum->symbol str1ngs: in g-golf? leoprikler: yep leoprikler: at least according to the docs str1ngs: I think this will work. str1ngs: though only for response dialog. not for passing enums to say a function leoprikler: yeah, for that we'd need symbol->enum str1ngs: definitely an improvement http://paste.debian.net/1163263 str1ngs: I need to dynamic wind this too str1ngs: if thunk throws an exception need to make sure (destroy dialog) is always called. leoprikler: you can compare symbols with eq? instead of = str1ngs: right, I think eq? is preferred always except for strings and integers? str1ngs: ie string= and = str1ngs: this examples gets better with case. here I'm only want 'ok so I'm explicit leoprikler: eq? is preferred for symbols and list pointers leoprikler: normally you'd use equal? if you don't care (IIRC also for strings) leoprikler: = is for numeric comparisons, especially with floats str1ngs: right that's why I had it before. thanks for catching that. str1ngs: yes-or-no-p is just stop gap till I can fix some coroutine issues in emasy. I'd rather use the minibuffer echo area like emacs. leoprikler: string= and other = functions (list=, vector=) are specialized forms of equal?, that do type-checking on top str1ngs: but I'll probably keep this gui yes-or-no-p for special GTK instances leoprikler: tbh you should probably add some more parameters to it, so that you can distinguish the cases in which you'd want to spawn a dialog from those where you'd want to use the minibuffer leoprikler: e.g. for M-x you likely want the minibuffer, but if you click on an icon you likely want the dialog str1ngs: also equal? can be specialized with goops leoprikler: as can be eqv? and = str1ngs: leoprikler: I can't parameterize this is platform code. an minibuffer yes-or-no-p is better since it does'nt require a platform. leoprikler: guile-gi has a = override for numeric comparisons with enums IIRC str1ngs: plantform meaning GTK, QT, win32 leoprikler: you should still distinguish between maybe-platform? and never-platform? str1ngs: I could, but not useful since on other platforms this code would never be seen str1ngs: I have a higher generic abstraction. so as long as the platform has a working minibuffer. then yes-or-no-p work work via a minibuffer prompt. just like emacs. leoprikler: you do know that emacs uses platform-specific widgets for certain cases, yes? leoprikler: If dialog boxes are supported, a dialog box will be used if ‘last-nonmenu-event’ is nil, and ‘use-dialog-box’ is non-nil. str1ngs: of course, but for maintainability its easier to maintain a non platform specific yes-or-no-p str1ngs: the less GTK code I have to write the better IMHO :) dsmith-work: Morning Greetings, Guilers bonz060: Hi guys... bonz060: Is there a way to pipe the output of (current-error-port) t oa string. bonz060: ? rekado: from within Guile or with a shell? rekado: with a shell it’s just 2>somewhere alextee[m]: is it possible to compile a library out of guile code? alextee[m]: my use case is for zrythm. i want to add the possibility of writing DSP code in guile, and then compiling it to a library and loading it into zrythm to be used in time-sensitive parts alextee[m]: another option is to include a faust compiler and support faust.. but guile is better ! alextee[m]: `guild compile` hmm alextee[m]: can these compiled files then be loaded into C? RhodiumToad: they're not compiled to native code alextee[m]: ah that sucks. is there no way to compile code from guile to native code then? alextee[m]: i could expose some guile API that can be used then i could parse the guile stuff and generate corresponding C code from it and compile that maybe... RhodiumToad: no (though there is a jit, in guile 3) rekado: alextee[m]: eventually, the compiler may produce ELF files, so it would be “native” code, but this would still be stuff that’s loaded into the Guile VM. rekado: if time is a concern: the Guile VM is plenty fast alextee[m]: rekado: it doesnt have to be perfect, but will it be fast enough to be used duringaudio processing? alextee[m]: ok nice, looking forward to that then rekado: obviously it will have to be compiled (so that the Guile VM can be used directly) and not read by the Scheme interpreter (which is *much* slower) alextee[m]: i'll be an early adopter :-) rekado: so compilation helps here. rekado: but garbage collection and audio processing have always been at odds with one another alextee[m]: is there no way to specify when to garbage collect? rekado: it’s complicated, but I don’t know enough to guide you leoprikler: you can manually invoke (gc), and probably otherwise tweak some metrics, but I think that is best avoided rekado: you *can* influence the garbage collector (and you can write code that produces less garbage), but the farther you go with this the farther you are removed from writing Guile. rekado: I think you can also delay garbage collection, hopefully long enough that you can run (gc) in a less critical phase. rekado: personally, though, I’d probably use Faust alextee[m]: yeah im thinking the same thing, faust is starting to sound a lot better for this rekado: it’s made for writing DSP / data flow code rekado: you could generate faust from Guile, of course, but … why bother :) alextee[m]: i'll keep guile only for UI related things and actions that run in the UI thread i guess leoprikler: if you want to use scheme, there are also some implementations, that directly produce C/machine code leoprikler: Guix has recently packaged loko-scheme, so you may try that in the meantime alextee[m]: oh cool alextee[m]: but still i guess garbage collection is a thing i need to worry about alextee[m]: there must be no allocations or anything that might block alextee[m]: unless there's something specifically designed for time-sensitive-ish things alextee[m]: could add it as a toy anyway because it's fun. it will just probably clip at times rekado: alextee[m]: perhaps Guile itself could gain alternative memory management in the long run. alextee[m]: that would be cool leoprikler: hmm, theoretically you could roll your own using bytevectors manumanumanu: ahoy tohoyn: daviid: Have you considered upgrading G-Golf to guile 3.0? tohoyn: sneek, botsnack sneek: :) str1ngs: tohoyn: hello, there is work being done on that. but it's not the top priority right now. str1ngs: daviid probably could update you more on it though. dsmith-work: Morning Greetings, Guilers catonano: hi dsmith-work cyclopsian: Hey everyone, I've published some guile bindings for the wayland window system last month https://github.com/cyclopsian/guile-wayland cyclopsian: along with some bindings for xkbcommon and epoxy https://github.com/cyclopsian/guile-epoxy https://github.com/cyclopsian/guile-xkbcommon cyclopsian: with that, I was able to get EGL to work as well (it was never implemented in guile-opengl) rekado: cyclopsian: oh, that’s great! rekado: perhaps we will see a new guile-wm but for wayland then…? dsmith-work: So what's with wayland anyway? Why do people want it? Maybe I'm just old, but X11 seems fine for me. rekado: AFAIU X11 is not used as intended dsmith-work: Not trying for a flame war or anything. Just curious. rekado: combined with the separation of composition and writing to a window that’s done by toolkits there are a few ugly side effects, such as blanking when switching windows and the like rekado: wayland is a simplification in that regard as it makes the common use-case less cumbersome for today’s toolkits str1ngs: cyclopsian: https://github.com/cyclopsian/guile-wayland this is awesome. will this work with 2.2.7 at all? cyclopsian: str1ngs: probably? I never tested it, but it don't think it uses anything specific to 3.0 str1ngs: cyclopsian: great. cyclopsian: let me know if you develop something cool with it :) joshuaBPMan: Hey guile people, I'm trying to send an email with guile... joshuaBPMan: I found this example on line joshuaBPMan: https://lists.gnu.org/archive/html/guile-user/2014-10/msg00030.html joshuaBPMan: but it's a little confusing. I've got msmtp set up. I tested it in a shell, now I am just trying to get it to work from guile. dsmith-work: Cool joshuaBPMan: I figured it out: joshuaBPMan: https://video.hardlimit.com/videos/watch/95ddfcce-0be7-4d2c-a1d4-8017deedfdeb joshuaBPMan: hmmm. now I'm trying to find guile's hash-ing function, so I can generate a message-ID. joshuaBPMan: well that was easy (hash ) rekado: joshuaBPMan: that’s not how you generate a cryptographic hash, though rekado: the second argument is for the size of the hash table dsmith-work: Tuesday Greetings, Guilers johnjay: dsmith-work: i think i asked this before but is guix the package system for guile? johnjay: i.e. the equivalent of melpa/apt/yum? dsmith-work: Well, I guess it looks like it's becoming that. But guix is actually a system package thingy. (never used guix) ardaukas: hello? :) ardaukas: I'm just new to scheme and Guile, just starting to try it ... because I'd like them to be my primary coding langs ardaukas: I hope that you can help me with some basic questions: ardaukas: - best web/forum (kind of stackoverflow) to ask questions about scheme/guile? dsmith-work: ardaukas: The mailing lists and here. ardaukas: - For my first network exercise I want to perform a DNS request to a specific name server, but can't find any library specific for DNS requests in Guile ... so I must be looking in the wrong place. Any suggestion for this use case? dsmith-work: The mailing lists are archived, and recently, this chan is now logged. ardaukas: I mean, I'd like to not make my "basic exercise" grow by having to implement it in C ;) ardaukas: I've tried "getaddrinfo" ... but does not seem to give the IP addresses nor I find any way to convert it's answer into an A IP value, for example catonano: ardaukas: I think you should get a connection to a dns server and then interrogate it in code you write yourself catonano: and then maybe you could just print the result in the repl catonano: as far as I can tell there are no libs for this but it shouldn't be very hard catonano: there are examples of tiny servers and clients in the manual ardaukas: there must be some lib, it's a basic network request dsmith-work: ardaukas: From your guile prompt, try (help getaddrinfo) Also https://www.gnu.org/software/guile/manual/html_node/Network-Databases.html ardaukas: as an example: ardaukas: (addrinfo:canonname (car (getaddrinfo "www.gnu.org" #f AI_CANONNAME))) ardaukas: $1 = "wildebeest.gnu.org" catonano: I used a little utility called "nc" to inspect the network traffic my guile script was generating, as an aid ardaukas: (guile-user)> (addrinfo:addr (car (getaddrinfo "www.gnu.org" #f AI_CANONNAME))) ardaukas: $2 = #(2 3509828756 0) ardaukas: ... seems that could be a matter of converting that number to an IPv4 octet sequence? dsmith-work: ardaukas: Do you want it printbale in dotted quad notation? dsmith-work: So 3509828756 is #xd133bc94 is 209.51.188.148 ardaukas: ?? :O dsmith-work: You might want inet-ntop ardaukas: So it was there and just was missing the last step ?! dsmith-work: Ya. getaddrinfo returns things that are nice to pass to connect ardaukas: Juas! I had it there :) , just didn't think about "convert decimal to IP" dsmith-work: So that #(...) is a vector with the adress, address family, (and something else). ardaukas: great! ardaukas: oooook ardaukas: first time I use it (well, everything, scheme, guile ...) just had guessed that should be the one ardaukas: nice ardaukas: Thanks a lot! :) ardaukas: let me check inet-ntop dsmith-work: Well, it's just a fairly thin wrapper over the C getaddrinfo dsmith-work: As is inet-ntop ardaukas: I've seen it's a scheme function in POSIX->networking ardaukas: but guile complains saying it's an unbound variable ardaukas: In the docs there's no reference saying that an import is needed dsmith-work: scheme@(guile-user)> (addrinfo:addr (car (getaddrinfo "www.gnu.org"))) dsmith-work: $1 = #(2 3509828756 0) dsmith-work: scheme@(guile-user)> (inet-ntop (sockaddr:fam $1) (sockaddr:addr $1)) dsmith-work: $2 = "209.51.188.148" dsmith-work: That's from just starting guile. ardaukas: not my case: ardaukas: > $ guileGNU Guile 3.0.4 dsmith-work: scheme@(guile-user)> (version) dsmith-work: $3 = "3.0.4" dsmith-work: Same ardaukas: ?? exiting and retrying ... now it works !?! dsmith-work: Though I don't think you can use getaddrinfo to query a specific dns server. It just calls the local name resolver. ardaukas: can you check this in your side?: ardaukas: scheme@(guile-user)> (inet-ntoa 2130706433);;; :5:0: warning: possibly unbound variable `inet-ntoa'ice-9/boot-9.scm:1669:16: In procedure raise-exception:Unbound variable: inet-ntoa ardaukas: scheme@(guile-user)> (inet-ntoa 2130706433);;; :5:0: warning: possibly unbound variable `inet-ntoa'ice-9/boot-9.scm:1669:16: In procedure raise-exception:Unbound variable: inet-ntoa ardaukas: sorry for the formatting ... let me try ardaukas: scheme@(guile-user)> (inet-ntoa 2130706433) dsmith-work: It's inet-ntop not inet-ntoa dsmith-work: And you have to pass in the family, because it also does ipv6 ardaukas: yes, yes, but attending to Guile's doc, inet-ntoa should perform the conversion: ardaukas: https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Network-Address-Conversion.html#Network-Address-Conversion ardaukas: that line I've pasted is just an example from the doc dsmith-work: Note the "1.8" in that url? dsmith-work: https://www.gnu.org/software/guile/manual/html_node/Network-Address-Conversion.html is the 3.0.4 docs ardaukas: I was just about to tell you that the search engine had taken me to a wrong version :( ardaukas: have just realized of it ardaukas: and I agree with you that seems that getaddrinfo asks to the local system, no way to send the request to the remote DNS server (as "dig" does) dsmith-work: Yes, dig is a tool used specifcally for dns queries. getaddrinfo is for name resolution in general. (like it can use /etc/hosts or nfs or whatever is in nsswitch.conf. Well, suspect. Never tried..) ardaukas: yes, seems so. Thanks a lot, I'll check how launch dig from guile dsmith-work: dig -> (D)omain (I)nfo (G)roper dsmith-work: s/(and something else)/and port number catonano: ardaukas: sorry I misunderstood ardaukas: Thanks, you've been very helpful. Seems that there's nothing like GNU/Linux dig for scheme ardaukas: I'm just building the master branch of guile 3.0.4 for Ubuntu str1ngs: ardaukas: which variant of ubuntu are you using? str1ngs: focal should have guile 3.0.1 str1ngs: in the repos I mean ardaukas: Ubuntu 20.04 ardaukas: I've just checked /usr/bin/guile and it's 3.0.4 ! str1ngs: :) ardaukas: curious, before I was lunching it from /usr/local/bin and was 3.0.1 ... there's something wrong str1ngs: guile --version is 3.0.1 for me. using focal 20.04 ardaukas: yesterday I downloaded the 3.0.4 tar.gz and built and installed it ... and installed a 3.0.1 guile REPL ?? str1ngs: lsb_release -a Description: Ubuntu 20.04.1 LTS str1ngs: ardaukas: did you install it with prefix /usr? ardaukas: no, just configure, make, sudo make install I think ardaukas: I'm checking it again str1ngs: maybe use make uninstall to remove /usr/local . make sure you still have the same configure prefix str1ngs: that's if you intend to use repo guile 3 str1ngs: ardaukas: to remove the guile installed to /usr/local. bad wording on my part. dsmith-work: Try "type guile" from a bash shell ardaukas: yes, did it ardaukas: linked to /usr/local/bin/guile, which is 3.0.4.35... ardaukas: and /usr/bin/guile launches 3.4.35... too ardaukas: excuse me ardaukas: 3.0.4.35... I mean ardaukas: Ubuntu 20.04.1 LTS ardaukas: well, no problem, nevertheless, I'll try building the very latest version and deploy it to /usr/local ardaukas: build fails. Tries to run "makeinfo" command, which is not found ardaukas: so, dependencies on flex an texinfo so far ardaukas: So, rebuilding now, thanks for your help :). I have to leave now, hope to be back soon dsmith-work: Often, "apt-get build-dep" for a previous version will install the dev packages you need. mwette: . RhodiumToad: moo simendsjo: Is https://www.gnu.org/software/guile/libraries/ currently the best place to find libraries for guile? I asked around on the mailing list some time ago, which caused some rants on the topic, but didn't conclude on any better list even though this list is probably lacking a lot. dsmith: simendsjo: There is also this list: dsmith: sneek: guile-software? sneek: Its been said that guile-software is http://sph.mn/foreign/guile-software.html simendsjo: sneek: Thanks, didn't know about that one. Looks like there are projects there not added to guix too. civodul: simendsjo: the list of gnu.org/s/guile/libraries is built from Guix packages, so at least you know it's usable and somewhat "lively" civodul: the downside is that well, anything not in Guix is missing :-) matijja: Hello Guilers! RhodiumToad: good evening matijja: I have problem with this example: http://paste.debian.net/1162918/ matijja: Why I can't close only output port? RhodiumToad: the interface for bidirectional pipes is a bit ... broken matijja: hmm, is there any workaround? RhodiumToad: yeah, sec RhodiumToad: I think you basically have to stick to using open-process and handle the read and write ports separately RhodiumToad: open-input-output-pipe hides the read and write ports inside a closure, so there's no simple way to access them rlb: Debian's had some additional failures in test-out-of-memory, now on ppc64el, even with -fno-stack-protector: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966300 (that links to a bug-guile bug from 2.2.2, i.e. this test has long-standing issues). Since we've already commented out most of the test, I'm thinking about just disabling it for now in Debian, but of course happy to re-enable it, or help with testing if/when anyone has rlb: time to pursue it. rlb: "already commented out": https://salsa.debian.org/rlb/deb-guile/-/blob/deb/guile-3.0/v/3.0.4-1/test-suite/standalone/test-out-of-memory#L63-83 matijja: RhodiumToad: I did it. Thank you. (http://paste.debian.net/1162922/) rlb: New(?) numbers.test failure on i386: https://bugs.debian.org/968403 I'll forward it in a minute. hendursaga: Is there a non-blocking scm_shell function or would I have to run that under a thread? I'm rather new to C. rlb: iirc that's just blocking? but you could use also open-pipe. rlb: or open-pipe* matijja: Does Guiel has any `mkfifo' function? Or I can just `(system "mkfifo /tmp/my-fifo")`? matijja: *Guile hendursaga: rlb: Guile's open-pipe? I'm trying to extend a C program to be scriptable in Guile, and I want the user to have a REPL. RhodiumToad: matijja: mknod can make fifos. matijja: RhodiumToad: Thanks. hendursaga: Oh! Perhaps I could run a REPL server? Like how Geiser works? rlb: hendursaga: ignore me -- you clearly said scm_shell, but I heard scm_system :) matijja: hendursaga: Did you check that? (info "(guile) REPL Servers") matijja: RhodiumToad: Is there any reason, why (mknod "/tmp/p" 'pipe #o666 0) makes rw-r--r-- permissions. But (chmod "/tmp/p" #o666) do the trick? RhodiumToad: umask RhodiumToad: mknod, like all file creation calls, respects the current process umask, while chmod does not since it's supposed to set exactly the mode specified matijja: Ah ok. Thanks. wingo: o/ hendursaga: matijja: It appears I can use spawn-server.. manumanumanu: Ahoy! str1ngs: daviid: a early WIP of menu-bar-mode https://bufio.org/images/2020-09-05-202237_2048x2121_scrot.png daviid: str1ngs: very nice str1ngs: still working on something. obviously now icons yet daviid: sure str1ngs: I need a way to dynamic change the menu bar when buffers change. not all buffers a uri str1ngs: have * catonano: sneek later tell minerjoe I guess you need to visit the "tree" sneek: Got it. daviid: still need to commit and push, but things start to work wrt using multiple inheritance to implement GInterfces - https://paste.gnome.org/pad6eyt6i daviid: here is a complete description of the class, as now 'seen' by g-golf - https://paste.gnome.org/p5ipcftjl - pretty cool stuff :):) daviid: have to rest, bbl janneke: so...where is (add-to-load-compiled-path (getcwd)) *: janneke types (add-to-load-path (getcwd)) (set! %load-compiled-path (cons (getcwd) %load-compiled-path)) minerjoe: crickets sneek: Welcome back minerjoe, you have 1 message! sneek: minerjoe, catonano says: I guess you need to visit the "tree" minerjoe: catonano: what is the "tree"? catonano: minerjoe: usually a xml document is considered a "tree" catonano: it's a data structure, it's common in computer science catonano: there is a standard algorithm to "traverse" a tree and extract information from it.Implementing it in scheme require a few lines of code catonano: requireS catonano: minerjoe: I hope I helped you minerjoe: catonano: thank you. I understand. I was hoping to avoid rolling my own. I figured that must have been solved by now. Scanning SXML docs for patterns? catonano: 🤷‍♂️️ rekado: minerjoe: with SXML you can use sxpath to find elements matching a path. stis: tjena guilers! chrislck: sxpath is amazing str1ngs: davidl: very nice, I think I have some C code that I can switch to using g-golf directly when this is ready. also is a guile primitive? davidl: str1ngs: maybe you meant to write this to daviid? str1ngs: apologies. I should not IRC before the first coffee in the more :) davidl: no probs :-) str1ngs: sneek later tell daviid. very nice, I think I have some C code that I can switch to using g-golf directly when this is ready. also is a guile primitive? sneek: Got it. str1ngs: davidl: I appreciated letting me know I got the wrong nick. str1ngs: I'd be like maybe daviid doesnt like me anymore! daviid: . sneek: Welcome back daviid, you have 1 message! sneek: daviid, str1ngs says: g-golf and nomad running on my pinephone https://bufio.org/images/2020-09-03-220022.png daviid: str1ngs: very nice! the pinephone runs puros or another os? jusr curious, obviously, it looks like a gnome phonetop :) str1ngs: daviid: pinephone runs quite a few distro's. I'm using mobian its's based off of buster. and the WM is phosh it's a wayland compositor, same one used by librem daviid: str1ngs: ok tx, phosh is being devlopd by purism? str1ngs: right str1ngs: though one day nomad-shell might exist \o/ *: str1ngs crosses fingers daviid: do you use external kb, i was curious, about C- and M- commands str1ngs: for nomad I use a bluetooth keyboard. but that's not practical I need to implement a menu-bar-mode and then maybe a phone-mode daviid: ok str1ngs: daviid: it's going to be interesting translating emacs methodology into a phone UI daviid: str1ngs: yes, and i wish you good ideas and good luck, it' not going to be easy :) str1ngs: on the bright side will add a UI to nomad that users of firefox etc. use str1ngs: even emacs has menus, though I turn them off myself. daviid: yes (to both :)) g0d_shatter: str1ngs are you around tonight? str1ngs: g0d_shatter: hello, I am around yes. g0d_shatter: str1ngs, yesterday when you installed gdb and got it to work with guile on focal (ubuntu) you compiled it by hand, right? You grabbed the source and configured/make/make-install, yes? str1ngs: g0d_shatter: right g0d_shatter: I've got a focal VM up with the other tool I need finally compiled and I'd like to figure out how to get it working on this one g0d_shatter: cool g0d_shatter: str1ngs do you remember what flags you gave to configure it? g0d_shatter: was it just "--with-guile"? str1ngs: I think I use --with-guile but it should auto detect. with --with-guile either way. str1ngs: use with* g0d_shatter: got it, thank you str1ngs: no problem g0d_shatter: no dice, yet again str1ngs: g0d_shatter: doe /share/gdb/guile/gdb.scm exist str1ngs: does* g0d_shatter: str1ngs sorry! I missed this response, so I'm not sure why, I didn't use the prefix flag this time, but no, /share/gdb/guile/gdb.scm does not exist g0d_shatter: none of the necessary guile libraries are copied into /share/whatever str1ngs: sneek later tell g0d_shatter. make sure you only have guile-2.0-dev installed it will install what it needs. for gdb it does not acutally need guile-2.0 the interpreter. after that confirm with pkg-config it finds guile-2.0 libs with . pkg-config --libs guile-2.0 . make sure you don't have PKG_CONFIG_PATH set to something else just in case too. sneek: Okay. minerjoe: Hello all. I'm lost trying to find a good way to parse web pages and then extract data from them in guile. I can get sxml alright, but what is a good way to query it such as list all the links etc.? civodul: g0d_shatter: yes civodul: that's for the next GDB release g0d_shatter: civodul: right, GDB 10, I just wanted to make sure that the patch makes allows one to use the latest guile version and not just guile-2.2, which is what was described in the patch by Ludovic. g0d_shatter: apparently a patch was submitted today on the blocking bug for GDB 10 so that should get out in the next month daviid: str1ngs: hello, no sure i understood, but the version in configure.ac now is 0.1.0, i'm happy to bump it to 0.2.0 if that helps? str1ngs: daviid: no need, as long as you are sticking with 0.1.0. sorry for the noise the mistake was on my end when I initially submitted the guix package. g0d_shatter: I'm having problems compiling older versions of gdb with guile support, for whatever reason "sudo make install" is failing to install the required guile files to their proper system location, and even moving them there by hand doesn't seem to help g0d_shatter: is this a problem that sounds familiar at all to anyone? str1ngs: hello g0d_shatter what error do you get when you do sudo make install? str1ngs: g0d_shatter: ahh I read your question better. are you using --prefix=/usr assuming you are on linux. g0d_shatter: str1ngs I have used that switch and not used it, both times the libraries aren't copied to their proper locations str1ngs: do you have more then one version of guile installed? Debian with use alternatives which could confuse things str1ngs: try using ./configure GUILE=/full/path/to/guile --prefix=/usr str1ngs: also check configure for gdb does it actually find guile? str1ngs: assuming you are having issue with the gdb make install. g0d_shatter: str1ngs I don't, I've been bitten by the "multiple versions installed" issue before str1ngs: gotcha I guess you are on debian based system? g0d_shatter: str1ngs It does *find* guile, because I don't think it would compile if it didn't g0d_shatter: or at least it hasen't before g0d_shatter: I am str1ngs: which gdb, it might compile the question is does it find guile support str1ngs: grep guile config.log might give a clue. g0d_shatter: debian stabel str1ngs: which toy is that buster right? g0d_shatter: gdb 8.2.1 g0d_shatter: yep str1ngs: do a configure and check config.log str1ngs: sometimes configure will give summary as well. g0d_shatter: str1ngs thank you for taking the time to help out, I'm going to retry the whole thing from configure to make again g0d_shatter: the flags i'm using are ../configure --prefix=/usr --with-system-readline --with-guile str1ngs: I treat guix like a gnu mirror. guix build gdb@8.2.1 -S str1ngs: /gnu/store/w3cg73az1kly0qj8kxy9l8fw484ljzpm-gdb-8.2.1.tar.xz g0d_shatter: I honestly have no experience with guix other than reading the code for the elf parser, which I have heartily copied from :) johnjay: g0d_shatter: elf parser? what is that g0d_shatter: however looking at the gdb docs, at the configure options, I see one called "--with-relocated-sources=dir" which I'm wondering if I should pass since I'm building this in a directory off of my home str1ngs: g0d_shatter: I'm not seeing any option to build gdb with guile support. or do you build guile with gdb support g0d_shatter: johnjay https://git.savannah.gnu.org/cgit/guix.git/tree/guix/elf.scm g0d_shatter: str1ngs no you build GDB with guile support, hold on I'll link you the doc showing it g0d_shatter: str1ngs https://sourceware.org/gdb/current/onlinedocs/gdb/Configure-Options.html g0d_shatter: control-f "guile" will take you down to it, its the 8th flag up from the bottom of the page dsmith: g0d_shatter: Hmm. You might need to run ldconfig (as root) after installing guile. Not saying that's your issue, but it might be. johnjay: g0d_shatter: interesting. why does it say it wasn't needed anymore and what happened to it? str1ngs: g0d_shatter: got it. it should also autodetect g0d_shatter: dsmith: if I'm installing guile via debian's apt, does that matter? g0d_shatter: dsmith so far I use apt to install all of the necessary dependencies, grab the appropriate source and then try to compile it in a sub directory of home and just "sudo make install" after "make". gdb compiles, with partial guile support, and installs, but doesn't copy the guile libraries over to the proper system location g0d_shatter: johnjay: I'm guessing you're referring to the comment in the elf parser file? I don't know, its not the only elf related file in the guix tree, I believe johnjay: is guix basically apt/melpa/cpan but for guile? str1ngs: g0d_shatter: what is your guile --version? str1ngs: g0d_shatter: I got it to buile guile support but only guile-2.0 g0d_shatter: str1ngs yep only 2.0 until the next release of gdb, what was the recipe you used to build it with guile support? was it on buster? str1ngs: g0d_shatter: just make sure you have guile-2.0 and guile-2.0-dev installed str1ngs: maybe even guile-2.0-libs g0d_shatter: str1ngs huh, I do have all of those installed g0d_shatter: hoping that ldconfig trick dsmith mentioned does the trick we'll see, I'm compiling it now str1ngs: g0d_shatter: after make . do make install DESTDIR="$PWD/temp" then you can see the tree with. find ./temp g0d_shatter: and its compiled the guile libs so far, lets see if it puts them where they're supposed to go str1ngs: you are installing to /usr or somewhere else? g0d_shatter: str1ngs will do! g0d_shatter: yeah, --prefix=/usr str1ngs: also gdb does not install to standard paths. it does not use site path str1ngs: so installing to /usr probably won't help you str1ngs: I wold just use /usr/local or $HOME/local str1ngs: you may need to set GUILE_LOAD_PATH str1ngs: it *does* bytecompile sorry str1ngs: so you'll want GUILD_LOAD_COMPILED_PATH too g0d_shatter: str1ngs so when I tried to build gdb with only the --with-guile flag, it installed to /usr/local but still didn't collect the guile files to /usr/share/gdb/guile/gdb str1ngs: (gdb) guile (+ 1 1) str1ngs: 2 str1ngs: awww yeah g0d_shatter: nice str1ngs: g0d_shatter: just have guile-2.2 and guile-2.2-devel installed and configure with --with-guile. make install start gdb and try guile (+ 1 1) str1ngs: don't bother with guile-2.0 str1ngs: trow that ole thing out! :P g0d_shatter: str1ngs is this on Buster?!? str1ngs: I'm on focal 20.04 g0d_shatter: I don't know what that is str1ngs: think of it as bullseye str1ngs: but the toys never get put away :P str1ngs: g0d_shatter: it's ubuntu 20.04 LTS g0d_shatter: I see g0d_shatter: str1ngs: what version of GDB are you using? str1ngs: I tested with gdb-8.2.1 g0d_shatter: hmmmmmm g0d_shatter: well lets give it a shot str1ngs: from what I gather gdb only needs libguile and it loads what it needs based on the --prefix. so no GUILE_LOAD_PATH required etc. g0d_shatter: well I just purged guile-2.0 and installed guile-2.2 via apt, as well as guile-2.2-dev and guile-2.2-libs so we'll see if this actually works str1ngs: g0d_shatter: I was kidding about guile-2.0 but if you don't actually need it best to remove it. str1ngs: some autotools get fancy with getting guile versions. you can though somtimes use ./configure GUILE=/usr/bin/guile-2.2 to un-confuse it g0d_shatter: str1ngs kidding how? str1ngs: g0d_shatter: or when I said throw that ole thing out :P g0d_shatter: I mean I've had problems with gdb finding the correct version of guile when building it for a couple years now g0d_shatter: and the only times I've had it correctly build is with only one guile installed str1ngs: if you see gdb/configure.ac it gets all fancy dsmith: g0d_shatter: IF you have installed guile and all by packages, no, you don't need to run ldconfig. g0d_shatter: dsmith: gotcha, thank you dsmith: There is a cache used by the shared object loader, and ldconfig updates that cache. If you copy a lib*.so to some dir in your lib path, and it's not being found, running ldconfig will let it be found. g0d_shatter: dsmith: ahhh g0d_shatter: dsmtih: thank you g0d_shatter: str1ngs: well its not working on this install, I get the same "cannot find a usable guile from guile-2.0" error on executing make g0d_shatter: str1ngs: so at this point I'm just going to be trying to build the GDB snapshot on an appropriate system I guess str1ngs: g0d_shatter: what does this output guile -c "(display (version)) (newline)"; pkg-config --libs guile-2.0 g0d_shatter: str1ngs: 2.2.4 on the first command and no libs found on the second (since I had deleted all traces of any guile-2.0 pacakges) str1ngs: g0d_shatter: apt show guile-2.2-dev g0d_shatter: they're all gone, I've deleted them from the system, it won't compile with guile 2.2. I don't know how you got it to work on focal but it isn't working here since this version of GDB isn't patched to run with 2.2 str1ngs: ffs /lib/x86_64-linux-gnu/libguile-2.0.so.22 str1ngs: what that's 2.2 str1ngs: I think str1ngs: g0d_shatter: I'm sorry its using guile-2.0-libs str1ngs: so apt install guile-2.0-dev str1ngs: you need that package for gdb g0d_shatter: yeah, I've danced this dance many many times, I gave it a shot just in case but I have to install guile-2.0 only for the next month or so str1ngs: g0d_shatter: sorry for the confusion it only using so it will link to that guile interpreter irrelevant str1ngs: using libs* g0d_shatter: no worries str1ngs: so I have a good idea of what you need should only need guile-2.0-dev g0d_shatter: it'd be really nice to get it to work on this vm since its got a different program it took all night to correctly compile and setup and I'd like to use them in a pipeline type situation g0d_shatter: but if that has to wait, then that has to wait str1ngs: then test with pkg-config --libs guile-2.0 str1ngs: -lguile-2.0 -lgc str1ngs: should output something like that g0d_shatter: going to duck out for a little while, if I still need some help I'll try this tomorrow or later tonight, thank you all for your help, I really appreicate it daviid: str1ngs: np, i'll stick to 0.1.0 then str1ngs: sneek: later tell daviid. g-golf and nomad running on my pinephone https://bufio.org/images/2020-09-03-220022.png sneek: Will do. mwette: g0d_shatter: does /usr/bin/ contain guile-2.2 but not guild-2.2? If so, that may be a problem. I had issues on debian derived OS before on that. dsmith-work: Happy Friday, Guilers!! ArneBab_: johnjay: when I say Guile Emacs, I mean every Emacs package working with the elisp implementation in Guile ArneBab_: str1ngs: that sounds great — thank you! ArneBab_: johnjay: but that needs someone to take up Guile Emacs and finish the opitmization work. *: ArneBab_ needs to sleep str1ngs: ArneBab_: I have been meaning to look at scheme and elisp interaction. specifically calling scheme from elisp johnjay: ArneBab_: i guess. but that would mean porting every package to a certain extent johnjay: but to that idea: why would you need to? str1ngs: johnjay: not really it would essentially be Emacs but using guile elisp johnjay: if something is related to text editing then put it in a program called guile-super-text-editor johnjay: if it's not then put it in nomad-browser. or guile-player. or guile-scape. etc str1ngs: johnjay: Guile Emacs is Emacs that uses guile for elisp johnjay: right str1ngs: so you would not have to port packages, you just need to port Emacs johnjay: i guess. but you are calling elisp from scheme in that scenario which sounds messy johnjay: mitscheme has that edwin thing right johnjay: just do that but guile str1ngs: problem is guile elisp is really good it has jit bytcode etc. but Emacs developers don't want guile. johnjay: presto, text editor with scheme str1ngs: it's kinda a shame because it would reduce duplication of effort str1ngs: you can edit text with nomad btw try M-x find-file str1ngs: but it's not complete mwette: What about a translator that converts elisp to scheme? Doable? str1ngs: the underlying text buffers work great but the GUI implementation needs work. str1ngs: there is no need to translate elisp to scheme you can just use language elisp mwette: unless you want to write new extensions in scheme mwette: like a new c-mode derivative str1ngs: see http://paste.debian.net/1162367 str1ngs: johnjay: ^ johnjay: str1ngs: ok that's cool. johnjay: if the goal is elisp from guile then what's wrong with doing the slow way johnjay: like, make the interpreter implement the emacs interpreter johnjay: it would be slo as rocks though johnjay: how long does guile take to build? johnjay: i specified -j3 and it's still going johnjay: mwette: well honestly that's going to have to happen at least for c-mode johnjay: some of the complaints people make are about slow speed on syntax and indenting johnjay: so you'd need to rewrite it to use threads ArneBab_: str1ngs: well, the porting to guile-emacs never included the bytecode-improvements needed to actually make guile-emacs fast. ArneBab_: johnjay: elisp in Guile already exists. Just start Guile as guile --language=elisp; then try (defun foo() (print "foo")) (foo) wingo: hoo, i would hesitate to do serious gc hacking in c without constexpr. i really miss that from c++ civodul: constexpr is pretty cool, i miss it even in Scheme :-) civodul: well, to some extent wingo: :) wingo: how important is it to be able to compile guile with only a C compiler? civodul: ah wingo: obviously we have C ABI that we need to preserve wingo: but inside guile we could use whatever. i don't know what the tradeoffs are civodul: from a bootstrapping perspective, having Guile in C is great civodul: even if it's not a property we take advantage of currently because we first build GCC wingo: right civodul: but in theory, we could do mess -> mescc -> [...] guile wingo: that would be some serious heavy lifting wingo: on the part of mescc civodul: mescc can compile tinycc already wingo: sure, but that's different civodul: so for pure C, that's good civodul: so what i mean is we can do that if Guile is in C, but we can't if it's in C++ wingo: i am just saying that there are tradeoffs and we should be sure that we're making the right ones civodul: yes civodul: so i find constexpr great, but i wonder the extent to which it would simplify the implementation of a GC :-) wingo: yeah, just wondering if e.g. avoiding gcc or clang is (1) really feasible and (2) important wingo: right, it's just one thing :) civodul: i also wonder how much of the GC could be in Scheme wingo: Handle would be nice too :) wingo: in general, RAII-like abstractions would be really nice wingo: but it's not a thing for c, obviously wingo: anyway, might not be possible civodul: there are various GCC attributes for things like destructors (heavily used in systemd) wingo: civodul: can't rely on them though wingo: like the whole point would be to be able to rely on a standard civodul: another tradeoff :-) civodul: but yeah wingo: if we prevent compilation from tcc, we gain nothing wingo: i.e. might as well do c++ civodul: true civodul: anyway, i guess i can see C++ has nice features while being at the same time on the not-fond-of side :-) wingo: :) dsmith-work: Thursday Greetings, Guilers ArneBab_: wingo: having more of the gc in Scheme sounds interesting johnjay: civodul: what exactly is the bootstrapping? johnjay: you compile a certain version of gcc then compile guile then use guile to compile scm? dsmith-work: johnjay: Guile uses compiled .go (Guile Object) files. The compiler is in Scheme. There is a minimal "bootstrap" interpreter/compiler written in C that is used before the Scheme compiler has been compiled. johnjay: right that's what the other schemes do johnjay: c compiler compiles the scheme compiler which compiles the scheme dsmith-work: The distribution tarballs contain pre-compiled .go files for various machines. dsmith-work: Building from a tarball is *way* faster than building from git. johnjay: right. so the scheme compiler part is called mess? dsmith-work: No, that's a different project. I thought you were talking about building guile. dsmith-work: There is an effort to get resporoducible builds from base human readable sources. Completely bootstrap the whole tower from nothing. dsmith-work: The normal guile build just uses your system C compiler. (or whatever you ./configure) dsmith-work: Sorry. I'll shut up now.. johnjay: well johnjay: if you'll indulge me once more, what is "reproducible"? johnjay: as in, a c compiler compiles everything? dsmith-work: Hmm. Let me see if I can find that... dsmith-work: https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf bandali: https://reproducible-builds.org civodul: johnjay: https://bootstrappable.org/ has some background info on that ArneBab_: johnjay: you start with human-verifiable hex and only ever add human-readable sources to arrive at gcc that can compile everything, and you never needed binaries a human cannot check for that. johnjay: ok thanks ArneBab_: johnjay: in a perfect world you start at pure sources with a given hash, and the binary you get is always the same if you compile them again. ArneBab_: (same as same hash) ArneBab_: You could say that the commit-IDs of all the source-code repositories involved (containing only human-readable stuff) should always lead to a binary with the same hash. str1ngs: hello, daviid I hit a bit of a hiccup with a new patch to version bump g-golf in guix. The original submission had version 1 which does not reflect the autotools version 0.1.0 . The patch was merged before I can fix it. I've now updated it to 0.1.0 but that might cause an upgrade path issue. My proposal use the autotools version as being more correct. is 0.1.0 okay with you? It's better to fix this now than later. g0d_shatter: asking again so forgive the noise, but does anyone know if the recently updated GDB->Guile bindings will now also work with guile-3.0? johnjay: does guile have an equivalent of melpa johnjay: where you can just download new things? str1ngs: johnjay: closest thing is guix str1ngs: johnjay: which you can run on ubuntu johnjay: aiee johnjay: no wonder you develop on it str1ngs: develop on which? johnjay: guix johnjay: i'll see if i can install it as you said str1ngs: johnjay: in the guix source is ./etc/guix-install . run that and have it user substitutes when it asks yes/no. it's that easy str1ngs: s/user/use johnjay: by the way i'm suprised you had to define something like find-first in util.scm johnjay: does guile not have basic things like that? str1ngs: in scheme/nomad/util.scm? johnjay: i think i'm in emacsy str1ngs: let me check what it's doing there johnjay: i only see it used once in event.scm str1ngs: he could have used (srfi srfi-1) find in place of that maybe johnjay: oh my bad johnjay: i thought you were the sole author str1ngs: https://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Searching.html str1ngs: no emacsy was created in 2013 for a google summer of code project. str1ngs: then kinda got not used. janneke cleaned it up. and I've been semi maintaining it str1ngs: but i'm not the author if you see the git logs johnjay: ah gotcha str1ngs: I'm the author of Nomad that uses emacsy. probably the only project that does. at least that I know of. johnjay: ah ok. so you kind of adopted it since it was useful for nomad johnjay: makes sense str1ngs: right, it makes sense. janneke is busy making hurd a thing :) str1ngs: contributions welcome too of course. :) johnjay: thanks. johnjay: just to sanity check myself, in scheme anything not #f is true? johnjay: because in srfi-1 it says find looks for the first one that satisfies the predicate. which means the same as it not being #f str1ngs: '() is #f str1ngs: try in a REPL johnjay: and his definition of find-first says that it looks for the first entry that is not false. johnjay: but that's the same thing str1ngs: thinking.. johnjay: '() can be #f sometimes according to what i'm reading here johnjay: but most of the time it is considered true johnjay: which is weird coming from common lisp/elisp johnjay: (if '() 1 2) => 1 johnjay: but yeah regardless idk if that definition makes sense or not brendyyn: ,L elisp brendyyn: (if '() 1 2) => 2 str1ngs: johnjay: '() is null not false btw johnjay: o_o johnjay: ok brendyyn: i think in scheme everything is true except for #f its self. str1ngs: right I confused things there for a second. johnjay: brendyyn: in this file it says to write a version of srfi-1::find that finds the first element that is not false, rather than the first one that is true johnjay: but that means the same thing. heh str1ngs: johnjay: I still think find could be used here str1ngs: with find you control the predicate anyways. johnjay: right johnjay: maybe emacsy isn't the best place to be poking around for scheme code to learn from then str1ngs: (find (lambda (i) (is-a? ) (buffer-list)) str1ngs: johnjay: I think it's more there is many ways to skin a cat. johnjay: ye brendyyn: johnjay: guix is the largest application built on guile i think. im learning from that slowly. str1ngs: err (is-a? i ) johnjay: str1ngs: is emacsy mostly complete to what you want it to do? johnjay: for nomad that is str1ngs: not complete, but it suffices. I'll probably improve on it overtime. I'd like to replace coroutine.scm str1ngs: .... for example. str1ngs: johnjay: nomad is much better place to explore emacsy IMHO str1ngs: it has working buffers and minibuffer and a REPL str1ngs: emacsy is well designed in the big picture. str1ngs: johnjay: https://www.nongnu.org/emacsy/manual/emacsy.html is a good read. and covers nomad's use case as well. johnjay: ah yeah you're probably right chrislck: #nil is also falsy dsmith-work: UGT Greetings, Guilers apteryx: hello! what is the difference between a stable and non-stable sort? apteryx: i.e., sort vs stable-sort dsmith-work: Stable preseves order apteryx: I see, thanks. This is of importance when multiple items are "equal". dsmith-work: from wikipidea "maintain the relative order of records with equal keys" johnjay: question. when I do the example in the guile manual it doesn't display the output of $HOSTNAME johnjay: even though I have it set to something in the shell wingo: moo dsmith-work: johnjay: What example? johnjay: the guile manual starts out with an example of a function which calls getenv on the current shell to get HOSTNAME johnjay: but (my-hostname) in the prompt just prints $2 = #f johnjay: but echo $HOSTNAME is a string dsmith-work: Is it exported? johnjay: i have no idea what that means johnjay: https://www.gnu.org/software/guile/manual/guile.html#Linking-Guile-into-Programs dsmith-work: What says: env | grep HOSTNAME johnjay: hrm. it's blank. johnjay: how is $HOSTNAME defined then? dsmith-work: ok, then say: export HOSTNAME dsmith-work: and try your example dsmith-work: The shell has variables, and environmemnt variables. dsmith-work: They are set the same, but only when you "export" a variable does it go into the environment. dsmith-work: Oh, you can also set an env var tmporarily on the command line. johnjay: it's not my example. it works now lol what johnjay: so environment variables... are not the same as the variables. johnjay: sigh dsmith-work: Yeah. By "your example" I of course ment the example you were attempting. dsmith-work: In the shell, rigfht. johnjay: apparently i have to learn a little more about bash then dsmith-work: HOSTNAME=foo somecommant johnjay: right i know about that dsmith-work: will temporarily export HOSTNAME while running the command. dsmith-work: bash also has the extension: export VAR=Value dsmith-work: where it sets the variable and exports all in one go johnjay: ye dsmith-work: Hmm. This looks like it explains: https://bash.cyberciti.biz/guide/Export_Variables johnjay: dsmith-work: ok that makes more sense. a little johnjay: although it raises the question johnjay: was that guile example made on a different system where HOSTNAME was typically exported? johnjay: i'm on latest ubuntu and it isnt dsmith-work: It's just an example. Whoever wrote it probbaly assumed people know how the shell does ENV vars. johnjay: i guess so. johnjay: it's a bit jarring because it comes immediately after hello world johnjay: so you kinda expect something like that to "just work" dsmith-work: Probably better would be to return "localhost" in the else case. Or maybe raise an exception, though that's probably too much for a simple example. dsmith-work: The point of the example is how to add guile to a C prog, not how to read env vars. johnjay: right dsmith-work: I was working on an embedded linux thing with an LCD display running X. Worked great from command line. As root. Failed with a segfault on boot. As root! dsmith-work: Some library code was assuming HOME was set and was segfaulting on the NULL returned from getenv. dsmith-work: So. No guarantees env vars are set. wingo: so wingo: https://ecraven.github.io/r7rs-benchmarks/ wingo: turns out, chez runs with a heap of around 170 MB wingo: minimum. by default. wingo: at least in the runs i have recorded wingo: makes gc overhead less than guile :P wingo: e.g. on cpstak guile runs in a heap of around 10 MB wingo: because working set size is not large. but frequent gc's, and a fair amount of overhead for that wingo: if you start guile with a similar heap size, speed is 2x as much dsmith-work: wingo: Sounds like it's time for initial-heap-size arg wingo: well there is GC_INITIAL_HEAP_SIZE, which you can set e.g. GC_INITIAL_HEAP_SIZE=150m wingo: not documented, but it is a libgc thing dsmith-work: Ahh. wingo: hum. maybe i am misinterpreting, i am using the maxresident from `time` but for chez i think i am running it under guix wingo: so perhaps the maxresident was for guix environment wingo: yarrr civodul: hey! civodul: "echo + | guix environment --ad-hoc chez-scheme -- time chez-scheme" suggests 41M maxresident civodul: "echo + | time guile" says 35M (REPL with guile-{readline,colorized}) wingo: hey :) wingo: yeah my "time" invocation was inside, i think (?) wingo: and this is for running a file, not interactive wingo: so could be heuristics are different wingo: anyway, been thinking off and on about gc wingo: generally thinking about what is the next thing for guile wingo: well specifically thinking about perf anyway wingo: is it continuing to do compiler things, or is it jit improvements, or aot -- or is it the gc? wingo: i am thinking it may be the gc. wingo: which is complicated of course. bdw-gc is verrrrrrry good in its niche wingo: and us not havingn to maintain a gc is likewise very good civodul: it's also annoying at times, but yeah, not having to think too much about it is good civodul: it seems to me we have a top-notch compiler but an unoptimized runtime civodul: there are prolly things we can do there civodul: many small things and also bigger things (like UTF-8, maybe) wingo: honestly we are pretty good for the compiler, except lack of register allocation for native code. wingo: that will give us a good perf bump eventually but i think it may not be the lowest-hanging fruit wingo: it's irritating tho, and probably 100h-200h of work with C and the JIT could fix it; i just would prefer to not write more compiler in C. but perhaps that is simply irrational, dunno wingo: civodul: how is guile for guix right now? you are on 3.0 for everything, right? stis: hi guilers! wingo: heya stis :) civodul: wingo: yup, everything 3.0.4 even! civodul: it's doing good overall, though i'd really like to improve Guix perf all around civodul: most of the work is probably on the Guix side civodul: but there may also be a few things to do in libguile for instance *: wingo nod civodul: the other day i found replacing 'display' with 'put-string' in hot code had a noticeable impact civodul: as an example wingo: weird civodul: well, iprin1 (!) "does things" :-) civodul: even for display civodul: (which i didn't expect) civodul: then Guix uses 'write' a lot to serialize sexps, and that too is costly wingo: ah you mean put-string is faster civodul: yes wingo: yeah i can understand that wingo: hehe iprin1 :) a function of an old vintage, probably need to reclaim that part of the cave ;) civodul: :-) wingo: so for gc, if we ever wanted to do things there, the c interface is going to be a mess to evolve. possible but a mess wingo: so one thing is to move more and more things to scheme wingo: like we reclaim srfi-1, moving all that code back to scheme civodul: yes, that's a good idea anyway wingo: yeah wingo: so maybe that's the thing to noodle on in the short term civodul: i can help on this front civodul: yeah wingo: cool :) i think we can work on it just by committing replacements in scheme and directly deprecating the C versions wingo: maybe that is a bit harsh tho wingo: many c interfaces can be deprecated now and then removed in 3.2 wingo: but some will need to remain and forward to scheme wingo: i guess for srfi-1 tho everything is internal already wingo: so we can just remove that c code; nice ;0 wingo: :) rather str1ngs: hello wingo, a really cool guile target would be wasm. wingo: str1ngs: i agree :) i would rather wait until tail calls are there tho, otherwise things get needlessly gnarly wingo: the exception handling proposal also has an algebraic effects extension planned, which is neat :) str1ngs: wingo: understanble johnjay: dsmith-work: that's kinda lame str1ngs: wingo: I had read up on the tail call limitation for wasm as well. johnjay: i mean... how can you login without a home dir johnjay: i'd say the library is in the right in that case str1ngs: services login without a HOME all the time. johnjay: eh. this is why i prefer to program in anything but bash str1ngs: johnjay: are you using getpwnam? str1ngs: I believe they use this in the beginning of the guile manual. johnjay: yes it's in the hello part wingo: str1ngs: yeah it is quite tricky. https://docs.google.com/document/d/1oi6ROZJuE-hBb21Tgq-XcUegPktecF52gADzBJcYL34/edit#heading=h.1ugrinxqnqf has details str1ngs: johnjay: does that work okay? I think they use root for that IIRC johnjay: you're right they do wingo: the problem is that wasm has a kind of "realm" register that they want to keep pinned, and tail calls complicate that str1ngs: wingo: aye, maybe it's best to wait till wasm is better standardized/mature wingo: the standard is fine, it's the implementations that need to land. v8 has an implementation, though not optimized. spidermonkey wants to optimize before landing, but it's not a priority str1ngs: johnjay: getpwnam works okay though? civodul: wingo: the C functions for SRFI-1 are SCM_INTERNAL and can just be removed without further ado civodul: which is cool wingo: civodul: yeah that is cool! str1ngs: wingo: I've been meaning to play with wasm more. but I can't find a GNU specific way. wingo: would be nice if we could get efficient string manipulation in scheme, like if it could be as efficient as srfi-13 civodul: oh you were talking about the other ones too civodul: yeah str1ngs: wasm woudl be real handy for Nomad. since we could avoid using JS civodul: people complained that string-contains is so naive dsmith-work: johnjay: The startup script that started the X server didn't set HOME. That's ok. The error was not checking return from getenv() wingo: maybe if we had sub-bytevectors and utf8, we could internally allow strings to expose their utf8 buffer. i am assuming we don't want to add cons strings and all that civodul: yeah wingo: we could allow strings to expose either a readable or a writable buffer, and do copy-on-write if needed... wingo: i think we have all the machinery for that, currently civodul: yes, more or less wingo: shared stringbufs are read-only wingo: i think civodul: yes civodul: but yeah, being able to expose buffers would be nice wingo: maybe you can make explicitly shared and mutation-sharing strings str1ngs: johnjay: I think the (getenv "HOME") could be improved. ideally it's not good to uses 'getenv without checking if it's #f. wingo: well, maybe that is a good 3.2 focus. improve the run-time, move more things to scheme wingo: maybe change to utf-8, maybe not :P wingo: maybe add utf-8, instead of replacing... i don't know. wingo: maybe we need a deprecation cycle for our strings -> utf-8 wingo: maybe we get lloda to land his arrays :) civodul: yup :-) civodul: sounds like good ideas! dsmith-work: wingo: About strings and utf-8. Consider how Rust handles filenames as a different type. civodul: i was wondering also about low-end devices civodul: https://issues.guix.gnu.org/40626 wingo: dsmith-work: yeah that is a different but related mess! wingo: civodul: istr we fixed statprof to be more helpful; you may want to update https://issues.guix.gnu.org/40626#5 str1ngs: dsmith-work: I like the idea of paths as a type. I think SBCL does that too? str1ngs: or CL dsmith-work: I've heard CL has some very funky filesystem stuff. Handles weird non-posix things that pre-date unix. str1ngs: ahh forgive my CL ignorance. though path types are intresting johnjay: hrm. question about emacs. i know there's a ton of stuff glommed onto it like news readers or music players johnjay: is that the same as having them be in guile but separate? str1ngs: johnjay: not really, its more like gloomed *into* it. str1ngs: or w/e that word is :P johnjay: right but. why not just have your guile news reader, guile music player, guile hex editor, etc johnjay: what's the benefit of rolling them all up into an elisp blob str1ngs: it would not be like emacs, though say in nomad we have so it's more like Emacs johnjay: right web browser is another thing johnjay: what i mean is is emacs just this way due to historical accident str1ngs: it's not one elisp blob though. its package that are auto loaded when needed johnjay: or is there some benefit to "giant program that does everything in scheme" dsmith-work: Heh. When emacs eventually uses Guile, that will all be there. (not likelly though) rekado: johnjay: if you are familiar with browsers as a platform for JavaScript applications then it’s a small step to see Emacs as a platform for Elisp applications. str1ngs: rekado: has a good analogy str1ngs: or think of it as eclipse but in elisp. johnjay: hrm. so it's like running programs on a virtual machine rekado: while browsers are rather heavy (*much* heavier than Emacs, by the way) you don’t consider web-delivered JavaScript applications as part of the browser and something weird. johnjay: right. i expect javascript to be in my browser str1ngs: johnjay: guile is more like a virtual machine. but yes much closer to a VM str1ngs: as in bytecode dsmith-work: I kind of think that emacs is current embodiment of the lisp machines of yore. johnjay: yeah it sort of is lol. dsmith-work: People use emacs as their X window manager! *: str1ngs breaks out his space-cadet keyboard. *: dsmith-work recently rewired CapsLock to be Hyper *: str1ngs dawns rocket suit. str1ngs: I use space as Ctrl leader johnjay: but have you required Menu to be Iso-Shift-level whatever johnjay: i'm on the verge of getting rid of my enter key johnjay: C-m is sufficient str1ngs: I never use C-m maybe I should? johnjay: well i kid. but i tried using emacs on bsd in the terminal and weirdness happened str1ngs: emacs treats C-m special it is hardwired to RET. not 'new-line johnjay: had to use ESC for meta and F1 for help, backspace didn't work str1ngs: err 'newline johnjay: also themes didn't work due to color limitations. tsdh-light was the only light theme that worked on low color terms str1ngs: for Nomad I use (define-key global-map (kbd "C-m") (lambda _ (insert #\newline))) str1ngs: though that will probably not work in a minibuffer johnjay: according to the guile manual the idea of guile is to be emacs but for everything johnjay: so browser has scheme, music player has scheme, etc str1ngs: right, re extensible johnjay: that's why nomad seemed interesting. i just haven't heard of a lot of things that use guile and that's the selling point str1ngs: there are things. like Lilypond GnuCash etc johnjay: the manual mentioned those. i'd never heard of any but gnucash str1ngs: I plan to take Nomad a step farther. nomad-shell will be a wayland compositor str1ngs: so ya, think of a desktop with a minibuffer etc str1ngs: jonsger: did you try M-x terminal btw? str1ngs: johnjay: ^ ArneBab_: johnjay: Emacs provides the buffer as abstraction for operations which is also a user-editable datastructure. Looking at the sheer size of a simple IntelliJ plugin compared to the same functionality in Emacs, the Emacs design really shines. I have yet to see anything where it’s easier to add your own small tools. ArneBab_: johnjay: lilypond dominates musical score creation. dsmith-work: johnjay: Were you using emacs in a terminal or in X? (you get much more key code options when in X) ArneBab_: johnjay: It’s like the LaTeX of music score creation, except that there doesn’t exist anything like MS office that gets even close. johnjay: dsmith-work: in terminal johnjay: bsd forces you to install x lol johnjay: ArneBab_: i guess lisp shines in adaptability the most? idk johnjay: IntelliJ sounds like some massive 1G eclipse plugin johnjay: also it's kind of weird gimp dosen't use guile johnjay: i think it uses tinyscheme or something ArneBab_: johnjay: it’s not just that. It’s also stuff polished by time. ArneBab_: 1G? I give it 16G to keep IntelliJ fast :-) johnjay: ah ok johnjay: it kind of puts the guilemacs question into perspective johnjay: when you ask for guile emacs do you mean a guile text editor or do you mean every emacs package ported to scheme? different hings str1ngs: ArneBab_: btw not exactly related to your GI_TYPELIB_PATH issue the other day. but I've improved nomad's declaration to not use propagation at all now. probably submit a patch in the next couple of days. g0d_shatter: Hi all, I was curious if anyone can tell me before I try to build it if this patch will allow building gdb against guile-3.0 as well as guil-2.2 g0d_shatter: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=68cf161c24b096608bf4a1b97b489cc7277bffc0 daviid: cd wingo: good morning :) dsmith-work: Morning Greetings, Guilers lloda: my question about handling C-c yesterday was about those stretches of code where I cannot C-c to interrupt lloda: i want a way to tell Guile that it's ok to interrupt lloda: i'm ok with the default handler, I don't need a custom one, I just want it to be called, or the signal to be raised, or w/e is not happening over those stretches of program mwette: Based on comment yesterday, it sounds like if your program gets stuck in an infinite loop in a C function executed by Guile, you can't C-C out of it. lloda: yes. In my case it's a Scheme loop with some C functions inside. It isn't stuck and I still cannot C-c. lloda: if let's say 1% of the time is spent running Scheme and 99% is spent running C, I still want to be able to interrupt it lloda: if that matters dsmith-work: Maybe there is something you can insert into your loop every so often that lets the hander run. lloda: yes lloda: that's what i'm looking for dsmith-work: lloda: maybe scm_async_tick() ? lloda: is there a scheme version of that? lloda: I am not running pure C lloda: I rather keep the C I have independent of Guile dsmith-work: lloda: https://www.gnu.org/software/guile/manual/html_node/Asynchronous-Signals.html dsmith-work: SCM_TICK is just: #define SCM_TICK scm_async_tick () dsmith-work: dsmith-work: If you are in scheme, there is no need, apparently. Seem to be for long stretches of C code that do not call into libguile. lloda: that's what I don't get lloda: there is Scheme code running and I cannot interrupt it lloda: it isn't pure C code lloda: I will try SCM_TICK tho cause I need a solution lloda: thx dsmith-work dsmith-work: Though scm_async_tick just returns if SCM_I_CURRENT_THREAD->block_asyncs is true. dsmith-work: lloda: Maybe your code is running with async blocked somehow? dsmith-work: lloda: I'm curious to see if that helps. lloda: i do use openmp in the C lloda: not sure what else could be mwette: lloda: maybe look at vm-trace-level in the manual mwette: OpenMP is going to be running threads, so that might complicate things. Is your guile/c data mt-safe? lloda: yes lloda: get input / compute stuff / put output lloda: self contained functions lloda: thx for the pointer stis: Hi guilers! dsmith-work: hej Hej HEJ str1ngs: hello daviid, I'm just in the process of updating an improving nomad's guix declaration. I'm updating g-golf at the same time to 84e894eb7945c3bcdf7f8d5135c1be3efa524c92. Is that commit okay with you regards to guix. str1ngs: ? daviid: str1ngs: yes dsmith: daviid: Hey hey. Well, I had another iteration on that re-export macro. dsmith: daviid: Now does some error messages for no modules and non-list-like module names. dsmith: daviid: Pretty sure I'm done now. daviid: dsmith: i did read that, thanks lisbeths: I am looking to informally discuss a bit about the guild project and learn more about it. Is it true that guile is now the official extension language of the gnu project? jackhill: lisbeths: yes, I believe that is is. jackhill: That said, I don't know more about what an official extension language means to GNU. Guile is available in lots of places, but may not be universal. leoprikler: not universal, but ubiquitous ;) dsmith-work: Morning Greetings, Guilers RhodiumToad: mornin' RhodiumToad: or other time as appropriate civodul: hey! mwette: Good day! lloda: is there a way to actively check for C-c ? dsmith-work: lloda: Not sure what you mean. mwette: lloda: In C, one can set up a signal handler for SIGINT and run the repl with setjmp (or maybe setcontext these days). The sigint handler will longjump to the start of the repl. I'm not sure how Guile deals with this. RhodiumToad: ... not well RhodiumToad: longjmping out of a signal handler is a dangerous practice; if you jump out of a non-signal-safe function, any subsequent call to a non-signal-safe function can crash the process RhodiumToad: non-async-signal-safe RhodiumToad: guile's own signal handling works by setting a flag in the real sigint handler and then checking it later, at a safe place RhodiumToad: you can install your own handler and have it set a flag you can check yourself wingo: o/ davexunit: haven't done much with guile in months. picking it back up again with a prototype for a gpu accelerated vector graphics renderer. here's some bad art demonstrating what it can do so far: https://files.dthompson.us/screenshots/Screenshot%20from%202020-08-31%2011-06-16.png str1ngs: davexunit: hello, I'm not sure if you got my message regards to coroutine.scm in guile-2d? davexunit: str1ngs: hi, guile-2d hasn't been maintained in years. davexunit: I currently maintain a library called chickadee that has a coroutine implementation that is similar. str1ngs: davexunit: understandable, It looks like emacsy snarfed coroutine.scm and I'm having a prompt issue that I can't figure out. str1ngs: ideally I will change this to something else, but since emacsy is a library I need to time to do the correctly. davexunit: what's the backtrace look like? I can make an educated guess str1ngs: one sec I'll give you a backtrace. manly it's something contextual but I can't figure out what. ie if I do something from a REPL. str1ngs: http://paste.debian.net/1161999 str1ngs: davexunit: ^ str1ngs: let me link the emacsy emacsy-message might help davexunit: str1ngs: there's not much in this trace. abort to unknown prompt means that something tried aborting to a prompt tag that it wasn't called with. davexunit: if you have a prompt tag 'foo, the program needs to be within a (call-with-prompt 'foo ...) form in order for (abort-to-prompt 'foo) to work. str1ngs: davexunit great, that might explain the contextual issue then. I appreciate the feedback. davexunit: str1ngs: yw str1ngs: davexunit: yes! works now davexunit: str1ngs: :) dsmith-work: wingo: Do you think it could be possible with our current macros to implement something like macroexpand-1. That is, just one level of macro expansion. For debugging/education mainly. str1ngs: davexunit: going to digest https://www.gnu.org/software/guile/manual/html_node/Prompts.html . eventually I might be skilled enough to replace coroutine.scm str1ngs: davexunit: I apoligize for the simple issue. I was not aware this was a guile primitive and assumed it was emacsy specific. davexunit: str1ngs: my latest iteration on the coroutine implementation can be found here: https://git.dthompson.us/chickadee.git/tree/chickadee/scripting/script.scm davexunit: for a much more sophisticated system, see guile-fibers. str1ngs: I had considered fibers eventually since I'm use to goroutines myself. dustyweb: hi hi dustyweb: davexunit: !!!!! dustyweb: :D dustyweb: nice to see you davexunit: dustyweb: hey dustyweb: davexunit: too bad we didn't get to do our IRL hackathon dustyweb: pandemick dustyweb: maybe we should still do one online davexunit: yeah it's been a rough year dustyweb: you holding up ok? dustyweb: . o O (maybe that's not a questino for a public channel in a year like 2020!) davexunit: kinda catonano: dsmith-work: about macroexpand-1: very interesting question ! catonano: hi davexunit ! davexunit: hey catonano catonano: dsmith-work, dsmith: there was a discussion, some time ago, about support for progressive expansion of macros for debugging/education, on the Guix mailing list dustyweb: oh davexunit just saw your vector renderer dustyweb: coool :) davexunit: thanks dsmith-work: catonano: I *think* guile had one a long time ago, like maybe in the 1.4 days. dsmith-work: Doesn't help now though.. catonano: dsmith-work: yes it had one, its removal is mentioned on the NEWS file, you can find it with a grep search catonano: IN the NEWS file dsmith-work: Ahh, that happened in the 1.8->2.0 update catonano: dsmith-work: there's a thread in the guile ml (not guix, guile) titled "macroexpand-1" it's of may 21st 2018, I opened it catonano: dsmith-work: and then there's another thread in the guix ml titled "my latest blog post", it's of june 7th 2018. It's a bit unfortunate but it expands on macroexpand-1 for debugging/educational purposes dsmith-work: I see Mark digging into this at https://lists.gnu.org/archive/html/guile-user/2018-05/msg00040.html catonano: dsmith-work: right dsmith-work: I'm mostly interested in "what does this expand into", without going all the way down to tree-il or whatever. catonano: dsmith-work: that's exactly what I was looking for, at the time catonano: th eanswer is that that would be a different artefact, the current expansion can't be reused for debugging/education. And a different artefatc isn't currently available because nobody went and made it, as fo rmany other things catonano: that's a brutal syntesis wingo: dsmith-work: i am not sure. would you expand the outermost form only? dsmith-work: wingo: Yes. Only the outermost. wingo: then no variables are lexically bound? wingo: that would be possible to build, i think dsmith-work: wingo: As a fallback, merely quoting the template expression is pretty good. dsmith-work: wingo: With a complicated (long) macro, that is possibly recursive, it would be great to see what happened. dsmith-work: (the quote trick from http://www.phyast.pitt.edu/~micheles/syntax-rules.pdf#page=4 ) hendursaga: Are there any helper functions for Guile similar to, say, Python's os.path.join? Built-in? civodul: hendursaga: you can try (string-join '("a" "b" "c") "/") civodul: it's just string manipulation but might suit your needs stis: hey guilers! hendursaga: civodul: OK but a cross-platform file delimiter, say? str1ngs: you can replaces "/" with file-name-separator-string for more windows support str1ngs: have not tried that way on windows but should word str1ngs: work* hendursaga: I think I saw that somewhere, yeah civodul: hendursaga: you can use file-name-separator-string instead of "/" civodul: ah yes, what str1ngs wrote :-) civodul: but IIUC "/" works everywhere nowadays, even on Windows dsmith: civodul: Always has. dsmith: At the file open() level anyway. jgart: is there a way to reload ~/.guile from within the guile repl without using emacs and without exiting the repl? jgart: I'm looking for a short command I can run like ,q str1ngs: jgart: (load (string-append (getenv "HOME") "/.guile")) should work str1ngs: jgart: also ,l "/home//.guile" replace user and assuming HOME is in /home jgart: I tried the following: (define ll (load (string-append (getenv "HOME") "/" "test.scm"))) jgart: now I can load that file with ll but it doesn't seem to update jgart: Is there an easy way for me to add another meta command instead of polluting my environment? jgart: str1ngs thanks for the help jgart: or a custom meta command I should say jgart: is there currently a meta command for going to the top repl (for example in gambit if one is in the 3rd nested repl they can type ,t to go to the top repl alextee[m]: this is pretty cool https://bbs.ax/ alextee[m]: it says r5rs scheme, not sure what that means alextee[m]: https://gitlab.com/naughtybits/schemebbs lisbeths: how do I print a string to stdout daviid: lisbeths: display, write, simple-format or format lisbeths: thank you lisbeths: can you tell me why this doesn't compile: https://pastebin.com/e440yYP8 lisbeths: it says something like 'img is wrong type for map lisbeths: nevermind I figured it out lisbeths: thank you for your help daviid: ok, in the 'future', can you use debian or gnome paste, not pastebin, nor any not tro-friendly/tracker 'system', tx daviid: *tor friendly mwette: maybe: apply 'img => apply img str1ngs: rlb: hello, do you know the policy on debian for adding /usr/local to search paths? for guile it might be nice if say export GUILE_LOAD_PATH="/usr/local/share/guile/site/2.2" where included in a /etc/profile.d/guile-2.2.sh. str1ngs: that would break with multi guile's though never mind me. guix-vits: Hello. Are 'module-ref' and '@@' a same thing? str1ngs: guix-vits: (@@ (srfi srfi-1) map) and module-ref (resolve-module '(srfi srfi-1)) 'map) both return the samething. str1ngs: as for the underlying mechanics I can not say. str1ngs: err (module-ref (resolve-module '(srfi srfi-1)) 'map) guix-vits: :) str1ngs: try in REPL should be the same. str1ngs: guix-vits: try on unexported bindings as well guix-vits: str1ngs: Yes, tried, bu still wonder if (module-ref is "more 'correct'" way to force-pet the unexported make-linux-libre*. guix-vits: guix-vits: The manual didn't shown any warnings about module-ref approach (i want to be a good boy). catonano: jgart: did you receive any info about how to extend the commands set of the repl ? jgart: catonano: not yet jgart: I'd love to figure that one out catonano: I'd love that too jgart: I'd also love a way to exit to the top repl from a series of nested debugger repls jgart: ideally with ,t jgart: https://github.com/pflanze/chj-schemelib/blob/b93168aa11405384ad0e31460b3ceec2c63ee5a6/cj-gambit-sys.scm#L643 jgart: is there anything like decompile in guile? simendsjo: str1ngs: Ref earlier chats regarding problems with Guix and Guile on Manjaro - I used the installation script for the binary installation of Guix from https://guix.gnu.org/manual/en/html_node/Binary-Installation.html. This worked well, and I've been able to install Guile and other software using Guix. leoprikler: sneek later tell jgart (system vm disassembler) sneek: Will do. str1ngs: simendsjo: hello, glad you got it working. str1ngs: hello, davexunit emacsy uses coroutine.scm from guile-2d one of emacsy interactive commands is giving me problems with prompt not found. here the emacsy define. https://git.savannah.nongnu.org/cgit/emacsy.git/tree/emacsy/minibuffer.scm?h=wip#n179 . it seems to be contextual but I can't figure out how. mainly say if I use say read-from-minibuffer from a REPL. the REPL should be thread safe since it's polled on the main GTK thread. Do you str1ngs: have any ideas how I might look into this? rlb: str1ngs: offhand something like that doesn't sound unreasonable - though I do tend to try to favor upstream defaults. Looking at the default %load-path, I could imagine having a versioned an non-versioned local pair "somehow", but ideally that'd be something we settled on and arranged upstream. And as I think you may have been referring to, there'd be questions about what ordering (if any) might be sensible. rlb: I believe emacs puts local fairly close to the "front", fwiw. rlb: ...which is fine as long as /usr/local/ has appropriate permissions. rlb: "fine" str1ngs: something like this might work for multi guile. http://paste.debian.net/1161843 this is just WIP would need more then what I have here. str1ngs: I guess the reason I bring it up is for example there were dependencies for guix in say ubnuntu 20.04. but now guile-zlib an guile-lzib are new dependacies. this would help users who install manually with the defualt GNU configure --prefix=/usr/local just a musing on my part. str1ngs: also ran into this helping someone install g-golf/nomad on a debian system where dependencies have no package yet. str1ngs: rlb: ^ rlb: might also want to mirror the current VERSIONED NON-VERSIONED pair. rlb: but I suspect it'd be worth some discussion on guile-devel (or similar) first. i.e. if it's appropriate then maybe it's not just a debian thing, and if it's not appropriate, then... str1ngs: I guess mainly if emacs adds /usr/local for search paths it would be a quality of life improvement for guile users as well. str1ngs: hmm good idea, are you suggesting maybe adding this as a default to %load-path? rlb: right str1ngs: that would probably have to be back ported though. but actually more elegant solution rlb rlb: either always or maybe via configure option --with-local-dirs or... rlb: and wrt ver/non-ver, e.g. ("/usr/local/share/guile/3.0" "/usr/share/guile/3.0" "/usr/share/guile/site/3.0" "/usr/local/share/guile" "/usr/share/guile/site" "/usr/share/guile") str1ngs: right good idea str1ngs: +1 rlb: And sure, once it's decided, could always implement it in say debian "early" or at least discuss that (depending on how much we want to "just track upstream"). But even if not, we can just suggest a trivial wrapper for people to use in the interim. str1ngs: that's the only real issue I've had with guile on ubuntu atleast. other then that it's pretty top notch. and mainly that's from supporting a end user perspective. str1ngs: as a note could use guile-zlib and guile-lzip in the repos. str1ngs: wish I was was more proficient with package for debina. str1ngs: debian* str1ngs: also guile-3 variants like guile-git etc. not to much of big deal there since guile-2 works rlb: I'm currently poking at some clojure related packaging questions and depending on how that pans out, I might learn more about debhelper plugins, if if that pans out, and isn't too difficult, we might contemplate some kind of dh_guile helper -- which might make it much easier to package (some) guile modules. rlb: But I've been reasonably overcommitted recently, so "we'll see". str1ngs: I wish I had more time to work on this. it's somewhat easier to work on guix package then debian. str1ngs: re for my workflow anyways. rlb: Haven't tried guix, but wouldn't be surprised. rlb: I use git-dpm, but in some ways that *increases* the initial complexity in exchange for being able to use git to manage the debian patches. rlb: dgit may also be interesting (haven't really delved yet): https://manpages.debian.org/testing/dgit/dgit.1.en.html str1ngs: oh nice joshuaBPMan: Trying to build a static site with haunt...seems tough. str1ngs: hello joshuaBPMan 8sync has a nice website created with haunt. source is here https://git.savannah.gnu.org/git/8sync/website.git/ str1ngs: might help if you are looking for an example. joshuaBPMan: str1ngs: thanks. The guix.gnu.org site is impressive, and confusing. joshuaBPMan: thanks. joshuaBPMan: str1ngs: have you ever read Gardens of the moon? Your alias reminds me of one of the characters... joshuaBPMan: str1ngs: I'm confused...that 8sync/website.git seems to be an empty repo... str1ngs: joshuaBPMan: I have not read that book, my nick is in reference to guitar strings :) joshuaBPMan: str1ngs: ahhh. bummer. Strings is also known is fiddler in my book. He's pretty bad a*s. str1ngs: well isn't a fiddle a small guitar? *: str1ngs probably going to get beat up by fiddlers now. rlb: :) manumanumanu: Ahoy hoy! joshuaBPMan: str1ngs: nah. Fiddler ended fights. if you've got his name, you'll do the same. dsmith: There are guitars and then there are guitars. johnjay: str1ngs: do you develop on guix mostly? johnjay: i'm still stuck in the vanilla worlds of bsd and u buntu str1ngs: johnjay: mainly I develop on ubuntu. and I run guix foreign. it's a good mix for me. str1ngs: I do run guix system. but often times I need to test something local on ubuntu so it's easier this way for me. johnjay: that's not a bad phrase. johnjay: running in qemu-kvm = foreign str1ngs: johnjay: nope guix foreign distro. is guix running along side ubuntu. str1ngs: guix only touchs /gnu and /var/guix str1ngs: or any modern distro for that matter. johnjay: oh i see stis: Hi guilers! wleslie: hello(Stis). dsmith: leoprikler: Yeah, I know there is a lot more you can do with syntax-case, but syntax-rules is so beautiful and elegant that I'm enamored with it and don't want to look at syntax-case. dsmith: leoprikler: (m0 m0* ...) (mn mn* ...) ... seems to do want I want. dsmith: Just need to add other patterns for catching errors. dsmith: Not super happy with the error reporting, but better than it was: https://paste.debian.net/1161524/ johnjay: rlb: irc is so disorienting sometimes johnjay: i'm in emacs room and people talk about scheme. i'm in this room people talk about emacs str1ngs: johnjay: Hello, in regards to the emacsy out of tree build issue. I'm aware of the root cause just not an easy fix right now. johnjay: ah ok johnjay: is that not something that autotools makes it easy to do? str1ngs: johnjay: yes, but there was a request to add --without-examples to remove a large set of dependencies like kwebkitgtk. how every both guile and texinfo need source files in place from the examples . so to fix it I need to enable all the targets. which defeats --without-examples. leoprikler: can't you make it so that the examples are only treated as text in the --without-examples case leoprikler: or that the including texinfo is not sourced? str1ngs: there is some back history here. emacsy was originally written with noweb so there is some entanglement still. if the files are not source then the manual would break or not make sense. str1ngs: though maybe if I treat them as text that will work. I think the only concern is texinfo not to worried about the guile snarfing. str1ngs: I was adverse to adding --without-examples anyways because I was not confident there would'nt be side effects. I added up adding it because the user was MacOS user and I thought exposure and testing on Mac was a good thing... but never heard from the user againa. leoprikler: so you're relying on the fact, that you can evaluate the code in the manual itself to generate some example blocks? leoprikler: could you write your code in a way, that all those evaluations are #+CALL: and then if someone passes --without-examples [or --without-eval or however you want to call it], those get replaced by a warning saying "this doc was built without support for <...>, so there's nothing here" leoprikler: or even do feature testing inside the manual using macros dsmith-work: Happy Friday, Guilers!! simendsjo: I'm having some problems with Guile on a non-(Guix System) system. Manjaro (Arch based) has 2.2.6 available. Installing the git version fails. Installing Chickadee fails. Installing the different Guix versions (stable, git) fails. And looks like Guile doesn't really work on Windows. In my case, it means Guile is Guix System only atm, which is quite odd. RhodiumToad: fails how? RhodiumToad: (guile works for me on freebsd) dsmith-work: simendsjo: Don't know much about Manjaro/Arch, but Guile does have dependencies, and the headers/libs for those must be installed for guile to build. (So typically some *-dev packages). dsmith-work: When building from git, some auto* tooling needed beyond the packaged sources (the tarballs). dsmith-work: simendsjo: FWIW, I have no problems installing Guile from source on Debian. dsmith-work: So I would hesitate to label it Guix-only civodul: simendsjo: there are indeed packages for quite a few distros, and also "guix install guile" should work on top of any distro civodul: but you're welcome to report Guix issues on #guix :-) simendsjo: guile-git compiled now, but getting guix-git to compile was worse as every package still refers to guile2. I guess I should prioritize getting guix installed, and then use that to install guile and most other software I need. simendsjo: .. but guile-ssh failed 11 tests so I cannot install Guix. I guess I'll try to build everything from source rather than using the Arch packages. Way more difficult than I was hoping it would be. civodul: if you want Guix, i highly recommend the binary distro at https://guix.gnu.org/download/ lampilelo: have fun resolving issues with the wrong libc and other libs loading lampilelo: few days ago i gave up on guix on arch when it hung while updating and after i killed the process it turned out guix is in an unrecoverable state lampilelo: it's just too much screwing around with it lampilelo: i think it's better to just install guile from source civodul: lampilelo: interesting, had you installed it from the Arch package or the binary tarball? lampilelo: from the tarball str1ngs: leoprikler: hello, I'm really not the author of emacsy. I just help maintain it. So I need to go digging regards to the manual. I don't think out of source builds are overly important I'd like to work on guile 3 support for emacsy first. civodul: lampilelo: if you have time, we'd welcome details on what went wrong at bug-guix@gnu.org simendsjo: Looks like guile-ssh fails all tests on Manjaro. Exit code 1 after each group. How can I further debug this? https://gist.github.com/simendsjo/8db196a0dd869d75859a79da5749d8b8 str1ngs: simendsjo: hello, check the test log files. example. tests/server.log that might not be the exact name/location but you get the idea. simendsjo: These doesn't give any more information. `# of expected passes 4\n FAIL server-client.scm (exit status: 1)` str1ngs: simendsjo: which guile version are you using? simendsjo: str1ngs: 2.2.6 str1ngs: hmmm weird they don't use 2.2.7 is this a AUR package or something? simendsjo: No, this is the official one in Manjaro. It might lag a bit behind Arch. str1ngs: simendsjo: what is the source field for guile-ssh simendsjo: str1ngs: https://github.com/artyom-poptsov/guile-ssh/archive/v0.12.0.tar.gz str1ngs: simendsjo: can you try changing that to 0.13.0 ? str1ngs: or using git instead might be easier. simendsjo: str1ngs: Tried using 0.13 instead, but it fails in the same way str1ngs: also libgit2 is fairly recent? simendsjo: str1ngs: 1:1.0.1-1 str1ngs: thanks good. str1ngs: that is good* I meant str1ngs: simendsjo: are you trying to build guile-ssh to use guix btw? just curious str1ngs: simendsjo: also can you paste the PKGBUILD somewhere? simendsjo: str1ngs: yes. But look at the gist I posted earlier. Some of the tests shows a backtrace, but not all. simendsjo: str1ngs: Here's the pkgbuild https://gist.github.com/simendsjo/a5c34da0c189f31f0b58f6d0ba14b77f str1ngs: simendsjo: thank you sorry, missed the gist str1ngs: simendsjo: and I mistoke guile-ssh for guile-git apologies str1ngs: I have guile-git on my mind right now. simendsjo: :) simendsjo: simendsjo: I found the problem with guile-ssh. I had installed guile-git too, and it defaulted to using that instead of guile 2.2.6. So the problem is probably related to the master branch of guile. Of course, now guile-json fails a test, but hopefully one step closer.. str1ngs: simendsjo: I built guile-ssh manually on my pinebook pro with manjarho and checks are passing. str1ngs: simendsjo: I'm not sure how guile-git would effect this was that a typo str1ngs: ? simendsjo: I'm trying a bunch of different things here, and guile-git is built now. The problem is now guile-git-lib, which gives some ssh related error in some of the tests: https://aur.archlinux.org/packages/guile-git-lib/#comment-762960 *: dsmith-work keeps thinking guile-git is guile built from git instead of a release tarball.. simendsjo: Sorry, guile-git-lib, not guile-git. As you say, guile-git is guile from git str1ngs: simendsjo: ah so maybe an issue with guile-lib is that what the package is called in Arch? str1ngs: simendsjo: hmm I don't see guile-lib as a depend of guile-ssh. main thing you have it sorted out? str1ngs: dsmith-work: you are right its a common Arch naming for package built from git. str1ngs: I got confused thinking guile-git the library forgot it could be guile built from git. civodul: i figured string/bytevector output ports are buffered, which is ridiculouse civodul: -e civodul: but if you make them unbuffered, you allocate less but wall-clock time increases simendsjo: I'm trying to build guix-git. The outstanding dependency is guile-git-lib, which fails some tests with "Failed to retrieve list of SSH authentication methods": https://aur.archlinux.org/packages/guile-git-lib/#comment-762960 simendsjo: .. installed guile-git-lib by turning off the tests -- figured the tests were the problem, not the library.. Now stuck on guix-git requiring Guile-Zlib, which isn't packaged in Arch. The guix package fails on guile-json3 as the tests fails. Turned off the tests for guile-json3, crossing fingers, and back at trying guix (not guix-git). simendsjo: So far it looks good and is compiling, but this is not a frictionless experience simendsjo: Close, but no cigar. `mmap(PROT_NONE) failed` and segfault. I get the impression people don't use guix (or much guile?) on Arch/Manjaro. str1ngs: simendsjo: hello, I don't know if how many people use guix. but generally it's easier to use guix-install.sh. though that technically locally bootstrapped. it is bootstrapped and gives you all the guix depends you need. which you will get later anyways. str1ngs: guix on Arch I mean. str1ngs: guix-install.sh is not locally bootstrapped I meant str1ngs: simendsjo: when using git with makepkg is it possible to pin the git hash? dsmith: Odd. Was able to stop the "overrides core binding" warning at work. Can't seem to stop it now. str1ngs: janneke: hello, pushed a small fix to Emacsy that fixes 'end-of-line behavior to be on par with Emacs. see https://git.savannah.nongnu.org/cgit/emacsy.git/commit/?h=wip&id=34032ff811f4057e242e2c7a42722b4af6f8bb0b dsmith: OhhKaaayy dsmith: rm'ed the ccache and all is better dsmith: Anyone know if it's possible to add a docstring to a define-syntax ? str1ngs: hmm good question I'm a assuming the docstring is for the actually macro. not something expanded? dsmith: Correct dsmith: Yes! needs to be in the syntax-rules form, not define-syntax str1ngs: nice, I happened across this the other day too. daviid: . sneek: Welcome back daviid, you have 1 message! sneek: daviid, dsmith-work says: What do you think of https://paste.debian.net/1161329/ ? dsmith: Actually, more like https://paste.debian.net/1161380/ dsmith: Just might work for guile 2. Someone running guile 2 could test?.. daviid: dsmith: nice, did you compare the module related code in (ice-9 boot-9)? dsmith: I've looked at it some. daviid: dsmith: ok, to answer your last quiz first, wrt cond-expand and guile-2, the guile-2 code should still use module-use!, imo dsmith: Hmm. dsmith: ok daviid: dsmith: for 3.0, i still need to look into the (ice-9 boot-9) changes myself, but it sounds strange 'as a first impression', that a lambda user would have to know and use the module internal structure, to pragmatically acheive what they can, in a module def, using #:export, #:re-export, #:replace and #:re-export-and-replace - in other word, it doesn't soud 'correct' to have to call (hashq-set! (module-replacements iface) sym #t) daviid: 'ourselves' - daviid: if we need to keep that dcode, you might want top 'cache' (module-replacements iface) in the upper let i guess daviid: but i think we might try to see if the binding exists, and use module-replace!? dsmith: Most of the interfaces in boot-9 have a list of symbols as arguments. dsmith: module-export! and module-replace! for example. dsmith: Those call the hashq-set! dsmith: Also module-re-export! dsmith: But the interfaces are inconvinient. Aurora_v_kosmose: Been messing with sxpath. It's kind of... not the most user-friendly. dsmith: But probably the more correct thing to do is use #:re-{whatever} in the use-modules form. But again, that wants individual symbols, not whole module publics. daviid: dsmith: well, the all point is not to have to write ansd use #:[re-]export* dsmith: daviid: Yeah, that's the whole point of re-export-public-interface right? Passing in whole modules names instead of lists of symbols. daviid: dsmith: right, and to comment your last comment, these module keywords are just the user interface, and call and run code ... that is the code we need ... so it is not anymore or less correct, imo - guile should have and maintain a re-export-public-interface, but it's fine to do it ourselves, it forces us to look and understand that part of guile better ... mwette: Aurora_v_kosmose: agree. And I've hunted for help docs/code and not finding much. I want to write a tech note on how to use, but that'll take some work. Aurora_v_kosmose: It says it's a translation of XPath, but a number of features either don't work or are hard-enough to guess I can't get them to work. mwette: example? daviid: dsmith: we (or I at least) also need to exhaustively test absolutely all possible cases ... - the best is to list those possibilities on a paper :), imo, then write the tests - ok, I have to jump on something else, by all mean, but tx for your participation and code ... should be back later Aurora_v_kosmose: Finding a node which has an attribute with a specific string value. Aurora_v_kosmose: It'd be something //a[name="example"]/* mwette: https://paste.debian.net/1161386/ mwette: ^ is w/o the // Aurora_v_kosmose: That would work, yeah. But that's the unabbreviated syntax, no? dsmith: Sure would be nice to have a macroexpand-1 ... daviid: dsmith: I still think module-use! should be patched in 3.0 though, let's see what our maintainers think about that, ifthey maniftes - iwhen they have some time ... and worth noting it is actually used several places in (ice-9 boot-9), including as a top level form in that file ... dsmith: daviid: https://paste.debian.net/1161390 dsmith: Does it the old way for non-guile-3 daviid: dsmith: let me try, not sure if (cond-expand (guile-3 works in guile-2, let's see dsmith: Should pick up the else for guile-2 daviid: compiling ... dsmith: That inner (define) might be an issue. Is that available in guile 2? dsmith: Might need to be a let-rec daviid: dsmith: all fine using it in guile-2 daviid: i prefer let-rec, but that really is taste , not important at all dsmith: Cool. daviid: yes great dsmith: That simple example seems to work for guile-3 dsmith: scheme@(guile-user)> map dsmith: $1 = # dsmith: Like so dsmith: After the ,use (a) daviid: dsmith: perfect dsmith: leoprikler: Thanks muchly! dsmith: Well, I learned a bit more of modules. dsmith: And cond-expand. daviid: dsmith: there is one other case that is related but not covered by this syntax you did work on (with leoprikler indeed and str1ngs as well, tx all ...) daviid: let me point to it - dsmith: daviid: One thing that is missing from the original, it does not check that the passed in module names are lists. daviid: maybe we can add that check as well? doesn't cost much ... dsmith: I think that would require using syntax-case. dsmith: Beyond me at the moment. daviid: it's ok, tx mwette: Aurora_v_kosmose: yes. I think maybe '(// a (@ (name "example"))) might be woth a try Aurora_v_kosmose: mwette: I actually tried that one. It doesn't, for some reason it can only understand having a field named (name) but the second you add the string it refuses the input. Aurora_v_kosmose: Maybe that's been fixed by Guile 3.0. I'm still on Debian's 2.2? Aurora_v_kosmose: mwette: In any case, it can't be helped. If I want to do it in guile, I'll just have to do it the longer way. daviid: g-golf compiles fine using 3.0.4 now, but fails its checks, it actually can't run 'anyting' :) daviid: but in a repl, connect correctly returns the generic function, and map the srfi-1 map ... so good progress, still work to be done mwette: Aurora_v_kosmose: try http://okmij.org/ftp/Scheme/xml.html#SXPath Aurora_v_kosmose: mwette: Thanks Aurora_v_kosmose: I'll give it a look dsmith: daviid: Ah. Very cool. Progress! daviid: probably due to declarative/none-declarative module change introduced in 3.0, it can't find anything it imports dsmith: Makes sense. str1ngs: great news :) daviid: here is a (failure) example - https://paste.debian.net/1161391/ daviid: it does successfully import, but the name isn't properly bound/exported from its imported module i guess daviid: of course none of the check passes ... for the same reason daviid: yep, here https://paste.debian.net/1161392/ daviid: hum, not sure this is the cause - but this is very easy to reproduce outrside g-golf anyway dsmith: I'm guessing g-object-import-with-supers might need to be tuned up. Just guessing. daviid: dsmith: actually that seems ok, here is a simplified version - https://paste.debian.net/1161396/ daviid: dsmith: drop this somewhre, fire a repl, add-to-load-path, ,use (gobject), then (make-and-export-class ') ... and try daviid: that works daviid: but in g-golf, there are several level of 'indirection, s to speak daviid: several modules indirection i mean, which i am trying to reproduce outside g-golf as well daviid: going afk a little, bbl ... apteryx: how can I flatten pairs? apteryx: an alist, I mean apteryx: probably using fold apteryx: this works: https://paste.debian.net/1161398/ daviid: dsmith: ok, so here is a mini g-golf, to reproduce the problem, using 3.0.4 [just to confirm, the same mini g-golf project works fine using 2.2.7] - https://paste.debian.net/1161403/ wingo: moo civodul: hi there! chrislck: o/ chrislck: apteryx: would be a good habit to avoid appending lists. https://paste.debian.net/1161421/ wingo: omg i just had the weirdest debugging morning wingo: made some incremental compiler improvements. ran benchmarks to see how we did. ~everything was slower wingo: but especially some benchmarks that were essentially allocation benchmarks wingo: looked at the compiled object code -- no significant difference wingo: wondered about jit tiering, if things weren't working wingo: wondered about icache in the interpreter wingo: wondered about differing optimizations in libguile wingo: strange things. guile 3.0.2 was running ~40% faster wingo: turns out the issue was that i had inadvertently improved memory usage, by a very small amount wingo: enough so that for guile in git, the heap didn't expand as large as it did on 3.0.2 wingo: and so with similar allocation rates, guile in git was having to collect up to 40% more often, for some benchmarks wingo: because the working set size never exceeded the threshold needed to bump to a larger heap wingo: these are small heaps, btw: just 3 or 4 MB wingo: problem was exacerbated by parallel marking, which given the small heap size, wasn't able to effectively take work off the main thread's plate wingo: solution is to bump the initial heap size. in the meantime we had slightly outgrown the initial heap size configured in guile; bumping from 2 MB to 3 MB not only speeds up startup by eliminating a useless gc, but also puts us at a different point on the curve, "fixing" this particular weirdness wingo: need to re-run old benchmarks though wingo: with the new heap conditions RhodiumToad: fun mwette: So, is there an advantage to using a different allocation scheme for cons cells, assuming the bulk of scheme memory allocs are for cells? wingo: mwette: not sure that is a good assumption fwiw. anyway in guile since we use the bdw-gc allocator there isn't really a concept of "cells" as exposed to the user wingo: with bdw-gc you allocate any size data. it uses segmented free lists and allocation areas to allocate e.g. all 2-word objects in a contiguous block wingo: and guile has a tagging hack to allow pairs to be represented in two words. so in practice guile does all that you would want to do; only the tagging hack is specific to pairs civodul: wingo: interesting! civodul: i had also observed that sort of phenomenon in Guix, where using slightly less heap would mean taking up slightly more time civodul: which is counter-intuitive and frustrating wingo: indeed wingo: i don't even know what the ideal solution is. i suspect that even the heap sizes i chose are too small for good performance wingo: but i don't want to bloat the initial guile footprint too much wingo: /opt/guile/bin/guile -c '(pk (gc-stats))' wingo: ;;; (((gc-time-taken . 0) (heap-size . 2097152) (heap-free-size . 622592) (heap-total-allocated . 1434032) (heap-allocated-since-gc . 1434032) (protected-objects . 0) (gc-times . 1))) dsmith-work: Hey Hi Howdy, Guilers str1ngs: hello dsmith-work ArneBab_: wingo: wow, nice rlb: civodul, wingo (and everyone): I'm not sure it'd even be feasible (just now managed to remove 2.0 from debian), but I'm wondering if there are any strong arguments for/against keeping 2.2 in the next stable release, i.e. bullseye, likely releasing in about a year (freezing much sooner). rlb: (Suppose the 2.2 -> 3.0 transition might be easier, given the work to move packages off of 2.0, but I won't hold my breath.) dsmith-work: rlb: Well, there have been some modules changes between 2.2 and 3.0 that are causing issues for g-golf civodul: rlb: i suppose there are packages stuck on 2.0 (that's the case for GDB until the upcoming release), but there are probably few packages that run on 2.2 and don't run on 3.0 civodul: so presumably, there's little value in keeping 2.2 if you add 3.0 rlb: OK, so that'd go in the "might want 2.2 so that people using g-golf will have it" category I suppose (since g-golf itself isn't in debian atm). Though if we think g-golf's likely to have things sorted out by next August, then might not be as important? rlb: civodul: ok, thanks. rlb: If I get my act together, the best thing would probably be for me to start filing the "please upgrade" bugs now. i.e. more likely to leave our options open. civodul: ah, i'd expect g-golf to easily migrate to 3.0 civodul: yeah *: civodul has to go civodul: later! str1ngs: rlb: Hello, I would like to create a debian package for g-golf. Unfortunately my experience with packaging for debian is nil. Any suggesting how to best get started would be useful. is a PPA a good place to start for this? leoprikler: whether you're packaging for a ppa or debian itself, I think you have to familiarize yourself with its funny makefile-esque packaging rules rlb: Hmm, if you want package for debian proper, then not sure about ppas - never used them, and not sure if debian supports them directly. rlb: I'd say, first off, *strongly* recommend debhelper. str1ngs: rlb: thank you, that is helpful. rlb: And then perhaps: https://wiki.debian.org/Packaging/Intro rlb: Though I'm not sure, haven't read it carefully yet. str1ngs: currently I'm maintaining the guix package. but since g-golf is a GNU project it would be nice to work towards a debian package. rlb: In the end, with debhelper, if your needs are straightforward, you may only need a very simple debian/rules file, and then list what you want installed where in the relevant debian/*.install files, etc. rlb: Also, while testing/debugging, fakeroot can be very handy. str1ngs: gotcha thanks. str1ngs: it rlb: i.e. you can run the whole package build without having to be root. rlb: but for *real* builds, I wish I'd learned sbuild sooner. str1ngs: I'm familiar with fakeroot. rlb: Though if you intend it to enter debian proper eventually, source-only uploads are finally ready, so you can just let the buildds handle everything. *: rlb thanks all those who made that possible. str1ngs: source-only is a offload mechanism? also thanks for the advise I stick to upstream debian and avoid and ubuntu variation like PPA rlb: Also potentially interesting git-buildpackage, git-dpm, and dgit. I use git-dpm, but I think git-buildpackage may be more common. Haven't tried dgit yet. str1ngs: I might need git-buildpackage for now until later down the road. technically there is no g-golf release yet. rlb: source-only is potentially better from a reproducibility perspective, from a "did the maintainer actually build the packages in a sufficiently isolated way" (e.g. sbuild) perspective, and possibly from a security perspective, though it does "centralize" things more, which has its own weaknesses on that front. str1ngs: or I can give davidd a heart attack and tell him g-golf is now in debian lol str1ngs: rlb: source-only does sound useful, takes some responsibility off me. rlb: Previously, one set of debs (for the maintainer's host arch) would have been built on their own machine. rlb: all the other archs were built by the buildd, so in practice amd64 was typically "not built by the builds". rlb: given likely dev hardware :) rlb: For guile module debs, we don't really have much/any policies atm, but in many cases, I assume that dropping the .scm and .go files into the proper dirs may be sufficient, unless you want to support multiple guile versions. rlb: i.e. we don't have anything like debian-emacs-policy. rlb: (Of course that's not nearly as notable as it used to be, now that we've "unversioned" the emacs packages.) str1ngs: rlb: probably I will just target 2.2.7 for now least guile 3 is still WIP as this writting. str1ngs: in the context of g-golf I mean. str1ngs: rlb: is guile-3.0 in buster it's in focal 20.04 so I assume so. rlb: OK, and of course happy to have everything to move to 3 as soon as possible, then we'll have more flexibility wrt 2.2 come debian release time. rlb: Nope - just bullseye https://packages.debian.org/guile-3.0 rlb: i.e. testing str1ngs: sorry I meant bulleys. got my toys mixed lol rlb: hah, ok, right. str1ngs: I don't know why I use ubuntu. just seems easier to support end users for me. rlb: Well, all part of the family, broadly speaking? str1ngs: aye rlb: Oh, and if you end up finding that we need some debian-guile-polcy, just shout :) str1ngs: I'm not so versed in policy, from what I have seen of guile packages re debian systems it's top notch. str1ngs: even more so with the guix dependencies like guile-ssh guile-git. forget whole packaged those. but it's been really helpful. rlb: (for emacs, we didn't ship the .elc files, so had to compile them per-installed-flavor at install/upgrade time, in proper dependency order, clean up, etc.) dsmith-work: syntax-rules question: How match against lists. So to ensure that in (foo l1 l2 ...), the l1 and so on look like lists. (really: look like module names) dsmith-work: s/How match against/How to match against proper/ leoprikler: dsmith-work: you should really use syntax-case for that, but (foo (e1 e2 ...) ...) should *mostly* work rlb: ...hmm, lately, I've wanted a "clobber the cache for these paths" command. We don't already have anything like that do we? e.g. "guile --clear-auto-compiled --recursive ." or something. rlb: I want to be able to run that when hacking on guile itself, and/or some other project, in conjunction with a clean, to avoid having to say unpleasant things when "macros"... rlb: Right now I just "rm -rf ~/.cache/guile/ccache/.../the/relevant/path", but that's less than ideal. ArneBab_: leoprikler: here’s the result of our shared hacking today: https://hg.sr.ht/~arnebab/likeplaying/browse/likeplaying/likeplaying.w?rev=tip — It’s a tiny script, but it solves a problem for me: curating videos while I do something else. str1ngs: rlb: that sounds useful. I selectively remove ~/.cache/guile myself. or selectively use --no-auto-compile ArneBab_: leoprikler: whenever a good video is playing I just run likeplaying from anywhere and it grabs the filename from the mpv window :-) rlb: str1ngs: right, and no-auto-compile doesn't work very well when I'm running a "make -j 7 check" with many more than 7 independent tests :) rlb: it's very expensive, though I'm pretty sure it did work, which surprised me a little, i.e. good sign that we're doing the right thing with respect to concurrent auto-compiles from multiple processes. rlb: fsvo "right thing", since the semantics there could be interesting without some care... rlb: even if you make everything atomic. *: rlb would have to think about it -- maybe it's fine. daviid: str1ngs, leoprikler, dsmith-work wrt 3.0 changes about how one must address re-export(s) and re-export(s) of replaced bindings, here is some very usefull input - https://lists.gnu.org/archive/html/guile-devel/2020-01/msg00004.html daviid: I still haven't looked into this, not even superficially, I will of course, asap, but I thought you might be iterested to read (or re-read) this ArneBab_: I just restructured the guile template in conf: conf new -l guile PROJ now creates PROJ/PROJ.scm along with the module (PROJ PROJ). In short: conf new -l guile foo ; cd foo ; make install ; foo ArneBab_: https://hg.sr.ht/~arnebab/conf daviid: it points to the NEWS entry from andy, and proposed a manual solution to the 'problem' - which is what str1ngs rightfully did in his proposed patch - however, in g-golf (and guile-cv ...) I need an automated solution to this, and, hopefully, backward compatible ... also, daviid: the re-export of the public interface of a module, which for some name(s) replaces guile core binding(s), is one of the two problem g-golf needs to solbvve (automatically, by running a program, not by manually writing in a file) daviid: the other is (highly related) to do so when a guile proc is promoted as a generic, which is the 'setenv' example in the previously dscussed and pasted code here ... the code that successfully does that using guile 2.2.7, and needs to be dapted (probably to use module-re-export-and-replace! os so-so is here http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/function.scm?h=devel, line 288 daviid: leoprikler: the results/solution must be so there are no warnings, since the replacement is deliberate ... fwiw daviid: what ever it takes, it must work jut like it does for 2.2.7 - in tha paste used by dsmith-work to post to the ml johnjay: hey. i'm trying to compile something based with guile but i can't get past the configure script johnjay: i got rid of guile 3.0 as the guy said but the script says it can't find guile lib johnjay: i have guile 2.2 and 2.2-dev and libs. but it says configure: error: guile-lib is missing; please install it. johnjay: ah ok. in u buntu you need "guile-library" package. that solve it catonano: johnjay: may I ask you what are you trying to compile ? johnjay: something related to nomad johnjay: but if you have something more common i can try to compile let me know johnjay: also what's teh deal with guile3 and guile2 existing at same time? is there big incompatibility? johnjay: i guess ubuntu 20 didn't install that library by default leoprikler: guile3 and guile2 are entirely separate, they shouldn't even look into the same module paths leoprikler: daviid: Making it work "just like Guile 2.2.7" is merely a matter of whether or not you add (hashq-set! (module-replacements iface) key #t) after (module-add! iface key value) leoprikler: btw. is it wanted that all method-gf are pushed back into hl-api gobject? ArneBab_: mwette: here’s another small change to guile-libyaml: https://github.com/mwette/guile-libyaml/pull/2/files — ./demo1.scm works now. ArneBab_: and there’s an example for a reference nerdypepper: hiya, does anyone edit guile scheme in vim here? nerdypepper: i am looking to have some sorta integration with guile-lint nerdypepper: also, guile-lint seems to dislike using square brackets [] in let and cond expressions, any way to allow that? str1ngs: leoprikler: ah I got it sorted out in #emacs re emacsy was the package. str1ngs: leoprikler: to johnjay str1ngs: question that is. leoprikler: I have no idea what question that was, you'd have to help my memory out here a bit :) str1ngs: it was some time ago. reguards to guile 3 and unbuntu str1ngs: the project he was building was emacsy. which should support guile 3 soon. I have a local working copy anyways. leoprikler: ahh, right leoprikler: once emacsy is ported to guile 3 nomad should be no problem, right? str1ngs: actually I did'nt know ubuntu had guile 3 in the repo. I've been building in manually str1ngs: the only blocker is g-golf guile 3 issue which is no rush. once that is done g-golf looks pretty good for guile 3 as well. leoprikler: I don't know anything about newer ubuntu period. IIRC "stable" is still stuck on 18.04 str1ngs: do you use debian? leoprikler: The only Debian system i still have is a LM installation I plan to nuke after getting a grade on my masters thesis. str1ngs: haha, I'll take that as a no. str1ngs: it was ubuntu 20.04 aka focal str1ngs: which has much better guile package support than 18.04 ie guile-ssh guile-git etc leoprikler: Well, that certainly makes it easier to bootstrap Guix str1ngs: yes, I forget who did the work. but it tricked down to ubuntu nicely. thank unsong hero! str1ngs: johnjay: I did find the reason for the failure out of tree builds and emacsy. it's related to the not enabling all of the examples. A regression introduced by adding that --without-examples flag. thanks for finding that, I should have that fixed soon. dsmith-work: Wednesday Greetings, Guilers dsmith-work: leoprikler: No error checking, but how does this look? https://paste.debian.net/1161329/ dsmith-work: Seems to work for me. Wonder what happens in 2.2 dsmith-work: sneek: later tell daviid What do you think of https://paste.debian.net/1161329/ ? sneek: Got it. apteryx: is there anything to manipulate plists in Guile? apteryx: plist being of the for '(key1 value1 key2 value2 ...) apteryx: form* leoprikler: keys being keywords or arbitrary symbols? apteryx: symbols like #:some-key leoprikler: fixed or arbitrary? leoprikler: for fixed combine let-keywords with quasiquote, for arbitrary no apteryx: fixed leoprikler: (let-keywords plist #f ((key1 default) (key2 default) ...) `(#:key1 ,new-key1 #:key2 ,new-key2 ...) ) apteryx: pretty cool, thanks! apteryx: are the ellipses part of the supported syntax? apteryx: I guess not. The keys I want to manipulate are from an expected set, but the number of keys can vary, so I think let-keywords won't help for that. leoprikler: the ellipses are just for show leoprikler: you can set the other keys to a well-known default e.g. #f or *unspecified* apteryx: ah right, if I specify the full set it can work, but that's on the verbose side and difficult to maintain leoprikler: pretty sure you could write a macro for that, but I see your point apteryx: nothing standard to get all keys of an alist, right? I need to make my own match-lambda pkill9: actually that's what I want to do pkill9: get all keys of an alist apteryx: https://paste.debian.net/1161351/ apteryx: oops, this should be alist->keys brettgilio: wingo: hey, I can't parse your ATOM feed. I think the formatting on it might be broken? apteryx: well, it is, nevermind ;-) brettgilio: I can parse other atom feeds just fine tho leoprikler: apteryx: map car alist? apteryx: that'd also work apteryx: or (map first alist) from srfi-1 str1ngs: dsmith-work: that change looks promising. does that help with guile 3 map issue? and work for guile 2 as well? brettgilio: wingo: ignore my comment. I got it brettgilio: I figured it out dsmith-work: str1ngs: Pretty sure that won't work with guile 2. I don't have a 2 install handy. Should be possible to work with both by conditionally calling the hash-set! (I think) leoprikler: does guile-2 not have this replacements list? leoprikler: but yeah, cond-expand rules dsmith-work: leoprikler: Yeah, the way replacements are recorded changed. leoprikler: nice to know str1ngs: dsmith-work: gotcha, thanks for looking at this BTW. dsmith-work: from the NEWS file regarding #:re-export-and-replace: "Note to make this change, we had to change the way replacement flags are dsmith-work: stored" str1ngs: is it possible to get major version number someway? or do I need to use (version) apteryx: leoprikler: this is what I was after: https://paste.debian.net/1161353/ apteryx: It's a bit more complicated than I'd like, but it does exactly what I want. apteryx: got to go! dsmith-work: str1ngs: Never tried. But (apropos "version") returns quite a few results.. dsmith-work: ({major,minor,micro,effective}-version) str1ngs: ahh (major-version) what I need thanks. I just need it for ~/.guile. daviid: . sneek: Welcome back daviid, you have 2 messages! sneek: daviid, str1ngs says: I was just explaining how setenv was both related and not related to the guile 3 issue. It's still an issue for me in regards guile 2.2.7 and I will be using %gi-method-short-names-skip with setenv. The issues being I rather be explicit when it comes to setting environment variables. sneek: daviid, dsmith-work says: Hope you don't mind. Posted this bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43025 daviid: dsmith-work: I don't mind, thanks., I hope one of our maintainer fixes module-use! in 3.0.4, let's see ... daviid: str1ngs: there is no 'issue' in g-golf and guile 2.x wrt setenv, nor any other short name methods that needs to 'promote' a guile core procedure to a generic function having the guile core procedure as its default method - that is a g-golf feature, not an issue :) - and the feature is customizable, you may either no build any short name method, or having some, not others ... so we are talking about your personal preference here, which daviid: is perfectly fine, but definitely not an issue daviid: str1ngs: the other conments I added were to better describe, not only for you, but others that may follow and wish to understnd, how import works and why one can end up importing class(es) and method(s) that do not pertain to the original namespace manually imported by a user ... str1ngs: daviid: you seem to be correcting me on an issue that I was just informing you about. Last we checked setenv was an outlier to the map issue. I'm simply being courteous and give letting you know what precisely what I discovered. leoprikler: I don't think the problem is necessarily with module-use! leoprikler: module-use! for interfaces happened to work in Guile 2.2.7, but don't ask me to find the portion of code, that made it work wingo: moo leoprikler: One drawback of the Guix package manager is, that it lacks super cow powers :( pkill9: there is cow-store, maybe that could be considered a super cow poewr pkill9: power* leoprikler: perhaps leoprikler: someone should totes implement `guix moo` tho civodul: :-) tohoyn: sneek, botsnack sneek: :) str1ngs: pkill9: I alway though it would be amusing to name cow store to barn :) str1ngs: thought* dsmith-work: Tuesday Greetings, Guilers str1ngs: hello dsmith-work peanutbutterandc: civodul, Mr. Cortes, may I interest you with this minor patch, please? https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42574 (I reported it a while ago, at your instruction) civodul: good day, Mr/Mrs peanutbutterandc :-) civodul: i won't look at it today, but as long as it's in the bug tracker, it won't be lost civodul: thanks for the reminder! peanutbutterandc: civodul, Ah, I see. Thank you very much. I just couldn't help myself, seeing that you were here (in #guix). A good day to you too, sir! (: ArneBab_: wingo: a heatfelt welcome to your child in this bright and harsh but beautiful world! wingo: tx! ArneBab_: chrislck: and a lovely welcome to your child, too :-) ArneBab_: s/heatfelt/heartfelt/ peanutbutterandc: Oh wow, Mr. wingo, congratulations, sir! chrislck: \o peanutbutterandc: And congratulations to you too, Mr. chrislck chrislck: thx arnebab_ and peanbutterandc! peanutbutterandc: (: civodul: the phrase "the Guile family" makes even more sense :-) ArneBab_: mwette`: I tested guile-yaml and found that it did not note its dependencies. So I created a guix.scm file which gives the dependencies: https://github.com/mwette/guile-libyaml/pull/1/files ArneBab_: mwette`: this doesn’t cover installation of the package itself (since it uses the trivial-build-system), only installation of dependencies via guix environment ArneBab_: mwette`: I tested it with guix environment --pure -l guix.scm dsmith-work: leoprikler: That re-export-modules code is actually from http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gw/support/modules.scm#n54 leoprikler: Yeah, I don't think guile-gnome is a good source for research on modern Guile code ;) leoprikler: The last change to this file was in 2014, to the repository in general in 2017. dsmith-work: leoprikler: Right. daviid was looking for a replacment or a fix. leoprikler: I'm pretty sure I posted one to the ML dsmith-work: using #:re-export (srfi srfi-1) in the use-modules form works fine. leoprikler: I don't think that's how re-export works str1ngs: dsmith-work: #:re-export shoudl work for guile 2.2.7 as well right? dsmith-work: I would expect so leoprikler: #:export, #:re-export etc. export symbols, not modules dsmith-work: Ok, I'm working from memory. It was some #:re-* thing. str1ngs: re g-golf I experimented with #:re-export-and-replace (setenv map for-each connect). but that's not backwards compatible, also I was not sure of the impact overall. leoprikler: fwiw you can still use re-export with symbols dsmith-work: Yes. leoprikler: the only difference between guile 2 and 3 is that 3 will warn about overrides with re-export dsmith-work: I think what they want/need is re-export whole public interface(s). str1ngs: is #:re-export proffered over module-re-export!? str1ngs: preffered* leoprikler: I'd say yes str1ngs: but it only works on symbols so that would be tedious I guess. leoprikler: #:re-export and re-export! are both syntax, whereas module-re-export! is a generic procedure leoprikler: btw module-re-export! wants a list of symbols also, so... str1ngs: right but you can loop over that with module-for-each str1ngs: I guess the real issue is somewhere in this process core bindings not just have a warning but become unbound. leoprikler: again, that's because you're trying to export a module by modifying something other than the obarray leoprikler: it's not going to find map in the obarray str1ngs: aye I didn't think re-exporting (srfi srfi-1) was a good idea other. but daviid thought that is should be allowed and the problem should not exist. so maybe maybe there is ignorance on my part. leoprikler: Well, the thing is there is a significant difference between re-exporting the module (srfi srfi-1), vs. the contents of (srfi srfi-1). str1ngs: gotcha leoprikler: One of those doesn't really make sense in most interpretations whereas the other does. manumanumanu: ArneBab_: my son just made me write his first program. It was a simple (display "bajs"). Bajs means poop in swedish. He apparently shares my sense of humour. leoprikler: Someone should write a JS interpreter called bajs leoprikler: or at least a node module leoprikler: and soon you'll find it in all of the websites mwette: bajs = "Bad Ass JavaScript" (pun intended) manumanumanu: mwette: bad ass-javascript str1ngs: leoprikler: does'nt node already exist :P *: str1ngs hides leoprikler: sounds like the name for an exciting new frontend leoprikler: oh, the burn manumanumanu: as everyone reading xkcd knows, moving the implicit hyphenation is a source of neverending fun! str1ngs: yet another frontend you mean :P leoprikler: don't make fun of me! Soon, the entire industry will use it... for about five minutes, before they hop onto the next str1ngs: I want to use it too! dsmith-work: Someone will use it to write a js build tool. Because there are just not enough of them yet. ArneBab_: manumanumanu: cool! :-) dsmith-work: And then it will be baked in to CI processes everywhere. ArneBab_: mwette: did you see my pull-request? ArneBab_: mwette: ah, yes, you already merged it — sorry for the noise :-) ArneBab_: and thank you! ArneBab_: how can I resolve ~ in a filename as home? Is there a readymade proc or do I have to roll my own? leoprikler: (ice-9 regexp) + (getenv "HOME") leoprikler: there's no "expanduser" as in emacs lisp or python ArneBab_: passwd:dir : getpw : getlogin ArneBab_: (passwd:dir (getpw (getlogin)) ArneBab_: ) ArneBab_: arg, yes, I want HOME leoprikler: we had that discussion a while ago; that's not what POSIX does leoprikler: for ~arnebab, you'd want (passwd:dir (getpw "arnebab")) leoprikler: but for ~, (getenv "HOME") is the mandated behaviour ArneBab_: Can we just do this right once and create (resolve-filename filename)? ArneBab_: And add it to Guile? ArneBab_: I expected (open-file …) to just do this — a 5 minute hack just blew up to >30min leoprikler: Hmm, I do think it would fit better into guile-file-names ArneBab_: where is that? leoprikler: https://gitlab.com/brandoninvergo/guile-file-names leoprikler: basically, since this thing splits file names into lists, you'd want something that expands "~[.*]" inside that list ArneBab_: isn’t that a huge dependency just to get the resolution that’s common in bash? leoprikler: perhaps, but in python you'd also pull in os.path for that ArneBab_: or is the hidden intrinsic complexity enough to warrant that? dsmith-work: Hmm. Not entirely serious, but kind of: If you want bash behavior, how about shelling out to bash? dsmith-work: As a larger issue: instead of duplicating functionality, use what already exists? ArneBab_: I thought about just making a bash-script, but I didn’t want to … leoprikler: The thing is, if you do this via string manipulation and regexp, you'll inevitably reinvent the wheel dsmith-work: And chances are, it won't be exactly the same. ArneBab_: guile-file-names is packaged in guix, so I’ll go that way — thank you dsmith-work: Some weird quirk will pop up. ArneBab_: shelling out to bash is often a security risk. leoprikler: Does "(^|/) ~.([^/]*)" look sane to you? ArneBab_: not that this matters here dsmith-work: Yeah. As I said, not really serious. leoprikler: oh, wait, the dot is actually a bug leoprikler: what are you going to do about ~alice/~bob? ArneBab_: that’s /home/alice/~bob ArneBab_: or should be dsmith-work: Off on a rabbit trail: Does bash provide a library for such things? leoprikler: or ~alice/~bob// str1ngs: it would be nice to have something like Emacs 'expand-file-name in guile. str1ngs: and glob ArneBab_: yes str1ngs: I miss go languages file.Glob leoprikler: file-names does have a large number of valuable procedure (including glob apparently) leoprikler: it's just missing expand~ right now str1ngs: is that in guile? ArneBab_: guix install guile-file-names ArneBab_: https://gitlab.com/brandoninvergo/guile-file-names/-/blob/master/src/file-names.scm str1ngs: ahh maybe I'll look into that than. ArneBab_: What I’d prefer is to have canonicalize-filename resolve these ArneBab_: canonicalize-path ArneBab_: bat that would change the API ArneBab_: I’ll regex it and file a wish leoprikler: hmm, just noticed it is only packaged for guile2 ArneBab_: oh … guile-file-names got some criticism: https://gitlab.com/brandoninvergo/guile-file-names/-/issues/5 ArneBab_: sounds like it needs some love ArneBab_: not the quick hack I can do at this time of the year leoprikler: sadly doesn't say what criticism ArneBab_: sounds like moving away from GOOPS, but looking at the latest commit that might have been done already leoprikler: I think this is rather because of overriding issues leoprikler: e.g. lstat shadowing lstat dsmith-work: Filenames can be troublesome, with different encodings and all. ArneBab_: shttp://paste.debian.net/1161183/ ArneBab_: http://paste.debian.net/1161183/ ArneBab_: with imports: http://paste.debian.net/1161184/ ArneBab_: I decided to avoid complexity and just treat ~/ in the first cond-statement ArneBab_: would be safer by just replacing the first char ArneBab_: ~ arg, and isn’t correct leoprikler: pretty sure case 2 has a bug ArneBab_: yes ArneBab_: and I can go down to string-replace from Guile proper dsmith-work: Might want to handle (getenv "HOME") -> #f leoprikler: even guix sets HOME to /homeless-shelter dsmith-work: Yeah, I've seen HOME not set.. ArneBab_: me too … str1ngs: yep that's one of the draw backs getenv. ArneBab_: what’s a good fallback? the users home? ArneBab_: or /tmp? (but that might throw away user input) str1ngs: ArneBab_: passwd:dir like glibc does. but that could fail too dsmith-work: I suspect bash falls back to what's in passwd str1ngs: you need passwd:dir to handle ~$USER and ~other-user anyeays str1ngs: anyways* dsmith-work: And ~usernamethatdoesnotexist ? dsmith-work: That leaves ~ in place I guess str1ngs: ~userdoes not exist should probably not expand and be treated as path literally. so not found str1ngs: probably good to check posix spec on that one. dsmith-work: dales@debian:~$ ls ~nouseratall dsmith-work: ls: cannot access '~nouseratall': No such file or directory dsmith-work: str1ngs: exactly so ArneBab_: damn, getpw throws an error if the user doesn’t exist str1ngs: forgive my ignorance, but doesnt CL have a type just for paths? ArneBab_: http://paste.debian.net/1161188/ ArneBab_: this now seems to work ArneBab_: would be great if someone could take it up and for example … guile-lib … dsmith-work: Hmm. Never noticed before, but glibc seems to have an expansion function leoprikler: ArneBab_: why not take the length of the match in case 2? leoprikler: instead of discarding it for another match ArneBab_: good question ArneBab_: (would be better, yes) str1ngs: dsmith-work: I wrote this FFI to wordexp. http://paste.debian.net/1161190 nice thing is it does globbing too. though not that secure. actually leoprikler was instrumental with some of the FFI bit. ArneBab_: leoprikler: this should now work correctly and is shorter: http://paste.debian.net/1161192/ leoprikler: yeah, that's pretty much the same i would have written ArneBab_: should/can I mention you in the file (want to submit to guile-lib; it’s 90 min of hacking after all) str1ngs: ArneBab_: I think guile-lib is a great candidate for this. leoprikler: Wait a sec, I'mma testing it leoprikler: where is getpw? str1ngs: probably posix module? ArneBab_: I thought src/string/posix.scm str1ngs: https://www.gnu.org/software/guile/manual/html_node/User-Information.html ArneBab_: yepp, that’s where I got the getlogin from leoprikler: okay, found a bug ArneBab_: yay! ;-) ArneBab_: (the bugs found before submission are the best bugs :-) ) *: str1ngs quick! grabs his flyswatter leoprikler: http://paste.debian.net/1161194/ ArneBab_: where was the error? leoprikler: see the added case 1 ArneBab_: ah, it tried to match? leoprikler: (test "~") would fall through to number 2 leoprikler: and try to (getpw "") ArneBab_: nice catch! thank you! ArneBab_: and it’s nicere to read \o/ leoprikler: hmm leoprikler: I think we can one-up this ArneBab_: what do you mean? leoprikler: http://paste.debian.net/1161195/ leoprikler: have fun with it ;) ArneBab_: oh, wow ArneBab_: thank you! ArneBab_: submitted via email to David Pirotte ArneBab_: Deepest thanks to magit for making git-format patch usable :-) ArneBab_: leoprikler: I also added some docstrings with texinfo (because guile-lib has that at other places) ArneBab_: leoprikler: followup-thought: I put both procedures under LGPL to allow easy inclusion into Guile — was that OK (if not I’ll write a followup-email to David) daviid: ArneBab_, leoprikler, str1ngs, dsmith-work nice! daviid: ArneBab_, can I ask you to email guile-user, subject something like 'guile-lib: new (string posix) module, filename resolution procedures - proposal for inclusion' or 'something like that', and ask for review/objection, so this gives a chance to anyone who's interested to 'raise their voice' ... not sure aboutr the lice4nse, please ask opinionate3d opnion in the email to, I suggest, tx! ArneBab_: daviid: sure :-) leoprikler: ArneBab_: yes, I meant to apply the same license to both. Since you already used LGPL, I'm fine with adding the rest under it. ArneBab_: leoprikler: thank you! ArneBab_: daviid: sent daviid: ArneBab_: excellent, I don't think anyone will object, but I feel it is the right thing to do, guile-lib is 'to all of us' - I just happen to be one of the (not very good so far) co-mainainer ArneBab_: I like that :-) daviid: str1ngs: hello! g-golf imports, automatically, all and every class (and methods, class methods, interfaces ...) that appears in the class precedence list of the class(es) your are importing/using, so yes, Gio is almost always imported, at least partially; daviid: str1ngs: using 2.2.7, you shouldn't do anything 'specific' wrt setenv, unless you'd want to of course, but there is no need to add setenv to %gi-method-short-names-skip (and not map, for example) daviid: str1ngs: when a guile core method is 'promoted' as a generic function, the core procedure becomes the default method (the last one in the describe list ...) - I'm assuming that is what you see whe you refer to Method #< 557569863b80> daviid: str1ngs: here is a default method use, after importing Gio - https://paste.gnome.org/pukyb8ahx daviid: str1ngs: now, both re-exporting the public interface of a module and this setenv 'problem' example (which is only an example, there are many others we could have spoted and used to fix ..) are both very related, although not triggered by the exact same piece of code - and both needs to be fixed 'outside g-golf', the problem has nothing to do with g-golf daviid: *when a guile core procedure is 'promoted' as a generic ... (if it is a method, then it is not promoted, there is already a generic, g-golf just adds another mthod to it ...) wingo: o/ wingo: heya civodul :) civodul: hey wingo! civodul: how are you? wingo: good good good!~ wingo: had a week at the beach. optimistically i took one (1) paper to read -- i read about 25% of it :P wingo: back at work after parental leave etc wingo: how you? civodul: heh :-) civodul: i'm good, had long holidays and read zero papers :-) wingo: :) wingo: i did manage to land a guile thing tho, "case" dispatch is no longer O(n) in number of datums :) civodul: oh, that's nice! civodul: very cool wingo: yeah even symbol dispatch is hash-based wingo: which is pretty fun :) civodul: neat civodul: that happens at tree-il or cps level? wingo: cps civodul: cool wingo: jump tables and all civodul: woot, fancy wingo: and binary search for sparse datum sets wingo: with the recent match fixes, it means some match clauses get compiled to jump tables wingo: need another fix to match compilation to get more cases tho civodul: awesome civodul: faster case/match makes us all happier wingo: yeah! wingo: http://git.savannah.gnu.org/cgit/guile.git/tree/module/language/cps/switch.scm civodul: thanks civodul: do you know what impact this had on the speed on the compiler itself or that of "case-heavy" benchmarks? wingo: civodul: didn't have time to check; it's on my list wingo: for the compiler itself it's neutral civodul: ok wingo: because it doesn't take much time to run, but the match limitations mean that it recognizes fewer cases as optimizable wingo: could be more of a win once the long clauses in (language cps compile-bytecode) become optimizable civodul: i need to catch up on these match issues wingo: i am writing a paper about it wingo: will have a bit more time over the next month, hope to finish that writeup then civodul: great wingo: there are some interesting optimizations that we do that appear to actually be novel, and that even gcc/llvm don't do civodul: it's definitely worth writing about it wingo: hehe i agree, the only question is where and how ;) will see soon dsmith-work: Monday Greetings, Guilers dsmith-work: wingo: Parental leave? You got kid(s) now? wingo: yep, two dsmith-work: wingo: Well! Congratulations! Welcome to Dad-ness. wingo: tx :) civodul: wingo: it seems we never incremented "serial" in guile.m4 in recent years wingo: doh civodul: which encourages aclocal to ignore and keep using old copies :-) wingo: ah! wingo: we have such lovely tools wingo: :) civodul: isn't it civodul: well we can make it serial 11 this year :-) wingo: woo :) wingo: civodul: hey q for you, someone has a patch to make fibers use libevent, so it can run on macos -- https://github.com/wingo/fibers/pull/42 wingo: my irrational instinct is that it sounds great to have an optional dep but not to rely on libevent wingo: is that ridiculous? wingo: asking just because you know of more fibers uses, and also because it affects how easy it would be to add fibers to guile, if we ever wanted to do that wingo: (i have no idea whether that's a good idea) civodul: right civodul: i'd say that if keeping the non-libevent code is "cheap", then it's ok to do so wingo: but to your mind it should be possible to run without libevent? wingo: my lizard brain thinks that way but i don't trust it! civodul: you mean would it be possible to avoid libevent on macOS? civodul: i have no idea wingo: no i mean, on gnu/linux, we shouldn't require libevent civodul: yes, i agree civodul: i mean the epoll code is already there anyway civodul: so the question is whether to add a libevent backend vs. replace epoll with libevent, right? civodul: now, the other aspect to consider here is getting the person who contributed this code on-board :-) *: chrislck having parental leave too o/ dsmith-work: Hah. guix and civodul: https://www.nature.com/articles/d41586-020-02462-7 dsmith-work: wingo: btw: any idea why re-export-public-interface is broken in guile 3? https://paste.gnome.org/p6tasyf73#line-22 civodul: dsmith-work: yeah, pretty fun :-) wingo: dsmith-work: weird, dunno what the deal is str1ngs: sneek later tell daviid. I was just explaining how setenv was both related and not related to the guile 3 issue. It's still an issue for me in regards guile 2.2.7 and I will be using %gi-method-short-names-skip with setenv. The issues being I rather be explicit when it comes to setting environment variables. sneek: Got it. dsmith-work: sneek: botsnack sneek: :) manumanumanu: wingo: regarding libevent on osx: Nobody likes osx kqueue. It is buggy like a dead pidgeon that has been lying in the sun for a week. Congrats, btw! First kid? dsmith-work: sneek: later tell daviid, Hope you don't mind. Posted this bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43025 sneek: Will do. str1ngs: dsmith-work: thank you. much appreciated . dsmith-work: sneek: botsnack sneek: :) dsmith-work: manumanumanu: "buggy like a dead pidgeon that has been lying in the sun for a week" Gotta remember that one. manumanumanu: dsmith-work: true story: I had to scoop a dead, decaying pidgeon from the rooftop outside my work window today. I mistakenly thought it would be an easy match. I got out with a shovel in one hand, a plastic bad in the other. A minor touch to the pidgeon and it rolled over, exposing decaying flesh full with flies and maggots and a smell that wasn't of this world. The comparison is, believe it or not, actually manumanumanu: unfair to the mac kqueue implementation. dsmith-work: That kind of stuff has a way of reaching deep into the nostrils, grabbing something, and pulling hard. manumanumanu: The guy overlooking the operation actually barfed, and he was standing 3 meters away. Inside looking though a window. manumanumanu: It makes it to the top 3 most disgusting things I have ever done. When the memory fades I might reconsider the unfairness of the comparison to kqueue though, but that is mostly because of life time lost due to kqueue on mac behaving badly. manumanumanu: A digression! Back to hacking on the most expressive looping facility syntax-rules can provide! foof-loop will pale in comparison! manumanumanu: (it will not, but I will add some syntactic comfort to foof-loop for subloops and lazy loops) dsmith-work: So is it kqueue or kqueue-on-mac that's horrible? manumanumanu: kqueue-on-mac dsmith-work: Ok. The bsd folks seem quite pleased with kqueue. Maybe that depends on who you talk to. manumanumanu: bsd kqueue is fine. The lifetime lost was on porting a simple piece of code to mac. It just wouldn't work. I stared at it for weeks, and tried a gazillion things. I had my freebsd friend look at it telling me it was fine. In the end a mac developer told me "oh, yeah. It is broken. You need an extra select.". manumanumanu: this is a long time ago when I actually believed I knew C. rilez: is anyone working on a clojure-on-guile? str1ngs: Hello daviid. I have a good idea what's happening with setenv. Seems short method names produces setenv when GIO is used. Example g_app_launch_context_setenv. You can test this from a REPL with (gi-import "Gio") and (describe setenv). That should cover the setenv #< ( ) generic method. But I'm not sure what's used for Method #< 557569863b80> maybe g_setenv? It's not that str1ngs: important since I can add setenv to %gi-method-short-names-skip. At least with guile 2.2.7 that clears things up. with guile 3.0 I have not tested yet. Though I think the other guile 3.0 issue we discussed just brought this my attention. I don't import Gio directly it's a typelib dependency somewhere. rilez: more importantly, is there a library for generic collection access + algorithms? leoprikler: rilez: I don't think Guile has generics in the same way other languages do. Procedures are very specific w.r.t. the types they operate on leoprikler: It also rarely makes sense to use an implementation that assumes e.g. lists for doing stuff with vectors or arrays. bitwiz: mauritslamers: great :) catonano: leoprikler: I remember reading a hint about the expectation that a thng being called is always a lambda on Andy Wiongo's blog. In discussing the idea from Clojure that you can call a collection thing as if it was a lambda. Or something. RhodiumToad: you can create callable things in guile that are not lambdas catonano: leoprikler: as for lists being the thing in lispy languages, I heard a claim about that by Rich Hickey. Also Sussman remarked that the idea of having abstract types and lists being only one possible reification was a good idea by the Clojure folks catonano: RhodiumToad: can you ? How ? RhodiumToad: easiest way is to make a goops class derived from or catonano: ah right. I tend to overlook goops RhodiumToad: you can make applicable structs outside of goops too catonano: really ? How ? RhodiumToad: I've not tried RhodiumToad: but I know it's possible, not least because goops can do it catonano: interesting. I'd be curious to know how 🤔️ RhodiumToad: I don't know if any of the record APIs allow it. RhodiumToad: examples of how its done can be found in the guile core modules RhodiumToad: for example, parameters are applicable structs RhodiumToad: that's probably the simplest example, actually RhodiumToad: see boot-9.scm on the page starting ";;; {Parameters}" catonano: RhodiumToad: note taken catonano: thanks RhodiumToad: this is one way to do it with goops: https://dpaste.org/QGRD RhodiumToad: with that code, an object of class can be called as (obj key) to look up keys, or (set! (obj key) val) to modify catonano: RhodiumToad: thanks ! I saved it locally as a reference ! RhodiumToad: it's also possible to make a base class which forwards the apply and setter operations to specific method names, and then you can just derive from that RhodiumToad: (you need something like that if you want to make an applicable object which is derived from a non-applicable one, for example) catonano: I see catonano: RhodiumToad: it would be nice if you would contribute an example showing this to the collection of Guile code examples that has been discussed recently on the mailing list peanutbutterandc: Hey there lfam: I'm wondering, does Guile have a procedure that can be used to read a list in a random order? I'd like to randomize the order in which these URLs are accessed by Guix: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/download.scm?h=v1.1.0#n63 minerjoe: manumanumanu: thanks much. I know about those, was hoping for a more developed library, which I hadn't found yet. I'll give them a whirl. minerjoe: str1ngs: thanks! chrislck: lfam: list->vector, fisher-yates shuffle, vector->list? chrislck: all https://www.rosettacode.org/wiki/Knuth_shuffle#Scheme str1ngs: chrislck: is that a dance? or an algorithm? :P lfam: chrislck: Thank, I will check those out lisbeths: I am trying out this: http://www.gnu.org/software/guile-gtk/docs/guile-gtk/Introduction.html#Introduction and I get this: https://pastebin.com/raw/yssrrTCd lisbeths: I think I need to install the gtk-2.0 module from the command line but I cant find how to do that leoprikler: I think you need some guile-gnome module to fix your load path lisbeths: hmmmmmm do I need guix to do that or can I just do that with apt leoprikler: you probably already have the module, you just need the right use-modules clause lisbeths: so is my path messed up? bitwiz: lisbeths: apt install guile-gnome2-gtk I think leoprikler: not really, guile-gnome has this gimmick where you need to load the main module first and then can use the rest lisbeths: I tried installing that it still says no code for module (gtk-2.0 gtk) lisbeths: whats "the main module" bitwiz: Are you using Guile from Debian as well, or a version you installed yourself from source? lisbeths: I am using guile from ubuntu's snapshot of the debian repos for todays date on version 20.04 lisbeths: I am not using debians repositories: ubuntu does not use those bitwiz: Ok, that sounds good (sorry - I assumed you were on Debian when you mentioned 'apt') lisbeths: My goal is to learn webassembly or webkit using gtk using scheme lisbeths: so I want to learn gtk for the first time using guile leoprikler: WebAssembly and Webkit sound like two very different beasts ;) lisbeths: then webassembly lisbeths: for now though I just wanna do gtk with guile leoprikler: for the record, where did apt install guile-gtk to? lisbeths: uh I do not know how to test for that lisbeths: i am willing to use guix package manager if that makes things easier leoprikler: the thing is, guix does not have guile-gtk, only guile-gnome if you're going for "old and finished" bitwiz: (guile gtk) looks to be really old and not updated for 13 years. (gnome gtk) from guile-gnome looks a lot more recent, although even that seems to be targetting Guile 2.2 and GTK 2.0 leoprikler: if you want "new and experimental", then g-golf or guile-gi are probably what you want lisbeths: I would prefer old and finished for now leoprikler: in that case install guile-gnome from either apt or guix bitwiz: About finding the installed files: try 'find /usr/share/guile -name gtk.scm' leoprikler: For guile-gnome, you can find the docs at http://www.gnu.org/software/guile-gnome/docs/ mauritslamers: Hi all, I have a system in which I use a global variable as a list of alists to keep a series of events. These alists have all possible properties already set with a value. Now in processing this event list I use an object property to keep track of a subset of these events. In a procedure I retrieve this subset and call another procedure to perform certain changes on these subset of alists. It turns out that the changes I perform on these ali mauritslamers: are not applies to the alists as I have them in the global variable. Somewhere on the way I lose the pointer / reference to the actual alists as they are in the event list. Could any of you shed some light on where that might be? bitwiz: How do you select the subset of events? bitwiz: It might be less confusing if you use a list of records instead of a list of alists mauritslamers: bitwiz: I understand, but that is not really possible at this moment as it would cause too much of an overhaul at this moment :) mauritslamers: I select the subset of events by adding them with append mauritslamers: (set! (objprop state-obj) (append (objprop state-ob) (list evt))) mauritslamers: so adding them one by one whenever I encounter them chrislck: isn't it better consing lists? mauritslamers: actually, that is what I am doing for these sublists, I use append for almost everything else as I don't want to change the order bitwiz: I'm not sure, but this looks very similar to the mess I got into with my own project. Start by drawing diagrams of cons cells and it should start making sense. I really recommend record types, then using filter to find the subset. It'll be less code, should work the way you expect, and might not even take much work mauritslamers: bitwiz: I understand your concern, and I will most surely have a deeper look at the record types. I am using alists as I am doing embedded guile in Lilypond, which uses alists exclusively as far as I know. bitwiz: Ah right, then it's not under your control mauritslamers: also, because of the transformation I need to do, I cannot use filter, as the structures of events can be nested and the properties I set can be in different nestings. The events are going one by one through a specific procedure. I gather the events based on a specific key having value true. After it turns false, I need to process the gathered events to change certain properties on those events nikita`: why am I banned from #guix ? I did type nothing in the last days. All I see in my log is a mass-ban of nicks bitwiz: Should your 'set!' be 'set-cdr!' ? How does 'objprop' work? nikita`: ok, nvm whatever it was i'm no longer banned mauritslamers: bitwiz: the objprop is an object property, as created by (make-object-property) mauritslamers: One of the reasons I was asking was that I wondered whether setting the value of an object property would cause a list copy instead of a pointer copy mauritslamers: nevertheless, it might indeed be that using records would make my life lots easier mauritslamers: my main programming language is JS actually, so I am more familiar with doing things mutable and keeping track of references as it is done in JS. mauritslamers: they seem to be available in guile 1.8.7 which is what Lilypond uses bitwiz: Yeah, the switch from procedural/mutable style to Scheme completely kicked my ass at first too (only just getting out of that now) bitwiz: Are you expecting (set! (objprop ...) new-val) to set the property itself? mauritslamers: and record types seem to be a nice way to document things mauritslamers: bitwiz: mauritslamers: no, bitwiz: Hang on, I think I understand what you're doing now mauritslamers: When I call that procedure with this sublist, I run a for-each on that sublist, setting the value of a key: (assoc-set! evt 'prop value) mauritslamers: assoc-set! will return a new list when the key didn't exist yet, which is why I have all keys already set mauritslamers: but for some reason it looks like that I am working on a copy of the event and not the orignal mauritslamers: can record types be "extended", something like derived or subclassing? mauritslamers: there is a set of shared properties / fields all events use, and type specific fields mauritslamers: ah, it looks like that is srfi99 which is not implemented by 1.8.7 mauritslamers: but I might be able to deal with that by having a "common-properties" field, which is in it self another record bitwiz: About your list problem, though: the code you posted looks right to me (you get away with set! because object properties are 'procedures with setters'). What is (list evt) doing? bitwiz: Are object properties settable in Guile 1.8? mauritslamers: bitwiz: yes, they are mauritslamers: (list evt) is necessary when using append, because otherwise it would take the contents of the alist to add to the list bitwiz: So you end up with a new alist, right. When you set values in the new alist, I don't think there's any easy way to be sure the changed values affect the original alist, for the same reason that you need the set! here mauritslamers: originally this code was part of a huge closure, where I was using variables to keep track of these sublists, and that worked without issue. mauritslamers: but that function with closure was 300+ LOC mauritslamers: and not even half of the possible event types were implemented, so I tried a refactor to make things smaller and manageable. That has worked, but this bit is biting me still mauritslamers: bitwiz: I think I know my problem... the property name is wrong... mauritslamers: as in: in (assoc-set! obj key val) I am using the wrong key, which doesn't already exist mauritslamers: So, everything works as it should, just not me :D dsmith-work: Happy Friday, Guilers!! pkill9: whoa it's friday pkill9: yesterday i thought it was going to be saturday dsmith-work: Tomorrow I thought today was yesterday... *: sneek looks squinty eyed at dsmith-work RhodiumToad: today is the tomorrow you worried about yesterday chrislck: off-by-1 error... happens to anyone leoprikler: there are two big problems in computer science: cache invalidation, naming, and of-by-1 errors :) str1ngs: in my case it's a combination of those and also PEBKAC :P minerjoe: Hello all. Is there are library for guile that allows me to do things I would do in the shell? Most importantly start a subprocess and monitor it's output? str1ngs: minerjoe: probably you want open-pipe which is built into guile. see https://www.gnu.org/software/guile/manual/html_node/Pipes.html manumanumanu: minerjoe: and if open-pipe is not enough, there is a hidden open-process that allows you to handle input and output separately manumanumanu: it is hidden, and can be found like this: (define open-process (@@ (ice-9 popen) open-process))) (i think) manumanumanu: hasn't there been at least one patch to expose open-process? dsmith-work: There is also pipeline. More complicated, but if you need it, it's there. daviid: dsmith: np! here is the snipset I did paste to reproduce the problem https://paste.gnome.org/p6tasyf73 (only valid a few days ...) - it would be good if you could (re)read the log of http://logs.guix.gnu.org/guile/2020-08-18.log, top part of the log, where i give a little context about the re-export-public-interface macro ... tx! sneek: Welcome back daviid, you have 1 message! sneek: daviid, peanutbutterandc says: Is work ongoing to make g-golf compatible with 3.x series, too? dsmith: daviid: On a guess, I tried adding "#:re-export (map)" to the define-module form in a.scm dsmith: scheme@(guile-user)> map dsmith: WARNING: (guile-user): imported module (a) overrides core binding `map' dsmith: WARNING: (guile-user): imported module (a) overrides core binding `map' dsmith: $1 = # dsmith: daviid: I guess that's what re-export-public-interface is supposed to do? daviid: dsmith: right, str1ngs did also proposed to add #:re-export-and-replace (which afaaict only exists for 3.0.4 and future versions ... but I wish, that is the all point actually, very precisely that users don't have to do that daviid: dsmith: and no warnings either, just like you have no warning when you import (srfi srfi-1) ina module or in the repl ... or does 3.0.4 produces warnings whn one import srfi-1 in the rpl ... i hav nearly zro xperienc with 3.0 so far ... daviid: dsmith: I also wouldn't want to maintain diff version of a same module for diff guile versions - so, the solution is expectd to be fully automatic, for both 2.2 and 3.0 ... dsmith: Well, I've been playing a bit with it here. dsmith: But I really don't know much about the way modules work. dsmith: daviid: Since you have such a nice repeatable test case, probably best to file a bug against Guile 3. dsmith: daviid: Andy did made some changes to modules. Not sure exactly what. dsmith: daviid: One of the changed needed for bobot++ was to replace %module-public-interface with (module-public-interface (current-module)) dsmith: daviid: But it looks like re-export-public-interface already has that. daviid: dsmith: ok thanks for the help and tip - I know there has been changes, and I am prety sure something can be cooked for 3.0 as well, it's just that i have users willing that it works 'now', and I won't be able to lok into this 'now' ... hence my request for elp ... thanks for your time dsmith: It may be instructive to see what differences there are in re-export between 2.x and 3.0, if any. daviid: sure, as it migyht be ineteresting to look at module-use! as well, but i'm really not having time to do that now, thanks again dsmith: I would think you could just call re-export with the list of public symbols from the modules of interest, dsmith: but re-export takes actual symbols, not a list. And it's a macro, so you can't apply it. dsmith: And is there some reason re-export-public-interface is a define-macro instead of a define-syntax ? daviid: right, i also think 3.0.4 mandate to use re-export-and-replace in certain circumstances ... all this needs a deep analysis, will do, but not 'now' dsmith: Yep daviid: dsmith: to the last quiz, i think historical reasons, re-export-public-interface is nearly 20y old :) daviid: andy probably never told us he was an advance lisper in a previous life :):) dsmith: Ahh, pre-dates the better macros dsmith: Long ago, you needed to use-modules syncase. Or was it use-syntax syncase? Anyway it was a really long time to load. I'm thinking like 0.5 - 2.0 seconds or so. dsmith: And so define-syntax was avoided unless the cost was worth it. daviid: i think guil-gnome is not that old, i did exaggerate a bit :):) dsmith: Long long LONG ago, guile had tk built in! peanutbutterandc: Hey there, peanutbutterandc: is anybody aware that (procedure-source) does not work in guile? peanutbutterandc: Okay there's a bug report too: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24887 hmm dsmith-work: Thursday Greetings, Guilers leoprikler: guile-gnome is stone-age old dadinn: hi all pkill9: hi dadinn: I am getting a weird compilation error complaining about an unbound variable, but the script still runs dadinn: this is the definition: (define current-dir (dirname (current-filename))) dadinn: I use it in a call right after it: (add-to-load-path current-dir) dadinn: this is because I have some modules in a git submodule, and want to use them dadinn: but i think the error comes after this, at the end of the file I am referring to it again dadinn: tried to compile the script with guild also, which gives a bit more of the backtrace, but it is not really useful dadinn: these are the logs from guild: https://imgbox.com/4Xgt3zPG dadinn: hmm, actually it seems that it fails right at the add-to-load-path call :/ daviid: dadinn: could you try (add-to-load-path (dirname (current-filename))) instead, and also call (dirname (current-filename)) at the other places, instead of refering to current-dir, and see if that works sneek: daviid, you have 3 messages! sneek: daviid, peanutbutterandc says: I tried to take a quick poke at running the hello-world g-golf script and then ran into the following issues: 1. g-golf isn't guile3.x ready yet. worked around that issue using: `guix environment --ad-hoc guile@2.2.7 g-golf` but then encountered 2. this error: https://termbin.com/myt5 (I also had to make a small change to how the script itself was called: https://termbin.com/cjds ) sneek: daviid, peanutbutterandc says: sorry false alarm `guix environment --ad-hoc guile@2.2.7 g-golf gtk+` worked just great (thanks to leoprikler for pointing my foolish mistake). Shiny! sneek: daviid, dsmith-work says: I never got to the bottom of the mising for-each issue. I assumed it was some interaction with the way bobot++ was messing with modules. I just used srfi-1 and moved on. dadinn: daviid: yes it was like that before, and it used to work. I extracted the current-dir, because I would need it later in the script :/ daviid: dadinn: ok, the problem is add-to-load-path does its job at compile and runtime times, if you want to define a variable, you need to make it bound at expand load and eval, try this: daviid: (define current-dir #f) daviid: (eval-when (expand load eval) (set! current-dir (dirname (current-filename)))) daviid: and see if that fixes it dadinn: the set! call seems to make it unset again dadinn: this must be some serious black magic! :) dadinn: Geiser doesn't seem to find docs for expand... are you sure it should be like that? daviid: sneek: later tell peanutbutterandc you need to install, on guix, what correspond on debian to the gir1.2-gtk-3.0:amd64 (or another arch of course, i pasted what is on my computer ..) daviid: sneek daviid: dadinn: i don't understand 'to make it unset again' dadinn: sorry, I meant undefined... (define current-dir #f) sets it to #f, but the eval-when call makes it undefined again daviid: dadinn: i think you should stick to (add-to-load-path (dirname (current-filename))) - but i'll try here, so far i was just maiking assumptions ... daviid: sneek: later tell daviid hello sneek: Will do. daviid: . sneek: Welcome back daviid, you have 1 message! sneek: daviid, daviid says: hello daviid: hum, weirtd it didn't catch the realier message daviid: sneek: later tell peanutbutterandc yes, you need 2.0 or 2.2, and yes, you need to install the Gtk typelib, on debian, it would be the gir1.2-gtk-3.0:amd64 (or what ever postfix for your acrch of course) ... sneek: Will do. daviid: tx leoprikler :) daviid: dsmith-work: understood daviid: dadinn: what version of gule are you using? daviid: *guile dadinn: daviid: i didn't quite understand the add-to-load-path doing its thing bit... also I have no clue what the (eval-when (expand load eval)... ) bit does... where could i read up on these? dadinn: daviid: I am using guile-2.2 on Debian buster daviid: dadinn: ok let me check here dadinn: specifically the version is 2.2.4 daviid: but in 'general terms', it's because both the eval-when ... and the add-to-load-path (which calls eval-when ...)) tries to access the variable at expand load eval time ... you should stick to the (add-to-load-path (dirname (current-filename))) daviid: dadinn: 6.10.8 Eval-when dadinn: daviid: yeah, read it... wow! Is my cat going to die? :D daviid: dadinn: well, i hope you only did void your warranty :) daviid: dadinn: hum, the example is a bit diff there can you try it? i mean the same but for your use: daviid: (eval-when (expand load eval) (define current-dir ...)) - i personally would still stick to (add-to-load-path (dirname (current-filename))), but would use that 'example' to define current-dir 'for later use' as you said ... dadinn: daviid: yeah, with all 3 (expand, load, eval) it seems to work daviid: dadinn: ok, keep that in mind for the other 6 lives of your cat :):) dadinn: I never heard about the separate contex/steps between load and eval... is this because the byte compiled code executes differently from an eval call (like in the REPL)? dadinn: an eval call I suppose have to byte-compile the expression beforehand, and then load it? What does "run-time" mean then? daviid: dadinn: i'll let others answer those questions, i am a bit busy, i wanted to quick help you ... dadinn: hmm, never went this deep down the rabbit-hole before... possibly I should have choosen the blue pill! :D dadinn: daviid: No worries, thanks for the help... learned something useful it seems! :P daviid: dadinn: you really want to understand that rabbit-hole :) otherwise it will catch you gain daviid: make sure you undertand the date example in the manual, if not ask here, i hope someone can explain ... dadinn: daviid: yeah, the date example is good, I don't quite get it yet... evaluating it in my head... Does not compute! dadinn: daviid: Not sure how many lifes my cat has left with, but it seems if I only use (eval-when (expand) (define (current-dir ...))) that works fine. The load, and eval wasn't needed dadinn: does this mean that add-to-load-path itself is a macro? :P daviid: dadinn: that won't work if you change the plce of the module ... you really want to always use expand load eval ,until you really really know what's going on ... daviid: add-to-load-path is a syntax, look at its definition, in (ice-9 boot-9) dadinn: daviid: actually that was I wanted to ask: I see that the .go file is in a cache, so if I move the scm script to a different dir, would this fail? daviid: dadinn: you're putting your cat in danger :) daviid: try and siplay (use peek to make a quick trest daviid: anyway - you've been warned ... be on the safe side when you uswe/have to use eval-when ... use (expand load eval) ... dadinn: daviid: thanks again, I think I will not dig deeper for now... cat's lives matter! :P jgart: how can I give this as input '(1 1 1 1) and get this as output '(0 1 2 3) jgart: I want to construct a list from intervals jgart: my input list above shows the intervals between adjacent integers in the output list jgart: any suggestions/tips are greatly appreciated brendyyn: thats 4 intervals so it would be 5 numbers in the output, not 4? else the first one is starting at -1 jgart: sorry, the input list should be '(1 1 1) brendyyn, it builds the intervals from a "root" i.e. integer 0 jgart: brendyyn, and yes you are correct jgart: if the input list is of length 4 then it outputs a list of size 5 jgart: etc... daviid: dsmith-work: answering the quiz you wrote to str1ngs, because it is not str1ngs 'fault' daviid: dsmith-work: str1ngs 'faces' a situation which is 'created' by the use of a re-export macro, in a way as i described in the snipset ... so not gona repeat, pease read and try the snipśet (in the log ... ping me if you can't find it), try both with 2.2.x nd 3.0.4 (may be it fails with 3.0.3 as well, but it did work with 2.9.x and 3.0.0 ...) daviid: dsmith-work: str1ngs is merely a 'victim' here :), that g-golf not only exte4nsively uses the re-export macro, but it does to also re-export sfri-1 public interface, which triggers the problem, but it has nothig to do with g-golf 'per se', not with str1ngs programs, it is a consequence of some 3.0.4 compiler optimazation technique, which expects some name(s) to be immutable - justin_smith: daviid: so the error is provably in the incompatible assumptions of the codebase and the new compiler, and pragmatically can be solved on either side or both daviid: I want to understand and hopefully patch that so one can re-export the public iterface of any module, srf-1 is just a 'pretext' and a good/easy way to reproduce the problem daviid: justin_smith: I don't understand that sentence, sorry - if you think you understand the problem (I mean if you know guile's source code deep down to ... please use the snipset, patch module-use! or fix the macro ... many thanks if you can and the free time to do so, i'm on sonmething else for now and would greatly apreciate a fix from one of our expert guierls 'out there' ... tx justin_smith: daviid: I should have phrased it as a question - I think I recognize a familiar architectural problem, and hoping I can help by articulating it justin_smith: daviid: in older guile, re-export is safe. In guile 3 (as designed), immutable macros are safe. The combination is an error. If we had access to both the app codebase and the guile codebase and could change either, there's two ways to fix the issue. justin_smith: pragmatically, as a political choice, how many codebases re-export and are therefore broken by this new guile behavior? is the benefit of immutable macros great enough to risk the breakage? justin_smith: that's the question I was rather incoherently starting to ask justin_smith: I hope that's clearer daviid: justin_smith: ah ok - I don't have time to go with this the way you wish to, please use the snipset with 2.2, then 3.0.4, if you can fix it, perfect if not, well too bad justin_smith: OK, I'll see if I have time to help, I was hoping the low effort path of asking some questions would make the answer obvious :D justin_smith: cheers! daviid: there is nothing esle but running a 10 lines snpset and fix it ... the rest is a complete lost of time ... afaic, thanks for help if you can ... chrislck: jgart: (let lp ((in in) (out '(0)) (start (car in))) chrislck: (if (null? in) chrislck: (write (reverse out)) chrislck: (lp (cdr in) chrislck: (cons (+ start init) out) chrislck: (+ start (car in))))) chrislck: gone lloda: what i was looking for the other day to look up the backtrace manually is lloda: (frame-arguments (vector-ref (debug-frames (repl-debug (car (fluid-ref *repl-stack*)))) 0)) lloda: which is from backtrace in (system repl command) lloda: you don't really need to use call-with-error-handling since the default repl already prepares the debug stack for you a_v_p: Finally managed to get M#! macro for Metabash working: https://github.com/artyom-poptsov/metabash#example dsmith: daviid: Sorry if I came across wrong. I was merely asking str1ngs what is the sequence of events that casues the failure to happen. Tryting to get to a minimal test case. dsmith: daviid: Do you have a minimal test case? dsmith-work: Hey Hi Howdy, Guilers janneke: hello dsmith-work :) manumanumanu: Ahoy guilers! daviid: dsmith-work: hello! I so far did not understand, from what you wrote 'back then' and what i read from you today, what happend, what actually causes/caused the for-each proc, in your exprerience/environment, while porting the scheme part of the bot code to 3.0.4 - what caused for-each to be unbound and how you solve the problem - if you do know, please share, daviid: dsmith-work: asking because, as you probably did read here, re-exporting the public interface of a module (which merely calls module-use!) does not work in 3.0.4 and either needs to be patched or the code that uses it to be adapted - therefore, I am gathering all knowledge and experience(s) I can from other guilers ... tx daviid: the re-export-public-interface was first introduced by andy, in guile-gnome, I snarfed and used it 'as is' for as long as I can remember, where I neede t of course ... here http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/utils.scm#n183 - I just changed the name daviid: the code is actually defined in two places in guile-gnome, probably for bootstrap reason, I don't remember - http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gw/support/modules.scm daviid: I probably can fix this, at least I hope I can :), but I am asking for help, so I can focus on other g-golf missing things/features ... if anyone beats me, that would be wonderful - you do need to know quite a bit about module introspection, all these proc/syntax are in (ice-9 boot) - i will paste a super tiny code sample in a sec, so who's interested can reproduce and work on a solution ... daviid: here - https://paste.gnome.org/p6tasyf73 (I made the paste valid for one week) peanutbutterandc: daviid, Mr. David, I am a beginner, who is interested in guile and gtk. But looking at g-golf, it seems that it is a gnome thing.... should I be looking for something else or will g-golf do all gtk thingies too? peanutbutterandc: also, are there any resources that you would like to recommend for me so that I can, someday, do bright and shiny stuffs with guile? daviid: peanutbutterandc: g-golf will let you 'play with' any gnome library(ies) that have a so called GObject Introspection typelib, Gtk, WebKitGtk, and many others ... so yes, you may use g-golf to build a gtk app - fy, there is another guile project that will let you dfo that to, called guile-gi peanutbutterandc: daviid, I see. Now, for a beginner like me, how should I go about learning gtk? Should I first poke around with C, and then go to reading the manuals for g-golf (or guile-gi)? Or should someone like me start from g-golf, etc. ? daviid: wrt to the last question, maybe others may help - you'd need to be a bit more precise on the kind of app/lib/technology you are interested in though peanutbutterandc: daviid, I hope to be able to do some GUI extensions to some free software packages, someday (for my non tech-savvy friends who can't use my script-ed extensions) peanutbutterandc: daviid, GNUCash, in particular. And since it seems to have guile support, I hope that I will be able to write an add-on-like thingy that will plug-in to it (?) peanutbutterandc: might take me 6 more months though... daviid: peanutbutterandc: i would read the 'Basic' part of the Gtk manual, and ask here for ome help when you need some ... there are a few g-golf users here, not many but better then none :) - and i can paste a few tiny example to get you start with peanutbutterandc: daviid, I see... Thank you very much. I will do just that then. GTK manual first and then g-golf. tiny examples would be great help, too. daviid: peanutbutterandc: ah, gnucach actually doesn't use g-golf - it uses guile as an extension, but the gui part is in C, afaict - the gnucach 'guile maintainer' is here, chrislck is there nick in this channel daviid: *their nick peanutbutterandc: daviid, Hmmm..... I see. Well, I am a beginner. And a 'freetard'. And because guile seems to be available to gnucash. And because g-golf seems to make gtk thingies available in guile, and because I am not that well-versed in C, I was hoping I'd be able to write the plug-in in guile peanutbutterandc: even if that is not possible... I'll just have a new skill up my sleeve... and in scheme, too! peanutbutterandc: I will bother chrislck once I learn enough of gtk and g-golf, then. (: daviid: peanutbutterandc: if you wan't to try g-golf, the first thing is to install :), we may help you here as well - what distro are you using? peanutbutterandc: daviid, Linux Mint. But I have guix. And I have seen g-golf in guix, too. (: brendyyn: how does it differ from guile-gi? peanutbutterandc: I will go read those stuffs that you told me to, and then will guix install it sometime today (hopefully) daviid: if you're using guix, there is a package - I must warn you that g-golf is beeing actively devloped, and in a so called 'experimental' stage daviid: peanutbutterandc: here is 'hello world' example using g-golf - https://paste.gnome.org/pzogd6t3m - copy and save the content for later, the paste is valid 6h only ... peanutbutterandc: daviid, Thank you very much. I have saved it. And it does look quite neat. I wonder if I could find the same thing in guile-gi somewhere, for comparison... daviid: peanutbutterandc: also, make sure you read the 'Using G-Golf', 'Before you start' [the user manual is largely incomplete, but what is there is good and will help you, i hope] peanutbutterandc: daviid, Thank you very much. I will. You have been most helpful. (: daviid: peanutbutterandc: you should try the guile-gi website, it has a manual or a wiki, i don't remember - i can't help much about guiler-gi i am afraid, not that i wouldn't want to, it's just that i don't know peanutbutterandc: daviid, I see. I will take a look at that too. Thank you very much daviid: welcome peanutbutterandc: :) roelj: How would I define a symbol from C, so that I can do scm_is_eq (, );? leoprikler: roelj: symbol as in (eq? param 'my-symbol) leoprikler: If so, you probably want scm_from_utf8_symbol leoprikler: brendyyn: g-golf and guile-gi have made different design decisions leoprikler: the former is (almost?) purely Scheme, whereas the latter has quite a sizable C extension leoprikler: the former uses --, whereas the latter uses - leoprikler: (both also expose ) leoprikler: the latter exposes accessors and signals as methods, which can lead to a lot of confusion leoprikler: the former is in the process of being made compatible with Guile 3, whereas the latter (supposedly) already has that leoprikler: And the latter troublingly has some bugs, that only manifest themselves on Guix (related to the greater GI_ troubles there) peanutbutterandc: sneek, tell daviid: I tried to take a quick poke at running the hello-world g-golf script and then ran into the following issues: 1. g-golf isn't guile3.x ready yet. worked around that issue using: `guix environment --ad-hoc guile@2.2.7 g-golf` but then encountered 2. this error: https://termbin.com/myt5 (I also had to make a small change to how the script itself was called: https://termbin.com/cjds ) Thought you might like the reports. P.S: I peanutbutterandc: changed the error log to have $HOME. sneek: daviid:, peanutbutterandc says: I tried to take a quick poke at running the hello-world g-golf script and then ran into the following issues: 1. g-golf isn't guile3.x ready yet. worked around that issue using: `guix environment --ad-hoc guile@2.2.7 g-golf` but then encountered 2. this error: https://termbin.com/myt5 (I also had to make a small change to how the script itself was called: https://termbin.com/cjds ) Thought you might like the rep peanutbutterandc: wait, I thought sneek was going to wait till daviid was online peanutbutterandc: sneek help peanutbutterandc: sneek later tell daviid I tried to take a quick poke at running the hello-world g-golf script and then ran into the following issues: 1. g-golf isn't guile3.x ready yet. worked around that issue using: `guix environment --ad-hoc guile@2.2.7 g-golf` but then encountered 2. this error: https://termbin.com/myt5 (I also had to make a small change to how the script itself was called: https://termbin.com/cjds ) sneek: Will do. peanutbutterandc: sneek, botsnack sneek: :) leoprikler: peanutbutterandc: you need gtk+ in your environment and adjust GI_TYPELIB_PATH peanutbutterandc: leoprikler, lol I knew I was doing something wrong. Thank you very much. That makes much more sense. I am a n00b. Sorry for the inconvenience. peanutbutterandc: sneek, later tell daviid sorry false alarm `guix environment --ad-hoc guile@2.2.7 g-golf gtk+` worked just great (thanks to leoprikler for pointing my foolish mistake). Shiny! sneek: Will do. peanutbutterandc: sneek, botsnack sneek: :) peanutbutterandc: leoprikler, could you please tell me why `guix environment --ad-hoc guile guile-gi gtk+` doesn't work? Error: https://termbin.com/09kl leoprikler: the guile-gi recipe in Guix is broken, use the one from upstream peanutbutterandc: leoprikler, :( rekado_: do we have a bug report about guile-gi in Guix? rekado_: I only see one which isn’t relevant: https://issues.guix.gnu.org/search?query=guile-gi+is%3Aopen leoprikler: I don't think so, but upstream has this: https://github.com/spk121/guile-gi/issues/84 leoprikler: The upstream recipe differs heavily from that being used in Guix, specifically w.r.t. inputs, so I think it would need a bit more review rekado_: peanutbutterandc: with my changes I can enter an environment containing guile guile-gi and gtk+. Is there anything else I need to do to reproduce the error? peanutbutterandc: rekado_, Hey there: `guile this-script` https://termbin.com/y0cp did it for me rekado_: the good news is that it doesn’t crash rekado_: the bad news is that it doesn’t seem to do what it’s supposed to rekado_: all I see is this: https://dpaste.com/8QCD9JRG9 peanutbutterandc: rekado_, I see. g-golf does work. But it only runs on guile2.x. leoprikler: rekado_: That is a typical GI_ env-related issue, that you only see in Guix leoprikler: Try using a pure environment and exporting XAUTHORITY as well as XDG_* rekado_: with this I get In procedure connect: Wrong type argument in position 1 (expecting open file port): #< 7f0f98c66500> leoprikler: hmm, guile-gi should provide a connect override for GObjects leoprikler: (connect button print-hello) → (connect button clicked print-hello) rekado_: yes, that did it rekado_: to summarize: I patched the definition of guile-gi, ran ./pre-inst-env guix environment --pure --ad-hoc guile guile-gi rekado_: then ran export XAUTHORITY=/run/user/1000/gdm/Xauthority rekado_: and then ran the application with guile this.scm rekado_: a window with a button pops up rekado_: when clicking the button it prints “Hello World” rekado_: I’ll push my patches to the guile-gi package definition dsmith-work: Hey Hi Howdy, Guilers roelj: Hi dsmith-work! dsmith-work: sneek: later tell daviid I never got to the bottom of the mising for-each issue. I assumed it was some interaction with the way bobot++ was messing with modules. I just used srfi-1 and moved on. sneek: Got it. dsmith-work: roelj: Hey. dsmith-work: str1ngs: So let me get this straight, You want to use map. You use-modules some other module that uses srfi-1, and that makes your access to the core map go away? random-nick: hello, how come mit scheme is faster than guile 3 on those scheme microbenchmarks? https://ecraven.github.io/r7rs-benchmarks/index.html tohoyn: sneek: botsnack sneek: :) tohoyn: daviid: what is the situation with G-Golf? dsmith-work: Monday Greetings, Guilers mwette: Have a great week! lloda: |o lloda: could use an example of how to use display-backtrace lloda: or even how to get at the data there lloda: I find the doc obscure :-/ dsmith-work: str1ngs: So the problem I had bringing the bot over was (IIRC) was for-each being undefined (!!). Initially, I rewrote the calling code with named let instead. I found that srfi-1 for-each was still available, so I went back to that. d4ryus: lloda: does (catch #t (lambda () ) (lambda error ) (lambda _ (display-backtrace (make-stack #t) (current-output-port)))) as an example help? The first lambda of catch gets called, on error the 3rd lambda (with the display-backtrace call) gets called before the stack is unwound, then the stack is unwound and the 2nd lambda gets called. lloda: that helps I think lloda: but how can I look at that stack on the repl? lloda: the printer is of no use d4ryus: Hmm, not sure. You could save the stack and then look at the frames etc. if that helps? d4ryus: I wrote a very basic display-backtrace procudure as a display-backtrace replacement due do display-backtrace not working well with fibers: https://paste.gnome.org/pqrskdxgm maybe you can find some info there on how to inspect the stack lloda: thanks d4ryus i can use that lloda: even tho i'll have to edit & rerun lloda: which i find puzzling since ,bt can obviously access that stack d4ryus: I guess you could hook the repl into it, maybe wrapping your code with call-with-error-handling does the trick? (see: module/system/repl/error-handling.scm line 43) lloda: ooh that seems to be precisely what I need d4ryus: Looks like that is what the guile repl does. It starts a new repl with a debug record (looks like it contains the stack and other info) inside the procedure thats passed as 4th argument (the error handling procedure that gets called before the stack is unwound) to catch. roelj: Does someone have an example of an Autotools-based project that uses a libtool library that is loaded in Guile with "load-extension"? roelj: I don't know how I should configure the distribution of the library so that Guile can find it.. lloda: it seems that frame-arguments doesn't always return a list. Sometimes it returns _ and I don't know what that means... dsmith-work: roelj: An external library? Or is the package the library? roelj: dsmith-work: Uhh.. I have Guile code and C code under one Autotools project. roelj: So, an internal library I suppose :) lloda: apparently '_ means the arguments have been GC'd ? dsmith-work: Ok. This might help: https://gitlab.com/dalepsmith/guile-sqlite I'm not expert on autotools, but that seems to work. dsmith-work: roelj: ^^ roelj: dsmith-work: Of course, I should've gone to the awesome guile-sqlite code! roelj: dsmith-work: Thanks for the pointer, again :) dsmith-work: That's sqlite2. There are better/more extensive guile sqlite3 interfaces out there. roelj: dsmith-work: Well, I only needed line 17 from "configure.ac" dsmith-work: roelj: And 11-17 of Makefile.am dsmith-work: (11-16) dsmith-work: roelj: Specifically, I've named the .so sqlite.so, NOT libsqlite.so . roelj: Hm, I get a "*** No rule to make target 'all'. Stop." when make enters the directory containing the extension code. Any ideas? roelj: Perhaps I forgot LT_INIT lloda: i'm surprised (. x) matches an improper list lloda: i suppose it makes sense erkin: I believe it's nonstandard syntax. RhodiumToad: I think it's how (. x) gets read that causes it RhodiumToad: experimentation suggests that (. x) is read as just x erkin: I guess that wasn't intended. dsmith-work: roelj: You have no "all" target. Either add an all target or have whatever is calling that make use an existign taret. RhodiumToad: so e.g. (match '(a . b) ((. x) x)) is the same as (match '(a . b) (x x)) and in either case is (a . b) dsmith-work: roelj: (without looking at your files..) lloda: so it's (match x ((? list? x) x)) the way to go? lloda: is it RhodiumToad: you want to return x as-is only if it is a proper list? lloda: i want to match a proper list yes d4ryus: lloda: I think _ means "optimized out" RhodiumToad: lloda: or maybe (match x ((e ...) e)) lloda: thx d4ryus i figured lloda: i needed to parse the result of frame-arguments because otherwise the 2nd etc arguments would get removed by the truncated printing lloda: should have thought of that RhodiumToad thx justin_smith: d4ryus: is the "optimized out" state related to TCO by any chance? eg. if the tail call was followed, I'd expect the gc to reclaim the locals of the function that was jumped from justin_smith: otherwise TCO wouldn't work - you'd leave a trail of all the locals back through the call chain justin_smith: I think justin_smith: well, it would work but also be a resource leak justin_smith: which is a less than ideal version of "works" d4ryus: justin_smith: Yeah, makes sense. Besides TCO you often see arguments of local procedure calls replaced with _. I guess those get optimized (inlined?). justin_smith: intuitively that sounds right, some day I'll read the compiler code maybe and really know roelj: dsmith-work: I forgot to include the Makefile.am in configure.ac. D'oh! :) dsmith-work: heh roelj: But I'm exploring a different route now; How do I access a handle from "scm_c_make_gsubr" from Scheme? dsmith-work: roelj: Sorry, I don't understand your question. roelj: Ah, my bad.. Here's another attempt at explaining my situation: I have a function (written in C) that I'd like to expose in a Scheme module (instead of the toplevel). So I can scm_c_make_gsubr that function, which returns a handle to the Scheme equivalent of that function. Now, how can I "add" this function to the public interface of an existing Scheme module? roelj: I found "scm_c_export" and "scm_c_call_with_current_module". RhodiumToad: as far as I can see, scm_c_define_gsubr adds the definition to the current module RhodiumToad: so just make sure the current module is the correct one dsmith-work: Typically, you use SCM_DEFINE a the the function definition, and then run the snarfer, and #include the resulting foo.x file in the body of your init function. RhodiumToad: otherwise, the return value of scm_c_make_gsubr is exactly the thing that you would pass to scm_define dsmith-work: And then in the .scm file that dynamically loads the .so, you (re-)export what you want to expose. roelj: Uhh.. I now do: SCM m = scm_c_resolve_module(...); scm_c_call_with_current_module (m, f, NULL); And in f I call scm_c_define_gsubr. RhodiumToad: that seems like it might be overkill, but should work? roelj: But if I #:use-module (that module), it cannot find the functions I added using scm_c_define_gsubr. roelj: How could I simplify it? RhodiumToad: did you export them? roelj: As in, scm_c_export("the-name-of-the-function", "another-function")..? RhodiumToad: yes roelj: No.. :) RhodiumToad: well then roelj: haha roelj: Right. So, you mentioned it might be overkill. What's overkill? The call to scm_c_call_with_current_module? RhodiumToad: yes RhodiumToad: scm_c_module_define might be more applicable roelj: Ah, I see roelj: When using scm_c_module_define, how do I scm_c_export them? RhodiumToad: er, good question. roelj: I added scm_c_export ("the" "functions", NULL); But I still get a "Unbound variable: the". RhodiumToad: where did you add it? roelj: In the function that is passed as second parameter in scm_c_call_with_current_module. roelj: Directly after scm_c_define_gsubr. RhodiumToad: that should work... roelj: Perhaps I should paste the code somewhere. What's a good paste service? RhodiumToad: dpaste.org leoprikler: debpaste, gnome paste, dpaste, pick one roelj: https://dpaste.org/8nCw RhodiumToad: typo RhodiumToad: pdf_report vs pdf-report roelj: Bah, indeed! roelj: That was it indeed roelj: thanks! roelj: Alright, one more thing.. So I have an executable that calls scm_with_guile. Which in turn loads that (www db reports) module. If I were to define a function "init_guile" that does "scm_c_define_gsubr", can I then load the executable with "load-extension"? Or is it impossible to compile an executable that is also a library? leoprikler: ever heard of ASLR? roelj: Nope leoprikler: (short answer: Yes, you can make executables, that are also shared libraries) roelj: I can't quite link address space layout randomization and executable+library yet. leoprikler: Perhaps I'm remembering it wrong, but in order to implement ASLR and be able to move the code of the program itself, you have to basically make it a shared library (i.e. compile with -fPIC etc.) leoprikler: the magic behind ASLR then becomes loading a shared library and executing main ;) roelj: leoprikler: Yeah, I found: http://marklodato.github.io/2009/10/03/executable-shared-libraries.html roelj: Building now.. roelj: Guile says "file not found", even when passing the absolute path to it. Does it expect a ".so" extension? leoprikler: it is not an absolute path without that, so I'd say yes roelj: But.. my executable does not have a .so extension! :P leoprikler: in that case, you might want to check whether something is wrong with your shared library leoprikler: "file not found" can also mean that a dependency was not found and is generally very confusing leoprikler: when in doubt, strace dsmith-work: strace reveals all.. roelj: Ah, good call roelj: Well, it does seem to open the executable first, then continues to search for .la and .so roelj: So I guess -fPIC and -fPIE is not enough to make it a recognizable shared library for Guile. RhodiumToad: if you build something as an executable, it won't export any symbols by default roelj: Perhaps splitting the shared-library bits and the executable is better / easier anyway roelj: Ah, I see.. I have multiple source files, most in a subdirectory. And I set _LDFLAGS to "-fPIC -fPIE -pie". But it seems that only .c is compiled with these options, and not the rest. roelj: What's the automake magic that is needed to make the LDFLAGS "global" for this program? dsmith-work: So LDFLAGS are only for linking.... roelj: Right, so I added it to _CFLAGS. That seems to do it. roelj: As in, it compiles. But it doesn't seem to make a difference erkin: The guard in this syntax-case macro refuses to match any use of the macro: https://clbin.com/2eIY7 erkin: It naturally works without the guard. erkin: Anyone got any ideas? erkin: Is it because it can't determine whether the `+' refers to a procedure at compile-time? erkin: Okay, putting the guard aside, there's a syntax-case macro that works correctly with Racket but breaks in Guile. erkin: https://clbin.com/z0ygw erkin: The expanded form evaluates fine on both, so I think the Guile macro expander might be expanding it differently. erkin: Oh wait, Guile futures don't take thunks. erkin: At least I learnt how to use `macroexpand' today. leoprikler: I think your guard is malformed leoprikler: #'f yields # leoprikler: you actually want something that makes use of syntax->datum pkill9: why does lisp simultaneously make so little sense, yet make so much sense? pkill9: i did it, i put my CV metadata into a scheme file daviid: str1ngs: fwiw, i think dsmith-work faced the same or at least a 'similar' problem, while trying to port our bot from using 2.2 to 3.0 - maybe you both can share and enlight us ... in his case, it was for-each that would 'disappear', and i don't think his code uses goops either ... daviid: but i still on 2.2.7, so i have little to offer here ... daviid: str1ngs: you could try to snipset this, having just a tiny module a, that import srfi-1, then a module b, that import a but _not_ srfi-1 and check a map call in both module, using 2.2.7, then 3.0.x (the latest preferably ...) and see what that gives you daviid: str1ngs: just to complete, even using goops, in the a and/or b should not change the expected behavior, which is that both should see a map procedure, a using the srfi-1 and b the guile core one ... my 2c str1ngs: daviid: I think I hit kinda a edge case. emacsy does some re-exporting which is causing some problems. I at least know what is causing some problem. Also for what it's worth I have working patch for g-golf and guile 3. https://paste.gnome.org/pqz4mmn5h take the patch with a grain of salt. if you have some feedback on how to avoid using #:re-export-and-replace . g-golf suffers the re-export issue emacsy does in regards to srfi-1 and the str1ngs: other procedures listed. daviid: str1ngs: it's only if you import g-golf, and a namspece that defines a map short method name that, in that module, map you be promoted to a generic function, with the default procedure bound to what the module 'sees' (the srfi-1 map proc if srfi-1 is imported, the guile core proc if not) str1ngs: daviid: that's not what I'm seeing. it's if a module that uses map and imports g-golf were the issues happens. and only with guile 3 of course. daviid: str1ngs: just importing g-golf? no namspace 'yet' ? str1ngs: one sec I'll give you the message. daviid: nothing changes here, just using g-golf does not promote map as a generic functipon daviid: scheme@(guile-user)> map daviid: $2 = # daviid: scheme@(guile-user)> ,use (g-golf) daviid: scheme@(guile-user)> map str1ngs: also it happens with setenv which is weird daviid: $3 = # daviid: g-golf doesn't use setenv, afaict daviid: str1ngs: you really should try to talk to dsmith-work daviid: and built the snipset i mentioned daviid: i would do it, but i don't have 3.0.x at my finger tips now ... str1ngs: this has nothing to with a generic function as far as I can see. this has to do with g-golf re-exporting (srfi srfi-1) map which overrides the core binding. it happens with setenv too. daviid: str1ngs: ok, then in the snip set, you may try to have a b module that just use srfi-1, and another example that re-export srfi-1 str1ngs: let me see if it does it with one of our examples. I have to many moving parts right now with emacsy . one sec. daviid: by all mean, re-exporting sfri-1 froma module shuld make it so it disapears in the importer ... and to convinve guile maintainers, you'd rather leavbe g-golf out of tye loop daviid: sorry my typing is less then optimal :) daviid: try what i said, just module a, then module b, just that str1ngs: daviid: if you build g-golf with guile 3. and do ./pre-inst-env guile. ,use (g-golf) and (oop goops describe) . then do (describe map) str1ngs: as you see this happens without using another module even. daviid: what does map returns daviid: just map daviid: is it that describe promote map as a generic?, that's a goops code daviid: it doesn't, afaixct, just checked daviid: describe just exporet describe daviid: mind you, guile also defines a describe proc somewhere str1ngs: does not return anything it give Unbound variable: map and warnings of WARNING: (guile-user): imported module (g-golf) overrides core binding `map' daviid: str1ngs: ok, then you should be able to reproduce this without g-golf, then file a bug report str1ngs: as I said #:re-export-and-replace (setenv map for-each connect) fixes it daviid: thyis has nothig to do with g-golf daviid: str1ngs: but does 3.0 says we must do that? maybe, i don't know str1ngs: well, you are re export srf1 srfi-1 . so I'm not confident this is a guile bug daviid str1ngs: I mean I have a fix here also tests pass. so whats your feed back on using re-export-and-replace? daviid: str1ngs: why would re-exporting srfi-1 or any other module public interface trigger a bug? daviid: str1ngs: if you re-export the public interface of a module tha defines map, there is no justification that the imported module would not have that name defined ... str1ngs: if I remove (srfi srfi-1) from re-export-public-interface the problem goes away. daviid: weither way, thye module b, that imports a (that imports and re-export srfi-1) should see map daviid: i wish i had 3.0 at my finger tip, this has nothing to o wit g-golf ... daviid: thry what i suggest, without g-golf daviid: this is a bug,. in guile daviid: if module b import and re-export srfi-1, any moduel that import b shold see the map defined in srfi-1 str1ngs: I don't think so . if you reexport srf1 srfi-1 then its going to override the binding. daviid: overide, not disappear *: str1ngs shrug daviid: but i know 3.0 made things very complicated with thatc respect str1ngs: I don't have to time to go over this I have my local fix. I need to fix more important issues with emacsy and guile 3 daviid: str1ngs: fine str1ngs: the patch a link passes all tests and seems to improve things so looks like there is an improved. don't know if you want to save that for later reference or something. daviid: but it has nothig to do with g-golf :) - it manifest itself because that's what you use, but with a tiny, just a few lines of code, module a, b ... one woud reproduce the poblem ... str1ngs: improvement. daviid: str1ngs: ok, i'll keep it tx daviid: i'm surprised you didn't had to declare any modules declaratices, lime (g-golf hl-aopi gobject) principaly str1ngs: daviid every time I post an issue with g-golf it has nothing to do with g-golf. Until I have utterly convinced you. I don't think it takes much to look at my patch provide feedback on re-export-and-replace. I mean it a pretty basic code review. daviid: str1ngs: importint srfi-1 and re-exporting srfi-1 is not a g-golf 'thing' str1ngs: please at least look at re-export-public-interface and consider if that might be the culprit then. str1ngs: because using that on srfi-1 might explain this problem. daviid: str1ngs: it might be that 3.0 does not let any module re-export their public interface 'as before', yet it hasd nothi8nbg to do with g-golf str1ngs: okay g-golf is perfect. got it. daviid: str1ngs: that's not what i mean and never will pretend , never ever - i am saying 3.0 introduces a constraint, that makes it appear g-golf fails, but the symptom involves procedures that are not being (re)defined nor promoted to generic functions, in a senario that perfectly works 2.0 and 2,2 daviid: and the patch as pasted, will break for users that uses 2.0 opr 2.2 str1ngs: yes, I said take it with a grain a salt with a caveat for feedback. which you have not provided. str1ngs: I suspect the best thing to do here is not re export srfi-1. I'm confused to why it needs exporting? apteryx: why can't I recalled failed expressions at the Geiser REPL? apteryx: recall* apteryx: is this behavior configurable? I find it annoying. I just want to recall the same block of expression to edit it, but it seems it's trying to outsmart me (eh, not recalling this, as it failed the last time I evaluated it!). str1ngs: apteryx: are you using guile readline in the REPL? str1ngs: I'm assuming by recall you mean history? apteryx: str1ngs: yes str1ngs: and you have readline working in the REPL. arrow up and down work? apteryx: I am using readline yes apteryx: I'm in Geiser REPL in emacs. let me check if the behavior is the same at the Guile REPL in a terminal str1ngs: geiser might have it's own command history. apteryx: yeah, the behavior is OK in Guile itself (I can recall the failed expression) str1ngs: let me check with gieser apteryx: in Geiser, when I do M-r, I can search back, but there's no match for any failed expression. str1ngs: try with M-p apteryx: ah, yes I meant M-p str1ngs: also for history try with M-r str1ngs: wait you are using M-r sorry str1ngs: M-r and M-p work for me. say if I do (dddd) and it back traces in geiser daviid: str1ngs: not being able to re-export the public interface of a module - or having to manually decide which may or may not, using replace or not is the problem ... i was not criticising your patch, i was trying to tell you that there is no way, as of today, to define a module conditionally apteryx: str1ngs: OK, I'll debug on my side, must be some other package interaction then. Thank you! str1ngs: apteryx: try without ~/.guile and restart a REPL. sometimes geiser has issues finding the prompt. daviid: str1ngs: by thew way connect is promoted as a generic and the module specify to replace the binding, in (g-golf hl-api signal), fwiw str1ngs: it's actually quite the voodoo finding the guild prompt. str1ngs: err guile* str1ngs: daviid: maybe there is a bug in guile dunno. I'm working on a fix that does not use re-export-and-replace. though like I said it's not apparent to me why srfi-1 needs exporting apteryx: str1ngs: ah, it seems to occur only with multi-line expressions str1ngs: hmm strange apteryx: ah, and not always o.O str1ngs: yeah (foo RET ) worked str1ngs: does it only happen when it's a expression error? str1ngs: I know guile REPL can't handle those. apteryx: I believe it was an expression error? In procedure scm_lreadr: #:33:68: invalid character in escape sequence: #\: apteryx: I'm trying to define a string literal which contains #\: apteryx: str1ngs: perhaps try: https://paste.gnome.org/pxznpfhdk apteryx: this is what triggers it for me apteryx: guix repl is able to cope with that, but Geiser fails to show it in my history. str1ngs: apteryx: it won't give me history for that either str1ngs: in gieser apteryx: strange :-) perhaps I should open a bug for it. apteryx: it's not the only occurence I've experienced. I'm often annoyed about it. daviid: str1ngs: imo not re-exporting sfri-1 would only 'hide the problem', but not fixed it, it would not fix setenv nor connect for example, or does it? that would be very surprising ... but anyway, I need to find a robust solution that allows g-golf to work 'out of the box' for 2.0, 2.2 and 3.x, and I am not going to manually re-export and replace some names, not others ... again, not criticising that you did that, you had to, an that works, daviid: great, but that can't be a fix for g-golf itself apteryx: is there an alternative way to write #\: (the colon character literal) so that it could be embedded in a string? apteryx: ah, one way: str1ngs: apteryx: are you internally escaping " here? str1ngs: #\: is fine its the escaped quotes imho str1ngs: apteryx: also for stuff like this I use a scratch pad and just eval the expression. saves alot of typing :) str1ngs: geiser-eval-last-sexp or C-x C-e at the end of the expression str1ngs: apteryx: geiser-eval-last-sexp or C-x C-e at the end of the expression apteryx: str1ngs: try (display "(string-split (getenv \"LIBRARY_PATH\") #\:)") apteryx: or just eval the string itself str1ngs: (getenv \"LIBRARY_PATH\") should be (getenv "LIBRARY_PATH" e) str1ngs: err (getenv "LIBRARY_PATH") str1ngs: eval this (string-split "root:x:0:0:root:/root:/bin/bash" #\:) str1ngs: which is out of the manual BTW :P apteryx: str1ngs: I want that Guile program to be stored in a string, so I must escape the double quotes of the Guile program. str1ngs: then try #\\; str1ngs: err #\\: str1ngs: btw you sould have mention you needed to escape this :P str1ngs: apteryx: see (eval-string "(string-split \"root:x:0:0:root:/root:/bin/bash\" #\\:) ") str1ngs: thought don't use eval-string just for testing here. str1ngs: daviid: setenv is the only thing that leads em to believe this is a bug with guile. though atypically people don't re-export often maybe? which could be why this has been overlooked? str1ngs: daviid: I don't see anything in g-golf that effect setenv unless it dynamically using something for GI? maybe we should focus on setenv and not srfi-1? apteryx: str1ngs: sorry, had trouble with my weechat client apteryx: trying it now str1ngs: you got this message? (eval-string "(string-split \"root:x:0:0:root:/root:/bin/bash\" #\\:) ") apteryx: so, escaping the backslash in the character literal apteryx: that seems to work, thank you! str1ngs: yes or it would be #: str1ngs: actaully that might not be right. I just know it needs to be escaped like that haha daviid: str1ngs: i'd rather call this a (new) constraint rather then a bug - and a knowned (by maintainers) constraints - iirc, this has also been discussed in guile/guix ml, because it also triggered bugs in guix (which i believe have been all solved) ... as it did for dsmith-work porting his bot (scheme) code to 3.0 ... str1ngs: daviid: well I always looked at this a being a stricter guile. I'm only leaning toward using the word bug because you brought it up. apteryx: str1ngs: it works :-) str1ngs: apteryx: 👍 daviid: str1ngs: right - if the simple module a and b snispet I described earlier would raise an exception, i'd perso consider it a bug (in guile) daviid: - for which maybe I can find a hack in/for g-golf, but merely re-exporting the public interface of a module should never lead to an 'undefined name ...' exception, since it is defined and re-exported ... my 2c daviid: and that it raises an exception for setenv is indeed misterious str1ngs: that's why I think it's easy to focus on setenv. since it's not something the is normally gets overridden like map does. str1ngs: though setenv is not as easy to reproduce as map. map you just need to use (g-golf) daviid: you test this outside g-golf - just a module a, b ... - i think i have aremote access to machine where i did cimpile guile 3, i'll check daviid: for info, re-export-public-interface was written by wingo himself :), and uses a public guile internface daviid: that hasn't changed in 3.0 daviid: str1ngs: (g-golf support modules) merely calls module-use! str1ngs: emacsy does the same thing. my question is why does srfi-1 need be be re-exported. that should be available to any guile user. if they use srfi-1 explicitly. kthough emacsy does this it o daviid: https://www.gnu.org/software/guile/manual/guile.html#index-module_002duse_0021 - i suspect what it does has somewhat 'silently' changed, and in 3.0, 'Add interface to the front of the use-list of module' does not merely add the interface to the front ... but i'd need to investigate better str1ngs: I got cut off there.... though emacsy reexports it only exports emacsy modules which makes more sense then to export srfi-1 daviid: re-exporting srfi-1 is perfectlt valid thing to do ... and if we need to or not does not solve the bug ... str1ngs: why does it need to be done? daviid: i wana understand why this raises an exception,m i don't want to make the 'thing' disappear daviid: why6 not str1ngs: meh seems silly to do something just because you can. that's not a valid reason str1ngs: hey your call I just can't help but thing it's causing problem where maybe they are not needed. daviid: str1ngs: does that fix the setenv? andor the connect? daviid: if you do not re-export srfi-1 i mean str1ngs: setenv and connect to be unrelated. str1ngs: but from my view export srfi-1 is hiding bugs. for example test/gi.scm does not use sirf-1 and it probably should. str1ngs: if that's the only reason to export srfi-1 why bothter str1ngs: it's later here my typing has gone to shit :( daviid: str1ngs: let's focus on one problem at a time - i did see you added srfi-1 to gi, but here, 2.2.7, the test suite pass without that - does that raises an exception in 3.0 as well? str1ngs: probably not if I re export. but my point is depending on you if you use first or last duplicate handler you might get the wrong map. and then your test heavily relies on g-golf to re export srfi-1 . daviid: *added sfri-1 to (tests gi) i mean str1ngs: since I can't replicate setenv like map. they might be unrelated just FYI. also I use a load so that's changed in guile 3 too str1ngs: ie specially use load that has the setenv. so lets assume that's a nomad issue for now. str1ngs: well using load from modules to clarify. daviid: ok, i now have access to 3.0.4 daviid: not a 'confortable' access but ok to test a few things ... str1ngs: str1ngs: (buffer-string) => "What? A" ; *** failed *** str1ngs: ; expected result: "What? Ac" str1ngs: PASS test/minibuffer.scm (exit status: 0) str1ngs: good job emacsy! str1ngs: lol daviid: str1ngs: so, just a simple modules shows the problem - https://paste.gnome.org/pdj9izyi9 daviid: daviid: with modules being defined as in g-golf daviid: here is the 'out of g-golf' modules.scm - https://paste.gnome.org/p5hwkvebl so you may cop daviid: *cop/try ... str1ngs: why I just need to do ./pre-inst-env guile ,use (g-golf) and then map str1ngs: the effect is the same. obviously reexporting srfi-1 map is overriding (guile) map daviid: str1ngs: I am glad because since you (and neither do I at this point) do not know why nor how to solve the problem daviid: now we have a 10 lines snisept we can use to ask for help daviid: but for once, it has nothing to do with g-golf, and two, it does not overide, tht would be the expected behavior (one can argue about the warningsa ... but ok) it fails to overide and raises an unexpected exception str1ngs: dunno daviid: jyst read the paste str1ngs: daviid: you are telling me what I already told you from the beginning daviid: i don't think so - but the important thing is to solve the problem, now we have something others can use to help ... str1ngs: don't be surprised of one of those solution might be don't re-export srfi-1 though. since it's kinda messes with users importing the module. keep in mind this situation. I want to use core map but I want to use g-golf's connect . neither (default-duplicate-binding-handler '(replace warn-override-core warn last)) or (default-duplicate-binding-handler '(replace warn-override-core warn first)) will work in the situation. I use the load str1ngs: variant for duplicate handling here. str1ngs: since core is first and connect is later. str1ngs: core map is first I meant. daviid: would be very surprised if the aswer would be don't re-export the public interface of any modeule in 3.0.4 str1ngs: no I think it's okay, I think guile is just saying be polite and re-export only your modules :) daviid: thaqt would be dead wrong str1ngs: then shot me :P str1ngs: well I"m off to bed. and then I'm away for a some days on vacation. good night. daviid: so waht, i can't define a module that uses goops, augemnt it, and makes trhings so the user can import my module and use gopps, as well as the augemtned class and methods ... daviid: that would make absloutely no sense daviid: str1ngs: yes, good night, i need to eat something and rest as well daviid: good vacation as well leoprikler: reexporting SRFI-1 from your own module sounds like it's asking for bugs leoprikler: imo re-export is a tool to form combined APIs, if you have e.g. (foo bar), (foo baz) and (foo qux) with some dependencies between them, you can separate them into modules, whose public interfaces satisfy each other, but also have a (foo) module, which re-exports only what the user would want to see daviid: re-export is a tool to re-export - it should never ever bug daviid: and it is very likly not th r-export that fails, but the way the new comiler makes some binding immutable, which is against the vry nature of lisp/scheme daviid: or 'wish to turn' bindings immutable daviid: anyway, i'll look how to best cope with these new terrible limitations after i complete two more important features and have g-golf in pre alpha mode manumanumanu: wingo: Nice work on the branch optimization! Funny fun fun optimizations! jgart: How hard will it be to port this library from chez to guile? https://github.com/paullucas/rsc3-chez/blob/master/rsc3.sls jgart: How unportable is it? I just wanted to get the opinion of any guiler that might be able to have a general idea from a quick glance at the procedures used in that file pkill9: does there exist a small library/tool that uses pandoc pkill9: i haven't used pandoc in a long time jgart: pkill9, guile bindings to pandoc? pkill9: jgart: I'm being too specific, basically I want to generate a CV into different formats from information stored as a scheme file pkill9: CV being curriculum vitae pkill9: i would like to use guile because I like it, lol pkill9: and i've been using it a lot recently pkill9: hmm, actually i could probably write the whole thing from the ground up, it would be pretty simple pkill9: since guile can generate code and text very nicely pkill9: probably doesn't need to deal with pandoc at all, just call it on the output probably jgart: pkill9, https://github.com/LeifAndersen/leifandersen.github.io/blob/4736f20ec85b67af3690e92ddd4d1271dd67e62b/cv/cv.scrbl jgart: pkill9, this is the guile remake: https://www.nongnu.org/skribilo/ jgart: not sure what the latest status of development on skribilo is pkill9: i remember seeing skribilo a while back jgart: looks like the last update was this July 6 jgart: git clone git://git.sv.gnu.org/skribilo.git pkill9: can it output to markdown? it doesn't list it on the site pkill9: having a CV scripted directly in a single file would be nice pkill9: looks like skribilo could be good for htat pkill9: it doesn't look like skribilo does a lot pkill9: in terms of producing documents pkill9: then again it's website is produced with skribilo jgart: i think it outputs latex and lout jgart: html jgart: pkill9, if you look in the engine directory you'll see all the things it outputs to there jgart: guile-commonmark can convert to and from sxml/markdown jgart: https://github.com/OrangeShark/guile-commonmark pkill9: skribilo seems good, i can use alists pkill9: mostly what my CV file is made of is lists and strings and booleans minerjoe: Hello all. How does one forget a function after it has been defined. I'm trying to change a define into a define-method. In CL I would UNINTERN, but I can't find the same in scheme. pkill9: how do you create and access an alist of alists? daviid: minerjoe: in these situation, we generally 'promote' the procedure so it becomes the default method of a generic function bearing this name - see ensure-generic in the manual minerjoe: daviid: thanks daviid: pkill9: you'd have to write your own pkill9: got it working pkill9: i needed to use dots pkill9: i don't understand why when i have '((a "b")) pkill9: i thought you only need dots for when "b" is actually a list daviid: pkill9: g-golf cache uses an alist of alists - http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/gi/cache.scm?h=devel daviid: pkill9: '((a "b")) is not an alist of alist(s) ... pkill9: oh that was a bad example pkill9: that was a reference to the sub-alist pkill9: which was returning ("b") instead of "b" pkill9: is it procrastination to convert my CV from yaml to guile? It's not even a technology job, just for minimum wage things daviid: minerjoe: welcome jgart: pkill9, no it's not procrastination. I'd do it. pkill9: cool, thanks for the validation :D pkill9: im getting an error with skrilo pkill9: skribilo* pkill9: create empty files /tmp/a and /tmp/b pkill9: then run `skribilo -p /tmp/a -p /tmp/b` and it raises an error pkill9: but it doesn't with `skribilo -p /tmp/a` pkill9: multiple preloads it seems to fail on pkill9: the error is In procedure string-prefix?: Wrong type argument in position 2 (expecting string): #:preloads pkill9: i can just use GUILE_LOAD_PATH anyways, no big deal str1ngs: hello janneke: in the process of starting working porting emacsy to guile 3 I found a small issue with one of the examples. I pushed a fix here https://git.savannah.nongnu.org/cgit/emacsy.git/commit/?h=wip&id=5bd0719129da21c83533cf5fd3ecfec31d8f3779. regards to guile 3 I'll push to a new branch for review before merging to wip. str1ngs: hello with guile 3 . I'm getting this Unbound variable: map it seems if you use a module that uses (srfi srfi-1) it's replacing the core map. I'm I reading this right? how I can are resolve. seems if I use (srfi srfi-1) in my module that will fix it but that seems wrong to me. alternatively I guess I need a delicate handler? str1ngs: duplicate* mwette: str1ngs: are you use-module'ing (srfi srfi-1) and don't want map? str1ngs: some cases I use (srfi srfi-1) but mostly it's in places where a module I'm using is using (srfi srfi-1) which then overrides the core binding for map and for-each. str1ngs: seems this helps some #:duplicates (merge-generics replace warn-override-core warn first) mwette: you are using goops? str1ngs: yes mwette: Ah. I don't use goops, don't know this territory. str1ngs: I'm porting a few project dependencies for nomad. the first one I'm working on is emacsy str1ngs: though in this case I'm not sure if this is goop's related. mwette: I'm guessing it could be if goops generics handler is taking over map. str1ngs: map seems to be a procedure so I can't see goops taking over that. str1ngs: (describe map) str1ngs: `map' is a procedure with 2 or more arguments. str1ngs: if it was a method it would describe them all pkill9: does anyone have an example of using skribilo to produce a markdown file? pkill9: actually there's some html -> markdown convertors onliune str1ngs: mwette: kinda figured it out. for non modules file I need to (default-duplicate-binding-handler str1ngs: '(replace warn-override-core warn first)) so the first binding is used. str1ngs: some of these are test files so they are not modules. mwette: thanks for the info pkill9: actually pandoc has a html->markdown converter str1ngs: mwette: though that's the default handler so technically it should work without that :( pkill9: is there a simple way to get data from an sxml tree that's structured like this: https://pastebin.com/raw/q21drL6X pkill9: i just want to store some metadata in that way pkill9: actually i don't think sxml is what i meant, i think i meant sexp pkill9: oh, assoc-ref works fine with it pkill9: i like guile, but i don't think i fully understand what i am actually doing pkill9: what's the best way to read until the end-of-file and return all the s expressions in a list? pkill9: oh i have an idea chrislck: sneek: later tell janneke \o/ for some windows patches sneek: Okay. wingo: moin :) RhodiumToad: mornin' RhodiumToad: I tested the armv7 abi fixes btw, seems good janneke: o/ sneek: Welcome back janneke, you have 1 message! sneek: janneke, chrislck says: \o/ for some windows patches janneke: chrislck: in a minute :) *: janneke sends mail wingo: RhodiumToad: great! *: wingo landed switch optimization, yay wingo: case dispatch should be much faster now janneke: yay! chrislck: It's Friidayyy \o/ *: chrislck knows nothing about cross-compilation... are things like compiling win32 & arm in ci possible? str1ngs: hello, is there anything like elastic tabs for guile? http://nickgravgaard.com/elastic-tabstops/ str1ngs: RhodiumToad: wingo: btw there's still one bug that kicks in on 32-bit freebsd RhodiumToad: gen-scmconfig isn't coping with the case where off_t is in fact an int64, but HAVE_STAT64 etc. is not defined - it assumes that off_t is a long, which is wrong wingo: interesting RhodiumToad: freebsd (as with all 4.4BSD derivatives) doesn't have any of the "largefile" nonsense, because off_t is 64 bits even on 32-bit systems RhodiumToad: so there is no need for 64-bit variants of system calls dsmith-work: Happy Friday, Guilers!! chrislck: \o/ it's not Friday until dsmith says so!! *: sneek does the Friday dance janneke: chrislck: not sure what you mean by 'ci', but this janneke: guix build --target=i686-w64-mingw32 guile@2.0 --with-source=guile=https://ftp.gnu.org/pub/gnu/guile/guile-2.0.11.tar.gz --verbosity=1 janneke: builds an i686-mingw version of guile-2.0 using guix chrislck: :-o chrislck: ci = continuous integration... ie every guile commit tries a win32 build chrislck: would be _nice_ janneke: yeah, well start as soon as 2.0.11 is released, it bitrotted after that :-/ chrislck: easily done by hooking up to travis-ci.org janneke: you could setup a cuirass service to do that janneke: ah, could be / no idea *: chrislck not too hot on gnu vocabulary chrislck: the idea is to keep guile hackers on their toes janneke: yeah, right janneke: us hackers are slacking all day ;) janneke: (and night) chrislck: see https://travis-ci.org/github/gnucash/gnucash - builds both cutting edge distros (arch) and oldest supported (ubuntu-18.04) chrislck: if a commit breaks a build, travis yells at us chrislck: that's all it is dsmith-work: ci is great janneke: yeah that's nice dsmith-work: We had a team that was on the other side of the planet, doing mostly windows work, while locally was more linux. The linux builds would break regularly until we installed a ci system (jenkins). chrislck: so... guile doesn't have CI??? dsmith-work: So before, with all the time lags, it could take days of communication to fix things. chrislck: travis is nice... it tests gnucash main repo *and* each committer's branches dsmith-work: And after, we would see the breakage and the fixes before we came in in the morning. chrislck: https://travis-ci.org/github/christopherlam/gnucash/branches has all of my experimental branches chrislck: janneke: if you know the nix command to build guile win32, then maybe I can try create a travis profile to CI it dsmith-work: The lightEning jit has ci, as it's hosted on gitlab. janneke: chrislck: ah, you could ask on #nixos, i don't know how to build for w32/mingw janneke: using nix a_v_p: Hello Guilers! I keep experimenting with Metabash, this time I'm trying to implement a 'diff' analogue that will allow me to compare two data streams. a_v_p: Currently I can do something like this: https://gist.github.com/artyom-poptsov/f76be508899d2f8645f032cf4682204c a_v_p: But I don't like the implementation : https://github.com/artyom-poptsov/metabash/blob/master/modules/metabash/diff.scm a_v_p: Suggestions are welcome! rilez: I wrote a rough draft of a tutorial on delimited continuations. Would anyone be interested in looking it over? rilez: https://github.com/rilerez/generator-guile-tutorial mwette: rilez: Thanks! I've saved the link for later enjoyment. rilez: woot feel free to file an issue or @ me if you have critiques! daviid: str1ngs, RhodiumToad: looking at your suggestion to 'make distclean' should not remove the configure file, I agree, will patch - while at this, could look at http://git.savannah.gnu.org/cgit/g-golf.git/tree/Makefile.am?h=devel#n180 and see if you spot other candidate for 'none removal', tx daviid: RhodiumToad: you mentioned 'at postgres we ...' are you a postgres core developer/maintainer? lisbeths: I have guix installed on debian and it is pulling right now so I know that guile is installed, but when I run guile it isnt in my path. It's somwhere in my guix path. rilez: hmm can you find guile in ur guixprofile lisbeths: hold on let me do another tty lisbeths: also I want to apologize for what I had said the other day on #guix I was off of my schizoid meds lisbeths: got me bant lisbeths: what directory is it in lisbeths: I found out I can actually can run this to get guile: guix repl nckx: lisbeths: Apology accepted 🙂 lisbeths: The problem I have with the guix community, which I can now say with medication is as follows: lisbeths: I personally think guix is the future of package management, but my main computer with 16 gigs of ram does not have free drivers. I can not afford to go get a new laptop. Right now I have been compiling guix on a laptop with 2 gigs of ram so it will be supported. I think it is wrong to say that you can't help me sideload a nonlibre kernel onto my computer. nckx: OK. lisbeths: I have purged all of the non libre software from my computer painstakingly in order to appease the guix devs however the kernel is not one I can get rid of without extreme pain and time out of my own life. rilez: At least on my computer, .guix-profile is in my home directory nckx: lisbeths: You don't have to appease us (or anyone) at all. Your computer is yours to do with as you wish. Guix does not and will never contain a single line of ‘break proprietary drivers just because we can nye nye nye’ code. rilez: inside it i have ~/.guix-profile/bin, ~/.guix-profile/lib, and the like nckx: But that's very different from supporting (either in code or in IRC or elsewhere): that's *effort*. That's *time*. Nobody owes you that. There's nothing wrong with that. lisbeths: Well the question I had had was if I just swap out the kernel (which I can do myself) I don't know if the guix system will handle that properly. lisbeths: Debian handles things in such away that they have a more supported free version and a less supported nonfree repositories nckx: lisbeths: Sure. I do that. lisbeths: moreover the entire notion of "you can't even support the notion of proprietary software on your system" was brought about by stallman and I had thought that was what the whole debate surrounding all of this drama was about was ousting him. lisbeths: I am not trying to take sides merely to say that debian is a more expeirenced project and they separate nonfree and free out that way for a reason lisbeths: it is because not everyone can afford to go buy open source compliant hardware and they need drivers lisbeths: perhaps the person I was talking to previously was misinformed about what guix "supports" lisbeths: but I will take this discussion into the guix channel instead of here for less confusion rilez: Has anyone gotten guile running on webassembly? lisbeths: I think there are already some gpl 3 schemes that run on it. I am fairly certain. so that might be a good place to start, becuase alot of the same core functions will be compatible. lisbeths: or rather gpl 2 schemes rilez: cool, thanks! It probably makes more sense to shim the missing functionality than try to run the guille vm through emscripten rilez: I feel like the hardest thing to replace would be prompts lisbeths: you could also begin writing your app in a fairly r5rs compliant guile and "wait" for guile suppoort lisbeths: like 'expect' it lisbeths: similarly to how video game developers plan for their games to have twice as good graphics cards as when they start because it takes two to five years to make a game rilez: ahh yeah I'm still trying to work out what reasonably standard scheme should be rilez: Oh! Is there a way to make a callable object? Is my best bet to use a clojure? Is there a way to specialize a GOOPS method on it? str1ngs: daviid: hello I think anything created by autogen can stay, for example aclocal.m4 can stay same with m4/ . see distclean @ https://www.gnu.org/prep/standards/html_node/Standard-Targets.html#Standard-Targets particularly. ‘make distclean’ should leave only the files that were in the distribution. distribution as in tarball produced make dist-gzip . str1ngs: daviid: build-aux can stay too. to test you can do make distclean. then ./configure should still work. str1ngs: rilez: I'm not sure what you mean by callable object. rilez: a struct that is also a function daviid: str1ngs: the reason it removes 'to much' is because I made 'make distclean' to work like 'git clean -dxf' (sort of ...) - users should use 'make clean' - but i agree that it can't remove to much, and configure must still work, that's a bug indeed, if it doesn't ... daviid: str1ngs: i wish i had a script to compare a fresh untar, then what is in after ./configure; make 'distclean' ... - so i could run it when i make changes to the 'dist' .. daviid: if anyone here has such a script, please ping me ... daviid: str1ngs: m4 is not entirely removed, afaict, but what is not in the tqrball daviid: anyway, i see it needs love ... str1ngs: daviid: I think instead of distclean you probably want maintainer-clean. daviid: str1ngs: imo, distclean should bring the dir back to its exact state as aftyer a fresh untar str1ngs: distclean is still useful for users since it ensure an configure created files are remove. str1ngs: daviid: that is right, that's my understanding of distclean as well daviid: str1ngs: yes, agreed - as it is, 'my distclean' removes to much str1ngs: no worries, maybe if you just use maintainer-clean that will avoid any issues with distclean. daviid: str1ngs: but i don't think the std distclean works as i wish either str1ngs: I hear ya daviid: which is why i enhanced it in the first place, a looong time ago :) - then got it too strong :):) str1ngs: rilez: does this help. http://paste.debian.net/1160238 str1ngs: rilez: obliviously my name method is redundant. all I could think to use here. str1ngs: daviid: it grew too powerful! :P daviid: str1ngs: yes, i got the 'git clean -dxf' virus :) str1ngs: I like git -xfd too str1ngs: though for projects I don't maintain. I'll use make distclean str1ngs: just with git -xfd make sure you stage new files first. don't ask me how I know this :P str1ngs: err git clean -xfd daviid: str1ngs: yes, git clean -dxf can be dangerous ... we've all been there i guess str1ngs: thank goodness for emacs buffers. saved my bacon :) daviid: yep, emacs is a good os :) str1ngs: you know in emacs you can undo auto reverted buffers RhodiumToad: daviid: I'm a postgres committer but not on the (small) core team janneke: oh, my fixnum-size addition to the assembler is /almost/ correct janneke: now looking into a problem with the `-1' constant pinoaffe: I need to do some tree matching and I don't think there is a pre-made matcher that does what I need, does anyone have some pointers to writing tree matchers, or a relatively simple one to use as a reference? pinoaffe: I want to do partially ordered matching so that '(a 1 2 (b 3) (c 4)) and '(a 1 2 (c 4) (b 3)) are indistinguishable for the matcher, while '(a 2 1 (b 3) (c 4)) should be different, and I wasn't able to find something like that chrislck: pinoaffe: see (ice-9 match) chrislck: or maybe not chrislck: what's the exact matching rule? pinoaffe: chrislck: it doesn't do the unordered matching I need, but I'll take a look at the initial simple-match implementation and look whether I can modify it leoprikler: so atoms should have the same order but tagged pairs should not? leoprikler: I would suggest sorting the list in advance with this in mind, using a predicate that puts atoms before lists and lists before other lists à la symbol<= janneke: hmm, it seems to bo combination of scm_less_p and -1 (and .go compilation) dsmith-work: {appropriate time} Greetings, Guilers dsmith-work: RhodiumToad: Ever consider adding Guile to Postgres? mwette: pinoaffe: check Wingo's tree-fold article: http://wingolog.org/pub/fold-and-xml-transformation.pdf mwette: pinoaffe: source code to sxml-match in the module (sxml match) may provide some help mwette: in sxml-match attribute order does not matter mwette: pinoaffe: sorry, not clear if you are looking at trees or lists with only atoms and pairs; what's the form of your input? RhodiumToad: dsmith-work: I believe someone did a pl/scheme a while ago, not sure what implementation they used RhodiumToad: dsmith-work: it should be doable with guile but _only_ if built without threading RhodiumToad: (the postgres backend is possibly one of the most threading-hostile C environments in existence) dsmith-work: heh dsmith-work: RhodiumToad: I had considered it a long while ago. (Guile 1.3 or 1.4 I think). I was working on an Apache guile plugin and I thought it would be really cool to have Guile running in the browser, web server, AND the database. dsmith-work: Back then, guile had no dependencies. Bignums, GC, and Threads were all in libguile. RhodiumToad: bignums and gc shouldn't be a problem guix-vits: whoami guix-vits: cool guix-vits: Hello people, hello str1ngs. I've found out that the fan on my RockPro is actually working: `echo > /sys/class/hwmon/hwmon/pwm1` makes it. So fan is good. str1ngs: guix-vits: nice, I just ordered one yesterday. chrislck: sneek: botsnack sneek: :) chrislck: good bot str1ngs: guix-vits: how well is guix supported can you make system image with guix? guix-vits: str1ngs: IDK. Those SBC so new to me, that i'd just installed Armbian. What do You mean? str1ngs: guix-vits: I was just wondering if you can create a rock64 system image using guix build system ./rock64.scm str1ngs: I run guix foreign on my pinebook, with debian buster. guix-vits: str1ngs: I think _i_ can't, but ..:) guix-vits: str1ngs: is suspend works? str1ngs: hmmm I don't use suspend on my pinebook but let me check for you. str1ngs: I have a nvme so normally I just power off. *: janneke has a pretty nice working patch for x86_64-mingw janneke: found another void*/long/fixnum confusion thing in vm-engine.c janneke: sizeof long!=sizeof * -- talk about unwise platform choices... *: str1ngs all hail janneke! The slayer of bugs! dsmith-work: sneek: seen wingo sneek: I think I remember wingo in #guile one month and 20 days ago, saying: all hail godbolt. dsmith-work: heh drakonis: one true king godbolt dsmith-work: I wonder what the latest changes wingo has been working on are about. Jumptables? As in cond/case ? guix-vits: gb daviid: RhodiumToad: nice! and good to know as well :) one always needs a postres expert they can quizz if needed :):) daviid: *postgres pkill9: how do i refer to an # ? daviid: pkill9: eof-object? daviid: (eof-object? (eof-object)) -| #t pkill9: that's what I wanted, thanks daviid: welcome daviid: str1ngs: I pushed an important patch - related to short method names, no rush, but when you can, please pull, make, check ... and let me know if everything is ok ... str1ngs: daviid: I can do that now since I'm working on nomad anyways. daviid: ok str1ngs: daviid: should make distclean remove configure. I did'nt think it should do that. str1ngs: just a curious quesiton daviid: i think it should daviid: not sure str1ngs: I'll have to read up on that more. str1ngs: daviid: looks good so far. daviid: ok great str1ngs: I'll let you know if I run into any issues. I suspect it's okay so far though. RhodiumToad: make distclean should not remove configure, and configure should be included in the distribution. RhodiumToad: I don't know about other projects, but for postgres we even commit ./configure to the repo and maintainer-clean doesn't remove it either dadinn: hi all dadinn: How can I pass environment variables to a `system*` call? dadinn: normally in shell scripting I can do: `FOO=BAR myscript my args` kahiru: wouldn't a combination of primitive-fork and execle work instead of that? chrislck: Wednesday greetings, guilers! dadinn: kahiru: not sure how execle works... can it do that? kahiru: according to the docs it executes the arguments passed to it in the same process with a new environment, that's why I suggested forking before that. But this is probably the most DIY and least preferable solution, even if it is the only one I'm aware of manumanumanu: Ahoy hoy! RhodiumToad: annoyingly, posix does not define an execlpe() function or any close equivalent, though you can implement one using execve() and some looping RhodiumToad: I should probably port the spawn module that I wrote for lua to guile, it'll be even more useful there because of eliminating threading issues with fork, but it only works on freebsd dsmith-work: UGT Greetings, Guilers dsmith-work: dadinn: That "var=val command" is a shell thing. *: janneke hacks bytevectors.c for mingw-x86_64 RhodiumToad: dsmith-work: yes, but it's not unusual to want to add env vars to a spawned subprocess dsmith-work: RhodiumToad: Agreed nisstyre: is there a guile procedure for expanding a directory path containing ~ ? nisstyre: I'm trying to automatically load a file from ~/.config but the tilde is interpreted as a directory name str1ngs: nisstyre: no but I did make a FFI to libc's wordexp. see http://paste.debian.net/1160174. it does word exaction like ~ and lobbing. nisstyre: I see, I could use that maybe str1ngs: though this returns a list not a single string right now. nisstyre: str1ngs: I'm already embedding in C actually so I could just write it in C and expose it to Guile nisstyre: just wanted to know if there was a pure guile way nisstyre: thanks for the pointer nisstyre: isn't wordexp insecure btw? RhodiumToad: wordexp probably does much more than you need nisstyre: in my case I think it's fine but in general, I've heard it's gnarly RhodiumToad: yes, it's not at all safe RhodiumToad: you don't want it just to handle ~ RhodiumToad: which is a simple string manipulation (unless you want it to work on windows too) nisstyre: ideally yeah but I have no idea what it should be on windows str1ngs: nisstyre: potentially I would definitely pass WRDE_NOCMD flag. which I have not added yet here. if you just want ~ expansion there could be a safer way. I'm primarily using wordexp because it does globbing as well. RhodiumToad: windows has an API to get their equivalent of a home directory, but while you could probably do it via the ffi I'm pretty sure there's no native support for it in guile str1ngs: ideally what guile could use is something like emacs expand-file-name str1ngs: which is complicated because it support windows :P guix-vits: Hello, Hello str1ngs. Is it simple to prevent emacs from asking about scheme implementation? I need to say "guile" when opening the .nomad. str1ngs: guix-vits: hello, yes you can do (setq geiser-active-implementations '(guile)) str1ngs: guix-vits: err this as well. (setq geiser-default-implimentation 'guile) str1ngs: ignore the first one if you use other schemes of course. guix-vits: str1ngs: No: `C-x f .nomad` steel asks. guix-vits: (i started a new emacs.) guix-vits: guix-vits: /me "YAY, THIS ARMBIAN STUFF BOOTS!" str1ngs: guix-vits: I'm assuming it's geiser that is asking? str1ngs: guix-vits: which board are you using with armbian? guix-vits: str1ngs: IDK :) (but geiser is installed). guix-vits: str1ngs: rockpro64 str1ngs: oh why I was just going to order one of those. like in the next 10min str1ngs: is it a pine64? guix-vits: Yes. str1ngs: nice guix-vits: guix-vits: Heatsink didn't arrived at first time (maybe due to our post), The fan isn't working (yet :), but DARN! :))) str1ngs: I want to replace my jetson with a rockpro64. will go nicely with my pinebook and pinephone. str1ngs: guix-vits: what is the exact message emacs give you when asking for which guile to use? guix-vits: str1ngs: "Scheme implementation:" guix-vits: I've a "#! # -*- mode: scheme; coding: utf-8 -*- !#" (three lines) guix-vits: str1ngs: guix-vits: I think I gave you a typeop. should be (setq geiser-default-implementation 'guile) guix-vits: str1ngs: Thanks, that working. str1ngs: sorry about that. mine seemed to work despite the typeo guix-vits: hmm.. i didn't see a difference. str1ngs: alos you can manager local variables with emacs. M-x: add-file-local-variable mode scheme str1ngs: my typing when to shit today :( guix-vits: implIme.. guix-vits: got it guix-vits: str1ngs: Do You know by chance, also, how to prevent Gnus from messing up the newlines in attachments? str1ngs: guix-vits: I don't know gnus very well. I used it for awhile it was always a PITA. so now I use mu4e guix-vits: :) str1ngs: guix-vits: best place to as is in #emacs str1ngs: guix-vits: btw I use these to connect a running nomad. http://paste.debian.net/1160180 . also in ~/.nomad http://paste.debian.net/1160181 str1ngs: guix-vits: first paste is emacs for geiser of course str1ngs: guix-vits: /tmp/nomad-devel works with make run. guix-vits: str1ngs: Got it, will examine. Thanks. str1ngs: guix-vits: also you can always do M-: (getcwd) use any expression . the REPL server is more advance use case. str1ngs: this is in nomad, not emacs :) guix-vits: OK guix-vits: *yet not in emacs, (lol) leoprikler: nisstyre: for just handling ~, you could try regexp matching and use (getenv "HOME") nisstyre: leoprikler: I did end up using (getenv "HOME") but I'm sure there's a better way nisstyre: it works for now though leoprikler: If you're looking for a pythonesque os.path.expanduser, I think I must disappoint you leoprikler: btw. getenv "HOME" is also what your shell does to expand ~ in case you're wondering the-y-is-wrong: gn janneke: hmm word-size and pointer-size are used intermingled'ly janneke: i guess we need to switch to (sizeof long) for x86_64-mingw janneke: something like => https://gitlab.com/janneke/guile/-/commit/16e21e9a35ac735243d0a5381d72b251b2b8030d janneke: hmm, possibly we need long-size and pointer-size in (make-assembler)? janneke: oh my RhodiumToad: hm RhodiumToad: that smells like the wrong approach to me RhodiumToad: the issue is that "long" on win64 is only 32 bits? janneke: yeah, well janneke: what i observe is that a > 32bit number, say (define DT_GUILE_VM_VERSION #x37146003) janneke: is read incorrectly from a .go file RhodiumToad: ah. janneke: so, adding pk's in assembler.scm shows janneke: ;;; ("DT_GUILE_VM_VERSION" -149659645) janneke: after .go compilation RhodiumToad: is the guile build actually limiting itself to 32 bits for short fixnums even though 64 bits are available? janneke: i don't know... janneke: guild compile --target=x86_64-w64-mingw32 yields the same as without target janneke: and i'm wondering if that's OK, or that 64bit mingw .go files should be different dsmith-work: janneke: There are 4 kinds of .go files. {BE,LE}{32,64} dsmith-work: I'm fairly certain guile assumes a pointer and the native word size are the same. A SCM needs to look like either at different times. janneke: dsmith-work: OK janneke: reading the code in numbers.h janneke: typedef long scm_t_inum; janneke: #define SCM_I_FIXNUM_BIT (SCM_LONG_BIT - 2) janneke: ... janneke: it seems to me that the size of LONG is used for the immediate number layout in the SCM RhodiumToad: * In the current implementation, Inums must also fit within a long RhodiumToad: * because that's what GMP's mpz_*_si functions accept. */ janneke: yeah janneke: so upon reading the .go on mingw, "someone" should translate the linux-like-64bit .go from immediats to bignums? RhodiumToad: so on LLP64 platforms like windows, guile can't use half the available bits for fixnums janneke: yeah janneke: that's why i thought the .go may have to be different RhodiumToad: uh, given that restriction, I don't see how an LP64-compiled .go could ever be compatible with an LLP64 platform janneke: so many options if you don't know how things work :) janneke: that was my thought, but dsmith-work asserts that must not be so? janneke: i'll try adding a fixnum-size or long-size to (make-assembler) etc. janneke: changing word-size to 4 on mingw is NOT okay RhodiumToad: guile's SCM type must be exactly the size of a void* dsmith-work: So from scm.h: dsmith-work: " - sizeof (scm_t_bits) <= sizeof (void*) and sizeof (SCM) <= sizeof (void*) dsmith-work: In some parts of guile, scm_t_bits and SCM variables are passed to dsmith-work: functions as void* arguments. Together with the requirement above, dsmith-work: this requires a one-to-one correspondence between the size of a dsmith-work: void* and the sizes of scm_t_bits and SCM variables." RhodiumToad: which is what I just said :-) dsmith-work: Heh dsmith-work: Current guile has dsmith-work: typedef uintptr_t scm_t_bits; RhodiumToad: so as it stands the code in bytevectors.c is definitely wrong on LLP64, and your fix for that looks almost reasonable, though it would break on a system where long is bigger than void* RhodiumToad: (I know of no such system) janneke: yeah -- that code "works" for me mwette: What is "native word size" in C. I don't think "int" works. dsmith-work: mwette: I think that's what it was intended to be. mwette: on my x86_64 box, sizeof(int)=4, sizeof(long)=8, sizeof(void*)=8 *: janneke stubbornly tries adding 'fixnum-size" to target and assembler janneke: thanks a lot, more for/from me tomorrow! *: janneke -> zZzz mwette: btw, there's intptr_t dsmith-work: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf#page=45 paragraph 7: dsmith-work: A "plain" int object has the natural size suggested by the architecture of the execution environment dsmith-work: para 5, not 7 lfam: I know that Guile 3.0.3 increased compiler speed at certain optimization levels. I'm wondering if there have been any recent reductions in space / memory usage? tramplefoot: since guile has no support for srfi-20, it would be safe to assume that goops is 100% srfi-20 compatible? tramplefoot: would it be** oops daviid: str1ngs: fwiw, i wrote and pushed the (g-golf gi utils) doc, all procedures daviid: str1ngs: wrt glist/gslist, g-golf has gi-glist->scm, gi-gslist->scm and scm->gi-gslist (so currently it's missing scm->gi-list, but as i said earlier, ping me if/when you need it ...) daviid: wrt glist/gslist, g-golf currently only manages pointers (none of the 'portably storing integers in pointer variables') - if you need those, let me know str1ngs: daviid: okay thinks, will read about those when I have time. Right now I don't have a need for those. Only thing I might need that is not support by g-golf yet is webkit_web_context_register_uri_scheme. I'm still researching that though. could be I'm not using right. str1ngs: thanks* daviid: str1ngs: you mean becasue g-golf misses calbacks right? daviid: wrt webkit_web_context_register_uri_scheme str1ngs: I get this ** (browser.scm:383439): CRITICAL **: 19:38:52.222: void webkit_web_context_register_uri_scheme(WebKitWebContext*, const char*, WebKitURISchemeRequestCallback, gpointer, GDestroyNotify): assertion 'callback' failed str1ngs: not sure if it's the callback or the GDestroyNotify . my guess it's the GDestroyNotficy despite it saying callback. maybe you know off hand? if not I'll just research it more. daviid: str1ngs: just like for the other callback you tried - the vte-terminal example - unless the callback can be NULL, it won't work in g-golf, till g-golf has a full callback implementation (which is not exactly a piece of cake to implement, but on the todo list, after GIInterface ...) daviid: i was writing the above before to read your last sentence :) - i don't know str1ngs: daviid: okay that makes sense. I think though the is the destruct callback though right? I just want to make sure I understand the limitation to work around it properply. daviid: str1ngs: i don't understand that sentence daviid: str1ngs: i think, from the error paste above, that it is because of the callback, not because of the GDestroyNotify - i think for the time being, for that call in particular, you'll have to cook something in C ... str1ngs: daviid: okay, that's good to know. I wasn't expecting that I thought it was GDestroyNotify that was not supported. I'll work something out in C meantime. This would eventually supported by g-golf though? Not a rush I'm just curious. daviid: str1ngs: yes, i hope to support callbacks, and prob will need help, because it needs a C marshaller ... it's unfortunate the gnome team didn't simply reuse the GClosure functionality for callbacks, i don't know why, but that's howit is ... str1ngs: daviid: aww I recall this now. I actually had this mapped out in my head how to do this. now I forgot I should have made notes :0 str1ngs: :( daviid: str1ngs: i have taken deep notes of related conversations, #introspection - when the time comes, it's just to read and implement :):) str1ngs: I'm glad someone is organized :) When the time comes let me know if you need any help. daviid: str1ngs: but don't do anything before i ping you - i really wana set-up things first daviid: yes, will do ... tx str1ngs: no worries, It's nice because I have so much to do with Nomad. So report issues I find. Which is very few. g-golf has come along way over this last year. daviid: the doc is uploded, fwiw, here - https://www.gnu.org/software/g-golf/manual/html_node/Utilities.html#Utilities str1ngs: will read this now. daviid: str1ngs: then could you proof read the sentences that start as 'The GType of value is (must be) a ...' and make sure the GTYpe mentioned is correct ... str1ngs: gi->scm and scm->gi look very useful. str1ngs: daviid: which procedure or syntax is that under? str1ngs: The GType of value... daviid: str1ngs: yes - i thougyht you might wana use those - feel free to snarf outside g-golf .. daviid: str1ngs: all gi-*->scm proc have such a sentence str1ngs: ah just use. The GType of value must be a gchar* or a gpointer, respectively. daviid: yes, -lease check that it is correct str1ngs: see my suggestion. str1ngs: I would leave out respectively too not needed. daviid: would you? thought i'm more concern about the C correctness of the sentences, i lso wanted to use 'respectively' and find it a little 'too much' :):) daviid: */thought/although daviid: you think respectively is too much then daviid: no need for it? i'm not a native speaker ... str1ngs: in this case it's somewhat implied that each must be either a gchar* or a gpointer. it's not wrong just not required. daviid: ok str1ngs: also for gi-boolean->scm. change maybe to The GType of @var{value} must be a gboolean. str1ngs: some please you use @var some you don't just a FYI str1ngs: actually you have @var sorry disregard that. just change to The GType of value must be a gboolean daviid: you mean remove 'is (must be) and say must be ... str1ngs: right daviid: ok, i also hesitated about this ... daviid: str1ngs: tx - doc changes pushed, online doc updated as well str1ngs: daviid: looks good too me. str1ngs: daviid: I'm adding URI scheme support for Nomad I want to handle things like gnunet:// and nomad://manual/welecome. in the case of nomad I want to use sxml to present rich documentation. str1ngs: nomad:// will be a restful API to serve sxml docuements. daviid: str1ngs: great- and about:* ... str1ngs: daviid: yes it will look more like this nomad:///about/ str1ngs: or maybe nomad://sxml/about? sxml technically the host name so not sure what to use there /// is also valid but confusing to read. str1ngs: the restful part is nice since you can do this nomad:///tutorial/buffers str1ngs: plus links will work you get the idea. daviid: str1ngs: i'm really not knowledgeable to any of this, but i would (at least also try to) support what users do know 'already', for these std URI's, like about: ... daviid: thenyou should find a good 'maxime' for about:nomad :) daviid: did you know this one? about:epiphany (in epihany/gnome web) str1ngs: yes, though this will be more extensive this just an about. I can though just redirect about about: str1ngs: in the case of ipfs:// for this far exceeds what about: does str1ngs: for example* peanutbutterandc: Hey there peanutbutterandc: I was wondering if there was some sort of de-facto testing module for guile... peanutbutterandc: I can see that the source repo contains .test files but it does not appear that there is anything like that for normal user usage (?) str1ngs: hello, there is (srfi srfi-64) and also (unit-test) from guile-library str1ngs: peanutbutterandc: ^ peanutbutterandc: str1ngs, Hey there! Could you please give me some relavent docs to read please? URLs, other pointers? peanutbutterandc: (use-modules (unit-test)) doesn't work... peanutbutterandc: Okay srfi-64 one does str1ngs: well depends which one you want to use. peanutbutterandc: str1ngs, I am a beginner str1ngs: (unit-test) requires guile-library str1ngs: peanutbutterandc: if you are new to guile I would use srfi-64 str1ngs: https://srfi.schemers.org/srfi-64/srfi-64.html str1ngs: it's pretty straight forward. peanutbutterandc: str1ngs, guix show guile-library does not return anything. Am I missing something? str1ngs: in guix it's called guil-lib str1ngs: err guile-lib str1ngs: here's the docs for (unit-test) https://srfi.schemers.org/srfi-64/srfi-64.html str1ngs: err sorry wrong link. http://www.non-gnu.org/guile-lib/doc/ref/unit-test/ peanutbutterandc: str1ngs, I see... thank you. I have another question: I have heard that guild is supposed to grow into something resembling pip for guile later on.... peanutbutterandc: is that true? peanutbutterandc: Or will guix do the job just so? peanutbutterandc: str1ngs, Thank you very much, BTW. :) str1ngs: you mean guildhall? peanutbutterandc: I suppose that str1ngs: guix probably super seeds guildhall :) str1ngs: though one day guix might have a subset just for managing guile libraries :) peanutbutterandc: str1ngs, I see. so just use guix. noted. Um... regarding (srfi-64) vs (unit-tests) which one do you use and why? str1ngs: I prefer (unit-test) since I can logically encapsulate tests into methods. also the tests don't run when I load the file. srfi-64 is just as good but for other use cases. (unit-test) requires some (oop goops) knowledge peanutbutterandc: str1ngs, I see. Thank you very much for helping me out. str1ngs: remember (oop goops) is not all that portable. so srfi-64 is better to use in that case. plus it a good place to start. peanutbutterandc: str1ngs, I see. Thank you very much. srfi-64 will be the one, then. :) str1ngs: no problem peanutbutterandc: Okay... another question: in the source tree, where can I find code for procedures in the module (guile)? leoprikler: a great number of places leoprikler: not quite sure if it's just the C source or it has some more peanutbutterandc: leoprikler, Hey there! Did manage to grep it and it turned out to be a .c file.... so yeah but looking into it RhodiumToad: stuff from places like ice-9/boot-9.scm and ice-9/psyntax.scm ends up in the (guile) module peanutbutterandc: RhodiumToad, Hey there! ... I see RhodiumToad: probably other things too, I don't know RhodiumToad: interesting, having been reading boot-9.scm out of curiosity since it came up above, I notice it uses (let-syntax) in quite a few places RhodiumToad: in a way that would break with the r7rs semantics of let-syntax dsmith-work: Tuesday Greetings, Guilers peanutbutterandc: Okay I have a question: does not the value of a variable set in the script over-ride the value from an imported module? peanutbutterandc: Because I just had the strangest experience (guile 3.0.2) peanutbutterandc: This thing did not write to a log file named "this-thing-here" https://termbin.com/urumk peanutbutterandc: line 203 in testing.scm (in (srfi srfi-64 srfi-64)) implies that peanutbutterandc: and so does the code later on peanutbutterandc: there's an if peanutbutterandc: s/(srfi srfi-64 srfi-64/(srfi srfi-64 testing.scm/ peanutbutterandc: Can anybody give me any clue as to why this test does not print in stdout but prints to a log file (despite the explicitly set-to-#f test-log-to-file variable): https://termbin.com/um8r ? leoprikler: peanutbutterandc: The behaviour of SRFI-64 is to a pretty large extent controlled by your test runner. leoprikler: The default test runner (at least in Guile) appears to use (test-begin ...) to derive the log file name peanutbutterandc: leoprikler, But shouldn't guile respect my setting test-log-to-file? The code in $GUIX_PROFILE/share/guile/3.0/srfi/srfi-64/testing.scm does indicate that it should leoprikler: this is Scheme, not Emacs Lisp leoprikler: you can try some hackage to overwrite this definition, but I don't think that's the intended way of handling this peanutbutterandc: leoprikler, I am sorry but itsn't that a global variable definition? I know that scheme is lexically-scoped and elisp isn't (read about that in guile manual, I think) but I don't understand why it is affecting me here (I am a n00b) leoprikler: In short, as per the lexical scope of the test-log-to-file, the compiler can assume (and will for optimization), that this parameter is always #t. leoprikler: For this to work as intended in Guile test-log-to-file should be a parameter or (in accordance with other SRFIs) a box. peanutbutterandc: leoprikler, But it is in the global scope, is it not? And my (define )-ing it again (or (set! )-ing) it in this particular file should change it's value before compilation, should it not? I am really confused. leoprikler: also note: ;; Not part of the specification. FIXME leoprikler: Your local setting of the variable is local to your module. leoprikler: It does not affect the binding, that is present in the srfi-64 testing module, which is where you want the change to have an effect. dsmith-work: In guile 3, some module bindings can be optimized as constants. Or something like that. DOn' dsmith-work: t really have a handle on that yet. peanutbutterandc: leoprikler, what you said does kinda' make sense.... I have one final question (since I come from python). In python we do stuff like `import this_module` and then things like `this_module.this_particular_stuff = "something else"`.... I guess the reason with python I'm actually changing stuffs in the module's lexical scope then... right? leoprikler: Yes, and you can also do something similar in Guile. leoprikler: Have a look at module-set! and module-define for instance leoprikler: However, I would strongly advertise against doing something like that, as the definition may already have been inlined. peanutbutterandc: leoprikler, I did that, too, but to no avail. But maybe I am doing something wrong? Or perhaps it is because (srfi srfi-64) itself gets that value from (srfi srfi-64 testing)? Here: https://termbin.com/fftuj leoprikler: try it with srfi srfi-64 testing leoprikler: but I think it's the compiler peanutbutterandc: leoprikler, just did. Didn't work leoprikler: yep peanutbutterandc: https://termbin.com/m0rv peanutbutterandc: "it's the compiler" as in, a bug in guile? o.O leoprikler: so if you do want that thing to work as a parameter you have to write your own test runner leoprikler: no, it's a bug in srfi testing leoprikler: the compiler is allowed to optimize away this definition, so you setting the variable has no effect peanutbutterandc: leoprikler, *sigh* all I wanted was some simple tests. :( So, do I have to report this bug to srfi people? leoprikler: well, you did want a bit more than that in that you don't want them to log to a file ;) peanutbutterandc: leoprikler, logging to stdout looks a whole lot cooler peanutbutterandc: :P leoprikler: writing your own test runner should not be so difficult tho, especially for this case peanutbutterandc: leoprikler, I will have to read the srfi in it's entirety then. *sigh* more reading... peanutbutterandc: leoprikler, Anyways, thank you very much for your help peanutbutterandc: how do I report this to the srfi people? o.O chrislck: it's not difficult to log to stdout peanutbutterandc: chrislck, How do I do it? chrislck: use this custom test-runner: https://github.com/Gnucash/gnucash/blob/maint/bindings/guile/test/srfi64-extras.scm#L24 chrislck: then (test-runner-factory gnc:test-runner) before your tests chrislck: why fight with srfi? use the tools it gives you peanutbutterandc: chrislck, lol that was so unexpected. I was thinking there was some clever hack/kludge that you were going to give me. But thank you anyways. I will use it to write a runner thingy (perhaps that will learn me some scheme) chrislck: in this snippet above, calling (test-end ...) when finishing your tests will have the advantage of returning #t if all tests pass peanutbutterandc: chrislck, I see. Since you have given a link to gnucash... I have another question. From what you know of gnucash, how extend-able is it? I want to extend it with guile (someday) to more-easily do multiple invoices in a single session (personal requirement). While I did write a python script to deal with the issue: https://github.com/peanutbutterandcrackers/gnucash_invoice_automator I need something... GUI-ey chrislck: Use python GUI stuff peanutbutterandc: chrislck, .... and I have this thought of making a spreadsheet-like thingy for gnucash and it'll sit somewhere in the menus and I could have my non-tech-savvy friends to use it... peanutbutterandc: python GUI? chrislck: PyQT PyGTK TkInter etc lloda: peanutbutterandc: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=2b4e45ca1b89a942200b7b9f46060dddc44d2876 lloda: that issue with test-log-to-file was a bug peanutbutterandc: chrislck, will that thing be open-able from within gnucash itself? somehow? I was hoping the guile thing will sit in the menus and then come out like a spreadsheet.... peanutbutterandc: lloda, Hmm.... let me try it with my local build then lloda: however i agree it's a dubious interface, to set globals like that. So it's better to use your own runner. chrislck: ¯\_(ツ)_/¯ you'll need to ask the main devs how to hook python code and GUI to menus *: chrislck likes his custom runner peanutbutterandc: chrislck, could this not be done with guile (GUI thing)? I like guile better these days. chrislck: ¯\_(ツ)_/¯ you'll need to ask the main devs how to hook guile code and GUI to menus <-- peanutbutterandc: Understood. My previous experience with gnucash channel has been.... silence. And similar with the mailing list. Therefore my jumping at an opportunity here peanutbutterandc: lloda, I have some good news and some bad news. Good news is: with (module-define!...) no log file is written (in my build) the bad news is, nothing prints to stdout. peanutbutterandc: ...which probably means the srfi thingy should be made to treat stdout as a port in the thingy where it takes the log-file and then write whatever to stdout peanutbutterandc: if that is how scheme works peanutbutterandc: i am just going through my introductory books peanutbutterandc: lloda, also, the thing only displays "# of expected passes n" on the screen. I wish it displayed a summary by default. lloda: without the patch module-define! isn't guaranteed to work. And with the patch, set! is enough. lloda: the default runner is very raw. lloda: looks like you want a custom runner! peanutbutterandc: lloda, strange. define didn't work and set! did! peanutbutterandc: lloda, also, please forgive me for saying this, but perhaps scheme hackers should not be like "the default thing is very raw, but whatever i'll just write a custom one", but rather give a very neat default ? Maybe this is me just being too pythonic. but sensible-defaults sound like a good idea.... peanutbutterandc: lloda, could you please explain why set! worked and define didn't? lloda: set! sets the module variable, but define makes a new one local to the script, so the module doesn't see any change lloda: and fwiw I agree with you about defaults, but this is more a result of building things by sparse committee more than any Scheme philosophy lloda: srfis are improved by making new ones, not by changing old ones, b/c finding agreement between users is hard peanutbutterandc: lloda, I thought set! and define were basically the same thing (n00b here).... is there something I can read on, please? lloda: well you can have bindings with the same name in different modules lloda: these are different bindings ofc lloda: if you repeat defines inside the same module, that's a different thing peanutbutterandc: lloda, so... if I were to be a smart-bum straight-outta-python guy and send in a PR with what I think is a sensible-er default.... what would happen? o.O peanutbutterandc: lloda, Ah! That kinda' makes sense! lloda: peanutbutterandc: if the maintainers like your change, it might get included peanutbutterandc: lloda, Oh wow. That'd be quite the thing! :) lloda: it may need a lot of convincing and patience tho, or work that seems pointless to you but others ask of you to be convinced. So too often it's easier to patch things for oneself lloda: I'm not arguing that's a good thing, but I don't know how to fix it lloda: Schemers do tend to be free spirits and that has its good and bad sides peanutbutterandc: lloda, I see... I'm just a n00b, though. Starting htdp.org these days (because I am too afraid to approach sicp). Maybe I should just take care of my own small things then. peanutbutterandc: :) lloda: questions are good :-) lloda: sharing is good too. peanutbutterandc: lloda, Thank you for your help. Off I go now, then... to srfi 64 and runners and stuff... :) lloda: yw! chrislck: (web server) doesn't seem to have a clean way for the handler to tell the server to shutdown chrislck: the handler can call (exit) which is rather... explosive chrislck: if I want the handler to schedule a shutdown call and return a goodbye message, e.g. (shutdown-webserver-in-2-seconds) (build-response "Shutting down, goodbye"), it doesn't seem easily done ArneBab: lloda: for the SRFI you can normally just clone the repo and file a pull request for the reference implementation. I don’t expect them to dislike a more powerful default runner. rilez: Do you know of any implementations of common lisp--style restarts for guile? rilez: Built with prompts and exceptions I guess? dsmith-work: rilez: There was some very in-depth discussions about that on the mailing lists recently. dsmith-work: Like within the last 30 days or so. dsmith-work: (or so my memory tells me. Not the most reliable..) dsmith-work: But basically: No. dsmith-work: Not like CL anyway rilez: I'll check the logs! rilez: Is the search for the chat logs broken for anyone else? dsmith-work: rilez: Start from here https://lists.gnu.org/archive/html/guile-user/2020-08/msg00008.html dsmith-work: Yeah, seems the search is broke for the channel logs. rilez: How can I help with documentation? ArneBab: you can start by getting the Guile source (git repo) and looking into the handbook (doc/ref/*.texi) rilez: thanks! stis: Hi guilers! dsmith-work: Hej, stis How goes the python? stis: Well I got the unit testframework for Cpython n shape stis: plan run the tests to spot errors and make it more according to the standard stis: but hacking is low on summer as I spend time walking and visiting friends. dsmith-work: stis: I think it's quite amazing the work you are doing there. stis: thx dsmith-work: Python is *not* may favorite language. However I've had to use it quite a bit for about the last 5-6 years or so. stis: yeah we use it at work as well along java c++ c# stis: not a big fan either of it. stis: and now I'm som kind of expert on it lol dsmith-work: Heh. leoprikler: Don't you want to have multiple destructors tho? dsmith-work: It's not all bad. There worse things I'd rather not use. But I've been bitten serveral times by it. stis: sure it' sometimes neat, but being bitten by scheme the wrong design desitions shows stis: But with guiles python you can quickly leave python and enter the golden gates of scheme. stis: bitten is swinglish I think for beeing introduced and love it leoprikler: Biting is a thing you can do in pleasant and unpleasant ways. leoprikler: I think dsmith-work's experiences were unpleasant ones from the tone of it. stis: yeah I understand that, but mine was the pleasure version of it. Was not sure if it was a Sedish thing or more general. stis: leoprikler: what did you mean by multiple destructors? stis: guile is GC'ed and Python is referenced and therefore there is less need for destructors in guile python to break circlular references leoprikler: C++21 will apparently have a feature, wherein template classes can have more than one destructor depending on the template arguments (using contracts to ensure, that only one is instantiated per specialization). stis: cool leoprikler: Which means, that somewhere around 2027 we can start actually using this. stis: lol leoprikler: To be fair, the toolchains like GCC are quick to take up new/experimental features, but a lot of codebases are simply slow to port them. stis: k leoprikler: Btw. Guile does have destructors in the name of "finalizers". str1ngs: leoprikler: do you know if that works for goops? stis: leoprikler: yep dsmith-work: leoprikler: Yes. Unpleasant. Like assigning to a typoed variable name. Then wondering why the real var was undefined. leoprikler: str1ngs: finalizers? I think it's more of a FFI thing, but maybe there's some GC hook for that str1ngs: gotcha, thanks leoprikler: I'm pretty sure CPython also has some kind of finalizer/destructor in its FFI dsmith-work: More OffTopic: I've been learning Rust lately, and I *really* like it a lot. I need some decent static typing after Python. dsmith-work: I had this horrible python work flow. Was on embedded Linux. The "drivers" for our plug in cards were in python. Needed to build,burn,and boot a firmware image to test. stis: leoprikler: maybe the __del__ destructor leoprikler: I knew it had to exist stis: dsmith-work: rust looks really nice, heard that it has a great compiler leoprikler: I know that feel. I worked at a company, where in order to run some software I had to compile it, then place it in a special location in some other project, compile that, then run some hardware-emulating GDB magic for testing. leoprikler: I actually managed to automate most of it using carefully handcrafted Makefiles. leoprikler: (I even learned M4 at the time, because for some reason autotools was too much, but m4 still existed) dsmith-work: leoprikler: Yes. I used buildroot, which is all makefiles. stis: +1 dsmith-work: m4 is actually pretty cool on it's own. Long ago was using some freebie dos 68k assembler from moto with no macros. M4 made it pleasant. ArneBab: stis: wow, nice! (re unit test framework); we might get to do some semi-realworld-performancetesting with that leoprikler: Hard agree, that job really made me appreciate M4's existence. stis: ArneBab: the latest releases should be a lot faster made a lot of effort on that this spring dsmith-work: sneek: botsnack sneek: :) pkill9: how do you read html with guile? str1ngs: pkill9: I hear ya pkill9: is there a way to watch for sigusr signals in a guile script? pkill9: i want to run a daemon that waits for these signals RhodiumToad: (sigaction) pkill9: thanks RhodiumToad RhodiumToad: though honestly signals are messy and may not be the best way to wait for events pkill9: yea i found it laggy pkill9: what would be a better way pkill9: ?* RhodiumToad: guile does defer the call to a signal handler until the interpreter reaches some safe point, which may be an issue depending on what your thread is doing in the mean time RhodiumToad: what sort of things is the daemon doing? RhodiumToad: reading a fifo is one of the obvious alternative methods pkill9: basically it just runs a swaymsg command pkill9: it go to prev/next workspace, skipping a specified workspace pkill9: calling it each time has some noticeable lag, not terrible, but not great pkill9: a fifo would work yea pkill9: is there a guile function for creating a fifo? RhodiumToad: (mknod) dsmith-work: UGT Greetings, Guilers Habush: aleix: Hi. Any update on the libevent PR? mwette: not really. The converter needs to be re-written, though. It works directly on the syntax trees emitted by parse-c99. The tricky part is that when type T is defined in C, you may need to provide not only the scheme hooks for T, but also for T* and T**, etc. And then you need to handle dereference and pointer operations. mwette: If you make an object, say x, of type T in scheme, and a functions wants the pointer, ffi-help provides (pointer-to x) leoprikler: Maybe, but in my personal use case, I think I want to use ffi-helper to extract function pointers and enum values while writing most of the serious wrapper code in the same module leoprikler: so it's a step lower than what you are doing in basically letting the user access everything for free leoprikler: I'll definitely have a look at nyacc at some later point and perhaps write my tryhard frontend mwette: If I understand, you would want to list a set of C declarations visible in some set of includes, and get just those expanded. I have not done that, but it swould be not too hard. leoprikler: basically that, yes leoprikler: more explicitly it would probably be: mwette: So the ffi-helper is good about keeping definitions you want and expanding the ones you don't. leoprikler: make/parse-c-struct code for raw pointer types leoprikler: dynamic-func for functions leoprikler: and symbol tables for every enum type leoprikler: (plus maybe another symbol table for global #defines) mwette: I don't know what you mean by raw pointer types. leoprikler: raw struct types, oops :P leoprikler: i.e. struct foo { int bar; int baz; } would get a parse-c-foo-struct procedure mwette: but often structs include structs. You may want to check out nyacc's expand-typerefs procedure. mwette: i.e., struct foo { some_funky_t bar; another_funky_t baz; } => struct foo { int bar; double baz; } leoprikler: hmm, didn't think about that leoprikler: perhaps there might arise the occasion, where one wants that in nested lists mwette: to expand-typerefs you pass a declaration and a "keepers" list and it expands everything except the keepers leoprikler: but I think flattening them to basic types should be fine in most cases mwette: For simple, stuff you should be OK. For collections of functions that use multiple types you'll appreciate what the ffi-helper does. leoprikler: oh, sure, for huge libraries like gtk, stuff like ffi-helper is invaluable leoprikler: but for small examples like wordexp(3), I would like to have my embedded systems friendly solution :) leoprikler: (also for semilarge ones like libmpdclient, where handwriting a wrapper in C or scheme is very possible) leoprikler: Really, the only thing I would actually need here, that isn't in Guile itself already, is the extraction of enums daviid: str1ngs: fwiw, g-golf (can) makes and parses array of (utf8) strings leoprikler: yeah, we already noted that over in the guix channel leoprikler: just for reference, what does your utf8 argv parser look like? daviid: leoprikler: here (g-golf gi utils) daviid: scm->gi - or scm->gi-strings for the core mplementation daviid: leoprikler: http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/gi/utils.scm?h=devel#n320 leoprikler: a bit verbose, but basically same idea daviid: str1ngs: any particular eason why tou did not use this? just curious leoprikler: it was for a library outside the GI scope leoprikler: and as far as I can see, you have to do some extra work for refcounting/GC in that code, that probably doesn't apply daviid: ah ok - yes, one ned to keepo a pointer to the string, iirc str1ngs: daviid: oh I just want to use wordexp for globing and expansion. str1ngs: nothing g-golf related. though I might use it in nomad str1ngs: daviid: I'd like to add 'expand-file-name like emacs to nomad. leoprikler: Is this perhaps related to the missing tab completion? 🙃️ str1ngs: actually nomad's tab completion ala emacsy is pretty good. only place it needs work is M-: ( it can handles symbols but not expressions leoprikler: I think I can recall it not working in find-file, but expanding ~ and variables is very much appreciated too str1ngs: yes, sorry that does not expand. I'll like to improve on that. though find-file etc. is kinda something I hope others hack on. My primarily focus has been on extensible for the web browser. though these are all building blocks. since adding 'expand-file-name that could be used in completer of 'find-file str1ngs: emacsy does expand ~/ during 'find-file though it's kinda clunky on in the each-area to use. str1ngs: echo-area* daviid: str1ngs: ok - is this wordexp binding in nomad? str1ngs: not yet daviid it is just WIP. see http://paste.debian.net/1159692. (glob "~/*") gets all files in the home directory as a string list. str1ngs: I would like to add something like this to guile to be honest. kI miss filepath.Glob from g str1ngs: I miss filepath.Glob from golang daviid: str1ngs: guix must have that str1ngs: it may do, I don't know daviid: str1ngs: and do you need this to be portable accross OS, or on linux only str1ngs: I think wordexp is POSIX so should be reasonable portable. *: str1ngs looks at windows daviid: str1ngs: if posix, it means 'none native window', i guess str1ngs: also whatever systems support guiles FFI. think all the major ones do. daviid: msys2, cygwin will be ok of course daviid: str1ngs: i was asking because i also have some, in grip str1ngs: aye. with WSL though on windows it should work. which is what I use when I *have* to use windows. str1ngs: though windows support on nomad is long way off. str1ngs: think that's something that will need to be contributed. daviid: don' know wsl - i use msys2 when i have to ... daviid: i thought you wnted something ourtside nomad daviid: otherwise, you could reuse (gi-scm wordexp-ptr 'strings) str1ngs: daviid: right I just might make it a module daviid: and (scm->gi "("your" "strings" "here") 'strings) str1ngs: does that make a GList? str1ngs: GList of strings I guess? daviid: no, but an arry of pointers, but g-golf also has GList and GSList as well ... daviid: actually, GSList 'only', never had a use case for GList daviid: yand (scm->gi "("your" "strings" "here") 'gslist) daviid: str1ngs: all this is in (g-golf gi utils), feel free to use, snarf ... and test :) daviid: let me know if you need GList, i can cook that for you (and g-golf) daviid: str1ngs: grip has (grip file) and ()grip path) - the former uses a glob as well daviid: https://git.savannah.nongnu.org/cgit/grip.git/tree/grip/file.scm daviid: get-filenames pkill9: is it an ugly hack to use eval? str1ngs: I'll need to use GList eventually though not for this. because I only use GLib/Gtk in the graphical abstraction. the core of nomad just scheme primitives so most things will work despite a graphical toolkit. str1ngs: daviid: can grip do something like this "~/*/*" ? str1ngs: expands all files as a list of the second leaf directory in ~/ daviid: str1ngs: you mean you'll need GList in nomad? if that's so, you probably have a webkit/gtk function in mind? so far, i only did need GSList, but GList is on the todo ... far below GIInterface (full implementation), and so far below GICallbacks as well daviid: str1ngs: not the ~, but it will understand * and any regexp that glob.scm understand daviid: (get-filenames "." #:like "*") daviid: $10 = ("./child-property-prev.scm" "./short-methods" "./gdk.scm" "./hw-app.scm" # …) str1ngs: daviid: nothing in mind right now. though I'm bound to run into something daviid: for example of course str1ngs: I guess I find stuff like this handly. (glob "~/[a-c]*") daviid: str1ngs: i think guix does a better job then grip here str1ngs: I'll check guix. it's more of a extended use case other then nomad. daviid: str1ngs: here https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/utils.scm#n402 str1ngs: if I can avoid wordexp would be better since this is a thing (glob "$(uname -a")). you can turn this off but still. daviid: you definitely can avoid wordexp, but i don't fully understand the above sentence str1ngs: worexp can do command substitution though you can turn it of if you pass the WRDE_NOCMD flag. without it you can do this. (glob "$(rm ~/*)") str1ngs: dont eval though of course. daviid: :) daviid: ok, i thought you wanted to retreive filenames, cmd substitution is another thing .. daviid: anyway, need to hack daviid: ping me if you need GList str1ngs: probably what I need glob-match? from (guix glob) coupled with a tilde expanded. wordexp is low effort on my part since it does both. pkill9: eval is telling me one of the variables in the expression i gave it is unbound, what could be the issue? daviid: right, grip uses glob to, but i see the guix implementation is nicer - and you use/know guix already ... str1ngs: pkill9: we'd have to see the expression. though probably you want this `(display ,foo) pkill9: str1ngs: it's this https://paste.debian.net/plain/1159696 pkill9: it says command-prefix is unbound pkill9: I try unquoting it, i assume it will work, but it would be nice to be able to just pass it without unquoting anything pkill9: in that paste, the 'selection' is the expression returned str1ngs: quote like this. (let ((welcome "Hello GNU!")) (eval `(display ,welcome) (interaction-environment))) pkill9: why does it need to be unquoted? pkill9: in my example, 'shell-command' doesn't need to be unquoted pkill9: though i guess it's calling that directly? str1ngs: pkill9: thinking one sec str1ngs: pkill9: where is shell-command defined? pkill9: in the same file str1ngs: pkill9: which variable does it say is not defined? pkill9: command-prefix and package-specification str1ngs: right so you want to use `(display-menu.. rest .... ,command-prefix ... rest) does this make sense? str1ngs: display-menu is called when selection is bound is that okay? if so you might need to move ` str1ngs: also the same with package-specification. kassuming this are str1ngs: don't mind that last sentence :P pkill9: i get what to do to make it work, and why it works, i just don't get why it doesn't work when I don't unquote it pkill9: i'll just unquote for now, i don't need to get hung up on this pkill9: thanks str1ngs: see quasiquote on https://www.gnu.org/software/guile/manual/html_node/Expression-Syntax.html str1ngs: basically the quotes everything except for things prefix with , those will be evaluated. pkill9: i understand quasiquotes, i just don't get why eval doesn't see that variable str1ngs: you sure it's not the call to display-menu causing this? pkill9: interestingly, i don't need to unquote the call to the function within a nested expression pkill9: display-menu is just returning the symbols pkill9: it returns the assoc-ref str1ngs: then probably `(("Build and run package" the ,command-prefix should fix this as far as I can see str1ngs: I think I'm reading this right :) pkill9: to give you an example of an evaluation that works in that paste: (shell-command ,command-prefix ,%web-browser (package-home-page (specification->package ,package-specification))) pkill9: notice package-home-page and specification->package don't need to be unquoted str1ngs: those are procedures they are evaluated by eval. pkill9: ok pkill9: so eval creates a kind of sub-environment? pkill9: idk, i thought function and variables were the same in lisp/scheme str1ngs: functions are variables if you use them like so. see a REPL if you type version vs (version) one is evaluated the other is a value. str1ngs: because here you pass the data as an expression the procedures are evaluated but (interaction-environment) is outside the scope of your let. so you need to evaluate the variables with , daviid: str1ngs: notye that scm->gi-strings returns a pointer to a NULL terminated array of pointers to strings ... but scm->gi-n-string returns pointer to a non NULL terminated ... daviid: just in case ... str1ngs: daviid: that could be handy for something GLlib related. str1ngs: I think when I hack on a grid-buffer I might need GList will let you know. daviid: str1ngs: for non NULL terminated arrays, you'd use (scm->gi '("a" "b" ...) 'n-string) str1ngs: daviid: right now I'm working on a bug in emacsy related to co-routines and prompts. not easy to track down the context. str1ngs: not related to g-golf daviid: str1ngs: those operations have their counter part of course, gi-scm ... 'strings|n-string|pointers|n-pointer str1ngs: okay will keep these in mind. though I can't think of anything that might need this off hand. daviid: yes, co-routines and prompts ... hard to write, hard to debug .. are you using fiber, or guile-async ? daviid: *fibers daviid: guile-a-sync2 and guile-a-sync3 work with g-golf now str1ngs: not right now it uses emacsy uses (emacsy coroutine) daviid: ah ok str1ngs: which async was glib friendly? daviid: guile-a-sync* (for guile 2.0, 2.2 and 3.0) str1ngs: I though you mentioned something before. later when I have a better grasp of emacsy I might port (emacsy coroutine) daviid: those have been proted to g-golf a while ago str1ngs: does guile-a-sync have and glib code? str1ngs: any* daviid: and tested for weeks, non memleak, no bug, till now :) daviid: str1ngs: yes it has str1ngs: hmmm :( that wont' work for emacsy it's program agnostic. maybe fiber then. daviid: https://github.com/ChrisVine/guile-a-sync2/wiki str1ngs: or 8sync? daviid: 8sync do not use GLlib daviid: *GLib str1ngs: for emacsy that's okay it's kinda agnostice think pure scheme. daviid: ... "(a-sync g-golf) - provides some convenience await procedures for the glib main loop using g-golf" ... str1ngs: first I need to understand emacy's problems to correct them lol daviid: and it provides those for guile-gi as well, fwiw str1ngs: this is one issue is with coroutines and propmpts. daviid: sure, was just pointing - so it 'rings a bell' if you later need it ... str1ngs: oh I appreciate it's informative. I've been meaning to ask which async library was glib friendly . maybe I can leverage it in nomad. emacsy is something different it needs to not be coupled with GLib if possible. str1ngs: some examples use SDL, you get the idea. daviid: i think guile-a-sync is the only GLib friendly, afaict at least str1ngs: that's good to know. I might still be able to use it at some point. str1ngs: it's a fine line of how much GLib and Gtk I actually use. if anything I can think I make more things generic. which would help later with more back ends like ncurses str1ngs: if things ever progress that far. I'm fine with Gtk and GLib for now. daviid: sure - worth noting the author is a very very experienced C and scheme hacker as well str1ngs: this was snarfed from guile-2d which davexunit wrote. str1ngs: sigh, I should just talk to him :) daviid: guile-a-sync* snarfed guile-2d? daviid: maybe, just curious - we should all snarf anyway, instead of rewriting the wheel i mean .. daviid: whenever possible, this is all free s/w ... str1ngs: naw emacsy snarfed guile-2d str1ngs: aye we need more modules like guile-lib :) str1ngs: can we add glob to guile-lib? *: str1ngs looks at daviid daviid: it's ok ... which became sly - i see guile-a-sync2 doc says co-routines are like ecmascript ones ... not my domain though ... daviid: str1ngs: yes we should work on guile-lib, i've always wanted to libify guix, the part of guix we all need all the time ... but always got stuck with a pile of things way above my head :) str1ngs: let me look at guile-a-sync2 but if it uses GLib it won't be a good fit for emacsy. I would like to maybe just fix some bugs for emacsy for now. then think more on it. daviid: str1ngs: it has co-routines without GLib daviid: https://github.com/ChrisVine/guile-a-sync2/wiki/overview daviid: https://github.com/ChrisVine/guile-a-sync2/wiki/coroutines str1ngs: ahh that then might work. daviid: "... It is similar to ECMAScript generators and python generators." daviid: the make-proc-iterator proc of course str1ngs: I guess the reason this works well with GLib is it uses one event loop daviid: *the make-iterator proc ... str1ngs: but as long as you don't *have* to have Glib for that event loop then should work with emacsy str1ngs: well it will stay within the design of emacsy daviid: right daviid: and you don't want to rewrite all this str1ngs: The a-sync procedure can be used with any event loop, including the glib main loop provided by g-golf and guile-gi str1ngs: right that's was my intention. I was thinking of adding in emacsy to replace (eamcsy couroutine) str1ngs: nice daviid: chris, the author, has writtten and tested his lib for almost a decade, and still uses it dauily, i think so - he contributed to g-golf ... definitely a win approach if you need coroutines i would say str1ngs: it won't be for sometime. I need a better handle on the problem space. but this is good research str1ngs: I agree thanks for pointing this out. daviid: sure, np! keep it in mind and possible read his code ... should help str1ngs: it's a bit of a challenge because I'm semi maintaining emacsy. I think I'm the only one using it. plus trying to get nomad to be more usable. daviid: ok, back to my own hack lipe of things :) daviid: *pile str1ngs: happy hacking :) daviid: so, is guix using this glob to? https://git.savannah.nongnu.org/cgit/grip.git/tree/grip/support/glob.scm daviid: that file is in guile-gnome to by the way str1ngs: I don't think so it has a (guix glob) module daviid: in grip, i made it so i can include it ... str1ngs: you know probably GLib has globber already str1ngs: though I'd avoid GLib for this. daviid: right, agreed (to avoid glib for those tasks ..) pkill9: what could be causing a (let) to show a bunch of 'unbound variable' warnings where you are setting the variables? daviid: pkill9: use prob need to use let* - see the doc for diff between let and let* ... pkill9: nah i tried that daviid: please paste a snipset we can reproduce ... pkill9: https://paste.debian.net/plain/1159710 pkill9: it's not reading the let syntax pkill9: i've probably made a typo somewhere daviid: pkill9: this is not a so calle snipset daviid: *called pkill9: it's under the write-cache function pkill9: it gives a bunch of warnings: ;;; /home/itsme/.local/bin/build-and-run-package-guile:267:75: warning: possibly unbound variable `desktop-file-contents' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:271:58: warning: possibly unbound variable `desktop-file-contents' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:272:102: warning: possibly unbound variable `desktop-file-contents' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:274:58: warning: possibly unbound variable `run-in-terminal?' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:275:62: warning: possibly unbound variable `exec' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:274:58: warning: possibly unbound variable `exec' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:278:20: warning: possibly unbound variable `current-guix' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:278:20: warning: possibly unbound variable `desktop-files-modification-times' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:278:20: warning: possibly unbound variable `desktop-files-menu-entries' pkill9: ;;; /home/itsme/.local/bin/build-and-run-package-guile:265:36: warning: possibly wrong number of arguments to `map' pkill9: oh, it might be desktop-files-menu-entries, which is missing an arugmetn for map chrislck: don't you need a let* in the line after "desktop-files-menu-entries"? pkill9: fixed it, thanks str1ngs: pkill9: that's a common gotcha :) chrislck: I tend to use let* by default str1ngs: umm should docstrings have periods at the end? str1ngs: daviid I added a small feature to nomad you were interested in sometime ago. Now when you hover on a link it is displayed in the echo area of the minibuffer. daviid: str1ngs: nice - not using nomad, but i beleive users will like it! daviid: the important thing is you now have the 'machinery', i remember you said it was not that easy ... str1ngs: it's been there for some time. I was just not aware of the signal. 'mouse-target-changed str1ngs: daviid: pretty trivial actually https://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/gtk/widget.scm?h=decision-policy#n222 daviid: str1ngs: cool - I see you define show-all, grab-focus, get-text ....? aren't these 'built-in'? str1ngs: daviid: they are now. not when I added them :) str1ngs: I have not ported (nomad gtk widget) to short names quite yet. daviid: ah ok :) pkill9: eval is working pretty nicely pkill9: bindings for sway i nguile would be sweete pkill9: in guile* str1ngs: pkill9: I'm writing a compositor in guile will be called nomad-shell. not sway but will be simular. pkill9: cool pkill9: one reason to have it for sway though is just that it's a more mature project and has a lot of contributors pkill9: so more bugs ironed out, etc jackhill: ooh, I would be interested in either/both of those projects. wklew: hi guilers, im back with another delimited continuation question wklew: while trying to implement control/prompt by following the racket implementation, i realized i need a multi-prompt version of call/cc wklew: does such a thing exist? mwette: a_v_p: are you looking for help? wklew: oof this connection mwette: a_v_p: if so, here is an approach I would use: https://paste.debian.net/1159585/ jgart: how can I return a new list that collects the lists that have 1 as a common atom. Give the following list: ((0 1 2) (1 2 3) (2 3 4) (3 4 5) (4 5 6) (5 6 7) (6 7 8) (7 8 9) (8 9 10) (9 10 11) (10 11 0) (11 0 1)) sneek: jgart, you have 2 messages! sneek: jgart, manumanumanu says: I am the srfi-171 author. If you have any questions you can ask me here, or even better PM me. sneek: jgart, manumanumanu says: but srfi-171 would be a bad choice. SRFI-158 would be a much better choice. jgart: I want to return: '((0 1 2) (1 2 3) (11 0 1)) jgart: any hints or help are greatly appreciated justin_smith: jgart: sounds like a classic use for srfi-1 filter jgart: thanks, justin_smith jgart: I'll check that out justin_smith: jgart: in fact without even using srfi (filter (lambda (x) (memq 1 x)) ...) should work justin_smith: I forgot filter was in the base guile RhodiumToad: technically I think that should be memv but memq works for it in guile justin_smith: memv is faster for types (like numbers) that support it, right? RhodiumToad: no RhodiumToad: equal is slower than eqv which is slower than eq RhodiumToad: member uses equal, memv uses eqv, memq uses eq RhodiumToad: however, numbers of equal value are not necessarily eq RhodiumToad: correct usage is to use eq? (and memq, assq, etc.) only for comparing against special unique values and interned objects such as symbols or keywords RhodiumToad: eqv? etc. should be used for values without substructure (though iirc the real/imag parts of complex numbers don't count as substructure for this purpose) RhodiumToad: and for values with substructure, you need equal? RhodiumToad: so for example you can compare symbols with eq? but comparing strings requires equal? RhodiumToad: guile, as an implementation artifact, happens to allow eq? to work with characters and small fixnums RhodiumToad: oh, also, sometimes eq? has a use for comparing whether two things are in fact the same pair. *: chrislck has defeated SASL. +1 EXP chrislck: is there a SRFI or module which can convert relative to full file paths? eg. "~/folder1/../folder2/x.txt" to "/home/chris/folder2/x.txt" jackhill: chrislck: the tilda expansion might be hard, otherwise guile had canonicalize-path jackhill: *tilde jackhill: I might use the shell to get the tilde expanded. It it authoratative on all the rules. jackhill: otherwise, I might look to see if scsh has anything chrislck: thanks... looks like a very OS-specific problem leoprikler: for the record, you could just use (getenv "HOME") unless you need other users as well chrislck: the idea is to try convert strings without writing code... there's https://stackoverflow.com/questions/51520/how-to-get-an-absolute-file-path-in-python?rq=1 in python but guile needs one too leoprikler: that'd be (string-append (getcwd) "/" dir) leoprikler: note that python needs expanduser and expandvars to handle stuff like ~/ and $HOME leoprikler: you could write those on your own using regular expressions, but I'm pretty sure most use cases are very trivial in the end chrislck: maybe guile needs (ice-9 path) or something leoprikler: I think there is a filesystem library out there, but I don't know if it does everything you want it to leoprikler: Perhaps try out guile-file-names str1ngs: (passwd:dir (getpwnam (getlogin))) will also get home without using environment variables str1ngs: err $HOME leoprikler: oh, nice, one can actually use that for ~user too leoprikler: extending guile-file-names with that might be nice, but is it portable? might be unix only str1ngs: the main question I guess does it work on windows. not sure leoprikler: then again do people use that syntax on windows? :P str1ngs: people that are forced to use windows :) leoprikler: I think my question was unclear. I was wondering whether people using Windows (whether forced at gunpoint or otherwise 'convinced') enjoy the luxury of having tilde expand to anything in the first place. RhodiumToad: chrislck: you can call realpath() via the FFI on posix-like platforms RhodiumToad: really guile should have its own wrapper for that RhodiumToad: str1ngs: ~/foo uses $HOME and _not_ whatever is in the passwd file RhodiumToad: str1ngs: which means that ~ and ~myuser aren't necessarily the same str1ngs: leoprikler: what I was trying to imply was if a unix user is forced to use windows. then globing ans expansion would indeed be usesful. str1ngs: $HOME not being ~$USER seems kinda broken. all the more reason to use passwd RhodiumToad: Windows does have its own concept of a home directory but obviously it doesn't work the same way as on unix leoprikler: well, during guix builds $HOME is not /var/empty RhodiumToad: str1ngs: not only is it not broken, it's always been the traditional behaviour and is required by the standards RhodiumToad: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_01 str1ngs: I don't see anywhere where is says the passwd and HOME can be different. str1ngs: it only says if login is NULL assuming it means the passwd entry then $HOME is used. so 'passwd:dir is preferred over HOME which is why I suggested it. RhodiumToad: HOME is just an env var, nothing forces it to be the same as the value in the passwd entry RhodiumToad: no, you read it wrong RhodiumToad: "login is null" means that you used ~/foo rather than ~somelogin/foo str1ngs: right I did read it wrong that was imply the postfix str1ngs: wait this is for a POSIX shell which might make sense. this might not work the same as glob RhodiumToad: globbing is a separate operation RhodiumToad: tilde expansion is done before pathname expansion str1ngs: so unless you are writing a POSIX shell. personally I would use globing. I might have made an assumption here. dsmith: dsmith@debmetrix:~$ pwd dsmith: /home/dsmith dsmith: dsmith@debmetrix:~$ HOME=$HOME/src dsmith: dsmith@debmetrix:/home/dsmith$ cd dsmith: dsmith@debmetrix:~$ pwd dsmith: /home/dsmith/src RhodiumToad: yes, cd without args also uses $HOME dsmith: And you can change (in the current process) HOME to whatever. RhodiumToad: str1ngs: nobody asked for globbing that I can see. the question was how to resolve a path that might contain ~ and .. *: RhodiumToad wonders why guile doesn't already have a (realpath), maybe a historical oversight? leoprikler: guile is not alone in this regard tho leoprikler: see the various python solutions pkill9: it has canonical-path though str1ngs: right I've already mentioned that before *: RhodiumToad doesn't like python dsmith: RhodiumToad: I would thing oversight. Most things are in because someone wanted/needed them at some point. RhodiumToad: what has canonical-path? str1ngs: check the manual? RhodiumToad: I just did? str1ngs: it's documented there! RhodiumToad: where? leoprikler: Nowhere as far as I can see leoprikler: but you can ,describe canonicalize-path RhodiumToad: also, python does have realpath() str1ngs: guile is not posix. some functions adhere to scheme standards str1ngs: though I'm not sure if canonicalize-path. but some procedures/functions do. str1ngs: Again probably realpath is not required since canonicalize-path exists. you can though if it's important to you. provide a patch to the posix module. RhodiumToad: hm RhodiumToad: so canonicalize-path exists, but is not in the docs? str1ngs: it is in the docs str1ngs: see https://www.gnu.org/software/guile/manual/html_node/File-System.html RhodiumToad: ah RhodiumToad: looks like it was added recently RhodiumToad: 2020-05-30 in fact RhodiumToad: anyway, canonicalize-path is just a realpath() call on platforms where that exists RhodiumToad: added recently to the docs, that is, the function has been there a long time dsmith: 2009-06-19 dsmith: commit 25b82b3 *: dsmith recently learned how to search in gitk leoprikler: it's missing from the 3.0.2 docs, so that's probably why no one knows about it yet ;) RhodiumToad: yes, the copy of the docs I was searching happened to be from 3.0.2 dsmith: OT Question: Is it possible after writing to a socket, clear/reset the socket of any untransmitted data? dsmith: Talking kernel buffers here, not userland buffering. dsmith: Hmm. There is the SIOCOUTQ ioctl that undent data in the socket send queue.. RhodiumToad: not on my system there isn't RhodiumToad: but the real problem is, what does it mean for data to be untransmitted? RhodiumToad: (and what possible good would it do?) dsmith: Right. dsmith: Was just going over the HiSLIP spec: https://www.ivifoundation.org/downloads/Protocol%20Specifications/IVI-6.1_HiSLIP-2.0-2020-04-23.pdf#page=51 dsmith: Talks about clearing messages. "Clear messages on the synchronous and asynchronous channels with the exception of {..}" dsmith: Must be userland unsent messages. dsmith: Oftentimes, the people that write these specs don't have a real understanding of how things are implemented. RhodiumToad: that sounds like "clear" in the sense of "read and discard incoming messages" dsmith: Yes you are right: "To send a device clear, theclient will..." str1ngs: using FFI is it possible to represent an array of strings? I need to pass something like char *argv[] to a foreign function. mwette: I would think so. Check out string->pointer pointer-address and uint-list->bytevector. You want to make a bytevector of an array of integers which are pointers to the strings. mwette: Then pass to the function, declared to take '*, via bytevector->pointer. str1ngs: mwette: great. I will read up on these thank you. leoprikler: str1ngs: I just hacked together https://paste.debian.net/1159661/ leoprikler: if it's for wordexp, it'll be fine just passing a significantly large null struct, will it not? leoprikler: parsing the struct back into something meaningful is where your problem lies, so you need to reverse all the arrows ;) leoprikler: and the program flow too str1ngs: the term argv was probalby not the best but the principle is the same. let me take a look at this. leoprikler: well, passing an argv to a function is different from accepting an argv from a function str1ngs: right as far as I can see wordexp_t *p is . char string_list[2][10] = { "tom", "jerry" }; str1ngs: so it does need to be memory created then passed as an argument where it is the filled. str1ngs: or **char p str1ngs: here's what it looks like in C http://paste.debian.net/1159662 str1ngs: I just notice p.we_wordc which means this is a struct. so I don't know where wordexp_t is defined. leoprikler: I think this might need an SCM_DEFINE'd wrapper function leoprikler: otherwise you risk ABI weirdness breaking your code str1ngs: that I can do. I was just trying to avoid using C leoprikler: If you want to use as little C as possible, you can just pass the arguments in unchecked and return the wordexp_t in a controlled manner leoprikler: I do think that writing the whole blob in C would be more safe though in some manner str1ngs: I can pass SCM I've done that before no problem. I'll play with FFI some more though. This was mainly to expose myself to FFI anyways. str1ngs: if not SCM_DEFINE as a last resort. leoprikler: you can do parse-c-struct to get the contents of the wordexp_t str1ngs: I found the definition for worexp_t it's not what I thought it was so that's an improvement :) str1ngs: afk for a few leoprikler: yeah, it's size_t, pointer, size_t leoprikler: exactly as in the manual str1ngs: right, so should be able to use make-c-struct hard part will be char **we_wordv; leoprikler: well, you start with bytevector->uint-list leoprikler: then map (compose pointer->string make-pointer) str1ngs: thing is it starts with an empty list I would assume. leoprikler: on which end are you right now? passing to or reading from? str1ngs: right now I'm just researching leoprikler: passing to is simply three zeroes str1ngs: then you think parse-c-struct would be enough? leoprikler: not quite leoprikler: with parse-c-struct you get argc as an integer and argv as a pointer leoprikler: you convert argv to a bytevector using argc leoprikler: then to an uint-list leoprikler: than to a bunch of pointers/strings str1ngs: right but for wordexp it takes a wordexp_t p. I confused things using argv as an example. str1ngs: char **we_wordv; is like argv which is what I thought wordexp_t. sorry for the confusion str1ngs: possible wordexp does initializing as long as you use wordfree when you are done. in which case this might be easier than I thought. str1ngs: so I just need to reverse your example. *: str1ngs cross's fingers str1ngs: really AFK for a awhile :) a_v_p: Guilers, is there a way to create an empty list from the C world? I have read the manual and the header files, but found nothing similar. Maybe I overlooked something? mwette: sneek: later tell str1ngs, nyacc's ffi-helper generated, from (define-ffi-module (wordexp) #:include '("wordexp.h")), this: https://paste.debian.net/1159665/ sneek: Okay. a_v_p: Oh wait. 'scm_make_list' seems to be what I need. str1ngs: mwette: maybe I should use that instead :) sneek: Welcome back str1ngs, you have 1 message! sneek: str1ngs, mwette says: nyacc's ffi-helper generated, from (define-ffi-module (wordexp) #:include '("wordexp.h")), this: https://paste.debian.net/1159665/ str1ngs: is size_t uint64 I'm not sure this is a safe assumption on my part. str1ngs: that could be platform dependent maybe? mwette: yes- the intention is that you compile ffi->scm on the host to be used. If another host defines size_t to be 32 bits, it should do the right thing. mwette: The command "guild compile-ffi wordexp.ffi" generates "wordexp.scm" mwette: when you have nyacc available mwette: the contents of wordexp.ffi I used is just (define-ffi-module (wordexp) #:include '("wordexp.h")) str1ngs: thank you mwette leoprikler: that's surprisingly much boilerplate for little gain str1ngs: I think I almost got it. http://paste.debian.net/1159679 . though I'm not sure how to handle cadr of the parse-c-struct. this should be SCM pointer of char **we_wordv str1ngs: more correct version. http://paste.debian.net/1159680 str1ngs: I have some weird hacks for my distro don't mind them :) mwette: Do you mean lots of boiler plate for simple header file? Yes, it would be easy to do by hand. But that's not what I am after. I have auto-converted glib.h + gobject.h + pango.h + gdk.h + gtk2.h and then been able to write a hello world gtk+-2 demo. That just can't be done by hand in the same time. The idea is to be able to talk to C libraries quickly. str1ngs: mwette: I can see ffi-helper being quite useful. :) mwette: str1ngs: you don't need to dynamic-link lib's that are already bound into the guile run-time str1ngs: oh wow I did not know that leoprikler: let me expand your let* chain leoprikler: (real-results (parse-c-struct results wordexp-type)) leoprikler: (wordc (car real-results)) leoprikler: (wordv (cadr real-results)) str1ngs: right looks good leoprikler: (wordbv (pointer->bytevector wordv (* wordc (sizeof '*)))) leoprikler: (words* (bytevector->uint-list wordbv (native-endianness) (sizeof '*))) leoprikler: finally (map (compose pointer->string make-pointer) words*) str1ngs: awww yeah! str1ngs: leoprikler: that's the missing special sauce thanks. now I need to getting better grasp of bytevector->uint-list. the rest kinda makes sense. leoprikler: bytevector->[u]int-list "reinterprets" a bytevector as a list of integers given a particular endianness and integer size leoprikler: for instance, you can unpack a series of big-endian 16bit integers if you're working with low level protocols that use them a lot leoprikler: or an array of native-endian FFI data str1ngs: this is not bad, it's actually easier then C. doesn't not help I don't grok map and compose like for-each. imperative has tainted me! leoprikler: mwette I kinda see the point, but I wish it needed less helpers and had more raw guile code leoprikler: e.g. instead of symbols-tab a (define WRDE_SYNTAX 5) or something like that str1ngs: nice thing about wordexp is it can glob as well. but I need to set some enumb. I won't want program expansion str1ngs: enum* str1ngs: aka command substitution leoprikler: well, i think passing flags should not be too difficult for a manually written FFI to handle ;) mwette: leoprikler: I struggle with code bloat. If you define everything then the namespace will get quite polluted. Conversion of gtk2.scm generates 91k lines of scm code. mwette: the gtk2.scm symbol-tag has ~2300 items leoprikler: yeah, that's definitively too much to handle in any normal way leoprikler: hence why guile-gi and g-golf both have filtering mwette: So I usually define a procedure (gtk2-val 'GTK_CTREE_ExPANSION_TOGGLE) -> 4 leoprikler: I feel that's a bit too general though mwette: guile does not have the size developer community to hand-wrap c libraries like the python community does leoprikler: can nyacc handle specific enums? leoprikler: you could do something like (define %gtk-ctree-table '((expansion-toggle . 4) ...)) mwette: yes. If the header declares a c function that takes an enum then you can just pass the symbol value. e.g., my cariso example uses (cairo_image_surface_crate 'CAIRO_FORMAT_ARGB32 200 200) mwette: s/symbol value/quoted symbol name/ mwette: leoprikler: when you define a ffi module via define-ffi-module you can add scheme code to add helper's. I also have partial hooks for a re-namer so one will be able to convert _ to -, but the thinking is that the generated scm code is really C-in-scheme and serious use should put a more scheme-like wrapper on the front. leoprikler: hmm, does nyacc's ffi-helper use any parsing on top of parse-c99? leoprikler: if not, it should probably be easy enough to alter the front end to fit my needs daviid: . sneek: Welcome back daviid, you have 1 message! sneek: daviid, str1ngs says: both and work now. without using change-class. I only test 'decide-policy signal since that's the only signal I know of right now that does this. daviid: str1ngs: ok, perfect - it will work for any signal that sublcasses one or more of its arguments pkill9: what's the character code for open and close parentheses? pkill9: codes* daviid: pkill9: that is a quiz for the repl :) pkill9: nevermind, don't need it pkill9: i forgot about string-replace-substring pkill9: hmm pkill9: how do i replace "(" with "\("? pkill9: (string-replace-substring "(" "(" "\(") does nothing daviid: pkill9: prob need to escape the \ daviid: "\\(" pkill9: that returns "\\(" daviid: yes, but write it to a port ... daviid: (display "\(\n") vs. (display "\\(\n") daviid: pkill9: 6.15.3 Backslash Escapes pkill9: i see, thanks daviid: wc! pkill9: wc? daviid: welcome pkill9: ah daviid: pkill9: and 6.6.3 Characters as well .. daviid: (char->integer #\() (char->integer #\)) to answer your previous quiz lloda: or you could use https://github.com/lloda/guile-raw-strings and not worry about escapes ^^ dsmith-work: Happy Friday, Guilers!! a_v_p: Guilers! I'm thinking about a macro for my recent project (Metabash) that should look something like this: (M#! remote session "cat /etc/hosts" => local "sort" => local "grep 127.0.0.1") a_v_p: Is it possible to accomplish with syntax-rules/syntax-case, or I need something *more powerful*? dsmith-work: a_v_p: Have you looked at scsh ? ISTR that they had some maros for command lines. That was probably with lispy defmacro style macros though. dsmith-work: a_v_p: https://scsh.net/ topoi: dsmith-work: The acknowledgements read tough though (https://scsh.bnet/docu/html/man.html) dsmith-work: Heh a_v_p: dsmith-work: Thanks! I think I saw some examples of macros from SCSH sources today... seems to need to dig deeper. dsmith-work: I think there have been at least two different efforts to port scsh to guile in the past. Not sure what the current status is. a_v_p: dsmith-work: Almost there: https://gist.github.com/artyom-poptsov/f1a3479522455b97cbbf30801d395f1e a_v_p: Unfortunately it does not match syntax like: (M#! remote session "ps aux" => local "grep guile") daviid: lloda: fwiw, i was browsing guix package page to check something, and see guix also has guile-cairo-1.10.0 still sneek: daviid, you have 2 messages! sneek: daviid, str1ngs says: can just check this snippet http://paste.debian.net/1159198. And make sure I'm getting the 'ok enum right for gtk-response-type. you can import it with (gi-import-by-name "Gtk" "ResponseType"). sneek: daviid, str1ngs says: I can help think there is a better way to do this. daviid: str1ngs: will check asap wklew: Hi guile, does anyone know if spawn-fiber is a continuation barrier? wklew: i.e. whether I can abort to the context of the call to spawn-fiber from within it wklew: i guess thats a very easy thing to test now that i write it out daviid: str1ngs: you might wna use enum->value instead of assoc-ref ... daviid: str1ngs: is this code working? didn't test it ... daviid: str1ngs: in the doc, III. G-Golf Core Reference, Support, Enum str1ngs: daviid: this code works yes. but I'll will read about enum->value daviid: ok str1ngs: I guess I'm use to user enums in constructors which is simple. since you just use the symbol str1ngs: use* daviid: I meant to type enum->symbol str1ngs: okay will try that. thanks daviid: str1ngs: worth a quick lok to the enum/gi-enum doc daviid: *loock daviid: *look :) str1ngs: will do, thanks for the clarification daviid: wc! daviid: str1ngs: I am going to patch g-golf so that within the context of signals, you'll never have to call change-class again - working on it, will ping you ... daviid: str1ngs: pushed. you should now be able to remove the change-class calls, as in here - https://paste.debian.net/1159326/ str1ngs: daviid: great, will test it out first thing in the morning. daviid: sure, no hurry lloda: daviid: i saw your msgs about guile-cairo, but I don't know the processes those distros follow. They know where to find the newer version so I feel it's up to them... daviid: lloda: ok, i was just thinking to ping them maybe but i don't know either :) dsmith-work: Thursday Greetings, Guilers mwette: hi there kahiru: heya kahiru: anyone doing anything cool? ecraven: getting disillusioned with ansible ;) I wish I could get people to use guix instead str1ngs: sneek later tell daviid: both and work now. without using change-class. I only test 'decide-policy signal since that's the only signal I know of right now that does this. sneek: Okay. guix-vits: cool. kahiru: ecraven: I feel you ecraven: kahiru: it feels like they started a really nice project, and then stacked so many crates, that now everything is kind of brittle and almost ready to fall over ArneBab: ecraven: maybe you could write a tutorial "moving from ansible to Guix" ecraven: hehe, for that, I have to actually *move* to guix kahiru: to me it felt rather brittle since day 1 ecraven: I always preferred ansible over puppet, but now, I dislike both :P ArneBab: I moved to Guix 18 months ago. It was a rough journey, since I had to get proprietary stuff working there. ecraven: should try chef, just to make it three I don't like :D ArneBab: (for work) kahiru: I was always more of a salt guy ecraven: never tried that kahiru: you haven't really missed anything *: kahiru ducks in case there are some salt people around str1ngs: I use salt. :) dsmith-work: I generally don't use much salt, except on eggs.. ecraven: salt and butter on potatoes! *: str1ngs stomach growls dsmith-work: So, what is this "salt" thingy? topoi: What are the problems that made you desillusioned with ansible and puppet, ecraven? str1ngs: dsmith-work: it's for infrastructure automation like ansible ecraven: topoi: for ansible, it just seems like it has a nice core of features, and then they found things missing, and just piled them on willy-nilly str1ngs: dsmith-work: aka saltstack ecraven: for puppet, I like some of the things they did recently (types for parameters), but it just feels much "heavier" to use than ansible (and I much prefer a serverless solution, without a puppet master) topoi: ecraven: I already imagined the argument contra puppet. Regarding ansible: this phenomenon seems rather common. =) ecraven: I understand it, but it's not something I'd *want* in a tool such as this topoi: ecraven: Maybe there is some yet undiscovered rule of software bloat? =) But there must be _some_ userbase for those features? ecraven: it's not about the features, it's about *how* they are integrated topoi: In some inconsistend way? topoi: s/end/ent/ ecraven: to me, very much so ;) ArneBab: topoi: do you mean that whenever you don’t use emacs your tool grows until it has at least the features of Emacs and double the bloat? :-) topoi: =D ..that rule reminds me of Greenspun's tenth rule and seems surprisingly entangled. topoi: Citing the first sentence in the introduction of r6rs: "Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear nec-essary." topoi: :3 stis: hi guilers! dsmith-work: topoi: Yes indeed. jgart: what would be the best way to translate this bash snippet to idiomatic guile? $ find / -type d 2>/dev/null | shuf | tail -n 1 jgart: the above chooses a random directory from / jgart: pasting this one liner here again just in case the line length makes it hard to read: jgart: $ find / -type d 2>/dev/null | shuf | tail -n 1 ft: Probably something involving file-system-fold from (ice-9 ftw), build a directory list as you go, producing a random integer from 0 to length-of-list minus one, and list-ref to that. ft: Not sure if there's list-shuffling built in. If there is, you could do that and take the head of that. ft: Random number generators are in (srfi srfi-27). justin_smith: a cute option would be to ask the OS how many directories are allocated on each FS, do a weighted choice from the mount points, then rand-Nth directory under that choice jgart: ft, justin_smith thanks for your suggestions! I will give it a go leoprikler: as pointed out, rand-Nth suffices, but if you ever need to do list shuffling, just implement Fisher-Yates leoprikler: It's pretty straight-forward to do list->array and array->list conversions leoprikler: to do via* leoprikler: list->vector and vector->list ._. dsmith: Probably will be a fairly long list daviid: sneek: seen lloda sneek: lloda was in #guile 25 days ago, saying: (help) doesn't seem to like it when I export from a macro. daviid: sneek: later tell lloda I was thinking that you might want to ping the debian guile-cairo package maintainer, debian bullseye (testing), so even testing, stilll point to 1.10 ... fwiw sneek: Okay. peanutbutterandc: is there a way in guile for me to see the definition of a procedure in the repl? peanutbutterandc: this procedure might even be dynamically generated (i.e. the defintion does to come from a loaded file) str1ngs: peanutbutterandc: I find it easier to use geiser and M-. which is geiser-edit-symbol-at-point peanutbutterandc: str1ngs, Hey there! I am sorry, it seems this is some emacs spell and I am not yet well-versed in either emacs or guile. Being a relative beginner, I was hoping for something on the repl str1ngs: peanutbutterandc: I' str1ngs: peanutbutterandc: hello, I'm not sure how to do this in a REPL. str1ngs: peanutbutterandc: you don't have experience in emacs? str1ngs: peanutbutterandc: I'm still not sure how to do this from a REPL peanutbutterandc: str1ngs, Not much, sir. Except the usual writing and saving (becuase emacs formats scheme code really well - the indenting and all)... I see. guile seems to provide a ton of things at the repl. And so I was thinking that there might be something there str1ngs: peanutbutterandc: need to get some sleep. hopefully someone more knowledgeable can help. ttl peanutbutterandc: str1ngs, Thank you nevertheless. Good night roelj: So.. if I use http-post, and the response is a 302 redirect. Can something in the web modules follow the redirect? alextee[m]: Does guile have any musical libraries? alextee[m]: Like for processing revolving around musical chords roelj: Like creating sheet music? Or like producing sounds? alextee[m]: I guess if there's a c library you could guile-ify it though alextee[m]: roelj: taking in some notes and giving you a list of chords or scales they are in for example alextee[m]: Or some AI that suggests chord progressions based on the previous chord roelj: alextee[m]: Hm, there's https://git.elephly.net/?p=software/scales.git;a=summary bit it's a "starting point" at best for what you are looking for. :) alextee[m]: Hmm not quite what i'm looking for alextee[m]: I guess i'll look at github and if i dont find anything i'll write a C library, then use that fancy script to produce a Guile API alextee[m]: This! https://github.com/yuma-m/pychord bitwiz: alextee[m]: Lilypond has Guile scripting bitwiz: (...for making sheet music) alextee[m]: dont think lilypond has what im looking for bitwiz: Ah, just saw what you were asking for (something for number-crunching scales essentially). It would be an interesting project to implement directly in Guile alextee[m]: sounds much easier to do it in guile, but i want a C api too bitwiz: alextee[m]: Maybe there's a C/some other language version, that you could create C/Guile bindings for? That seems more likely bitwiz: Here's something in Python: https://github.com/gciruelos/musthe roelj: alextee[m]: You could also invoke Guile code from C if you want to turn things upside down :) bitwiz: Much more extensive, also in Python: https://github.com/cuthbertLab/music21/ alextee[m]: wouldn't that be slow if you need performance? alextee[m]: bitwiz: thanks, i also found 2 libraries in python that kinda similar things: http://chordrecognizer.sourceforge.net/ https://sourceforge.net/projects/scgen/ alextee[m]: not sure how to create c or guile bindings for python code roelj: alextee[m]: You get the speed of Guile.. If that's not fast enough, you could implement the performance-critical parts in C and call that from Guile. *: chrislck wonders what is the benefit of a superfast musical chord generator..... music isn't exactly a performance-critical industry..... roelj: chrislck: Perhaps if you want an AI to compose music, you could brute-force hits! *: str1ngs cranks up the techo! head bobs *: chrislck bobs head at 60Hz and counting.... chrislck: actually, my bad: music is all about *performance* chrislck: <-- slap alextee[m]: chrislck: there are workarounds and caching that can be done, but consider if you need to covert a chord into its MIDI notes during an audio processing cycle alextee[m]: calling another process or guile code is a no-no in that case. just an example roelj: alextee[m]: Oh I see, so you want to keep a low latency.. I don't have any metrics, but I can imagine that Guile's garbage collector may get in the way of low latency. *: chrislck nods in agreement alextee[m]: well, i'll probably write a C library, as i see there's none, and produce some guile bindings so you could write scripts to do some non-low-latency processing *: chrislck wants to port imgui to guile lloda: gonna commit the fix for https://lists.gnu.org/archive/html/bug-guile/2020-08/msg00010.html sneek: Welcome back lloda, you have 1 message! sneek: lloda, daviid says: I was thinking that you might want to ping the debian guile-cairo package maintainer, debian bullseye (testing), so even testing, stilll point to 1.10 ... fwiw lloda: wingo: if it's ok, it's a trivial thing lloda: leoprikler: there are functions array->list and list->array already which are type generic lloda: not sure that's what you meant leoprikler: maybe, but for fisher-yates conversion to/from vector is enough lloda: the patch for #42713 changes things a bit lloda: before you could call test-current-runner after test-end, but now that gives #f lloda: that seems correct to me but I was relying on the old behavior lloda: anyway, pushed str1ngs: sneek later tell daviid. can just check this snippet http://paste.debian.net/1159198. And make sure I'm getting the 'ok enum right for gtk-response-type. you can import it with (gi-import-by-name "Gtk" "ResponseType"). sneek: Will do. str1ngs: sneek: later tell daviid. I can help think there is a better way to do this. sneek: Okay. dsmith-work: UGT Greetings, Guilers str1ngs: hello dsmith-work chrislck: \./ chrislck: |o\ a_v_p: Guilers, is there a way to get rid of the REPL prompt altogether? guix-vits: IDK. In the meantime You can try `,option prompt ""`. guix-vits: a_v_p: ^^ a_v_p: guix-vits: Thanks! a_v_p: Guilers, I started a project called "Metabash". It's a Guile library that allows to run distributed processes connected by pipes similar to Unix pipes: https://github.com/artyom-poptsov/metabash a_v_p: Basically with Metabash one can run 1st process on host1.example.org, 2nd on the local machine and the 3rd on host2.example.org in one pipeline. a_v_p: I thought it would be fun to have such a facility for Guile. pkill9: cool a_v_p manumanumanu: sneek: later tell jgart I am the srfi-171 author. If you have any questions you can ask me here, or even better PM me. sneek: Okay. manumanumanu: sneek: later tell jgart but srfi-171 would be a bad choice. SRFI-158 would be a much better choice. sneek: Okay. guix-vits: bb dsmith: tinga: You are too deep in the tree tinga: Where should I be? dsmith: cd cag; cd ..; GUILE_LOAD_PATH=$(pwd) ...... tinga: aha tinga: Thanks, checking. dsmith: So for a module (foo bar) there must be a file "foo/bar.scm" visible from a dir in the load path. dsmith: Is if the path contians "/glork" then the files would be "/glork/foo/bar.scm" daviid: str1ngs: can you try the following 'decide-policy signal callback - https://paste.debian.net/1158910/ - and let me know, but here this works str1ngs: daviid: that works! why didn't I think to use change-class :( daviid: ok great str1ngs: that's an eloquent solution to this problem. daviid: w can only do that because the C pointer already been 'hiddenly' casted str1ngs: slightly off topic. I was trying to reason how best to handle exceptions in most signal. I though one catch should be enough what do you think. str1ngs: so change-class is pretty safe to use then? daviid: it is very safe in that callbac yes daviid: and any where the cast already happened 'in the back' str1ngs: okay great, this is a nice solution and should work for the other decide policies . daviid: yes, but again, only if the GObject instanc has been cast str1ngs: great, thanks for looking at this for me. I can delete some more C code now :) daviid: wrt exceptions, not sure - in the very few apps i wrote using guile-gnome and clutter, i never did that - if there is no bug in your callback code, what could possibly raise an exception str1ngs: you'd be surprised :) str1ngs: the main thing is I'd like to avoid a signal crashing the whole program. daviid: but what could cause this? str1ngs: in load-commit I have some logic that updates the mode-line. I've already found one bug with crylic text and uri conversion str1ngs: since some bugs you can not foresee, my impression with signals is it might be a good practice to guard them. keep in mind in nomad will have hooks like emacs, so users can extend things. so saving the program from termination is important daviid: i would only vry slectively do that - catch is expensive as well daviid: by the way, you should not block the compilation of your app code str1ngs: understandable. it's something I've just been mulling over. I've tried avoiding catch as much as possible. str1ngs: you mean block in a signal? daviid: no, passing --no-auto-compile str1ngs: I only use --no-auto-compile on some examples. and that's just to make sure nothing is compile cached. when I work on the Guix GI bug. daviid: you should only do that if the script installs in $prefix/bin and does absolutely nothing but call a proc from compiles modules ... str1ngs: thanks, I have a personal reason to use it in my examples. since I sometimes use it to debug GI on GUix daviid: ok str1ngs: the --no-auto-compile on $prefix/bin scripts is good advice thank you. daviid: wc! str1ngs: daviid: here's Nomad's more complete 'decide-policy signal. http://paste.debian.net/1158934 . note webkit-policy-decision-download does not actually download. it causes 'download-started to emit on the WebView's context. str1ngs: daviid: correction get-request should be webkit-navigation-action-get-request since its a procedure not a method. str1ngs: I assume that's correct because it takes a pointer as a argument not a daviid: ys proc do not have short names str1ngs: understandable. I assumed it was a method for some reason. RhodiumToad: hmm. tricky macro question: RhodiumToad: I want (foo (a b) (c) (d e)) to expand to (bar (a d) (b c e)) RhodiumToad: i.e. each element has one or two items, and I want a list of the first item of the two-item elements and a list of the last item of each peanutbutterandc: Hey there peanutbutterandc: Is it possible to (add-trace-at-procedure-call! ...) (from (system vm trap-state)) to a procedure that is defined inside another procedure (closure)? lampilelo: is there a standalone library for unit testing guile? mwette: sneek: later tell RhodiumToad https://paste.debian.net/1158996/ sneek: Got it. chrislck: mwette thanks for your (cond-expand (guile-3) (guile-2 )) trick - it worked well. mwette: yw dsmith-work: Tuesday Greetings, Guilers mwette: good day to you str1ngs: lampilelo: not exactly standalone there but there is (unit-test) that comes with guile-library str1ngs: or guile-lib depending on what distro you use. lampilelo: str1ngs: i've already set it up with the test suite from guile's source tree. is there a reason to use guile-lib? it seems kinda dead chrislck: lampilelo: srfi-64 is the defacto standard... str1ngs: lampilelo: I wouldn't consider it dead. (unit-test) is more unit tested based. one benefit of (unit-test) is the tests don't run simply by loading the file. so it really depends on your use case. lampilelo: chrislck: ah, i knew there was something else yet! i was surprised i couldn't find it in the manual but it's there, the reference is just a one-liner RhodiumToad: mwette: thanks, but I don't think that works for me - I need it to expand to literally (a b) not to an expression that results in (a b) sneek: RhodiumToad, you have 1 message! sneek: RhodiumToad, mwette says: https://paste.debian.net/1158996/ a_v_p: Hello Guilers! Is it possible to do bi-directional communication between a process started with 'open-input-output-pipe' and the main process? a_v_p: I mean, I try to write a set of lines to 'sort' command and then read the sorted lines, but reading from the port blocks as soon as I try to read anything. dsmith-work: Yeah, that's gonna be tough. dsmith-work: Sort needs to read all it's input, right? justin_smith: a_v_p: the classic gotcha is trying to read from the process before flushing data the process is trying to read justin_smith: and yeah, it might be that it won't provide any output until its input is closed (for a sorting program that's a requirement!) dsmith-work: So sort wants to see EOF on it's input before it sends anything. justin_smith: grep will give you partial results as long as input flushes, sort can't possibly do so, because its problem domain makes it impossible dsmith-work: Consider that the last line you send might need to be the first out. dsmith-work: Seems like there have been more pipe questions in the last month than in the previos 10 years. a_v_p: justin_smith: Thanks, I tried to send an EOF object but problem is that the port immediately closes on EOF. a_v_p: Or it doesn't. a_v_p: Well, I figured out how to accomplish what I want with named pipes a.k.a FIFOs. str1ngs: RhodiumToad: I might have missed your example. do you mind pasting it again. thanks for the help by the way. RhodiumToad: https://dpaste.org/jQo1 str1ngs: RhodiumToad: great I will check this out thanks. datum->syntax is new to me. str1ngs: will read the docs though str1ngs: RhodiumToad: thanks this helped particularly the data->syntax str1ngs: * datum->syntax RhodiumToad: (also #`(... #, ...) is like `(... , ...) but for syntax trees rather than ordinary data, but I assume that is obvious) str1ngs: not so obvious to this noob. but I have seen that syntax before. my skills at quoting are only at `(... , ...) :) cyclopsian: is there a proper way to catch an exception (to add some metadata) and then rethrow it while preserving the original stack trace? RhodiumToad: that might depend on the guile version - are you looking at some version in particular? cyclopsian: I'm on 3.0.4 RhodiumToad: so if I understand it right, in a with-exception-handler that doesn't specify unwinding, then raising any other exception will keep the same stacktrace as the original one wklew: Hi guile, I'm working on a library for probabilistic programming and thought I'd share here: https://git.sr.ht/~wklew/guile-hansei wklew: I just finished the tutorial in the readme and would love some feedback, esp. people who are new to the concepts discussed wklew: it's based on an OCaml library by oleg kiselyov jgart: do guile have something like "repeatedly"? https://docs.hylang.org/en/stable/language/core.html?highlight=partition#repeatedly jgart: *does RhodiumToad: it doesn't have a native concept of that kind of iterator, afaik RhodiumToad: there are primitives from which such things can be constructed jgart: RhodiumToad, do you know off hand what primitives might be good candidates to construct repeatedly? RhodiumToad: you might see srfi-171 and srfi-158 (guile3 has the former but not the latter) RhodiumToad: even with just srfi-171, you can do things like (generator-transduce (ttake 5) rcons (const 1)) RhodiumToad: the (const 1) can be replaced by any function, and it will be called repeatedly RhodiumToad: e.g. (generator-transduce (ttake 5) rcons (lambda () (random 10))) returns a list of 5 random numbers jgart: RhodiumToad, thank you and thanks for the example! I'm reading more about srfi-171 here: https://www.gnu.org/software/guile/manual/html_node/SRFI_002d171.html cyclopsian: hmm, with-exception-handler does work, but now my issue is there is no easy way to do that from a C function cyclopsian: is there a reason that everything in exceptions.h is marked internal? cyclopsian: it looks like those are what should be used externally now in 3.0+ RhodiumToad: that'd probably be a question for wingo *: RhodiumToad does not know cyclopsian: thanks for the help, that pointed me in the right direction :) pkill9: if i run `guix repl`, (%package-module-path) includes extra channels, but when run with guile it doesn't, anyone familiar with guix know why? notvivi: hello leoprikler: pkill9: that'd be different from guile itself is no real surprise, since guix does load a lot of modules that guile on its own would not leoprikler: I don't know an answer to 42688 however, which is started with guix repl leoprikler: interestingly though, ignore-dot-guile is forced to #t when loading scripts leoprikler: perhaps that's an issue dsmith-work: Hey Hi Howdy, Guilers a_v_p: wingo: Hello! wingolog.org TLS certificate has expired on July 30. ArneBab: RhodiumToad: why do you need (lambda () …); doesn’t (λ _ …) work? Is it to make it explicit that the proc cannot take any arguments? (because ((λ _ #t) 'arg) works, but ((λ () #t) 'arg) does not) RhodiumToad: the () makes the lack of args explicit, yes jgart: Hi, I have these guile modules but I am not able to load module sg1 in the module pc-ops https://notabug.org/ccao001/gac jgart: Any help is greatly appreciated jgart: Am I loading the modules incorrectly? jgart: I want to do for example (transpose-all %trichords) in the pc-ops.scm file %trichords is in sg1.scm jgart: or how do I load the the module(s) from the guile repl rekado: jgart: the module names are (gac sg1) and (gac pc-ops), so these files are expected to be found in gac/sg1.scm and gac/pc-ops.scm, respectively. rekado: the directory containing the “gac” directory should be listed in the list of colon-separated directories in the GUILE_LOAD_PATH environment variable. tinga: rekado, cd gac; GUILE_LOAD_PATH=`pwd` guile then (load-from-path "pc-ops.scm") yields "no code for module (gac sg1)". How comes? daviid: tinga: jgart: 6.20.4 Modules and the File System RhodiumToad: https://dpaste.org/Yosa RhodiumToad: main bug is that it won't free the string if pointer->string errors daviid: str1ngs: this, imo, is a bug in webkitgtk and/or its GI typelib def - I exposed in depth why i think it is and how to solve it, on #introspectin ... i'm still thinking on the best way to 'workaround', will ping you asap *: RhodiumToad wonders if there's a better way to handle functions returning malloc'd strings in the ffi RhodiumToad: w00t. so tests pass with GUILE_JIT_THRESHOLD=1 on freebsd/armv7 RhodiumToad: still needs one small patch for correct off_t handling RhodiumToad: (gen-scmconfig doesn't seem to contemplate the possibility that off_t might be bigger than a long) str1ngs: daviid: okay, thanks for the update. chrislck: anyone familiar with srfis on https://github.com/scheme-requests-for-implementation/srfi-180/ ??? how to load it in guile??? leoprikler: you'd probably need to write a wrapper around it chrislck: any example somewhere? leoprikler: SSAX in the base library, but it should be a bit simpler leoprikler: but basically, you need to do a (define-module ...) followed by (include ...) chrislck: still difficult. no easy examples found :( a_v_p: Guile-Udev update: I made a better version of procedure that creates an udev monitor instance: https://github.com/artyom-poptsov/guile-udev/blob/dd0c859e3985173b722b5003d1f33fdbd5b9b329/examples/device-listener.scm#L16 chrislck: what's the safest way of running code *only* when guile-2.2 or guile-2.0 is being called? https://paste.debian.net/1158670/ doesn't seem to cut it mwette: I think you need something like (cond-expand (guile-3 (quit)) (guile-2 #t) (else (quit)) ;; the else may be optional) mwette: sorry I though entire module, then (cond-expand (guile-2 ) (else #t)) leoprikler: I think the define might be malformed mwette: any why the eval-when? I don't think that's needed. mwette: s/any/And/ mwette: Maybe this, then: (cond-expand (guile-3) (guile-2 ) (else)) chrislck: thanks both, will try :) pkill9: why does this return '("test2 "test3")? (assoc-ref '(("test" "test2" "test3")) "test") ArneBab: RhodiumToad: nice! pkill9: actually, why does this return '(("test" "test2" "test3"))?: (pretty-print '(("test" . ("test2" "test3")))) str1ngs: pkill9: assoc-ref takes an alist. like (assoc-ref '(("test" . "foo")) "test") str1ngs: pkill9: basically it takes a list of pairs pkill9: i get that, but why does it turn multiple values into a list? pkill9: if there is more than two values pkill9: instead of erroring or something ArneBab: pkill9: try it without pretty-print ArneBab: pkill9: remember that (a . b) is just a shorthand for (cons a b) pkill9: oh ok *: ArneBab also stumbled over this a few times :-) pkill9: why has that period been made shorthand for cons? ArneBab: AFAIK because you can then write cons-cels as data ArneBab: try '("test" "test2" . "test3") ArneBab: (a . b) with a and b as primitive values is a pair, but not a list. ArneBab: '(a b) is a proper list. ArneBab: (cons a ) gives a list ArneBab: (cons a ) gives a pair ArneBab: AFAIK pairs consume slightly less space because they save one pointer dsmith: pkill9: I don't know for sure, but I suspect using . for cons'es has been around about as long as there has been lisp. mwette: (list "test" "test2" "test3") = (cons "test" . (list "test2" "test3")) mwette: oops remove '.' mwette: (list "test" "test2" "test3") = (cons "test" (list "test2" "test3")) leoprikler: (list "test" "test2" "test3") = (cons "test" (list "test2" "test3")) = ("test" . ("test2" "test3") ) manumanumanu: Ahoy hoy! RhodiumToad: I think the only thing that really irritates me about scheme (vs lisp) is having to use () rather than nil RhodiumToad: especially in the form (lambda nil ...) str1ngs: hello I'm trying to write this define-macro as a define-syntax but it's just not groking for me. (define-macro (call-javascript js) str1ngs: `(run-javascript (buffer-widget buffer) ,js #f #f #f)) str1ngs: I'm assuming this can be done with define-syntax since define-macro is not recommended anymore? str1ngs: (define-macro (call-javascript js) `(run-javascript (buffer-widget buffer) ,js #f #f #f)) str1ngs: my example got truncated sorry RhodiumToad: where are buffer-widget and buffer going to come from? str1ngs: I want (call-javascript "alert();")) to expand to (run-javascript (buffer-widget buffer) "alert();" #f #f #f)) I'm just trying to avoid alot of repeated code. str1ngs: I guess I want to template here? is that the right term? RhodiumToad: right but the question is, is it ok for buffer-widget and buffer to be resolved in the lexical context of the define-syntax, rather than that of the expansion? str1ngs: I'd like to evaluate where the macro is called doe that makes. my macros skill are weak. this is actually an exercise to better understand on my part. str1ngs: s/makes/make senses/ RhodiumToad: so the core distinction between lisp-style defmacros and scheme define-syntax is how the lexical bindings work RhodiumToad: the intention is that in scheme, all free variables resolve in their lexical contexts RhodiumToad: so basically you've picked a non-trivial example to use as an exercise RhodiumToad: if I'm understanding it right, which is by no means certain, you can do it like this: RhodiumToad: https://dpaste.org/jQo1 RhodiumToad: the use of datum->syntax is to construct new syntax in the lexical scope of the caller RhodiumToad: str1ngs: ^^ that help? jgart: how can I accumulate a list of lists by adding 1 to '(0 1 2) recursively until I reach 12 iterations of that process? jgart: Here is an example of my input and output jgart: https://paste.debian.net/1158511/ jgart: any help is greatly appreciated jgart: (map 1+ '(0 1 2)) would give me just the first output: (1 2 3) mwette: (let loop ((res '()) (i1 0) (i2 1) (i3 3) (cnt 12)) (if (zero? cnt) res (loop (cons (list i1 i2 i3) res) (1+ i1) (1+ i2) (1+ i3) (1- cnt)))) mwette: "(if (zero? cnt) res" => (if (zero? cnt) (reverse res)" RhodiumToad: why recursively? RhodiumToad: (map (lambda (i) (list i (remainder (+ 1 i) 12) (remainder (+ 2 i) 12))) (iota 12)) mwette: either works; I guess the named let is faster. RhodiumToad: if the (0 1 2) is actually an argument and could be anything, then how about RhodiumToad: (define (transpositions l) (letrec ((rot (lambda (o) (map (lambda (e) (remainder (+ o e) 12)) l)))) (map rot (iota 12)))) jgart: Thank you RhodiumToad and mwette for the answers! jgart: I also got this way of solving it from #scheme irc jgart: (unfold (lambda (xs) (= (car xs) BOUND)) values (lambda (xs) (map 1+ xs)) '(0 1 2)) jgart: zaifir shared that jgart: but his solution doesn't account for the modulo 12 wrapping jgart: I can add that jgart: RhodiumToad, I will try you last above now with letrec jgart: thanks alot! jgart: RhodiumToad, I imagined it could be solved recursively but wasn't sure. Iteratively recursive call is fine too? RhodiumToad: for a well-defined number of iterations, recursion seems overkill RhodiumToad: in my example I'm using (iota n) to generate the n-element list RhodiumToad: also the letrec there is out of habit, any binding form would work RhodiumToad: some people would have used a local (define) jgart: the lists that I would need to generate the "transpositions" for in the end won't be so easily formalized so to generated jgart: Here is one such complete list: https://paste.debian.net/1158515/ RhodiumToad: that's the input? jgart: RhodiumToad, but I appreciate you elegant solution for generating '(0 1 2) jgart: eventually that will be the input RhodiumToad: and for each of those elements, you want a 12-element list result? jgart: each indexed list will need to be transposed 12 times jgart: yes exactly RhodiumToad: so (map transpositions 3-1) RhodiumToad: using the one above with the letrec etc. jgart: those are the equal-tempered pitch class sets of cardinality 3 (i.e. musical three-note chords) https://en.wikipedia.org/wiki/List_of_pitch-class_sets jgart: RhodiumToad, Ok I will try now jgart: thanks! RhodiumToad: interesting, I wondered why the mod 12 jgart: mod 12 because I want to model the pitch-class domain https://en.wikipedia.org/wiki/Pitch_class jgart: there are only 12 pitch classes but many pitches that are multiples of those 12 RhodiumToad: ya, I know jgart: sorry if I was two pedantic with the above. Just wanted to clarify the relationship of pitch and pitch-class jgart: RhodiumToad, thank you so much! I just tried your code jgart: that's exactly what I wanted (i.e. (map transpositions 3-1)) jgart: very elegant solution! jgart: I will now try to study your solution so that I can assimilate what you just did. Great! jgart: RhodiumToad, I owe you a virtual beer RhodiumToad: it makes sense to you? jgart: so I can you plain let instead of letrec in your procedure? jgart: RhodiumToad, not yet jgart: trying to read through it and follow the flow of execution to see everything that happens jgart: I have a general intuition for what is happening RhodiumToad: in this example any binding form would be fine. I just use letrec out of habit when binding procedures rather than values RhodiumToad: a local (define) would work too, e.g. jgart: why do you use letrec when binding procedures? jgart: I'm still not practiced in using letrec RhodiumToad: (define (transpositions l) (define (rot o) (map (lambda (e) (remainder (+ o e) 12)) l)) (map rot (iota 12))) jgart: ohh ok a nested (define) jgart: maybe that way is clearer to me for now RhodiumToad: letrec allows the bindings to reference themselves, the same way a (define) would jgart: right, where let does not RhodiumToad: i.e. (letrec ((foo (lambda ... (stuff here can reference "foo" for recursive calls)))) ...) jgart: let* also allows recursive calls? RhodiumToad: no, let* makes each binding visible to the following bindings, but not to itself. RhodiumToad: for both let and letrec, bindings are not visible to other bindings in the same form. RhodiumToad: there's also a letrec* jgart: right, I'm seeing that here: https://www.gnu.org/software/guile/manual/html_node/Local-Bindings.html RhodiumToad: letrec is normally not used for data because although the bindings are visible, it's not safe to actually try and access the values during binding initialization RhodiumToad: that's ok for functions, since you're not going to actually call the functions until you're in the body, hopefully (and letrec* is available for when that's not the case) RhodiumToad: the only real subtlety in this code is the use of l and o from inside (rot) jgart: rot is short for rotations? RhodiumToad: rename it as you choose, but yes *: RhodiumToad didn't know what the data was representing when writing that jgart: and "o" and "e" in the lambdas where chosen arbitrarily? jgart: no worries! I'm still working this all out myself RhodiumToad: all identifier names are arbitrary. jgart: RhodiumToad, right jgart: ok, makes sense RhodiumToad: the point in this case is that we're using the lexically outer definition of "l" (as a parameter of (transpositions) within the body of the nested define, RhodiumToad: and in turn within the innermost (lambda) we have a lexical reference to "o" RhodiumToad: so within the scope of a single call to (transpositions) with some list as parameter, (rot 1) returns that list with all the values rotated by 1, etc. jgart: the map with lambda having single parameter "e" is consuming the "l" from transpositions RhodiumToad: yes jgart: very elegant! jgart: thank you RhodiumToad! I'm off to take a walk before sunset. Maybe I'll see you in this chat later. Thanks again! pkill9: how do you test if a given list is an association-list? daviid: i thought i did succeed in programatically (dynamically) perform the same as what is acheived by the #:replace define-module 'option', such as for example, in the (g-golf hl-api signal) connect variable name, which is bind in guile core and needs to be transformed into a generic function - however, what i have seems to have weird corner cases daviid: here is an example of what worksd, and a 'symptom' of what is or may be a problem daviid: if you launch a repl and enter connect, guile tels you it is a procedure, here # chrislck: pkill9: you need to understand how to compare lists first chrislck: (member lst assoc-list) is the simplest one daviid: if you ,use (g-golf) and try that again, you'll see it became a generic function, with teo methods -| $3 = #< connect (2)> - which exactly what is expected daviid: now, if you import GtkWindow, g-golf should do the same for short name methods, for example close, which the short name method for gtk-window-close daviid: (gi-import-by-name "Gtk" "Window") -| #< 562742d87900> daviid: however, close -| # daviid: but it should be a generic function, which it is, but in the (g-golf hl-api gobject) 'only' [it did not replace, as i thought it would, the (current-module) binding] (@@ (g-golf hl-api gobject) close) -| $6 = #< close (2)> daviid: the code that does the machinery is here - http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/function.scm?h=devel - lines 247 - 275, and the specifric case for replacing a core or current-module binding is in lines 261 - 270 daviid: if anyone is willing to help .. well, tx! daviid: what is weird is if you drop the following code - https://paste.gnome.org/pxw4m80m5 - in say 'hello-world.scm', chmod a+x and run it, _without_ any opned guile repl 'anywhere', it will compile execute and display i the terminal these lines (from the dimfi call, which is sort of a peek proc in g-golf ...) daviid: ;; # daviid: ;; #< close (2)> daviid: daviid: but if you launch a guile repl, 'leave it' running, then try the same hello-world example again, if fails displaying these daviid: ; # daviid: ;; # daviid: daviid: and then if you click the quit button, raises an exception of course, since it runs the core close proc over the window, instead of the appopriate method ... str1ngs: daviid when you have a sec can you take a look at the 'decide-policy signal in this example. http://paste.debian.net/1158525 . I tried to simplify this example as much as possible. run the script then and click on the Try it yourself button in the web page. this call some JavaScript to request a link in a new tab.. This use to work for me but now longer works. here is the documentation for the decide policy str1ngs: signal. https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-decide-policy My guess is WebKitPolicyDecision does not have the methods that WebKitNavigationPolicyDecision does. daviid: str1ngs: will take a look asap str1ngs: daviid: I'm reading the channel backlog maybe I can look into that abit. str1ngs: daviid: I could'nt get (run-javascript "window.open('https://gnu.org');" #f #f #f) so the example is more complicated then needed. probably the javascript world won't allow for window.open so you'll just have to click the link. applogies daviid: str1ngs: give me a bit of time, i actually have to clone g-golf to try your example :) because i am in the middle of this giinterface refactoring and your example neeeds those ... str1ngs: daviid: if this is something you are aware of it's not a rush. I can work around it for now. mainly i'ts used to create a new when a link requests a new tab. str1ngs: daviid I'm reading channel backlog seeing if I can grok they problem you are having daviid: str1ngs: the example works, i click, nothing happens, but no bug either ... str1ngs: daviid: check the terminal output I have catch that outputs the error daviid: nothing in ther temnal either daviid: david@capac:~/alto/projects/g-golf/examples 92 $ ./decide-policy.scm daviid: daviid: and the window with the example 'is there' str1ngs: you should see something like str1ngs: New Tab requested! str1ngs: Error: key: goops-error str1ngs: you click the Try this green button to execute the javascript? daviid: no 'try this green button' here str1ngs: it's in the browser window daviid: ah, didn't see that daviid: ok daviid: i can see the bug now str1ngs: it's okay I tried to example in the lable. str1ngs: err label* str1ngs: I could'nt just call the javacript manuall sorry I needed to use a link. so made the example more complex then I wanted. daviid: but i need to understand where is the callback code for this button str1ngs: the callback is decide-policy daviid: ok str1ngs: when something like window.open("https://gnu.org"); it requests to open the link in a new window. in nomad I just open the link in a new buffer. daviid: this seems to be called a million times, so to spea str1ngs: if I don't handle the decide-policy the click gets ignored. str1ngs: the only type I'm worried about is new-window-action str1ngs: also download action later. str1ngs: in C you need to cast WebKitPolicyDecision to WebKitNavigationPolicyDecision. see WebKitNavigationPolicyDecision str1ngs: err https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-decide-policy str1ngs: I could just make a C helper function vi GI. to cast the types. that should get around it quickly if you are too busy daviid: str1ngs: i'm trying to understand why ... and what it seems to be is a webkit-policy-decision> instance is not what webkit-navigation-policy-decision-get-navigation-action expect as its frist arg daviid: you have to understand that i know nothong, or next to nothing about webkitgtk itself, so i'm in 'unknowen water' ... i'm fine, but it's not as i knew the answer out of my head just looking at it ... daviid: importing WebKit2 is not instantaneous, you might wna selectively import things there too .. just saying str1ngs: I'm pretty confident this worked at one point. this is the code in nomad as is. http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/gtk/widget.scm?h=feature-g-golf#n172 daviid: i can't find the method def for webkit-navigation-policy-decision-get-navigation-action str1ngs: you can't find the method in g-golf? daviid: str1ngs: it could be yes - we need to find out why, when ... which commit ... daviid: no i can find t, the doc daviid: get-navigation-action daviid: $3 = #< get-navigation-action (1)> str1ngs: oh the doc, I can find that one sec daviid: actually, wait a sec str1ngs: https://webkitgtk.org/reference/webkit2gtk/stable/WebKitNavigationPolicyDecision.html for WebKitNavigationPolicyDecision daviid: let'1s see what tha cache expect daviid: so, that method expects a WebKitNavigationPolicyDecision daviid: but the example you paste pass a webkit-policy-decision>, which a super class instance daviid: that won't work in goops daviid: this is a very 'ruff' look at things daviid: we can digg further of course daviid: this why you need to cast in C by the way str1ngs: daviid: this reminds me of the gdk event thing str1ngs: similar special case anyways. daviid: (describe get-navigation-action) daviid: get-navigation-action is a generic function. It's an instance of . daviid: Methods defined for get-navigation-action daviid: Method #< () 55a76ca50840> daviid: Specializers: str1ngs: daviid: btw in your hello-world.scm if you change to exec guile --no-auto-compile -e main -s "$0" "$@" it becomes consistent ;; #< close (2)> so it some compile bug str1ngs: or compile cache issue daviid: but in your example, you pass a daviid: str1ngs: i don't think it is, but ... let's focus on one thing at a time :) str1ngs: right in C you would cast this with WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision); str1ngs: with --no-auto-compile I have consistent < close (2)> just a FYI daviid: in g-golf, is undefined, even after importeng the all webkitgtk daviid: it is a struct, not a 'real' gobject subclass daviid: it seems str1ngs: scheme@(guile-user)> str1ngs: $1 = #< 55ab020cbc00> str1ngs: when I use (gi-import "WebKit2") daviid: oh, tipo on my side str1ngs: I got worried and though we had different WebKitGtk versions or something haha daviid: (make ) daviid: $5 = #< 55a76e2145e0> daviid: scheme@(guile-user)> (get-navigation-action $5) daviid: $6 = #f daviid: but str1ngs: “navigation-action” property might not be set with make daviid: str1ngs: yes i was just 'playing ' with goops ... str1ngs: though #f is not a goops-error at least :) daviid: but i was passing the right argument daviid: to show you ... str1ngs: I can meant time just use C helper function that takes WebKitPolicyDecision and casts then returns WebKitNavigationPolicyDecision. it's pretty simple to do str1ngs: return WEBKIT_NAVIGATION_POLICY_DECISION (decision); should do it daviid: but it would be nice to understand and solve in scheme to ... str1ngs: I hear ya. I don't know what part of g-golf this effects. it's not related to interfaces I gues? daviid: need to ask on #introspection daviid: what is 'casting' a type for another, internally, so we can maybe do it in scheme str1ngs: in gtk they use C macros to cast types. so WebKitNavigationPolicyDecision has WEBKIT_NAVIGATION_POLICY_DECISION daviid: did ask daviid: it is difficult for me to ask about things i don't know ... let's see daviid: you are on #introspection as well str1ngs: WEBKIT_NAVIGATION_POLICY_DECISION is basically (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_NAVIGATION_POLICY_DECISION, WebKitNavigationPolicyDecision)) str1ngs: I need to connect to znc one sec daviid: i see your name there... daviid: i thought you were already str1ngs: daviid: technically I'am and I get messages. but I don't always connect via znc. reading the backlog now. str1ngs: ebassi comments on quit() is useful str1ngs: unrelated of course :) str1ngs: daviid: probably for GI we should not cast. since language binding more then likely can't handle something like that normally. I guess #introspection can suggest how to do this. daviid: mean while i have an idea daviid: we/you could grab the g-inst slot value of the decision arg and use it to make a instance daviid: then pass that to get-navigation-action daviid: that didn't work daviid: the pointer points to a webkit-policy-decision and needs to be cast daviid: that's total heresy daviid: :) daviid: str1ngs: by the way you ned to import goops before to set the duplicate handler, then import g-golf ... str1ngs: my example my need updating. normally I use goops via define-module anyways daviid: str1ngs: can you write, in your code, a casting func in C, so we could try? str1ngs: daviid: I'm looking at that now daviid: we could then try thiski str1ngs: two secs daviid: (np-decision (make daviid: #:g-inst (cast-to-wnpd (!g-inst decision)))) daviid: in the let of the callback ... str1ngs: hmm for somereason when I GI return WebKitNavigationPolicyDecision * it returns str1ngs: let me try with your variant though daviid: you should only cast the pointer daviid: str1ngs: then youwould try this https://paste.gnome.org/pt932ar4m daviid: if you write the C func cast2wnpd str1ngs: I'm doing this via GI so I don't need to use !g-inst str1ngs: g-golf is already pasing the pointer daviid: you need to cast the gobject instance pointed by ... daviid: you cn't just take the instance and make a using it ... it will complain 'just the same way' ... str1ngs: http://paste.debian.net/1158528 when called with g-golf (dimfi (nomad-get-navigation-policy decision)) returns which is really od. str1ngs: odd* str1ngs: returns ;; #< 55606bc3a4a0> str1ngs: daviid: I'm passing decicsion through g-golf via GI then I'm casing in C daviid: how about what you suggested above? (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_NAVIGATION_POLICY_DECISION daviid: can you cast and check the type in C before to return? str1ngs: I'll check the type but WEBKIT_NAVIGATION_POLICY_DECISION casts to WebKitPolicyDecision to WebKitNavigationPolicyDecision daviid: ok then if you (make #:g-inst (nomad_get_navigation_policy (!g-inst decision))) it should work str1ngs: no, I'm calling the C code via g-golf not guile C. so g-golf passes the pointers str1ngs: (nomad_get_navigation_policy decision) should return webkit-navigation-policy-decision str1ngs: err str1ngs: (dimfi (nomad-get-navigation-policy decision)) works just it's returning despite the C function casing with return WEBKIT_NAVIGATION_POLICY_DECISION (decision); str1ngs: so maybe it's only seeing the parent class here? str1ngs: g-golf that is? str1ngs: I could maybe use guile scheme and use pointers. str1ngs: err guile C daviid: I would try to write and ffi a cast2wnpd C snipset, then try what i proposed daviid: if that works, we can dig on your approach, which i know is more 'beautiful' ... but one step at a time daviid: i think daviid: you can patch libg-golf.c[h] just to see if it works daviid: str1ngs: can you describe (gi-cache-ref 'function nomad-get-navigation-policy) and see whast its return arg is? str1ngs: daviid: one sec str1ngs: daviid: that returns #f but nomad-get-navigation-policy returns $4 = # daviid: i thought you were using GI to import it str1ngs: Iam I use (gi-import "Nomad") daviid: hum daviid: then it is in the cache daviid: maybe a tipo? daviid: (gi-cache-ref 'function 'nomad-get-navigation-policy) daviid: a tipo ... str1ngs: $2 = #< 563f85f5a540> daviid: ok, now describe daviid: it str1ngs: seems to be g-golf is using the parent class and not the child class str1ngs: describe output http://paste.debian.net/1158531 daviid: so, this is correct daviid: return-type = interface daviid: type-desc = (object #f 94830832738512 #f) daviid: if you call it, it should retur an instance of str1ngs: right but when I pass decision it still returns ;; #< 55be92345720> str1ngs: (dimfi (nomad-get-navigation-policy decision)) str1ngs: if I cast and C then get the uri string. and return cons *gchar I get the uri str1ngs: http://paste.debian.net/1158532 returns the uri for the new tab daviid: you still have the same repl you used to describe the function? daviid: so you could try (g-type-name 94830832738512)? str1ngs: I don't have the same repl str1ngs: where does 94830832738512 come from. that segfaults for me daviid: yeah, those types are dynamic daviid: in the paste of the describe ... str1ngs: it's in type-desc right? daviid: yes str1ngs: ah okay one sec daviid: i just don't know why your function does return a wrong instance str1ngs: (g-type-name 94389096412128) str1ngs: $3 = "WebKitPolicyDecision" daviid: that is why str1ngs: one sec str1ngs: I use the wrong function str1ngs: gahh I took the wront type-desc daviid: ok str1ngs: (g-type-name 94389096412384) str1ngs: $6 = "WebKitNavigationPolicyDecision" str1ngs: looks right now daviid: yes that looks correct str1ngs: dunno :( daviid: i can't try, that is a problem :) str1ngs: I'll just get the uri from C for now. I'm not sure why this is'nt working it did work at one point. daviid: the code that returns the value is here str1ngs: I don't think the function returns the wrong type. it seems g-golf is handling correctly for some reason. str1ngs: not handling* str1ngs: maybe because it's an interface? daviid: no, these are 'object (GObject subclasses) daviid: the problem is i can't try, it doens't help :) daviid: the code that returns theinstance is here daviid: http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/function.scm?h=devel str1ngs: this function does need a transfer GI annotation. which I use Returns: (transfer full): daviid: line 1126 to 1132 str1ngs: what do you need to try? daviid: now, can you add a line there, after 1129 daviid: (dimfi class name g-type) daviid: before the line (set! (!type-desc funarg) ... daviid: man debugging this way is the worst situation of my carrer, ever str1ngs: ;; #< 562988e32e40> 94736371323440 str1ngs: when I call (nomad-get-navigation-policy decision) str1ngs: debugging what way? str1ngs: I gave the example that cause issues. my helper function is was just to be a work around. be are getting side track. but I suspect it suffers from the same issue. daviid: ok, if you call it again, it shold prit these lines anymore, can tyou trry that str1ngs: as far as i can see it only prints it once daviid: ok daviid: what it printed, is the class of the instance it returns daviid: so, the call shoud return an instance of ;; #< daviid: 562988e32e40> 94736371323440 str1ngs: right yet (dimfi (nomad-get-navigation-policy decision)) returns ;; #< 5631a6ed45c0> daviid: you can see by yourself there is no other way, the instance is made line 1132 daviid: using the class argument, defined by (g-object-find-class foreign) daviid: which returns the above ... str1ngs: well it returns daviid: it returns either the reuslt of the line 1127 or 1132 str1ngs: anyways we are getting side tracked with this function. lets assume it's the function's fault. I still need to get a . if not I can just extend the C to return the URI daviid: str1ngs: i want to debug, i can not try daviid: as i said the worst situation ever daviid: if i could try daviid: can you try this str1ngs: you can use the example I gave you. the C helper function is just a work around really daviid: i can't, i don't have your naoad cast daviid: we are debugging that call str1ngs: right but but I can just extend the C function to return the value I really need which is the URI str1ngs: that does nothing to help for scheme in the long run though. str1ngs: I can push the to a branch if it helps daviid: str1ngs: to try i would need to be abe to do str1ngs: daviid: I pushed to decision-policy branch of nomad if it helps str1ngs: ./pre-inst-env guile will give you a repl. and (gi-import "Nomad") imports the nomad namespace. str1ngs: make run starts a development browser daviid: str1ngs: i'm not going to do that daviid: to much str1ngs: you will need emacsy and shround though to build. the rest of the dependencies are in debina. str1ngs: well if you can't take time to build nomad. I don't know what to say. str1ngs: I'll work around the issue in C. meantime you can figure out why the example does not work. daviid: we know why the exmple does not work daviid: it needs a cast daviid: you write the cast in nomad, i cvan'1yt try it daviid: sorry str1ngs: no, casting is a C concept GI bindings normally do not cast. I could write this example in GIJS and pygobject and I'm confident that they are not going to cast. in fact this code worked then stopped working. I'm just reporting the issue to you. daviid: it needs a cast you can't just pass the pointer you have from the decision instance daviid: you can try yourself, as i did paste earleri, doing daviid: (get-navigation-action (make (!g-inst decision))) will rise an exception ... str1ngs: daviid: if you use this http://paste.debian.net/1158534 example with g-golf @ hash 30148389eed34a06f16e679be9ae59d9782d559f it will work. so somewhere between that hash and HEAD something broke. str1ngs: I just switched to long names the example is the same as before daviid: ok will look at this peanutbutterandc: Hello there. Is anybody here today? I have noticed that during the weekends the channel tends to get relatively quiter peanutbutterandc: s/quiter/quieter/ *: RhodiumToad is here peanutbutterandc: RhodiumToad, Hello there! :) I needed some help regarding this: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42574 peanutbutterandc: It is just a small issue (some mis-step on my part) I'm sure. peanutbutterandc: And I'd really like to be able to trace some of the recursive procedures that I am learning. I'd really appreciate a few pointers daviid: str1ngs: i found why it did work and now it's not RhodiumToad: peanutbutterandc: that does look like a bug str1ngs: daviid: okay is it an easy fix? daviid: no, but let me confirm a few things nhere first peanutbutterandc: RhodiumToad, I was hoping it would be just my mis-step... does it look like a simple bug, sir? Or would it requier some serious debugging? peanutbutterandc: s/requier/require/ str1ngs: daviid: if it's not an easy fix. I can work around it. atleast you are aware of the problem now. peanutbutterandc: RhodiumToad, Also, it seemed to me that after a call to (trace-calls-to-procedure proc1) (proc1 x y z) ought to be traced no matter what. They aren't. (Or perhaps my expecations aren't correct?) daviid: str1ngs: well, the problem is it should not 'have worked' RhodiumToad: hmm. RhodiumToad: ;; Note that because this procedure manipulates the VM trace level RhodiumToad: ;; directly, it doesn't compose well with traps at the REPL. daviid: and now properly fails ... though i still need to try a few things before i can explain why and how to address these situations in newer versions of g-golf ... str1ngs: daviid: strange str1ngs: well I just use a C function to handle this meantime peanutbutterandc: RhodiumToad, I see that you are on the case, Mr. Holmes. RhodiumToad: that may be a red herring. RhodiumToad: the bug may, in fact, be very simple. RhodiumToad: aha. RhodiumToad: trace-calls-to-procedure has this: (define (return-handler frame depth values) str1ngs: daviid: I revised my C function. instead of getting a WebKitNavigationPolicyDecision I'm just returning a WebKitNavigationAction. see http://paste.debian.net/1158538 RhodiumToad: simply removing the "values" arg makes it work. RhodiumToad: looking at the place where that handler is called, in (system vm traps), it is only passed 2 args. daviid: str1ngs: ok but i really wish i could find out why the previous didn't work RhodiumToad: (print-return doesn't need to be passed the values, it gets them itself using frame-return-values given the frame parameter) peanutbutterandc: RhodiumToad, Does this mean that you will be submitting a patch soon, sir? peanutbutterandc: RhodiumToad, May I also ask why does the procedure have to be turned into a hunk and called with (call-with-trace (lambda () (procedure 1 2 3)) in the first place? str1ngs: daviid dunno peanutbutterandc: I was really expecting (procedure 1 2 3) to be traced after I did a (trace-calls-to-procedure procedure) call RhodiumToad: I would guess that the vm trace level is not set to enable traces by default. RhodiumToad: call-with-trace increments the trace level inside its dynamic context. peanutbutterandc: RhodiumToad, I see... so it is all just an extra formal argument in the procedure definition that is causing the trouble? RhodiumToad: (add-trace-at-procedure-call! reverse) might be better RhodiumToad: (has the same bug, but should avoid needing to play with call-with-trace) RhodiumToad: looks like this is a regression from 2.2->3.0, in 2.2 the calling convention for the return handler is different, and it looks like the conversion to 3.0 was improperly done and not tested daviid: str1ngs: here is the exact commit that changes work/doesn't work anymore 2f161c81d99ebe8928ad3da0bfa94e1052152345 peanutbutterandc: RhodiumToad, I just tried (add-trace-at-procedure-call! reverse) and it took me to a debug prompt. I have yet to learn about debug prompt well enough: with all the things about stack frames and all. Is there any lecture/book/manual that you'd recommend regarding the matter(s)? daviid: before that commit, methods were imported as procedures, and there were no short name methods RhodiumToad: peanutbutterandc: you need ,use (system vm trap-state) for that one daviid: after that commit, (gobject) methods are imported as goops methods, and g-golf provides short name methods RhodiumToad: peanutbutterandc: if you find yourself in a nested prompt, usually the most useful thing to do is to control-d out of it, unless you actually want to find out where you are peanutbutterandc: RhodiumToad, I did (use-modules ...) lol Let me try that then. Thank you for the pointer daviid: str1ngs: so, before, webkit-navigation-policy-decision-get-navigation-action is a procedure, there is no dispatch by goops on its first arguent RhodiumToad: (use-modules (system vm trap-state)) would have worked too RhodiumToad: the ,use is just a shorthand command in the REPL daviid: after the commit, webkit-navigation-policy-decision-get-navigation-action is a generic function, with one method, the argument of wich daviid: _must_ be and instance of a daviid: and can't be a 'blindingly passed pointer' as it was before str1ngs: makes sense peanutbutterandc: RhodiumToad, No sir. It is still just throwing me into a debug repl. Am I supposed to see an actual trace? RhodiumToad: peanutbutterandc: what exactly did you see? daviid: ok, great, now, let's see how to addres this peanutbutterandc: RhodiumToad, "I see dead people" https://termbin.com/dv56 :) str1ngs: daviid: my nomad-get-navigation-action is probably not ideal since it returns a pointer for some reason. lol str1ngs: and (webkit-navigation-action-get-request action) doesnt seem to care str1ngs: 🤦 RhodiumToad: peanutbutterandc: add-trace-at..., not add-trap-at... daviid: let's focus on get-navigation-action and its argument RhodiumToad: peanutbutterandc: using add-trap-at... tells it you want to actually stop and go to the debug prompt when that function is called. daviid: it needs an instance of peanutbutterandc: RhodiumToad, silly me. Sorry for the inconvenience. I will rectify the error right away daviid: but we know, because it worked before, that the decision instance pointer is/should be accepted, since that is what was passed before the commit peanutbutterandc: RhodiumToad, Yes, sir. It works. But stumbles upon the same error (I think it might be the same error) as the other one... RhodiumToad: it is the same error peanutbutterandc: Wrong number of arguments to return-handler daviid: though i would prefer to cast the pointer str1ngs: daviid: I don't see how to do that in scheme. all I have is so without same way in GI to convert to there is not much I can do. RhodiumToad: you can just edit that line in system/vm/trace.scm and recompile it with guild compile str1ngs: maybe using glib primitives it can be converted RhodiumToad: sneek: seen wingo? sneek: wingo?, pretty sure was seen in #guile one month and 7 days ago, saying: all hail godbolt. RhodiumToad: sneek: seen civodul? sneek: civodul was last seen in #guix 3 days ago, saying: nckx: re truth.png :-). daviid: yes, if casting there is, it must be by calling a C function, just like we do in libgog-olf for gdk events ... peanutbutterandc: RhodiumToad, I see. Thank you sir. I will try to do just that. You're super awesome! str1ngs: daviid: casting is a C concept and Glib has C Macros that do that. I don't know how you would leverage that. #introspection should explain how to do this. peanutbutterandc: And sneek is so cool! daviid: but the thing is that it seems it should, in this specific case, accept a peanutbutterandc: Is sneek written in guile, too? RhodiumToad: peanutbutterandc: it's your bug, I'll leave it to you to post the patch daviid: (make (!g-inst decision)) instance str1ngs: daviid: its the generic method that causing the issue. for better or worse I guess RhodiumToad: as far as I know it is, yes daviid: because that 'mimic' what was before the commit peanutbutterandc: RhodiumToad, Oh no sir. I'm just a n00b. You should post the patch. I'm only an inspector Lestrade to your Sherlock holmes peanutbutterandc: Where can I see sneek's source? RhodiumToad: iirc it's not published anywhere? but I could be wrong daviid: str1ngs: well, we can rgue i gues, but goops is showing how superiror it is here, not the opposite, but let's this argument for academic ... let's try to solve it peanutbutterandc: RhodiumToad, I see... I hope you will be posting the patch soon, too, sir? I put the matter into your most capable hands. :) And off I go git cloning guile RhodiumToad: perhaps I wasn't clear enough peanutbutterandc: RhodiumToad, I really don't think I should take credit for your work. One person reporteth. The other fixeth it. Perhaps? But if you insist I will make the change (with the proper credit in the commit message, of course) RhodiumToad: you don't have to take credit, you can credit me for it all you like peanutbutterandc: But I must send a patch in myself? RhodiumToad: what you _don't_ get to do is dictate how I spend my time. peanutbutterandc: I am sorry sir. That was not my intention. peanutbutterandc: If anything, I am most grateful for you having resolved this issue for me. Thank you very much. I will put in a patch and will credit you in the commit message. peanutbutterandc: Strange, `info guile` does not have a 'submitting patches' or 'contributing' section (the regex search fails) peanutbutterandc: looking elsewhere daviid: wow daviid: :) peanutbutterandc: RhodiumToad, Please pardon me but https://www.gnu.org/software/guile/contribute/ says that I ought to turn the example that triggers the bug into a test case. I don't know anything about writing test cases in guile. Do you think it is okay to not write a test case since this is only a matter of removing a formal parameter from the definition? chrislck: It's easy to write a test case. chrislck: (I haven't followed the above bug hunt closely) peanutbutterandc: chrislck, I am a n00b. May I please be directed to a resource for writing tests in guile please? chrislck: Write the minimum LOC to trigger the bug chrislck: e.g. mine: https://lists.gnu.org/archive/html/bug-guile/2019-12/msg00011.html RhodiumToad: (define (foo l) (if (null? l) '() (append (foo (cdr l)) (list (car l)))) (add-trace-at-procedure-call! foo) (foo '(1 2 3)) RhodiumToad: or something like that RhodiumToad: doesn't matter what the function does as long as it recurses RhodiumToad: er, I think I missed a paren in there peanutbutterandc: Since I am a python-n00b too, I remember seeing unit test module in python. And, if used properly, one could only run the tests. I was wondering if there was something similar in guile daviid: str1ngs: look at this https://paste.debian.net/1158540/ - or how g-golf won't let users do what they want :):) peanutbutterandc: ...tests only daviid: not even its author haha chrislck: don't worry about writing unit tests in guile... just minimum LOC to demonstrate a bug, and send to bug-guile@gnu.org, and magically some guile hacker will get round to it peanutbutterandc: chrislck, Some guile hacker did get round to the issue and did fix it and has told me to send in the patch. And now here I am, feeling like I'm pushed into the Operation Theater in my first year of med school :D But I think I'll learn a bit from this experience. :) peanutbutterandc: Just cloned the repo :) *: RhodiumToad is just zis guy, you know? chrislck: IIUC No Rhodium didn't fix it, just pointed out how. The main repo still has bug. RhodiumToad: though I suppose I do count as a contributor since my name is in the commit log now, indirectly peanutbutterandc: And that is why I don't want to take the honour from you. You should have your name in the contributor list. Proudly. But that is just my opinion sir. peanutbutterandc: But I am preparing sending in the patch. Because you have asked me to. And orders are orders. chrislck: ditto. as a bug reporter my name is now immortalised but the bug fixer is still wingo: http://git.savannah.gnu.org/cgit/guile.git/commit/?id=cf53854d42d4e260459896cb0c4b071608398b96 chrislck: (still no idea what's the bug that's just been found) peanutbutterandc: chrislck, This one: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42574 RhodiumToad: looks like an editing error when converting 2.2 -> 3.0, and not tested peanutbutterandc: Hmm... there seems to be a bunch of .test files in the repo, under 'tests' sub-dir, that use (test-suite) module... peanutbutterandc: but since there isn't a trace.test perhaps I won't need one (?) *: RhodiumToad compiles up latest guile on his raspberry pi RhodiumToad: still need to patch the off_t thing for 32-bit freebsd :-( chrislck: ... all this talk of of peanut butter and pie gets me hungry peanutbutterandc: lol chrislck: ok asking for help now: chrislck: srfi-180 is finalised. does it mean I could grab https://github.com/scheme-requests-for-implementation/srfi-180/blob/master/srfi/180/body.scm and use it as is? chrislck: none the files on that repo are loadable as is in guile chrislck: i.e. although it's finalised, the repo code is not usable peanutbutterandc: Okay... this is stupid, but how do I compile guile, again? `autoconf && ./configure && make` ? o.O peanutbutterandc: I am such a n00b daviid: str1ngs: so, you/we are being bitten by a fundamental principal/rule/hypothesis and a pillar at the 'heart' of g-golf design: instances are unique - to a gobject instance correspond one and only one goops instance and vis-e-versa peanutbutterandc: I have done `guix environment guile` then `autoconf` then `./configure` throws an error "can't find install-sh, ... in ./build-aux" peanutbutterandc: any ideas please? daviid: str1ngs: hence, gobject instance pointers can be and are cached, so when a gobject lib returns an instance, g-golf returns its goops instance ... pretty obvious one could say ... this is 'hard coded' in g-golf using the mop (the meta object protocol), which is good peanutbutterandc: It appears that `guix environment guile` doesn't give me automake and friends that are required to run autogen.sh. Any ideas as to what might be going wrong here? daviid: str1ngs: i see two solutions: (1) copy the gobject instance, so it's a new pointer, we can use it to create a new goops instance or (2) remove the instance from the cache, keeping its gobject instance pointer, so we can create a new goops instance as well daviid: in the second case, one must be sure the instance to be removed is not referenced (a user responsibility I mean) and g-golf could provide a 'cast' method which would do exactly that, keep the gobject pointer, remove the revious instance from the cache, and then create and cache a new instance daviid: in this scenario, it would be the user responsibility that the 'new' class for the gpointer is 'adequate', like it would be the case for this example we are talking about daviid: str1ngs: I didn't know that casting, in C, does preserve original pointer address(es) - in this paste https://paste.debian.net/1158528, i assumed the returned pinter would always be new RhodiumToad: peanutbutterandc: I don't use guix, sorry daviid: str1ngs: ok, let's think about this a bit more, need to rest peanutbutterandc: RhodiumToad, I see. It's all right sir. I am trying the normal route now (without guix environment) RhodiumToad: just ./configure && make should do, btw RhodiumToad: though you may need to do things like specify the correct libgc library to use according to whether threading is enabled or not peanutbutterandc: RhodiumToad, I finally got autogen.sh running but it currently gives me AM_GNU_GETTEXT macro not found in library error thingy peanutbutterandc: I think I have an idea... just a sec ArneBab: RhodiumToad: do I see it correctly that your letrec-solution is equivalent to this? ArneBab: (define (transpositions l) (define (rot o) (map (lambda (e) (remainder (+ o e) 12)) l)) (map rot (iota 12))) RhodiumToad: they should be exactly equivalent, yes ArneBab: ah, sorry, you showed that next — sorry for the noise :-( ArneBab: but a pretty cool solution peanutbutterandc: Okay this might be really stupid... but I can't seem to figure out where is the built guile (built from source) peanutbutterandc: anybody here? peanutbutterandc: I did find meta/guile but it does run (complains about readline) dsmith: sneek: bugs? sneek: I could be wrong, but bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile dsmith: peanutbutterandc: ^^ peanutbutterandc: dsmith, I am sorry? o.O dsmith: peanutbutterandc: To submit a bug report, send it as an email to the above address peanutbutterandc: dsmith, Oh... it wasn't a bug... turned out to be my ~/.guile causing the problem. A good little -q and the issue was gone. Thank you nevertheless. peanutbutterandc: dsmith, If you're still here, where exactly do I sent in the patches? peanutbutterandc: sneek, patches? peanutbutterandc: sneek: patches? peanutbutterandc: Is it just me or does the contributing page not tell where to send in patches? https://www.gnu.org/software/guile/contribute/ ? o.O I am really confused peanutbutterandc: Do I send the patches to the same email thread as the bug report in question? o.O mwette: yes ; attach the patch to the email going to bug-guile@gnu.org peanutbutterandc: mwette, I see. Thank you very much. :) dsmith: peanutbutterandc: Yes, send in the patches with the bug report peanutbutterandc: dsmith, I see. Thank you. :) ArneBab: mwette: can we treat the question by peanutbutterand… as bug report about the contributing page? Maybe change from ArneBab: "Please send a patch and commit log as produced by git format-patch." to ArneBab: "Please send a patch and commit log as produced by git format-patch to bug-guile@gnu.org." dsmith: I'd send a patch about fixing how to send a patch but I can't find out how to send a patch... ArneBab: :-) ArneBab: (point taken, I’ll send a patch when I get to it) mwette: the instructions are on the guix page IIRC mwette: looking ... mwette: ... only finding the following which is guix specific and does not indicate how they want the git log entry written : https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html#Submitting-Patches mwette: here it is, starting line 82: https://git.savannah.gnu.org/cgit/guile.git/tree/HACKING dsmith: And this in the README: https://git.savannah.gnu.org/cgit/guile.git/tree/README#n464 str1ngs: daviid it keeps the same pointer. with GLib the C macros that cast to type checks etc. it's considerbly safer with GLib then just doing. WebKitNavigationPolicyDecision *navigation_decision = (WebKitNavigationPolicyDecision*) decision. str1ngs: daviid: what types are effected by this issue. derived interfaces? ArneBab: dsmith: in case you’re trying it out: I pushed some improvements for streaming video with wispserve: https://hg.sr.ht/~arnebab/wispserve ArneBab: it now uses small chunk sizes at the beginning öf the file (32KiB), then 256KiB within the first 2MiB and afterwards 2MiB chunks. pkill9: what's wispserve? ArneBab: pkill9: wispserve is a small local fileserver I built after I searched fruitlessly for two hours for "simple way to stream local files so I can watch them in a webbrowser on another computer" pkill9: nice pkill9: so like python's http module dsmith: ArneBab: Why the increasing chunk sizes? ArneBab: pkill9: not quite as convenient (it shows all files, no folder structure) ArneBab: dsmith: because when you’re accessing a video from the browser, having a big initial chunk introduces wait times (in my local test 32KiB take 11ms, 256KiB already take 70ms). Afterwards I want to reduce the overhead from additional requests ArneBab: dsmith: that’s just from local testing, because browsers do not really request the sizes as they are optimal dsmith: Nice. Initially optmize for latency, later for bandwidth. ArneBab: dsmith: the reason that got me to check that initially is that I get GC warnings when I access large files. ArneBab: (that’s the not-that-glorious reason :-) ) dsmith: heh ArneBab: but yes, in hindsight it’s a good idea :-) ArneBab: now it works pretty well. ArneBab: though most stuff is still missing — like mime types ArneBab: for anything but text and video ArneBab: do we have a library with extension-to-mime-type mappings? str1ngs: ArneBab: it's not ideal but you call file -i /path/to/file to get a mime type str1ngs: which is better then extensions since it uses file magic. just requires file program str1ngs: ArneBab: I did also find this https://www.nongnu.org/guile-www/doc/mime_002dtypes.html which has mime-types<-extension. part of guile-www str1ngs: though I think file magic is better IMHO :) a_v_p: I finally managed to post Guile-SSH 0.13.0 release announcement to the guile-user ML: https://lists.gnu.org/archive/html/guile-user/2020-08/msg00004.html a_v_p: Had problems with Emacs Gnus configuration, so my previous messages got lost on the way to the ML. dsmith: I need to get back to using Gnus. TimeWarner/Spectrum has totally broken their webmail interface. ArneBab: str1ngs: I now moved to file-magic, but also had to change from checking that for every request to tracking it in the downloadable files, because I cannot afford the second disk-access for every chunk. ArneBab: I didn’t think that that would have such a big effect, but it does str1ngs: ArneBab: yeah it's not ideal due to the fork called either. str1ngs: s/called/call str1ngs: ArneBab: I'm assuming file-magic using file -i? ArneBab: it’s now only called when the file is first accessed (which is also when I ran sha256 over the file so it can be accessed via uri-res/raw/urn:sha256: ArneBab: str1ngs: actually file --mime-type, because the content type from file isn’t the one I need in the webserver ArneBab: (I need "ISO-8859-1", because of reasons?) ArneBab: (I guess it’s the standard port encoding) str1ngs: right ArneBab: when I pass that as charset the browser correctly decodes what it gets ArneBab: I’m a bit worried about GC problems, though. str1ngs: slight offtopic, ironically I'm working on adding download support to nomad for unsupported webkit mime types. str1ngs: are you using (web server) ArneBab ? ArneBab: str1ngs: I’m actually using (fibers web server) by wingo ArneBab: str1ngs: crazy idea: in this server I implemented pre-liminary X-Alt and X-NAlt support so downloads could be retrieved from multiple sources without the need for a tracker ArneBab: str1ngs: is that something you could pull into nomad? str1ngs: Assuming it uses handlers like (web server) I guess you might have a static file handler in this case? ArneBab: yes str1ngs: it should be cheap to get the mime type just before opening the file. file magic tends to read a limited amount of bytes ArneBab: https://hg.sr.ht/~arnebab/wispserve/browse/wispserve/serve.w?rev=tip#L347 ArneBab: it’s actually not cheap, because I serve range requests and separate them ArneBab: what I do is getting the mime-type for the file if I don’t know it yet RhodiumToad: FAIL: version.test: version reporting works RhodiumToad: whut str1ngs: failed successfully! ArneBab: :-) RhodiumToad: ah. RhodiumToad: $4 = "3.0.2.160-52baa-dirty" ArneBab: str1ngs: the file-server retrieves the shared files at startup and then checks its vhash path->file to get metadata about the file ArneBab: str1ngs: and every file is a record: served serverpath accesspath size mimetype sha256 RhodiumToad: dammit, now I have to recompile it all ArneBab: str1ngs: the part I worry about is read-performance. I fear that I’m still much to inefficient there: https://hg.sr.ht/~arnebab/wispserve/browse/wispserve/serve.w?rev=tip#L267 ArneBab: (port (open-input-file abspath #:binary #t)) → (data (if end (get-bytevector-n port (+ 1 (- end begin))) (get-bytevector-all port)) → bytevector->string data "ISO-8859-1" *: ArneBab just saw where he actually gives the encoding explicitly … str1ngs: ArneBab: do you hash the files are server startup? str1ngs: s/are/on ArneBab: yes, or at first access if I pass --lazy ArneBab: for the future I still need to hash chunks so they can be validated str1ngs: I guess that is not bad. alternatively you could just hash the restful path for uniquness ArneBab: The hash is also intended to provide validation of a file downloaded from many sources str1ngs: hashing chunks seems sophisticated :) str1ngs: does this do P2P? ArneBab: I want to implement a variant of the Gnutella Download Mesh: swarming as with bittorrent but using standard HTTP str1ngs: interesting idea. I wonder if maybe gnunet would be helpful here? ArneBab: that it became a video streaming tool is more or less an accident (I wanted to stream videos to our TV) ArneBab: AFAIK GNUnet is much to complex for that str1ngs: I thought it had the building blocks for this. ie distributed hash table . whih is what bittorrent is based off of ArneBab: What I’m missing for full compatibility with actual Gnutella-clients is a TigerTreeHash implementation ArneBab: That’s all much more complex than what Gnutella used very successfully str1ngs: I trust your judgment here, it's kinda out of my knowledge base. ArneBab: Gnutella enabled multi-source downloads with just 4 additional headers str1ngs: also there is IPFS though that would lake guile bindings. str1ngs: lack* *: ArneBab used to be moderator on the gnutella development list when he was still useless at coding … ArneBab: IPFS is BitTorrent again :-) str1ngs: ahh that makes sense. ArneBab: That’s why I can grab for rough memories to find my way back into the RFCs str1ngs: btw this might be useful for guix in the context of P2P substitutes :) *: ArneBab started giving a spring lecture about distributed systems in 2019 to help keep those developments known ArneBab: that’s why I started doing it in Scheme, I just didn’t get it to a state yet, where I could integrate it and file a pull-request so Guix substitutes could be swarmed by all those who need them str1ngs: there was some talk of use IPFS due to NIX's interest in that protocol. not sure where that is at. ArneBab: IPFS is a nice system, but it needs a tracker. What I like so much about the Gnutella Download-Mesh is that it needs minimal support from the server ArneBab: The server can even die and all members of the swarm can still complete their downloads (if enough stay active after they finish so the whole file is still available). str1ngs: I guess it needs a seed swarm? ArneBab: It needs a seed-server which hands out the IPs of the most recent requesters ArneBab: also it needs validation data for the chunks ArneBab: Gnutella used a merkle-tree to provide that validation str1ngs: IPFS uses merkle-tree's as well. ArneBab: I’m thinking about simplifying that as BitTorrent did it and just providing a list of chunk-hashes, though it won’t be compatible then :( str1ngs: simple is better. I like the idea regardless. the less centrally the dependent the client's are the better. ArneBab: IPFS uses mekle-trees? ArneBab: In theory I prefer merkle-trees: then the server can simply provide the merkle-tree root and the clients can exchange ranges themselves. str1ngs: it uses Merkle DAGS str1ngs: https://docs.ipfs.io/concepts/merkle-dag/ ArneBab: AFAIK that’s merkle-trees by another name :-) str1ngs: great marketing! :P pkill9: is there a way to readlink recursively and get the final directory? ArneBab: Ah, no "there are no balance requirements" ← DAG vs. Tree str1ngs: pkill9: you can use FTW https://docs.ipfs.io/concepts/merkle-dag/ str1ngs: pkill9: sorry wrong link https://www.gnu.org/software/guile/manual/html_node/File-Tree-Walk.html ArneBab: ah, merkle-CRDT: https://hector.link/presentations/merkle-crdts/merkle-crdts.pdf ArneBab: ^ nerdsniped me … pkill9: str1ngs: I'm not sure that does what i want, I want the functionality of 'realpath' RhodiumToad: ... and you can't use realpath? str1ngs: pkill9: think canonicalize-path can get absolute path, I think that's what you want? pkill9: yea i realised i can, i'm shelling-out atm pkill9: str1ngs: that works, thanks str1ngs: I could have misunderstood what you meant by realink. I assumed you wanted to walk a path then get the absolute path of the last directory. str1ngs: hopefully I understood that correclty pkill9: yea, i thought ftw is for going through directories RhodiumToad: hm, why is there no (realpath) in the posix module? pkill9: RhodiumToad: i found a mailing list thread requesting 'realpath': https://lists.gnu.org/archive/html/guile-devel/2017-06/msg00009.html RhodiumToad: maybe you could convince the ffi to allow you to call that directly dsmith: The realpath (3) manpage has dire warnings about portabale ways of determining the correct buffer size. Maybe that's why it's absent. dsmith: Sorry, seems like that's for the earlier posix spec, a later spec makes it all better. RhodiumToad: realpath(p,NULL) returns an allocated string RhodiumToad: not sure how to arrange to free() the result RhodiumToad: I got as far as returning the right result RhodiumToad: does scm_from_stringn always copy the string? the docs aren't 100% clear RhodiumToad: I guess it does dsmith: ArneBab: is there a decent emacs mode for wisp? ArneBab: there is wisp-mode: highlighting and switching between indentation levels with tab/shift-tab. It isn’t at the level of geiser, but with rectangle-edit many things are easy that you’d otherwise reach for paredit. ArneBab: https://hg.sr.ht/~arnebab/wisp/browse/wisp-mode.el?rev=tip dsmith: Hmm. I see a wispjs-mode dsmith: ArneBab: Ahh. Thanks str1ngs: pkill9: M-x load-uri str1ngs: pkill9: I'm assuming you are using a recent nomad? str1ngs: pkill9: see http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/web-mode.scm?h=feature-g-golf#n191 for some basic keybinds. str1ngs: pkill9: M-x: query is also useful. same with C-x b which lists buffer. think tabs str1ngs: you can also interactively create webviews. with M-x switch-to-buffer name str1ngs: pkill9: if you already have a web buffer and you want to just goto another uri. you can do M-x edit-uri str1ngs: emacs edit keybinds also work in the echo area :) including command history g0d_shatter: apparently I was 10 days too late to this party, thanks Ludovic for getting this done https://sourceware.org/bugzilla/show_bug.cgi?id=21104 g0d_shatter: and Doug Evans as well apparently, thanks to you both, this makes my work one million times easier daviid: str1ngs: I was looking at some of the nomad codes, 'pure curiosity' :) daviid: str1ngs: in the (nomad gtk frame), i see you export !container, are you sure this is not a property 'somewhere' in the all gtk tree 'of things'? otherwise, you would be on a safer side to remove it from the export list and have it on a separate 'line' using g-export instead, like (g-export !container) - something i would systematically do, if i was you, for all methods, getters, setters and acdfcessors ... my 2c :) daviid: str1ngs: for info, g-golf defines mslot-set!, which i find improves code readability when multiple slot-set!, so you could use it, for example, to replace lines 89 - 92 with a code similar to (g-golf hl-api gtype) lines 97 - 101, another 2c :) as you wish of course ... daviid: str1ngs: it will be nice to see nomad running on a librem5 or pine phone ... :) did you grab and try yet? daviid: *grab a qemu sdk image ... daviid: str1ngs: I just pushed a patch that fixes a few internal resolve-module calls, and although it shouldn't change anything for users, and passes all checks, I'd be happy if you could pull/build/test to confirm everything is indeed fine for users ... whenever you have sometime, tx str1ngs: daviid: I'm not sure if !container is used by gtk. I use it a generic accessory. primary as a way to add remove something from a custom inherited control. daviid: str1ngs: my advise is to always use g-export for method, setter, getter and accessor names, no matter what, it puts you on the sfe side str1ngs: daviid: I have not tested nomad on a phone yet. I ordered a pinephone should have it next month sometime. I have started to reason out how to present a emacs interface that is suited for a phone. if you have any ideas let me know. daviid: str1ngs: i thought nomad was a browser, hence yu would just use it .. like epiphany str1ngs: daviid: okay I'll look into g-export. actually some of that code needs work due. though it does work right str1ngs: right now* daviid: str1ngs: C- and M- won't work on a phone though ... str1ngs: daviid: you could just use it. but it's heavily modeled after emacs. everything has keybinds and interactive commands. modelines and an echo area. ie no tabs instead it has ibuffer. you get the idea. that does not translate well into a touch only interface :) daviid: str1ngs: if you loook at g-golf source code, you won't find a single use of #:export for any accessor, nor method names str1ngs: daviid: I will read the manual on g-export I'm assuming that is provided by g-golf? daviid: yes, let me know if the doc is clear enough daviid: ah, it's not in the dox :) daviid: doc str1ngs: can you just explain quicking what it does? I have a good memory :) daviid: str1ngs: yes, give me a sec, it is dead important you understand why ... daviid: you and other users str1ngs: daviid: also if you recursively clone https://gitlab.com/mike.rosset/nomad-3rdparty the sub projects can be install all at once, encase you want to try nomad on debian. str1ngs: obviously you don't need g-golf :) str1ngs: the rest of the nomad dependencies should be in debian proper. daviid: str1ngs: ok, i won't do that now, but good to know str1ngs: the 3rdparty was just an FYI. no rush str1ngs: to test nomad. later you can just do make run. no need to install even. encase you don't want to pollute your system. daviid: str1ngs: do you understand that when you uwe export, you create a new binding, and it is that new binding that is exported? str1ngs: davivid: I was not aware that it was new. I assumed it just exported the modules existing binding. daviid: exactly not, hence g-export, which test for you if the binding exists, it resues it, and only if not it creates a new binding ... str1ngs: hmmm I have quite a few methods I might need to g-export as well. str1ngs: ahh that should like it's more safe when used with GLib/GTK ? daviid: str1ngs: till you really know what you are doing, my advise is to _always_ use g-export for method, setter, getter and accessor names, always daviid: and, but tht yu do already, the proer module setting for duplicte handlers str1ngs: that's an easy rule for me to follow, I can do that. daviid: right, easy and safe str1ngs: I do only like export in the context of viewing the API from a top level. str1ngs: I assume 'g-export works the same as 'export ? daviid: yu should use export the class names though, as you do, always use export for class names, and monitor when modules are compiled/imported, that it never triggers a warning on class name redefinition str1ngs: ie (g-export !container) ? daviid: str1ngs: look for some exmple in g-golf daviid: but yes str1ngs: will do. I'l keep the class names in #:export then daviid: it is a syntax daviid: you can read the code, it's not secret things daviid: here (g-golf support g-export) daviid: yes, always keep class names in #:export, always use g-export for a/s/g/m str1ngs: I have alot to fix here see http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/gtk/buffers.scm?h=feature-g-golf lol daviid: and always proper set #:duplicates to (merge-generics replace warn-override-core warn last) for all modules that uses oop goops and/or g-golf daviid: as you do already, just repeating str1ngs: daviid: I appreciate the feedback btw. when I started nomad I was still new to guile scheme. so I had a few false starts plus porting from C. so any API idea is helpful. daviid: wc! str1ngs: daviid: right now I do all of my gi-imports in (nomad gtk gi) then I use opp goops and g-golf where I need it. I should then in those modules use #:duplicates to (merge-generics replace warn-override-core warn last)? btw I found the single module that does all the gi-import works nicely str1ngs: I have some abstraction here. encase I want to use ncurses or qt for the interface. hence the extra complexity. daviid: yes, every module that uses g-golf should have the #:duplicates handlers set to the above, always daviid: in the repl as well by the way daviid: and in scripts, as the hello-world ... daviid: for the repl, yu may ad thato your .guile filet daviid: or the global init.scm file if more then one user str1ngs: I think I have #:duplicates (merge-generics replace warn-override-core warn last) in on my modules now. tomorrow I'll look at switching to g-import. thanks again. daviid: str1ngs: sure, no rush - but take a few notes of all we said so you may look at later ... it's g-export (not g-import) str1ngs: sorry I meant g-export :) daviid: str1ngs: so, when you have a min, if you can pull make g-golf and test nomad just run your own 'make check' would already be nice, no rush either but let me know when you've done it ... tx str1ngs: daviid make check looks good. I'm using Ubuntu 20.04 btw. which should be pretty much on par with bullseye. str1ngs: I'll test more with g-golf aswell. daviid: str1ngs: ok, what about nomad 'made check'? jgart: what is the recommended way to get functionality similar to nth in guile? https://docs.hylang.org/en/stable/language/core.html?highlight=nth#nth jgart: is nth in any of the guile libraries? daviid: or was it already the nomad 'make check' maybe? daviid: jgart: list-ref, vector-ref ... jgart: daviid, thanks! I'll try that str1ngs: daviid: make check on nomad does not handle graphical tests. it does many scheme only tests and I need better coverage. graphical tests are non trivial with g-application daviid: str1ngs: ok, but does it instantiate gobject calsses, even in mem only? daviid: str1ngs: but it'f fine, no rush - i'm pretty sure the fix is ok str1ngs: daviid: I was experimenting with graphical tests but I was not satisfied them quite yet. str1ngs: I have some tests that can turn on that will use g-golf though daviid: str1ngs: yeah, i have no experience with that str1ngs: I experimented with a macro that creates a and then runs the test in a inner :) str1ngs: needless to say graphical tests suck :P unless they are something trivial of course. daviid: str1ngs: if you can compile nomad, it's already a god sign daviid: because you instantiate gobject subclasses in the code, the gui is just the cherry test daviid: :) str1ngs: yeah, normally just do make run which runs wiht gnu.org.nomad.devel id daviid: if that runs, i'm fine daviid: :) daviid: with my fix i mean str1ngs: with g-golf Fixing (resolve-module '(g-golf hl-api gobject)) calls nomad run looks good str1ngs: aka aedcb6d8f4885b5b78e0ddc1d9bc46edcd49d324 str1ngs: I was just making sure I was using a prestine g-golf install. daviid: yes, that fix indeed, perfect, thanks str1ngs: no problem str1ngs: https://gitlab.com/mike.rosset/nomad-3rdparty helps on debian systems. since I can remove and install the nomad stack easily. atleast the develop packages that don't have dep packages yet. str1ngs: I do hope to eventually have deb packages for g-golf and emacsy. but my experience with debian packages are kinda limited. I'm more use to autotools myself. daviid: str1ngs: you should talk to tohyon - or is ot tohoyn i never remember - he knows how to do that and has a ddebian sponsor as well str1ngs: daviid: does he hang out in #guile? str1ngs: the main one is I'd like to create a deb package for g-golf then eventually emacsy and nom str1ngs: err nomad* daviid: str1ngs: he offered to package g-golf for debian, but i said only after the first alpha release 9things can be prepared of course, but i do't want g-golf in debian, not even experimental before a first aplpha release ... str1ngs: that's understandable. I'm not looking to rush a release. GNU projects are more strict about releases. daviid: str1ngs: he hangs from time to time, he is the other g-golf user, hs project is theme-D or seomething like that daviid: you spoke to him already ... str1ngs: eventually I'd like to promote nomad from nongnu to GNU but I have so much more coding standards to do before I could attempt that. daviid: there re other debian expert here str1ngs: oh yes I had helped him with g-golf things. theme-D is a static typed guile IIRC. which is kinda intresting. daviid: str1ngs: the guile debian maintainer hangs here, even now :), rlb daviid: the aiscm (guile) pproject also has a debian package iirc daviid: str1ngs: i personally won't work on that part, packaging for distro, but of course will always be happy to help and/or fix thigs so that it is possible ... str1ngs: I just learned about coops for chicken on the aiscm that's a great name :) str1ngs: aiscm webpage daviid: haha str1ngs: daviid: right, normally someone else will pick up that work. with guix I don't mind doing the packaging work since it helps the most people. str1ngs: guix is nice to package for . atleast from my experience str1ngs: is coops goops compatible? daviid: i don't know coops daviid: but i took its name as 'cops' [police] :) daviid: thye chicken police str1ngs: lol str1ngs: http://wiki.call-cc.org/eggref/4/coops daviid: i doubt it's goops compatible, only gauche is, to my knowledge jgart: https://dpaste.com/GUH2YSKM9 jgart: why does choose-three-nine not update to choose another random set from 3-1 and 9-1? str1ngs: in today's political social climate cops is a four letter word :( daviid: jgart: can you use a tor friendly paste service, gnome or debianpaste ... jgart: ok one sec jgart: https://paste.debian.net/1158396/ daviid: str1ngs: oh, it looks clos based, so it should be pretty compatible - str1ngs: daviid: yes I thought you would find that intresting. jgart: didn't realize that dpaste is not tor friendly, sorry daviid: jgart: it's ok str1ngs: daviid: have you tried gnunet over tor? I thought of adding gnunet support to nomad. daviid: str1ngs: no, mind you i am a simple user ... no expertise what so ever with web things jgart: the choose-three-nine procedure does not seem to update to choose a new random list jgart: maybe it's my repl acting funny daviid: jgart: i'll let someone else help you, i have to work on something else jgart: choose-three-nine takes choose-three and choose-nine as arguments to append jgart: daviid, ok no worries. Thank you anyways for looking at it str1ngs: jgart: should this not be (append (choose-three) (choose-nine)) ? str1ngs: if IIRC append takes lists not procedures jgart: str1ngs, I get the error: Wrong type to apply: jgart: when I change it to your suggestion jgart: I had tried that way earlier jgart: but I got the type error above jgart: str1ngs, what is IIRC? str1ngs: if I recall correctly jgart: str1ngs, ohh I see. Yes you are correct jgart: append only takes lists ... obj jgart: https://www.gnu.org/software/guile/manual/html_node/Append_002fReverse.html str1ngs: this might work still I confused the use of define. a mental lasp on my part. jgart: any suggestions for how to give it the output of those procedures (which are lists)? str1ngs: jgart: acutally we are both right :) jgart: when choose-three and choose-nine are not wrapped by parentheses it takes the output of those procedures and append accepts it jgart: but it doesn't update afterwards jgart: choose-three chooses randomly from a list of lists jgart: so does choose-nine str1ngs: right but it only does it once, then binds it jgart: str1ngs, yes exactly jgart: I'd like it to not bind it jgart: append! str1ngs: do you want choose-three-nine to be random everytime? jgart: dare I say mutate it everytime jgart: str1ngs, yes I do str1ngs: okay that's what I figured jgart: str1ngs, any suggestions for how to get around this binding so that it can update everytime it is called? str1ngs: jgart: http://paste.debian.net/1158397 I think this is more what you want. str1ngs: basically use procedures instead of bound variables str1ngs: this makes it random if you call str1ngs: err (choose-three-nine) jgart: ohh ok str1ngs: I'm hoping this is what you were after? jgart: because I didn't have the procedure name in parentheses then it made a binding? str1ngs: right, it binds it as a varible str1ngs: you cant test this just type choose-nine in the repl jgart: I tried it jgart: it works! jgart: str1ngs, thanks! str1ngs: does it make better sense now? jgart: yes, I was binding the result of calling the procedure once to a variable name jgart: is that correct? str1ngs: that is correct str1ngs: and I intuitively assumed that's what you were doing. then I though maybe you only wanted one random list. which confused me even more haha jgart: that was a subtle syntax difference with large ramifications in what the output becomes str1ngs: aye jgart: It's a good subtlety to take note of. str1ngs thanks! str1ngs: you could also use lets. in most cases you don't use define for variables. jgart: right. In this case I want all those lists to be available globally jgart: * in the global scope str1ngs: aye they make for good constants though. str1ngs: jgart: this looks pretty good now. simple enough to reason jgart: Now I need to just to readily convert (0 1 2 3 4 5 6 7 8 9 10 11) to ("c" "cs" "d" "ds" "e" "f" "fs" "g" "gs" "a" "as" "b") str1ngs: jgart: maybe a pair. ie '(0 . "c") jgart: and then use a port to feed it to a notes.ly file for lilypond jgart: right an associative pair str1ngs: aka alist jgart: and the logic to use choose-three-nine into lilypond tokens jgart: str1ngs, right jgart: str1ngs, thanks for your help again! I'm off to sleep jgart: I learned alot str1ngs: jgart: no problem. goodniht str1ngs: goodnight* dsmith: RhodiumToad: Looks like the fbsd arm fixes have landed in master dsmith-work: Happy Friday, Guilers!! mwette: \o| |o| |o/ chrislck: / | /\ | \ chrislck: {Friday-dance} mwette: o_< o_/ o_< o_/ - exercise is always good dsmith-work: ok. actuall lol-ing here guix-vits: Hello Guile. a_v_p: guix-vits: Hello. RhodiumToad: dsmith: yeah, I saw, was planning on testing them when I had a moment chrislck: Still no Win32 patches for guile-3.0 though :( a_v_p: I've released Guile-Udev 0.1.0: https://github.com/artyom-poptsov/guile-udev/releases/tag/v0.1.0 *: a_v_p sent Guile-Udev announcement to guile-users@gnu.org in a hope that the email will reach the the mailing list. apteryx: is there a grep-like Guile thing already builtin? apteryx: something lie (file-contains? file regexp) apteryx: or, lower level, how do I read a whole file as a stringÉ apteryx: I fail to find it in the Guile Reference manual. apteryx: ah, get-string-all apteryx: from (ice-9 textual-ports) ArneBab: apteryx: or (ice-9 rdelim) (read-delimited "" port) alextee[m]: does guile have a way to get the OS and its version? alextee[m]: like Windows 10.x or MacOS 10.15 or Linux 5.4.24-gnu daviid: alextee[m]: uname daviid: 7.2.12 System Identification alextee[m]: daviid: uname is for linux-based only isn't it? daviid: prob in msys2m cygwin, but 'pure' win prob don't have it, not sure alextee[m]: im using "pure" windoze alextee[m]: ooh scm_uname () jgart: is there any guile embedding of librsync currently available? https://guix.gnu.org/packages/librsync-0.9.7/ dsmith-work: sneek: guile-software? sneek: I've heard guile-software is at http://sph.mn/foreign/guile-software.html dsmith-work: jgart: ^^ Take a look there. jgart: dsmith-work, yes jgart: thanks jgart: looks like guile bindings for librsync don't exist yet daviid: wc! jgart: Hi! is there anything similar to interleave in guile's standard library? jgart: https://docs.hylang.org/en/stable/language/core.html?highlight=complement#interleave daviid: jgart: not 'std', but i wrote one, in grip daviid: jgart: here https://www.nongnu.org/grip/manual/html_node/Lists.html#Lists - interleave jgart: daviid, ohh nice! thanks! daviid: jgart: https://www.nongnu.org/grip/index.html - thought feel free to just snarf the interleave code if you do not wish to install grip daviid: here is the code jgart: I see grip is not in guix jgart: It would be great to get it in there jgart: so I can just `guix install grip` jgart: daviid, thanks for the code! I'll just snarf it for now daviid: jgart: yes, at least the 'grip core' - the others, grip-sql and grip-clutter do not deserve to be i guix :):) [prob i will remove those actually] jgart: is grip core a separate git repo? daviid: jgart: no, but it won't install grip-sqlite if it doesn't find sqlite and won't install grip-clutter unless you'd have a bunch of things ... you may just try daviid: here is the code daviid: http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/list.scm lines 70-71 :):) jgart: daviid, thanks! jgart: I'll take a look daviid: fell free to just grab the interleave def ... daviid: *feel jgart: daviid, the dot in (interleave . lls) means that the procedure is variadic? daviid: jgart: you may pass ore then two lists - see the manual entry i pasted above jgart: I saw the manual. So I may pass any number of lists to be interleaved is my understanding jgart: daviid, thanks! daviid: yes you may daviid: wc! jgart: daviid, where is concatenate from in the function signature of interleave? daviid: jgart: srfi-1 i think jgart: yes that's correct jgart: ok I see it jgart: does guile have a way to let me know where a procedure came from if it was imported from another module? jgart: or emacs/geiser? daviid: jgart: ,a daviid: ,a interleave -| (grip list): interleave # jgart: awesome! good one to know!! thanks so much daviid daviid: it doen't seem to work for all procedures though, not sure why daviid: others know better then myself things about the repl and geiser .. daviid: g-type-name daviid: sorry, wrong buffer jgart: not sure if that command is in the scope of what geiser already provides jgart: but ,a should do for now daviid: ,a is a guilçe command jgart: I'm just wondering if geiser gives a similar functionality somewhere to what ,a does in guile jgart: but no worries ,a is enough for me now... in a repl atleast daviid: jgart: i don't know if geiser improves that (or not), i see it does work for (grip list) procedures, but for some reason, not for g-golf (another project i work on ...) jgart: daviid, how do you generate the documentation for your guile projects? jgart: I see it say "Powered by sxml" at the bottom of very page jgart: says* jgart: I was just browsing the g-golf docs daviid: jgart: the site is powered by sxml, the doc source code is texinfo, all format generated using a script (from aother gnu project) jgart: guile's web module for the sxml? jgart: daviid, do you know of any good resources to learn texinfo for documenting my guile projects? jgart: besides the gnu manual for texinfo daviid: jgart: the first quiz, no, just the guile sxml module, here https://www.gnu.org/software/guile/manual/guile.html#SXML daviid: the second quiz, just read the texinfo doc, even 'quiclky', it is very easy to read, then grab another project and 'copy' to start with ... daviid: jgart: to build a site you should look at haunt - https://dthompson.us/projects/haunt.html daviid: jgart: what is your guile project? just curious daviid: jgart: the script that generates the g-golf online docs is this - http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh jgart: daviid thank you for sharing all this! daviid: np! jgart: I've checked out haunt. I'm planning to make a haunt site soon jgart: My project is just getting started. I want to make a computer-assisted music composition environment with guile daviid: jgart: great, you mauy look at the haunt site sourtce code, iself built using haunt, or guile website, guix as well ... for examples ... jgart: similar to abjad.github.io or music-suite.github.io jgart: those are influences jgart: daviid, thanks! daviid: cool, good luck - the first one use lilypond i tyhink jgart: possibly leveraging the lilypond guile api http://lilypond.org/doc/v2.20/Documentation/internals/scheme-functions jgart: there is no project site at the moment. It is all vaporware until further notice. daviid: jgart: lilypond manuals all use texinfo as well, fwiw ... jgart: so texinfo supports lilypond snippets then? daviid: so you may learn while still being 'swimming' in music domain ... daviid: i think so, but you should register to their ML and ask there ... daviid: correction, it is not that texinfo support 'anything but texinfo', it is that lilypond sites uses texinfo ... jgart: abjad.github.io wraps a lot of lilypond guile. It has a guile proxy: https://github.com/Abjad/abjad/blob/82de275f1a9e8f5804098b815837c0f300606daa/abjad/parsers/parser.py#L215 jgart: given that I can just call those lilypond guile procedures directly since this music composition library is written in guile, what architectural decisions can I make in this computer-assisted music composition library? jgart: these are some of the questions I'm trying to ask myself at the moment :) jgart: daviid, thanks for the insight on their site jgart: translating some of the object-oriented ideas of abjad to goops might be fun also daviid: lilypond core is C++, but it is music type setting tool, not a composition tool - other projects propose to write in dif frmats, including lilypond ... jgart: the embedded guile in lilypond is mostly used for tweaking the output of the score daviid: jgart: i have to concetrate on other things - but happy to answer any guile quiz ... those composition and lily quyiz, should see 'with them' really ... they have an irc channel, but not very active, their ML is very very active ... jgart: thanks daviid I'll have more guile questions soon. Thanks for introducing me to grip daviid: np! jgart: it would be nice to implement common music notation https://en.wikipedia.org/wiki/Common_Music_Notation as a guile program that targets lilypond output instead of postscript as in CMN. jgart: In the way that haunt supports sxml in addition to markdown lilypond can have an alternative sxml syntax. tohoyn: sneek, botsnack sneek: :) dsmith-work: Thursday Greetings, Guilers mwette: o/ chrislck: |o/ chrislck: \o| dsmith-work: RhodiumToad: Wow. Was this all it took to fix the u8-to-stack issue? https://gitlab.com/wingo/lightening/-/commit/8b37b783ead3a426ac5538d778e2f83e39bc3077 ManDay: How can I ,break on a procedure which is in a library? ManDay: (I wrote the library and compiled it with --debug= ManDay: ah ,break-at-source works (though ,cont will happily ignore it) RhodiumToad: dsmith-work: that should work RhodiumToad: dsmith-work: it does depend on the value having been correctly sign-extended or zero-extended when being _loaded_ into the register, but that's also a requirement on ARM dsmith-work: RhodiumToad: I thought it was going to be a *lot* more tricky than that. RhodiumToad: (and architectures that don't require that also won't require that the high bits are correct on the stack) RhodiumToad: no... there were a number of possible solutions dsmith-work: RhodiumToad: Looks like most of those switch cases can be collapsed into one. dsmith-work: s/can be/can now be/ g0d_shatter: uh.... g0d_shatter: what just happened in here that all of these accounts are renamed in one go? RhodiumToad: all what accounts? RhodiumToad: looks like one user (apteryx) having a connection problem or broken script dsmith-work: Looks like a different address each time. dsmith-work: Or maybe it's just flipping between two.. RhodiumToad: just flipping between one ipv4 and one ipv6 address g0d_shatter: gotcha g0d_shatter: I didn't realize that was one account g0d_shatter: :wingo are you here today? g0d_shatter: well I just drop this and if anyone else has an idea I'm fresh out of solutions at the moment. I'm compiling gdb with the guile bindings on debian stable, and for whatever reason gdb will compile, with some of the bindings, but the guile libraries aren't there. g0d_shatter: as in /usr/share/gdb/guile/gdb/* is empty g0d_shatter: I feel like this is just a missing package of some kind? Even though I have guile-2.0-dev installed RhodiumToad: 2.0? g0d_shatter: yeah, there's still a blocking bug on gdb using 2.2, as far as I know g0d_shatter: or anything above 2.0 for that matter g0d_shatter: something to do with ports iirc dsmith-work: sneek: seen rlb? sneek: rlb was in #guile 4 days ago, saying: (In other news, *finally* got guile-2.0 removed from debian testing...). dsmith-work: g0d_shatter: I wonder that's relevant. g0d_shatter: dsmith-work: yeah by chance I found out about this two days ago, its removed from testing, but not stable, and the version of gdb is 8.2.1, so I'm not sure if that would be the problem per se g0d_shatter: also, I've hit this exact same issue, where gdb will compile, but can't find guile libs, before, and I'm about to page thru my dev notebook to see if I remembered to write down how to fix it g0d_shatter: dsmith-work: thank you for the response though! dsmith-work: It sure would be nice if ldconfig was patched to ignore libguile-*.so.*-gdb.scm like it does some other files in lib/ g0d_shatter: the configure command I'm using is ../configure --prefix=/usr --with-system-readline --with-guile and I'm wondering if by removing the --prefix=/usr it'll work, we're about to find out g0d_shatter: no dice dsmith-work: Contact the Swiss Army and borrow the strace knife. Usually sharp enought to the bottom of file-searching-and-loading issues. g0d_shatter: ahhh, good call g0d_shatter: out of curiousity what is the "ccache" directory in /usr/lib/x86-64-gnu/guile/2.0/ccache ? I'm not sure I've ever noticed this directory before RhodiumToad: cached bytecode files g0d_shatter: ahhh, thank you dsmith-work: compile{r,d} cache I suspect g0d_shatter: I feel like it would be easier to figure out how to get that patch for newer versions of guile going then continue to wrestle with these issues g0d_shatter: I just dropped an email on the devel list, wanted to say thanks for the help and pointers today, excited to dig in and try to get a patch into gdb for a project I really care about pkill9: str1ngs: how do you go to a new URL in nomad? ArneBab: I made me a simple fileserver because I spent two hours yesterday searching for a simple solution to stream from my computer to our local TV: https://hg.sr.ht/~arnebab/wispserve ArneBab: It’s woefully incomplete, but it provides `wispserve --serve ~/shared-videos`, serve the videos in range-requests so browsers work well, and lists all files. pkill9: I don't suppose there is already a library out there for parsing .desktop files? leoprikler: There is a number of config file parsers, but I don't know whether there's a specific guile implementation pkill9: ok, it's not difficult ot parse them, I'm just seeing if it's already been done to save time/effort dsmith: They are like m$ .ini files, right? dsmith: Seems like it. https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s03.html pkill9: yea pkill9: just ini files CrabbyOldMan: Never liked ini files.. daviid: str1ngs: great! for the nomad patch ... sneek: daviid, you have 1 message! sneek: daviid, str1ngs says: Just a FYI I've submitted a patch to guix which updates nomad to now use feature-g-golf https://issues.guix.gnu.org/42582. And soon I'm I'll have a 0.2.0-alpha release so feature-g-golf should be completely merged at that time. daviid: str1ngs: i posted a //run related quiz on #introspection, maybe you know the answer? daviid: str1ngs: i found the solution, thanks to ebassy ... daviid: seepel1: here is an updated (g-golf) hello-world example, which uses the 'modern' way of doing things, meaning a GtkApplication, GtkApplicationWindow and run, quit - https://paste.gnome.org/psohpas0f ArneBab: dsmith: do we have a good ini file parser? str1ngs: daviid: example looks good. Though strange to see read short named methods now :) daviid: str1ngs: well, i couldn't wait for short namd methods ... :) daviid: at last, all clean and beautiful ... :) ArneBab: daviid: I see the gi-imports by string for which I’d need to know beforehand what I need; are there helper-functions to give discoverability? Something like gi-import-item-Application? str1ngs: daviid: it is I agree. just I'm so use to C name space names :). I need to port nomad to short names still. str1ngs: ArneBab: you can import whole names spaces. ie (gi-import "Gtk") in the case of GTK though it's faster to selectively import. daviid: ArneBab: gi-import-by-name namspac name ArneBab: or maybe (gii-Application) → Application imported ArneBab: (basically: is there auto-completion?) daviid: no ArneBab: ^ to not talk around the issue :) str1ngs: it's good to know the name spaces and classes IMHO daviid: ArneBab: thes ar g-base-info-names, you'll understand by playing a little, but GtkWindow -> "Gtk" "Window" ... and you can always import the name space if you don't know, or to start with ... daviid: ArneBab: just ask, w'll hlp you, then you'll get it ... ArneBab: that’s not why I’m asking. I’m asking because I’m now doing java dev at work, and I learned the value of discoverability through auto-completion. str1ngs: Gtk is the only namespace that practically needs to be selectively imported. most other cases you can just import the whole namespace with gi-import. str1ngs: there is no way to auto discovery this, there is no information until the typelib in imported. daviid: ArneBab: you could only autocomplete if you imported ... str1ngs: you can though look in /usr/share/gir-1.0/ but that's kinda out of the scope of g-golf and guile. ArneBab: it would have to be maintained, yes … understood, yes daviid: ArneBab: also, it would be imposible to dvelop anything out of any gnome namspace without reading/studying the maual anyway ... ArneBab: it would be nice if that could be changed :-) (at work I’m often prodding internal APIs with auto-completion, jumping to API docs to see whether I guessed right) str1ngs: I agrees, atleast in the context of knowing the name spaces and classes. once you have your imports though geiser does a great job of completion. atleast with my Emacs setup it does. ArneBab: that sounds like the best way would be "import everything at first, reduce imports later" daviid: ArneBab: it won't, ver, change - you can't autocomplete what's not in mem ... str1ngs: ArneBab: that reduction is how I handle it at times. the only case you can't do that is with Gtk it's very slow to import. ArneBab: str1ngs: also for development where you leave the editor open anyway? ArneBab: (or the geiser shell) ArneBab: … couldn’t that reduction be automated? ArneBab: daviid: I understand, yes. Otherwise guile-gi would become documentation of gtk ArneBab: str1ngs: (with automation I mean: show me the reduced import I would need so everything I use here keeps working) daviid: it would be, imo, a complete loss of develop time as well, you need to read the namespace manual to actually write ana pp anyway ... you would not autocomplete in the dark, that would be 'ridiculous' daviid: all this does not make any sense, sorry to say ... str1ngs: ArneBab: here's an example of non trivial application use case. http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/gtk/gi.scm?h=feature-g-golf import is actually quite easy and only needs to be done once. ArneBab: daviid: autocompletion in the dark works pretty well in Java and Python — it changes development from the need to remember stuff exactly to fuzzy matching available options against rough memory str1ngs: you are comparing apples to oranges though. there is no information to complete until the typelibs are imported. even pygobject can't do that. str1ngs: which is python so your python example fails there too. ArneBab: str1ngs: Python often has full wrappers, I think exactly because of that. daviid: ArneBab: you don't develop a gnome app in the dark, it just doesn't make sense ArneBab: however just importing the whole namespace and reducing the imports later should be enough, too. str1ngs: right that's what I said just import the whole typelib namespace. and now you have full completion. assuming you are using geiser. str1ngs: or something REPL even. daviid: you must read the manual and other examples, it's difficult, not like a one line list- str1ngs: g-golf is 100% more introspective then C I would know :) daviid: ArneBab: anyway, ping us when you need help, we'll hlp you of cours ... but you will soon grab a basic knowledge if you play with a little ... str1ngs: daviid: what are you working now in regards to g-golf? just curious str1ngs: on* daviid: ArneBab: what i'm trying to say is this: the knowldge you need is in the gnome namespace manuals and examples 'out there', not in g-golf ... daviid: str1ngs: GIInterfaces and 'Using G-Golf', the user manual daviid: full and proper GIInterfaces implementation is very important, getting close now ... str1ngs: good to know, I'm going to start work on porting to short names in the next couple of days. daviid: str1ngs: great, it will be a good test for g-golf ... str1ngs: in regards to short names I've needed to do (set! %gi-method-short-names-skip '(insert reload load-uri)) for now. so no obvious bugs ArneBab: daviid: ok daviid: str1ngs: ok daviid: str1ngs: are these guile core syntax? daviid: or nomad module syntax? daviid: anyway, just curious, good to test the customization as well ... str1ngs: daviid: in the case of 'insert it's emacsy syntax and reload and load-uri are nomad/emacsy syntax. think interactive commands like emacs. str1ngs: I'll probably keep these nomad/emacsy syntax for ease of user use. str1ngs: insert inserts into text buffer like eamcs. and reload load-uri are web mode interactive commands. daviid: ok, in this case, if you don't set! %gi-method-short-names-skip, they would (should) become insrt_, reload_ and load-uri_ daviid: str1ngs: but you know that already i guess ... daviid: all in the manual ... just in case str1ngs: right, seems to be okay like this for now. insert I can't get around the other possible I can rename. daviid: str1ngs: ok, what i'm trying to say is this - if you keep the default, the insert syntax name will be protected, and the short name method will be insert_ daviid: any syntax name is protected str1ngs: ahh you are saying I can use insert_ instead now? daviid: yees, if tou don't set! the skip var ...the way short names are defined n str1ngs: that's good to know thank you. I'll just keep this %gi-method-short-names-skip in that case. str1ngs: btw on guix I get (process:102313): GLib-GObject-CRITICAL **: 13:01:36.689: g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0' failed . but it does not actually effect the program execution I need to look into this more. does not happen on debian systems. I think it might be related to GI on guix again. daviid: str1ngs: you can try, just comment your (set! .%gi-method-short-names-skip ...) from, import ouy module and try in a repl, insert, insert_, reload, reload_ ... str1ngs: I need to try an reduce the problem and figure out what gtk code is actually causing it. daviid: the postfix char is customizable as well, in could be a prefix, or even a complete renamer lambda ... str1ngs: I see in Nomad load_ is bound daviid: ok str1ngs: well it's a generic method. daviid: str1ngs: exactly, it protected load, because there is no way to transform a syntax into a method ... daviid: str1ngs: make sure to read this https://www.gnu.org/software/g-golf/manual/html_node/Customizing-G_002dGolf.html#Customizing-G_002dGolf, the _ Short Name Methods subsection, _ Syntax Name Protect and every variable reference entry - it is really important you understand this, and let meknw if the manual is nhot clear str1ngs: I did read that part of the manual but was more focused on %gi-method-short-names-skip since that all I've needed so far. daviid: well, skip is more for users who do not want short name methods 'at all', for either all methods, or some ... but in any case, syntax names are always protected (unless a bug or so ) str1ngs: also I need to get a better handle on https://www.gnu.org/software/g-golf/manual/html_node/Gdk.html#Gdk . I'm not using Gdk right currently I think. daviid: str1ngs: there was a user here who said he preferes to protect syntax names by prefixing using @ ... so i beleive i've offered all possible ways to acheive what ever users wants str1ngs: for me I tend to use defaults. for Nomad it's a little tricky because it was written when only long names existed. So I rather not break thing just for the sake of short names quite yet. though defiantly any new GI code I'll be using short names. I think it's code tax in the long run.. str1ngs: less code tax to use short names I mean. daviid: str1ngs: sure, just mentionening the possibilities ... so in his config, those syntax you are 'facing' would be protected, and short name methods would be @insert, @reload, @load-uri, instead of the default insert_, reload_ ... str1ngs: sounds good, I'll know more once I port the long names. daviid: ok daviid: str1ngs: i don't know about the guix related GLib-GObject-CRITICAL ... but it seems it can't obtain the GType of a boxed type based on its name ... str1ngs: I'm pretty confident it's related to the on going GI issue on guix. daviid: ok str1ngs: though it says critical, it does not effect Nomad. I will try when I have time to reduce the message and see what's exactly causing it. maybe I'll know more then. str1ngs: debian systems are not effected so I don't think it's an issue with g-golf right now. daviid: it doesn't sound like a g-golf issue indeed, but let's see ... once you succeed in getting a short snipset ... daviid: str1ngs: if it helps, g-type-name is extensively used by g-golf 'itself', defined in (g-golf gobject type-information), you may try it at the repl as well .. daviid: str1ngs: for example (g-type-name 56) -| "gfloat" daviid: or (g-type-name (!g-type )) -| $18 = "GtkWindow" dsmith-work: Wednesday Greetings, Guilers mwette: o/ peanutbutterandc: Hello guile a_v_p: peanutbutterandc: Hi! peanutbutterandc: a v p wow how do I mention you? You've got embedded spaces! Hello there! :) peanutbutterandc: "a v p" does this do the trick? o.O peanutbutterandc: nope dsmith-work: peanutbutterandc: a_v_p has emedded _ peanutbutterandc: dsmith-work, How would I go about mentioning "a v p"? This seems like a fun little puzzle dsmith-work: peanutbutterandc: I guess I don't know what you mean by "mention" peanutbutterandc: dsmith-work, like this peanutbutterandc: sorry i'm a n00b dsmith-work: a_v_p: Hello dsmith-work: LIke that? peanutbutterandc: Yes, but that isn't turning my messages green on hexchat. But that's besides the point... peanutbutterandc: anyways.... peanutbutterandc: Ah! peanutbutterandc: Silly me! dsmith-work: peanutbutterandc: So I don't see spaces, I see underlines... peanutbutterandc: It's a_v_p with embedded underscores. I'm using hexchat. And it just turns them into spaces peanutbutterandc: dsmith-work, lol dsmith-work: Oh wow dsmith-work: "Well that's your problem right there.." peanutbutterandc: Anyways, is there any chance that you might have any answer regarding this: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42574 please? peanutbutterandc: dsmith-work, which irc client would you recommend, BTW? peanutbutterandc: I'm trying to get this trace thing working properly so that I can trace the example programs in a certain book. Just so. But I'm not having much luck with it. dsmith-work: peanutbutterandc: Well, I've most always used erc in emacs. I messed with xchat a bit a long long time ago, but I like having the power of emacs available. dsmith-work: I'm using ERC with GNU Emacs 26.1 (x86_64-pc-linux-gnu, GTK+ Version 3.24.5, multi-tty) of 2019-09-22. peanutbutterandc: And they're such neat recursive functions. So trace-mpting. peanutbutterandc: (tempting) dsmith-work: peanutbutterandc: I've never used the tracing stuff, sorry. peanutbutterandc: I see.... I still have to learn emacs properly...*sigh* peanutbutterandc: dsmith-work, I see. It's all right. peanutbutterandc: a_v_p, perhaps you might have some ideas regarding the matter? https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42574 dsmith-work: I've just recently started using paredit for lispy stuff. Avoidied it for years. It's *wonderful*. peanutbutterandc: dsmith-work, I've read about paredit in guix-reference-manual. It says the same thing too, basically. dsmith-work: peanutbutterandc: Make sure the manual and the guile are at the same version. Low level stuff (like evaluation, the vm, the jit) might have changed quite a bit between major versions. dsmith-work: The https://www.gnu.org/software/guile/manual/ manual is for the latest version, 3.0.4 peanutbutterandc: dsmith-work, I just looked at the manual that I have (info) and it's basically the same... dsmith-work: There are links to older manuals here https://www.gnu.org/software/guile/learn/ dsmith-work: Ok. peanutbutterandc: dsmith-work, Perhpas you might be able to shed some light into the matter, too, (regarding bug 42574). I am pretty sure it isn't really a bug but just me being a n00b seepel1: daviid: Thanks for the example! *: sneek yawns nckx: OK, that ☝ is adorable. I've never seen that in #guix. mwette: sneek: what day had the largest number of logged messages on #guile mwette: sneek not yawning now -- hehe nckx: sneek doesn't understand your big wurds. rekahsoft: Hi all, I was under the impression that sfri modules came with guile. However when I attempt to load them I see "no code for module (sfri sfri-1)". Any idea what might be wrong here? ft: (use-modules (srfi srfi-1)) ;; Then ,d fold → Apply PROC to the elements of LIST1 ... LISTN to build a result, and return… ft: it's "srfi" not "sfri" (scheme request for implementation) rekahsoft: ft: wow, thank you. That typo was killing me :( ft: No problem. It happens to everyone. :) peanutbutterandc: Hey there! A newbie here. I'm trying to run a trace of a recursive procedure call. The book I am studying (simply scheme) does this be `trace procedurename` and then `(procedurename arguments)`, and it prints a lovely trace (in the example) sneek: peanutbutterandc, you have 2 messages! sneek: peanutbutterandc, nckx says: I don't use systemd; does make sense? I originally wrote gnu-store.mount as WantedBy=guix-daemon to keep it ‘separate’: i.e. if the local admin disabled gnu-store.mount, starting guix-daemon wouldn't start it behind their back. Maybe that's overkill. sneek: peanutbutterandc, nckx says: If I added Wants=gnu-store.mount to it instead, we wouldn't need to enable/start gnu-store.mount by hand at all. Is that correct? Would it be better? peanutbutterandc: Now, I tried doing so with guile's ,trace (proc args...) and it was.... a mess. Since the procedure depends on a lot of other things, it kinda' plluted the output. peanutbutterandc: ,trace (proc-defined-in-the-repl-without-any-outer-loaded-scm-files-like-factorial-for-example arg) does produce a very clean trace: as beautiful as anything. But not in this case. peanutbutterandc: since the procedure depends on 'simply.scm' file (custom extensions to scheme, for the book) peanutbutterandc: now, I did find this that seems to do the same thing as (trace ...) in the book: https://www.gnu.org/software/guile/docs/master/guile.html/Tracing-Traps.html peanutbutterandc: If I do (use-modules (system vm trace)), there is a (trace-calls-to-procedure) procedure which, I was hoping would work just like (trace procedure) in the book: just a trace of the calls to that procedure. But that doesn't happen. peanutbutterandc: TL;DR: How is one supposed to use (trace-calls-to-procedure) from (system vm trace)? I tried (trace-calls-to-procedure a-procedure) but none of the subsequent calls to (a-procedure arg) produces a trace. peanutbutterandc: I was hoping (trace-calls-to-procedure) from (system vm trace) would work like (trace) as in guile1.x as shown here: https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Tracing.html peanutbutterandc: Perhaps I am doing something wrong. Any pointers would be greatly appreciated. seepel1: peanutbutterandc: I think you are looking for (add-trace-at-procedure-call! proc) from (system vm trap-state) https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/High_002dLevel-Traps.html seepel1: Whoops, that was 2.0 documentation... maybe it's different now peanutbutterandc: seepel1, I read the current documentation and the name does suggest that it should trace calls to that particular procedure... curioser and curioser seepel1: Oh, interesting, does it error when you call a procedure that has a trace set? seepel1: In 2.2 it works for me, but seems to error on an internal return-handler in 3.0. peanutbutterandc: seepel1, No... it just doesn't do anything. No trace. It's as if I never called it. Just normal output peanutbutterandc: so very strange seepel1: Hmmm, I'm not super knowledgeable about, this so I doubt I'll be of much help. Sorry! peanutbutterandc: seepel1, It's all right. I appreciate your trying to help. Wonder if I'll bump in to Mr. Wingo himself anytime soon. He could surely help. :) peanutbutterandc: Hey, anybody here? dsmith-work: Tuesday Greetings, Guilers str1ngs: greetings dsmith-work o/ str1ngs: sneek: later tell daviid. Just a FYI I've submitted a patch to guix which updates nomad to now use feature-g-golf https://issues.guix.gnu.org/42582. And soon I'm I'll have a 0.2.0-alpha release so feature-g-golf should be completely merged at that time. sneek: Will do. pkill9: what's g-golf? str1ngs: pkill9: g-golf is Guile binding to gobject introspection str1ngs: in the case of nomad we use it to write GTK code in pure scheme. str1ngs: pkill9: I submitted a patch which should fix the nomad build issue on guix. str1ngs: it's actually a major update not just build fix. pkill9: nice str1ngs: apologize for the inconvenience. There was no point fixing the build issue. since I was hoping to release the move to g-golf. pkill9: what module is 'remove' in? pkill9: from https://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Filtering-and-Partitioning.html chrislck: srfi-1.c? pkill9: i need something i can import pkill9: it says 'remove' is unbound dsmith-work: It's in (srfi srfi-1) chrislck: isn't discovering srfi-1 a rite of passage for any schemer? dsmith-work: pkill9: remove is implemented in srfi-1.c, but you need to (use-modules (srfi srfi-1)) to get at it. pkill9: thanks dsmith-work: chrislck: I've been (slowly) learning Haskell. What a joy to see all my old friends there for working with lists. a_v_p: FWIW, here's a daemon that I wrote using Guile-Udev that auto-mounts USB devices for seats in a multi-seat configuration according to a config: https://gitlab.com/gkaz/mst/-/blob/master/mstd/mstd pkill9: i like alists str1ngs: pkill9: the nomad package is really dated. I would git clone nomad. then do guix environment -L ./guix nomad. then ./configure and make run. str1ngs: pkill9: also you need a pretty recent guix pull. str1ngs: pkill9: git clone -b feature-g-golf https://git.savannah.gnu.org/git/nomad.git to be more precise. if you have cloned already switch to the feature-g-golf branch. winny: is there a guide to guile error handling? Something that discusses real world application? winny: this looks promising https://dustycloud.org/blog/guile-errors/ interested in more stuff =) mwette: thanks for that link daviid: pkill9: hey, that blog winny just referred to has a nice intro article on hash tables - fwiw, here https://dustycloud.org/blog/hash-tables-are-easy/ sneek: daviid, you have 1 message! sneek: daviid, dsmith says: For concatenating images and other things like that, check out imagemagick winny: thanks =) daviid: str1ngs: wrt guix, the command civodul proposed // guix install g-golf --with-branch=g-golf=devel // would that grab/update/install the latest, like the eqiv of // git pull; make; make install // can seepel run that 'anytime' for example? winny: is there an easy way to determine if a scheme object has been garbage collected? RhodiumToad: from within a program? or for debugging? RhodiumToad: in programs, you can use the guardians mechanism winny: yeah, within a program that embeds guile, RhodiumToad: you're interested in when a scheme object that you create in C code gets collected? winny: yeah, trying to debug a crash related to http://git.savannah.gnu.org/cgit/xbindkeys.git/tree/keys.c#n458 -- it appears sometimes i get errors saying apply-smob/1 given the wrong type, sometimes it's a vector, sometimes it's a syntax transformer, sometimes it's a different error entirely, but i put in a check to see if the key->function is still passes scm_procedure_p() test, and in most cases it winny: fails when the program crashes winny: oh jeez winny: wish i checked the commit messages winny: http://git.savannah.gnu.org/cgit/xbindkeys.git/commit/keys.c?id=13b2af4b613c09983814aff53bfa51ead57fc0cd RhodiumToad: yes winny: so in future i should use guardians, but the description suggests it affects when objects are collected in addition to notifying the user? RhodiumToad: well for a case like this guardians are probably not the thing RhodiumToad: you want to reference a scheme object from a C structure, and release the reference to the scheme object when the C structure is explicitly freed? RhodiumToad: (if so, protect/unprotect is a reasonable strategy) winny: I am thinking from a debugging point of view -- realizing what was happening took awhile because I couldn't make sense of the backtrace, and there are quite a few threads online about seemingly bogus types not being callable or not compatible. Hence my seeking to interrogate the GC from a debugger/with tracing to ensure a pointer is still "live" from a debugging session RhodiumToad: from a debugging session, there's probably a good way to check when a given value gets freed, but I don't know offhand what it is RhodiumToad: I haven't worked with libgc much winny: i'll keep my eyes open, might have to simply do some codebase surfing akoppela: Hello folks akoppela: What would be the best place to search for Guile jobs? kori: akoppela: to be 110% honest i doubt you're going to find any kori: I might be wrong, though... str1ngs: daviid: yes it's pretty much the same. personally though I would use something more like guix environment --ad-hoc g-golf guile@2.2.7 gtk+ webkitgtk glib-networking . since with g-golf this more useful. though --with-branch tries to build too much when used with environment. str1ngs: or maybe I'm not using --with-branch properly. dsmith-work: Morning Greetings, Guilers miskatonic: hi dsmith pkill9: i like waybar, but it's configuration system is horrible, it woudl be good to be able to configure it with guile chrislck: does guile development use continuous integration? what platform? chrislck: eg travis? dsmith-work: chrislck: The lightening back end does: https://gitlab.com/wingo/lightening/-/blob/master/.gitlab-ci.yml chrislck: ah nice dsmith-work: What are all those .x-sc_* files for? dsmith-work: (in the Guile sources) civodul: dsmith-work: it's for some sort of linter that Gnulib has civodul: "x" like "exclude": it specifies patterns of files to not be linted civodul: i don't even remember how to run that stuff dsmith-work: heh minerjoe: /names daviid: . sneek: Welcome back daviid, you have 2 messages! sneek: daviid, str1ngs says: Thanks for look at (nomad gtk gi) module. no particular reason I'm using map other then to experiment with it more. for-each is more natural for me since it's procedural so I'm trying to use map more. the Nomad typelib is now down to only 7 functions and is left over from porting from C. It's actually nice to have since it can be used instead of SCM_DEFINE and function methods are automatically exposed to sneek: daviid, str1ngs says: I need to test g-golf using guix system soon. I might be able to grasp the issue better and find any other guix related problems I think there could be another issue. I mainly use a debian workflow with autotools and periodically I'll test guix but with my foreign distro install. daviid: str1ngs: ok - i'm gona wait then, but i was thinking adding a 'Notes for Guix users' under 'Before you start' and give some hints about 2 things: (a) this problem we just spoke about and (b) how to setup things, when you are a Guix System user (no host, and no dual boot, just Guix system) to devel/conrib or just use a git clone (instead of a guix package) daviid: str1ngs: wrt (b), I mean as we do on debian (or other distro), git pull, [./autogen.sh, .configure ...], make, make install, restart geiser/guile, ,use (g-golf) and devel, test ... and this 'cycle' over again and again ... what is a good setting for guixsd users - this would help seepel 'right now' i think ( i can't ask seepel to update guix g-golf package everytime i push a change ... daviid: dsmith: (and any interested guilers) i finally grabbed and installed a librem5-sdk under qemu, and it has guile already, daviid: purism@pureos:~$ guile --version daviid: guile (GNU Guile) 2.2.4 daviid: Packaged by Debian (2.2.4-deb+1-2+deb10u1) daviid: daviid: it even has guile-cairo (but thye 1.10 version), and guile-gnome daviid: i'm gona try to compile g-golf 'right now' :) seepel: daviid: No need to worry about me. I've got things running now, and am mostly learning about gtk itself now :) sneek: seepel, you have 2 messages! sneek: seepel, str1ngs says: hello. inputs should be fine no need for propogated-inputs here. if you are having a problem with the package can you describe the problem you are having? sneek: seepel, str1ngs says: the error cannot register existing type 'GdkPixbuf' as far as we have determined happens on guix due to different versions of the same typelib being loaded. Which only happens on guix. I found the easiest way to do this is to adjust the gi-import order. see http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/gtk/gi.scm?h=feature-g-golf for nomad does all it's imports from one file. and how it orders daviid: seepel: ok, but do you use the guix 'precompiled' package? daviid: seepel: i would be iterested to see how a guixsd user copes with devel/contrib a s/w in 'active devel' phase, like g-golf seepel: daviid: Right now I am, but I also have sorted out how to install a specific commit from a local package definition. daviid: seepel: ok, perfect then, please grab the latest, i fixed a few things ... daviid: when you wish of course, nothingurgent - these are none fudamental fixes ... seepel: I will for sure, haven't run into any problems so far though. daviid: seepel: no indeed, you're fine with the guix package for now daviid: seepel: so, wrt this project, make sure it has a 'mobile' mode, like epiphany, so your app will run smoothly on the librem5 phone ... daviid: *this project of yours ... daviid: str1ngs: ^^ same for your nomad project ... seepel: daviid: That sounds like a plan, is there a gtk concept of a 'mobile' mode? Or are is it up to me to detect screen size and adjust my UI accordingly? daviid: seepel: i think they just check for the screen size daviid: at least that is what epiphany seems to be doing ... seepel: daviid: Cool, will do (eventually). I wouldn't get your hopes too high, right now I'm basically using getmail to dump some email into an mbox file, parsing it with guile-email, and then I'll consider it a win if I can display a list of emails, and then display the plain-text content of a selected email :) daviid: seepel: sure, no particular hope here :), i was just sharing the idea that if a ui there is, better think 'right at the beginning' how it works in 'mobile mode', since what you do, wether a tiny 'personal' toy or the next world wilde killer app :), will run on the librem5 seepel: daviid: You're totally right, it'd be pretty fun to see my little guile email client running on a phone :) daviid: seepel: yes, and probably inspiring as well, i think seepel: daviid: How do I call gtk_paned_pack1 for GTKPaned (https://developer.gnome.org/gtk3/stable/GtkPaned.html) For gtk_list_box_prepend as prepend, so I expected it to be pack1, but also tried paned-pack1. daviid: seepel: let me check daviid: here pack1 is defined daviid: seepel: https://paste.gnome.org/p4f9x0ynb seepel: daviid: Oh thank you. And also so sorry, it turned out to be a me problem. daviid: seepel: no problem daviid: i successfully compiled g-golf for the librem5 sdk daviid: and successfully run the hello-world example on it seepel: daviid: Nice! daviid: ot: have taken 4 screeshots, i'd like to 'concatenate those', what is a good quick to do that? daviid: could use guile-cv :) but it need a tiny script ... daviid: *would need daviid: here https://imgur.com/a/K0GC4J6 daviid: of course the original librem5-qemu image and original main screen wouldn't have emacs :), added to work ... dsmith: sneek: later tell daviid For concatenating images and other things like that, check out imagemagick sneek: Will do. str1ngs: daviid: funny you mention that, I just ordered a pinephone for that same reason :) str1ngs: daviid: for guix users that want to use the latest g-golf. I have a g-golf-git package in nomad, see http://git.savannah.nongnu.org/cgit/nomad.git/tree/guix/gnu/packages/g-golf.scm?h=feature-g-golf str1ngs: daviid: to use it with guix it's as simple as doing. guix environment -L ./guix --ad-hoc guile@2.2.7 g-golf-git gtk+ webkitgtk glib-networking civodul: i think you could also run "guix install g-golf --with-branch=g-golf=master" str1ngs: thanks civodul that should work too. just FYI g-golf uses devel for development branch str1ngs: with nomad I use the package declaration since I like to pin to certain git commits. though eventually when g-golf is more mature I hope the g-golf declaration should be enough :) str1ngs: the g-golf declaration in guix I mean. civodul: str1ngs: makes sense! a_v_p: Guilers, what is the proper way to handle missing 'guild' program in a system during the build phase? I'd like to replace 'guild' if it is not present, or skip compiling altogether in this case. a_v_p: I have GNU Guile 2.0.14 installed, and there's no 'guild'. a_v_p: FWIW, the GNU/Linux distribution is ALT Education 8.2. civodul: a_v_p: i think you should just have 'configure' error out when 'guild' is missing civodul: it's been there forever, even in 2.0 civodul: perhaps you're missing a "guile-dev" package for that distro? a_v_p: civodul: Okay, thanks. Let me check. a_v_p: I have 'guile20-devel' and 'libguile20-devel' installed. I guess the package names are up to distribution maintainers so it's not very helpful. a_v_p: The guild tool is missing anyway. And there's nothing like 'guile-dev' in the repository. :-/ I'll ask the distribution maintainers. civodul: a_v_p: so "guile20-devel" does not contain 'guild'? civodul: or even just "guile20" actually civodul: it should definitely be there a_v_p: No, it doesn't. civodul: does it have the 'guile-tools' program? a_v_p: No. There's only 'guile-snarf'. a_v_p: Nevertheless, '/usr/share/guile/2.0/scripts/compile.scm' is present in the system. a_v_p: It should be possible to emulate 'guild' behavior using plain guile command. civodul: a_v_p: perhaps there's a separate "guile-bin" package or something? civodul: otherwise it's a serious issue in their package civodul: so yes, you could emulate 'guild', but really, you shouldn't have to :-) a_v_p: civodul: Agreed, looks too hacky, but I need to fix `guile-udev` building somehow. civodul: understood civodul: then you could basically ship a copy of 'guild'... civodul: or roll your own script that calls 'compile-file' (we do that in Guix) mwette: a_v_p: I generate a guild (from guild.in) in my package distro; needed due to distro w/ misnamed suffix issue a_v_p: Well, I got some hints from the distribution maintainer's chat. a_v_p: civodul: They said that the 'guild' tool was in Guile since 2.2. But you said that the tool was here from 2.0. Hmm... civodul: yes, and before that there was 'guile-tools' civodul: weird! a_v_p: You mean, in 2.0 guild was part of 'guile-tools'? a_v_p: civodul: So they said that 'guild' become a part of their Guile package since Guile version 2.2 in the distribution. Alas, Guile 2.2 was included in the ALT Education version 9, but I need to stick with 8.2 for now. a_v_p: mwette: Thanks, I think I'll do the same. str1ngs: a_v_p: are you using autotools? aka configure.ac? mwette: a_v_p: http://git.savannah.nongnu.org/cgit/nyacc.git/tree/etc alextee[m]: does guile have some sort of library for bash completion alextee[m]: ? a_v_p: str1ngs: Yes. str1ngs: a_v_p: does ./configure GUILE=$(which guile) help? a_v_p: str1ngs: No. str1ngs: is it configure or make that complains it can not find guild? a_v_p: str1ngs: My project fails to compile .scm files during the build phase. str1ngs: when you say build phase do you mean when you run make? a_v_p: Yes. str1ngs: do you have a make target for .scm.go: that looks like this? $(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILD) compile $(GUILE_WARNINGS) -o "$@" "$<" str1ngs: maybe pastebin Makefile.am a_v_p: Yes. The project builds fine on a system where guild is present. The problem is, I have to build the project on a system that does not contain 'guild'. a_v_p: https://github.com/artyom-poptsov/guile-udev/blob/master/modules/udev/Makefile.am str1ngs: what does GUILEC expand to? I have not seen that before a_v_p: To see the verbose output, run make like follows: 'make V=1' str1ngs: sneek: later tell a_v_p add this target to Makefile.am https://paste.debian.net/1157860. then paste the output of make debug sneek: Will do. str1ngs: a_v_p add this target to Makefile.am https://paste.debian.net/1157860. then paste the output of make debug a_v_p: str1ngs: I can do it, but what's the purpose of this? sneek: Welcome back a_v_p, you have 1 message! sneek: a_v_p, str1ngs says: add this target to Makefile.am https://paste.debian.net/1157860. then paste the output of make debug a_v_p: sneek: botsnack sneek: :) str1ngs: a_v_p: the purpose is to ensure $(GUILD) is expanding also you have $(GUILEC) which does not seem right. a_v_p: str1ngs: Here you are: https://paste.debian.net/1157863/ a_v_p: That's the output of 'make V=1'. a_v_p: (A part of output.) str1ngs: and with make debug ? a_v_p: str1ngs: https://paste.debian.net/1157864/ str1ngs: seems you have guile 2.2 with guild-2.2 a_v_p: Yes, I run 'make' on Ubuntu GNU/Linux. str1ngs: you want to run make debug on the system that you are having issues with a_v_p: str1ngs: Here, 'make V=1' on the problematic system: https://paste.debian.net/1157865/ str1ngs: run make debug please a_v_p: str1ngs: https://paste.debian.net/1157866 str1ngs: okay thank you, now add echo tools: $(GUILE_TOOLS) to the debug target str1ngs: and run make debug str1ngs: a_v_p: the debug target should look like this http://paste.debian.net/1157867 a_v_p: str1ngs: Okay: https://paste.debian.net/1157868 RhodiumToad: moo a_v_p: I fixed the issue by adding 'guild' to the 'build-aux' in the repository and using it when no 'guild' is available in the system. str1ngs: a_v_p what is the output make debug now? str1ngs: a_v_p: for guile 2.0 is $(GUILE_TOOLS) should expand to guile-tools . str1ngs: for guile-2.2 it should expand to GUILD aka guild str1ngs: so the command you want is $(GUILE_TOOLS) compile not $(GUILEC) str1ngs: this will make it portable a_v_p: str1ngs: https://paste.debian.net/1157869 str1ngs: a_v_p: do you have m4/guile.m4? a_v_p: str1ngs: No. str1ngs: assuming you are using AC_CONFIG_MACRO_DIRS([m4]) if not it could just be ./guile.m4 manumanumanu: ArneBab: The difference will be very small until you have used any of the "expensifying" operations: concat, split, or insert in the middle. It will be one extra (if (has-lookup-table? rrb) .... ) per operation. I suspect that removing the dispatch on (transient? ...) will make up for that, meaning only (fector-ref ...) will be more expensive. mwette: m4/guile.m4 does not work on Ubuntu 18.04 because guile and guild are not installed consistently. rlb knows about this and is fixing the debian upstream, I beleive mwette: s/ei/ie/ rlb: mwette: maybe fixed in 3.0.1+1-2? https://metadata.ftp-master.debian.org/changelogs//main/g/guile-3.0/guile-3.0_3.0.4-1_changelog mwette: rlb: thanks. My Ubuntu bug "guile-2.2 installed but not guild-2.2" is still unassigned (on launchpad.net). rlb: Looks like that might be 2.2.7+1-4 rlb: https://metadata.ftp-master.debian.org/changelogs//main/g/guile-2.2/guile-2.2_2.2.7+1-5.1_changelog rlb: (In other news, *finally* got guile-2.0 removed from debian testing...) a_v_p: I wrote a draft version of a daemon with Guile-Udev that should auto-mount USB flash devices by means of 'udisksctl' command: https://gitlab.com/gkaz/mst/-/blob/wip-mstd/mstd/mstd pkill9: a_v_p: i don't know much about udev, why would you use a daemon instead of writing a udev rule? seepel: . a_v_p: pkill9: Sorry, I don't quite understand the question. ArneBab: pkill9: does’t udev depend on the systemd codebase nowadays? a_v_p: pkill9: Ah, I got it. One reason to roll out my own daemon is that I tried to implement the functionality I needed as an udev rule, but wasn't able to get it work stable enough. a_v_p: You see, on some systems all mounts that my script did when called from an udev rule were visible only in the systemd private namespace. I tried enable shared mounts and disable private namespaces, but with no success. a_v_p: Here's the old version of auto-mount script: https://gitlab.com/gkaz/mst/-/blob/master/scripts/mst-mount ArneBab: I had three subsequent iterations of an udev rule to get my usb audio pre-amplifier working. Today it doesn’t work anymore. pkill9: ArneBab:yes, but there is eudev which is udev independent from the systemd codebase pkill9: a_v_p: i mean,why would you run a daemon to automount the USB flash device, instead of just writing a udev rule that tell sudev to automount it pkill9: oh nvm you got it ArneBab: pkill9: true — I hope eudev will keep working and people will pull the necessary updates. pkill9: wish i could configure swaywm with guile str1ngs: pkill9: I started work on extending nomad to use wlroots. pkill9: str1ngs: I've hear dof nomad but haven't used it, where can I find it? I can't find it in search str1ngs: pkill9: https://www.nongnu.org/nomad/ str1ngs: pkill9: there is no wayland code right now. it's just a stand alone program. later I hope to make it a displa manger as well. str1ngs: display* str1ngs: or wayland server to be more precise. pkill9: i see it uses webkitgtk, how well does that work with the web nowadays? str1ngs: pkill9: pretty good str1ngs: nomad is more like emacs in away. it also uses vte for a terminal it's not just limited to the web. though that's it's primary focus right now. pkill9: cool pkill9: i thought webkit didn't really work with modern web str1ngs: webkit works fine str1ngs: though eventually nomad won't be limited to just webkit. eventually it will support qtwebengine. personally webkit is a more open platform though. pkill9: the guix package fails to build for me, it can't find guile-gcrypt, though it's added pkill9: why does (scandir) include "." and ".." in the list? RhodiumToad: why not? a_v_p: Hello Guilers! I started Guile-Udev project that provides bindings to libudev: https://github.com/artyom-poptsov/guile-udev civodul: hi a_v_p! nice! a_v_p: civodul: Thanks. :-) There is a working example in the repository as well. civodul: a_v_p: in Guix there are several modules to deal with .ko files, finding out which modules need to be loaded, etc. civodul: you might find it interesting civodul: it could serve as the basis for some udev-like functionality in Scheme :-) pkill9: what would you use those udev bindings for? pkill9: i don't know much about udev, other than that you create rules for it to do things when hardware is plugged in/out a_v_p: civodul: Do you mean that it's possible to implement something "udev-like" w/o using libudev? civodul: yes a_v_p: pkill9: On one of my job I need to write a daemon that will track USB devices and do some logic upon it. a_v_p: Besides, although it's not Guile related ( yet :-) ), here's the project: https://gitlab.com/gkaz/mst a_v_p: It's a graphical multi-seat configurator. a_v_p: civodul: I went down the easier path and used libudev as the basis. It took me just around two days to implement Guile-Udev. I guess writing everything from the scratch will take longer. civodul: yup, that makes sense civodul: if you're curious: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/linux-modules.scm :-) a_v_p: civodul: I see. There's some code that reads events from the Linux kernel, but apart from that this module does other Guix-related things such as loading kernel drivers. a_v_p: I guess in a pure-scheme implementation of udev I may face some portability issues that are already solved in libudev. manumanumanu: Ahoy hoy, guilers! manumanumanu: I am having a happy moment. I just had an epiphany regarding Andy's fectors. I can probably change them to be RRB-trees with minimal work, which means a sliiight constant cost, but fast splitting, insertion in the middle, and concatenation manumanumanu: the constant cost could be nullified by making transients explicit instead of implicit, making the dispatch on whether it is still a strict 32-way trie or an rrb-tree. jackhill: a_v_p: Thanks for making and sharing guile-udev. It looks like the THANKS file could be updated :) jackhill: it mentions guile-ssh. Thanks for that too! jackhill: also, AUTHORS a_v_p: jackhill: Oh, a good catch, thanks. Fixed that. ArneBab: manumanumanu: will you benchmark the old and new version (pro-forma question, given that you’ve benchmarked everything, but I still wanted to ask, because I’d be very interested in the results)? a_v_p: I wonder, is there an official Guile room on the Matrix network, or at least any active rooms where lispers share their parenthesis and the ancient lore? Blukunfando: Whatever there is should be reachable from the URLs in the topic. dsmith: a_v_p: "Official" guile room is right here in #guile on irc dsmith: There are also plenty of people in #scheme too Blukunfando: a_v_p left before my reply. daviid: str1ngs: ok, great, hope it helps seeple, let's see daviid: str1ngs: it's a beautiful module def you ge there, which even gi-import "Nomad" itself daviid: :), impressive (I know it relates to the part you wrote in C and made those GI, really impressive to ... daviid: str1ngs: any particular reason you use map, as opposed to for-each i mean, in the eval-when expr? just curious daviid: str1ngs: wrt to this 'order' you mention i the explanation, do you mean if you import the Gtk 'stuff' before the Gdk 'stuff' it woud, it would fail on guix? daviid: str1ngs: also, you seem to say there are more then one gir-1.2-* lib installed on guix, so there would be more then one gir1.2-gdkpixbuf-2.0 ? daviid: str1ngs: excuse my ignorance - just trying to understand and the reason is this: daviid: str1ngs: do you think we should add a note in g-golf manual about this? iirc, and can count :), this is now the third user who is unable to simply install the the g-golf guix package and use it ... daviid: *we/I should add - but I'd need help to write it ... minerjoe: Does anyone here know a good library for running shell commands? I need some way to execute a bash script from within guile and get access to the stdout and stderr. I've been playing with the new pipeopen but having trouble getting stderr. str1ngs: sneek: later tell daviid. Thanks for look at (nomad gtk gi) module. no particular reason I'm using map other then to experiment with it more. for-each is more natural for me since it's procedural so I'm trying to use map more. the Nomad typelib is now down to only 7 functions and is left over from porting from C. It's actually nice to have since it can be used instead of SCM_DEFINE and function methods are automatically exposed to str1ngs: scheme thanks to g-golf and GI. The guix problem is a little harder to document for right now the most I have gleamed on the issue is gi-import can be order dependent on guix. It's possible this patch used by guix could be improved http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch or just due to the nature of guix gi-imports will always be order dependant. sneek: Got it. ArneBab: minerjoe: I’m unsure about stderr; what I use is (use-modules (ice-9 popen)) dsmith: minerjoe: Pretty sure the current pipe stuff doesn't mess with stderr. Just look at ice-9/popen.scm ArneBab: -> open-pipe str1ngs: sneek: later tell daviid. I need to test g-golf using guix system soon. I might be able to grasp the issue better and find any other guix related problems I think there could be another issue. I mainly use a debian workflow with autotools and periodically I'll test guix but with my foreign distro install. sneek: Got it. ArneBab: I would have expected this to control output and error port, but I don’t get the string from the error port: (import (ice-9 rdelim))(import (ice-9 popen))(let* ((err (open-output-string))(port (with-error-to-port err (λ()(open-input-pipe "echo 1; echo 2 >&2"))))) (list (flush-all-ports) (read-delimited "" port) (get-output-string err))) ArneBab: Do I misunderstand something or is this a bug? RhodiumToad: as far as I know, with-error-to-port only affects scheme code in the current dynamic context, it doesn't do an OS-level redirection nios34: Hello. I want to translate the GNU Guile Manual. So, where are the sources of that? And, how to build that? heisenberg-25: I have the following issue. When I call (dynamic-link "liba") from the guile repl it works. But if I add this to a scm file and try to compile that scm file with autotools I get dynamic-link: file: "liba", message: "file not found" error. Has anyone had similar issue? It's kinda annoying str1ngs: heisenberg-25: does using (dynamic-link "/full/path/to/liba.so") help? str1ngs: heisenberg-25: also which OS distro are you using? heisenberg-25: str1ngs: using the full path still fails. I am using Mac OS ArneBab: RhodiumToad: do you know how to change the error-port of open-pipe? str1ngs: ahh on MacOS it's probably liba.dynlib str1ngs: IIRC ArneBab: I’ve also been searching for that multiple times, but I don’t think I found a solution. str1ngs: heisenberg-25: is LD_LIBRARY_PATH set at all? heisenberg-25: yeah, but setting the lib extension doesn't fix it str1ngs: where is liba.dynlib btw/ str1ngs: guile will search known library paths and add the right extension so it should work. when using guile repl and dynamic-lib is the library useable? heisenberg-25: LD_LIBRARY_PATH is set and includes the directory where the lib resides. heisenberg-25: the odd thing is it works from guile repl and also compiles for other libraries in the same dir. it just for a particular library it is refusing to link str1ngs: from the guile REPL does (getenv "LD_LIBRARY_PATH") output the path as well? str1ngs: the only thing I can think is when building with autotools (getenv "LD_LIBRARY_PATH") is not set. maybe have the module/file print that first see if it differs when you are building mwette: maybe LD_LIBRARY_PATH=/path/to/dir guild compile mylib.scm mwette: ls str1ngs: - irc: ls: command not found :P mwette: :P heisenberg-25: str1ngs: You are right. (getenv "LD_LIBRARY_PATH") returns the correct value from the guile repl. but empty when I try to display from the file minerjoe: ArneBab: Yea, I know about popen, but it doesn't give me a pipe to stderr. It looks like above you were attempting? Any luck? minerjoe: You'd think there has to be a way in guile to do something like (system "foo") and get the output of stdout and stderr? RhodiumToad: ArneBab: ok so I was slightly wrong RhodiumToad: ArneBab: open-pipe _is_ supposed to inherit current-error-port, but _only_ if it is a port that has a file descriptor, which string ports don't. dsmith-work: Happy Friday, Guilers!! dsmith-work: nios34: In the doc/ref dir in the guile sources minerjoe: RhodiumToad: I'm attempting to port shellpool http://github.com/jaredcdavis/shellpool from common lisp to guile and hit the snag that in CL when I open a subprocess I get two output streams, one for stdout and one for stderr. That library uses that to perform a small bit of magic. With guile, the stderr part seems to have been conspiculously left out. Is there a reason for this and is there a way to do that? mwette: maybe guile needs a pipe-cleaner dsmith-work: Maybe some combination of with-error-to-port and pipe to make a pipe for stderr, wrapped around the "normal" subprocess piping.. dsmith-work: minerjoe: How does CL handle having pipes from both stdout and stderr without deadlocking? As in you are blocked reading from the stdout pipe and the subprocess is blocked writing to it's stderr. dsmith-work: Or maybe that can't happen? ArneBab: RhodiumToad: is there a way to create a port with a fake filedescriptor? RhodiumToad: fake? RhodiumToad: you'd have to create a pipe and handle reading from it safely yourself RhodiumToad: and as pointed out already, deadlock is a huge problem dsmith-work: Yeah. I wonder how CL handles that. ArneBab: RhodiumToad: could I make a read-write pipe and only read from it after the other pipe is closed? RhodiumToad: that risks exactly the deadlock problem RhodiumToad: if the child process fills that pipe buffer then it will block RhodiumToad: resulting in it never closing the stdout pipe ArneBab: then you’ll need a thread that reads? RhodiumToad: or to do all your reading in a nonblocking or multiplexed fashion ArneBab: how can I do that? ArneBab: I’m asking, because that is a very common usecase RhodiumToad: looking at the guile docs, it does support all the low-level operations you'd need to be able to do this in guile, I think RhodiumToad: see "ports and file descriptors" in the docs RhodiumToad: oh, for another approach see the "suspendable-ports" module RhodiumToad: see under "Nonblocking I/O" in "Input and Output" ArneBab: RhodiumToad: got it working without nonblocking for now: (import (ice-9 rdelim) (ice-9 popen) (rnrs io ports))(let* ((err-cons (pipe))(port (with-error-to-port (cdr err-cons) (λ()(open-input-pipe "echo 1; echo 2 >&2"))))) (list (flush-all-ports) (read-delimited "" port) (close-port (cdr err-cons)) (read-delimited "" (car err-cons)))) ArneBab: minerjoe: see above ArneBab: it still works after (import (ice-9 suspendable-ports))(install-suspendable-ports!) ArneBab: here’s a re-usable solution: ArneBab: (import (ice-9 rdelim) (ice-9 popen) (rnrs io ports))(define (call-command-with-output-error-to-string cmd) (let* ((err-cons (pipe))(port (with-error-to-port (cdr err-cons) (λ()(open-input-pipe cmd))))(result (read-delimited "" port))) (close-port (cdr err-cons)) (values result (read-delimited "" (car err-cons)))))(call-command-with-output-error-to-string "echo 1; echo 2 >&2") minerjoe: ArneBab: works! thank you! ArneBab: minerjoe: not that this might deadlock: if you exceed the buffer of the pipe, it is likely to deadlock. minerjoe: ArneBab: I think get it now. Its due to the read from stdout preceding stderr, so if the subprocess floods the buffer it will block? ArneBab: yes ArneBab: you’d need to alternate between reading from stdout and stderr to avoid that. Suspendable ports should allow for doing that, but I don’t understand it well enough to do this quickly. ArneBab: https://www.gnu.org/software/guile/docs/master/guile.html/Non_002dBlocking-I_002fO.html RhodiumToad: the idea is that with suspendable ports, you can provide a handler that's called when there's no data yet to be read, and that handler can abort-to-prompt to get out of the pending read and do something else, such as checking whether the other port is readable ArneBab: That’s what I understood. What I did not understand is how I’d use its API in actual code … RhodiumToad: prompts are a bit brain-twisting, though RhodiumToad: it took me a few days to get the hang of shift/reset ArneBab: I wrote down the current implementation with a pointer to non-blocking IO: https://www.draketo.de/software/guile-capture-stdout-stderr.html pkill9: is there a plugin for emacs for command completion of guile? pkill9: that also describes arguments chrislck: Any (ice-9 match) gurus here? Qu: about (? pred?); I know we can match eg: (match item (((? item->name this) . rest) ...)) and use "this" binding. chrislck: Is it also possible to use the output of (item->name this), knowing the output isn't #f ??? RhodiumToad: hm, I suspect not, but I'm not at all sure chrislck: It's a "would be nice to have" missing feature minerjoe: pkill9: I use geiser. It has autodocs. minerjoe: ArneBab: Nice blog. Spelling mistake "dependyng" ArneBab: ah, thank you! minerjoe: Folks, has there been movement in adding an inspector to guile+geiser, ala SLIME. Not trying to be CL is better, just a wonderful feature that I use all the time. ArneBab: what does it do? minerjoe: ArneBab: Lets you explore the entire system. Drill down into objects, lists, packages, etc. minerjoe: Just found (oop goops describe). minerjoe: So the machinery is there, I'll just need to whip up some elisp. ArneBab: nice! dsmith-work: I've heard a lot of great things about slime. Make me want to learn CL just so I can use it.. minerjoe: dsmith-work: I've been primarily a CL developer for over 10 years. Guile+geiser is great! don't get me wrong, but it does feel more like a toy in comparison to SBCL+SLIME. minerjoe: That said, I wouldn't be doing what I am now with SBCL, way too heavyweight to embed. minerjoe: dsmith-work: Also, SLIME is great, but SLY is better. dsmith-work: Sylvester the Cat's Common Lisp IDE. Interesting... minerjoe: dsmith-work: It has a really nice integrated tracing system. You just trace up all the functions you care about, run your code, and analyze the results in a dedicated emacs buffer. dsmith-work: I did something in emacs the other day tracking down a problem. Might have been tracing. Was *amazing*. I want that for Guile. dsmith-work: Needed to instrument the function you wanted to trace. minerjoe: Not to jump on #guile and crap, just observations. I truly like some of the decisions that scheme made. Useing a lisp-1 is pretty cool. minerjoe: dsmith-work: Yea. I'ts just move the cursor to the symbol, and hit a keybinding. dsmith-work: Guile does have some kind of tracing, but I've neved used it. Well, I just tried to in Geiser a few days ago and it didn't go well. dsmith-work: Locked up the emacs<->guile connection. Had to kill emacs. minerjoe: I've been reading up on guile's tracing but haven't got it to work for me though. Does anyone else use ,trace? I've been trying to emulate CL's tracing with trace-calls-to-procedure but I'm not getting any output. Even the simple example in the manual is not working. I'm thinking its not returing the tracing info to the geiser port but rather it's ending out stdout(err?) which I have no access to. minerjoe: dsmith-work: Yea, ive noticed that geiser<->guile gets confused. One really nice thing about SLIME is that if the REPL hangs you can usually just C-c to send a signal and break into the integrated debugger. With geiser I have to close the buffer and reconnect. minerjoe: losing my work, as the C-c before would leave me at the stack frame that is hanging. minerjoe: dsmith-work: If you don't use geiser, how do you interact with guile? From the shell? dsmith-work: I sometimes use geiser. Mostly from shell. dsmith-work: I think geiser mostly looks at a scheme repl. It's looking for a prompt, for example. dsmith-work: While slime has it's own protocol with code that runs in the lisp process. minerjoe: dsmith-work: Yea, thats the fundamental difference. minerjoe: Wonder how much work it would be to implement the SWANK protocol in guile, which would give us SLIME. minerjoe: And a more robust emacs<->scheme interface. terpri_: minerjoe, i concur re: geiser vs. slime. geiser is generally great though terpri_: it's been done before for Scheme48 (SLIME48), probably a decade ago terpri_: there's also the possibility of supporting common lisp in guile, and simply making sure any of slime's nonstandard requirements are supported minerjoe: terpri_: Yea, its hard to type "constructive criticism" about people babies. I truly like geiser. dsmith-work: Geiser *is* great to have. dsmith-work: And jao is awsome too. ;^} pkill9: how do i trigger geiser to give me a completion? dsmith-work: Hmm. https://github.com/ecraven/r7rs-swank and it has https://github.com/ecraven/r7rs-swank/blob/master/specific/guile.scm dsmith-work: I wonder how well that works minerjoe: pkill9: I think it worked out of the box for me. Looking at my configs I don't see anything specific. pkill9: oh, i start geiser repl and now it shows me arguments in the statusbar pkill9: how do i have it complete a partially-written function? dsmith-work: C-h m might show something dsmith-work: Like: C-M-i completion-at-point a_v_p: Hello Guilers! I'm trying to use libguile with QTCreator/QMake with some success, should I say. Does anyone tried to go down this path before, or am I in a Guile wilderness somewhere? pkill9: nice i got autocompletion working pkill9: by defualt it's M- pkill9: but there is geiser-smart-tab-mode so you canjust use tab minerjoe: dsmith-work: Tried to get the r7rs-swank to run, doesn't seem to work with latest guile. Investigating. pkill9: how do i make emacs run `run-guile` when it opens a scheme file? dsmith-work: pkill9: Don't remember off hand. Somewhere in emacs "customize" I think. justin_smith: surely there's a "scheme-mode-hook" where you could add your function that starts guile? that's the sort of thing I remember doing 8 years ago when I used emacs justin_smith: https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html justin_smith: scheme-mode-hook is listed as a standard hook here http://ftp.gnu.org/old-gnu/Manuals/elisp-manual-20-2.5/html_chapter/elisp_46.html dsmith-work: pkill9: My config here is minimial: dsmith-work: (use-package geiser dsmith-work: :ensure t) justin_smith: dsmith-work: based on the docs I linked, it should be something like (add-hook 'scheme-mode-hook 'run-guile) dsmith-work: Ya, something like that I have on home machines. justin_smith: the gotcha might be that some buffers that get scheme-mode turned on shouldn't have their own repl justin_smith: dsmith-work: oops, I tagged the wrong person there, meant that for pkill9 dsmith-work: I've got a bit more for paredit: https://paste.debian.net/1157699/ dsmith-work: justin_smith: heh. np minerjoe: pkill9: I doub't youd need a repl for each buffer, rather just one repl you can jump to from any scheme-mode buffer. I bind 'switch-to-geiser to an easy keybinding and then you can jump to it anytime you want. pkill9: RhodiumToad: It worked! thanks! pkill9: I replaced the read-unicode-char function definition with all that paste pkill9: strangely I don't get that error on my vps which is also runnign guix system pkill9: it's running guile 3.0.2, I'm running guile 3.0.4 on my laptop pkill9: guile feels very robust dsmith: What platforms have stack grow up these days? RhodiumToad: I believe the ia64 register stack grows up. IIRC the PA-RISC stack grows up, but that's long defunct. RhodiumToad: if there's any other architectures in recent use that have a stack growing up, I don't know of them. RhodiumToad: above c+p problem turned out to be in xterm, of all places dsmith: PA-RISC. Was that in the old hp-9000's ? RhodiumToad: yes dsmith: With terminals that looked like bullits, sort of. RhodiumToad: HP switched to ia64, iirc dsmith: Ok. dsmith: This was some 30 years ago or so. RhodiumToad: I guess I used them in the mid 90s or so? RhodiumToad: basically ia64 was an attempt to fold pa-risc and dec alpha and i386 together to create a new and better processor RhodiumToad: the fact that it ended up nicknamed "Itanic" indicates how well that went RhodiumToad: afaik HP ended up committed to using it because they'd burned their boats on pa-risc development in the process RhodiumToad: postgresql buildfarm still has one pa-risc system and a couple of ia64 systems in it dsmith: That hp system I used could boot from tape. And by that I mean mount the tape as the root fs. dsmith: You could cd to a different dir and the tape would seek and spin. I was very surprised. RhodiumToad: not sure I ever tried that dsmith: The tape (and the disk) was using hpib for the bus. (Called gpib these days) RhodiumToad: that sounds a lot older than the one I used. dsmith: Our disk crashed, and I needed to boot from tape to format and restore and stuff. RhodiumToad: scsi was king then dsmith: They regularly made tar backups, but you couldn't restore from them. RhodiumToad: huh RhodiumToad: that seems to be a problem :-) dsmith: Had to boot from that tape. Bring the os up. Install tar. THEN do the restore. RhodiumToad: ah dsmith: Well, it was a while ago. dsmith: Maybe not install tar. dsmith: I just remember it was hard. dsmith: heh dsmith: The stack were.. different. dsmith: Could it have been a discontiguous stack? RhodiumToad: I don't recall that dsmith: Oh well. Long gone now. RhodiumToad: I do recall it went upwards RhodiumToad: I had to read a bunch of assembler stuff for it because we ran into a compiler bug with the HP compilers dsmith: It seemed like as you pushed it went in one direction, but the frames were out of order. Like each frame was malloced from somewhere. But that just may be because it was growing up and I didn't understand it. RhodiumToad: if you did something like char foo[100]; char *p = foo+50; then &p[-50] and (p-50) did different things RhodiumToad: I recall it had branch delay, but I've forgotten almost everything else about it RhodiumToad: oh, I think it also had inverted page tables? dsmith: http://hpmuseum.net/display_item.php?hw=369 Like that, but the two boxes matched in size. One was cpu, the other disk/tape. RhodiumToad: oh, that looks quite a lot older dsmith: http://www.hpmuseum.net/display_item.php?hw=248 The terminals. dsmith: But it was PA-RISC RhodiumToad: the one I used might have been an F-something? dsmith: Deskop? RhodiumToad: server RhodiumToad: tower case, not rackmount dsmith: Those terminals had the most annoying flow control. ENQ/ACK. dsmith: Had to hit ^E every so often to get more output. dsmith: One of the things I did was change some config (/etc/ttys?) to enable that. Then the terminals actually worked smoothly. dsmith: That place had everything HP. The busness system was hp-4000. The pc's were those dos machines with the first 3.5 in floppys. And of course hp plotters. daviid: seepel: hello, maybe you already know, but g-golf guix package def patch by str1ngs, but i know you did help, made it to ... tx to both of you pkill9: is there a map equivalent for vectors? RhodiumToad: srfi-43 RhodiumToad: guile also accepts vectors as arrays, I believe, so there's array-map! and array-for-each and so on pkill9: nice pkill9: can you loop through an array? pkill9: specifically, a vector mwette: (srfi srfi-43) has vector iterators pkill9: how do you use vector-fold? mwette: (vector-fold (lambda (ix val seed) (+ val seed) #(1 2 3))) => 6 mwette: oops: (vector-fold (lambda (ix val seed) (+ val seed) 0 #(1 2 3))) mwette: starts w/ seed=0 then adds 1, then 2, then 3 to get 6 seepel: daviid: I did see that, and thank you str1ngs! seepel: daviid: strings: I think I found another issue is in the package definition actually. Looking at the documentation https://guix.gnu.org/manual/en/html_node/package-Reference.html#index-inputs_002c-of-packages it seems to indicate that the runtime dependencies should actually be in propogated-inputs rather than inputs so that guile can find them at runtime. pkill9: i did it pkill9: i used vector-map pkill9: so 'seed' is the position in the vector? daviid: seepel: ok, i can only tx you when you update patch the pkg def, but can't really help doing it ... i'll let you and str1ngs analyse and possibly fix the problems on the guix side of things ... but tx again seepel: No problem, happy to do so, just have to find the time to test my hypothesis :) daviid: if/when you fix the package def or any other update that pushes a new pkg def on guix, always try to take the latest commit 'again', and ask me i doubd, because i push almost every day ... seepel: daviid: While I have you, I am now getting an error when running g-golf, but haven't really looked too deep. Is it obvious to you what I might've messed up? https://paste.debian.net/1157480/ daviid: seepel: ok, can you see this with str1ngs, he had a similar problem in the past and that is only on guix ... i can't help sorry daviid: str1ngs: could you, when time avail of course, help seepel with the problem he just pasted ... many thanks seepel: daviid: No problem, thanks for the pointer, I suspected as much. Not urgent for my project progress. I've got a couple days of email parsing work that doesn't need UI anyway. daviid: seepel: iirc, this happens when there is more then one gobject introspection lib available, but i don't garantee, my memory is ... not that good :) seepel: That would make sense, thanks. daviid: seepel: wc! i wish i could help ia better way, but i can't :) daviid: i'm sorry you can't just run that tiny example, but i think str1ngs knows how to solve the problem, let's see seepel: No problem, someday I will learn how to guix :) daviid: seepel: maybe you can poste the paste on #guix as well, don't know seepel: I'll probably try a few different things first. Just to double check that it is actual incompetence rather than accidental incompetence :) daviid: seepel: ok, but i don't thin it is 'incompetence', after you install g-golf, imo, it really should just work ... seepel: daviid: I'm doing other things to run guile 3 in my normal path, and then setting up another environment to run guile 2.2 and g-golf. It is very likely I misunderstood something. And I'm ok being incompetent, it just means I don't know how to do something. I also find I learn a lot by trying different variatons on how I think it is done. daviid: ah yes, guile 3 and guile 2 ... i really would ask on #guix, but ... as you wish of course seepel: Hmmm, I managed to fix the error, but I have no idea how. I basically just re-set everything up and now it is fine. daviid: seepel: ah, well at least it works, maybe you figure 'why' later :) seepel: Fingers crossed. I suppose it was accidental incompetence after all :) seepel: Thanks for the help! daviid: you did everything, tx you ... dadinn: hi all dsmith-work: Hey Hi Howdy, Guilers mwette: o/ civodul: hey ho! str1ngs: sneek: later tell seepel hello. inputs should be fine no need for propogated-inputs here. if you are having a problem with the package can you describe the problem you are having? sneek: Okay. str1ngs: sneek: later tell seepel the error cannot register existing type 'GdkPixbuf' as far as we have determined happens on guix due to different versions of the same typelib being loaded. Which only happens on guix. I found the easiest way to do this is to adjust the gi-import order. see http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/gtk/gi.scm?h=feature-g-golf for nomad does all it's imports from one file. and how it orders str1ngs: it's inputs. sneek: Got it. str1ngs: daviid: ^ how to resolve the cannot register existing type 'GdkPixbuf' on guix when using g-golf. minerjoe: Hello schemers... Long time CL programmer dabbling now with guile as it's a great lisp to power up existing C programs (like Mario and the mushrooms). My main trouble is that I'm having a bit of learning curve to not program CL in scheme (love me some iterate and loop). Is there a good tutorial, or reference, on the idiomatic ways to iterate? At the moment I've just defmacroed up DOTIMES and friends and y'all would probably cringe at minerjoe: some of my code as not the scheme way. I love mapping and such, but how do you map say with an index from 3 to 10. In CL we have the series library which gives you ways to iterate across number ranges functionally. The other need is that in CL I often have to iterate across collections (lists,hash-tables,vectors,etc) COLLECTing things as I go (but not necessarily for every element). What is the idiomatic way to do that with recursion or minerjoe: DO? At the moment I just do it the CL way which is start with an empty list, cons as needed and reverse! at the end. RhodiumToad: some people do like making complex iteration macros a la CL but I'm not a great fan RhodiumToad: I'm also not a long-time schemer so don't take me too seriously RhodiumToad: named-let seems to me to be the most "idiomatic" looping construct in scheme pkill9: btw RhodiumToad, the guile-json library bug with integer->char was fixed: https://github.com/aconchillo/guile-json/issues/58#issuecomment-662815034 https://github.com/aconchillo/guile-json/blob/master/NEWS#L2 dsmith-work: Yep. named-let is my favorite dsmith-work: Not that I know how to write idiomatic Scheme, it's just nice and I like it. RhodiumToad: pkill9: ugh, that seems to have a bug RhodiumToad: pkill9: looks like it's now broken for \uE000 and upwards? RhodiumToad: my version handled that ok, but the committed one doesn't pkill9: ok i made a comment RhodiumToad: minerjoe: btw, don't forget about srfi-1 when looking for list iteration stuff RhodiumToad: minerjoe: and srfi-43 for similar with vectors ArneBab: minerjoe: I nowadays mostly use named let: (let loop ((foo #f) (bar #f)) (cond ((not foo) (loop (not foo) bar)) ((not bar) (loop foo (not bar))) (else (values foo bar)))) pkill9: does there exist Qt bindings for guile? dsmith-work: pkill9: Probably not dsmith-work: sneek: guile-software? sneek: Its been said that guile-software is at http://sph.mn/foreign/guile-software.html dsmith-work: Several gtk things there but no qt pkill9: qml would be good to convert to guile pkill9: since it's declarative aleix: pkill9, RhodiumToad: thanks for catching the errors on guile-json unicode support (twice)! i handled surrogate pairs when building json but completely forgot when parsong. thank you! RhodiumToad: yw RhodiumToad: aleix: you might want to put in test cases for codepoints in e000-ffff aleix: good idea :-) heisenberg-25: Just finished porting fibers to Mac OSX. Phew :) heisenberg-25: wingo: I replaced epoll with libevent but removed the use of wake read/write pipes. Are those really necessary? It is working fine without them and I see you added them to stop from blocking the GC while running the waiting on the fds to become active heisenberg-25: but in the current guile docs, it says that is not necessary, hence why I removed them aleix: heisenberg-25: awesome! i was in the process of doing that as well following: https://github.com/wingo/fibers/pull/27 heisenberg-25: aleix: Ah, I wish I saw this PR before embarking on this. But I learned a lot about guile's low-level interface, which was cool. I will share the code momentarily. aleix: heisenberg-25: i'm very interested to add it to homebrew-guile. it already has more than 20 guile packages :-). heisenberg-25: Here is the code https://github.com/Habush/fibers/tree/libevent heisenberg-25: aleix: that would be awesome! RhodiumToad: heisenberg-25 might have been here heisenberg-25: RhodiumToad: I didn't get what you said? RhodiumToad: old joke aleix: heisenberg-25: that commit looks awesome! RhodiumToad: "kilroy was here" -> "heisenberg might have been here" heisenberg-25: :) heisenberg-25: aleix: thanks. I'm open to feedbacks and make improvements . Also I'll have to look at PR you shared. dsmith-work: heisenberg-25: So. MacOS. Does that also help any BSDs in general? RhodiumToad: there is less similarity between macos and any BSDs than is sometimes believed heisenberg-25: dsmith-work: I think so. But I'm a bit skeptical about the clock related functions. For example, clock_getcpuclockid isn't available on MacOS, but it is available in FreeBSD heisenberg-25: so what I did was, return CLOCK_PROCESS_CPUTIME_ID if the platform is MacOS. I couldn't find any other way to do this. Maybe someone here knows a better/different approach? heisenberg-25: same for pthread_getcpuclockid. It is availabe in FreeBSD but not in Mac OS. Hence, I'm returning CLOCK_THREAD_CPUTIME_ID on Mac heisenberg-25: https://stackoverflow.com/questions/32668240/any-equivalent-function-to-pthread-getcpuclockid-since-i-have-tid-of-thread heisenberg-25: I gotta say, the Guile docs are so well-written and to the point! dsmith-work: That reminds me. Someone was asking about thunks the other day. The manual mentions them all over the place, but has no specific definition. (that I could see) dsmith-work: There are a few places where describing a thunk arg is says something like: "thunk must be a procedure with no argument" justin_smith: isn't thunk a generic term like "function" or "input" (though less common)? justin_smith: I guess it does make sense to link or offer an explanation somewhere dsmith-work: Just saying there probably should be a reference in the Concept index. dsmith-work: Most people with any familiarity with Scheme already know what a thunk is. dsmith-work: "A procedure with no arguments" pretty much nails it. dsmith-work: At first glance, doesn't seem very useful, right? "No arguments? What!?" heisenberg-25: dsmith-work: also the continuation docs could be made more beginner friendly :) justin_smith: dsmith-work: "and optionally computing a useful result" ? dsmith-work: But thunks do have access to the lexical envronment. pkill9: with string-match, how do you match up to a newline? I want to get the "Exec=..." line from a .desktop file, and "Exec=.*\n" matches that line plus all the lines after it pkill9: ah i worked out how, using [^\n]* minerjoe: RhodiumToad: Thanks! dsmith: Isn't nginx supposed to be to latest hotness? pkill9: yes chrislck: alextee[m]: zrythm is super impressive alextee[m]: chrislck: thx. I hope I can figure out more ways to use guile daviid: str1ngs: are you using multiple inheritance in nomad? maybe you told me but i forgot ... str1ngs: davidl: I know for sure with emacsy I have some multiple inheritance. Maybe with g-golf but I can't recall off hand for sure. If it's important I can double check for you? str1ngs: davidl: also g-golf is updated to version: 1-804.5d2903a now in guix. so if anyone needs the latest with guix just make sure they guix pull. str1ngs: sneek: later tell daviid I know for sure with emacsy I have some multiple inheritance. Maybe with g-golf but I can't recall off hand for sure. If it's important I can double check for you? sneek: Okay. str1ngs: sneek: later tell daviid also g-golf is updated to version: 1-804.5d2903a now in guix. so if anyone needs the latest with guix just make sure they guix pull. sneek: Got it. str1ngs: davidl: sorry for the noise that was meant for daviid :) str1ngs: sneek: later tell daviid though for g-golf I would not use something like. (define-class text-widget (gtk-text-view gtk-box)) since multiple inheritance is not supported by GTK. hopefully I understood your question right. sneek: Got it. dsmith-work: Wednesday Greetings, Guilers roelj: Is there an equivalent “add-to-load-path” for the %load-compiled-path? pkill9: roelj: i can't find anything here https://www.gnu.org/software/guile/manual/html_node/Load-Paths.html pkill9: it mention %load-compiled-path dsmith-work: pkill9: Nope. You need to do what add-to-load-path is doing. Look in boot-9.scm dsmith-work: There is also the -C option to guile dsmith-work: Interesting they made that syntax.. *: pkill9 wants to make a guile web scraper roelj: Okay, thanks pkill9: how can you search recursively for in ( . )? pkill9: guile-json produces those pairs for keys pkill9: hmm actually i wouldn't need to do that pkill9: because I already know the structure of the data chrislck: pkill9: are you working with nested-alists? pkill9: im working with nested lists, not sure what an alist vs a list is though pkill9: argh, im able to ping the domain, yet guile keeps saying 'name or service not known' pkill9: yes, alists are what they are pkill9: (key . value) chrislck: feel free to copy from https://github.com/Gnucash/gnucash/blob/master/gnucash/report/html-chart.scm#L47 mwette: pkill9: check the tree-fold routines in (sxml fold) mwette: pkill9: https://wingolog.org/pub/fold-and-xml-transformation.pdf roelj: When I want to conditionally add an attribute in sxml (like this: (sxml->xml `(input (@ ,(if #f `(checked "") '()))))..). What can I put in the place of the empty list to let sxml->xml NOT include it in its XML representation? chrislck: roelj: check ,@ chrislck: ,@ is the bully equivalent of , -- it takes more than 1 space on the bus chrislck: ,@ is the bully equivalent of , -- it takes as much space as it wants dsmith-work: heh dsmith-work: Takes your lunch too? pkill9: i'm constantly getting this: In procedure getaddrinfo: Name or service not known chrislck: :) pkill9: but i can ping and access the website roelj: chrislck: This is exactly what I was looking for, thanks! mwette: roelj: use . : (@ . ,(if #f `((checked "")) '())) roelj: mwette: Why The "."? dsmith-work: pkill9: So what does that suggest? You are using getaddrinfo differently than ping, or maybe ping isn't using get addrinfo? mwette: the difference is (list '@ '()) vs (cons '@ '()) heisenberg-25: Hi, why is the getaffinity procedure not available on non-linux systems? running (getaffinity 0) on ubuntu succeeds but fails for Mac OSx. Is there a work around mwette: and (cons '@ '()) => '(@) heisenberg-25: or is there some flag that I should compile guile with to make it work? mwette: heisenberg-25: hybridkernel.com/2015/01/18/binding_threads_to_cores_osx.html pkill9: dsmith-work: (web client) is using getaddrinfo heisenberg-25: mwette: Thank you, this really helps. I will post question if I run into an obstacle :) dsmith-work: That reminds me. What does it take to use https with the (web client) ? pkill9: how can I deal with unsupported characters in text that gets passed to guile-json pkill9: i want to just replace all non-supported characters in a string basically pkill9: the json parser passes some text to integer->char, and then an error: json/parser.scm:249:2: In procedure read-control-char: pkill9: In procedure integer->char: Argument 1 out of range: pkill9: 55358 pkill9: 55358 i believe is a hugging emoji, lol RhodiumToad: no its not RhodiumToad: 55358 = U+D83E, which is a high surrogate, and therefore not a valid character RhodiumToad: I believe json encodes surrogate pairs separately? so you might have to fetch both parts of the pair and convert them together RhodiumToad: U+D83E could be the first half of U+1F917, which would encode as U+D83E U+DD17 RhodiumToad: i.e. "\uD83E\uDD17" in json RhodiumToad: (U+1F917 == hugging face emoji) dsmith-work: So that's a bug in guile-json? RhodiumToad: if it's trying to decode \uXXXX independently when the value is a surrogate, yes dsmith-work: Ugh. RhodiumToad: (it's kind of ick that json uses that encoding in the first place...) RhodiumToad: haha. "strictly complies to http://json.org specification". RhodiumToad: anyway, yes, definite bug in guile-json. pkill9: guix's guile-json is 3 stable versions out of date, so it may have been fixed, i'll see RhodiumToad: I was looking at what was on savannah RhodiumToad: http://git.savannah.nongnu.org/cgit/guile-json.git/tree/json/parser.scm#n275 holomorph: what happened to ice-9 json RhodiumToad: it is not correct that "Characters in Guile match the JSON representation" so that breaks RhodiumToad: I guess the fix should be to read 4 hex digits, and if the value is in DC00-DFFF throw error, if it's D800-DBFF then read in an immediately following \uXXXX and error if that isn't DC00-DFFF minerjoe: Need some help, please. Tried google, no avail. How do you get guile to output unicode characters? minerjoe: (integer->char 8308) minerjoe: #\20164 minerjoe: (char->formal-name #\20164) minerjoe: "SUPERSCRIPT FOUR" minerjoe: (dispay #\20164) minerjoe: ? minerjoe: This is under geiser in emacs. RhodiumToad: (display (integer->char 8308)) works for me in shell RhodiumToad: possibly something isn't configured to handle utf8? minerjoe: Yea. Just tried shell and it works. minerjoe: Hmm. dsmith-work: Locale settings? daviid: . sneek: Welcome back daviid, you have 3 messages! sneek: daviid, str1ngs says: I know for sure with emacsy I have some multiple inheritance. Maybe with g-golf but I can't recall off hand for sure. If it's important I can double check for you? sneek: daviid, str1ngs says: also g-golf is updated to version: 1-804.5d2903a now in guix. so if anyone needs the latest with guix just make sure they guix pull. sneek: daviid, str1ngs says: though for g-golf I would not use something like. (define-class text-widget (gtk-text-view gtk-box)) since multiple inheritance is not supported by GTK. hopefully I understood your question right. minerjoe: The problem isn't actually in geiser. I have a web app and am trying to output sxml. Using (format #t "~A" #\20164) give "?". RhodiumToad: that also works for me RhodiumToad: what sxml function did you use? daviid: str1ngs: i was just being curious - you may use multiple inheritance in g-golf minerjoe: RhodiumToad: I'm just generating lists with quasiquote. Using format to generate strings. Is there a way to tell guile not to use "?" but the real thing? dsmith-work: minerjoe: Pretty sure guile uses ? when it doesn't know how to encode the charcter. RhodiumToad: yeah, this is a problem with encoding translation minerjoe: dsmith-work: I'm new to guile, old common lisp programmer, just figuring things out. This would be something related to "ports"? RhodiumToad: (sxml->xml `(foo ,(format #f "~A" #\20164))) for example works perfectly for me dsmith-work: ⁴ dsmith-work: IS that what it is? minerjoe: And I'd like to fix the geiser<->emacs so that it works at the REPL also. minerjoe: dsmith-work: yes RhodiumToad: superscript-4 is the character, yes minerjoe: Does anyone here have emacs+geiser that correctly displays unicode? dsmith-work: Works for me. Guile 3.0.4 (format #t "~A" #\20164) minerjoe: dsmith-work: in geiser+emacs? RhodiumToad: minerjoe: what does (port-encoding (current-output-port)) return? minerjoe: minerjoe: $10 = "ANSI_X3.4-1968" RhodiumToad: right. that's the problem then. RhodiumToad: should be "UTF-8" dsmith-work: Yep. Works the same. RhodiumToad: for whatever reason, likely to do with your LANG / LC_* environment vars, the output port encoding is wrong dsmith-work: minerjoe: WHat verison guile? minerjoe: minerjoe: (set-port-encoding! (current-output-port) "UTF-8") minerjoe: This works! minerjoe: dsmith-work: 3.0.4 minerjoe: Thank you! minerjoe: I'm pretty sure I can figure out how to get the web-server to now output. minerjoe: correctly RhodiumToad: it'll be picking up the default for that encoding from LANG or LC_* minerjoe: RhodiumToad: well my LANG=LANG=en_US.UTF-8 minerjoe: RhodiumToad: well my LANG=en_US.UTF-8 RhodiumToad: and LC_CTYPE? minerjoe: RhodiumToad: not set RhodiumToad: output of (system "locale") might be useful minerjoe: student@black ~ % locale minerjoe: student@black ~ % locale RhodiumToad: uh? minerjoe: Eh. pasting failing. Probably ok. All en_US.UTF-8 RhodiumToad: and locale charmap also returns UTF-8 ? dsmith-work: sneek: paste? sneek: I could be wrong, but paste is https://paste.debian.net dsmith-work: minerjoe: Could the environment for your shell and your web server be different? RhodiumToad: almost certainly will be minerjoe: Na. I just ran (system "locale") at the start of the app and it's all en_US.UTF-8 minerjoe: I'll investigate. I can just force it. RhodiumToad: if the current output port isn't the default one for guile's stdout, then whatever created it might be setting the encoding minerjoe: RhodiumToad: yes local charmap = UTF-8 RhodiumToad: aren't charsets fun minerjoe: Do you know what port is used for (format #f ...) ? dsmith-work: Things were a lot simpler back when everything was just american english. Bytes were Chars and Chars were Bytes... dsmith-work: That makes a string port, right? minerjoe: dsmith-work: I think. But don't know how to set the encoding? RhodiumToad: format #f just returns a string dsmith-work: Calls (open-output-string) RhodiumToad: so there's no encoding issue with that minerjoe: My (format #f) gives the "?" minerjoe: investigating RhodiumToad: no, it's when the result returned by the format #f is being displayed that it gets changed to ? minerjoe: That makes sense. dsmith-work: Ok. heisenberg-25: is using scm_without_guile really worth it? The doc says it provides small optimization for the GC but is it worth the extra line of codes and adding wake pipes? RhodiumToad: i.e. (eq? (string-ref (format #f "~A" #\20164) 0) #\20164) should be #t unconditionally, regardless of any encoding settings RhodiumToad: er, should probably be eqv? RhodiumToad: though in guile eq? will work too dsmith-work: Ah. Yes, guile strings can be "wide". *: dsmith-work has been doing lots of Rust lately.. minerjoe: RhodiumToad: I've narrowed down the problem to scm_to_locale_string, which is converting the guile string into the C string that the web-server is serving. Any idea how to set the locale for that? minerjoe: Apologies if this is a RTFM. RhodiumToad: the "current locale" RhodiumToad: is this guile embedded in something, or the guile REPL binary? minerjoe: Its embedded. RhodiumToad: ah. so it's possible that the environment didn't do setlocale, and is therefore in C locale. pkill9: i tested latest stable guile-json and it still fails with the error i was talking about, gonna report bug RhodiumToad: what does (setlocale LC_CTYPE) return in the embedded environment? minerjoe: RhodiumToad: will see minerjoe: RhodiumToad: That works! Thanks! I just added setlocale(LC_CTYPE, "en_US.utf-8") to the main() and we're off and running. minerjoe: And geiser is now working with unicode also. RhodiumToad: note that setlocale(LC_ALL,""); is the more standard way minerjoe: RhodiumToad: Ok. I'll see if that works. RhodiumToad: you don't want LC_CTYPE set differently to the other locale settings in general. RhodiumToad: the default if setlocale is not called is equivalent to setlocale(LC_ALL,"C"); using "" means "read the LANG and LC_* environment variables" dsmith-work: The guile exe does setlocale(LC_ALL, "") dsmith-work: (depending on the value of env var GUILE_INSTALL_LOCALE) RhodiumToad: right. The snag from the point of view of embedded usage is that the locale set by setlocale() affects the whole process, sometimes in unexpected and very bad ways dsmith-work: That happens *before* guile calls scm_boot_guile(), btw. dsmith-work: References this: https://lists.gnu.org/archive/html/guile-devel/2011-11/msg00041.html pkill9: RhodiumToad, could you tell me what to put and where to fix this? This is where the error occurs: https://github.com/aconchillo/guile-json/blob/master/json/parser.scm#L282 I guess the fix should be to read 4 hex digits, and if the value is in DC00-DFFF throw error, if it's D800-DBFF then read in an immediately following \uXXXX and error if that isn't DC00-DFFF minerjoe: RhodiumToad: Thanks for the help! Happy hacking! minerjoe: dsmith-work: you too! RhodiumToad: I'd change that function to something like read-hex-val removing the integer->char, and write a new read-unicode-char dsmith-work: minerjoe: Things are working fine for me. Was just pointing out that the guile exec calls setlocal before "booting" the library. A C application (that uses libguile) needs to do that too. RhodiumToad: which would read one hex val, return it via integer->string if it's <#xD800 or >#xDFFF, and process the surrogate pair otherwise minerjoe: dsmith-work: Yes. Thank you. Was the info I needed. RhodiumToad: rough draft: https://dpaste.org/muUo RhodiumToad: pkill9: ^^ RhodiumToad: meh, dpaste has contracted a bad case of tabdamage RhodiumToad: try https://dpaste.org/1Xc9 RhodiumToad: huh, actually maybe it's my c+p that's at fault, have to look into that daviid: str1ngs: tx for the g-golf guix pkg patch daviid: str1ngs: wrt your other quiz, i really wish not to change anything 'at that level' daviid: str1ngs: i hope you can find a hack, but note that make distcheck entirely removes build-aux cyclopsian: are any guile-cairo maintainers around? cyclopsian: I'm considering removing the smobs from it and using foreign objects instead RhodiumToad: I guess lloda and/or wingo would be the people to talk to? RhodiumToad: sneek, seen lloda? sneek: lloda was in #guile 10 days ago, saying: (help) doesn't seem to like it when I export from a macro. RhodiumToad: sneek, seen wingo? sneek: I last saw wingo in #guile 26 days ago, saying: all hail godbolt. cyclopsian: hmmm, actually it seems this was brought up a few months ago by someone else https://github.com/spk121/guile-gi/issues/82#issuecomment-605711588 str1ngs: daviid: touch is more of a hack. ideally build-aux/config.rpath is generated by gettext which adds config.rpath to EXTRA_DIST so distributing config.rpath is pretty normal. anyways was more of a FYI I'll work around it. str1ngs: daviid: specially it's generated with gettextize I meant. str1ngs: cyclopsian: I was going to mention someone has done that work already. also total worth switching from vim to emacs from my expierence. dsmith: Also, emacs is fun to hack! cyclopsian: str1ngs: oh cool, is the patch anywhere public? I couldn't find anything about it on guile-user str1ngs: cyclopsian: spk121 did the work think this is the right repo https://gitlab.com/spk121/guile-cairo greyeax: is there a library for interacting with REST APIs? cyclopsian: thank you! greyeax: artanis /kinda/ looks like what i want, but i cant tell... cyclopsian: greyeax: Artanis is for making REST APIs cyclopsian: there is a "web client" module included that can send http requests, but I've never tried it cyclopsian: https://www.gnu.org/software/guile/manual/html_node/Web-Client.html pkill9: how do you read a guile file in guile? rlb: pkill9: depending on what you mean (open-input-file "something") and then the various read commands. dsmith: pkill9: Do you mean how to read s-expressions? rlb: heh dsmith: pkill9: That's real easy. (read) rlb: i.e. or get-string-all, get-bytevector-all, etc. rlb: depending on what you want... dsmith: Used to use read-delimited, with a delimeter of "", so the whole file.. *: rlb has found that scheme (and guile) has moved along a good bit while he was preoccupied elsewhere. pkill9: dsmith: I'd like to open a guile file and modify it dsmith: pkill9: I would think it would be best to do that by expressions, instead lines or whatever. Then you can manipulate that as lists, using the full power of scheme. pkill9: yea that's wha ti want to do pkill9: to be honest since what I'm using is a record, I can just reconstruct the whole thing each time dsmith: (read) will do that for you. Reads by exprssion, not the whole file. pkill9: ah great dsmith: But you just loop or fold over that, or whatever until eof. pkill9: can you do the same in order to write? e.g. rewrite a specific expression? pkill9: like the second expression in the file pkill9: tbh what i'm trying to do would be better just rewriting the whole file each time dsmith: Yes, that's what you would need to do. dsmith: What are you wanting to do? dsmith: Does it need to be read/viewed by humans? dsmith: If so, you might want to use a pretty-printer. pkill9: I'm making a guix package definition generator, and I want it to be able to edit the package definition - though probably better to make a new script for editing the package definitions pkill9: yea I use that pkill9: i want to make an ncurses interface where you can do common changes to the package definition, like adding/removing an input, adding configure flag, etc dsmith: If you want to keep a hand-edited format of the file, like keeping comments, you probably can't just use read. pkill9: hmm yea, no worries about that greyeax: cyclopsian: tyty pkill9: why does running this return a bunch of numbers in the content I believe: (http-request "http://www.reddit.com/r/modhelp/comments/.json") pkill9: found ithttps://www.gnu.org/software/guile/manual/html_node/Bytevectors-as-Strings.html pkill9: i'm getting this error while trying to convert a json string to scm: In procedure integer->char: Argument 1 out of range: 55358 pkill9: anyone know what it means? pkill9: I believe it may be due to an emoji dsmith: pkill9: Not a valid unicode codepoint perhaps? pkill9: I tested a different subreddit and it worked pkill9: yea i think so dsmith: Prob guile doesn't do emojis pkill9: and searching that number brings up a post mentioning a hugging emoji pkill9: how can you search for a nested pair recursively? I want to get all of particular keys after converting json to scheme dsmith: Urr? https://www.zrythm.org/en/ https://docs.zrythm.org/group__guile.html alextee[m]: hehe, my mess is popular on the internets now \o/ alextee[m]: sorry alextee[m]: dsmith: see https://manual.zrythm.org/en/scripting/intro.html alextee[m]: it's not much exposed but i can use it for unit tests now too, it's pretty cool how many use cases it has dsmith: Ok, I gots to play with this some alextee[m]: source for the guile stuff is here https://git.zrythm.org/cgit/zrythm/tree/src/guile mwette: sneek: later tell pkill9 to read/write scheme files look at last lines of http://git.savannah.nongnu.org/cgit/nyacc.git/tree/module/nyacc/lang/c99/ffi-help.scm sneek: Will do. mwette: sneek: later tell pkill9 call-with-input-file ... call-with-output-file sneek: Will do. dsmith-work: Tuesday Greetings, Guilers chrislck: ok this is funny: https://erkin.party/blog/200715/evolution/ RhodiumToad: heh chrislck: I wonder where wingo's at a_v_p: Hello Guilers! str1ngs: hello a_v_p stis: yay, got the python unittest library to work with python on guile stis: also hello guilers! dsmith-work: stis: Woah. Congratulations! dsmith-work: stis: Wait. You got the library working, or you got all tests passing? stis: well hold on, just got the library working, but now I can start working my way through cpython unit tests ... stis: It's a quite huge take to make a cpython on guile. dsmith-work: stis: It is an amazing task. stis: and then I want it to interact with guile. For example a simple return returns an implicit None, but to interact with guile you want it to retrun zero arguments, so a lot of effort is going into making the transition between python and guile seamless ArneBab: stis: wow! cool! alextee[m]: is there a guile web server that's suitable for production use? alextee[m]: i kinda don't get apache alextee[m]: i would need redirection to say docker ports and things like that alextee[m]: maybe i'll just use this https://www.gnu.org/software/guile/manual/html_node/Web-Server.html wonder what guix's websites use alextee[m]: on a systemd based server i guess i would have to write systemd configurations myself to make it run on reboot though daviid: alextee[m]: gnu artemis? daviid: sorry, i meant gnu artanis - https://www.gnu.org/software/artanis/ alextee[m]: oof, i was reading something about a DNA sequencer. thanks daviid: alextee[m]: i don't know about guix servers, but most of the guix web-sites are powered by haunt daviid: here is haunt - https://dthompson.us/projects/haunt.html alextee[m]: i already have some static websites and a few services like redmine alextee[m]: i just need a web server to expose them daviid: alextee[m]: and so is guile's web-site, powered by haunt ... alextee[m]: oh i thought haunt was somehow integrated into the web server stuff daviid: ok, really not my domain, but i wanted to point to artanis .. so you may read and see ... alextee[m]: i saw a guile-haunt on github alextee[m]: the docs look very nice for artanis, thanks! daviid: wc! alextee[m]: heh: Although GNU Artanis has good server core, I would recommend you use Nginx as the front server. In addition to the enhanced performance, it'll also be less vulnerable to attacks. alextee[m]: maybe i can keep apache and only route some things to artanis as a start daviid: i'll let others how know help you with thoase quiz .. seepel: Ahhh, good call out. I'll definitely need webkitgtk as well. pkill9: what's the character predicate for forward-slash? pkill9: found it, #\/ RhodiumToad: #\ followed by any character is a character literal whose value is that character rlb: Unless I missed it, be nice to include some documentation regarding the pipeline error handling, i.e. what happens if any given process fails, how is the exit status computed, etc. Perhaps even nicer if we had something like bash's PIPESTATUS. dsmith: rlb: That newish pipe commmand returns a list of pid's. (along with the in fd and out fd) dsmith: I guess that's so you can call wait on them to get result status rlb: Ahh, ok - that'll work. No way to get stderr, but that's not critical atm. Thanks. dsmith: rlb: And that newish function is "pipeline". rlb: right str1ngs: daviid: were you looking for my help yesterday? I must have missed that seepel: str1ngs: He was recruiting you to help me install g-golf in guix. I've since managed to sort myself out. Turns out there was a bug in the package definition, and I didn't realize that g-golf didn't support guile 3 yet. dsmith: pkill9: You know, I think that's just the way readline works. dsmith: pkill9: Just noticed at a bash prompt, when completing an exec or a filename, it *also* adds the space. str1ngs: seepel: does the guix g-golf definition have a bug? str1ngs: seepel: daviid I notice you want the latest g-golf to work. I'll look into to it. I need to update nomad to use the latest g-golf as well. daviid: str1ngs: i was away from the kb, but i think seepel did solve that problem - by all mean, i'll let you (two) solve that problem str1ngs: daviid I've been pretty busy the last two months. I should make some time to get back upto speed with g-golf. seepel: str1ngs: Yes it seems to, the guile-lib package seems to point to guile 3 but is needed for the g-golf tests which look for it in the 2.2 site directory so the check phase fails. seepel: I have a modified version which seems to work, hoping to find some time tomorrow to figure out how to submit a patch :) str1ngs: seepel: right should just be a matter of using guile2.2-lib for the input. daviid: str1ngs: np! nothing changed, at least from a nomad usage pov - i'm working on the manual at the moment, the only thing that will change in the future, for nomad, is the way interfaces are being handled daviid: str1ngs: of course i'll let you know, but for the time being, everything is 'the same' ... str1ngs: daviid: sounds good. sorry I missed your highlight yesterday. seepel: str1ngs: Yup, that's the conclusion I came to as well. My only question is if guile2.2-lib should also be in the native-inputs considering they are needed for the build. str1ngs: seepel: I added guile-lib as an input g-golf when I submitted it and it passed review. So lets assume that's okay for now. str1ngs: I would also bump the git hash to whichever daviid thinks is the best. if git HEAD is fine the use the latest hash of cource. str1ngs: course* seepel: I did bump the hash. Actually, another question I had was how I should bump the version. Right now it is (git-version "1" "683" commit) str1ngs: seepel: one sec there is an easier way to do this. daviid: str1ngs: seepel yes, yu may pick-up the very latest commit, which adds doc to tell how users may configure g-golf ... seepel: I meant the guix package version. str1ngs: seepel: actually this wont' work for g-golf because it does'nt have tags. use git rev-list --count HEAD to get the revision. so (git-version "1" "804" commit) should work seepel: str1ngs: Perfect, thank you! str1ngs: maybe daviid will be nice and tag alapha release :) str1ngs: seepel: see emacsy-minimal for an easier way to get a version for git. but it relies on release tages daviid: str1ngs: asap, but not too early either ... we will have to make this guix update danse a few more times i'm afraid ... str1ngs: daviid: no worries just a single alpha release tag would be useful. but because this is a GNU project I'm guessing you want to be more strict about release tags. str1ngs: seepel: with the emacsy-minimal package you can just use something like v0.4.1-28-gd459ca1 for the commit with (version (string-drop commit 1)) and it's all handle automatically. but I forget how to have git spit out the version tag with the hash. there is away to do it. str1ngs: seepel: ahh I remember git describe :) daviid: str1ngs: i thought it was as easy as copy/pasting the commit id, rehashing the package and 'patch guix' with those two 'simle changes' ... daviid: str1ngs: i won't 'alpha release' until i have full interface implementation, a complete user manual part and a few more other 'minor' things ... daviid: and i also hope to have proper 'callbacks' (which is not exactly a piece of cake ...) in the alpha release str1ngs: daviid: still need to had the git revision from rev-list --count HEAD. to get a version for guix daviid: mean while, I also hope to have a few more audacious users, to get rid of as many bugs as possible and augment/fix (missing) types ... str1ngs: but you have it about right. usually with nomad I do a bunch of testing before I submit a patch for guix as well. str1ngs: I'll probably find some bugs in the next couple of days when I get back up to speed. will let you know :) daviid: str1ngs: ok, great str1ngs: daviid if also g-golf working pretty good when I update it. I'll maybe submit the feature-g-golf branch to guix. that should gain more traction for both g-golf and nomad. daviid: str1ngs: excellent, but let's make 'small but sure' steps ... str1ngs: sound good. daviid: str1ngs: i don't remember if you were around when i pushed the feature, but were you g-golf has 'short name method' str1ngs: daviid: I saw some mention of that. I plan to look at that as well tomorrow. I'd rather switch to short names now then later. will save me work. daviid: *but g-golf has 'short name methods' - and syntax name protection - this is now described in the manual as well, along with other 'configure g-golf' things ... maybe worth a quick read ... daviid: str1ngs: ok spk121: . manumanumanu: ArneBab: I have a much simpler one than srfi-134 here: https://hg.sr.ht/~bjoli/data-structures/browse/persistent-fifo.scm. Adding removal of items back and front should be simple enough. It Enqueueing and dequeueing is amortized o(1), like srfi-134, but it doesn't do any balancing, and should be slightly faster than srfi-134 manumanumanu: ArneBab: oops. I shouldn't be half-reading discussions :) manumanumanu: Nice implementation! I have thought about porting the last generator srfis to guile and making a proper package out of it. The make-coroutine-generator on top of delimited continuations is just too nice to not have. Last time I checked, a list-generator on top of delcc was even faster than a list-generator using set manumanumanu: !! manumanumanu: oops. *using set! manumanumanu: not only that, the fifo I linked to can trivially be made a deque with the same amortized o(1) for pushing to the front. pkill9: does anyone know how I could generate the list of inputs used in guix package definitions? they are of the the form `(("package-name" ,package-variable)) pkill9: I want to generate that quasiquote too pkill9: i looked to see how `guix import pypi` does it but can't work out how mwette: not sure what you mean ? (pretty-print '`("abc" ,def)) => `("abc" ,def) pkill9: mwette: i want to generate "abc" and "def" pkill9: as in, I want to produce those programmatically dsmith-work: Monday Greetings, Guilers pkill9: but what i want to do pkill9: is to write the quasiquote pkill9: but programmatically create the abc and def pkill9: I don't know how to compute the abc and def, while adding a quasiquote to the beginning of the list of inputs pkill9: the list of inputs is like so: `(("input1" ,input1) ("input2" ,input2)) pkill9: I want to programmatically generate the names of input1 and input2 pkill9: but I want to then after doing that, add the quasiquote at the beginning pkill9: anyone know how? mwette: Ahh. I ran into same issue but ended up building a list and using eval-string. mwette: (define (acons-defn name type seed) mwette: (cons (eval-string (simple-format #f "(quote `(~A ,~S))" name type)) seed)) mwette: (eval-string (simple-format #f "(quote `(~S ,~A))" "input1" "input1")) mwette: pkill9: ah i see, thanks mwette: I made a Guile Scheme code generator for modules using ffi using bytestructures. pkill9: got it working \o/ thanks mwette pkill9: lisp is the ultimate virus due to it's code-generating-code nature roelj: Is there a way to disable auto-compilation in C code when Guile is "started" using "scm_init_guile"? roelj: I think a call to setenv("GUILE_AUTO_COMPILE", "0") before scm_with_guile isn't working. dsmith-work: roelj: Unlikely to fail, but did you check the return value from setenv ? roelj: dsmith-work: Of course not ;). roelj: Checking now dsmith-work: roelj: I took a quick look at the code that checks the env variable. Hard to see how it could be wrong. dsmith-work: roelj: And it *is* called before scm_init_guile. dsmith-work: Uh, dsmith-work: s/before/from/ roelj: dsmith-work: Yes yes. I've done a minimal test example, and that works! civodul: has anyone parsed xhtml with xml->sxml? civodul: it chokes for me, but there's no line info roelj: civodul: What happens when you remove the doctype? civodul: roelj: it doesn't help RhodiumToad: is your xhtml actually valid xml? roelj: civodul: Hm, this seems to work fine for me: (xml->sxml "Test

Hello!

") dsmith-work: civodul: Is it huge? dsmith-work: (like blowing out a stack or something) civodul: dsmith-work: no no, it's a parse error civodul: on pages like this: https://download.savannah.nongnu.org/releases/guile-json/ civodul: "Wrong character " #\= civodul: "Wrong character " #\= civodul: err RhodiumToad: that page isn't even close to valid anything dsmith-work: https://validator.w3.org/check?uri=https%3A%2F%2Fdownload.savannah.nongnu.org%2Freleases%2Fguile-json%2F&charset=%28detect+automatically%29&doctype=Inline&group=0 roelj: civodul: https://validator.w3.org/check?uri=https%3A%2F%2Fdownload.savannah.nongnu.org%2Freleases%2Fguile-json%2F&charset=%28detect+automatically%29&doctype=Inline&group=0 civodul: ah! RhodiumToad: it just breaks off at the end with bad tags and no proper closing of anything civodul: alright, so it's not the parser that's to blame :-) civodul: ty! dsmith-work: "14 Errors, 13 warning(s)" dsmith-work: roelj: heh a_v_p: civodul: Hello! I've sent a new Guile-SSH release announcement to "guile-user" ML almost two days ago, but the message didn't appear in the ML yet. Am I missing something? dsmith-work: I wonder how htmlprag will do on that.. pkill9: any idea why this json is failing to be read by guile-json's (json-string->scm)? https://www.reddit.com/r/modhelp/comments/.json pkill9: i put it in a variable with (define a (readline)) and pasted it into the terminal a_v_p: There was Guile-SSH distribution archive with a GPG signature attached to the email -- probably, that didn't pass some mail filters on ML? If so, I can re-send the announcement without the archive. pkill9: then (json-string->scm a) errors with ice-9/boot-9.scm:1669:16: In procedure raise-exception: pkill9: In procedure integer->char: Argument 1 out of range: 55356 heisenberg-25: I am getting a no code for module error while building a guile project. File A defines module
and it is imported by file B. But compilation of file B fails with no code for module . I am using autotools to build the project str1ngs: daviid: hello, one small issue I've found with g-golf's autotools. In autogen.sh config.rpath is generated using touch. would it be possible to just add a empty build-aux/config.rpath to git tree. This would help with autotools projects that use g-golf as a sub project. for example I use g-golf as a sub project here https://gitlab.com/mike.rosset/nomad-3rdparty . which makes it easier to install nomad dependencies that do not exist str1ngs: normally, like emacsy and shroud. roelj: How would I set the *random-state* from C? scm_c_define("*random-state*", ...)? str1ngs: roelj: it's easier to use the SCM_DEFINE macro see clear-image in https://www.gnu.org/software/guile/manual/html_node/Function-Snarfing.html . there is also a SCM_DEFINE_PUBLIC str1ngs: in the case of clear-image you can then use clear_image from C. if I'm understanding your question roelj: str1ngs: Does this also work for variabels that are already defined? str1ngs: roelj: aww one sec scm_c_define binds a variable not a procedure. once sec I'll explain how to set the variable . roelj: str1ngs: I see there's scm_variable_set_x, but I don't know how what to pass to it. str1ngs: I think you can get the binding with SCM var = scm_c_lookup ("*random-state*"); which you can then pass to scm_variable_set_x roelj: If there's a better way to initialize Guile's pRNG from C then I'd also like to hear about it :) roelj: str1ngs: Ah, thanks! str1ngs: roelj: also it might be better to use scm_c_public_ref since it's not dependent on the current module. it's what I would normally use here. roelj: str1ngs: IIUC then scm_c_public_lookup doesn't dereference the variable. Why is it important to dereference it? The call to scm_variable_set_x would fail if the variable wasn't bound, right? roelj: str1ngs: Well, it works and I learned something new today. Thanks! str1ngs: roelj: actually in this case you want scm_c_public_lookup to get the bindings. scm_c_public_ref gets the value. str1ngs: does this make more sense? roelj: Oh yes roelj: I didn't realize that difference thoguh str1ngs: apologizes been awhile since I used these. I should have read it more deeply roelj: So, I now do scm_c_public_lookup, followed by scm_variable_set_x. str1ngs: right that seems more correct roelj: How do I catch if something goes wrong? Can I test the return value of scm_c_public_lookup? roelj: The doc says "signals an error", but that leaves me a bit clueless. str1ngs: in this case I would use a catch. but if you use scm_c_public_lookup on a well defined variable the chance of this through an error is next to nil. personally just use higher lever catch str1ngs: s/through/throwing roelj: str1ngs: Do you have an example of a catch written in C? str1ngs: what I do for my C bindings is keep the C function procedures slim. and then write most of the higher level stuff in scheme. so then it is easier to write guards etc. str1ngs: I have an example one sec it's old and not being used now. but should work. it's partly in C++ though but should give you an idea. roelj: str1ngs: Sounds great! str1ngs: personally if you write things right your catches should be in pure scheme anyways. str1ngs: roelj: see http://git.savannah.nongnu.org/cgit/nomad.git/tree/qt/keymap.cpp?h=feature-qt#n86 str1ngs: then see call_proc and eval_handler at top of the file. roelj: str1ngs: Thanks! I see it's actually very similar to the Scheme variant. roelj: This really helps, thanks! str1ngs: no problem dsmith-work: roelj: Might not be the best example, but here is sqlite2 code that calls into scheme and catches and rethrows. dsmith-work: So handlings Scheme (which handles) -> C -> Scheme (which throws) dsmith-work: https://gitlab.com/dalepsmith/guile-sqlite/-/blob/master/sqlite.c roelj: dsmith-work: Heh, I like how it makes sqlite errors catchable.. :) dsmith-work: roelj: That's what the bot has been running for about 15-17 years or so. dsmith-work: (with tuneups for different guile versions) roelj: dsmith-work: What's that SCM_DEFINE followed by a #define? Does it automatically make the function available from guile? dsmith-work: That's part of the snarfer machinery. Basicaly, Yes. heisenberg-25: Is there a libevent wrapper for guile? dsmith-work: The #define FUNC_NAME is for error message roelj: Woah, 15 years is impressive, what Guile version was this initially written for? dsmith-work: Can't remember. 1.8 at least. dsmith-work: But as I said, tweaks for different versions. dsmith-work: roelj: The SCM_VALIDATE_* macros use FUNC_NAME I believe dsmith-work: roelj: But it *has* been the same old db copied around from machine to machine. roelj: impressive, as it seems pretty readable and I don't see any version-specific work-arounds roelj: but I haven't looked everywhere :P dsmith-work: Oh, I had to change the catch/throw stuff I'm sure. dsmith-work: The original code just used a simple makefile. No auto* stuff. dsmith-work: That predates the initial commit roelj: So even back then Autoconf had a high barier of entry? ;) dsmith-work: Hah. Must have been on Guile-1.6 initially roelj: It seems that Guile opens a temporary file on startup. What's that about? dsmith-work: Yes. Autotools and I are still not speaking to each other. roelj: dsmith-work: Haha, still!?! It's been what.. 30 years? dsmith-work: I've only touched autotools twice. RhodiumToad: autotools are horrible, it's just that the alternatives are sometimes worse roelj: Hm, so when I run "guile", I see it opens /tmp/ffiXXXXXX", then the file gets deleted, but it's still in the "open files" list for Guile (so I assume it doesn't close the file?). What's that about? roelj: If I grep the Guile source code, I can't seem to fine anything FFI related that does this justin_smith: roelj: creating, opening, and deleting a tmp file is idiomatic, the OS lets you continue using the file (as you hold a reference to the fd) and the space is reclaimed after process exit justin_smith: that said, I'm not sure what guile does this for, I just know it's a *nix idiom roelj: justin_smith: Ah, what happens when you write to a fd of a file that was deleted? RhodiumToad: it still writes to it RhodiumToad: the file still exists, it just has no names RhodiumToad: (files in unix-like OSes may have no name, or one name, or multiple names) justin_smith: right - the fd lets you do all the standard operations (read, write, truncate) but other people can't find it by name RhodiumToad: I'm guessing this is from libffi rather than guile proper? dsmith-work: It might be the compiler creating the file RhodiumToad: what guile version is this? I don't see it dsmith-work: That calls mkstemp: module/system/base/compile.scm roelj: Hm this is interesting roelj: I use Guile 3.0.4. RhodiumToad: dsmith-work: yeah, but no "ffi" in its template string dsmith-work: Ahh. True RhodiumToad: roelj: does it still happen with guile -q ? roelj: What's more interesting is that "strace -f guile" doesn't show it either, but if you look in /proc//fd, it's there. roelj: RhodiumToad: Yes, with "guile -q" it also happens roelj: It's not a big deal, but I'm curious about it dsmith-work: Yes. Very curious. RhodiumToad: not happening here (on freebsd) roelj: even more interesting *: dsmith-work guesses it's a glibc thing RhodiumToad: again, I'd suspect libffi roelj: Ah it's in libffi (src/closures.c) roelj: The function is called “open_temp_exec_file_dir”. RhodiumToad: wonder why it doesn't happen here roelj: RhodiumToad: The file opening is wrapped in #ifdef O_TMPFILE. Is that something Linux-specific? RhodiumToad: yes roelj: Then I think we have a winner RhodiumToad: but it goes on to do mkstemp or mkostemp if that isn't defined, which does the same thing RhodiumToad: (and that isn't happening here) roelj: Oh right, in open_temp_exec_file_name. alexshendi: Good evening! May I ask questions about chickadee here, or is there a more appropriate place? RhodiumToad: my guess is that that stuff never gets called because it maps in an executable segment some other way. RhodiumToad: ah. I think the file is being used to circumvent security restrictions that prevent a writable mapping from becoming executable. dsmith-work: alexshendi: You can ask, sure. Not sure if the devs for that are around. (better to ask then ask to ask and all that) roelj: RhodiumToad: Aha! RhodiumToad: i.e. with an executable file to back the page, it can make separate writable and executable mappings for it justin_smith: RhodiumToad: I assume this is needed in some form in order to JIT? roelj: I don't understand why this is needed, but then also this is way over my head I think. RhodiumToad: yes, and also libffi needs to be able to construct call trampolines str1ngs: daviid: I've mailed a patch to update guix's g-golf to the latest revision see https://issues.guix.info/42446 pending review of course. RhodiumToad: specifically, it looks like libffi has a "closure" mechanism to construct closures, which will need to create executable trampolines justin_smith: roelj: how's this for a simple version - the underlying system says memory is either read-only and executable, or r+w and non-executable, creating a new file is a way to map something you wrote to, as executable, without the kernel killing you for breaking the rules justin_smith: this is direct execution (machine instructions), not interpretation of some bytecode by a static program roelj: justin_smith: That's a great explanation! roelj: But why is r+w memory non-executable? And why isn't this a problem for non-code-generating code? justin_smith: roelj: it's a security issue - imagine if a buffer is being written to using user input, and they provide a long input justin_smith: and the input is long enough, that their input, gets written over your program justin_smith: this is called a buffer overlflow exploit, this is how hackers get root on your box justin_smith: because in the old model, all your data and your code were in one contiguous memory, and you could let users write over your executable if you didn't check indexes RhodiumToad: note that this is an OS limitation not a hardware one RhodiumToad: it's not hugely effective at preventing exploits, since it does nothing about ROP roelj: Interesting.. How does the kernel differentiate between r+w regions and read-only regions in memory? Or is that info that the compiler provides? RhodiumToad: (which is based on arranging to execute instructions that are already present, rather than writing new ones) RhodiumToad: whether a page is writable or executable or both is controlled by the hardware, specifically the virtual memory translation system dsmith-work: Yep RhodiumToad: for each page in the process's address space, there's an entry that says what physical memory if any is used for that page, and what the access permissions are roelj: Right.. can you recommend a book that explains these things? :) RhodiumToad: ugh, I'm useless at book recommendations roelj: Or any other sources? :D RhodiumToad: anything that has a basic introduction to virtual memory will cover this dsmith-work: roelj: That stuff is usually deep in the kennel, but is also exposed through mmap. See the mmap man page RhodiumToad: yeah, mmap and mprotect are the user-level interface to manipulate virtual memory dsmith-work: Different archs have different vm capabilities. dsmith-work: ppc might have something that x86 doesn't. RhodiumToad: yeah, every cpu design has to make its own tradeoffs between vm functionality and performance justin_smith: I thought ARM 64 bit actually had a way for a higher privelege process to impose read-only access of another process to some memory region justin_smith: not finding that in the docs right now though dsmith-work: But there is some common features that most support. RhodiumToad: and let's not get into the horror show that is i286/i386 segmentation *: dsmith-work shudders RhodiumToad: at least that's all gone in long mode dsmith-work: RhodiumToad: Here are some scary words from the past: large small compact RhodiumToad: been there dsmith-work: And near and far *: RhodiumToad did a _lot_ of 8086 (not even 286) assembly back in the day *: dsmith-work has also been there dsmith-work: RhodiumToad: I was working on a 68K project once, and enjoyed the incredible luxury of allocating a 512K buffer. dsmith-work: It was like hearing a choir of angels, or coming upon a linking book in Myst. RhodiumToad: 68k was so nice *: RhodiumToad did quite a lot of 68k assembler paines: hi paines: So I compiled guile-opengl with guile-3.0.1 from Ubuntu, and it cannot find the module gl, when I now try to use it . I think this is because the installation of the modules happened into /usr/local/lib/guile/3.0. Anyone can help with this ? dsmith-work: paines: Well, as usual with mysterious file finding issues, try to run it under "strace -ffile" to see what it's looking for and where it's looking. dsmith-work: s/-ffile/-efile/ dsmith-work: paines: And compare that to where you think it should be looking. paines: dsmith-work, good idea. it acutally seems to look everywhere except /usr/local/ dsmith-work: So. You installed guile via a package, and guile-opengl from source? paines: exactly dsmith-work: I'm thinking you could add the /usr/local locations to your load-path, or reconfigure/compile the guile-opengl with something like --prefix=/usr (not familiar with that) paines: i think this can be remedied with GUILE_LOAD_PATH paines: or yeah paines: recompile and add the correct prefix paines: yeah. with --prefix it works directly. no hazzle. thanks man! cyclopsian: does anyone know if there is a languageserver client for guile, or some other way to get completions and linting in my text editor? cyclopsian: if not, I may write one soon dsmith-work: cyclopsian: Geiser dsmith-work: Well, assuming your editor is emacs dsmith-work: cyclopsian: https://www.nongnu.org/geiser/ cyclopsian: it may finally be time for me to switch to emacs from vim cyclopsian: :) dsmith-work: cyclopsian: There is also the great evil of using vi key bindings in emacs, if you want. dsmith-work: https://www.emacswiki.org/emacs/Evil roelj: I have an autotools-based project, and I'd like to add the guile modules to GUILE_LOAD_PATH. I created a config file to write the installation path of the guile modules, but those are written as "NONE/share/guile/site/3.0" and "${exec_prefix}/lib/guile/3.0/site-ccache", which are not the final paths. How would I gather the final destination to set GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH to? *: dsmith-work runs away and hides roelj: dsmith-work: Come on, this is your chance to discover the inner beauty of M4 and the unlimited possibilities of a build system! roelj: With GUILE_SITE_DIR I can get the paths of Guile itself, but I'm looking for the paths where my package's libraries will be installed, which isn't always the same. dsmith-work: roelj: Well, take a look at some random package that does the right thing. mwette: kernel.org/html/latest/admin-guide/mm/concepts.html roelj: dsmith-work: Here's the magic AC_DEFINE_DIR: https://fossies.org/linux/nano/m4/ac_define_dir.m4. This Autotools is truly brilliant :P roelj: Ah, I found it: 6.20.10 Accessing Modules from C. Sorry for the noise dadinn: hi all dadinn: I am encountering a problem, I hope someone can explain it: (system* "which" "pacman") throws an error saying "In execvg of which: No such file or directory" dadinn: this is on a live Arch image... it has `which`, this is in a guile repl, `which` works fine when in the shell, but inside guile it fails for some reason :/ dadinn: on my local host machine (Debian), inside a Geiser REPL, (zero? (system* "which" "apt")) returns #t dadinn: so I don't understand what's going wrong inside the Arch live VM... do I have to set some configuration option for guile? dsmith: dadinn: Probably a $PATH issues I suspect. dsmith: dadinn: Or is which a shell builtin, and you are using a different shell? dsmith: dadinn: Might be a good idea and call in the Swiss Army and borrow one of their knives: specifcally, strace dsmith: dadinn: Try using the full path to which, as in "/usr/bin/which" or wherever it is. *: dsmith usually reaches for the bash builin "type" dsmith: as in dsmith: $ type which dsmith: which is /usr/bin/which dsmith: $ type type dsmith: type is a shell builtin dsmith: Just a habit dadinn: dsmith: interestingly it is a shell built in for Arch, while it's a binary on Debian, and Guix :/ dadinn: dsmith: which type dadinn: nothing dsmith: "type" is definitly a bash builtin dsmith: "which" being a program, does not know details about shell builtins and funcitons, only execs on the $PATH dsmith: Depends on your shell. dsmith: The defualt Debian sh is dash I think. dsmith: So, system* eventually calls execvp, which *does* search the $PATH if the named command does not begin with "/". dadinn: dsmith: wow, thanks for that info... there is a package `which` for Arch... so that would solve it! dsmith: dadinn: What shell are you using? daviid: dsmith: I see someone made it to the top HN entries (second entry, 2d ago, not any more of course ...) writing "Bare metal Smalltalk-80 port to the Raspberry Pi", how about you write a "Guile/Scheme port to the Raspberry Pi" :) dsmith: What's to port? It just installs like normal. (now) dsmith: Thanks to the mighty RhodiumToad dadinn: dsmith: under Arch it is zsh daviid: I don't understand why the author named it "Bare metal Smalltalk-80 port to the Raspberry Pi" and not "Smalltalk-80 port to Bare Metal Raspberry Pi" daviid: I thought "bare metal" was meant to be used as "the real thing/server", I didn't know it could be used in conjonction with prog languages dsmith: "bare metal" means no OS dsmith: Writing directly to machine registers, instead of going though layers of drviers. dsmith: That's the way I've always used the term and have heard it used. dsmith: Nothing between your code and the metal of the machine... daviid: ah, i did read the wikipedia entry, superficially admittedly, before to ask here, and the first thing they say is 'thereal server as opposed to virtual machine ...' daviid: dsmith: tx dsmith: Sheesh daviid: I've also always heard that terms within the context of HPC, and bare metal HPC .. daviid: dsmith: whatr is your raspeerry os? daviid: i mean our bot rasp pi os dsmith: Rasbian. dsmith: Oh, that's um. dsmith: Some mildly upgraded Debian dsmith: On a BBB daviid: did you had to adapt guile or just it compile 'put of the box' using gcc dsmith: !uname sneek: Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux dsmith: Just ./congfigure and install daviid: dsmith: ok, i guess not worth an article then :) dsmith: Nope. Nothng to see here. dsmith: Says: Debian GNU/Linux 9 dsmith: Dunno what code name that is. dsmith: It was not installed, though. Upgraded bit by bit. dsmith: dsmith@beaglebone:~$ df -h | grep mmc dsmith: /dev/mmcblk0p2 1.7G 1.6G 34M 98% / dsmith: /dev/mmcblk0p1 96M 72M 25M 75% /boot/uboot dsmith: Not enough space on the little guy to do a dist upgrade dsmith: So deb 9 is "Stretch" drakonis: yup drakonis: and the followup is buster daviid: by the way, whileat somewhat slightly ot subjects, does any one knows if guile will easily compile/install on a libbrem 5 phone? dsmith: Is that Linux arm32? daviid: is there a developer environment we can download and use to try this ... I would like to make sure g-golf works on the librem 5 phones ... daviid: dsmith: i don't know daviid: i think it's a 64bits processor daviid: but i know next to nothiong about proceors dsmith: I would say "probably", but won't know til you try. daviid: right, i wish we try, now :):) dsmith: heh daviid: i would love to read a tut on a dev env dsmith: guile actually cross compiles pretty good. daviid: so i could start to try ... dsmith: At lest using buildroot. dsmith: Needs to be built twice though.. dsmith: Once for runnng on your dev machine for writing out .go files and other stuff. dsmith: And again for actualy running on the target. daviid: dsmith here https://puri.sm/products/librem-5/#specs daviid: it says CPU NXP® i.MX 8M Quad core Cortex A53, 64bit ARM @max 1.5GHz (auxiliary Cortex M4) dsmith: Not sure if the terms are right. "host", "target" etc. daviid: GPU Vivante GC7000Lite dsmith: Ah, one of those multi-arch thingies daviid: and apparently there is a dev env - https://developer.puri.sm/Librem5/ dsmith: I wonder if that the same cpu as this: https://www.avnet.com/wps/portal/us/products/new-product-introductions/npi/avnet-maaxboard/ daviid: i'll look into this asap, but if anyone beats me, plese let me know ... daviid: dsmith: i have no idea, really, not my domain ... dsmith: And I have had Guile 3.x running on that on Debian. daviid: oh, that woud be cool dsmith: On the quad 64bit part dsmith: (My company makes those. Well, the company that owns the company I work for also owns the comapny that makes those..) dsmith: "NXP i.MX 8M Processor with Quad Arm Cortex-A53 and single Cortex-M4F" dsmith: Sure sounds the same. daviid: dsmith: cool! - daviid: i wish i could 'apt-get install librem5-sdk', install guile and g-golf in it, and start to 'play with it' ... daviid: *on my debian laptop I mean dsmith: rlb did upload 3.0.4 debs.. daviid: yes i did see that, but i don't think there is a 'librem5-sdk' yet :) dsmith: https://packages.debian.org/sid/guile-3.0 daviid: i mean a VM running PureOS and you'd see the phone in host window ... dsmith: What is librem ? daviid: the name of the phone dsmith: Audio? dsmith: Ahh! daviid: librem5 daviid: we need at least one guile killer app on the librem5 phone, for yesterday :):) daviid: which might be the uix to start daviid: the GuixOS i mean daviid: or GuixSD daviid: anyway, i'll try to see of there is such a thing as a devel env so i could work on this without actually have a phone ... dsmith: Seems like they want you to use Python. daviid: i won't do that dsmith: I mean, just looking through their docs on building apps for the thing and the examples, I see python but not much about cross compiling stuff.. daviid: dsmith: do you see how to get a deve env dsmith: https://developer.puri.sm/Librem5/Development_Environment/Workstation/index.html daviid: ok will get there, i'm slow :) dsmith: Hmm. dsmith: https://developer.puri.sm/Librem5/Development_Environment/Workstation/Flatpak.html#cross-compiling dsmith: It looks like maybe they are suggesting running the "device native" tools in a qemu environment? dsmith: So instead of cross compiling, you run an arm-native compiler in a qemu vm. daviid: dsmith: I really need help with this, so much not my doimain that i barely understand what i read ... dsmith: Heh daviid: i mean i won't be able to help, but rather will epend on the help of others .. but i'm reading now dsmith: Those docs there seem to gloss over some details.. daviid: i hope i can set-up something ni can start to work on, and get guile in the sdk, thwen g-golf daviid: then a "hello world!" guile app on it ... that would be a good start daviid: what is to gloss? dsmith: Is this that linux phone for about, oh $200 or so? dsmith: "not go into great detail" daviid: dsmith oh no, the librem 5 is $799 dsmith: Ok dsmith: I must be thinking of something else. daviid: the pineapple phone maybe daviid: but i'm interested in debian daviid: pureos is debian daviid: and only have 24h in my days as well :):) dsmith: https://www.google.com/url?q=https%3A%2F%2Fpostmarketos.org%2Fblog%2F2020%2F06%2F15%2Fpinephone-postmarketos-community-edition%2F&sa=D&sntz=1&usg=AFQjCNHq_ySAjDXnpuap7FI5f4xzA5xY2g daviid: one has to start somewhere dsmith: Yeah, pinephone dsmith: FOr about $150 daviid: ah yes, they run pueos as well i think daviid: yep, they run 'Phosh is a phone shell running on top of various GNOME components. It is developed by Purism for their own Linux smartphone...' daviid: anyway, tight nowe, i'd like to have a working env on my laptop daviid: *right now daviid: the entire future of thye all humanity is in these 2 phones :):):) daviid: of course that can only happen if they run guile :):) daviid: and g-golf daviid: :) daviid: [ and guix ] dsmith: librem5 usa is $1999 !! dsmith: $749 for the non-usa dsmith: I'd rather buy an EOB Strat dsmith: https://reverb.com/p/fender-eob-ed-obrien-signature-sustainer-stratocaster?hfid=34669035&utm_source=google&utm_medium=cpc&utm_campaign=9712451747&merchant_id=102084731&utm_content=340753042522&gclid=Cj0KCQjwu8r4BRCzARIsAA21i_B5A8m_2-DbGwhiMnlJfJKECecJaVK-CF1ve2Vv-WUHap1TADKCxBUaAqcKEALw_wcB daviid: dsmith: no, that $1999 is a special edition that comes with a screen and other things, don't remeber but 'like a work station' or so ... dsmith: Sorry for the long links daviid: installing qemu-user-static daviid: let's see daviid: dsmith: i live in a country that taxes 100%, anything from abroad daviid: here, the phone would cost me $1,500 daviid: a stupid country rule, but ... dsmith: That's just such a lot of money for a phone. But they are not really phones, are they, more like pocket machines. daviid: anyway, I'am interested to make 'guile/g-golf' happen on these phones, glad the pinephone runs pureos as well, it's a lot cheaper ... daviid: I've pushed asereis of patches to the manual, tonight i should add a 'betting started', 'Basic example' and 'How to write apps' sec/subsectrions daviid: to the g-golf manual i mean daviid: for who's interested, they have an irc channel, #purism apteryx: hello! Is it possible to match a multi-line pattern with regexps in Guile? dsmith: apteryx: The regex engine in Guile is the system C library regex. apteryx: right. Does this mean no? :-) dsmith: So whatever that can do.. seepel1: For what it's worth I have a Pine Phone and installed Guix on it (from inside Ubuntu). So it certainly runs Guile :) sneek: seepel1, you have 2 messages! sneek: seepel1, civodul says: awesome blog port about type inference in Guile! sneek: seepel1, manumanumanu says: thanks! Love it! seepel1: Oh hey, I haven't been around in a while :). Thanks for the encouragement civodul and manumanumanu! daviid: seepel1: good news - i am going to try to install a librem5/pureos sdk on my laptop, for the time being - I really want to try 'that environment', + guile/g-golf and write a 'hello world!' ... hendursaga: seepel1: So not GuixSD yet? seepel1: hendursaga: Unfortunately work got busy, it is on my very long todo list though :) seepel1: daviid: That sounds awesome! Do you have any quick links to a hello world using g-golf? I've been meaning to look into it. I'm also curious how you would compare g-golf to guile-gi. hendursaga: seepel1: I take it you'd have to update and build stuff on an external machine for it, due to lack of resources? seepel1: hendursaga: I assume that as well, I'm also not excited about how long it would take doing everything on the phone itself. There is some information about running Guix on a Pine Book Pro though. daviid: seepel1: i have pushed the updated manual online yesterday - make sure to read (very quick read) the Using G-Golf subsections, Before you start ... I am going to paste the example here, i will add it to the repo and manual soon, but for 'today', the paste will do daviid: seepel1: here https://paste.debian.net/1156988/ seepel1: daviid: Thanks! daviid: seepel1: wc! ping me anytime ... daviid: seepel1: here is a radio-button tiny example - https://paste.debian.net/1156989/ daviid: seepel1: so, if you update the g-golf guix package to the latest, these two examnple should work on your pine phone daviid: if you have patience to update g-golf on guix and try that, please let us know ... daviid: *to have it to point to the ver latest commit seepel1: Perhaps I'll give it a shot. daviid: seepel1: that would be wonderfull daviid: let me know ... seepel1: I'm not much of a Guix expert, so I'll have to learn that part too. But I've been meaning to find a reason to dig deeper into creating packages anyway. daviid: seepel1: ah ok, i was assuming you were a guix contributor - no problem, we have quite a few contributors here seepel1: Well, the wifi on the phone doesn't seem to be working. It doesn't seem like I'll be useful anytime soon... In the meantime I'm still curious to try out g-golf on my laptop so I'll give that a go :) daviid: seepel1: make sure to build from a clone of the g-golf repo, checkout the devel branch, then run the make danse ... the guix package is out of date ... daviid: seepel1: here file:///home/david/gnu/g-golf/git/doc/g-golf.html/Obtaining-and-installing-G_002dGolf.html#Obtaining-and-installing-G_002dGolf - Install from the source daviid: if you don't build from the source, the above pasted exaples won't work seepel1: Got it, briefly tried just swapping out the commit for the g-golf package in guix. Seems to have failed on finding the unit-test module. I'll try from source. daviid: seepel1: you need guile-lib for that daviid: guix install guile-lib [ or someyting like that daviid: seepel1: in the above pasted manual link, make sure to read and satisfy the Dependencies daviid: seepel1: what is you laptop distro? seepel1: I basically dumped the package definition into a local file g-golf.scm and tried to run guix package -f g-golf.scm. I am likely running into my guix knowledge limit, guile-lib is both in my profile and in the package-definition inputs. seepel1: I'm running Guix System daviid: seepel1: ah ok, i don't know guix enough - please ask for some help on #guix ... seepel1: I might go ahead and stumble around a bit. I've been meaning to get more intuition about packages and building software in guix anywoay daviid: seepel1: there are guix and g-golf users here daviid: str1ngs: heya! could you help seepel1 to gewt g-golf working on their laptop? daviid: str1ngs: seepel1 ues guix system, no plan B :) daviid: str1ngs: the very latet g-golf i mean ... seepel1: Oh my, I feel a bit guilty calling in the cavalry daviid: seepel1: it's ok, they may not answer if no time ... i don't know why it is so difficult on guix, to work with a clone of a devel repo apteryx: dsmith: there's nothing inherently line-oriented in POSIX regexp. '.' even matches newlines, so it supports "multi-line regexps" out of the box. apteryx: so that's nice, but then posix regexps are rather limited so I don't think I can do what I had on mind (no greedy variants, no negative look-ahead, etc.) pkill9: what's the general way to have guile generate guile and save it? pkill9: what's the general way to have guile generate guile and save it? *: apteryx studies the PEG library apteryx: pkill9: I don't understand the question pkill9: no worries, I worked out what i want to do apteryx: good pkill9: to elaborate, i just want to generate guile that is saved to a file, i'm playing around with pretty-print combined with quoting/unquoting apteryx: I see! Serializing a live program? pkill9: hmm i don't think, I want to create a tool for creating guix packages pkill9: package definitions* apteryx: OK! Have you looked at the code of the importers? pkill9: no i haven't, that sounds like a good idea apteryx: that's pretty much what's going on there :-) pkill9: i want to automate a lot of the things in creating package definitions, such as getting/writing the hash, writing the commit, adding the inputs, adding the modules for the inputs, adding the modules for other aspects, adding the license and homepage etc pkill9: I use emacs atm pkill9: but i'm not too fond of it, i'm not enough of a power user lol pkill9: and it could be so much easier apteryx: agreed, that more automation would be welcome. a_v_p: ArneBab: I'll appreciate any help with making Guile-SSH better for sure. ;-) ArneBab: a_v_p: I can show you what I found for parsing, but I don’t know whether it’s a good match. It is highly specifiy to parsing messages from a stream. a_v_p: ArneBab: That would be nice, thanks. ArneBab: a_v_p: I now extracted the port and message handling code https://notabug.org/ArneBab/guile-freenet/src/master/fcp.w#L50 ArneBab: it has a reader thread that sends messages through processor-functions (handlers) that can fire any action and either drop the message (return #f) or pass it on (return it). ArneBab: and a writer thread, that can take and send one message at a time. ArneBab: send: https://notabug.org/ArneBab/guile-freenet/src/master/fcp.w#L259 ArneBab: send message blocks if another message is currently being sent. ArneBab: the actual sending is doen by write-message: https://notabug.org/ArneBab/guile-freenet/src/master/fcp.w#L108 ArneBab: the links are valid for commit c826c5e0b3e374d885d23e1c010a7178632d0336 ArneBab: explicit threading is confined to https://notabug.org/ArneBab/guile-freenet/src/master/fcp.w#L491 ArneBab: call-with-fcp-connection thunk ArneBab: but I have to be careful with writing to quickly to ports: If I print messages every few milliseconds, I get port-already-closed errors pkill9: how do you add completion functionality to guile's readline? pkill9: under the completion seciton in https://www.gnu.org/software/guile/manual/html_node/Readline-Functions.html pkill9: nevermind, worked it out pkill9: how do you pass a prompt to readline when using it in (with-readline-completion-function)? dsmith: scheme@(guile-user)> (with-readline-completion-function (make-completion-function (list "foo" "bar" "baz" "zap")) (lambda () (readline "Prompt: "))) dsmith: Prompt: foo dsmith: $1 = "foo " dsmith: pkill9: ^^ pkill9: thanks dsmith: pkill9: I typed "f" and hit Tab, and then Return pkill9: i don't understand what (lambda () (readline prompt)) does, but it works, thanks dsmith: It'a a "thunk". A lambda (a function) of no arguments. dsmith: Baically, any code you want, but wrapped up to look like a function. dsmith: https://www.gnu.org/software/guile/manual/html_node/Lambda.html dadinn: hi all dadinn: quick question: how do I do sed style search-replace on a string in guile? pkill9: what does #{blah}# mean? dsmith: pkill9: That's the syntax for symbols that have funky chars in them, like spaces. dsmith: scheme@(guile-user)> (string->symbol "s p a c e s") dsmith: $1 = #{s p a c e s}# dsmith: dadinn: I think the manual has some examples. pkill9: ah, the completer is adding a space at the end dsmith: dadinn: https://www.gnu.org/software/guile/manual/html_node/Regexp-Functions.html#index-regexp_002dsubstitute pkill9: is there a way to prevent the completion from having a space at the end? it's not a big deal as I can just strip spaces from the output mwette: (ice-9 regex) has regexp-substitute pkill9: i mean, how can i prevent a space being added when i press to complete dsmith: dadinn: Or you can dig though the resulting match structure from regexp-exec and slice and dice things by hand. dsmith: pkill9: Dunno. Maybe that's a bug in the way Guile uses readline. dsmith: pkill9: Does the C lib behave the same way? pkill9: don't know dsmith: pkill9: In that example I pasted, after it completes, there a space. You can backspace that away. Or add more spaces. Whatever is there will be returned. Looks like. pkill9: it's weird, guile looks so esoteric with it's grammar, but now I get it, and I can write what still look to me to be very complex esoteric things, and they work first time pkill9: or if they don't, I can see exactly where I made a mistake instantly pkill9: Like I just did some list splicing stuff pkill9: dsmith yea, i just want to be able to complete it without having to remove the space pkill9: infact, ideally i prevent spaces being input at all dsmith: Probably need to make your own completion function. I've never used the readline stuff. pkill9: ah yea, I'm using (make-completion-function) which takes a list of strings pkill9: probably need to manually make one then instead of generate one dadinn: dsmith: coolio! dadinn: what is the recommended way to do unit testing in guile? ArneBab: the common way is srfi-64: https://srfi.schemers.org/srfi-64/srfi-64.html ATuin: hi I need some help with a syntax-case macro ATuin: https://paste.debian.net/1157064/ ATuin: I get `Unbound variable: make-name` but it's defined there leoprikler: I'm not sure if you're using with-syntax correctly here ATuin: me neither :D ATuin: i'm a bit confused with it being honest leoprikler: Guile-GI actually does something vaguely similar to what you're trying to achieve leoprikler: https://github.com/spk121/guile-gi/blob/master/module/gi.scm#L58 up to L110 ATuin: mmm the strange thing is the unbound variable message leoprikler: but it uses syntax quoting leoprikler: Either way, I'd let-bind name first and then use with-syntax, seems cleaner imo ATuin: let's see ATuin: i get all the time the unbound variable error ATuin: but macros can reference normal procedures right? leoprikler: yes, they should leoprikler: let's try to get an MWE going leoprikler: wait a sec... leoprikler: why are you even using with-syntax here? pkill9: how can I turn a list like '((some1 (thing1)) (some2 (thing2))) into '(some1 (thing1) some2 (thing2)) ? pkill9: actually, some1 and some2 are the same pkill9: ahh found it, apply append leoprikler: https://paste.debian.net/1157067/ leoprikler: pkill9 so basically flatten-1? pkill9: never heard of it, but sounds like it does that leoprikler: "flatten-1" basically means flatten the list by 1, and I think a straightforward implementation of it in Scheme should be (lambda (x) (apply append x)) ATuin: uhh leoprikler: I don't think SRFI defines any flattening procedures, sadly ATuin: leoprikler: i use the with-syntax because I want to define some names in my macro ATuin: the original idea is to replace some boilerplate I have in a record ATuin: dunno if that can be done without with-syntax leoprikler: yes, you can leoprikler: you're already using the #` construct leoprikler: and you can use let-bindings by simply doing #, inside it leoprikler: as shown in the Guile-GI code ATuin: so in your example you can prefix the `%` inside the #` construct? ATuin: I did not know that :D leoprikler: https://paste.debian.net/1157069/ dadinn: what is the recommended way for unit testing in guile? I have seen ggspec which kida looks similar to something like JUnit... but it seems I need to checkout a git repo for it :/ leoprikler: There are some SRFIs for testing, particularly 64 dadinn: isn't there something similar built-in? ATuin: dadinn: I use srfi-64 mostly ATuin: leoprikler: with your example i can use a function dadinn: ATuin: Can you recommend me a project where it is used? I am a Java/JVM/Clojure guy, and I am used to project structures how testing is managed ATuin: https://gitlab.com/a-sassmannshausen/guile-hall/-/blob/master/build-aux/test-driver.scm ATuin: here it's used with a custom runner dadinn: ATuin: would I put my test code next to the sources, between (test-begin) ... (test-end) ? ATuin: but by default it has a simple runner defined (it's easy to write your own one) ATuin: https://github.com/wedesoft/guile-testing/blob/master/test_example.scm ATuin: there you have an example ATuin: dadinn: yes, then you can define `(test-group)` also mwette: Atuin: I think you need wrap it: (eval-when (expand load eval) (define (make-name ctx field) ...)) leoprikler: For a real-world project, that uses SRFI-64 for testing, see Guile-GI (already mentioned earlier) or even Guix ATuin: ahh yes guix uses it ATuin: mwette: i think at this point I need to reread all that part in the manual to see how does it work :) dadinn: ATuin: so you place the test begin/end clause at the end of each source file, and do the tests for the functions defined before them? leoprikler: well, not quite dadinn: ATuin: the examples you have given don't seem to be like real projects, because there is no source which they tests... I would like to see a project example, how they are used in real life leoprikler: yes, you sandwich the tests in begin/end, but you can have multiple groups per file (not sure why you'd do that, but whatever floats your boat), and you'd usually import the functions instead of defining them dadinn: ATuin: also, how do the tests run? when the file gets compiled it automatically runs? leoprikler: https://github.com/spk121/guile-gi/blob/master/test/typelib.scm leoprikler: no, you run the tests through the Guile interpreter dadinn: ATuin: also, what is the test-runner for? It kinda implies some Mafefile based project structure somewhere, to run the tests defined in the sources with a given test-runner... is that so? dadinn: ATuin: should I be using Makefile to manage the project? ATuin: dadinn: to run the tests, normally when loading the module/file the tests are executed. the runner can modify how they are displayed or executed. ATuin: or reported if you prefer leoprikler: Build-system wise, Guile has a heavy preference for autotools ATuin: dadinn: I normally use guile-hall that does all the autotools for free leoprikler: you can use custom make files or other build systems (e.g. meson), but you'd have to write your own test runner ATuin: yep, using guile-hall you get the runner for free ATuin: mwette: I think I see now, even when the macro works I get the `Unbound variable` message because of that code you pointed out dadinn: ATuin: ah, thanks! That's what I am looking for! ATuin: dadinn: that project helps out when starting from scratch and the runner is not so bad, but if you want to replace it's quite easy. In the srfi-64 they explain quite well how to do it, leoprikler: hmm, Hall looks promising, but does it also support "impure" projects? leoprikler: e.g. guile mixed with C or even some python? ATuin: mwette: confirmed, the message is not appearing when using that code. Really nice, thanks. ATuin: leoprikler: I dont think so, but will be nice to add support for that ATuin: i discovered it not long time ago but i liked the idea. I would like to be able to run the tests without creating the whole distribution of the package also ATuin: `hall tests` for example ATuin: I created a fork implementing that that almost work seepel: daviid: I finally managed to build g-golf and run the hello world! figured out the problem was a few version mismatches between guile 3 and 2.2. I ended up building for 2.2, should g-golf build with guile 3? daviid: seepel: not yet, but it will .. seepel: daviid: Cool, I'm content to play around in 2.2. I'm curious, is it a matter of setting up the configure script correctly, or do you expect there to be code changes that are needed as well? daviid: seepel: it's morte then just adding 3.0 to the configure script daviid: *more seepel: daviid: Thanks! daviid: seepel: np! do you have any particular app in mind, wrt using g-golf i mean? just being curious seepel: I'm actually interested in building an email client. daviid: oh, that's ambitious, cool! daviid: seepel: the user i was asking for help yesterday is working on a project that uses g-golf - called nomad, here - https://github.com/mrosset/nomad/tree/feature-g-golf daviid: that is the feature-g-golf branch of nomad seepel: Oh, I've poked at nomad before. A very cool project. daviid: seepel: ok, i pointed it as an example of using g-golf for other namespaces, webkitgtk in this case .. manumanumanu: Good night everyone! a_v_p: Hello Guilers! Guile-SSH author is here. manumanumanu: Hi ho! a_v_p: How do you debug Guile C code in GDB? Namely I need to see what's inside an SCM object in the debugger. a_v_p: "print obj" gives me only "$2 = (SCM) 0x55c52d5705a0" a_v_p: That's not very helpful. manumanumanu: a_v_p: sorry, went afk. I have very little experience with that. The manual says this: https://www.gnu.org/software/guile/manual/html_node/GDB-Support.html a_v_p: manumanumanu: Thanks! I've read this part of the manual indeed, but it seems that I have no Guile extension for GDB in Ubuntu GNU/Linux 20.04. manumanumanu: oh... manumanumanu: a_v_p: seems to be a debian thing manumanumanu: or a gdb thing? It seems disabled by default. R1ck77: Hi! If I create a SCM object in C, like 'SCM thing = scm_from_utf8_string("something");' how long does it remain valid? Is it eligible to be garbage collected? If not, how do I get rid of it? RhodiumToad: it remains valid as long as something in memory points to it R1ck77: ok, so I guess I have to do a "free" on it, in C R1ck77: reasonable. Thank you! RhodiumToad: no R1ck77: no? R1ck77: if I create a SCM object in C (the aforementioned guile string) nothing is "pointing" to it apparently. It seemed a logical conclusion that I owned the object in some way R1ck77: (although my "free" remark was plain dumb. I got confused with plain strings converted FROM scheme) RhodiumToad: as long as the value is in a machine register, local variable on the stack, or pointed to by another scheme object or a global or static variable, or pointed to from a C data structure that Scheme has been told about, RhodiumToad: then the garbage collector will leave it alone RhodiumToad: (see "Garbage collection" under Programming in C -> General Libguile Concepts in the docs RhodiumToad: once it's no longer pointed to by anything the garbage collector knows about, then it is eligible for collection and will be freed at the next opportunity *: R1ck77 did just read the GC section R1ck77: I was completely wrong. To my defense, I didn't expect the GC could be so smart to actually find the SCM objects on the stack and on the registers. I'm positively impressed. R1ck77: my (wrong) assumption was -> GC cannot find my C objects -> I own them -> I need to do "something" with them R1ck77: wow. R1ck77: thank you, RhodiumToad RhodiumToad: that said, reading the gc docs does induce some slight skepticism RhodiumToad: the way that compilers are becoming increasingly aggressive about weird optimizations is cause for concern RhodiumToad: (the GC is not actually part of Guile, it's a separate library) RhodiumToad: "Some C optimizers may lose the last undisguised pointer to a memory object as a consequence of clever optimizations. This has almost never been observed in practice." R1ck77: yes, I know, libgc. Good choice I can say R1ck77: well, about your last remark, a 64 bit memory space is a very very large search space so it's not that surprising R1ck77: I admit that having always worked with non-gc embeddings (lua and python specifically) I feel definitely out of my confort zone R1ck77: still, I hope to manage to get guile to run on Android (not an easy task up to now): I would love to use it for app development RhodiumToad: lua is garbage collected... R1ck77: yes, but in the same thread, it's all very predictive\ RhodiumToad: the main thing in lua is that the actual object internals are all hidden inside the API RhodiumToad: so as long as you make sure you have a value (string or userdata) on the lua stack while you poke at its innards, you're ok RhodiumToad: the only real rough edge is the number to string mutation in lua_tostring R1ck77: completely correct. Let's say that what I'm trying - very confusedly - to say, is that it's so simple "it feels" like a reference counting thing when you use it R1ck77: now it's been a while since I did serious work on it, but after reading the lua programming guide the general impression was of control and predictability R1ck77: why did you said that lua_tostring is a rough edge? R1ck77: (again, it's been a while, but I don't recall any special issue with it) RhodiumToad: if stack index n contains a number, and you do char *s = lua_tostring(L, n); then that converts the number to a string _and replaces the stack entry with the string value_ RhodiumToad: it does the replacement because otherwise, nothing would be anchoring the returned string R1ck77: strange I never stumbled into this thing (or that I did and I don't remember about it) R1ck77: maybe I never held on lua values but always kept them inside of the lua state, so I never noticed/cared? :/ RhodiumToad: the case where it causes the most trouble is iterating a table with lua_next R1ck77: yep, I just read the lua_tolstring and it's mentioned RhodiumToad: if you call lua_tostring on the stack index of the returned key without copying it first, you mess up the iteration if the key was actually a number R1ck77: I guess you are pulling the carpet from it R1ck77: in retrospect I think I probably duplicated each and every number on the stack before converting them RhodiumToad: that works :-) R1ck77: play it safe (and dumb :-) ) R1ck77: back to work. I got a Guile library and an embedding that compiles, now I "just" need to understand why guile segfaults (on termux) or hangs the app (when used as a library) :) R1ck77: native debugging on an Android machine. How hard could it be? R1ck77: RhodiumToad, since you seem very informed - all around, not just from my n00b perspective - I'm working on 2.2 right now, do you think moving to guile 3.0 is worth the time? Do you know if anybody did work on Android compatibility or portability between 2.2 and 3.)? RhodiumToad: I know little of android RhodiumToad: 3.0.x jit is broken when using clang (not gcc) on 32-bit arm R1ck77: oooook.... RhodiumToad: otherwise, 3.0 seems good R1ck77: well, the native development kit is based on clang and 32 bit arm is half of my architectures, so I think I have my answer (2.2 or bust...) RhodiumToad: ah. RhodiumToad: the problem is known, it just needs to be sorted out what the best way to fix it is RhodiumToad: but the fact that it doesn't manifest with gcc has reduced interest in it, I think RhodiumToad: https://gitlab.com/wingo/lightening/-/issues/15 R1ck77: the problem strikes me more for what it implies, rather by itself: the take away is that probably Android as a platform is hardly considered RhodiumToad: yes, that may be true RhodiumToad: I found that issue using freebsd on an RPI RhodiumToad: I'm a relative newcomer to guile, but I don't recall android having been mentioned here much R1ck77: well, It's seems a nail more in the coffin of my "let's see how Guile would be as a development tool on Android" thing :( RhodiumToad: personally I'm happy to help out with getting it fixed R1ck77: I mean, I think the language is great, the idea behind it is great, but up to now when I try to use it, Guile seems to fight back R1ck77: are you one of the main contributors? RhodiumToad: no RhodiumToad: wingo and civodul both show up in this channel from time to time R1ck77: If I may ask, what do you use Guile for, RhodiumToad ? RhodiumToad: so far, mostly for learning scheme and some functional programming tricks R1ck77: you have an assembly background? I did read your bug report, you seem to be confortable in getting your hands dirty in ASM more than I would :) RhodiumToad: yeah, assembly was the second language I learned after basic, and lisp was the 3rd or 4th RhodiumToad: (we're talking 40-odd years ago) R1ck77: WOW R1ck77: I feel a bit better now, at least R1ck77: I mean, with "only" 20 years of coding under my belt now it's clear why I felt so overwhelmingly amateurish xD RhodiumToad: finding this bug: https://gitlab.com/wingo/lightening/-/commit/1bb909a44d2303f88bb05125fc6742e97f80cd1d RhodiumToad: was probably harder than the other one R1ck77: jeezz.. R1ck77: I have very little experience with assembly and low level programming in general (I learned a bit of x86 and ARM assembly in my spare time and had fun with it, but that's it...), but now I'm working with a lot of (competent but young) people who have no clue about anything under a JVM R1ck77: I guess being the only "senior" around who knows what an opcode is sort of inflated my ego R1ck77: thank you for pulling me back on earth and returning me some sense of perspective :D R1ck77: anyway going back to Guile, I can't escape the feeling that no matter how much I seem to like it and how good it may be, it's practically dead :((( R1ck77: I mean, there has been this new lisp/scheme wave with Clojure, Racket and other languages on the forefront, with people creating new lisp languages all around, but Guile doesn't seem to have been touched by it R1ck77: RhodiumToad, thank you for the help (and congratulations about your journey as a programmer: I look forward from being able to say, one day "I did that 40-odd years ago" too) dsmith: a_v_p: The HACKING file mentions using the gdbinit file in the guile sources. dsmith: Has things in it like dsmith: define gdisplay dsmith: call (void)scm_display ($arg0, scm_current_error_port ()) dsmith: newline dsmith: end dsmith: Which will help seeing SCM value dsmith: Wow. Looks like lots of cool stuff in there.. ArneBab: sneek: later tell R1ck77 please tell me if you get Guile working for app development. I‘d love to use it to *start* into app dev sneek: Okay. ArneBab: sneek: later tell R1ck77 regarding being dead: Guile has been taken up by Guix and has started flying, not so much in publishing but rather in the OS work sneek: Okay. a_v_p: dsmith: Thanks, I'll give it a try. tohoyn: sneek, botsnack sneek: :) a_v_p: Woohoo, it seems that I fixed most of the random segfaults in Guile-SSH on the 'master'! a_v_p: The tests would sometimes fail mostly due to concurrency and GC'ing issues. mwette: a_v_p: sweet! dsmith: a_v_p: Awesome. Did that gdbinit help? a_v_p: A new Guile-SSH release is here: https://github.com/artyom-poptsov/guile-ssh/releases/tag/v0.13.0 a_v_p: dsmith: No, I haven't checked this GDB feature yet, I'll do it later. dsmith: a_v_p: To be clear, this is an init file that adds some functions to gdb the help debug Guile C code. dsmith: It is NOT adding Guile to gdb so you can use Guile to script gdb for debugging other things. a_v_p: dsmith: Yes, I know. And I was looking exactly for something like that, thanks. dsmith: Cool. dsmith: I totally forgot about it when I was debugging something a few weeks ago. a_v_p: I was able to fix segfaults by eliminating some bad multi-threading from Scheme code. a_v_p: When one is using the FFI in Guile with some tricky library code below the surface, it's easy to mess with concurrent GC'ing, especially with multi-threading. a_v_p: Some Guile-SSH procedures would SEGFAULT as I was trying to use an libssh channel when the parent libssh session was freed. a_v_p: The worst part is that such errors are hard to track down. That's where GDB with Guile extensions would be very helpful. dsmith: multi-thread and gc issues are the worst! Because cause and manifestaion are so separated by both code space and time. And usage patters. Ugh. ArneBab: a_v_p: how did you fix them? ArneBab: I had some very nasty segfaults when trying to do multi-threading with futures and atomic variables, but I did not report it since I found a workaround :-/ a_v_p: ArneBab: The most obvious fix was to remove threading in 'call-with-ssh-forward' procedure. a_v_p: Also I added additional checks on SMOBS GC callbacks. a_v_p: And added 'scm_set_port_needs_close_on_gc (channel_tag, 1)' call to Guile-SSH channel type initialization code. ArneBab: a_v_p: so you now only thread outside? a_v_p: ArneBab: It's better to use separate processes. Here an example: https://github.com/artyom-poptsov/guile-ssh/blob/master/examples/rpc/client.scm.in#L86 a_v_p: The code starts SSH port forwarding in a spawned process and then connects to the forwarded socket from the main process. ArneBab: that sounds like a hard hack to fix something which should have worked … ArneBab: maybe we should get together and gather problems ArneBab: to get trheading to just work ArneBab: my solution was to move the future inside the procedure instead of running procedures in futures. a_v_p: FWIW, I was looking for something like a "POSIX socket forwarder" that forwards all I/O on an "virtual" socket to a specified Guile port (better yet -- using the caller's thread), but found no such thing. So I proposed to use a separate process that forwards the data. rlb: Hmm, not sure if it would be relevant, but a bit back I noticed that you can forward file descriptors over local sockets to another process. rlb: (worked quite well for the case I had in mind) ArneBab: I had a similar problem: I‘m communicating with TCP process and want to multiplex messages I send over different threads. ArneBab: this is my socked-handling procedure: https://notabug.org/ArneBab/guile-freenet/src/master/fetchpull.w#L709 ArneBab: looking at the code again now, I see that I basically removed the multithreading from anything that writes to the port ArneBab: I now have a read thread and a write thread and they synchronize over an atomic box: https://notabug.org/ArneBab/guile-freenet/src/master/fetchpull.w#L311 ArneBab: I‘m now blocking everything on the network, because it didn‘t work otherwise ArneBab: What I would have needed: A threadsafe queue where I can put messages so the sender thread can take them out and one where the reader thread pushes messages that the handlers can take out; with limited size so reading/putting blocks when too many messages are in queue rlb: Yeah: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/BlockingQueue.html I may hack something like that up at some point if we don't already have it. rlb: While I may have some issues with the jvm, java.util.concurrent is very useful. ArneBab: though concurrency in Java is still ugly ArneBab: (but more reliable) rlb: fwiw, clojure has a good bit of precedent here too. rlb: e.g. https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/seque rlb: though somwhat different model from what you describe, perhaps ArneBab: I’d actually need a threadsafe deque ArneBab: as a fifo ArneBab: I wonder whether I might already have one from another project I hacked together … ArneBab: https://github.com/scheme-requests-for-implementation/srfi-134/blob/master/contrib/arne-babenhauserheide/deque.scm ArneBab: since this is immutable, thread-safety with a global value should only depend on atomic blocking of a variable roelj: I can't seem to find an example of how to call a Guile function from C. I thought I'd seen an example in the manual about two years ago.. Does anyone know where it is? ArneBab: dsmith: no prob with that — my seeing is different: too many parens start merging everything together, so I have a harder time recognizing the procedure names. Though I do use inner parens to focus on some parts. ArneBab: But the key to wisp is that it‘s still scheme. If people use it, you can always add the parens and get the Scheme you know. ArneBab: More importantly: anything written in wisp is compatible to Scheme down to the lowest layer. Not just some option to call foreign code, but the same down to the performance model. manumanumanu: How can I tell whether two syntax objects point to the same thing? manumanumanu: would that be free-identifier=? manumanumanu: ah yes. manumanumanu: The manual could really need an example... dsmith-work: Happy Friday, Guilers!! mwette: morning! chrislck: here's my latest gnucash creation, using cutting edge chartjs module \o/ https://github.com/Gnucash/gnucash/pull/759 mwette: I now have a string-diff : (string-diff "abxef" "cabdef") => ((ins 0 1) (dup 0 2) (del 2 3) (ins 3 4) (dup 3 5)) chrislck: ooh mwette: https://github.com/mwette/guile-contrib/blob/master/seqdiff.scm chrislck: mwette: are you working on DNA sequencing? manumanumanu: mwette: fun! I have been playing with adding an %app macro to guile, and it works alright :) Just for fun I added the feature of infinite cdadadddddadaaadddaddadar generation at compile time mwette: haha - no exactly manumanumanu: just itch scratching. Don't know why, but I just need to _make_ something manumanumanu: and that idea popped up mwette: I've actually run out before (IIRC guile has up to 5 op's) dsmith-work: chrislck: Wow. Nice manumanumanu: mwette: The only downside is you have to change the current reader, or wrap whatever code you are writing in the (%appify ...) macro. I thought about actually writing an extensible guile reader in guile so that we can have reader macros, but meh. manumanumanu: too complex manumanumanu: and not fun... dsmith-work: manumanumanu: civodul wrote some kind of extensible reader. Though I think it was in C. dsmith-work: https://www.nongnu.org/guile-reader/ manumanumanu: yeah. I know. I am a sucker for pure scheme, though. davidl: mwette: can you explain what the string-diff does? I don't understand the result values "ins" "dup" "del" etc. justin_smith: davidl: looks like a calculated minimal set of edits https://en.wikipedia.org/wiki/Levenshtein_distance mwette: davidl: for (string-diff a b): (del i j) means delete chars i-j from a; (ins i j) means insert from b; (dup i j) means duplicate (or copy) from a davidl: ok cool stuff, Ive never heard of that before davidl: mwette: I don't follow the (del 2 3) part in the example above. mwette: davidl: operations to turn a into b, so (ins 0 1) from a="cabdef" => "c"; (dup 0 2) from a="abxef" => "ab"; (del 2 3) from b="abxef" => [delete "x"]; (ins 3 4) from b="cabdef" "d"; (dup 3 5) from a="abxef" => "ef" mwette: s/from a="cabdef"/from b="cabdef"/ mwette: del and dup are ops on a, ins is op on b davidl: mwette: ok thanks! (if I read i to j as index i up to j - but not including j - it looks correct). mwette: it's consistent with (substring "cabdef" 0 1) => "c" wklew: possibly silly question, but how do i build guile-3.0-dev from guile source checkout? wklew: nevermind, I think it installed the dev filed and I was just having linkage issues wklew: s/filed/files dsmith-work: wklew: Like not running ldconfig? wklew: I believe that was it wklew: I'm now having issues building guile-reader (for haunt), it seems it can't find the GUILE_PKG macro manumanumanu: wklew: I don't think guile-reader is available for guile3 manumanumanu: or? wklew: I thought so too, but I saw that cwebber's recent patch to the guix haunt pkg seems to use 3.0 for everything wklew: issue 42326 dsmith-work: Looks like guile 3 removed things like SCM_COL, SCM_LINUM that guile-reader uses. Not mentioned in NEWS! wklew: well I got everything working by building against GUILE_EFFECTIVE_VERSION=2.2 wklew: a little disappointing dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen dsmith-work sneek: I think I remember dsmith-work in #guile 53 minutes and 30 seconds ago, saying: Always another bug!. ArneBab: dsmith-work: do you mean the one-page sxml template or in general the code with fewer parens? roelj: dsmith-work: Yes that's it! I was using Guile 3.0.2, and with 3.0.4 it should the function names! Thanks once again! dsmith: ArneBab: Just the lack of parens in general. dsmith: When a function is long, it's hard for me to see what pieces line up with what based on indentation alone. dsmith: ArneBab: Not saying it's bad or people shouldn't use it. Just not for me. dadinn: hi all dadinn: is there something of a hash-set in guile? dadinn: I mean the data structure dadinn: I cannot find anything like that, so I am thinking of using a hashtable... but then there is no method to get the list of keys :/ dadinn: can I map car over it? that assumes the hashset can be taken as a sequences of key-value pairs... which I am worried will not be true :/ dadinn: hmm, poor mans hash-set: https://termbin.com/6vbw dadinn: * man's daviid: dadinn: 6.6.22 Hash Tables dadinn: daviid: yes, but that is not a Hash Set, I am particularily looking for unique values in a list dadinn: also, with thy let typo fixed in my example, it is still a problem that `(hash-table->list car list)` doesn't work, because car doesn't seem like the right way to access the key :/ dadinn: whatever, it is called hash-map->list dadinn: working version of the poor man's hash-set: https://termbin.com/ypqv dadinn: I mean it should be better called unique... cuz it just returns a unique list as result daviid: dadinn: why don't you just parse the content-list instead dadinn: also, since it is a hash-table, it obviously can have a problem with collisions :/ dadinn: daviid: I parse the content list dadinn: daviid: what do you mean just parse the content-list? daviid: dadinn: you are, it seems, thowing away the hash table, you may as well just call map and a hash function over content-list dadinn: daviid: I don't understand the map and hash function part... can you give an example? daviid: map my-hash-proc my-contnet dadinn: daviid: that would mean i would get a list of hashes/integers, the same number as the content-list was (assuming hash-proc returns an integer) daviid: yes, but you don't need to build and throw away a hash table to solve that problem ... if the set of key is what you want ... dadinn: davidl: it is the set of keys is all I need, I should call the fuction unique, or uniq dadinn: the problem is if there is hash collisions, I won't save the different values which clash hashes at the moment, so I would need to use a multi-map for that dadinn: or is it a problem? I am not sure how hash-table is implemented :/ dadinn: if the hash of two keys are equal, does the later key overwrite the earlier? daviid: hash collisions occur if you have duplicates in your content-list, so you may either filter before, while building or after ... dadinn: daviid: the problem with collision is that if two non-equal values have the same hash... two equal values should always have the same hash daviid: dadinn: all i was saying is in yur paste, yu throw away the hash table, and therfore you may as well not even build one, just call hash functions and filter forduplicates ... dadinn: daviid: how do you filter for duplicates? is there a function for that? That's exactly the same I am trying to achieve with putting stuff into a hash-set-like thing daviid: dadinn: in yu paste, you only return the keys right? dadinn: daviid: and even if there is a function like that, how does it address the case when there are two non-equal values which happen to have the same hash? dadinn: daviid: yes, I only return the keys, now I am trying to update it a bit so I will use a multi-map to protect against hash collisions, becaus I am not sure how hash-table works dadinn: daviid: for example I don't know what hash function hash-table uses, and how to find to example non-equal keys which have collisions to test this dadinn: if I do a naive list-input list-output based implentation where I put items from the input list to the output list, comparing the new input is not in the output list, that's an O(n^2) complexity... that's why I need a hash-table /hash-set dadinn: daviid: naah, I can't get around the problem of hash collisions, or maybe I am misguided with the entire issue... drank too much beers tonight, going to bed! ;D dadinn: my final solution to the uniqueness problem is: https://termbin.com/4ocb thchr: Quick question: sometimes I see the notation (+1 i) instead of (+ 1 i) - is there a difference? mwette: 1+ is a procedure: (define (1+ x) (+ 1 x)) thchr: Hmm, I don't get it; if I type (1+ 2) at the guile repl, 3 is returned? I encountered the (1+ x) notation in a (do ..) loop construct? mwette: just type 1+ at the guile prompt mwette: Try to type (define (xx i) (1+ i)), then type (xx 2) and you get 3 mwette: oops (define (xx i) (+ 1 i)) mwette: then (xx 2) => 3 thchr: Ah, I get it now: nice! Thanks for explaining this! ZombieChicken: Anyone aware of a guile implementation of termbox? daviid: sneek: guile-software sneek: guile-software is at http://sph.mn/foreign/guile-software.html daviid: ZombieChicken: if it exists, it's likely reported there ^ daviid: i couldn't find any leoprikler: dadinn: For the record, SRFI-1 has delete-duplicates and lset-* procedures so you can treat lists as sets leoprikler: it doesn't come with the "hash" part, so asymptotically performance will be worse, but it should do the job dsmith-work: Morning Greetings, Guilers kahiru: morning dsmith-work mwette: morning, all chrislck: silly question: how do hash-set! and friends handle hash collisions? dsmith-work: chrislck: Looks like (from hashtab.c) that a hash table is a vector of a-lists. The lists have (key . value) pairs. dsmith-work: So I would imagine two keys that hash to the same value are on one of those a-lists. thchr: Another question: trying to benchmark a method, I encountered a strange disparity between manually pasting code in the Guile REPL and `include`ing it. E.g., on 2.2, this code (https://gist.github.com/thchr/3e046aa33b5597756a99b3c772bb90b5). If I `include` the file (or run it as `guile filename.scm` from bash) performance is 5-10 times slower than thchr: if I launch the REPL and then manually paste the contents of the file. What is happening here? thchr: On 1.8, the difference seems to be about a factor of 2. thchr: Ah, link got garbled: https://gist.github.com/thchr/3e046aa33b5597756a99b3c772bb90b5 RhodiumToad: tried it on 2.2.7, didn't see any difference? thchr: I'm on 2.2.3 RhodiumToad: try 2.2.7 then :-) RhodiumToad: or 3.0.x thchr: I guess I will then; I'm on an older Ubuntu though, so I have to compile from source then - I guess I should... RhodiumToad: it's quite a lot faster on 3.0.x RhodiumToad: might be the jit thchr: Out of interest, how much? RhodiumToad: how long are you expecting it to take? thchr: On my laptop, it's on the order of 2e-5 seconds on v2.2 RhodiumToad: ah, the output here is wrong because you're not accounting for internal-time-units-per-second RhodiumToad: so correcting for that, I get ~2.8e-5 s on 2.2.7, and ~1.7e-5 s on 3.0.4 thchr: Ah, OK - didn't know that command RhodiumToad: (you seem to be assuming that's 100, on my system it's 1e9) thchr: (It was 1e9 on one of my systems as well, yeah) rlb: nb. 3.0.4-1 uploaded to debian unstable -- and built on all the release architectures (at least), on the first try: https://buildd.debian.org/status/package.php?p=guile-3.0 dsmith-work: Yey! RhodiumToad: still won't run properly on 32-bit arm of course dsmith-work: RhodiumToad: Why not? dsmith-work: RhodiumToad: Oh! For fbsd? RhodiumToad: https://gitlab.com/wingo/lightening/-/issues/15 <-- that's still unfixed RhodiumToad: oh, I suppose it'll work with gcc dsmith-work: Yeah, s/fbsd/clang/ dsmith-work: Forgot about that. manumanumanu: Ahoy hoy! manumanumanu: rlb: you are doing a hero's work! ATuin: I need some help with this code: https://pastebin.com/swuyxvr4 ATuin: how can i read the output of the pipe? ATuin: that code seems to hang on the child process ATuin: when using `open-output-pipe` I can see the output of `wc` in the console dsmith-work: ATuin: remove the format ATuin: aha let me try dsmith-work: YOu can't (read-line p) there. ATuin: removing the format didn't help ATuin: mmm why? ATuin: i guess i'm using the port wrongly but I can not see why o how dsmith-work: You can't read and write to that same pipe. dsmith-work: (I always get confused on what is an "in" and and "out", depends on perspective) ATuin: yeah, I'm confused now :D dsmith-work: So if you want to write to it, you need an output-pipe. If you want to read from it, an input-pipe. ATuin: https://www.gnu.org/software/guile/manual/html_node/Pipes.html dsmith-work: Examples: https://www.gnu.org/software/guile/manual/html_node/Pipes.html ATuin: then how do i use that function ATuin: it opens the pipe in both modes according to the doc dsmith-work: Doh! dsmith-work: Didn't see that. Sorry! ATuin: Care should be taken with OPEN_BOTH, a deadlock will occur if both parent and child are writing, and waiting until the write completes before doing any reading. ATuin: they comment that in the doc dsmith-work: Yes. ATuin: maybe i'm reaching that case ATuin: a funny fact is that when the child is rofi, stumpwm hangs completely until I kill the process :D dsmith-work: So it may be that buffereing is involved. Maybe a flush after your display. dsmith-work: IF you close, that ends up closing both ends. ATuin: I thought the same so I tried to flush the port and even remove the buffer but nothing ATuin: yeah closing it makes the read to fail later ATuin: I also think it's something related to buffering ATuin: could it be that the child is waiting for more input so the read is hanging ATuin: so maybe the problem is the write procedure dsmith-work: Yes, that's why closing the pipe to "wc" would be good, but that also ends up closing the pipe FROM "wc" dsmith-work: ATuin: istr something like this on the mailing lists a few months ago. dsmith-work: I don't remember what (if any) the solution was. ATuin: mmm don't know i can check it ATuin: i guess i can always fork manually and dup the fds but i'm curious why is not working because that procedure looks very conveniant dsmith-work: Is there a way to make "wc" line buffered? I would think it must read it's total input until EOF before producing any output. ATuin: https://lists.gnu.org/archive/html/guile-user/2018-01/msg00041.html ATuin: yes, seems that's the problem thchr: RhodiumToad Just to update on my previous conundrum: I found that the problem didn't exist on Guile 2.0 nor on Guile 3.0.4. Somewhat hilariously, I also found that the problem went away if I called guile-2.2 from sudo; somehow it seems auto-compilation wasn't happening, I think. ATuin: this wc example was just to test it ATuin: the original problem came from piping into `rofi` dsmith-work: ATuin: https://paste.debian.net/1156720/ dsmith-work: 1 9 45 ATuin: nice ATuin: receive? ATuin: i will read the doc ATuin: ahh it's similar to call-with-values dsmith-work: Basically just the example in the manual modified a bit. dsmith-work: pipeline separates out the in and out pipes so you can close them independently. ATuin: where is pipeline defined? dsmith-work: https://www.gnu.org/software/guile/manual/html_node/Pipes.html#index-pipeline ATuin: ahhh yes sorry ATuin: i remember it now ATuin: aha i see the trick now ATuin: smart! thanks dsmith-work: np. Sorry for the confusion earlier. ATuin: np ATuin: I will try with the original problem (rofi) dsmith-work: You could still run into the problem of deadlock. ATuin: yeah but in this case i wont read until the the other side is closed dsmith-work: reading from the pipe, with the pipe blocked on a read, which you can never send. ATuin: interesting I dont have that procedure in this version of guile ATuin: 3.0.2 ATuin: yeah, it was introduced in 3.0.3 :D manumanumanu: ATuin: open-input-pipe was changed in 3.0.3 to allow for the open-pipeline (????) procedure that opens a pipeline like a shell | pipe. I didn't read your discussion, but from what i glanced through it seems like a regression manumanumanu: Anyway, good night! ATuin: manumanumanu yeah thanks ATuin: the problem is that only got 1 pipe and the child was waiting for more input so my read was blocking manumanumanu: ATuin: oh, you could use (@@ (ice-9 popen) open-process) to get 2 separate ports. That way you could close the one you write to close stdin for the process manumanumanu: I should really submit some kind of patch to put that stuff in the manual! dsmith: Well, whatever it is, it would be well defined and proven at compile time. dsmith: I'd *much* rather fix things at compile time than run time. dsmith: Mostly I've worked on Embedded things. ArneBab: I wish we could have somewhat more of compiletime-checks in Scheme — basically more warnings during bytecode compilation ArneBab: dsmith: then I’m really glad that you’re going for Rust :-) dsmith: It's nasty to build a filesystem, reflash your device, and *then* find a run time error. dsmith: I blame wingo. He was talking about go channels which made me curious about go. Eventually that got me interested in Rust. ArneBab: That’s funny — my impression is that Go managed to capture the people Rust wanted and Rust managed to capture those that Go wanted :-) dsmith: heh ArneBab: PR vs. actually fulfilling needs ArneBab: And I’m still trying to find ways to put guile to more productive use dsmith: I like go a lot. But it's really no good for embedded because of gc. dsmith: Guile is just plain fun. ArneBab: (and all the while a co-worker added s-expressions to our tests in Java, because "they are at least readable" :-) ) justin_smith: dsmith: I've been learning ARM assembler lately, and I like who both guile and RISC assembler let me accrete and sculpt a design around a relatively small set of operations (but can see the appeal of static checking when your goal is to have a working result, as opposed to the aesthetic flow of being engaged in programming) ArneBab: Guile also has very reasonable performance nowadays, but existing tools aren’t there — or not easy enough to find. I sometimes find myself grabbing Python instead of Guile for quick hacks. ArneBab: I’m annoyed by that :-) dsmith: justin_smith: Dynamic languages are *Very* addictive. The quick feedback loop is like a drug. justin_smith: dsmith: this reminds me of a paper I read recently about the philosophical premise of project management in software development. plan / implement vs. brainstorm / improvise as fundamentally different ways of engaging with work justin_smith: and I think there are a lot of signs that brainstorm / improvise gets more done when it stays vaguely on track (but has worse worst cases...) dsmith: justin_smith: Ever use Forth? justin_smith: indeed justin_smith: was just reading about collapseos the other day dsmith: Forth often has an assembler, though usually *nothing* like a "traditional" asm. justin_smith: and occasionally think about what I'd have to accomplish before I'd trust myself ot attempt programming for a greenarrays board dsmith: Interactive asm at the repl. justin_smith: (which last I checked are only programmable using forth) justin_smith: dsmith: yup! I ran colorforth back when I could just slip it in a floppy drive and go justin_smith: http://www.greenarraychips.com/ 144 cores, no c compiler dsmith: I think I recently saw a video by Chuck on that. dsmith: "consuming as little as 7 picojoules of energy" that sounds like Chuck. justin_smith: I'd love a reality tv series that just followed the architectural meetings and daily standups of a team making something *interesting* on a greenarrays board justin_smith: dsmith: I have been thinking more about linux / guile / c / asm as a stack for my "laid off so I have time to pay attention to this" project justin_smith: but you bring up a good point with forth dsmith: justin_smith: Have you read "Thinking Forth" ? dsmith: justin_smith: I have a paper copy from when it came out, but it's now available online: http://thinking-forth.sourceforge.net/ chrislck: gnucash now supports guile-3.0 \o/ dsmith: Woo holomorph: https://wiki.gnucash.org/wiki/Roadmap#Reports holomorph: D: chrislck: it's true... getting the average bookkeeper or sole-trader to learn lisp is not reasonable :) chrislck: your mom-and-pop business shouldn't be worried about tail-calls nor O(N) dsmith: "Scheme is impenetrable to most programmers^w expert beginners" daviid: i totally desagree with "Expecting users to be able to write reports in Scheme is completely unreasonable", it is the opposite which is completely unreasonable chrislck: if I ever make it to fosdem I'll offer a talk: how I became the defactor scheme maintainer in gnucash, or "all I wanted was VAT reports" dsmith: I suspect that people who have never been exposed to programming at all take to Scheme nicely. chrislck: https://lwn.net/ml/python-ideas/CAP7+vJKsrT-n4rHjaR4PYPRq09JOZcoR54ZjkboOkZcYhB+7oA@mail.gmail.com/ python to have parens! pkill9: why is that dsmith? dsmith: pkill9: No bias and pre-concieved notions. ArneBab: chrchr: nice! ArneBab: dsmith: I’ve been planning for a while (years) to do an actual scientific study about the effect of parens on the ease of understanding. It’s one of the uses I see for wisp: Since programs in wisp are structurally equal to their scheme equivalents, it allows separating the effect of parens from everything else. ArneBab: chrchr: wow, Python with or without parens for function call :-) ArneBab: chrchr: did you try to show them wisp? ArneBab: chrchr: if you can give me a typical report, I can create the equivalent in wisp so people can compare ArneBab: advantage: All the old stuff just works, because the *.go files are compatible. kahiru: good morning guilers tohoyn: sneek, botsnack sneek: :) tohoyn: daviid: hello tohoyn: daviid: anything new with g-golf? chrislck: ArneBab: https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/reports/standard/new-aging.scm dsmith-work: Wednesday Greetings, Guilers dsmith-work: ArneBab: The *shape* of lisp/scheme code matters to me. If you put everything on one line, I can't read it. dadinn: hi all mwette: I'm looking for pointers to tutorials on web-client coding w/ authorization. I have gnutls and now gcrypt; any other externals needed? dadinn: I have just encountered a problem with using modules. I think my problem is I am kinda expecting that the current-directory is always on the load-path, so I can use submodules (git style) more naturally. This is not the case, but the workaround was that I add the current-dir to the loadpath manualy, before the use-module directives. Like here I did here: dadinn: https://github.com/dadinn/init-instroot/blob/master/init-instroot.scm dsmith-work: dadinn: Putting current dir on the load path is bad the same way putting "." in your $PATH is bad. dadinn: The problem I find is that I can't seem to compile the common/utils.scm and common/utils/dep.scm packages individually, because it is only the parent project's directory on the load path :/ dadinn: dsmith-work: I think I have a reasonable use-case... this is exactly the same how it works on the JVM, specifically Clojure... the contents of a JAR file are always on the classpath dadinn: dsmith-work: unless your argument is that JVM is inherently flawed... dadinn: dsmith-work: nevertheless, this kinda works fine already, but I am not able to use Geiser, by loading deps.scm, because it complains it cannot find utils.scm: https://github.com/dadinn/common dsmith-work: Oh I was just giving the reason why "." is not on the load-path. Adding the full path to the current directory (/some/location) is not as unsafe. dadinn: dsmith-work: hmm, actually you are right, what I am doing is: (add-to-load-path (dirname (current-filename))) dadinn: dsmith-work: when I am trying to run (current-filename) in the Geiser REPL I get back #f ... I suppose because the REPL is not linked to any source file, yet I have tried to load deps.scm as source file :/ mwette: or $ export GUILE_LOAD_PATH=`pwd`:$GUILE_LOAD_PATH ArneBab: chrislck, dsmith-work: I converted the first 186 lines to wisp — started with sweeten and then adjusted by hand to match the structure of the scheme code: https://www.draketo.de/software/wisp-example-new-aging-start.html ArneBab: I decided to keep the parentheses around N_ calls, because N_ is often used inline. ArneBab: chrislck: do you think the wisp-report would be easier to read for others? dadinn: so is there a better way I could structure my code, especially the `common` submodule, so that the sources deps.scm module can reference the utils.scm module next to it in the same folder? chrislck: IMHO only marginally so. the steep learning curve is the lack of templating language (like jinja/mustache) and lack of standard query language. Most are looking for something like PHP by writing html templates directly and inserting {{ account.name }} here and there. chrislck: the report code will incrementally build the report HTML DOM tree by looping through accounts/transactions/invoices etc using scheme's very excellent looping constructs, but users want an easier time. chrislck:
    { for acc in Accounts where acc.name.beginsWith["Assets"] }
  • { account.name } balance is { account.balanceAt[$today]}
  • { endfor }
chrislck: ^ this is whay IMO they expect chrislck: oops:
    { for acc in Accounts where acc.name.beginsWith["Assets"] }
  • { acc.name } balance is { acc.balanceAt[$today]}
  • { endfor }
dsmith-work: There sure are a lot of templating systems out there. (Especially for JS). chrislck: yups chrislck: ArneBab: new-aging is of fairly high complexity, but 100% my work, so, I know it has good scheme habits :) chrislck: I'm sure you'll see the enormous vocabulary in use -- both for data access and html report building is the next steep learning curve (after learning lisp) chrislck: so: a templating language, and a query language, would make it much easier. unfortunately I don't know how to structure it. chrislck: FWIW my next idea is to try generate sankey charts: https://www.reddit.com/r/dataisbeautiful/comments/b5t5sp/oc_a_sankey_diagram_showing_how_i_spent_my_money/ dadinn: or to try to ask the question more generally: how can two modules reference each other, when they only know that they are on the same relative path to each other? dadinn: my parent project has to refer to the utils module as (common utils) but that is not the path for my other project which is in the same folder as the utils package.. yet the utils package has to define itself as (common utils) dadinn: actually, it seems I solved it with: (add-to-load-path (dirname (dirname (current-filename)))) dadinn: ;) dsmith-work: I think most modules are installed to a known place. Not usually relative to some other file. dsmith-work: That's a windowsy thing I think. Install an exe and any dll's in same or subdir, and the exe looks for them relative to where it finds itself. dsmith-work: Not sure how guix works. Probably just extends the load-path to whereever. thchr: I'm trying to use statprof, following https://www.gnu.org/software/guile/manual/html_node/Statprof.html. If I execute the first example, I get hit with an error `ERROR: In procedure setitimer: thchr: (on Guile 2.2, btw) dsmith-work: That manual happens to be for 3.0, but 2.2 is the same. dsmith-work: thchr: What kind of system are you on? thchr: This is run through WSL thchr: I can try a Linux install on 1.8.8 as well ow dsmith-work: Hmm. Works nicely for me on 3.0.4 dsmith-work: Debian Linux 64bit x86 *: dsmith-work looks squinty eyed at WSL dsmith-work: "The profiler works by setting the unix profiling signal ITIMER_PROF to go off after the interval you define in the call to statprof-reset." thchr: Tried the 1.8.8; doesn't seem to have statprof unfortunately thchr: I see, so could be an issue of running this through WSL then. dsmith-work: Windows doesn't have signals. I wonder what WSL does. ArneBab: chrislck: why not just use sxml in quasiquoting? dsmith-work: ArneBab: For templating? ArneBab: chrislck: why I translated your code to wisp (aside from wanting to show off wisp :-)): When people say "we need a non-lisp", you can show them the code and say "it’s not the scheme, the same structure in another language would be worse. Let’s work on a higher level API that can be used from Scheme, so people can drop down to low-level if needed, but don’t have to". ArneBab: dsmith-work: sure ArneBab: dsmith-work: very simple example: https://notabug.org/ArneBab/guile-freenet/src/master/fetchpull.w#L777 dsmith-work: https://mail.gnome.org/archives/gtk-list/1997-August/msg00123.html ArneBab: (that only gets the title dynamically) dsmith-work: "We plan to use GTK/Scheme bindings for coding small utilities and applications. When these bindings are more mature, it should be possible to write complete applications in Scheme." ArneBab: That’s an argument by authority. It works best if accompanied by utility. (my code is using SRFI-119; it’s just one command away from regaining the parens) ArneBab: (though I have to admit, that templating languages that allow you to open the template in a browser to see and tweak it with placeholders visible is pretty useful) roelj: I'm using statprof to find a performance bottleneck in my Guile program, and the top two entries are "anon #xbda148" and "anon #xbd0560". How can I dig deeper into this? dsmith-work: ArneBab: Ugh! I don't think I could deal with code like that. dsmith-work: roelj: I wonder if that's related to the fix df22eb595 ? dsmith-work: roelj: What guile version dsmith-work: ? dsmith-work: "Statprof reports primitive names" mwette: guile 3 adds to the fun. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42345 dsmith-work: Always another bug! ArneBab: do you mean the one-page sxml template? ArneBab: or in general the code with fewer parens? rlb: Is there an obvious replacement for scm_internal_stack_catch? I'm *still* trying to remove guile-2.0 from debian, and geda-gaf is the last hold out: http://git.geda-project.org/geda-gaf/tree/gnetlist/src/parsecmd.c?id=1.8.2-20130925#n209 rlb: I can always file for package removal, but thought I'd see if I might be able to come up with a stopgap patch without too much effort. rlb: cf. https://packages.debian.org/search?keywords=geda rlb: cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885195 rlb: Commenting out that clause, I can get it to build and pass all the tests but 1 with 3.0, but from that last bug tracker message, might be plausible to just remove it in favor of "lepton" (not really a domain I know much about). rlb: Got it to build and past all but one of the tests (if that was all the tests) by disabling that bit (given some other changes). But also updated the bug -- might still be sensible to remove the package from debian. dsmith: rlb: Hmm. For bobot++ we had scm_internal_lazy_catch -> scm_internal_catch dsmith: rlb: In scwm, I replaced scm_internal_stack_catch with scm_c_catch, but I'm not sure if that's quite right. dsmith: Unfortunately, the NEWS is not that helpful with moving to new catching functions. ArneBab: justin_smith: so you mean things like Sonar Qube and linters? We’re using Sonar at work and it helps by catching a lot of potential problems like not closing files or forgetting to check for nullness. dsmith-work: Morning Greetings, Guilers mwette: morning justin_smith: ArneBab: right, the original question was about static analysis tools used as a security precaution justin_smith: and of course guile does a bunch of these things for us, but we dont' have the approved tools that eg. a board of directors would request for sensitive systems ArneBab: I think it could be useful to have something — tools to check best practices or such. But for that we need best practices :-) ArneBab: There are always things that are legal in a language, but not a good idea. ArneBab: The two tools I know that do the most there are IntelliJ and Matlab (unfree): The latter even tells you when something you did can be sped up with minor changes. ArneBab: Ideally Guile would provide those warnings itself while compiling dsmith-work: I have been *really* digging Rust laetely. justin_smith: ArneBab: yeah - at least in theory, a lisp lets you do things that would be utterly nonsense in another language, but contextually (especially when provided by a well vetted library) are best practices justin_smith: imagine your linter complaining about the macroexpansion of a match form because it doesnt' understand match... justin_smith: but even so, we could have good verifiers or linters, they just haven't been made for most lisps justin_smith: security lib rejecting your program because it uses goops which overrides built in functions... ArneBab: performance-linter warning against using string-append in a loop sneek: dsmith-work Hey! ArneBab: dsmith-work: do you mean, you enjoy programming in it, or you dig deep? dsmith-work: ArneBab: really enjoying it ArneBab: dsmith-work: what is it you enjoy — and can we get part of that in Guile? ArneBab: :-) dsmith-work: ArneBab: Lots of things. Expressions instead of statements. Match. The type system. The error messages. Type interence. dsmith-work: inference dsmith-work: The borrow checker. ArneBab: what’s the difference between expression and statement? ArneBab: (dsmith-work is it ok if I try to pick your brain on this a bit? I’m curious because I wanted to try out Rust for ages but never made the time) dsmith-work: So in Scheme, "if" is an expression. It evaluates to a value. Also in Rust. dsmith-work: ArneBab: In Scheme, the last expression in a lambda is the return value. Also in Rust (if you leave off the semicolon to keep the epxression turning into a statement); thchr: Question: I'm using a piece of C software (MPB) where I want to call a Guile function repeatedly (thousands and thousands of times): right now, this interop is implemented with `scm_call_1` (or `gh_call1` on older Guiles), with the call in the inner loop looking like: thchr: position thchr: there is a way to speed this up? dsmith-work: thchr: Can you move your loop to Scheme? That will probably speed things up for Guile 3. Not sure about 2.x thchr: I can't move it to Scheme unfortunately; at least not without a lot of pain. thchr: It's initializing a C data structure for subsequent use in C thchr: More generally, any guidance on what precisely the bottleneck here is would be welcome: what really happens on `scm_call_1` is somewhat opaque to me: is the whole Scheme function reparsed/compiled on every call? dsmith-work: thchr: Well, I don't really know. But things *have* changed quite a bit between 1.8, 2.0, 2.2, and 3.0 dsmith-work: 1.8 was interpereted. dsmith-work: 2.0 and 2.2 compiled to a virtual machine. dsmith-work: 3.0 does too, but also has a JIT compiler to machine code. thchr: Yeah, I read that 3.0 brought JIT compiling; that's nice. I'm on 2.2 currently. thchr: I guess I'm mainly wondering whether I'm seeing such slow performance because I'm really paying for a compilation step at each invocation; if so, that would be awful. Basically, I'm wondering whether the C interop requires that I "register" the Guile function beforehand, outside my loop. dsmith-work: I don't think you are compiling at each iteration. justin_smith: how big is the overhead per C->scheme call? it could be that batching multiple calls and minimizing the amount of data that needs to cross the c->scheme boundary would help with performance justin_smith: I assume certain wrapping / conversion must happen dsmith-work: thchr: The guile devs are not currently around. It would be a good idea to post to the mailing list. justin_smith: thchr: are you evaluating a form containing a lambda from the c side? or reusing a previously created lambda? R1ck77: Hi! Did anybody manage to compile Guile for Android? thchr: dsmith-work Argh, I lost connection.Sounds like a good idea asking in the mailing list: which one is it though? The development mailing list http://mail.gnu.org/mailman/listinfo/guile-devel/ seems down (and I guess also not appropriate for questions like this) thchr: (and thanks dsmith-work) dsmith-work: guile-user, probably thchr: Hmm, also down (this one, right: http://mail.gnu.org/mailman/listinfo/guile-user/?) thchr: Without the '?'... bandali: pretty sure it's lists.gnu.org, not mail.gnu.org thchr: Ah dsmith-work: https://lists.gnu.org/archive/html/guile-user/ dsmith-work: The archives are up thchr: Nice, thanks! bandali: and mailman as well: https://lists.gnu.org/mailman/listinfo/guile-devel/ bandali: mail.gnu is our mail server, not the list server dsmith-work: https://lists.gnu.org/mailman/listinfo/guile-user/ thchr: I was following the 'development mailing list' link at https://www.gnu.org/software/guile/contribute/ thchr: Thanks all dsmith-work: thchr: Curious what you are working on.. thchr: justin_smith: Sorry, my connection dropped out and I missed your messages (found them in the log now). I guess the core problem is that I have no idea what the overhead for the Scheme->C call is. thchr: justin_smith: I'm calling a function I `(define ...)`d on the Scheme side; so I guess I'm reusing a lambda? thchr: Working on photonic crystals justin_smith: yeah (define (f x) ...) is a shorthand of (define f (lambda (x) ...)) justin_smith: so if you just call f, it will reuse that lambda justin_smith: it's the call to lambda that does the compilation work, and it should be straightforward to ensure your code doesn't do that in the path C is invoking justin_smith: unless guile has a very weird compiler thchr: So, using `scm_call_1(f, arg)` is as good as it gets then? justin_smith: thchr: likely, but you could also try measuring what happens when smaller vs. larger units of work cross the c<->scheme boundaries? and/or you could just ask the people who wrote the compiler thchr: justin_smith: I'll try both then justin_smith: if you have the patience for it, gdb on scheme calling your code, and stepping by instructions rather than lines of code is likely extremely informative thchr: I never got around to picking up gdb :( justin_smith: I discovered I was doing goops indirection for 80% of my loop once that way, lol ArneBab: dsmith-work: wow, good to know :-) ArneBab: dsmith-work: do you see something in Rust that could be added to Guile? *: ArneBab just wanted to build a small m3u-file fixer — two hours later conf can create wisp-projects but there is still no m3u-fixer :-) https://hg.sr.ht/~arnebab/conf dsmith: ArneBab: Hmm. Nope. I don't think it would be Scheme any more then. dsmith: Pattern matching. But Guile already has that. Someone is working on making it more awesome. dsmith: ArneBab: I just came off of doing about 4-5 years of Python, and really hungering for a statically typed, ahead-of-time compiled language. ArneBab: dsmith-work: at work I’m currently alternating between Javascript and Java; I learned to both appreciate types in Java and the flexibility of Javascript (along with the simpler structures people build with it). The main thing I’d carry over to Scheme is to have more focus in tutorials on records. ArneBab: define-record-type gives you the data-classes we’re hungering for in Java ArneBab: dsmith: did you already experiment with extending Guile with high-performance Rust? dsmith: Nope ArneBab: that’s a use-case for which I’d really love to see a tutorial :-) dsmith: Just learning Rust ArneBab: it’s crazy that rust managed to be the place where performance-innovation takes place ArneBab: ripgrep is a game-changer dsmith: So with the C<->Scheme interface, it's always a question of who allocates memory, and who is reposible for freeing it. That's one thing that Rust has down cold. ArneBab: (with crazy I mean: hard to believe but real) dsmith: Yeah, started using rg in emacs. Very nice. ArneBab: so with Rust<->Scheme you’d keep memory on the Rust side and only direct rust from Scheme ArneBab: rg allows me to skip IntelliJ for Javascript development and instead use dumb-jump and projectile for symbol resolution :-) alextee[m]: g_test_init(), g_test_add_func() and g_test_run() basically alextee[m]: only need these 3 alextee[m]: except add_func() adds a guile script civodul: alextee[m]: you sure you don't want to use srfi-64 or similar instead? alextee[m]: i want to replace my C unit tests (for example https://git.zrythm.org/cgit/zrythm/tree/tests/actions/copy_tracks.c) with guile, since i already exposed the functions used in the tests to guile alextee[m]: civodul: oh this looks nice! i can just somehow include my custom modules and then do the work with srfi-64 alextee[m]: thanks alextee[m]: i think i might need a little C interface to kick off the guile tests after exposing my custom modules from C rlb: civodul: I noticed that clojure's lein now produces a default project license that's not just eclipse, it's dual: eclipse or GPLv2+ with classpath exception. For projects that might want to straddle both worlds (eclipse and fsf) any idea offhand which is preferable between lein's choice or say epl + lgpl? (I'm not all that familiar with the classpath side). hendursaga: Apologies, I'm still making my way through the Guile reference manual - how would I easily modify %base-services so that I can configure network-manager-service-type, or work around it? hendursaga: Sorry that was for #guix dsmith: Apology Accepted, hendursaga tohoyn: sneek, botsnack sneek: :) kahiru: hey, I was wondering, if both let and define create local bindings, is one preferred over the other? alextee[m]: what's the easiest way to pass configuration data to a guile script? alextee[m]: similar to how you would pass it in C, like #include "config.h" alextee[m]: i have the configuration dictionary in meson but i'm unsure in what format i should pass it to guile alextee[m]: (it contains things like HAVE_THIS_FEATURE: true, HAVE_ANOTHER_FEATURE: true) ArneBab: alextee[m]: I’d use either an alist (to check with (assoc key the-alist)) ArneBab: alextee[m]: or create a record (define-record-type …) ArneBab: the advantage of the record is that the format is clearly defined. The disadvantage is that it’s harder to change and more code. ArneBab: I’m not sure whether there’s a better way — maybe wait for others here … alextee[m]: oh hmm alextee[m]: maybe just (define key "value") for each one alextee[m]: that way i can just do (if key ...) alextee[m]: thanks anyway :-) alextee[m]: omg this is awesome! i wrote a unit test in guile! kahiru: alextee[m]: can I see? alextee[m]: kahiru: this is my test runner https://git.zrythm.org/cgit/zrythm/tree/tests/guile_runner.c alextee[m]: and here is my test: *: alextee[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/DLhgjjxesLqZseRfJmFJcqdi > alextee[m]: those modules are exposed in each file in src/guile in that repository kahiru: cool dsmith-work: UGT Greetings, Guilers mwette: howdy! justin_smith: kahiru: an advantage of let, all else being equal, is that the let form imposes a predictable structure where bindings are created then used, which is useful for macros and preferred by some human users kahiru: makes sense, thanks davidl: are there any SCA tools for guile? davidl: like this is the kind of stuff that everyone wants now or will soon want/require: https://www.kiuwan.com/languages/ and if Guile doesn't have it, Im not sure how much Ill be able to use it in the future in a business environment. justin_smith: davidl: I've had poor luck finding such tools for lisps, the tools tend to be pretty shallow and require a level of predictability that's less common when you have powerful macros davidl: justin_smith: it's unfortunate. "tend to be pretty shallow" - so you know of some tools at all? I haven't found any. Could you name some tools you know of? justin_smith: davidl: I mean the ones that are implemented for other languages are shallow davidl: aha ok justin_smith: that kind of shallow analysis doesn't cut it in a lisp with a real macro system justin_smith: otherwise they could do bytecode / object code level analysis, but you have to pay individual human beings to analyse that (there are tools that help but they only go so far) justin_smith: I mean, if you think for a moment about the domain, it's halting problem complete justin_smith: if you look at the sources of most real security bugs (unchecked array access, arbitrary side effecting code inside data constructors), we should be far ahead of the game :/ justin_smith: but we don't have static code that can prove it davidl: justin_smith: I do not understand "halting problem complete", but what you are saying is very interesting. I would love to read some blog post around these issues that centers around guile or lisps in general. justin_smith: davidl: what I mean is that the halting problem says you can't (in the general case) prove a program doesn't do X without running the program. There's always the pathological case that violates your analytic constraints (usually proven by taking the analyzer itself as an input) justin_smith: davidl: yeah, it would be a good topic for a blog post, I'm getting laid off in a couple months might even have a chance to write it up properly ArneBab: You can actually prove subsets of programs — the little prover explains a lot there, but feels like it’s built to build compilers: https://mitpress.mit.edu/books/little-prover ArneBab: also if you can constrain the inputs, you can constrain the outputs. ArneBab: (though I don’t know whether my reply really answers your question) justin_smith: ArneBab: yeah, these things are true, but the existing static analysis tools are just fuzzy matchers for common bugs (failing to check bounds, not sanitising input to certain constructors etc.) tinga: Hi. Is there syntax foo somewhere for something between case and cond, so that (foo c (bar? 1) (baz? 2)) is the same as (cond ((bar? c) 1) ((baz? c) 2))? chrislck: tinga: try (ice-9 match) tinga: Thanks, checking tinga: Not sure how you'd do it, via (? predicate pat_1 ... pat_n) ? tinga: (looking at https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Pattern-Matching.html) chrislck: (match c ((? bar?) 1) ((? baz?) 2)) tinga: OK mfg: hi, does the mkdir function create paths like mkdir -p ? justin_smith: mfg: a quick try tells me no (fails with "no such file or directory") justin_smith: it should be easy to make parts of a path in a loop though mfg: hm okay, that's what is suspected too. building the path up is the way to go then :) justin_smith: this works - (for-each mkdir '("foo" "foo/bar" "foo/bar/baz")) mfg: thank you mfg: ah this is rather short! nice leoprikler: there's also a mkdir-p in guix, check it out ;) justin_smith: you could make a small function to take foo/bar/baz and generate (foo foo/bar foo/bar/baz) mfg: leoprikler: in what module is it? leoprikler: (guix build utils) mfg: nice thx :) alextee[m]: Sweet justin_smith: I have a hunch that the problem with JIT is the same as with build systems, versioned deps, and threading, but amplified. People who don't understand it intimately consider it a solved problem and are confused that the options all exist. People who know it well enough to improve it are disappointed by mainstream designs that should be able to do some priority feature. justin_smith: without massive institutional backing the likely outcome is large numbers of 40% solutions that mostly work on some happy pass justin_smith: s/happy path/happy pass/ justin_smith: OK that substitution was reversed :/ justin_smith: either it's a hard enough problem that there's no good solution, or it's hard enough that qualified and competent people can't recognize a bad solution spk121: . dftxbs3e: justin_smith, I am well aware that technical problems need many different experiments before settling onto a solution everyone can approve. But before going into making a whole JIT library, I am confident there has to be a common ground already that solves the portability problem. Such as maybe a portable macro assembler that can make use of CPU features as it detects them. When the portability problem is out of question, it's less of a problem dftxbs3e: to make many JIT implementations. RhodiumToad: (use-modules (xkcd now-there-are-N+1-conflicting-standards)) daviid: spk121: hello! everything is alright? spk121: daviid: oh hey. been a strange few months. But that's probably true for everyone, I guess. daviid: spk121: yes, definitely - very strange times that is ... tohoyn: sneek, botsnack sneek: :) ArneBab: RhodiumToad: do we have that? chrislck: I think RhodiumToad was jesting like python's >>>import antigravity ArneBab: if xkcd were by-sa instead of by-nc, I’d totally go for such a module :-) *: RhodiumToad checks whether he is connected now RhodiumToad: it was mostly a comment on the proliferation of JITs conversation RhodiumToad: https://xkcd.com/927/ ArneBab: I know the strip, I just thought we might have that, because that would be totally cool :-) ArneBab: maybe even with keyword search wired into auto-complete? (I don’t know how we could do that) alextee[m]: can we please install this binary in future releases of guile? libguile/guile-snarf-docs alextee[m]: i currently have to use it directly from the source code of guile after building it dsmith: Hey hey sneek: dsmith, you have 1 message! sneek: dsmith, R1ck77 says: thank you for the info: chibi does look promising (not giving up on Guile yet, though)! dsmith: So, just catching up on the logs. dsmith: About the proliferation of JITs dsmith: And the lack of ppc64 in Guile dsmith: My understanding: The Lightning interface was not a good fit for Guile. dsmith: Lightnening is Lightning with an api more suited to Guiles needs. dsmith: ppc64 *is* in Lightning. dsmith: So all that needs to be done is simply provide the same lightning->lightEning trasformation for ppc as was done for arm and intel. dsmith: Heh dsmith: For example, that nasty segfault bug on arm also exists in Lightning. The lowest level code is very similar if not identical. dsmith: Just need someone with PPC64 system and deep understanding of PPC to work on it. dsmith: Ppc is rare these days. Arm seems to have taken over. dsmith: Motorola/Freescale/NXP seems to have moved to arm too. mwette: One explanation for the man JITs: The same as there are many computer languates, C compilers, databases, text processors, operating systems, etc. The one real resource that is requried to start a new JIT is time and an interest to do so. And there is always someone who has different view of what the best design is. mwette: My WD network drive is linux/ppc, but it's several years old. Do the new ones use ARM? mwette: I see lightning has RISC-V but not lightening. dsmith: risc-v might have been added after Andy did the "fork". lle-bout: dsmith, I can donate access to a PPC64 VM lle-bout: I have a big machine at home lle-bout: if you have IPv6 networking, then I can give you access. lle-bout: dsmith, PPC64 has a modern and performant FSF RYF certified system: https://www.fsf.org/news/talos-ii-mainboard-and-talos-ii-lite-mainboard-now-fsf-certified-to-respect-your-freedom lle-bout: That's why it's so interesting lle-bout: All the firmware is FOSS dsmith: lle-bout: Thanks, but I'm not the ppc expert. I've used it on various embedded boxes, but only from C. lle-bout: The bootloader and all is FOSS, everything is FOSS, it doesnt need proprietary software at ALL. lle-bout: and it's on par with some Intel Xeon (minus software optimizations) lle-bout: IBM published all the code under FOSS licenses with it's latest chip POWER9 and made the PowerISA 3.x royalty-free just like RISC-V lle-bout: but PowerPC has decades of history and software support compared to RISC-V lle-bout: So it's more interesting lle-bout: You can get a ready to use desktop system here: https://raptorcs.com/content/BK1SD1/intro.html lle-bout: also, community of RaptorCS customers and beyond: #talos-workstation dsmith: lle-bout: Is it an rs-6000 ? lle-bout: dsmith, that's old and slow, it's custom built by RaptorCS and based on this chip: https://en.wikipedia.org/wiki/POWER9 lle-bout: POWER9 chip was released in 2017 lle-bout: by IBM dsmith: Ewww. Broadcom NIC dsmith: Broadcom is just about the wost to get device info from. dsmith: But there are probably already working drivers, right? lle-bout: dsmith, wrong; I can attest it works very well and it has a FOSS firmware implementation as well! https://github.com/meklort/bcm5719-fw lle-bout: the driver is in the Linux tree dsmith: Good alextee[m]: are there guile bindings for the glib test system? Wojciech_K_mkr: Thanks, sp1ff narispo: it's unfortunate that work on JIT backends is being duplicated across libjit, libgccjit, GNU Lightning and within GNU Guile itself - the result is poor platform support. narispo: All are GNU projects, by the way. narispo: It's not about other non-GNU like DynAsm narispo: Or Cranelift leoprikler: Sounds like NIH on drugs. tohoyn: sneek. botsnack sneek: :) ArneBab: narispo: they are different enough, that it isn’t easy to just merge them together. There are different approaches that get tried. GNU Guile is using a fork of GNU Lightning, by the way. For the reasoning, see https://wingolog.org/archives/2019/05/24/lightening-run-time-code-generation narispo: ArneBab: I heard that in a conference from Andy that they werent happy with GNU Lightning ArneBab: narispo: see the blog entry, it’s about that and the why narispo: ArneBab: I see, well I need PowerPC 64-bit le and be support but I'm not well versed enough with PowerPC 64-bit assembly and ABIs to write things such as JITs. jonsger: I tried once, but didn't get far https://gitlab.com/jonsger/lightening/-/tree/port-to-ppc64le narispo: ArneBab: Are GNU Lightning authors just gone? narispo: Because if not, I am certain they could address Andy's concerns or at least help. narispo: jonsger: cool! ArneBab: Looking at the blog post, that doesn’t seem likely, because they have a different technical vision. The best approach for something depends on your use-case and Andy's approach didn’t match where they wanted to go. ArneBab: narispo: do you need PPC 64 support for Guile or for something else? narispo: Visions are important but community work is important too narispo: I am certain there is a common ground to find between Andy vision and GNU Lightning ArneBab: yes, it is. And our limited free time often forces us to priorize. narispo: After all, both Guile and Lightning are GNU projects, it's not like complete strangers. narispo: ArneBab: It is for GNU Guile narispo: I am porting GNU Guix to PowerPC 64-bits ArneBab: nice! ArneBab: I trust Andy that he tried to find common ground but found that we wouldn’t be able to do the work on Guile with that. ArneBab: s/we/he/ narispo: It is very sad. The goal of GNU Lightning is to be useful and it's not. I thought RMS was especially careful to try not to duplicate work but it seems there's 3-4 JIT libraries within the GNU eco-system. narispo: JIT is a big problem for portability. Around the eco-system, it seems everyone is using specialized JIT engines. There is no go-to library that everyone can use and be happy with it's design to feel like they can contribute to adapt it to themselves. narispo: LLVM and GCC have made AOT compilers more portable but JIT compilers which have different needs do not benefit from this at all right now. narispo: WebKit, Firefox and Chromium are also all using their own JIT engines. narispo: It is a total mess. narispo: Porting a JIT requires advanced expertise that isnt easy to find. narispo: It's one of the worse areas of computer engineering to do duplication in when it comes to portability. ArneBab: While I think that your analysis, that this is a problem, is correct, the reason is most likely that we’re already happy to have some people at all who invest into JIT-work. ArneBab: (sidenote: Java and pypy also have their own JIT — possibly the decisions in a JIT-engine are more closely tied to the exact needs of the language than an AOT compiler) ArneBab: (replace "language" with execution environment — virtual machine) ArneBab: (execution environment, because there are now many languages on the JVM and on pypy — but for all the speed of the JVM, kawa, which is a scheme on the JVM, is on the slower end of the Scheme implementations. See https://ecraven.github.io/r7rs-benchmarks/ ) dftxbs3e: ArneBab, It is definitely a problem eco-system wide that needs solutions. There has to be a common denominator that allows both portability and writing performant JITs. It could be as simple as a portable macro assembler that makes best use of the CPU features as it detects them and then you are free to do whatever you want on top. If there was a single place where everyone put work into, then the problem of finding people to write JITs would be dftxbs3e: solved. The designers of GNU libjit argue the contrary: "However, there is a problem with current JIT approaches. In almost every case, the JIT is specific to the object model, runtime support library, garbage collector, or bytecode peculiarities of a particular system. This inevitably leads to duplication of effort, where all of the good JIT work that has gone into one virtual machine cannot be reused in another." - https://www.gnu.org/software/ dftxbs3e: libjit/doc/libjit.html - but I don't think they are right. dftxbs3e: https://www.gnu.org/software/libjit/doc/libjit.html - full link dftxbs3e: Oops, more relevant: "Most of the work on a JIT is concerned with arithmetic, numeric type conversion, memory loads/stores, looping, performing data flow analysis, assigning registers, and generating the executable machine code. Only a very small proportion of the work is concerned with language specifics." dftxbs3e: I don't mean to quote the first one but the second. dftxbs3e: There's also GraalVM that tries to support many languages at high speed by Oracle, not sure if it can succeed. catonano: hendursaga: there's also Spook https://muto.ca/p/spook.html catonano: It does the same work of Haunt bu it's a distinct project stis: hej hopp guilers! alextee[m]: is there a way to pass NULL via guile to my C side? alextee[m]: passing 0 tells me Wrong type argument in position 1 (expecting POINTER_P): 0 alextee[m]: and passing nil tells me unbound variable stis: alextee[m]: (address->pointer 0) stis: or such alextee[m]: stis: thanks! roelj: alextee[m]: There's also %null-pointer tohoyn: sneek, hello tohoyn: daviid: I have been away for some time. is there anything new with g-golf? tohoyn: sneek, botsnack sneek: :) roelj: Reading from a FIFO seems harder than I thought. I have the following snippet: http://paste.debian.net/1155880. This hangs if something was written before I open the FIFO, but works fine if I write something to it while I am already reading from the FIFO.. I thought ‘char-ready?’ would make sure the opposite happens. roelj: Any pointers to the docs would be appreciated. :) roelj: Oh I see this is quite a tricky part. I was reading the R5RS manual that didn't include the elaborate restrictions on when it works. lloda: I call (help (my module)) and I get lloda: While compiling expression: lloda: In procedure "primitive-call-ip": Wrong type argument in position 1 (expecting "PRIMITIVE_P"): # lloda: something in (my module) surely, but what? the module works fine from what I can tell lloda: a more general question, how can I get those While compiling expresion... errors to give me a backtrace lloda: ok I got to (compile '(begin (import (ice-9 session)) (help (ffi blis)))) ... lloda: that was (my module) lloda: looks like a bug in (texinfo reflection) :-\ lloda: (help) doesn't seem to like it when I export from a macro dustyweb: hi davexunit ! dustyweb: I guess I really ought to get those Haunt patches upstream to you dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work, happy Friday! :-) Wojciech_K_mkr: Hi! What is Guile's way of making sure resources are closed? I mean scenario like: 1. open a file 2. process contents 3. close file even if step 2 raised exception Wojciech_K_mkr: Should one just use exception handlers? sp1ff: Wojciech_K_mkr: curious to hear from others, but for myself I use `call-with-port', or `call-with-input-file', and just count on the garbage collector on abnormal return (such as an error) hendursaga: Anyone here have experience with SXML? hendursaga: I'm looking for projects that use it, that are open-source. It seems a very good idea but doesn't seem to get much attention beyond papers and talks. pkill9: hendursaga: there is Haunt I think pkill9: a static website generator hendursaga: pkill9: Cool! And it has Atom support. hendursaga: At least building. Is there any RSS/Atom feeds readers/aggregators written in Scheme? dsmith-work: hendursaga: People are deathly afraid of parens for some reason. minerjoe: I'm loving guile. New to scheme, old time C and Common Lisp. Thanks to all you. manumanumanu: leoprikler: more like (match black-box ((my-own-pattern-matcher key val) val) ...) I doubt I will make it optimize 2nd hand pattern matchers, but lists, vectors, streams and such will all be matched. I could probably even make one for generators, given I can (gcons ...) them back on again. manumanumanu: whereas you with ice-9 match is limited to whatever it supports. Which takes you all the way there, always, but it would still be neat to have. Say custom matching for a goops class leoprikler: I don't think that'll work, because pattern matching is basically syntactic sugar manumanumanu: leoprikler it works already. I can query a binding in a module and get it's value, and if that value happens to be a macro expander I can use that to make my matcher modular manumanumanu: I could also do the simple thing. Register the syntax object of the name of, say, (define-matcher my-matcher ...) and check whether a matcher used points to the same thing on the syntax level. manumanumanu: I would guess racket does one of those above (probably the first one, since matchers are represented as structs and you have to work with them programmatically to actually get any meaningful thing out of them leoprikler: hmm, that sounds a bit like how (ice-9 regex) works to me leoprikler: If you use records to store information you can have functions instead of macros manumanumanu: well... I _want_ the resulting code to be fully expanded. I just query whether (@@ (module module) name) is an instance of the record manumanumanu: if it is, I use the macro expander stored in the record to expand to whatever it expands manumanumanu: that means, however, that the syntax will be more verbose: (ice-9 match) matches lists like (a b c), whereas my expander (and iirc racket's) will use (list a b c) leoprikler: hmm, perhaps you could try with a variant of ice-9's matcher that allows invoking custom macros leoprikler: e.g. binding the special symbol => to your magic leoprikler: that way you can have list matching as (a b c) and you can also have (=> my-matcher d e f) leoprikler: (by the way, is there a reason why ? is not enough) manumanumanu: leoprikler: I don't want to invoke anything in the patterns. Everything that is not a matcher should be either a literal (to be tested with equal?) or an identifier to be bound or an ignoring _. roelj: Hm, how can I capture the stderr from an open-input-pipe? I tried wrapping (with-error-to-port (open-output-string) ...) around it, but the stderr of my terminal is used instead.. manumanumanu: roelj: i don't know of any way :( Even the open-process (on which open-input-pipe is built) only provides stdin and stdout iirc manumanumanu: you could write your open-process using fork manumanumanu: that is gnarly by the standards of people not used to C, though roelj: Well thanks for the bad news :) manumanumanu: we should really have an even lower level way than the hacky (@@ (ice-9 popen) open-process). Racket's subprocess returns a stderr where supported iirc, so does chez roelj: I agree roelj: For now I'm going to try to implement it in C. roelj: Outside of Guile roelj: Hha, come to think of it. A hack would be to create a temporary file and append "2> that-temp-file", and then simply read from that file with Guile. roelj: .. so is there a facility in Guile to make a named pipe? (A pipe that I can write to as if it was a file) manumanumanu: roelj: like a fifo? manumanumanu: but a file roelj: (mknod ... 'fifo ...)? roelj: manumanumanu: Yes, exactly a fifo. manumanumanu: mknod manumanumanu: iirc manumanumanu: roelj: ^ roelj: Ideally, can it be combined with tmpnam in a safe way? manumanumanu: that I can't answer though. i'd say probably not since I suspect it is just a wrapper around mkfifo roelj: thanks roelj: Sweet! Using "mkstemp!" and redirecting error output to (port-filename ...) I captured the stderr from "open-input-pipe". It'd be even better if I could instead use a FIFO, but I don't know how to retrieve the filename from (mknod ... 'fifo ...).. manumanumanu: good! nice to hear it worked out rekado: roelj: you provide the file name to mknod. roelj: rekado: Hm yes. How do I create a filename that I can safely pass to mknod? manumanumanu: roelj: randomly? :D Read 16 bytes from urandom and create a filename roelj: What does mknod do if the file already exists? manumanumanu: roelj: raises an exception roelj: Great manumanumanu: I don't know what exception (and I don't really know how to work with the new exception system). roelj: That can be found out quickly enough :) dsmith-work: Thursday Greetings, Guilers manumanumanu: roelj: did things work out for you? stis: how can a print a stack trace at will? justin_smith: stis: try (backtrace) stis: thanks mwette: But I think you need to create a stack object first; I had code but can't fidn it now justin_smith: stis: I didn't expect it to be that simple, I found it with (apropos "backtrace") mwette: maybe the stack thing is if you want to start a debug-repl "at will" stis: backtrace works perfectly, mucho thanks. justin_smith: correcting myself, I ran (apropos "trace") stis: that command was wonderful to put in my program, made the bug shallow. justin_smith: stis: the built in debugger is also helpful - it can do similar, without needing to change your code stis: I know but the bt is lost because of ctaching and throwing at multiple places stis: the original stack is hence lost when one does ,bt justin_smith: stis: oh yeah, and with TCO it gets even worse, good point manumanumanu: Ahoy hoy! How are you all?! I must warn you. I am in a crazy good mood! I finally got a linux computer again, which means I am now back on a 4k screen and life is good! stis: o/ stis: pythons function argument handling is really advanced manumanumanu: in a good way or in a bad way? stis: I think it has too many features, makes it slow and hard to interop with guiles conventions (keywords) manumanumanu: does it do the whole "apply with hash table"? stis: The only thing I do not implement is / and * separators, I parse them though manumanumanu: but does python do that? it seems like a bad idea... stis: keywords are slooow, mainly because I need to interoperate with guile's conventions stis: so lot's of flattening hashes to lists like (#:keyw1 'adsds' #:keyw2 1234 ...) and likewise constructing them and in the process translate keyword types back and fourth to strings manumanumanu: :D stis: *a **a is supported stis: just a single * and a single / is not suprted (yet) stis: I also have a macro so that you can have the python convention in scheme if you like stis: it looks like e.g. (def (f *li **keyw) ...) stis: it looks like e.g. (def (f (* li) (** keyw)) ...) stis: and you have (= a b) possibilitis as well to implement normal keywords manumanumanu: if it is any consolation, procedure calls are slow in regular python as well stis: yeah hole of python is a set! mess with unesesary designs decitions that makes it sloooooow stis: so functional programming is a fake there, mutating is in the design. stis: I mean you have no hope in using delimited continuation that you reinstate more then one time manumanumanu: My friends usually become angry when I categorize python as a language in the "mutability-first" category manumanumanu: guh. apple apparently killed target display mode, which has made my inherited imac 2015 a very expensive and fragile paper weight. dsmith-work: Morning Greetings, Guilers stis: o/ mwette: Does anyone know of a string-diff function, analygous to "diff" for text files, in either Scheme or C? stis: I think there is a diff in the python-on-guile, not sure if it works. mwette: thanks -- will look mwette: SequenceMatcher in python difflib chrislck: guile should have a style guide similar to https://google.github.io/styleguide/lispguide.xml jcowan: How does Guile support #n= and #n# lexical syntax? Does it insert markers for #n# and patch them up, or does it process them forward somehow? wklew: chrislck: there is this one, often mentioned https://mumble.net/~campbell/scheme/style.txt manumanumanu: chrislck: Ḯ have been writing a little text on how to write fast idiomatic scheme (and why python programmers always tend to write the slowest scheme) manumanumanu: and it has some style advice manumanumanu: which is very similar to the one you linked, but with a "pattern matching for clarity" manumanumanu: i have been meaning to publish it soon. I will make sure to ping you when I do manumanumanu: and if I ever finish my optimizing pattern matcher, the current _marginal_ downside of match compared to hand tuning your cond code will be nil. roelj: So, I execute a command using open-input-pipe and I capture both stderr and stdout (by using with-error-to-port). If the command was succesful, output is written to stdout, but if something goes wrong, output is written to stderr. How can I properly test whether the command ran succesfully? roelj: I think the test would be something along the lines of "if something was written to stderr, return #f". roelj: Would “(eof-object? (lookahead-char stdout-port))” block? dsmith-work: Command success and stuff written to stderr are independent. dsmith-work: Lots of things write to stderr to not pollute stdout. dsmith-work: Well, maybe not "lots". roelj: dsmith-work: Yes, I am aware. But I am certain this command will only write to stderr if something goes wrong ;) roelj: It's a very very special case dsmith-work: Ok. roelj: And in this case the exit code in both cases is 0.. dsmith-work: Eww roelj: Yeah, I know manumanumanu: roelj: isn't there a char-ready? roelj: manumanumanu: Hah! There is! roelj: manumanumanu: Thanks! manumanumanu: good old "venerable port interfaces" manumanumanu: you will need to double check that it isn't the eof object though manumanumanu: as that also satisfies the predicate manumanumanu: roelj: ^ roelj: manumanumanu: Thanks, I was reading the manual :) dsmith-work: roelj: I'm curious what you come up with. roelj: dsmith-work: I've run into some problem, but currently I have: (and (char-ready? port) (not (port-eof? port))) roelj: I'm sure I have something working at some point tomorrow. manumanumanu: Wow... I am playing around with syntax-local-binding. great scott. fun times! manumanumanu: who would have thunk it, that little me could have so much fun with module reflection. I can now, at compile time, tell whether something is a pattern matcher or not as long as it is in another module. leoprikler: great, let's use that for pattern matching leoprikler: (cond ((pattern-matcher? code) ...)) aleix: hi there! the other day i needed to create a small web server to receive a POST. the current run-server handler is good, but too generic. i was wondering if there's something were you can add more specific matches (like a gorilla mux for go: https://github.com/gorilla/mux). artanis (https://web-artanis.com/) provides something like this, but i'm only interested in the multiplexer part. ArneBab: aleix: did you try using (ice-9 match) in a principal handler? aleix: ArneBab: I didn't try but thought about using it to build a simple router. you would have to add some bolier plate to get the request-method, etc. aleix: may be I should try it and it might look simpler than what I was expecting aleix: i was thinking of something that allows you to simply do ((GET "/user/{id}") get-user) where get-user would be (define (get-user request id)) or something like that ArneBab: aleix: if the watch doesn’t get elegant enough, you could also try to take out the boilerplate with something like (define-syntax-rule handle-id ...) ArneBab: aleix: please tell us what you end up with! aleix: ArneBab: thanks! yes, i will. rekado: I’m not sure if this is a bug, but I found unexpected behavior in the web client rekado: I’m generating an Authorization header to talk to AWS and I want it to look like this: Authorization: AWS4-HMAC-SHA256 Credential=AKIA00FOOBARBAZ/20200707/eu-central-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=dffbd63b2f39efeaedc4ee013dab88f211000e2b35bedbb9746d34bd20000b02 rekado: Guile, however, wraps the value of SignedHeaders in quotes rekado: … Credential=AKIA00FOOBARBAZ/20200707/eu-central-1/s3/aws4_request, SignedHeaders="host;x-amz-content-sha256;x-amz-date", Signature=dffbd63b2f39efeaedc4ee013dab88f211000e2b35bedbb9746d34bd20000b02 … rekado: the result is that AWS assumes that the “host” and “x-amz-date” headers aren’t signed; it expects the signature to include the missing headers “"host” and “x-amz-date"” rekado: I work around this by replacing (@@ (web http) default-val-writer), but this isn’t great. rekado: my variant removes (string-index val #\;) from the condition. rekado: sooo… who is wrong here? Is it correct of Guile to change the value of the Authorization header that I provide as an alist of symbols to strings, or is AWS just too stubborn? leoprikler: looking at this it does appear quite weird that only SignedHeaders are quoted dsmith-work: Greetin's Guilers rekado: leoprikler: it’s the only key/value pair whose value contains “;” rekado: that’s why it’s quoted rekado: but AWS thinks it’s wrong to quote anything in this carefully crafted Authorization header. leoprikler: hmm leoprikler: in my personal opinion both the quoted and unquoted versions should have the same semantics leoprikler: but I don't see why quoting is needed – this might be just a heuristic on (web client)'s part leoprikler: IOW the carefully crafted authorization header is legal, but AWS is also a bit stubborn leoprikler: I think RFC 7230 section 3.2.6 allows for different interpretations here dustyweb: hello #guile! Tirifto: Hello #dustyweb! dustyweb: hi Tirifto roelj: My Guile-based web server crashes with exit code 141 (broken pipe). The interesting part is that if I run it in a Guix container (guix environment -CN ...) the "broken pipe" is handled by “(catch 'system-error ...)”. This is Guile 3.0.2. Where could I begin to look? civodul: hi roelj! civodul: roelj: perhaps you need to (sigaction SIGPIPE SIG_IGN) or something? civodul: the default handler for SIGPIPE terminates the program roelj: Hi civodul! roelj: Hm, I totally overlooked that indeed. roelj: Thanks! That should allow me to fix this :) civodul: yw! civodul: see "info libc" for more info on that roelj: Hah, for this I pulled the physical copy of the glibc manual from by bookshelf. There are only few opportunities to do so.. :D dsmith-work: {appropriate time} Greetings, Guilers stis: tjena guilers! stis: \me is trying to get cpythons unittest to work stis: with python on guile dsmith-work: stis: How is that going? stis: small steps forward. Find small issues all the time. Python is quite complex under the hood stis: x-tra tricky to get it to interoperate well with guile stis: getting the modules working correctly is very difficult dsmith-work: hey R1ck77: Hi! Is there any way to add a docstring to function definitions (a-la-elisp/Clojure)? sneek: Welcome back R1ck77, you have 2 messages! sneek: R1ck77, dsmith says: For embedded, there is Chibi Scheme: http://synthcode.com/scheme/chibi/ sneek: R1ck77, dsmith says: "Chibi-Scheme is a very small library with no external dependencies, intended for use as an extension and scripting language in C programs." R1ck77: sneek help R1ck77: sneek botsnack sneek: :) mwette: Rick77. If the first expression in a procedure body is a string, then it serves as the docstring. (define (foo) "does nothing" #t) ; guile> ,d foo janneke: hmm, i'm getting a build failure for guile-1.8.8 on x86 janneke: PASS: test-bad-identifiers janneke: ERROR: Value out of range -9223372036854775808 to 9223372036854775807: -9223372036854775808 topoi: How do i transform '(a (b c)) to '((a) ((b) (c)))? It should be plainsimple but i seem to do overlook something. sneek: topoi, you have 1 message! sneek: topoi, wingo says: there were problems in guile and g-wrap, but now for me guile-gnome works fine with master topoi: I just want to transform the elements in a tree. topoi: (resp. the leaves) chrislck: this is not straightforward chrislck: here's a super ugly version: https://pastebin.com/raw/3r676bwz topoi: chrislck: Thx. =) Ugly is better than dysfunctional. I tried with recursion and stateless (foldr like) but seemed to make some stupid mistakes which I could not see. justin_smith: this version makes a new list instead of mutating the one you already had http://ix.io/2qXi justin_smith: (stateless, as you say) stis: perhaps my-flatten in https://pastebin.com/7WBR6Mr1 chrislck: topoi, cleaner: https://pastebin.com/raw/hb6FjGZt chrislck: ^ this one optimized topoi: (I needed it for a better representation of a huffman tree; you need small fun projects for keeping fit. I lost it as it seems. =) justin_smith: chrislck: optimized in what sense? less stack usage? chrislck: I think so, avoids list-generating map justin_smith: but it calls reverse, which walks the entire result at the end justin_smith: the job here is making a list chrislck: ah true topoi: justin_smith: There was a useless layer in it. As I failed to flatten the bottom layer I tried the inverse and failed again, became quite frustrated after a while and then joined #guile to find some friendly folks who arbitrated my anger. =) justin_smith: topoi: haha, well hopefully one of our examples help then topoi: I'll walk through each of them. Thanks all! =) chrislck: (ignore the embarassing ugly one) justin_smith: chrislck: well it did respond to the question literally (while the others make new lists) chrislck: but is O(N^2) at least stis: topoi: non functional version that is avoidingin append, tree traversal with ackumulator. see https://pastebin.com/dGkZUUKw stis: oh I forgot to return the value of the ackumulaotor: (let ((ack (mk-ackumulator))) (tree-traversal x ack) (ack))) stis: is the corrected version stis: and a functional one avoiding append https://pastebin.com/XEzRByFv chrislck: prize for someone who writes using fold justin_smith: chrislck: I claim my prize http://ix.io/2qXs justin_smith: if fold-right isn't acceptable, pretend I called reverse! on the result of fold justin_smith: oh I left out the actual call: (map-tree list '(a (b c))) => ((a) ((b) (c))) chrislck: 👏 chrislck: was looking for something like https://pastebin.com/raw/M3R9xfmr without justin_smith: my map version doeos less work, by actually producing the result in the same order the output needs it R1ck77: Hi! Is there in Guile the equivalent of Clojure's interpose? R1ck77: (interpose "," '("hello" "there")) -> '("hello" "," "there") rgherdt: R1ck77: string-join rgherdt: hmm, not the same, sorry. this one merges the strings R1ck77: can I add a separator while joining? The stuff I'm doing is actually strings, so.. *: R1ck77 testing R1ck77: it does exactly what I need, thank you rgherdt! R1ck77: (still curious if a general interpose exists btw, so if there is any taker, he/she's welcome) rgherdt: yw chrislck: is (apply fn args) known to have performance issues with big args? chrislck: hmmm no: (define lst (iota 10000000)); ,time (apply + lst) = 0.3s and (fold + 0 lst) = 0.5s montxero: I've written a small library, how do I load it in the repl? RhodiumToad: what kind of library? montxero: one 1 wrote my self RhodiumToad: ,use (whatever) is a shorthand for (use-modules (whatever)) for the repl montxero: ahhh montxero: thanks RhodiumToad: you may also need to add the current dir or whatever dir your module is relative to to the load-path, there's a function for that montxero: was killing my self with ,import (whatever) montxero: I did (add-to-load-path "pwd") RhodiumToad: (add-to-load-path ".") is more likely what you wanted unless your dir is named "pwd" RhodiumToad: ,import is the same as ,use afaik montxero: import didn't work for me montxero: Hmmm, do I need to do someting special to call funtions defined in the library? RhodiumToad: how did you define the library? montxero: r6rs style definition. RhodiumToad: ah montxero: Making a pastebin now RhodiumToad: ok, so the docs say the r6rs definition is actually expanded to a guile-style (define-module), so it should be fine to load it with ,use RhodiumToad: when you say "didn't work", what actually happened? montxero: RhodiumToad: https://pastebin.com/SVDyb5Be RhodiumToad: the (add-to-load-path) part needs to be done in the repl, not the module montxero: RhodiumToad: I can't call functions exported in the library montxero: I did the (add-to-load-path) in the repl as well RhodiumToad: did the ,use or ,import succeed or fail? montxero: It is in the library so it compiles montxero: both ,use and (import (lib)) worked montxero: ,import worked as well RhodiumToad: does the file name not match the module name? montxero: it does. the file name is interpreter.scm RhodiumToad: hm, it works when I try a trivial module using the same style RhodiumToad: I put (library (interpreter) (export foo) (import (rnrs)) (define (foo x) (+ 1 x))) into interpreter.scm, RhodiumToad: and did (add-to-load-path ".") and ,use (interpreter) in the repl RhodiumToad: and then (foo 1) returned 2 as expected montxero: will try that now RhodiumToad: what guile version are you using? montxero: 3.0.2 RhodiumToad: ok, I just tested that with the exact same as above and it also worked montxero: I am typing that in to try it now montxero: It did for me as well! montxero: but my original library is not working yet montxero: Does it matter that I compiled it first? montxero: with guile interpreter montxero: with `guile interpreter.scm ` in a terminal? RhodiumToad: shouldn't matter, no dale`: I have had patches in the database #40719 for some time now to introduce an improved (ice-9 getopt-long) module. I realize it's a bit of an elephant-bomb compared to most patches, but was wondering if someone might be able to review it sometime soon? jackhill: I have a geiser problem: when using M-x geiser-connect, it takes a long time to connect, and the prompt in the repl looks like: contains many ^A^B jackhill: everything seems to work fine with M-x run-geiser. I suspect I've done something wrong with my enviornment, but where should I start looking? dsmith: chibi scheme is supposed to embed well dsmith: http://synthcode.com/wiki/chibi-scheme dsmith: sneek: later tell R1ck77, For embedded, there is Chibi Scheme: http://synthcode.com/scheme/chibi/ sneek: Okay. dsmith: sneek: later tell R1ck77 "Chibi-Scheme is a very small library with no external dependencies, intended for use as an extension and scripting language in C programs." sneek: Okay. justin_smith: oh, someone already did an android port too https://github.com/sergv/chibi-scheme-android terpri: hm, i hadn't thought about chibi for a while. maybe it would be useful for game developers, in contexts where they might embed lua or something terpri: wren is interesting btw: https://wren.io/ not all that semantically interesting, but kind of like embeddable smalltalk with JS-ish syntax and erlang-style processes (iirc) dsmith: I looked at Chibi slightly. Slow. Like Guile 1.4 slow. dsmith: Now where is that scheme benchmark site? dsmith: sneek: benchmarks? sneek: Someone once said benchmarks is http://ossau.homelinux.net/~neil/ ArneBab: https://ecraven.github.io/r7rs-benchmarks/ dsmith: sneek: forget benchmarks sneek: Okay. ArneBab: sneek remember benchmarks https://ecraven.github.io/r7rs-benchmarks/ dsmith: sneek: benchmarks are at https://ecraven.github.io/r7rs-benchmarks/ sneek: Understood. ArneBab: sneek: botsnack sneek: :) dsmith: goodbot ArneBab: yes, chibi is among the slow schemes dsmith: No depenencies is nice. ArneBab: yes dsmith: sneek: benchmarks? sneek: Someone once said benchmarks is at https://ecraven.github.io/r7rs-benchmarks/ montxero: Are libraries defined using the `(library ...)` syntax restricted to one library per file? montxero: Thanks, I just figured it is. rlb: mwette: don't know if you were already thinking about it, but suggest considering providing msync as well, and maybe some way to get the fd for other operations, unless of course your api just works on file descriptors in the first place. justin_smith: is there a way to get the "type" of some object without initializing goops? rlb: justin_smith: hmm, in what sense? class-of's in goops.c, and none of the class objects exist until it's loaded. And without that, I suspect you'd need to write your own equivalent dispatcher on pair?, integer?, char? ... that returns whatever kind of token you want. I (at least) don't know of anything similar outside goops. justin_smith: rlb: I'm writing a bare bones multimethod / generic dispatch function, I want dispatch to be able to look at the type of a value, and the entire reason for doing this is to avoid the overhead of loading and using goops rlb: On a somewhat related note, if it's not already true, it'd be nice if we had well specified way to get a goops class that can be used for specializations for record types, etc. justin_smith: I can use the goops class-of if it doesn't require the other expensive redefinitions and overhead goops adds rlb: i.e. other than (define (class-of (make-foo-instance))) rlb: or maybe that's the recommended approach... rlb: I'd have to think about it -- goops.scm expects to load that extension with (oop goops) as the current-module. justin_smith: does the goops extension of primitives apply only to modules that import goops? if so I could compromise by making a wrapper module that re-exports class-of but not the rest of goops justin_smith: but I really don't want to replace primitive stuff with the goops version throughout my vm rlb: So even if it were safe for you to do it yourself just to get that function, you might break goops if you weren't careful. I would say that maybe you'd be better off to just duplicate what class-of is doing, for your own purposes, but then you'd have to track updates/changes, which might or might not be reasonable. justin_smith: rlb: aha - so fork class-of, OK justin_smith: that's sad, but at least it's a path forward rlb: Is it the loading overhead that's too high I assume? rlb: And/or could we improve that? justin_smith: rlb: I had hoped that somewhere in the compiler / C code there was a hash map that knew about tag to type mappings, but I don't know guile's implementation well enough to know if such a thing would even be coherent justin_smith: rlb: the loading part is minor, it is more that goops is replacing certain primitives with generics - or at least I thought I read it was doing that, I'd be happy to be proved wrong mwette: rlb: got it : will look into msync() rlb: e.g. if it turned out to be sensible, then maybe another option might be to move a smaller subset to (oop goops base) or something, including, at least, class-of, but don't know offhand, if that really *is* sensible, or if it's feasible wrt goops initialization. justin_smith: I guess I'm used to typed vms where it wouldn't even make sense to have values without type tags, but hey a scheme vm could do other things in theory now that I think about it rlb: mwette: not getting your msyncs right can cause really unpleasant bugs across platforms :) justin_smith: rlb: in fact, for my usage, I could just use the type tag as a raw numeric value, as long as it maps cleanly to instances, if a type tag existed rlb: (and you can't mix read/write and mmap ops portably without a good bit of care, if at all -- I forget whether we determined that you really have to close/reopen/seek when interleaving domains, or whether an msync/flush was sufficient) rlb: justin_smith: guile plays some fairly clever tricks with tagged pointers, so there's no single unified "type tag". rlb: In exchange, fixnums are "free" as compared to say python, etc. justin_smith: perhaps what I want is a dispatch with the various basic predicates (string? boolean? etc.) and finally get the record-type because non-primitives should be some sort of recrd... mwette: rlb: thanks ; If I read you, open flags and mmap prot have to be consistent (e.g., O_RDONLY w/ PROT_READ) justin_smith: but I'll read the class-of code, that's a start rlb: Id' suggest looking at the implementation of class-of in goops.c if you haven't already, might help clarify some bits. rlb: mwette: I think it may be worse than that. rlb: :/ rlb: But I forget what we encountered last time I was fighting with that across platforms. mwette: civodul: I'm currently stuffing the mmap procedures into filesys.c. WDYT? rlb: If I manage to find the info, I'll send it to you, but I'd suggest keeping with guile's general agnosticism there, if possible, and just "wrap posix(ish)" at your lowest level, so it's possible for people to help themselves. rlb: i.e. so I can just call (foo fd FLAGS), etc. rlb: and deal with the errno's myself, etc. rlb: (But of course completely fine to have a higher level if there's a friendlier abstraction that makes sense most of the time (and we can determine is "sufficiently portable" wrt actual semantics.)) rlb: justin_smith: I'm not positive, but I think that goops might not affect much in modules that don't import it, and many of its affects are on a per-function/method basis. rlb: i.e. iirc, the primitive manipulation may mostly be "on demand", i.e. if you (define-method something-that's-currently-primitive ...) it gets promoted, but only in the current namespace. rlb: You should be able to see that fairly easily. justin_smith: rlb: yeah - I'll do some profiling, my current guess is that a module that imports goops for class-of and then re-exports should be safe perf wise (and it might even be safe to import only class-of from goops in each ns as well) rlb: Try it, and then (write some-thing) from two modules, one where you made the specialization, and one where you didn't, I don't think the other module will be affected. rlb: In which case, if you can get the init overhead of (use-modules ((oop goops) #:select (class-of)) to be low enough, which could benefit everyone if there are interesting improvements there, then you might be a lot happier relying on guile to maintain that function for you. rlb: fwiw, that's what I've been doing in some bits I've worked on, i.e. just use class-of. rlb: "just using" rlb: Oh, right wrt your comments above, #:selecting individual symbols from goops should be just fine. justin_smith: cool - that would be the sane implementation, but I'm more than twice bitten expecting sanity in the past, even with lisps haha justin_smith: thanks for the suggestions and insight, it's appreciated rlb: Might also be preferable to use class-of for now, even if you might end up needing to do something different later. rlb: Certainly. rlb: (if you have other bits to wrestle first :) ) mwette: right: I've working on implementing mmap w/ raw interface and in addition a simple "mmap-file". That latter could have a windows variant (i.e., MapViewOfFile). I have (provided? 'mmap-api) => #t; maybe (provided? 'mmap-file) is needed also. rlb: nice civodul: mwette: filesys.c sounds like a good place mwette: civodul: thx civodul: dustyweb: hey, just stumbled upon this: https://tutorial.ponylang.io/reference-capabilities.html civodul: looks like there's a renaissance of capabilities, no? civodul: pretty cool dsmith: Hey pkill9: is there a simple GUI library for Guile to make forms? dsmith: sneek: guile-software? sneek: From what I understand, guile-software is at http://sph.mn/foreign/guile-software.html dsmith: pkill9: Take a look there ^^ pkill9: thanks mwelt: hi all! Short question, what's the difference between backticks and normal ' for quoting? e.g. `(1 2 3) vs. '(1 2 3)? rlb: mwelt: perhaps https://courses.cs.washington.edu/courses/cse341/04wi/lectures/14-scheme-quote.html ? rlb: ...or https://docs.racket-lang.org/reference/quasiquote.html With the observation that ,x is equivalent to (unquote x) and ,@x is equivalen to (unquote-splicing x). mwelt: rlb: thx a lot! rlb: certainly dsmith: Though in Guile '(a b c) is not really the same as (list 'a 'b 'c) . dsmith: scheme@(guile-user)> (eq? '(a b c) '(a b c)) dsmith: $1 = #t dsmith: scheme@(guile-user)> (eq? (list 'a 'b 'c) (list 'a 'b 'c)) dsmith: $2 = #f dsmith: For example chrislck: (define lst '(a b c)) makes lst immutable I think? dsmith: That's it dsmith: A constant expression. chrislck: Tripped me up badly at that time. dsmith: I only mention it because that second link rlb posted has things like: '(+ 3 4) ; => (list '+ '3 '4) (a list) pkill9: i don't suppose anyone knows of guile code that takes a list of strings, and uses them to produce a basic form using guile-ncurses that simply takes input for each of them? dsmith: SO the list of strings is a prompt/label for each input field? dsmith: (no I don't know any code for that, to address your question) pkill9: yea pkill9: guess i'll have to create it myself pkill9: probably not too difficult really pkill9: just a bunch of reading pkill9: lol dsmith: pkill9: At least the docs look useful and well written. stis: hey guilers! civodul: hello! erkin: Hello! dsmith-work: {appropriate time} Greetings, Guilers simendsjo: I'm having some problems with my guix/guile setup. Adding guile libraries using guix (guix install or guix environment) doesn't update %load-path, so nothing is available. Am I missing something in my setup, or is this inteded behavior? Should I manipulate %load-path manually? chrislck: (add-to-load-path "...") is better simendsjo: Seems like I have to use (set! %load-compiled-path (cons the-lib %load-compiled-path)) for every library and their dependencies. I bet there's a simpler way :) civodul: simendsjo: when guile and guile-foo are in the same profile, the env vars are properly set in ~/.guix-profile/etc/profile civodul: you can also run "guix package --search-paths" roptat: mh... I'm trying to do something like this: (define* (f a b #:key (c #f) #:rest d) (for-each (match-lambda ...) d)), but when I try to pass #:c, it is actually passed as part of d roptat: I thought, since I pass a keyword, guile would be able to understand it's #:c, and not part of the rest roptat: (f "a" "b" #:c #t) -> no matchin pattern #:c simendsjo: civodul: Ah. I need to source ~/.guix-profile/etc/profile to get the paths available. Is this a common thing? Should I add this to my bash profile? Or just run it when needed..? roptat: so... how can I do that? roptat: ah it's actually properly set, but the rest argument contains the keyword, I see it in the manual now civodul: simendsjo: yeah civodul: but basically, upon completion "guix install" prints a reminder if you need to do it civodul: https://guix.gnu.org/manual/en/html_node/Invoking-guix-package.html mwette: I'm hacking in libguile, adding a function and I can't figure out error with SCM_DEFINE, posted here: https://paste.debian.net/1154806/ Any ideas? rlb: mwette: Is there more error info after that? mwette: rlb: nope rlb: weird - it sounds like it's winding up to tell you something... mwette: wait a second. I missed something before: warning: no previous prototype for 'scm_mmap_search' [-Wmissing-prototypes] mwette: ^ which is the real error message mwette: winding down :) rlb: Heh. rlb: I don't see that here, but perhaps it's differing compilers or compiler defaults. rlb: (or project or pkg-config insinuated options) mwette: I added that function in filesys.c: working on adding mmap API to guile. *: rlb is in favor of mmap support dsmith-work: Yey mmap dsmith-work: Hmm. Doens't guile already mmap elf .go files? simendsjo: I'm trying the coop server, but I'm unable to set breakpoints. It says "Trap 0: Breakpoint at ...". `,traps` shows the breakpoint. `,enable 0` says it's already enabled. But It doesn't actually break. What am I doing wrong? civodul: dsmith-work: yes it does dsmith-work: Ah, but a mmap interface isn't directly exposed to Scheme code. dsmith-work: Looks like it's buried in static C functions. mwette: Current thinking is to implement mmap/search, mmap (which is not searched for garbage) and mmap-file. Submit as proposed wip-mmap-api branch and ask for feedback to clean up the api. mwette: I'm adding option to configure: --enable-mmap-api mwette: di mwette: I left declarations out of filesys.h, assuming those need to be added by hand. mwette: echo "hello, world" > hello mwette: meta/guile -c '(use-modules (rnrs bytevectors)) (display (utf8->string (mmap-file "hello")))' => "hello, world" dsmith-work: mwette: Nice dsmith-work: mwette: What about gc? How is that handled? mwette: finalizer on the returned bytevector calls munmap civodul: mwette: i haven't looked in detail yet but that sounds nice! mwette: This one will need a code review, I believe. R1ck77: Hi! Am I supposed to free the memory returned from scm_to_utf8_stringn somewhere? And if yes, how? sneek: Welcome back R1ck77, you have 3 messages! sneek: R1ck77, dsmith says: The channel is often slow. Just wait a day or two... sneek: R1ck77, dsmith says: https://www.gnu.org/software/guile/manual/html_node/Conversion-to_002ffrom-C.html sneek: R1ck77, dsmith says: Use free() justin_smith: what a good bot R1ck77: I was just about to write that :) R1ck77: ok, I just received a delayed message, dsmith thank you for the answer and for the explanation! :) R1ck77: I must say I'm impressed from this sneek thing... dsmith-work: sneek: botsnack sneek: :) *: sneek wags R1ck77: LOL R1ck77: I admit I'm not used to async IRC communication :) R1ck77: since there seem to be a few people around: does anybody know if I can embed guile in Android (license wise: I would take care of the technical details...) R1ck77: ? dsmith-work: R1ck77: Like I said, the channel *is* often slow. People in diffferent timezones, etc. dsmith-work: R1ck77: Can you compile C apps for Android? *: dsmith-work has no clue justin_smith: yes, there's a C compiler for android dsmith-work: Well, it's probably possible then. justin_smith: I think the real question was about the licensing - eg. can you do it without open sourcing your own app dsmith-work: There *are* Schemes that run on the JVM. Would those be a better fit on Android? justin_smith: the repo says LGPL http://git.savannah.gnu.org/cgit/guile.git/tree/LICENSE justin_smith: LGPL describes the terms, particularly under clause 4 https://www.gnu.org/licenses/lgpl-3.0.en.html "combinded works" R1ck77: also, being kicked out becaues your wifi module acts out doesn't help... justin_smith: R1ck77: guile is available under LGPL http://git.savannah.gnu.org/cgit/guile.git/tree/LICENSE - you can see the terms here, see in particular section 4, "combined works" https://www.gnu.org/licenses/lgpl-3.0.en.html justin_smith: double check versions and interpretation etc, I'm not a lawyer R1ck77: thank you justin_smith, also thank you dsmith (I catched up on your answers on the channel logs) R1ck77: I was actually thinking about open sourcing the app anyway, but I thought there were some obvious catches with Android not being probably 100% open source that people here were privy of R1ck77: I was on a mind to do my homework with the licenses, but I thought: justin_smith: R1ck77: as long as your code is open source, you should be fine - anyone who considers android insufficiently open can port your impl to a platform they find acceptable I guess R1ck77: if I ask on the channel "can I do Android app in Android" and a booming voice answers from the sky "thou shalt be dammned!", that would be a time saver justin_smith: GPL for windows apps definitely exists, for starters R1ck77: very nice, that's a good start indeed R1ck77: I think the feasibility is worth investigating, then! R1ck77: (I'm thinking about an OpenGL app on android using Scheme for glue, so performances are not a minor detail) R1ck77: also dsmith, as far as other scheme/lisp interpreters on JVM are concerned, I only know kawa and Clojure. I already experimented with clojure and while I love the language and I got something working on my app, it's very brittle justin_smith: clojure on android needs a patch to the mainline clojure, and is very out of date justin_smith: also, clojure's design assumes that memory is free, which isn't nearly as true on mobile R1ck77: not really: I know about the patch and some newish version work as well without it justin_smith: R1ck77: last I checked the version of clojure that was compiled to android was stuck at 1.6 R1ck77: memory wise, I didn't try anything really intensive so it may be a problem, but permances looked decent so far, even when using OpenGL R1ck77: you don't need the patch with 1.8 R1ck77: and you'll be back in troubles with 1.9 I think (again due to class compiler issues :( ) R1ck77: which is the main reason why I'm trying to bypass Clojure and use Guile (or another C scheme with glue capabilities) justin_smith: R1ck77: oh, I didn't realise newer versions worked - we are up to 1.10, 1.11 coming soon justin_smith: R1ck77: last I tried it, clojure on arm took about a minute to get to the point of running a program justin_smith: it uses a lot of short-lived objects and I don't think that performs as well on the arm vm R1ck77: with 1.8 on an old device it took many seconds, but I hid the problem by loading in a separate thread and showing a splash R1ck77: on newer devices is almost instant justin_smith: R1ck77: that's cool to know R1ck77: well, it sucks that the compatibility is so brittle, however ;( R1ck77: with 1.9 - 1.10 due to class compilation issues my app didn't work on some devices apparently. I forgot the details, but the point is, just by starting, Clojure tries to dynamically compile stuff on android and BOOM R1ck77: this didn't happened with 1.8 though: I didn't get any crash on the store at least justin_smith: right, there's no way to run clojure without the compiler R1ck77: as for performances, they where surprisingly ok :) justin_smith: cool R1ck77: justin_smith, but it worked on 1.8!!! :((( R1ck77: download VR Theater if you want to see yourself btw R1ck77: there is not the Clojure-based VR prototype, but you'll see the loading at least R1ck77: anyway, most people use Clojurescript on android for the previous compatibility reasons, but it doesn't cut it for me *: R1ck77 silently curses his wifi module R1ck77: btw, I know I R1ck77: I'm probably asking in the wrong place, but is there any other lisp/scheme C implementation that can be extended and embedded that comes to mind? justin_smith: R1ck77: lua is designed for embedding and very easy and light weight to embed, the fennel language is written in lua and compiles to reasonable lua output justin_smith: it's pretty close to self-hosting too (in very active development) R1ck77: well, I know lua (I used to love it btw and, surprise, part of VR Theater is written in luaj :D), so it's quite interesting! justin_smith: R1ck77: feel free to ask more on #fennel if interested, the compiler devs hang out there R1ck77: thank you a lot justin_smith: I'll check the language around and then hang a bit in their channel! R1ck77: (it looks promising btw, and I know how easy it is to embed/extend lua already. Neat!) dsmith: sneek: later tell R1ck77 The channel is often slow. Just wait a day or two... sneek: Okay. dsmith: sneek: later tell R1ck77 https://www.gnu.org/software/guile/manual/html_node/Conversion-to_002ffrom-C.html sneek: Got it. dsmith: sneek: later tell R1ck77 Use free() sneek: Okay. RhodiumToad: wklew: it's easy to show that the reset is evaluated before any shift. RhodiumToad: my first guess is that the storing of the first forced result of the evaluation of the stream is itself part of the continuation at this point. RhodiumToad: similar thing happens with delay/force from srfi-45 (can't do it with builtin delay/force because force isn't rewindable) wklew: RhodiumToad: ahh that complicates things wklew: I think storing thunks in the stream will be the cleanest solution wklew: otherwise I'd have to rewrite all the streaming functions to reset each element anyway wklew: thanks for the help! RhodiumToad: shift/reset can be a bit brain-bending wklew: for sure! been spending a lot of time with oleg's papers and such wklew: I'm trying to translate his ocaml library for probabilistic programming to guile wklew: oleg kiselyov that is RhodiumToad: I know which oleg you meant :-) *: RhodiumToad also read their stuff on shift/reset when learning about it RhodiumToad: not to mention the whole business of finding a ~20-year-old bug in their code rlb: Is this expected to work? https://paste.debian.net/hidden/871c70cc/ It hangs here if I uncomment the (touch err). But it's fine if I just use open-output-file to create err. i.e. it doesn't seem to like a (pipe). RhodiumToad: a system-call trace will probably make it pretty obvious what the problem is. rlb: RhodiumToad: heh, not (yet) obvious to me, but thanks for the suggestion. wklew: RhodiumToad: now I'm curious what/where the bug was RhodiumToad: rlb's bug? I don't know, I haven't see the trace :-) wklew: no sorry, we were speaking of oleg's code RhodiumToad: oh RhodiumToad: ssax parser screws up on CDATA RhodiumToad: a misreading of the spec which results in corrupted data wklew: oh wklew: good catch :) RhodiumToad: and I don't think the xml people anticipated that anyone could misread it in that specific wrong way, so there is no test for it in the xml validation suite dsmith: sneek: botsnack sneek: :) manumanumanu: Hi folks sneek: Welcome back manumanumanu, you have 1 message! sneek: manumanumanu, wklew says: cool, that's interesting too! manumanumanu: :D manumanumanu: So, does anyone know of any newer research into optimizing pattern matchers than Balland 2006? I am finally writing an optimizing extensible pattern matcher, and I think i have most of it nailed down. manumanumanu: (Balland et al. of course) manumanumanu: I believe I can leave out a lot of the work their pattern matching optimizer does, since guile already does constant propagation, inlining and let fusion... I suspect it will be a _lot_ more simple to do in guile than in SML manumanumanu: hmmm. the problem when writing a pattern matcher is that you want a pattern matcher leoprikler: Instant pattern matcher, just call another pattern matcher ;) leoprikler: Balland et al. refers to "Optimizing pattern matching compilation by program transformation", right? mwette: I'm adding an option to Guile's configure.ac, how do I get an associated variable defined in config.h.in? leoprikler: mwette: AC_DEFINE? mwette: leoprikler: Thanks. Found it I think. mwette: Yes, it's working now. Thanks. manumanumanu: leoprikler: yes! I am not in academia or anything, but to me it seems like the latest and greatest in pattern matching compilation. leoprikler: Well, to be fair, it's not cited by a great number of other papers, so there have probably been little improvements since. manumanumanu: I actually found that the common lisp pattern matcher trivia uses it, and that produces excellent output. I haven't been able to make it produce worse-than-hand-tuned for most of my cases. For simple cases like ((a b 2 d e) ...) (a b 3 d e) ...) the code is a lot better than what (ice-9 match) produces. With all the work the guile optimizer does, I doubt we can actually do much better than the suggested manumanumanu: Balland, since we can just leave all the really hard parts to guile manumanumanu: On a similar note, does anyone know of any predicate-based generic method library that plays well with modules? (i.e: a method defined in module a should not be visible in module b unless it is explicitly imported) manumanumanu: It removes the possibility to specialize types, but I suspect it could be a lot simpler (and faster?) than, say, goops if all you want is simple generics that play well with regular records justin_smith: manumanumanu: I briefly played with the idea of using a lambda closing over a hash table, accepting "message" based dispatch, eg. a message #:extend to add a dispatch target, a message #:invoke to send a dispatchable value to a target, etc. justin_smith: I should take another go at that justin_smith: also explicitly lacking the ability to magically wrap any external or built in function or do meta level mainpulations justin_smith: that plus afew macros should go pretty far justin_smith: but I doubt it's a unique idea and hope somebody else made it and I can just use their lib manumanumanu: justin_smith: well, did that work well with the module system? Otherwise, I would probably just use chibi's implementation. That is elegant enough. justin_smith: manumanumanu: I only played with it briefly and don't have a version I'm happy with yet - I'll look at chibi's version justin_smith: manumanumanu: the difference between my approach and chibi's is that chibi does linear lookup which allows "next method" / arbitrary predicates, and mine was a single dispatch function with a hash - speed vs. inheritance justin_smith: mine would respect modules, as it generates a function belonging to a single module, just because you extend it doesn't mean it belongs to you manumanumanu: But if you have a method named banana in module a, extend it in module b, then import module a in module c, which banana is visible in module a? justin_smith: the method is a lambda belonging to the module that defines it, you can make a special call to add a dispatch key and function for that key, but that doesn't affect its visibility or ownership justin_smith: the reason it isn't done is not being satisfied with the conventions for calling it, which I want to have first before writing code that relies on it justin_smith: but I expect the final code to be smaller than the amount I've written about it in this channel so far, I am aiming quite low manumanumanu: I don't understand, but please ping me if you ever finish it :D justin_smith: manumanumanu: sure thing! rilez: is there a standard way to expose delimited continuations in other languages that run on the guile vm? sneek: Welcome back rilez, you have 1 message! sneek: rilez, mwette says: I use texinfo comments above defines, see https://paste.debian.net/1149728/. To generate the docstring I use my draft scheme-texidoc mode for emacs. tinga: Hi. (use-modules (ice-9 debugging trace)) is giving us "no code for module (ice-9 debugging trace)", what's up? rilez: i think there's a way to get the search path/locate the file containing a module rilez: I think it's page 413 of the printed manual, section 6.18.7 rilez: i'll check where the info about finding modules is too rilez: i recently had an issue where some of the standard libraries didn't install completely, and re-installing fixed it for some reason tinga: Thanks, will check later dsmith: tinga: There is a (system vm trace) dsmith: tinga: Those old debugging interfaces went away with guile 2.0 See the NEWS file. wklew: do streams have to occur in tail position to work properly? sneek: wklew, you have 1 message! sneek: wklew, manumanumanu says: you can use srfi-171 as well, which is also useful for stream processing, but with eager semantics. It does a kind of stream fusion of map/filter etc. For a (list-transduce (tmap 1+) rcons (list 1 2 3 4 5)) it is slightly slower than regular map, but already at (compose (tfilter odd?) (tmap 1+)) it is faster, at least in guile3. wklew: sneek, later tell manumanumanu: cool, that's interesting too! sneek: Okay. wklew: mixing streams and shift/reset is giving me trouble, and I thought non-tail calls might be the issue wklew: I'll paste some code tomorrow zzzz simendsjo: I recently completed a project in an ML-language which has been very successful much thanks to immutability. The API to update is pretty much a function `(Event -> State) -> State` (internally using a very small DSL for updating the state), and the state itself uses immutable lists, immutable dictionaries and immutable records. Are such datastructures and convenient syntaxes available for Guile or some other implementation? d4ryus: simendsjo: Guile has some immutable data structures: VLists, VHashes and immutable records come to mind. bonz060: simendsjo: perhaps vlists? https://www.gnu.org/software/guile/manual/html_node/VLists.html bonz060: simendsjo: Also iirc, guix uses a bunch of immutable data structures, and they have some store monad to deal with side fx simendsjo: Thanks. So immutable records are `define-immutable-record-type`? Does it support a syntax for updating them? Something like `(with ((some-field 1)) some-immutable-structure)` for returning a copy of some-immutable-structure with some-field set as 1 in the new copy? simendsjo: bonz060: Do you know which on the top your head? I see `set` implemented on top of `vhash`. rgherdt: simendsjo: sure, take a look at set-field/set-fields in the srfi-9 info page simendsjo: rgherdt: Thanks, that's exactly what I was looking for. mwette: Guile also has intsets in (language cps intset). intsets are immutable integer-keyed hashes that use transients, a concept from racket. dsmith-work: Hey Hi Howdy, Guilers civodul: hey ho! mwette: Hi! wklew: Ok I've clarified my problem. If I have a stream which contains an unevaluated `shift` in its stream-car, is there a way to wrap it in a `reset` while forcing it? wklew: (reset (stream-car strm)) doesn't work afaik because by the time it gets to `reset` it's been forced wklew: the alternative is to store a thunk in the stream, so the thunk is returned by `stream-car`, but that seems... excessive? wklew: what I would really like to do is stream-map over a stream whose expressions may contain a call to shift, enclosing each in a reset prompt as it is forced RhodiumToad: so wouldn't it make sense to put the reset around a call to a procedure that does the stream-car call? RhodiumToad: hm, no RhodiumToad: maybe I'm missing why it wouldn't work as-is? RhodiumToad: reset is syntax, not a procedure, so it should establish the prompt before calling stream-car dsmith-work: Hmm. This is odd. Using buildroot to cross-compile guile for aarch64, the host-guile compile fails at guile-procedures.texi. But just a normal pull from master (apart from buildroot) works fine. dsmith-work: This was working about guile 3.0.2 IIRC. Curious. dsmith-work: Maybe there is still some funny with bootstrap .go files? dsmith-work: Hmm. A (full) make clean might have fixed it. dsmith-work: Looking good so far dsmith-work: Works dsmith-work: # uname -a dsmith-work: Linux maaxboard 4.14.78 #1 SMP PREEMPT Tue Jun 30 16:32:30 EDT 2020 aarch64 GNU/Linux dsmith-work: # guile dsmith-work: GNU Guile 3.0.4 R1ck77: Hi! what am I supposed to do with strings returned by scm_to_utf8_stringn after use? R1ck77: (free, scm_something_free, don't touch them, something else...) R1ck77: I admit i'm a bit surprised, I thought this was a Guile 101 question... is people using Guile to do C libraries interfaces around here? Just curious... R1ck77: (the alternative being that it's used as a plain Scheme implementation, nothing bad about it!) R1ck77: ok. It probably is a 101 Guile question, I'm just alone :D R1ck77: Thank you anyway! :) wklew: (define s (stream (shift k (k (k 0))))) wklew: (reset (1+ (stream-car s))) wklew: => 1 wklew: I'm expecting 2 wklew: the shift is apparently evaluated before the prompt is in place rlb: I might be handling this wrong, but I tried using a (pipe) with (with-error-to-port ... (open-pipe* ...)), and attempts to read from the err pipe (from a separate thread using get-bytevector-all block forever), even after a close-pipe on the subprocess. rlb: The command itself doesn't need stdin, so it should finish "immediately" anyway. It seems like maybe the err-pipe isn't actually being closed by the subprocess (assuming it's even connected as I intended). rlb: e.g. this hangs on (touch err): https://paste.debian.net/hidden/9265e30e/ SpaceIgor2075: Hello, I'm a newbie. Can I use Guile as a standalone interpreter for learning Scheme? chrislck: SpaceIgor2075: of course lloda: what would be needed to have filesystem completion in (load "...") or (load-from-path "...") lloda: wonder if anyone has given this a thought chrislck: Dear all: we know scheme doesn't quite error out if a var is undefined. (define (my-func) (if #t 'answer never-used)) will never error out. chrislck: Is it possible to do some static analysis before run-time to detect these 'never-used' objects? chrislck: ^ ahh these are 'possibly unbound variable' warnings chrislck: ^^ does anyone know how to highlight/detect these unbound vars? What IDE is best? chrislck: On a whim I tried slib. sudo apt install slib --> installs version 3b1-5. "SLIB does not support Guile-2.2 yet. Ignoring." O_o. chrislck: why not remove SLIB from manual? dsmith: This has happened before. Guile chanages, slib is broken for a while, evenutally slib syncs. wklew: you're right, i had it backwards. what I'm thinking of is something like the dual of append-map wklew: where each element is itself a stream that gets folded down to a single value narispo: this would be best for accelerating GNU Guile with FPGAs: https://en.wikipedia.org/wiki/Reconfigurable_computing#Partial_re-configuration narispo: if the FPGA can do DMA it's perfect chrislck: Dear All. I know we can access an unexported var in a module via (@@ (module name) private-var) as long as private-var is toplevel in (module name). chrislck: Is there any access to private-var if it is in a function? chrislck: (define (make-counter) (let ((counter 0)) (lambda args ... etc))) chrislck: ^ can we possibly access counter from outside? chrislck: ^^ the purpose is unit-testing... chrislck: ^^^ to unit test large functions I am currently refactoring into toplevel small functions. wondering if there is a less drastic way. daviid: chrislck: i would define a getter, like the guile manual withdrawal example daviid: then you can use th gettr to test ... daviid: the value of counter chrislck: daviid: agree but the use case is (define (big-function ...) (define (helper-fn ...) ...) ...) and I want to unit-test helper-fn chrislck: helper-fn is also a big ugly fn daviid: chrislck: i don't think you can access th counter 'from outside', so to spak chrislck: ok daviid: but for testing purposes, you could/may set an external var to the val of the local ... using sort of 'if debug? set %e-counter counter), then access %e-counter daviid: all this is tricky daviid: accessing locals would break fundamental rules of hygiene ... as you prob know chrislck: yeah. I want my functions to not know they're being tested ;) daviid: i would define getters, even if only to debug daviid: the big function could do that daviid: i mean literally follow the withdrawal example is the only sane approach i see daviid: otherwis i se the testing code being so error prone that it would be mpossible to trust the tests :):) apteryx: rekado_: thanks for tipping in bug#41956. I've replied now. manumanumanu: sneek: later tell wklew you can use srfi-171 as well, which is also useful for stream processing, but with eager semantics. It does a kind of stream fusion of map/filter etc. For a (list-transduce (tmap 1+) rcons (list 1 2 3 4 5)) it is slightly slower than regular map, but already at (compose (tfilter odd?) (tmap 1+)) it is faster, at least in guile3. sneek: Got it. rlb: Is with-error-to-port an appropriate way to intercept stderr from open-pipe*? I ask because it doesn't seem to work for me (though of course I might well be doing it wrong). I'm using a bytevector-output-port. It doesn't complain, but I wondered if that was supported yet, i.e. I want the bytes. civodul: hi rlb! civodul: rlb: it only works if current-error-port points to a file port civodul: see scm_piped_process in libguile/posix.c rlb: So we can't capture stdout and stderr right now? rlb: (without a physical file?) rlb: Also, I wonder if for now it should throw an exception or something if current-error-port is incompatible so you know you're "doing it wrong"... weinholt: rlb, it should be possible to use (pipe) and hook up the subprocess' stderr to the write side weinholt: rlb, if the subprocess writes to both stderr and stdout then a careful program should not block on reading from one of them rlb: weinholt: you mean if you were to just not use open-pipe* and do handle it all yourself? weinholt: rlb, i'm suggesting you can use (pipe) instead of what you're doing now with a bytevector-output-port weinholt: rlb, here's another way: https://github.com/rotty/spells/blob/master/spells/process/compat.guile.sls rlb: Sure, that's what I meant wrt "not use open-pipe*". rlb: civodul: seems like it might be nice to support something like that with open-pipe* (or some derivative, built in to guile). rlb: Fwiw, clojure has a much more restricted convenience function (though it does provide access to :err): https://clojuredocs.org/clojure.java.shell/sh Much like python's subproc.communicate(), it side steps deadlock/streaming concerns, but isn't very flexible. civodul: rlb: correct, we can't capture both without going through a file (which is annoying) civodul: or a pipe rlb: Wait, will it let me use a pipe there? If so I misunderstood, I thought it required a *file* port. In any case, I can just use a temp file for now if I have to. civodul: a pipe is a "file port" :-) civodul: file ports are ports backed by a file descriptor civodul: sockets are also "file ports" rlb: oh, then I *definitely* misunderstood weinholt :) rlb: OK, well that's fine then. I'm already having to use some future shovel(s). rlb: (to avoid deadlock) rlb: civodul, weinholt: thanks much. weinholt: :) dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen rlb? sneek: rlb was last seen in #guile 36 minutes and 23 seconds ago, saying: civodul, weinholt: thanks much.. dsmith: (had a few minute power outage a little bit ago) mwette: o/ wklew: is there a Guile library like haskell's "foldl"? https://hackage.haskell.org/package/foldl wklew: I'm looking to do stream processing with "fusion", i.e. composing filter, map, take etc in constant memory wklew: SRFI-41 doesn't mention whether it supports this wklew: for example, take the first 10 elements of a possibly infinite stream and perform a left fold on them, in a single pass rgherdt: isn't this what SRFI-41's stream-fold does? wklew: well the goal is to build a complex fold from composable, simple folds wklew: that's what the foldl haskell library does wklew: e.g. `(fold-left + 0 (take 10 ...))` wklew: we would rather not accumulate those 10 values in memory and then pass them to fold-left, rather it would all be done in one pass *: wklew actually reads the SRFI docs... rgherdt: SRFI-41 states "if the intermediate result is stored as a stream, it can be generated piecemeal, using only as much memory as required by a single item." rgherdt: so as I understand it should do what you want rgherdt: your example: (stream-fold + 0 (stream-take 10 (stream-range 0 100))) wklew: excellent! that's exactly what I was hoping wklew: now I'm trying to wrap my head around representing a lazy tree as a stream leoprikler: assuming you want all items eventually, you can do a stream-lambda implementing a BFS leoprikler: (or DFS if you prefer) leoprikler: otherwise it might be simpler to use delay/force directly, but I don't think they compose well with stream-* wklew: stream-let would be the closest to what I have now, where I build a tree using a named let wklew: so that's cool wklew: I'm actually doing a sort of append-map, where the value of each element is computed from its children wklew: interestingly there is no stream-append-map in SRFI-41 leoprikler: a stream is basically a list, that may be infinite leoprikler: so append-map does not really make sense leoprikler: append-map only makes sense if its arguments are finite as otherwise there's nothing to concatenate mwette: mrkotfw: I ran into a dynamic-link issue like that (on Fedora?). The problem is the way libtool works. I think it is fixed in 3.0.2. Ref is https://bugs.gnu.org/21076. mwette: sneek: later tell mrkotfw to check https://bugs.gnu.org/21076 sneek: Okay. daviid: I pushed a series of patches to g-golf, related to a 'protect' syntax name to be used as generic function names 'mechanism', with three user (re)definable/customizable variables to alter the defaults with that respect. I also documented this as well as I could... those interested, please pull, make, read the doc and try ... daviid: leoprikler: I have taken your suggestion into consideration, so you may prefix those (syntax names to be protected) using '@ if you wish, and set the postfix to #f ... and for those who wish an even more sophisticated and 'personal' way of protecting syntax names, they may define a renamer leoprikler: Hmm, could the Guix recipe be outdated w.r.t. packages? leoprikler: I'm trying to build inside "guix environment g-golf", but that results in: dynamic-link: file: "libgirepository-1.0", message: "file not found" roelj: Can I get the return value of a command when run using ‘open-input-pipe’? roelj: Ah nevermind, that's done using close-pipe. leoprikler: daviid`: syntax-name->method-name is missing the case for begin != #f, but suffix = #f leoprikler: Either require both to be symbols always or do (or [prefix|postfix] '#{}#) daviid: leoprikler: tx, I pushed a fix roelj: I'm running a Guile program in a container (made with Guix), and it cannot seem to resolve addresses, backtracing with: (getaddrinfo "some.address" "https" 0 # # ?). roelj: What does Guile need to resolve addresses? leoprikler: I'm not sure whether Guix containers are allowed to use networking roelj: leoprikler: Well, curl works fine :) leoprikler: So, you do both -C -N and getaddrinfo fails? roelj: Perhaps I omitted the most important error message poart: In procedure getaddrinfo: Servname not supported for ai_socktype roelj: leoprikler: I make a "pack" with guix pack, and imported that in Docker, and then run it in Docker.. :/ leoprikler: okay, (getaddrinfo "gnu.org" "https") works from environment -C -N roelj: I don't know how this works, but should "https" be translated to a port number? leoprikler: well, it expects a string, so no roelj: hehe leoprikler: name service hint_flags hint_family hint_socktype hint_protocol leoprikler: not sure how docker handles this tho leoprikler: I'm pretty certain you can get getaddrinfo to work as intended in `guix pack` tarballs roelj: Hm, so I reduced it to the following: scheme@(guile-user)> (http-get "http://gnu.org") => In procedure getaddrinfo: Servname not supported for ai_socktype roelj: And the same error for (getaddrinfo "gnu.org" "https") leoprikler: Well, I get gnutls-not-available :) roelj: haha :) leoprikler: and some certificate error if I add it leoprikler: Have you tried using guix pack tarballs? leoprikler: I believe, this might be a docker-specific issue roelj: Ha! https://stackoverflow.com/questions/56430294/bash-script-that-uses-whois-command-gets-servname-not-supported-error-on-do this solution adds "ntp". roelj: Let's see if that works roelj: leoprikler: It being a docker-specific issue was a very helpful suggestion :) roelj: Just running "ntpd" doesn't have any effect. roelj: strace it is weinholt: roelj, symbolic service names like "https" are defined in /etc/services, you might be missing that file roelj: weinholt: Yeah, I found that in the strace output as well, so I'm trying by including the "net-base" package in the container. roelj: That was it -- missing /etc/services. Thanks weinholt and leoprikler! mwette: o/ ArneBab: ecraven just updated the r7rs benchmarks with data for Guile 3.0.4! https://ecraven.github.io/r7rs-benchmarks/ ArneBab: Guile 3.0.4 is seriously closing in on racket, and in the gcbench even on gerbil und chez! ArneBab: wingo: ^ I thought the results might interest you :-) civodul: nice! ArneBab: I also did a check of the standard deviation of the data (using 4 runs provided by ecraven), and the ranking looks mostly robust. From what I saw I would expect the rank to change by at most 1 between different runs. ArneBab: In many tests Guile 3 already bridged the gap between the slower and the seriously fast schemes and is typically less than factor 2 slower than racket — and in some cases faster. ArneBab: I also just compared the Guile results to the fastest implementation for each test: using the raw CSV data, the geometric mean slowdown compared to the respective fastest implementation went down from 16x slower to 6x slower. ArneBab: well, 7x ArneBab: (rounded correctly) civodul: neat civodul: did you try comparing 2.2 and 3.0? civodul: i mean the figures are there, just not easy to look at ArneBab: yes ArneBab: 3.0 is faster on every test than 2.2 ArneBab: and the geometric mean shows that 3.0 is twice as fast as 2.2 when you compare against the limits that can be reached on any test. ArneBab: the slowdown above (7x): For racket it’s 5x and for chez it’s 2.6x. ArneBab: So Guile is now only 40% slower than Racket (factor 1.4); getting closer to the goal of catching up on racket. ArneBab: Chez shows how much is possible … dsmith-work: Happy Friday, Guilers!! civodul: yay, Happy Friday! ArneBab: Happy Friday dsmith-work! civodul: ArneBab: yeah, interesting civodul: i have the uneducated intuition that there are low-hanging fruits in our run-time civodul: for "real" applications civodul: we should investigate the benchmarks where Guile doesn't perform so well to see what the reason is civodul: code quality or something else ArneBab: that sounds like a good idea, yes. ArneBab: There are two main pain points: ctak (doesn’t actually complete on time) and equal (fails on circular datastructures) ArneBab: the biggest slowdown is on fibc (103), ack (30), and string(29) ArneBab: then there are some between 13 and 6, worst first: cat wc browse tail deriv cpstak mbrot graph read1 sumfp puzzsle pnpoly ArneBab: (I ignore two outliers where the fastest scheme is ridiculously fast (0.1 or 0.) ArneBab: ) ArneBab: sources of the wirst three: ArneBab: https://github.com/ecraven/r7rs-benchmarks/blob/master/src/fibc.scm ArneBab: https://github.com/ecraven/r7rs-benchmarks/blob/master/src/ack.scm ArneBab: https://github.com/ecraven/r7rs-benchmarks/blob/master/src/string.scm ArneBab: s/wirst/worst/ civodul: fibc is call/cc, doesn't matter IMO civodul: ack shouldn't be slow ArneBab: I now checked the data on the page for ack again: it’s because cyclone is crazy fast on this. Guile 3 is as fast as racket and factor 2 slower than chez. ArneBab: so, ack is also an outlier ArneBab: thank you for checking! ArneBab: so from the worst three, only string is a serious worry. ArneBab: it’s string-length, string-append and substring. ArneBab: Just the part for which avoiding it made string-replace-substring much faster. ArneBab: so this is a real pain-point ArneBab: looks like it’s in libguile/strings.c dsmith-work: There was some recent string improvements by moving C to Schme (string-for-each I think) ArneBab: … hm, no, the fast string-replace-substring still contains substring dsmith-work: I wonder if there are other opportunities there. ArneBab: running this with ,profile, I see 94.62% of the runtime in %after-gc-thunk ArneBab: 5% are string-append ArneBab: my most plausible guess is that it’s string-append ArneBab: depending on memory pressure, time shifts between %after-gc-hunk and string-append ArneBab: I tried switching to an implementation of string-append in pure scheme, but that’s much slower. Maybe one of you knows of an efficient way to do this. I used plain string->list and then (append ...) on char lists. civodul: there's something fishy going on with %after-gc-hunk ArneBab: did you find something concrete? ArneBab: the code does lots of appending of short strings civodul: not really, i posted something to guile-user, but no solid explanation dsmith-work: Heh. after_gc_async_thunk has a Fun comment dsmith-work: (calls scm_c_hook_run AND scm_c_run_hook) civodul: yeah :-) ArneBab: do you know why? civodul: why what? civodul: for string-append in Scheme, you should mimick what the C code does, accessing the stringbufs directly civodul: (system base types) has code for that, though it's not meant to be used in this way ArneBab: why it calls both civodul: one is for hooks written in C, the other is a C function to call hooks civodul: so there are two naming conventions very similar ArneBab: ah, makes sense, but looks pretty strange :-) civodul: yeah civodul: besides, string-append benchmarks are mostly measuring GC efficiency civodul: so it could be that we lose just because libgc doesn't do as well as the others civodul: however, Bigloo also uses libgc, so it's a good point of comparison civodul: i'm not sure whether Racket still does dsmith-work: That C code for string-append doesn't look that bad. Total up the lengths, alloc the new string, memcopy the pieces (or loop for wide chars). civodul: my impression is that calling subrs is quite expensive civodul: because we have to leave and then reenter the VM civodul: though i think wingo was skeptical about this hypothesis civodul: https://lists.gnu.org/archive/html/guile-user/2020-06/msg00038.html dsmith-work: So it's not that string-append is slow, it's calling it in a Scheme loop that' dsmith-work: s slow? civodul: yes civodul: which is "expected" in a way, because there's little more than overhead when you do that civodul: + gc civodul: so dunno ArneBab: why does the gc take so much time? in the gcbench Guile does really well ArneBab: So I don’t understand why it’s so expensive here dsmith-work: Benchmarks. Who can say? ArneBab: I also got problems with using string-append for the string-replace-substring proc ArneBab: IIRC removing that gave quite some speedbump R1ck77: Hi! Has anybody tried using Guile to write native android applications? If not, is it due to some technical or legal blocking problem anybody knows about Thank you! dsmith-work: Thursday Greetings, Guilers R1ck77: Hi! Has anybody tried using Guile to write native android applications? If not, is it due to some technical or legal blocking problem anybody knows about Thank you! mwette: Can android host binaries like guile? I thought it was more java based, in which case you might look into kawa: https://www.gnu.org/software/kawa/ R1ck77: mwette, you can use C/C++ on Android, they call them "native applications". Never delve into them too much, but I thought "what the heck, C is a pain, but maybe with Guile it would be fun..." R1ck77: I was going to give it a try anyway, but I'm only concerned about license compatibility to be honest R1ck77: also, I'm a bit put down that guile doesn't seem to be much popular outside GNU projects... Wrong/though audience, but I'm wondering where is the catch... mwette: OK. Thanks. Sorry, can't help w/ your question, though. R1ck77: mwette, thank you for trying anyway! :) roelj: I was trying something fun, and seem to not understand why the following throws an error: ((symbol-append 'co 'ns) 'A '()). I hope someone can explain it to me :) roelj: I guess because it is evaluated as ('cons 'A '()). But how would I go from 'cons (the symbol) to cons (the function)? eval? dsmith-work: Ya dsmith-work: scheme@(guile-user)> cons dsmith-work: $1 = # dsmith-work: scheme@(guile-user)> (eval 'cons (interaction-environment)) dsmith-work: $2 = # dsmith-work: scheme@(guile-user)> (eq? $1 $2) dsmith-work: $3 = #t roelj: Alright, that seems easy enough to understand. So, this (interaction-environment), what does that mean? When I (use-modules (foo)), and in the module "foo" I have a function "bar" that takes one argument. Would (eval 'bar (interaction-environment)) be eq? to the function "bar" from the module "foo"? roelj: And how is that different from what primitive-eval does? leoprikler: Not really leoprikler: An alternative would be using module-ref leoprikler: then you really have just that procedure dsmith-work: roelj: eval requires an environment to look stuff up in. (interaction-environment) is what you get at the repl. roelj: Hm. I'm going to read the manual again. Thanks! :) dsmith-work: roelj: https://www.gnu.org/software/guile/manual/html_node/Fly-Evaluation.html guix-vits: sneek later tell nly hello again. sneek: Will do. roelj: Is it possible to use 'sendfile' with the port returned by (http-get ... #streaming? #t) as the input port? dsmith-work: Used sendfile to rx from a socket? dsmith-work: The manpage for the sendfile system call says: dsmith-work: "The in_fd argument must correspond to a file which supports mmap(2)-like operations (i.e., it cannot be a socket)." dsmith-work: roelj: With that in mind, I would think not. roelj: Heh, too bad.. :) Is there a other efficient way to write ~100G from a http-get request to a file? Should I just use a bytevector buffer and iterate over it? dsmith-work: Guile used to have a low-level read function. Had a very scary name with slahes and bangs in it. Don't remember the name right now. dsmith-work: roelj: I'm not sure what would be best. Might want to try a some differnet approaches. dsmith-work: roelj: That was read-string!/partial , btw roelj: dsmith-work: Ahyeah. Thanks! I'm receiving binary data, so I think I prefer bytevectors anyway. dsmith-work: That names comes from before guile had bytevectors dsmith-work: Probably *should* be a bytevector instead roelj: Hm interesting dsmith-work: Hmm. The name actually comes from scsh dsmith-work: Gory details in libguile/rw.c dsmith-work: roelj: You are probbaly better off with recv! roelj: dsmith-work: I realize I can just try it, but is ‘recv!’ more efficient than ‘get-bytevector-n!’? dsmith-work: Don't know. But it looks like it's just a thin wrapper over the recv syscall. roelj: Ah, so they are pretty much the same, but recv! is a slightly more direct route to the actual syscall. roelj: Ugh. The server responds with “Content-Type: application/x-www-form-urlencoded; charset=utf-8”. I think Guile then thinks that the body port should be a string port. Is there a way I can override that to be a binary port? dsmith-work: get-bytevector-n! Does all the port machinery, buffering, pushback, etc. revc! ignores all that and just reads from the fd. roelj: Hm, a throughput of ~20MB/s. roelj: Ah, increasing the buffer size increases the throughput. dsmith-work: Yes roelj: Right, I think I'm maxing out the server's upload, so that's good dsmith-work: THis over a local Ethernet? roelj: dsmith-work: No, over the internet. mrkotfw: Hello everyone mrkotfw: I'm attempting to build guile-SDL2 on MinGW64, and I'm getting this error: 'In procedure dynamic-link: file: "/mingw64/lib/libSDL2", message: "The specified module could not be found."' mrkotfw: Is it expecting an .a file? Or in this case, .dll? mrkotfw: https://pastebin.com/raw/5QKutJ9p mrkotfw: Okay, I think I understand... sdl2/config.scm holds paths, and the path it's using is invalid mrkotfw: Damn, looks like there's an issue with SDL2_mixer dsmith-work: mrkotfw: Not sure if this applies to mingw32, but there is a notorius problem with dynamic link. The error is always a misleading "can't be found". dsmith-work: If the init function errors out, you get that error. dsmith-work: mrkotfw: Usually, on linux, using strace reveals if the .so is actual found or not. Not sure how to do that under windows. dsmith-work: THere is some kind of tracing tool, but I can't remember the name of it. mrkotfw: dsmith-work: Thanks for the info... I might have to shelve this for now nly: hello roelj: I see there's a new ‘pipeline’ function :D. Is it equally fast/efficient as using pipes in bash? roelj: (I want to pass 100+ GB through a pipe..) wingo: hi :) wingo: civodul: good job on 3.0.3 release :) wingo: civodul: excepting one thing tho. pretty sure chris vine is right, that the change to the libtool version was incorrect wingo: wdyt? wingo: we should clarify that --disable-deprecated builds do not have stable ABI, and that symbols of such binaries may disappear at any thing wingo: *time wingo: will send that to the list civodul: hi wingo! sneek: Welcome back civodul, you have 1 message! sneek: civodul, efraim says: I'll test the JamVM patches on aarch64 but I don't want to be responsible for breaking other architectures :) civodul: like i said, i was hesitant civodul: but thought we'd rather be safe than sorry civodul: but yeah, dunno, we don't have a documented procedure for that wingo: civodul: pretty sure all through 2.2.x we deprecated things wingo: keeping the soname wingo: between keeping those changes and changing the soname, i would have reverted the bitvector changes on 3.0, fwiw wingo: i.e. i only made them thinking that it would preserve ABI compatibility civodul: wingo: yeah civodul: i understand civodul: i don't see changing the SONAME as that big a deal (to me it's less serious than not changing it when it should have been changed) civodul: but i agree it creates annoyances civodul: sorry about that civodul: Debian for instance will have to rebuild all the dependents of guile-3.0 civodul: from then on, i'm find with the policy you suggest: ignoring --disable-deprecated ABI stability civodul: what course of action would you suggest now? wingo: i don't know. i would suggest reverting, tbh wingo: i mean releasing a quick 3.0.4 with CURRENT reset to what it was, and adapting the other two versions appropriately (I always have to look at the manual to see how to do it) wingo: like it's not simply that debian would have to rebuild guile-3.0; it means they would have to have libguile3.0-42 vs libguile3.0-43 wingo: which is not what we intended i think civodul: ok civodul: "the other two versions"? civodul: ah you mean the libtool numbers wingo: AGE and REVISION or whatever wingo: yeah civodul: hmm civodul: should i do that? wingo: if you have the cycles, yeah civodul: well, i don't, but if it has to be done... wingo: well let's try between the two of us, in the meantime would you mind following up to the list with a note saying that we're going to release 3.0.4? wingo: like we should avoid a cascade of problems with distributions wingo: so maybe sending a note will give us the time to take care of it civodul: just emailed the list civodul: probably best to avoid having distros get into troubles wingo: yeah wingo: not all distros are as advanced as guix ;) civodul: :-) civodul: wingo: after the revert, this gives something like this: https://paste.debian.net/1153638/ civodul: actually there's a new scm_bitvector_position civodul: so that gives this: https://paste.debian.net/1153639/ *: wingo looks wingo: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info wingo: yes i think that's right civodul: alright wingo: the second patch you post wingo: because we are in case (2) wingo: friggin abi civodul: yes wingo: i guess we should add some comments there. basically in a stable series we either increment both CURRENT and AGE -- that being the default option -- but if we know that nothing was added ABI-wise, we can just increment REVISION wingo: afaiu civodul: https://git.savannah.gnu.org/cgit/guile.git/log/ civodul: right civodul: i end up rereading the Libtool manual every time and going through git log civodul: perhaps we should just use libabigail wingo: thanks for working through this with me and apologies again for the bother civodul: well, in hindsight, it was undoubtedly a mistake wingo: lots of guile is a mistake in hindsight ;-)) civodul: :-) civodul: wingo: how about this for NEWS? https://paste.debian.net/1153642/ wingo: civodul: lgtm civodul: tx! dsmith-work: Hey Hi Howdy, Guilers wingo: heya dsmith-work dsmith-work: wingo: Greetings. dsmith-work: wingo: Did you happen to see the clang/arm breakage in the jit? wingo: dsmith-work: you referring to https://gitlab.com/wingo/lightening/-/issues/15 ? wingo: (also, are you using clang for your guile builds?) dsmith-work: Yes, that case. Not using clang. That's RhodiumToad using fbsd on rpi. *: RhodiumToad raises hand wingo: o/ wingo: that's a very interesting bug wingo: i wonder why it doesn't cause more problems wingo: do other abis not require writing the full word? wingo: i would guess not but apparently all this is paged out of my brain :P dsmith-work: wingo: x86 doesn't require zero padding I think. The abi doc I was looking didn't say for chars/shorts, but *did* mention bools. dsmith-work: Bit 0 is 0or1, bits 1-7 must be 0, other bytes are don't-care. wingo: https://stackoverflow.com/questions/36706721/is-a-sign-or-zero-extension-required-when-adding-a-32bit-offset-to-a-pointer-for/36760539#36760539 wingo: yeah that is what i found too (of course looked at the abi doc but i wanted interpretation about something it was silent about) wingo: https://groups.google.com/forum/?hl=en#!topic/x86-64-abi/E8O33onbnGQ <- related RhodiumToad: wingo: gcc doesn't seem to assume that the caller of a function is following the ABI strictly. this is probably not really intentional, just an artifact of how it deals with data RhodiumToad: whereas clang for whatever reason assumes that the ABI is followed RhodiumToad: x86 requires bools are padded to bytes because it's easier and faster to check a byte for zero than a bit RhodiumToad: but x86 doesn't otherwise require padding because, at least historically, forcing sign-extension or zero-extension slowed things down RhodiumToad: whereas arm (at least in 32-bit, I haven't done anything with aarch64) tends to favour word-size accesses everywhere wingo: i guess lightening should (a) assume that its registers are properly extended, e.g. that loading a u8 zero-fills any high bits, and (b) add "_abi" variants for the various store APIs, which backends can implement wingo: generally speaking we will make them equivalent to word-size stores for values <= word-size wingo: sound about right? wingo: or maybe we can simplify and just use `jit_str` to store the values (i.e. the word-size variant) RhodiumToad: _assuming_ that loading a value fills the high bits is a bad idea wingo: from looking at the code in firefox, that is what it seems to do wingo: RhodiumToad: pretty sure it is guaranteed by construction in the jit wingo: could be wrong tho! RhodiumToad: it is for arm, but what about other architectures? wingo: from what i can tell it's general at least across x86/x64/arm/aarch64/mips32/mips64 wingo: could be another platform is different but it sounds unlikely and we can cross that bridge later i guess wingo: needs thinking about tho wingo: alternately we could emit extz / exts calls for "small" data types wingo: when passing them as args wingo: maybe that is safest wingo: could break some dependency chains too... RhodiumToad: hm, yeah, I see that x86 is using movzx / movsx to generate byte loads civodul: wingo: 3.0.4 uploaded! wingo: *clap clap clap clap* wingo: RhodiumToad: yeah consider, you do ldr_c (R0, addr); jnz(R0, L0). there i think the lightening API really means that loading an int8_t does sign extension wingo: otherwise the result of the comparison would be undefined, if the high bits weren't defined wingo: wdyt? RhodiumToad: well I'm fairly new to lightening, hadn't looked at it before tackling these bugs wingo: lol, i used to know lightening, but apparently i forgot everything about it; high five to the lightening newbies club RhodiumToad: heh RhodiumToad: so I think the approach that feels best to me is to have an _abi variant for stores, meaning "store a value of this size in the way that the platform ABI expects" wingo: "good" news would be that the fix to this bug is straightforward: just use jit_str instead of jit_str_c when passing stack args. similarly for _s and _i wingo: assuming that is compatible with all platform ABIs, which i think it is for the ones that lightening supports RhodiumToad: note that I haven't checked on what aarch64 does. RhodiumToad: (I don't have any aarch64 hardware to check) wingo: from firefox things i know that writing u8 args as word-size values isn't incompatible; whether it's required or not, i don't know. wingo: (i wonder why armv7 is loading the whole word from the stack instead of just the byte; easier to encode?) RhodiumToad: clang on aarch64 is _not_ loading or testing a whole word, just a byte RhodiumToad: at least from doing examples on godbolt dsmith-work: I've got an aarch64 board. dsmith-work: Need to fire that thing up too. wingo: all hail godbolt dsmith-work: YEah, that's really useful. *: wingo gtg, biab *: RhodiumToad finds the aarch64 abi doc RhodiumToad: ok. so aarch64 explicitly does _not_ do the same padding that 32-bit arm requires dsmith-work: Bah. Board has power supply problems. RhodiumToad: an integer value smaller than 8 bytes is passed in the low order N bits of an 8-byte slot (register or memory), but the remaining bits are unspecified dsmith-work: RhodiumToad: Souund like the x86 stuff. RhodiumToad: yup dsmith-work: civodul: need to tag v3.0.4 ? zig: Thanks whoever fixed the bug in guile 3.0.3 my project works again :) civodul: dsmith-work: tag pushed, thanks for the reminder! *: dsmith-work bows with a flourish dsmith-work: sneek: seen rlb? sneek: rlb was in #guile 6 days ago, saying: Though I still need to think through whether or not that really makes sense here.... dsmith-work: !uptime sneek: 17:42:55 up 2 days, 5:35, 0 users, load average: 0.19, 0.06, 0.06 rekado: looks like neither of the two moderators of r/guile are using Reddit rekado: since the r/guile community is restricted nobody can post there rekado: (unless they have been approved by the moderators in the past) daviid: there was a 6h internet 'cut' im my area, back a little while ago, now trying tho read the logs (a coupl of times the last half hour or so) repeatedly fails here, with a 504 Gateway Time-out, is it just 'here' or there are not accessible for others as well? RhodiumToad: logs also not working for me. RhodiumToad: dsmith-work: did you see my earlier answer to the question about ABI docs? daviid: RhodiumToad: ok tx for the confirmation dsmith: RhodiumToad: Yes! I have the pdf. Thanks muchly. dsmith: Yes, I'm getting 504 on the logs too. dsmith: RhodiumToad: So. Since that byte-to-mem code seems to be used for both writing into a string and pushing on to a stack, something needs to be added somewhere to tell it to pad to the word size. dsmith: Like some extra flags to encode the size of the destination. dsmith: RhodiumToad: Also, I would think *other* arches would also get it wrong too. RhodiumToad: I'm not sure what the requirements are for other arches. dsmith: No proof, but I'm almost certain all args must on word size bounds for any arch. (for sane pushing and popping the stack) I guess the real question is the padding. cnmne: hello, i'm playing with the web server module and i'm not sure how to access server-local-ip:8080 from a different computer on the same LAN. not sure if this is a guile question, but wanted to make sure it wasn't a missing parameter for `run-server' dsmith: You can check if it's listening with "netstat -ltp" (or "ss -ltp" if no netstat). Being root allows the "-p" to show more info. dsmith: If it's litening on 0.0.0.0, then you should able to get to it. If 127.0.0.1, then local only. *: rekado kicks the logs chrislck: sneek: botsnack sneek: :) dsmith-work: Tuesday Greetings, Guilers b4283: greetings mwette: o/ manumanumanu: Ahoy hoy! manumanumanu: What a nice release 3.0.3 seems to be! dsmith-work: yes! RhodiumToad: still needs work for arm dsmith-work: RhodiumToad: I was looking at another abi. 64bit x86. A bool has bit 0 set, bits 1-8 zeroed, and remaining bits don't care. dsmith-work: Didn't see anything about bytes or shorts. dsmith-work: I would not have expected that. RhodiumToad: x86 has no problem treating registers as byte or word values manumanumanu: what's up with macro expansion in the repl in 3.0.3? manumanumanu: am I alone in getting way too much information? manumanumanu: noooooooo. Disregard that manumanumanu: jesus i'm such a noob manumanumanu: does the fx+ do anything these days compared to regular +? RhodiumToad: it's slower civodul: yup, it's an elaborate way to get slower code :-) Habush: Hi, where can I find the documentation and source code for the sneek bot? dsmith-work: Habush: /msg help to the bot dsmith-work: Habush: No source at this time. civodul: i'm looking at 'strip' in psyntax and wondering civodul: it's typically linear in the size of the input civodul: and it conses a lot dsmith: Didn't guile used to have a macroexpand-1 at one time? dsmith: Maybe that was for defmacro type macros. daviid: leoprikler: went afk, but your last example is a good example tx daviid: leoprikler: can you tell me, in guile-gi, short name gf are not 'made' at all, or are made but using a prefix or postfix? leoprikler: Guile-GI internally creates short names for everything that GI marks as a method. leoprikler: However, Guile-GI strongly encourages the use of modules, specifically through the (use-typelibs ...) syntax. daviid: leoprikler: yes, so does g-golf, but what about shrt names hat are guile core syntax, like begin? daviid: i was answering the first sentence leoprikler: So it just lets them bind those as well and then uses module magic to filter out unwanted imports. daviid: every oe should use modules daviid: so there are filtered out leoprikler: no, what I mean, is that instead of importing stuff directly into your script as seen in the example you posted daviid: not made into generic funtion usingh a prefix, postifx or both then? leoprikler: Guile-GI creates modules internally (e.g. (%gi Gtk-3.0)) when using that syntax leoprikler: And upon importing from (%gi Gtk-3.0), you can add a #:renamer daviid: that doesn't sound like something i want to do in g-golf, but thanks leoprikler: And they also have a renamer function, that takes a (list of) symbol(s), an optional prefix and an optional suffix (the default being just prefixing everything with '%) daviid: ok tx. I think leoprikler: IIUC G-Golf binds stuff directly in the module leoprikler: perhaps you could take the renamer as an optional argument in your functions or use a fluid daviid: leoprikler: methods are added to their generic function, those are added to the public interface of (g-golf hl-api gobject) - which from a user point of view is an impĺementation detail I would say - to your last suggestion, maybe daviid: but I didn't think to oofer renaming 'facilities', and wrt short name methods, when they exist as guile core syntax, I t am thinking to rename those using a postfix _ as daviid: like begin_ daviid: lambda_ leoprikler: underline looks pretty weird in lisp imo leoprikler: Also note, that you can't just hardcode Guile core syntax and say "Yep, I'm done". daviid: I don't want to prefix, and certainly not using %, which is used both in guile and g-golf ... but postfix and offer a default char to be used sounds good to me daviid: i don' understand yur last sentence daviid: ok, I am going to implement what I just described and see how that goes, will let you vknow, and others 'here', when it's done, so you may try leoprikler: The last sentence was w.r.t. "when they exist as guile core syntax" – your users might have more stuff to protect. In Guile-GI for instance, there are several testcases protecting test-begin etc. because Guile-GI "long" names don't have the namespace in them and therefore the GLib test module clashes with SRFI-64. leoprikler: You may not have that exact problem, but you could still run into cases where a short name clashes with custom syntax from non-core stuff. leoprikler: Not sure what meaning it would carry in Scheme, but Vala uses the "@" prefix for functions that would override syntax. daviid: leoprikler: are you developing a gnome app in another language? just curious daviid: leoprikler: long names, from imported typelib, should be unique in the universe :) leoprikler: I think they are in G-Golf, because you have the full name, no? e.g. gtk-window-destroy. daviid: right, as for other language binding, by long name, we mean the 'original function or method name leoprikler: Well, Guile-GI doesn't really have those. It has short names and long short names, because the namespace is always discarded. daviid: I won't prefix, but thanks for the suggestion leoprikler: I'm not quite sure why, though. leoprikler: My GNOME experience is mostly through some small Vala applets. leoprikler: I once wrote a music player with bindings to Guile way before G-Golf or Guile-GI were ready for use. leoprikler: (music = mpd) daviid: did you use guile-gnome? leoprikler: Nope. For one, I was using Guile 3 and it also failed to build horribly back then. leoprikler: ehhh GNOME 3 daviid: ok leoprikler: "I was using Guile 3 way back in the past" yeah right xD daviid: any link i can look at with some your vala gnome app code? daviid: oh i see some cxode here, forget about 'my request' - https://en.wikipedia.org/wiki/Vala_(programming_language) - has a gtk mini example leoprikler: Sadly no. I never published it, because I couldn't settle on a name. leoprikler: My next big project will get a Greek letter, I swear. dsmith: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ release.2.3.1-6-a463-dirty dsmith: !uptime sneek: 20:51:59 up 89 days, 9:24, 1 user, load average: 1.00, 1.01, 1.05 dsmith: sneek: botsnack sneek: :) dsmith: sneek: version dsmith: sneek: botsnack sneek: :) dsmith: sneek: version sneek: Sneeky bot running on Guile version 3.0.3 using bobot++ something from git dsmith: !uptime sneek: 22:29:41 up 89 days, 11:02, 2 users, load average: 0.08, 0.54, 0.93 dsmith: Weird. the bobot revsion went away. dsmith: But the bot is now on 3.0.3! *: sneek dances daviid: dsmith: congrat! that debugginh session with RhodiumToad was quite impressive by the way dsmith: heh dsmith: Was nice to work though it with someonw daviid: definitely dsmith: OOps. Used the wrong bobotcode. THat's why the version was broke. dsmith: sneek: version sneek: Sneeky bot running on Guile version 3.0.3 using bobot++ release.2.3.1-6-a463-dirty dsmith: Yesss daviid: I am thinking (and locally experimenting) to remove numbering from g-golf's manual - none of the gnome libs have numbering, even for the most 'sophisticated' and biggest one, like Gtk - I've always found their manual quite 'beautiful' and efficient daviid: dsmith: as you may have seen, i decided to go for %gi-method-short-names-skip, for the time being at least ... which can take 'all, 'none (or '()), or a list of (symbol) names ... dsmith: Is fine dsmith: I don't know what recent gnome manuals look like, but the old app manuals I remember looking at were horrible. Nothing more than regurgitating the menus in the app. dsmith: While I was looking for gtk stying info.. daviid: oh really? I don't think they changed that much - but i can't see how numbering section/subsectios would help anyway - here is the gtk top page https://developer.gnome.org/gtk3/stable/index.html daviid: and here is the GtkBocx, just as an example https://developer.gnome.org/gtk3/stable/GtkBox.html daviid: I 'copied' their way of presenting thing for g-golf, here is an example https://www.gnu.org/software/g-golf/manual/html_node/Repository.html#Repository daviid: anyway, I am procrastinating :) daviid: this part of the g-golf nmanual is for cotributors, I need to spend time on the user one daviid: now, I need another variable name :) daviid: for this trailing/postfix char or string that will be used when a method short name 'clashes' with a user or guile core syntax name ... like begin -> begin_ daviid: maybe %gi-method-short-names-'something' daviid: %gi-method-short-names-res-postfix - with res for resolution, which i could dscribe in the manual .... daviid: or just %gi-method-short-names-postfix tohoyn: sneek, botsnack dsmith: Have you considered a prefix? sneek: :) dsmith: Doesn't clojure or something do that with java interop? Like a "." prefix? daviid: dsmith: no, these short names are made by removing their respective container's name, and i want/wish uers may immediately know what the shortname would be ... then use #\Tab to complete ... daviid: dsmith: the java . is for accesor - daviid: g-golf uses ! as a prefix for all accessors, internals and iported one3s daviid: here we are talking about renaming method short names if their name clashes with a user or guile core syntax name dsmith: Will there always be the postfix, or just on names that collide with scheme syntax/special-forms ? daviid: mind you I could as well propose a lambda if you and other users prefer to prefix ... and having the default mto postfix using _ daviid: just on names that collide daviid: so, gtk-window-add -> add, but gcr-secret-exchange-begin -> begin_ dsmith: Feels kind of kludgy. But I don't have a better suggestion. daviid: the _ being a default, and the var name I am looking for could be changed by the user dsmith: Would have a documented list of known colliders? A way to add more? daviid: what I think is this: 1- postfix is better in thiese cases; 2- the _ postfix char is kind of a good choice because it is never (likely wil never) be used by anyone 'else where' daviid: dsmith: no, all this is runtime daviid: I am not aware of ... so far, just begin actually dsmith: load is syntax in guile (!) But by macro wizardry you can pass it to a second-oder function, like to map. daviid: load is a syntax, didn't know :) dsmith: SOmething about source locations. daviid: but anyway, all this will be/is meant to be automatic, so we'd have begin_, load_ daviid: or something decided by the user daviid: assuming one postfix char, what would be a good var name - or maybe i shold defie a var that holds a lambda, default would be the above, but users could pass the lambda of their dream ... daviid: %gi-short-names-protect (to use the guile-gi terminology) - (lambda (name) 'add a _ trailer'), the users could pass their own daviid: I think I'll do that daviid: %gi-short-names-protect bound by default to a lambda that postfix using _, but then users may do absolutely whatever they want ... daviid: then everybody is happy :) dsmith: All problems can be solved by another layer of indirection.. dsmith: (or suitable application of high explosives) dsmith: (or too many layers of indirection) dsmith: EXCEPT FOR foo many .. daviid: yep, and with that approach, it becomes a user problem, if they do not like the default that is ... which is alweays good daviid: ... if ... that is! is very uk :) daviid: *which is always good - to give users options to ... that is :) iltutmus: did i leave the channel? i'm testing the znc's detaching feature, according to its wiki, you shouldn't see me lefting dsmith: iltutmus: I couldn't say, I've got join and other messages turned off. The channel logger doesn't log them either. iltutmus: hmm RhodiumToad: iltutmus: I don't see any recent connect/disconnect messages from you iltutmus: well then, it works :) *: RhodiumToad has his client configured to filter out joins/parts unless the user has recently spoken RhodiumToad: and I can toggle that on and off on the fly to see what was filtered iltutmus: i tested it again after wrote my first message iltutmus: oh iltutmus: good dsmith: RhodiumToad: What irc client? RhodiumToad: weechat dsmith: Ah RhodiumToad: I adjusted the threshold for "recently" to be several hours, too dsmith: I'm using ERC with GNU Emacs 26.1 (x86_64-pc-linux-gnu, GTK+ Version 3.24.5, multi-tty) of 2019-09-22. *: mwette installed guile-3.0.3 on ubuntu 18.04. Build went fine, but installed guile would not execute until I ran "ldconfig". dsmith: yep. Needed to do that for the bot's machine too. dsmith-work: Morning Greetings, Guilers nikita`: dustyweb: do you still maintain guile-gcrypt? the readme said to open bugs via notabug, but there's also a 1 year old issue. while I see no rush in tickets, I'd like to point out https://notabug.org/cwebber/guile-gcrypt/issues/4 which is only from earlier today and possibly get feedback at some point :) dustyweb: hi nikita` dustyweb: oh dustyweb: nikita`: I am very bad at keeping up with bug reports. One could call it a bug of mine :) dustyweb: nikita`: civodul and I are theoretically co-maintainers, but I think civodul has done more maintenance than I dustyweb: nikita`: we've mostly been using guile-users mailing list for feedback/discussion... I'll take a look at this issue though nikita`: ok :) dustyweb: nikita`: I might be the wrong person to help with it though dustyweb: hm nikita`: no rush, and I'm happy for any advice where to look dustyweb: define-enumerate-type... civodul: nikita`: is https://notabug.org/cwebber/guile-gcrypt/issues/4 still valid with the latest release? civodul: oh wait, that's a brand new issue nikita`: yes, this was while updating to the new release civodul: weird, the guile2.2-gcrypt package in Guix didn't have that problem civodul: nikita`: which 2.2 version is it? civodul: are there patches applied? nikita`: guile22-2.2.7nb2 , no patches applied for guile-gcrypt itself. guile22 has one patch for guild to adhere correct behavior for triplets. there's another patch applied to "Use correct mmap permissions for later PROT_WRITE mprotect." civodul: ok nikita`: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/guile22/patches/ nikita`: I'll reply in a bit, I'm still working but now taking a break to eat dsmith: RhodiumToad: Do you have links to the arm abi docs you were referring to earlier? nikita`: knowing what this hint at roughly would be helpful already, if it's system or distribution specific it's on us/me to fix it. RhodiumToad: dsmith: for the ABI RhodiumToad: ? RhodiumToad: dsmith: this one: https://static.docs.arm.com/ihi0042/i/aapcs32.pdf RhodiumToad: dsmith: specifically chapter 6, under "Stage B - Pre-padding and extension of arguments" RhodiumToad: "If the argument is an integral Fundamental Data Type that is smaller than a word, then it is zero- or sign-extended to a full word and its size is set to 4 bytes." *: RhodiumToad adds that to the issue for future reference civodul: nikita`: would it be possible for you to rm -rf /usr/pkg/guile/2.2/lib/guile/2.2/site-ccache/gcrypt/ beforehand? civodul: i'm thinking it might be interfering nikita`: oh. nikita`: yeah nikita`: in sandboxed builds that's a no-issue, i wanted to test this nikita`: I do updates mostyl outside of a sandbox. tis helps a lot, I can start looking into PATH or removing nikita`: super inconvenient and I want an alternative where I sandbox every build by default and apply more reproducibility, but progress is different. nikita`: thanks! I'll get back to you once I have results civodul: great, thanks! nikita`: probably later this week or so, I'm preoccupied with finding a new job, new flat, and GSoC civodul: sure, no rush dsmith-work: Hey hey civodul: hey dsmith-work! dsmith-work: civodul: Back in the office. dsmith-work: civodul: the bot updated: dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 3.0.3 using bobot++ release.2.3.1-6-a463-dirty civodul: yay! civodul: well done civodul: sneek: botsnack sneek: :) civodul: RhodiumToad & you are our ARM heroes! dsmith-work: Heh. Thanks. Learned a lot! civodul: really nice you were able to get to the bottom of these things dsmith-work: It was a very magical bug. Elusive. Was good to see a solid fix. dsmith: RhodiumToad: How goes the battle? RhodiumToad: the problem goes away at -O0 RhodiumToad: which suggests either undefined behavior somewhere or a clang bug RhodiumToad: but it means more recompiles before I can make progress, so... dsmith: You got a rarely used os, a rarely used compiler, and rarely used hardware. dsmith: Lots of places for problems to show up. dsmith: (rarely used for Guile) apteryx: rekado: about the ~A, right I saw that too, and tried to fix it in http://issues.guix.gnu.org/41956, but failed so far RhodiumToad: ARGH RhodiumToad: (yes, that's an "I found the bug and it's stupid" kind of ARGH) RhodiumToad: ok. so too sleepy now to figure out what the code should actually be doing, but at least I've pinpointed why it breaks RhodiumToad: seems to be some disagreement over whether a uint8_t passed on the stack (rather than in a register) actually needs to be extended to 32 bits RhodiumToad: (caller thinks not, callee thinks yes, result is a value that was supposed to be 0 is ... not 0) daviid: leoprikler: would you have a more specific example, not sure I understand the scope of your warning :) - in g-golf, functions are never 'turned' into methods, so that exclude GLib potential name 'clashes' as a all RhodiumToad: sneek, later tell civodul I've identified the bug, fixing it shouldn't be too hard but I need sleep first sneek: Will do. RhodiumToad: looks like gcc and clang might be disagreeing over how the calling convention works, which would explain why it doesn't fail on gcc RhodiumToad: reading the arm specs, it looks like clang is assuming the caller is following the spec whereas gcc is a bit more conservative, and the JIT code generation is violating the spec tohoyn: sneek, botsnack sneek: :) tohoyn: daviid: there is a bug in g-golf. see https://paste.gnome.org/pubonddxl and https://paste.gnome.org/pe0kavzhs tohoyn: daviid: to reproduce the bug run command "guile -s koe6.scm" tohoyn: daviid: it reports that "raise" is undefined daviid: tohoyn: you might as well import the all Gtk namespece ... but you shouyld _never_ import anything from GObject - things from GLib, GObject are manually binded, for boostrap purposes ... daviid: wjay os this supposed to do? what is raise? how could you call vector on it ... tohoyn: daviid: "raise" raises an exception. In Theme-D it is set as a component of a vector. tohoyn: daviid: because Theme-D implements objects as vectors at the low level tohoyn: daviid: the error remains even though I remove the two GObject entries in koe5. daviid: tohoyn: yes, I was telling not to ever gi-import from GLib or GObject daviid: after you import one of the namespace name, raise becomes a generic functin daviid: *function daviid: tohoyn: I was working, yesterday, on a mechanism not to generate generic function and methods short names - that will fix your problem I guess - I didn't push yet because I am hesitating on the name of the uer varible ... apteryx: is there a way to run a locally built guile? apteryx: something like Guix's pre-inst-env script would be neat daviid: apteryx: yes, look in the ./meta subdir, there is uninstalled-env, read the comment in this file, it exlains what it does and how to run it ... tohoyn: daviid: FYI, Theme-D-Golf uses Theme-D generic functions for the short method names. daviid: tohoyn: I don't know what you do, but raise becomes a generic function after importing koe5 tohoyn: daviid: but it should be visible in koe6? daviid: tohoyn: do you know which namespace name has a long name method that becomes 'raise'? apteryx: daviid: thanks! now I need to figure out why guile-readline doesn't seem to be built daviid: once 'shorten' tohoyn: daviid: raise is not a GOOPS method tohoyn: daviid: AFAIK daviid: i know daviid: it is a procedure, it becomes a generic function after you import ... i'd like to figure out what namespace name daviid: 'provoques' it to become a generic functin ... tohoyn: daviid: If it is a G-Golf method you probably know it better daviid: it's not daviid: ah it is a gdk method daviid: gdk_window_raise daviid: tohoyn: so, there is no g-golf bug here tohoyn: daviid: we have a duplicate method name here daviid: tohoyn: I am hapy to help, but it is not a g-golf bug tohoyn: daviid: because raise is defined by the guile exception system daviid: tohoyn: I think, to make it simple for you, that you are among those users that will prefer not to generate short named generic functions tohoyn: daviid: yes daviid: okj, give me a few minutes, I ll push tohoyn: ok daviid: tohoyn: pushed - so now you may call (set! %gi-method-short-names-skip 'all) after you imported g-golf, to skip all method (gf) short name generation daviid: the default value is to generate all generic function short names tohoyn: daviid: it works. tx. daviid: perfect, wc leoprikler: daviid: IIUC "short name" generation does actually generate methods, does it not? leoprikler: And a method being named "begin" or "raise" can cause issues with Guile internals. tohoyn: FYI: Theme-D-Golf version 0.8.3 has been released. See http://www.iki.fi/tohoyn/theme-d-golf/ . tohoyn: Changes: Updated for changes in G-Golf leoprikler: In Guile-GI, there is a similar potential for overriding core functionality with bogus. It's usually not that bad, because the correct method can be dynamically resolved in GOOPS, but that does not work for syntax. leoprikler: e.g. you won't have an issue with "connect" due to different arguments, but you will have one with "lambda" (good thing that there's no GLib lambda) daviid: leoprikler: GLib will never lead to a problem, there is no mthod in GLib, afaict - procedures should not (never) be a problem, raise is not a problem, it was a miss use by the user. syntax won't work, if you can point to a GObect long nam method that would short named to a guile core syntax, I'll use tht to come with a solution leoprikler: Gtk.SourceGutterRenderer.begin leoprikler: Gcr.SecretExchange.begin leoprikler: Gda.XaTransaction.begin leoprikler: Pango.Renderer.begin leoprikler: Gtk.Gesture.begin leoprikler: Tracker.DataProvider.begin leoprikler: I think you'll find more methods named "begin", but those were some of the top ones suggested by valadoc. daviid: Gtk.Gesture.begin is a signal, not a method daviid: but i'll look into this potential problem, tx daviid: i think all you posted are signals, not methods leoprikler: DataProvider is an abstract method according to Vala. leoprikler: SecretExchange is not even abstract leoprikler: https://developer.gnome.org/gcr/unstable/GcrSecretExchange.html#gcr-secret-exchange-begin dsmith: RhodiumToad: Wow. *: RhodiumToad yawns RhodiumToad: bleh. fixing this might not be simple. RhodiumToad: might need to talk to wingo about it dsmith: Hah. Here is that windows stack thing I was vaguely remembering: https://gitlab.com/wingo/lightening/-/commit/a96c0188f196acb46fdee3bd0c20575db6c945a9 RhodiumToad: so, opened an issue for the arm thing dsmith: RhodiumToad: So is the problem clang is pushing a byte with garbage 32bits, or is it jit code doing that? RhodiumToad: when passing a value smaller than a word, the jit is writing only part of a word to the stack, leaving the other bytes undefined RhodiumToad: e.g. passing a byte by doing mov.w r0, #xx str.b r0, [sp] dsmith: Ok. RhodiumToad: however, the function being called is allowed to assume that the word at [sp] is all valid, containing the parameter value widened to 32 bits RhodiumToad: and clang indeed makes this assumption, so for example it will test for a zero by loading the whole word and seeing if it's zero RhodiumToad: so the error I get occurs because the jit code stored 0 but the called function thought the value was not 0 dsmith: Looks like the x86-cpu code is doing sign extension, so maybe it's DTRT. Arm might need to do that RhodiumToad: no, this looks like a fundamental defect in the lightening code; consider for example abi_mem_to_mem RhodiumToad: if you have a parameter value which is in memory and smaller than 32 bits, then the load of the value and the following store have to be different sizes. RhodiumToad: e.g. ldr.b r0, [r1] str r0, [sp] dsmith: Hmm. RhodiumToad: though, hmm, that could still be fixed in abi_gpr_to_mem civodul: woow, great debugging session, RhodiumToad sneek: Welcome back civodul, you have 1 message! sneek: civodul, RhodiumToad says: I've identified the bug, fixing it shouldn't be too hard but I need sleep first civodul: so it really happens with Clang specifically, right? RhodiumToad: but abi_gpr_to_mem doesn't seem to have any scope for cpu-specific behaviors as written RhodiumToad: gcc seems to generate ldr.b rather than ldr when reading the parameter value, which is why it doesn't obviously fail dsmith: Calls jit_stxi_c (really stxi_c in the *-cpu.c) RhodiumToad: however, it seems to me that it would be completely wrong in the big-endian case? does anyone run arm in big-endian mode? civodul: RhodiumToad: could you add a reproducer in https://gitlab.com/wingo/lightening/-/issues/15 ? civodul: is ARM in big-endian a thing? dsmith: Can be slyfox: ARM can be BE, yes civodul: i mean, the widespread CPUs don't support it, do they? slyfox: AFAIU most of them don't (maybe it's a firmware issue?) dsmith: I don't think so. No longer acive in Debian. (was for a time) civodul: ok RhodiumToad: details added to the issue civodul: awesome, thanks RhodiumToad: one can imagine that one reason why the ABI specifies things the way is does is that a function might want to load multiple args from the stack using one ldr instruction RhodiumToad: I don't know if any compilers actually do that, but it's clearly allowed RhodiumToad: er, ldm I mean civodul: so i'll tag 3.0.3 with what we have now, because there are already important fixes and improvements that have accumulated RhodiumToad: ok. civodul: thumbs up for all the fixes already committed! RhodiumToad: that should at least get it working with gcc civodul: (no pun :-)) civodul: yeah mwette: RhodiumToad: Where does the optimization fit in? RhodiumToad: what optimization? RhodiumToad: oh, you mean why it goes away with -O0? RhodiumToad: my guess is that that makes it more likely that the stack slots happen to contain 0s in the unassigned bytes RhodiumToad: nope RhodiumToad: what actually happens at -O0 is that bind_kwargs copies the values of the parameters into local stack slots, as uint8_t RhodiumToad: so the undefined bytes get masked off again. mwette: thanks tohoyn: FYI: Theme-D version 3.0.4-1 and Theme-D-Gnome version 0.9.4-2 have been released. See http://www.iki.fi/tohoyn/theme-d/ and http://www.iki.fi/tohoyn/theme-d-gnome/ . chrislck: any match experts here? why would 2nd version be erroring out chrislck: https://paste.debian.net/1153188/ chrislck: (define y (make-string-database-2 )) chrislck: (y 'store 'b "beta) chrislck: :11:2: Wrong number of arguments to #:11:2 (expr)> chrislck: is this a match.scm bug/wart? RhodiumToad: that's not quite correct usage of match-lambda RhodiumToad: (define (x) ...) already implicitly does (lambda () ...) wklew: I think that was the goal, the first version does the same RhodiumToad: to use match-lambda, you'd use (define make-string-database-2 (let ((string-hash (make-hash-table))) (match-lambda ...)) wklew: I can't find anything wrong with it RhodiumToad: oh RhodiumToad: my mistake, the problem seems to be simply that you wanted match-lambda* RhodiumToad: match-lambda creates a function of 1 arg chrislck: oh that's right chrislck: still no chrislck: ah works yes chrislck: ty :) dsmith: RhodiumToad: Was just looking at the arm opcodes. strb (immediate) does zero extension, while strb (register) does not. RhodiumToad: uh? RhodiumToad: the immediate in strb is part of the address, not the data dsmith: Maybe I'm misreading. AHh, zero extends the address. RhodiumToad: strb as the name suggests is storing a byte into memory. just one byte. dsmith: I guess it's meant for storing individual bytes in a string.. mwelt: Hi all. Short question on POSIX File System procedures. Refering to the documentation there's scm_mknod ( path, type, perms, dev ) for creating, inter alia, symlinks. mwelt: My question would be, how to define the source of the link, if there's only a single path input oportunity? RhodiumToad: mknod is not how you create symlinks... RhodiumToad: (you want the symlink function for that) mwelt: RhodiumToad: theres the keyword 'symlink for scm_mknod, that's why I was under the impression this might indicate the correct procedure. RhodiumToad: mknod used to do a lot more than it does now (and when I say "used to", I mean in the 1980s or so) mwelt: RhodiumToad: and what would this 'symlink function' be? The search in the documentation only returned this scm_mknod procedure. RhodiumToad: -- Scheme Procedure: symlink oldpath newpath mwelt: Thanks a lot. Are these procedures also part of the main documentation? If so, why is it so hard to find :) dsmith: Looks like a bug in the docs to use mknod for creating a symlink. RhodiumToad: that's under Guile Modules > POSIX > POSIX System Calls and Networking > File System RhodiumToad: mknod is kind of a raw low-level interface, way back in the day it was used for stuff like making directories mwelt: Ah it's actually the same document I was looking into ^^ sorry RhodiumToad: so in theory it can make any kind of inode, but in practice these days it's obsolete RhodiumToad: maybe linux still uses it for device nodes, I don't know (I don't use linux) RhodiumToad: the fact that you can specify any type of file is just to allow you to specify any value for the file type bits for the mknod() system call, it doesn't actually mean that they do anything useful dsmith: Yes, pretty sure you use mknod for that. Though that's often done to udev or something now. Not usually done "by hand" RhodiumToad: on freebsd, you can use mknod to make device nodes on a normal filesystem, but such nodes have been inert since freebsd 6 RhodiumToad: actual device access is done via the devfs file system mwelt: ok I understand. Thanks for clarifying things up! RhodiumToad: and devfs creates and removes entries itself as directed by the underlying drivers mwelt: I am fairly new to guile. Did some chez scheme years ago came back to it now I fiddle around with guix. Thought it would be some kind of 'idiomatic' to write some scripts in guile. dsmith: RELEASE!! civodul: YES! civodul: 3.0.3 is out! civodul: https://www.gnu.org/software/guile/news/gnu-guile-303-released.html civodul: well the page is on its way civodul: big thanks everyone! slyfox: yaaaaaaaay! \o/ janneke: civodul: \o/ daviid: congrat! all, wow, 170 commits, 17 contributors ... amazing, well done all! daviid: I was looking at tje libraries page (out website) and spoted a few tipo/mistake - I don't have guix so I'll write about those here, just a few daviid: guile-studio says it is guile, including the url daviid: guile-lib says it works with 3.0, 2.0, but it works with 2.2 as well jcowan: Where is the 3.0.3 `pipeline` procedure documented, if anywhere? civodul: there's a link in the announcement on the web site *: civodul -> zZz jcowan: ta civodul: happy celebration, Guilers! :-) dsmith: https://www.gnu.org/software/guile/manual/html_node/Pipes.html#index-pipeline jcowan: okay, was hopimng for more details than that someplace, but thanks RhodiumToad: (let* ((port (make-custom-binary-input-port "the port" (const 0) (const (expt 2 42)) #f #f))) (port-position port)) RhodiumToad: $2 = 4398046511104 RhodiumToad: well that works better RhodiumToad: ERROR: asyncs.test: preemption via sigprof - arguments: ((wrong-type-arg #f "Wrong type (expecting ~A): ~S" ("resumable continuation RhodiumToad: " #) (#))) RhodiumToad: now what RhodiumToad: at least r6rs-ports.test passes now dsmith-work: Yeah, all the error/condition/exception reporting needs to be gone over carefully and tuned up. RhodiumToad: ERROR: srfi-69.test: SRFI-69: can use all arguments, including size - arguments: ((keyword-argument-error #f "Invalid keyword" () (3 RhodiumToad: 1))) dsmith-work: Many times, printing an error causes a segfault or something. RhodiumToad: the asyncs one passed on a retry, so I think that one might be just chance RhodiumToad: i.e. happens to get the sigprof at a bad place RhodiumToad: srfi-69 failure is consistent though. RhodiumToad: just to check, that passes for you? RhodiumToad: hm. this test doesn't fail if run standalone RhodiumToad: so the problem is that you can't run r6rs-hashtables.test and then srfi-69.test in the same interpreter RhodiumToad: which seems ... odd dsmith-work: All tests pass. dsmith-work: I put it in a loop and it ran for a while. RhodiumToad: hm. RhodiumToad: that worries me dsmith-work: But sometimes got a leftover file in /tmp that cause a failuer. RhodiumToad: because that pair of tests reproducibly fails for me dsmith-work: And a pipe test error too. dsmith-work: But that might be because of without-threads RhodiumToad: I'm currently using a with-threads build RhodiumToad: if I do just ./check-guile r6rs-hashtables.test srfi-69.test it fails dsmith-work: So one that that was a concern at one time, was is the rest of the system (libc) built as arm or thumb? RhodiumToad: arm dsmith-work: Mine is still rebuilding for with-threads RhodiumToad: aha. dsmith-work: So I can't check at the moment. But soon. On intset.go RhodiumToad: so the problem actually isn't with r6rs-hashtables. RhodiumToad: the problem is jit, somehow dsmith-work: So I heard at one time Debian was default thumb. But I think this rasbian is arm. RhodiumToad: it's just that without an explicit GUILE_JIT_THRESHOLD, and without r6rs-hashtables.test, it's not reaching the threshold on some path. RhodiumToad: GUILE_JIT_THRESHOLD=200 makes srfi-69.test fail on its own. dsmith-work: Do you know about GUILE_JIT_STOP_AFTER ? dsmith-work: Set GUILE_JIT_THRESHOLD=0 and then bisect on GUILE_JIT_STOP_AFTER dsmith-work: At some point n passses and n+1 fails. dsmith-work: Supposed to help identify the failing jit code. dsmith-work: Aww Fouey RhodiumToad: GUILE_JIT_THRESHOLD=0 GUILE_JIT_STOP_AFTER=681 passes, 682 fails dsmith-work: Forgot I wanted to pull to get the latest changes. RhodiumToad: any way to get it to show what function it decided not to jit? dsmith-work: And you can set GUILE_JIT_LOG = 1,2,3 RhodiumToad: the log isn't helping RhodiumToad: GUILE_JIT_PAUSE_WHEN_STOPPING=1 helps RhodiumToad: can't easily see what function it's trying to compile tho dsmith: Need to look at hex addresses I think. dsmith: WHen I as using logging heavily, I also had code that was printing stuff. So I couild correlate. dsmith: The blx and veneer problems. dsmith: debugging on-the-fly generated code is a whole new level of "hard to do". dsmith-work: make check failed dsmith-work: ERROR: 00-repl-server.test: repl-server: simple expression - arguments: ((misc-error #f "~A" ("Unable to create directory in /tmp for 00-repl-server.test") #f)) dsmith-work: dsmith-work: Cause /tmp was loaded up I guess RhodiumToad: probably dsmith-work: sneek: bugs? sneek: Last time I checked bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile dsmith-work: Added this https://gitlab.com/wingo/lightening/-/issues/14 dsmith-work: yey make check passes dsmith-work: With 0 threshold dsmith-work: yep dsmith-work: passed again dsmith-work: Ok, running the checks in a loop. will run overnight dsmith-work: with ramdom addresses enabled again daviid: I am going to add a g-golf 'mechanism', using a variable, so users may decide to not having any generic short names at all, or skip some, like map for example ... I wonder what a good name would be dsmith: shrtnm (not serious) daviid: %gi-no-generic-short-name-for, in which case one might passs 'all or a liat daviid: 'all, or 'none', or '(map ...) dsmith: Remember to use your vowels sparingly daviid: or %gi-skip-generic-short-name-for daviid: or %gi-no-generic-function-short-name-for // %gi-skip-generic-function-short-name-for or %gi-no-gf-short-name-for %gi-skip-gf-short-name-for daviid: or some other name? :) daviid: gi stands for GObject Introspection, in this context daviid: or %gi-no-generic-function-short-names daviid: bah :) daviid: %gi-no-generic-function-short-name-for seems the best to me daviid: then, sould it be for 'none, or for 'all :):) daviid: I'll accept both, everybody will be happy daviid: hum %gi-skip-generic-short-names might be better daviid: dsmith: wdyt? :) dsmith: Personally, I don't like long names. dsmith: On the other hand, less chance of a collsion. daviid: ok, I am more into the name meaning something, hence long names, unless universally obvious :) daviid: but there are many long name possibilities :) dsmith: Can they be re-named? Kind of like module imports? daviid: no dsmith: But you do want user to adjust a set of names. daviid: I just wanted to offer to skip them all, or some dsmith: Hmm. daviid: renaming is really 'out of scope' so to speak dsmith: %gi-short-names ('on, 'off, 'all, #t, #f, #:on '(list of names) dsmith: Something like that would be my personal preference. daviid: I see, you would not use generic-function at all dsmith: Right daviid: in the variable name daviid: good sugestion, I'll think about it, thanks dsmith: Would there be any other "short names" than generic-functions? daviid: no dsmith: Naming is *hard* daviid: yeah, very hard :) dsmith: I can't count the times I've named some kind of struct "thing". At least as a placeholder. dsmith: YEah, had thing1 and thing2 too. dsmith: And then later, after working with it a while, a better name surfaces. daviid: yes, difficult - always ... dsmith: Sometimes, a good name used in isolation might seem weird, but when used in context, it's nice and readable. dsmith: Think about how it will be used. What other identifiers and functions will be used with it. dsmith: Grand ideas. daviid: my only objective is to offer those who do not want short names at all to be able to specify so, then those concerned that some guile core are transformed into generic, with an inevitable 'penalty', should it be small ... there is one ... daviid: map is the only real concern actually, but then the mnechanism should be 'general daviid: anyway, tx, i'll think a bit more about it dsmith: I'm not much for apps (gui apps), but I'm looking forward to playing with it some day. dsmith: s/it/g-golf/ daviid: i hope you'll have fun :) dsmith: A long long time ago, scwm had an interface to gtk+. That has long since bitrotted. dsmith: I don't have much motivation, as awsome (what I use) works perfectly for me. daviid: sure daviid: and a wm is not a 'piece of cke' either dsmith: I sent in some patches and all of a sudden, they made the maintainer. daviid: :) roelj: How do the ‘http-get’ and others validate certificates, or what environment variables influence it looking for the CA store? roelj: I set both SSL_CERT_DIR and SSL_CERT_FILE, but that doesn't seem to work. leoprikler: daviid: do not forget about GLib functions with names sounding like Scheme syntax like "begin" leoprikler: Guile-GI has a way of protecting those bindings on a "per name" basis, as it uses modules leoprikler: not sure how G-Golf wants to handle this tohoyn: sneek, botsnack sneek: tohoyn, you have 1 message! sneek: tohoyn, daviid says: I pushed an important patch, to the G-Golf repo, devel branch: "Methods - Both long and short name generic functions" - please pull, make ... and see if everything is ok sneek: :) RhodiumToad: hm. so I made a testcase specific to this error I'm getting RhodiumToad: basically (define* (testfn #:optional a b #:key (c #f) #:rest d) (format ...)) and then call that function 100 times in a loop RhodiumToad: with the default threshold, after 34 successful calls, the 35th call fails with "Invalid keyword: 34" RhodiumToad: so the first thing that suggests to me is that whatever code path isn't being properly jitted is being called a lot, just under 30 times per call RhodiumToad: hm. RhodiumToad: setting the threshold to 0 makes it fail on the very first call. but a threshold of 1 makes it fail on the second? dsmith: threshold 0 means always jit dsmith: 1 means (I think) jit if called more than once dsmith: Ya, it's in the manual dsmith: "Each function has its own counter that gets incremented when the function is called and at each loop iteration in the function. When the counter exceeds the ‘GUILE_JIT_THRESHOLD’, the function will get JIT-compiled." RhodiumToad: with a threshold of 0, it succeeds (program runs to completion) if GUILE_JIT_STOP_AFTER is set to less than 370 RhodiumToad: i.e. GUILE_JIT_THRESHOLD=0 GUILE_JIT_STOP_AFTER=369 works, GUILE_JIT_THRESHOLD=0 GUILE_JIT_STOP_AFTER=370 fails at iteration 0 RhodiumToad: GUILE_JIT_THRESHOLD=1 GUILE_JIT_STOP_AFTER=241 stops at iteration 1 (second call) dsmith: Maybe there is a way for force a bactrace or at least print the current function at the stop_after point. dsmith: As in instrument the stop_after code to do that RhodiumToad: you can make it pause to attach gdb, but I've so far failed to find out how to get the current function dsmith: wingo knows dsmith: No doubt he added that for this very purpose RhodiumToad: simplified it down to just (define* (testfn #:key a #:rest b) #t) (testfn #:a 1 1) (testfn #:a 1 2) (testfn #:a 1 3) RhodiumToad: removing the extra args didn't affect the stop-after threshold at all, curiously RhodiumToad: neither did removing the do-loop I was using before for the iteration dsmith: My loop over make check with-threads and address randomization is still running from yesterday dsmith: (I expected it to) civodul: RhodiumToad: i pushed your THUMB fix to the lightening repo (and just replied by mail) civodul: dsmith: we can add the test you posted yesterday in lightening if you're confident that it was a good reproducer dsmith: Yes. fails without RhodiumToad's fix. passes with it. Solid. dsmith: But remove the fprintf. (oops) dsmith: Idealy, should feed it into the jit code as a parameter, but I couldn't figure out how to do that. dsmith: So you could also verify the other encodings. civodul: awesome civodul: i'm trying to run the checks via qemu-binfmt here dsmith: Yes that's how I ran them yesterday. Worked well. dsmith: Just needed to look into the yaml file for the invocation. civodul: awesome civodul: i guess we need enter/leave_jit_abi like in the other tests RhodiumToad: civodul: I don't have any better test than dsmith's, so use that one civodul: cool civodul: i guess movi.c is a good name civodul: i confirm that it reproduces the bug for me civodul: dsmith: OK to push the test with your name/email address as the author? civodul: and me as co-author because of the small changes i made dsmith: Sure. Probably better to use dalepsmith@gmail.com civodul: alrighty! dsmith: Yey. Sneek will be pleased. civodul: :-) civodul: JIT for sneek civodul: https://gitlab.com/wingo/lightening/-/commit/24ef197b1269f8371b1f4a412caa6d2b99d66839 civodul: RhodiumToad, dsmith: does that solve all the issues you noticed so far on ARMv7? RhodiumToad: no civodul: ah RhodiumToad: I'm debugging another one civodul: cool RhodiumToad: but dsmith hasn't seen it, so it may be a clang vs. gcc issue civodul: alright RhodiumToad: or a freebsd vs. linux or whatever civodul: if would be great if you could post a description & reproducer on gitlab/w/l or bug-guile@gnu.org so we have an audit trail civodul: that's on FreeBSD? RhodiumToad: I have time to spend on it today/tomorrow, so if you're planning a release I'd appreciate a few hours leeway civodul: sure RhodiumToad: freebsd on an RPI2b civodul: ok civodul: i'm going afk for a bit civodul: later! RhodiumToad: symptom is that this fails: (define* (testfn #:key a #:rest b) #t) (testfn #:a 1 1) (testfn #:a 1 2) (testfn #:a 1 3) RhodiumToad: but only with a sufficiently low jit threshold RhodiumToad: I'm trying to narrow down exactly what function being jitted is breaking it dsmith: civodul: Yes. All issues. dsmith: civodul: As I mentioned earlier. Have had a make check running in a loop over night. Still running. civodul: dsmith: yeah, nice! RhodiumToad: I should have checked out a whole bunch of different worktrees RhodiumToad: recompiling with different compile options, such as -O0, is time-consuming :-( civodul: RhodiumToad: you wrote that the snippet above "fails", as in it doesn't always return #t? or crashes? RhodiumToad: it throws an error about 1 not being a keyword, but only after doing some jit RhodiumToad: if the jit threshold is never hit, it runs fine RhodiumToad: I can narrow down which function being jitted causes it, but I can't tell which function it actually is RhodiumToad: i.e. it's the 370'th call to the jit code generator civodul: uh civodul: weird civodul: and only on armv7-freebsd? RhodiumToad: I've not actually tested it specifically on other platforms civodul: ok civodul: i guess we'd notice because it's a rather simple snippet RhodiumToad: it showed up for me when running the tests RhodiumToad: the srfi-69 test, specifically civodul: ok RhodiumToad: bleh. define* leads into a maze of macros RhodiumToad: I guess that's actually not important, because at the VM level there's just a bind-kwargs opcode civodul: yeah RhodiumToad: and it's definitely bind_kwargs in vm.c that ends up actually throwing the error RhodiumToad: hm RhodiumToad: if there's a #:rest, then bind_kwargs is supposed to be called with the "strict" parameter false RhodiumToad: which would prevent the error RhodiumToad: so somehow that parameter is not correct. progress! RhodiumToad: argh argh argh RhodiumToad: so I compiled it all with -O0 and of course the damn problem went away :-( RhodiumToad: so either clang is miscompiling something when optimization is on, or the nasal demons are at it again civodul: bah :-/ civodul: it could be a stack marking issue civodul: if you compile the C code with -O0, you make it more likely that objects remain live civodul: as in RhodiumToad: time to make a new workdir and compile up another copy civodul: heh civodul: well, tty tomorrow civodul: maybe this fix will be for 3.0.4 civodul: we'll see! *: civodul -> zZz mwette: RhodiumToad: You mean -O2 breaks libguile/lightening/*.c or libguile/jit.c? RhodiumToad: I mean that the bug I was seeing when it was compiled with -O2 could not be reproduced at -O0. RhodiumToad: investigation continues. but since I make the mistake of recompiling at -O0 in the original workdir, I now have to compile again to get -O2. RhodiumToad: (in a new workdir this time) mwette: So maybe worth compiling w/ -O2 and then selectively compiling other parts to -O0. Is there an __attribute__ to control optimization at a function level? RhodiumToad: haven't checked. but now that I know more about where to look, i can probably get useful info from gdb even at -O2. mwette: there is __attribute__((optimize, )) but don't know what level arg is supposed to be mwette: it's a string, so I'm guessing __attribute__((optimize,"O0")) might work RhodiumToad: I don't see such an attribute in clang. RhodiumToad: there seems to be an __attribute__((optnone)) mwette: Ah. I was looking at gcc manual. mwette: OK, I got gcc to accept this form: int __attribute__((optimize("O0"))) foo(...) { ...} chrislck: mauritslamers: your function is fine. you can used named let for the state variables. rekado: gah, the rebase is really tricky rekado: Emacs 25 changed the way symbols are represented internally terpri_: rekado, how so (roughly)? *: terpri_ way behind on guile-emacs rebasing daviid: I pushed an important patch, to the G-Golf repo, devel branch: "Methods - Both long and short name generic functions" // this is an important milestone, for G-Golf, because till now, GObject methods were actually imported as procedures. They are now imported as goops methods. In addition, G-Golf also provides short name generic functions and method, 'just' like guile-gnome. daviid: str1ngs: ^^ daviid: sneek: later tell tohoyn I pushed an important patch, to the G-Golf repo, devel branch: "Methods - Both long and short name generic functions" - please pull, make ... and see if everything is ok sneek: Will do. mwette: sneek: botsnack sneek: :) daviid: here is an updated example - https://paste.debian.net/1152440/ - note the method short-name calls, destroy, join-group, set-active, add, pack-start and show-all conjunctive: Hi, I was wondering, how would you limit read-line to 512 characters in the context of the Fibers ping-server example? conjunctive: (for reference: https://github.com/wingo/fibers/blob/master/examples/ping-server.scm#L39-L40) leoprikler: daviid so I can do stuff like (destroy window) now just like in Guile-GI? leoprikler: Oh, I can, nice RhodiumToad: gmake[2]: *** [Makefile:2279: ice-9/iconv.go] Segmentation fault (core dumped) RhodiumToad: that's with threading disabled RhodiumToad: and it's a mov.w r12, #0 / ldrt r5, [r12] again RhodiumToad: grumble. and it doesn't reproduce RhodiumToad: this is with alsr on, so it may of course only happen with particular choices of memory addresses RhodiumToad: the last mov/ldrt error was with alsr off but threading on RhodiumToad: sod this, time to add an assert civodul: bytevector-u32-native-set! is mis-cross-compiled on master and not in 3.0.2 civodul: generated CPS is the same as if the "target" fluid was ignored civodul: but i can't find where that expansion happens RhodiumToad: mis-cross-compiled? RhodiumToad: random guess, is this related to the change on Jun 1 that makes -O1 also do resolve-primitives? civodul: no, it's with -O2/-Ocps civodul: i didn't check -O1 actually civodul: the starting point of all this is that .go files under prebuilt/ for 32-bit platforms are miscompiled RhodiumToad: miscompiled only for endian-mismatched platforms or for all? because presumably an issue with bytevector-u32-native-set! would only be a problem in the event of endian mismatch civodul: RhodiumToad: AFAICS it's really just the word size that's problematic civodul: i need to investigate some more apteryx: what's happen when a guard close is missing an "else" for unknown condition types? The doc suggests it get rethrown but I'm not sure. apteryx: what happens* apteryx: nevermind, it seems to be related to the kind of exception that `canonicalize-path' throws apteryx: consider this: (guard (c ((message-condition? c) (format #t "error: ~a: ~a~%" "fixed-arg" (condition-message c)))) (canonicalize-path "/doesntexist")) --> error: fixed-arg: ~A: ~S apteryx: why doesn't the formatted string get produced right? dsmith-work: Happy Friday, Guilers!! guix-vits: dsmith-work: Thanks. Is sneek doesn't accept "later tell" from inside of '/query' any more? civodul: Happy Friday! civodul: dsmith-work: how's your debugging journey going? civodul: i just fixed that cross-compiled .go bug civodul: i'm testing it, but if everything goes well, all the lights are green for me dsmith-work: No success yet dsmith-work: Address randomization matters! dsmith-work: Turning that off makes the segfaults consistent. dsmith-work: single threaded seems to make it happen less often, but does not eliminate. dsmith-work: I tried to do a bisect on make check. GUILE_JIT_STOP_AFTER=1384 fails. 1383 works civodul: yeah, turning ASLR off is a good way to make bugs reproducible civodul: meanwhile i'll test on the machines i have access to civodul: is it OK if we release 3.0.3 ASAP and leave the bug fix you're working on for 3.0.4? dsmith-work: I think so. civodul: good dsmith-work: Can aways just disable the jit. dsmith-work: That's still happeing for guix, right? civodul: no, we no longer disable JIT on ARM civodul: except for a statically-linked Guile variant civodul: so perhaps it's just that the issue had become rare enough dsmith-work: With the jit threshold at default, it happens rarely. But it can. civodul: yeah maybe we were just lucky then civodul: BTW, IIUC, the description at https://bugs.gnu.org/40737 is not up-to-date, is it? dsmith-work: threshold at 0 pushes it harder civodul: if you have more details to describe how to reproduce it, what backtrace you get, etc., feel free to email them to that bug dsmith-work: I will. civodul: great dsmith-work: All the backtraces are useless. :( civodul: arf dsmith-work: And gdb doesn't even let me disassemeble at the failed address. dsmith-work: (gdb) disassemble /r 0x75106c26 dsmith-work: No function contains specified address. *: dsmith-work shakes fist at gdb wingo: you can disassemble 0x75106c26+100 sneek: Welcome back wingo, you have 1 message! sneek: wingo, dsmith-work says: So is there any advantage to calling scm_gc_free() in jit_free_fn() ? wingo: like disassembly a byte range RhodiumToad: moo *: RhodiumToad returns from power failure dsmith-work: (gdb) disassemble /r 0x75106c26+100 dsmith-work: No function contains specified address. dsmith-work: dsmith-work: grr RhodiumToad: comma before the + dsmith-work: Yey! dsmith-work: I was sure I did that yesterday. dsmith-work: 0x75106c22: 4f f0 00 2c mov.w r12, #0 dsmith-work: => 0x75106c26: 4c f8 00 5e strt r5, [r12] dsmith-work: Our old frind RhodiumToad: yeah. I'm trying an assert in ldi_i to see if it gets hit dsmith-work: wingo: Can you explain or point me to some docs/code on how stacks happen with jited code? How they grow and are cleaned up and how they are swithched? wingo: dsmith: basically the scheme stack is entirely separate from c wingo: it is a data structure that can grow either by remapping or copying. any time the scheme stack might expand (generally at function entry) it might relocate wingo: the interpreter operates on the stack as a data structure and doesn't recurse on the C stack, unless it needs to call out to C wingo: if a function has JIT code, the interpreter will call the JIT code, which does the same operations on the scheme stack as the interpreter would wingo: and when it reaches a function that has no JIT code, either in a call or in a return, it returns back to the interpreter, which reloads the state of the data structure and continues operating wingo: all the bits in jit.c and vm-engine.c that reload e.g. SP from the thread are sometimes about register spilling, but often about this need to account for invalidated SP because the stack expanded wingo: er wingo: SP in the logical sense of scheme wingo: not %rsp or whatever wingo: because remember, two stacks wingo: the c stack and the scheme stack. RhodiumToad: I think the question behind the question is "why don't backtraces work in gdb when a call came from jitted code" RhodiumToad: and I think the answer to that is that the jitted code lacks the debug info needed for gdb to figure that out. dsmith-work: Yeah, that's probably true. *: civodul pushes cross-compilation bug fix civodul: hey wingo wingo: heya :) RhodiumToad: I think it's moot anyway. generating mov #0 followed by a load/store using that register indicates something wrong in code generation, not at runtime civodul: wingo: you're also OK with releasing as is? dsmith-work: The segfaults are often: set r12 to zero, load some reg with [r12] wingo: civodul: yes, fixes can always come in a followup RhodiumToad: did the rotate_left thing get fixed? wingo: sounds like RhodiumToad has a nice ARMv7 fix tho that might make sense to land wingo: RhodiumToad: link? RhodiumToad: I didn't post it anywhere, sec RhodiumToad: what I did was https://dpaste.org/WieJ but that's not necessarily the only fix or even the best one RhodiumToad: using (v << n | v >> ((32 - n) & 31)) would be another fix RhodiumToad: basically, when v is 32 bits as it is here, (v >> 32) is undefined dsmith-work: Or (n?(v << n | v >> (32 - n)):v) RhodiumToad: indeed wingo: RhodiumToad: what name and/or email should i use to thank you? :) RhodiumToad: Andrew Gierth, andrew at tao11 . riddles . org . uk dsmith-work: wingo: While you are here, what's with #define jit_ldrt_strt_p() 0 dsmith-work: and then many if (jit_ldrt_strt_p() && ...) dsmith-work: So effectivly always disabling that branch of the if wingo: dsmith-work: it comes from lightning. either i need to detect a feature and use that, or i need to constant-fold it to 1 or 0 RhodiumToad: we were wondering why it generates ldrt / strt insns despite there being no obvious reason to do that civodul: wingo: ah cool, let's include the fix by RhodiumToad wingo: doing it now civodul: awesome wingo: https://gitlab.com/wingo/lightening/-/merge_requests/4 dsmith-work: wingo: And another thing. ;^} memset in reset_literal_pool() seems to be a noop. wingo: will merge when the test succeeds wingo: dsmith-work: why is it a noop? dsmith-work: pool->size = 0; memset(pool->entries, 0, sizeof(pool->entries[0]) * pool->size); RhodiumToad: third arg is always 0 wingo: haha yes dsmith-work: Maybe should have been ->capacity instead? dsmith-work: The rest of the code doesn't touch entries unless the have been initialzed first. dsmith-work: So not really a problem. But still.. wingo: yeah i think i was being paranoid about struct holes and related things wingo: a lot of invariant-asserting code there anyway dsmith-work: So the errors are trying to dreference NULL. Why? Is the code being generated incorectly? Or is something funky going on at a higher level, passing a zero. dsmith-work: That's an immediate 0 RhodiumToad: this is why I'm trying it with an assertion in ldi_i dsmith-work: That should provide a valid backtrace RhodiumToad: if something tries to generate a load from address 0, it should fail. but this problem doesn't reproduce reliably for whatever reason RhodiumToad: it hasn't failed for me yet. though the power failure I had earlier was in the middle of a run dsmith-work: It's address dependant somehow. RhodiumToad: dsmith-work: do you get it repeatably with aslr and threads off? wingo: civodul: done dsmith-work: Yes. dsmith-work: It always fails a certain test with make check, but NOT when running that individual test civodul: wingo: thanks! RhodiumToad: dsmith-work: can you put ASSERTs into ldi_i and sti_i to assert that i0 is not 0? civodul: wingo: i'll run some more tests, update GUILE-VERSION, and go ahead wingo: thumbsup civodul: :-) dsmith-work: Bah! dsmith-work: RhodiumToad: Added the asserts, but I still don't get a backtrace. Looks like they were not asserted. RhodiumToad: but you got a crash still? dsmith-work: YEs RhodiumToad: oh, also add one to sti_c dsmith-work: ok dsmith-work: It's the 00-initial-env.test that triggers it. dsmith-work: Same. :( RhodiumToad: uh. weird. RhodiumToad: what's the surrounding code to your crash at runtime? dsmith-work: #0 0x75106c26 in ?? () dsmith-work: #1 0x76f556c0 in scm_i_string_ref (str=, x=478720) at strings.c:668 dsmith-work: #2 0x00074e00 in ?? () dsmith-work: Dump of assembler code from 0x75106c22 to 0x75106c2c: dsmith-work: 0x75106c22: 4f f0 00 2c mov.w r12, #0 dsmith-work: => 0x75106c26: 4c f8 00 5e strt r5, [r12] dsmith-work: 0x75106c2a: 47 f2 f8 45 movw r5, #29944 ; 0x74f8 RhodiumToad: go back a few more instructions dsmith-work: 0x75106c18: 00 5c ldrb r0, [r0, r0] dsmith-work: 0x75106c1a: 5c f8 00 5e ldrt r5, [r12] dsmith-work: 0x75106c1e: 85 60 str r5, [r0, #8] dsmith-work: 0x75106c20: 85 68 ldr r5, [r0, #8] dsmith-work: 0x75106c22: 4f f0 00 2c mov.w r12, #0 dsmith-work: or dsmith-work: 0x75106c12: 47 f2 d8 4c movw r12, #29912 ; 0x74d8 dsmith-work: 0x75106c16: c7 f2 00 5c movt r12, #29952 ; 0x7500 dsmith-work: 0x75106c1a: 5c f8 00 5e ldrt r5, [r12] dsmith-work: 0x75106c1e: 85 60 str r5, [r0, #8] dsmith-work: 0x75106c20: 85 68 ldr r5, [r0, #8] dsmith-work: 0x75106c22: 4f f0 00 2c mov.w r12, #0 dsmith-work: => 0x75106c26: 4c f8 00 5e strt r5, [r12] RhodiumToad: what assert exactly did you put where? dsmith-work: ASSERT(i0); dsmith-work: in the three funcs you mentioned dsmith-work: ldi_i, sti_c, sti_i RhodiumToad: oh interesting RhodiumToad: ok, I have to stare at the manual a while to figure this out civodul: now to debug a deadlock with open-input-output-pipe civodul: regtur: if you're around, it's tests/inferior.scm in Guix that triggers it :-) RhodiumToad: huh. RhodiumToad: that mov.w looks like it is invalid. RhodiumToad: the imm12 constant is 0010 0000 0000 RhodiumToad: and the reference manual says that's UNPREDICTABLE RhodiumToad: oh FFS RhodiumToad: civodul / wingo, if you're planning a release or anything, stop now RhodiumToad: I think I found it, one of the paths through encode_thumb_immediate is _completely_ bogus dsmith-work: Oh, that's a beauty of a function. Lots of hex everywhere RhodiumToad: the case for abcdefgh 00000000 abcdefgh 00000000 will always generate 0, regardless of the input value RhodiumToad: the return should be return (((v & 0x0000ff00) >> 8) | (2 << 12)); RhodiumToad: (it is obvious that (v & 0xff) is 0 because it literally just checked that) RhodiumToad: this is why it fails randomly with aslr, because that makes the top bits of the value variable; the success/fail based on whether or not it's run from make might be dependent on the environment size or similar RhodiumToad: dsmith-work: can you test that too? dsmith-work: Build done dsmith-work: Nice find, BTW RhodiumToad: this thumb instruction encoding stuff is pretty crazy dsmith-work: Flew through the always-fail case dsmith-work: SO it was enocoding some valid address as 0. RhodiumToad: yup. but only when the valid address was in the form xx00xx00 where both xx were the same. dsmith-work: That had to have a specific pattern RhodiumToad: so you can see that with aslr, it'd be highly unpredictable dsmith-work: Yes. dsmith-work: And with threshold=0 more opportunities for that to happen dsmith-work: Well, failed, But that was dsmith-work: Running 00-repl-server.test dsmith-work: ERROR: 00-repl-server.test: repl-server: simple expression - arguments: ((misc-error #f "~A" ("Unable to create directory in /tmp for 00-repl-server.test") #f)) dsmith-work: running again after cleaning /tmp dsmith-work: Looks *really* good dsmith-work: That's just crazy that XX00XX00 or 00XX00XX would have a sepecial encoding. RhodiumToad: well you can sort of see it, in that there's only 12 bits available to use, and they want to represent as many as possible of the actual constants people might want RhodiumToad: so e.g. there are ways to encode 0xaaaaaaaa or 0x00010001 dsmith-work: "Ooo look. Lot's of people use 0xDEADBEEF, let's make a special code for that..." mwette: needle in a haystack bug dsmith-work: All tests pass RhodiumToad: think about the sorts of values that get used as bitmasks, for instance mwette: super awesome guys RhodiumToad: (there actually _isn't_ a good way to encode 0xdeadbeef in this scheme) dsmith-work: Heh, ya. Was attempting humor. dsmith-work: So if bit x is set, then bits yz select one of these 4 constants. 0xDEADBEEF ... dsmith-work: Hmm. There ought to be some test in the lightening repo that validates all that. RhodiumToad: clearly there should be, but equally clearly there is not dsmith-work: s/all that/all that immediate encoding/ janneke: i heard somenoe prefers 0xCABBA9E nowadays janneke: *someone dsmith-work: heh RhodiumToad: 0x0ddc0ffeebadf00d dsmith-work: Ya. That's fixed it. RhodiumToad: been a good week for weird memory bugs dsmith-work: civodul: This will close https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40737 civodul: oh, nice! civodul: RhodiumToad: could you email what you have to 40737@debbugs.gnu.org? RhodiumToad: sec civodul: yes, take your time :-) RhodiumToad: why do you allow trailing whitespace in your files, btw? it really messes up my diffs dsmith-work: Maybe because https://gitlab.com/wingo/lightening which comes from http://git.savannah.gnu.org/cgit/lightning.git ? *: civodul not sure what that statement implies :-) RhodiumToad: magit to the rescue, as usual RhodiumToad: mail sent civodul: thank you, RhodiumToad! dsmith-work: civodul: I'm guessing guile inherited the whitespace from lightening which inerited it from lightning. Just a guess. civodul: wingo: so we have another lightening patch for ARM by RhodiumToad at https://bugs.gnu.org/40737 dsmith-work: One more small nit dsmith-work: $ grep JIT_NEEDS_LITERAL_POOL lightening.c | sort| uniq -c dsmith-work: 1 #endif // JIT_NEEDS_LITERAL_POOL dsmith-work: 12 #ifdef JIT_NEEDS_LITERAL_POOL dsmith-work: 1 #if JIT_NEEDS_LITERAL_POOL dsmith-work: THat #if should really be #ifdef RhodiumToad: oh, there's a small bug in the configure script somewhere RhodiumToad: I _think_ it gets here: if test $gl_cv_func_working_mktime = no; then without gl_cv_func_working_mktime being set at all RhodiumToad: the failure is probably harmless dsmith-work: RhodiumToad: Check out tests/ldr_i.c in the lightening repo. Looks could be easily extended for the failure case (and others). apteryx: refining my minimal repro: (guard (c ((message-condition? c) (format #t "error: ~a~%" (condition-message c)))) (throw 'system-error "canonicalize-path" "~A" '("No such file or directory baba"))) -> error: ~A apteryx: shouldn't condition-message be able to extract the message from such a throw? apteryx: perhaps I need to read the source of make-exception-from-throw apteryx: OK, so the error happens in (ice-9 exceptions): (guile-system-error-converter 'system-error '("canonicalize-path" "~A" '("No such file or directory") '(2))) -> $4 = #<&compound-exception components: (#<&external-error> #<&origin origin: "canonicalize-path"> #<&message message: "~A"> #<&irritants irritants: (quote ("No such file or directory"))>)> apteryx: we can see that already at that point the message is lost apteryx: is this by design? Is it left to the users to correctly format the message doing something like (apply format `(#f ,msg ,@msg-args)) ? apteryx: or should the exception object message slot already be populated with a correctly formatted message? *: apteryx has too many questions mwette: aperytx: haha - yeah, i don't like the return of "error"; I usually use something like (catch 'ctx (lambda () (throw 'ctx "error ~S ~S ~S" 1 2 3)) (lambda (key fmt . args) (apply simple-format #t fmt args)) if that helps apteryx: mwette: the glue in (ice-9 exceptions) seem to provide an opportunity to rectify this if we want apteryx: it bridges legacy throw exceptions with srfi-34 style ones apteryx: it it typical for a system-error to contain "~A" as the message, and the actual message as a message-argument? apteryx: if it's always true, we can format the actual error message at the level of guile-system-error-converter apteryx: the node 7.2.1 POSIX Interface Conventions hints that this is the case, with a handler example binding the variables "fmt fmtargs data". apteryx: and formatting a human readable message with: (apply format #t fmt fmtargs) apteryx: I'll propose a patch. dsmith-work: https://paste.debian.net/1152897/ dsmith-work: RhodiumToad: ^^ dsmith-work: Not sure how the api works. But that fails without your fix, and passes with it. dsmith-work: civodul: ^^ dsmith-work: Should be extended with more cases somehow. dsmith-work: (I called it movi.c) apteryx: the docstring at SCM_DEFINE (scm_error_scm, "scm-error", 5, 0, 0, (error.c, line 70) gives me confidence that we should format the message before raising the exception. mwette: apteryx: you mean via (format #f ...) ? apteryx: yeah mwette: I would prefer to have error accept format string and args. apteryx: try this for example: (guard (c ((message-condition? c) (format #t "message: ~a~%" (condition-message c)))) (canonicalize-path "/doesntexist")) apteryx: it produces: message: ~A: ~S apteryx: I'm not sure where that ~S came from mwette: i have not looked into SRFI-35 etc. This info in TSPL may apply: https://www.scheme.com/tspl4/exceptions.html#./exceptions:h0 apteryx: They describe what msg and irritants should be: msg must be a string and should describe the exceptional situation. The irritants may be any Scheme objects and should include values that may have caused or been materially involved in the exceptional situation. apteryx: describe the exceptional situation: I don't think "~A" fits the bill ;-). civodul: dsmith-work: https://paste.debian.net/1152897/ would be a unit test, right? civodul: can you email it to the bug? civodul: i don't feel confident with merging the lightening patches so i would prefer to let wingo take a look RhodiumToad: that test would presumably go in the tests/ subdir of wingo's lightening repo dsmith-work: Yeah, that would be a lightening test. dsmith-work: Really should test more cases. But I havn't figured out how yet. dsmith-work: And it's more of an example for someone with paperwork to write a real test. dsmith-work: civodul: Yes, I'll email it to the bug civodul: thanks! civodul: i don't know how much has diverged but perhaps there are applicable bug fixes in lightning.git dsmith-work: mail sent dsmith-work: apteryx: There were some recent changes to exceptions and conditions. Looks like more to come too. See NEWS dsmith-work: NEWS "Reimplementation of exceptions" RhodiumToad: civodul: no, the upstream has the bug too RhodiumToad: http://git.savannah.gnu.org/cgit/lightning.git/tree/lib/jit_arm-cpu.c#n1145 -- see line 1158 dsmith-work: Bah. left a printf in that example. dsmith-work: Would be nicer if those ASSERTs printed out something instead of just calling abort() dsmith-work: Oh! that's lightning, not lightEning dsmith-work: Probably some very unexplained things going on there too. RhodiumToad: I was looking for the origin of the code and whether it had been fixed elsewhere dsmith-work: Hmm. The assert *does* print stuff. Just not the actual return value. mwette: lightening @ gitlab.com/wingo/lightening; lightning @ www.gnu.org/s/lightning mwette: ^methinks RhodiumToad: yes RhodiumToad: grr. coredump running tests RhodiumToad: this doesn't look like a jit thing tho rekado: apteryx: you’ll find the ~A here: (catch #t (lambda () (canonicalize-path "/doesntexist")) (lambda args args)) rekado: that gives you (system-error "canonicalize-path" "~A" ("No such file or directory") (2)) RhodiumToad: => 0x21f97030 <+348>: vst1.32 {d16-d17}, [r3]! RhodiumToad: r3 = 0 dsmith-work: Whoops RhodiumToad: #0 0x21f97030 in compare_u32_strings_ci (s1=0xbcd2b6d0, s2=, locale=, func_name=) RhodiumToad: at i18n.c:863 dsmith-work: RhodiumToad: That is supposed to save all those registers at *r3++ right? RhodiumToad: yes RhodiumToad: it's doing a memory to memory copy using the vector regs RhodiumToad: I think this is the for loop in SCM_STRING_TO_U32_BUF dsmith-work: So this is clang generated code? RhodiumToad: yes RhodiumToad: but: RhodiumToad: c_str = c_str_malloc_p ? malloc (bytes) : alloca (bytes); RhodiumToad: notice no check for NULL return from malloc dsmith-work: Oooo dsmith-work: I've heard that "malloc can't fail on Linux" too many times. RhodiumToad: and yup, definitely looks like that's what happened RhodiumToad: it tried to allocate 4000000 bytes RhodiumToad: hm, it should have been able to do that dsmith-work: I've been learning Rust lately, and I've been appreciating it more and more. RhodiumToad: fascinating how clang vectorizes that loop, though dsmith-work: I guess the safest thing to do there is conditionalze the loop on c_str, and then check it at the call sites. dsmith-work: I was really amazed the other day how rust optimized match foo {'Y'|'N'|'y'|'n' => true, _ => false } dsmith-work: After adjusting an offset, loaded a bitmap into a regiser and probed that. dsmith-work: Only one branch. dsmith-work: RhodiumToad: was it a specfic test that failed or another "random" one. *: RhodiumToad runs it again to see RhodiumToad: I'd just done a make check at top level, nothing special rekado: davexunit: the r/guile community on Guile is restricted so I can’t post there. Is this on purpose? RhodiumToad: seems to fail consistently in the same place terpri_: dsmith-work, something like this, or is rust cleverer? https://paste.debian.net/1152952/ (that's from gcc -O3, i'm not good at reading amd64 asm though) dsmith-work: terpri_: Like https://paste.debian.net/1152954/ terpri_: clever dsmith-work: Maybe if you swapped the true/false it would be closer dsmith-work: That bitmap is the same I think. dsmith-work: 8800387991553 is 0x80100000801 RhodiumToad: clang generates a bt rather than the shift/and dsmith-work: RhodiumToad: bt ? terpri_: with the true false swap and changing the return type to bool i get: https://paste.debian.net/1152956/ RhodiumToad: bt = bit test terpri_: slightly shorter, but not as concise as the rust asm RhodiumToad: https://godbolt.org/z/hYuitU dsmith-work: I was just amazed at the bitmap in a register. Not used to regs with that many bits. terpri_: ah yes, good old godbolt RhodiumToad: hm. is guile doing its own malloc? RhodiumToad: ugh, it's getting it from libgc, isn't it dsmith-work: A friend of mine challenged me to write that with no branches. (Because of course, you need to respond in sub-nanoseconds after waiting for a keypress) RhodiumToad: bah, trivial with cmov dsmith-work: RhodiumToad: alloca or malloc? (why would it need malloc?) terpri_: RhodiumToad, i don't think so. guile does have a fallback malloc implementation from gnulib though, it seems RhodiumToad: why wouldn't it need malloc? RhodiumToad: libgc provides a GC_malloc dsmith-work: Sorry. I thought you meant someting else. RhodiumToad: hm RhodiumToad: but the code in question seems to be calling the bare libc malloc terpri_: yes dsmith-work: That code allocs and frees right after. No need to get the GC involved. (I assume) RhodiumToad: so the question is why did it fail to allocate a mere 4 megs terpri_: but if malloc fails...SIGSEGV dsmith-work: RhodiumToad: I meant, wny need malloc from gnulib? (not libgc) Is't the c lib malloc good enough? terpri_: dsmith-work, i don't know under which circumstances it would *use* gnulib malloc, just that it exists in the repo (lib/malloc.c) dsmith-work: Hmm. Special cases size 0. RhodiumToad: FAIL: r6rs-ports.test: 8.2.7 Input Ports: custom binary input port position, long offset - arguments: (expected-value 4398046511104 RhodiumToad: actual-value 0) RhodiumToad: wtf is with that dsmith-work: 0x40000000000 terpri_: aha: https://paste.debian.net/1152962/ (from lib/stdlib.in.h) terpri_: i wonder where malloc isn't posix-compliant. maybe ancient *nix systems or windows or something RhodiumToad: that looks like the test is wrong RhodiumToad: hm. no. terpri_: here's the rub, i think: https://pubs.opengroup.org/onlinepubs/9699919799/ "If the size of the space requested is 0, the behavior is implementation-defined: either a null pointer shall be returned, or the behavior shall be as if the size were some non-zero value, except that the behavior is undefined if the returned pointer is used to access an object." terpri_: but on windows: "If the size of the space requested is 0, the behavior is implementation-defined: either a null pointer shall be returned, or the behavior shall be as if the size were some non-zero value, except that the behavior is undefined if the returned pointer is used to access an object." https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/malloc?view=vs-2019 dsmith-work: 0075b7f4dc Ludovic Courtès 2018-07-19 dsmith-work: civodul added that test terpri_: err terpri_: "If size is 0, malloc allocates a zero-length item in the heap and returns a valid pointer to that item." is the windows behavior i meant to quote terpri_: hence its presence in gnulib, i guess dsmith-work: RhodiumToad: So on your system, is that malloc really returning 0? Is there a limit to the amount you can request? RhodiumToad: as far as I can tell it returned 0. I don't know why. terpri_: your system does have more than 4 megs of memory, right? :D RhodiumToad: it's not close to any system limits RhodiumToad: 1GB ram, per-process limit 512MB terpri_: weird RhodiumToad: but I'm looking at another failure now RhodiumToad: something's assuming that (port-position) should truncate to 32 bits dsmith-work: Modern malloc typically uses mmap for largish allocations. RhodiumToad: grr RhodiumToad: this looks like broken largefile idiocy dsmith-work: 32bit or 64bit ? RhodiumToad: typedef long int scm_t_off; idiocy, I say dsmith-work: r6rs and str ports check for base > SCM_T_OFF_MAX, which could be INT64_MAX, INT_MAX, or LONG_MAX. dsmith-work: Depending on ./configure dsmith-work: INT_MAX is 32bits on a bit system? RhodiumToad: what generates scmconfig.h ? dsmith-work: Prob libguile/gen-scmconfig.c RhodiumToad: yeah RhodiumToad: oh nonsense RhodiumToad: #if defined GUILE_USE_64_CALLS && defined HAVE_STAT64 RhodiumToad: idiocy RhodiumToad: no comprehension that platforms exist that don't have idiot largefile breakage RhodiumToad: on freebsd, as with all *BSDs since around the 4.4BSD period, off_t is 64-bits and there are no silly *64 system calls RhodiumToad: that should be checking SIZEOF_OFF_T instead RhodiumToad: lack of largefile breakage is one of my favourite freebsd features :-) dsmith-work: It's been about 19 years since I used fbsd. Really enjoyed how the drivers and man pages and stuff was all in sync. Nice clean code too. dsmith-work: Took me an afternoon to hack up a scsi scanner. dsmith-work: Just visually inspecting the code, all gets seem to have matching ungets. rekado: rebasing guile-emacs on top of Emacs 25 now. It’s not exactly fun, but it’s a great way to get familiar with the changes. RhodiumToad: I can't tell whether what I'm seeing is a debug artifact or is real dsmith-work: RhodiumToad: Could be a wild pointer smashed it. But my reading of the code says it can ony ever be 0 1 (or 2 for arm,aarch64) RhodiumToad: what gdb is telling me is that the _jit is pointing to the wrong place RhodiumToad: ok. that does turn out to be a debug artifact. RhodiumToad: ASSERT(!(im & 0xfbff8f00)); in torri() is where it dies. RhodiumToad: im is 256. RhodiumToad: sigh RhodiumToad: I may have found it RhodiumToad: the nasal demons strike again RhodiumToad: # define rotate_left(v, n) (v << n | v >> (32 - n)) /* spot the problem */ RhodiumToad: tum te tum, waiting for eval.go to compile again rlb: Why does this print bar twice? (define-syntax foo (begin (display "bar\n") (identifier-syntax 1))) justin_smith: rlb: could this be similar to the semantics that make eval-when neccessary? justin_smith: eg. the define-syntax is executed twice when entered at the repl, maybe rlb: Ahh, I suppose that might be it. rlb: Thanks. I'll poke around a bit more. justin_smith: I don't know your actual case, but it might help to consider using eg. a delay to make some side effect only evaluate once rlb: In this case, I want to define a syntax (maybe an identifier syntax) that captures a binding. rlb: Though I still need to think through whether or not that really makes sense here... RhodiumToad: anyone want to bet on whether this compile succeeds? RhodiumToad: (currently 36 minutes into the compile of psyntax-pp) daviid: it will succeed daviid: it make couple of hours on old machines ... RhodiumToad: well that depends on whether my fix for the above bug is correct :-) RhodiumToad: this is on an RPI2b daviid: if your bug fix is a fix and not a bug :):) i bet it will compile RhodiumToad: yawn *: RhodiumToad will leave it compiling :-) minerjoe: I'm hoping this is a channel to just shoot from the hip? minerjoe: I'm new to guile and trying to add it to an existing program. I'm trying to call a function defined in the main program (not a shared library). The symbol is present via "readelf -sW" as GLOBAL DEFAULT, but it is not found via (dynamic-func "foo" (dynamic-link)). Maybe this is not the way to get at a function not dynamically linked into the program? daviid: if i wanted to measure the impact of replacing map by a generic, what would be a good micro benchamrk? dsmith: RhodiumToad: What is your fix? dsmith: RhodiumToad: What problems do you see in that rotate macro? dsmith: The args are unsigned. And single names. And it's for a 32bit arm. dsmith: The one call site loops < 32, so no "overrotate". wingo: greets RhodiumToad: dsmith: the rotate macro has an undefined result when n is 0 RhodiumToad: ok, so after fixing the bug the compile completed wingo: RhodiumToad: wow! wingo: excellent debugging!! wingo: we should have a way to build with ubsan :P RhodiumToad: what I did was add if (v <= 0xFF) return v; and change the loop to start from 2 rather than 0 RhodiumToad: other options would be to use v >> ((32 - n) & 31) or a compiler rotate intrinsic RhodiumToad: did you see my other comment about nonportable use of `date` ? mauritslamers: hey all, I have a question regarding style or best practices. I am writing something in guile within the context of Lilypond. It is not part of the project at all, but it uses the context it gives for additional output. My question is not how to use the Lilypond API, but more on what the best approach is datawise. Lilypond seems to be using mainly assoc lists to keep track of things. Now I am contemplating whether to use assoc-lists as a main mauritslamers: vehicle for storing additional info, or to use object properties. mauritslamers: My own background is mainly JS, so I am used to construct these kinds of systems from a semi-funcitional, semi-OO point of view. RhodiumToad: wingo: I'm going to try a build with clang -fsanitize=undefined :-) wingo: RhodiumToad: saw the comment, didn't look into it *: wingo has v little time lately, for family reasons mauritslamers: Basic task is to retrieve a list of events, parse these events in a certain way, so they create output. The exact output however depends on circumstances (such as previous events and future events). My current approach is to leave everything in a big list of assoc-lists, change values where necessary. But I am wondering whether I should use object properties instead to keep track of these extra settings, and what the advantages are of object mauritslamers: properties vs assoc lists RhodiumToad: assoc lists don't perform especially well, imo wingo: assoc lists are fine if there are few elements in them tho janneke: RhodiumToad: there used to be a ... yeah "it depends", last time i looked it was ~100 elements wingo: basically i would use either alists or hash tables. object properties use weak hash tables underneath, which is good if you know you don't want to keep the object alive mauritslamers: The easiest for me would be to use object properties, it would lead to me writing something that essentially would be JS but with a Scheme syntax :) wingo: but hash tables can be iterated over wingo: hehe wingo: yeah, sorry, no concrete guidance here ;) mauritslamers: In JS I have the certainty that when I change an object, I will always keep the pointer (reference) to that object. I gathered from the docs that this guarantee doesn't hold with assoc-set! mauritslamers: as in: when assoc-set! is used on a list while setting a new key, you get a different reference (pointer) back. mauritslamers: wingo: no worries, it is more curiosity about what would be the more scheme way of doing things instead of JS. wingo: yeah, can be interesting experimenting with different ways of writing a program, whether you build up a mapping in a functional way, or whether you use a more place-oriented approach of stuffing new associations in a hash table or whatever mauritslamers: The biggest issue is that I might have to reverse course somewhere in the program. This big list of events consists of multiple streams (musical staffs to be exact). In most of the situations everything of importance stays within a single staff, but there are situations where I suddenly need to access info on a different staff, ie different stream. mauritslamers: So, technically i could split it up in as many lists as there are staffs and process each list individually mauritslamers: It would cause issues though when it turns out I do need info from a different staff. mauritslamers: The functional way would be to split it up, and return parsed lists for each staff mauritslamers: The JS or OO way would be to leave it as a single list, filter it out per staff, and adjust settings, but that works on the assumption that the pointers / references to these list items would not change. *: RhodiumToad not sure that there is a "the" functional way RhodiumToad: now bootstrapping eval.go with -fsanitize=undefined RhodiumToad: let's see if this works. chrislck: hola! chrislck: What level schemer are you? chrislck: 1. I'm a pythonista. I like my for loops. chrislck: 2. I'm scheme-curious. What's all this about cons car cdr? chrislck: 3. Wow. I love srfi-1! chrislck: 4. macros? WTH is this supposed to work chrislck: 5. Holy amaze-balls! I love named let. chrislck: 6. srfi-1 can kiss my ass, ice-9 match ftw RhodiumToad: well, -fsanitize=undefined has made the compiler a hell of a lot slower RhodiumToad: used to take 30 mins to compile eval.go, it's now on 49 minutes and not done yet mauritslamers: chrislck: if you were talking to me: not really on that scale. I know about macros, I know what they do. So conceptually I sort of know the roots of the language but I simply do not have the experience of designing with it mauritslamers: So for me the question above is mainly about how I can "prevent" myself to starting writing JS in scheme syntax :) mauritslamers: What I have seen so far with Guile is that using assoc lists and writing functions to change things very much resembles the way C deals with objects: structs to hold the data, methods/functions/procedures to change things on that struct. RhodiumToad: what kinds of objects are you referring to? mauritslamers: C has structs to keep data, and uses externally defined functions / methods to change data inside structs of that type mauritslamers: Thinking about this a bit longer I think my question is mainly how to deal with state and state changes in scheme RhodiumToad: records in scheme are like C structs. goops objects are more... objecty mauritslamers: and whether that is different from language x mauritslamers: important for me at this moment is also that what I write has to work with a very old version of guile (1.8.2), as it runs as part of Lilypond 2.14 RhodiumToad: ah mauritslamers: and it is a bit complex for me to figure out what is supported there exactly. chrislck: maybe you can be the driving force to move on to guile-2.2 :) RhodiumToad: or even guile-3 mauritslamers: Let me spill all the beans, that will make it easier :) mauritslamers: I am working on music braille support for Lilypond, not as part of the Lilypond project. mauritslamers: The music basis of it atm is the song bundle of the dutch protestant churches, of which a new version has been made using Lilypond 2.14 chrislck: are you the mauritslamers who hangs in #gnucash too? mauritslamers: yes :) mauritslamers: because of many reasons, not in the least that I am the one and only dev on this project, it is not possible timewise to convert either Lilypond guile to something more recent, or to try to convert that song bundle to a more recent Lilypond version. mauritslamers: chrislck: now you mention it I recognize your nick :) mauritslamers: and IIRC RhodiumToad also frequents #postgresql? mauritslamers: That nick is also very familiar at least :) mauritslamers: anyway: I have already written something that does at least a partial braille conversion, but I am now redesigning and refactoring because of the limitations of the current implementation. mauritslamers: So I am mostly trying to figure out how to design this in a way that it works as fluent as possible within guile, instead of trying to imprint the semantics and methods of different language on this. mauritslamers: What I find perhaps the most complex is how to do list navigation: I am parsing a list and I need to walk backwards and forwards in that list in order mauritslamers: to figure out the context of the item I am currently processing mauritslamers: in JS I would use an array and indexes, and use properties on objects to keep the context data on, and create a method to render the required braille for that object mauritslamers: But that doesn't really work that way in scheme chrislck: use for-each, or preferably named let chrislck: scheme lists are not designed for random access mauritslamers: would vectors be a solution there? chrislck: yes, but as usual, it depends. how often you expect to access elements randomly? chrislck: best pastebin your snippet mauritslamers: Hmm, I don't see how I can make this into a pasteable snippet: Lilypond creates events, and from these events I create a list (currently) of all events. In that list I expect to access elements randomly a lot, as well as filter them based on different properties or settings. mauritslamers: what I have been doing now is using for-each, and then through a closure keep track of the previousNoteEvent or previousEvent mauritslamers: which are changed through set! chrislck: as usual, "it depends" chrislck: TMTOWTDI dsmith: RhodiumToad: "<< 0" Should be fine, So ">> (32-0)" is undefined behavior? RhodiumToad: if x is a 32-bit type, x >> 32 is undefined dsmith: RhodiumToad: What bug was this? RhodiumToad: this shows up when doing jit on arm, it's in lightening/arm-cpu.c dsmith: Right. Wondering if its the "random" segfaults I'm seeing. RhodiumToad: for me the result was that it would work apparently fine up to language/cps/compile-bytecode.go and then abort on that dsmith: Consistently? RhodiumToad: yes dsmith: Ah dsmith: So that's probably clang-specfic? RhodiumToad: well it's undefined behavior in any compiler RhodiumToad: the specific way in which the undefined behavior manifests itself can vary, of course dsmith: Yes RhodiumToad: generating bad jitted code is certainly possible RhodiumToad: anyway, you could try fixing it and testing again on arm, see what happens? dsmith: Yes definitely RhodiumToad: my sanitize=undefined build has ground its way through psyntax-pp successfully and is now working through the other files RhodiumToad: it's at least 2x slower than normal rekado: rebased 25 of 159 commits for guile-emacs rekado: lots of them are really big commits rekado: this is going to take a while… civodul: fearless rekado strikes again! :-) dsmith-work: Thursday Greetings, Guilers dsmith-work: RhodiumToad: Nope. Still fails for me. RhodiumToad: huh. chrislck: mauritslamers: nothing beats looking at your code directly RhodiumToad: fails how exactly, and what exact sequence of events? dsmith-work: running the test-language in isolation repeatedly until segfault. dsmith-work: with the jit threshold at 0 dsmith-work: while GUILE_JIT_THRESHOLD=0 make TESTS=test-language check-TESTS; do :;done dsmith-work: One kind of failure: dsmith-work: (gdb) bt dsmith-work: #0 0x76f505cc in scm_is_string (x=0x0) at strings.h:293 dsmith-work: #1 scm_string_to_symbol (string=0x0) at symbols.c:361 dsmith-work: #2 0x722df4cc in ?? () dsmith-work: Backtrace stopped: previous frame identical to this frame (corrupt stack?) RhodiumToad: ok. I'll try that when this build is done. dsmith-work: And I've been running gdb like this: dsmith-work: ../../meta/uninstalled-env ../../libtool --mode=execute gdb ../../libguile/guile core dsmith-work: From the test-suite/standalone dir dsmith-work: jit_new_state takes an allocation and a free function. dsmith-work: Called with an allocate that is scm_gc_malloc dsmith-work: The free funcion is a nop. dsmith-work: Would it be better to use scm_gc_free ? RhodiumToad: presumably there's a reason not to *: RhodiumToad hasn't dug into the code much yet rekado: I see no stable-3.0 branch. Is that role taken by the master branch? civodul: yes civodul: dsmith-work: you're seeing that with master on ARMv7? dsmith-work: Yes dsmith-work: Well, v3.0.2-141-g2e2e13c40 civodul: ouch, so we're not done yet there civodul: i never hit that though, weird dsmith-work: Does not happen every run. dsmith-work: So... dsmith-work: location specfic? Using uninitialized memory? dsmith-work: jit threshold=0 dsmith-work: Never happens without the jit. So something arm jit specific. dsmith-work: So is there any advantage to calling scm_gc_free()? (I'm thinking yes) RhodiumToad: gmake[2]: *** [Makefile:2279: ice-9/and-let-star.go] Segmentation fault (core dumped) RhodiumToad: looks like it's in generated code RhodiumToad: => 0x22ba90a8: ldrt r5, [r12] RhodiumToad: r12 is 0 RhodiumToad: in fact, RhodiumToad: 0x22ba90a4: mov.w r12, #0 RhodiumToad: no useful backtrace dsmith-work: So does that look like bad generated code? RhodiumToad: this one looks like it is not completely reproducible RhodiumToad: well, hard to say. RhodiumToad: hm. dsmith-work: Does a disassm of the surrounding code look reasonable? RhodiumToad: the disasm of _that_ code doesn't look reasonable. RhodiumToad: why ldrt? dsmith-work: Maybe look at it as thumb code instead? RhodiumToad: I wonder if this is some confusion over arm vs. thumb mode RhodiumToad: how do I convince gdb to do that? I've not used it much on arm, yet *: dsmith-work looks for his notes... dsmith-work: set arm force-mode thumb dsmith-work: disassemble /r justin_smith: out of context, "set arm force-mode thumb" is funny RhodiumToad: weird. RhodiumToad: so it was showing it as thumb-mode code before RhodiumToad: and it obviously is, because in arm mode it's garbage dsmith-work: The jit builds thumb code. RhodiumToad: cpsr bit 5 is 1, so I guess we are in fact in thumb mode. dsmith-work: That bug monster arm-jit patch handled all the arm->thumb and thumb->arm jump. Including when jumping through a "veneer". (branch to a close by jump to far away code) RhodiumToad: so. the fact that it loads a constant 0 into r12 and then immediately uses it as a pointer does suggest bad code generation. but it's not clear why it doesn't happen predictably RhodiumToad: and why is it ldrt? dsmith-work: Yeah. A quick search says it's for os calls or something. dsmith-work: Also, thumb has limited registers. (they are all still there, you only get 3 bits in the opcode to specify them instead of 4 bits in arm mode) dsmith-work: Is 12 a valid register in thumb? dsmith-work: Must be, or it wouldn't disassemble. dsmith-work: What's the actual opcodes for that "ldrt r5, [r12]" RhodiumToad: => 0x22ba90a8: 5c f8 00 5e ldrt r5, [r12] RhodiumToad: wonder if gdb is decoding this correctly dsmith-work: Try starting by += 2 bytes from there. dsmith-work: Alsom little endian, so the opcode is 0x5e00 0xf85c ? RhodiumToad: little endian, yes dsmith-work: I need to get gnus working. The web interface for my old email is totally hozed. RhodiumToad: I think the 0xf85c is the first halfword and 0x5e00 the second. RhodiumToad: and the reference manual does say that decodes to ldrt r5,[r12] dsmith-work: Ok. RhodiumToad: #define jit_ldrt_strt_p() 0 RhodiumToad: and there are lots of if (jit_ldrt_strt_p() && ...) RhodiumToad: seems very weird dsmith-work: Like some temp code to be filled in later? dsmith-work: if (jit_ldrt_strt_p() && i0 >= 0 && i0 <= 255) dsmith-work: T2_LDRSBI(_jit, r0, r1, i0); dsmith-work: So right now, code like that *NEVER* takes the branch. dsmith-work: wingo: Got any comments on that? dsmith-work: Could that be the torri12() function generating that? RhodiumToad: shouldn't be. RhodiumToad: I think the only way it should get that is T_LDRI RhodiumToad: oops RhodiumToad: T2_LDRI RhodiumToad: THUMB2_LDRI is 0xf8500c00 and THUMB2_U is 0x00000200, so OR those and get 0xf850 0e00 RhodiumToad: then fill in register numbers 12 and 5 and immediate 0, and get 0xf85c 5e00 dsmith-work: Yes RhodiumToad: from context, I think this is an ldi_i RhodiumToad: so something called ldi_i(_jit, 5, 0) dsmith-work: Same thing here https://issues.guix.gnu.org/issue/39208 dsmith-work: Or is that what you are working from? RhodiumToad: no, different place here and not reproducible dsmith-work: This looks similar: dsmith-work: 0xf5c43c9e: str r5, [r0, #16] dsmith-work: 0xf5c43ca0: mov.w r12, #0 dsmith-work: => 0xf5c43ca4: ldrt r5, [r12] dsmith-work: 0xf5c43ca8: str r5, [r0, #8] RhodiumToad: yes, that's probably also an ldi_i RhodiumToad: having it not be reproducible is a problem dsmith-work: Hmm. Maybe it's just because ldi_i() called trying to deref 0, and the real problem is somewhere else. RhodiumToad: ldi_i being called at all with a last parameter of 0 indicates a problem, I think RhodiumToad: if it were reproducible I would be setting a breakpoint for that dsmith-work: The segfaults I see are usually some SCM being 0. dsmith-work: Like scm_is_string (x=0x0) dsmith-work: That brings me back to something is overwriting something somewhere. RhodiumToad: are you building with or without threads? dsmith-work: The default ./configure, so with. dsmith-work: RhodiumToad: Good idea dsmith-work: RhodiumToad: There are couple of <<32 in hash.c that causes warnings in my compiler. RhodiumToad: yeah. but I think those are harmless because they're under conditionals that are false when the value being shifted is 32 bits. RhodiumToad: bad style, but probably not actual bugs dsmith-work: Does this memset look like a noop? dsmith-work: pool->size = 0; dsmith-work: memset(pool->entries, 0, sizeof(pool->entries[0]) * pool->size); dsmith-work: In reset_literal_pool() in lightening.c dsmith-work: Should that be pool->capacity instead? RhodiumToad: hm, that does look odd dsmith-work: The alloc_* just below allocates capacity entries. RhodiumToad: question is whether anything cares about the content beyond pool->size dsmith-work: However, this is common code to all arches. dsmith-work: On the other hand, it is within #ifdef JIT_NEEDS_LITERAL_POOL, which is only for arm and aarch64 RhodiumToad: I don't see anything that accesses beyond pool->size so I think it's harmless RhodiumToad: bicbw dsmith-work: Another thing I'm suspicious of is the constants in literal_pool_byte_size dsmith-work: Harmless but also useless. dsmith-work: Seems there was an intent to clear the thing. dsmith-work: So. configured --without-threads. dsmith-work: make check had one failure. Not sure where just yet dsmith-work: All the standalone tests passed. dsmith-work: FAIL: popen.test: open-output-pipe: no duplicate dsmith-work: dsmith-work: With threshold=0 got one standalone fail. FAIL: test-use-srfi dsmith-work: Second run ran all standalone checks dsmith-work: And again the popen test fails. But that might be due to no threads. dsmith-work: Nope. Still getting some failures. dsmith-work: Changed that memset to use capacity instead. dsmith-work: No failures so far. dsmith-work: sneek: later ask wingo: So is there any advantage to calling scm_gc_free() in jit_free_fn() ? sneek: Got it. dsmith-work: Nope. Still segfaults. (kind of expected it would) mauritslamers: @chrislck: https://gist.github.com/mauritslamers/65b0c8f59e48ba848d71fce8750de8c3 mauritslamers: To me it feels like this could be done differently, but I don't know really how. Problem is mainly all the state variables that I need to keep around, and that define what needs to happen next. RhodiumToad: dsmith-work: I'm running standalone text without threads, and no failure yet after 10 runs dsmith-work: Is GUILE_JIT_THRESHOLD=0 ? RhodiumToad: y dsmith-work: Sounds good. dsmith-work: Note that I've had it fail after 12. dsmith-work: It it runs for 50 or so it's probably fixed RhodiumToad: except I didn't fix anything :-( dsmith-work: heh roelj: Is there a convenient way to see what is using how much memory in a Guile program? dsmith-work: RhodiumToad: I can eventually get a core dump from this: dsmith-work: while GUILE_JIT_THRESHOLD=0 ./meta/guile < /dev/null; do : ; done justin_smith: roelj: having done such profiling in other lisps, even when it's possible there's a gotcha that you can use "cons" in ways that lead to the same spine being used in many places, as the tail of multiple lists justin_smith: so even when you have a global view of all allocated memory, making sense of it requires application analysis RhodiumToad: dsmith-work: is this on a platform with ASLR? if so, have you tried disabling it? dsmith-work: RhodiumToad: What is ASLR ? RhodiumToad: address space layout randomization roelj: justin_smith: Well, I'd like to see what it looks like.. :) dsmith-work: Ah civodul: roelj: there's no heap profiler, unfortunately, but there's gcprof in (statprof) civodul: that shows you which parts of your code spend the most time allocating memory civodul: which is not exactly what you want, but can already be useful roelj: civodul: Thanks! It's going to be interesting to read anyway dsmith-work: RhodiumToad: Prob was enabled. Trying with it disabled. dsmith-work: RhodiumToad: That seems to have allowed guile < /dev/null to no longer segfault. RhodiumToad: interesting. RhodiumToad: what about other tests? dsmith-work: Running them now dsmith-work: Nope. Got a segfault. dsmith-work: Running 00-initial-env.test dsmith-work: Same story. Corrupt stack. dsmith-work: #1 0x76f556c0 in scm_i_string_ref (str=, x=478720) at strings.c:668 dsmith-work: that x looks really wonky RhodiumToad: is it reproducible now, or still random? dsmith-work: make check failed at the same place. dsmith-work: I didn't save the core. dsmith-work: Yep dsmith-work: Identical backtraces dsmith-work: Well that's nice. dsmith-work: So. dsmith-work: What kind of bug would be address space dependant? dsmith-work: That probably includes mmap'ed memory allocation? dsmith-work: Why should the code care? dsmith-work: Unless it's acting on something uninitallized? dsmith-work: Of course, running that single test by hand has no failure. dsmith-work: civodul: Wasn't there some problem with some arch that needed some extra stack space? dsmith-work: Maybe it was windows? RhodiumToad: windows has a stack size set at link time and doesn't behave very nicely if you exceed it RhodiumToad: that's not the problem here dsmith-work: The thing I was thinking was like some reserved padding, before or after the stack. RhodiumToad: this is weird, I turned on some address randomization options on freebsd and tried the ) at strings.c:548 dsmith-work: Useful bt ? RhodiumToad: valid backtrace up to scm_i_str2symbol, which seems to have been called from jitted code and the stack isn't readable from there RhodiumToad: I think there's no way to get a valid backtrace through jitted code, because it's not conforming to the conventions that allow tracing dsmith-work: Hmm. dsmith-work: freebsd on arm? RhodiumToad: the option I turned on doesn't actually randomize the program load address, it only makes mmap() calls more random in the addresses they choose RhodiumToad: (might affect where shared libs get loaded I guess) RhodiumToad: freebsd 12-stable (not very recent, few months maybe), armv7 (compiled for cortex-A7), rpi2b RhodiumToad: ldr r0, [r0] and r0 = 0x0 dsmith-work: Maybe the stack isn't being overwritten. Maybe some return code is popping the wrong values and loading a stack that's just something else entirely. dsmith-work: setting threshold to 0 seems to enhance the effect dsmith-work: Ah dsmith-work: wingo had a suggestion. There is a var that stops jitting after a count. Need to bisect the count. dsmith-work: I currently don't have an always fails single test dsmith-work: GUILE_JIT_STOP_AFTER dsmith-work: wingo: currnet master (has arm patch) compiled and build just fone on a stock rasbian buster rpi. dsmith-work: Probably was using the new compiler instead of jit? dsmith-work: I mean, with the new compiler, is the jit still used as heavily? dsmith-work: However, seems to be stuck n srfi-18.test dsmith-work: Running again. All tests pass. dsmith-work: Not with JIT_THRESHOLD=0 though. dsmith-work: Fails at different places on repeated runs too. dsmith-work: So, how do I just run say, "test-language" dsmith-work: Like this? ./meta/uninstalled-env test-suite/standalone/test-language dsmith-work: Hmm. Can't find q.scm when I do that. mwette: maybe meta/guile test-suite/standalone/test-language dsmith-work: test-suite/standalone/test-language is a shell script. mwette: oh mwette: are you trying to run the srfi-18 test? dsmith-work: No. It's failing earlier in the "standalone" tests. dsmith-work: With JIT_THRESHOLD=0 dsmith-work: mwette: to recap, first "make check" hung on the srfi-18 test. Second "make check" finsihed with no errors. dsmith-work: GUILE_JIT_THRESHOLD=0 make check has several failures in the "standalone" tests. dsmith-work: And not always the same tests fail. dsmith-work: So I wanted to just run one of the failing tests. dsmith-work: test-language was one. dsmith-work: But I can't seem to run it at all. dsmith-work: regardless of the jit threshold dsmith-work: And this on and armv7 rpi3 mwette: Yea, trying to narrow down is what I'd do. mwette: Are you building in the source dir or in separate build dir? dsmith-work: In source dsmith-work: And here is what makes it hard. "GUILE_JIT_THRESHOLD=0 ./meta/guile" worked 11 times and filed with a segfault on the 12th. mwette: that's a tough one mwette: I can execute the contents of test-language one at a time: meta/guile -c "(exit (= 3 (apply + '(1 2))))" --language=elisp mwette: but I think that may be pulling modules from already installed stuff. mwette: $ meta/guile -c '(display %guile-build-info) (newline)' mwette: ((buildstamp . 2020-06-17 02:09:19) (CFLAGS . -pthread) (LIBS . -lcrypt -lm) (libguileinterface . 2:1:1) (guileversion . 3.0.2.139-3c32) (extensiondir . /opt/local/lib/guile/3.0/extensions) (pkgincludedir . /opt/local/include/guile) (pkglibdir . /opt/local/lib/guile) (pkgdatadir . /opt/local/share/guile) (includedir . /opt/local/include) (mandir . /opt/local/share/man) (infodir . /opt/local/share/info) (ccachedir mwette: . /opt/local/lib/guile/3.0/ccache) (libdir . /opt/local/lib) (localstatedir . /opt/local/var) (sharedstatedir . /opt/local/com) (sysconfdir . /opt/local/etc) (datadir . /opt/local/share) (libexecdir . /opt/local/libexec) (sbindir . /opt/local/sbin) (bindir . /opt/local/bin) (exec_prefix . /opt/local) (prefix . /opt/local) (top_srcdir . /home/mwette/repo/sv/guile) (srcdir . /home/mwette/repo/sv/guile/libguile)) mwette: mwette: so now I see why meta/uninstalled-env mwette: $ meta/build-env guile -c '(display %load-path) (newline)' => build dirs dsmith-work: So some env isn't getting set right I think. dsmith-work: ./meta/build-env sh -x test-suite/standalone/test-language dsmith-work: The falure is at dsmith-work: + guile --no-auto-compile -l /module/ice-9/q.scm -c 1 dsmith-work: ;;; Stat of /module/ice-9/q.scm failed: dsmith-work: ;;; In procedure stat: No such file or directory: "/module/ice-9/q.scm" dsmith-work: That "/module/ice-9/q.scm" doesn't look right. dsmith-work: The script has -l "$top_srcdir/module/ice-9/q.scm" dsmith-work: So $top_srcdir isn't set. dsmith-work: It's set, but not exported mwette: something else too; I added export top_srcdir and top_builddir but then get error wrt "/test-language.el" : No such file mwette: added to meta/build-env ; then ran meta/build-env .../test-langauge mwette: this is super-hack to debug; but adding srcdir=$top_srcdir/test-suite/standlone export srcdir to meta/build-env; then it works mwette: the Makefile in standalone/ sets srcdir for the script mwette: dsmith-work: cd test-suite/standalone; make TESTS=test-language check-TESTS dsmith-work: Ahh. dsmith-work: mwette: Thanks muchly. dsmith-work: Ok, for that particular test, I can't get it to fail when run on it's own. dsmith-work: When run from make check, it seems to fail about 70-80 % dsmith-work: (with the jit threshold set to 0) dsmith-work: Ah well. Too sleepy to look any more mwette: sneek: later tell dsmith-work maybe the system needs to be loaded to stress memory or filesystem sneek: Okay. tohoyn: sneek, botsnack sneek: :) rekado: I think I found one of the bigger problems in wip-elisp rekado: an earlier rebase in 2016 of the commit “intern arbitrary constants” introduced two copies of compile-bytecode rekado: it may not matter much in this case, but perhaps there are more rebase errors on wip-elisp rekado: bah, this is confusing. rekado: in one of the commits for interning arbitrary constants a new “to-file?” field was added to “make-assembler”, but it is always #t, so none of the conditional code that checks the field ever runs rekado: when building Guile from source, can I bypass the bootstrap and use the fast Guile that is already installed on my system? wingo: rekado: i am not precisely sure when that is possible, to GUILE_FOR_BUILD using a Guile not of the same version wingo: i guess that during a stable series, the issue would be that the .go file you have loaded for module MOD may differ from the .scm file that you are compiling for MOD, and that some private detail from the different versions may differ in an incompatible way wingo: but i don't know when precisely there would be problems wingo: maybe there is no issue manumanumanu: ahoy hoy! manumanumanu: Is there a reason why predicates like integer? doesn't return the integer it tests? I mean, I understand that the standard says it should, but having them return the tested value (if truthy) would be great for cond => clauses and would make all predicates composable wingo: fwiw you can get similar effects with `match` wingo: e.g. `(match (foo) ((? integer? x) x))` manumanumanu: wingo: but you still don't have composability. I'm rolling my own, mostly to test my emacs text editing ability. Managed to get a list of all predicates from the procedure index in under one minute, half of which my poor poor computer was chugging through emacs macros :H wingo: yeah, but it is a consistent point on the design space :) janneke: manumanumanu: yeah, having pair? return the list be "handy" wingo: procedure ends with ? -> it returns a boolean manumanumanu: sure, but since we only have one false value, returning a truthy value would be just fine janneke: i've been using non-idiomic "pair??" and "number??" functions a lot...but all that code is not generally usable, so i stopped doing it wingo: we have three false values, depending on which predicate you are looking for :) wingo: #nil, #f, '() manumanumanu: #f #nil and? manumanumanu: oh wingo: false in elisp wingo: honestly i don't use pair? any more at all; all hail match manumanumanu: janneke: anyway, I'm creating a modules called composable-predicates that returns the tested value if true. I doubt I'll use it for other things than the repl janneke: manumanumanu: ah, yes for the repl that could be nice janneke: wingo: hmm, that's one area where guile is no match for mes janneke: eh, mes is no match for guile manumanumanu: janneke: the only problem is I am starting to get used to my repl niceness :D I have found myself writing my lambda shorthand in code so many times #%(let ((a (abs %1))) (/ a %2)) => (lambda (%1 %2) ...). and I have started to feel tempted to use my for loops more than once. janneke: for loops? you must be kidding? *: janneke hates off-by-one errors caused by not filter-mapping with a passion janneke: it's one of the things that initiated my moving away from python manumanumanu: janneke: they are racket-styled ones. I did a rewrite. They are really just syntactic sugar for a named-let (mostly) left fold manumanumanu: (for/list ((i (in-naturals)) (e (in-list lst)) (cons i e)) => '((0 . e0) (1 . e1) ...) manumanumanu: generic and extensible and I haven't found a case where the code isn't as good as a named let. janneke: manumanumanu: ah, i don't know racket; suppose it's a matter of taste, experience, or perhaps cranal wiring manumanumanu: https://hg.sr.ht/~bjoli/guile-for-loops *: janneke 's head is wired better for (map cons '(e0 e1) (iota (length '(e0 e1)))) janneke: i suppose the computer doesn't care all that much manumanumanu: janneke: sure. I write most my code like that as well. The for-loops are generic, though. You can do (in-string ...) and (in-generator ...). I could add an (in-file ...) although that would have about 10% overehad manumanumanu: and since it is really just a fold, there are many variants: for/sum, for/foldr, for/and etc. manumanumanu: in fact, all loops are just syntactic sugar for for/fold and for/foldr (the latter is only used for for/stream, but could be used to make for/list be non-tail recursive like guile's map). manumanumanu: But now I see I never added for/hash(q,v) :D *: RhodiumToad isn't really a fan of looping constructs that try to be too generic manumanumanu: RhodiumToad: "too generic" is pretty broad. I decided to not implement arbitrary transformation support, but i suspect your limit comes earlier :D manumanumanu: RhodiumToad: I am somewhat curious. What are your objections? My for loops aren't generic in that they blindly accept any sequence. You have to specify (in-list ...) etc except for literals. I believe there is a benefit to having a unified syntax for iterating over sequences, especially once you otehrwise would have used costly combinations of (map blah (filter blah (zip blah lst lst2))) civodul: hmm the backtrace i reported for i686 at https://paste.debian.net/1152366/ persists civodul: after rebuilding bootstrap/* prebuilt/* civodul: it's really the prebuilt .go files that cause problems civodul: because building from a fresh checkout is ok dsmith-work: Wednesday Greetings, Guilers sneek: Welcome back dsmith-work, you have 1 message! sneek: dsmith-work, mwette says: maybe the system needs to be loaded to stress memory or filesystem dsmith-work: mwette: So with repeated runs, ran 5 times no error, failed on 6th. dsmith-work: like: dsmith-work: while GUILE_JIT_THRESHOLD=0 make TESTS=test-language check-TESTS; do :;done civodul: hmm bisect points at cb8cabe85f535542ac4fcb165d89722500e42653 but i'm skeptical mwette: dsmith-work: Is that more-or-less repeatable? If you start a big compile job in the background, then how many times? chrislck: if there's talk of augmentin integer? and pair?, how about augmenting and=> too to accept multiple procs - https://paste.debian.net/1152476/ mwette: bad memory? dsmith-work: mwette: Probably not. I hope not! mwette: maybe add: guile -c '(use-modules (system foreign)) (display (scm->pointer (lambda () #t))) (newline)' and see if there is pattern? Just throwing out ideas here. dsmith-work: The addresses of the jit code does change from run to run, at least it did some weeks ago when I started looking into this. dsmith-work: So I have a nice core file. Can't seem to get gdb to use it with meta/gdb-uninstalled-guile dsmith-work: Doh! Cause it's a shell script! dsmith-work: Ahh, that script is running gdb with --args dsmith-work: ../../meta/uninstalled-env ../../libtool --mode=execute gdb ../../libguile/guile core dsmith-work: Program terminated with signal SIGSEGV, Segmentation fault. dsmith-work: #0 0x76e965cc in scm_is_string (x=0x0) at strings.h:293 dsmith-work: Having a SCM be NULL is "not good". dsmith-work: Ok, another segfault. Totoally different location. dsmith-work: Both backtraces suggest corrupt stack mwette: dsmith-work: good luck! -- gotta go now dsmith-work: Is it normal for __pthread_cond_wait to have mutex=0x0 ? RhodiumToad: no dustyweb: hi #guile dustyweb: ! civodul: howdy dustyweb! dustyweb: civodul: how goes the hacks? civodul: good! civodul: though i was hoping to release 3.0.3 and found an issue with pre-built .go files civodul: & you? civodul: do we have CapTP for Guile yet? :-) rekado: bah, I know too little to make sense of Guile Emacs crashes rekado: I now get segfaults right away, during the Guile Emacs build rekado: 0x00000000005f4385 in calloc (nmemb=, size=size@entry=1) at gmalloc.c:1510 rekado: a backtrace isn’t helpful; it just indicates that calloc is called in a loop civodul: does Emacs define its own calloc or something? RhodiumToad: it might. emacs is a bit weird about memory civodul: yeah dsmith-work: What I'm seeing had got to be some kind of stack overwriting I think. dsmith-work: Hey. That reminds me. Saw some warnings fly past. About int and pointer not the same size. RhodiumToad: what are you building? dsmith-work: RhodiumToad: Guile RhodiumToad: on arm? RhodiumToad: I can have a look if you like dsmith-work: Sorry don't have a log dsmith-work: Now rebuilding on 32bit intel dsmith-work: vm-engine.c: In function 'vm_regular_engine': dsmith-work: ../libguile/scm.h:176:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] dsmith-work: # define SCM_PACK(x) ((SCM) (x)) dsmith-work: ^ dsmith-work: Like that RhodiumToad: hm RhodiumToad: what version exactly are you compiling? dsmith-work: v3.0.2-141-g2e2e13c40 dsmith-work: Current master dsmith-work: RhodiumToad: https://paste.debian.net/1152510/ RhodiumToad: well those are obvious bugs RhodiumToad: some of them, anyway RhodiumToad: hm RhodiumToad: so the hash things look harmless but the compiler can't really prove that RhodiumToad: the others... hard to tell from the code *: RhodiumToad tries a build civodul: dsmith-work: i noticed those warnings on i686 but apparently the issue has always been there civodul: looks fishy tho *: RhodiumToad still waiting for configure, it takes a while on the raspberry pi *: RhodiumToad checks that the turbo setting is indeed on rekado: civodul: yes, calloc is defined in src/gmalloc.c civodul: so it might be ELF shenanigans civodul: does it use the old glibc malloc hooks? civodul: well dunno, just vague ideas civodul: dsmith-work: if you have time, could you try "make dist" on x86_64 and then build from that tarball on 32-bit Intel? RhodiumToad: date: illegal time format RhodiumToad: echo ' { "buildstamp", "'`date -u +'%Y-%m-%d %T' -d @$$BUILD_DATE`'" }, \' >> libpath.tmp <== non-portable use of `date` RhodiumToad: bleh. compile failed RhodiumToad: ld: error: ./.libs/libguile-3.0.so: undefined reference to GC_get_suspend_signal [and 3 more] RhodiumToad: bah RhodiumToad: missed a configure option RhodiumToad: tum te tum, I think this is going to take "a while" RhodiumToad: BOOTSTRAP GUILEC ice-9/eval.go -- 21 minutes and counting dsmith-work: civodul: Sure. Building now. dsmith-work: RhodiumToad: Yes. Takes. A. While. RhodiumToad: well it's 6 minutes into psyntax-pp.go now RhodiumToad: unfortunately, it seems to be limited to one thread dsmith-work: Shouldn't those ptr<->int casts be going through uintptr_t ? RhodiumToad: wouldn't really help, I think RhodiumToad: however, it looks like I get different warnings than you do. dsmith-work: Probably compiler differnces RhodiumToad: yes. RhodiumToad: (I'm using clang) dsmith-work: Also, that was from x86, not armv7 RhodiumToad: ah dsmith-work: but still 32bit dsmith-work: Buils faster. dsmith-work: Like that joke about the guy looking for his keys in kitchen, but lost them in the basement, because the light was better there. RhodiumToad: hm, at least it's using more threads now *: RhodiumToad checks cpu temp dsmith-work: Erh? dsmith-work: Hadn't thought of that. dsmith-work: Could the poor little thing be just overheating and having fits? RhodiumToad: unlikely dsmith-work: Agreed dsmith-work: Sure would be nice to have that rewindable syscall thingy civodul used. dsmith-work: But it's Intel only. dsmith-work: civodul: make dist completed. Now building on 32bit box dsmith-work: civodul: look familar: dsmith-work: ice-9/boot-9.scm:1669:16: In procedure raise-exception: dsmith-work: In procedure bytevector-u32-native-set!: Argument 3 out of range: 654452552 dsmith-work: Makefile:1927: recipe for target 'ice-9/eval.go' failed RhodiumToad: dsmith-work: just so I can try and reproduce, what's the exact sequence of things you're doing? dsmith-work: On 64bit: ./autogen.sh && ./configure && nice make -j5 && nice make dist dsmith-work: On 32bit: ./configure && nice make dsmith-work: After copying over a tarball and unpacking it civodul: dsmith-work: ah ha! civodul: we have something civodul: thanks for testing! dsmith-work: Yes? civodul: i've been looking at it but it's tricky because there's one level of indirection dsmith-work: BTW: that number 654452552 is the same. 0x27022748 RhodiumToad: so the issue is with bytecode built on 64bit and then run on 32bit? dsmith-work: It looked like it might be part of a string at first. dsmith-work: RhodiumToad: Yes. dsmith-work: civodul: What do you have? civodul: dsmith-work: i just meant that you've been able to reproduce the bug, so it's real civodul: very real civodul: so yes, the issue seems to be with bytecode built on 64-bit civodul: thing is, .go files in prebuilt/ are built with -O2, not with the new compiler civodul: so in theory, that hasn't changed civodul: "rm prebuilt/32-bit-little-endian/system/vm/assembler.go" allows it to proceed dsmith-work: So should these prebuilt go file be reproducible? dsmith-work: I mean, should not matter if make dist is run on 32bit or 64bit, the go files should be the same. dsmith-work: (for the 4 cases {big,little}{32,64} civodul: yes civodul: another interesting issue: in the tarball, there are no symlinks under prebuilt/ civodul: whereas in the repo there's 32-bit-little-endian -> i686... RhodiumToad: gmake[2]: *** [Makefile:2279: language/cps/compile-bytecode.go] Abort trap (core dumped) RhodiumToad: #3 0x20145048 in subxi (_jit=0xbfbfd790, r0=6, r1=0, i0=) at ./lightening/lightening/lightening.c:309 RhodiumToad: that doesn't look right rekado: there have been lots of changes to src/gmalloc.c, so I’ll just have to rebase the guile-emacs changes to a newer version of Emacs. civodul: uh RhodiumToad: yeesh, so many macros I can't even figure out where this is RhodiumToad: the line number is off, somehow RhodiumToad: contents of *_jit seem highly dubious RhodiumToad: looks like it aborted in get_temp_gpr, with _jit->temp_gpr_saved++ being equal to 200 RhodiumToad: when it expected 0 or 1 dsmith-work: RhodiumToad: what arch? RhodiumToad: armv7 RhodiumToad: RPI2b RhodiumToad: bleh. that wild pointer for _jit may be a debugger artifact RhodiumToad: or it may be a register corruption dsmith-work: Ok, I don't understand what's going on there. dsmith-work: If that's called more than once it aborts? RhodiumToad: the problem is that it's somehow losing track of j->jit, I think tinga: Is there a way to show the source location of the current continuation? tinga: From the debugger, I mean. tinga: Ah, ",frame 0" it seems apteryx: dsmith-work: yes, edebug is awesome apteryx: Realgud supports many compiler and supposedly makes it easy to hook new ones. Could be interesting to try to add support for debugging Guile in Realgud. jackhill: daviid: ah, cool :) I thought you might upon seeing 3.0 removed from GUILE_PKG tohoyn: sneek, botsnack sneek: :) wingo: moin dsmith-work: Hey Hi Howdy, Guilers civodul: wingo: i see a build failure for master on i686-linux: https://paste.debian.net/1152366/ civodul: does that ring a bell? civodul: hmm it could be that my prebuilt directory had stale .go files dsmith-work: civodul: I had no probs building for 32bit intel dsmith-work: civodul: From a fresh clone dadinn: lastlog heisenberg-25: I am using the guile static profile and it works. But in the output it displays some procedure names as "anon #xb12c48". anyone had similar issue or know why? manumanumanu: heisenberg-25: are the anon procedures lambdas? heisenberg-25: manumanumanu: do you mean anonymous procedures? I am not sure. but there isn't a function named anon in my code. dsmith-work: heisenberg-25: What version? There was a recent commit: df22eb5 Statprof reports primitive names heisenberg-25: dsmith-work: I am using guile-3.0.2 dsmith-work: Ok. That commit is after 3.0.2 heisenberg-25: dsmith-work: re-building guile from the source manumanumanu: heisenberg-25: i mean, are you passing any (lambda (x y z) ...) to a higher order function? Iirc those procedures are called something like that in the profiler justin_smith: also, many macros will end up creating lambda blocks internally heisenberg-25: manumanumanu: yes. heisenberg-25: dsmith-work: the commit you suggested fixes the issue, :) dsmith-work: Yey! heisenberg-25: wingo: is there a way to suspend the run-fibers call if an exception occurs. Right now it prints the exception stacktracae but hangs. and while running from the guile repl, I have to do Ctrl + Z to terminate guile (because Ctlr + C) doesn't work rekado: found this on Guile’s Elisp: https://emacsninja.com/posts/state-of-emacs-lisp-on-guile.html rekado: looks like there are a few misunderstandings rekado: ugh, don’t look at the hackenews “discussion” of this… civodul: rekado: the author may be doing something wrong, but it looks like they made some effort to get the thing running civodul: of course, they probably started with a misconception and have a confirmation bias justin_smith: I think the main misconception is that guile's elisp would be usable without the c functions in emacs civodul: right, like buffer functions daviid: here is a code snipset, for so those interested may help me to find why on earth :), which daviid: oh, hit enter before text completion :) daviid: .. interested may help me to debug among the weirdest bug ever - https://paste.debian.net/1152105/ daviid: a cpmplete description of what it's supposed to do and how to reproduce i the paste, between the ;;; Commentary: ... ;;; Code: lines daviid: I guess it's because it is map, used 'everywhere', and that won't work unless map is bound to a generic before anything using is compiled after it is turned into a generic - just like guile-gnome, g-golf rebinds connect (core guile implementation of the connect(2) posix call) into a generic, but unlike map, it is probably not used any where (in guile itself), and so it is fine ... daviid: I think I am going to 'bypass' map as a short method for the time being, probably a few others to, like find ... maybe 'bypass' any core guile proc for the time being, then see how things go ... jackhill: daviid: I'm curious, what needs to be done for guile-3.0 support in g-golf? daviid: jackhill: actually I don't know, yet :) - wingo: moin civodul: hi wingo! wingo: heya :) wingo: have a good weekend? civodul: yup, partly sunny, not too bad :-) civodul: & you? wingo: good good! civodul: do you think everything is in place for 3.0.3, with the ARM fix now merged? civodul: i should be able to take care of it this week wingo: civodul: yeah lgtm civodul: awesome civodul: what are your thoughts regarding the string-for-each discussion? wingo: civodul: string-for-each should be in scheme :) i just wanted to push back on the idea that entering/leaving vm and/or jit was related to after-gc-thunk civodul: ah ok civodul: when you have time, i'd be curious to learn what you think is happening here civodul: i just naively looked at the profile without digging much wingo: well gc happens, i dunno, max 100 times a second wingo: whereas the test case you were looking at is 3 or 4 magnitudes more, at least civodul: right wingo: i don't know what the gc issue is. looking at comparative benchmark results, there are no significant regressions afaiu: https://wingolog.org/pub/guile-3.0.3-vs-guile-3.0.2-microbenchmarks.png wingo: so, it is something to understand, but not a release blocker afaiu civodul: ah no, there's no regression civodul: yes, agreed civodul: it's just "weird", and we didn't see it in 2.2 i think civodul: but definitely not a blocker civodul: GC hook aside, the string-for-each case shows suprisingly high (to me) overhead wingo: the string-for-each case is essentially measuring overhead afaiu wingo: is that how you read it too? wingo: i.e. there's no workload civodul: wingo: yes, but i expected string_for_each and vm_engine to be higher civodul: i also expected a less significant difference compared with pure Scheme civodul: but like you say, it should be in Scheme, so maybe it's not worth discussing dsmith-work: UGT Greetings, Guilers dsmith-work: NEWS updated! janneke: wooot, göran mailed me about their xz decompression in scheme janneke: i will want to look into that, not sure though what to do with the syntax-case bootstrap thingy... janneke: taking it in might harden the requirement on guile/syntax-case, not sure if that's smart janneke: otoh it might help getting people on board trying to "crack that nut" civodul: janneke: neat civodul: weinholt might be around :-) janneke: civodul: oh...oops -- ah well, great! :-) janneke: i really love how people reach out and help, it's amazing! civodul: yup! manumanumanu: is there any way to expand macros? Say that I have a procedural macro and want to expand the body of the macro? I could probably hack it together using syntax-local-binding, but hopefully there might be some nicer way... manumanumanu: to expand on that: I want to programmatically expand macros, not at the repl. tinga: Hi. How do I do benchmarking of my code? Something like `time` in other Scheme implementations. civodul: hi tinga! civodul: there's (ice-9 time), which provides a 'time' procedure civodul: or simply ",t" at the REPL tinga: Is there a single stepper in Guile 3? tinga: Something like this was for 1.x: https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Single-Stepping-through-a-Procedure_0027s-Code.html dsmith-work: tinga: A few weeks ago I was having some problems in emacs. Found a stepper thingy. Was *awesome*. Sure wish something like that was in Guile. dsmith-work: May have been edebug justin_smith: with 2.x you can examine data and step from the debug prompt justin_smith: that alone won't do the nice editor source following that emacs edebug does of course justin_smith: but surely the guile debugger has enough data to make that work if someone writes the editor code? tinga: justin_smith, how do you step? Can't see it mentioned don https://www.gnu.org/software/guile/manual/html_node/Interactive-Debugging.html justin_smith: tinga: very strange that those commands are not included in the doc tinga: Ah, ",help debug" shows it justin_smith: yeah - I was working with some hairy goops multi-dispatch code where I pretty much needed a stepper to even know where things where blowing up thanks to generic dispatch justin_smith: between break / step / resume and inspection of the stack and registers, all that's missing is nice editor integration to jump to the code and highlight the active form justin_smith: oh and watches (I think that's what tracepoint does but I haven't messed with it)( marusich: Huh. Log search is broken. http://logs.guix.gnu.org/guile/guile/search?query=marusich+ellipsis marusich: RhodiumToad, janneke, thank you for the reply the other day in http://logs.guix.gnu.org/guile/2020-06-11.log - I see that although the Guile manual doesn't seem to discuss it, a form like (... TEMPLATE) is used in syntax-rules to escape ellipses (...) in the TEMPLATE, so (... ...) becomes ..., like you said. (R6RS 26 Sept 2007, p. 58) marusich: I will remember to check more places next time in my undying quest for knowledge. marusich: Speaking of R6RS, I just noticed this little gem in the Acknowledgements: "We also thank Betty Dexter for the extreme effort she put into setting this report in TEX, and Donald Knuth for de-signing the program that caused her troubles." [rg]: holla folks, are guile libraries covered here too? tohoyn: sneek, botsnack sneek: :) chrislck: silly question: instead of (apply fn args), is there a reason why calling (fn . args) is not possible via syntax macro? chrislck: ^ I appreciate it would make code look weird... daviid: d leoprikler: chrislck I think the syntax would be fn arg args ... leoprikler: (fn arg args ...) with brackets leoprikler: if you really want to have 0+ arguments (fn args ...) would probably work too rekado: marusich: hmm, you got an extra “guile” there. This is the correct URL: http://logs.guix.gnu.org/guile/search?query=marusich+ellipsis anadon: Looks like there may be something wrong in the guix packages. Time to bounce there. tohoyn: sneek, botsnack sneek: :) msiism: What is Guile's implementation language? RhodiumToad: the parts of guile that aren't written in guile are in C msiism: I see, thanks. gjanssens: Hi, for gnucash on Windows we are currently pulling in guile 2.2.7. It has a few issues for which we carry local patches. gjanssens: One in particular has to do with a missing mktime_internal implementation. gjanssens: Searching the guile bug database I ran across this one: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24681 gjanssens: That reports the same issue on sparc solaris. gjanssens: The bug suggests this is due to a change in gnulib. gjanssens: And the fix should go into 2.0.15 gjanssens: We're more than three years later and the bug is still open. gjanssens: Is this oversight or are there technical hurdles that prevent this from being fixed ? janneke: gjanssens: you aren't using the 2.2.3-based wip-mingw-guile-2.2 (similar questions apply)? wingo: sneek: later tell civodul i don't thing the conclusion about scm_call_n is right fwiw, or that it applies to anything beyond the case you are considering sneek: Okay. wingo: i.e. unrelated to after-gc-hook wingo: sneek: later tell civodul important to avoid jumping to conclusions imo to avoid effort misfocussing sneek: Okay. gjanssens: janneke: no we're not using wip-mingw-guile-2.2 I wasn't even aware that was a thing... gjanssens: that branch hasn't been touched since 2018. How much of it has been merged in the main development branch ? *: janneke starts to doubt... janneke: i remember that stable-2.2 didn't build for me and i started looking for patches, found wip-mingw-guile-2.2 janneke: ...interesting gjanssens: For gnucash we now have a working guile 2.2.7. But our patches are absolutely minimal and aimed at getting guile to work for us. gjanssens: It's a lot of duplicated effort though to keep on maintaining this out of tree. gjanssens: That's why I started looking around for other work in this area. And the first thing I ran into was the bug I linked to before. civodul: hey wingo civodul: wingo: i probably kind of jumped to the conclusions civodul: that's how i interpreted the perf report civodul: but i'm happy to hear your opinion anadon: It looks like the page in the manual dedicated to adding readline support is no longer complete. When Following them in 3.0.2 it can't find the `ice-9 readline` module. guile-readline and guile are both installed via guix. RhodiumToad: worked for me? RhodiumToad: (not using guix, though) tohoyn: sneek, botsnack sneek: :) tohoyn: FYI: a new version Theme-D-Golf 0.8.2 has been released. The new version includes support for overridden functions in G-Golf. tohoyn: see http://www.tohoyn.fi/theme-d-golf/index.html RhodiumToad: random thought, has anyone considered whether it's possible to implement proper ephemerons, rather than just key-weak weak hashes? wingo: dsmith-work: yeah i don't know! the way i would debug is set GUILE_JIT_THRESHOLD=0 and GUILE_JIT_STOP_AFTER=n wingo: and bisect over n until you find the function whose compilation is causing the problem wingo: RhodiumToad: i thought about it but could not find a good way to do it. here are some of my confused thoughts about the problem: https://bdwgc.opendylan.narkive.com/BtFAqAtN/gc-weak-maps-and-libgc#post2 wingo: if we ever replace the gc, native support for ephemeron tables would be a thing to add wingo: maybe it is best not to link to my confused thoughts, i have a history of doing badly in this area *: civodul attempts to update gdb to Guile 2.2/3.0 *: guix-vits -- "i love 'bastards' like this: (system "cat ~/test/r.json") -> string; i promise to read the manual someday." *: guix-vits * -> 0 * *: guix-vits "my precious: (get-output-string) & Co." *: guix-vits "ok, man will be faster than those unrelated commands. So: File Ports.." guix-vits: (get-string-all p) -> $69 = "* {\n ... Want to get the result from 69-th attempt? Avoid reading the manual beforehand :] civodul: heh civodul: updating those gdb bindings is my "bonne action" of the day, as we say here dsmith-work: Happy Friday, Guilers!! dsmith-work: wingo: Thanks. I'll try the GUILE_JIT_STOP_AFTER=n. Gonna be hard though, as it doesn't fail every time. wingo: probably depends on veneers somehow then dadinn: hi all dadinn: I am trying to use define-syntax rules, I have the following code: (define-syntax-rule (print-to-file path . body) (with-output-to-file path (lambda () (print-headers) body ... (print-footers)))) dadinn: I am not sure how to do the splicing part with the body argument to the macro dadinn: I kinda now that syntax-rules use the ... to do the splicing, but not sure how define-syntax-rules form works :/ chrislck: dadinn: start with (define-syntax-rule (print-to-file path body ...) ...) and it'll be fine dadinn: chrislck: what would be the right expression if i wasn't using ... at all? dadinn: chrislck: I wouldn't expect splicing syntax-unquote to work :P dsmith-work: civodul: You are working on getting gdb up to date? civodul: dsmith-work: yup, i submitted patches wingo: i merged lightening btw civodul: and i discovered a patch had been posted in 2018 and fell through the cracks civodul: wingo: awesome, thanks! civodul: does that mean we're all set for a release? dsmith-work: While you are at it: libguile/lightening/lightening/lightening.c dsmith-work: -#if JIT_NEEDS_LITERAL_POOL dsmith-work: +#ifdef JIT_NEEDS_LITERAL_POOL dsmith-work: Just to be consistent zig: hello! zig: I managed to port my triple store, dubbed nomunofu, to guile 3.0.2 zig: but the search engine, dubbed babelia, is not working at all. zig: it is complaining about a continuation barrier. zig: The thing is that it was working with early guile 3.0.0 zig: Oh I see, several fixes in things related to the issue I see https://lists.gnu.org/archive/html/guile-devel/2020-03/msg00046.html zig: I will try guile-3.0.0 and see if it still works. civodul: wingo: scm_call_n is expensive when JIT is enabled: https://lists.gnu.org/archive/html/guile-user/2020-06/msg00038.html anadon: I still need help getting the guile repl to use readline. Haven't figured this one out. justin_smith: anadon: what did you try? dsmith-work: anadon: My guess is you didn't have the readline-dev package installed at configure time justin_smith: n/m I found the scrollback dsmith-work: As line libreadline-dev anadon: dsmith-work: guile got installed as a package. dsmith-work: Ah anadon: justin_smith: What was in the manual, the two lines for ~/.guile got added. I also installed `guile-readline`. guix-vits: anadon: (W.A.) geiser in emacs? anadon: sneek: tell later guix-vits What do you mean? () sneek: later, anadon says: guix-vits What do you mean? () anadon: sneek later tell guix-vits What do you mean? (re: (W.A.) geiser in emacs?) sneek: Okay. dsmith-work: anadon: Probable meant use emacs+geiser instead of readline. anadon: I'll look into it. Still, I'd like to understand why the approach in the manual didn't work. dsmith-work: anadon: Do you have strace? You could run guile under "strace -efile" and get a better idea of where guile is looking for readline, and why it's not finding it. anadon: I keep forgetting it exists. ArneBab: manumanumanu: the racket-version is https://paste.debian.net/1151325/ — in both versions a comment at the top says how to call it. ArneBab: manumanumanu: keep in mind that the algorithm itself must stay the same because of benchmarkgame rules daviid: sneek: seen wedesoft sneek: I last saw wedesoft in (here?) 4 months ago, saying: Waiting for the Guile FOSDEM 2017 videos to switch to "done" https://review.video.fosdem.org/overview http://video.fosdem.org/2017/K.4.601/. daviid: dsmith-work: do we have a bot goops tutorial pointer? elliotpotts: hi folks lfam: Howdy guix-vits: Cool, in /query sneek one can say things without prefixing them with 'snеek:' guix-vits: snеek: botsnack guix-vits: sneek: seen sneеk sneek: Sewni was last seen in (here?) 9 months ago, saying: I didnt realise you were using the bot :P. guix-vits: Cyrillic 'e' rules (^^) *: guix-vits Actually not so: "*** snееk is an erroneous nickname" marusich: Where can I find a good explanation of how to understand the use of ellipsis (...) in match clauses? marusich: I get the idea well enough when I see one being used, but I'm looking at code that uses 3 of them at the same time, and I'm confused: http://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/utils.scm?id=88f85494491a0cd4d4262c97860f01e99c2bc313#n793 marusich: Like, what the heck is (... ...) ? elliotpotts: I have a notice about the definition of the `SCM_UNPACK(x)` macro: in c++20, `volatile` on the left hand side of an assignment is deprecated elliotpotts: so this thing will "soon" be invalid c++: `#define SCM_UNPACK(x) ((scm_t_bits) (0? (*(volatile SCM *)0=(x)): x))` elliotpotts: should this be reported as a bug or something? RhodiumToad: what on earth is that trying to do? RhodiumToad: seems to be trying to induce a segfault? RhodiumToad: but 0 is false in any event so... elliotpotts: it's forcing the `*(volatile SCM *)` to be compiled though never evaluated... in order to typecheck x, I think... RhodiumToad: oic elliotpotts: there's a comment: elliotpotts: The 0?: constructions makes sure that the code is never executed, and that there is no performance hit. However, the alternative is compiled, and does generate a warning when used with the wrong pointer type. We use a volatile pointer type to avoid warnings from clang. elliotpotts: I guess there could be a check for c++20 and replace it with decltype and static_assert janneke: marusich: i guess that's what syntax-case does for you :-/ janneke: marusich: try something like: janneke: ./pre-inst-env guile janneke: (use-modules (ice-9 match) (guix build utils)) janneke: ,expand (substitute* '("foo" "bar") (("baz") "bla")) janneke: IWBN if there was a way not to expand the "match" macro...hmm janneke: marusich: if you e.g., capaitalize 'match and quote its clauses: https://paste.debian.net/1151533/ janneke: then ,expand => (MATCH '("foo" "bar") janneke: '((files ...) janneke: (for-each substitute-one-file files)) janneke: '((? string? f) (substitute-one-file f))) RhodiumToad: but aren't we already inside a syntax-rules here? RhodiumToad: ahh RhodiumToad: (... ...) seems to expand to just ... ? *: RhodiumToad is not finding this documented janneke: ah yes, where i said syntax-case, make that syntax-rules, stop the clock RhodiumToad: so I'm seeing by experiment that (... ...) inside a syntax-rules is a "quoted" ... identifier RhodiumToad: but nothing in the docs actually says this RhodiumToad: aha. that part is defined in r6rs, but not mentioned in the guile docs dsmith-work: daviid: Doesn't look like it (goops tutorial link). Do you know of one? daviid: dsmith-work: this one https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ dsmith-work: sneek: goops-tutorial is https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ sneek: Understood. dsmith-work: sneek: goops-tutorial ? sneek: Its been said that goops-tutorial is https://www.wedesoft.de/software/2014/03/02/oop-with-goops/ daviid: dsmith-work: great, tx guix-vits: (?) Do someone willing to share an Guile example? https://webkitgtk.org/reference/webkit2gtk/unstable/WebKitUserContentFilterStore.html#webkit-user-content-filter-store-save-from-file guix-vits: i can't defeat 'callback. lloda: sneek: later tell elliotpotts check http://logs.guix.gnu.org/guile/2020-05-27.log sneek: Will do. lloda: sneek: later tell elliotpotts easiest solution is to compile your code with -DSCM_DEBUG_TYPING_STRICTNESS 2 sneek: Okay. lloda: I already argued for that to be the default dsmith-work: lloda: Did you know that you can link to a specific line in the log? It's the nick of that line. For example: http://logs.guix.gnu.org/guile/2020-05-27.log#155008 dsmith-work: A nice touch. dsmith-work: Thank You, logger implementer person. lloda: i didn't know dsmith-work thank you lloda: the logs are great really civodul: hello! civodul: wingo: would you be available to push 3.0.3 or would you like me to take care of it? dsmith-work: Morning Greetings, Guilers wingo: hi :) civodul: (not right now, sometime in the coming days) civodul: hey :-) wingo: civodul: humm, am a bit overloaded atm. if you have the cycles, plz do it :) wingo: need to merge the arm patch to lightening tho!! sneek: Yes please civodul: wingo: ah yes, that one civodul: wingo: did that the arm fix need more work or more testing? civodul: actually how do you handle merges of lightening in guile.git? dsmith-work: civodul: It definitely some real problems. Though I was seeing some errors, most probably unrelated. dsmith-work: s/some/fixed some/ dsmith-work: s/was/was still/ dsmith-work: civodul: There have been some update since I did any testing, and I haven't been able to get back to it. civodul: dsmith-work: alright, we'll synchronize when i get around to preparing the release, then wingo: civodul: lightening is merged via git merge -s subtree civodul: ok, i see dsmith-work: Oh!, but that PR hasn't been merged yet. rekado: the logging web interface is a ~500 line Guile script: https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/goggles.scm civodul: %after-gc-thunk shows high in profiles civodul: weird wingo: that does sound weird wingo: i wonder if it is fake somehow wingo: like if SIGPROF arrives during gc, will it necessarily be counted as after-gc-thunk? wingo: or is it real and either the thunk it being called too often somehow, or taking too long wingo: i don't recall seeing it at the top of profiles in the past civodul: yeah civodul: i've been thinking it might be fake civodul: but i don't see how it could civodul: after all, statprof is just sampling the stack dsmith-work: wingo: So I'm trying to remmember where I was at with jit on armv7. When the env var was set to always jit, it caused more problems. dsmith-work: wingo: Any thoughts on why? Stress on mem allocation? Overwriting some bounds? dsmith-work: wingo: Maybe overwriting a stack? dsmith-work: The backtraces from core dumps seem to indicate a corrupt stack. guix-vits: Hi daviid: Is GAsyncReadyCallback, and GCancellable are supported yet in g-golf? daviid: guix-vits: not yet, actually at this moment, any function that accepts callback(s) will accept #f (which 'is' NULL), but not yet a 'real' callback - I statd to think about it, had a few very long chat wth the GI folks, g-golf will get there, but don't hold your breath guix-vits: Thanks daviid, i'll try #f. daviid: guix-vits: for example this will work (example iitially proposed by str1ngs, I just reviewed it a little ...) - https://paste.gnome.org/paob2ihua daviid: guix-vits: are you using the very latest g-golf? a source clone, checkout the devel branch ... the guix package is 'late', I wouldn't use it till ther is a g-golf release *: guix-vits loading. . . daviid: guix-vits: in the paste you should remove line 47, a comment I made to myslf at the time, but that has been fixed, as line 48 shows ... guix-vits: daviid: + on Guix there is no /bin/bash by defauld (only /bin/sh, and those /run/current-system things). Cool. daviid: sneek: later tell tohoyn it is invoked in (g-golf hl-api function) gi-import-function sneek: Okay. daviid: sneek: later tell tohoyn not exactly 'invoked' but used to substitute the GI function ... look at %i-func and %o-func ... again, for info ... you should write your own mechanism, knowing that these overridden funcs are being overridden becaus they expect a g-value and *-get-* should ignore that arg, *-set-* should receive the value to be set to, not a g-value ... sneek: Got it. daviid: sneek: later tell tohoyn you should write your own mechanism and _not_ depend on g-golf's internals, especially not the overriding mechanism I should say, because chances that I'll need to improve or change it are rlatively high ... sneek: Will do. anadon: xelxebar: Just because I'm new and trying to figure stuff out :P anadon: How do I achieve the effect of `(hash-ref initial_state "heads")` when using `(hash-ref initial_state (heads))` when `heads` is defined as the string "heads"? tohoyn: sneek, botsnack sneek: tohoyn, you have 3 messages! sneek: tohoyn, daviid says: it is invoked in (g-golf hl-api function) gi-import-function sneek: tohoyn, daviid says: not exactly 'invoked' but used to substitute the GI function ... look at %i-func and %o-func ... again, for info ... you should write your own mechanism, knowing that these overridden funcs are being overridden becaus they expect a g-value and *-get-* should ignore that arg, *-set-* should receive the value to be set to, not a g-value ... sneek: tohoyn, daviid says: you should write your own mechanism and _not_ depend on g-golf's internals, especially not the overriding mechanism I should say, because chances that I'll need to improve or change it are rlatively high ... sneek: :) wingo: o/ d4ryus: hi, is (resolve-module '(fibers) #f #f #:ensure #f) a good way to test if a module has been loaded? leoprikler: d4ryus: code like that is used in Guix with the comment "this hack allows us to [...]", so I'd guess yes d4ryus: leoprikler: ok, thanks :) ArneBab: wingo: this could be interesting to your fibers experiment: http://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1.html — especially "a virtual thread can be pinned in two situations: when there is a native frame on the stack — when Java code calls into native code (JNI) that then calls back into Java — and when inside a synchronized block or method. In those cases, blocking the virtual thread will block the physical thread that carries ArneBab: it." ArneBab: I just ported nbody from the benchmarksgame to guile: racket: https://paste.debian.net/1151325/ guile: https://paste.debian.net/1151324/ ArneBab: this loses all the unsafe operations in racket and some performance ArneBab: forgot an import: guile version: https://paste.debian.net/1151326/ ArneBab: racket: time racket nbody/nbody.racket-2.racket 100000 # real 0m0,190s ArneBab: guile: time guile time guile nbody/nbody.guile.guile 100000 # real 0m5,243s ArneBab: ^ this could be a good candidate for a game of golfing down the runtime wingo: you will get better perf if you use an f64vector as the backing store and compile with -O3 ArneBab: can I pass O3 directly to guile? wingo: no. is not a bad idea tho wingo: you pass it to "guild compile" ArneBab: I don’t see a difference with an f64vector ArneBab: no O3 yet, will play later ArneBab: thank you! wingo: should also switch to normal * - and so on wingo: fl* is unoptimized in guile ArneBab: flX->X: halved the runtime ArneBab: O3: down to 377ms; only factor 2 to racket ArneBab: guild compile -O3 nbody/nbody.guile.guile ; time guile nbody/nbody.guile.guile 100000; time guile --fresh-auto-compile nbody/nbody.guile.guile 100000 ArneBab: somewhat optimized version: https://paste.debian.net/1151332/ ArneBab: wingo: that was already a factor 10! ArneBab: O2 is similarly fast — I thought O2 would be default … ArneBab: ah, no, gcc also uses O0 by default ArneBab: so with minimal optimization and without unsafe math, Guile is half as fast as the optimized racket program (in this case). ArneBab: this allows tieing Guile to some degree into the benchmarksgame metrics: https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbody.html ArneBab: current version would be 2 minutes on that page. ArneBab: with 50000000 as setting racket gets better — it’s now 14s racket vs. 83s guile ArneBab: guild compile -O3 nbody/nbody.guile.guile ; time guile nbody/nbody.guile.guile 50000000; time racket nbody/nbody.racket-2.racket 50000000 RhodiumToad: which guile version? ArneBab: 3.0.2 ArneBab: 50000000 is the setting recommended on the benchmarksgame page RhodiumToad: hm. what about the fx= / fx+ etc. calls wingo: yes those need replacing with = and + and so on roelj: I'd like to cite/refer to Guile. Is there a preferred way to do this (and perhaps a BibTeX entry? :D) ArneBab: I replaced them RhodiumToad: any improvement? ArneBab: yes, factor 2 ArneBab: O2 made an other factor 5 ArneBab: roelj: in my bibtex I only have the guile reference manual RhodiumToad: ArneBab: I'm talking about fx+, not fl+ ArneBab: ah, sorry ArneBab: are these still exact when replaced? (result must not change) ArneBab: result did not change, speed went up by factor 4 ArneBab: 28s now — compared to 14s racket ArneBab: https://paste.debian.net/1151343/ ArneBab: thank you! ArneBab: "we made the code simpler and now it is 10x as fast" roelj: ArneBab: What did you use as "authors roelj: ArneBab: "* ArneBab: Author = {Guile Contributors} leoprikler: I personally have " author = {Galassi, Mark and Blandy, Jim and Jerram, Neil and Vollmer, Marius and Grabm\"{u}eller, Martin and Court\`{e}s, Ludovic and Wingo, Andy},", but that renders as Galassi et al. which may or may not be accurate lloda: That's what always happens with multiple authors dsmith-work: UGT Greetings, Guilers leoprikler: I think, there's a setting for that, but 7 is more than 3. wingo: ArneBab: you could replace the map with a for-each also; perhaps that is a transformation guile should make, dunno wingo: i.e. if a map result is unused, don't cons wingo: or replace with a loop up to N instead of iota roelj: ArneBab: I'm using publisher={The Guile Developers} now, but I wonder whether this can be improved. :) lloda: that code looks translated from something else ArneBab: lloda: it’s taken from racket which likely took it from the java reference version as advised on the benchmarksgame page. ArneBab: for-each did not change things ArneBab: --fresh-auto-compile takes 4 minutes, O2 takes 24 seconds. ArneBab: switching to named let loop got down to 22s leoprikler: Can you do a tail-recursive advance? leoprikler: and instead of your vector loop, do vector-map! of vector-for-each ArneBab: leoprikler: I don’t see an effect of the tail recursion ArneBab: (but I don’t want to deviate too far from the racket, if it does not yield performance gains) ArneBab: I think I should profile first … leoprikler: Well, my idea was that you could call (advance N) instead of looping advance calls leoprikler: but yeah, probably makes no difference ArneBab: I tried that, but yes, did not make a difference. Named let is fast :-) wingo: i don't know why fresh-auto-compile would take longer than O2 wingo: unless compilation takes a while, but that's a small program wingo: afaiu fresh-auto-compile uses O2 lloda: named let is low level lloda: i wish I could chain maps and get the same perf d4ryus: Is redefinition guaranteed to work? e.g. when i redefine a function foo via (set! foo (lambda ...)), is it guaranteed to be picked up in all places on the next call of foo? lloda: question isn't clear to me d4ryus lloda: what are all places? the next call is just one place lloda: but Scheme variables are just names for values, they aren't places where you keep values lloda: so anywhere you grabbed foo's value won't see that foo now names something else lloda: or that's how I see it at least wingo: i think that's not quite right tho d4ryus: lloda: sorry. i meant if module x exports foo which is used by module y. if i load x and y and then redefine foo from module x. Will module y then use the new value of foo? wingo: d4ryus: module y will use the new value of foo d4ryus: well, i know it does. but is it guaranteed? d4ryus: wingo: ah ok. thank you! wingo: see caveats at https://www.gnu.org/software/guile/manual/html_node/Declarative-Modules.html d4ryus: lloda: thanks, too! d4ryus: wingo: Ahh, interesting. that is exactly the information i was looking for :) wingo: :) lloda: well I was waiting for wingo's correction ;-) wingo: hehe heisenberg-25: Why is (get-bytevector-n (response-body-port res #:keep-alive? #f) len) giving an "Throw to key `bad-response' with args `("EOF while reading response body: ~a bytes of ~a" (0 237))'." while reading from a response object res, with content-length len using guile web module? ArneBab: wingo: I don’t know either why --fresh-auto-compile is slower — should I file a bug report? ArneBab: wingo: this is really easy to reproduce wingo: if you could look into it that would be great wingo: use guile from master tho if you can ArneBab: I have the strange effect that the time does not match any optimization level. It is faster than O1 but slower than O2 ArneBab: wingo: is it possible that switching from interpreter to compiled does not work as it should? ArneBab: Here’s complete reproduction in one shell command: wget -O nbody.guile https://paste.debian.net/download/1151386; time guile nbody.guile 500000; time guild compile -O2 nbody.guile ; time guile nbody.guile 500000; time guile --fresh-auto-compile nbody.guile 500000; time guile nbody.guile 500000 ArneBab: calling guild compile gives a massive speedup that is lost when forcing a recompile from guile ArneBab: but if you switch from -O2 to -O1, the explicitly compiled code is slower than when using auto-compile ArneBab: All these are toplevel forms and the code to run is a let at toplevel. Could that be the issue? ArneBab: defining a toplevel procedure and running that explicitly does not change this. leoprikler: I think using "time" to time the algorithm is perhaps the wrong approach leoprikler: If you do fresh-auto-compile, you get the compilation overhead once and normal performance otherwise leoprikler: or no, fresh-auto-compile always recompiles, my bad leoprikler: but still you have compilation + execution vs. just compilation vs. just execution leoprikler: and Guile 3 does have JIT compilation IIRC leoprikler: so you compile as you go ArneBab: leoprikler: the second call uses the code created by fresh-auto-compile, and it is also slower ArneBab: so the command-line above tests all three cases: not compiled (real auto-compile), explicit guild compile, fresh-auto-compile, using the fresh-auto-compile ArneBab: only the call after explicit guild compile is fast leoprikler: okay, I looked it up and %auto-compilation-options only sets up warnings, but no optimizations leoprikler: so in theory it should be as good as guild compile -W... ArneBab: I’m trying to create a minimal working example, but my examples don’t reproduce the problem … leoprikler: can you try "guild compile -O2" vs "guild compile" manumanumanu: Ahoy hoy! manumanumanu: ArneBab: could you post the code? Next week I am up for som micro-optimizations :D ArneBab: manumanumanu: https://paste.debian.net/download/1151386 ArneBab: leoprikler: no change manumanumanu: ArneBab: rnrs arithmetic fixnums does nothing iirc leoprikler: so both behave the same way? ArneBab: leoprikler: yes manumanumanu: it just checks that the args are fixnums and that the results are fixnumns leoprikler: hmm ArneBab: manumanumanu: that might no lonegr be needed, yes ArneBab: longer *: mwette found a hidden gem in guile: system/vm/elf&dwarf. I'm working on a guile front end to my microcontroller cpu simulator and want to snag debug info out of my compiled elf files. I'm still trying to get address-lineno sync but making progress. anadon: I want to have stronger typing for a program I'm using, so I am using rnrs enums to represent a fair/biased coin, and a head/tails side. I'm using these values as keys in a hash table to look up probabilities of events like P(heads | biased coin). From a `(let coin_type ( make-enumeration `("fair" "biased")))` how do I access the specific symbols in `coin_type` to use as keys? xelxebar: anadon: I'm not all that proficient in guile, but I think you may be using make-enumeration incorrectly xelxebar: (enum-set-member? 'foo (make-enumeration '(foo bar))) should return true. xelxebar: The set members are symbols, not strings. xelxebar: Is there a particular method that doesn't fit your needs? https://www.gnu.org/software/guile/docs/master/guile.html/rnrs-enums.html tohoyn: sneek, botsnack sneek: tohoyn, you have 4 messages! sneek: tohoyn, daviid says: g-golf introspection data is perfectly correct :), as a matter of fact, procedures that override any typelib function _do_ use the imported version and the cache holds on scheme representation of GI 'objects' sneek: tohoyn, daviid says: as said earlier, you are not supposed to use/depend on g-golf internals anyway, thay may change anytime, you do this 'at your own risks', which is ok, but g-golf does not bear any obligation wrt. now, if you do, you'll have to adapt ... this said, what we are talkg about now is _not_ a change in g-golf internal representation but the adition of an override mechanism ... sneek: tohoyn, daviid says: so, it appears to me that you need to think and implement your own theme-d override mechanism ... fwiw, overriden functions are listed in %gi-override, (g-golf override override) module sneek: tohoyn, daviid says: of course that list will evolve in time ... sneek: :) tohoyn: daviid: could you tell me where are the overridden procedures (xxx-ov) taking one argument invoked? wingo: moin civodul: hello! ArneBab: moin wingo RhodiumToad: moo dsmith-work: Hey Hi Howdy, Guilers daviid: should g-golf accept '() and #f or stricktly '(), wdyt? here is an example is gtk-init, (gtk-init 0 #f) and/or (gtk-init 0 '()) - fwiw guile-gnome would even accept (gtk-init #f #f) daviid: this is a bit of a 'symetric question' to the one we previusly spoke about hre, wrt gi->scm that return a list, and now return '() not #f, when the gnome lib returned NULL ... daviid: ok, I'll ake those to only accept '() - till now, this was the case for all but one, scm->gi-gslist to name it, so I'm goig to make it stricktly accept lists not #f anymore daviid: actually argv is 'tagged as an array of utf8, not a glist, so even after this change (which only affects functions that accept GList/GSlist, users will still be able to (gtk-init 0 #f) or (gtk-init 0 '()) - but from now on, for functions that expect GList/GSList, g-golf will raise an exception if passed #f, users must pass '() instead str1ngs: daviid for lists I prefer '() +1 here for that. daviid: str1ngs: ok, all situations have been solved wrt returned values, but I realize I still do not 'enforce' '() for function calls - what I did so far affects direct calls to scm->gi (commit de41195), but funcall args are preprocessed in prepare-gi-args-in, which still accept #f for those args tagged as 'array, 'glist, 'gslist', 'ghash, 'error, 'utf8, 'filename and 'void daviid: str1ngs: this is just to say that to achieve 'in/'inout arguments 'strict' enforcement to lists only, '() - not #f - for those tagged arguments, to pass %null-pointer (which is ok only if the argument has its 'maybe-null? slot value being #t), I need to review the 'preprocessing' code that occurs in prepare-gi-args-in daviid: so at this point the question 'still is opened', should g-golf enforce, for those tags, that expect a list 'on the scheme side' of things, strict lists or accept #f as well ... apteryx: how can I query the integer user id given a user id string? daviid: apteryx: passwd:uid apteryx: thanks! (passwd:uid (getpwnam "username")) daviid: wc! daviid: tohoyn: I just push a series of patches, and now child properties g-value are 'hidden' to g-golf users, please pull, make and test ... here is a concrete en example, based on yours ... https://paste.gnome.org/pw7blrnnw tohoyn: daviid: your example works fine tohoyn: daviid: I may have asked this from you before but could you look at https://savannah.nongnu.org/task/?15647 and tell me what is wrong with the project licenses? wingo: o/ tohoyn: daviid: gtk-container-child-get-property is not handled correctly. It takes four arguments last of which is a gvalue. tohoyn: (gi-cache-ref 'function 'gtk-container-child-get-property) tohoyn: and (describe ...) guix-vits: tohoyn: maybe this parson on savannah need an ``Use a license compatible with the GNU GPL, and use the __"or any later version"__ formulation in your license notices.''? daviid: you should not pass tha last arg, see the example ... tohoyn: daviid: yes, but Theme-D-Golf uses the introspection data and it has to be correct. tohoyn: daviid: because Theme-D is statically typed tohoyn: guix-vits, I already have "or (at your option) any later version" in my license notices. leoprikler: for the record, guile-gi accepts #f for NULL and also allows omission dsmith-work: {appropriate time} Greetings, Guilers guix-vits: sneek: tell dsmith-work Hi :D sneek: dsmith-work, guix-vits says: Hi :D mwette: the link for the logs now gives me "502: bad gateway"; anyone else get that? mwette: ^ that is http://logs.guix.gnu.org/guile/ guix-vits: mwette: logs.guix.gnu.org (w/o guile) gives 502 to me and butterypancake (#guix) dsmith-work: Yes, 502 for me mwette: thx ArneBab: daviid: did g-golf already warn when it got #f? If not then throwing an error on #f sounds like it could break existing programs. ArneBab: daviid: is there a way to give compile-time errors for all places where someone used teh old version? ArneBab: wow, after fixing pull: The news headlines are awesome! dsmith-work: daviid: (I haven't been paying attention to this discussion so far) For this GList/GSlist stuff, are these exposed to Scheme as scheme lists or as some other type? daviid: ArneBab: fwiw, before 1.0, I allow myslf to change anything at anytime - althought things are prtty 'stable' now, from a user point of view I mean, iernally, thunderstorm every day here :):) daviid: dsmith-work: the #f for NULL debate, not only for GList/GSList, for 'in and 'inout rgument still is 'open' - not sure yet ... daviid: http://logs.guix.gnu.org/guile/ fails for me, today daviid: sneek: later tell tohoyn g-golf introspection data is perfectly correct :), as a matter of fact, procedures that override any typelib function _do_ use the imported version and the cache holds on scheme representation of GI 'objects' sneek: Got it. daviid: sneek: later tell tohoyn as said earlier, you are not supposed to use/depend on g-golf internals anyway, thay may change anytime, you do this 'at your own risks', which is ok, but g-golf does not bear any obligation wrt. now, if you do, you'll have to adapt ... this said, what we are talkg about now is _not_ a change in g-golf internal representation but the adition of an override mechanism ... sneek: Okay. daviid: sneek: later tell tohoyn so, it appears to me that you need to think and implement your own theme-d override mechanism ... fwiw, overriden functions are listed in %gi-override, (g-golf override override) module sneek: Will do. daviid: sneek: later tell tohoyn of course that list will evolve in time ... sneek: Will do. civodul: http://logs.guix.gnu.org/guile/ is back up! (but slow) ArneBab: daviid: ok mwette: civodul: thanks for the log fix civodul: yw! dale-2: Hi dale-2: Anyone know what the status of gtk/guile is? Has the project been abandonned? jackhill: dale-2: g-golf and guile-gi are two projects working in that area. Both make use of use GObject introspection. Perhaps daviid can say more… dale-2: Thanks, I'll look them up... never heard of them until now! jackhill: you're welcome :) dale-2: Interesting, they're both available in Guix... looks like guile-gi is furthest ahead at the moment. daviid: dale-2: fwiw, someone asked a similar question recently, here is what I answered https://lists.gnu.org/archive/html/guile-gtk-general/2020-05/msg00001.html dale-2: Okay, just read that, thanks. RhodiumToad: having used guile-gnome, it's possible to do usable stuff with it, as long as you don't use idle callbacks a lot RhodiumToad: (those will crash) dale-2: Difficult to know which one to go for. Probably I like the sound of the message-passing idiom better. dale-2: I think for a new project, going with guile-gnome would be harmful in the long run. Also I'd like to be using guile-3.x. RhodiumToad: yeah, choice between old dead project and new unstable projects is a pain dale-2: ;) manumanumanu: Did anyone see Aleix's message to guile-user? I found it fascinating: (for-each fun-stuff (string->list str)) was a lot faster than (string-for-each fun-stuff str) where fun-stuff is a procedure in the same module. leoprikler: I think there's a logical explanation for that to be found in caches. leoprikler: If you do string->list, you already have a complete list, whereas string-for-each probably works by accessing all elements of the string once and then calling the function as if you'd do your own string-ref loop RhodiumToad: I doubt it's anything to do with caches manumanumanu: leoprikler: i think the data is too large to be in a cache, and if anything strings should have better cache locality RhodiumToad: more likely string-for-each is not being expanded inline, so there's an actual call to fun-stuff, whereas with the for-each from the same module it can all be inlined manumanumanu: RhodiumToad: I thought so as well, but I couldn't make anything meaningful out of the assembly *: RhodiumToad hasn't looked at the message manumanumanu: But the difference is something like 2s - 18s manumanumanu: oh yes. for a simpler case that seems to be the case manumanumanu: I was just confused that the disassembly for the original code was something like 260 lines manumanumanu: RhodiumToad: I am still not sure. I got the disassembling wrong. I will continue to investigate. manumanumanu: a named let is still faster... leoprikler: that's called manual inlining ;) chrislck: aleix benchmarks probably use a large json string :) chrislck: what about the fact string->list accesses narrow chars if possible whereas string-for-each doesn't? manumanumanu: chrislck: well, you are iterating over a list, which should give you worse cache locality. manumanumanu: chrislck: and does guile type-infer narrow chars? I suspect that RhodiumToad (and myself, in the earlier reply to Aleix) are correct in that there is some inline magic going on. I just need to learn how to read the assembly to understand what :D leoprikler: I'm still not convinced, that locality matters too much here or is even impacted that heavily. leoprikler: But yeah, inlining will have probably have a greater effect. dadinn: so if i have a pattern (foo bar bar* ...) , and i call the macro with (foo 1 2 3 4), then what does bar and bar* bind to? erkin: bar binds to 1, bar* binds to 2 3 4 erkin: bar* is not a list, mind you. It's literally multiple syntactic elements at once. erkin: It might make things easier to consider the template system a separate, Scheme-based DSL than Scheme itself. dadinn: i assumed it is such erkin: Had you defined it as (foo bar . bar*), bar* would be (2 3 4), merely a list. dadinn: ok,then i clearly don't understand :) erkin: ... makes it very easy to write recursive macros where you have two templates: (foo bar) and (foo bar bar* ...). If the cdr of the form has only one element, it matches the first template. Otherwise, it falls back to the next one. erkin: In the (foo bar bar* ...) clause, you can recurse on the macro as (foo bar* ...) to call it again with the rest of the forms given. erkin: Until only one element remains, then it can match the first (foo bar) clause. erkin: You can also write mutually recursive macros similarly. dadinn: so when ... is used in the template it is like ,@ ? erkin: I wouldn't say so, because ,@foo expands *from* a list foo, whereas foo ... was never a list in the first place. erkin: It's literally everything the parser matches. erkin: You can also have nested ellipses for macros generating macros that use ellipses but that's a huge pain in the butt IMO: https://srfi.schemers.org/srfi-46/srfi-46.html dadinn: so you would recommend I should stick with the cons form instead? erkin: If it does what you want, yes. It's much easier to deal with. erkin: I need to go to sleep now. I hope I managed to help you. erkin: I do agree that there needs to be more newbie-friendly tutorials for Scheme's macro systems (there are seven different ones in use today, across separate implementations, although everyone uses `syntax-rules' for nearly everything). erkin: I was writing a tutorial myself but got sidelined by work and such. :-P dadinn: one more question, how does syntax-rules save me from something like: (let ((with-output-to-file (lambda (path) (error "Called the wrong one" path)))) (with-my-output-to-file "test.txt" (display "foobar"))) erkin: Not sure I get the question. dadinn: i've noticed on the tree-il it says (toplevel with-output-to-file) but I don't understand erkin: Oh I think I see. erkin: Yes, at expansion time, the `with-output-to-file' in `let' bindings is a separate symbol from the one in `with-my-output-to-file's definition. dadinn: how does it guarantee that the with-output-to-file is taken from the context the macro was defined, and not where it was expanded erkin: The standards leave the underlying implementation to the implementers but most of the time it's an automatically computed gensym system. erkin: Something like (let ((with-output-to-file~1 (lambda () 'junk))) (with-output-to-file~0 "text.txt" (lambda () (display "foobar")))) erkin: Where `with-output-to-file~0' is bound to the original top-level definition. erkin: Again, it's implementation dependent but that's the gist. dadinn: so the toplevel node I see in the Tree-IL is not a function object itself captured at the point of definition? erkin: You could say that, yes. dadinn: sorry, my question was in the negative, but actually I meant that that is what I would assume it was :) erkin: Oh sorry dadinn: coolio! erkin: I'm not entirely sure how Guile does it in particular but it captures the environment at the time. erkin: Fun fact: You can write macros that break hygiene (in a way) by nesting macros and abusing the literal list with forced captures: http://okmij.org/ftp/Scheme/Dirty-Macros.pdf erkin: It's practically impossible to do it by accident though. erkin: If you do want to break hygiene for sure (eg given a symbol `foo', you want to define `set!-foo' and `get-foo' in a macro), there's `syntax-case', a heavyweight superset of `syntax-rules' that comes with all sorts of utilities for operating on syntax objects. It's admittedly rather baroque and difficult for newbies to grasp (probably to discourage breaking hygiene at all). erkin: Ah, I need to sleep already. erkin: Good night! dadinn: erkin: Good night! thanks a lot! rndd: hi everyone! i don't understand these code https://paste.debian.net/1150543/ . Does length work as variable and can store numbers and is it 0 by default? nalkri: Length is a function that if it gets an empty list (the "null?" test) returns 0, if it gets a non-empty list it returns one plus the length of the same list minus its first element nalkri: That may or may not help :p rndd: nalkri: but where sum is stored -_-? nalkri: In the stack, if it's actually evaluated as a recursive function (I think it would be optimised to a loop really) rekado: rndd: it is not really “stored” rekado: try substituting the calls to “length” rekado: first try with the empty list rekado: (length '()) becomes (if (null? '()) 0 (+ 1 (length (cdr '())))) rekado: that becomes (if #t 0 (+ 1 (length (cdr '())))) rekado: and that becomes just 0 rekado: let’s try a longer list '(a) rekado: (length '(a)) => rekado: (if (null? '(a)) 0 (+ 1 (length (cdr '(a))))) rekado: (null? '(a)) is false, so the “if” expression becomes (+ 1 (length (cdr '(a)))) rekado: (cdr '(a)) is '() rekado: so that’s (+ 1 (length '())) chrislck: rndd would find time watching the first few SICP videos very well spent rndd: ohhh, so it becomes (+1 (+1 (+1 (+1 ... 0) ? chrislck: (1+ (1+ ... (1+ 0))))) yes nalkri: Thank you, and sorry for my lack of explanation mwette: b daviid: str1ngs: ar you connected to irc.gim.net (today)? I can't connct to either irc.gnome.org, nor irc.gim.ne today ... guix-vits: daviid: i'n not str1ngs, but those works for me. daviid: guix-vits: ok tx, i wonder why not 'here' daviid: guix-vits: hum, tx that worked ... daviid: I'll rport that to the gnome tam it's getting mor and more difficult ro connet to their servers ... apteryx: I'm trying to compile GNU Anubis with Guile 3, and getting: libguile.h: No such file or directory. Was this file only present in Guile 2? apteryx: ah no, it's present in both. probably it's looking at 2.2/libguile.h wingo: sneek: later tell civodul it is a good idea :) sneek: Got it. wingo: sneek: referring to the source slot in syntax objects wingo: o/ regtur: hi civodul/wingo, can I redirect your attention to the PEG patch I sent on May 11 (now that the copyright assignemnt is with the FSF)? civodul: hi regtur! civodul: thanks for pinging, i'm a bit swamped but i'll see if i can take a look soon civodul: sorry for the delay again civodul: actually perhaps others more familiar with PEG can comment, too regtur: would be greatly appreciated, thanks chrislck: manumanumanu: for (match) I always find it easier to write the match pattern whole before adding predicates. eg. (match input ((a b (c . d) e) ...)), then switching predicate inline: (match input ((a b (c . (? string? d)) e) ...)) dsmith-work: Happy Friday, Guilers!! allana: Hi #guile. I am beginning my journey into guile and scheme. I have been using GNU guix for a bit over a year now, maybe two. I have been struggling with package definitions in scheme, and I have decided that it really is time to take a deeper dive. I plan to use it professionally as well. I'm beginning this journey by reading through the guile "info" pages and playing around in the guile repl. Is this a good place to start? Would anyone allana: have other recommendations? sneek: Welcome back allana, you have 1 message! sneek: allana, terpri_ says: the patch should be in guix master very soon, simply haven't gotten around to submitting it properly yet rekado: allana: welcome! Playing with the REPL is a great way to get more comfortable with Guile. allana: rekado: Thanks for the affirmation. leoprikler: Can anyone tell me a good "syntax highlighting" package for Guile, that exports to LaTeX? rekado: I only know of https://dthompson.us/projects/guile-syntax-highlight.html, but it doesn’t export to LaTeX. It generates SXML or HTML. leoprikler: Well, I solved my problem somewhat – it just appears I was using listings the wrong way mwette: What's the best latex package for formatting Scheme code? leoprikler: I think people would normally point you towards minted, but I'm using listings, since minted is apparently a bit buggy in Guix. mwette: Thanks so much! I don't live on guix so I'll check out minted. manumanumanu: rekado: thanks. I had tried that, but PEBKAC. The predicate had a type error that I wasn't expecting dadinn: hi everyone dadinn: I am trying to write some basic simple macros in guile, but I am only finding obscure stuff about syntax-rules dadinn: I am used to the sane gensym macros in Clojure, is there anything like that in Guile... rather than this undocumented madness? erkin: Not fond of hygiene? erkin: syntax-rules is definitely not undocumented. You can find tutorials and guides for it all over the web. erkin: I can help you if there's anything in particular you're struggling with. dsmith-work: dadinn: Try this: https://www.scheme.com/tspl4/syntax.html#./syntax:h2 mwette: https://www.gnu.org/software/guile/manual/html_node/Syntax-Rules.html#index-define_002dsyntax_002drule erkin: Keep in mind that instead of directly working with lists (as `defmacro' does), Macro-by-Example style macro systems (such as `syntax-rules') work with templates. mwette: ^ define-syntax-rule is simple dadinn: erkin: the only thing I found was this article from 2008: http://www.willdonnelly.net/blog/scheme-syntax-rules/ erkin: There's this very well-written guide: http://www.phyast.pitt.edu/~micheles/syntax-rules.pdf dadinn: erkin: I've tried to read the original higenic macro thesis from 1986, but it's incomprehensible, didn't sounds something a practical person, who write real code, would come up with... so yeah, not that fond of hygiene yet dsmith-work: Yes erkin: It answers 90% of questions you could have about the workings of `syntax-rules'. erkin: Well, if it's any consolation, there are other languages who picked up Scheme's hygienic macro system, including Rust. dadinn: erkin: also, Clojure is really practical in this sense, and its gensym+namespaces gives a reasonable safety agains variable capture erkin: That's the Common Lisp approach. dsmith-work: I don't remember where I read it, I heard syntax-rules macros explained kind of like this, erkin: In addition, Racket has a very good and quick guide: https://docs.racket-lang.org/guide/pattern-macros.html dsmith-work: when doumenting a macro, you show a pattern of what the macro matches, and then what it would expand to. dsmith-work: Syntax-rules *directly* does thats. dsmith-work: Just a list of patterns and expansions. erkin: I'd say defmacro style isn't very suitable for long and complicated macros. It's very easy to write simple macros without having to think much about it but it quickly turns to spaghetti once it gets complex. erkin: The self-documenting nature of MbE templates make for readable and clear macros. dadinn: i was trying to write something like this: (define-syntax with-my-output-to-file (syntax-rules () ((_ path body ...) (with-output-to-file path (lambda () body ...))))) dadinn: nothing rocket science erkin: That macro seems fine to me. dsmith-work: Note that ... means zero-or-more dadinn: the error says wrong type to apply... and macroexpand returns a tree-il which is not that helpful either erkin: For something that simple, you can use the `define-syntax-rule' shorthand. (define-syntax-rule (with-my-output-to-file path body ...) (with-output-to-file path (lambda () body ...))) dadinn: this doesn't seem to work: (with-my-output-to-file "shitfuck.txt" (utils:println "FUCK!!!!") (utils:println "SHIT!!!!")) dadinn: sorry for the obscenity :/ erkin: What is utils:println? erkin: That macro works for me if I use `displayln'. dadinn: ah its just a function display + newline erkin: Can I see it? dadinn: is there a displayln function? erkin: Oh right, that's my own definition. It's a Racketism, sorry. dadinn: (define* (println #:rest args) (newline) (display (string-join args " ")) (newline)) dsmith-work: So here is a simple example, direct from the guile sources: dsmith-work: (define-syntax-rule (when test stmt stmt* ...) dsmith-work: (if test (begin stmt stmt* ...))) dadinn: dsmith-work: hmm... yeah I saw it somewhere, I think in the '86 paper that the template should end with ( body body ...) what's the point in that? erkin: Imagine it like a Kleene star. erkin: What's the point of having * in regexps be able to match zero arguments? :-) dsmith-work: Because (lambda ()) is not valid. dadinn: so if i want to have a rest argument called `foo`, then the pattern has to end with (foo foo ...)? dsmith-work: Name the second foo something else. But yeah. erkin: If you want a syntax list whose car is foo and cdr is bar, just use (foo . bar) dsmith-work: Or use . dsmith-work: Like page 5 of http://www.phyast.pitt.edu/~micheles/syntax-rules.pdf mwette: I like the explanation of macros in this: https://www.scheme.com/tspl4/ erkin: Like (define-syntax-rule (when-let (value condition) . body) (let ((value condition)) (when value . body))) dadinn: dsmith-work: why lambda () is not valid? dsmith-work: Can't have an empy body erkin: For the same reason () isn't valid. A function needs to return something. mwette: Section 3.1 dsmith-work: (lambda () somthing) is ok, (lambda () ) is not dadinn: dsmith-work: sure, but lambda has the body, and it has no arguments because with-output-to-file expects a no-argument thunk only dsmith-work: Why is ... like that? It's easy to make one-or-more from zero-or-more, but not the other way around. dadinn: dsmith-work: I am not sure, what is wrong with it? In the tutorial I found, that's what it said how ... should be used :/ dsmith-work: Sure. dsmith-work: The usual convention if you want one-or-more is foo foo* ... dadinn: I am not getting what's the point of this pattern/template thing, all I wanted is `(with-output-to-file ,path (lambda () ,@body)) but with syntax-rules I have no clue how to achieve that erkin: You don't need ... for this. dadinn: also, I am not sure how to call my macro with-output-to-file in my utils module, and not to override the builtin version :/ erkin: (define-syntax-rule (with-my-output-to-file path . body) (with-output-to-file path (lambda () . body))) dadinn: hmm, that looks simple... does it take the name from the pattern automatically? erkin: `define-syntax-rule'? dadinn: yes erkin: Yes, it expands to (define with-my-output-to-file (syntax-rules () ((_ path . body) (with-output-to-file path (lambda () . body))))). erkin: It's for writing single-clause macros with no literals. dadinn: erkin: fair enough erkin: In case you're curious, good example of a recursive, multi-clause macro with literals would be the implementation of `cond' using `if'. erkin: http://pasterack.org/pastes/341 dadinn: i am still confused about the meaning of ... , i thought it would behave something like #:rest in define*, but because of the dual variables I am still unsure how to interpret it erkin: It matches every token that could fit there (including none), verbatim. ArneBab: wingo: wow — cool! (more meaningful comments when I’m through :-) ) lloda: how to set the compilation flags for autocompilation? lloda: ah %auto-compilation-options lloda: can this be set per module? civodul: hey! civodul: lloda: it's a global variable lloda: right lloda: do people actually precompile their Scheme? i rely entirely on autocomp lloda: actually it isn't clear to me how one would set -o2 or w/e in %auto-compilation-options lloda: I cannot find the format in the manual lloda: the default is just a list of warning symbols lloda: guild compile -Ohelp lists the flags but the summary options -O0 etc aren't available to %auto-compilation-options, or are they lloda: I think I might have asked this before sry lloda: oh (@ (system base optimize) optimizations-for-level) wingo: lloda: hey this changed recently! wingo: lloda: (use-modules ((system base compile) #:select (default-optimization-level))) wingo: (default-optimization-level 2) wingo: or use parameterize, etc wingo: same for default-warning-level chrislck: some error after converting all _ to gettext for guile-3.0: "WARNING: loading compiled file (...) load-thunk-from-memory: incompatible bytecode kind" using guile-3.0.1 chrislck: oh guile-3.0 was looking into guile-2.2 cache wingo: maybe you had some precompiled .go files in your GUILE_LOAD_COMPILED_PATH that were compiled with an older guile chrislck: right. civodul: wingo: optimizations-for-level is still there though, right? wingo: civodul: yes :) wingo: though it isn't used in guile any more civodul: phew :-) civodul: ah ok wingo: whenever you can migrate to passing #:optimization-level as a param to compile-file, you should do so wingo: no urgency tho civodul: ok lloda: neat thx wingo wingo: civodul: incidentally one place to look for improving compile speed at -O0 / -O1 would be making fix-letrec do something simpler instead of computing SCCs wingo: like just do the standard letrec conversion instead or something, dunno wingo: or maybe it can be optimized in some better way wingo: b/c letrectification can produce big graphs to be teased apart into scc's wingo: (at higher levels) civodul: wingo: ok civodul: i haven't put any thought into all this! manumanumanu: wingo: fyi, your blog posts have been instrumental in getting me to understand what guile is doing behind the scenes. Not that I understand much, but reading through the guile posts over the last 10 years has made me write better code :D wingo: tx :) wingo: civodul: just responded to your mail. i think you will enjoy the statprof fix :) manumanumanu: funny to see that the -O2 produces almost the same quality code as O1, except for some select benchmarks, where the gains are substantial. That is pretty cmuch in line with my own non-structured benchmarking of code. wingo: you mean -O3 vs -O2 perhaps? wingo: -O2 is significantly better than -O1 wingo: also note that the meaning of -O1 changed in master to also include -Oresolve-primitives wingo: which it had excluded previously for $reasons manumanumanu: yes dsmith-work: Heigh Ho, Guileers lloda: is it fair to see that @@ shouldn't be used inside Guile? lloda: s/see/say wingo: lloda: inside guile it's fair game wingo: but better to export interfaces that are important wingo: i mean to say it's totally possible but best to design something we aren't ashamed of :) lloda: I used (@@ (ice-9 arrays) array-print-prefix) in pretty-print b/c I didn't want to export it lloda: but then I used it outside Guile lloda: but again I don't want to export it if I'm the only user :-| wingo: lloda: in this case i think it's fine :) wingo: like if it breaks you are holding both pieces and it's your fault ;) wingo: but probably since you are holding both pieces it won't break! lloda: ok :) i'll let it be bjoli: Did you ever feel that you couldn't fizzbuzz fast enough? Look no further, I have made a (really just one procedure) module to generate wheels: https://git.sr.ht/~bjoli/wheel-utils. Now you can fizz and buzz at twice the speed, generating gigabytes of fizzing and buzzing data! bjoli: i had it lying around. Some old code from 15 years ago when I did programming in HS. My teacher did not like that solution, even though it was by far the fastest and simplest to extend. Bless his poor soul. chrislck: they taught lisp in HS?/?? bjoli: nah, I just implemented everything in scheme and ported it to whatever programming language we had to use. chrislck: very interesting that every lisp hacker has their own style :) dsmith-work: I guess Scheme is malleable enough that it can encode your ideas directly *: chrislck made it a personal mission to eradicate most unreasonable set! from gnucash, and this is now nearly complete dsmith-work: A worthy endeavor dsmith-work: A long time ago, you could make guile code faster by using set! everywhere (less garbage to collect) dsmith-work: Now it's the opposte. It constrains the compiler. civodul: yup :-) chrislck: 🕺 chrislck: also many, many loops reduced to 1 to minimise nested loops 🕺 chrislck: less embarassing code now 🕺 bjoli: Isn't also one problem that set! implicitly boxes things? bjoli: which makes type inference not work properly and all that jazz? civodul: wingo_: thanks a lot for the statprof fix, you made my day! :-) civodul: wingo_: so the reap-pipes issue is indeed very weird civodul: mwette reported it recently: https://lists.gnu.org/archive/html/guile-devel/2020-05/msg00019.html civodul: i guess running hooks is quite expensive because they're written in C civodul: but i wonder if that's the only explanation wingo_: i think that's not the explanation, guile already has some after-gc hooks for other reasons i think wingo_: i think that hook is somehow busted; not sure tho civodul: oh and i had forgotten that 'syntax-source' is written in terms of 'source-properties' civodul: no wonder we're putting pressure on source-whash wingo: yeah would be nice to have a better reader! terpri_: bjoli, i used to write tiny sets of lisp primitives in c and used it for all my cs homework (ignoring gc, etc.) terpri_: probably looked very strange to my professors, but i never got a complaint about it :) wingo: nice :) ahungry: Sounds a lot like https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule dsmith-work: wingo: What's with the reader? wingo: dsmith-work: would be nice if it returned datums + source location info wingo: instead of datums + noodling around with weak source location table civodul: wingo: there could be a "source" slot in syntax objects, just like for tree-il nixfreak54: Does anyone have articles , tutorials on how to use guile for everything especially replacing it with bash scripts ? I'm looking for a language that I can script anything with , sort of like python justin_smith: nixfreak54: I've thought about using this more, but haven't yet done so in anger https://github.com/ChaosEternal/guile-scsh/blob/master/docs/cheat.txt https://github.com/ChaosEternal/guile-scsh/blob/master/examples/guile-scsh.scm justin_smith: also this doc https://github.com/ChaosEternal/guile-scsh/blob/master/USAGE nixfreak54: sweet thanks justin_smith nixfreak54: why in anger though , just curious justin_smith: nixfreak54: oh, that's an idiom / saying justin_smith: it just means "this looks cool, I tried it, but haven't used it enough to really judge it" justin_smith: in other words, I used it for fun, but didn't have a reason to be angry at it yet :D dsmith-work: "in anger" could be translated "in production". bjoli: wingo: there has to be more or less portable readers available, no? Or is one of the catches that it has to be in C? nixfreak54: alright , well thanks again I appreciate it manumanumanu: the chez reader seems _ok_, and should be a lot simpler once a lot of the chez specific stuff is removed. I don't really understand the licensing stuff, though. civodul: manumanumanu: i think there'd have to be an implementation in C civodul: earlier wingo suggested that it could be Scheme code "transpiled" to C ArneBab: I’ve been unable to guix pull for two months now — recently started upgrading directly from a git clone. Do you have a hint how I can fix that? ArneBab: $ LANG=C guix pull ArneBab: Building from this channel: ArneBab: guix https://git.savannah.gnu.org/git/guix.git 790ada9 ArneBab: s … ArneBab: building /gnu/store/kmzfd8avp1qskknh4z62birwvdja9ixy-module-import-compiled.drv... 4% [##### ]builder for `/gnu/store/kmzfd8avp1qskknh4z62birwvdja9ixy-module-import-compiled.drv' failed with exit code 1 ArneBab: damn… wrong channel, sorry! manumanumanu: chrislck: your work on the gnucash codebase is amazing. I suspect it has gotten faster as a result. manumanumanu: So many small things must add up manumanumanu: regarding match: i have the pattern (name . children), and I want to check name against a predicat. Is that possible with the (? pred? name) way? manumanumanu: ie: i want to match a (name . children), but only if name satisfies a predicate rekado: manumanumanu: yes, this should work rekado: this will not match: (match '(12 "world") (((? string? name) . rest) name)) rekado: but this will: (match '("hello" "world") (((? string? name) . rest) name)) mwette: (match '(name . "value") ((? (lambda (p) (symbol? (car p)))) #t) (_ #f)) => #t mwette: I like rekado's better. gmaggior: Sorry, can a guile .scm file can be compiled into a standalone executable? daviid: gmaggior: no sneek: Welcome back daviid, you have 1 message! sneek: daviid, str1ngs says: Hello something has changed with (gtk-container-get-children (make )) before it would return '() now it returns #f is that intended? https://developer.gnome.org/gtk3/stable/GtkContainer.html#gtk-container-get-children only documents it returns GList* from my experience the C api does not return #f. gmaggior: daviid, thanks daviid: gmaggior: what we do, is we write a guile script with --no-auto-compile -e main, that is minimal and import compiled modules - this way, for a user, it looks like it's an applcation, so to speak gmaggior: daviid, oh ok fine! daviid: str1ngs: the thing is that the scheme representation for NULL is #f, not '() - it is so much 'spread' in GI, that I think it is better to stick to that 'definition' RhodiumToad: moo daviid: gmaggior: here is an example http://git.savannah.gnu.org/cgit/foliot.git/tree/foliot/foliot.in - note that the autotool chain, the configure step to be precis, will generate a 'foliot' file, which is installed 'as in' $prefix/bin/foliot gmaggior: daviid, many thanks! I'm checking it out daviid: str1ngs: to be 'consistent', otherwise what is NULL for string(s), #f or "" ... I thing by sending the message to g-golf users that NULL 'is' #f and #f 'is' NULL (converted to/from ...) is 'more reliable' (?) daviid: gmaggior: welcome - what tells the autotool chain to install 'foliot' as a script is in Makefile.am, line 77 daviid: str1ngs: I had a guix clone, and did pull today, it seems that all it takes to prepare a patch is to change the commit variable then the (sha256 (base32 ...)) expression I guess ? daviid: str1ngs: i see they added ("gettext" ,gettext-minimal) depency - which is a bit of a surprise, I don't use it ... would that be because of texinfo? showing my ignorance here ... foliot does use gettext, but not g-golf, nor guile-cv str1ngs: daviid I think gettext is for bootstrapping configure.ac str1ngs: daviid: in the case of GList* I'm use to '() not #f. I think this might be easier to use from a coding stand point. Since it's more useful to get length of the list then to have to handle two different types? Just my thoughts I can work around it around it. so your call. daviid: hum, in this case, it should be 'covered' by the autoconf/automake dependency, just curious, no big deal here str1ngs: I don't think autoconf or automake provide gettext. the gettext macro is something that only comes up with because of guile.m4. I can double check that dependency though see if it's really needed. daviid: str1ngs: oh guile.m4 imposes gettext daviid: ? daviid: I think gnome users should expect to recieve #f for gnome lib calls that return NULL, and hence always do (and val (what-ever-with val)) daviid: str1ngs: that maks more sence (to me) then configure.ac imposing gettext ... now, why does guile.m4 requires gettext, I do't know str1ngs: if gettext is not install then autoreconf -ivf fails with configure:12707: error: possibly undefined macro: AC_LIB_LINKFLAGS_FROM_LIBS. I tested on ubuntu-20.04 btw str1ngs: daviid: does gtk_container_get_children actually return null? str1ngs: err NULL daviid: str1ngs: very highly probably, otherwise you'd rceiv a list RhodiumToad: I had a similar issue with guile-gnome on freebsd, it needed a dependency on gettext to get at lib-link.m4 daviid: that failure above, to me tells that autoconf should depend on gettext daviid: not g-golf RhodiumToad: no, it's not autoconf itself that's the issue str1ngs: I don't think its and autoconf issue either. this tends to happens with guile projects. I suspect guile.m4 RhodiumToad: AC_LIB_LINKFLAGS_FROM_LIBS is from lib-link.m4 which is part of gnulib, not autoconf str1ngs: git grep AC_LIB_LINKFLAGS_FROM_LIBS shows guile.m4 daviid: fine, but the package that defines AC_LIB_LINKFLAGS_FROM_LIBS, if it needs gettext, should impose th dpendncy, don't you think? RhodiumToad: that's not the issue RhodiumToad: at least on freebsd, "the package that defines AC_LIB_LINKFLAGS_FROM_LIBS" _is_ gettext str1ngs: right in this case g-golf is providing guile.m4 in m4. so it's only need because we use git and not a release tarball. str1ngs: AC_LIB_LINKFLAGS_FROM_LIBS is provided by gettext but in this case it used by guile.m4 RhodiumToad: yeah, I needed the gettext dependency for guile-gnome in freebsd because I needed to patch the configure.ac extensively str1ngs: if you did not use guile.m4 then gettext would not be needed. so it's really a g-golf native bootstrap dependency RhodiumToad: (because it had no way to tell it what components to include or not regardless of what was actually installed) daviid: RhodiumToad: oh i see, why is that it is gettext that defines AC_LIB_LINKFLAGS_FROM_LIBS, that sounds really strange daviid: again, no big deal, just being curious str1ngs: maybe gettext use gnulib? IIRC its some thing related to gnulib as RhodiumToad mentioned. RhodiumToad: I don't know RhodiumToad: all I know is what ports provide what files str1ngs: I just added the dependency and avoided the rabbit hole haha daviid: i'm gona ask on #autotools, why autoreconf -vif fails unless gettext is installed and if they considr this 'normal' str1ngs: later it's a mote issue because the release tarball won't need autoreconf any ways. daviid: right str1ngs: it only fails if the project uses guile.m4 keep that in mind. daviid: but yet, a strange rabbit hole :):) str1ngs: daviid: let me know what you decide about gtk_container_get_children daviid: str1ngs: what would you return a string and gnome returns NULL str1ngs: I'm more in favor of '() then #f . but I can use #f if needed, it just requires an extra step type checking. str1ngs: GList* is a list not a string. and the docs don't say it actually returns NULL so I can test what the C api returns if it helps? daviid: str1ngs: the problem is not so much lists, but to be consistent, daviid: str1ngs: I don't pretnd I hld the right answer, I did ask myself so many times ... but as things are, when an argument is a pointer to 'anything', if it is the %null-ponter, g-golf rturns #f, and when passing, if #f, thn it passes NULL ... daviid: str1ngs: g-golf users are gnome users, they have to read the manual of the lb they are using ... if tha arg is a pointer, they must expct #f if ... which sounds very reasnable to me daviid: str1ngs: but we can see and improving tin the future ... though it would be quite a lot more work then it seems daviid: str1ngs: but for thee time being, I'll (have to) stick to the rule exprsses above - if an argument or returned value of function of a gnome lib is a pointer, g-golf users must expect pass or receive #f ... daviid: str1ngs: I still have so many important things to do ... str1ngs: again gtk_container_get_children does not return NULL it returns a GList* if there are not children it has length of zeron str1ngs: daviid: I just verified this with the C api and that's how I've always used it myself. if you return #f on no children then it changes the return type. but it's your call at the end of the day. daviid: str1ngs: NULL is not a type, it is a value daviid: when you call gtk_container_get_children and there is no children, gnome returns NULL str1ngs: gtk_container_get_children does not return NULL it returns a newly-allocated list of the container’s non-internal children. daviid: this, in g-golf, up to now, pass through the same code, no matter what the 'final type' is ... but we can improve that i the future, it's not a priority to me though str1ngs: no this was not always the case something changed before I could simply do (length (gtk-container-get-children container)) to see how many children a container had. now I need to type check gtk-container-get-children if its a boolean or not. daviid: str1ngs: it changed? daviid: hum daviid: str1ngs: I did work on glist gslist a little while ago, and also added quite a few other similar procs, like gi-n-gtype->scm, scm->gi-n-gtype ... daviid: I didn't thnk I 'changed' what we had, I'll check better str1ngs: daviid: okay thanks, specifically (gtk-container-get-children (make )) use to return '() now it returns #f daviid: str1ngs: ok - note that the gi-argument for the returned value of gtk-container-get-children is definitely being set to NULL when there are non-internal children, that is a fact - which is not a 'justification' but that is why 'the change' made it so you see #f now (because I sort of uniformed any gi-argument-ref/set I suppose, I'll check and fix the problem daviid: str1ngs: ther are many places I need to loo and fix, improve th tst-suite, but i the man time, you can edit (g-golf gi utils), and change line 238, replace #f with '() daviid: str1ngs: that won't be enough - better wait for a good patch daviid: str1ngs: ok, I pushed a fix for glist, gslist, I'll fix the other cases, strings, pointers, gtypes ... asap tohoyn: sneek, botsnack sneek: :) str1ngs: daviid: great will test this out thanks. I'll probably mail a patch for the guix declaration in the morning as well. daviid: str1ngs: wrt to the guix patch, let's wait I fix all occurrences of the problem you mntionned today, I'll let you know, a few days probably ... str1ngs: daviid: sounds good. I'll stage something meantime then let me know. should not be much work then. str1ngs: daviid: btw instead of using examples. I've started to just make unit tests. so as long as you are covering the low level. I should start to accumulate more GTK case coverage. see http://git.savannah.nongnu.org/cgit/nomad.git/tree/test-suite/tests/gtk/widget.scm?h=feature-g-golf daviid: str1ngs: nice dsmith-work: {appropriate time} Greetings, Guilers guix-vits: Guest61703: i was though g-golf is perfectly legal :P *: guix-vits `(webkit-settings-new)`, yay. ArneBab: wingo: what’s the reason for the 16x speedup of O3 over O2 in the mbrot benchmark? https://wingolog.org/pub/guile-3.0.3-optimization-level-microbenchmarks.png civodul: ArneBab: the difference between -O2 and -O3 is "sealed bindings", so we'd need to look at mbrot to try and see why it matters there civodul: it can make a difference if there are lots of small top-level procedures wingo: probably unboxing wingo: probably a loop inlines or contifies a small helper that otherwise forced boxing civodul: ah yes dsmith-work: With -O3 sealed bindings, are non-exported things visble to @@ ? civodul: dsmith-work: sometimes, but not always, depending on inlining civodul: you can no longer rely on @@ when using -O3 ArneBab: wingo: ah, nice wingo: https://wingolog.org/archives/2020/06/03/a-baseline-compiler-for-guile civodul: wingo: yay, excellent! civodul: thank you! rgherdt: really nice, thanks daviid: str1ngs: whenever you have a minute, please update and pick-up the latest commit for the g-golf guix package definition, thanks! apteryx: hmm... what does call-with-blocked-asyncs do exactly? "block the execution of system asyncs by one level for the current thread while it is running." What are "system asyncs" ? apteryx: ah, https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/System-asyncs.html str1ngs: daviid: just to clarify you want me mail a patch to bump the guix hash to g-golf tip? daviid: str1ngs: I would do that yes, many things have been fixed ... 'we' probably will need to do that a couple of times from now till the first alpha release, but now is a good time I think daviid: str1ngs: I was/am assuming it's easy and not (very/to much) time consuming ... wdyt? daviid: str1ngs: I also thought you could 'point to the latest commit' without to have to go through a patch review 'cycle' - since the package is in already, iiuc - and that you had commit rights for g-golf in guix ... and so that these 'updates' on guix would really just take a few minutes ... to many assumptions maybe :):) str1ngs: daviid: I use a local g-golf.scm declaration myself which tracks g-golf develop tip. I plan to periodically send patches upstream to guix when needed. Maybe I can treat g-golf master branch as semi stable? Submitting patches to guix are not a problem. It's mainly the contributors there are pretty busy. str1ngs: daviid: I'll submit a patch though that updates to g-golf's current tip. Then just ping me when you git milestones you'd like guix to be updated to. This until g-golf hits point release status. WDYT? str1ngs: s/git/hit daviid: str1ngs: if g-golf is in guix, which it seems it is, then I think it should be updated yes, and now is a good time - I merged everything to master indeed ... lloda: lol @ the analyis bug leoprikler: hugo: not really, but you can roll your own if you use a let-bound parameter/variable pair leoprikler: You do have to be careful with that however, since you need a set! and set-default! somewhat equivalently to Emacs Lisp then leoprikler: Come to think of it, you might want to look into the Guile implementation of Emacs Lisp for hints hugo: leoprikler: How do you mean let-bound parameter/variable pair? leoprikler: Hmm, let me implement a MWE shortly dsmith-work: {appropriate time} Greetings, Guilers civodul: hey, dsmith-work! leoprikler: hugo: https://dpaste.org/R8yk leoprikler: you can get slightly different results if you use thread-local-fluids leoprikler: of course you can also use records and what not tinga: Hi. Is there a package for Guile, or do I need to install packages like guile-json manually? (Can't see any mentioned in the guile docs.) tinga: Is there a package *manager leoprikler: btw. there's a typo, the first "other" should be "old" leoprikler: tinga: There's guix ;) tinga: Found https://github.com/ijp/guildhall, should I install that first if I want to install guix's dependencies like guile-json? tinga: leoprikler, I'm on my way to installing guix leoprikler: what distro are you on? tinga: (Choosing from source as I always prefer.) tinga: Debian testing civodul: tinga: i'd recommend the binary tarball: https://guix.gnu.org/manual/en/html_node/Binary-Installation.html tinga: Well, if people are using guix as package manager for guile, then I'll just install the few dependencies Guix has manually I guess. civodul: but recent Debian has many of Guix' dependencies available civodul: and soon a guix package as well tinga: civodul, debian's guile-json etc are all for guile 2.2 civodul: well that's ok leoprikler: you can bootstrap an older version of guix, then upgrade to a newer one tinga: Hmm OK, I'll go with guile 2.2 from debian then install newer guile from within guix I guess. civodul: yeah, "guix pull" will give you that tinga: civodul, ok, maybe it's worth mentioning that in the README, too :) (i.e. "guile 3 is preferred but you can install via guile 2.2.x then run guix pull") civodul: yeah, but like i wrote, the recommendation is to use the binary tarball str1ngs: sneek later tell daviid. Hello something has changed with (gtk-container-get-children (make )) before it would return '() now it returns #f is that intended? https://developer.gnome.org/gtk3/stable/GtkContainer.html#gtk-container-get-children only documents it returns GList* from my experience the C api does not return #f. sneek: Okay. str1ngs: civodul: hello, I recently built guix locally with ubuntu-20.04 with only dependencies from Ubuntu repositories. So the debian packages have trickled down to ubuntu as well. I forget who contributed those packages but it's been useful. tinga: civodul, I'm still one of those people who cares about avoiding binary installs if possible (unless it's reproducible builds) wingo: https://wingolog.org/pub/guile-3.0.3-optimization-level-microbenchmarks.png civodul: str1ngs: we owe most of them to vagrantc, great work! str1ngs: tinga: what version of debian are you using? double check guile 3.0 does not exist already. it's possible if you are say using buster it exists. dsmith-work: wingo: v3.0.2-122-ge2066d2e6 shaved a few minutes off build times. Now 32 min for me civodul: tinga: Guix is kinda about reproducible builds :-) str1ngs: civodul: ah thanks for refreshing my memory. I meant to thank him for the work on that. tinga: str1ngs, it does, but there are no -json nor -sqlite3 etc debian packages for guile 3 in testing wingo: dsmith-work: great :) tinga: civodul, yep, that's one reason why I'm interested in it, so I also want to install guix itself in a reproducible manner, hence avoiding binary install. str1ngs: tinga: ah gotcha. I personal use guile2.2 for non guix reason. civodul: wingo: so you hardcoded an mbrot pass in the compiler or what? ;-) civodul: the new match/case optimization is at -O2, right? str1ngs: tinga: the thing with building guix locally is you still end up pulling base binary substitutes unless you boostrap the world. which is not worth it unless you have a specific reason too. so using the binary install is actually quite beneficial in the long run. wingo: civodul: haha no, that good performance was already there fwiw wingo: the change relative to 3.0.2 is small -- https://wingolog.org/pub/guile-3.0.3-vs-guile-3.0.2-microbenchmarks.png wingo: civodul: yes that optimization is in -O2 and above tinga: str1ngs, sad to hear, how is using the binary install "beneficial"? *: dsmith-work needs a bigger monitor wingo: i think its effects don't really show up on the benchmark because you really want a user-written "match" facility written as a macro in the source language for it to be really useful hugo: leoprikler_: Is my understanding that your make-parameter-variable uses the let scope to create thread-shared variables, and fluids for those with limited extent? wingo: and those microbenchmarks don't exercise generated code so much wingo: or not that kind of macro-generated code anyway hugo: I also don't understand how records would solve anything here? Or do you mean that I should put a record in my fluid, and set the fields of the record, since only a pointer is actually stored in the fluid? str1ngs: tinga: I am of the same school of thought as your self. I prefer to build most things from source as well. though I tend to now look at guix as a special case. Since it is highly repeatable and trustable. civodul: wingo: so big match expressions found in the compiler are the kind of code that should benefit, right? tinga: str1ngs, also, as I said, if reproducible then that's fine with me (allows to be verified by community effort unlike non-producible builds), so if "base binary substitutes" are built reproducibly then that's not so bad. wingo: civodul: yes i think so. it's the code i had in mind when writing the optimization anyway wingo: match expressions with many similar clauses str1ngs: tinga: right that's the case here. the beneficial part is technically it's only useful to build and install from source when you plan to bootstrap everything. If you don't then you end up pull the substitutes you got with the binary install anyways. str1ngs: tinga: another useful case is if you install the daemon with the binary install. But don't want to use guix environment guix all the time, specifically this needed on foreign distro's. tinga: civodul, is it true that the guid binary installs are built reproducibly? (e.g. https://ftp.gnu.org/gnu/guix/guix-binary-1.1.0.x86_64-linux.tar.xz) wingo: civodul: https://wingolog.org/pub/guile-3.0.3-compile-times.png wingo: just uploaded a better version lloda: o3 compiles faster than o2? wingo: yes, because it seals private bindings wingo: meaning that anything not exported becomes a private letrec-bound definition, subject to contification / etc wingo: so in general such programs are smaller leoprikler_: hugo: no, you could use a record, that contains both a fluid/thread-local-fluid/parameter and a raw value and some accessors with the same effect as my let-based solution but perhaps a nicer naming scheme hugo: leoprikler_: Let or record doesn't really matter. So my question is if the core concept here is that "regular" variables are shared between all threads? leoprikler_: regular variables/let bindings are always shared, hence the evil-ness of set! leoprikler_: in a similar manner, you can get quite evil results with destructive list operations, e.g. filter! civodul: wingo: interesting figures civodul: i think it's largely a function of the file's size wingo: what's a function of the file's size? civodul: the cost civodul: the compile time i mean wingo: not sure that it's simply file size hugo: leoprikler_: Thank you. I will probably go with something along those lines. Possibly wrapping up the "regular" variable in an atomic box civodul: wingo: not only that, but i think it's an important factor civodul: trivial code in a very large file takes a long time to compile wingo: could be civodul: the -O3/-O2 difference for assembler is interesting civodul: much more visible than with the other files wingo: anyway i think that with the baseline compiler these issues are solved, wdyt? civodul: yes, i think so civodul: well "solved" is a strong word if we aim for GCC (or tinycc!) compilation speeds ;-) civodul: but yeah, it should definitely make a big difference already wingo: hehe wingo: yeah but more progress can be made. wingo: at this point it's easier to profile as well civodul: yes civodul: and all that said: it's a great improvement wingo: i.e. get a breakdown between read / expand / optimize / emit civodul: thanks a lot for that civodul: right civodul: also for Guix i'd like to provide expansion civodul: try to see if there's something we can improve in all these macros civodul: but it's hard to profile because that runs on eval wingo: probably eval can be improved too wingo: civodul: fyi my compile-times graph was wrong wingo: i was measuring the wrong thing for -O1 wingo: https://wingolog.org/pub/guile-3.0.3-O0-O1-O2-O3-compile-times.png is the thing wingo: night! civodul: wingo: thanks for the update & good night! civodul: ah yes -O1 is much lower than before civodul: even slightly faster than -O0, uh civodul: i guess peval removes a bit of work or something civodul: anyway: thumbs up! tohoyn: daviid, str1ngs: do you have experience about publishing software on Savannah? daviid: tohoyn: yes daviid: str1ngs, tohoyn, I just pushed aother series of patches that shouldn't affect your respective code, but yet ... when ever possible, please pull, make, check and let me know if there is a problem ... tohoyn: daviid: I'll check that daviid: ok great tohoyn: daviid: could you look at https://savannah.nongnu.org/task/?15647 ? I don't understand what is wrong with my licenses. RhodiumToad: isn't the problem that they want you to use "gplv3 or any later version", not just "gplv3 only" ? tohoyn: RhodiumToad: quote from the license header: "... either version 3 of the License, or (at your option) any tohoyn: ;; later version." RhodiumToad: did you say that in the application, though? tohoyn: RhodiumToad: See https://paste.gnome.org/pqhmzxxwe . There may be something wrong with the license header. RhodiumToad: no RhodiumToad: I mean in your "registration details" on that page tohoyn: RhodiumToad: do you mean the Savannah project page? RhodiumToad: at the link you posted, under "Registration Details", it says "License: Other license (Most of the software is licensed under GPL v3. The documentation is licensed under GFDL-1.3. Some library modules are licensed under LGPL v3. ) " tohoyn: how should I change it? daviid: the header lacks a copyright though ... but i'll let RhodiumToad helping you ... not that they will check every file and they all must be 'ok' wrt to their license policy ... RhodiumToad: try "... Most of the software is licensed under GPL v3 or later. The documentation is licensed under GFDL-1.3. Some library modules are licensed under LGPL v3 or later." daviid: *note RhodiumToad: (I don't know if the GFDL has an "or later" but if it does, include that too) RhodiumToad: g-golf's page says it's lgpl v3 or later, so that's ok RhodiumToad: just remember that any time you mention the name of a license, always include or not include the "or later" part according to whether the thing being licensed does in fact specify that or not RhodiumToad: i.e. treat "gpl v3" and "gplv3 or later" as if they were completely different licenses RhodiumToad: note that I'm basically just guessing here based on the other guy's responses tohoyn: daviid: I checked the new G-Golf with Theme-D-Golf. it worked fine. daviid: perfect, tx tohoyn: is it so that Guile bytecode files should not be stripped? dsmith-work: Monday Greetings, Guilers dsmith-work: tohoyn: Right. Don't strip .go files dsmith-work: Only portions that are needed are loaded. But when you need it, it's there (like debug info) tohoyn: dsmith-work, tx heisenberg-25: Hi, quick question about using automake tools for guile. After running GUILE_PKG([3.0 2.9 2.2]) in configure.ac, the $(GUILE_EFFECTIVE_VERSION) is empty in my Makefile.am. what am I doing wrong? or do I have to re-run GUILE_PKG([3.0 2.9 2.2]) in the make file too civodul: heisenberg-25: "2.9" was never a valid effective version civodul: in Makefile.am, you can do: GUILE_EFFECTIVE_VERSION = @GUILE_EFFECTIVE_VERSION@ str1ngs: heisenberg-25: $(GUILE_EFFECTIVE_VERSION) should expand if you use GUILE_PKG . make sure you run autoreconf -ivf and ./configure again. manumanumanu: Hello everyone! dsmith-work: manumanumanu: I was very plesantly surprised that Rust has such a capable macro system. But.. Icky too. Because it can only use valid rust tokens. manumanumanu: yeah! I have seen some nice uses for it. Giving rust tco, for example :D heisenberg-25: civodul: I set it and it still giving me issues. The error I am getting is during make install, it is failing with "mkdir: /usr/local/guile: Permission denied, mkdir: /usr/local/guile: No such file or directory". heisenberg-25: so I thought the $(GUILE_EFFECTIVE_VERSION) might be empty as I have set moddir=$(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION) heisenberg-25: str1ngs: I'm using GUILE_PKG heisenberg-25: so $(info GUILE_VERSION is $(GUILE_EFFECTIVE_VERSION)) prints the correct version, so the $(GUILE_EFFECTIVE_VERSION) is being set :/ str1ngs: heisenberg-25: probably in your case you want to do sudo make install dsmith-work: As in, you need to have permssions to make the dir. dsmith-work: I think if you are in the "staff" group on Debian you can scribble there. heisenberg-25: str1ngs: I fixed it by changing the dest installation. Thanks :) str1ngs: heisenberg-25 no problem, I'm assuming you changed it to a prefix you have write access to? roptat: hi, I'm trying to parse a big xml document (200MB) with guile, and using xml->sxml is not practical, as it is taking forever (and currently taking 3GB of memory...). I see there's a (sxml ssax) module that sounds more promising as it could allow me to process the xml file without having to load it all in memory first roptat: there's an introduction to it in the manual, but there's no example or documentation of the function, only a list of them. Is there any other place I could find some information about how to use this module? civodul: roptat: (guix import snix) uses it if it can help dsmith-work: As the documentation says: "SAX parsers are more efficient, but much harder to user" roptat: especially when they are not documented :p civodul: :-) roptat: I'm looking at the code for (sxml simple) civodul: (guix cve) used to use it also roptat: thanks for the help, I think I'll be able to do what I want :) heisenberg-25: is there any way to embed guile in a website? heisenberg-25: found this https://ideone.com/l/scheme-guile but not sure if it supports embedding rgherdt: heisenberg-25: regarding guile I don't know, but take a look at biwascheme hugo: Is there some good alternative to parameters for multi threaded programs? I want to be able to change the value in a limited scope, but still being able to override the global from any thread. hugo: I know I can roll my own, but something well thought through might work better marusich: What module provides the "rename" procedure? I'm looking at the manual and cannot see it. sneek: Welcome back marusich, you have 2 messages! sneek: marusich, lle-bout says: I built your branch: http://dpaste.com/0ANRXXB sneek: marusich, lle-bout says: it's getting minimal! I could bootstrap successfully with only the following patch on top of GNU Guix's current master https://gitlab.com/lle-bout/guix/-/commit/6d06c0edfe1806100a9ca42b99f002f1244c1dd9 marusich: Never mind, I was looking for rename-file. marusich: To answer myself, it is built in - importable without using any modules explicitly - which is why no module was mentioned in the manual. Sorry for the noise! lle-bout: I was wondering; could GNU Guile benefit from a noticeable speed bump aided by an hardware accelerator like an FPGA over PCI-e or OpenCAPI, or even standard USB? I'm thinking FPGAs come to give great opportunity to all interpreted languages to get up to speed with compiled ones, while still remaining modular. GNU Guile could dynamically reprogram an FPGA to aid itself at ever evolving tasks. ArneBab: lle-bout: do you mean like a support-processor used by the JIT-compiler? lle-bout: ArneBab, yes, something like that lle-bout: But it doesnt need to be about JIT-ing - it can be executing Scheme directly on the FPGA by programming an optimized interpreter to that FPGA, or compile Scheme directly to an FPGA circuit lle-bout: ArneBab, there exist small FPGA that fit into a small USB stick, I'm wondering if these would be powerful enough to give GNU Guile any advantage, it'd be an interesting research area because I think it can bring us closer to an optimized "Lisp Machine" in the general sense, other interpreted or JIT-ed languages could also benefit from such a CPU+programmable accelerator combination lle-bout: Ideally, consummer would start shipping with on board small FPGA for such purposes :P lle-bout: consumer hardware * ArneBab: lle-bout: so you mean something like compiling hot functions down to FPGA instructions? lle-bout: ArneBab, that is a possibility but I'm thinking it's not quite as practical as having a specialized Scheme FPGA interpreter because reprogramming an FPGA dynamically isnt a fast process ArneBab: lle-bout: ah, so you rather mean something like programming the FPGA for common functions in Guile? lle-bout: ArneBab, writing a Guile Object interpreter in FPGA with DMA access from the FPGA, to interpret any code necessary hopefully faster ArneBab: that sounds hard ArneBab: did you measure where Guile spends most of its time in processing? ArneBab: (that could be a good starting point) lle-bout: ArneBab, yes :-) - it certainly is, but I'm looking forward to such research topics, I have a POWER9 machine with PCI Gen4 on which I can plug an FPGA with very high speed I/O - I havent ran any measurements yet, just dreaming about a Lisp Machine revamp in present time :P ArneBab: that would be pretty cool, yes :-) lle-bout: ArneBab, I have come to the realization that only dynamic languages such as Python, Lisp or Javascript, can allow for practical software freedom. The others just cultivate walls of their own that later can't be changed freely ever by users. lle-bout: A complex language made for experts or structurally makes downstream patching difficult can't allow for software freedom. There needs to be a platform where everyone's happy in terms of performance and where there's no compromise to make on choosing other languages that provide worse practical software freedom due to difficulty of modification of the code base architecturally. lle-bout: Lisp allows downstream patching straight into the language itself, without any external programs, and I think it's really valuable. In other languages you might obtain it with diffutils but it's not as easy. JavaScript, I think, is a great example of practical software freedom, and that's also why it really took off, but it's unfortunate that most developments are jailed in the Web APIs and that existing JIT compilers are so lle-bout: memory intensive that they arent suitable for many applications. ArneBab: lle-bout: Javascript is heavy in memory, because it is really hard to optimize for speed. That browser developers actually managed to make Javascript fast is sufficient proof for me that you can make almost every language fast by just throwing enough money and skilled people on it. ArneBab: Scheme is special to me, because it frees the application developers from many of the limits traditionally imposed by having to use what the language designers expected. lle-bout: https://bellard.org/quickjs/ - is a promising new JavaScript engine but I would've hoped that GNU Guile could become a standard for writing optimized language interpreters considering it has an intermediate representation, acting in some ways as the LLVM's specialized for JIT'ing lle-bout: GNU Guile helping carry the software freedom ideals, ensuring they do not get lost in the process lle-bout: ArneBab, well, as much as I'd like to agree with that, I also think Scheme itself imposes some design limits, e.g. recursivity lle-bout: Rust procedural macros are also interesting, giving full access to internal compiler AST to parse and produce arbitrary AST from arbitrary text inside the macro call lle-bout: I'm not very experienced in Scheme, but I don't think you could do such a thing lle-bout: That is, without taking yet another huge performance hit which would encourage you not to do it in the first place ArneBab: In Scheme you can do whatever you want in a reader extension. That’s how SRFI-105 and wisps dimension-guessing arrays are implemented. ArneBab: you avoid that if syntax-case suffices (to reduce complexity) ArneBab: you avoid syntax-case if syntax-rules suffices ArneBab: you avoid syntax-rules if a procedure suffices ArneBab: and you can always scale up to the more complex level, because they mostly act the same in code ArneBab: And if all that isn’t enough, you can go for Guile mechanisms and write your own language. ArneBab: lle-bout: my wisp work is implemented as language which does the smallest possible amount of work to get to arbitrary scheme to defer to regular Scheme. That way it gets almost all of the Scheme operations for free. → https://www.draketo.de/english/wisp ArneBab: lle-bout: on the other hand, the enter-three-witches changes are not implemented as their own language but rather as syntax-case macros, because that allows using all highlevel scheme inside them. → https://hg.sr.ht/~arnebab/dryads-wake/browse/dryads-wake.w?rev=a64329e67970#L231 ArneBab: This is the syntax-case macro that rules that all: https://hg.sr.ht/~arnebab/dryads-wake/browse/enter.w?rev=a64329e6797098eb867d3558a77a835e9f848ff4#L349 ArneBab: lle-bout: looking at a benchmark, it seems like quickjs is about factor 30 slower than node: https://bellard.org/quickjs/bench.html ArneBab: that’s roughly what I expected: making javascript fast is hard. ArneBab: comparing with the benchmarksgame, it means that quickjs is likely factor 3 slower than Python: https://benchmarksgame-team.pages.debian.net/benchmarksgame/which-programs-are-fastest.html ArneBab: It would be interesting to run the bellard benchmark with Guiles ecmascript implementation in Guile 3.0 ArneBab: wingo: this could be interesting to get a notion of the speed of ecmascript in Guile: https://bellard.org/quickjs/bench.html ArneBab: (I just tried the mozilla benchmarks used there in guile, but the base.js script already fails: https://github.com/mozilla/arewefastyet/blob/master/benchmarks/v8-v7/base.js ) manumanumanu: lle-bout: what? If anything, rust's procedural macros are inspired by scheme's. manumanumanu: You can do arbitrary transformations on text. I could theorecitally implement a (rust ...) macro for compiling rust (i think, at least. There would be all kinds of ugliness to coerce runt into scheme i believe) manumanumanu: Only a lot easier. Rusts procedural macros are complicated. manumanumanu: lle-bout: and regarding recursion: I would say compiling things to scheme is simpler because of recursion: Having done a little bit of "transpilation" I would say that best case is where the target language supports Tail call optimization. Trying to force one kind of looping facility into another one is often awful. Rewriting any kind of iteration/looping system as tail recursive functions in generally a lot manumanumanu: easier. chrislck: just wondering: there's a 'sneaky' theme to most lisps: guile/racket/larceny/gambit chrislck: what do we make of chicken/chez then? lloda: that isn't really lisp but specifically Scheme chrislck lloda: Scheme was short from Schemer which came from Planner and similarly named expert systems of the time lloda: most non-Scheme lisps are named like prefixlisp from what I can tell butterypancake: is there a more concise way of doing the following? It just seems like a lot of guile to just replace periods with underscores butterypancake: (regexp-substitute/global #f "\\." "3.15.0.1" 'pre "_" 'post) lloda: there is string-replace butterypancake lloda: oh not what you mean lloda: I have a string-replace-char somewhere which is a string-map one liner lloda: (define (string-replace-char s a b) (string-map (lambda (c) (if (char=? c a) b c)) s)) lloda: something like that lloda: not more concise for a one off :-/ catonano: rgherdt: anyway canonicalize-path is cool. I saw it in the past but misunderstood it daviid: sim daviid: sorry, wrong window ... mwette: sneek: later tell rilez I use texinfo comments above defines, see https://paste.debian.net/1149728/. To generate the docstring I use my draft scheme-texidoc mode for emacs. sneek: Will do. manumanumanu: wingo: so that's what all the CSE patches were about! :D Fun times! does "making case compile as it should" involve that whole binary search/hash table dispatch that ikarus (or was it vicare?) does? Because I have a macro that turns into a humongous case, which was so slow I had to implement the binary search part myself :D manumanumanu: and while we are at it, one _could_ extend the equal? -> eqv? -> eq? optimization to case, especially in guile since so few things are eqv?-only... manumanumanu: is there any way to get the absolute path of something? Something like (abspath "../banana/boat/song.ogg") -> "/home/bjoli/banana/boat/song.ogg" RhodiumToad: do you also want to resolve symlinks? manumanumanu: nope manumanumanu: meh. i haven't really given it any thought. This is a small utility working in a directory where there won't be any symlinks except by accident RhodiumToad: hmm, question seems moot anyway, there seems to be no realpath binding in the posix module manumanumanu: I have been looking around a little in the manual, and I can't find it manumanumanu: I could get it by changing dir to whatever path there is, then (getcwd) and then returning back catonano: manumanumanu: there's a "absolute-file.name" in gule-haunt and it does what you were thinking catonano: manumanumanu: https://paste.debian.net/1149785/ RhodiumToad: it would be better if the posix module had a realpath binding manumanumanu: catonano: the problem is that it would keep the relative parts o the path: (absolute-file-name "../hej.hå") -> (string-append (getcwd) "/" "../hej.hå"). Anyway, I'll just go with my version. rgherdt: manumanumanu: (canonicalize-path path) rgherdt: unfortunately it seems not to be in the manual manumanumanu: thanks! manumanumanu: it is even in the default environment rgherdt: yep rgherdt: manumanumanu: beware that canonicalize-path returns an error if the path doesn't exist wingo: manumanumanu: regarding case, yes, i have been meaning to implement http://scheme2006.cs.uchicago.edu/07-clinger.pdf for a while, was waiting on match optimization first raingloom: sorry for the noob question, but how the hecc do i load a declarative module in Geiser? i can work with non-declarative ones just fine, but Guix's modules always error out because deps aren't imported. wingo: raingloom: that i don't know! it sounds like a good question tho :) wingo: i didn't know there were particular problems with declarative modules and geiser raingloom: wingo: well, maybe i'm missing something obvious. i'm pretty new to Geiser. What I tried is C-c C-a to load and enter the module, which doesn't actually load it, so i also imported it, but that still doesn't import its deps and its exports also don't become visible. and evaling the buffer just errors because of missing deps. wingo: that sounds unpleasant wingo: i break my guile too often to use geiser, sadly raingloom: nice :D wingo: probably that's a problem specific to me, i have fond memories of geiser otherwise raingloom: if (define-module) had one (or many) (use-modules) section within it, i could just eval that as a sexp, but since it uses a different syntax, i'd have to do some kind of transformation. raingloom: well, i guess i'll just suffer :D wingo: perhaps jao knows who can help here :) jao: i think geiser doesn't work with declarative modules. civodul was telling me the other day. aren't they a 3.x thing? wingo: i just don't know how they are different to geiser wingo: they are still modules, they still have variables, you can still module-ref into them wingo: but yeah, since 3.x *: wingo zzz aleix: hi! for those of you who are not in the mailing list (an who use a mac), i just announced a new project this morning: this https://github.com/aconchillo/homebrew-guile . it's basically a way to install Guile libraries/apps easily on mac. jao: guilebrew jao: (would be a much better name, imho) aleix: always complaining :-D jao: i haven't touched a mac in a decade, i won't complain much more aleix: i followed the recommendation from homebrew, so it works with their commands jao: so their recommendation is to call it "guile homebrew tap"? i'm liking apt more and more :) jao: okay, i'll stop trolling now. congrats, regardless of names! aleix: they recommendation is to use homebrew-something, so "brew tap" works. they find it in githug, etc. aleix: *their jao: and why not brew guile? aleix: a new command? jao: i thought brew tap was a command. sorry, i don't know much about brew. aleix: easier to just do "brew install chickadee" than learn a new command aleix: ah, yes "brew tap" is a command to add a new tap aleix: so you do "brew tap aconchillo/guile" and they now it's on github and it's called "homebrew-guile" jao: okay, i see. homebrew-guile then. makes sense. aleix: after that, you can just do "brew install guile-git" jao: nice daviid: str1ngs: I pushes a series of patches to g-golf, which shouldn't affect your code, but still, when you have some free time, please pull, make, check and lt me know if everything is alright ... tx daviid: sneek: later tell tohoyn I pushes a series of patches to g-golf, which shouldn't affect your code, but still, when you have some free time, please pull, make, check and lt me know if everything is alright ... tx sneek: Will do. daviid: *pushed str1ngs: daviid will do thanks p0a: Hello p0a: I read a bit about guile p0a: It looks a bit like lua to me. (I haven't used either) p0a: So if guile is the glue between a complex program and the user, where is it used? what are some typical scenaria? p0a: Would guile be used to write an emacs mode? p0a: sorry for such an ignorant question tohoyn: sneek, botsnack sneek: tohoyn, you have 1 message! sneek: tohoyn, daviid says: I pushes a series of patches to g-golf, which shouldn't affect your code, but still, when you have some free time, please pull, make, check and lt me know if everything is alright ... tx sneek: :) aleix: tohoyn: what's the difference between g-golf and guile-gi? tohoyn: aleix: ask daviid or str1ngs. I have not used guile-gi. aleix: p0a: Guile is a general programming language. It can also be embedded (such as Lua) to existing applications written in C or C++. There are Guile projects for game development, bindings for TensorFlow, it is the basis of Guix (a new OS) and it has a bunch of available modules ready to be used. AFAIK, it can not be used to write Emacs modules, eventhough there's been attempts that almost succeed but I didn't follow what happened. p0a: aleix: thank you RhodiumToad: other than being embeddable, it's not much like lua :-) dsmith-work: Happy Friday, Guilers!! civodul: Happy Friday! chrislck: anyone knows if you can get out of hash-for-each early easily? no call/cc pls :) civodul: chrislck: you can use let/ec for a non-local exit using delimited continuations civodul: or 'throw', which is equivalent chrislck: ah nice chrislck: (throw ...) sounds like tantrum... dsmith-work: call/cc and let/ec sounds like someone dying with something stuck in their throat.. wingo: i fixed the match problem!!!!!!!!!!!!!!!!!! wingo: aaaaah this is nice civodul: wingo: yay! civodul: congrats on that one wingo: reduces some big functions that use match by 30-40% civodul: woow civodul: Guix makes heavy use of match civodul: i should give it a spin wingo: the % reduction in the limit can be 100% ;) civodul: :-) wingo: yeah the compiler uses match too, obvs civodul: yeah civodul: that also means that many tests are elided, right? chrislck: o/ wingo: civodul: yep wingo: many tests, many intermediate computations wingo: cse.scm is all ugly now but i can try to work on that wingo: this is great. now i can finally work on making "case" compile as it should civodul: wingo: is this optimization... CPU-intensive? :-) wingo: it shouldn't be civodul: ok wingo: why, is the build taking longer than it used to? civodul: no i haven't tried it yet, just wondering wingo: the constant factors of CSE are a little higher but it is linear, and it residualizes a smaller program with less control-flow so the net effect is that the compiler speeds up civodul: ah yes, more initial work, and less work in later passes wingo: e.g. compiling compile-bytecode.scm is around 10% faster with this optimization than in 3.2 civodul: neat wingo: 3.0.2 rather civodul: so you'll be partying all night long? ;-) wingo: hahaha :) wingo: gotta admit it's delightful to reach a good place on a friday afternoon :) civodul: heh, it's a great feeling! janneke: so, #guile is the feel-good place today, great \o/ *: sneek dances wingo: :) janneke: *lol* dsmith-work: wingo: Something you might want to fix. Current code is fine, but still.. In lightening.c, JIT_NEEDS_LITERAL_POOL is #ifdef'ed everywhere except for one place that uses #if instead. Should be #ifdef there too. lfam: I'm excited to get these improvements in Guix :) wingo: dsmith-work: do you want lightening commit access? :) dsmith-work: Do I need paperwork? wingo: dsmith-work: i dunno, it is not a gnu project, but guile uses it. wdyt civodul, is it important for contributors to lightening to assign to fsf ? *: wingo steps out for a bit civodul: wingo: it's currently all copyright FSF (right?), so i'd lean towards preserving it civodul: assignment is always a barrier, but maybe it's okay for lightening dsmith-work: wingo: btw, the build time for the latest master is about the same. 35m for me. civodul: "Fix typo causing performance problems!!!" fun :-) rilez: Can you put texinfo in comments above defines? sneek: rilez, you have 1 message! sneek: rilez, nckx says: The full output would be helpful. You can use a pastebin on IRC, or send an e-mail to help-guix@gnu.org if you prefer. If the last ~10 lines of that output mention a .bz2 log file, please include its text as well. RhodiumToad: moo rilez: RhodiumToad 🐮🐮 rilez: ah ok i figured it out. I found doc-snarf. rilez: now the question is how to get geiser to find it aleix: howdy wingo: lloda: yes certainly! dsmith-work: {appropriate time} Greetings, Guilers bricewge: Hello Guilers! bricewge: Does building a static guile on armhf works? bricewge: It seems to hang on my machine as well as in Guix's CI http://ci.guix.gnu.org/log/skdy6z15p5y7xxs3a87d298bazwqnyrn-guile-static-3.0.2 chrislck: http://fox-toolkit.org/ is an interesting GUI toolkit... wonder how hard would be to write guile bindings lloda: wingo: ty, done tohoyn: sneek, botsnack sneek: :) dsmith-work: bricewge: Is the jit enabled for that? There are some problems with the jit on 32bit arm. (when calls go back and forth between thumb<->arm) dsmith-work: Which reminds me... dsmith-work: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40737 heisenberg-25: are there any websockets implementation in guile? dsmith-work: Thread 1 (LWP 507): dsmith-work: #0 0x76ee6f12 in scm_is_pair (x=0x0) at pairs.h:182 dsmith-work: #1 scm_sloppy_assq (key=0x752076f0, alist=0x0) at alist.c:59 dsmith-work: Those 0x0's should not be there, right? bricewge: dsmith-work: No JIT, I applied https://issues.guix.info/41350#36 bricewge: It looks to be Guix related issues, the CI don't honor timeout and it seems that building it that way (via binfmt and without parallelization) it takes a long tens of hours bricewge: I'll wait an report tomorrow if it fail dsmith-work: sneek: guile-software? sneek: Its been said that guile-software is at http://sph.mn/foreign/guile-software.html dsmith-work: heisenberg-25: There is something listed at ^^ dsmith-work: Seems a bit old dsmith-work: Last update 4 years ago heisenberg-25: dsmith-work: Checking it. thanks dsmith-work: And in the later backtrace: dsmith-work: #4 0x76f0b97e in throw_ (args=, key=0x0) at intrinsics.c:352 dsmith-work: Key is a SCM. Should not be 0x0 dsmith-work: I guess because of the "stack corrupt" message, none of that can be relied upon. dsmith-work: Hey Hi Howdy, Guilers rgherdt: hi lloda: following yesterday's link from dsmith https://lists.gnu.org/archive/html/guile-devel/2004-05/msg00051.html lloda: at this point since all of Guile compiles fine with STRICTNESS set to 2, i'd say the type checking of all user programs is worth some unnamed arch with a bad compiler possibly maybe having slower perf, so we should make STRICTNESS 2 the default. Plus it makes Guile modern C++ compatible. lloda: Re: [invalidate-compilation-cache is deprecated; recompile your modules] deprecation warning, do I have to recompile my modules manually now? Only sometimes? Autocompilation is on fwiw. dsmith-work: lloda: I'm curious, have you seen any perf changes with strict=2? wingo: lloda: most people will not see that error, if they build either with guile 3.0.2 or 3.0.3 lloda: I was just passing -DSCM_DEBUG_TYPING_STRICTNESS=2 when compiling my code and I didn't notice anything, but I wasn't running benchmarks lloda: but if I change SCM_DEBUG_TYPING_STRICTNESS to 2 in scm.h, I do see some errors when compiling Guile wingo: error only appears either for people who define languages, or people that do "git pull" and keep old .go files lloda: wingo: I deleted all my cache and it appeared again so I dunno lloda: but I do rebuild Guile itself a lot lloda: i'm satisfied if I don't have to do anything by hand in a normal situation :-) lloda: is it right that SCM_NEWSMOB macros in libguile/smob.h cast to (scm_t_bits) directly instead of using PACK/UNPACK? lloda: ok i've done a little benchmark with 2 vs 1 and I don't see anything meaningful lloda: dsmith-work: probably deserves more extensive benchmarking tho lloda: wingo: ok to push http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=e1ac6923f4c00d520754616aa03e9cee426fe8e1 ? lloda: this fixes building Guile with #define SCM_DEBUG_TYPING_STRICTNESS 2 in scm.h dsmith-work: lloda: BTW, I found that reference I was looking for about == https://www.gnu.org/software/guile/manual/html_node/Equality.html#index-scm_005fis_005feq lloda: dsmith-work: yes I saw that when the stricter conversion flagged my == lloda: it might be a common error, without the check chrislck: (ping wingo). wish to ask advice. we know guile is great and all, but can be too powerful. an idea we have is to script gnucash with a limited DSL but not allow access to the full GnuCash API. e.g. https://pastebin.com/LxrchcKu - note the lack of (use-modules (gnucash)) chrislck: it would be run from $gnucash --run-script=script.scm and allow basic scripting, but with a severely restricted set of save commands. chrislck: it would be run from $gnucash --run-script=script.scm and allow basic scripting, but with a severely restricted set of safe commands. chrislck: i.e. this would be an upgrade from --run-script=reports.json chrislck: the question is how to structure the loader -- would there be a wrapper with macros defining get-report and set-option! etc? chrislck: (this could be a very gentle introduction to scheme ) reepca: when a signal handler registered via sigaction is ran, is the signal that triggered it blocked during its execution? Can the handler be re-entered while it's still running? And does it establish a continuation barrier? I'd expect so, since the "safe points" are presumably being ran C-side. rekado: chrislck: you can set the current module to be one that already includes all the modules you want to provide rekado: See https://git.savannah.gnu.org/cgit/gwl.git/tree/gwl/utils.scm#n316 and https://git.savannah.gnu.org/cgit/gwl.git/tree/gwl/utils.scm#n98 rekado: load-workflow* loads some user-provided code in a fresh module where a bunch of modules have been pre-loaded rekado: load* creates that environment and evaluates the user code inside of save-module-excursion rekado: chrislck: you could use the same mechanism for GnuCash reports civodul: hey! civodul: wingo: should we aim for a 3.0.3 release soonish? wingo: yah wingo: need to merge in the armv7 fixes civodul: oh right wingo: and i was hoping to get in a compiler optimization that would improve "match" statements, but it has been difficult to find time to think clearly :P civodul: heh :-) catonano: civodul: I sent a tiny patch with a mention of Guile Hall in the manual. I'd love if it could be in 3.0.3 🙏️ dsmith-work: Morning Greetings, Guilers civodul: catonano: sure, i'll take a look civodul: i have that discussion highlighted in my inbox :-) catonano: civodul: thanks 😊️ lloda: the definition of SCM_UNPACK in scm.h doesn't compile under c++20 in gcc 10 lloda: it looks super crufty to me lloda: how about we just change that to something line [inline scm_t_bits SCM_UNPACK(SCM x) { return (scm_t_bits) x; }] lloda: have to track that comment about the clang warning tho lloda: d9eafa374c was a c&p job so it's a pain to track lloda: yeah I have no clue what volatile is doing there lloda: also is this SCM_DEBUG_TYPING_STRICTNESS business necessary at all? civodul: lloda: it's been useful a few times in the past civodul: it was nice to have CI build with SCM_DEBUG_TYPING_STRICTNESS=2 lloda: why isn't that the default instead of =1 lloda: performance concern seems off lloda: i'd expect the compiler to fold everything civodul: right civodul: well, "historical baggage" civodul: wingo: thoughts? wingo: no idea! wingo: for c++ you really just want reinterpret_cast<> :P lloda: yeah lloda: replacing the macros with inline fun doesn't work I get 'initializer element isn't constant' down the line in snarf.h wingo: yeah :/ if we want to keep c++ compat, probably we will need some c++ ifdefs wingo: lloda: regarding "why not strictness 2 by default", istr some platforms won't pass small structs by value in registers ever wingo: but it's terrible. dsmith-work: IIRC, the strict typing stuff gave the compiler more opportunity to discover errors, at the expense of slower code. lloda: the code shouldn't be slower just because of a type check that is done by the compiler :-( dsmith-work: I think it was more like certain operations were syntax errors when "strict" but not when "normal". dsmith-work: Like taking the address of a bitfield or something. lloda: fwiw just compiling with -DSCM_DEBUG_TYPING_STRICTNESS=2 fixes my immediate need. Not a real solution tho. dsmith-work: https://lists.gnu.org/archive/html/guile-devel/2004-05/msg00012.html lloda: that was 16 years ago and the claim is indirect dsmith-work: Yep. lloda: using -DSCM_DEBUG_TYPING_STRICTNESS=2 made gcc flag all my (I guess broken) uses of SCM_UNSPECIFIED==... dsmith-work: Yeah, you are not supposed to compare SCM's directly. lloda: right lloda: also need to use UNPACK/PACK to cast to/from void* now chrislck: rekado: thanks looks like it's possible -- using guile as a DSL for configs rather than to access the full API. just need to find a way to load appropriate modules before loading script. tohoyn: If I pass an expression (syntax abc) to a macro is the value to be passed a syntax object or expression (syntax abc)? reepca: can sigaction handlers be re-entered if the signal they handle is received while they're running? civodul: don't tell me about signals civodul: :-) civodul: reepca: are you talking about "real" handlers at the C level, or Scheme handlers? reepca: scheme handlers civodul: ok, they run from "asyncs" reepca: aye civodul: so not directly from the "real" handler civodul: so Guile's signal thread receives the signal civodul: it queues an async that invokes the handler civodul: "eventually" that async runs and actually invokes the handler civodul: it's racy reepca: so I'd need to use call-with-blocked-asyncs inside the handler if I wanted it to not be re-entered civodul: i think so civodul: there are example of that in the Shepherd civodul: (and signalfd coming up \o/) reepca: getting nonblocking child-reaping to work in fibers is proving a bit tricky reepca: simply because as soon as a child is reaped, the process id ceases to have any real meaning rndd: hi everyone! how i can call function description in repl? ft: ,d function-name rndd: ft: thank you very much rndd: 0_- emys: is there a procedure I can use to get the absolute path for a relative path supplied as an argument? emys: like (abs '.') ; => "/home/....." tohoyn: emys: getcwd returns the current working directory emys: tohoyn, ok, bad example what if I want to have a user-supplied path like `../lsjdfk/asdfs` expanded to the absolute path emys: kind of looking for a guile equivalent to https://docs.python.org/3.8/library/os.path.html#os.path.abspath rekado: emys: you are probably looking for canonicalize-path emys: rekado, thats it alextee[m]: what's missing if guile reads/prints french accented letters like "?" alextee[m]: * what's missing if guile reads/prints french accented letters like "?" ? wingo: alextee[m]: setting locale wingo: maybe guile failed to install your locale? wingo: pre-2.2 this was more common alextee[m]: maybe, this is mingw btw. i think it uses 2.2 alextee[m]: msys2/mingw dsmith: So for some reason, I was looking into slime. And happened upon this: https://wingolog.org/archives/2006/01/02/slime catonano: dsmith: in reading it, I undertsand where the inspiration for LSP came from manumanumanu: I shit you not: mac os x decided to re-map my paragraph sign to the swedish letter ö in the last update. nalkri: at least it wasn't å manumanumanu: which makes for all sorts of problems: it is my emacs leader key, I use alt+ö (meaning paragraph) to summon my quake-style terminal manumanumanu: and it is just extremely annoying rekado: dsmith: I wonder how much of this is missing in Geiser str1ngs: daviid: it's to be working for me. but my znc server connects to gimpnet then I use circe from emacs to connect the znc server. so hard for me to test this for you. daviid: str1ngs: I can't connect to irc.gnome.org, but I can to irc.gimp.net, then join 'none #gimp' channels ... tohoyn: I have found two bug candidates in the reference implementation of SRFI-72. anybody who can discuss this? tohoyn: I'm unable to mail to the srfi-72 mailing list. gagbo: Is there a function that takes a list and a default value, and returns the default value if the list is empty ? gagbo: something like (if-let ((value (computation))) value default) gagbo: I don't know if if-let is in Guile, can't find it in the manual :( gagbo: that if-let is bad since it's missing the empty list check :( tohoyn: (define (fn l default) (if (null? l) default l))) rgherdt: Hi! I uploaded a while ago a simple patch for the "hash-table-merge!" function (it's currently broken), but only realised the naming convention of using [PATCH] in the title later. I'm not familiar with the way our Bug Report work, could someone please rename my bug report, or classify it as "patch available"? Would that happen automatically if I had used the [PATCH] convention? rgherdt: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41131 andswitch: (list-set! lst k val) modifies the pair in the list that contains the k-th element, but it doesn't modify the k-th element itself. Correct? RhodiumToad: yup andswitch: thx andswitch: ArneBab: I'm enjoying Wisp! In one or two cases I had to stare a bit to really grok how it reads something, but then it just clicked and now I feel like I'm flying. any1: Is there some way to close only the input end on a pipe from open-input-output-pipe? any1: I.e. I want to subprocess to exit so I can gather up everything from its output. Otherwise things just hang. RhodiumToad: no. but if you reach into the module and grab some private parts, you can convince it to give you the two pipes separately. RhodiumToad: someone asked that recently and gave a solution - let me see if I have it logged RhodiumToad: so the method given before was: RhodiumToad: (receive (from to pid) ((@@ (ice-9 popen) open-process) OPEN_BOTH "someprogram") ... ) any1: I'll try that. Thanks! RhodiumToad: (substitute let-values or call-with-values to taste) mwette: maybe (close-port (fdes->inport (port->fdes port))) ?? RhodiumToad: I don't think port->fdes would work on a bidirectional port? since that's actually a custom port with the real ports hidden in closures any1: I imagine that will close the port but maybe not the file descriptor. jasom: So, I'm writing an extension to xbindkeys (uses guile 2.2.x) and find that if I allocate in a key handler, the whole program eventually crashes shortly after a GC. Do C programs have to do anything special to keep references to scheme objects alive? jasom: Looking at the C program, It enters the main of the program via: scm_boot_guile(0,(char**)NULL,(void *)inner_main,NULL); loads a single scheme file, which may pass closures back to the program via a scheme function defined in C, then enters an X11 event loop that periodically calls into one of the closures via scm_call_0(). jasom: Is there anything obviously wrong with doing that? dsmith: Heya jasom, I don't your answer, but it's a good question. Might take a while for people who know to answer. dsmith: jasom: Have you seen https://www.gnu.org/software/guile/manual/html_node/Garbage-Collection-Functions.html ? dsmith: Sepecifically, the protect-object and remember-upto stuff? jasom: dsmith: saw that, but footnotes say that it's only needed in 1.8 and older dsmith: Ah jasom: I will try those though and see if it makes a difference dsmith: Also, (may or mayb not apply to your code) make sure that any SCM's are *never* NULL. Bad things happen. jasom: that made the problem go away. Is it required to use scm_gc_malloc() to allocate from the heap? I'll try making that change and see if it fixes things. jasom: I've read https://www.gnu.org/software/guile/manual/html_node/Memory-Blocks.html about 3 times and I'm still not sure what the requirement is for allocating from the heap something that will include a mixture of C and scheme objects... jasom: I see "Memory blocks that are associated with Scheme objects (for example a foreign object) should be allocated with scm_gc_malloc or scm_gc_malloc_pointerless." But I understand that as meaning "pointers that will be held by scheme objects" not "pointers that hold references to scheme objects" jasom: well using either explicit protection or gc_malloc causes the bug to stop reproducing, so I'm guessing that the GC doesn't scan malloc() allocations for roots. RhodiumToad: that's possible. dsmith: jasom: It's also fun to force a gc instead of waiting for one. jasom: dsmith: yeah, that can make it happen faster certainly jasom: dsmith: good point; fastest way to reproduce is to do something that allocates in the press event and gc in the release. Crashes on second click every time. Should help in getting fix upstream dsmith: sneek: botsnack sneek: :) jasom: dsmith: thanks for the help; I've submitted a patch upstream now. dsmith: Wow. Glad I could help. dsmith: jasom: Looking at that 1.8 comment more carefully. I belive it says for 1.8 and before, you *must* use scm_gc_protect_object. After 1.8, you can use that function or store it in a C gloabal variable. ryanprior: Are there any quality GTK3 applications written in Guile that I should check out to research how I might write my own? daviid: ryanprior: I don't think so, but we have basic examples, both for guile-gi and g-golf ... daviid: ryanprior: guile-gi is here https://spk121.github.io/guile-gi/ daviid: ryanprior: g-golf is here https://www.gnu.org/software/g-golf/ ryanprior: Thank you, I will check out the basic examples for sure. daviid: ryanprior: don't know about guile-gi, but the g-golf repo does not have the examples, but i can paste when/if you wish, le me know ... the first think for you is t decid if you go with guile-gi or g-golf I can't recommend because i'm the g-golf author :):) daviid: str1ngs: do t still have a nomad vrsion that uses guile-gi? chrislck: tutorials are painfully lacking in guix and numerous guile code chrislck: the video posted here or guix was really good: https://www.youtube.com/watch?v=t4vKPhjcMZg ryanprior: daviid: what's your brief pitch for g-golf over guile-gi? Are there certain areas or use cases where guile-gi is clearly stronger? ryanprior: Also, feel free to hit me with the examples in whatever format, I will save or bookmark them. daviid: ryanprior: here is what i wrote for a similar user rqust a few days ago https://lists.gnu.org/archive/html/guile-gtk-general/2020-05/msg00001.html daviid: ryanprior: here is a g-golf (very) basic example https://paste.debian.net/1148378/ daviid: i hope someone can post a basic guile-gi example, i can't ... daviid: because i don't have any daviid: i think there i a nomad guile-gi example 'out there' ... tohoyn: is it possible to expand macros to Scheme code? macroexpand makes tree-il. chrislck: sneek: botsnack sneek: :) janneke: tohoyn: in the REPL, try: ,expand (cond (#t #t)) tohoyn: janneke: tx. works. mwette: o/ emys: I want to use (ice-9 getopt-long) but the docs don't really say how I can access the command line arguments emys: what I got working is to define a main procedure and add to the shebang that guile should call that procedure emys: are there other options? emys: ah, found what I was looking for, never mind emys: (program-arguments) RhodiumToad: or (command-line) mwette: (srfi srfi-37) is option to getopt-long if you run into issues (e.g., repeated flags) like I did janneke: mwette: if i understand you correctly, i'm using something like this janneke: (define (option-ref-multi options name) (map cdr (filter (compose (cut eq? <> name) car) options))) mwette: janneke: Thanks. The problems I had occured a while ago, so I don't remember all the nuances. I switched to srfi-37 after wingo said it was preferred. str1ngs: daviid: nomad has only ever used g-golf. str1ngs: guile-gi has an example folder IIRC daviid: str1ngs: ah ok janneke: mwette: ah...right janneke: i didn't like the mixing of code and data, i'll have another look daviid: str1ngs: ot - it seems I can't connect to irc.gnome.org today, can you? str1ngs: daviid: I'm connected via znc daviid: str1ngs: emacs erc mode here - i can't connect tohoyn: daviid: is it so that GValues should not be used by ordinary users of G-Golf? daviid: tohoyn: they souldn't have to - if you find (another) case where it seems to be the cae, probably the function or method should b overriden, let me know, and we can think about it ... tohoyn: daviid: gtk-container-child-get/set-property daviid: but in that case, you could use the property accessor on the child itself - i never used, never had to, what would be a use case that yu couldn't do that? tohoyn: daviid: child properties are different from ordinary properties. they are related to both parent and the child. the get/set functions take both the parent as a child as a parameter. are there accessors for these? tohoyn: daviid: see https://developer.gnome.org/gtk3/stable/GtkContainer.html tohoyn: ^parent and the child tohoyn: daviid: there seems to be an accessor for child property "expand" but it takes only one argument. tohoyn: daviid: that accessor is probably for ordinary "expand" properties tohoyn: daviid: there is a similar situation with propery/child property "position" daviid: tohoyn: I wrote a child-property.scm example when you first brought the subject, with an hpane and a vpane ... do you still have it? but i don't like it :), because the g-value must be initializd, then retreived ... it should dbe possible to override those i think daviid: also, we're in scheme, calling gtk-container-child-get-property and not receiving the value is 'damn wrong' daviid: i'll think about this - i never used those, of course i attach child, pass the pack-strt expand fill values, but never had to ask what thy are after that ... tohoyn: daviid: I still have the example tohoyn: daviid: probably the scheme version of child-get-property should return the value of the property instead of using a GValue. daviid: yes, but then it must be overriden, i didn't do that yet - i wonder what guile-gnome did tohoyn: daviid: guile-gnome version seems to take a GValue argument daviid: so it was not ovveriden then? daviid: anyway, will look into this - let's see ... janneke: hmm, in what module is sort defined? *: janneke tries to #:select ((sort . list-sort)) and find sort is not in srfi-1 janneke: haha, it's in (guile) ... but so is sort-list dsmith-work: Happy Friday, Guilers!! mwette: o/ mwette: charsets don't use bitfields so for small sets memq is probably faster? mwette: memq w/ literal list, that is *: mwette is rewriting C99 preprocessor and ended up rewriting the number reader (num = integers, octal ints, hex ints, binary ints, floats, fixed-point and decimal floats); lot's of suffix combos to deal with RhodiumToad: I wouldn't expect memq to beat charsets RhodiumToad: not on any length of set justin_smith: for hash based lookup, it's usually only faster than linear search after ~16 items RhodiumToad: charsets don't actually use hashes justin_smith: oh cool, what do they use? RhodiumToad: looks like a linear search of ranges RhodiumToad: so I'd expect a hash to beat them for large sparse sets RhodiumToad: but simply on cache locality they'll beat out memq for any size ech: https://twitter.com/thekami9/status/1263891699304202241 lloda: > guile-cairo 1.11.1 is out RhodiumToad: tested build with the released file, builds ok dsmith: The bot remembers by the "metaphone" of the nick. I supposed it's for sloppy/fuzzy matching. dsmith: Except when addressing the bot. That used to be by metaphone also, but I've fixed that. RhodiumToad: metaphone is a bit, um, loose dsmith: (seen used to match sneek) RhodiumToad: (though I suppose it could have been worse, like soundex) dsmith: The metaphone for both ends up being "sn" RhodiumToad: metaphone is definitely too loose for nicks without arranging to store multiple nicks per metaphone buffergn0me: Does anyone have tips for how to handle the meta switch with a relative guile path so that Emacs opens the script file in Scheme major mode? buffergn0me: Specifically, I am doing #!/bin/sh buffergn0me: exec guile --no-auto-compile -s "$0" buffergn0me: At the top of the script file ryanprior: How do I interpolate a string? Like (let ((place "world")) (interpolate "Hello, {place}!")) buffergn0me: One answer to my earlier question: # -*-Scheme-*- as the second line after #!/bin/sh buffergn0me: Would be nice to do this by file extension instead, but I am not sure if there is a convenient mechanism for modifying the major mode search order for this case alextee[m]: ryanprior: i'd use (string-append) or format alextee[m]: not sure if there's a formant variant that takes named arguments ryanprior: (string-append "first " a " then " b " and then finally " c.") ryanprior: vs ryanprior: (interpolate "first {a} then {b} and then finally {c}.") ryanprior: The second one looks so much more obviously correct to me, whereas I strain to scan the first one to make sure all my spaces and quotes are correct. ryanprior: Can I write a reader macro to do that? lloda: You can use a regular macro to pick the names of the variables, the rest is just parsing the string. ryanprior: Cool, I would like to work on that. I have not grasped the API of the Guile macro system yet despite reading the manual and looking at a dozen examples. In particular the examples I've found (in Guix and the Guile manual) have been either simplistic and don't do much, or inscrutible such that I don't really understand what they do or how. ryanprior: So if you know anybody who writes cool macros that I should definitely learn from, I would love links. lloda: i've written some macros, but i'm far from an expert ryanprior: Otherwise my plan is to work my way through the codebases of some existing guile repos (ice-9 things maybe?) and search for better examples. lloda: i've read a good chunk of https://www.greghendershott.com/fear-of-macros/ lloda: i think it's good lloda: bear in mind it's for racket, so not all of what he talks about is available in Guile lloda: then there's tspl4 by Dybvig lloda: it's more of a reference lloda: there are a couple of articles that cover syntax-rules only, not syntax-case lloda: syntax-rules for the merely eccentric and for the mildly insane, iirc lloda: those are worth a read too dsmith: sneek: macros? sneek: I could be wrong, but macros is http://hipster.home.xs4all.nl/lib/scheme/gauche/define-syntax-primer.txt ryanprior: Cool I will give those a read lloda & dsmith thank you! pinoaffe: hi everybody! (string->symbol "17f658ff") fails with $1 = ice-9/boot-9.scm:1669:16: In procedure raise-exception: In procedure string->number: Value out of range: 658, is this a bug? daviid: tohoyn: I pushed a series of patches to support GList/GSList 'inout, 'out arguments and GSList 'in arguments - so now you may use gtk-radio-menu-item-get-group and even gtk-radio-menu-item-set-group, for example ... although wrt the later, as mentined earlier, gtk-radio-menu-item-join-group is 'the recommended way' - note that you may (also) create instances using (make #:label "Item xx), then daviid: gtk-radio-menu-item-join-group ... daviid: str1ngs: ^^ fwiw :) daviid: str1ngs: I've not implemented anything yet wrt callback support, I did a bit of thinking about it, but 'nothing yet' daviid: str1ngs: now, I'm thinking to first work to offer proper support for interfaces (so they become goops classes, inheritable by those implementing 'their interface' ...), then work to provide the long waited 'short method names', then I'll get back to the callback support ... daviid: fwiw, here a slightly better hello-world example, which uses a and proper gtk-box-pack-start expand fill padding settings, so when the user changes the window size things a kept 'nice and pretty' :) - https://paste.debian.net/1148094/ - it only lacks short method names, coming ... str1ngs: daviid: thanks for the update. generally I just use gtk-box-pack-start myself. wingo: heyo janneke: hey wingo rgherdt: Neo, onde tu estavas?! rgherdt: sorry, wrong chat wingo: :) RhodiumToad: pinoaffe: interestingly, the same error occurs with entering #{17f658ff}# literally RhodiumToad: or to be more precise, it's produced by trying to _output_ that symbol RhodiumToad: in fact (symbol? (string->symbol "17f658ff")) returns #t with no error as one would expect RhodiumToad: aha. RhodiumToad: so it's a bug in the code that decides whether a symbol needs to be printed with extended read syntax or not RhodiumToad: if (scm_is_true (scm_i_string_to_number (scm_symbol_to_string (sym), 10))) return 1; RhodiumToad: and the string_to_number throws because it has the form of a number with exponent but the exponent is too large dsmith: RhodiumToad: Sweet! dsmith: Surprising to me it's messing about with a symbol as a number. Should be just a sequence of chars, right? Oh! It's needing to know if it should do the #{..}#. RhodiumToad: yes RhodiumToad: though something else isn't right here, I think RhodiumToad: a lot of things seem to get #{...}# that don't appear to need them RhodiumToad: hm RhodiumToad: so the check for a number seems to be redundant as it stands - it does that check if the first character in the symbol is +, -, or ascii 0-9 RhodiumToad: but none of those appear to be in the class of valid initial characters that it checks later RhodiumToad: is there a handy function somewhere to say what unicode classes a character is in? RhodiumToad: ah, char-general-category seems to be the thing RhodiumToad: ah. it matters for symbols that begin with + or - RhodiumToad: since symbols can start with those too RhodiumToad: er, numbers RhodiumToad: so #{-10z}# prints as just -10z because that's not a number, while #{10z}# prints as #{10z}# because it starts with a category Nd character which is not allowed to be first in a symbol RhodiumToad: so what that check actually needs is a function that says whether a string has the syntactic form of a number, regardless of whether it can be converted to a number or not pinoaffe: RhodiumToad: ah okay, thanks for taking a look! RhodiumToad: workaround, avoid printing your strangely-named symbols :-) pinoaffe: I'm generating a lot of uuids and printing them as symbols, so this happens every now and then RhodiumToad: hm, that sounds like it could be a pain pinoaffe: yeah, I might try and write a function to detect whether a uuid is going to trigger this and just generate a new one in that case RhodiumToad: oof RhodiumToad: I guess you don't want to change the format of your uuid symbols pinoaffe: I'm working with an external file format (the librepcb files), and I don't think they'll lightly make such a massive change in their file format :) pinoaffe: I guess I could also write a simple printing / writing function, that might be easier RhodiumToad: arrange to always print your symbols as strings instead? pinoaffe: yup, that should do the trick dsmith-work: Morning Greetings, Guilers mwette: morning here, good morning pinoaffe: RhodiumToad: I ended up writing my own, very minimal, sexp-printer: http://dpaste.com/255W1TQ lloda: arch = os.popen('../config/config.guess').read() RhodiumToad: ? lloda: bad paste my bad :-( RhodiumToad: I guess someone should write up a bug report for the symbol thing? RhodiumToad: bah. it was reported in 2016 RhodiumToad: https://lists.gnu.org/archive/html/bug-guile/2016-08/msg00043.html dsmith-work: RhodiumToad: Do you have an idea for a fix? sneek: dsmith-work, you have 1 message! sneek: dsmith-work, chrislck says: {appropriate-time} greetings to you too! dsmith-work: Heh pinoaffe: RhodiumToad: wew, that's old chrislck: lol RhodiumToad: the bug is caused by confusion between "has the syntax of a number" and "can be converted to a number", so maybe those two concepts need to be split apart somehow? sneek: Welcome back RhodiumToad, you have 1 message! sneek: RhodiumToad, chrislck says: you are very helpful chrislck: sneek: ok that's enough chrislck: a looong time ago gnucash was a guile app, very scriptable. soon, gnucash will run reports from commandline. RhodiumToad: I guess the question is how hard should display of a symbol try to avoid using #{...}# ? dsmith-work: ISTR fixing bug in gnucash is what drew wingo into guile RhodiumToad: there are currently cases like (display '10z) where a symbol read without #{..}# is nonetheless printed with them dsmith-work: Ok this is interesting: dsmith-work: scheme@(guile-user)> (string->symbol "}#") dsmith-work: $1 = #{\x7d;#}# RhodiumToad: the tricky case is (display '-10z) chrislck: I think wingo wanted a report which tells him how much he earned per DOW RhodiumToad: if changing the behavior of (display '-10z) to output #{-10z}# is acceptable, then it would be sufficient to simply change the code to look for an initial + or - followed by a digit or . RhodiumToad: (I think) dsmith-work: Racket uses '|...| instead of '#{...}# dsmith-work: Is there anything standard? RhodiumToad: |...| is r7rs, no? RhodiumToad: guile has an option for it RhodiumToad: (options for reading and printing, that is) RhodiumToad: but that doesn't avoid this problem winny: hello, what is the return value of the display procedure? winny: Working on glue to evaluate an expression and do the right thing when printing it back to IRC, as such no value should be echoed back as "(No value)" dsmith-work: Unspecified. Same thing that (if #f #f) would return. reepca: does 'write' ever produce newlines? winny: as a solution I found (display (call-with-values thunk (lambda args (cond ((null? args) "(No value)") ((= 1 (length args)) (car args)) (else (cons 'values args)))))) works winny: e.g. no args passed to the call-with-values receiver means something like display was called winny: is this the best way? dsmith-work: scheme@(guile-user)> (eq? (if #f #f) (display "")) dsmith-work: $1 = #t RhodiumToad: I wouldn't really expect that to be portable winny: indeed, i'm asking here because i'm writing for guile ;) RhodiumToad: right. so what seems to happen in guile is that display returns no values RhodiumToad: so your call-with-values is probably the right approach RhodiumToad: you could probably improve on it using case-lambda RhodiumToad: hm. no. it's not working for me RhodiumToad: (lambda () (display 1)) is returning one value which is # RhodiumToad: (unspecified? x) seems to be the way to go RhodiumToad: (call-with-values thunk (case-lambda (() "(No value)") ((a) (if (unspecified? a) "(unspecified)" a)) (rest (cons 'values rest)))) Aurora_v_kosmose: Was there a built-in for ls? I can't seem to remember atm. rekado: Aurora_v_kosmose: there’s scandir in (ice-9 ftw) Aurora_v_kosmose: rekado: Ah right, that was it, thanks. chrislck: anyone can read C and decode guile's read.c -- "end of file in string constant" in scm_lreadr - what does it mean *: RhodiumToad can read C *: RhodiumToad goes to look RhodiumToad: seems obvious enough to me - it's reading a "..." quoted string, but hit end-of-file before seeing the closing " *: janneke wondered about the boldness of the statement "anyone can read C" ... chrislck: Rhodium: thank you :) chrislck: janneke: I meant "is there anyone who can read C" chrislck: janneke: I meant "is there anyone who can read C better than I" janneke: chrislck: yes, luckily RhodiumToad got that :-) janneke: i can't seem to remember that i'm not allowed to do (catch (and foo?) ... ) *: janneke there should be some extra ... in there miskatonic: does guile support gobject inspection repositories? janneke: miskatonic: there are two projects working on that, afaik, guile-gi and guile-golf dsmith: Home come Scheme doesn't have an all-dancing all-singing loop macro? Because CL is not properly tail recursive. miskatonic: who needs the loop macro, anyways. There are enough other ways in CL to perform iterations miskatonic: as there are in emacs lisp, which has by default neither loop nor tail recursion but still gets its job done janneke: dsmith: that makes some sense; my occasional encounter with the imperativeness and c-like loop'iness of lisp drives me mad dsmith-work: Morning Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) RhodiumToad: is there a way to tell the bot "later tell A or B ..." lloda: sneek: later tell RhodiumToad yes sneek: Will do. lloda: oh you meant or lloda: i'm dumb sorry lloda: sneek: later tell lloda or RhodiumToad no sneek: Okay. lloda: so? sneek: Welcome back lloda, you have 1 message! sneek: lloda, lloda says: or RhodiumToad no lloda: bad sneek RhodiumToad: lloda: ah, just the person sneek: Welcome back RhodiumToad, you have 1 message! sneek: RhodiumToad, lloda says: yes RhodiumToad: guile-cairo bug: use of a size_t* where an unsigned long* is expected RhodiumToad: in scm_cairo_surface_get_mime_data lloda: ah that's a new function RhodiumToad: just making "len" an unsigned long would suffice. passing an unsigned long containing the size of a memory object to a parameter of type size_t is always safe regardless of relative sizes of types (to the best of my knowledge) RhodiumToad: but passing size_t* where unsigned long* is expected is an error unless size_t is typedef'd as exactly an unsigned long RhodiumToad: (which is often not the case) lloda: confirm RhodiumToad lloda: will fix RhodiumToad: I made the mistake of not testing on i386 arch when updating the freebsd port, so I have a mailbox full of build failures lloda: fixed in git RhodiumToad: thanks much RhodiumToad: is there going to be a release? lloda: is this fix enough for you to build? I can push a release RhodiumToad: I'd prefer a release since then I can just update the port to the new version rather than having to add a patch lloda: sure, np. Just asking if you had more things to fix RhodiumToad: not that I know of, but I can test lloda: I'll push 1.11.1 lloda: if you can test that'd be top RhodiumToad: take me a couple hours maybe because I have a big build going on to test something else lloda: np, just let me know whenever lampilelo: so i have a queue_pop() function that locks and unlocks an scm mutex, the function is then called in a loop that empties the whole queue; i wanted to ask a question if it's worth it to make the mutex recursive and lock it before the loop, but after reading the code it looks like it does almost exactly the same thing both ways lampilelo: also super-expensive lampilelo: i think i'll make a queue_pop_unsafe() function that won't lock and instead put the only lock-unlock in the process_queue() around the loop lampilelo: nah, i'll make a comment about possible optimization if its needed dsmith-work: RhodiumToad: Nope. Single tell target only. RhodiumToad: lloda: confirm build success on freebsd i386 and freebsd armv7 RhodiumToad: (as well as amd64) RhodiumToad: sneek, later tell lloda confirm build success on freebsd i386 and armv7 as well as amd64 sneek: Okay. lloda: got it RhodiumToad, will push the release asap sneek: Welcome back lloda, you have 1 message! sneek: lloda, RhodiumToad says: confirm build success on freebsd i386 and armv7 as well as amd64 daviid: sneek: seen spk121 sneek: zzappie was in (here?) 28 days ago, saying: dsmith-work: Hey thanks ive found it too and was stuck exploring this person's profile for about an hour he or she did lots of cool stuff. daviid: dsmith-work: is that so? i thought nicks were unique and if do not exists or misspelled, that the bot your tell us 'unknown ...' RhodiumToad: that looks like some weirdness in the bot RhodiumToad: fwiw spk121 was last here on 2020-04-14 daviid: RhodiumToad: tx RhodiumToad: at least from my logs wingo: o/ janneke: \o pinoaffe: so I've started using geiser with guile, and every now I unthinkingly make the repl print a huge string / sexp / whatever, which then completely hangs up emacs and makes it pretty much unusable - is there anything I can do to change this / salvage such a situation? rekado_: pinoaffe: difficult rekado_: I still run into this once in a while rekado_: Emacs 27 has “so-long” mode, which might help pinoaffe: I'm working with a lot of decently sized (s)xml, so currently any ill-considered printing is likely to require a restart of emacs, which means I can't really use geiser civodul: there's the emacs-so-long package (in Guix at least) for 26.x too janneke: so-long...ooh, that souds great (as far as workarounds can be great) civodul: :-) civodul: i think i just had a vision: i envy C++ constexpr *: janneke has restarted emacs one or two times when debugging mes printing a circular janneke: list civodul: ah yes, that's terrible civodul: macros are great but sometimes you'd want to reason on types *: civodul feels heretic today janneke: dare i say that goops gives very nice errors, at times? civodul: no but i want some things to happen at compi^W expansion time lloda: pinoaffe: you can change the default repl printer with (repl-default-option-set! 'print (lambda (repl val) ...)) janneke: ah, static typing civodul: well, there are macros like "uuid" or "base32" in Guix, which are really not rocket science janneke: mustn't let regtur hear about things guile could loarn from c++ janneke: *learn -- typing is broken today ;-/ civodul: these things call for a mechanism like constexpr, more than regular macros rekado_: pinoaffe: I use ,pp in the REPL for sxml civodul: and currently, you know that some computations happen at compile time through one of the compiler passes civodul: but it's not "official" janneke: hmm... civodul: anyway, random thought of the day dsmith-work: Tuesday Greetings, Guilers justin_smith: pinoaffe: the ice-9 pretty-print module comes with truncated-print, in other lisps I've been able to replace the repl printer with a custom function like truncated-print which can control the maximum output size justin_smith: this looks exactly like what I was thinking of https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile_0027s-repl_002dprint-procedure.html pinoaffe: rekado_, justin_smith, lloda: thanks, I'll try to change the repl printer to abbreviate by default justin_smith: oh I missed that someone else mentioned that already justin_smith: but that example from the "guile-cv" manual does work, if loaded from the ~/.guile config (or I guess more generally, if loaded before the repl runs) justin_smith: sadly it didn't work mid session wasamasa: hello, I think I've found a bug in guile 3.0.2 wasamasa: before reporting it I'd like to make sure whether it's indeed a bug and what to include in the report wasamasa: when redirecting a length script into the repl, it eventually crashes with "Too many root sets", then does a coredump wasamasa: *lengthy wasamasa: is that expected behavior or abnormal? wasamasa: http://ix.io/2mIk dsmith-work: wasamasa: Not a guile dev, but I'm pretty sure any coredump should be considered a bug. wasamasa: ok, that's what I'm used to with emacs bugs, any crash there gets the same treatment wasamasa: if I don't redirect it, but execute it as normal script, it finishes, although it takes 10 minutes to do so wasamasa: hm, the error originates from the boehm garbage collector wasamasa: same behavior with guile 2.2.6 on arch lampilelo: you're still testing guile-emacs? wasamasa: no, guile --language=elisp lampilelo: ah, right, i read your blog about it yesterday wasamasa: I mean, if it's shipped with a sufficiently new guile, it's official and supported dsmith-work: wasamasa: Have a look at module/language/elisp/README in guile sources. Might help with expectations dsmith-work: wasamasa: Also, test-suite/tests/elisp*.test for what is currently tested wasamasa: ah, these I haven't found so far wasamasa: I'm tempted to say that's more tests than emacs has wasamasa: for some reason they don't test the core functionality, only the extra stuff wasamasa: anyhow, I've reported the bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41404 RhodiumToad: lloda: I may have hit a bug in guile-cairo? RhodiumToad: yup RhodiumToad: cairo_surface_get_mime_data ( ..., &len ) where len is a size_t, but where the function prototype says it wants unsigned long * daviid: pinoaffe: here is what I do and recommend - https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile-for-Guile_002dCV.html#Configuring-Guile-for-Guile_002dCV - which I wrote for guile-cv users, but applies to any use that involves huge 'what-ever' in a repl and wrt the raised exception system ... daviid: oh, i see someone did paste that already, sorry daviid: justin_smith: i personally make the config 'global' -in the int.scm file at guile -c "(display (%global-site-dir))(newline)" - because I _never ever_ want to display huge 'what-ever (in guile-cv, it wold be like 20 million floats or so ...) and if I fce an exception, they I grab and ses a variable I can further 'inspect', using write, or sending its content to a file ... daviid: justin_smith: I was not waware those settings couldn't be done o the fly, that's unfortunate daviid: but i don't need, I never need, to fully repl display the content of huge 'wah-ever' - but if someone coes with a solution to toggle this dynamiclly, let me know ... justin_smith: daviid: surely it's nothing you couldn't solve with indirection and a global (lambda (repl obj) (if truncate? (truncated-print obj) (write obj)) (newline)) justin_smith: it's a good candidate for dynamic binding, though that's not as popular in scheme as it is with other lisps justin_smith: daiia justin_smith: err, I should have figured the person who wrote that doc would be here manumanumanu: Finally I am on a linux computer! ZombieChicken: Did the build system for guile 3 change from guile 2.2? daviid: justin_smith: we can do that, but i thought yo wanted to fix the problem at the 'source', so one could dynamically set! the repl printer, which imo would be better ... then users who'd like to could toggle between truncated or non tuncated ... justin_smith: yeah, that would be better (though I assume harder to fix) cbaines: does anyone know how to work out why Guile is making a futex system call? RhodiumToad: locking between threads? RhodiumToad: it'll have to do that sometimes for the GC, at least cbaines: is there any way to confirm it's that? cbaines: I'm already disabling gc at points, as it appears to make forking unreliable RhodiumToad: well forking in a threaded program has a long list of caveats cbaines: I'm not trying to use threads in this case RhodiumToad: (which amount to "don't do it unless you're about to exec()") RhodiumToad: afaik, the default guile build is to use threads and put the GC into a separate thread cbaines: I am actually trying to do things in the forked processes cbaines: Is that not possible to do safely with Guile? RhodiumToad: maybe you want to build it without threads - I don't know if that even works, but I believe it should weinholt: cbaines, strace -k to show backtraces for syscalls, might give you the info you need RhodiumToad: doing nontrivial stuff after a fork in a threaded program is always dubious cbaines: I think I need to rebuild strace for -k to work.... cbaines: strace: Stack traces (-k/--stack-traces option) are not supported by this build of strace cbaines: It seems that disabling garbage collection might work cbaines: but even trying to do it occasionally seems to quickly result in Guile getting stuck :( cbaines: I think I need to go back to the drawing board in terms of how to use processes... dsmith-work: It's possible to fork/exec with threads (otherwise system and friends wouldn't work), but you can dsmith-work: t use fork and then keep on running in the new process. dsmith-work: Not unless you handle all the locks properly. cbaines: At this point, I'm trying to avoid using primitive-fork cbaines: The primitive-fork docs suggest using (ice-9 popen), so I'm now trying to work out how to use that, given that I don't care about writing to or reading from the processes I want to run... dsmith-work: Will system* do? cbaines: I'm trying to use processes to do more than one thing at once cbaines: I think system* will just mean I have one process waiting for another to finish lampilelo: can't you use threads instead? cbaines: I think I was having problems because of using threads RhodiumToad: with threads, if you share any data you have to make sure you do appropriate locking cbaines: Or rather, because threads cause issues with forking lampilelo: fork doesn't copy threads lampilelo: just the calling thread RhodiumToad: the problem is that locks held by other threads stay locked in the forked child. RhodiumToad: so if you try and take those locks, you hang forever dsmith-work: Exactly dsmith-work: There is a fuction that's supposed to handle that, but the interface is not nice for Scheme. dsmith-work: It aquires all the locks and then releases them in the new process. dsmith-work: But of course, you must get them in the right order or you deadlock. *: RhodiumToad grumbling a bit about guile-cairo dsmith-work: All they needed to do was include a few void *'s for context.. RhodiumToad: my own fault of course for thinking "it's not a big update, I don't need to test it on many platforms" dsmith-work: Ah. pthread_atfork is what I meant. ZombieChicken: is it me, or goes Guile lack a for loop? RhodiumToad: it has several? RhodiumToad: (do) is one of them RhodiumToad: named-let is also commonly used ZombieChicken: Different name then. Thanks ZombieChicken: Trying to convert some Racket code to Guile, and it seems like a lot is 1:1 wrt names justin_smith: fascinating, racket's "for" looks like a hybrid of clojure "for" and the version from c justin_smith: probably clojure copied racket then made it more lispy ZombieChicken: racket seems to do a lot of interesting things RhodiumToad: this business of making horribly complex loop macros has always struck me as a bit iffy justin_smith: common lisp "loop" is insane, it's practically a punchline on its own ZombieChicken: Sometimes a nice do/for loop makes more sense than a recursive function ZombieChicken: justin_smith: How complex is CL's "loop"? I can't say I messed with CL too much; the hyperspec kind of scared me off. Plus it's weird way of handling printing to stdout justin_smith: ZombieChicken: it's a full programming language inside cl ZombieChicken: Fun ZombieChicken: DSLs are great ZombieChicken: Hmm. Seems like guile 3 takes a little while to compile... justin_smith: ZombieChicken: http://ix.io/2mKQ ZombieChicken: That looks fun justin_smith: I compare it to c++ templates or haskell monads - I'll agree that they are intreguing and unique features, but they are also kind of wild RhodiumToad: now that is insane RhodiumToad: and not in a good way ZombieChicken: I've always felt that I either didn't understand monads, or that they were little more than a weird object ZombieChicken: RhodiumToad: On the up side, it reads kind of like English? RhodiumToad: that's not a good thing justin_smith: it might have been influenced by COBOL in that aspect RhodiumToad: and I say that as an SQL expert and someone who has written COBOL in the past ZombieChicken: Given how CL developed, there is no telling tohoyn: sneek, botsnack sneek: :) leoprikler: I think, I found a bug in Guile. leoprikler: It appears `false-if-exception' does not catch exceptions when used inside `with-exception-handler' (but it does inside `with-throw-handler'). RhodiumToad: I'm guessing this is in guile 2.2 ? leoprikler: 3.0.2 leoprikler: Try the following: leoprikler: (with-exception-handler (lambda _ (display (false-if-exception (error "moo")))) (lambda () (error "meow"))) leoprikler: (with-throw-handler #t (lambda () (error "meow")) (lambda _ (display (false-if-exception (error "moo"))))) leoprikler: The first will backtrace on "moo", the second on "meow" leoprikler: (you can skip the display if you want) lampilelo: what's up with this "#define FUNC_NAME s_function_name" it's not documented in the info manual but is required for some macros that are documented there (like SCM_ASSERT_TYPE) dsmith: It's so some error messages can show the current C function lampilelo: ah, no' its not for SCM_ASSERT_TYPE, it's required for internal macros lampilelo: so what would I give SCM_ASSERT_TYPE as a subr argument in normal code not internal to guile? just "function-name"? lampilelo: or should I define FUNC_NAME? dsmith: You could put a literal string. dsmith: #define SCM_ASSERT_TYPE(_cond, _arg, _pos, _subr, _msg) dsmith: For _subr dsmith: Since a SCM can be any type, those ASSERT's are usually used on entry to a C function to ensure that the args are what the function can handle. dsmith: Usually called right at the entry to the function. lampilelo: yes, that part is clear dsmith: the _pos is the argument number. lampilelo: what i'm really asking is what is this s_function_name thing? i see now that snarfing my SCM_DEFINE created an entry that uses it dsmith: Oh. That's a static string with the function name. lampilelo: i'm interested because in reality I tried to use SCM_VALIDATE_HOOK macro and it requires FUNC_NAME lampilelo: but it's not documented so i'm assuming it's considered an internal macro and isn't designed to be used outside guile lampilelo: ah, ok, i found where it's defined, so it just assigns scheme function name to it leoprikler: I think the convention is to use {\n#define FUNC_NAME ...\n...\n#undef FUNC_NAME\n} lampilelo: i wondered if it's something more than that dsmith: Well, if you look at just about any source file in libguile, you can see that FUNC_NAME is #define'ed and #undef'ined for every C func. dsmith: Right lampilelo: leoprikler: sure, it's a convention in a guile source tree but it's not documented so, like i said, i'm assuming it isn't meant to be used outside leoprikler: perhaps not the nicest interface for extensions, but probably not one that's going to collide with other stuff leoprikler: well, neither is the SCM_VALIDATE_HOOK macro, so... lampilelo: and that's why i started looking for an alternate way, but SCM_ASSERT_TYPE requires a _subr lampilelo: so i wanted to know how it all falls together dsmith: While useful for external C modules, I don't think those assert macros (and snarfing macros) where written with *external* modules in mind. More to just make libguile code eaiser to manage. leoprikler: Snarfing is partially documented for external modules. lampilelo: ok, so since you guys know guile's internals maybe you can tell me if there's a more idiomatic way to define a hook than that: https://paste.debian.net/plain/1147305 dsmith-work: Hey Hi Howdy, Guilers rekado: I’m running a debug build of Guile Emacs in gdb to analyze some segfaults and other bugs, but I don’t understand exactly what I’m looking at. rekado: this is the gdb session with backtrace: https://paste.centos.org/view/raw/c7c0d475 dsmith-work: rekado: I'm guessing #15 is where the problem starts: dsmith-work: handler=0x7ffff31614c0 rekado: it already happens in #18 dsmith-work: address 0x2 ? rekado: Cannot access memory at address 0xfffffffffffffe00 dsmith-work: AH yes dsmith-work: Whis is what, -2048? dsmith-work: More like -512 dsmith-work: yep rekado: this looks like it happens really early, right after using scm_with_guile rekado: I wonder where this comes from dsmith-work: So #21 is in the GC. Maybe that's looking somewhere it shouldn't? dsmith-work: It's probing the stack? dsmith-work: Looking for stack boundaries. dsmith-work: Is savannah down? I'm getting a 502 on a pull rekado: hmm, I’ll rebuild with libgc 7 instead of 8. lampilelo: it seems like it segfaults while catching an error inside a finalizer lampilelo: funny dsmith-work: Unfortuantely, that happens a lot. A segfault within an error handler. dsmith-work: main code: Ooo look! I got an error trying to read this address! dsmith-work: error handler: Ok, let's print out what's at that address.. dsmith-work: dsmith-work: Or something along those lines mwette: Hey guys, 0xfffffffffffffe00 looks like it could be -1 immediate value. How many bits does Guile use for marking values? mwette: Look at the section "Faster Integers" in the Guile Ref Manual. mwette: Ah, 3 bits. That's not -1 methinks. mwette: Never mind. lloda: I think I'm going to remove the bug list & new bug tabs in the guile-cairo website and just direct people to guile-user. This thing is pretty stable and we don't get many bugs. All the bugs in the old tracker are fixed. Wdyt wingo? RhodiumToad: mwette: effectively only 2 bits for integers. mwette: RhodiumToad: thanks. wingo: lloda: :thumbs_up: catonano: can I build just the Guile manual and not Guile itself ? wingo: catonano: after configuring i would guess "make -C doc" catonano: wingo: thanks. Configuring right now tohoyn: sneek, botsnack sneek: :) lampilelo: hmm, is string-titlecase supposed to turn "i'm" into "I'M"? lampilelo: string-locale-titlecase handles it correctly and turns it to "I'm" lloda: curious lloda: what is your locale? lampilelo: it doesn't seem to matter but i have LANG set to en_US.UTF-8, but the LC_* pl_PL lampilelo: but when i overwrite it and run it again it doesn't change lampilelo: on srfi.schemers.org they specify "if c is preceded by a cased character, it is downcased; otherwise it is titlecased", so i guess it's right lampilelo: ' isn't cased lampilelo: afaiu *: dsmith-work acivates his portable snarkulator dsmith-work: You mean "," is not lowercase "'" ? lampilelo: :D lampilelo: of course not! "," is a lowercase for "`" dsmith-work: Ahhh! rekado: guile-emacs fails with the same kind of error when linked with libgc-7.6.12 dsmith-work: sneek: seen bipt ? sneek: I think I remember bipt in (here?) 9 months ago, saying: i saw that your guile-emacs package made it into a guix release :). ZombieChicken: anyone know if Guix is working on the Pinebook Pro? ZombieChicken: I know someone said they were working on it civodul: ZombieChicken: janneke is one of the people who looked into it civodul: ArneBab_: you've been having networking issues :-) ZombieChicken: civodul: ty janneke: hey ZombieChicken, there is a wip-pinebook-pro branch janneke: currently, vagrantc (over at #guix) is oloking into it (my pbp is dead) janneke: *looking ZombieChicken: ah! I misread the channel name janneke: hehe, dunno why that happens some times cbaines: janneke, what happened to your Pinebook Pro? cbaines: (I ordered one, and I'm hoping it'll be shipped soon) janneke: cbaines: i have no idea, i liked it a lot cbaines: right, that's a shame civodul: oh :-/ ZombieChicken: janneke: guile ~= guix, I guess. dsmith: RhodiumToad: That's what I was thinking. (a CG thread) kolyad: I'mm having a problem with a recursive macro, and I'm sure I must be doing something stupid. https://paste.debian.net/1147236 kolyad: It appears to expand indefinitely, Suggestions? dsmith: You only have one case in your macro. RhodiumToad: the null? test is being done at run time RhodiumToad: so there's no way for the macro expansion to terminate dsmith: SO when you "call" the macro, it expands again. dsmith: You need another case for terminating the macro. dsmith: what RhodiumToad says kolyad: Ok. Thanks. I was kinda lost. dsmith: SO dsmith: Just like a recusive function, you need a terminating condition, dsmith: You also need a terminating macro condition. In "macro rule" land not "expanded code" land. reepca: how would one query which file is backing a certain module? reepca: I suspect I have stale .go files somewhere, but can't seem to find them dsmith: reepca: Well, they are usually under ~/.cache/ dsmith: .cache/guile/ccache/3.0-LE-4-4.2/ dsmith: Or similar dsmith: Installed ones are somewhere like /usr/local/lib/guile/3.0/ccache/ reepca: I've deleted ~/.cache/guile quite a few times though, and the problem persists dsmith: reepca: If I'm building guile from git, and it, and it's changing rapidly, I regulary just blow away the ~/.cache/guile dir dsmith: reepca: Might I suggest pulliing out the every mighty strace? dsmith: strace -efile guile {whatver} reepca: when I run (set-current-module (resolve-module '(my-module))) and then try evaluating a certain variable in my-module, it says that it's unbound reepca: but when I try evaluating a different variable it doesn't say that it's unbound dsmith: You can where it's looking, and what it's looking for, AND where it's not. reepca: it just occurred to me that this is probably that one optimization at work reepca: where it deletes bindings that aren't exported ZombieChicken: Can one write a module for the Linux Kernel using Guile? dsmith: ZombieChicken: No ZombieChicken: No way to transpile/translate guile into C? dsmith: Not at this time, no. There used to be a translater years (more like decades) ago. "hobbit" I think it was. dsmith: Around guile 1.3 I think. dsmith: Well, this is interesting! https://weinholt.se/articles/quasiquote-literal-magic/ reepca: so in order for (unshare CLONE_NEWUSER) to work, the process needs to be single-threaded. I count at least 6 threads launched by the time the repl starts up. Is there a way to control this? dsmith: Heh. Blast from the past: http://gnu.ist.utl.pt/software/guile/anon-cvs.html chrislck: vim is scriptable by racket... how interesting... dsmith: Sounds like vim is getting closer and closer to emacs... chrislck: lol: it'll have virtuous-mode to counter evil-mode dsmith: heh tohoyn: daviid, str1ings: has the callback support of G-Golf or GObject Introspection documented anywhere? tohoyn: ^been documented str1ngs: tohoyn: Last time I talked to daviid he had not started working on it. tohoyn: str1ngs: ok. I just encountered some callbacks when I worked with Theme-D-Golf. str1ngs: signals should work, but situations that use GAsyncReadyCallback etc won't work. str1ngs: which function are you having problems with? tohoyn: str1ings: none. I just noticed that gi-import-xxx procedures imported some callbacks. tohoyn: str1ngs: not actually imported (only a notification) tohoyn: daviid: it says in https://www.gnu.org/help/evaluation.html that GNU software should be internationalized with gettext. did you have to do that with G-Golf? lampilelo: i'm playing with hooks and snarfing in c, is there more idiomatic way to create a hook than this? https://paste.debian.net/plain/1147305 jackhill: rekado: thanks, that does help me get started. jackhill: RhodiumToad: yep! I didn't spend to long on catamorphisms rekado: I’ve been trying to speed up processing of large Debbugs files that contain raw emails separated by a bunch of different control characters. rekado: the files also contain attachments, so sometimes I have to read through 10+MB of stuff before I find a mail separator rekado: I initially wrote this with (ice-9 rdelim) to read the file line by line, because the control characters are always on a line on their own rekado: then I thought I probably shouldn’t be using a string API and work with the bytevector directly rekado: but I only managed to make everything much slower rekado: do you have any hints for working with files as bytevectors? rekado: the rdelim version takes 14 seconds on a 31MB file rekado: the bytevector version (where I read byte for byte) takes 26 seconds on the same file. rekado: I noticed no difference when I read the whole file into memory with get-bytevector-all and then operated on it byte for byte through a port opened with open-bytevector-input-port. RhodiumToad: how are you searching for delimiters? rekado: naively by get-u8 from the bytevector and comparing it with = the desired delimiter octet rekado: if it doesn’t match: unget and move on to the next byte RhodiumToad: not surprising it's slow then rekado: yes rekado: I thought this would become faster when I do this on a bytevector that’s already in memory daviid: sneek: later tell tohoyn I pushed a fix for gtk-tree-store-set-value, please pull, make, try ... tx for the report sneek: Got it. mwette: (On the long term) I wonder if mmap() would help. I have worked on/off on mmap port for Guile, but that is not done. mwette: ^ in processing large files. mwette: see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27782 mwette: How about a procedure (mmap-file "abc") => bytevector ? civodul: mwette: that'd be nice civodul: bytevectors have an indirection to make that possible mwette: So mmap is a bit of a kitchen sink, and there is a windows version. Better to make low-level interface in C (e.g., mmap) and make Scheme helpers (e.g., mmap-file, mmap-anon) or just make higher-level procedures in C (e.g., (mmap-file "foo.dat" "rw") ? <= Where "r" maps to PROT_READ|PROT_WRITE. mwette: I'm going with user-friendly high level interface (map-file "foo.dat" "rw") tohoyn: sneek, botsnack sneek: tohoyn, you have 1 message! sneek: tohoyn, daviid says: I pushed a fix for gtk-tree-store-set-value, please pull, make, try ... tx for the report sneek: :) tohoyn: daviid: it works. tx. daviid: tohoyn: great, i'll fix the glist problem a well, wii let you know daviid: lloda: fwiw, savannah nongnu projects may also have/open mailing lists, but this must be done by the project admin - login, then Main->Features, the activate the 'Mailing Lists' checkbox, which will provide a menu entry on the main project page, then you (the project admin) may start new ML(s), which one of them can be bug-guile-cairo ... which uses debbugs, just like for bug-guile ... tohoyn: daviid: is byte-array implemented as Scheme bytevector? daviid: tohoyn: when possible, using sfri-4 daviid: afaict all are sfri-4, when allocated by g-golf tohoyn: daviid: if an argument type is byte-array can I pass a bytevector to it? daviid: tohoyn: not all types are covered, when you find a missing type, let me know - it's just a matter of time and occurrences so we caover them all ... daviid: tohoyn: i probably not 'just like this - the machinery needs to follow the GI protocol ... just paste a snipset and i'll fix the missing type daviid: tohoyn: what is the function? it's difficult to answer 'in the dark', and example is _always_ better ... tohoyn: daviid: no particular function. I'm just implementing Theme-D interface to G-Golf. tohoyn: daviid: how is ptr-array implemented in G-Golf? daviid: tohoyn: as a user, you shouldn't have to buid an array of pointers yourself tohoyn: daviid: ok daviid: tohoyn: because usually, they are the are built from scheme lists of ... daviid: and therefore, the scheme procedure that iplements a GI function expect a lst ... daviid: tohoyn: wrt gtk-radio-menu-item-new-with-label, when you a re creating a new group, you should pass #f as the first arg, not '() daviid: (gtk-radio-menu-item-new-with-label #f "Item") tohoyn: daviid: ok tohoyn: daviid: so ptr-arrays are implemented as lists in guile? daviid: tohoyn: this said, could you make an example for me that use an existing group - I'm not sure what the scheme arg should look like in that case tohoyn: daviid: here: https://paste.debian.net/1147024/ daviid: tohoyn: is a radio button considered a group ? I don't know because i (a long time ago) built those using glade ... tohoyn: daviid: IMHO a group is a list of radio buttons daviid: ok, i'll check that tx tohoyn: daviid: see https://developer.gnome.org/gtk3/stable/GtkRadioMenuItem.html#gtk-radio-menu-item-new-with-label daviid: i know the doc tx daviid: tohoyn: ok, it appears it is not the recommended way of doing things, see the documentation for gtk_radio_menu_item_join_group tohoyn: daviid: good point. daviid: (gtk-radio-menu-item-new-with-label #f "Item 1") -| $10 = #< 5570666d3ca0> || (gtk-radio-menu-item-new-with-label #f "Item 2") -| $11 = #< 557066893b80>, then (gtk-radio-menu-item-join-group $10 $11) tohoyn: daviid: the first argument of procedure g-variant-parse-error-print-context has type-tag and type-desc "error" tohoyn: daviid: shall I make a snipset? daviid: tohoyn: g-variant are not implemented, i think lampilelo: when hooking guile to an existing program, if I want to load an scm user config file, do I have to load it for every thread or can I load it just in the main thread when initializing? will the stuff from the file be available to other threads? lampilelo: i'm not putting threads into guile mode, just call scm_with_guile at certain places lampilelo: it doesn't seem to work so I'm assuming that every thread has it's own, isolated environment manumanumanu: lampilelo: what exacttly do you want to do? I am not quite following lampilelo: i want the user to have his config.scm file that will be loaded when he starts a C app and the code from inside that app to be able to call functions defined in that file lampilelo: and it's a multithreaded application manumanumanu: lampilelo: I haven't really embedded guile in multithreaded applications (nor am I very good at C). davexunit has done some things down that path manumanumanu: lampilelo: this old blog post does it for guile2: http://pimpmycode.blogspot.com/2012/11/using-gnu-guile-for-fun-and-profit.html lampilelo: hmm, i have more fundamental problem than that - it seems like i don't know how to invoke scm_call correctly so i'll work on that first lampilelo: manumanumanu: i'll take a look at it, thanks manumanumanu: sorry to not be of more help. tohoyn: daviid: is it so that GValues should not be used by ordinary users of G-Golf? If so, could you check function gtk-container-child-get-property. lampilelo: manumanumanu: this article talks about spawning threads from inside of guile, that's not what i want, i want to hook it up to existing threads, but thanks anyways lampilelo: ok, it seems that it works in multiple threads after loading it from the main one lampilelo: the problem was me not knowing how modules work lampilelo: FYI i'm trying to extend moc player with guile lampilelo: first thing on the list is custom loading mechanism for lyrics laurus: Where can I find a list of the functions that are implemented for ELisp in Guile? laurus: (Or any documentation of the ELisp in Guile for that matter, beyond the description of what it is that I see in the Guile manual.) lampilelo: laurus: there is a README file in guile/module/language/elisp/ in the guile source tree, but not everything is listed there, so i think you'd have to look at the code laurus: lampilelo: For example, I put this into a file called mytest.el: (prin1 (+ 1 2)) laurus: Then, I ran: guile --language=elisp mytest.el laurus: But I get: ice-9/boot-9.scm:752:25: In procedure dispatch-exception: In procedure public-lookup: No variable bound to prin1 in module (language elisp runtime function-slot) lampilelo: grep does confirm it's not there laurus: lampilelo: how can it not be, this is one of the most basic ELisp functions lampilelo: don't ask me, i never tried to use elisp in guile laurus: One of the release updates a few years ago said "Guile's Elisp implementation is now fully Emacs-compatible" pinoaffe: laurus: I think you're mixing things up laurus: pinoaffe: how so? pinoaffe: laurus: there is an elisp compiler built on top of guile, which should be fully compatible, and then that's starting to allow for emacs to be scripted in guile, but that part is far from finished pinoaffe: oh wait, I misunderstood you, nevermind tohoyn: FYI: software library Theme-D-Golf has been released. it provides access to G-Golf in programming language Theme-D. The library can be downloaded from http://www.iki.fi/tohoyn/theme-d-golf-0.8.0.tar.xz str1ngs: tohoyn: nice laurus: pinoaffe: my conclusion is that only the most basic aspects of Elisp are implemented in Guile, but a person who has programmed Elisp in its traditional environment and tries to do almost anything (like print something out as I just tried) in the Guile version can't really get anywhere. ATuin: tohoyn: scheme with static types, interesting laurus: lampilelo, pinoaffe: this is extremely annoying because Elisp itself is very well documented in a large reference manual (as I'm sure you're aware). laurus: so anyone who actually takes Elisp seriously based on what's in its _official_ manual and goes into Guile and tries to program even the most basic thing will come away annoyed and bothered lampilelo: laurus: you can write scripts in elisp using emacs batch mode if you want, why use guile for that? lampilelo: if you don't want to use guile proper, that is laurus: lampilelo: I thought one of the selling points of Guile is that it's a multi-language VM for the GNU system. laurus: Every single time I come back to this I get annoyed and feel like I've wasted time. lampilelo: gnu is just a bunch of volunteers, it seems like there's not that much people that care about the multi-language thing to implement it laurus: lampilelo: yeah I guess that's right. lampilelo: that many* laurus: Well, thank you for the help. pinoaffe: laurus: yes, it's a multi-language VM for the GNU system, but the documentation is pretty bad laurus: pinoaffe: well, it seems like there is close to zero coordination going on laurus: I mean, Guile apparently has Elisp, but it seems like no one between the "GNU Emacs Lisp" people and the "Guile version of Elisp" people have gotten together to even confirm what the spec itself should be for "implementations of Elisp outside the Emacs editor." laurus: Why has that not happened? ATuin: mmm I'm trying to set to false the test-log-to-file for srfi-64 but seems that it always ends up saving the output into a file ATuin: any idea on how to stop loggin into a file? reepca: is guile's gc smart enough to not collect foreign pointer objects when only the result of pointer-address is still live? mwette: ATuin: what version of guile? mwette: ATuin: The symptom you see is a known bug in guile-3.0.0 through 3.0.2. Fixed in commit 2b4e45ca1b89a942200b7b9f46060dddc44d2876. mwette: The fix is to add `#:declarative? #f' to define-module in srfi/srfi-64.scm rekado: laurus: prin1 is defined in ./module/language/elisp/boot.el laurus: rekado: Really! How did you know that? rekado: grep rekado: but it does look like there have been a few regressions laurus: rekado: I don't seem to even have that "module" rekado: I have been trying to upgrade the wip-elisp branch since Guile Emacs can’t be built at this point laurus: (I'm very unfamiliar with Guile, perhaps I need to install that module?) rekado: probably in the wip-elisp branch only rekado: so I guess Guile still does support Elisp, but it currently doesn’t include what you could consider the standard library rekado: that’s only on wip-elisp laurus: rekado: I see, thank you that's helpful. How do I get that elisp module installed? rekado: I think you would build Guile from the wip-elisp branch rekado: but I don’t recommend doing that now; not before the regressions have been addressed. rekado: :-/ laurus: Wow, I see. rekado: I’m working on a patch rekado: interest in elisp on Guile has been surprisingly low, so I think it’s no wonder that it has atrophied somewhat since it got first introduced. laurus: rekado: so I have a couple things I'd like to ask you about briefly laurus: rekado: one is, how does Guile choose which functions from Elisp to implement? rekado: oh, I’m the wrong person to ask. I’m just a janitor. laurus: For example, we have the "GNU Emacs Lisp Reference Manual" which documents all these functions. But, we don't have a language spec for implementations of Elisp (like that in Guile) laurus: rekado: no that's okay, you're very knowledgable laurus: rekado: like, what's your opinion on this? I mean if it were you, how would you decide what to implement? rekado: from what I can tell very little is implemented in Guile itself rekado: even boot.el is written in Elisp laurus: rekado: Wow, okay laurus: rekado: from my understanding, some of these commonly used Elisp functions are written in C rekado: so it’s just a bunch of primitives that are sufficient to load boot.el, and that should be enough to load all the other Elisp code. laurus: rekado: what would happen to those, on a Guile VM-based implementation? rekado: I suppose they would be reimplemented in Elisp laurus: rekado: I see. For example, prin1 is in C in Emacs, so someone actually wrote an Elisp version of it and put it into Guile. Very cool. rekado: even something like “defun” is implemented in Elisp on top of primitives defined in (language elisp runtime) laurus: rekado: That is completely incredible! laurus: rekado: So that's why the release notes said that Guile VM-based Elisp is working just as the Elisp in Emacs, or whatever the exact wording was laurus: rekado: What is the issue with the build right now, I mean, what does your patch do? rekado: wip-elisp is currently based on a version of Guile before the 2.2 release laurus: Oh! rekado: so the first step is to rebase it on 2.2 and fix broken tests rekado: (there are quite a few that fail) laurus: I see. And then upgrade it to 3.0? rekado: once that works, yes, upgrade to 3.0 laurus: Wow. Is that going to be a lot of effort? rekado: but before then I’d like to see if we can build guile-emacs again laurus: I am quite unfamiliar with Guile and I don't know how much changes, etc. laurus: rekado: doesn't building guile-emacs depend on the elisp implementation working? rekado: because right now it is so terribly slow that the compilation takes forever rekado: it used to work before rekado: so I hope that rebasing on top of 2.2 and fixing a few bugs will restore that functionality laurus: rekado: this is all so encouraging and inspiring! My initial goal is just to program command-line scripts in Elisp and run them using the Guile VM rekado: the diff between 2.1.x and 2.2 is much smaller than that needed to upgrade to 3.0, so I want to be sure I’m doing something that actually yields results laurus: rekado: Do you think Guile Emacs could eventually take advantage of Guile's facilities to improve the core of Emacs that is "crufty"? rekado: I don’t know. rekado: Doing so would mean to diverge from Emacs laurus: Well, if Guile Emacs was working amazingly well, maybe the GNU Emacs people would start liking a collaboration rekado: since the Emacs developers are not convinced Guile Emacs is worth the trouble, diverging from Emacs would just make future work on Guile Emacs more difficult to keep in sync. rekado: that’s still doubtful laurus: Yes, I guess I meant long-term laurus: rekado: is there a way to donate to you somehow for the work you're going to do on this? rekado: no, I don’t take donations rekado: it also wouldn’t be right laurus: rekado: Hm, okay. laurus: Well I appreciate the work you're going to be doing rekado: other people have done all the work; I’m just an enthusiast who would like to prevent their work from rotting laurus: :) laurus: why is it called wip-elisp by the way? rekado: wip = work in progress rekado: I guess the “elisp” part is obvious ;) laurus: Right, but I don't even have an "elisp" module at all in my Guile install laurus: Yet, I can use ",language elisp". So I'm wondering why all the key stuff seems to be separated out rekado: wip-elisp includes a few commits that are, well, non-committal. rekado: some hacks and workarounds rekado: some tests disabled rekado: this would need to be cleaned up before merging it into the master branch laurus: rekado: I see. laurus: Well I will definitely look forward to this, I'm quite inspired by it. rekado: yeah, me too rekado: thanks for asking about it rekado: it made me open up the directory again and look at the test failures laurus: I'm maybe an unusual user of this in that I'm more interested in Elisp than Scheme, simply because I know more of it laurus: I also have an interest in Emacs as a platform for applications (stuff like mu4e for example) laurus: So I'm more interested in the fact that Guile has this VM capability, than Guile Scheme itself laurus: You're welcome, glad to hear that :) rekado: the Guile VM and compiler tower are very cool. laurus: I think regarding Elisp that despite its issues or being a worse language than Scheme or whatever, it is in use and a lot of very useful stuff for a lot of people has been built on it rekado: one style of writing libraries for Guile includes writing a compiler layer laurus: And Emacs the program is useful not only as a text editor but as an application platform for some of those applications rekado: yeah, I live in Emacs, too dsmith: laurus: At the core, Scheme and elisp are incompatible. '() nil t #t #f mean different things. The "compatability" that was added was a way to allow those differences to co-exist. (my understanding anyway) sneek: Welcome back dsmith, you have 1 message! sneek: dsmith, wingo says: turns on i made a mistake that resulted in all optimizations being on, also for bootstrap :P things a little better now. laurus: So having a future for Emacs that is on this very solid VM and platform is quite important laurus: dsmith: Yeah, I know that from Tom Lord's warnings about trying to bridge the two, in an email to one of the lists a long time ago :) laurus: rekado: and of course if people are using Emacs for those applications, extending them, etc., then the ability to write Elisp programs that do stuff outside of Emacs allows them to use that knowledge more generally, hence the importance of being able to run Elisp on Guile VM from the command line rather than emacs editor batch mode mwette: I believe another big incompatibility between scheme and elisp is lexical vs dynamic scoping. laurus: I also think there's a role for standardization in all this laurus: I.e., what gets implemented and how. For example, how is the concept of "buffer" implemented on Guile VM. laurus: Do you happen to know the answer to that (regarding buffer specifically)? dsmith: Also is that scheme is a lisp-1 and elisp is lisp-2 dsmith: laurus: It's not dsmith: Like buffer-local variables? Nope laurus: dsmith: so "find-file" doesn't work in Guile Elisp? laurus: Or, for example, "write-region"? dsmith: That would all live in emacs. Those are emacs functions. laurus: dsmith: But, how then would someone write a text-processing script in Guile Elisp? dsmith: I suspect the intent was more to get Guile into emacs than provide emacs functionality into Guile. laurus: dsmith: But "buffer" surely must exist somehow, otherwise how could Guile Emacs even run? laurus: Or is it just like, that's implemented in C and stands apart from the stuff running on the Guile VM? dsmith: Oh, that all exists inside of emacs. bipt did a whole lot of work there Two Google Summers of Code worth. laurus: You mean to bridge the two systems laurus: ? dsmith: So there right now, the only place elisp is implemented is in emacs itself. There is not much separation beteen elisp the language and emacs the application. What would a separate implementation of elisp look like? What functions would be avilable in it's core? What functions are specific to emacs the applicaiton? It's all mixed together right now. laurus: dsmith: Well didn't we just discuss that there is a lot of Elisp implemented in wip-elisp? dsmith: I believe the main focus of the emacs support in guile was to specifcally be able to extend emacs with guile as the Elisp and Scheme languages. dsmith: Again, personal opinion. As an outside observer. laurus: dsmith: Right. I'm saying that there are these other benefits of the work that was done laurus: And moving into the future it might be good to be paying attention to these other aspects dsmith: There are other languages on top of guile. Most of them are not very usable either. They do not get much love. dsmith: Why would they, when you can code in Scheme instead? ;^} laurus: dsmith: because of all the reasons I just mentioned laurus: As Richard Stallman said (quoted in an e-mail from Thomas Lord to the Guile mailing list in 2010): "If it only supports something like Emacs Lisp then it is not much of an advance. Guile supports Scheme and Javascript as well as Emacs Lisp. It also supports multithreading, which IMHO is a big deal as well, perhaps more important than bignums.\n\n I think the support for multiple languages is the biggest advance." laurus: (sorry, it was to the emacs-devel mailing list, not the Guile mailing list) dsmith: I would really like to see Guile in Emacs. I think it's a great idea. There are not to many emacs devs on board with it though. Unfortunately. dsmith: A long long time ago, when Gnome was first starting out, Guile was to be the offical scripting language for automating apps. dsmith: Somehow, that just went away. dsmith: Oh well. RhodiumToad: much as I'm getting to like scheme (and have always liked lisps in general), I think it's less accessible as a language to most users janneke: RhodiumToad: English is also pretty hard, I don't think it will ever take off RhodiumToad: if it hadn't become dominant for reasons unrelated to its ease or difficulty, it probably would not have gagbo_: and english is pretty easy grammar wise gagbo_: I would be endlessly confused by having guile and elisp code in the sources though, it would not be fun times with the devs I think... Part of the reason I chose Guile for my pet project was to see what (bad) Guile looks like gagbo_: and now I can't help people anymore in elisp because I can only remember Guile functions gagbo_: (I know Guile Emacs wasn't about mixing Scheme and Elisp in configurations, but hacking the VM where you're handling elisp code in scheme looks not that fun :/ ) tohoyn: sneek, botsnack sneek: :) dsmith: sneek? dsmith: sneek: sneek? sneek: Its been said that sneek is a good bot dsmith: Indeed jackhill: rekado, RhodiumToad: Thanks for your advice yesterday on sxml. I accomplished what I needed to … jackhill: … inefficiently, but hey, it works, and now I have something I can iterate on at my leasure. lampilelo: omg, at last! i put guile inside the moc player and now i can have lyrics stored in any place i want! i can implement automatic downloading of lyrics and other stuff i can come up with, without redesigning much of the c code lampilelo: thanks guile! lampilelo: if i tell the moc developers they'll probably say "what? scheme? :/" because moc is more vim-like jackhill: lampilelo: Vim (at least used to) supports being scripted in Racket: https://github.com/vim/vim/blob/ade0d39468014fd55d30f7647a1ac104baff4bc5/src/INSTALLpc.txt#L31 lampilelo: oh, wow lampilelo: lispers are everywhere justin_smith: some acquaintances of mine made a very small lisp (mostly clojure flavored) in lua, which runs in the nvim native lua engine lampilelo: the only lisp i know that is related to lua is fennel justin_smith: https://github.com/jaawerth/fennel-nvim justin_smith: lampilelo: tht's the one justin_smith: neovim uses a lua runtime, and this code lets it load fennel directly lampilelo: i learned about it like a week ago (i know about it, i don't know it) lampilelo: that's pretty cool lampilelo: since when this is a thing? dsmith: At one time, someone was working on a lua for Guile. justin_smith: yeah, it exists, but sadly doesn't even try to be compatible justin_smith: so it's really "a minimal lua-like-language" implemented on guile manumanumanu: justin_smith, dsmith : that would be nalaginrut's work. IIRC it got actually quite close dsmith: Yes dsmith: nala justin_smith: manumanumanu: right - it's not that it's incomplete, it is that it intentionally diverges from the lua spec justin_smith: so it's interesting but not lua dsmith: lua is really nice for embeddeding all on it's own. I think a lua-on-guile would be pretty hard to compete wth that. manumanumanu: If laurus ever returns, I think we could tell him/her that guile-emacs just deferred a lot of the elisp runtime to use whateve C procedures emacs has. reepca: so I'm trying to use the ffi to access the "environ" global variable, but it doesn't seem to be working reepca: wait I might be a fool reepca: ah, I have to dereference it, of course manumanumanu: Forgive my ignorance, but I am comparing the following two ,time outputs: manumanumanu: ;; 2.009149s real time, 2.395014s run time. 0.586440s spent in GC. manumanumanu: ;; 1.763346s real time, 1.791048s run time. 0.093789s spent in GC. manumanumanu: The runtime is pretty comparable, but what is going on with the first one? 2.39s run time? What does the difference to the second one mean in practice manumanumanu: I am code-golfing a json library trying to make it faster. Mine is the second one, on a 24mb json file. manumanumanu: reading a 24mb json file into scheme dsmith: multi-core machine? manumanumanu: sure, but I am not doing any threading myself dsmith: ok. Wonding if that was why. How can the "run" time be longer than the "real" time? manumanumanu: The second piece of code started as the first piece of code and got a lot of optimizations that were then merged back into code 1. lampilelo: these guile-based parsers are not overly fast, i wrote a basic libxml wrapper for guile some time ago and it's a lot faster than the parser in the sxml module manumanumanu: did you expect it to? manumanumanu: libxml is pretty fast, and is written in a language where no operation has any real overhead reepca: anyone else having autodoc issues with geiser with guile 3.0? reepca: sometimes the autodoc hints appear, sometimes not - for example, they don't appear for 'write', but they do for call-with-output-string lampilelo: manumanumanu: sure, but it makes me think we should have c-based solutions in the guile's core; sxml simple is pretty much a reference implementation for sxml lampilelo: and sxpath isn't implemented fully afaik johnjay: guile has a JIT now? johnjay: or it always had one? manumanumanu: johnjay: since 3.0 johnjay: cool manumanumanu: lampilelo: i somewhat agree, but best would of course be if guile could provide enough speed to make native guile modules compelling enough :D Reading json at 13mb/s isn't bad for a dynamic language. manumanumanu: it isn't stellar either. comparing to languages that use C it is not great :) :) manumanumanu: my json library is less than half as fast as racket's json library, which is probably the fastest one running on chez scheme, which means I am doing fine manumanumanu: being guile native means playing well with delimited continuations reepca: how would one query which module is used for a certain binding? manumanumanu: reepca: (help binding) manumanumanu: shows the defining module lampilelo: manumanumanu: yeah, i guess it would be a pain to implement properly reepca: manumanumanu: thanks lampilelo: i mean in c manumanumanu: i wouldn't parse XML in C, but evn I could write a json parser without too many RCEs in C :D manumanumanu: but I don't think I could write one using SSE, which means it wouldn't be stellar RhodiumToad: manumanumanu: regarding runtime, the GC runs in its own thread jackhill: Hi Guix! I'd like to learn about streaming in Guile. Something like conduit or pipes in Haskell or transducers in Clojure. Advice on where I should look? jackhill: s/Guix/Guile/ jackhill: :) daviid: jackhill: guile has just 'win' a transducer module, but i don't remember who wrote it and where it is :) jackhill: daviid: thanks. I'm currently looking at SRFI-41 daviid: jackhill: I hope someone that 'really knows' can help ... daviid: jackhill: no, here is what I was looking for https://lists.gnu.org/archive/html/guile-devel/2020-03/msg00011.html and other emails in the thread ... jackhill: an and SRFI-171. The internet searching is going better today than it usually does :) daviid: srfi-171 jackhill: great, thanks I appreciate it daviid: welcome tohoyn: daviid: I get the following error from configure when I have Guile 3.0, 2.2, and 2.0 installed: configure: error: found development files for Guile 3.0, but /usr/bin/guile-2.0 has effective version 2.0 tohoyn: daviid: It doesn't work even if I remove 2.0 from configure.ac tohoyn: daviid: I have both guile 3.0 and 2.2 installed and I would like to use 2.2 tohoyn: for g-golf daviid: tohoyn: not sure, maybe you could try to remove 3.0, use GUILE_PKG([2.2 2.0]), or even GUILE_PKG([2.2])? tohoyn: daviid: I changed the argument of GUILE_PKG to [2.2]. It doesn't work if the development files of both guile 3.0 and 2.2 are installed. daviid: tohoyn: hum, that is a guile parallel install 'error', not a g-golf error, I wish I could help but I am 'idea less', I hope soene used to these config can jump'in and help ... daviid: what is the error whe yu only keep 2.2? daviid: only keep GUILE_PKG([2.2]) in g-golf configure.ac file I mean ... tohoyn: daviid: wait ... tohoyn: daviid: configure: error: found development files for Guile 2.2, but /usr/bin/guile has effective version 3.0 tohoyn: daviid: seems to work when i used update-alternartives --config guile daviid: tohoyn: this is a debian guile parallel install problem, I think tohoyn: daviid: Theme-D works fine there tohoyn: daviid: having development files for both 3.0 and 2.2 installed daviid: the configure output should show what it finds for guile, guld, gule-config, then variables, site, site-ccache ... daviid: *guild, guile-config tohoyn: the problem is that configure.ac reports an error when it finds out the the version of /usr/bin/guile is 3.0 daviid: but it first tried other, like guile-2.0, guile2.0 daviid: and did not find any daviid: which is a debian problem I think tohoyn: daviid: configure.ac contains line GUILE_PROGS([2.0.14]) daviid: I meant guile-2.2, guile2.2 daviid: that's ok, it only ther to tll the minimum version with which it should be happy daviid: but it should finf guile, guild and guile-config all for 2.2.x tohoyn: daviid: anyway, bytecodes are wrong even though configure and make work tohoyn: daviid: ,use (g-golf) doesn't work daviid: it can't work if itlaunches 3.0 daviid: tohoyn: if configure fails, obviously make will fail, so will fail ,use (g-golf) tohoyn: daviid: the problem is that am/guile.mk uses command "guild". it should use "guild-VERSION" (which doesn't work for guile 2.0) tohoyn: daviid: configure and make work after update-alternatives daviid: i can patch guile.mk, it still does not explain why configure fails though daviid: make comes after daviid: and most istallation will keep guild and guile-config daviid: not gule-version daviid: guild-versiobn daviid: tohoyn: ok, I changed t to $(GUILD) - though in yur case, it should still fail earlier daviid: tohoyn: I pushed the fix, so guile.mk uses $(GUILD), not guild daviid: which is better, but it won't solve your/debain configure problem daviid: *debian daviid: anyway, have to rest, bbl tohoyn: daviid: the value of GUILD is wrong. it is /usr/bin/guild. daviid: as i told you, it is a debian problem daviid: tohoyn: the debian guile's maintainer is often herem alhtough not now, hi nicj is rlb, try to ping him when he's around ... tohoyn: daviid: I disagree. if you use guild-VERSION and guile-version it works fine. tohoyn: daviid: I do that with Theme-D. daviid: tohoyn: it's a debin proble if you use debian packages of course, if you manually installled, that's another problem tohoyn: daviid: I use packages daviid: the re is no guild-VERSION tohoyn: daviid: I've got guild-3.0 and guild-2.2 daviid: tohoyn: you report a configure problem, at that time, guild is not used daviid: it is the configure step that sets the GUILD variable tohoyn: daviid: ok. agree. daviid: ok, for some rason I don't know, it's not working for you daviid: on debian daviid: lets ask rlb when he's around daviid: or someone else that knows is welcome to help of course ... wingo: moin tohoyn: is it possible to have warnings as errors when compiling guile code? tohoyn: it would be useful especially for --warn=unbound-variable civodul: tohoyn: it's not implemented currently but i agree it'd be nice tohoyn: FYI: A new version of programming language Theme-D is released. It supports both guile 2.2 and guile 3.0 as target platforms. tohoyn: FYI: see http://www.iki.fi/tohoyn/theme-d/ tohoyn: FYI: A new version of software library Theme-D-Gnome has been released. (no support for Guile 3.0 yet) tohoyn: FYI: the new version works with Theme-D 3.0.0. See http://www.iki.fi/tohoyn/theme-d-gnome/. tohoyn: daviid: It would be nice if gslist would work as a g-golf return type. I need it for procedure gtk-radio-menu-item-get-group. tohoyn: daviid: function gtk-radio-menu-item-new-with-label gives the following warning: Unimplemented type: gslist lloda: what's the trick to use ssh for cvs commit lloda: it keeps asking me for a password lloda: I did it two years ago but I don't remember how :-( lloda: oh I did it lloda: I think... nikita`: my .shrc has export CVS_RSH=ssh lloda: no, i've got conflicts. I think it's ok to force for www-commit, right? lloda: nikita`: thx, yes that's what I did nikita`: how do you force commit to cvs... lloda: and set CVSROOT with username and remove the baked in -d line lloda: i've no idea nikita`: it doesn't work in my experience. resolve conflicts locally and then commit? lloda: the only thing i've ever used cvs for is the guile-cairo website nikita`: NetBSD is working on moving away from CVS but it's a long road, that's why I'm still using CVS for many projects lloda: ok i'll look into how to do that... nikita`: old repository with many roadbumps in commits. last i heard we're close to migrating RhodiumToad: migrating to what, out of curiosity? lloda: yeah that was my fault, I had a separate checkout of the website but I forgot about it and I foolishly used make www-commit from the guile-cairo source *: lloda has to be more diligent keeping notes nikita`: i first wanted to check if it's publicly discussed or internal.. https://twitter.com/netbsd/status/954438992325435392 mercurial nikita`: nothing finished so far, so nothing official i guess. lloda: actually http://savannah.nongnu.org/cvs/?group=guile-cairo has all the instructions, so yeah lloda: guile-cairo 1.11 is out :p lloda: fixes this 10 year old bug https://bugs.freedesktop.org/show_bug.cgi?id=30510 lloda: civodul: can/should we have a debuggs component for guile-cairo? or should we direct guile-cairo bugs to just guile RhodiumToad: does it fix anything else? :-) civodul: hi lloda! civodul: lloda: dunno, i'm not involved in guile-cairo nor debbugs :-) civodul: but maybe yes civodul: oh you just released a new version? civodul: yay! \o/ lloda: well odd version in case I messed something up lloda: mostly to regen the doc in the website civodul: if it's good enough for you, Savannah has an old-style web-based issue tracker lloda: I ask you b/c wingo told me you would know lloda: ah I've seen that tohoyn: daviid: there is a bug with tree stores. see https://paste.debian.net/1146884/ lloda: i'll check that out civodul civodul: yes, to request a debbugs entry, just email help-debbugs@gnu.org civodul: someone will set it up for you civodul: (IIRC) civodul: see also https://debbugs.gnu.org/ wingo: hehe apologies for my ignorance lloda: RhodiumToad: wingo added a couple extra bindings civodul: heya wingo! :-) lloda: There are no standing bugs as of now mwette: sneek: later tell tohoyn, daved rlb knows about the missing guild-2.2; I ran into the same problem sneek: Got it. dsmith-work: Happy Friday, Guilers!! civodul: yay, happy Friday dsmith-work & all! wingo: hey it's friday!! woo!!! janneke: ...welcome new contributor's day ;)? *: janneke ...trying to gently nudge "someone" to say something about regtur's fsf paperwork and/or new PEG patch civodul: janneke: paperwork is in order! civodul: regtur: ! civodul: hi! civodul: i'll push the 'pipeline' patch hopefully soonish janneke: civodul, regtur: \o/ *: janneke often very much likes a: "i've seen you" -- even if a real reply takes longer and more effort civodul: i hadn't seen regtur was here :-) janneke: he's hiding civodul: but yeah, sorry for not showing any signs of life! stis: tja guilers! stis: python's ctypes are nice, trying to build something for stis: I'm trying to build it with guile's ffi wingo: nice mwette: stis: Do you know about scheme-bytestructures and nyacc's ffi-helper? daviid: tohoyn: can you provide a snipset with a minimal example of radio-menu item/group, tx daviid: tohoyn: please use the 'template' we've used for list-store ... using gtk-main (not a and doesn't use g-application-run ...) tx daviid: for those debugging snipset ... unless the bug/missing type is related to and/or g-application-run of course ... tohoyn: daviid: do you need a C snipset or Scheme? sneek: Welcome back tohoyn, you have 1 message! sneek: tohoyn, mwette says: daved rlb knows about the missing guild-2.2; I ran into the same problem daviid: mwette: is this a guile.m4 problem maybe? daviid: it's been patched very recently, didn't grab the latest, g-golf keeps a copy (to avoid ACLOCAL problems and nice r messages if guile itself cant be find ...) tohoyn: daviid: here is a Scheme snipset: https://paste.debian.net/1146920/ tohoyn: daviid: is it ok? mwette: daviid: I don't know; guile-dev provides guile-2.2 but not guild-2.2 IIRC; I've also have problems if guile is 3.0, there is no guile-3.0 but guile-2.2 exists. I ended up tossing out guile.m4 and hacking up configure.ac for my app (nyacc) daviid: yes, it's ok, will look into this asap, let you know when fixed, tx daviid: mwette: I think rlb mentioned here he did solve those problems, with the new 3.0.x package he worked on for unstable (or is it in testing already?) ... that is very recently, not sure but i mwette: daviid: yes, I brought this up to him several weeks ago, I referenced a ubuntu bug report I filed bsima: this code never completes reading from the port, is there something I'm missing? bsima: (let ((port (popen/open-pipe "pandoc -f markdown -t html -o -" OPEN_BOTH))) bsima: (display "*bold*" port) bsima: (read-delimited "" port 'concat) bsima: (popen/close-pipe port)) bsima: RhodiumToad: trying to read and write pipes to the same subprocess from the same thread is a recipe for deadlock RhodiumToad: there's no guarantee that the subprocess will flush its output in a timely manner bsima: oh, deadlock. how can I pipe to/from a subprocess then? RhodiumToad: well not really a deadlock in this case RhodiumToad: there are two issues: the subprocess might not flush output, and that the subprocess might emit enough output to block writing its output pipe, causing you to block writing to its input pipe, resulting in your never getting to read the output to unblock it RhodiumToad: to make it work reliably, you need to desynchronize the input and output somehow - whether by doing things in a nonblocking fashion or doing them from different threads RhodiumToad: in the example of passing a short string through a text filter, the subprocess probably isn't going to write anything until it sees EOF on the input or has at least a buffer's worth of output lined up bsima: when i ^C then ,bt it looks like guile is waiting for something from pandoc RhodiumToad: that's exactly what it's doing RhodiumToad: pandoc hasn't seen an EOF on the input, doesn't have enough output yet to be worth writing, so it's waiting for more input bsima: how do I send EOF? bsima: (display "EOF" port) doesn't work justin_smith: isn't that a question of closing the output port? RhodiumToad: you have to close the writing direction of the pipe, yes - haven't looked at how you would do this in guile bsima: hm, should I use 2 ports? one for writing, one for reading? justin_smith: there's a separate "close-output-port" that looks like it should work https://www.cs.rit.edu/~afb/20013/plc/guile/guile_30.html#SEC306 justin_smith: sorry for the rando manual link bsima: oh rit, my alma mater :) bsima: seems like that just closes the port though, i think i need two ports justin_smith: my assumption was that "close-output-port" would close the out aspect, leaving in open for reading, maybe that was optimistic bsima: yeah, unfortunately it just closes the entire thing bsima: i think i want something like this https://docs.racket-lang.org/reference/subprocess.html#%28def._%28%28quote._~23~25kernel%29._subprocess%29%29 bsima: maybe i could just port that to guile RhodiumToad: looking at popen.scm, the bidirectional pipe implementation is just not usable bsima: oh? RhodiumToad: probably another case of "lisp disease" RhodiumToad: precisely because it does not implement one-way closing bsima: there's an interesting patch from last month on the guile-devel mailing list that implements 'pipeline' and 'piped-process' procedures RhodiumToad: it even hides the read and write ports inside a closure so there's no way to get at them RhodiumToad: being able to close the write direction of a bidirectional port while still being able to read the read direction is a fundamentally necessary feature RhodiumToad: it's why sockets have shutdown() bsima: i agree bsima: https://lists.gnu.org/archive/html/guile-devel/2020-03/msg00004.html bsima: i think that would solve my problem bsima: until it's merged i'll just write to/from tmpfiles bsima: (receive (from to pid) bsima: ((@@ (ice-9 popen) open-process ) OPEN_BOTH "pandoc") bsima: (display "*bold*" to) (close to) bsima: (display (read-string from)) (newline)) bsima:

bold

bsima: oh hey, i guess that works RhodiumToad: sneaky bsima: after studying the code in the patch this is what i came up with. I guess the special @@ syntax is necessary for getting that open-process function RhodiumToad: yes, it's not exported justin_smith: like all monkey patching, it's too bad you have to but very nice that you can bsima: oh i see open-process defined in C and completely undocumented ATuin: when using geiser and emacs evaluating a guile expression (inside a module file) it's not defining it in the REPL buffer, is that normal? ATuin: it works if I do it in a buffer that it's not a module bsima: ATuin: depends on what module the REPL is in i think bsima: scheme@(guile-user)> ,m bsima: (guile-user) ATuin: aha ATuin: let me try to change it ATuin: bsima: yes, it worked thanks ATuin: C-c C-z did the trick ATuin: does srfi-9 provide a way of getting a default value when using a getter for a field? or do i need to use goop for that kind of feature? manumanumanu: ATuin: I would hide the constructor and roll my own (make-[record] ...) that adds default values manumanumanu: hide the constructor as in call it %make-blahblah and (define (make-blahblah ...)) that solves the default argument stuff manumanumanu: make that (define* (make-blahblah ... ) ...) ATuin: ah sounds good manumanumanu: and if it is in a module, just don't export the %make-blahblah ATuin: yeah it is i will do that. ATuin: I create a record inside a module and that's defined in another module. When i recompile the module defining the record the predicte (my-record? r) returns #f :D ATuin: *predicate ATuin: I guess it's because it's a different struct at that point internally jackhill: Hi, I'm there is something that I don't inderstand about sxml-match: https://paste.debian.net/1146972/ jackhill: I would have thought that second two examples would work based on the manual "matching of SXML attributes (within an element) is under-ordered…" and "…the element being matched may include additional attributes not specified in the pattern" jackhill: Is it that I don't know XML well enough and those only the (@ (…)) are attibutes? RhodiumToad: (example (bar "bar") (foo "foo")) means barfoo jackhill: ok RhodiumToad: and obviously putting the (foo) and (bar) elements in the other order changes the meaning RhodiumToad: if you meant where the order doesn't matter, that would be (example (@ (bar "bar") (foo "foo"))) jackhill: okay, yeah, I think I just don't understant the semantics of XML :) jackhill: the xml I'm dealing with really is the former. Unfortunately, not every element has all the same subelements (although, they are at least in the right order). I only care about pulling some of them out, but it looks like I'll have to be use something more clever than sxml-match. jackhill: Thanks! rekado: jackhill: sxpath? jackhill: rekado: probably, once I learn it :) RhodiumToad: pretty sure sxml-match can do what you need. but you may have to use catamorphisms RhodiumToad: an might contain, say, a and a that you want to extract, and possibly an optional in between? something like that? rekado: jackhill: something to get you started: https://paste.debian.net/1146976/ andswitch: thanks, I'm really enjoying Guile atm wingo: o/ wingo: civodul: did compile times improve for guix, also? civodul: hey wingo civodul: wingo: until now we'd compile everything with -O3, except packages with -O1 civodul: so the rest is unaffected i think civodul: BTW, for packages, i was thinking it should be #:cps? #f #:peval? #t civodul: because without peval the "macro writer's bill of rights" is not honored wingo: yeah tricky, you also want #:resolve-primitives? #t in that case wingo: civodul: i guess my real question is, what change does the baseline compiler have on time to compile packages civodul: wingo: for all of gnu/packages/*.scm? wingo: civodul: yea wingo: h wingo: i think so anyway civodul: wingo: from 6m43s to 1m56s (-O0 + peval in both cases) wingo: neat civodul: the thing is that the load phase remains present, and it's sequential and all wingo: so that time includes load time? civodul: from 1,101M to 445M maxresident civodul: that includes the load time, yes wingo: well, that's something then civodul: yes, the compiler itself is more than 3x faster wingo: so it gives you some breathing room, you can double the package count now ;) civodul: and hopefully by then CPUs will be twice as fast...? :-) wingo: haha wingo: i wonder what the load time distribution is for any given module wingo: it could be that with parallel compilation, it could be reasonable to just make -jN on the individual modules *: wingo dunno wingo: maybe there are reproducibility concerns (gensym numbers etc) that prevent you from doing that civodul: one process per module? wingo: yeah civodul: yeah i wonder civodul: the load bit is annoying, it doesn't feel right wingo: yeah. in web browsers they do the unified build thing, for this reason: partition M C++ files into N "unified" files, to amortize cost of loading headers wingo: works well but can occasionally cause errors of file A includes B and C uses B but forgets to include it, sometimes there can be no error civodul: i was about to say "but C++ headers are not full source code", but i guess that's not quite true these days civodul: i see wingo: i think for that reason upstream chromium switched back away from unified builds, since they have enough parallelism on their build farm anyway wingo: yeah C++ headers are loads of code... wingo: civodul: you could probably run some experiments to see what the result would be doing one process per module: compute a table of load times for each module with no other modules compiled, add a minimal time for the compile itself, divide by cores wingo: would be a worst-case; later compiles could use results from earlier ones wingo: assuming that no individual load would be longer than the average tho wingo: perhaps that's not a good assumption wingo: *than the sum of load+compile times divided by core count civodul: hmm yes civodul: with R6-style phases we could determine when to load at all wingo: aaaaaah i had an idea wingo: compute load times wingo: for each module, no compiled files wingo: sort from quick to slow; store that file in source code. update it occasionally wingo: compile the files in order from slow to fast. approximates topological sort! wingo: that way you get the maximum benefit of using previously compiled modules wingo: er wingo: sorry, i meant compile them in order from fast to slow civodul: problem is, every time we build N modules, we first load those N modules, then compile them civodul: so load ordering shouldn't matter wingo: i am saying, load and compile them one by one in sorted order wingo: possibly with parallelism civodul: ah yes civodul: ok wingo: you can also do it compiling N by N in sorted order wingo: with or without parallelism wingo: assuming there will be some common load time among the packages that can amortize the cost, similar to what you do now, but without being O(n) in module count civodul: yes, "guix pull" does N by N, but for packages, the value of N is high civodul: the gnu/packages/*.scm set is split into two parts wingo: an automatic sorting by load time would be i guess the change wingo: to approximate a module graph sort civodul: yeah, could be chrislck: {appropriate-time} Greetings, sniped dsmith-work! dsmith-work: Thursday Greetings, Guilers rgherdt: hi nikita`: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/guile22/patches/patch-modules_system_base_target.scm?rev=1.1&content-type=text/x-cvsweb-markup this is crude, but it makes the vendor field truly optional. I think this could be solved differently. Should I email the dev list? I want to contribute this fix of what is an wrong implementation in guile and hinders portability. heisenberg-25: how do I check if a path is a directory or not in guile? RhodiumToad: see (stat) heisenberg-25: Thanks RhodiumToad: though I don't know whether that works on windows ATuin: hi, how can i run the unit tests in a file using srfi-64 manumanumanu: run the file "guile tests.scm" ATuin: manumanumanu: i made it a module, do i need a main function? ATuin: or is better not have it as a module manumanumanu: I usually just have it as a regular file ATuin: ok, thanks. ATuin: one more question, how do you test normally functions that are not exported? ATuin: or you just test the public interface ATuin: since my tests uses my module i can not reach the internal functions i have there, so far the only solution i have found is to make those public or just test them indirecty via the the public interface rekado: I use @@ to access procedures that are not exported ATuin: ah so it's possible, nice rekado: it’s probably better to just test exported procedures, but I like it this way ATuin: being honest I like that way as well so if @@ does the trick I will use it manumanumanu: ATuin: ((@@ (module) procedure) arg args ...) ATuin: nice, thanks. that's enough I guess ATuin: now i need to see if can keep my unittests in a module manumanumanu: A more general question: does anybody really like srfi-64? manumanumanu: are there any options? Could we have a neat way to have tests inline? ATuin: first time I use it, seems to do it's job but bit annoying ATuin: *its ATuin: iniline testing would be nice indeed rekado: manumanumanu: I’m okay with SRFI-64 rekado: I’m not a fan of inline tests manumanumanu: ATuin: if you don't like the (@@ ...) stuff, you could have your library code in their own .scm file and include it into a test file and a module file ATuin: I have now that setup mod.scm and test-mod.scm ATuin: in test-mode.scm I do (use-modules (path to my mod)) ATuin: but of course I can only access the public definitions ATuin: which makes sense ATuin: anyway I'm still learning and getting used to guile manumanumanu: rekado: I think I mostly dislike srfi-64 because I never learned to write my own test runners, and that when I found the variable you could set! to not make it write files, I was on guile3 which had declarative modules (and had a regression for srfi-64 where set!ting that variable would do anything). rekado: the first testing framework I used in Guile was ggspec ATuin: rekado: I looked at it but I was not sure if what it provices is worth enough to have an extra dependency, SRFI-64 seems do its job and it's included by guile already str1ngs: | tohoyn: sneek, hello mwette: sneek: botsnack sneek: :) catonano: sneek later tell andswitch you're right, I missed the bit about the single page you wanted. Sorry sneek: Okay. tohoyn: sneek: botsnack sneek: :) tohoyn: log service seems to be down rekado: tohoyn: thanks for the notice. It got stuck somehow. wingo: sneek: later tell dsmith turns on i made a mistake that resulted in all optimizations being on, also for bootstrap :P things a little better now. sneek: Will do. *: janneke hopes for a slight understatement there wingo: depends on the file in question wingo: is quite significant for bootstrap tho janneke: that is great; i'm bootstrapping more than i would sometimes like, these days :) wingo: janneke: you might like the bootstrap compiler, just for reading; it is 1400 lines and relatively straightforward wingo: maybe mes has some tricks it could use or vice versa janneke: wingo: yes, that's a nice idea! what's the entry point? wingo: janneke: https://git.savannah.gnu.org/cgit/guile.git/tree/module/language/tree-il/compile-bytecode.scm ; it's bottom-up manumanumanu: wingo: did I dream that it was about 10x faster? wingo: so the entry point is at the bottom wingo: manumanumanu: o/~ caught in a landslide, no escape from reality o/~ janneke: yes wingo: but yeah it is lots faster manumanumanu: open your eyes! manumanumanu: Or however it continues manumanumanu: im just a poor boy? manumanumanu: nice! wingo: :) manumanumanu: I am going to have a go at the equal?/eqv? optimization today. We got some arctic cold these days, so all my fruit blossoms froze. No cherries. No apples. I am rage-quitting gardening for a while wingo: haha condolences wingo: will it help to say i see my neighbor's tree laden with reddening cherries from my window? i guess not ;) manumanumanu: rub it in manumanumanu: gardening in sweden is a lost cause. All I get is cabbage and carrots manumanumanu: on the other hand, we got about 100kg carrots last year, and had kale through the winter wingo: nice wingo: i moved 18 months ago and haven't set up a proper veg bed yet manumanumanu: i'd suggest building your own raised ones instead of buying those flimsy ones manumanumanu: the ones we bought when we moved in 3 years ago are all rotten by now, but the ones I built look like new rekado: manumanumanu: we barely scraped by freezing; my trees don’t look happy at all. And my watermelons died. manumanumanu: To make the gardening a bit more on-topic: guile is powering my self-watering flower pot :D wingo: manumanumanu: what!! wingo: do tell wingo: at one point a few years ago i wanted to compile part of guile to a microcontroller to open and close the door of my chicken coop wingo: of course i never got around to doing it ;) manumanumanu: yeah. I have some python scripts to read from GPIO manumanumanu: neatly abstracted away wingo: janneke: a -j1 make in bootstrap/ now takes 11 minutes for me manumanumanu: so about 80% guile 20% python to measure impedance between two nails and start a pump if the it is too high (dry soil) wingo: i suspect the best you could do with -j40 would be 5 or 6 minutes, because of having to build eval.go and psyntax-pp.go first wingo: manumanumanu: neat! manumanumanu: I only managed to empty the water onto the floor once or twice :D janneke: wingo: eh, is that a full bootstrap; that used to take 2.5h? *: janneke looks puzzled wingo: janneke: full bootstrap wingo: well wingo: i mean to say wingo: you have built libguile/. you have no .go files, no prebuilt/ wingo: that was "time make -C bootstrap/ -j1" janneke: whoa -- that's amazing manumanumanu: i second that. janneke: can that be backported to 2.2.8? janneke: (not to bring back the dead, but...) wingo: :) wingo: not sure. it would need VM work as well as compiler work wingo: i.e. possibly-missing instructions wingo: best to let 2.2 lie sleeping IMO :) janneke: wingo: ah, i only really meant "...a mistake that resulted in all optimizations being on," wingo: ah that. no that was a recent mistake introduced when shoehorning the baseline compiler into the graph janneke: i'm not advocating any significant work janneke: OK, just checking wingo: the speed improvement is because of the baseline compiler + trimming the bootstrap module graph janneke: nice! janneke: bootstrap dependency reduction; *love it* wingo: :) wingo: make -j4 just got me down to 9m42s in bootstrap/; there are some "long poles" that won't fold up into the bag, it seems manumanumanu: wingo: when I'm at it looking at some primitiv expanders, are there any others you have thought about but not really bothered about? wingo: manumanumanu: which primitive expanders are you looking at? i am pretty good at forgetting about things i decided to not bother about so i can't answer the question :) *: wingo casts short memory into a virtue :P manumanumanu: now I am looking at turning equal? into more efficient forms for (const ...)s where it makes sense manumanumanu: chars manumanumanu: ratnums (i believe) manumanumanu: floats? No idea about that wingo: incidentally peval can be a really good place to do that sort of thing manumanumanu: I just thought language/tree-il/primitives.scm is the place to do it since that is where equal/eqv -> eq? is doen wingo: yeah could be wingo: make -j4 -C module/ after a bootstrap runs in 3m36s on this now-aging laptop wingo: so, good. wingo: finally, a make -C bootstrap/ -j4, with prebuilt/ built, runs in 12s. manumanumanu: If I understand correctly, all numbers are eqv? all other numbers in guile, even complex and inexact numbers. wingo: correct manumanumanu: great. wingo: i mean of course (eqv? 1 2) is false wingo: but you mean that (eqv? N M) == (equal? N M) wingo: i guess wingo: if N or M is a number manumanumanu: haha manumanumanu: yes, that is how I meant RhodiumToad: two numbers can be = but not eqv?, though, if one is exact and the other not RhodiumToad: or if one is real and the other complex manumanumanu: oh yes, but now I am turning equal? -> eqv? which has a similar number comparison semantics iirc RhodiumToad: hm, that has some dubious edge cases manumanumanu: It is not as if I am not going to test it :D manumanumanu: (equal? 0.1 1/10) = #f which is true for eqv. (equal? 0 0/10) -> #t which is also true for eqv? RhodiumToad: if at least one of the operands of equal? is a number, then the result is equivalent to the result of eqv? on those same operands RhodiumToad: (eqv? 0.1 1/10) is false for me. manumanumanu: i meant that :D manumanumanu: it is true, but not #t :D manumanumanu: (eq? (equal? 0.1 1/10)) (eqv? 0.1 1/10)) -> #t :D manumanumanu: (eq? (equal? 0 0/10)) (eqv? 0 0/10)) -> #t RhodiumToad: whereas (= 0.1 1/10) -> #t manumanumanu: yup, but I am not touching = RhodiumToad: the edge case I found is that an exact complex number whose imaginary part is exactly 0 is actually an exact real number RhodiumToad: so (eqv? 1 1+0i) is true RhodiumToad: whereas (eqv? 1.0 1.0+0.0i) is not manumanumanu: that's the case for equal? as well RhodiumToad: yes RhodiumToad: as I said, if at least one operand of equal? is any kind of number, then the result is the same as using eqv? wingo: 1+0i is not the same as 1+0.1i wingo: er wingo: 1+0i is not the same as 1+0.0i RhodiumToad: right, because the latter is inexact manumanumanu: now, is there a way to run guile from the source folder where i just completed a 'make'? wingo: manumanumanu: meta/guile wingo: incidentally if you just finished a make, i suggest git pull and make again wingo: it won't take very long manumanumanu: haha, i botched it! :D wingo: that way you will have the new baseline compiler manumanumanu: (equal? #\a #\a) -> ERROR wingo: haha ;) wingo: easy to make mistakes :) RhodiumToad: looking at r5rs, it says that eqv? is true if the operands are both numbers, have matching exactness, and are = wingo: r5rs is out of date manumanumanu: it turns into very fast code though! (equal? #\a #\a) -> (#f) manumanumanu: the reason seems to be that I don't know scheme. I literally forgot a (cond ...) RhodiumToad: why would that be #f? manumanumanu: no, somewhere in the compile I ended up with ((and blah blah blah)) which tried to apply (#f) manumanumanu: it never even ran. That's how fast it was RhodiumToad: r7rs says that two inexact numbers are eqv? if and only if scheme's standard arithmetic procedures can't tell them apart. RhodiumToad: (it uses slightly more words but that's the sense) RhodiumToad: so what can tell 1.0 from 1.0+0.0i ? RhodiumToad: hm. RhodiumToad: perhaps 1.0 is treated as 1.0+0i such that the imaginary part is exactly 0? efraim: perhaps this is more of a Guix question, but if I've created a gexp how do I invoke it from a guile REPL? RhodiumToad: yup. RhodiumToad: so 1.0 and 1.0+0i are indeed eqv? wingo: (imag-part 1.0) => 0 wingo: (real? 1.0+0i) => #t wingo: 1.0+0i is just 1.0. wingo: efraim: i think there is some kind of guix repl extension wingo: perhaps a guix person knows more wingo: but you have to evaluate it within a store monad i think wingo: so thee repl extension lets you enter the monad efraim: thanks. I guess it's not a problem when it's already inside a script to do the store monad dance manumanumanu: wingo: you weren't kidding when you said it is easy to get wrong. I managed to actually get it wrong again and always simplifying equal? to eqv?. I forgot that primitive-expanders should return #f iif no expansion should be done. manumanumanu: now all tests pass :D wingo: :) lloda: sneek: bugs? sneek: Last time I checked bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile lloda: sneek: bug list? lloda: https://bugs.freedesktop.org is gone, so guile-cairo needs a new place for bugs lloda: I guess https://debbugs.gnu.org should work? but guile-cairo is 'nongnu' lloda: not sure how that works wingo: we could ask for a new debbugs component or so; i think civodul knows more about that lloda: sounds good manumanumanu: so, wingo: tests are changed, no fails. tests are added, all pass. However: I just extended the already existing procedure. That means we are only optimizing the less-than-three-arguments form. (equal? toplevel-x #\a) -> (eqv? #\a toplevel-x), but (equal toplevel-x toplevel-y #\a) -> (and (equal? toplevel-x toplevel-y) (eqv? #\a toplevel y)) manumanumanu: meh, i'll change it. it seems dumb not to. wingo: yeah that can usually be a straightforward recursive change manumanumanu: due to how the code was written, it ended up being a little bit more than that. I restructured it so that call to eqv? or equal? has it's arguments checked in order. If there are any eq-able or eqv-able literals that is the primitive used, otherwise don't do anything manumanumanu: The problem is I suspect the output from (make-conditional ...) is run through the primitive-expander once again, meaning we don't get o(n) manumanumanu: for things that turn into eqv? at least manumanumanu: no... for both eqv? and equal?. (equal? a b c d e) checks all args for simplifiable literals and turns it into (and (equal? a b) (equal? b c d e)) which in turn checks (b c d e) for simpflifiable literals, which in turn would be an eternal shame to submit as a patch RhodiumToad: hm, really you want to know what is the most simplifiable literal in the list before generating any clause manumanumanu: RhodiumToad: good idea. manumanumanu: the simplify call is only called once, so no non O(n). RhodiumToad: so if any arg is a symbol or keyword, you can reduce all the tests to eq?. otherwise, if any arg is a number or character, then they all reduce to eqv? weinholt: manumanumanu, weird that equal? works with any number of arguments, the manual says it takes exactly two arguments guix-vits: weinholt: (help equal?) -> "- Scheme Procedure: equal? [x [y . rest]]" guix-vits: maybe 2-nd is a list? manumanumanu: guix-vits: the manual says otherwise though. manumanumanu: wingo: there is a patch on the mailing list. It isn't pretty and needs a little discussion. Anyway, thanks for the help! *: guix-vits "same for eqv?: manual says x y, not [y . rest]. Confusing." dsmith-work: {appropriate time} Greetings, Guilers wingo: dsmith-work: hey! wingo: i fixed the speed thing i think wingo: want to give a try to a fresh build? wingo: a -j4 build from nothing should complete in around 20 minutes for the whole thing wingo: hey civodul :) dsmith-work: Is currently working on eval.go wingo: civodul: if you are able, give current guile another go on python-xyz.scm civodul: howdy! wingo: there was a bug that accidentally turned on all tree-il optimizations :P civodul: ah! :-) civodul: will do wingo: dsmith-work: is it done? :) dsmith-work: Not yet. :) dsmith-work: on fix-letrec wingo: still in bootstrap? weird dsmith-work: It's moving along. Does seem faster than yesterday dsmith-work: Done dsmith-work: git 31bb0e: real: 36m11.730s user: 87m33.215s dsmith-work: dsmith-work: git 3385f6: real: 60m12.574s user: 140m37.284s dsmith-work: yesteday ^^ dsmith-work: Close to twice as fast civodul: random thought of the day: what if we put Guile as the PT_INTERP of a .go file? wingo: civodul: would be interesting! lots of paths to get right tho wingo: in guix context you can do it, obvs wingo: dsmith-work: great! so around 2x as fast as 3.0.2 bootstrap without prebuilt files. wingo: iirc your number yesterday was 77m for 3.0.2 dsmith-work: yes wingo: nice wingo: thanks for testing, i might have missed this bug if you hadn't tested dsmith-work: Thats wallclock time. Was on 4 cores. dsmith-work: User time went from 189m to 87m dsmith-work: Which is more likes a single core time? wingo: dsmith-work: similar but a sequential build will usually have less user time than a parallel build, because later steps can take advantage of previous steps wingo: manumanumanu: you nerd-sniped me ;) see the list wingo: with regards to "match", and "case" for that matter, we really need to compile chained conditionals better :P mwette: Does that mean something like this? (('a 'b) ...) (('a 'c) ...) => (('a . ,rest) (match rest (('b) ...) (('c) ...) wingo: sorta wingo: that's part of it wingo: the other part is http://scheme2006.cs.uchicago.edu/07-clinger.pdf wingo: needs to be done at the CPS level though, so that the component parts of e.g. (match exp (($
) ..) ($ ) ..) ...) can work mwette: On occasion I'm guilty of hackage to avoid case forms. alextee[m]: i want to load a file and do some regex on every line and combine the results in a new string. i guess i'd do (with-input-from-file) and (fold), but is there a way to convert the file contents to a list of strings (one for each line)? RhodiumToad: read-line will read one line, why would you want to make a list? RhodiumToad: what I'd do is probably with-input-from-file and with-output-to-string alextee[m]: actually i think i dont.. i just want to do some regex and just (display) the result for each line, so read-line will work, thanks! alextee[m]: i'm doing with-output-to-file, and then inside that with-input-from-file RhodiumToad: ah, you don't actually need the string? alextee[m]: (reading a list of translators from a file and generating a C string to dump in a C header file) alextee[m]: no, i just need to (display) it civodul: wingo: python-xyz master -O0: 2m10s wall-clock civodul: python-xyz 3.0.2 -O0: 2m40s wall-clock civodul: time(1) says 693M (master) vs. 746M maxresident, FWIW civodul: hmm civodul: wait a minute, i was doing it wrong, not sure why civodul: it's down to 3.8s and 287272maxresident, much nicer :-) civodul: was i using the wrong optimizations-for-level before, go figure alextee[m]: https://paste.debian.net/1146592/ alextee[m]: is my use of (read-line) wrong? it seems to stay on the first line and that loop keeps displaying the first line forever. isn't it supposed to move the iterator on the current input port by default? alextee[m]: wait i think i'm just doing the do-loop wrong *: alextee[m] reads the docs again RhodiumToad: yeah alextee[m]: yeah i missed the [step] part, sorry for the noise :-) RhodiumToad: (do ((line (read-line) (read-line))) ... or something like that alextee[m]: thx! manumanumanu: wingo: regarding case, I have a case macro that does a binary search for more-than-n elements manumanumanu: btw, I'll read the patch and try to understand what it does. manumanumanu: It would be cool to actually be able to contribute manumanumanu: I had a macro that resulted in huge case macros, and shaved a lot of time from it by doing a binary search. I thought about doing it with a hash table, but I never got to that manumanumanu: Racket does o(logN) case dispatch, so I suspect they do a binary search as well manumanumanu: I had no idea that guile eq?'d chars! justin_smith: clojure compiles case into a hash table lookup also alextee[m]: is it possible to remove characters from an output port? alextee[m]: like, the last n characters? alextee[m]: not sure if that makes sense justin_smith: I'd suspect that for an arbitrary port this is impossible, but if it were possible to wrap a port in a buffer, you could do so before the buffer flush RhodiumToad: manumanumanu: does it eq all chars, or only some? justin_smith: I suspect in guile your wrapper couldn't directly be a port manumanumanu: RhodiumToad: andy's last patch seems to indicate all, but I am not sure I understand it alextee[m]: i see, thanks. i'll handle my problem in a different way then (make a list so i can tell if it's the last element or not and not print the extra chars) RhodiumToad: alextee[m]: if it's a random access port, such as a file port, you can seek backwards alextee[m]: oh? RhodiumToad: however, that would seek in bytes, not in characters alextee[m]: i think using a list in what im doing will be more elegant. i'll try and report back :-) RhodiumToad: manumanumanu: I'm guessing that characters are always immediate values, since all unicode codepoints easily fit in even a 32-bit word with enough space for type tags RhodiumToad: yup, reading the C code that does appear to be the case manumanumanu: guile also compares fixnums using eq?, which are larger RhodiumToad: ah, that depends on the size of the number RhodiumToad: numbers small enough to fit in a word with 2 spare bits for tag are immediate values, and will compare as eq RhodiumToad: numbers larger than that will not RhodiumToad: hm, that said, it's somehow still managing to compare them as equal RhodiumToad: aha RhodiumToad: (define a 2000000001) (define b (1+ 2000000000)) (eq? a b) => #f RhodiumToad: on a 32-bit system that is RhodiumToad: on 64-bit that would be #t still alextee[m]: i did it! \o/ https://paste.debian.net/1146602/ alextee[m]: result: https://paste.debian.net/1146603/ alextee[m]: now i dont have to copy the translators from the TRANSLATORS file in the about dialog manually anymore : P alextee[m]: i'll do this for the credits section in the manual too wingo: civodul: from 220s to 4s ??? wingo: a 50x improvement?? wingo: civodul: would be interesting to compare -O2 with -O2 -Ono-letrectify civodul: wingo: so i'm doing a full build of the 'guix' package civodul: its peaks at "only" 780M resident towards the end civodul: instead of almost 2G i think civodul: that too is pretty nice civodul: here's how i build 'guix' against master: https://paste.debian.net/1146620/ andswitch: Does a nested define create a closure like a lambda does? sneek: andswitch, you have 1 message! sneek: andswitch, catonano says: you're right, I missed the bit about the single page you wanted. Sorry civodul: andswitch: the compiler inlines it when appropriate civodul: so it depends on the situation justin_smith: I'd expect it to turn into the same thing a let* binding would gagbo: sneek: seen davet ? sneek: daviid was in #guile 4 days ago, saying: unknown_lamer: guile.m4 has been patched a couple of times since, I would grab the latest and use it to replace the one you keep in yur project. gagbo: sneek: later tell davet hi, I was wondering how you'd like to see contributions to guile-sdl2 ? I'd like to access the font-metrics functions from SDL_ttf and I don't know how hard it would be for a guile beginner to make, and I don't know how to submit a patch if I ever manage to do it myself sneek: Okay. gagbo: oh, didn't work at all as expected gagbo: I guess I'll have to lurk the old way unknown_lamer: dsmith-work: does sneek have a tell function? gagbo: it does, I've seen it work, I just didn't read that my query for davet wasn't met with davet, but daviid ; so I'm not sure that my request will ever land gagbo: I guess I'll have to send emails, but I don't know how to build properly guile-sdl2 from source now, so that won't help me patch it to get what I'd need. Looks like I'll have to sink a lot more time than I imagined lfam: gagbo: Are you looking for the maintainer of guile-sdl2? gagbo: I was gagbo: I still am, I guess lfam: I don't know how much time they have for this right now, but that person is davexunit lfam: We have a package for guile-sdl2 in Guix. It seems to build, so you could take a look at that to get started, or even just do your work in Guix gagbo: Oh yeah, I'm actually using the packaged version lfam: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/sdl.scm#n620 gagbo: That's why I know how I can use it, but not really how I can patch it and test my features lfam: Oh, alright lfam: If you want, I can help you get started over in #guix gagbo: I can try quickly dsmith: unknown_lamer: I think I've diabled "tell" because it doesn't do what most people expect. "later tell" is the usual thing to use. dsmith: unknown_lamer: "tell" just causes the bot to send the message immediately. If the nick is in the channel or not. Or away or not. unknown_lamer: useful heh dsmith: The only real use I can think of, is if the target nick is /ignore'ing the sender. dsmith: "later tell" waits for the nick to message the channel before sending the messages. dsmith: Might be nice to change that for joins instead. lfam: I tend to join and leave randomly when my laptop sleeps and wakes dsmith: unknown_lamer: For that, the bot would need to keep track of who is in the channel, nick changes, etc. dsmith: Not currently doing that. lfam: I like that sneek messages when I speak, becauase it's a sign that I'm ready to participate unknown_lamer: makes sense dsmith: Yep lfam: sneek: botsnack sneek: :) lfam: Good bot *: sneek wags lfam: !!! lfam: Such a good bot unknown_lamer: need to add a hook that runs after the bot joins a channel *and* the userlist is initialized unknown_lamer: or I wonder if there's any reason not to move hooks/join to after that unknown_lamer: not sure what use there is in running a hook right when you join before any info on the channel is available dsmith: I can hook on joins. And leaves. And nick changes. unknown_lamer: right, but when you join the channel you need to query the roster to get the initial state? dsmith: IF I hook on raw maessages, I can use the 532 code to populate the nick list. dsmith: The server sends those. dsmith: Not sure if it's because of a query by bobot code, or if it just does that automatically. unknown_lamer: bot does a WHO after joining dsmith: ok unknown_lamer: but I think hooking on raw messages is ... hacky unknown_lamer: I try to think of reasons against moving the hook to after userlist initialization, but right now i think moving it is the right thing dsmith: YEah, I don't really like it. Especially since the bobot code is already handling that. dsmith: What might be better, is if the scheme code could just query the C++ userlet. Instead of bulk loading the whole thing. dsmith: gagbo: Yeah, original sarahbot code uses a "metaphone" encoding for nicks. I think it's so variations in spelling don't matter. dsmith: https://en.wikipedia.org/wiki/Metaphone dsmith: ---- tohoyn: sneek, seen daviid sneek: Welcome back tohoyn, you have 1 message! sneek: tohoyn, str1ngs says: It does not work with guile 3.0 as far as I've tested. sneek: daviid was in #guile 4 days ago, saying: unknown_lamer: guile.m4 has been patched a couple of times since, I would grab the latest and use it to replace the one you keep in yur project. civodul: "invalidate-compilation-cache is deprecated; recompile your modules" civodul: oh i see wingo: civodul: yay wingo: i finally managed to trim cps out of the bootstrap module graph wingo: in git from a couple hours ago wingo: so bootstrap should be feasible now :P maybe 20 minutes -j1 civodul: wingo: yay, awesome! civodul: in other news, reepca found that the revealed count of file ports wasn't initialized, oops! civodul: i'm writing tests for that wingo: ! wingo: that's exciting :P dsmith: Ooo dsmith: I wonder if that was causing the "random" startup crashes I was seeing on arm. dsmith: And it would go away if I used a pipe for stdin. wingo: ! dsmith: OR maybe it was stdout? Was just repeatedly starting guile in a loop, seeing if it segfaults. dsmith: Redirecting to /dev/null to make things quieter stopped the crashes. dsmith-work: Tuesday Greetings, Guilers wingo: guix is building guile 3.0.2 and i am already irritated that it is taking so long :P wingo: not 100% fixed in 3.0.3 but at least the "long pole" of compiling psyntax is only 3m instead of 12 or whatever it is now civodul: heheh :-) civodul: wingo: it's building it from source, why is that? wingo: what do you mean, why is building psyntax faster in master? wingo: or why is guix building from source wingo: i guess because there was some update to mes or something wingo: it rebuilt everything. i passed --substitute-urls=https://ci.guix.gnu.org/ but no dice wingo: civodul: ^ rekado: does /etc/guix/acl exist? civodul: yeah maybe the server is not authorized: https://guix.gnu.org/manual/en/html_node/Substitute-Server-Authorization.html civodul: you should definitely get binaries for Guile wingo: hum chrislck: wish to ask devs here... "too many heap sections" means, I believe, a gc issue. Is there a magic flag we can set to increase the heap limit? wingo: chrislck: i have never run into that, myself; perhaps look at libgc documentation wingo: weird, it still wants to build guile from source; no idea why civodul: you could "rm -rf /var/guix/substitute/cache" for good measure, though it shouldn't make any difference wingo: yeah no difference wingo: i haven't rebuilt in a while, surely not since 3.0.2 wingo: so maybe it's just missing that substitute? dunno. weird chrislck: wingo: thx for pointer. will do. some gnc reports are crashing on 32-bit windows. wingo: that could indicate a memory leak fwiw rekado: I see a whole bunch of guile-3.0.2*.nar* files in both the gzip and lzip caches on ci.guix.gnu.org wingo: ok wingo: i admit, on this ubuntu machine i don't understand everything. but it seems to want to build from source today. standard "guix pull" wingo: acl in place, no warnings rekado: strange! civodul: wingo: what does "guix build guile --no-grafts -d" return? civodul: for me it's /gnu/store/bl4pvflvbw0lyk0y05f2md94kgyrc6an-guile-3.0.2.drv (x86_64) wingo: /gnu/store/cgk36zvqbd9199yhi0ywfy2lmm20zxdz-guile-2.2.7.drv wingo: but this is in a guix pull wingo: so i don't know if the "new" profile is in place yet civodul: so that's prior to the recent "core-updates" merge civodul: ah you mean "guix pull" is building this one? wingo: no wingo: the drv above is what "guix build guile ..." prints civodul: ok, and what does "guix describe" return? wingo: but guix pull is building guile 3.0.2, before showing me what it's going to do civodul: hmm, ok wingo: Generation 15 May 05 2020 11:49:10 (current) wingo: guix 0e68092 wingo: repository URL: https://git.savannah.gnu.org/git/guix.git wingo: branch: master wingo: commit: 0e680920b9e54d7c8a901b1c9cf02ce4468f44ed wingo: probably i am an idiot somehow but it's partly because i am an idiot that i switched over to the "guix pull" workflow, rather than running from my dev dirs :P civodul: well maybe there's an actual problem too, that's more likely than you being an idiot :-) *: civodul tries guix time-machine --commit=0e680920b9e54d7c8a901b1c9cf02ce4468f44ed -- time-machine -- describe civodul: first time i tried such a command, i find it interesting civodul: it worked, but that doesn't tell much janneke: i have found it to be extremely useful civodul: perhaps i happen to have the stuff in store civodul: hey janneke civodul: the double time-machine? janneke: ah no, i missed that janneke: the single one :-) civodul: ah, see? :-) civodul: "guix time-machine --commit=0e680920b9e54d7c8a901b1c9cf02ce4468f44ed -- weather guile-next@3" says 100% wingo: guile-next is fine i think wingo: well wingo: build-started /gnu/store/x32cnfkd50fnxs10xp1jdn24h7ai2gxr-guile-3.0.2.drv - x86_64-linux /var/log/guix/drvs/x3//2cnfkd50fnxs10xp1jdn24h7ai2gxr-guile-3.0.2.drv.bz2 1726316 wingo: that is what it is building wingo: for some reason it is showing the build log, interleaved with @ build-log wingo: just a normal "guix pull" civodul: ah got it, it's: guix build -e '(@@ (gnu packages commencement) guile-final)' -d wingo: wingo@milano:~$ guix build -e '(@@ (gnu packages commencement) guile-final)' -d wingo: /gnu/store/y88s25rjwdic7x2ijfqn2mjszias0kvs-guile-2.2.6.drv civodul: yes, but the guile-3.0.2.drv above is the new "guile-final" wingo: ah wingo: ok :) civodul: substitute here: https://ci.guix.gnu.org/0m0vd873jp61lcm4xa3ljdgx381qa782.narinfo wingo: it built gcc and mes and everything to get there, fwiw civodul: that means you really got zero substitutes, right? civodul: then perhaps the key in /etc/guix/acl is the wrong one? wingo: i guess? it did make a number of lines like "getting substitutes from https://ci.guix.gnu.org/ 100%" wingo: and no warning about bad acl things civodul: yes, but the authorization check happens after civodul: it's not "bad", it's just unauthorized civodul: see https://git.savannah.gnu.org/cgit/guix.git/tree/etc/substitutes/berlin.guixsd.org.pub wingo: that's the one in /etc/guix/acl wingo: the guix daemon that is running is the one from /var/guix/profiles/per-user/wingo/current-guix/bin/guix-daemon, fwiw civodul: ok, and do you have /var/guix/substitute/cache/4refhwxbjmeua2kwg2nmzhv4dg4d3dorpjefq7kiciw2pfhaf26a/0m0vd873jp61lcm4xa3ljdgx381qa782 ? civodul: wingo: in other news, a .go file compiled with master -O0 makes 3.0.2 segfault wingo: civodul: nope wingo: i don't have that substitute wingo: civodul: yes i don't doubt it, a .go file from master uses new instructions from master civodul: right, but i thought there was this version cookie civodul: but maybe it's not incremented yet? wingo: ah, yes indeed. not yet incremented civodul: ok wingo: i was trying to build guile on this machine but guix got in the way ;) civodul: yeah it's terrible, i don't understand what's going on wingo: so why wouldn't i have the substitute? wingo: there were like 50 lines of "getting substitutes" and they all went 100% immediately wingo: my network is really slow btw wingo: so that's somewhat unusual civodul: what does "sudo grep -r 0m0vd873jp61lcm4xa3ljdgx381qa782 /var/guix/substitute/cache/" return? wingo: could the substitutes server be returning truncated output or something? wingo: civodul: nothing civodul: nothing is very little civodul: it's as if substitutes were turned off wingo: yes it seems that way. maybe it is a permissions issue somehow civodul: yeah is /var/guix/substitute writable by the daemon? is it empty? wingo: so wingo: having removed the cache wingo: there is only one dir now wingo: /var/guix/substitute/cache/x2wcz6gz3evwlqcrz3fqstmezkfcfnpfb5kfyxbz7kjikc7upkiq wingo: which has a bunch of 99-byte files wingo: whose contents are all (narinfo (version 2) (cache-uri "https://ci.guix.gnu.org/") (date 1589292026) (ttl 600) (value #f)) wingo: i.e. i removed the cache then did a git pull. wingo: *guix pull civodul: (value #f) means the substitute was not found civodul: ttl 600 means it'll try again in 5mn civodul: is https://ci.guix.gnu.org/0m0vd873jp61lcm4xa3ljdgx381qa782.narinfo accessible from that machine? wingo: yes, it does return information wingo: at least via wget dsmith-work: git master: real: 60m12.574s user: 140m37.284s dsmith-work: git v3.0.2: real: 77m18.208s user: 189m15.317s dsmith-work: tar v3.0.1: real: 9m52.616s user: 31m53.711s dsmith-work: Uh, s/3.0.1/3.0.2/ civodul: for python-xyz.scm it seems to go from 30s at -O1 to 39s at -O0, weird wingo: civodul: that sounds like you are not running the right guile wingo: or, there's some O(n^2) pathology somewhere; but i suspect not running the right guile wingo: dsmith-work: what master? civodul: wingo: i'll investigate and report back later wingo: an unsatisfying day for both of us then :P dsmith-work: v3.0.2-76-g3385f6e08 dsmith-work: "Update NEWS for baseline compiler" wingo: interesting wingo: is this on your ARM machine or an x86_64 machine, dsmith-work ? wingo: and "tar" you mean with prebuilt/ i guess dsmith-work: x86_64. 4 cores. make -j5 (but is in a vm under w10) dsmith-work: Yes, tar is from a tarball build dsmith-work: Using the prebuild .go files dsmith-work: So. Better. But not quite as awsome as hoped. wingo: well, it's tricky. the baseline compiler produces slower code so even the cps compiler as compiled by baseline will be slower, until it is recompiled by cps dsmith-work: YEah, I was wondering about that. wingo: i am not sure what is the fastest way to do things wingo: even the evaluator compiled by baseline will be slower wingo: until recompiled dsmith-work: Commit the prebuilt .go files to git... ;^} wingo: haha ;0 dsmith-work: That's basically what ikarus did. dsmith-work: But was intel only. wingo: i think the baseline compiler will be significantly better for guix tho wingo: since it doesn't need to bootstrap wingo: i see 5x-15x speedups lloda: >how do I force guile-snarf-docs to be created from guile-snarf-docs.in lloda: ah there it is nvm daviid: lloda: tha's done at configure time I guess sneek: daviid, you have 1 message! sneek: daviid, gagbo says: hi, I was wondering how you'd like to see contributions to guile-sdl2 ? I'd like to access the font-metrics functions from SDL_ttf and I don't know how hard it would be for a guile beginner to make, and I don't know how to submit a patch if I ever manage to do it myself lloda: yah thx daviid i've managed to make generate-docs daviid: gagbo: the author of guile-sdl2 is davexunit lloda: cyclopsian's hint did it daviid: :) dsmith-work: daviid: The bot picked the wrong nick. :( daviid: tohoyn: g-golf 'as is' won't work with guile 3.x, because it extensively 'expand/extend' some of its modules dynamiclly, which is the very essence of introspection ... and guile 3.0 has default compilation settings that expect modules to be immutable, also, 3.0 changed the 'meaning/applicability' of @ and or @@ ... - I won't work on this until I find it's more-less complete (no specific date, dont ask ...) - so plese use 2.2.x for the daviid: time being ... I also have to prepare guile-cv for that same maters ... daviid: dsmith-work: ok, just wanted to let gagbo know ... tohoyn: daviid: so we won't get g-golf for guile 3.0 at all? daviid: tohoyn: that's not wht I said, is it? tohoyn: daviid: I understood it wrong tohoyn: daviid: is guile 3.0 missing some features needed for g-golf? daviid: tohoyn: please re-read the above daviid: carefully tohoyn: daviid: so do you need @ and @@ to be more complete? daviid: tohoyn: I need to prpare g-golf so it works ith gule 3.x, that requires some work that i'm not going to do now, but after it is complete and after i port guile-cv to 3.x as well ... gagbo: daviid: oh yeah no worries, I should have added that I was told later about the correct nick. I just sent a patch so he'll deal with that when he can (I forgot it was still easy to use gmail to git send-email) andswitch: how do I pass a keyword argument? dsmith-work: andswitch: https://www.gnu.org/software/guile/manual/html_node/lambda_002a-and-define_002a.html dsmith-work: andswitch: "can be called as (sir-yes-sir #:action 'jump), (sir-yes-sir #:how-high 13), (sir-yes-sir #:action 'lay-down #:how-high 0), or just (sir-yes-sir)" andswitch: ah ok :) andswitch: I saw that page but missed it because i was looking at the code-blocks I guess andswitch: th andswitch: thx dsmith-work: np dustyweb: hi! catonano: dustyweb: hi ! dustyweb: heya catonano, how are you catonano: dustyweb: I could e better but I could be worse ! 😁️ dustyweb: :) wingo: hum the baseline compiler is still taking forever on assembler.scm wingo: i wonder why that is andswitch: is the one-page HTML reference manual for guile 2.2 still available somewhere? I can only find a link for the 3.0 version on the homepage catonano: andswitch: you can find links for previous versions at this page: https://www.gnu.org/software/guile/learn/ andswitch: catonano: yes I saw it but I can't find the link to the single-page html version of the reference manual. Only the multi-page one is there malaclyps: arpunk, I ended up using the upstream version -- my "fix" is to submit patches to bring guix up to date arpunk: malaclyps: Thanks for the heads up bsima: is there an example somewhere of using guile for emacs scripting? I have some guile code I would like to call from emacs, but not sure how to go about it bsima: maybe I should just ask this on the mailing list. seems complicated dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen unknown_lamer ? sneek: unknown_lamer was last seen in #guile 6 hours ago, saying: sneek: botsnack. dsmith-work: gootbot dsmith-work: version dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs dsmith-work: sneek: version dsmith-work: sneek: version dsmith-work: sneek: version dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: version dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: version dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ (something from git) dsmith-work: unknown_lamer: Both bot:getversion and bot:getreleaserevision seem to be undefined for me. unknown_lamer: https://git.hcoop.net/clinton/bobotpp.git/commitdiff/17f13c7ac1b386279a5da43c0fef7c2dbc11ce8a should be defined as of this rev dsmith-work: release-2.3.1-4-g031d65a dsmith-work: Which is "Call configure from bootstrap" unknown_lamer: hrm unknown_lamer: they work in my test bot dsmith-work: Had some errors installing, maybe it's still old code I'm running. unknown_lamer: ]eval (bot:getreleaserevision) unknown_lamer: "2.3.1.4-031d" unknown_lamer: same revision (different build-aux/git-whatever probably due to me having newer gnulib) dsmith-work: The first install error is that "/bin/bash: /usr/local/share/info: Is a directory" dsmith-work: Which it is. THe guile info pages are instelled in there. dsmith-work: Then (after make -k install) /bin/bash: /usr/local/share/guile/site/3.0/bobotpp: Is a directory dsmith-work: Doens't seem right. dsmith-work: It's *supposed* to be a dir. RIght? unknown_lamer: yes unknown_lamer: dsmith-work: I moved some stuff to build-aux, might try from a fresh snapshot? unknown_lamer: I had to clear out a bunch of gunk by hand when rebuilding (just had to shuffle things around a bit to integrate the git revision parsing stuff) dsmith-work: Ya. Just did a git clean -dxf and starting over unknown_lamer: just pushed the paren fix dsmith-work: Thanks dsmith-work: Hmm. the bootstrap is failing. dsmith-work: unknown_lamer: See pm dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ (something from git) dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ release.2.3.1-6-a463-dirty dsmith-work: Yey! dsmith-work: sneek: seen dsmith? sneek: dsmith was last seen in #guile one day ago, saying: $1 = #("foo bar" (0 . 7) (0 . 3) (4 . 7)). dsmith-work: sneek: botsnack sneek: :) wingo: moin sneek: wingo, you have 1 message! sneek: wingo, dsmith says: Your .dir-locals.el is unbalanced wingo: tx for not, i fixed it wingo: initial measurements, baseline compiler (-O0) goes between 5x and 15x as fast as -O1, depending on input wingo: still ironing out a couple bugs civodul: hi wingo civodul: nice civodul: haven't played with it yet :-/ wingo: np, probably best that i catch these few bugs wingo: the real test will be if we can get bootstrap/ compiled with the baseline compiler tho; currently my test is just making c&e tests use -O0 *: dsmith rubs hands in anticipation civodul: wingo: are you changing the c&e macro to test both compilers? wingo: civodul: yes wingo: i did that, i think nikita`: hm. https://gitlab.com/gnutls/gnutls/-/issues/996 this is the wrong bugtracker, right? I report this issue with one year delay or so.. system/base/target.scm is within guiles source, not gnutls? civodul: nikita`: i think you already reported a similar issue some time ago: "x86_64--netbsd" is not a valid triplet civodul: should be "x86_64-pc-netbsd" or similar nikita`: but it isn't civodul: a triplet with three elements :-) nikita`: i think we just had a chat, never a report. but we don't have tripplets in pkgsrc, what guile expects is a mistake for all systems targeted by pkgsrc civodul: i'll reply in the bug tracker nikita`: ok dsmith-work: Morning Greetings, Guilers wingo: neat, i can now compile module/ with the baseline compiler civodul: yay! wingo: neat, seems to be all in shape. will switch over bootstrap/ to use baseline civodul: that's a really nice side effect of this endeavor wingo: indeed *: wingo does first clean bootstrap... wingo: still takes around 3 minutes to compile eval tho wingo: maybe can be reduced by careful trimming of the module graph to avoid loading the cps compiler unless it's used wingo: pretty sure that overhead is mostly the expander wingo: but compiling psyntax only took 6 minutes or so after that chrislck: here's a surprising ice-9 match-lambda error condition: chrislck: http://paste.debian.net/1146155/ heisenberg-25: Hi, is there a nonblocking implementation for `write` function to write scheme values to file? wingo: heisenberg-25: not in guile itself, dunno if someone has that as a module wingo: unless you object->string then put-string to a nonblocking port heisenberg-25: wingo: Ok. I am writing a lot of scheme objects at once so object->string may cause a memory explosion, right? wingo: could be, yeah. best to find some implementation of "write" in scheme somewhere and use that heisenberg-25: Btw I am asking this as I am using fibers and want to write messages in a channel to file :) . So far using write works for smaller size of objects tohoyn: daviid, str1ngs: should g-golf work with guile 3.0? for me it does not. wingo: civodul: ok i think it is ready to go for guix wingo: if you are able to try git guile for guix, then compile with #:optimization-level 0, or otherwise compile with #:opts '(#:cps? #f) wingo: should yield more straightforward debuginfo and a faster compile that takes less memory justin_smith: heisenberg-25: maybe I am missing something about fibers, but wouldn't blocking be the right behavior, as you don't want writes to one port to be able to overlap, and a non-blocking send of a message is all that's needed for the thread that requests the write justin_smith: that is to say, if I were doing this from scratch, I'd want a single blocking writer (in its own thread) to insure integrity of output data heisenberg-25: justin_smith: checkout this pitfall about blocking i/o in the fibers documentation https://github.com/wingo/fibers/wiki/Manual#31-blocking justin_smith: heisenberg-25: when I use clojure with core.async, I explicitly create a non-async thread that reads from a channel (in order to isolate my i/o from the async machinery) - it prevents multiple weird issues justin_smith: that said I don't know fibers yet (I've looked at them as an analog to core.async but not yet used them in anger) so I'm sure there's subtleties that don't translate justin_smith: but, if there's an analogous situation, it would be making a non-fiber thread that can read the kind of port fibers use justin_smith: s/port/message justin_smith: a brief browse finds that get-message on a channel is thread safe, not sure if it works outside fibers though heisenberg-25: justin_smith: It is basically to allow suspending/resuming of a fiber waiting on i/o. blocking i/o calls prevent this justin_smith: heisenberg-25: I understand that's what fibers are for, the problem is that you often have i/o or CPU intensive things at the edges that you don't want monopolizing fiber resources, so the pattern required in core.async is an adaptor to a blocking thread via channel - you want a blocking thread (for the i/o or CPU usage) that can commonicate with another non-blocking thread (for coordination / light weight justin_smith: cooperative multitasking) justin_smith: it could be that fibers don't really want / need this paradigm, if that's the case I apologize for the noise as what I'm saying isn't relevant here justin_smith: but my first instinct, having done a lot of async programming, is that having a syncronous process that owns an output destination and blocks, mixed with channel reads / writes to communicate with non-blocking code, is the ideal pattern justin_smith: (of course no other process should be sharing that thread that is blocking - the blocking is essentially letting your sync on system calls, and could in theory be replaced by interrupt / select based poll ops) civodul: wingo: yay, thanks! civodul: i'll report back justin_smith: OK, I'd been intending to read about fibers, and so far they look much nicer to use than core.async, and some things I've learned to do to get around core.async problems might be silly in fiber world :/ justin_smith: I look forward to using them in anger and find out how they really compare justin_smith: hmm - the section of the manual on blocking (which heisenberg-25 first linked) describes the same problems (and same solution) with blockign file IO - indefinite wait time and using real threads as a middle layer str1ngs: sneek: later tell tohoyn. It does not work with guile 3.0 as far as I've tested. sneek: Got it. bsima: how can I do regex capture groups in guile? dsmith: bsima: matchsubstring: https://www.gnu.org/software/guile/manual/html_node/Match-Structures.html dsmith: scheme@(guile-user)> (use-modules (ice-9 regex)) dsmith: scheme@(guile-user)> (string-match "(.*) (.*)" "foo bar") dsmith: $1 = #("foo bar" (0 . 7) (0 . 3) (4 . 7)) dsmith: scheme@(guile-user)> (match:substring $1 2) dsmith: $2 = "bar" dsmith: bsima: Like that ^^ bsima: oh match substring takes another arg bsima: cool thanks bsima: scheme@(guile-user)> (index-titles) bsima: $2 = (("this is a title" . 2) ("test" . 1)) bsima: scheme@(guile-user)> (assq "test" (index-titles)) bsima: $3 = #f bsima: what the heck is going on? malaclyps: is guile3.0-chickadee working okay on mainline guix? The examples on https://dthompson.us/projects/chickadee.html just throw up a black window for me. guile3.0-sdl2 examples seem to work okay. I even tried creating a very simple patch to upgrade to 0.5.0... RhodiumToad: bsima: two strings with the same characters are not usually eq? to each other RhodiumToad: bsima: in fact they're not usually even eqv? RhodiumToad: bsima: so you'd need assoc, not assq or assv lampilelo: eq usualy means it's checking the equivalence of pointers or something that can fit into the word lampilelo: what you want is string=? RhodiumToad: you missed the question, it was about an association list lampilelo: ah, sorry RhodiumToad: the question was asking why assq (which compares with eq?) did not find the entry RhodiumToad: whereas assoc compares with equal? which compares strings by content, as string=? does lampilelo: you can use assoc from srfi-1 and specify string=? as equal operation lampilelo: yes, assoc uses equal?, so it should be good lampilelo: it recurses through the lists to compare their contents RhodiumToad: or of course one could convert the strings to symbols or keywords first malaclyps: davexunit, though I couldn't get chickadee to work on the current Guix, I'm *really* enjoying messing around with guile-sdl2, especially with your coop repl code! It's exactly what I've been looking for in a repl-ish game dev environment! manumanumanu: Does GUILE_FOR_BUILD do something? I have a working 3.0.2 built from release tarballs, but now I want to build the very same version from git. It still seems to take ages RhodiumToad: (set! (age RhodiumToad) (1+ (age RhodiumToad))) manumanumanu: RhodiumToad: Happy birthday! manumanumanu: but that seems rather un-idiomatic scheme :D (set! ...) is a code (life?) smell :) :) RhodiumToad: :-) RhodiumToad: hm, srfi-19 doesn't seem to have a decent calendar difference function? pinoaffe: RhodiumToad: yep, it does not pinoaffe: there is time-difference though manumanumanu: Maybe we should port gregor from racket. They all swear by it... andswitch: malaclyps: https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Cooperative-REPL-Servers.html ? malaclyps: andswitch, yep! malaclyps: davexunit, okay I worked out what's broken about guile3.0-chickadee in guix, touch wood I'll be able to submit the fixes upstream (it's just a matter of updating both guile3.0-sdl2 and guile3.0-chickadee I think) malaclyps: i can't believe I went on a huge exploratory voyage into common-lisp sdl2/openGL libraries, only to end up back at guile! malaclyps: that said, it did leave me a bit envious of some of the features of sly/SLIME that I wish I had in geiser arpunk: malaclyps: Are you working with the new upstream version of chickadee or the one currently available on guix? manumanumanu: Sorry to ask such an off-topic question: does anybody here speak serbian or know of any way to travel into serbia through your country? A friend's father just died and we are looking for ways for him to be able to go home to Serbia. I am trying to find info about transit through neighbor counties, but my serbian/croatian/hungarian/romanian/bulgarian is limited. manumanumanu: if you have any info, we can chat privately, or you can send me an email at linus.bjornstam@fastmail.se unknown_lamer: dsmith: https://git.savannah.nongnu.org/cgit/bobotpp.git/commit/?id=3804f43913ab073eee40f09d3d46398c52cd8ba8 good news, I integrated git-version-gen today unknown_lamer: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs unknown_lamer: oh, except the version isn't available to scheme, lovely unknown_lamer: sneek: botsnack sneek: :) dsmith: sneek: later tell wingo Your .dir-locals.el is unbalanced sneek: Got it. tohoyn: guile 3.0 documentation says that Tree-IL form fix is only for unset lambda expressions. what does "unset" mean here? rndd: hi everyone! i'm trying to compile example from https://www.gnu.org/software/guile/manual/guile.html#Guile-Initialization-Functions section 5.2.2 "A Sample Guile Main Program" on guix but pkg-config gives me an error "fatal error: libguile.h: No such file or directory". does anyone know how to fix it? mwette: rndd: I'm not sure how your environment is set up on guix. Maybe if you do $ PKG_CONFIG_PATH=$HOME/.guix-profile/lib/pkgconfig:$PKG_CONFIG_PATH pkg-config --cflags guile-3.0 rndd: mwette: thank you for the answer! i think my question is not proper for this room. this is a guixsd specific question. after all, i specified specifications manifest where i declared guile, but nothing -_- tohoyn: I get plenty of warnings "imported module (rnrs) overrides core binding xxx". is there a way to get rid of them? tohoyn: I use guile 3.0 dustyweb: helo tohoyn: I'm using guile 3.0 as a target platform for Theme-D and those messages are really annoying. mwette: tohoyn: I hate those. Read the section of the manual Modules. You can use (use-modules ((rnrs xxx) #:select (foo bar))) or #:renamer -- something like that. tohoyn: mwette: should guile have a compiler option to suppress those warnings? tohoyn: mwette: I mean a command line option mwette: i dont know. i try to use the specifiers tohoyn: mwette: do you use #:select so that you don't import bindings that would override core bindings? tohoyn: mwette: the #:duplicate keyword might help tohoyn: mwette #:duplicates (replace last) works andswitch: is there a specific category of programs in which Guile really shines coding wise? catonano: andswitch: this question is a bit vague. Guile is a scheme, it shines at everything scheme shines at catonano: andswitch: there's a category where it also shines, if not coding wise. Substituting bash scripts ans integrating such "scripts" with APIs provided by C libraries. Coding wise it could be a bit ugly but it's a use case that is covered really strongly catonano: andswitch: are you satisfed with my remarks ? andswitch: sure :) do you happen to an example of such a substitution? andswitch: sounds interesting catonano: andswitch: no, sorry I have no such example at hand 😐️ andswitch: that's ok, thanks nonetheless catonano: andswitch: there's a Guile library for piloting git. You can check out repos, creating branches, maybe even creating patches catonano: andswitch: it wraps an API provided by a C based library catonano: that could be a partial example andswitch: https://gitlab.com/guile-git/guile-git ? catonano: andswitch: yes, that one andswitch: so in a sense you have the C functions available in REPL now catonano: exaclty. In the REPL you can call schme functions but in reality those functions are wrapping C functions andswitch: nice mwette: catonano: check https://www.nongnu.org/nyacc/, click on the FFI Helper page, the FFI Helper takes .h files and generates .scm files that use the GUile FFI API catonano: mwette: thank you ! Yes I know ! I was thinking of some bash script that was substituted by a Guile script but I couldn't come up with any andswitch: mwette: you culd try this on the kernel API mwette: Not sure what you mean about the kernel API. mwette: Do you mean libguile? andswitch: if i understand correctly, the linux kernel has an API for user-space programs to access kernel services. If you can create bindings for the whole kernel API, you can write all of user-space in Guile :D andswitch: probably i don't understand it correctly though mwette: OK. I was not familiar. When I look it up, it just mentions libc etc. I have used the FFI Helper to provide interfaces to dbus, epoll, glib, gtk+-2, etc. In the distro there is an examples directory with, well, examples. andswitch: that's a long list of libraries :) looks good mwette: A working demo gtk app is shown here: https://paste.debian.net/1145864/. The comments on lines 22-24 indicate the number of lines in the ".ffi" file and then autogenerated ".scm" file. andswitch: cool BlackMug: hello there BlackMug: is there comparison between guile and rust? or guile and rust and C? *: guix-vits "i'm so used to 'a = 4; b = a; // changing b will not change a.'" justin_smith: andswitch: maybe you mean system calls? when I used fortran it was a fun exercise to interact with the kernel via syscall invocations directly, skipping libc justin_smith: I'm not sure if guile has the kind of control you need to be able to operate at that level justin_smith: s/fortran/forth/ I'm tired dsmith: Ahh Forth! andswitch: justin_smith: don't know if that's the technical term, maybe. But if it's all C, I imagine a system call is just a function call? justin_smith: andswitch: it typically is, but there's an underlying implementation, IIRC it involves putting a magic number on the stack and then making a call to the syscall address justin_smith: which is kind of like a function call but much lower level justin_smith: the trick was that forth could do this directly, without the c machinery in between andswitch: i see pinoaffe: https://gitlab.com/pinoaffe/guile-words I implemented a couple of word / string / list utilities, such as (approximately) counting english syllables and calculating levenshtein distance, does anyone wanna take a look at my code? andswitch: i'm not familiar with that kind of communication unknown_lamer: grep RunHooks -r source/ is your best bet tbh unknown_lamer: looking at this it's kind of arbitrary depending on the hook unknown_lamer: wow, I never got rid of the pre-STL String class entirely either unknown_lamer: maybe I can try dusting this off to remember some C++ and then figure out http://coccinelle.lip6.fr/ to get rid of String unknown_lamer: The following packages will be REMOVED: unknown_lamer: guile-1.8 unknown_lamer: I have apparently not updated guile in a *bit* unknown_lamer: dsmith: hrm, I applied the patch but after building I get a lot of "Utils.C:(.text+0x1bf3): undefined reference to `scm_from_locale_string'" and whatnot, run into that at all? dsmith: No. dsmith: Do you have more than one guile installed? dsmith: Prob need to remove all -dev packages too. unknown_lamer: just guile-3.0-dev guile-3.0-doc guile-3.0-libs guile-3.0 and it's trying to link against libguile-3.0 unknown_lamer: hrm hrm unknown_lamer: will have to take another look later dsmith: Nope. Just did a fresh build from my branch. No build errors. Some warnings about "throw". dsmith: Hmm. I've got guile 3.0.1 installed here. dsmith: My g++ is g++ (Debian 8.3.0-6) 8.3.0 unknown_lamer: I think it's because I have guile.m4 from 2008 manually included unknown_lamer: the idea being that you can reconf without needing guile, in case someone wanted a scriptless bot dsmith: "git clean -dxf; autoreconf --install --symlink && ./configure && make" unknown_lamer: dsmith: yeah it wasn't that unknown_lamer: dsmith: which version of autotools are you using? wondering if maybe i'm running into some incompat there now... (keeps whining about missing config.rpath too) unknown_lamer: I am ... so out of date now :-\ daviid: unknown_lamer: guile.m4 has been patched a couple of times since, I would grab the latest and use it to replace the one you keep in yur project unknown_lamer: alas, no dice unknown_lamer: so weird dsmith: autoconf 2.69-11 dsmith: nope dsmith: yep dsmith: automake 1:1.16.1-4 ahmed1hsn: How do guile compare with Chicken scheme? dsmith: (basically, up to date Debian Buster) unknown_lamer: dsmith: hrm even weirder, same here (on sid though) unknown_lamer: turns out it's something with gcc 9 dsmith: sneek: version? sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs reepca: is there a way in guile-fibers to properly spawn a new thread that could be considered "outside" of fibers? Closest I've found so far is: (parameterize (((@@ (fibers internal) current-fiber) #f)) (call-with-new-thread ...)) reepca: for context, I'm trying to implement a thread pool for various pesky blocking operations reepca: it works fine to use channels to communicate between "outside fibers" threads and "inside fibers" threads, but if you try spawning a new thread from inside fibers it can't use channels to communicate with anything because it tries suspending through the call-with-new-thread continuation barrier. dsmith-work: Happy Friday, Guilers!! mwette: Howdy! dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen unknown_lamer ? sneek: unknown_lamer was last seen in #guile 13 hours ago, saying: turns out it's something with gcc 9. dsmith-work: Heya mwette mwette: testing the bot? dsmith-work: Yeah. New bobot++ code. dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs dsmith-work: Hmm. That version really should be more accurate mwette: sneek: later tell dsmith-work nice work on the bot sneek: Got it. dsmith-work: thanks sneek: dsmith-work, you have 1 message! sneek: dsmith-work, mwette says: nice work on the bot stis: hey guilers! dsmith-work: Bah! Snowing outside! manumanumanu: civodul, wingo : If I were to submit a patch with a "simplify-equal-and-eqv" in the style of maybe-simplify-to-eq of primitives.scm, would you be interested? As I wrote to ludo, porting aleix's json parser from match (using equal?) to regular cond clauses led to a whopping 25% speedup on some already pretty fast code (we got the json parser down from a rather slow 19s for a 24mb file, to about 2.5 s on a 2015 manumanumanu: imac). That rhymes badly with match expanding to optimal code. Since guile is already optimizing equal? to eq? for nulls and booleans, why not eqv? it for bignums, floats (????? I don't know if that is sane), ratnums and chars? manumanumanu: The maybe-simplify-to-eq is simple enough (but not as wide as it could be, since keywords are also eq?, but are not in the code). I can use that as a starting point. wingo: manumanumanu: plz send the patch :) manumanumanu: wingo: the question is then: how can I hack on it without having to do recompiles? Can I chaange the file on a compiled system? (I have never really dug this deep before. I am in waay over my head) Point me in the right direction and I won't bother you again! wingo: manumanumanu: do you work from a git checkout? manumanumanu: I could. I never got guile to compile on my mac outside of homebrew, but I have a bunch of SBC's that run different versions of guile (2.9.3 - 3.0.1) from git. manumanumanu: wingo: sorry, doing my going to bed routine here. answer latency is variable manumanumanu: I'll see whatever answer tomorrow! :D Good night! Compiling the latest master on my rock pi 4. It might be done in the morning... wingo: civodul: i wired up the baseline compiler to -O0. probably it's broken for many cases but you can give it a go now and fix its bugs ;) civodul: wingo: woohoo, a big thank you! civodul: i'll give it a spin over the week-end wingo: coolio wingo: civodul: note i also added an #:optimization-level kwarg to the compile procedures rekado_: ooh, nice! wingo: if you don't use that, then instead pass #:cps? #f in the opts wingo: but better to pass #:optimization-level or -O0 on command line wingo: anyway, zzz wingo: night :) civodul: night! rlb: dustyweb: don't have time to read the whole scrollback right now, but (1) yes, I'm using fash, though for it to be suitable for me longer-term, it'll need to add a fash-delete, (2) I have some fash patch(es); I think I've sent them to wingo, but not sure what the general position on them will/would be, and (3) fwiw, you may know, but as more prior-art, the clojure syntax there is just {x y} (and #{x y} is a set), which guile presumably rlb: couldn't adopt as-is because, if nothing else, srfi-105. Clojure also evaluates the contents (eventually), i.e. at runtime, {(inc 1) :two} maps 2 to :two (where inc is just 1+). rlb: Oh, and I'll also need a fash-set :) rlb: In any case, I'd love to see solid persistent map and set support in guile proper, whether or not it ended up being suitable for me right now. rlb: One of the patches was to add a fash-update, similar to clojure's update. justin_smith: yeah, update / update-in / assoc-in make a big difference in usability of immutable hashes rlb: ...careful api design and the arrow forms don't hurt either, though I can understand if some are put off by the latter. dsmith-work: {appropriate time} Greetings, Guilers mwette: o/ dustyweb: rlb: hey dustyweb: thanks for responding :) dustyweb: glad to hear where we have clear overlap str1ngs: hello daviid, I just wanted to follow up on the callback work we looked at the other day. How did you make out with that? It did capture my curiosity :) lloda: cyclopsian: thx - i'll try to have a look dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen mwette? sneek: mwette was last seen in #guile 2 hours and 20 minutes ago, saying: o/. dsmith-work: !version dsmith-work: !uname sneek: Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux daviid: str1ngs: I will work on this within the next few days ... will let you know str1ngs: daviid: I'm not in a rush for the feature. just curious how the implementation was going. if you need help with any of the C parts let me know. reepca: are open-pipe and open-pipe* the only built-in guile procedures for starting a process without waiting for it without using primitive-fork? daviid: I now have a reasonable idea on how to make it work, after that long chat on #intro ... and I think I can do it without a single line of C code, but if not, will let you know ... str1ngs: daviid: that would be nice if you can avoid C even. unknown_lamer: dsmith-work: hey, the patch you emailed me against bobot++ a few weeks ago is all there is for 3.x support so far, right? unknown_lamer: I should probably apply that and push it out to git dsmith-work: unknown_lamer: There few other things I've found since. Some doc errors. Commented out some "cerr <<" debug messages in the mutex code. unknown_lamer: docs are probably atrocious heh unknown_lamer: I think I wrote them over a weekend when I was ... 17 unknown_lamer: threading "support" was added pretty late too dsmith-work: unknown_lamer: Just some typos. Like bot-log instas of botlog or so. unknown_lamer: I wonder if there's any straightforward guide to the changes in C++ since C++98 heh unknown_lamer: I think I can drop HP/UX support now too dsmith-work: However, there are some odd things going on. dsmith-work: Like for-each being uindefined! However, *is* available after using srfi-1. dsmith-work: I thing the way bobot tries to put it's scheme interface into guile-user is suspect. unknown_lamer: dsmith-work: ancient times... unknown_lamer: original code is from ... 97 or 98? unknown_lamer: and I think predates modules in guile itself if my memory isn't completely failing me dsmith-work: I know the bot has been running for at least 10 years or so. unknown_lamer: 'tho I could have sworn there's a bobot-user or similar module, probably not hard to do that if not unknown_lamer: I remember some low level trickery though, iterating over the exported symbols of some module dsmith-work: Yes, dsmith-work: So the earliest commit for guile-sqlite is March 2, 2010. Pretty sure the bot was running before that. unknown_lamer: yeah, I asked to take over maintenance in 2003 unknown_lamer: modernized the C++ (... for the time, I guess it's crusty and old again now!) and ported forward to guile 1.9 I think unknown_lamer: git history should have everything dsmith-work: unknown_lamer: Still hacking CL? unknown_lamer: https://git.hcoop.net/clinton/bobotpp.git/commit/2e20c3e1445f1539b3164af29da30654942f6a15 unknown_lamer: 2002 is when I started hacking on it, guess at some point I might have been using CVS ha unknown_lamer: guess in 2002 that's all there was other than raw RCS unknown_lamer: dsmith-work: nope, just a sysadmin nowadays unknown_lamer: doing almost no programming at all for like eight years now :-\ dsmith-work: Woah. dsmith-work: Not cvs, it was bzr I think. unknown_lamer: I switched to darcs once that existed dsmith-work: Maybe that's what I'm remembering unknown_lamer: then imported cvs -> darcs, 2008-11-11 afaict (the "project @ ..." commits are all from the cvs to darcs tool) unknown_lamer: and now to git in 2020! unknown_lamer: I like darcs more theoretically but there's no good UI to it anymore, magit finally made git tolerable dsmith-work: magit make it fun! Makes me want to write code just so I can use magit. unknown_lamer: people here thought i was some kind of wizard and it was just because i used magit ha unknown_lamer: converted a few vim users to the correct editor thanks to it ;) dsmith: unknown_lamer: The hooks section in the docs describes the args to the various hooks, but not what the text regex is matching against. dsmith: Seems like it's all the hook args separated by spaces. daviid: sneek: later tell lafrenierejm get-keyword is defined/exported in/from (oop goops), so you may either (use-modules (oop goops)) or 'snarf it' if you don't want to use the all (oop goops) module, just bind the following to a 'local' name: (@ (oop goops) get-keyword) sneek: Got it. ennoausberlin: Hello. Is there a srfi function to convert a number of seconds (I get this from /proc/uptime) to a more readable form , e.g. 1 year 6 days 2 hours 30 minutes? chrislck: localtime and mktime wingo: those are for dates wingo: not durations wingo: i think for durations you need to roll your own thing ennoausberlin: @wingo: I could not find any, but I wanted to ask here before I do the calculations by myself. Thank you dsmith-work: Hey Hi Howdy, Guilers mwette: Greetings! wingo: o/ dustyweb: hi wingo dustyweb: wingo: so what do you think about trying to get fash.scm into Guile proper? dustyweb: if I volunteered to do the work, do you think it would be welcome? dustyweb: I think it would be nice to make it broadly available dustyweb: we do have vhashes but they aren't thread safe. IIRC fash is right? dustyweb: and seems better performant I thiiink but i don't remember wingo: happy to include it in guile, fash should be thread-safe but needs to use atomic boxes rather than its own thing dustyweb: it's been a while since I remember why I liked it better dustyweb: wingo: cool wingo: can you check with rlb if fash is the right thing? he is working in similar areas dustyweb: oh great dustyweb: rlb: hi! dustyweb: let's talk dustyweb: wingo: I'm going to start porting Goblins to Guile dustyweb: and I want to get my Racket and Guile programs talking dustyweb: but first thing's first: we need to agree on a nice functional hashtable :) dustyweb: (yes that can be changed later but I'd love to do it sooner than later!) dustyweb: rlb: wingo: btw I really like that Racket has separate hashtable types for hash(equal), hasheq, hasheqv dustyweb: something I hate about the default hashtables in guile is that it's the *operations* that determine that dustyweb: and then you can mess up your hash dustyweb: so annoying wingo: indeed dustyweb: but fash does better dustyweb: I'll also say something that may be controvercial in scheme-land: Guile's default syntax would be improved if we had a first-class representation of hashtables. it's not super high priority but dustyweb: I noticed I chose the right datastructure more often in Racket because I wasn't aiming for repl prettiness as much dustyweb: O(n), O(no) dustyweb: the wrong datastructure obviously being alists dustyweb: which like yes they're perfectly fine and fast for small things but it's tempting to lie to yourself "well this will probably stay small!" until it doesn't dustyweb: and then you have Regrets (TM) dustyweb: and hashtables are such a common use case dustyweb: I think it's worth it dustyweb: but again, not a killer issue dustyweb: anyway hi! I hope everyone in #guile has been having fun in my pseudo-absence :) dustyweb: and isn't too annoyed by my wordy return either ;) dsmith-work: dustyweb: What do racket first-class hash tables look like? (got a url?) dustyweb: dsmith-work: like so: dustyweb: #hash((a . 1) (b . 2)) dustyweb: #hasheq((a . 1) (b . 2)) dustyweb: #hasheqv((1 . a) (2 . b)) dustyweb: now here's the gross part dustyweb: notice that the symbols aren't quoted dustyweb: you have to use quasiquote to insert values dustyweb: which makes no sense to me dustyweb: I mean, as its display form, sure dustyweb: but wtf dustyweb: so my proposed syntax, let's say we were defining a hashtable, would be dustyweb: (define new-hash dustyweb: #hash(('a 1) ('b 2))) dustyweb: and you could always quote it like dustyweb: (define new-hash dustyweb: '#hash((a 1) (b 2))) dustyweb: that seems more sensible to me dustyweb: there's no need to introduce cons notation for this dustyweb: and RhodiumToad: hm, wouldn't that be inconsistent with #(...) tho? dustyweb: good to use quoting patterns that more closely resemble normal scheme dustyweb: RhodiumToad: Racket also has #(...) for vectors dustyweb: observe that it's #( dustyweb: so dustyweb: #hash dustyweb: is easily distinguishable dustyweb: right? RhodiumToad: (symbol? (vector-ref #(a) 0)) ;; #t dustyweb: RhodiumToad: yes, but dustyweb: oh wait dustyweb: RhodiumToad: you're talking about the quasiquote syntasx RhodiumToad: no dustyweb: rather than #hash dustyweb: ? dustyweb: ah dustyweb: #hash(a) is a syntax error in guile dustyweb: In procedure scm_lreadr: #:3857:3: Unknown # object: #\h dustyweb: but dustyweb: I think guile does have a pattern using # dustyweb: for other things dustyweb: so maybe some other syntax is necessary dustyweb: I'm not sure what RhodiumToad: what I'm saying is that for #hash(...) to evaluate its args would be inconsistent with #(...) which does not dustyweb: RhodiumToad: fair dustyweb: yes that's true dustyweb: so maybe #hash should not evaluate its args. dsmith-work: There is read-hash-extend, but I think that's for single chars. dustyweb: another option is to go the closure route but it would be incompattible with the curly infix syntax dustyweb: or, modified closure: dustyweb: {[a 1] [b 2]} ;; or {(a 1) (b 2)}, [] is just convention dustyweb: I don't like {key1 val1 key2 val2}, easy to get lost... closure also flattens let, which is gross dsmith-work: Ya, seems to be a single char. dustyweb: but {} for dictionaries matches a lot of the world dustyweb: so the real thing is that I think you'd want a syntax that the repl, by default, would also print and pretty print with, and that it's syntactically common to do that dustyweb: and whatever that's for should be for the immutable hashtables, obviously dustyweb: but since it's a late addition, I'm not sure what kind of character choice would be commonly available dustyweb: ~? ;) lloda: dsmith re: guile-cairo, I guess I'm technically a maintainer, but I only stepped in b/c i needed a couple bugs fixed at the time. I couldn't get the doc gen system to work and I did try :-/ help would be very much appreciated. RhodiumToad: why do you want read syntax for it, rather than for example having a form which takes an alist and makes a hash table from it? dustyweb: RhodiumToad: that's technically "fine" in a sense, but my argument is dustyweb: it changes how users tend to "choose" datastructures dustyweb: since lispy users like stuff that (pretty) prints at the repl a lot dustyweb: so having something as common as a (functional) hashtable have such representation by default, I'd argue, impacts that choice... right now I think a lot of people choose alists where inappropriate in guile dustyweb: including me dustyweb: I'm guilty of that dsmith-work: So. Could the writer for a hash also include alist->hash (or whatever) ? dustyweb: dsmith-work: you mean actually print out alist->hash? dsmith-work: Ya. rekado: I guess nobody likes SRFI-10, but we can do #,(hash ((a 1) (b 2))) rekado: (import (srfi srfi-10)) (define-reader-ctor 'hash (lambda (alist) `(alist->hash-table ',alist))) dustyweb: dsmith-work: that doesn't really work given the way that people copy-pasta around such things, insert them into quoted datastructures dsmith-work: Yeah, something, like that dustyweb: keep in mind that when the repl prints things out it's usually implicitly quoted dustyweb: scheme@(guile-user)> (list 1 2 3) dustyweb: $45 = (1 2 3)(list dustyweb: er dustyweb: scheme@(guile-user)> (list 1 2 3) dustyweb: $45 = (1 2 3) dustyweb: rather than dustyweb: scheme@(guile-user)> (list 1 2 3) dustyweb: $45 = (list 1 2 3) dsmith-work: TRue dustyweb: or dustyweb: scheme@(guile-user)> (list 1 2 3) dustyweb: $45 = '(1 2 3) RhodiumToad: rekado: even the documentation page for srfi-10 doesn't like srfi-10 dsmith-work: heh rekado: it even talks about this very use case dustyweb: I hope I'm not being annoying coming in and being like, "Guile, we need to change everything and do all these things because I've been hanging out in Racket land too long, nya-nya!" dustyweb: I'm hoping to do productive cross-pollination rather than being invoking pollination allergies :) daviid: dustyweb: nice to hear that you're 'really' back! :) fwiw someone worked on fash, here is they repo https://hg.sr.ht/~bjoli/guile-fash dustyweb: daviid: yes we talked on the list... sadly I can't clone that url! RhodiumToad: no, the annoying thing is when you use lots of short lines, please make less use of the return key dustyweb: I said that in an email just this morning so I guess we'll see what they say dustyweb: RhodiumToad: are you sure me having every message be really long, but having the same amount of words, wouldn't be worse? :) RhodiumToad: it would not be worse daviid: dustyweb: porting mediagblin to guile, that might well become our killing app (considering guix 'more then an app' :)) dustyweb: daviid: well, it would be porting spritely to guile at this point :) dustyweb: mediagoblin is still happening and just put out a release but I'm not the primary maintainer anymore... I'm working on some next-generation federated social web things dustyweb: basically "now that activitypub is well adopted, what is it that we're not doing well yet?" dustyweb: so that's basically dustyweb: - better security str1ngs: killer goblins! dustyweb: - content-addressed storage dustyweb: - bridge federated social networks with "p2p" networks dustyweb: - distributed social web as a distributed social game ;) dustyweb: most of that work has been me working on an ocap'y actor model implementation in Racket, and the storage layer dustyweb: the next step is to get two actor model systems to talk to each other dustyweb: for distributed programming dustyweb: so I plan to get my racket actor system talking to a guile one daviid: is that 8sync daviid: you ported 8sync to racket daviid: ? dustyweb: daviid: sort of... it's 8sync after I learned a lot more about ocap security dustyweb: and the actor model fundamentals dustyweb: and got review from people who actually know what they're doing :) dustyweb: I have debated whether or not to simply reuse the name/branding of 8sync dustyweb: or to call it Goblins in Guile too dustyweb: as I port it back dsmith-work: lloda: That's because it uses some scripts and code that only exist in the Guile source tree. (Is not installed) dsmith-work: lloda: Try adding your (built?) guile source tree to your $PATH dsmith-work: It's been decades now dsmith-work: I'm thinking that code is not changing much. Might be ok to install it? (the C doc snarfing machinery) lloda: from what i remember, i needed to install guile-gnome and that needed g-wrap etc. lloda: in the end it did run but it choked on the new format of the cairo doc lloda: but, it's been a while daviid: I think there is 'bug', or maybe i should say an improvement that needs to be done on our texinfo modules so it handle 'new' 'gtk/cairo like' docs daviid: guile-gnome doc can't build either, that's ben a while now ... justin_smith: dustyweb: I recently came back to guile for a personal project after years of using clojure professionally justin_smith: dustyweb: one of the first things I did was implement a non-quoted round-trip #h(#:a 0 #:b 1) read / write syntax for immutable vhash hash-tables justin_smith: I discovered that I would have to do a lot more work for the h to be more than one char justin_smith: (or it seemed so) justin_smith: I was suprised how concise a working reader was: justin_smith: (read-hash-extend #\h (lambda (chr port) (let ((data (read port))) `(ht ,@data)))) justin_smith: but that's very non-scheme because I wanted it maximally clojure flavored - so it doesn't quote the body and there's no internal structure to the input, just a flat list that gets partitioned into pairs by the ht function janneke: (and=> (pair? (call-something)) car) ... it /could/ work janneke: why #t, though *: janneke spends another let justin_smith: also, fash looks very useful, I hope a fork called antifa comes out cyclopsian: could someone post that d-bus binding here again? I think I saw it here a few days ago but lost the link str1ngs: cyclopsian: I think it was called ac-dc-bus arpunk: cyclopsian: https://gitlab.com/weinholt/ac-d-bus cyclopsian: thank you cyclopsian: lloda: i happened to be looking at the guile-cairo docs a few days ago, I think the problem was the call to "guile-snarf-docs-texi" cyclopsian: that doesn't exist anymore cyclopsian: it was replaced with "guild snarf-check-and-output-texi" dsmith-work: Ah cyclopsian: in upstream guile civodul: justin_smith: re #h, i'd recommend a good old macro like https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/linux-initrd.scm#n253 civodul: it's about as convenient and doesn't have the drawbacks of reader extensions civodul: namely the fact that reader extensions can collide (it's a global name space) civodul: and plain 'read' doesn't work on them justin_smith: yeah, I was explicitly doing this for my own vanity / convenience, but using a proper macro makes sense wingo: moo civodul: hey! *: civodul has yet to play with the new compiler civodul: i set out to fix a bad bug in Guix but i keep procrastinating ft: new as in post-3.0 new? rekado: ft: yes, a new, less optimized compiler without a CPS step rekado: intended for much faster compilation with somewhat slower resulting code. ft: rekado: I see. Begs the question why? ft: ah rekado: this could be great for Guix which has lots of modules with thousands of variables that probably don’t benefit all *that* much from optimizations dsmith-work: wingo: So do you have a idea how much the new compiler will shorten bootstrapping builds? wingo: dsmith-work: somewhere between 2x and 20x i think, not quite sure tho dsmith-work: wingo: I'm amazed at how fast using the bootstrapped .go files is. Like 6 minutes or so. (on an 8 core box) *: dsmith is curious how much build times would improve lafrenierejm: How would one go about getting the value of specific keyword from a list of keyword:value mappings? lafrenierejm: (Not sure about scheme's terminology. LMK if the question isn't clear.) mwette: not clear: Guile has make-hash-table, hash-set!, and hash-ref to create hash tables, add items to tables, and retrieve values. Is that enough? mwette: There are various forms of hash depending on what it takes to match a key. justin_smith: also, alists are considered keyword:value mappings and use assoc / assq etc. justin_smith: but you probably want a hash table instead dsmith-work: However, you can (read) and (write) an alist. Not so a hash. justin_smith: not with that attitude :D lafrenierejm: Thanks for the replies. I'm wondering if I have some fundamental misunderstanding... lafrenierejm: https://paste.mozilla.org/uyntVt0c is the code I'm working with. Specifically, it's a WIP Guix recipe. I've added comments there with the corresponding Python code. Does that context clarify my question? justin_smith: lafrenierejm: it really matters what the data type is - eg. hash-ref or variant for a real hash-table, assoc for an alist (which is a common alternative in scheme code) justin_smith: also, it looks like define-package and package are macros which means their documentation would help you justin_smith: (and makes it hard to say what you need without knowing those macros) justin_smith: lafrenierejm: the doc says that "arguments" of a given package will be a list, by convention key/value pairs, so it's not even a lookup structure yet justin_smith: https://guix.gnu.org/manual/en/html_node/package-Reference.html#package-Reference justin_smith: oh wait, I'm wrong - it takes a list as an arg, but that doc doesn't describe how to look things up in it, so who knows what's in there lafrenierejm: justin_smith: Thanks for taking a look. I'll poke at it some and see if anything gives. justin_smith: I'm surprised I'm not seeing documentation about accessing the objects created by package definition, maybe I'm just not searching the right thing justin_smith: that said, you could try things like hash-ref and assoc and see what breaks :D lafrenierejm: justin_smith: Looking through some implementation details in utils.scm, it appears that arguments really is just a flat list. :/ daviid: lafrenierejm: fwiw, in (oop goops), (get-keyword key l #:optional default) daviid: lafrenierejm: so you'd do (get-keyword #:configure-flags (package-arguments sqlite) #f) daviid: if i understood your quiz correctly daviid: lafrenierejm: the (guix utils) module also defines a few keywords related utils, strip-keyword-arguments default-keyword-arguments substitute-keyword-arguments ensure-keyword-arguments rekado: you can also look up things in a keyword list with (and=> (memq #:foo the-list) cadr) RhodiumToad: mmm... nope. RhodiumToad: (define mylist '(#:key #:otherkey #:otherkey 1)) (and=> (memq #:otherkey mylist) cadr) ;; expected 1, got #:otherkey rekado: RhodiumToad: I’m assuming a well-formed keyword list that alternates keywords and values. RhodiumToad: that's exactly what mine is. sometimes the value of a keyword is also a keyword. RhodiumToad: happens a lot in goops especially RhodiumToad: (think #:init-keyword) rekado: RhodiumToad: ah, true rekado: I just saw the Guix context, so I reported what I sometimesdo in Guix. rgherdt: Hi! I'm getting an error whenever I use a cond-expand inside a r7rs define-library. For example: rgherdt: https://paste.debian.net/1145080/ rgherdt: I get: Syntax error: unknown location: source expression failed to match any pattern in form ((cond-expand (chicken (import (chicken format))) (else (import srfi-1))) (export my-func) (begin (define (my-func x) (format #f "received ~a" x)))) rgherdt: I'm importing (scheme base) before loading the definition file rgherdt: am I missing something? dsmith-work: UGT Greetings, Guilers civodul: hey! mwette: Hi, all. justin_smith: rgherdt: my reading of the cond-expand doc is that if no case matches it's an error, and I don't see an else, and I'd assume chicken wouldn't match in guile RhodiumToad: I see an else? justin_smith: I don't see one in the paste RhodiumToad: ah, indeed justin_smith: it's confusing, because the thing in the error message should work, but the literal thing in the paste shouldn't (if I'm reading the docs correctly) mwette: rgherdt: you may need to close your library form first rgherdt: RhodiumToad justin_smith: sorry, the error message was from an experiment with else to see if that was the issue mwette: (library ...) (cond-expand ...) vs (library .. (cond-expand ...)) justin_smith: rgherdt: oh that makes more sense rgherdt: mwette: hmm, but that wouldn't be part of the library then, right? mwette: not sure about library forms, tbh, but that seems to be what is in the Guile manual rgherdt: according to r7rs cond-expand is allowed inside a define-library (chicken loads this correctly) mwette: Oh, OK. Then I think you need an else (cond-expand (chicken (xxx)) (else)) rgherdt: this also didn't work. Actually define-library is not yet documented in Guile's Reference, since r7rs integration is pretty new. I also ran (install-r7rs!) but still get the error rgherdt: here an updated pastebin with the commands to load the library and the corresponding error message: https://paste.debian.net/1145105/ lafrenierejm: daviid: Unfortunately, `get-keyword` isn't bound. :( lafrenierejm: rekado: `(and=> (memq #:configure-flags ,(package-arguments sqlite) cadr))` is giving me "ERROR: Wrong type to apply: #:configure-flags". Full recipe is https://paste.mozilla.org/FTm5mqv9. lafrenierejm: Where can I read up on Guile's `and=>` and `memq`? The former in particular is completely new to me. mwette: paren misplaced ; sqlite) => sqlite)) chrislck: lafrenierejm: use the source, luke http://git.savannah.gnu.org/cgit/guile.git/tree/module/ice-9/boot-9.scm#n806 lafrenierejm: mwette: Thanks for the sanity check. Moving the paren as suggested gives "ERROR: Wrong type to apply: #:configure-flags". (and=> (memq #:configure-flags ,(package-arguments sqlite)) cadr) lafrenierejm: chrislck: Will do. :D mwette: lafrenierejm: Maybe you want the comma before (and=> , and that may be wrong also. To me it looks like you want to create a list. Maybe work the code (i.e., `(#:phases ...)) in isolation within guile, using a known value for (package-arguments sqlite). rekado: lafrenierejm: the Guixy thing to do here is to use substitute-keyword-arguments rekado: (arguments (substitute-keyword-arguments (package-arguments sqlite) …)) rekado: see the definition of bash-minimal in (gnu packages bash) rekado: but maybe that’s too much rekado: https://paste.debian.net/plain/1145131 rekado: (without substitute-keyword-arguments) rekado: here’s the version with substitute-keyword-arguments: https://paste.debian.net/plain/1145133 heisenberg-25: Is (ice-9 readline) module removed/moved in guile 3.x? I can't seem to import it rgherdt: it works here rgherdt: how did you install guile-3? heisenberg-25: I built it from the source heisenberg-25: ls /usr/local/share/guile/3.0/ice-9/ | grep readline - returns nothing rgherdt: weird, I also installed from source, and I have /usr/local/share/guile/3.0/ice-9/readline.scm heisenberg-25: This is where I installed it from https://ftp.gnu.org/gnu/guile/guile-3.0.2.tar.gz and I using it inside a docker (don't think that matters) tohoyn: heisenberg-25: try command "pkg-config --variable=sitedir guile-3.0" tohoyn: tohoyn: I suspect guile does not like to be installed into /usr/local tohoyn: ^heisenberg-25 heisenberg-25: tohoyn: yeah it is installed in /usr/local rgherdt: tohoyn: here guile seems to be happy inside /usr/local, what issues did you get? tohoyn: rgherdt: probably I was wrong heisenberg-25: tohoyn: the command you sent outputs /usr/local/share/guile/site/3.0 rgherdt: heisenberg-25: the archive you linked has guile-readline inside rgherdt: heisenberg-25: I suppose something went wrong with your build rgherdt: maybe you can try compiling guile-readline from that folder separatelly tohoyn: heisenberg-25: does that directory contain readline? rgherdt: heisenberg-25: is libreadline-dev installed in your system? heisenberg-25: tohoyn: No It doesn't even contain ice-9 heisenberg-25: rgherdt: No tohoyn: heisenberg-25: ok. it seems that it is in different directory. rgherdt: maybe that's the issue, guile-readline depends on libreadline rgherdt: the dependencies are listed in the README file heisenberg-25: okay. re-running the build after libreadline installation. will report back in few moments rgherdt: while running ./configure you should see, if readline was found heisenberg-25: I think it found it. heisenberg-25: rgherdt: It works! thanks heisenberg-25: Btw anyone who worked with (ice-9 atomics), can you please take a look at this question https://stackoverflow.com/questions/61456217/how-to-use-ice-9-atomic-boxes-with-hash-table rgherdt: heisenberg-25: nice, you're welcome justin_smith: heisenberg-25: I'm no expert on guile atomic boxes, but in general, compare-and-swap! type operations are not useful if the data referenced is mutable justin_smith: and the default make-hash-table is mutable justin_smith: (ther'es hashv / vlist based immutable hashes...) justin_smith: s/hashv/vhash/ heisenberg-25: I see. I was using mutexes but I am switching my threading to use fibers and it doesn't work well with mutexes. The author suggests to use atomic boxes heisenberg-25: https://github.com/wingo/fibers/wiki/Manual#34-mutexes dustyweb: hello! dustyweb: doing some non-guix guile hacking today :) dustyweb: it's been a while justin_smith: heisenberg-25: there is a workaround, if eq? works on your hash, and you are willing to copy the hash, call compare-and-swap and only replace the box contents if its still eq to yoru copy of the original justin_smith: (this is generally the idea of atomic exchange, not ice-9 atomic specific) justin_smith: heisenberg-25: you might find it more useful to use a hash where each value is an atomic box, especially if you can guarantee each value is immutable, or comparable with eq? and cheap to copy justin_smith: then instead of changing the hash, you'd change the box in the val of the hash justin_smith: that said, don't do boxes with more boxes inside heisenberg-25: justin_smith: the hash values aren't comparable with eq? (I am actually using the hashx functions). justin_smith: this makes the "compare" part of compare-and-swap! much harder to do correctly, but it could be that atomic-box-swap! still works on your vals if you are willing to make new ones instead of updating in place justin_smith: it won't work on the hash-table itself, as that is always identical to itself, before and after mutation :D heisenberg-25: that means copying the hash-table each time I update it, right? justin_smith: right, which is why I mentioned boxing vals of the table, instead of the table itself justin_smith: there's also vhash (not hashv as I mistakenly said above) which is an immutable hash table justin_smith: each assoc returns a new table https://www.gnu.org/software/guile/manual/html_node/VHashes.html justin_smith: they are more expensive than a standard hash, but I'd hope they are cheaper than copying a whole table over and over heisenberg-25: I will look at vhash. heisenberg-25: Btw this is the function https://github.com/opencog/atomspace/blob/652bc959335825181156b46e70888ab1b04a94ae/opencog/scm/opencog/base/atom-cache.scm#L43 I am trying to use the atomic boxes with (I didn't include it the code on the SO question for simplicity :) ) justin_smith: heisenberg-25: aha! you are implementing thread-safe-memoize justin_smith: so the worst case on a race condition, if you have a thread-safe hash, is that f is called twice on some x instead of once heisenberg-25: justin_smith: Yes! (although the above code isn't written by me) justin_smith: that's if you hve a thread safe hash justin_smith: if your hash isn't thread-safe, worst case is totally destroying the structural validity of the hash as an object justin_smith: (depending on how it's implemented of course) justin_smith: so you could use atomic-box-swap!, and if you make a lock around the smallest scope (the hash update itself, not the entire calculation) or the hash is known to be thread safe, you are good justin_smith: if all these things work as documented - I'm very familiar with the version of htese things offered by clojure, and the docs make it look like this is the same heisenberg-25: "if you make a lock around the smallest scope (the hash update itself, not the entire calculation)" can you please elaborate this? this I am not using mutexes how can I use a lock here? justin_smith: oh, this would require a mutex, but much simpler logic around the mutex than usual justin_smith: but you dont' even need a mutex if you know the hash is thread-safe justin_smith: (and usually that thread safety ends up relying on some very short lived mutex somewhere down the line toward the bare metal) heisenberg-25: exactly. so using mutexes inevitable justin_smith: but the general principle is to keep them very short, and the swap pattern helps you make them extremely short lived justin_smith: eg. doing nothing inside the mutex except a single change to a pointer heisenberg-25: if I understand this what you said correctly, using a lock only around the scope I update the hash-table should work? justin_smith: heisenberg-25: actually I was wrong - the swap functions don't really make sense if you can't compare and retry, and atomic-box-set! only makes sense when replacing one value with another (fundamentally *not* what is happening with a mutable value you are updating) justin_smith: so you can use the swap functions with an immutable value like a vhash (where identity equality can tell you if anyone elsed touched it so you can retry or abort) or just use a lock around the hash usages and hope everyone else did too zig: manumanumanu: I republished what I found related to the R7RS libraries I found around my backup laptop zig: https://github.com/amirouche/guile-arew zig: not sure what the status is, but there should be tests zig: also it is a requirement for babelia (wanna search engine) zig: this should include the generator things, and people are interested in delimited continuation over the rainbow zig: zig: happy hacking ;) dsmith-work: For Great Justice! dsmith-work: (sorry, couldn't help it) zig: :) cyclopsian: are there any plans to make it so calls to (read) are capable of nonblocking i/o? suspendable-ports doesn't work for this cyclopsian: I saw an allusion to it in the fibers manual, but checking the implementation it still calls getc in a loop cyclopsian: my use case is having the repl plug into another event loop cyclopsian: I know about (system repl coop-server) and I think I can hack it to do what I want, but ideally would like to be able to do it without threads wingo: would be nice! no immediate plans but a reader implemented in scheme would be swell wingo: in the context of guile would be nice to have one source file that could compile to C and Scheme, because bootstrapping -- so it's complicated a bit wingo: but 3rd party read modules could work cyclopsian: ah okay, figures that porting it to scheme is the plan :) cyclopsian: wingo: what do you mean have one source file that could compile to C and scheme? like implement it in VM bytecode? cyclopsian: or is there some other meta language wingo: oh i don't know, either a high level specification that a macro could expand to scheme and some other procedure to take that specification and produce C wingo: or, a straight-up Scheme reader and a bespoke compiler from Scheme to C -- doesn't have to be general because it only has to work for this program dustyweb: beep cyclopsian: I see what you mean. I wonder if that would mean still having calls to read use the C implementation for speed reasons and only falling back to the scheme implementation if there is an escape continuation on the stack bsima: how do i get a list of the currently bound symbols at a repl? mitigate: daviid - the answers to my questions are --with-guile-site=yes for configuring guile-lib and GUILE_AUTO_COMPILE=0 for the user to use the system compiled files sneek: Welcome back mitigate, you have 1 message! sneek: mitigate, daviid says: I don't know what gentoo ebuild does, but if you use the autotool chain, _and_ specify --with-guile-site=yes as a configure option, then yes, it will use guile's (global) site dir for the source modules and guile's siteccache dir for the compiled modules, and in that case, you, a a user, dont ned to do anything tbe able to use guile'lib's modules and they all should be (pre)compiled mitigate: haha dsmith: rlb: There are 4 flavors, all combos of {32,64}{be,le}. dsmith: rlb: (but you prob already knew that) str1ngs: hello daviid, thanks for looking at this. I think in the case of vte-terminal-spawn-async the flags were more of an issue. though the annotation issue would still make this hard to work on. https://developer.gnome.org/glib/stable/glib-Spawning-Processes.html#g-spawn-async uses GSpawnChildSetupFunc and other functions on that page might use it as well. The documentation for GSpawnChildSetupFunc can be found here GSpawnChildSetupFunc str1ngs: daviid https://developer.gnome.org/glib/stable/glib-Spawning-Processes.html#GSpawnChildSetupFunc mitigate: I'm still having trouble with paths. I'm on M-x guiler in emacs and I've set up %load-path and %load-compiled-path - (use-modules (emacsy emacsy)) doesn't show an error (load it from the system). but (emacsy-initialize #t) throws an error In procedure module-lookup: Unbound variable: emacsy-initialize mitigate: coming from CL all the add-hook! set! hurts my eyes!! mitigate: i was hoping to get full strings in the stacktrace from the repl. On the command line the strings are truncated mitigate: i'm possibly missing something basic and should head for a modules tutorial RhodiumToad: I sort of like the !s, it makes it more obvious when you're mutating stuff str1ngs: mitigate: hello, what distro are you useing? mitigate: str1ng - gentoo - more of "roll your own" mitigate: ah now i see i have to use the wip branch of emacsy. str1ngs: mitigate: ahh wip branch fixed your problem. mitigate: not yet mitigate: but it'll fix another problem with an undefined variable str1ngs: I normally install emacsy with --prefix=$HOME/local. then set export GUILE_LOAD_PATH="$HOME/local/share/guile/site/2.2" str1ngs: and export GUILE_LOAD_COMPILED_PATH="$HOME/local/lib/guile/2.2/site-ccache" str1ngs: mitigate ^ daviid: sneek: later tell mitigate you should not set GUILE_AUTO_COMPILE=0 sneek: Will do. daviid: str1ngs: getting the spwanflags in g-golf is easy, I'll add those to g-golf right now, but here is how you do that - (gi-import-by-name "GLib" "SpawnFlags" #:with-methods? #f #:force? #t) daviid: str1ngs: the annotation 'bug' is only a problem if one once to pass NULL, (#f or %null-pointer), but we can still use that/those functions to make callback work in g-golf then ... but I need to understand what to do :) because according to the #instrospection folks, unlike I thought, I can't prepare and pass a GClosure str1ngs: daviid: would it be easier for me to just use (gi-import-by-name "GLib" "SpawnFlags" #:with-methods? #f #:force? #t) myself? daviid: str1ngs: no, i'll do that, just mentionning daviid: str1ngs: here is what they told me "in the case of the async APIs, there isn't (a closure API). you have to pass a function pointer to a C function, which uses ffi to get the C arguments off the stack, and translate them into values that you can pass to your user's scheme function" daviid: str1ngs: from that answer, it seems to me that what you pass i your C version, is one of the g_spawn_ function, is this correct? str1ngs: for my use case I really only need to pass #f or NULL here str1ngs: not to say that would'nt change but my use case is pretty trivial. I mainly just need this function to call. daviid: str1ngs: for all callback? exactly like in my 'template'? str1ngs: this is the C code http://git.savannah.nongnu.org/cgit/nomad.git/tree/typelib/util.c?h=feature-g-golf#n67 str1ngs: I should probably use FLAGS for the 0 argument here daviid: it's ok daviid: str1ngs: if you were to pass a callback, would you pass a pointer to a predeined Glib function then? str1ngs: I think the scheme way would to have a lamba here. but my guess is that would be really hard to impliment? daviid: str1ngs: I was asking in the C code you pasted str1ngs: what I would normally do here in C. is create a function with the a GSpawnChildSetupFunc signature. and then pass that function name. but I'll have to test that out to confirm this is theoretical daviid: str1ngs: ok, it is so weird that they do not provide a closre api, because now I have (as all other bindig of course, not just g-golf) to 'invent' a mechanism to do that, exactly that, ut not using what we have ... str1ngs: well I would not do it for my VTE sake it's not worth the work IMHO. what are other bindings doing do you know? daviid: str1ngs: but there are other callback arguments 'out there' str1ngs: though there is one spot it might be useful let me find it. daviid: this was just a way to think and test ... str1ngs: this is a more practical use case I think. https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#webkit-web-view-run-javascript str1ngs: GAsyncReadyCallback is probably used more often in API str1ngs: btw the CL GI bindings suffer from this problem too. daviid: str1ngs: by th way I can very easily patch g-golf so it parse the vte-terminal-spawn-async child-setup-data-destroy #f, and I was asked to report a bug to the vte team, I won't becaue they don't use an email workflow, they use a web bug report workflow ... would you like to do that? str1ngs: daviid str1ngs: daviid: I can report the annotation bug to the VTE team now I'm aware. daviid: str1ngs: either the vte-terminal-spawn-async or this webkit_web_view_run_javascript is a good example - the problem is to come up with a solution for all ... or to manually bind a C signature function 'on demand' ... daviid: str1ngs: thy said 'it seems like an annotation bug', the person is a gnome developer, but not a member of the vte team ... str1ngs: I'll check the annotation if that's the case and it gets fixed I'm assuming #f would then work there? daviid: str1ngs: yes, note that (a) the typelib does not report it as 'allow-none', (b) the doc also does not mention 'allow-none' althogh the doc comment says '... or NULL' daviid: in the mean time, I'll patch g-golf right noe to accept it as an exception daviid: and import the spawnflags str1ngs: okay thank you. str1ngs: daviid: here is revised C version using GSpawnChildSetupFunc. http://paste.debian.net/1144861 str1ngs: it's slightly more complete. maybe I should test VteTerminalSpawnAsyncCallback too str1ngs: BTW printf ("Starting Terminal\n"); prints to the widgets terminal which is intresting. daviid: str1ngs: ok, yes it's interesting to 'doubl test' it works str1ngs: I think GAsyncReadyCallback is more useful to g-golf as a whole. though I use VTE I can get around these corner cases with C if I have too. using a typelib and g-golf . daviid: str1ngs: then a webkit_web_view_run_javascript example, later, would be nice as well ... daviid: str1ngs: to come up with a general solution, g-golf needs to analyse its callback (the GI info) argument, then generate a C function with that signature, I'm not sure how to do that str1ngs: I hear ya, this is not easy to sovve. did #introspection talk about how other GI bindings solve this ? str1ngs: solve* daviid: str1ngs: the person had to leave, sothe conversation ended with the suggestion I pasted above "in the case of the async APIs, there isn't (a closure API). you have to pass a function pointer to a C function, which uses ffi to get the C arguments off the stack, and translate them into values that you can pass to your user's scheme function" daviid: I wonder what guile-gi does str1ngs: or pygobject str1ngs: I'm just putting a GAsyncReadyCallback example together in scheme. daviid: yes or pygobject - good for the GAsyncReadyCallback example ... we'll use it str1ngs: here the scheme JS example. http://paste.debian.net/1144866 str1ngs: this is the simple version does not use a callback. but this should get you started I think? str1ngs: this throws the 'match-error can't find pattern callback str1ngs: I just pull I'm 18 commits behind :( daviid: str1ngs: ok, I jut pushed a patch and now the vte-terminal.scm script I did paste erlier todat works fine daviid: str1ngs: please pull, make and test ... :) daviid: str1ngs: I don't think the CL bindings were/are complete - the guile-gi author is absent these days, I hope he's fine ... str1ngs: daviid: great thanks will check it out first thing in the morning. daviid: ok daviid: this webkit-web-view-run-javascript is complete? daviid: *this paste daviid: str1ngs: this works - https://paste.debian.net/1144870/ - it will be a good example to further work this callback problem, so now we have two examples to play with ... gypsydave5: Quick question about mutable lists - (set-cdr! (cons 1 2) 3) works as expected, but (set-cdr! '(1 . 2) 3) complains that the argument isn't a mutable pair. What gives? RhodiumToad: pairs that are quoted in the expression aren't mutable RhodiumToad: since they're basically compiled constants gypsydave5: Perfect explanation RhodiumToad -- thanks! RhodiumToad: (as I understand it, anyway) dsmith-work: Hey Hi Howdy, Guilers guix-vits: sneek: botsnack sneek: :) z0d: was uniform-vector-read! removed from Guile? what can I use instead? str1ngs: sneek: later tell mitigate we merged emacys wip branch into master. thanks for letting us know about that. sneek: Okay. dsmith-work: z0d: Always check NEWS for language changes: dsmith-work: *** `uniform-vector-read!' and `uniform-vector-write' have been dsmith-work: removed. Use `get-bytevector-n!' and `put-bytevector' from (rnrs io dsmith-work: ports) instead. z0d: dsmith-work: thanks str1ngs: hello daviid, just a request for comments here. it looks like to me that now takes a for the #:application #:init-keyword before it took the !g-inst pointer. does this sound right to you? str1ngs: I made API change in Nomad and seems to be working. daviid: str1ngs: it should definitely accept an instance of the type of it proerty, I guess it was a bug that has been fixed - I patched the instance contruction for interfaces ... str1ngs: gotcha, it's working nicely thanks. do you have a link to your vte example. I forget to add it to my notes. str1ngs: daviid found the link in logs. daviid: so after those patches, you may do (make #:model store) - instead of gtk-tre-view-new/set its model ... and retrieve the model as an instance, (!model a-tree-view) -> an instance of the class tht was used to create to tree-view ... daviid: ok, those links die after some hours, days ... as you know str1ngs: okay good to know, I'm not using modal right now. I got the gnome link thinks str1ngs: thanks* str1ngs: I will probably use modal at some point. so thanks for the details str1ngs: also regards to VTE some time ago it was suggested to use spawn async but that is still not listed as stable API which is wired. so wondering if we should worry about VTE at all? str1ngs: weird* rlb: dsmith: thanks, actually didn't remember offhand. str1ngs: daviid: calling vte-terminal-spawn-async works well now thank. without using callbacks of course. daviid: str1ngs: I used the vte example because you use it, and now it's one of the example we have to further implement callbacks ... I also told the #introspection person that helped me with this that I did ask you to report the bug ... str1ngs: daviid: I will check the annotation and report that now. str1ngs: did you need any further examples for webkit-web-view-run-javascript. the example I used was minimal I planed to extended it for callback later. which does not need to show a GUI to test. thought not a practical example. daviid: str1ngs: did you see the run-javascript latest paste I posted yesterday? str1ngs: I'll check that, I'll find it on http://logs.guix.gnu.org/guile/ str1ngs: webkit-web-view-run-javascript does work now, have not testing callbacks which is probably WIP? daviid: oh, we passed each other - no 'real' callback will work, since there is no protocol provided by GI daviid: I have no idea what I should do about this str1ngs: no problem, this is better then before. justin_smith: is it possible to attach a custom write implementation to a lambda? str1ngs: daviid: personally I don't need it because I can use the web extension via web messaging which is asynchronous . but that does not help regular users. daviid: str1ngs: do you know pygobject? i'd like to know what they do, if they do provide a callback solution that is 'general' str1ngs: daviid: I can look at pygobject for this senerio. My python is weak, but I should be able to grasp the C parts str1ngs: let me try to report this annotation issue. then I'll get a pygobject example going and try to figure out how it handles async call backs. daviid: str1ngs: I'll ask on #introspection, I did ask actually, but wantd to know if you dod know 'enough' about pugobject ... to help, no worries str1ngs: daviid https://gitlab.gnome.org/GNOME/gjs/ might be better reference since it's a GNOME project. str1ngs: in terms of asking how something is implimented. daviid: they point me to gjs regurlarly ... but they didn't (yey) in this case str1ngs: https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/function.cpp#L204 str1ngs: gjs_callback_closure seem to do the FFI argument lookup daviid: str1ngs: your C knowledge might b a better help daviid: take this vte callback example, your lambda that displays something i the terminal - how do we 'turn that a C function' that w can pass it ... str1ngs: GSpawnChildSetupFunc is probably not the hard. but maybe you mean VteTerminalSpawnAsyncCallback? daviid: str1ngs: anyone, the mechanism ... not a specific 'case str1ngs: gotcha, I thought GAsyncReadyCallback from webkit_web_view_run_javascript would be more practical to work on. since we know the API is more stable atleast. daviid: you have a lambda, any args, a C 'engine' will call it, how do you prepare the C function from scheme ... is the question daviid: str1ngs: forget about g-golf/gi, daviid: that is not the roblem str1ngs: makes sense, I will think on this. daviid: right, they pointed me to this code - https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/function.cpp#L197-507 str1ngs: aye that's the code that I thought handled this. daviid: I don't spot the part that 'writes' the C function str1ngs: maybe we can distill the gjs parts out daviid: its a guile ffi problem, not a g-golf/gi problem daviid: how to write a C function given a tempete (i cn give the tmplate) daviid: *template daviid: dynalically of course, otherwise we can write C function manually 'on-demand' ... :):) daviid: and here is a good example - a lambda that takes one argument, it is a pointer which can be NULL - how do we dynamically write a C function that can be called by a C 'engine' str1ngs: here GjsCallbackTrampoline seems to be built up to provide the function daviid: str1ngs: are you on #introspection? daviid: they are answering there ... str1ngs: one sec I'll connect to my znc daviid: i don't thnk it's logged str1ngs: I have a back log, reading now str1ngs: daviid: from the sounds of it there is enough in gjs_callback_closure to figure this out. but it will take more groking. particularly need to look at GjsCallbackTrampoline str1ngs: daviid: this is a very top down pseudo way to do this I think. g-golf would have a C function like gjs_callback_closure. this is called when the callback is needed. this gets all of the arguments converts them to scheme types. then calls the void *data which is the lambda with the scheme arguments. this is might be overly simplified but I think is basically how this would be done in g-golf. WDYT wingo: moo sneek: Welcome back wingo, you have 1 message! sneek: wingo, dsmith says: How does guile-cairo get at guile-snarf-docs and guile_filter_doc_snarfage which are not normaly installed? wingo: dsmith: iirc that was meant to be run only by the package maintainer. but it has been a long time, perhaps daviid knows more there wingo: civodul: hey did you see i pushed the new compiler :) not hooked up to anything yet tho wingo: is much like the old tree-il -> glil compiler; better handling of lexicals (no penalty for naming a value), worse handling of contification (something better left to cps) wingo: only tested in the most cursory of ways tho :P daviid: wingo: maybe you meant lloda`, because wrt guile-cairo, I've always been a mere user :) and none of my projects use guile-snarf-docs, so I wouldn't know *: wingo stands corrected wingo: my memory is a sieve these days :P daviid: wingo: it's ok, mine to :):) daviid: it's terrible wingo: yeah. accept the things you can't change, etc.. justin_smith: repeating a question from 2.5 hrs ago that might have been missed in scrollback - is it possible to attach a custom write implementation to a lambda? wingo: justin_smith: don't think so, it's kinda baked in justin_smith: OK, in that case I'll use a helper (lambda closed over hash table from proc to printer) thanks dsmith-work: wingo: Still, lots of extensions use the snarfing machinery. Would be nice if the doc-snarfing part of that was also available. wingo: justin_smith: yeah makes sense justin_smith: call it something like write+ and replace the calls to write that matter wingo: dsmith-work: you're not wrong :) i hesitate to maintain & document such a thing in guile itself tho civodul: wingo: i didn't! civodul: woow civodul: lemme see civodul: wingo: neat! civodul: the bit about adding high-level intrinsics is interesting wingo: yeah, could apply to CPS at lower optimizations levels also; dunno wingo: not sure what the tradeoff is wingo: anyway for guix packages i am pretty sure that skipping CPS is the right thing wingo: the baseline code is quite good on simple cases imo civodul: so eventually -O0/-O1 would automatically pick the baseline compiler, right? wingo: civodul: yeah civodul: cool civodul: it's funny that it's a completely different path civodul: so the other -Oxyz flags would make no sense civodul: perhaps -Ocompilation-speed could select it or something civodul: so the missing bit is source location info mostly, right? dsmith-work: wingo: SO. How do you enable this new compiler? wingo: dsmith-work: not wired up currently :) you have to manually (load-thunk-from-memory (compile-bytecode (macroexpand exp) mod mod))) wingo: civodul: source location info is easy actually, just need to wire it up wingo: incidentally i am not jealous about this thing, i plan no big changes other than bug fixes, so plz feel free to hack on it *: wingo zzz civodul: wingo: noted, thanks! lafrenierejm: Does guile have anything like clojure's comment function? lafrenierejm: Or does one have to comment out by line using ;;? mwette: do you mean #;(this is an expression which is commented out) mwette: you can comment-out multiple lines with #| ... |# lafrenierejm: mwette: The first one is exactly what I meant! Thanks so much! lafrenierejm: mwette: Where in the documentation could I have found that out? I'm just starting to work in Guile, and I'm pretty lost. cyclopsian: lfam: that SRFI looks like the best reference, the only difference in guile's implementation is that it adds a path separator in between lafrenierejm: Does guile have an equivalent of clojure or hy's threading macros? Aurora_iz_kosmos: SRFI-62, in the manual. "S-expression comments" was the thing. Aurora_iz_kosmos: It'd really be nice to have those SRFIs actually in the manual rather than only hotlinked though. lafrenierejm: Aurora_iz_kosmos: Was that addressed to me? Or lfam and cyclopsian? Aurora_iz_kosmos: lafrenierejm: Part indicating where it is was aimed at you, complaint about hotlinking was a general thing. Aurora_iz_kosmos: lafrenierejm: The fact it's only linked means you simply couldn't find it in the manual. lafrenierejm: Aurora_iz_kosmos: Got it. TY. dsmith: lfam: I think "vicinity" was an attempt at an abstract way of saying "directory" or "folder". mwette: lafrenierejm: I would have expected it to be in the "comments" section of the manual https://www.gnu.org/software/guile/manual/guile.html#Scheme-Read, but it's not. I could not find it, but I'm pretty sure it's in the manual. mwette: SRFI-62, Section &.5.36. dsmith: sneek: later ask wingo How does guile-cairo get at guile-snarf-docs and guile_filter_doc_snarfage which are not normaly installed? sneek: Will do. cyclopsian: I tried to build the guile-cairo docs and it wouldn't work until I copied those scripts manually from libguile cyclopsian: And even then it still fails because it uses the wrong script (guile-snarf-docs-texi instead of guild snarf-check-and-output-texi) cyclopsian: And even then, the help still doesn't load because documentation-files is not being correctly appended to cyclopsian: :/ tohoyn: guile 3.0.2 gives warnings like "imported module xxx overrides core binding yyy". is it possible to get rid of them? RhodiumToad: is the relevant module using #:replace ? tohoyn: RhodiumToad: The modules are (srfi srfi-1) and (rnrs exceptions) RhodiumToad: I don't get that warning? tohoyn: looks like srfi-1 has "replace" for map-in-order but I still get the warning RhodiumToad: you're sure it's loading the correct file? RhodiumToad: I get nothing RhodiumToad: (use-modules (srfi srfi-1)) in the guile3 repl and I just get the prompt back, no output tohoyn: ok. I'll check. tohoyn: no warning tohoyn: it's probably a problem in my source code RhodiumToad: are you tweaking the load-path at all? tohoyn: yes tohoyn: I set GUILE_LOAD_PATH to point to my own source directory weinholt: civodul, in case you're still searching for a d-bus library, i've whipped up one with just the fundamentals: https://gitlab.com/weinholt/ac-d-bus civodul: weinholt: oh excellent, thank you! civodul: funny name :-) civodul: and that's brand new, right? weinholt: yes, fresh from the editor civodul: heheh, good stis: tja guilers! manumanumanu: tja stis! manumanumanu: tjabba, even. civodul: weinholt: pushed a Guix package for guile-ac-d-bus :-) stis: nice! weinholt: civodul, that was fast! mitigate: I'm trying to use guile-lib for the first time: I installed it in gentoo without doing anything special - but guile doesn't seem to find the modules. For eg. configure.ac checks fail. doing a (use-modules (debugging assert)) fails - and guile is installed mitigate: is there some config needed to get guile to load the module from say /usr/share/guile-lib/debugging/assert.scm, or from /usr/lib64/guile-lib/guile/2.2/site-ccache/debugging/assert.go mitigate: all i get is a (scm-error misc-error #f "~A ~S" ("no code for module" (# #)) #f) mitigate: I guess I could do a export GUILE_LOAD_PATH=/usr/share/guile-lib - that works but it puts stuff in ~/.cache/guile/ccache. but GUILE_COMPILED_PATH=/usr/lib64/guile-lib/ or GUILE_COMPILED_PATH=/usr/lib64/guile-lib/guile/2.2/site-ccache/ doesn't work daviid: mitigate: did yu manually install guile-lib or you're using a gentoo package? mitigate: i was using the gentoo package ("ebuild") mitigate: but then all the users have to agree to the copyright mitigate: misfire daviid: mitigate: so it is not a guile-lib gentoo package mitigate: how is it supposed to work daviid: well if it was a distro package, like debian or guix have a guile-lib package, not being able to use the package module(s) would be a distro bug, which is why I asked daviid: if yu manually installed guile-lib, yo need to know where the source code module have been installed and add that path to GUILE_LOAD_PATH mitigate: are the distros expected to set GUILE_LOAD_PATH (as I said above) for the user when installing guile-lib ? daviid: well, as i said, if yu did 'gentoo-install guile-lib' no, but if guile-lib is not a gentoo package, then yes daviid: so it appears there is no gentoo guile-lib package? but i'm not familiar with gentoo mitigate: the recipe isnt doing anything special. how does debian do it daviid: apt-get install guile-lib daviid: mitigate: where are the guile-lib installed on your machine? mitigate: i noted the locations above ^^ mitigate: i dont have debian. do you? daviid: mitigate: i was just using debian as an example, it doesn't matter mitigate: yeah it doesnt matter what distro -the question is how it is supposed to work daviid: this should work export GUILE_LOAD_PATH=/usr/share/guile-lib mitigate: i mentioned that above. daviid: well it should not complain then mitigate: i mentioned a problem with that above. mitigate: it is not using the compiled package from the guile-lib's make install daviid: i don't think guile-lib does install the compiled module, but i don't remember mitigate: sigh daviid: mitigate: that is not a problem :) it just means that it will comple those for you (on a per user bses) at first attemt to use its modules ... mitigate: Guile-Lib version 0.2.6.1: The script pre-inst-env.in has been fixed so it properly sets GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH mitigate: you posted that item on savannah! daviid: hum, let me check :) mitigate: i'm out of time. i'll check again later daviid: mitigate: i don't know what gentoo ebuild does, but if you use the autotool chain, _and_ specify --with-guile-site=yes as a configure option, then yes, it will use guile's sitccache directory for te compiled modules daviid: and guile's global site dir for the ource modules daviid: sneek: later tell mitigate I don't know what gentoo ebuild does, but if you use the autotool chain, _and_ specify --with-guile-site=yes as a configure option, then yes, it will use guile's (global) site dir for the source modules and guile's siteccache dir for the compiled modules, and in that case, you, a a user, dont ned to do anything tbe able to use guile'lib's modules and they all should be (pre)compiled sneek: Got it. rlb: hmm, I imagine this might be intentional, but just noticed that (@ (foo) ...) in a file anywhere will cause a (resolve-module '(foo)) at startup, creating a potentially empty/dummy module, even if the @ ref is inside a function that's never called. Was fairly mystified for a bit, but I "fixed" my issue by changing it to an explicit (module-ref (resolve-module ...) ...). civodul: rlb: i think @ does resolve-module #:ensure #f rlb: civodul: it didn't appear to. rlb: but perhaps something else is/was going on -- have a bunch of other moving parts involved. But switching to the explicit resolve/ref *did* fix the problem. rlb: Also, was surprised it resolved when the module is loaded, as opposed to when the function is called... rlb: (the function containing the @ ref) iv-so: where can i read more about bytecode? iv-so: is it completely platform independent? rlb: No, but there are a limited number of "flavors". If you look in your ~/.cache/guile/ dir, you'll see what flavor your platform needs. rlb: And iirc the dist archive contains "all" the flavors precompiled. There are just a couple/handful, I think. iv-so: i am interested in cross-compiling guile libraries rlb: Hmm, well I'd assume that guile's "make dist" must know how to precompile all the flavors for ./modules/ , so maybe you'd be interested in something similar? rlb: ahh, another possibly relevant bit: "guild compile -h" lists the --target option. iv-so: wow, thanks rlb: certainly rlb: Might also be able to find the "list" of "all" targets or however guile does it by poking around in the Makefile.am's. daviid: str1ngs: I'd like to work callbacks, prepred a 'templte', here https://paste.gnome.org/pusrhf6to - but as it is, it fails, and that is (according to the GI introspection friends) a bug in the annotation for the function, for its child-setup-data-destroy, which manual says it may be NULL, but the annotation in the typelib, which I check in g-golf source code of course, says it cant daviid: str1ngs: so the question is, do you kow another function, that would not be part of an unstable lib/typelib that I could use to learn and implement what's missng in g-golf? I tried, an asked on introspection, but so far could not find any daviid: I tried GtkWindow, GtkApplication, CltterActor, GApplication, looking in their respective manual, but couldn't find any daviid: str1ngs: also, when clicking on the (manual entry) GSpawnChildSetupFunc for the child_setup argument, I get a 404 - do you happen to know where that doc is? daviid: though I really wish I cn find a simpler and stable function to learn and play with ... mbakke: iv-so: does %libgit2 in "$prefix/share/guile/site/3.0/git/config.scm" look correct? iv-so: mbakke: i am not sure, %libgit2 is /usr/lib/libgit2 iv-so: i think i understand now tohoyn: is it guaranteed that procedure abort-to-prompt never returns in guile 3.0? RhodiumToad: not at all RhodiumToad: abort-to-prompt passes its continuation to the handler, so it can return as many times as that continuation is later called RhodiumToad: e.g.: RhodiumToad: (define (foo) (abort-to-prompt 'x) (display "resumed after prompt")) RhodiumToad: (call-with-prompt 'x (lambda () (foo)) (lambda (cont) (cont) (cont) (cont))) RhodiumToad: which displays "resumed after prompt" 3 times tohoyn: ok. tx. RhodiumToad: as an optimization, there's apparently a check for whether the handler is a lambda expression that doesn't reference the continuation arg; since in that case the abort is guaranteed _not_ to return, the continuation doesn't need to be preserved tohoyn: ok. I've got that situation. rgherdt: Hi all. I'm getting an error when including any file by relative paths: "attempt to include relative file name but could not determine base dir" rgherdt: this is on Guile 3.0.2, manually compiled on Debian Stable rgherdt: any idea? rgherdt: by the way, the command is: (include "test.scm") RhodiumToad: (include) is relative to the location of the file that called it. if you're calling it from the repl, there's no file for it to be relative to RhodiumToad: i.e. if /foo/bar.scm contains (include "baz/quux.scm") then that includes /foo/baz/quux.scm regardless of the process current dir at the time RhodiumToad: maybe you're looking for (load) rgherdt: RhodiumToad: many thanks. I'm getting the problem while evaluating it in emacs. I defined a library in a .sld file which includes an implementation file (using R7RS syntax) and tryied to evaluate it. That was the problem, loading the .sld solved it. Thanks a lot. tohoyn: is it possible to define a variable in a guile module so that if the value of the variable is set in another module the binding of the variable in the original module will change too? tohoyn: if I define (define-module (test1) #:export (myproc1 myproc2)) and myproc2 uses myproc1 I would like to have the binding of myproc1 in myproc2 if the value of myproc1 is set in another module. tohoyn: binding of myproc1 in myproc2 to change if the value of myproc1 is set in another module RhodiumToad: are you using guile3? tohoyn: yes RhodiumToad: I think you need to declare the module to be non-declarative to do that tohoyn: I'll try RhodiumToad: basically, read the stuff in the 3.0 docs about declarative modules tohoyn: ok. tx. tohoyn: It seems that I have two source code files A.scm and B.scm so that A defines a global variable VAR and B changes that the binding of VAR in A is unchanged. can this be changed? RhodiumToad: did you even read what I just wrote? tohoyn: yes but A and B are not modules tohoyn: just source code files RhodiumToad: how are you loading them? tohoyn: loaded with "load" or "load-compiled" RhodiumToad: can't reproduce that RhodiumToad: if I have a.scm with (define A 123) (define (get-A) A) and b.scm with (define A 456) then after loading b.scm, (get-A) does indeed return 456 tohoyn: ok. I probably have some bug in my code. mwette: o/ civodul: hey mwette cyclopsian: Hi everyone, I have a Guile extension written partly in C and partly in Scheme and I have been writing docstrings. Are there any doxygen-like tools to extract those docstrings into a nice texinfo manual for an API reference like in the guile documentation, or do I have to copy them manually into a separate texi file? cyclopsian: Worst case, if nothing else exists, I plan to write a small script to iterate the module and extract the docstrings. Aurora_iz_kosmos: I'm not aware of any. Oddly-enough. dsmith: cyclopsian: The C doc snarfer that's in the guile sources is not installed. mwette: cyclopsian: Are you tlking about the c or scm files? mwette: In my scm files I write comments before each function in texinfo. Then I use an emacs sub-mode I wrote to convert to text to include in Guile docstring. See https://paste.debian.net/1144359/ and https://github.com/mwette/guile-contrib/blob/master/scheme-texidoc.el mwette: I have a script that scans through scm files and extracts the sequence of comment-lines that start with `;; @'. However, I have not been using this extensively. mwette: The emacs sub-mode extracts the texinfo source and runs through "texi2any --plaintext" and stuffs that into the procedure code. mwette: The emacs code is not super-robust (yet). cyclopsian: That's really close and I probably should have done that. I did it in the reverse and all my procedures have the docstrings in the code already, but no comments Aurora_iz_kosmos: First field as command is sorta de-facto standard way to make docs in Guile. Aurora_iz_kosmos: s/command/string-comment/ cyclopsian: I have them like SCM_DEFINE(..., "docs here") { } and (define (f x) "docs here" x) cyclopsian: And "docs here" is filled in already Aurora_iz_kosmos: Yeah, (define (f x) "much comment very info" x) is the standard way. mwette: Yes. And at the Guile prompt if you type `,d f' you see "much comment very info" displayed. My (incomplete) emacs approach makes that comment nicely formatted. mwette: here is a more elaborate example: https://paste.debian.net/1144364/ Aurora_iz_kosmos: Unfortunately I know too little about parsers to really comment on that. dsmith: cyclopsian: With the C SCM_DEFINE macros, you run a separete preprocessor pass that expands those macros into files with funky indicators. Then there are a few C progs (in lex?) that munge those into the .text help files that guile uses. dsmith: cyclopsian: See the guile-cairo project. cyclopsian: Thanks. I did some grepping and module/scripts/doc-snarf.scm seems to do parts of it dsmith: cyclopsian: http://git.savannah.nongnu.org/cgit/guile-cairo.git/tree/guile-cairo/Makefile.am#n46 lfam: I'm curious, what is the 'in-vicinity' procedure. Or more generally, what is the concept of "vicinity" in Scheme? lfam: Should I just read SRFI-59? anadon: I sent this to John Cowen, but maybe a few people here could also comment. I'm trying to consider a general use case of a Guile file describing a datastructure which spans something obscenely large -- say 100's on TB. So big that is actually can only exist across multiple systems each of which only have some chunks of it. Then also say that there are multiple readers/writers acting on this said file which need to be able to access inde anadon: xed or referenced data efficiently and not with linear parsing of the entire thing. How might I think about or solve this problem? anadon: My best thought is to put in some reference in the place of a subtree when it gets too big. Then when a given subsubtree becomes too large to parse or index efficiently to apply a similar reference and put that data into a new further down. Then for normal lists which become too large, have a seperate data structure to have ranges of indecies put into sub-trees for that portion of the now split list, and have that tree structure handle anadon: what were flat datastructures. But this has to have been solved by someone before. RhodiumToad: the structure as a whole is linearly addressed? anadon: RhodiumToad: I'm assuming in 100TB of a file that there would be 1D parts which are large enough to need to be split. anadon: A general case "how do I handle stupid large files" RhodiumToad: I swear I've seen something describing the use of just such a sparse object, but I'm drawing a blank on what it was anadon: I figure I can't have been the only one to run face first into this. Just, I have no idea how to find their work. daviid: anadon: https://en.wikipedia.org/wiki/Hierarchical_Data_Format daviid: if it hellp ... not guile related obviously daviid: *helps rlb: wingo: make-regex isn't exported from (ice-9 regex) even though it's documented? *: rlb is surprised no one's noticed if he's not missing something. rlb: i.e. with 3.0.2 (use-modules ((ice-9 regex) #:select (make-regexp))) crashes here. rlb: s/make-regex/make-regexp/ anadon: daviid: That's a side effort, and one that I find knee-capped. dsmith-work: rlb: I've been using it (without #:select) with no problem. rlb: Does it work with the #:select for you (if you have time to try)? dsmith-work: Fails when using #:select dsmith-work: While compiling expression: dsmith-work: In procedure resolve-interface: no binding `make-regexp' in module (ice-9 regex) rlb: I'm guessing it's missing an export somewhere... rlb: Though don't know offhand why it works in the non-select case, if so. dsmith-work: scheme@(guile-user)> (use-modules (ice-9 regex)) dsmith-work: scheme@(guile-user)> make-regexp dsmith-work: $1 = # dsmith-work: Because it dsmith-work: 's already in guile-user ? dsmith-work: It's available without the use-modules dsmith-work: s/ available/ already available/ rlb: hah, oh, well that might explain it rlb: I forgot to check that. rlb: Thanks. dsmith-work: !dump rlb: Since make-regexp is available by default, and regexp-substitute/global isn't, maybe it *is* a bug. Not sure, perhaps I didn't re-read the docs carefully enough. dsmith-work: rlb: Yeah, it's not clear from the manual that some regex things are not in the module (regexp? make-regexp regexp-exec and the regexp/{thing} flags) tohoyn: happy May 1st sneek: Welcome back tohoyn, you have 2 messages! sneek: tohoyn, wingo says: definitely a big sneek: tohoyn, wingo says: definitely a bug tohoyn: sneek: should I file a bug? dsmith: sneek: bugs? sneek: Someone once said bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile str1ngs: daviid: thanks daviid, will check it out. tohoyn: daviid: me too RhodiumToad: 3.0.2 is known to not work on armv7 ? wingo: RhodiumToad: depends on how the rest of the system is compiled. there is a bug tho in the jit; some patches not yet merged RhodiumToad: ok. building it for armv7 on freebsd (under qemu for speed) crashed for me wingo: https://gitlab.com/wingo/lightening/-/merge_requests/3 janneke: do we have a convention for writing changelog entries for goops methods, especially if they have several specializations? janneke: (foo): Add specialization for . janneke: (foo): In specializer, do blah. janneke: Hmm... janneke: what about: (foo)[]: Do blah. dsmith: RhodiumToad: That lightening MR *definitely* fixes the "Illegal instruction" failures I was having on armv7, both with -mthumb and -marm. However, dsmith: I would still get some segfaults. A different problem I think. dsmith: RhodiumToad: You can build without errors if you set GUILE_JIT_THRESHOLD=-1 (disables the jit) dsmith: (with or without the PR) manumanumanu: Hi guys! Anyone here familiar with texinfo? manumanumanu: I am getting some errors that are interfering with building from master under macos/homebrew manumanumanu: I can probabl correct them all, but I have a question about language: Does guile documentation use what I think is called the oxford comma? manumanumanu: blah, blah, and blah. Instead of: blah, blah and blah. dsmith-work: Happy Friday, Guilers!! dsmith-work: manumanumanu: I think ", and" from some simples grepping. dsmith-work: s/simples/simple/ manumanumanu: anyway, I am trying something else. I think I was to blame for the documentation error. The warnings are because of xref missing a comma afterwards (which for the two places were sane, even regarding the oxford comma). manumanumanu: Now bootstrapping to see if I really was to blame. If so I will probably go into hiding (even though noone else seems to be hit by this) manumanumanu: wingo: my srfi-171 patch broke installing on os x due to my malformed documentation. I am so sorry. A patch is on it's way to the mailing list in about 1 minute. wingo: np, i had't even noticed yet :) wingo: we all make mistakes :) wingo: tx for fixing manumanumanu: wingo: Patch coming whenever my email provider is up... Sorry again. dsmith-work: wingo: FWIW, I've not seen any problems with aarch64 dsmith-work: With the jit threshold at 0 wingo: dsmith-work: good to hear! *: wingo finishing new quick-and-dirty compiler... civodul: yay! :-) manumanumanu: wingo: Why? This sounds exciting! mwette: wingo: Sweet! Will the debugger provide better visiblity into variables? mwette: And I guess bootstrapping will be snappy fast. wingo: manumanumanu: is to reduce compile time & space. result will run slower than cps but compiler will run faster wingo: for -O0 and similar. i think debugging may be more straightforward also but that's a secondary thing. mwette: wingo: Thanks. dsmith-work: wingo: an since intel/amd is also fine, /me thinks those segfaults must be isolated to the armv7 jit code. rlb: civodul: if I understand correctly, wondering about the possibility of making GUILE_SYSTEM_EXTENSIONS_PATH "official", i.e. documenting it (or doing something else), so that projects that build on guile have a supported (when it's available) way to augment the load-extension/dynamic-link path. rlb: Or rather, some documented way to provide a dir with your own libs that should "come first" without having to change LD_LIBRARY_PATH. rlb: (which affects all subprocesses as mentioned in dynl.c) rlb: ...and better yet, some way to do that after guile starts up so that a (shell/env) wrapper isn't mandatory, e.g. (set! %system-extensions-path (cons ... %system-extensions-path)) as per %load-path. civodul: rlb: GUILE_SYSTEM_EXTENSIONS_PATH is really for Guile's own .so files civodul: so what we'd need is GUILE_EXTENSIONS_PATH civodul: but that'd be synonymous with LTDL_LIBRARY_PATH currently *: rlb would be quite happy with that :) civodul: (libtool's thing) rlb: It's not a critical concern right now, just wondered. rlb: i.e. I can just set LD_LIBRARY_PATH -- all the lib names are quite unique, but it might be nice to have a somewhat "cleaner" option like that. civodul: LTDL_LIBRARY_PATH is a bit cleaner than LD_LIBRARY_PATH, but yeah rlb: Good suggestion, thanks -- if nothing else, I'll switch to that. rlb: civodul: and it'd be nice to have %extensions-path too, so you can adjust it from within guile, and programs won't be required to have a shell/env wrapper. rlb: (if we were to add GUILE_EXTENSIONS_PATH) iv-so: has anyone here successfully used guile-git with guile 3.0? mbakke: iv-so: Guix uses it pretty heavily iv-so: ik, i am trying to package guix for my distro and am stuck with dysfunctional guile-git rn civodul: iv-so: how dysfunctional? does "make check" fails? civodul: *fail iv-so: like this: git/bindings.scm:66:8: In procedure git_libgit2_init: Function not implemented lfam: Hey, I've seen that too lfam: I was on Guix System, and I used `guix pull --core-updates`, then using that, built Guix from source. I saw that error later when trying to do `./pre-inst-env guix system reconfigure ...` mbakke: iv-so: in what context do you get that error? lfam: It went away after I built Guix from source using the master branch, and then reconfiguring mbakke: could be a GUILE_LOAD_PATH issue iv-so: mbakke: when i eval (use-modules (git)) for example dsmith: SO there must be something in the way bobot is starting that is hiding or removing the normal for-each. But I don't see other things going away.. dsmith: Odd. dsmith: Ya, for-each is in boot-9 RhodiumToad: very odd dsmith: Hmm. There is one in scheme/base.scm too alextee[m]: can jinja be used with guile? alextee[m]: i have a website that uses python and jinja but the more i use guile the more i want to convert everything! dsmith: sneek: paste? sneek: Someone once said paste is https://paste.debian.net z0d: hi z0d: how can I sort an alist by its cdr? RhodiumToad: what type are the cdrs? RhodiumToad: (sort my-alist (lambda (a b) (< (cdr a) (cdr b)))) or something along those lines, with a suitable comparison in place of < z0d: oh. I've read the docs on sort, but didn't see that you can specify an accessor z0d: thanks z0d: but makes sense emys: is there a context-manager like form in guile to change the current work directory for the execution scope emys: something like (with-current-work-dir "some/path" exprs ...) tohoyn: macro guard in guile-3.0 file module/ice-9/exceptions.scm uses raise-continuable in one place. what would it change if this was changed to raise? dsmith: emys: I don't think so. (apropos "with-") doesn't reveal anything. Probably wouldn't be to hard to make though. dsmith-work: Morning Greetings, Guilers rekado: emys: Guix (guix build utils) has with-directory-excursion. It uses dynamic-wind with chdir. wingo: i bet that's exciting in a multi-threaded environment :) tohoyn: should expression "(display (guard (exc ((integer? exc) "abc\n")) (raise 10))))" give output "abc"? tohoyn: for me it interrupts the program with signal 1 tohoyn: it works in guile 2.2.7 tohoyn: but not in guile 3.0.2 tohoyn: could somebody else check this with guile 3.0? mwette: unbound variable: guard mwette: where does that come from? tohoyn: mwette: (ice-9 exceptions) in guile 3.0 tohoyn: mwette: guile 2.2: (import (rnrs)) tohoyn: mwette: it works in 3.0 if you do (import (rnrs)). tohoyn: mwette: tx anyway mwette: 3.0.2 crashes w/ "User defined signal 1" mwette: w/ import rnrs: abc dsmith-work: https://paste.debian.net/1143954/ dsmith-work: Works for me. dsmith-work: Does get some warnings though. tohoyn: strange: (rnrs exceptions) seems to take the implementation of guard from ice-9 RhodiumToad: weren't there significant changes in this area for 3.0 with the aim of unifying the different exception mechanisms? dsmith-work: Ya, I heard something along those lines. dsmith-work: Errors in guile are often annoying. You see some format string and a bunch of args instead of a nice message. dsmith-work: I think the changes around handling exceptions are meant to improve that. dsmith-work: What's expecially annoying is printing some random error causes a much worse segfault or some other abort. wingo: sneek: later tell tohoyn definitely a big sneek: Got it. wingo: sneek: later tell tohoyn definitely a bug sneek: Okay. dsmith-work: sneek: seen civodul? sneek: civodul was last seen in #guix 5 hours and 2 minutes ago, saying: sorry for the delay!. RhodiumToad: is there / should there be a distinction between "seen X here?" and "seen X anywhere?" and which should be the default... dsmith-work: RhodiumToad: Hmm. dsmith-work: RhodiumToad: Currently only the very last message is saved. No matter what channel. dsmith-work: Wasn't ever an issue when the bot was only in #guile. dsmith-work: sneek: botsnack sneek: :) daviid: str1ngs: tohoyn, I pushed a patch that adds a high level api entry for (gdk_) events - a small doc reorganization actually, since its content was previously defined in 'Gdk - Events'. I am not entirely happy with the doc structure (and content, but that is none stop endless task ...) yet, but I think this tiny 'move' is going in the right direction alextee[m]: i want to call a proc on each element in a list, and i also want to know the index of the element in that proc. is there a function that does this? alextee[m]: or somehow pass both the element and the list in the proc, so i can calculate the index myself alextee[m]: maybe a named let would fit here RhodiumToad: do you need to return a constructed result? RhodiumToad: you could count the element index in a fold alextee[m]: no i just need to display it alextee[m]: oh fold looks like it would work here, thanks RhodiumToad: (fold (lambda (elem idx) (do-stuff elem) (1+ idx)) 0 mylist) RhodiumToad: or something of that ilk alextee[m]: thanks! RhodiumToad: obviously you could do it with a named-let but then you can do anything with a named-let daviid: I fixed/enhanced g-golf for (a) 'interface properties and (b) list-store/tree-model set/get value for 'object column type daviid: both fix illustrated in this example - https://paste.debian.net/1143648/ - line 37 for (a) and lines 36, 62, 65 67, 68 for (b) rlb: Is there a "Local Varables" setting to select the scheme "implementation" for scheme-mode? i.e. chicken vs guile vs...? rlb: (wrt emacs) rlb: s/Varables/Variables/ dsmith: rlb: I don't think so for bare scheme mode. But probably is for geiser. rlb: maybe that's what I'm seeing? rlb: (in the mode line) rlb: normally says Guile when you have #!/...guile, but doesn't if you need some mess that execs guile further down in the #!...!# block comment, and so I was trying to fix that. dsmith: rlb: geiser-guile--guess in geiser-guile.el rlb: dsmith: ahh, thanks. I'll take a look. str1ngs: I think the guile mode comes from geiser str1ngs: daviid: looks good daviid thanks. dsmith: rlb: file-local-variable: geiser-scheme-implementation dsmith: rlb: Thanks for the reminder. I was just wanting this the othe day. rlb: Hah, your welcome? (Thanks.) rlb: s/your/you're/ dsmith: https://www.nongnu.org/geiser/geiser_4.html#How-Geiser-associates-a-REPL-to-your-Scheme-buffer mwette: xb wingo: wow nice post on type inference in cps!!! http://seanplynch.com/blog/understanding-the-guile-type-inferencer.html alextee[m]: which module provides string-replace-substring? the manual doesn't mention alextee[m]: oh it does nvm alextee[m]: (use-modules (ice-9 string-fun)) alextee[m]: i still get "In procedure module-lookup: Unbound variable: string-replace-substring" RhodiumToad: where is it in the manual? alextee[m]: RhodiumToad: 6.6.5.12 Miscellaneous String Operations RhodiumToad: not seeing it RhodiumToad: in which version? alextee[m]: ah that's my local copy, maybe it's outdated alextee[m]: RhodiumToad: it's there RhodiumToad: for which version? alextee[m]: 6.6.5.12 Miscellaneous String Operations last part alextee[m]: https://www.gnu.org/software/guile/manual/guile.html#Miscellaneous-String-Operations alextee[m]: im using guile 2.2.7 btw, maybe this is for guile 3? RhodiumToad: yes RhodiumToad: it's new in guile3 RhodiumToad: or at least newer than 2.2.7 alextee[m]: ah i see. i'll copy this then https://lists.gnu.org/archive/html/guile-devel/2013-09/msg00029.html chrislck: this is a function with lots of history *: alextee[m] is writing a gsettings schema generator in guile: https://paste.debian.net/1143702/ alextee[m]: result so far: https://paste.debian.net/1143703/ alextee[m]: so much better than editing xml! chrislck: why not use sxml->xml ? alextee[m]: oh didnt know about that. not sure how that would work alextee[m]: looks pretty complicated rekado: alextee[m]: but it isn’t! rekado: it lets you convert an S-expression representation to valid XML rekado: (sxml->xml '(enum (@ (id "org.zrythm.Zrythm.audio-backend-enum")) (value (@ (nick "none") (value "0"))))) alextee[m]: oh! great! let me try that rekado: @ introduces attribute lists rekado: the rest is as you’d expect rekado: also remember to use quasiquotation and procedures to generate stuff alextee[m]: could probably use more compex examples in the manual *: alextee[m] has no idea what s-expressions or quasiquotations are chrislck: https://pastebin.com/DL4YTyvk rekado: quasiquote is the toggle switch rekado: ` means “data mode” rekado: , means “code mode” rekado: `(this is data but ,(+ 1 3 4) is code) rekado: an S-expression is just a fancy name for all of these parentheses and what they enclose. alextee[m]: chrislck: thanks! alextee[m]: oh i see chrislck: every guile prog is an s-expression alextee[m]: haven't consciously used ` or , yet so not sure how they work, although i see them in guix packages alextee[m]: so in the example above, this is an S-expression? '(enum (@ (id "org.zrythm.Zrythm.audio-backend-enum")) (value (@ (nick "none") (value "0")))) rekado: the example above is equivalent to '(this is data but 8 is code) rekado: alextee[m]: yes rekado: it’s just data rekado: a nested list chrislck: so is this: '(bla) chrislck: so is this: #f (I think) alextee[m]: ah i see chrislck: alextee is starting to see the matrix alextee[m]: :D the awakening *: chrislck read SXML and SSAX chapters several times to finally grasp it chrislck: using sxml will "guarantee" that your XML is well-formed RhodiumToad: eh. chrislck: ok it will be easier to write well-formed xml alextee[m]: doesn't look well-formatted to me: alextee[m]: probably needs some flags to change how it outputs things *: alextee[m] reads the SXML chapter RhodiumToad: well-formed, not well-formatted alextee[m]: oh vms14: Hi, I'm trying to load a gnome guile library in netbsd, but I don't know what I should do, I have the gnome libraries in a different location from the guile stuff and trying to add it with setting %load-compiled-path vms14: (set! %load-compiled-path (list "/usr/pkg/guile/2.2/lib/guile/2.2/ccache" "/usr/pkg/guile/2.2/lib/guile/2.2/site-ccache" "/usr/pkg/lib" "/usr/pkg/libguile-gnome-2/")) vms14: gnome stuff is in /usr/pkg/lib/libguile-gnome folder vms14: and guile stuff in /usr/pkg/guile/2.2/ it has a bunch of folders there like lib, man, include, share, bin and so on dsmith-work: Wednesday Greetings, Guilers vms14: but gtk.so is in /usr/pkg/lib/guile-gnome-2/libgw-guile-gnome-gtk.so vms14: how I'm supposed to load those paths? dsmith-work: vms14: I don't have an answer for you, but just be patient. Might take a day or so. RhodiumToad: vms14: did it install a gnome-2.scm in the guile "site" dir? RhodiumToad: vms14: I made a freebsd port for guile-gnome so I have some idea of what's going on RhodiumToad: the theory is that you should be able to import the (gnome-2) module and it sets up all the paths for you vms14: RhodiumToad: found it at /usr/pkg/share/guile-gnome-2/gnome/gw/gtk.scm RhodiumToad: no vms14: so I should try to add that to the path, but which "path" variable? %load-path/ RhodiumToad: where is gnome-2.scm vms14: /usr/pkg/share/guile/site/gnome-2.scm vms14: hmm RhodiumToad: right. so you should be able to just do: RhodiumToad: (use-modules (gnome-2) (gnome gtk) (gnome whatever...)) vms14: does not find the module vms14: it seems I have to add a bunch of folders to some paths RhodiumToad: what exactly is not found? RhodiumToad: and what is your load path before you mess with it? vms14: (use-modules (gnome-2)) vms14: While compiling expression: vms14: no code for module (gnome-2) vms14: "/usr/pkg/guile/2.2/lib/guile/2.2/ccache" "/usr/pkg/guile/2.2/lib/guile/2.2/site-ccache" vms14: that's the load path vms14: but the gnome wrapper stuff is installed in different paths RhodiumToad: that's %load-compiled-path ? what is %load-path ? vms14: ("/usr/pkg" "/home/vms/.emacs.d/elpa/geiser-20200426.2152/scheme/guile/" "/usr/pkg/guile/2.2/share/guile/2.2" "/usr/pkg/guile/2.2/share/guile/site/2.2" "/usr/pkg/guile/2.2/share/guile/site" "/usr/pkg/guile/2.2/share/guile") RhodiumToad: but not /usr/pkg/share/guile/site ? vms14: just that RhodiumToad: that looks like a somewhat confused default vms14: so, I've just need to add /usr/pkg/share/guile/site to load-path? RhodiumToad: yes vms14: it seems I'll have to add several folders to several load paths vms14: I'll try thanks RhodiumToad: no RhodiumToad: just add that one directory to that one path, nothing else vms14: ohhh, done vms14: thanks you so much vms14: <3 RhodiumToad: (my freebsd port of guile-gnome is blocked on a portmgr review, unfortunately, but I use it locally) vms14: you can switch to netbsd :D vms14: the team is really awesome *: RhodiumToad would rather not :-) vms14: :O *: vms14 cries *: dsmith-work ran netbsd on a cobalt qube for a while. RhodiumToad: the annoying thing about going a freebsd port for guile-gnome was having to patch the hell out of the autoconf script to make it respect --without-BLAH options dsmith-work: vms14: So how is guile on nbsd? vms14: dsmith-work: can't tell you really, just installed it, I don't even know scheme, I use common lisp with sbcl vms14: and I could say support for sbcl in netbsd is kinda bad :/ vms14: no thread support and most libraries using ffi won't work since they assume linux paths dsmith-work: Just curious becuse I know nbsd is very picky about posix things. No linux-isms there! vms14: usually in netbsd is a hell to install libraries in a not mainstream language since netbsd tends to separate in folders what it comes in base and what the user has installed RhodiumToad: hm, freebsd is no different in that respect? vms14: /usr/pkg is where your installed stuff goes, so you have /usr/lib and /usr/pkg/bin RhodiumToad: (just /usr/local rather than /usr/pkg) vms14: I should work on that someday and try to add a way to make languages find their libraries vms14: btw thanks for helping me with that civodul: wingo: i'm testing a trick to avoid malloc/free/dynwind in most cases for POSIX subrs that take a string civodul: https://paste.debian.net/1143749/ civodul: i'll post a patch & figures soon if that makes sense to you wingo: civodul: nice! do we have internal pointers enabled? wingo: otherwise returning a pointer into a string could be a hazard civodul: ah good point, we don't have internal pointers civodul: and STRINGBUF_CONTENTS is a pointer in the middle of the stringbuf civodul: but OTOH, for this use case, it's fine because the Scheme string outlives the C pointer returned civodul: WDYT? wingo: civodul: i am not so confident making the assertion that a C compiler wouldn't remove the SCM. depends on the use site but it's a bit iffy wingo: one of those occasions where what one would want is C++ with RAII :) dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen rlb sneek: rlb was last seen in #guile 18 hours ago, saying: s/your/you're/. dsmith-work: sneek: testing is Testing, Testing, One Two Three.. sneek: I'll keep that in mind. dsmith-work: sneek: testing? sneek: Someone once said testing is Testing, Testing, One Two Three.. dsmith-work: sneek: forget testing sneek: Consider it forgotten. dsmith-work: sneek: testing? dsmith-work: sneek: botsnack sneek: :) dsmith-work: goodbot *: sneek wags alextee[m]: is there a variant of (format) that returns the string instead of printing it? alextee[m]: oh #f civodul: wingo: hmm even if it were removed, the SCM is still in the VM stack no? wingo: civodul: that is not guaranteed. in practice though, yes. guix-vits: sneek: seen sneek? sneek: Sewni was in (here?) 7 months ago, saying: I didnt realise you were using the bot :P. dsmith-work: alextee[m]: Also can be a port, so you could pass a string port. Might be useful for building a string a piece at at time. guix-vits: sneek: seen sneek? sneek: Sewni was last seen in (here?) 7 months ago, saying: I didnt realise you were using the bot :P. *: guix-vits "ah, some sort of regex" dsmith-work: alextee[m]: I wouldn't be surprised if #f is implmented by printing to a string port internally and then returning the string. alextee[m]: so many ways to do things in scheme, fun civodul: wingo: ok, i've sent what i have to guile-devel + you! dsmith-work: Hah! dsmith-work: alextee[m]: Indeed, #f uses (open-output-string) dsmith-work: sneek: botsnack dsmith-work: sneek: botsnack sneek: :) dsmith-work: Interesting! dsmith-work: So the problem I was having with for-each being undefined goes away when using srfi-1 dsmith-work: (which also defines a for-each) someoneelse: sneek: later tell dsmith-work It's working. sneek: Got it. dsmith-work: Ok sneek: Welcome back dsmith-work, you have 1 message! sneek: dsmith-work, someoneelse says: It's working. mwette: janneke: You once asked for standalong CPP for C99. I'm working on standalone version plus, parser source for (system base lalr). The combination should be smaller footprint for you to work with, assuming you can compile (system base lalr). The new CPP will be token based versus the old string based one. janneke: mwette: oh that's very nice d4ryus: hi, about a week ago i repored a bug (#40681) but did not hear anything yet. Is this normal or should i do anything? wingo: d4ryus: is normal, we are a bit slow :) wingo: also, confinement &c d4ryus: ok, no rush :) tohoyn: daviid: I think that types should be accessed with their goops class names instead of symbols (e.g. arguments of gtk-list-store-newv) dsmith-work: {appropriate time} Greetings, Guilers dustyweb: o/ roelj: I'm getting "Value out of range -9223372036854775808 to 9223372036854775807: 18446744073709548016" upon calling ‘time-utc->date’. What's wrong here? roelj: Ah, this happens on a file with the unix epoch of 0 (produced by Guix). dsmith-work: Guix is wearing platforms and bell-bottoms.. str1ngs: groovy! manumanumanu: hello everyone sneek: Welcome back manumanumanu, you have 1 message! sneek: manumanumanu, seepel says: Here is the type inference blog post you asked about: http://seanplynch.com/blog/understanding-the-guile-type-inferencer.html. Hope it is helpful! civodul: woow civodul: sneek: later tell seepel awesome blog port about type inference in Guile! sneek: Got it. civodul: wingo: seen it? it's really nice! lloda: it shouldn't be possible to send format on a loop that cannot be C-c :-( manumanumanu: sneek: later tell seepel thanks! Love it! sneek: Will do. stis: manumanumanu: do you still have questions? stis: hello guilers btw! manumanumanu: hi stis! Sorry, i was afk for a thousand years, and didn't read the history. manumanumanu: I lost interest in what I was doing. I am porting parsack from racket, and apart from the syntax-parse macros, everything is really simple manumanumanu: I might have questions when I go back to it :D mwette: lloda: Try something like call-with-blocked-asyncs ? stis: k mwette: lloda: sorry, you want to unblock, call-with-unblocked-asyncs maybe? Not sure if that is what you are after. stis: yey new release of python on guile drakonis: python on guile? drakonis: you mean like an interpreter? stis: compiles to scheme stis: anf then further to go so you get jit goodies stis: there are also macros soo that you can play pythin in scheme if you like civodul: mwette: your copyright assignment is on file, yay! \o/ mwette: civodul: got the news, too. I'm free to throw more patches. civodul: mwette: yup, now we'll have to review fast enough, uh! tohoyn: daviid: you said there are no struct or union type in g-golf. however, when I display an GdkEvent it says #< 56044fc938a0> sneek: Welcome back tohoyn, you have 5 messages! sneek: tohoyn, daviid says: I fixed the bitwise ops multiple modules import warning - although I didn't (ever) see it, I wonder why but any, fixed sneek: tohoyn, daviid says: you should use the accessors (which are actually not 'real' accessors, but that's an impleentation detail), not the 'long names' gdk-* procedures, which are not getters ... sneek: tohoyn, daviid says: you should not use g-golf 'internals', that part of the manual is for myself :), contributors and future maintainer(s) - as a user, you should use (g-golf), gi-import or (selectively import) gi-import-by-name, and then use the api that is defined/provided by the (type)lib(s) you are 'dealing' with sneek: tohoyn, daviid says: there is no struct/union type in g-golf sneek: tohoyn, daviid says: those are decoded as a list, a value or a pointer if it is opaque tohoyn: sneek: tx tohoyn: daviid: whatever is (value?) are types like that disjoint? TvCvRuy007: test TvCvRuy007: sneek: botsnack sneek: :) chrislck: sneek: is a good bot sneek: chrislck, you have 1 message! sneek: chrislck, dsmith-work says: Watch out. (eq!) will eval every espression, but (and) might not. chrislck: dsmith-work: oh that's true... dsmith: Also evals the eXpressions civodul: hmm what's the name of 'filter' in elisp? tohoyn: daviid: it would be good for Theme-D if you could obtain the types of the properties. BTW, setters use class as the type of the value set currently. rekado_: civodul: cl-remove? civodul: rekado: ah, could be, thanks! civodul: i have a Cairo surface and i'd like to turn that into a PDF civodul: (using Guile-Cairo) civodul: does anyone have experience with that? mwette: imagemagick methinks. cairo also has PDF i/f IIRC civodul: yes it does, but i don't quite understand the API mwette: ImageMagick has "convert" tool that convert among png, pdf, etc. Or do you want to use the cairo API? civodul: yeah i really want to use Cairo, via Guile-Charting mwette: I don't use that, but via ffi helper used cairo_image_surface_create. I see cairo_pdf_surface_create. Do those appear in the Guile-Charting API? dale`: Is there somebody here who can advise where to discuss new module development? civodul: mwette: i eventually found how to do it! civodul: i'm using Guile-Charting, which uses the Guile-Cairo bindings civodul: and yes, it provides bindings for cairo_pdf_surface_create dale`: Hmmm.... When creating a new module, is it best to target ice-9, or to engage with the SRFI or RNRS people first? tohoyn: dale: AFAIK ice-9 is limited to guile dale`: Yep, I get that, but that's good enough for my purposes dale`: Does anybody know the best time of day to come in here? RhodiumToad: from my logs, it's usually reasonably quiet, but only about 23:00-05:00 UTC stands out as a particularly slack time RhodiumToad: bah, they left tohoyn: dale: I usually use RnRS compatible procedures if they are available dsmith-work: I *think* dale` was meaning creating a new module. Should it be in ice-9 or srfi or rnrs? rekado: I would hope that nothing will be added to ice-9 g0d_shatter: hey all, I just got an interesting error while hand installing gdb on the latest kali g0d_shatter: https://dpaste.org/1PeH g0d_shatter: thats from just starting gdb w/o any file under target g0d_shatter: and this is trying a couple of guile expressions in the repl https://dpaste.org/Ruzu g0d_shatter: fwiw I've gotten this now on two different machines with kali g0d_shatter: this is the set of options I used with configure https://dpaste.org/xpmk g0d_shatter: if anyone has any ideas on what I can do to remedy this I'd be mighty appreciative! dsmith-work: Something to always look for: Do you have more than one guile installed? Like from os package and also from source? dsmith-work: g0d_shatter: ^^ g0d_shatter: yes! g0d_shatter: I do, I have guile-3.0 as well, from os package g0d_shatter: do you think I should try removing and recompiling w/o the other guile? g0d_shatter: dsmith-work: ^^ dsmith-work: You could try running gdb under "strace -efile" and see if the files its trying to open are the ones you expect. dsmith-work: You *can* have parallel installs of guile, but only on major verisons. So, you can't have 3.0.1 and 3.0.2 installed at the same time. dsmith-work: Also, if you installed from source, it's probably in /usr/local ? Might be finding the system one first? g0d_shatter: Not sure on that last bit, I compiled with --prefix=/usr, so that would rule that one out, no? I'll try running strace now and see what I get dsmith-work: In general, it would be best if you only have one guile version installed. *: wingo starts work on wee baseline compiler for guile dsmith-work: !! dsmith-work: wingo: Have been able to check out that lightening PR yet? wingo: yes it looks good!! wingo: i should just apply it dsmith-work: Cool dsmith-work: wingo: I still get errors occasionaly and solidly with threshold=0. dsmith-work: I need to try aarch64 wingo: will look into it wingo: on my list. dsmith-work: Cool! (I did file a bug with some backtraces. Hope that can help) g0d_shatter: dsmith-work: thanks for your help earlier, that solved the problem completely dsmith-work: Np. Glad to help. rlb: Anyone know if mcron is still active? https://savannah.gnu.org/projects/mcron/ At least right now, the git repo link there is broken (500 bad gateway): https://git.savannah.gnu.org/cgit/mcron.git rlb: (Next on my list of NMUs I might need to make to get 2.0 out of debian testing.) bandali: rlb, there was an mcron release very recently https://lists.gnu.org/archive/html/info-gnu/2020-04/msg00002.html bandali: and both your links work, at least as of now bandali: probably a temporary server-side issue rlb: bandali: thanks rlb: I suppose I'll just see if I can NMU the existing debian version for now, as opposed to considering removal. bandali: cheers tohoyn: daviid: radio menu items don't work. see https://paste.debian.net/1143050/ . guix-vits: the Manual: "For details on how these forms work, see See Lambda." ; two see rndd: hi everyone! newbe question! how to parse html using guile? mwette: rndd: guile-lib (https://savannah.nongnu.org/projects/guile-lib) has htmlprag rndd: mwette: thanks tohoyn: how do I make a GNU license notices at the beginnings of the files if the package uses GPL, LGPL, and GFDL? tohoyn: und tohoyn: Savannah suggests a license notice containing: "GNU package is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation..." tohoyn: already answered on #gnu terpri: any suggestions for doing regexp-replacements (or even just string search) on binary data? for guix packaging, i'm trying to implement the offset-patching algorithm from https://github.com/NixOS/nixpkgs/pull/48193/files terpri: the actual data to be munged consists of JS var declarations embedded in the binary file, but guile's regexp functions can't be used on strings containing NUL chars terpri: i suppose i could write my own regexp library rekado: terpri: you may find replace-store-references in (guix build grafts) interesting. terpri: thanks rekado, that looks useful dsmith: unknown_lamer: You around? dsmith: Problem: Too many processes on hydra-guix-119 Problem started at 20:37:03 on 2020.04.26 dsmith: (the above is a test. Please ignore) daviid: sneek: later tell tohoyn I fixed the bitwise ops multiple modules import warning - although I didn't (ever) see it, I wonder why but any, fixed sneek: Got it. daviid: sneek: later tell tohoyn you should use the accessors (which are actually not 'real' accessors, but that's an impleentation detail), not the 'long names' gdk-* procedures, which are not getters ... sneek: Got it. str1ngs: daviid: BTW there is one for map and guile 3.0. I just put off telling since you have probably been busy. :) dsmith: unknown_lamer: Nevermind. Found what I was looking for. daviid: str1ngs: a warning? daviid: str1ngs: i didn't think g-golf would work out of the box with guile-3.0, due to some use of @@, and declarative/none declaratice modules ... daviid: gule-cv also fails to build with guile-3, didn't have time to even look at it yet ... dsmith: civodul: Woo! Fixed it. civodul: yay! daviid: sneek: later tell tohoyn you should not use g-golf 'internals', that part of the manual is for myself :), contributors and future maintainer(s) - as a user, you should use (g-golf), gi-import or (selectively import) gi-import-by-name, and then use the api that is defined/provided by the (type)lib(s) you are 'dealing' with sneek: Got it. str1ngs: daviid: I just looked at it in passing. will be awhile before I revisit g-golf and guile 3.0. daviid: str1ngs: no problem, I will look at this, but after I reach an alpha release for 2.2.7 str1ngs: daviid: no worries. daviid: sneek: later tell tohyon from a user persepective, the type of the 'attached-to property is - if they (try to) pass anything else, it will raise an exception sneek: Got it. daviid: sneek: later tell tohoyn there is no struct/union type in g-golf sneek: Will do. daviid: sneek: later tell tohoyn those are decoded as a list, a value or a pointer if it is opaque sneek: Got it. msiism: Is it possible in guile (2.0) to load a file inside the repl by saying (load file_name)? RhodiumToad: dunno about 2.0 but it works in 2.2 msiism: Well, ,load worked for me now. *: msiism needs to upgrade his system sometime soon srandon111: catonano, how are you? catonano: srandon111: not that bad, after all. Thanks for your concern 😊️ catonano: srandon111: are you on the fediverse ? daviid: sneek: later tell tohoyn I pushed a patch that defines and documents two new !changed-mask and !new-window-state accessors - you may pull/make/install and test ... let me know if everything is ok sneek: Will do. gorf`: hey sneek: Welcome back gorf`, you have 1 message! sneek: gorf`, dsmith-work says: Testing Message dsmith: ok sneek: Welcome back dsmith, you have 2 messages! sneek: dsmith, dsmith-work says: This is a test sneek: dsmith, dsmith-work says: something daviid: sneek: later tell tohoyn wrt to your question about gtk_action_group_add_actions, I see it has been deprecated, here is what the manual says - "gtk_action_group_add_actions has been deprecated since version 3.10 and should not be used in newly-written code." - I guess it is not in the typelib anymore ... daviid: sneek: Okay. dsmith-work: ? srandon111: catonano, yes don't you remember you introduced me to mastodon dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: bugs? sneek: bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile dsmith-work: sneek: seen dsmith? sneek: I last saw dsmith in #guile 2 hours ago, saying: ok. rlb: Given guile-3.0 in testing, uploaded a make-guile to shift to it -- seems to have built OK on the release architectures. rlb: (wrt debian) tohoyn: daviid: g-golf pre-inst-env puts the same directory twice in variable GUILE_LOAD_PATH, e.g. "/home/tohoyn/git/g-golf:/home/tohoyn/git/g-golf" sneek: Welcome back tohoyn, you have 3 messages! sneek: tohoyn, daviid says: wrt the gtkbuilder - related bug, could you prepare a snipset, so I can reproduce locally. tx sneek: tohoyn, daviid says: I pushed a patch that defines and documents two new !changed-mask and !new-window-state accessors - you may pull/make/install and test ... let me know if everything is ok sneek: tohoyn, daviid says: wrt to your question about gtk_action_group_add_actions, I see it has been deprecated, here is what the manual says - "gtk_action_group_add_actions has been deprecated since version 3.10 and should not be used in newly-written code." - I guess it is not in the typelib anymore ... tohoyn: daviid: here is a snipset for the gtkbuilder bug: https://paste.debian.net/1142919/ tohoyn: daviid: I get the following error message: No variable named in # str1ngs: tohoyn: try importing gio. with (gi-import "Gio") str1ngs: I think that should resolve the unbound str1ngs: tohoyn: anything that has a "g" namespace is probably found in Glib or Gio str1ngs: err GLib tohoyn: str1ngs: is defined when I do (gi-import "Gio") catonano: sneek: tell srandon111 no sorry i don't recognize you ! Who are you on the fediverse ? 😀️ sneek: srandon111, catonano says: no sorry i don't recognize you ! Who are you on the fediverse ? 😀️ RhodiumToad: (perhaps you meant "later tell ..."?) str1ngs: tohoyn: okay, looks like it's working as intended then. catonano: RhodiumToad: oh jeez, of course. Thanks catonano: sneek: later tell srandon111 no sorry i don't recognize you ! Who are you on the fediverse ? 😀️ sneek: Got it. tohoyn: daviid: !changed-mask and !new-window-state work fine. tohoyn: daviid: procedure gtk-event-get-changed-mask expects a pointer but the events are values of type . chrislck: here's a silly shortcut: instead of (and (not a) (not b) (not c) (not d)), we can use (eq? #f a b c d) instead :-/ dsmith-work: True, but watch out. (eq!) will eval every espression, but (and) might not. dsmith-work: sneek: later tell chrislck Watch out. (eq!) will eval every espression, but (and) might not. sneek: Okay. msiism: Is it possible to customize the Guile REPL prompt? If so, could anyone point me to where this is documented? Thanks. guix-vits: msiism: `` ,option prompt "NEW-PROMPT"'' msiism: guix-vits: Thanks. guix-vits: ,option prompt (lambda () (format #f "io-ho-ho@~a> " (module-name (current-module)))) guix-vits: rekado told me. msiism: Oh, I see. guix-vits: the Manual: "if your program is too big to include. please" ;should be comma tohoyn: daviid: I get the following error message: WARNING: (g-golf): `bitwise-and' imported from both (rnrs arithmetic bitwise) and (srfi srfi-60) tohoyn: warning mwette: guix-vitz: Thanks. I sent a patch to civodul. mwette: guix-vits: Thanks. I sent a patch to civodul. tohoyn: daviid: I'm investigating the attached-to property of GtkWindow (the type of the property is GtkWidget). I obtained the type with procedure g-property-info-get-type. now g-base-info-get-name return #f for the type. the tag of the type is "interface". how can I obtain the name of the type? tohoyn: daviid: BTW, are the struct and union types in G-Golf disjoint? butterypancake: so my employer is threatening me that they might make me create a gui soon butterypancake: I did web dev for 3 months once and I really didn't like it butterypancake: I've never used guile but it looks interesting. If I write the backbone in guile it's easy to write a minmal javascript frontend? RhodiumToad: butterypancake: are you looking to display in a browser or just be an ordinary GUI app? butterypancake: he wasn't super specific but we've done both before as a company so yes butterypancake: I would like our apps to be CLIs so I can script tests. Ideally I'd then have buttons in a web app or native gui just call the snippet that the corresponding CLI command would do butterypancake: Our apps don't have a lot of configurations. Our previous GUIs have like 10 buttons tops and maybe 1 or 2 text boxes for input (usually number inputs) RhodiumToad: what platforms would you need to run on, if native? butterypancake: we usually deploy to windows but linux is a posibility (one which I personally want to keep open because I like FOSS) RhodiumToad: I don't know offhand of any good way to do a native gui on windows from guile, so I guess webapp would be the way to go butterypancake: I'm not sure I quite understand what this snarfing thing does butterypancake: does it produce a file with only the SCM marcro expansions, or is it everything else too butterypancake: I think I'm missing the info page where it describes snarfing. I've got the function snarfing page and snarfing macros page. is there one for what snarfing is? dsmith: You need more than just writing C functions. You also need to add the C funcs to the Scheme symbol tables. dsmith: "snarfing" is a separate preprocessor pass expands the function definition macros into C code that loads the Scheme symbol table. dsmith: It writes out .x files, which the C code then includes. dsmith: Usually inside of some kind of init function. dsmith: The .x files usually contain a sequence of scm_c_define_gsubr() calls. tohoyn: daviid: are you there? daviid: tohoyn: you may always ask, because whn I am not or not availabl, I read the log and answer lter, when I can ... tohoyn: daviid: ok. you probably noticed my message about G-Golf autogen.sh. daviid: tohoyn: others may answer as well ... daviid: automae as always worked ... i did suspect an installation problem daviid: which you apparently solved ... daviid: I am on debian testing to, fwiw reepca: are the revealed-count modifications in port->fdes and release-port-handle thread-safe? tohoyn: daviid: it would be convenient for me to have getters and setters in addition to accessors tohoyn: daviid: because Theme-D doesn't have accessors tohoyn: daviid: so that getters and setters are automatically imported when their class is imported tohoyn: daviid: just like other methods daviid: tohoyn: all methods associated with GIObjectInfo are imported tohoyn: daviid: yes, but the importing is not the main thing in this tohoyn: daviid: if G-Golf had getters and setters I could just "import" them to Theme-D tohoyn: daviid: I'll think about this a little more. Perhaps I could implement getters and setters using accessors (in Theme-D). tohoyn: daviid: i.e. to generate the getters and setters automatically daviid: but you have those, they are provided by the typelib itself, currently as 'long names', do plan to implement shortname methods, but that is not the highest priority for now ... tohoyn: daviid: great! tohoyn: daviid: I they imported by G-Golf? daviid: all methods are imported tohoyn: daviid: how are they named? consider e.g. can-default property of . daviid: you already know that :) - gtk-widget-get-can-default ... tohoyn: tx tohoyn: daviid: it seems that getter and setter of GtkWindow property default-width are not imported. daviid: it is not provided by Gtk itself ... you must use the property accessors, oor gtk-window-get-default-size tohoyn: daviid: gtk-window-get-default-size is not available tohoyn: daviid: but gtk-widget-get-can-default is daviid: tohoyn: it is available, but I see, testing it, there is a bug when there was no default-size specified at creatio time ... will fix it tohoyn: daviid: gtk-tree-view-get-model returns a pointer instead of an object. see https://paste.debian.net/1142716/ . daviid: tohoyn: yes, i was working on it, it is because it s type is 'interface, not a 'object - will fix that to, tx for the report daviid: tohoyn: i pushed a fix for fundamental 'out args that may return NULL, you may pull, make, install and try gtk-window-get-default-size daviid: tohoyn: the 'interface type is far more compicated to solve, but I'm on it, I was already on it ... it will take some time, but I will let you know ... tohoyn: daviid: there is something wrong with the getters and setters. see https://paste.debian.net/1142717/ . tohoyn: daviid: gtk-widget-set/get-can-default work fine daviid: but you pass one arg only, it needs both the width and height daviid: which is what the error message reports ... daviid: *you pass two args, it needs three args ... tohoyn: daviid: ok, the calls work now but get-default size returns two #f's after I do set-default-size. daviid: ok will look tohoyn: daviid: gtk-window-get/set/-default-width are still not defined daviid: it is not defined, in is not in Gtk daviid: that's not a g-golf 'problem' tohoyn: daviid: ok. I meant earlier that just this kind of getters and setters would be useful for me. tohoyn: daviid: the property is defined, though daviid: tohoyn: I won't provide things that are not in the typelib tohoyn: daviid: ok daviid: but of course you may define those yourself ... tohoyn: daviid: yes, I'll try to autogenerate the getters and setters for Theme-D wingo: i wonder what a scribble-like approach to texinfo would look like civodul: hey wingo wingo: heya :) civodul: the surface syntax is not too dissimilar civodul: but yeah, there's room for exploration in that area! wingo: looking at https://docs.racket-lang.org/scribble/layers.html it sounds tricky, a scribble approach produces a module rather than a datum civodul: arf, cloudfare :-/ wingo: yarr wingo: no idea why people do cdn's tbh for projects like this, are their bandwidth bills really that high? weird civodul: i'm not convinced the module bit is really important here civodul: there's a reader that turns the documents into Scheme civodul: like in Skribilo civodul: and then you can choose to write "mostly text" or "mostly code" daviid: tohoyn: I pushed a fix for gtk-window-set-default-size - Note that now, and that is the expected behavior, as described in the Gtk doc, gtk-window-get-default-size will return -1 -1 when default size has not been explicitly set tohoyn: daviid: ok daviid: tohoyn: ther ar still other fundamental tag types for 'out args, when you hit one let me know ... daviid: *still missing/no well defined ... tohoyn: daviid: function gtk-tree-store-set-value does not work. see https://paste.debian.net/1142735/ . tohoyn: daviid: OTOH gtk-list-store-set-value works. The string-pointer property of the last argument of gtk-list-store-set-value is # whereas for gtk-tree-store-set-value #f. daviid: ok, will look tohoyn: It would be nice if you could run/load compiled guile programs directly from the guile command line, like "guile -e main -s program.scm" works for Scheme files. str1ngs: tohoyn: you mean from the REPL? is so you can do (main '(arg0 arg1)) str1ngs: provided you load the file of course. tohoyn: str1ngs: I mean shell command line str1ngs: maybe I misunderstand. but you can use guile -e main -s . in a shebang str1ngs: so you can then do ./foo.scm arg1 arg2 tohoyn: str1ngs: yes tohoyn: can I access the fields of unions and structs in G-Golf? I need fields of GdkEvent and GdkEventWindowState. str1ngs: you can use accessors to get GdkEvents for example on key-press you would use (!keyval event) str1ngs: and (!type event) to get the type str1ngs: tohoyn: here in this updated docs you can see GdkEvent. https://bufio.org/doc/g-golf/Events.html#Events str1ngs: I eported to html until daviid has a new release. tohoyn: str1ngs: I read the documentation but I found no way to access fields of a GdkEventWindowState tohoyn: daviid: function gtk-action-group-add-actions is undefined tohoyn: daviid, str1ngs: is GtkBuilder supported by G-Golf? GtkUIManager is deprecated. It says something about compiler options in https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-connect-signals . dsmith-work: Happy Friday, Guilers!! tohoyn: when I try to access a menubar defined with GtkBuilder I get the following error: No variable named in # tohoyn: the function causing this is gtk-builder-get-object str1ngs: tohoyn: I have not used GtkBuilder with g-golf. I find it easier to create my widgets using goops classes str1ngs: tohoyn: here a terminal widget derived from http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/gtk/widget.scm?h=feature-g-golf#n221 there are more widgets examples in that file. might help str1ngs: tohoyn: generally No variable named can be resolved by import it's Namespace. provided the type is supported by g-golf of course. str1ngs: tohoyn: what signal uses GdkEventWindowState? tohoyn: str1ngs: window-state-event str1ngs: I should be able to test that signal with GtkApplicationWindow? str1ngs: tohoyn: alos http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/gtk/frame.scm?h=feature-g-golf is a more complete derive goops class. I find it better the GtkBuilder myself str1ngs: also* str1ngs: tohoyn: what do you need from this event? str1ngs: regards to window-state-event tohoyn: str1ngs: changed-mask and new-window-state heisenberg-25: How do I change the value for a specific key in a hash table that is stored in an atomic box? (ice-9 atomic). str1ngs: tohoyn: as far as I can tell is not complete yet. I think it's best to wait for daviid to help answer this question. tohoyn: str1ngs: ok. I'll code the menu bars and tool bars without builder or UI manager. str1ngs: tohoyn: probably you can use builder to a limited degree. but for custom widgets I doubt it will work since you need to provide a class init for those things str1ngs: tohoyn: looks like builder works to a degree str1ngs: tohoyn: see http://paste.debian.net/1142772. str1ngs: tohoyn: and the glade file https://paste.gnome.org/pwrbv2grq tohoyn: str1ngs: do you have any example about implementing menu bars and menus without ui manager? dsmith-work: butterypancake: Did you see my message about snarfing? daviid: tohoyn: str1ngs: I will read and answer/solve what you wrote about ... but anything complcted, then it comes after this 'interface problem I was and still eed to work on ... daviid: tohoyn: you should _never_ access gdk-event fields 'yourself', and fwiw, in gtk4 it will be an opaque struct - if you miss an api, let me know, but I thought I did implement most of them ... tohoyn: daviid: it should be possible to access different event types (GdkEvent is a union of them) and fields of each event type (a struct type) daviid: tohoyn: you may access the state of a gdk-event sing (!state a-gdk-event-instance) - all this is in the g-golf manual, please read that section, it's good, if not feedback welcome ... daviid: tohoyn: yu should use the accessors g-golf provides tohoyn: daviid: is it possible to access fields of GdkEventWindowState? daviid: forget bout how there are represented, this will becoe totally hidden in gtk4, and you don't need to know this to use gtk3, just use the accessors daviid: yes it' i the manual daviid: could you build locally and read the manual ... tohoyn: daviid: I just read it daviid: ok, the Gdk -> Events section daviid: tohoyn: here is an example - https://paste.debian.net/1142813/ daviid: str1ngs: you can locally install the html doc running make install-html, fwiw tohoyn: daviid: is it possible to access fields changed_mask and new_window_state (GdkEventWindowState)? AFAIK !state is not related to GdkEventWindowState. daviid: tohoyn: it's not related, I've asked about those accessors on #introspection - let's see daviid: sneek: later tell tohoyn wrt the gtkbuilder - related bug, could you prepare a snipset, so I can reproduce locally. tx sneek: Got it. dsmith-work: sneek: later tell dsmith something sneek: Okay. dsmith-work: sneek: tell dsmith something else sneek: dsmith, dsmith-work says: something else dsmith-work: sneek: seen dsmith? sneek: dsmith was in #guile 16 hours ago, saying: The .x files usually contain a sequence of scm_c_define_gsubr() calls.. RhodiumToad: sneek: seen RhodiumToad? sneek: RhodiumToad was in #guile 0 seconds ago, saying: sneek: seen RhodiumToad?. dsmith-work: There is this odd message happening: dsmith-work: In procedure caddr: Wrong type (expecting pair): () dsmith-work: But the bot code does not use caddr anywhere. RhodiumToad: is the code up anywhere? dsmith-work: No other indication of where thats happening. Not sure what is triggering it. dsmith-work: No yet. Getting close. str1ngs: daviid: yes, I know I build the docs and pushed to a server so I could give tohoyn something to reference. daviid: ah ok, the doc is online as well, but maybe not the very latest, need to update that daviid: str1ngs: I ned to add a C function to libg-golf str1ngs: what do you need to add? daviid: because those very specific gdk accessors are not in gdk itself daviid: are you on #introspection? str1ngs: the struct fields that tohoyn needs? also I don't think !state works for that window signal. daviid: so I don't have to rewrite everything str1ngs: I can log into #introspection daviid: there is no log str1ngs: I have a huge znc despite not being in the channle haha daviid: do yu know what header file I need to add to have access to gdkevent and genevent structures, so i can add a C function ... str1ngs: one sec str1ngs: daviid: it's probaby /usr/include/gtk-3.0/gdk/gdkevents.h str1ngs: typedef union _GdkEvent GdkEvent; daviid: #include fails str1ngs: you might need daviid: that fails to str1ngs: with pkg-config flags? daviid: ah, wait, ebassi is answering on #intrspection str1ngs: I don't think they are meant to be used this way. str1ngs: makes more sense from what ebassi is saying. str1ngs: sometimes you need to include some platform stuff but it's rare. daviid: #include fails here daviid: str1ngs: and gdkevents.h is found with gtk, strange str1ngs: offtopic I thought PKG_CHECK_MODULES already did AC_SUBST str1ngs: daviid: I need to afk for awhile, but I'll check the back logs when I get back. daviid: str1ngs: ok rekado: yo, guilers, the logs now support a simple search: http://logs.guix.gnu.org/guile/search?query=nick%3Awingo+moo rekado: still WIP but I thought it might already be useful dsmith-work: rekado: Hey! That's awesome. RhodiumToad: the channel message should maybe be updated to point to the right site? RhodiumToad: sneek: logs? sneek: Last time I checked logs is http://logs.guix.gnu.org/guile/ RhodiumToad: PvNotice(ChanServ): Welcome to #guile! This channel is logged, see . RhodiumToad: that ^^ is the message sent to joiners lfam: RhodiumToad: That's not what I am seeing lfam: Welcome to #guile. See https://gnu.org/s/guile for more information. Guile 3.0.2 is out! . This channel is logged, see . Bug database at . lfam: That's what I see RhodiumToad: that's the topic, not the message sent to joiners RhodiumToad: that's the topic, not the message sent to joiners lfam: Ah lfam: Right RhodiumToad: someone with owner privs (rlb, civodul, wingo) can update the join message with a chanserv command RhodiumToad: with /msg chanserv set #guile entrymsg ...text of message here... *: civodul tries civodul: i think i did it, woo! RhodiumToad: that appeared to work, yes civodul: thanks for the hint, RhodiumToad RhodiumToad: yw iv-so: Hello, everyone. Is there a reliable way to find guile bytecode among other ELF binaries? Can I strip .go files? If so, how to do it? RhodiumToad: you can check things like the machine type, ABI, and the presence of .guile.* sections? RhodiumToad: dunno about stripping them, never tried daviid: rekado: I wnted to try the earch, thanks - but I've just noticed, while trying, that if I am in a log, today's #guile log for example, 24.04.2020, then hit back to list of logs, in brings me back to the list of #guix logs :) daviid: rekado: then 'manually' getting to http://logs.guix.gnu.org/guile/, I don't see the search box, is the search available or did I missunderstood and it will be in a few days maybe? daviid: rekado: by the way you changd the order of the logs date, thanks! much better for the 'usual case' ... iv-so: Thanks for answer. Will try. civodul: C-c C-k and declarative modules don't go together well civodul: uh civodul: we should adjust Geiser rndd: mwette: thanks! RhodiumToad: (add-to-load-path (dirname (current-filename))) from inside a guile script can be handy anadon: Good evening all anadon: Does anyone have advice for creating a program which stores file data with flexible metadata, transparently decrypts and encrypts said data, supports POSIX operations from C, and supports networking and distributed/sharded file data? There is a lot to unpack here, and I'm not skilled enough to unpack it myself yet. dsmith-work: anadon: Ya, that seems a little confused to me. dsmith-work: anadon: Is that from some kind of requrements doc written by a committee? dsmith-work: It's the OS and library that would support POSIX calls from C. dsmith-work: "flexible metadata" is kind of nebulous. dsmith-work: (Sorry. I'm not helping much, am I) RhodiumToad: "flexible" presumably in the sense of not conforming to some fixed predefined schema. anadon: RhodiumToad: Yup. Something that the user can do what they will with it. *: RhodiumToad mumbles "xml" quietly anadon: I'm trying to design and implement, effectively, a filesystem with web support minus low level disk stuff. anadon: No way in hell am I going to pull an XML. dsmith-work: fuse ? anadon: dsmith-work: FUSE is probably a good idea for this to plug into. dsmith-work: I've never looked at that before, but I would imagine that has all the entrypoints you would need to implement. dsmith-work: I mean, everything to make it look like a filesystem. *: RhodiumToad understands that xml is widely hated, but it does look like it could be useful here dsmith-work: sxml dsmith-work: Everything is JSON and YAML these days. anadon: By XML I took you to mean the parent standard SGML. anadon: Given how overbearing XML is, I don't think it is fitting. For being able to interpret things, I intend to use some Lisp-thing to represent data. RhodiumToad: well this is kind of the anti-xml attitude I was referring to previously RhodiumToad: to give a real example, suppose I have something like RhodiumToad: Mewhenever... RhodiumToad: then (a) anything can interpret that, even a human; (b) anything that cares can validate it; (c) anything that wants to add more metadata with a different schema can do so RhodiumToad: of course you can store that as sxml if you prefer dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen rlb? sneek: rlb was in rlb ago, saying: 4 days. dsmith-work: Bah RhodiumToad: a veritable bug dsmith-work: sneek: seen RhodiumToad ? sneek: I last saw RhodiumToad in (here?) ago, saying: 46 minutes and 30 seconds. dsmith-work: Heh *: RhodiumToad wonders if the bot counts actions RhodiumToad: 46 min 30 sec would be about right if it doesn't dsmith-work: sneek: seen RhodiumToad ? sneek: RhodiumToad was in (here?) 47 minutes and 56 seconds ago, saying: "flexible" presumably in the sense of not conforming to some fixed predefined schema.. dsmith-work: Ok! dsmith-work: sneek: seen dsmith-work? sneek: dsmith-work was in (here?) 31 minutes and 22 seconds ago, saying: Everything is JSON and YAML these days.. RhodiumToad: why the (here?) ? dsmith-work: The old db table didn't have the channel. RhodiumToad: sneek: seen dsmith-work? sneek: I last saw dsmith-work in (here?) 32 minutes and 6 seconds ago, saying: Everything is JSON and YAML these days.. dsmith-work: Supposed to be populating with the chan RhodiumToad: it doesn't seem to be making new entries? RhodiumToad: sneek: seen sneek? sneek: Sewni was in (here?) 7 months ago, saying: I didnt realise you were using the bot :P. RhodiumToad: heh RhodiumToad: fuzzy matching? dsmith-work: There was some. I've disabled that. "seen" would match the bot nick. dsmith-work: foo bar is the best baz I've ever seen dsmith-work: That used to trigger the bot RhodiumToad: sneek: seen dsmith-work? sneek: dsmith-work was in (here?) 37 minutes and 55 seconds ago, saying: Everything is JSON and YAML these days.. dsmith-work: RhodiumToad: The db is not being updated. dsmith-work: RhodiumToad: The db is not being updated. dsmith-work: Ok. dsmith-work: sneek: seen dsmith-work? sneek: dsmith-work was in #guile 13 seconds ago, saying: sneek: seen dsmith-work?. dsmith-work: goodbot dsmith-work: sneek: seen civodul? sneek: civodul was in (here?) 2 hours ago, saying: it's #guix, not #editors :-). dsmith-work: RhodiumToad: Say something. RhodiumToad: moo RhodiumToad: this is only a test. had this been a real emergency, we would all have fled in terror, and you would not have been informed. anadon: RhodiumToad: I want data to be interpreted by substance and structure rather than something explicit. The explicit route has always been opt-in, and I really want something that is more opt-out. dsmith-work: One more change to make is record the (current-time) seconds instead of the date as text like 'Apr 23 at 12:28 am' RhodiumToad: what database are you using, out of curiosity? dsmith-work: sqlite RhodiumToad: seems reasonable dsmith-work: https://gitlab.com/dalepsmith/guile-sqlite dsmith-work: the bot has been using that for over a decade. SAME db file. (copied from machine to machine occsionaly) dsmith-work: RhodiumToad: The seen time is off right now by +- 30 seconds, because only the minute was saved. dsmith-work: Not that it matters too much. But it annoys me a bit. dsmith-work: ok dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen someunknownnick? sneek: Not as far as I can remember. anadon: In https://www.gnu.org/software/guile/manual/html_node/Sandboxed-Evaluation.html , security notes point 4, are mutation risks only a concern for variables passed into a sandboxed execution? anadon: I'm having trouble parsing that section. dsmith: "Mutation may allow a sandboxed evaluation to break some invariant in users of data supplied to it." Sounds like just the stuff passed.. dsmith: When did this sandbox stuff appear? Never seen it before. dsmith: AN example or two would be nice. dsmith: sneek: seen wingo? sneek: wingo was in (here?) 7 days ago, saying: à demain. anadon: dsmith: Good enough for me. I won't be passing anything in. tohoyn: daviid: when I do (gi-import-by-name "Gtk" "ButtonsType" neither nor gtk-buttons-type are defined. See https://paste.debian.net/1142354/ . tohoyn: daviid: BTW, when GTypes are passed as procedure arguments should we have types as GObjects instead of symbols? tohoyn: daviid: e.g. gtk-list-store-newv daviid: tohoyn: ButtonsType is an enumerted type - once imported, you may just use any of its member to what ver function needs a button type ... but if you want to inspect of cache for your own introspection use, or what eve reason, you may retreive its instance as (gi-cache-ref 'enum 'gtk-buttons-type) tohoyn: daviid: ok tohoyn: daviid: should the name be ? daviid: no, these <...> arereserved for class name, in g-golf, enum, struct, boxed, are instances daviid: tohoyn: are , instances ... daviid: tohoyn: your last quizz, gtk-list-store-newv last argument is an array of GType (a pointer to a array of unsigned-long to be precise) tohoyn: daviid: I can't set a GObject-valued slot, see https://paste.debian.net/1142361/ tohoyn: daviid: slot-set! expects a pointer tohoyn: daviid: is it possible to obtain the GType value of a GObject representing a class? daviid: tohoyn: so, from a g-golf user perspective, it is a list of members of %g-type-fundamental-types tohoyn: daviid: classes are GObjects, aren't they? daviid: yes, (!gtype-id appears t be an illegal ops - (guile:117725): Gtk-WARNING **: 05:29:11.011: Can't set a parent on a toplevel widget daviid: tohoyn: daviid: yes, setting the parent is unncecessary and wrong tohoyn: daviid: you can set the transient parent instead (with the corresponding function) daviid: tohoyn: would you have a valid example I could use to add to the test suite, that would be helpfull tohoyn: daviid: wait ... daviid: tohoyn: ok, but I pushed a fix, could you pull, make, check and then you paste a valid example, if you can ... but first check my fix daviid: tohoyn: so with this fix, yu should pass the goops instance to set property that aceept g-object (sub)class instance(s) daviid: and accessing the property should properly rtrive the goops instnace for you, or #f if none tohoyn: daviid: shall I set the property with slot-set! or use accessors? daviid: slot-set! will _never_ work for g-object properties daviid: nor slot-ref - properties are GValues ... tohoyn: daviid: ready: https://paste.debian.net/1142383/ tohoyn: daviid: works fine daviid: ok perfect. now, this tells me that there will still be other property types that will need fix, as they appear so to speak - we'll fix 'on-demand tohoyn: daviid: do you know how I shall initialize the GValue when I set the font-desc property of GtkTextTag (type PangoFontDescription*) (this is C) tohoyn: daviid: I use function g_object_set_property daviid: tohoyn: you should not initialize the property yourself daviid: the property knows what type nd how to initialize its GValues ... daviid: *you should not initialze the g-value of a property yurself, never ever daviid: the only situation, unfortunately, when yu have to 'deal with' g-values is when a fnction needs 'in or 'inout arguments that are g-values - whch afaic is a design failure on the gnome side but that is another 'story' ) daviid: tohoyn: PangoFontDescription is an opaque struct, yu should use its apito create, manipulate .... and 'blindingly' pass its pointer when accessing setting properties ... tohoyn: daviid: it works fine when I use function g_object_set (the output is not fine) daviid: tohoyn: you shouldn't use thos low level, never ever daviid: if you do, you'r on your own ... i can't help daviid: you break the protocol ... tohoyn: daviid: in C? daviid: oh, no in g-golf o course tohoyn: daviid: I wrote a C++ example program for the Courier font problem daviid: in C do as you wish :):) tohoyn: daviid: could you run the C test program if I paste it? tohoyn: daviid: I may file a bug in Gtk daviid: tohoyn: I'm too busy and not very interested I must confess, but maybe someone else here might help you tohoyn: str1ngs: are you there? daviid: tohoyn: with a good C snipset, you may try gnome irc channel tohoyn: daviid: ok daviid: but C, not C++, since gobject is there object oriented system... daviid: tohoyn: irc.gnome.org - fwiw hang on #introspection of course .. daviid: tohoyn: wrt to your question related to gtk-image-new-from-icon-name, I did ask on #introspection and they answered that it is int32 because users may specifiy a different size (in pixel) then those in the enum type tohoyn: daviid: ok daviid: they added that in Gtk4 it will take an actual GtkIconSize, fwiw dsmith-work: Morning Greetings, Guilers RhodiumToad: yo butterypancake: The other day #emacs was claiming that guile emacs would leave emacs in a worse place. They claimed if they wanted to change the elisp engine, they'd need programmers that understood C, guile, and elisp. They also said they can do more optimizations with an engine specific to elisp, like the upcoming gccemacs optimizations. They where kind of convincing so I want to see what you guys think to hear out both sides lfam: Do you have a log of the conversation butterypancake? butterypancake: I don't. Literally just started using irc yesterday because I was thinking of personally picking up the guile emacs project butterypancake: Maybe I should start looking into how to take logs :P butterypancake: One of their arguments was that the current guile emacs is slower than normal emacs. I thought that was because of byte compilations problems but they said it wasn't and it was just that elisp is faster than guile butterypancake: this is guile 2.2 in the current guile emacs though, and guile 3 is supposed to be like twice as fast lfam: I'm not that familiar with Emacs but my impression is that it's extremely complicated internally and that changing the underlying language implementation would require buy-in from a lot of people lfam: Because it would take a lot of people to complete the work rekado: butterypancake: the current Guile Emacs is not really current. rekado: it does not even use Guile 2.2 rekado: I started rebasing the branch of Guile that Guile Emacs used, but there are a bunch of changes that need to be reviewed and adjusted. butterypancake: I mean one man created a working guile emacs. I would have to have support from the emacs devel mailing list, which I don't think would be super hard since RMS really likes guile. It would take a lot of work, but I think I could do it. Right now I'm trying to figure out if I should rekado: it’s slower because it currently doesn’t compile anything. butterypancake: ok, I thought that was the problem. #emacs seemed to think otherwise rekado: Emacs developers in general don’t like to hash out development plans by committee. rekado: they prefer to have someone show up and do the work and then demonstrate how it benefits Emacs. rekado: for Guile Emacs to ever succeed it would need people to actually take it serious. holomorph: and then derail in all whimsical directions rekado: only then would it get to a position where it could convince the Emacs community on its own merits. rekado: I’d like to see Guile Emacs become a viable alternative (perhaps merely as a configure-time option) rekado: and I hope that rebasing past work could encourage a little more development in that area butterypancake: I'd kinda feel bad for the gccemacs guy if guile emacs replaces his work though butterypancake: he's doing a lot of work making elisp compile to native machine code drakonis: its an experiment isnt it? butterypancake: it is, but it has a lot of hype around it. butterypancake: He posts in emacs-devel regularly and gets lots of praise and the reddit posts get a lot of attention rekado: isn’t that similar to Guile Emacs a few years back then… rekado: ? butterypancake: most likely. But from what I can tell that was like 5 years ago, before I even used emacs rekado: does anyone have a good example for quasipatterns with (ice-9 match)? rekado: I’d like to build patterns from a list, but I don’t understand the documentation tohoyn: daviid: G-Golf autogen.sh (devel branch) gives an error. see https://paste.debian.net/1142583/ tohoyn: daviid: I just installed Debian testing into a virtual machine emiller88: civodul: continuing over here from #guix tohoyn: daviid: Courier font worked ok in the new installation tohoyn: daviid: the autogen problem disappeared when I installed gettext Aurora_v_kosmose: Ah, I would have a log of that conversation, I think. civodul: emiller88: did the pkg-config trick help in the end? emiller88: civodul: Sadly no, I get `pkg-config --cflags guile-2.2: No such file or directory` whether I use nix-shell, or guix and different combinations of guile pkgs. It works if I just run the raw pkg-config though, just not in the Makefile. emiller88: If you have any other ideas I'm open to it but I started it yesterday to learn guile not how to get cflags to work in guix/nix :P. emiller88: I'd send the guix env to author if you do know how to fix it, I think that's the only thing wrong with the tutorial. civodul: emiller88: so you'll need to have Guile and pkg-config available/installed civodul: in Guix, this can be achieved with: civodul: guix environment --ad-hoc guile pkg-config civodul: in that shell, you can run: pkg-config guile-2.2 --cflags mwette: What about "make -p" to compare PKG_CONFIG_PATH to what's in your normal shell env? emiller88: mwette: emiller88: There isn't a PKG_CONFIG_PATH with make -p emiller88: civodul: Yeah that works, it doesn't work in the makefile, could I just put the raw path in there? mwette: I don't remember make well enough but if you are willing to try: make PKG_CONFIG_PATH=$PKG_CONFIG_PATH mwette: or hard code in the Makefile emiller88: Okay hard coding it worked emiller88: now it can't find gmp.h emiller88: Nvm that was because gnuplot wasn't in that env. Thanks! civodul: emiller88: it could be that your bash startup scripts are interfering, see footnote 10 at https://guix.gnu.org/manual/en/html_node/Invoking-guix-environment.html#FOOT10 civodul: namely, "guix environment --ad-hoc guile pkg-config --search-paths" probably contains PKG_CONFIG_PATH, doesn't it emiller88: Alright no update needed, I got ahead of the tutorial which uses CFLAGS = `guile-config compile` emiller88: LIBS = `guile-config link` emiller88: Which works just fine str1ngs: dsmith-work: it's worth it. this helped me when switched to paredit. http://danmidwood.com/content/2014/11/21/animated-paredit.html tohoyn: I can't obtain the info structure for procedure gtk-container-child-get-property. I have tried e.g. (g-irepository-find-by-name "Gtk" "gtk-container-child-get-property"). Can you help me with this? tohoyn: when I try describe with the function child-get-property is not present in the method list. daviid: tohoyn: the secod agument should be a name as expected by GI, camelcase, no underscore ... they are the exact same name(s) you seu for gi-import-by-name ... try to see f you can find it .. str1ngs: tohoyn: (describe (gi-cache-ref 'function 'gtk-container-child-get-property)) works for me. daviid: tohoyn: yu may also use accessors, for g-object instance properties tohoyn: gi-cache-ref works. thanks. daviid: tohoyn: wrt to these functions that are not in GI, because varargs, we should offer, gradually, a manual wrap/binding, I'm still thinking on the best way to acheive this, which is not as obvious as it seems, because in g-golf, we may (and even promote) selective imports ... tohoyn: daviid: AFAIK varargs are not (or were not) very well implemented in C++. Can you pass objects as a variable argument? daviid: tohoyn: varags function are not in any GI typelib that I am aware of - nothing to do ith C++ - then I don't understand the last question, can you give an example daviid: tohoyn: gtk-list-store-new isn't in "Gtk" "ListStore" either, just to gve another example ... daviid: and fwiw has been manually wrapped in guile-gnome as well str1ngs: (make ) should work though? daviid: definitely str1ngs: there I are very few cases to use -new I found daviid: but yesteray i spoted a bug/limitation that i'd lie to work on today: daviid: str1ngs: good for you, the more you goopsify your code the better, imo daviid: i can't wait to have short method nams, these long names are a pita :):) daviid: but one thing at a time str1ngs: short methods names would be handly, but the longs names don't hurt either. str1ngs: handy* daviid: long names make th code pretty unreadable, i think, but i guess it's personal ... daviid: this workd fie as well tohoyn (make #:title "Column 1") str1ngs: I prefer the short names. but I'm use to GTK C code haha daviid: which saves a call and is 10 times more readable :):) str1ngs: what I need to figure out. not an issue with g-golf but how to make my derived classes more flexible daviid: however, this fails: (make #:model $5) - where $5 would be a list-stre -| sscm-error"Not implemented:"interface ... I am gona work on this I hope to solve the problem soon ... daviid: str1ngs: or maybe not use derived classes at all and just use constructor functions daviid: str1ngs: what you mean more flexible? daviid: tohoyn: fyi this works fine (gtk-tree-path-new-from-string "0") daviid: (gtk-tree-model-get-iter a-store the-above-call-result-pointer) str1ngs: hard to explain, I guess I want my class to be more generic. but I always seem to hit edge case str1ngs: daviid: for context with nomad's mode-line and echo area . they are derived from the same class. one is backed by a emacsy buffer the other is back by a thunk. daviid: tohoyn: these functions returns two values, but you can and should add their name to %gi-strip-boolean-result - and read if you ddid not yet, the manual exaplining what this is ... daviid: str1ngs: design is certainly the most difficult task, as is naming variables .. :):) str1ngs: daviid: aye, I'm just thinking out loud :) . I think I need to redesign them anyways. at least they are event driven unlike emacs :) str1ngs: they only get updated when they need to :) tohoyn: function gtk-container-child-get-property expects a GValue as its last argument and stores the property value there. What should I pass in that argument? tohoyn: it's not an output argument daviid: tohoyn: maybe it needs an override, let me check daviid: can't you access the property using its accessor? tohoyn: daviid: I'll try tohoyn: daviid: it works daviid: can you paste a tiny example, i'll try to override this function then ... tohoyn: I have some problems with the PasteZone. It keeps saying "do not spam" tohoyn: daviid: I'll send you email daviid: tohoyn: you may use gnome pste as well tohoyn: daviid: ok daviid: yes, debian allws a few paste per day, dont know exactly how many ... tohoyn: daviid: see https://paste.gnome.org/p2atiu4ks daviid: ok tx, wil look asap, but i'm on something else 'right now' tohoyn: daviid: do the accessor work for child properties? did not work for me. tohoyn: str1ngs: do you know about this? daviid: but you may call the accessor on the child instance right? daviid: (!scale-factor hbox) maybe daviid: i didn't try yet tohoyn: daviid: it seems that the child accessors are not even defined tohoyn: daviid: try e.g. !resize daviid: what call exactly, so i can (later) try ... tohoyn: daviid: see https://paste.gnome.org/pe4hxkgka str1ngs: gtk_container_child_get_property is not the best function. it uses a mutator str1ngs: which is okay when you are using C. but for this I would just use an accessor as daviid mentioned tohoyn: child properties are properties related to the relation between the container and the child. that's why they don't have accessors (AFAIK). str1ngs: let me clean this example up. and play with it somemore str1ngs: daviid: GValue is not implemented right? tohoyn: IMHO the last argument of gtk-container-child-get-property should be an output argument. str1ngs: tohoyn: here's a work around https://paste.gnome.org/pwaig3qq7 str1ngs: I used a mutator to but there is probably a better way to reduce the list str1ngs: it's a bit hacky tohoyn: str1ngs: tx str1ngs: tohoyn: version that avoids using set! str1ngs: https://paste.gnome.org/pzflc9uly str1ngs: this might be to functional but the find with gtk-container-get-children is just as effective as gtk-container-child-get-property tohoyn: str1ngs: yes but all child properties don't have corresponding ordinary properties (e.g. shrink) str1ngs: right but you would have to account for that anyways. does GValue become false in those case or something? str1ngs: I understand you are probably using this in a introspective way so it might not be so ideal. tohoyn: str1ings: it is used in a Theme-D-Gnome UI demo (not introspective) tohoyn: str1ngs: I can paste you the code str1ngs: that might give me some context tohoyn: str1ngs: see https://paste.gnome.org/plqbrcdyp tohoyn: str1ngs: note that the code is in Theme-D str1ngs: gotcha, can D use goops? tohoyn: str1ngs: T-D has an object system resembling GOOPS somewhat tohoyn: str1ngs: the code uses Theme-D-Gnome which works on top of guile-gnome tohoyn: Theme-D can access GOOPS classes tohoyn: in the target platform tohoyn: str1ngs: see http://www.tohoyn.fi/theme-d/index.html and http://www.tohoyn.fi/theme-d-gnome/index.html str1ngs: this is interesting :) str1ngs: I think though for now until there are GValues you might have to loop to get a property tohoyn: ok str1ngs: I find though I do'nt have to do this. beause I just create slots for children I need to access str1ngs: there are times where dynamically finding children is handy though. tohoyn: the problem is that there are not ordinary properties corresponding all child properties str1ngs: right, but in most cases you know the class you are dealing with. str1ngs: trying to think if a type system would make this harder .. daviid: tohoyn: note that gtk-hbox-new is deprecated, you should use gtk-box-new i think tohoyn: daviid: ok daviid: I can't find the definitionof the scale-factor propoerty str1ngs: tohoyn or you can do (when (is-a? widget ) (!title window)) str1ngs: daviid: https://developer.gnome.org/gtk3/unstable/GtkWidget.html#GtkWidget--scale-factor str1ngs: its a property str1ngs: daviid: that's unstable just FYI meant to link the stable one daviid: it's ok i got it tx daviid: tohoyn: so, in the mean time, you may call (gtk-widget-get-scale-factor hbox) of course ... daviid: str1ngs: g-value's are definitely implemented ans used everywhere in g-golf, like g-closure's in general, signals i particular, yet to come callbacks ... everywhere - there are also functions that expect Gvalue as argument(s), like gtk-list-store-set-value, gtk-tree-model-get-value, and this gtk-container-child-get-property daviid: tohoyn: for info, gtk-container-child-get-property last argument is 'in, not out str1ngs: daviid: ya how this would work in C is you would do GValue x; then you g_value_init . and then pass x as the last value. and it gets mutated str1ngs: it's like how GError works as well str1ngs: actually you would past the reference with &x daviid: tohoyn: it sys "scale-factor" is not a child property of ... tohoyn: daviid: resize and shrink are child properties daviid: not of window daviid: tohoyn: to test, i need an example that 'works' bcuse i need to look in the doc, find the type, ... daviid: (gtk-container-child-get-property window hbox "scale-factor" ...) is incorrect daviid: so is incorrect shrink .. daviid: do you have a working C example? tohoyn: daviid: no tohoyn: daviid: I do have a Scheme example using guile-gnome str1ngs: daviid: gtk-container-child-get-property finds the property of hbox daviid: can you writ that in g-golf then daviid: that call str1ngs: it won't work because you need to pass a gvalue daviid: str1ngs: hold on daviid: let me handle this str1ngs: and there is no way to create a GValue as far as I know. daviid: i need a plausible call tohoyn: (gtk-container-child-get-property window-main hbox "scale-factor" x) daviid: (gtk-container-child-get-property window hbox "scale-factor" ...) is incorrect str1ngs: https://paste.gnome.org/pzflc9uly does the same thing str1ngs: ^ more scheme like IMHO daviid: tohoyn: you don't understand, scale-factor is not a chld property for gtkwindow tohoyn: daviid: forget scale-factor. The problems are resize and shrink daviid: resize and shrink are not either ... tohoyn: daviid: ??? daviid: i thnk you dont understand how this work, if i may say so ... tohoyn: daviid: see https://developer.gnome.org/gtk3/stable/GtkPaned.html#GtkPaned.child-properties daviid: (guile:106981): Gtk-WARNING **: 04:54:03.433: ../../../../gtk/gtkcontainer.c:1264: container class 'GtkWindow' has no child property named 'shrink' daviid: tohoyn: daviid: do you use GTK2? daviid: yes, so the call should ass an hbox and a chld .. daviid: not a gtkwindow and an hbox ... tohoyn: daviid: resize and shrink are child propertied of GtkPaned daviid: tight, not of gtkwindow daviid: the call you pasted is incorrect tohoyn: daviid: yes daviid: so, please paste a correct example i can try, forget about g-value, i'll handle it, i ned a proper example of a 'working' child property daviid: thos you pasted are all incorrect tohoyn: daviid: see https://paste.gnome.org/pw6qms3mt tohoyn: daviid: sorry for the incorrect code daviid: ok let me try daviid: tx daviid: i don't want to imprt the all gtk namespace, what is the name of the info to get hpand/vpaned procs, here (gi-import-by-name "Gtk" "Paned") is insufficient it appears tohoyn: daviid: wait ... tohoyn: daviid: for me it is enough daviid: i fund it tohoyn: daviid: gtk-container-child-get-property is defined daviid: it is (gi-import-by-name "Gtk" "HPaned"), i missspelled it imn my previous call ... str1ngs: tohoyn: which property of hbox did you want? tohoyn: str1ngs: resize and shrink (child properties) str1ngs: what type is resize bool? tohoyn: str1ngs: both are boolean str1ngs: I'm just putting a C example together str1ngs: thanks str1ngs: (guile-2.2:436367): Gtk-WARNING **: 01:11:21.671: ../../../../gtk/gtkcontainer.c:1264: container class 'GtkWindow' has no child property named 'resize' tohoyn: str1ngs: try to add a gtk-paned object into another gtk-paned daviid: tohoyn: ok, here is what I wnted to test so I could give you the proper feedback, str1ngs: as daviid pointed out this only works if there are child properties like paned tohoyn: str1ngs: see https://paste.gnome.org/pw6qms3mt daviid: the last argument of gtk-containerchild-get-property is a pointer to a g-vlue, that _must_ be initialized, that is it can _not_ be an empty g-value daviid: here is what works - https://paste.gnome.org/p7trju0x3 tohoyn: daviid: tx! daviid: welcome - please also note in this example, scrpts must import goops _before_ the defaut-duplicate-binding-handler call, then you import g-golf and selectively import the rest ... daviid: tohoyn: so, you must know the child property type before to b make these call daviid: tohoyn: str1ngs I want to patch g-value-init so it accept the symbol or the g-type, so we can short calls in our caode .... it was not ment to be called when i desned it lng ago ... will do this now! :):) daviid: tohoyn: also, while debugging g-golf, I prefer scripts asjust pasted, in pace of those using , please keep it as a way to work with me .. thanks! daviid: *in place of ... it uses and gtk-main ... unless the test is about of course ... daviid: tohoyn: str1ngs if/when the function you call accept an empty (pointer to) a GValue, use (g-value-new) tohoyn: daviid: how do I get the boolean value out of GValue? daviid: for 'in 'inout args of course, you ahould never pass 'out args (i know you know, but just reminding ... daviid: always use (g-value-ref g-vlue), it knows its type ... tohoyn: daviid: tx daviid: tohoyn: you ca see that in the example i pasted daviid: line 47 daviid: tohoyn: dimfi is 'my version' of peek/pk, it is in (g-golf support utils) fwiw str1ngs: daviid: here's a working C example https://paste.gnome.org/pd9p9hk7l daviid: used only to debug str1ngs: is there a g-value-new? daviid: ys daviid: i just wrote it above :) daviid: wrote about it here above :) str1ngs: i've never heard of g-value-new before daviid: str1ngs: I know how to do these things in C, but thanks for the example - it's amazing how much more beautifull things are i scheme ... :) str1ngs: nothing wrong with C :P daviid: str1ngs: g-value-new is new :), introduced a couple of patches ago i think str1ngs: well I better git pull. that would explain alot lol daviid: str1ngs: i need to add it to the manual daviid: will do that now to str1ngs: I think maybe (g-value-new 'int) would be better? str1ngs: or more like dunno if that is actually a class though str1ngs: main things would be 'int 'string 'boolean etc str1ngs: but let me see if g_init works str1ngs: g-value-init I mean daviid: no, because we need both, and g-value-init is the scheme call for g_value_init ... str1ngs: tha't fine as long as (g-value-init) works but it only takes one argument which is odd str1ngs: should be more like (g-value-init x ) maybe? str1ngs: daviid: gtk-init is be deprecated so it's kinda hard to keep pushing that :) str1ngs: unless we can come up with a simple main loop daviid: str1ngs: for debugging g-golf, i prefer scrits as I wrote above, unlss it is to debug calls ... daviid: gtk-mai is the simple loop daviid: *gtk-main str1ngs: the problem will be though is gtk-init is going to be deprecated completely eventually. and it's not what GTK teaches anymore daviid: as I said, to debug g-golf ... str1ngs: I'm just giving you a heads up, you can't expect people to use gtk-init when it's functionality is heading out the door. things change. str1ngs: but I should get some sleep. str1ngs: good night daviid: good night daviid: tohoyn: i just pushed a patch so now you may also call g-value-init passing a symbol, which then must be a %g-type-fundamental-types daviid: tohoyn: in the example we used, you may replace the call by (g-value-init 'boolean) tohoyn: daviid: ok dsmith-work: UGT Greetings, Guilers RhodiumToad: yo dsmith-work: str1ngs: Nice! dsmith-work: str1ngs: I have muscle memory for C-right and C-left to move by words. That's bound to slurping and barfing. tohoyn: When I try to change the font of the text in a text buffer I get crap onto the screen. See https://paste.gnome.org/poaxcmiub to reproduce the bug. tohoyn: If I don't apply the tag the code works fine. tohoyn: Can somebody help me with this? tohoyn: The code uses G-Golf zzappie: Hello guilers! zzappie: Any one knows of fuse guile library? dsmith-work: Nope. But a simple gsearch revealed this: https://github.com/sph-mn/guile-fuse str1ngs: dsmith: slurping and barfing is so handy. from some reason it's one of the last things I decided to learn lol str1ngs: for* str1ngs: tohoyn: I'll take a look in a second str1ngs: tohoyn: it shows file contents for me here. str1ngs: tohoyn: I did notice you have two (iter (gtk-text-buffer-get-start-iter textbuffer)) and only one is useful here. str1ngs: plus one shadows the other. I'm not sure how guile handles those situation or if that might be the cause. zzappie: dsmith-work: Hey thanks ive found it too and was stuck exploring this person's profile for about an hour he or she did lots of cool stuff tohoyn: str1ngs: I get squares with hexadecimal numbers. removing the first get-start-iter didn't help. tohoyn: str1ngs: the upper parts of the hexadecimal numbers are zeros dsmith-work: Just guessing, that might be a locale thing? tohoyn: see https://pasteboard.co/J50Chx9.png for the output tohoyn: dsmith-work: possible tohoyn: str1ngs: what locale are you using? tohoyn: dsmith-work: setting LANG=C didn't help dsmith-work: Or maybe what fonts are installed? dsmith-work: Aren't those hex boxes because couldn't find the right thing to be displayed for that character? tohoyn: dsmith-work: it is the fonts tohoyn: dsmith-work: font "Sans 18" works fine tohoyn: dsmith-work: tx tohoyn: Courier 18 doesn't work either tohoyn: it would be nice to have Courier fonts stis: hi guilers! sneek: Welcome back stis, you have 1 message! sneek: stis, manumanumanu says: Could you help me port 3 seemingly simple syntax-parse things from racket? I am porting parsack to guile, and that is about the only thing left stis: manumanumanu: shoot! str1ngs: tohoyn: I'm using en_US.UTF-8 str1ngs: tohoyn: though it's probably a missing font I would think? tohoyn: str1ngs: probably tohoyn: I'm going sleeping. dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: bugs? sneek: Someone once said bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile dsmith-work: sneek: gnucash? sneek: Last time I checked gnucash is amazing dsmith-work: sneek: where is guile-software? sneek: guile-software is at http://sph.mn/foreign/guile-software.html dsmith-work: sneek: where is guile-software? dsmith-work: sneek: where is guile-software? sneek: Someone once said guile-software is at http://sph.mn/foreign/guile-software.html dsmith-work: sneek: seen rlb? sneek: rlb was here 4 days ago, saying: OK, finally have 3.0.2 in debian and "settled" such that it should be able to propagate to testing (hadn't noticed some issues that had prevented propagation of 3.0 in general up to now).. dsmith-work: sneek: later tell glorx some message sneek: Okay. glorx: Hey sneek: Welcome back glorx, you have 1 message! sneek: glorx, dsmith-work says: some message dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen rlb? sneek: rlb was here 4 days ago, saying: OK, finally have 3.0.2 in debian and "settled" such that it should be able to propagate to testing (hadn't noticed some issues that had prevented propagation of 3.0 in general up to now).. dsmith-work: sneek: where is guile-software? sneek: Someone once said guile-software is at http://sph.mn/foreign/guile-software.html dsmith-work: sneek: help dsmith-work: sneek: seen rlb? sneek: rlb was here 4 days ago, saying: OK, finally have 3.0.2 in debian and "settled" such that it should be able to propagate to testing (hadn't noticed some issues that had prevented propagation of 3.0 in general up to now).. dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: where is guile-software? sneek: Someone once said guile-software is at http://sph.mn/foreign/guile-software.html dsmith-work: Hmm. Seem to be working nicely rndd: hi everyone! newbe question alert! suppose i want to use a library written in guile. can i just load it as local files instead of placing source code inside guile directory? mwette: set GUILE_LOAD_PATH to point to directory where the files are. mwette: or guile -L path/to/files lampilelo: i think i can make a bytevector of size (sizeof '*) and put the address stored in the pointer there, then bytevector->pointer, not sure though lampilelo: seems sketchy for sure mwette: I think you have it. mwette: But you need the pointer-pointer to point to something, right? mwette: Or are you just getting a pointer back? lampilelo: i invoked C function that returns a pointer to a new object mwette: I think you should be OK. lampilelo: i hope nothing blows up lampilelo: ok, it appears to be working, it blown-up at first but after some changes (that in my mind shouldn't change anything), it started working lampilelo: but now i wonder what happens with a char* returned from the function, it's allocated on the heap, so i guess i should free it? lampilelo: guile doesn't automatically put it under GC? lampilelo: it's so confusing, next time i lampilelo: i'll do it with a module in c mwette: No. You want a finalizer. Maybe you could use a guardian (see ref man) and call free(). mwette: I'm working on a tool to automate generating FFI code from C headers. I don't know how to approach the memory management issue in a general, or semi-automated, sense. lampilelo: how do i make a finalizer from guile then? lampilelo: you mean i just make a foreign function pointer to the specific free function? mwette: not sure in this case. If you use foreign objects, then I think it can be done. mwette: guardians -- you add the object to a guardian and then poll it. When the gc is ready to free the pointer the guardian will cough it up and you can free the memory. mwette: or if you can get your C code to use scm_gc_malloc() from libguile lampilelo: ah, i see, i didn't know about guardians lampilelo: ok, that's it for today, thanks for the guidance mwette mwette: seeya dsmith: Especially coughing guardians... mwette: ... technically speaking. daviid: dsmith-work, and others who are interested in guile-sqlite3 - https://notabug.org/guile-sqlite3/guile-sqlite3 daviid: tohoyn: do you read this channel log? tohoyn: moving discussion to the channel: Is it now possible to pass GObject types as procedure arguments in G-Golf? This is needed by list stores. tohoyn: what about GValue arguments? daviid: tohoyn: I pushed a series of patches that address the problems you raised, you should pull the latest g-golf devel branch, make/install and try again, here is a snipset - http://paste.debian.net/1141803/ daviid: I didn't try a gobject, but you should be able to do that, if not let me know, paste a snipset so can reproduce ... tx str1ngs: daviid : hello daviid, just a FYI there is now a g-golf package in guix :) tohoyn: daviid: The snippet works. daviid: str1ngs: ah great, thanks! do you have a way to 'mark it' as experirental there? str1ngs: tohoyn: I'm not sure I under stand the GObject question. can you elaborate? just that all g-golf classes derive from GObject. and you can pass them to procedures. daviid: tohoyn: great str1ngs: daviid I could have submitted it as g-golf-next. but instead I just commented in the declaration g-golf is still WIP str1ngs: as far as I know nomad is the only package that is using g-golf right now. so you'll have to manually install and use g-golf. tohoyn: str1ngs: GtkListStore needs GObject type arguments for the data str1ngs: and the nomad in guix is not the one ported to g-golf .. yet. str1ngs: tohoyn ah you mean like what nomad_scheme_get_type() would return? str1ngs: or macros like NOMAD_TYPE_SCHEME? tohoyn: str1ngs: I think that they are GTypeInfo structs str1ngs: makes sense now, thanks for elaborating. str1ngs: tohoyn: I might have missed your IRC queries apologies. tohoyn: daviid: The original list store example I sent you earlier works when modified tohoyn: str1ngs: it seems that G-Golf needs the types as symbols now tohoyn: str1ngs: primitive types like "int" and "string" str1ngs: symbols makes sense for this. like how flags and enums work. tohoyn: str1ngs: actually I suspect that the types passed as arguments are GType values tohoyn: str1ngs: see https://developer.gnome.org/gtk3/stable/GtkListStore.html#gtk-list-store-newv str1ngs: i'm curious what your use case is here tohoyn are you using a Tree or Model? dsmith: daviid: Ah. Thanks for the link. tohoyn: str1ngs: do you want to see the list store example? str1ngs: tohoyn: sure that would be interesting, thank you. tohoyn: str1ngs: see http://paste.debian.net/1141811/ daviid: dsmith: welcome, I sent an email to the list maintainer, it should appear there as well soon hopefully str1ngs: tohoyn: treeview makes sense, thanks for the example. str1ngs: I added this to g-golf examples :) dsmith-work: UGT Greetings, Guilers RhodiumToad: good afternoon tohoyn: daviid: hello tohoyn: daviid: GtkTreePath is not imported properly. After (gi-import-by-name "Gtk" "TreePath") type is not defined. daviid: tohoyn: it seems it is a struct, not a gobject tohoyn: daviid: yes daviid: opaque struct can only be used through there api interfaces tohoyn: daviid: ok daviid: tohoyn: about the list-store gobject problem, if you can paste a small example I can 'play with', that would help daviid: same for GtkTreePath if you have a problem tohoyn: daviid: see https://paste.debian.net/1141871/ for passing GOOPS objects as G-Golf argument tohoyn: daviid: it doesn't work daviid: ok, will look at it tx daviid: tohoyn: not sure what you expect, wrt to your paste, gtk-list-store-newv expect a list of g-type tohoyn: daviid: to pass the object into the store tohoyn: daviid: there is a bug with tree views, see https://paste.debian.net/1141881/ daviid: you must call gtk-init tohoyn: daviid: ok tohoyn: daviid: it works now daviid: tohoyn: yes, but back to your earlier paste, is not a g-type, so there is no way to initialize the GValue ... tohoyn: daviid: ok daviid: tohoyn: are you by any cahnce trying to reproduce something that did work using guile-gnome, that I can look at to compare? tohoyn: daviid: I'm trying to make G-Golf support to my own programming language Theme-D. If I encounter such problems I will report to you. tohoyn: daviid: I have already implemented guile-gnome support to Theme-D. daviid: i doubt you could do (gtk-list-store-newv 2 '(int )) in guile-gnome but ... daviid: tohoyn: what should work is (gtk-list-store-newv 2 '(int object)) - but then gtk-list-store-set-value will currently fail, even if you pass a g-object subclass instance, which might be a bug, though I don't know how a list-store would render such a value, it still might be a bug/limitation of g-golf as it is *: sneek stretches tohoyn: daviid: function gtk-text-buffer-create-tag is not imported when you do (gi-import "Gtk"). I suppose that it is because the function has a variable argument list. daviid: probably dsmith-work: So I finally did it. I've enabled paredit in Scheme buffers. Just gotta do it. daviid: str1ngs: I pushed a series of patched to g-golf, wich (I hope) complete the implementation related to imported functions that use GValue argument(s) dsmith-work: UGT Greetings, Guilers daviid: str1ngs: when you have the opportunity, please pull, make, install and see if everything is ok for your use case, nomad, and let me know ... the changes are importants, and affects every imported function, as well as signal calls ... daviid: str1ngs: you should clean and recompile nomad entirely dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: where is bugs? dsmith-work: sneek: bugs? sneek: Someone once said bugs is send reports to bug-guile@gnu.org, and see bug reports at http://bugs.gnu.org/guile mwette: https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=guile mwette: https://bugs.gnu.org/guile works dsmith-work: sneek: forget bugs sneek: Consider it forgotten. dsmith-work: sneek: bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile sneek: So noted. adfeno: Hi there, does 8sync have XMPP integration? adfeno: I'm trying to find a way to make XMPP messages be delivered to IRC channel and vice-versa. adfeno: XMPP in question is a MUC chat room. dsmith-work: adfeno: bitlbee does that, I'm pretty sure. It's not Guile, but it's been around for ages. adfeno: So I configure an account in Bitlbee, make it connect to both XMPP MUC and IRC channel, and it can replicate the messages back and forth? adfeno: automatically? dsmith-work: Hmm. I think it just exposes things like xmpp as irc. Didn't see the vice-versa. adfeno: I asked here too since XMPP is mostly XML and Guile, as far as I know, has procedures to convert XML to Scheme code. adfeno: So I thought that it would have support for some sort of XMPP bouncer bot from IRC to XMPP and vice versa. adfeno: I also asked in #8sync adfeno: Sorry, I meant: also asked in #gnu (since #8sync is somewhat empty now) dsmith-work: So, this is somthing the bot should not rememeber, seen dsmith-work: So, this is somthing the bot should not rememeber, since dsmith-work: sneek: botsnack sneek: :) dsmith-work: Yey dylanjm: Does anybody have any references to current guile projects that make use of the foreign object interface? I would like to create an extension to imagemagick and the closest project I can find is guile-cairo but it appears to use the old SMOB way of creating objects. rekado: dylanjm: guile-xapian uses SWIG rekado: https://git.systemreboot.net/guile-xapian/tree/ dylanjm: @rekado Thanks, I will check it out. dsmith-work: dylanjm: wingos guile sqlite interface uses the ffi. dsmith-work: dylanjm: Not sure where that is since gitorius went away dsmith-work: sneek: guile-projects? sneek: Last time I checked guile-projects is http://www.gnu.org/software/guile/gnu-guile-projects.html dylanjm: dsmith-work: I'll do some digging, besides on the guile website is there a place you know of that has a collection of guile projects? dylanjm: sneek: I've combed through there already and guile-cairo was the closest I could find that matches what I think I need. dsmith-work: sneek: guile-software ? sneek: guile-software is at http://sph.mn/foreign/guile-software.html dsmith-work: dylanjm: There is the more complete list dsmith-work: sneek: forget guile-projects sneek: Consider it forgotten. dylanjm: ahhh thank you. dsmith-work: Hmm. The sqlite iface is not there. adfeno: In case new people have joined and didn't see my message: Do you know a XMPP-to-IRC and IRC-to-XMPP bot to bridge an XMPP MUC with an IRC channel ? dsmith-work: adfeno: What is a MUC? (just curious) dsmith-work: Doh. Multi User Chat Aurora_v_kosmose: Doesn't SWIG exclusively to the extension-method rather than dynamic FFI? Aurora_v_kosmose: *do dsmith-work: Aurora_v_kosmose: Ya, pretty sure swig gens C code. It used to anyway. adfeno: For anyone interested, I found a possible solution for my question, although (as the link explains) I'll wait for the reviewers to see if it's free: https://directory.fsf.org/wiki/Hybridbot Blackbeard: adfeno: why not just using matrix? Blackbeard: There are bridges for both IRC and XMPP adfeno: I don't think making an account there makes sense. adfeno: And if I do so, I would have to choose between making a relay in the big matrix.org node or rolling my own. adfeno: Whilest the group I belong to is somewhat low on resources to do that. Blackbeard: adfeno: I don't say use matrix.org servers. Just the protocol. rekado: Aurora_v_kosmose: yes, you’re right. Blackbeard: But that seem offtopic here adfeno: We do already have a self-hosted XMPP adfeno: Blackbeard: Indeed, sorry for that, I was just closing on the request I made earlier :D Blackbeard: adfeno: I was talking about my idea being offtopic hahha adfeno: Oh I see. Aurora_v_kosmose: rekado: Ah, alright. I'd been using the Debian version which was so limited (which is why I did it by hand in the end), but it could've just been outdated. adfeno: I was hoping for 8sync to have implemented that (since as far as I know, XMPP uses XML) but it doesn't. Once 8sync adds support for that I'll reconsider. I do like 8sync and Guile by the way. Aurora_v_kosmose: 8sync's looking pretty neat. I've been keeping an eye in its general direction. adfeno: Also, Guile does offer ways to parse XML, so I was quite surprised for 8sync to focus on IRC first. Aurora_v_kosmose: Though given SXML's docs, SXPATH is kind of the only thing I'd want to use. Aurora_v_kosmose: & match, I guess. rekado: long time ago I started work on an XMPP library for Guile, but abandoned it midway lampilelo: with FFI: how can i make a pointer to a pointer? i made a pointer to an object and the c function takes a pointer to it as an argument (i.e. i have TYPE* and i need to get TYPE**) seepel: Hi guile, I'm still playing around with cps and I keep seing primcalls that have dotted pairs in the dst field, but I can't figure out what they mean. Does anyone have any ideas or can point me to a good place to learn about the dst field? seepel: Managed to find a few instances of these dotted pairs being utilized in the bytecode compiler. Mostly things like scm-set!/immediate. But cache-ref and cache-set! are still a bit of a mystery. Maybe it'll be the next blog post. Aurora_v_kosmose: Any general suggestions on Guile testing? Aurora_v_kosmose: A quick search shows Greg as being a thing. Aurora_v_kosmose: Hm. SRFI-64. daviid: Aurora_v_kosmose: fwiw, I use guile-lib unit-test for all my projects Aurora_v_kosmose: daviid: Seems like that & SRFI-64 are the current ways to do it. daviid: I personally don't beleive in 'current ways' nor do I select 'those' as criteria to orient/select anything I do, but as I said, fwiw ... you do as you wih of course Aurora_v_kosmose: Current -> supported and bugs are patched Aurora_v_kosmose: That's the main reason why I care. Aurora_v_kosmose: Abandonware has the downside that when something breaks, you're on your own. str1ngs: Aurora_v_kosmose: unit-test is quite nice. Aurora_v_kosmose: Does it have somewhat more wordy documentation somewhere? str1ngs: https://www.nongnu.org/guile-lib/doc/ref/unit-test/ Aurora_v_kosmose: Ah, that's the same as the info-pages. str1ngs: there is not much to it really str1ngs: create a test class derived from and then create generic methods with your assertions str1ngs: then call (exit-with-summary (run-all-defined-test-cases)) to run all the tests Aurora_v_kosmose: Assertions will generate reports? str1ngs: exit-with-summary will Aurora_v_kosmose: Ah, I see. str1ngs: Aurora_v_kosmose: here's a really basic example http://paste.debian.net/1141259 str1ngs: Aurora_v_kosmose: one of the nice things about unit-test is you don't have to run your tests at load time. str1ngs: so where you call (exit-with-summary (run-all-defined-test-cases)) is subjective. Aurora_v_kosmose: Ah, I see. Aurora_v_kosmose: Somewhat offtopic, but Nomad seems like a nice project. str1ngs: it's definitely really fun to hack on :) Aurora_v_kosmose: Is it in what you'd call a usable state or? str1ngs: It's pretty usable. though it's pretty bleeding edge. the version in guix is pretty basic compared to the current development version. str1ngs: but for the most part if you like emacs you'll probably like using nomad. str1ngs: I'm slowly gearing up for a new alpha release. but it's a big release. all of the C code as been ported to scheme. with the help of g-golf Aurora_v_kosmose: It does all rendering & everything in Guile? Aurora_v_kosmose: That's neat. str1ngs: all of the GUI GTK but using scheme and extensible. so for web-buffer it use webkitgtk. for term buffer it use vte str1ngs: there is an ibuffer for switching buffers etc. Aurora_v_kosmose: Huh, I see what you mean by Emacs-like. str1ngs: there is a working echo-area and most emacs keybinds just work like you would expect. str1ngs: alot more work needs to be done. I'm mostly laying the ground work for future additions. Aurora_v_kosmose: Huh, I might try it later. str1ngs: the version in guix is pretty stable but not as complete as the feature-g-golf branch. str1ngs: so better to build from git if you really want to try it out. Aurora_v_kosmose: Duly noted. str1ngs: and there is #nomad-browser if you need help with anything. or have suggestion or bug reports. Aurora_v_kosmose: Thanks. The channel probably ought to be mentioned on the Nomad page. str1ngs: noted :) mwette: di leoprikler: anadon: invoke is from guix, if you're writing normal guile code, you'll probably be happy with system* jcowan: My general impression of sxml is that the design is elegant, the implementation sloppy, and the documentation a disaster. chrislck: lol dsmith-work: The only thing good about sxml is the s. xml just rubs me the wrong way. Proably because of all those pointy sharp <'s and >'s everywhere. mwette: I've been working on a cookbook for SXML or at least (sxml xpath). The tools are pretty useful. But I agree, the documentation needs work. Aurora_v_kosmose: So, since when do Guile's pipes by default use UTF-8? str1ngs: seepel you need to have CFLAGS to find it easiest to use pkg-config mwette: In my nyacc parser generator examples (c, javascript, matlab) I use SXML as the format for the AST output, with sxml-match for pretty printer. Then I can translate to tree-il using (sxml fold). It seems like a clean approach to me. mwette: NEWS for Guile 2.2.0 release: String ports default to UTF-8 mwette: maybe that is related Aurora_v_kosmose: Yeah. Thanks. Aurora_v_kosmose: One of those things I like about Guile's module system is that you can restrict exports. chrislck: Aurora_v_kosmose: but you can always dig them out with (@@ (module-name) private-var) Aurora_v_kosmose: Huh. Interesting. I didn't know that was a thing, but I find it useful mostly for avoiding accidental name collisions. rlb: OK, finally have 3.0.2 in debian and "settled" such that it should be able to propagate to testing (hadn't noticed some issues that had prevented propagation of 3.0 in general up to now). Aurora_v_kosmose: Guile has some fairly nice performance. Aurora_v_kosmose: I converted an old Python script of mine, and the Guile result is about two magnitudes faster & 2/3 as long. civodul: hello! civodul: does anyone know of a D-Bus implementation for Guile? civodul: or bindings? mwette: I have only demo program in nyacc. examples/ffi/epoll.ffi + examples/ffi/dbus.ffi + examples/system/dbus.scm + examples/nyacc/lang/ffi-help/dbus-0?.scm civodul: oh nice! civodul: i should give it a try civodul: a good opportunity to play with nyacc civodul: :-) mwette: you can just go into examples and do ... https://paste.debian.net/1141208/ kristofer: hello! I've been working on a project with the awesome haunt static site generator! I'm curious, how do haunt users connect geiser to 'haunt serve -w' - or is that even realistic? mwette: civodul: I was walking through system/dbus.scm and noticed (use-modules (sched)) -- that should be commented out civodul: noted, thanks! marmulak: pretty fast dsmith: civodul: The bot only saves month and time. Tried to work around that (a future time must actually from a year previous.) dsmith: But I think the times are saved in the senders timezone. Ugh. dsmith: sneek: seen civodul sneek: civodul was here one year ago, saying: yay!. dsmith: silly silly bot civodul: sneek: botsnack sneek: :) dsmith: sneek: seen marmulak sneek: marmulak was here one year ago, saying: pretty fast. dsmith: sneek: seen marmulak sneek: marmulak was here one year ago, saying: pretty fast. dsmith: sneek: seen marmulak sneek: marmulak was here one year ago, saying: pretty fast. marmulak: damn dsmith: sneek: seen marmulak dsmith: sneek: seen marmulak dsmith: sneek: seen marmulak sneek: marmulak was here -58 minutes and -1 seconds ago, saying: damn. dsmith: Heh marmulak: something screwy's going on dsmith: sneek: seen marmulak sneek: marmulak was here 9 minutes and 27 seconds ago, saying: something screwy's going on. dsmith: Yess dsmith: mktime needs a timezone! Thought it defaulted to UTC but it default to TZ env var dsmith: sneek: seen civodul sneek: civodul was here 39 minutes and 52 seconds ago, saying: (dated Mar. 30). dsmith: Must have been #guix dsmith: sneek: seen dsmith sneek: I last saw dsmith 30 seconds ago, saying: sneek: seen dsmith. dsmith: sneek: seen civodul sneek: civodul was here 42 minutes and 12 seconds ago, saying: (dated Mar. 30). dsmith: sneek: seen civodul sneek: civodul was here 43 minutes and 3 seconds ago, saying: (dated Mar. 30). dsmith: OK seems to be working now. dsmith: Helps to actually read the docs.. dsmith: Sorry for all the noise, I need to remember to /msg or /query instead. dsmith: sneek: seen dsmith-work? sneek: dsmith-work was here 1 hour and 59 minutes ago, saying: Ah. timezone foolishness. dsmith: sneek: seen dsmith-work? sneek: I last saw dsmith-work 2 hours ago, saying: Ah. timezone foolishness. dsmith: sneek: botsnack sneek: :) mwette: speaking for those who live in the past ... *: sneek yawns seepel: Hi Guile! I'm trying to get my blog up and running with Haunt, and I'm wondering if anyone here knows how I might use a prefix like "blog/" for my posts, but have the collections page available at the top level? seepel: sneek: help seepel: sneek: later ask manumanumanu Here is the type inference blog post you asked about: http://seanplynch.com/blog/understanding-the-guile-type-inferencer.html. Hope it is helpful! sneek: Okay. seepel: If anyone else is interested, I'm all ears for feedback! I haven't blogged since 2013 :-D mwette: seepel: Thanks -- That's awesome. I have dug into lang/cps a bit. I'll want to peek into (l cps types) now. mwette: I have a package on sv.nongnu.org called nyacc. I have example compiler in nyacc (examples/nyacc/lang/calc) that just does simple calculations using tree-il and cps. And I've been into lattices for a bit, too. Are you into that? seepel: Just getting into it now! I appreciate that it is a different approach compared to Hindley-Milner for sure. It also _feels_ like it is more applicable to Scheme/Lisp. As is evidenced by most implementations using it (aside from maybe Typed Racket?). seepel: I have also been looking into how CMUCL/SBCL do this, and it seems rather similar. mwette: not familiar with that stuff but keep it coming seepel: I definitely hope to! Though I think work life is going to catch up with me again next week. mwette: I know the drill! seepel: I really appreciate the encouragement though! Thank you! mwette: OK. Have a good one. Gotta go now. seepel: You too! Aurora_v_kosmose: What happens when a pipe gets gc'd by going out of scope if it hasn't been closed? Aurora_v_kosmose: Does it kill the subprocess, or does it simply make it unreachable from within the Guile program? Aurora_v_kosmose: 3> The garbage collector will close a pipe no longer in use, and reap the child process with ‘waitpid’. If the child hasn’t yet terminated the garbage collector doesn’t block, but instead checks again in the next GC. | Manual mentioned it. Shame on me. dsmith-work: Happy Friday, Guilers!! marmulak: u2 *: chrislck is slowly learning to enjoy the benefits of guix... can run an indeterminably high number of packages via simple guix environment --ad-hoc packagename... and easily undo via 'exit'. the problem is the discoverability of these packages! marmulak: hm civodul: chrislck: unsatisfied with "guix search"? :-) chrislck: not dissatisfied... but e.g. "guix search libre" doesn't show libreoffice... because it was never there? has no package manager? need to add sources? civodul: "guix search libre" does show libreoffice, but also many other things chrislck: oh it *is* there civodul: yeah, the package name is always matched civodul: it's definitely not perfect though! chrislck: guix feels like an autistic savant :) chrislck: ok easy: i can run guix as above to run package; other incantations are useful as a package developer? chrislck: (didn't mean to demean guix nor autism... I meant it as a term of endearment) civodul: chrislck: for developers, there's https://guix.gnu.org/manual/en/html_node/Development.html#Development civodul: for package developers, https://guix.gnu.org/manual/en/html_node/Defining-Packages.html links to several tools civodul: (i agree the reference to autism was inappropriate) mbakke: also './pre-inst-env guix refresh -u ' to update packages in your Guix checkout :) chrislck: yups/ can't backtrack from that one, was a brain fart civodul: yup, "guix refresh" is pretty cool civodul: this whole Guix thing is pretty cool actually civodul: :-) Aurora_v_kosmose: The reduction of the binary seed for bootstrapping Trustable machines is a cool part of the project too. chrislck: On a very high level concept I agree it's da bomb too mbakke: if only we had trustable hardware to go with it d4ryus: Hi, i think (iam not sure though) there is a bug in the srfi-18 (threads) implementation in guile 2.2 and master. When mutex-unlock! is called (module/srfi/srfi-18.scm +306) with a condition and a timeout, it first resets the owner and then waits for the condition. If the timeout is reached (threads:wait-condition-variable returns #f) the cond's else condition returns #f. Now the owner is #f, which d4ryus: prevents one from unlocking the mutex, due to the early return if owner is #f. Am i missing something? Aurora_v_kosmose: mbakke: Aye, that's harder. Aurora_v_kosmose: How is this page updated: https://www.gnu.org/software/guile/libraries/ ? chrislck: is it feasible to run an old version of a package? e.g. guix environment --ad-hoc python@3.7.0 Aurora_v_kosmose: I recall hearing it's possible to pull arbitrary checksum-versions of the guix repository, so yes. Is there a more convenient way? I don't know. Aurora_v_kosmose: s/checksum-versions/commits/ ; weird brain glitch for a sec chrislck: so, like git checkout HEAD^200, run old-python, git checkout master Aurora_v_kosmose: Yeah. There's also ways to checkout the global system's guix into older commits but doing it with an explicitly separate clone is probably feasible and advisable. Aurora_v_kosmose: For all I know there's a way to do that in one step for a single environment run though. No idea. mbakke: chrislck: see 'guix time-machine' mbakke: (also, you'll likely have better results asking in #guix) :) Aurora_v_kosmose: Good point that. dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen rlb? sneek: rlb was here one day and 22 hours ago, saying: and some earlier posts iirc.. seepel: Hello Guile! Turns out I'm riding the struggle bus with Guix and Guile 3 again. I inside a guix environment --ad-hoc guile-next guile3.0-readline and when compiling my C program gcc cannot find . Anyone have any thoughts? Also, is this a question I should be asking here or over in #guix? rekado: seepel: I suggest adding gcc-toolchain to the environment *: dsmith-work giggles at "struggle bus". Saves it for later.. seepel: rekado: Let me give it a shot. gcc-toolchain is indeed in my user profile. Would that make a difference? The rest of my program that doesn't use guile compiles. Everything seemed to work a while back when I was using guile 2.2 seepel: Hmmm, no dice on adding gcc-toolchain to my environment. seepel: Oh I think this is a me problem. My Makefile looks a little different. Sorry for the false alarm everyone. civodul: :-) anadon: Where's the doc for `invoke`? seepel: I'm not familiar with that procedure, and it doesn't seem to be in the procedure index. What module do you expect it to be in? anadon: I thought it was a part of guile -- looks like it might have actually been guix. daviid: dsmith-work: you really need to publish this code somewhere, otherwise its qut dificult to help you :) dsmith-work: sneek: guile help cons dsmith-work: Hmm. dsmith-work: sneek: guile help cons sneek: No documentation found for: sneek: (srfi srfi-1): cons dsmith-work: sneek: guile help cons sneek: No documentation found for: sneek: (guile): cons dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: help Aurora_iz_kosmos: daviid: A language you say? dsmith-work: sneek: guile help cons-source sneek: `cons-source' is a procedure in the (guile) module. sneek: - Scheme Procedure: cons-source xorig x y sneek: Create and return a new pair whose car and cdr are X and Y. Any sneek: source properties associated with XORIG are also associated with sneek: the new pair. dsmith-work: Hmm. dsmith-work: cons isn't in guile-procedures.txt anymore. (help cons) doens't work. dsmith-work: Odd dsmith-work: sneek: guile help null? sneek: `null?' is a procedure in the (guile) module. sneek: - Scheme Procedure: null? x sneek: Return `#t' iff X is the empty list, else `#f'. Aurora_iz_kosmos: What was the proc to expand "~/" properly again? mwette: hmm.. that's usually glob but I don't tthink guile has it. guix has (guix glob) -- maybe something in there Aurora_iz_kosmos: Hm. Importing guix as a lib in a script just for that sounds a tad much. Aurora_iz_kosmos: Ah. Wait. "~/" gets expanded by the shell prior to being seen by a program, yeah? mwette: I don't think so. of course `~' is (getenv "HOME") Aurora_iz_kosmos: It appears to be so in bash. Convenient, I don't need to deal with it. Aurora_iz_kosmos: Was there a way to silence the compilation output? seepel: Has anyone sorted out how to get a proper guile-readline working with Guile 3 and Guix? mwette: seepel: I think you need to install guile-readline mwette: and (use-modules (ice-9 readline)) (activate-readline) as usual seepel: mwette: I called `environment --ad-hoc guile-next`, then when I fire up the repl it tries to find readline in the 2.2 site-dir seepel: I tried searching in guix for a guile-readline that was for version 3 but didn't find it. mwette: ah, guile3.0-readline seepel: Oh thank you a million! At first I was like "I don't need no stinkin' readline" and then I started to lose my mind :) mwette: yw Aurora_iz_kosmos: If I set the encoding of a file with ";; coding: utf-8", do I need to use fluids to set string ports to utf-8? alextee[m]: Does libguile build on mingw? alextee[m]: It isnt in the msys2 repos last time i checked, it said there was a bug daviid: alextee[m]: https://packages.msys2.org/base/guile - iirc, you need to install it daviid: pacman -S libguile daviid: https://packages.msys2.org/package/libguile?repo=msys&variant=x86_64 alextee[m]: daviid: that is not libguile alextee[m]: only the binary daviid: pacman -S libguile-devel alextee[m]: there is no mingw-w64-libguile alextee[m]: daviid: that still doesnt work alextee[m]: it's only for the native arch alextee[m]: it should start with mingw-w64 alextee[m]: like this: https://packages.msys2.org/base/mingw-w64-gtk-doc alextee[m]: should say: Repo(s): mingw32, mingw64 alextee[m]: let me find the issue daviid: alextee[m]: i use msys2 alextee[m]: i use msys2 too, libguile is not found when i use meson alextee[m]: it needs to be one of those mingw packages daviid: but that' a different issue no? eveythngis in msys2 alextee[m]: idk, im just trying to build a windows binary that can use libguile alextee[m]: can you do that with msys2? i think you need mingw daviid: anyway, just a user there, it really is when I have to that I use msys2, daviid: alextee[m]: i don't think so, but i'm not interrested in window binary(ies), when I have to d anythig on win, I tell users to install msys2 and run from there daviid: window (native build) is a total nightmare, afaict just reading others experience ... alextee[m]: it is a n ightmare alextee[m]: it looks like MXE has guile, i will try building it from there alextee[m]: https://github.com/mxe/mxe/blob/master/src/guile.mk alextee[m]: but version 1 :/ alextee[m]: no one has built libguile for windows yet? daviid: good to hear :), but I don't kow how to help, I just wanted to tell you that evrythng is in/on msys2, but that is to be usd in msys2 itself ... daviid: the guile msys2 package is 2.2.6-1, and its package description is 'funny':: "a portable, embeddable Scheme implementation written in C" alextee[m]: https://github.com/msys2/MINGW-packages/issues/3017 alextee[m]: "Guile not buildable for 64 bit. I will not produce half building packages in repo" alextee[m]: "This is known issue and we not have guile packages for mingw builded. You need contact guile devs to fix it. I will not do it." alextee[m]: https://github.com/msys2/MINGW-packages/issues/699 alextee[m]: https://github.com/msys2/MINGW-packages/issues/3298 alextee[m]: everyone's waiting for "guile devs" to "fix something" daviid: the msys2 is 64its afaict, and has threads, which are essentials for my needs on that sad platform ... alextee[m]: but msys2 is not usable when building projects using libguile targetting windows daviid: 'targetting window' is the problem :), target msys2 then ... alextee[m]: it's only useful for running guile commands during the build phase as far as i can tell alextee[m]: it's not feasible to ask users to use msys2, they're not programmers, you want to make the program easy to install alextee[m]: with mingw i got a (mostly) automated build going on, but withouht guile support daviid: not sure, why can't you install msys2 as part of your intall phase, then run the app 'in a transparent way' ... alextee[m]: that seems like a workaround than a solution, and im not sure if it will have implications alextee[m]: the "normal" way to build apps for windows is to build stuff with mingw daviid: alextee[m]: anyway, just wanted to point to the msys2 packages, I can't 'really help' I am afraid alextee[m]: np alextee[m]: (and thanks for the help anw :) ) mwette: Morning! dsmith-work: {appropriate time} Greetings, Guilers roptat: hi, i'm trying to use http-post (from (web client)) but it doesn't work: using curl I can do "curl https://example.org/page -d 'some-data'", but with guile, (http-post "https://example.or/page" #:body 'some-data') returns an error, as if no data were sent to that page roptat: what did I do wrong? roptat: (sorry #:body "some-data" of course, it's a string) mwette: roptat: do you have gnutls --with-guile installed? heisenberg-25: Hi, is there a generic function to find a type of variable in guile? mwette: sorry,configure option is --enable-guile rekado: roptat: what is the error you get? roptat: yes gnutls is installed and loaded roptat: the page returns a 422 error instead of 200 status, telling me some required fields are missing (I submit them) civodul: roptat: some servers require some headers, like User-Agent civodul: or Accept rekado: roptat: you could check that you’re sending the data in the right format by letting curl spit out the request headers rekado: and then use http-post on localhost to inspect the serialized request roptat: how so? Aurora_iz_kosmos: nc should be able to open a listening socket. Aurora_iz_kosmos: Mind you that won't work for http Aurora_iz_kosmos: *http2 roptat: it seems to be the same, except for the content-type roptat: I tried setting it in #:headers, but that didn't work, I have two Content-Type headers in the query... roptat: oh, it's content-type, not Content-Type roptat: ok, it worked! roptat: thanks for the tips :) civodul: wingo: got some weird profiles while looking at load times on ARMv7: https://issues.guix.gnu.org/issue/40626 civodul: ah wait, https://bugs.gnu.org/40626 rekado: (sorry about issues.guix.gnu.org; will be upgraded to work with raw debbugs data by the end of this week.) civodul: np! davexunit: another setback for live coding guile 3.0: procedures/variables get inlined where they are referenced, so when you, say, re-define a procedure at the REPL, all call sites continue to use the original until you also re-eval all of those as well, recursively. davexunit: "solution": avoid define, use define-method. davexunit: doesn't work for top-level variables that aren't procedures, though. those need to be boxed. davexunit: nothing I haven't been able to deal with, but maybe something that could be switched off when you're in dev mode. davexunit: similar to in GOOPS which is the metaclass I use when live coding with GOOPS. cbaines: Is there any to have Guile garbage collect less often, or maybe not at all? manumanumanu: cbaines: gc-disable? manumanumanu: that will work wonders for long-running processes cbaines: manumanumanu, Hmm, I see that procedure manumanumanu: cbaines: it is not documented, but it is available in the default environment cbaines: I only searched the documentation, I didn't search the source code cbaines: I guess like peek, it's a secret for some reason! Aurora_iz_kosmos: Aurora_iz_kosmos: Am I the only one who finds SSAX's manual section complicated and not particularly enligthening as to how to use it? Aurora_iz_kosmos: *enlightening RhodiumToad: no RhodiumToad: also, while it has been sort-of fixed upstream, there's still a bug Aurora_iz_kosmos: ? RhodiumToad: > in CDATA is misparsed, it is treated as an entity whereas it should not be RhodiumToad: the version on the author's webpage has been (silently, afaik) fixed, but I don't think anyone much noticed mwette: jobs dsmith-work: [3] mwette: dsmith-work: thanks! Aurora_iz_kosmos: The Racket docs seem somewhat more readable, though it remains rather complex. dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen rlb? sneek: rlb was here 21 hours ago, saying: and some earlier posts iirc.. dsmith-work: goodbot! dsmith-work: sneek: seen zeenix? sneek: xnox was here one month and 18 days ago, saying: wingo: there is no mention of scm_tc7_byvect in 1.8 news.. dsmith-work: sneek: seen fetsorn? sneek: I last saw fetsorn 3 months ago, saying: nckx: You beautiful person, thank you for guidance today, it all finally works.. dsmith-work: sneek: seen mwette sneek: mwette was here one year ago, saying: dsmith-work: thanks!. dsmith-work: Bah! dsmith-work: sneek: seen civodul sneek: civodul was here one year ago, saying: super weird. dsmith-work: seen glorkxx dsmith-work: seek: seen glorkxx bandali: dsmith-work, typo'd the bot name dsmith-work: tanks dsmith-work: snek: seen glorkxx bandali: np sneek: Sorry, no. dsmith-work: Ah. timezone foolishness civodul: one year ago, time flies! str1ngs: hello spk121 rlb: Looks like 3.0.2 survived the buildd gauntlet: https://buildd.debian.org/status/package.php?p=guile-3.0 mwette: nice work rlb: Thanks, though something went wrong with the "arch all" for the new 2.2 release that alongside the new 3.0 supports parallel dev package version installs. Have to fix that soonish: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid mwette: yea -- I have had issues w/ Ubuntu install of 2.2 which has /usr/bin/guile-2.2 but not /usr/bin/guild-2.2 and I have guile-3.0 under /opt/local so havoc often ensues. GUILE_EFFECTIVE_VERSION sometimes helps. I have changed my install to build guild based on targeted guile. rlb: mwette: that might be my fault. Happy to fix it if we need to. rlb: (fault indirectly) rlb: oh, right, that's directly affected by the recent changes, i.e. you can keep guile-2.2-dev installed (after they're available) independent of anything else. mwette: reported on launchpad as #1859033 mwette: your help is greatly appreciated! rlb: mwette: if they haven't changed things too much, and if you don't need the 3.0 packages installed at the same time, then you may already be able to fix your problem via "apt install guile-2.2-dev"? rlb: The recent changes just make it so that doing so doesn't conflict with an install of guile-3.0-dev. rlb: i.e. guild is in the -dev packages, not the guile-2.2 package. mwette: apt install guile-2.2-dev does not do it -- this is 18.04 BTW mwette: I've got something working so this is not a priority for me. mwette: I also have my own /opt/guile-rel/2.0, 2.2 and 3.0 for testing my nyacc pacakge rlb: mwette: might check to see what dpkg --listfiles guile-2.2-dev says... rlb: i.e. is guild-2.2 in there? rlb: Or did I misunderstand and that's not the problem... mwette: dpkg ... | grep guild => /usr/bin/guild rlb: Here's what I have: rlb: )$ dpkg --listfiles guile-2.2-dev | grep guild rlb: /usr/bin/guild-2.2 rlb: rlb: and /usr/bin/guild is provided via update-alternatives mwette: so a Ubuntu change? BTW /usr/bin/guile-2.2 is a symlink do ../lib/x86_64-linux-gnu/bin/guile mwette: s/do/to/ rlb: dpkg --version guile-2.2-dev? rlb: that symlink is normal, it's the unversioned paths that are managed by update-alternatives rlb: $ ls -l /usr/bin/guile rlb: lrwxrwxrwx 1 root root 23 Aug 6 2016 /usr/bin/guile -> /etc/alternatives/guile rlb: mwette: dpkg --version give dpkg version which is 1.19.0.5 rlb: dpkg --version guile-2.2 rlb: I meant rlb: sorry "dpkg --version guile-2.2-dev" mwette: sorry, I did that; it returns the dpkg version apparently rlb: sorry, don't know what I was thinking: dpkg --status guile-2.2-dev | grep -i version mwette: no problem; => 2.2.3+1-3ubuntu0.1 rlb: mwette: ahh, that was changed in 2.2.4+1-2 rlb: I thought those alternatives had been there for longer. rlb: So Ubuntu should pick that up whenever they move forward. rlb: You might be able to grab a newer debian source package or git tree, and build it yourself (after an apt build-dep guile2.2), but whether that would work without some changes to debian/control might depend on what build deps you have available. Happy to try to help if that ends up seeming useful. Suppose you might also be able to install newer versions from debian (main or snapshot.debian.org), but don't know how well that typically rlb: works. ATuin: j #lisp ATuin: ops wingo: moin lloda: hi wingo wingo: heya! ATuin: morning lloda: did you see my comment above about bitvector_ref wingo: lloda: not yet! wingo: where is it lloda: oh couple days ago wingo: feedback welcome, i have been noodling at bitvectors recently as you can see lloda: nvm it was just to mention a branch I started called wip-vector-cleanup lloda: I had done some of what you did there re: bitvectors lloda: put the arrays above instead of under wingo: ah good wingo: was yours a 3.0-compatible series or was it 3.1 material? lloda: 3.1 wingo: cool lloda: I want to change the interface of the 1-array functions so wingo: i think i found a way to get most of it in 3.0 -- the names were already quite inconsistent (e.g. bitvector-set! vs bit-set*!) so rationalizing the names is an opportunity to deprecate the old names wingo: just from the bitvector POV lloda: right wingo: i have no plans on the generic array interface so that is still all you wingo: when should we branch btw? lloda: there are a bunch of functions in bitvectors.c that actually take bit arrays and not bit vectors as arguments lloda: so I wanted to move that out wingo: yeah. i have deprecated most of them wingo: still working on it tho lloda: oh I didn't dare do that wingo: yes it was quite cheeky of me :) lloda: it's good wingo: but sometimes that's what's needed, it seemed like a good idea at the time, etc lloda: yeah lloda: I don't know about branching, afaic the sooner the better wingo: can do it any time wingo: would like an ok from civodul tho lloda: sounds good lloda: if you have time to look at wip-vector-cleanup that'd be great lloda: if not I'll keep rebasing on top of your patches wingo: lloda: tx for reminder civodul: Guix 1.1.0 is upon us! https://guix.gnu.org/blog/2020/gnu-guix-1.1.0-released/ mwette: contrat's to the guix team -- lot's of momentum going there it seems wingo: mwette: there are few functional modifiers on the bitvector interface as it is; you can bitvector-copy by make-bitvector + bitvector-copy! tho mwette: wingo: That's fine, but where is bitvector-copy!? It's not a in the core API. wingo: it certainly is! wingo: er wingo: humm :) wingo: good point :) wingo: it does exist, but as bit-set*! :-(( wingo: terrible interface mwette: Ah, missed it! wingo: in git you would (define (bitvector-copy src) (define dst (make-bitvector (bitvector-length src))) (bitvector-set-bits! dst src) dst) wingo: bitvector-set-bits! is like the now deprecated bit-set*! with #t mwette: That seems fine to me. wingo: i suppose a bitvector-copy can be more efficient than that tho, as it can just memcpy instead of memset to 0 then read both vectors, logior'ing the results and writing them mwette: I was doing algebra on regular languages, represented as FSMs, with states represented as bits in a bitvector. When generating synchronous product of FSMs I perform a number of bitvector operations. wingo: i can imagine lack of efficient bitvector-copy would be irritating mwette: yup dsmith-work: wingo! That arm jit patch by icecream95 seems to fix most probelms on arm. wingo: most? :) dsmith-work: I still get a segfault every now and then. dsmith-work: make check passes, but get about 4 failures with JIT_THRESHOLD=0 *: wingo nod wingo: they are deterministic for you? dsmith-work: No. :( wingo: uf :( wingo: well. already much better then, i should merge the thing dsmith-work: It seems to handle all the thumb->arm branch, jump, call with and without veneers. dsmith-work: And the 4byte offset alignment thing for BLX dsmith-work: I suspect that the segfault is unrelated. dsmith-work: That coolistic rr debugger is not available for arm. lloda: i'd be in favor of adding bitvector-copy! lloda: cf module/system/vm/frame.scm lloda: and -copy too lloda: i've been frustrated with the lack of regularity of copy/copy!/fill! in the various typed vectors manumanumanu: civodul: are there any performance benefits of switching to guile3? I remember there being questions about what it would really bring to have a JIT. I am all for it, of course, since all my programs magically got faster. civodul: manumanumanu: for Guix it's on the order of 10% "only" for core operations: https://guix.gnu.org/blog/2020/guile-3-and-guix/ civodul: but like i wrote there, Guix is i/o- and gc-intensive manumanumanu: That's still not bad! civodul: it really depends on the workload civodul: yes! civodul: definitely welcome, & for free civodul: in Guix one of the main performance issues is the compiler speed, which hasn't changed noticeably civodul: also because it's GC-intensive, i guess manumanumanu: Thanks for the explanation! manumanumanu: Does guile-parallax work? Looking at the source, I doubt it. manumanumanu: I don't understand how it could. seepel: Hi Guile! I've been having a lot of fun exploring compiler output by running stuff like (compile my-exp #:to 'cps) at the repl. Now I'm interested in exploring the type inference output. seepel: I think I've sorted out that I need to call infer-types from (language cps types), but I'm struggling a bit to understand what the arguments mean and how they relate to each other. seepel: Does anyone have any tips for me? Or maybe there is some documentation I missed somewhere? manumanumanu: seepel: i can't help you, but if you figure it out, could you write a blog post about it? I would be _thrilled_ to be able to inspect that. seepel: manumanumanu: That might be a big _if_ :) But I'll try. seepel: Do I assume correctly that it is wingo that would have written this code? manumanumanu: I think he wrote the CPS-part of guile, so that would be correct manumanumanu: you read the comments in the file i suspect? manumanumanu: I like the comments with diagrams, such as at line 1480 :D :D seepel: I did, maybe I'll read them again seepel: Yes, most of the comments I've read have been along those lines, describing the input bitvectors to the constraint propogation. I think my question is much higher level. Like, how do I actually call the procedure once I have a cps intmap. dsmith-work: seepel: There might be some insight at https://wingolog.org/ dsmith-work: For example: https://wingolog.org/archives/2014/01/12/a-continuation-passing-style-intermediate-language-for-guile dsmith-work: Wow. From 6 years ago. seepel: Ok, I sorted it out in the end. (infer-types (compile my-exp #:to 'cps) 0) will give me an intmap of vectors where each element in the vector is another intmap which seems to contain the bitfields for the types at the given program point. manumanumanu: can you translate that into something immediately useful? seepel: Hmmm, I don't think I can _explain_ everything, but I can dump what I have in my repl into a pastebin so there is something concrete to talk to. manumanumanu: I have been asking myself that for a while: what if I could get a part of what the compiler cannot infer. Say, as an optimization coach. Just knowing what can and cannot be elided would be cool (which can be understood from the disassembly probably, but I'm too stupid to read that) seepel: https://paste.debian.net/1140598/ seepel: So basically I made a simple function here, and inspecting the output of infer-types has inferred the function parameter `n` to be a number ranging from -inf.0 to +inf.0 seepel: Because I return the result of applying `+` seepel: At least that's what I _think_ it says :) seepel: manumanumanu: I have sooo many ideas for this information. One that immediately springs to mind is a much better auto-complete. seepel: Optimization coach is also a great idea! I was also thinking of something like that, though I was also wondering if you could build a solid linter. Also very interested in unboxing things. manumanumanu: cool! manumanumanu: Now: good night seepel: Good night! wingo: evening Aurora_iz_kosmos: What are the pros & cons of Records vs GOOPS objects? seepel: Aurora_iz_kosmos: I'd love to hear more answers as well, but one argument for records that I can think of would be that they are portable to other scheme implementations if that is something of concern. manumanumanu: Aurora_iz_kosmos: well, you can't do multiple dispatch on records manumanumanu: don't use goops records unless you want to use generics Aurora_iz_kosmos: Ah, that's definitely one worth considering. One-off datastructures could use either, but reuse would means GOOPS seepel: Is there a technical reason why multiple dispatch doesn't work on records? Or has it just not been implemented? manumanumanu: I don't know that, but I suspect that would mean complicating already complicated logic. goops isn't exactly trivial manumanumanu: I have been planning to implement a predicate-based multiple dispatch library for some time, but I never really got to it manumanumanu: (defmethod (add (s string?) (i integer?)) (string-append s (number->string i))) manumanumanu: something like that seepel: I've been mostly using (ice-9 match) to fill that niche myself, not perfect, but not terrible either. manumanumanu: probably faster than using multiple dispatch :D seepel: Draw back is that methods can't be dynamically extended, but that has been mostly ok for my purposes so far. wingo: Aurora_iz_kosmos: memory-wise they are the same. time-wise goops is a little more expensive but not terribly so. records provide more encapsulation; they aren't inheritable, accessors can be made private wingo: culturally records are more from the product type world, goops is more from the OO world wingo: also records have nice integration with `match'. that goops integration is less good is not fundamental (we could have a better, extensible match facility) but it's a consideration manumanumanu: it bothers me to no end that whenever I need r6rs records, they aren't compatible with match :( RhodiumToad: isn't that fixed in 3.0? wingo: manumanumanu: they are now! manumanumanu: OMG wingo: :) Aurora_iz_kosmos: wingo: I see. manumanumanu: christmas in april! seepel: wingo: Since you're here, do you mind if I ask what the main inspiration for the type constraint propogator is? If any? wingo: (records can be made inheritable fwiw, but only single inheritance) wingo: seepel: the original inspiration was getting a double result out of sqrt seepel: I've been looking into the CMUCL/SBCL code base, as well as reading some of Henry Baker's work on the subject (http://home.pipeline.com/~hbaker1/TInference.html) and would love additional resources if available. ArneBab: Does someone still have contact to ian? With tail call in Phase 3 of WebAssembly, a retargeting of his work WebAssembly might be doable: https://summerofcode.withgoogle.com/archive/2017/projects/6661485954596864/ → https://github.com/WebAssembly/proposals manumanumanu: there goes all my will to do any kind of work on an extensible pattern matcher wingo: seepel: sqrt returns a double iff the operand is a real number >= 0 wingo: ArneBab: i had a pass at doing tail calls in spidermonkey last year fwiw -- is a little complicated but we are keeping it in the plans ArneBab: cool! Aurora_iz_kosmos: manumanumanu: oh? ArneBab: wingo: what’s the state of tail call for wasm in FF? wingo: seepel: type + range inference does allow bounds check elision in some cases. it is not as good as the "ABCD" pass that ssa people do wingo: ArneBab: we are taking it into consideration when making abi changes but it's not staffed atm manumanumanu: seepel: I have also been looking at the sbcl source! The basic maths stuff are very fast in SBCL, and it is in part because SBCL is amazing, and in part because the functions are very optimized manumanumanu: just look at isqrt :D ArneBab: wingo: so Phase 3 isn’t "almost there" for wasm? wingo: ArneBab: it's waiting for more implementations. & specifically that browser implementors are convinced that fast solutions are possible wingo: it could go to phase 4 if jsc and v8 shipped it wingo: but there are some politics involved seepel: manumanumanu: I'll admit, I haven't gotten _super_ comfortable browsing the source on my own yet. I mostly follow MacLachlan's CMUCL design paper and follow along to the mentioned source files as best I can. manumanumanu: seepel: https://github.com/sbcl/sbcl/blob/62abc0aa4be49de4e4296f1de731aa9d03832f57/src/code/numbers.lisp#L1357 ArneBab: wingo: thank you for the info! ArneBab: wingo: but would that help get it in firefox? (that’s what I’m most interested in) manumanumanu: seepel: it is public domain, so I thought that I should some time have a go at porting some of these algorithms to see if they are any good in scheme as well seepel: I've been thinking exactly the same! seepel: But I'm just starting my journey, sounds like you have a head start seepel: From Henry Baker's paper the troubling thing is that he calls out specific problems that arise while trying to analyze Lisp-1s. But, on the other hand, it seems that the rules in all implementations I've found are much more ad-hoc than Baker presents, so maybe that would make the difference. manumanumanu: seepel: I have no education with computers what so ever: for all but a couple of things I do I am just throwing hours on things until it compiles :D :D wingo: fwiw i have found that the journey is long, it is a delight to move fast and quickly discover new things and concentrate and hack out a thing maybe, but it is very long too -- you need a lot of patience and low expectations for yourself wingo: otherwise you burn out early because you aren't happy with how fast things are going wingo: just my experience fwiw seepel: I can second that, I've been studying for about the last year and half just to figure out where I could possibly put some code down. Wrote my first code this week and have already had to throw out two versions. manumanumanu: my main benefit is that this is very much my hobby: i still feel an almost insatiable curiosity (even though getting srfi-171 into guile was pretty close to boring labour for the last couple of hours or so). manumanumanu: playing bassoon is work, though. Right now that is pretty boring since we are not allowed to have any live audience. Streaming isn't really the same :D seepel: manumanumanu: Does that mean playing bassoon is your day job? manumanumanu: it does! seepel: Oh cool! manumanumanu: if i would get 5 swedish krona everytime I get that reaction, I would have about 15 by now! RhodiumToad: heh seepel: Happy to be lucky number 3 :) manumanumanu: do we have a sneek manual somewhere? wingo: manumanumanu: that is a question for dsmith-work manumanumanu: dsmith-work: is there a sneek manual somewhere? manumanumanu: :D rlb: manumanumanu: wrt 3.0 performance, Andy's posted some bits about that a few times I think, e.g. https://wingolog.org/archives/2020/02/07/lessons-learned-from-guile-the-ancient-spry rlb: and some earlier posts iirc. RhodiumToad: I just ran some very crude timings on the little thing I wrote last weekend, and guile3 does seem quite a bit faster than 2.2 dsmith-work: manumanumanu: send the bot "help" RhodiumToad: it's a solver for the countdown number puzzle that I just wrote for practice, I'm actually curious what other people's solutions would look like seepel: I've just realized my analysis of the type analysis in my paste bin link was incorrect. What it shows is that the inferred _return type_ of the function is _any_ scheme value between -inf.0 and +inf.0. manumanumanu: sneek: help manumanumanu: dsmith-work: that help message needs some polish :P seepel: In case anyone is trying to follow along at home :) dsmith-work: Not much in there is it.. manumanumanu: it replied in a query manumanumanu: but it didn't tell me anything useful :D manumanumanu: I want to tell it to tell stis something when he shows up RhodiumToad: that's "later tell ..." dsmith-work: manumanumanu: : later tell whaever you want dsmith-work: Well. This is exciting: dsmith-work: Unbound variable: for-each manumanumanu: sneek: later tell stis Could you help me port 3 seemingly simple syntax-parse things from racket? I am porting parsack to guile, and that is about the only thing left sneek: Okay. manumanumanu: dsmith-work: someone else had that problem! manumanumanu: specifically with for-each dsmith-work: There was something very similar that happened when I started running it on 3.0 dsmith-work: I think I just open-coded whatever it was that somehow went away. manumanumanu: maybe that is waht I am thinking about. dsmith-work: wingo: Any idea what could possibly make guile forget about "for-each" ? dsmith-work: sneek: guile help cons wingo: dsmith-work: that does not sound like something i could understand! except maybe you are in a module that #:export (for-each) wingo: so it makes a fresh local binding that's unbound wingo: or you're in a pure module dsmith-work: Hmm. Nothing like that I can see. RhodiumToad: would importing a module that accidentally exports an unbound for-each also do it? wingo: that could do it, yes wingo: dsmith-work: i know you've been doing boot issues recently, i assume it's not before for-each is defined *: wingo zzz now tho wingo: à demain dsmith-work: No, this code has been running since 3.0 manumanumanu: me too! stay safe, everyone. wash your hands dsmith-work: sneek: uptime dsmith-work: !uptime sneek: 16:24:42 up 22 days, 4:57, 1 user, load average: 0.00, 0.01, 0.05 dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs dsmith-work: The thing is, for-each is only used in about 3 places. And the same code has been using for-each for years. No redefinitiosn or pure modules. dsmith-work: sneek: botsnack sneek: :) dsmith-work: sneek: seen wingo ? sneek: wingo was here Apr 15 at 08:24 pm UTC, saying: à demain. dsmith-work: goodbot daviid: Aurora_iz_kosmos: adding to what has been said, wrt goops vs records, a record is (just) a datastructure, goops is a language dsmith-work: goops has generic methods dsmith-work: Or is that generic functions? daviid: dsmith-work: is this bot code published somewhere? dsmith-work: No. :( daviid: dsmith-work: how about uploading it to sourcehut or svannah if you have an account ... daviid: or notabug if you don't like sourcehut ... dsmith-work: I need to look into license stuff. It's another bot ported to guile and bobot dsmith-work: sneek: help dsmith-work: Ok! Help is working. Changed a for-each to a named let daviid: dsmith-work: scary daviid: this for-each not working 'anymore' :) I mean dsmith-work: Indeed. I wonder if bobot it hiding it somehow. dsmith-work: But it's avalaible in some places.. dsmith-work: Ahh! Maybe because I am using srfi-1 ? dsmith-work: That replaces for-each rlb: I suppose I'll try 3.0.1->3.0.2 first, and if that doesn't work then perhaps --enable-jit=no for ppc64el too, and see what happens. rlb: (unless that test is just known to be sketchy) soda__hobart: hey everybody, i am trying to use guile as the scripting interface for a 2D game engine i'm making with c++. is there any documentation on how to wrap a c++ object instance with guile? all the functions for my interface are generally procedural, but i need some sort of reference to my "GameLoop" instance. can i use a pointer or something? Aurora_iz_kosmos: soda__hobart: That'd be mentioned around these parts: https://www.gnu.org/software/guile/manual/html_node/Programming-in-C.html soda__hobart: so the foreign object types part is what i should look at? i don't even need any real object-oriented kind of stuff for my API, just a reference to the GameLoop object that i can pass procedurally rlb: soda__hobart: unless things have changed, you'll likely want to write a C-ish "shim" interface and wrap that. soda__hobart: yep, that's what i was intending to do rlb: i.e. for foo->bar(), you'll provide a foo_bar(this), etc. rlb: or something equivalent. soda__hobart: cool, glad to hear that that's a viable way to do it rlb: There may be some helper tools, but up to a certain point, I'd likely just do it by hand. Aurora_iz_kosmos: Hm. He could tie it into GOOPS too. rlb: (i.e. reduce dependencies) rlb: indeed soda__hobart: yeah, i mean it's just to expose some of the primitive methods used by my engine rlb: And while Guile does have runtime ffi, and that might be what you want, writing an actually C dynamic lib has the advantage that you can lean on the compiler to make sure you get the types/sizes/etc. right. rlb: s/actually/actual/ soda__hobart: so for something like "jump" or "move", i can define those in guile Aurora_iz_kosmos: Also means you don't have JIT warmup, no? rlb: If you're using autotools, the existing macros can help set up the right vars, and then you can just rely on libtool (if you like). soda__hobart: i'm using cmake soda__hobart: maybe i should use autotools, though soda__hobart: what's JIT warmup? rlb: Ahh, not sure then. But if you can make a "proper" .so, then you can load it from some module (I usually have a scheme side module wrapper) like this (as the docs mention I assume): (load-extension "your-lib.so" "init_your_lib") Aurora_iz_kosmos: soda__hobart: Newer Guile versions have JIT to improve performance. But like most JIT implementations, optimization of calls & such requires using code paths a few times unoptimized first. rlb: iirc guile might not have the more substantial kind of "warmup" you might imagine, (if you're coming from the jvm world, for example), i.e. guile's currently a template based jit. Aurora_iz_kosmos: Interesting. I may be overestimating it, indeed. rlb: i.e. I don't know that it does that kind of analysis. rlb: But indeed, sometimes "it's a thing" :) Aurora_iz_kosmos: soda__hobart: Anyway, the contrast I was building to was that optimized C/C++ code starts as fast as it'll get. rlb: soda__hobart: and note that you can also use SCM_DEFINE and the "snarfer" etc. to automatically handle scheme side docstrings, and much of the contents of your init() function. rlb: (The stuff you'd write explicitly via PyArg_ParseTuple() in say python.) soda__hobart: ah rlb: soda__hobart: you may find libguile/*.c in guile itself useful for some examples, though of course some of what it does is "not for public consumption" :) rlb: but there are plenty of bits that look just like what you might want to do. soda__hobart: yeah, i don't need an interactive shell, it would be nice to have eventually, but ATM, i'm just trying to be able to script the game event loop with guile, so that stuff can get loaded in at runtime rlb: well once you have the functions you care about "published" to guile, you may be able to just run guile and then (use-modules (my stuff)) and start calling your code. (Assuming a suitable LD_LIBRARY_PATH). rlb: as a very simple example wrt SCM_DEFINE and libguile: https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/numbers.c?h=v3.0.2&id=84a61d87ea08c50c36ccb460a781ffe271efbf06#n4306 soda__hobart: hm, yeah, i still have a lot of research and reading to do, of course. my thinking was that i was going to do a GoF-style template method thing, where there are event callbacks, which in the game implementation are function pointers, and the functions themselves will be built out of various primitive functions and methods provided by the physics engine (Box 2D). so my idea was that a .scm file could basically be used to configure a soda__hobart: factory for producing those template methods. Aurora_iz_kosmos: weechat also has Guile code. soda__hobart: yeah, looking at source code of other projects has been very helpful rlb: I imagine you would, but keeping the "granularity" in mind can be helpful too -- i.e. not sure how much overhead there is right now for a scm->c crossing, but I assume it has some cost. soda__hobart: yeah, i was kinda thinking that each template object that wraps the defined (by scheme) function would only have to be initialized once, when the simulation/level thing loads. soda__hobart: like the scheme module is just supposed to be an interface to a factory method, so there would only be primitive data types. and if you have to do anything with a specific data type, just use a string key because they're all stored in a hash map anyways. rlb: Depending on what you mean, you can wrap your objects more directly/cheaply with foreign object types: https://www.gnu.org/software/guile/manual/html_node/Defining-New-Foreign-Object-Types.html rlb: s/can/may be able to/ daviid: str1ngs: fwiw (not exactly your 'usage' but ...), I pushed a series of patches to G-Golf, so it is now possible to override GI imported def when necesssary/applicable, and now, this list-store (minimalist) example works as expected - http://paste.debian.net/1140260/ daviid: it needs (g-golf) a second step (see the last pragraph of the last commit if interrested) so that functions and methods that use 'out arguments and need to be overridden, such as gtk-tree-model-get-value for example, would also work - which I hope to implement in one or few days at most (it's not exactly easy, hence may take more then a day, I'll see ...) str1ngs: daviid great thanks, will check this out. dsmith-work: {appropriate time} Greetings, Guilers civodul: Hello! dsmith-work: civodul: What C compiler are you using? civodul: GCC 7 dsmith-work: Ok, I've got 8.3 dsmith-work: civodul: What happens when you run guile with GUIlE_JIT_THRESHOLD=0 civodul: on ARMv7? dsmith-work: Yes civodul: oh, it segfaults dsmith-work: Ah civodul: niiiice civodul: not every time, it seems dsmith-work: Bah! rr only is for intel. civodul: yeah dsmith-work: Intermitent are the worst. civodul: now that i've done "ulimit -c unlimited" it no longer crashes :-/ civodul: were you able to grab a stack trace? dsmith-work: I have a core civodul: cool, can you run gdb on it and send what you have to bug-guile? dsmith-work: Yep dsmith-work: So, I got Illegal instruction (SIGILL), not segfault. dsmith-work: And the bad code is my old friend dsmith-work: => 0x73b144d8: 04 f0 1f e5 ; instruction: 0xf004e51f dsmith-work: Which is dsmith-work: => 0x73b144d8: 04 f0 1f e5 ldr pc, [pc, #-4] ; 0x73b144dc dsmith-work: in Arm mode dsmith-work: Which loads the PC from the next 4 bytes. dsmith-work: I'm going to clean everything. Some of my old testing code might have slipped in somehow. dsmith-work: Well fouey dsmith-work: I was getting some segfaults during the build, so I set GUIlE_JIT_THRESHOLD=-1 dsmith-work: make check passed. (default threshold) dsmith-work: And now I can't get it to segfault or illegal instruction! dsmith-work: This is with that arm patch. dsmith-work: Ok, make check with the threshold =0 does segfault on some tests. spk121: hi gabbiel: I can't find the name for the network posix module gabbiel: what is it called so that I can use-modules it? gabbiel: oh my I assumed it was a module, but the procedures are in the default module gabbiel: my bad rlb: Seeing a "FAIL: test-scm-spawn-thread" on ppc64el https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=ppc64el&ver=3.0.1%2B1-2&stamp=1586643529&raw=0 and wondered if that might be a known issue. Suppose I'll see about upgrading to 3.0.2 next. lloda: daviid: I just rebase on master every once in a while lloda: I don't want to do a lot of work polishing what is clearly a hack lloda: we should just think about the right way to do this and do it lloda: i'm sorry I've been lazy about it lloda: wingo: agree, I had already done that in the branch wip-vector-cleanup through scm_bitvector_elements lloda: I'll rebase daviid: lloda: yes, we should 'do the right thing' and get it in guile 'proper' daviid: daviid: but in the mean time, it's a good hack, and the only one we have :) Aurora-Sensei: Is 8sync still being developed? wleslie: sneek: seen NalaGinrut ? sneek: I last saw nalaginrut on Sep 15 at 01:32 pm UTC, saying: I think I have to fallback to 2.2, and I'll try to figure out what's wrong. Aurora-Sensei: It'd probably help if the bot also told the year in that date. wleslie: last email from them was January this year, so sounds plausible Aurora-Sensei: Neat *: chrislck is waiting for srfi-180 to be ready :) Aurora-Sensei: Oh, a JSON srfi. Nice. Aurora-Sensei: There's a Guile-specific lib for that, but a general thing will be nice. And pretty much required for modern web scripting. guix-vits: Hi there Aurora-Sensei: Gzochi's a pretty cool project. RhodiumToad: uh wow, I just crashed guile RhodiumToad: wonder if it was to do with running under statprof RhodiumToad: yeah, definitely looks like statprof RhodiumToad: is there a better way, in (match), to say "this should be the symbol x, y, or z and bind "s" to it" RhodiumToad: than doing (and s (or 'x 'y 'z)) daviid: (case what ((x y z) "s") else (...)) RhodiumToad: this is part of a more complex pattern dsmith-work: Hey Hi Howdy, Guilers civodul: howdy! RhodiumToad: yo mwette: hi RhodiumToad: there's no builtin list function like delq but which compares the cons cell rather than the car, correct? *: guix-vits done SICP's 1.11 (https://paste.opensuse.org/53360943) brendyyn: guix-vits: looks about the same as mine. Aurora_iz_kosmos: Does Guile have anything for JSON-like usage of XML? The current tooling it has seems more appropriate for (valid) xhtml parsing than exchanging API calls. alextee[m]: guile (and my horrible C-like loop) is on the front page :D https://www.zrythm.org/en/ Aurora_iz_kosmos: Cool. Aurora_iz_kosmos: Site refuses to load over Tor. What is it? Aurora_iz_kosmos: nvm, changed circuit it works Aurora_iz_kosmos: A DAW, neat. How does it compare to LMMS? alextee[m]: lmms is more like a toy for beginners alextee[m]: i read a comment somewhere the other day that sums it up nicely (auto-translated from russian): "So far in the alpha version, but it looks good. Now from oporous normal DAW in fact is not present: Ardour from oporous is the most developed, but marazmatic, in some places the accustomed interface, inconvenient MIDI editor, in some places glitchy, authors essentially do not want to pay much attention to MIDI, being excused by alextee[m]: that at them the basic direction is record and mixing of live instruments. Qtractor is also limited, although MIDI is better done there. LMMS is so rather a toy for the entry level. Everything else is even lower level." manumanumanu: Did anyone ever port parsack for guile? manumanumanu: That should be pretty staright-forward... manumanumanu: ah. guile-parallax manumanumanu: has anybody tried to use it? It seems to be a rather non-straightforward port... Aurora_iz_kosmos: alextee[m]: I can probably read the original comment too Aurora_iz_kosmos: :p Aurora_iz_kosmos: alextee[m]: Given I'm still essentially a beginner, what does it lack? alextee[m]: Aurora_iz_kosmos: idunno, haven't used it much Aurora_iz_kosmos: The main limitations with LMMS that I can see are that it's very much a synthesis/midi thing rather than recording. Though that's my main use-case so it doesn't cause much issue. heisenberg-25: Hi, How can I write a producer/consumer functions using (custom) ports? I know I'm asking a question without showing what I've tried but I was wondering if anyone could point me into a the write direction dsmith-work: heisenberg-25: Would you perhaps like a channel instead? heisenberg-25: dsmith-work something like golang channels? dsmith-work: (for some reason, I thought guile now has go-style channels) Aurora_iz_kosmos: Fibers Aurora_iz_kosmos: @ dsmith-work dsmith-work: Hmm. Yeah, that's probably it dsmith-work: https://wingolog.org/archives/2017/06/29/a-new-concurrent-ml this dsmith-work: Is what prompted me to learn go. heisenberg-25: dsmith-work thanks! I will check Fibers and will post my questions here dsmith-work: Well, with the patch that Icecream95 supplied https://gitlab.com/wingo/lightening/-/issues/12#note_322488250 , guile builds and mostly runs fine with JIT enabled on my rpi, Buster, buildroot(arm) and buildroot(thumb). dsmith-work: Still get occasional segfaults though. For all three. dsmith-work: Probably need that cool rr tool civodul used. dsmith-work: rlb: ^^ civodul: dsmith-work: interesting civodul: for me it runs fine without patches on an olinuxino civodul: "sun7i" per /proc/cpuinfo dsmith-work: I get segfaults about 50% of the time just running guile dsmith-work: civodul: try with GUILE_JIT_THRESHOLD for maximal jitness. (0 or 1, I don't remmeber) dsmith-work: =0 dsmith-work: Ahh. Getting that pre-boot error. ArneBab_: davexunit: is there also a chickadee for Guile 3.0? ArneBab_: … I just saw it in git, but I cannot install it … marmulak: I thought guile 3 was a done deal, but apparently even my guix system is using 2.2 ArneBab_: well, it’s always hard to update the foundation to everything marmulak: indeed marmulak: I thought surely it would be backwards compatible though ArneBab_: there are always edgecases that have to be fixed in patch-versions, and you don’t want your system to become unbootable because of those ArneBab_: (still I hope we’ll see guix on guile 3 soon) marmulak: well will I'm sure davexunit: ArneBab_: I use chickadee with guile 3.0.2 davexunit: upstream guix probably doesn't have it yet, though. guix-vits: Hi there. daviid: lloda: thanks. I actually did those changes manually, but a stable-2.2-wip-exception-truncate branch might be usefull for othrs ... tx daviid: lloda: now on master, do you cherry-pick one commt or merge the wip-exception-truncate branch? daviid: lloda: I was also thinking about doing something for our 2.2, 3.0 users who install from a tarball, that we could upload signed versions of pached (ice-9 boot) module, wdyt? daviid: lloda: or dowm to the 2.2.x, 3.0.x fine grane if necesasry daviid: something that wont solve the sitro problem, but ... daviid: *distro daviid: for distro, users still may download the appropriate pached (ice-9 boot) module, install it manyally, and if they which also precompile install the .go file .... daviid: which is what I recommend in the guile-cv manualll, but I wish I culd just tell users to grab the patched module daviid: or may be once we have those, I can even grab it as part of the build fase daviid: actually, I could add those to the guile-cv tree itself daviid: I don't kow if it would work for guix users though, quite ironically :) daviid: it would definitely work for debian, msys2 ... and probably any distro but guix and its 'ancestor' (I for got the name now but 'they know' :)) daviid: I compiled installed 3.0.3 from master and when I complie guile-cv, it comes with a few of these warnings - WARNING: loading compiled file /opt3/lib/guile/3.0/site-ccache/search/basic.go failed: ;;; "load-thunk-from-memory" daviid: daviid: *3.0.2 of corse, exactly 3.0.2.2-2b4e4 (patched with the wip-exception-truncate patch, commit 74de3b0a2fe6d5c67ad5ccdb6ed885f777443fbf) daviid: I didn't run a 'make uninstall' of the previous 3.0 occurrence that I had in /opt3 daviid: hum, that might be a guile-lib related problem, to rcmpile install guile-lib ... narispo: https://github.com/hlandau/specwriter daviid: recompiling/installing guile-lib did solve this problem, fwiw daviid: lloda: to answer my first quiz myself, I did cherry-pick the one commit needed from wip-exception-truncate branch to master, which worked fine wingo: lloda: am thinking that like scm_c_vector_ref et al, scm_c_bitvector_ref should only work on scm_tc7_bitvector RhodiumToad: hm, is there a good algorithm to create a shuffled copy of a list without going via a vector? mwette: o/ *: guix-vits ghost around jcowan: RhodiumToad: You could use Olin Shivers's list-merge! algorithm with a comparison function that returns arbitrary-but-consistent results, I guess jcowan: iow, it has to cache its answers, otherwise the process may never terminate *: RhodiumToad used a vector jcowan: see srfi 132 jcowan: oops, s/merge/sort. It's very nice in that it allocates only O(1) space because it reuses the cons cells of the input jcowan: on the other hand, it can break both caching and write barriers. manumanumanu: Happy easter! How do y'all celebrate? *: RhodiumToad celebrated by writing a solver for the countdown number puzzle RhodiumToad: a brute-force one, admittedly RhodiumToad: but the size of the search space seems to be typically around half a million entries, so brute-force is quite feasible RhodiumToad: (it's slightly variable because the number of subtraction and division subexpressions is affected by the numbers available, since you're not allowed intermediate results that are not integers >0) roptat: hi, I'm implementing jsonld in guile, and one of the things I need is IRIs. guile doesn't have a module for that yet, so I'm using (web uri) for now, but I know I'll need to create my own module later roptat: URIs are IRIs and so I'm testing with only URIs, which is fine. However, one of my tests has this IRI: "url://a/b/c" which is not considered a valid URI by guile (string->uri returns #f) roptat: the reason seems to be that guile wants at least a dot in the host name, but reading RFC3986, the host is an IP or this rule: "reg-name = *( unreserved / pct-encoded / sub-delims )" roptat: which should match "a" roptat: oh, I found the issue! there's a match to an IPv6 address that works, because "a" matches the regexp for ipv6 addresses, but it's not a valid ipv6, so the result is #f roptat: (string->uri "url://g/a/b") works RhodiumToad: wtf RhodiumToad: why would it accept a v6 address with no : in? wingo: i have never heard of an iri :) wingo: interesting bug re: ipv6 addrs RhodiumToad: v6 addresses in uris should be in [] anyway roptat: I've just sent a report RhodiumToad: e.g. blah://[::1]/whatever roptat: this is ipv6-regexp: (make-regexp (string-append "^([" hex-digits ":.]+)$")) roptat: so it matches "a" :) RhodiumToad: well that's broken roptat: also ipv4-regexp: (make-regexp (string-append "^([" digits ".]+)$")) roptat: I believe "42" is a valid host, but it would match the ipv4 regexp roptat: IRIs are defined in RFC 3987, while URIs are in 3986, it adds unicode to URIs, basically RhodiumToad: why would "42" be a valid host? RhodiumToad: I suppose it could be an unqualified local hostname roptat: because the rule is any number of characters in the unreserved, pct-encoded or sub-delims, and unreserved is "ALPHA / DIGIT / "-" / "." / "_" / "~"" roptat: the host is usually a name in the DNS, but it's not defined like that roptat: that's how I read the introduction of section 3.2.2 at least roptat: `We use the name "host" for the ABNF rule because that is its most common purpose, not its only purpose.` roptat: and you're right, it cannot be a plain IPv6, it needs brackets roptat: #40582 if you want to add anything RhodiumToad: huh. eval is really slow str1ngs: Aurora_iz_kosmos: how trivial is this? I did write a way to evaluate guile scheme from go. https://github.com/mrosset/scheme Aurora_iz_kosmos: str1ngs: Was that in answer to my query? It's not quite what I meant. I mean more to interact with a service written in Go from Guile. Aurora_iz_kosmos: xmlrpc-like str1ngs: Aurora_iz_kosmos: I would use json rpc over xmlrpc. something like https://golang.org/pkg/net/rpc/ str1ngs: https://golang.org/pkg/net/rpc/jsonrpc/ to be precise. Aurora_iz_kosmos: Fair, I'd probably have looked for JSON first as I find it more pleasant to read. Aurora_iz_kosmos: Eh, that's part of the standard library? Aurora_iz_kosmos: Neat. str1ngs: but I'm not sure how you would handle the RPC on guile side. you could maybe start with a UNIX socket. Aurora_iz_kosmos: Hm, good question that yeah. str1ngs: I had hoped to created a dbus service eventually do hand proper guile RPC. but my project is not at that stage yet. str1ngs: eval and read would work, but the security implications of that.. Aurora_iz_kosmos: You could have that as a mode, or otherwise using RPC handlers for specific calls. Aurora_iz_kosmos: Discarding anything invalid. Aurora_iz_kosmos: One could use GOOPS for handlers or not. Depends on how you feel like. str1ngs: Aurora_iz_kosmos: it's doable, be interesting to see what you come up with :) Aurora_iz_kosmos: I'd probably use GOOPS anyway and explicitly register handlers. For simplicity's sake. rlb: wingo: the "News" link at the bottom of the main page links to very old news: https://www.gnu.org/software/guile/ rlb: (i.e. on savannah circa 2016) rlb: https://savannah.gnu.org/news/?group=guile rlb: And until you said it, I hadn't noticed 3.0.2 :) *: rlb might attempt that this weekend -- we'll see. dsmith: Building without the bootstraped .go files and without the jit is so tedious. rlb: noooooooo doubt :) rlb: cf. the buildd times, though I'm sure you can sympathize: https://buildd.debian.org/status/package.php?p=guile-3.0 (the "all" links there on the right). rlb: e.g. https://buildd.debian.org/status/logs.php?pkg=guile-3.0&ver=3.0.1%2B1-1&arch=armel dsmith: 9 hours dsmith: Ugh dsmith: Takes like 6 minutes to cross-compile on my 8core work laptop rlb: Nice, though I suspect the ftp-masters would frown on such an approach for the debs :) dsmith: Yes. And you must have all the deps available too. rlb: I have thought about arranging an arch-specific deb (for one of the faster archs) that just contains the .go files, and then having the others depend on that, but that kind of indirect arch dependency is (unsurprisingly) not favored, and I think may have caveats. dsmith: Yeah, it's not just the alignment. dsmith: => 0x73ba24d8: 04 f0 1f e5 ; instruction: 0xf004e51f daviid: lloda: hello! I am on stable-2.2, git clean -dxf, git pull, git fetch --all, now, admittedly not a very good git user, what is the easier way to apply your wp-exception-truncate patch? tx daviid: lloda: I mean can I just merge those, are they (still) compatible with the stable-2.2 branch? daviid: I don't thnk that would work, there are quite a lot more patches there then just exception-truncate, not sure others were made for 2.2 daviid: cherry-pick doesn't work either retropikzel: How can I get the body out of (http-get "url") response? str1ngs: retropikzel: I use http-request to get a body. http://paste.debian.net/1139665 str1ngs: copy-to-port is custom . you can use any port function retropikzel: Thank you str1ngs: retropikzel: the tricky bit is receive if you have not used values before. but once you get use to the they are nice. lloda: hi daviid, wip-exception-truncate is rebased on master since that's what I use lloda: but I have pushed a patch to branch stable-2.2-wip-exception-truncate which goes on top of 2.2 lloda: since I don't use 2.2 I haven't tested it, but it should work lloda: lmk guix-vits: Hi there. dsmith: Hey hey RhodiumToad: bleh. accessing a bytevector as big-endian u16 is tons slower than as native-endian u16 dsmith: Getting closer... mwette: dsmith: lost track ... doing all non-thumb ? dsmith: mwette: I think so. dsmith: The BLX must be to 4 byte alignment. Actually, the branch offset must be aligned. dsmith: Sometimes, there is a 2 byte alignment. dsmith: Aligning the BLX op fixed almost all cases. dsmith: But I'm still getting one somewhere. Almost looks like it's not the JIT code making it. dsmith: mwette: I'm on Raspbian. Whatever that is. Thought it would be thumb, but I'm getting the errors. mwette: I read this: https://www.embedded.com/introduction-to-arm-thumb dsmith: https://static.docs.arm.com/ddi0406/c/DDI0406C_C_arm_architecture_reference_manual.pdf dsmith: Page 235 dsmith: But specifically page 348 mwette: thanks -- was looking for that dsmith: The T2 encoding dsmith: Here is my current illegal instuction: 0x73ba24d8: 04 f0 1f e5 dsmith: Which is T2: 0xF004 0xE51F dsmith: That bit 0 is not valid. dsmith: "H == ‘1’ then UNDEFINED" mwette: illegal in both modes (ARM and THUMB)? dsmith: Right dsmith: The 0xF0 at the start makes it a thumb dsmith: Here's the thing. I'm logging *every* BLX that gets generated (calli in arm-cpu.c) dsmith: And the failing one is not logged. mwette: what about BX? dsmith: So either something else is making it, or it's some other code that corrupting it. dsmith: That not a 32bit thumb code. Is 16 bit mwette: ah dsmith: There are only 4 immediate jump type 32bit codes. Bcond, B, BLX, BL. dsmith: It's either a bad offset for a BLX, or a BL or B got corrupted into a BLX. marmulak: hey buddies mwette: o/ *: RhodiumToad further improves the performance of hex->bin marmulak: that's great! marmulak: ok so I have a noob question of the day marmulak: what are we supposed to use the char-set type for? Because there is also 'string', and I was trying to write another example program yesterday that I imagined char-set might be useful for and then ended up hacking the whole thing together with strings only RhodiumToad: char-set is useful for a lot of things, e.g. looking for delimiters dsmith: marmulak: A char set is like [a-z] patter in regular expressions. dsmith: A set of char to match RhodiumToad: or scanning input for tokens marmulak: isn't a string basically a set of chars ~_^ RhodiumToad: a string is a vector of chars marmulak: so the different types simpl have different functions associated with them? RhodiumToad: a char-set is an _unordered_ set of characters marmulak: ioh I see dsmith: And no duplicates. marmulak: oh ok that's useful info dsmith: "heloooo" would not be a set marmulak: I imagine this helps with functions and optimization marmulak: my other newbie question is, let's say I (read) input, and the input is a word like "cat" except it's not in quotes. What I gathered so far playing with guile is that if it's in quotes its type is string marmulak: but without quotes I couldn't figure out its type mwette: marmulak: char-set's provide a general way to predicates like char-numeric? dsmith: (read) returns a "datum". An s-expression. mwette: s/way to predicates/way to generate predicates/ RhodiumToad: marmulak: if you're reading it with (read), then a word not in quotes is a symbol dsmith: Well, *reads* the next one and returns it. marmulak: RhodiumToad: a symbol is meant to be evaluated, right? RhodiumToad: whether to evaluate it after reading it is up to you marmulak: hmm gotcha dsmith: scheme@(guile-user)> (read) dsmith: (this is a test) dsmith: $1 = (this is a test) dsmith: scheme@(guile-user)> (read) dsmith: ( dsmith: another dsmith: test dsmith: ) dsmith: $2 = (another test) RhodiumToad: and given those, for example (symbol? (car $1)) will be #t dsmith: scheme@(guile-user)> (read) dsmith: " dsmith: strings dsmith: too dsmith: " dsmith: $3 = "\nstrings\ntoo\n" RhodiumToad: paste sites are a thing that exist marmulak: I know there's a lot of books and materials about scheme listed online, but do you guys know any particular book that introduces readers to these concepts for the first time like predicates and lambdas, folding, etc? Like, ELI5 dsmith: RhodiumToad: Yes. Sorry. Thought it would be small enough.. *: dsmith goes back to banging his head against the desk marmulak: hehe rekado: marmulak: The Little Schemer builds up your understanding from the ground up. rekado: it’s deceptively simple and sometimes annoyingly thorough. marmulak: I'm OK with simple marmulak: I have programming experience but I don't feel that I'm an experienced programmer. And I think from a compsci point of view I should strengthen my conceptual foundations rekado: The Little Schemer tries to develop your intuition of Scheme. rekado: It sometimes takes a little long before it will move on to other things marmulak: sounds good rekado: and sometimes the question/answer format seems to get in the way, but generally I think it’s a very good start. rekado: you start from a handful of primitives and build your way up rekado: by the end you should be very comfortable with lambda and what can be done with it. marmulak: great marmulak: would you say, that scheme is a "powerful" language? RhodiumToad: depends what you mean by that marmulak: I'm also curious marmulak: about your opinions dsmith: marmulak: In Paul Graham speak, I'd say yes. (he talks about laguage power in his writings) marmulak: a few days ago I joked in #guix that they should use haskell instead of scheme (part of the joke is implying they didn't have to fork nix). Maybe there is a technical reason to prefer scheme as a language, and some people responded with that type of answer. Their statements gave me the impression they considered scheme's strength to be related to some idea like power, completeness, or maybe flexibility marmulak: not that I'm searching for technical definitions of these terms, but it'd help to know what proponents of scheme think is good about scheme marmulak: and if there is something that makes scheme special, if there are other languages that also share that quality, whether in whole or in part dsmith: It's functional when you need it, or imperative when you need it, or OO when you want that. civodul: marmulak: the answer to this kind of question is always half-technical, half-social civodul: for the technical bit, see e.g., https://hal.inria.fr/hal-00824004/en civodul: & https://hal.inria.fr/hal-01580582/en civodul: (shameless plug, but hopefully gives some insight!) rekado: I used to be a Haskeller, actually, but I always liked Scheme. (Nowadays I no longer write Haskell.) marmulak: I'll gladly read stuff marmulak: dsmith: so it is multi-paradigm marmulak: I have read this also about ML languages like ocaml rekado: in my opinion, Haskell is lovely, but kinda inflexible at times, leading to lots of type-directed churn during development rekado: sometimes I do miss compile-time type checking in Scheme marmulak: scheme encounters type errors only at runtime? rekado: there are alternatives to using the type system as the only compile time checks, though, such as enums etc. rekado: procedures don’t have a type signature which would be checked by the compiler rekado: there’s Typed Racket which has type signatures rekado: and there are contracts, which serve a similar purpose. marmulak: so far I'm finding scheme fun and easy (well as easy as an unfamiliar language can be). But at this stage in my learning I find myself writing the same imperative programs I used to in C marmulak: racket seems kind of popular, though I never heard of it until recently rekado: becoming familiar with map and fold and friends will likely change your style. rekado: I’m now approaching most problems as some sort of data transformation marmulak: I used map a little bit while trying to learn haskell. I felt its great utility but understood very poorly how it works rekado: this makes me write small procedures that take an input in one format and return the input in a new format. dsmith: When I started learning Haskell, I was delighted that my old frinds from Scheme where there (map, fold, ...) rekado: map applies a procedure to all elements of a list and returns a new list. dsmith: Some had differnt names. marmulak: rekado: hmm yes rekado: fold is used to build up a data structure by processing a list item by item marmulak: it makes me think of folding@home rekado: heh RhodiumToad: if you really want to tie your brain into knots, try shift/reset marmulak: T.T rekado: you use fold by defining a procedure that is called for every element of the list; the procedure takes the element and the intermediate return value up to this point. rekado: this allows you to compute sums, count elements, filter lists, etc rekado: fold is very versatile and it becomes easy once you recast your problems as data transformations. rekado: gotta go marmulak: thanks dsmith: Hah! dsmith: My "fix" for veneers is "ldr pc,[pc,#-4]" Which is *exactly* the same thing as the malformed BLX! dsmith: Progress! RhodiumToad: hm, is it exactly the same? marmulak: do car and cdr stand for anything in English? RhodiumToad: yes marmulak: sure not car like the car I drive RhodiumToad: http://www-formal.stanford.edu/jmc/history/lisp/node2.html RhodiumToad: the names come from assembler macros on the IBM 704 marmulak: :o marmulak: this explains car and cdr, but it also mentions cpr and ctr RhodiumToad: the car and cdr account for 30 bits of the 36-bit word, those other two were the remaining two 3-bit fields RhodiumToad: which never became exposed at the programming level in the same way that car and cdr did marmulak: I see marmulak: lisp doesn't have cpr, ctr? RhodiumToad: nope marmulak: I see marmulak: shit, I would have understood the docks better if car and cdr were named something like head and tail RhodiumToad: some dialects of lisp allow you to call them that. RhodiumToad: but the original names have proven hard to stamp out marmulak: it's all good marmulak: once you know you can't un-know RhodiumToad: of course then there's things like (caddr x) RhodiumToad: which is just a shorthand for (car (cdr (cdr x))) marmulak: damn RhodiumToad: often considered bad style, though marmulak: is that the 3rd element of a list? RhodiumToad: it is indeed marmulak: OK I sort of see where that is going RhodiumToad: something like (cadar x) is a bit more complicated RhodiumToad: that's the second element of a list which is the first element of x marmulak: a list within a list RhodiumToad: i.e. (cadar '((1 2) 3)) is 2 marmulak: can you show me what a pair looks like RhodiumToad: you can write a pair as (x . y) RhodiumToad: so (car '(x . y)) is x and (cdr '(x . y)) is y RhodiumToad: a list like (1 2 3) is actually (1 . (2 . (3 . ()))) marmulak: do there have to be spaces around the period marmulak: so for pairs we also use car/cdr to get the first and second element RhodiumToad: in most cases without spaces the . would be part of the adjacent value, unless there was some delimiter like a ) marmulak: ah I see marmulak: x.y becomes a symbol RhodiumToad: car and cdr are specifically for dealing with pairs. a list is made up of pairs marmulak: I see, I understood it kind of backwards marmulak: so a list is like a matryoshka RhodiumToad: a list is either the special value () which is an empty list, or it's a pair whose cdr is a list RhodiumToad: so if you follow the cdr's, you end up at a () marmulak: so (1) = (1 . ()) RhodiumToad: you can make s-expressions that are "improper lists", where the chain of cdrs ends in some atom other than () marmulak: that sounds wrong RhodiumToad: e.g. formal parameter specifications are improper lists, like (lambda (a b . c) ...) RhodiumToad: c in that example is a "rest arg", it's assigned a (possibly empty) list of all parameters after the second marmulak: thanks marmulak: I'm reading The Little Schemer RhodiumToad: I haven't read that RhodiumToad: lisp was about the 4th programming language I learned as a kid, maybe 14 or so marmulak: it defines a function atom? that returns #t if (if I understood it) the input is not pair or null. I entered its definition into guile and it appears to be working as the book provided it marmulak: but I suspected this function does what symbol? does in guile marmulak: as far as I tested the results appear to be the same RhodiumToad: try it with something that's not a symbol RhodiumToad: e.g. (atom? 1) would be true, but (symbol? 1) would not manumanumanu: marmulak: you can define the function atom to be true if something is not a pair or null if you want RhodiumToad: manumanumanu: I got some more performance for hex->bin by simplifying that sparse array thing manumanumanu: RhodiumToad: great! And I made your bin->hex a bit faster :D RhodiumToad: https://github.com/RhodiumToad/scheme-bits/blob/master/hex/hex.scm RhodiumToad: how? manumanumanu: It is sooo little. Stable at about 2% difference by just porting your bin->hex stuff to my old implementation. manumanumanu: RhodiumToad: but looking at the code, there should be no difference. You bind an extra variable for the loop check through your macro, but that should be inlined RhodiumToad: yeah, the binding isn't really necessary in this usage, it's just that numeric-for is written for general use manumanumanu: I have a more or less feature complete implementation of racket's for loops btw manumanumanu: if you are interested manumanumanu: that produces optimal code in all cases I have found manumanumanu: RhodiumToad: https://hg.sr.ht/~bjoli/guile-for-loops RhodiumToad: I don't really like complex looping macros. manumanumanu: I use it mostly for repl stuff where named lets quickly become unwieldy manumanumanu: It is not as powerful as foof-loop, but has (imho) a simpler syntax. manumanumanu: but I don't know whether foof loop can do a lazy right fold, which my for loops can RhodiumToad: one thing I tried was exploiting the fact that guile allows uniform-vector ops on bytevectors. but that actually made it slower RhodiumToad: i.e. using u16vector-ref etc. RhodiumToad: that saves all the uses of 2*, but somehow it ended up slower overall manumanumanu: RhodiumToad: guile does a lot of unboxing magic with bytevectors iirc, which might be it manumanumanu: at least with floats manumanumanu: RhodiumToad: do you have any changes coming, or would you mind a patch for supporting upper/lower case and delimiters? RhodiumToad: I don't have any immediate changes planned manumanumanu: anyway, my bin->hex for some reason is 2-4% faster. I don't understand why. Check it out. Take it if you want: https://hg.sr.ht/~bjoli/misc/browse/default/hex.scm manumanumanu: (under guile3) RhodiumToad: I may look at that sometime, not now manumanumanu: Anyway, thanks for the code golfing. I had fun manumanumanu: good night! rlb: With the provided GUILE_PKG automakery and given say GUILE_PKG([3.0 2.2]) in configure.ac, is there an easy way to pick 2.2 for a given configure invocation when both are available, i.e. something like ./configure --with-guile=guile-2.2? rlb: (Use case is building a tree twice to test both flavors.) mwette: maybe ./configure GUILE=guile-2.2 rlb: ...looking at aclocal.m4 seems like maybe not, unless I were to create my own "shadow" PKG_CONFIG_PATH/LIBDIR or similar that didn't have 3.0. But for now I may be able to just not use GUILE_PKG and instead do the important bits of what it does directly. mwette: how about ./configure GUILE_EFFECTIVE_VERSION=2.2 mwette: I'm looking in guile.m4 rlb: mwette: yep, brilliant. Looks like that may work. Thanks. rlb: New 2.2 and 3.0 debs have been uploaded that are intended to allow multiple guile-X.Y-dev packages to be installed at the same time (hence the questions I was asking). rlb: (just to unstable) civodul: congrats, rlb! manumanumanu: rlb: does that mean guile-3 is coming to a debian-based distro near me? rlb: Should be -- I finally got it to build on all the release architectures, and it's been in unstable for a bit: https://packages.debian.org/sid/guile-3.0 Hasn't migrated to testing yet, though. manumanumanu: rlb: hooray. Thanks! Saw this as well: https://packages.ubuntu.com/focal/guile-3.0 manumanumanu: which is great, since I just got a new linux server. 6 cores ready to build! I don't have to do stuff on my odroid-xu4 anymore :D rlb: nice manumanumanu: then I can just update ubuntu on that one and have an official package marmulak: the only way I could figure out how to solve this in haskell was to read in all the data, split it where there is a comma, and then split the results again on space and then return the last element skipping < or > marmulak: so the data gets copied multiple times marmulak: it's probably the solution that uses the most memory Aurora_iz_kosmos: Hm. You could generate a datastructure with separators & offsets in one pass then use those offsets for either generating an intermediate list or directly operating on the elements. marmulak: what I wrote today in scheme (that I suck at) is that it does a loop where it reads in a string delimited by whitespace, then tests it so that it contains @ and no quotation mark, then outputs the result with "<>," deleted Aurora_iz_kosmos: I see. marmulak: it might actually be the better way but it runs slower than haskell or C ;) marmulak: although on most of the tests I ran it was not far behind Aurora_iz_kosmos: It's interesting that you're more familiar with Haskell than Scheme. Aurora_iz_kosmos: The latter is generally seen as more newbie-friendly. marmulak: not anymore XD marmulak: I tried to study Haskell for a week or two last year and probably forgot most of it by now. The learning curve was steep, Scheme does feel easy by comparison marmulak: this program I write is just a proof of concept because I wrote it years ago in C++ but shouldn't have, only because C++ was the only language I knew marmulak: so I like to do this "hey look this program I wrote in 50 lines is only 5 lines in scheme) Aurora_iz_kosmos: For industry-related reasons, you should probably get some minimal proficiency in Python marmulak: sorry, that parenthetical mark was reflex Aurora_iz_kosmos: If you don't have it by now, that is. marmulak: yeah I know python is so big marmulak: I just really wanted to learn functional programming Aurora_iz_kosmos: That's fair and relatable. marmulak: the thought of learning python makes me feel like I'm going back to QBASIC again marmulak: QBASIC for Linux Aurora_iz_kosmos: heh Aurora_iz_kosmos: It's not that bad. Think of it as pseudocode you can actually run. dsmith-work: There are worse things than Python dsmith-work: Not my favorite though marmulak: I'm proud though, today I wrote a program that does something in a lisp-like language, as opposed to evaluating (+ 1 1) in emacs and then going "ok" marmulak: it's more than a calculator now! Aurora_iz_kosmos: I find Python's one of the least annoying major scripting languages with a decent library ecosystem. marmulak: oh yeah it's very strongly supported marmulak: btw about scripting with guile, for invoking shell commands I am going to use the (system) function every time, right? dsmith-work: Looks at (system*) too and pipes marmulak: as for your suggestion of using a datastructure with offsets, I am not sure I would know how to do that marmulak: dsmith-work: thanks jcowan: Python is excellent for whiteboard interviews for the reason Aurora_iz_kosmos gives dsmith-work: system* doesn't use the shell marmulak: does (while) have a negative counterpart like (unless) is to (if)? I thought it should have existed by my program instead uses (while (not)) Aurora_iz_kosmos: Hm. Can't remember syntax macro atm, something like (defmacro until (condition body) (not ~condition) ~@body) mwette: (define-syntax-rule (while-not cond body ...) (while (not cond) body ...)) mwette: unless is taken already Aurora_iz_kosmos: Ah my bad. Aurora_iz_kosmos: Hm, it's not in my 2.0 manual, what does it do? mwette: (unless cond body ...) == (if cond (begin body ...)) mwette: oops -- (if (not cond) (begin body ...)) mwette: (when cond body ...) == (if cond (begin body ...)) dsmith-work: (define-syntax-rule (until cond body ...) (while (not cond) body ...)) dsmith-work: \lambda dsmith-work: λ dsmith-work: sneek: Later tell wingo, I sneek: Okay. dsmith-work: Bah! dsmith-work: sneek: later tell wingo I'm also getting Illegal instruction on a fresh rpi3 Buster install. Guile built from source, default config. sneek: Got it. lampilelo: you get illegal instructions? from the mob? daviid: spk121: did you manually wrap every single tree/store set value function? in guile-gi i mean .. spk121: daviid: not exactly sure what you mean, but, probably not. We only manually wrapped very few functions, so if they weren't in the .gir / .typelib they only got special treatment if they were types that appeared in .gir, like GHashTable and such spk121: oops, that sentence made no sense.. what I mean is that we only wrapped some pretty fundamental types so we could most of a .typelib daviid: ok, then this (gtk-list-store-set-value store iter column value) won't work in guile-gi (as it won't work in any binding), not any function th expect a pointer to a GValue ... daviid: unless we wrap thse manually (which is what guile-gnome and pygobject does ...) daviid: i was hoping 'modern' GI provided a way to overcome this (terrible) limitation, but it seems somehow imposible, hence the necessity for manual wrap of those daviid: I am thinking of a way to over come this automatically, and I can only think of tracking those at import time, then force an additional arg on users, whch is not 'beautiful', but efficient daviid: or otherwise, manually wrap 'à la guile-gnome' spk121: some of the gtk_list_store_insert_sorted seems to parse, but, that's it daviid: spk121: yes, i parse all of them, but they will fail at call time ... spk121: actually, we do end up parsing and the parent , so when both load up, the GListStore methods seem to cover the basic operations. daviid: spk121: but you require user to initalize GVlaue(s) themselves then daviid: this should fail in guile-gi: (gtk-list-store-set-value store iter 0 10) or (gtk-list-store-set-value store iter 1 "hello, world") - assuming store and iter are 'ok' of course, but that is working fine ... the problem is the value daviid: given store being (gtk-list-store-newv 2 '(int string)), and iter being (gtk-list-store-insert store 0) daviid: spk121: here is what needs to be done for these functions to work, the list-store set-vlue is just of them of course: http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/gtk/gnome/gw/gtk-support.c - line 358 and below ... spk121: daviid: well to be honest there's nothing in the test suite that has tried to use . I'd have a look and see if the methods that to get autogenerated are sufficient to write something in scheme only, because we have been avoiding creating a hard dependency on Gtk in guile-gi spk121: in the C part of guile-gi, that is daviid: they can't be sufficient, by design, I was wondering if you did think about a mechanism (which will be either ugly or quite complex) that we could omehow share ... daviid: a mechanism other then manually wrap/override them I mean daviid: spk121: here is a example for you to 'trnslte' to guile-gi and play with ... http://paste.debian.net/1139447/ - which fals on line 57 as 'expected', and will fal until I manually wrap gtk-list-store-set-value spk121: OK, cool. Lemme check it out daviid: wc! I'd be happy to read the guile-gi code for this example, just curious ... str1ngs: hello alextee[m], do you have an example of a GTK transfer annotation? I just want to return a pointer nothing? also is there any caveats with this that you know of? str1ngs: alextee[m]: nothing special* str1ngs: alextee[m]: sorry for the noise I found an example here. https://wiki.gnome.org/Projects/GObjectIntrospection/Annotations spk121: daviid: I think it would end up looking like this https://paste.debian.net/1139454/ spk121: but I haven't implemented input arguments that are arrays of GType, and input arguments that are arrays of GValue daviid: ah ok will look asap tx - then you'll see what i'm talking about when you do .. :):) wingo: civodul: hey i had a thought this morning sneek: wingo, you have 2 messages! sneek: wingo, dsmith-work says: I sneek: wingo, dsmith-work says: I'm also getting Illegal instruction on a fresh rpi3 Buster install. Guile built from source, default config. wingo: good morning btw :) wingo: to lower bootstrap time, and possibly as a reasonable solution for fast -O0, we can write a compiler from tree-il directly to bytecode wingo: just using stack techniques wingo: i think we might even be able to get reasonable debug info from it as well civodul: hello wingo! civodul: oh, wild :-) civodul: but yeah, why not! wleslie: nice wleslie: I saw this word the other day and thought of you, andy: https://en.wikipedia.org/wiki/Limnology civodul: though i think we should also invest in profiling and getting a better understanding of what happens with intmaps and all wingo: civodul: do you know what fraction of guix pull time is expand vs what proportion is compile? civodul: not sure civodul: the "Computing Guix derivation" bits (~1mn on modern hardware) is purely evaluated and largely expand wingo: civodul: i also have a wip patch to reimplement intsets as trees of bitvectors. goal would be lower tracing load and make access cheaper civodul: neat wingo: but i don't have perf numbers yet civodul: for me simply gcprof compile-file of one of the relatively large files in Guix is a good benchmark wingo: i started with an inlined implementation of bitvectors (u32vector / u64vector) but i realized i should just make sure bitvectors compile well civodul: you mean bitvectors instead of bignums? wingo: intset doesn't use bignums wingo: intset uses a tree, where a tree node is a vector or a fixnum civodul: well the key can be a bignum i guess, but yes :-) wingo: but having a vector of fixnums is a bit silly, allocation-wise wingo: civodul: pretty sure we will never see a bignum as an intset key! civodul: ah oh, maybe i'm confused then wingo: the bignums you were seeing in the slot allocator were really bitfields civodul: yes wingo: i.e. a bitmask where each bit indicates whether the slot is occupied or not wingo: pretty sure set that are like "which variable is live here" are intsets there wingo: not bignums civodul: hmm my memory is fuzzy civodul: but we do use bignums pretty much for those bitmasks, no? civodul: like when we do (1 << label) or things like that? wingo: there are a few differnt kinds of bitmasks wingo: we don't do 1 << label as a bignum wingo: we use a bitmask for that wingo: er wingo: sorry, intset wingo: we only do 1 << slot as a bignum civodul: ah that, yes civodul: ok wingo: thinking there would generally be fewer than 30 or 62 slots wingo: but apparently that's a terrible assumption :) civodul: heh :-) civodul: it means performance degrades significantly when you go beyond 60-something slots civodul: it makes it non-linera civodul: *linear wingo: yep civodul: the other issue is memory consumption, it's really fishy wingo: probably should fix that, though it's tricky :) wingo: anyway for modules for which an optimized compile aren't important, we can sidestep the problem civodul: yes wingo: don't build CPS, don't run slot allocation, just make the bytecode mirror the stack discipline civodul: how much work does that represent? wingo: that was my question for you :) civodul: ah good, dunno :-) civodul: i'd have to look wingo: i.e. wondering how much of guix time was taken by expand vs compile wingo: ah, you mean to hack it up civodul: oh i was wondering about human work time civodul: yes civodul: :-) wingo: i think i could make a compiler like that in 3-5 days civodul: ok wingo: but where to find those days is another question :) civodul: heh :-) wingo: wleslie: tx for the link, interesting! civodul: expand time is not significant when compiling gnu/services/mail.scm or something like that wingo: you are sure there? wingo: just checking wingo: i mean i know guix has lots of macrology civodul: right, i can try and get actual figures civodul: wingo: this should give a rough idea: https://paste.debian.net/1139467/ wingo: hehe yeah civodul: that'd mean ~11% of the time is parsing + expansion wingo: so the most we could expect would be 10x speedup or so, not bad civodul: yes wingo: making a baseline compiler like that would lower memory usage as well civodul: i guess so wingo: which i guess has some good implications for the guix use case wingo: i think but i don't really know that load-time for guix modules would be largely unaffected wingo: the package modules i mean civodul: what do you mean? wingo: i guess you would compile the guix module tree using the optimizing compiler and gnu/ with baseline civodul: that would only affect compile time wingo: well, the compiled file size would be different civodul: yes wingo: and the result may allocate more, if some optimizations aren't applied wingo: and it will do more work at load-time i think civodul: ah yes, i see wingo: so (use-modules (gnu packages foo)) might take longer wingo: but i think not. wingo: we'll see i guess civodul: yeah civodul: on a smaller file: https://paste.debian.net/1139469/ civodul: 8% here alextee[m]: str1ngs: sorry havent used these annotations before guix-vits: Hi Guile. Blackbeard: Hi guix-vits: Blackbeard: u're yet 'ok', or any better today? str1ngs: alextee[m]: no worries, I found what I needed janneke: hmm, i've got some code here that runs 5x faster when wrapped it `statprof' (guile-2.2.6) wingo: wtf :) janneke: yeah! trying to look into it; it's a nontrivial amount of code and data janneke: what i seem to notice just now, is that in `top' the non-statprof version jumps CPUs all the time dsmith-work: Happy Friday, Guilers!! janneke: hello dsmith-work!! civodul: hey, happy Friday! stis: Haaaaaappy! stis: yeah, got a new version of my python clone out mwette: Hi all. mwette: Maybe I should add a COBOL->TBD translator to nyacc. mwette: https://apple.news/AoGB6nzr7Q8WcmrABDa9GUg jcowan: Or better yet a Cobol language feature for Guile jcowan: Cobol control flow is complex, and targeting a properly tail recursive language has real advantages brendyyn: stis: thats amazing :) RhodiumToad: cobol probably comes nearer than any other real-world language to having an actual COME FROM RhodiumToad: in that you can PERFORM a range of paragraphs, and there's no indication within that range that control might drop back to some caller wingo: janneke: the difference with statprof is that periodically you get a SIGPROF call, which will wake up some things wingo: either it's a bug in guile that it's waiting when it shouldn't, or it's a bug in the kernel that it's waiting where it shouldn't wingo: strace while doign statprof might give you the answer, to see what syscall was current when the SIGPROF arrived janneke: wingo: that's smart; i'll have a look at that jcowan: RhodiumToad: Right, so compiling each paragraph into a separate procedure means that GO TO compiles into a tail call and PERFORM into a call to a metaprocedure that invokes procedures in their lexical order. The mainline execution, then, is just PERFORM THRU . RhodiumToad: makes sense *: RhodiumToad hasn't had cause to touch cobol in many years, fortunately *: jcowan either jcowan: there is more talk on #cobol right now than there has been in a month of Sundays. RhodiumToad: I'd be surprised if there weren't people running production cobol programs today that are older than I am RhodiumToad: (and I'll be 52 in a month) jcowan: I'm 61 and I've only ever written one program in Cobol. I volunteered to write it as an extension of working as a consultant, but the manager who wanted it said it had to be in a language he could easily maintain. Cobol it was. mwette: haha jcowan: I admit to taking advantage of Cobol's full abbreviative capabilities mwette: in response to ,locals I get: $16 = #f = (("sss" ... mwette: How do I interpret a variable "#f" with an apparent value? janneke: hmm, hard to tell -- but what puzzles me is that clock_gettime, futex and rt_sigprocmask are called all the time https://paste.debian.net/1139550/ jcowan: Means that its name is not known for whatever reason mwette: jcowan: thanks bricewge: Hello Guile! bricewge: I have a record name of 33 character long, it's difficult to stay under the line length limit. bricewge: I can't remember how to access the field of a record with a shortened name, I thought there was a procedure or a macro to do this... RhodiumToad: what kind of record? bricewge: RhodiumToad: SRFI-9 civodul: bricewge: you could always create an alias, like (let ((shr the-very-long-accessor-that-prevents-me-from-remaining-under-the-80-character-limit)) (shr x)) RhodiumToad: yeah, that's what I was thinking civodul: a famous one is (define call/cc call-with-current-continuation) civodul: but the tradition in Scheme is long names fully spelled out civodul: "code is meant to be read by humans" :-) bricewge: civodul: I think that's the one bricewge: civodul: I'm defining a mixed-text-file, I find it difficult to keep it readable, fully spelled out and under the 80 character limit civodul: how does that relate to mixed-text-file? bricewge: Especially with that looonnnng record name bricewge: civodul: See https://paste.debian.net/1139557/ in contrast with the nicely formated sddm-configuration-file civodul: oh i see civodul: here i'd use match-record civodul: it matches fields by name, which should be slightly shorter bricewge: Thanks, I'll use that then :) Aurora_iz_kosmos: Hm, does Guile's bytecode internally transform symbols to be lighter? marmulak: hey buddies marmulak: does guile code compile to something the os can execute? I found guild compile, but it seems to only produce bytecode Aurora_iz_kosmos: marmulak: Afaik there's no native compilation yet. Aurora_iz_kosmos: Adorable doujin https://nhentai.net/g/308249/ marmulak: wrong window? Aurora_iz_kosmos: oy blyat marmulak: lol cyka Aurora_iz_kosmos: (And this is why you use proxies for irc) marmulak: we've all had those moments RhodiumToad: guile3 does jit marmulak: if it's any consolation I didn't open it Aurora_iz_kosmos: marmulak: That's for the best. marmulak: JIT is great marmulak: I think the name "just in time" is misleading though marmulak: when the user is waiting for code to run, it's not "in time" marmulak: it's more like "a little bit too late compilation" Aurora_iz_kosmos: Eh, the code runs through the unoptimized path first. Jumps to compiled alternatives are inserted later. Aurora_iz_kosmos: At least that's how JIT generally works. jcowan: It's named by analogy to just-in-time manufacturing, which means you keep only a small inventory (but not zero) and order more parts only when you have orders in hand for the finished product. jcowan: In addition, JIT compilation results can run faster than AOT compilation when they can take advantage of things like branch postdiction. Aurora_iz_kosmos: I think it'd be neat for Guile to be able to generate executable images like SBCL's, doubly so if it could bundle C dependencies like CFFI can do with :static-link marmulak: yeah static linking is tight Aurora_iz_kosmos: It just facilitates deployments so much. marmulak: then we can write cross platform desktop applications in guile Aurora_iz_kosmos: Eh, executable formats would have to be accounted for. Aurora_iz_kosmos: Even if you vendor all the libs inside a static image, ELF doesn't run on Windows. Aurora_iz_kosmos: It might on OSX though. marmulak: yeah it'd have to be compiled separately jcowan: anyway, deploying apps with multiple files is pretty much a solved problem nowadays, on several different levels Aurora_iz_kosmos: Easy example: A person willing to host/run a program on a machine for me but not technical enough to setup a server, nevermind Docker. jcowan: OS-specific package or simply tarball, theb jcowan: then Aurora_iz_kosmos: I'm not aware of any specific system to create tarballs with mangled library paths other than Guix Aurora_iz_kosmos: And last I tried it didn't work on my machines. Aurora_iz_kosmos: (Over a year ago though, I guess) Aurora_iz_kosmos: Additionally, Debian packaging is annoying. (I wish Debian had something like PKGBUILD) str1ngs: WSL can run elf on windows Aurora_iz_kosmos: Ah, true. Still not used to that being a thing. str1ngs: guile can run as a static binary say if you used scm_boot_guile. and built statically. you would still GUILE paths for modules. so it's not like it cant do what SBCL is doing. just a little more work maybe. marmulak: neat marmulak: guix seems like a lot of trouble, I couldn't get ocaml to work on it str1ngs: plus guile's FFI is top notch IMHO there are manyways to use it. between guile extentsions to FFI directoy and now even GI str1ngs: s/directory/directly marmulak: what is FFI Aurora_iz_kosmos: Foreign-Function Interface Aurora_iz_kosmos: marmulak: Allows you to use C & ASM object libraries from Guile. Much like Java's JNI Aurora_iz_kosmos: But better. marmulak: that's one of the things that interests me most about guile marmulak: one thing that confuses me a little bit is that when I read about using guile with C, it was explained like this: "Write your program in C, and then you can extend it with guile", and when I got more familiar with the concept I thought the natural order was the other way around, to write a program in guile and then rewrite or add parts in C where needed davexunit: both are possible, but the latter is the recommended option. marmulak: it makes sense davexunit: I use the FFI to link against C libraries when necessary marmulak: there's untapped potential here for game development Aurora_iz_kosmos: Was linking Guile lgpl or gpl? Aurora_iz_kosmos: If it's the latter, it'd explain a lack of industry adoption. marmulak: long ago I contributed to a game project once where most of the game was written in LUA around some core engine written in C/C++ davexunit: marmulak: that's actually what I spend most of my time doing with guile. marmulak: nice davexunit: I have a project that is trying to be for guile what love2d is for lua. davexunit: still alpha, but works decently at this point. https://dthompson.us/projects/chickadee.html marmulak: oh that's nice marmulak: just the sort of thing I'm interested in marmulak: I've seen a package like this for other languages like haskell marmulak: I take it yours is the only one for scheme? davexunit: there are some libraries for other schemes out there but this is the only one of its kind for guile. jcowan: marmulak: The original idea was to take an existing program in C and add Guile to it to allow user customization, basically Emacs and Elisp style. marmulak: davexunit: I love how your project's irc channel is #guile ;) davexunit: ;) marmulak: it's probably out of my league but I was thinking of trying to write an xmpp client in in guile using libstrophe, which is written in C I believe mwette: nyacc's FFI Helper can help converting c headers to run in guile: https://www.nongnu.org/nyacc/nyacc-fh-ug.html Aurora_iz_kosmos: 3> The Guile library (libguile) and supporting files are published under the terms of the GNU Lesser General Public License version 3 or later. | Oh, so it'd be usable. jcowan: Many Scheme-related names have a sense of bad behavior: Scheme itself, Guile, Racket, Larceny, Foment, Gauche, Larceny, Heist. *: Aurora_iz_kosmos doesn't mind GPL home projects, but getting work to adopt GPL is not gonna happe Aurora_iz_kosmos: *happen marmulak: maybe we can give them positive names davexunit: btw there is currently a lisp game jam going on: https://itch.io/jam/spring-lisp-game-jam-2020 Aurora_iz_kosmos: Guile isn't negative though? davexunit: most of the entries are typically common lisp or fennel (a lisp that compiles to lua) projects. hopefully this time around there will be at least 1 scheme entry. marmulak: oh sweet marmulak: davexunit: hopefully they use chickadee Aurora_iz_kosmos: Was there a way to make callbacks in Guile for C? mwette: https://savannah.nongnu.org/projects/nyacc/ davexunit: unlikely, but maybe in the future. Aurora_iz_kosmos: https://common-lisp.net/project/cffi/manual/html_node/Implementation-Support.html#Implementation-Support I love the totally not vague "SBCL: Not all platforms support callbacks." But which ones? :/ mwette: marmulak: here is a demo file to convert gtk2.h to guile: https://paste.debian.net/1139583/ ; and here is a sample program using it: https://paste.debian.net/1139584/ marmulak: thanks Aurora_iz_kosmos: https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Callback-Closure.html Oh, it's been supported since a while. Nice. Aurora_iz_kosmos: Erh, https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Dynamic-FFI.html#index-callbacks mwette: note this is a "helper" because you are programming C semantics in Scheme -- e.g., you will be passing pointers to functions to get return values marmulak: ew pointers Aurora_iz_kosmos: Can't help it, Lisp machines are rare now. :p mwette: marmulak: the intent is for people to write a Scheme layer on top manumanumanu: RhodiumToad__: Regarding the bin->hex procedure: what kind of lookup table do you suggest? A full 256-byte one with pairs of (16 . 16)? I am not sure that will be more efficient... RhodiumToad__: I've actually been testing one manumanumanu: oh! RhodiumToad: however, the performance characteristics are ... strange manumanumanu: how come? RhodiumToad: what I'm testing is basically a sparse array, a vector of 1760 slots each of which may contain a vector of length 8 manumanumanu: how is that supposed to work? RhodiumToad: take two bytes of input, which if valid must be in the range #x3000 to #x6700, subtract #x3000 and div/mod by 8 RhodiumToad: if the value is out of range, or the first or second lookup is #f, then the input is invalid, otherwise the byte found is the result manumanumanu: Which guile? RhodiumToad: currently trying it on 2.2 manumanumanu: guile didn't fold euclidean division by a factor of 2 into a bit shift until 2.9.something manumanumanu: iirc RhodiumToad: right, I'm using the bit shifts directly manumanumanu: I am not very CS-y, why would that be fast? I don't know how large guile vectors handle cache locality RhodiumToad: I made it sparse mostly to save space manumanumanu: But what does "weird performance characteristics" mean? RhodiumToad: well that turns out to be down to the context in which logand or ash is being called, and whether you use the native names or the srfi-60 names manumanumanu: what is faster? RhodiumToad: changing (ash x -3) to (arithmetic-shift x -3) induces a huge slowdown, even though the latter is just a re-export of the former RhodiumToad: at least I think it is, need to check RhodiumToad: ah, it's (define arithmetic-shift ash) in srfi-60.scm manumanumanu: did you compare the assembly? manumanumanu: RhodiumToad: the disassembly for arithmetic-shift is a lot longer manumanumanu: under guile2.9.3 RhodiumToad: no, I didn't marmulak: hey what do I enter into emacs to git it to run the code I'm working on? marmulak: maybe I have to define something manumanumanu: I have no idea why, but (define (test b) (ash b 2)) produces a lot shorter assembly that the same with srfi-60 arithmetic-shift manumanumanu: marmulak: geiser-eval-buffer will evaluate all your code in the buffer if you are running geiser marmulak: what is geiser manumanumanu: marmulak: https://www.nongnu.org/geiser/ RhodiumToad: manumanumanu: sec, let me paste my current version marmulak: lte me try RhodiumToad: https://dpaste.org/1fES marmulak: apparently geiser isn't on ELPA marmulak: though the site says it is marmulak: oh wait I have to add something marmulak: it says to add code to package-archives, but I don't have anything like that manumanumanu: RhodiumToad: I suspect your bin->hex is fast enough. I had forgotten that I could just do a 16-byte ref! :D manumanumanu: RhodiumToad: hex->bin looks fine. Apart from being weird when you use srfi-60, what is wrong with it? RhodiumToad: nothing, now? manumanumanu: is it fast? :D RhodiumToad: in my tests so far about 50% faster than yours RhodiumToad: need to test on more data, though manumanumanu: great! jcowan: RhodiumToad: Pointer? RhodiumToad: https://dpaste.org/1fES <-- current code RhodiumToad: probably less portable right now marmulak: apparently I can't access melpa o_o marmulak: I love how geiser's git repo contains 7702 objects marmulak: just the right amount for an emacs mode manumanumanu: RhodiumToad: won't compile.... ;;; : warning: possibly unbound variable `#{\x200b;}#' manumanumanu: ah. dpaste did something fonky RhodiumToad: yeah, dpaste "raw" isn't really raw right now due to abuse RhodiumToad: I'll put it somewhere more friendly when I consider it more final than it is now manumanumanu: RhodiumToad: your bin->hex is a shitload faster as well. manumanumanu: twice manumanumanu: at least RhodiumToad: yeah, 2x was what I saw manumanumanu: the change is not so dramatic for hex->bin, but still about 1.5x manumanumanu: ok, not quite: 0.25xxx vs 0.30xxx seconds on 22mb of hex RhodiumToad: if my estimate is correct, memory usage for chars-hex should be about 20 kbytes? manumanumanu: No idea manumanumanu: depends on the overhead of guile's vectors manumanumanu: 1760 pointers to vectors of 8 elements. manumanumanu: a vector of 1760 elements pointing to vectors of 8 manumanumanu: does guile know that we are only storing bytes? manumanumanu: probably not RhodiumToad: it could be made less by using bytevectors, but that complicates the logic a bit because it'd be unable to store #f RhodiumToad: of the 1760 elements, only 64 point to vectors, the rest are #f RhodiumToad: hm, this could definitely be improved on manumanumanu: RhodiumToad: cool code! I learned something. Would you mind if I steal the bin->hex trick if I link to your library in the source? I don't really understand the whole sparse tree thing. I told John to ask about your code instead :P RhodiumToad: don't link to that paste, it's transient manumanumanu: well, whenever you release it? manumanumanu: you should. converting to and from hex is common enough RhodiumToad: you can steal any of that code, just credit me by name (Andrew Gierth) in comments manumanumanu: thx manumanumanu: RhodiumToad: the whole optional uppercase thing would be usable, but having support for delimiters would be better :D manumanumanu: That is common enough manumanumanu: anyway, good night dsmith-work: Oooo. Getting closer to finding the jit problems on arm. mwette: dsmith-work: go go dsmith-work: First prob was thumb->arm "long" calls throuh a "veneer". I think I got that working. dsmith-work: Now it's getting farther, but emitting a bad code for a call. dsmith-work: Something is editing a relative address incorreclty. dsmith-work: Good: 0x74b9441c: 00 f0 1c e8 blx 0x74b94458 dsmith-work: Baad: 0x74b943ba: 00 f0 49 e8 ; instruction: 0xf000e849 dsmith-work: dsmith-work: The 0x49 in there is odd. Literally. dsmith-work: SHould *not* have that lowest bit set dsmith-work: Yessss!! dsmith-work: The call must be on a 4 byte boundary, not a 2. dsmith-work: Stuffing in a NOP makes it happy *: dsmith-work dances civodul: woow, good catch dsmith-work! dsmith-work: Hmm. Well, 4 of 39 tests failed dsmith-work: dsmith-work: Illegal instruction dsmith-work: FAIL: test-language dsmith-work: FAIL: test-fast-slot-ref dsmith-work: FAIL: test-use-srfi dsmith-work: FAIL: test-pthread-create dsmith-work: All "Illegal instrution" dsmith-work: But preogress! Aurora_iz_kosmos: What's the general recommended RPC mechanism for interaction between say... Guile and a Go daemon? dsmith-work: Of course, all tests pass with GUILE_JIT_THRESHOLD=-1 dsmith: civodul: How do I run a specific test under gdb? (with uninstalled guile) dsmith: It's probbaly not that the call is not on a 4byte alignment. dsmith: More likely there is some code that back-patches the offset isn't right. civodul: dsmith: for the tests above that are written in C, you can do "./libtool --mode=execute gdb test-suite/..." dsmith: civodul: Thanks daviid: manumanumanu: yes, please let us know when tou moved to sourcehut, bitbucket is a disaster daviid: fwiw, I am among those who would ask you to keep the license to gpl, quite more important then to be part of srfi RhodiumToad: manumanumanu: if you're going to use a lookup table, why not use a 256-entry one for byte->hex and save the bit masking? Aurora_iz_kosmos: https://paste.debian.net/hidden/3ec1a4d6/ I'm having some issues with setting up Guile+Geiser in Emacs Aurora_iz_kosmos: I get that error when I try to eval the buffer. Aurora_iz_kosmos: Okay. I found the problem. There's something broken in my distro if one has multiple versions of guile installed. Aurora_iz_kosmos: So, the error only happens when I have both Guile 2.0 & 2.2 installed, and when I use it from Geiser. (use-modules (ice-9 getopt-long)) (define (main args) 1) This works fine in the absolute-path invocation of either interpreter. However, when using Geiser, Guile-2.2 throws that error. Aurora_iz_kosmos: I have cross-posted this in #debian as I'm fairly sure it's packaging-related. str1ngs: Aurora_iz_kosmos: have you tried setting the emacs variable geiser-guile-binary to the version you want to use? Aurora_iz_kosmos: Yes, that's how I found the issue only occurs with guile-2.2 RhodiumToad: perhaps the load path is being set incorrectly? Aurora_iz_kosmos: Currently going to be busy for the next while, but it occured to me that Debian's packaged Geiser might simply be too old. Aurora_iz_kosmos: I'll be testing that later. guix-vits: Hi Guile. manumanumanu: jcowan: please do. if you want me to give you anything more official than that, please send me an email at linus.bjornstam@fastmail.se manumanumanu: RhodiumToad: because I wrote that when I was 19 and was proud to get it to work, I suspect. jcowan: manumanumanu: I don't think anything else is necessary manumanumanu: RhodiumToad: I don't really understand what that would bring. Why use 256 element lookup table? RhodiumToad: why not? RhodiumToad: like I said, it saves on the bit-twiddling manumanumanu: oh, now I unedrstand jcowan: RhodiumToad, manumanumanu: I agree that would be better. RhodiumToad: hm, it's a pity there aren't any SIMD-style arithmetic ops on bytevectors *: jcowan remembers when you could have 128-word device drivers, which were position independent, or 256-word device drivers, which had to figure out where in memory they were loaded *: RhodiumToad found some vectorized hex->binary code he wrote a while back dsmith-work: {appropriate time} Greetings, Guilers civodul: hey hey! mwette: o/ wingo: o/ alextee[m]: is there a way to expose enums from C? dsmith-work: wingo: I tried changing the thumb->arm veneer code so it doesn't switch arm/thumb state. Got an Illegal instruction at the call site instead! lloda: wingo: civodul: ok to add #:declarative? #f to srfi-64? test-log-to-file is broken in 3.0 and this fixes it. lloda: I don't think it's worth patching upstream for this with any alternative solution like a box or w/e dsmith-work: It was an incorrect instrucion. Not sure why. The code that emit is is about 6 levels of nested routines. Ugh. dsmith-work: Havn'e been about to follow it. wingo: lloda: fine by me dsmith-work: Alternatively, building the whole system for thumb2 (instead of arm) has guile segfaulting about 50% of the time. wingo: dsmith-work: i wonder why it works on guix and qemu. do you have any idea/ wingo: ? lloda: done dsmith-work: wingo: Compiler and configured options maybe? wingo: sure. would be good to find out the difference tho civodul: lloda: sure, but do you know why it breaks? sounds fishy dsmith-work: wingo: Another wrinkle is that I'm cross compiling. I wouldn't think that should alter jit code generation though. dsmith-work: wingo: I'm amazed at how fast guile builds. Like 6 minutes! Using the bootstrapped .go files. Aurora_iz_kosmos: I confirm that using a recent (melpa-stable) Geiser version fixes the bytecode problem I previously reported. tl;dr Debian's geiser is outdated and broken. calculeris: Hello ! calculeris: Im planning (very slowly but surely) to implement a 100% interpreted lisp. calculeris: [a slightly modified version of Kernel Programming Language]. calculeris: I wish to implement it directly using a machine's instruction set. calculeris: At the moment, i don't know any instruction set. calculeris: The two options i currently hold are: calculeris: a) using x86_64 the same way picolisp does. calculeris: b) using guile's instruction set. calculeris: I like the option of using x86_64 because it would be fast enough and it will probably still holds for years to come. The problem would be that although it is staight forward to have native C runtime calls, using complex C libraries would be a titanium task because we would need to decode the C header. calculeris: This is my biggest issue, because i wish to do graphical tasks using my lisp, but the only way to do it would be by using some complex C API (i.e Vulkan) and making it more lispy to use. calculeris: This is where guile might be better. It would allow to leverage the work of the guile community, and thus use graphical lispy libraries and not the least, integrate well with guix. calculeris: But i am a bit affraid becuase it seems to be a bit too focused on compiled, semantically restricted scheme (recently i saw a post where they almost removed the ability to sort of eval in a distinct environment). calculeris: That is, it seems to be the total lisp opposite of the dialect i wish to implement [Highly interpreted with first class environment continuations and encapsulation type (a primitive tagging of data)]. calculeris: So i'm asking the question : calculeris: ops, it seems i have overflood the chat limit, sending againt my post in pastbin calculeris: file:///home/sanqueg/Builds/discussion/asking.txt calculeris: long post : https://framabin.org/p/?c04935bcf396723b#mLjr0I/NQcfSaFqtKyLW/6KAgemmSJZHa4Qk89YOVHY= (couldn't use built-in pastbin) jcowan: calculeris: I recommend that you write your interpreter in Guile or any other Scheme, in which case you can do whatever you want. If it doesn't run fast enough in Guile 3.0, try a different Scheme. The more you stay with portable Scheme, the easier it will be. calculeris: but scheme is already too slow [[an implementation on top of scheme already exist, albeit not in guile]] that why i was thinking of the guile VM lloda: civodul: iiuc with the default declarative-modules? #t the compiler assumes module bindings are never modified lloda: but that's the very purpose of test-log-to-file lloda: with the default setting, the exported binding and the internal binding are not the same, so it's impossible to set it lloda: probably it's a bad interface, but... jcowan: calculeris: Which Scheme? calculeris: jcowan: MzScheme jcowan: That's pretty old; I don't even know if it has a JIT jcowan: what version? calculeris: jcowan: i don't know, but it was released in 2009 : https://web.cs.wpi.edu/~jshutt/kernel.html jcowan: Oh, yes marmulak: hey buddies marmulak: I am trying to rewrite one of my old programs in guile marmulak: just for fun marmulak: the purpose of the program is to find e-mail addresses in a string of text, and they are separated by commas normally, and likely a space marmulak: I have two version of the program, the original I wrote in C++ and it reads characters from standard input one by one and basically uses switches to determine when to discard data or print it out marmulak: this is very unsuitable for a funcational language I think, and I wrote a later version in haskell that reads the entire input into one giant string then splits it and then evaluates each element marmulak: so in guile I figured out basically how to use (read), but I noticed by default it reads a string until reaching whitespace marmulak: which is something I could work with but then I'd have to understand how to "loop" the process until all the strings are done and reaching the end of the input marmulak: other option is to try to mimic the haskell program's behavior and read until EOF, not stopping on whitespace calculeris: marmlak: you can also use (read-char), for a single char, at least in guile marmulak: I did see that marmulak: I thought doing the chars one by one as I had in C would just make the program harder to write in scheme calculeris: not any harder than the C version marmulak: apparently scheme does have while loops marmulak: calculeris: you may be right marmulak: with a while loop I'd check if there's any input left marmulak: ok I think I found a useful manual page dsmith-work: marmulak: (read) reads an s-expr. A "datum". manumanumanu: civodul: It breaks because to disable file output you have to set! the variable to #f which, if I understand correctly, does not work for declarative modules (due to inlining or the new "fixing" of bindings) marmulak: so far I have something like, (while (eof-object? x) (let... marmulak: but I can't seem to write a properly formed let expression lol marmulak: I wanted to let x be (read) manumanumanu: civodul: it was undocumented in srfi-64, but many people rely on it across many implementations. calculeris: marmulak: (let ( (x (read-char) ) ...) marmulak: the code I wrote might work with set! calculeris: marmulak: not if you use the let inside the while marmulak: I see marmulak: what confuses me about let is why there's two open parenthesis marmulak: I guess it's so you can have multiple lets dsmith-work: (let (things) body) calculeris: marmulak: because they group things by parenthesis, and not by bindings binders, (let ( (a 1) (b 2)) ... ) dsmith-work: things is (name val) (name2 val2) ... marmulak: ah I get it, multiple definitions calculeris: marmulak: but there is no reasons you could not implement your own (my-let (name1 val1 name2 val2) ...) calculeris: marmulak: some lisp dialects have done this, like clojure or arc-lisp marmulak: I see dsmith-work: Another way to look at it: (let ((arg1 val1) (arg2 val2)) body) is pretty much identical to ((lambda (arg1 arg2) body) val1 val2) dsmith-work: That really helped me when I saw that anyway. marmulak: well I have to learn lambda first dsmith-work: OK. Save that for later then. dsmith-work: (define (name a1 a2) body) is same as (define name (lambda (a1 a2) body)) Aurora_iz_kosmos: marmulak: There's the email-regex abomination... marmulak: hehe marmulak: ok this sort of works (while (not (eof-object? (peek-char)))...) marmulak: it's good progress, my program now works like cat marmulak: everything that goes in comes out if I do (display x) after (read) marmulak: although what's weird is when I read in whole strongs (display) actually prints #eof after the last one marmulak: strings* Aurora_iz_kosmos: I think `display' may be equivalent to `println'. You'd want to use write otherwise. dsmith-work: marmulak: It's possible to read the whole input at once too. I think it was somethine like read-delimited, and set the delimter to "". marmulak: ah hmm dsmith-work: That's where you are headed. marmulak: I tried write but I still get #, perhaps the loop is continuing too long marmulak: dsmith-work: yeah seems best that way dsmith-work: *Generally*, (display) is for humans to read, and (write) is for (read) to read. calculeris: Aurora_iz_kosmos: no, display is like printf, there is no newline at the end, (the prodcedure (newline) does add newline jcowan: calculeris: I think the first thing to try is to experiment with vau.rkt and to try to get SINK working on current Racket, which is much faster than MzScheme-2008 Aurora_iz_kosmos: calculeris: Ah, my bad. jcowan: I just keep around a print function in my toolbox (display all arguments, then newline) marmulak: ok I see why it's printing #, the loop is iterating one too many times. Maybe the condition should be tested after rather than before calculeris: jcowan calculeris: jcowan: but the need is not so much as to get an interpreter working (there is already one done in C, fast enough), but to implement a language for the long run with full capabilities like debugger, world image, etc ..., and i doubt that using scheme will be good enough jcowan: It depends on the implementation. Racket is already like that. Aurora_iz_kosmos: How about SBCL? marmulak: also can someone tell me what exactly ice-9 is dsmith-work: sneek: ice-9? drakonis: the standard guile library, its a reference to a book sneek: Last time I checked ice-9 is "a nod to the fictional substance in Kurt Vonnegut's novel, Cat's Cradle, capable of acting as a seed crystal to crystallize the mass of software" Aurora_iz_kosmos: Ah... that's where the name came from, huh. calculeris: jcowan: truth be told, i allways had a disdain for Racket, personally i have considered it a betrayal of lisp, not in the language used, but by his community/philosophy, that why i haven't looked at it much, and im not sure i want to, i think i would be more disposed to go the rabbit hole with another lisp dialect dsmith-work: See, it was planned that guile would one day take over the world... drakonis: dsmith-work: like hurd? Aurora_iz_kosmos: heh calculeris: the worst april joke ever jcowan: Like Java. Or Cobol. drakonis: calculeris: ehhh, what calculeris: guix's april joke Aurora_iz_kosmos: Well, iirc Guile only runs on POSIX platforms, no? marmulak: yeah I thought it was a substance that causes water to instantly turn into ice calculeris: telling it was working ... jcowan: Aurora_iz_kosmos: No, also Windows drakonis: that's a ehhh what regarding racket drakonis: guile only runs on hurd and linux marmulak: does guile implicitly include the standard library? Aurora_iz_kosmos: jcowan: Oh. Is that a recent change or am I just that out of the loop? drakonis: calculeris: what's the issue with racket? drakonis: btw, the april fools joke is only half a joke drakonis: they got it to work on hurd but they arent dropping linux jcowan: Aurora_iz_kosmos: Windows has never been an official target calculeris: drakonis: just a gut feeling about all the unlispiness i feel by the community, that is reinforced by the rumors of a racket with another non-nestable syntaxe drakonis: ah yes, hearsay drakonis: how about looking into it instead of disliking it? calculeris: drakonis: because there are others lisp still avalibles, so that i prefer to first go by the lisp inspiring me more confidance calculeris: drakonis: but maybe it the wrong move drakonis: it is perhaps the wrong move to do that drakonis: because racket is very good manumanumanu: jcowan: I put the hex.scm here: https://hg.sr.ht/~bjoli/misc/browse/default/hex.scm I am not in a jurisdiction which has public domain, so I couldn't be assed to do the research. You may use it as you please without giving credit if that is your thing :D If I have some time over I might try to make a faster version with a full lookup table for bin->hex. I'll drop you a message if I make any changes Aurora_iz_kosmos: jcowan: I see. Makes it hard to eat the world when it isn't on most user-devices. *: Aurora_iz_kosmos would like to see a userspace Linux dominance but isn't expecting it calculeris: drakonis: yeah,maybe another factor that i have against racket, is that it is used to implement others languages, while i wish to do the same from my other dialect of lisp, and thus would feel very defeated if i had to learn all the racket way of processing languages just to get my lisp done jcowan: manumanumanu: All you have to do is say it's okay to change the license and I'll substitute the MIT license, which is what SRFIs use drakonis: okay i dont see what's wrong with that jcowan: calculeris: Racket's multiple languages work by compiling them into the racket/base language, which is then compiled into bytecode (or into Chez on the new system). jcowan: You probably don't want to do that. calculeris: drakonis: the fear that my lisp will be prisioner of Racket ecosystem, and also the fear that i know very few real lisp implementations done in Racket calculeris: yeah, obviusly racket is a better choice than C, but still, im afraid drakonis: nobody's forcing you to use racket though? drakonis: there's still various lisp implementations being written Aurora_iz_kosmos: The only way to avoid such dependencies would be to use no implementation extensions in whatever Scheme or Lisp you use. Or alternatively to use compatibility libraries for portability (often seen in CL) calculeris: i really found the dialect of lisp in witch i want to dedicate at least a decade, so the choice i will make is preatty chanllengin (and of course no one is forcing me to do it in racket, but it would be fool to not be influenced by people and make a bigger mistake alone ...) jcowan: I'm just saying that of living Lisps probably Racket has the best programming environment, so since you want that, you should probably try to inherit it. jcowan: Because you aren't compiling to Racket, you won't get all the advantages, but you'll get many. jcowan: Or if you want to implement debugger, image dump and restore, etc. yourself, jcowan: you should probably go with sbcl or chez to maximize performance. jcowan: without sacrificing too much ease of development, as using C or C++ would. calculeris: Common lisp is an option that i have not explored only because i don't like the default lisp starting point (which will change the day i start using Next browser), but intuitivly i would more gladly go the common lisp route. calculeris: Are you saying that common lisp has a better environmennt than racket ? calculeris: And the whole compiling or not compiling, i don't get it, my lisp dialect won't be compilling, but for my implementation i don't mind compilling, why does it affect the way i can access raket facilities ? calculeris: i sry, i misread, you are only telling that common lisp or chez are more efficient calculeris: *ah calculeris: but my doubt about obtaining the whole racket environment remains, why would i not be able to get it if my PL is not compiled ? calculeris: And it is this crazy to try to implement the whole facility of environment from the ground ? Aurora_iz_kosm[21:41:55]: because it has first class continuation marmulak: hey what is char_pred calculeris: are these 3 things already a lot of work for a single person ? calculeris: becasue in my mind, the big task was to interface the datum from my lisp to a graphical editor (which is obvously a very big task, after all t would be an emacs like editor but for graphics instead of text) mwette: we may all be running on ARM laptops and desktops in five years Aurora_iz_kosmos: calculeris: Depends on what's your opinion about implementing a parser without parser-generators. calculeris: its lisp, not so hard, no ? spk121: marmulak: usually it is a procedure that takes a single character and returns #t or #f calculeris: by the way, i have no idea what is a parser-generator spk121: marmulak: in what context? dsmith-work: marmulak: Probably some predictate for characters. marmulak: I'm trying to invoke string-delete but it's not happy ahungry: I think "a lot" is relative. I think its a lot less work than implementing a web browser from scratch that supports css3 / es2017, but its "a lot" more work than making a web app in a weekend marmulak: I thought I could just do (string-delete " " s) to strip out spaces calculeris: ahungry: sure but my point is that there is no leverage for the graphical editor, which is the big task, but for the little task like world image, it doesn't matter rly if i use or not a leverage, right ? dsmith-work: marmulak: try (help string-delete) marmulak: k spk121: marmulak: (string-delete #\space s) spk121: marmulak: or (string-delete char-whitespace? s) marmulak: oh that's neat marmulak: can I provide multiple things to delete spk121: marmulak: sure (string-delete (lambda (x) (or (char=? #\a) (char=? #\b))) "hello world") marmulak: shit, lambda dsmith-work: Lambda is the Ultiamte! marmulak: dafuq are these lambdas doing in my code calculeris: mind you, i prefer vau-calculis spk121: marmulak: to avoid lambda, perhaps (string-delete (string->char-set "abc") "hello world") dsmith-work: marmulak: Get used to them, it's lambdas all the way down. calculeris: dsmith-work: never !, i prefer fexpr all the way down, thus no longer need of macros dsmith-work: Wooo. Illegal instruction building on rp3 buster! marmulak: tryin the lambda actually didn't seem to work for me marmulak: char-set did marmulak: this makes it look close to the haskell version of this program rekado: if you don’t like to see “lambda” you can use srfi-26’s cut and cute. spk121: yeah, i messed the lambda. it should have been (lambda (x) (or (char=? x #\a) (char=? x #\b))) marmulak: what is cut and cute dsmith-work: Haskell has lambdas. marmulak: spk121: thanks marmulak: dsmith-work: it's probably the part of haskell I didn't understand dsmith-work: They are just spelled funny rekado: \x -> x rekado: that’s a lambda in Haskell (the identity function) rekado: marmulak: https://srfi.schemers.org/srfi-26/srfi-26.html Aurora_iz_kosmos: calculeris: https://en.wikipedia.org/wiki/Parser_generator dsmith-work: A lambda is an expression that evaluates to code. The code has no name, but you can bind it to a name, pass it as a value, or call it directly. Aurora_iz_kosmos: (define (sum x y) (+ x y) => (define sum (lambda (x y) (+ x y))) dsmith-work: Yep. Same thing. Just some sugar mwette: calculeris: in guile (system base lalr) (ice-9 peg) are parser generators dsmith-work: marmulak: Sometimes you don't really need to name your funtions. dsmith-work: Something you will see often is called a " dsmith-work: "thunk". calculeris: Aurora_iz_kosmos: mwette: i have some troubles understanding what is this, it is just a parser that convert to a datum tree ?, which in lisp world would be called a reader ? dsmith-work: (lambda () some-code-here) Aurora_iz_kosmos: calculeris: Essentially, you define the tokens & lexical units your language would have, and it autogenerates the code to do the analysis for you. Aurora_iz_kosmos: So lexing and tokenizing is done. calculeris: Aurora_iz_kosmos: i think i don't need to do that in the dialect of lisp i wish to implement, my dialect of lisp store either a symbol or a datum, if we need to know the value of a symbol, we eval the symbol in the environment-object/datum calculeris: Aurora_iz_kosmos: thus a symbol is only a symbol, and hold no extra information Aurora_iz_kosmos: Maybe, I don't know how you've set it up, you may very well already have done those steps anyway. calculeris: Aurora_iz_kosmos: No i still haven't done anything, but they seemed only useful for languages that don't work with datum/ mix of symbols and objects Aurora_iz_kosmos: https://github.com/hylang/hy/blob/master/hy/lex/lexer.py This Lispy Python wrapper uses one called rply. (https://rply.readthedocs.io/en/latest/) calculeris: Aurora_iz_kosmos: yeah, you are right, i need a lexer (called a reader in lisp) so that the lexical token (a sequence of chars) is converted to a datum in lisp , what i don't need is the parser which add semantic, because by using directly the datum, i have already all the semntical meaning i need to eval Aurora_iz_kosmos: Ah, I see. marmulak: writing code in scheme is fun but I feel like learning to write efficient or optimized code in scheme is going be a much greater endeavor marmulak: I have to learn all these complicated concepts Aurora_iz_kosmos: So, for an ugly thing to say that nevertheless is true: Maximal optimization will require a lot of non-idiomatic mutation-oriented code. marmulak: yea marmulak: not that I'm performance focused, it's more a matter of, as a programmer being able to write code that makes me feel "I wrote this well" as opposed to "I wrote this so poorly, but amazingly it works" Aurora_iz_kosmos: Ah, that's a rather different thing. marmulak: I actually did finish the program I wrote earlier marmulak: *was trying to write jcowan: "Premature optimization is the root of all evil." marmulak: couldn't have done it without your guys' help Aurora_iz_kosmos: I find that most Scheme code I write isn't performance-dependent nearly so much as to make optimization worth it. marmulak: looking at the end result, the way I solved the problem in scheme is functionally very close to how I solved it in C++, just with many fewer lines of code thanks to higher level functions Aurora_iz_kosmos: Mostly because I tend to use Scheme for scripting. marmulak: that's nice marmulak: I might end up using it for that as well Aurora_iz_kosmos: Some things don't port as well as I'd want, such as replacing some Python scripts I had that used libraries (which I then have to find C alternatives for and wrap in Guile). marmulak: the haskell version feels different and also looks prettier (less messy), but it was much harder to write and doesn't have any loop. Both the C and Scheme version have a loop and I guess that makes it feel procedural Aurora_iz_kosmos: Hm, wouldn't Haskell & Scheme both use recursion? marmulak: for this particular problem the solution wasn't terribly recursive Aurora_iz_kosmos: Ah I see. marmulak: let me look at them again to see the difference marmulak: the input data is like an e-mail header, with text like: Billy Bob , "Joe" , "abc@abc.com" marmulak: the C program reads characters individually into a string until it reaches something invalid and then decides that to do with what it's gathered so far, if it had an @ in it and didn't fall betwene quotes, it goes to output guix-vits: Hi Guile. Blackbeard: guix-vits: hi guix-vits: Blackbeard: i'm just pressed something, and got "HELLO" buffer in emacs; can't reproduce it. It shows charset support in emacs. Blackbeard: guix-vits: C-h ? Will give you all the help options Blackbeard: I don't remember right now which one is for hello Blackbeard: Maybe C-h h guix-vits: Blackbeard: yes, C-h h; thanks Blackbeard: Haha yes, gotta love Emacs guix-vits: Вітаю Guile manumanumanu: hungry-delete-mode manumanumanu: ... sorry manumanumanu: too much input lag. VNC. lloda: anyone seen a problem using srfi-64 where you (set! test-log-to-file #f) and it still writes logs anywayf lloda: ^H manumanumanu: lloda: is that expected to work? I thought you had to write your own test runner to not output anything manumanumanu: lloda: maybe try (set! (@@ (srfi srfi-64) test-log-to-file) #f). That won't work in guile3 i suspect, since the module is declarative manumanumanu: So, I want to host a real website using the guile webserver. How should I best do it? The guile server will be responsible for serving everything that ends in .gml (or whatever I'll call it), and the rest should be handled by a regular web server. manumanumanu: Do I want a reverse proxy? manumanumanu: I have avoided everything that targets the web since about 2002, so i feel quite lost. rekado: manumanumanu: I always use a reverse proxy rekado: I often use a pool of Guile web server processes and have the reverse proxy serve as a load balancer manumanumanu: great. That's what I thought. rekado: with nginx as the reverse proxy you can match on locations ending on .gml (or whatever) and pass only those to the application server(s) rekado: so other requests won’t be seen by the application manumanumanu: even better. manumanumanu: Then I only need to figure out if I can splice raw HTML into sxml templates for those ugly files which I haven't made a proper markup... manumanumanu: Why did I jump on to the markdown bandwagon instead of just continuing to use my old xml format? :D :D manumanumanu: guile-commonmark might work for that though :D lloda: thx manumanumanu I did try the @@ and it didn't work probably b/c of the declarativeness thing. It used to work before and maybe that's what broke it. lloda: I can put that flag in a box I guess manumanumanu: lloda: the upstream srfi-64 exports that binding, and even though it isn't part of the spec, it should really be counted as a regression that it stopped working manumanumanu: maybe the srfi-64 module should be non-declarative. manumanumanu: or that variable should be boxed, if we want to deviate from upstream. manumanumanu: you are more qualified to reason about that than I am, though, and in a much better situation to start a discussion about it. manumanumanu: if there are any speed improvements of the declarativity of srfi-64, you could hack the variable to be identifier-syntax and do boxing and unboxing. leoprikler: Hi, is there a way of running a hook until the first procedure succeeds without reinventing hooks themselves? leoprikler: I guess probably something from SRFI-1 could help me if I used hook->list, but I'm looking for a "simpler" solution. marmulak: is guile the best scheme to develop with, or are there other schemes you guys know about or use? srandon111: guys fromm the manual how can i understand how to convert a bytevector vector to an hex string? guix-vits: marmulak: idk, but emacs is aware of those: chez, chibi, chicken, gambit, guile, mit, racket leoprikler: Guile is the freeest ;) dsmith-work: Wednesday Greetings, Guilers RhodiumToad: hm, there's no vector-fold or similar for bytevectors? *: RhodiumToad curious about srandon111's question even though they left leoprikler: you probably want generic array procedures brendyyn: (guix bytevectors) has that, although it pads the bytevector to an even number of zeroes, and errors if you give it an unpadded one marmulak: I like how guile compiles my scripts before running them, although I kind of want to suppress the output of the compilation message. It's too verbose RhodiumToad: ah, array-for-each works, that's close enough leoprikler: you could also convert the bytevector to a list first and then fold leoprikler: or to a string and then string-fold if you're really evil ;) RhodiumToad: hm. array-map-in-order! and array-for-each only pass the element and not the index, while array-index-map only passes the indices and not the element brendyyn: I found myself needing to translate pythons [::-1], but it works on both strings and bytes, so i would convert to bytevector, use a bytevector-reverse i made, and then back to string. brendyyn: srandon111: there is bytevector->base16-string in (guix bytevectors), although it outputs hexadecimals with padded with zeros to an even length jcowan: RhodiumToad: SRFI 160 is pretty portable and provides folding over u8vectors; these are not the same as bytevectors in Guile (uniquely so AFAIK) but could be easily adapted to them dsmith-work: marmulak: Yes, that's often requested. marmulak: rightly so! RhodiumToad: (define (bytevector->hex bv) (call-with-output-string (lambda (port) (array-for-each (lambda (b) (put-string port (number->string (ash b -4) 16)) (put-string port (number->string (logand b 15) 16))) bv)))) RhodiumToad: simpler but relies on format: RhodiumToad: (define (bytevector->hex bv) (call-with-output-string (lambda (port) (array-for-each (lambda (b) (format port "~2,'0x" b)) bv)))) dsmith-work: format actually has some looping things built in ( ~{ and ~} ) , but they are for lists. jcowan: bring out your format combinators dsmith-work: format sure seems a lot like lisp format. dsmith-work: I wonder if printf was inspired by lisp format. jcowan: I would guess independent invention RhodiumToad: is it considered bad style to use letrec-syntax to define convenience abbreviations used by a small number of functions? jcowan: I personally avoid let-syntax in general and just use define-syntax at the top level, but inside a library if I don't want to expose it. But I wouldn't call it bad style specifically. jcowan: Note that there are issues around the interpretation of let-syntax jcowan: as to whether it expands to a lexical countour (let () ...) as in R7RS or not as in R6RS. R5RS was ambiguous. RhodiumToad: hm RhodiumToad: that was the second question jcowan: I voted for the contour interpretation in the R7RS-small committee, but that's because I misunderstood the issue. jcowan: It's easy to do a contour version given the splicing version, but not vice versa. manumanumanu: RhodiumToad: I have a bytevector to hexstring if you want it. it uses a lookup table, though. manumanumanu: RhodiumToad: https://bitbucket.org/bjoli/hex/src/default/hex.scm manumanumanu: It is decently fast, but not constant time. manumanumanu: I will move it to sourcehut and make it public domain. manumanumanu: Good night folks! apfel: hi there, can i somehow redefine a inner function of a function from outside the function? Like, i want to redefine inner-fun from this example on the repl: https://pastebin.com/2k7AJRk9 mwette: apfel: can you use this: https://paste.debian.net/1139193/ apfel: mwette: hm, thanks mwette: or you have to pass the "inner function" as an argument to outer-fun jcowan: manumanumanu: I'd like to reuse your hex library in SRFI 178, with a bit of renaming, are you OK with that? jcowan: The license would need to change to MIT, but that's pretty trivial *: davexunit made a new release of chickadee (game programming library) https://dthompson.us/chickadee-050-released.html rekado: oh, nice! abralek: Hi, is there some scaffold tool for guile projects? abralek: guile init super-project which would create all the needful like tests configs etc.. str1ngs: abralek: I'm not aware or any scaffold. mostly it's recommended to uses autotools str1ngs: abralek: here might give you a start https://www.gnu.org/software/guile/manual/html_node/Using-Autoconf-Macros.html RhodiumToad: dsmith-work: timing may be a contributing factor guix-vits: Hi Guile. RhodiumToad: hm. what are people doing in terms of installing guile2 and guile3 at the same time? abralek: str1ngs: yes, I know about autoconf, but those files are usually almost identical, except the project name abralek: I was looking at some projects like guile-ssh guile-json abralek: it would be great to have something to generate Makefile.am configure.ac tests str1ngs: RhodiumToad: guile supports muli version installs. you can use something like ./configure --program-suffix=2.2 to give program suffix RhodiumToad: yes, but there are remaining conflicts; the info files are not changed (fixable by specifying a different --infodir), and there's the problem of aclocal/guile.m4 which conflicts between installs str1ngs: RhodiumToad: see https://www.gnu.org/software/guile/manual/html_node/Parallel-Installations.html str1ngs: RhodiumToad: the best option is to use --program-suffix=2.2 and each guile has it's own prefix. str1ngs: this is assuming you are manually installing of course. RhodiumToad: I'm writing a freebsd port str1ngs: abralek: it's not hard all you need is configure.ac an Makefile.am. autoscan can create a skeleton configure.ac abralek: str1ngs: autoscan.. I am not aware about that. Let me see str1ngs: abralek: it won't do much on a new scheme project . but it will produce a configure.scan you can copy to configure.ac rekado: I’m trying to make a GET request with a Range header rekado: but the Range header seems to have no effect: rekado: (call-with-values (lambda () (http-get "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40262;mbox=yes" #:headers '((range . (bytes (10000 . #f)))))) (lambda (response body) (string-length body))) rekado: doing the same with wget does work, though rekado: wget --server-response -d --start-pos=10000 'https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40262;mbox=yes' civodul: rekado: did you try to see if the Range header is actually serialized? rekado: yes, it is rekado: (I tried with an HTTP request and observed strace output) rekado: I’ll ignore this for now and revisit later. srandon111: guys how can i return multiple values from a function without returning a list? srandon111: https://www.gnu.org/software/guile/manual/html_node/Multiple-Values.html srandon111: i was trying to read here, but it's quite impossible to understand srandon111: i see no examples or explanation on how to do it in guile brendyyn: (values 1 2 3 4 5 6 7 8 9) srandon111: brendyyn, but it returns a list srandon111: of values brendyyn srandon111: i want single values brendyyn: it doesnt for me jcowan: Multiple values are not a list, any more than multiple arguments are. You can arrange to get multiple arguments as a list, but that doesn't make them the same thing. mwette: I believe values must be called in the context of call-with-values (or a procedure or macro that uses call-with-values). (call-with-values (lambda () ... (values 1 2 3 4)) (lambda (a b c d) ...) mwette: oh, unless values has one argument -- then it may be OK. Guile ref manuals says otherwise behavior is undefined manumanumanu: srandon111: to work with multiple values, the simplest things to use is either let-values or receive. For let-values, you have to import (srfi srfi-11), and for receive, (ice-9 receive) (but maybe (srfi srfi-8) works). In the repl, multiple values are displayed each on a new line manumanumanu: srandon111: let-values: https://www.gnu.org/software/guile/manual/html_node/SRFI_002d11.html receive: https://www.gnu.org/software/guile/manual/html_node/Multiple-Values.html RhodiumToad: I actually like srfi-71, but it's less compatible because it redefines let manumanumanu: I believe chickn has a very nice form for srfi-8 with only one argument: (receive (values 1 2 3)) => (receive _ (values 1 2 3) _) which expands to (call-with-values (lambda () (values 1 2 3)) (lambda _ _)). manumanumanu: RhodiumToad: so do I, but I haven't gotten used to it being in guile yet :D RhodiumToad: let-values is a bit too paren-heavy even by ordinary lisp standards dsmith-work: UGT Greetings, Guilers jcowan: RhodiumToad: Yes, iwbni it only let you have one binding, but it slavishly imitates let mwette: I use let*-values but it is easy to get lost in the parens. In most cases I end up with call-with-values. I forgot about receive. mwette: I think when starting out it's better to use the base Scheme syntax/procedures, in order to get a better understanding of the langauge. e.g., named let versus other iteration forms jcowan: yes, receive is probably best if you have only one multiple-value-returning object RhodiumToad: call-with-values is much too cumbersome for serious use RhodiumToad: receive is a good option for simple cases. jcowan: One thing I miss from CL is multiple-value-call, which afaik cannot be emulated directly without reifying multiple values jcowan: It's roughly similar to call-with-values, except that it can call many producers and return all the values taken together. jcowan: it doesn't come up much, but when it does you really want it. dsmith-work: The way multiple values are handled in Scheme seems.. "foreign". Just doesn't seem to match the elegance in the rest of the language. dsmith-work: My Opinion. jcowan: There's a mismatch between Scheme's true nature as a continuation-based imperative language, where multiple values are just multiple arguments passed to the continuation, and its normal use as a functional language where by definition functions return a single value. dsmith-work: Yeah. That. jcowan: Another problem is that there is no way to name multiple values in the callee jcowan: (multiple-lambda (a b c) (d e f) ...) jcowan: such that the body automatically returns (values d e f), but you still have to assign them (ugh) dsmith-work: Heh. Reminds me of that quote: "Q: Why dosn't lisp have reference arguments? A: Because C++ can't return multiple values." Or something like that. *: jcowan laughs IRL jcowan: It makes sense, actually. Fortran (until fairly recently) had only reference arguments, and Algol 60 allowed the callee to specify each argument as by value or by name. RhodiumToad: hence the famous joke about Wirth jcowan: Yes jcowan: Here's a classic call by name procedure (rewritten into C with CBN): dsmith-work: s/reference arguments/output arguments/ jcowan: void gps(double i, n, z, v) { for(i = 1, i <= n, i++) z = v } jcowan: with well-chosen arguments, this can compute any computable function jcowan: What do you mean "output arguments"? dsmith-work: You pass the address of a variable to receive the retuned value. dsmith-work: I looked, but I can't find the exact quote right now. Or who it was by. jcowan: But also for the callee to get the value from the caller. It's reference both ways. If you pass i+1 or 5 as an argument, a cell is allocated on the stack, the value is assigned to it, and a reference to the cell is passed. If the callee mutates the argument, there will be no visible effect. marmulak: hey is comma notation (example: ,q instead of (quit)) some general feature of the language or are they just a few exceptional commands for guile mwette: exceptional commands that just work at the command prompt, I believe marmulak: that's interesting mwette: the comma notation IS part of Scheme in the context of quoting: mwette: (let ((foo 123)) `(abc ,foo)) => (abc 123) marmulak: sweet dsmith-work: Pretty sure they are only available at an iteractive repl. (could be wrong) str1ngs: ,q is considered a meta command str1ngs: marmulak: ^ str1ngs: marmulak: you can define your own with 'define-meta-command str1ngs: they only work in REPL as far as I know marmulak: is there a function in guile to sort a list of strings alphabetically str1ngs: marmulak: (sort '("b" "a") string<) str1ngs: string< should reverse marmulak: I was reading https://www.gnu.org/software/guile/manual/html_node/Sorting.html just now and I was wondering what is meant by a sort being stable or unstable marmulak: do the unstable ones crash sometimes str1ngs: err I meant string> should reverse marmulak: hmm that works marmulak: not sure what the manual means by "sort items less", like I tried (sort '(...) less) and it didn't like that str1ngs: it means to use a predicate comparison there I think. str1ngs: string< does a less comparison on strings marmulak: what is a predicate comparison str1ngs: for ints you would use < str1ngs: maybe a better term is less means use a less than comparison marmulak: right marmulak: so where the manual says "less" they mean to enter the symbol < str1ngs: right but you can also use > to reverse the list :) marmulak: B) marmulak: I have a list of package names for guix that I put in a manifest file, I just felt like sorting the list marmulak: should help for when it gets long marmulak: although I could have just not been a fool and made it alphabetical to begin with since I added things to it one by one str1ngs: sounds like a handy use case :) str1ngs: I just use sort-lines in emacs marmulak: scheme is all about practicality :) marmulak: I'm not ready to tackle emacs yet str1ngs: sometimes emacs tackles you. but it's a fun adventure :). One of the best things I've invested time in. marmulak: I've recently become an advocate for nano marmulak: a buddy of mine told me I had to learn emacs org-mode and that was kind of useful str1ngs: org-mode and magit are great reasons to use emacs marmulak: ok so I put a simple sort function whose result I want printed on screen in an .scm file and gave it as an argument to guile on the command line, and apparentily it compiled it o_O marmulak: I was thinking something more like, run it and show the result str1ngs: marmulak: you could treate the list as data and use 'write to sort and 'read to get the list back marmulak: the program seems to run but I think I need to add i/o to it if I want it to print to stdout str1ngs: but this is alot of work just to sort one list. when you can do this in a editor like emacs marmulak: oh yeah let me try to evaluate it in emacs selimcan: Verily I say unto you, Emacs is worth learning marmulak: verily marmulak: what is thait 'write and 'read that you speak of marmulak: oh write is cool marmulak: wait how can a function just do i/o like that, this is anarchy marmulak: I feel like I might be able to use guile as language for writing shell scripts or something like that with unix commands str1ngs: marmulak a working example http://paste.debian.net/1138935 str1ngs: marmulak: this is not sanitized but you can just do guix package -m ./example.scm and it will sort and save user-land list. str1ngs: including install. I still think this is overkill but should show you how to use 'read and 'write str1ngs: err I did'nt add sorting but you can :) marmulak: nice str1ngs: marmulak: revised version with sorting http://paste.debian.net/1138936 marmulak: I will save this for further analysis marmulak: I'm using a manifest file that is just one line of (specifications->manifest... marmulak: that I copied from the man page or something marmulak: it's much more simple than this but it works marmulak: I was also delighted to discover it works with "guix weather" as well str1ngs: marmulak: right I use specifications->manifest with my lists sorted in emacs pretty simple str1ngs: I added these read right to show how you can serialize a sorted list. str1ngs: err read writes* marmulak: excellent marmulak: we're making linux fun again srandon111: guys i am learning scheme, and just finished few exercises and am quite comfortable with basic stuff... i was trying to read this code https://github.com/NalaGinrut/artanis/blob/master/artanis/artanis.scm#L228 but can't undestand why so many lambdas i mean what is the dev trying to do there? str1ngs: marmulak later I plan to use guix scripts so I can pass command arguements. say ./profile server ./profiles workstation. and will install the subset manifest based on aruements. marmulak: sounds good marmulak: I am looking at some example guile scripts and I noticed #! is proceded by a line iwth !#. Never seen anything like that before guix-vits: marmulak: it's like #!/bin/bash, but for guile Blackbeard: guix-vits: hi marmulak: must it always be enclosed by !# or only when it's multi-line? str1ngs: srandon111: make-general-tag is used to create a name procedure . see a-tag label-tag etc. guix-vits: Hi Blackbeard dsmith-work: marmulak: https://www.gnu.org/software/guile/manual/html_node/Block-Comments.html marmulak: dsmith-work: thanks mwette: srandon111: (define para-f (make-general-tag 'para)) mwette: (define para-f/attr (para-f ("foo" "123") ("bar" "456"))) generates a function to generate paragraphs with those attributes) mwette: (para-f/attr "here is some text") => here is some text mwette: or something like that mwette: civodul: I'm using the private procedure call-with-output-file/atomic from (system base compile) via @@. If it would be generally useful to people maybe export it? (And possibly relocate it?) mwette: marmulak: I sometimes use #!/bin/sh\n ...\n exec guile $0 \n !# ; it lets you set up environment that guile may need. marmulak: thanks, I was following script examples in the manual and it gets pretty hairy with #!/usr/bin/env sh exec guile -l...... marmulak: impossible to understand lol civodul: mwette: i agree it would be more generally useful civodul: there currently isn't a module for that kind of tool though mwette: civodul: current location is fine with me srandon111: mwette, are we reading the same manual? whre is the "help" thing written? mwette: srandon111: didn't see "help" mentioned. Are you looking for a search database for guile help? Not sure about that. srandon111: mwette, damn.. guys we have to improve the doc system mwette: lol : the microsoft generation srandon111: mwette, what microsoft generation? srandon111: look at racket/clojure they have good docs srandon111: examples everywhere srandon111: we need to improve that mwette: It would be nice to have examples, yes. That's the first place people usually go. Maybe the best way to start would be with an FAQ. malaclyps: srandon111, i'm up for helping if you want to plot together! str1ngs: or maybe more like emacs, where it has a reference manual. and and Emasp lisp intro str1ngs: and the* srandon111: malaclyps, plot ogether examples? srandon111: malaclyps, are you there/ malaclyps: srandon111, yeah, or better documentation srandon111: actually i was working on a small tutorial/course about scheme programming techniques srandon111: and i wanted to do it guile flavored malaclyps: i mean "different documentation" -- it's good documentation, it's just some people ahve different tastes srandon111: malaclyps, guile actually other than the main reference lacks resources like tutorials/books/ and so on malaclyps: srandon111, i agree! srandon111: i wanted to cover, function design, data structure design, recursive function for iteration processes, recursive function for recursion processes, trees, means of abstraction and so on srandon111: a sort of easy level SICP tutorial srandon111: all in guile malaclyps: srandon111, happy to be a reader/editor for you srandon111: thanks malaclyps let's keep in touch now here is 2.28 AM, do i find you on this channel? malaclyps: i was also thinking that a "Modern Guile" guide might be good, based on the standards that Guix is sort of developing srandon111: malaclyps, yes definitely malaclyps: srandon111, I'm often here, i'll msg you my email too srandon111: ok go on *: guix-vits Hi there (i'm "afk") dsmith-work: {appropriate time} Greetings, Guilers mwette: Same to you. Have a good day. I'm off to work, in the dining room. civodul: hello! manumanumanu: Ahoy hoy, guilers anadon: What does R7RS stand for? manumanumanu: Revised⁷ Report on the Algorithmic Language Scheme dsmith-work: Yeah, I'm working out of my basement jcowan: anadon: So it is the seventh revision of the original Report on Scheme, which can retrospectively be called R0RS. jcowan: The name in turn tracks the Report and the Revised Report on the Algorithmic Language Algol 60, which contributed many features to Scheme (but not its syntax) jcowan: Unfortunately, the third and last Algol 60 report was not the Revised Revised Report but the Modified Report. But I still like to call it R2RA60. anadon: You see, I was born in 1991. I missed all this. alextee[m]: i want to find all files under a directory (no subdirs) ending in a suffix alextee[m]: is file-system-fold what i'm looking for? rekado: no recursion? Then use scandir. alextee[m]: oh thanks! jcowan: anadon: Those who do not learn from history are doomed to make a balls of their current projects. alextee[m]: file-exists? works for dirs too right? alextee[m]: probably *: alextee[m] tries alextee[m]: doesn't it seems alextee[m]: oh it does anadon: jcowan: Thus all this time and effort to try and make my paper right. dsmith-work: I've been working on updating buildroot for guile 3.0. The jit was making bad code. dsmith-work: Works fine without the jit. dsmith-work: (this is for rpi3) dsmith-work: Then I found that the jit only creates thumb code, and that Debian builds everything as thumb. dsmith-work: Explains why it (well, 3.0.0) is working on my beaglebone. dsmith-work: So Iv'e configured to build for thumb instead. And now I'm getting a segfault about half the time. dsmith-work: while true; do cat /dev/null | guile > /dev/null ; echo $? >> /tmp/errors; done dsmith-work: and then: sort /tmp/errors | uniq -c dsmith-work: 93 0 dsmith-work: 97 139 dsmith-work: If I redirect stdin directly, no errors. (like guile -o str1ngs: I'm not getting the point of this. why not just use meson to call guile-snarf alextee[m]: because i need to call pkg-config --cflags and i can't easily do that in meson alextee[m]: so i wrapped the call there str1ngs: but meson should build a CFLAGS or something no? str1ngs: I think you need to remove the -I libguile.h alextee[m]: it does internally, no way to get it str1ngs: can you spin off a branch and push what you have there. str1ngs: because I'm getting similar errors now, but not the same str1ngs: there must be a way to get the cflgs str1ngs: err cflags alextee[m]: there is not afaik :/ but there is a way to get the pkg-cofnig names, which i can pass to the wrapper and do pkg-config --cflags on them alextee[m]: which i tried before but still had problems alextee[m]: all the headers should be available when in snarf mode? alextee[m]: and i need to pass all the required -I flags so they get found, right? str1ngs: alextee[m]: right but libguile.h should have a pgkconfig cflags so it might be included twice. str1ngs: but for me to look at this i need to have what you have there. push a temp branch or something. alextee[m]: ok let me add all those flags first str1ngs: leave it as is for now. just need to be on the same page anadon: Hello all, I'm learning Guile and was looking about maybe supporting OCaml as well. Is this feasible, or is there some bijection between the languages? rekado: what do you mean by “supporting OCaml”? OCaml and Guile are very different languages. mwette: anadon: are you talking about using the Guile backend to compile OCaml source and be able to access data both from Scheme and OCaml? jcowan: Sure it can be done, it's what's known (sarcastically) as a Small Matter of Programming. As in making your C compiler also compile Scheme. jcowan: No blame to you, but we do get a lot of posts of the form "I'm a Guile n00b and I want to do ." Try walking before you run. alextee[m]: str1ngs: just pushed to a branch called "snarf" str1ngs: alextee[m]: thanks alextee[m]: i'll start adding the cflags now and remove the #if !defined(SCM_MAGIC_SNARFER) from the headers str1ngs: alextee[m]: this x files look wrong anadon: jcowan: Hey, I ask because I'm new. I don't quite know what's stupid yet here. dsmith: alextee[m]: Not sure if it will help, but take a look at https://gitlab.com/dalepsmith/guile-sqlite jcowan: As I say, no blame to you for asking. anadon: mwette: Just reading on the Lisp lineage and ondering if there was a significant overlap in working syntax and features. jcowan: But seriously, if you were new at , would you try to write a to translator? anadon: *wondering jcowan: Syntax, no, but it's semantics that matters. Common Lisp and Scheme almost share syntax, but the deep differences are in semantics. jcowan: OCaml and Scheme have very different syntax *and* semantics. alextee[m]: str1ngs: i thought so. can you pls post a correct looking x file? i have no idea what it should look like, but i would guess it would not include function declarations alextee[m]: dsmith: thanks! str1ngs: alextee[m]: should look more like this. jcowan: dsmith: That project appears to be empty, unless I am doing something wrong (I don't use the gitlab UI much) alextee[m]: dsmith: there is nothing there str1ngs: alextee[m]: http://paste.debian.net/1138590 anadon: jcowan: I'm trying to write a paper to rework for files are funamentally thought of and treated. So I do have a number of years of formal programming experience in C-like languages. I'm just branching out to more "pure" languages and trying to architect things before I spin out and sink a bunch of time into a dead end. So the Lisp family of languages looks like a correct choice, but I'm not yet familiar with them deeply enough to avoid anadon: dumb things. alextee[m]: str1ngs: !!!!! yes! i thought so. i have no idea why my x file is 10k lines long and includes the whole of libguile.h dsmith: alextee[m]: Hmm. str1ngs: alextee[m]: guile-snarf is not being invoked properly str1ngs: as far as I can tell jcowan: Okay. Be aware that the Lisps, ML, and OCaml are all impure functional languages. Haskell is pretty much the only pure functional language still standing. mwette: anadon: Good luck. Like jcowan said, pick one and go. SML and Haskell are others that probably have more similar syntax. Though the semantics can be very different. (IIRC Haskell has lazy eval.) alextee[m]: so `guile-snarf -I... -I... ... -o output.x input.c` is incorrect? i see you used a pipe before str1ngs jcowan: Do you have a draft or outline of this paper you can put on line? I've been interesting in file systems for a while now. jcowan: "Haskell is lazy to preserve purity, and it is pure because we likes pure, we likes it, gollum!" str1ngs: alextee[m]: think I fixed it *: jcowan thinks that a language should not be lazy and do strictness analysis for efficiency, but be strict and do laziness analysis when the procedure is marked pure. alextee[m]: str1ngs: I tried this from the root dir, still makes a 10k line .x file: `guile-snarf -I. -Iinc -I$(pkg-config --cflags gtk+-3.0) -I$(pkg-config --cflags guile-2.2) -o test.x src/guile/audio/position.c` alextee[m]: str1ngs: :o jcowan: Of course "purity" is only meaningful at a specified level of abstraction: pure languages depend on decidedly impure allocators. alextee[m]: oops, -I is wrong alextee[m]: still 78k lines though with gtk alextee[m]: str1ngs: i did it!! str1ngs: alextee[m]: can you try with this patch http://paste.debian.net/1138593 str1ngs: alextee[m]: the input and output should come before CFLAGS alextee[m]: str1ngs: yes! i just figured that out while trying alextee[m]: isn't that a bug though? alextee[m]: i thought order of arguments didn't matter str1ngs: its' also documented guile-snarf -o out-file in-file. so I don't think that's a bug dsmith: alextee[m]: Ok, I think you can see the files now. str1ngs: alextee[m]: and this would be easier to support if you used autotools :) alextee[m]: str1ngs: lol str1ngs: I know the GTK people like meson. but use guile folks use autotools alextee[m]: it compiled now! dsmith: alextee[m]: fwiw, that's the sqlite interface that the bot has been using for ages alextee[m]: str1ngs: thanks so much for your help alextee[m]: dsmith: not needed anymore yay \o/ str1ngs: alextee[m]: also for nomad I did not split the C files. I just add the SCM_DEFINE's lower in the main C file. it's less bookkeeping alextee[m]: what bot is using it though? dsmith: sneek: seen rlb? sneek: I last saw rlb on Apr 01 at 07:37 am UTC, saying: In any case, thanks for the help.. dsmith: Stuff like that alextee[m]: str1ngs: you mean just include all the x files in a single go? alextee[m]: dsmith: oh that's awesome, i love sneek str1ngs: alextee[m]: no I mean instead of having two position.c files alextee[m]: str1ngs: i prefer to split the guile stuff from the main logic str1ngs: well it's using main logic anyways :) and it's in the same namespace alextee[m]: and apparently you don't need any extra cflags str1ngs: so this is just a book keeping issue :P alextee[m]: str1ngs: it works if you wrap all the headers except libguile in an #ifndef SCM_MAGIC_SNARFER alextee[m]: so you don't really need to pass any CFLAGS to guile-snarf alextee[m]: except guile's include path alextee[m]: which makes my life easier with meson since i won't have to bother collecting all those cflags str1ngs: again SCM_MAGIC_SNARFER should only wrap. dot X includes str1ngs: please read the snarfing documentation alextee[m]: but if it works on the headers too :P alextee[m]: i did, but i do not see why it needs to know what's included str1ngs: either way whatever works for you :) alextee[m]: :-) glad it's working now str1ngs: I'm not sure about foreign objects. need to think more on that one. alextee[m]: i think the benefit of using foreign objects is that their lifetime is managed by guile alextee[m]: i think? str1ngs: well as far as I can see the structs are now guile types str1ngs: which is usefully in your case, because most of your types are C str1ngs: in nomad I did the inversion most of the types were scheme. and I only used C for the GTK etc. alextee[m]: i am thinking to just make a single type and use it everywhere alextee[m]: since all the type really has is a pointer stored in a "data" location str1ngs: if your types where GObjects you can use guile-gi or g-golf :P str1ngs: and get introspection for free :) str1ngs: this is what I do with nomad nomw. str1ngs: now* alextee[m]: hmm str1ngs: alextee[m]: though snarfing is a good start. srandon111: guys can somebody tell me if there is a book about guile? i mean other than the reference manual which kind of sucks without offense str1ngs: srandon111: please provide more constructive criticism than it sucks. guix-vits: srandon111: try SICP book (guile is an implementation of scheme)? srandon111: guix-vits, i already read SICP srandon111: str1ngs, yees... it basically lacks examples.. i was trying to understand how to launch exceptions anc catch them... welll i see the dense TOC, go in the section and can't see half example of code srandon111: basically it seems some kind of memento for developers of guile srandon111: str1ngs, srandon111: i think the manual needs some serious revisitation, especially inserting sometimes examples of code would be definitely helpful instead of being super abstract srandon111: str1ngs, rekado: srandon111: no manual is ever perfect and the Guile manual does have a couple of spots that are hard to understand. When you have concrete issues with the manual please submit a bug report with a proposal for change (or even a patch). rekado: about exceptions: have you read the manual section on exceptions? It does have a few examples. str1ngs: srandon111: which version of guile are you using? rekado: and it has a lot of elucidating prose srandon111: rekado, a couple of spots???? damn everytime i need something i can't find half example of code dude srandon111: sorry for being rude... but let's say things as they are... srandon111: str1ngs, 3.0.2 srandon111: rekado, can you link the examples? rlb: One thing that might eventually belong in the info pages if it's not, is the "plan" wrt exceptions that's in the 3.0 NEWS (I think). rlb: i.e. the intent to move away from throw/catch, etc. rlb: (i.e. guidance) srandon111: guys we need to improve those docs/manual rlb: no argument that the docs could be improved, someone just has to have the time to do the work, and understand what's needed. str1ngs: exceptions have changed in 3.0 could that be causing the confusion here? rlb: s/no argument/no doubt/ str1ngs: myself I use guile 2.2 and the catch documentation is self explanatory IMHO str1ngs: provided you read the signature srandon111: str1ngs, i am not a guile developer nor a super skilled scheme dev srandon111: i need examples rekado: srandon111: I’m sure you can “say things as they are” without being rude. This will also make it more likely that people will assist you. str1ngs: I think the expectation here is a little off. It's guile reference manual. not guile by example rlb: I suspect srandon111's talking about even more descriptive examples for those newer to scheme, etc. I think the info pages do a very good job of that in some places, and could include a bit more "gentle introduction, elaboration" in others. No specific examples in mind right now though, but I think that's crossed my mind before. str1ngs: I'm wondering if the changes to exceptions that is confusing things here *: rlb too srandon111: str1ngs, in general not only exceptions srandon111: many other points... srandon111: anyway i am working on a tutorial right now rekado: str1ngs: no, there is no copy-paste-ready snippet that shows throw and catch. rlb: str1ngs: and yeah, I imagine what srandon111 would really like is a more introductory text, but in the absence of that, in cases where it doesn't detract, wouldn't hurt to elaborate in the info pages. rlb: (simple mater of texinfoing...) str1ngs: rekado: right guile 2.2 makes sense to me . the guile 3.0 does not. but that's just quickly trying to grok it on my part. srandon111: rekado, exactly srandon111: rlb, yes rekado: I do think “the manual sucks” is a very uncharitable way of viewing a lack of examples. The Exceptions section is very comprehensive and, I think, well written. rekado: b#g rekado: oops str1ngs: I use R5RS to learn the basics of scheme. https://schemers.org/Documents/Standards/R5RS/HTML/ str1ngs: though I'm not sure if that's the issue here. there seems to be an expectation that a the reference manual should have examples. I think that more of a ideal situation then an expected one. anadon: dangling link from google when searching "guix upgrade" : https://guix.gnu.org/manual/en/html_node/Upgrading-Guix.html str1ngs: anadon: maybe let #guix now str1ngs: know* anadon: Wrong tab! malaclyps: Is there a way to pop up to the top-level prompt in the Guile repl? I always end up 9 backtraces down and have to ",q" forever to escape srandon111: rekado, rlb e.g., where do i find the manual how to find help for a specific command? mwette: look in the index mwette: you can also type `,d proc' at the command prompt, where proc is the procedure (or function) you are interested in srandon111: mwette, where in the index? srandon111: where should i lok ? mwette: https://www.gnu.org/software/guile/manual/guile.html#Procedure-Index rekado: srandon111: if you’re using an info reader (such as “Emacs” or “pinfo” or “info”) you can hit “i” and type away. str1ngs: malaclyps: I'm not sure if this is the best way. ,finish twice works malaclyps: str1ngs, thanks str1ngs: malaclyps: not confident that is right I get. system/vm/trap-state.scm:253:16: Wrong number of arguments to # str1ngs: but works on the second attempt malaclyps: str1ngs, yeah, it quits scheme on my first try, but maybe it's a clue to the right thing to do daviid: str1ngs: wrt this /dev/tty -> /dev/null np, feel free to substitute guix-vits: Hi there. guix-vits: daviid: test-g-value-boxed-semi-opaque failing in `guix build` environment. Can the "/dev/tty" be changed to "/dev/null", for example (at least as a 'quick way to disable this test')? daviid: guix-vits: yes, substitute to /dev/null is ok and better then removing the test guix-vits: daviid: thanks str1ngs: alextee[m]: looks good. GtkSourceView is pretty handy alextee[m]: yeah rekado: module/language/elisp/boot.el defines a bunch of macros in terms of things that don’t exist rekado: for example “defmacro catch” uses “call-with-catch”, which isn’t defined anywhere else. rekado: same with save-excursion and a bunch of others RhodiumToad: what version? *: civodul had an idea civodul: rekado: what about writing a blog post for Guile about Guile-Studio, with animated GIFs and all? civodul: we could even offer Guile-Studio packs for download somewhere *: RhodiumToad tries compiling guile3 on freebsd RhodiumToad: + test '=' no spk121: what about adding animated gifs as aliases to r6rs keywords, to make code more fun RhodiumToad: m4/timegm.m4 tests $gl_cv_func_working_mktime without regard for the fact that it's not set. RhodiumToad: sed -i is nonstandard, and while bsd sed accepts it, the option value is required, so -i -e doesn't work (should be -i '' -e) rekado: RhodiumToad: I’m on the wip-elisp branch rekado: trying to fix tests first before trying to rebase onto some newer version. rekado: civodul: this sounds like a good idea, but I don’t think I have the bandwidth at this time :-/ holomorph: yay wip-elisp rekado: I wonder why boot.el contains so many definitions written in Elisp that could probably be part of the language spec (written in Guile) instead. *: rekado reads more str1ngs: rekado: I don't think there is anyway to call scheme from elisp str1ngs: maybe language spec is different though. *: rekado is confused to see that there are changes to elisp in stable-2.2 that are not in wip-elisp *: rekado rebases chrislck: question about (ice-9 match) -- I'd believed (wrongly) that (match something ((_ x . _) x)) would simply capture something's 2nd element, and ignore the rest. but it seems the two _ are considered regular patterns. RhodiumToad: _ matches anything chrislck: i.e. I know; does the above (_ x . _) mean that the two _ must be equal? RhodiumToad: no chrislck: there's some weird stuff happening in my code then RhodiumToad: (match '(a b c d) ((_ x . _) x)) gives a result of b chrislck: I know you&I are right but the code behaves better when the pattern becomes (_ x . y) chrislck: where y is ignored RhodiumToad: I disbelieve chrislck: I'd like to disbelieve too RhodiumToad: so let's see a more complete example RhodiumToad: note that if _ is bound to something, things get weird chrislck: ahhh chrislck: that's it, _ was bound to gettext RhodiumToad: hm. wonder if that is a bug somewhere ATuin: hi, is there any example on how to use the pre-post-order in sxml? mwette: https://wingolog.org/pub/fold-and-xml-transformation.pdf mwette: ATuin: see above reference ATuin: ahhh that looks nice ATuin: thanks ATuin: real examples to read alextee[m]: i get a buunch of dupicated declarations when i include the x file: https://paste.debian.net/1138445/ mwette: are you #include-ing on line 27 and then again on line 74 perchance? alextee[m]: i was including on line 27 alextee[m]: and then the snarfed .x file on line 74 alextee[m]: are you supposed to wrap #include inside an "#ifndef SCM_MAGIC_SNARFER" ? alextee[m]: http://git.savannah.nongnu.org/cgit/nomad.git/tree/guile/util.c this doesn't seem to do that alextee[m]: https://paste.debian.net/1138446/ alextee[m]: here is what im doing alextee[m]: it compiles and links when i put the #include inside the #ifndef above, but i get warnings that the functions are unused and in scheme i get unbound variable, so that's probably wrong alextee[m]: here are the first 1k or so lines from the .x file https://paste.debian.net/1138447/ i can't paste the whole thing on debianpaste alextee[m]: not sure if that's snarfed correctly mwette: I have not done any snarfing lately. I can't help w/ that, sorry. alextee[m]: mwette: thanks anyway :) rekado: just rebased wip-elisp on top of stable-2.2; now I’m getting two more test failures in vm.test rekado: load-thunk-from-memory expects a pair, but I guess wip-elisp broke that and produces a bytestring. rekado: I’m very grateful to cwebber for the best-effort changelog commit messages in wip-elisp; sadly the commits themselves are still kinda hard to understand because in some of them there are a lot of changes. rekado: will take me some time to get enough intuition to dare changing anything rekado: found the offending commit: d808027782a7ac978a26bf3bd904c58a133316e1 (intern arbitrary constants) jcowan: If there is a way to get a pipe on the child's stderr, I don't know what it is. ThomasAlbers: I mean something to avoid (open-pipe "echo test | cat" OPEN_READ) where i have to build a string and use a shell alextee[m]: btw, what does scm_call_0 () return? i found this: ret = vm_engines[vp->engine](thread); alextee[m]: (docs don't mention what is returned) str1ngs: alextee[m]: scm_call_0 returns SCM str1ngs: IIRC alextee[m]: yeah, but what does it represent? alextee[m]: according to %p it returns "0x804" when it succeeds str1ngs: alextee[m]: can be any scheme type, so depends what proc you call. say (define (bar) "baz") if you call bar it return SCM which you can get with scm_to_locale_string *: alextee[m] is basically looking for a way to detect if there were any errors (and hopefully get the error message) when running scm_call_0() alextee[m]: ah i see so it's dependent on the script str1ngs: well you can wrap it in a C exception str1ngs: using scm_c_catch str1ngs: but that can be tedious from C. I try to just check the return types. and let scheme throw it's exceptions str1ngs: alextee[m]: maybe have one toplevel scm_c_catch. probaby you are using eval for user stripts so I make that eval safe. alextee[m]: str1ngs: oh this looks like what im looking for, thanks! str1ngs: alextee[m]: see http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/buffer.scm?h=feature-g-golf#n96 . here is a safe eval that eval's a buffer. kinda like your text input window str1ngs: alextee[m]: also I find only write C defines for the most minimal use case. and use scheme modules scripts everywhere else. alextee[m]: i see alextee[m]: does that catch syntax errors too? str1ngs: alextee[m]: yes str1ngs: I mean yes it catches syntax errors alextee[m]: wow, scheme is cool alextee[m]: i guess it runs things sequentially so as long as there's no syntax errors before the catch it will catch any syntax errors inside.. probably str1ngs: I'm still quite new to scheme to comment on that. other can explain unwind etc str1ngs: alextee[m]: I'd probably have some top level scheme that calls the SCM_DEFINE with a catch. str1ngs: so something like (define (eval-user-input text) (catch #t ....)) you get the idea. str1ngs: alextee[m]: then you don't need to use scm_c_catch because it's tedious :) alextee[m]: i'll probably do it in C with scm_c_catch str1ngs: your call :) *: alextee[m] found an example in nomad str1ngs: oh no, is it good example :) alextee[m]: qt/keymap.cpp str1ngs: ah yes str1ngs: all that qt code is gone now :) str1ngs: eventually I hope to use https://github.com/mrosset/giqt. so you can use QT from scheem. str1ngs: err scheme* *: alextee[m] seems M4/GObject/QT in a single project and tries to calculate how this could possibly work alextee[m]: + scheme str1ngs: alextee[m]: it works see. https://github.com/mrosset/giqt/blob/master/examples/hello.scm.in alextee[m]: wow str1ngs: don't show this the the GTK folks they will hate this idea haha alextee[m]: lol str1ngs: I think I can avoid this though. I only need the qtwebengine control str1ngs: though giqt would be fun for others to use I guess. str1ngs: also this works with sbcl, python, JS . see https://github.com/mrosset/giqt/blob/master/examples/webview.lisp' str1ngs: alextee[m]: GOBject is not so bad. its deriving GtkWidget which is probably not the best. alextee[m]: str1ngs: i think that's the other way around. GtkWidget inherits from GObject alextee[m]: it does sound useful for bindings though str1ngs: right, but but I derive from GtkWidget since it gets things working faster. notice I can do gtk_container_add str1ngs: probably can derive from GObject and then have a QTContainer. alextee[m]: oh yeah if you're doing custom widgets you're supposed to inherit GtkWidget afaik str1ngs: this is just proof of concept anyways. alextee[m]: or whatever's similar to the widget you're doing, but for just drawing with c airo the gtk devs said you should use GtkWidget str1ngs: for this I QtWidget derives from GtkContainer. due to how QT works. all controls are containers str1ngs: same principle though alextee[m]: i'm amazed how you can do that. i'm aware of some other kind of hack to run qt in gtk using C, but just inheriting widgets to do it is new to me str1ngs: then I override certain methods alextee[m]: GtkPort or something like that, where you get the X11 window of the qt thing and embed it in a gtk container, or something like that str1ngs: alextee[m]: that's the approach I'm going to probably use for nomad str1ngs: this way I only need to emmbed qtwebengine the rest can stay GTK alextee[m]: you might find this project interesting http://drobilla.net/software/suil alextee[m]: it's a library that allows a host to embed widgets from other toolkits str1ngs: only Gtk 2, Qt 4 though str1ngs: which makes webkit2 not usefult alextee[m]: str1ngs: that description is old alextee[m]: it does qt5 and gtk3 now too str1ngs: I think for nomad the X11 embedding would be better. less code alextee[m]: raw x11 embedding is probably the best idea IMO str1ngs: though theoretically if a designed it right you can use more then one backend alextee[m]: both gtk and qt support it afaik str1ngs: right, I'm going to write a typelib that proveds a qtwebengine control. then I can use it from scheme with g-golf str1ngs: will be awhile before I get there though. webkit is pretty good IHMHO str1ngs: also my buffer use generic methods so. load-uri would work on any web buffer class str1ngs: alextee[m]: does your program support midi? alextee[m]: str1ngs: yep str1ngs: I'll have to try it with my midi keyboard :) alextee[m]: it's in guix already :-) str1ngs: will check it out alextee[m]: still alpha though str1ngs: I hear ya, nomad is still pretty alpha too. though it's come along way. the g-golf branch is about 300 revision ahead of master now. *: guix-vits Hi there; *afk* d4ryus: hi, i would like to save the current module, evaluate something and then switch back to it. (current-module) returns the current module, but i cannot find a function to switch back to it, is there one? rekado: d4ryus: you can use save-module-excursion rekado: I use it with set-current-module to evaluate some user-provided code in a configured environment without affecting the current module. phoe: Hey! I have a design question. What is the reason that some vector operations in Guile have only destructive variants in standard (vector-set! for example)? I just ran into a use case where I could use a copying/non-destructive vector-set, but I would need to define it manually via copying the original and then mutating it. phoe: (also, the https://gnunet.org/bot/log/guile link from the topic is broken.) brendyyn: phoe: perhaps we should create a batteries included bytevectors libarary. I've been using them in my current project and found there isnt everything i need in (rnrs bytevectors). I've written bytevector-reverse, bytevector->number, bytevector-append, and used guix's base16-string->bytevector. civodul: phoe: i don't see the gnunet.org URL in the topic phoe: civodul: oh right! sorry, it was in the ChanServ autojoin message phoe: 09:57 -ChanServ(ChanServ@services.)- [#guile] Welcome to #guile! This channel is logged, see . phoe: brendyyn: my issue is that Guile is a functional programming language by definition, and yet it doesn't really provide functional operators for vector access. One needs to construct it oneselves, or - as you mentioned - use a library from an external source. phoe: (I don't mean just bytevectors though - general vectors are affected, too.) daviid: phoe: there is a fectors (functional vectors) library somwhere sneek: Welcome back daviid, you have 1 message! sneek: daviid, str1ngs says: can you confirm for me that changing the test 'test-g-value-get-pointer to use /dev/null is okay. guix build environement does not have /dev/tty. I'm pretty confident /dev/null is okay WDYT? I can substitute this so no need to change it. brendyyn: https://bitbucket.org/bjoli/guile-fector/ phoe: daviid: thanks! brendyyn: the amound of javascript required just to display that text page... phoe: https://hg.sr.ht/~bjoli/guile-fector phoe: much less javascript required brendyyn: oh golly golly phoe: and it seems it's more fresh than the BB version phoe: (even if just a bit) brendyyn: my librejs loves it phoe: Drew's orthodox minimalism has its upsides, yes d4ryus: rekado: save-module-excursion is exactly what i was looking for, thank you! dsmith-work: Happy Friday, Guilers!! *: alextee[m] uploaded an image: Screenshot from 2020-04-03 14-06-29.png (53KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/zxmqINJQMrRxPSLiOBjwOVCA > alextee[m]: str1ngs: well, i still can't figure out how to get the "what went wrong" message from catch, but scm_c_catch worked in detecting if an error occurred! ^ chrislck: alextee[m]: you can always (define last-catch-error "") ... (catch etc (set! last-catch-error "error explanation")) then from C, you can call scm_c_eval_string ("last-catch-error") to retrieve the error message alextee[m]: chrislck: is that possible to do from C? alextee[m]: i want the scheme to be as simple as possible so it's easy to get into for users with no programming experience alextee[m]: unless you mean running that scheme code from C before running this script chrislck: you can wrap your user-supplied guile script with a catch chrislck: see https://github.com/Gnucash/gnucash/blob/maint/libgnucash/app-utils/c-interface.scm#L18 now imagine cmd is the user-supplied string chrislck: actually https://github.com/Gnucash/gnucash/blob/maint/libgnucash/app-utils/c-interface.scm#L63 is the better snippet -- see how it stores the error in gnc:last-captured-error chrislck: and https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/report-gnome/window-report.c#L277 is how to display it back on screen alextee[m]: chrislck: interesting, thanks! i will try this now chrislck: the functional way would be for (catch) to run the script, and will return (list 'success output) or (list 'failure error-message) then process the 2-element list in C alextee[m]: are display-backtrace and print-exception standard scheme procedures that return the actual errors? alextee[m]: i mean, can't i just run those in my catch handler in C? alextee[m]: https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Capturing-Stacks.html alextee[m]: there's an actual example here in C! nice chrislck: levelling up in scheme means you unlock more chapters in the book ^_^ alextee[m]: ah segfault, i'll try in scheme then lol alextee[m]: i guess just format string on that example and put my script code in an %s alextee[m]: and just print the stack to the error out port chrislck: s/%s/~s chrislck: ah format from C uses %s alextee[m]: i will format the string in C before calling the whole thing with scm_call :-) srandon111: guys any good book in guile? srandon111: *about* guile? dsmith-work: srandon111: Several good books on Scheme, but nothing Guile specific that I know of. luni: Hi all i would like to ask information regarding OOP in Guile. I'm looking at the available online documentation and all is fine, anyway there is any introductory resource for interfaces/protocols to be used in the context of OOP with GOOPS? Thank you in advance rekado: luni: is there something specific you are missing from the Guile reference manual on GOOPS? alextee[m]: is there a C equivalent to (print-exception) ? luni: thank you for the answer, i will try to explain my situation to be more precise for what is possible alextee[m]: searching for "print_exception" doesn't bring up something in the guile docs luni: (premise) I'm new of OOP.... i have few classes and a lot of generic methods so inheritance is working well. But since generic methods are a lot i would like to have an efficient way to look at my code luni: and classes are not explicitly describing the methods that are related to them luni: so for me ok... all is working, but is a mess to read my own code. alextee[m]: grep to the rescue! found it in backtrace.h luni: so i'm searching some reference about good practice to follow in OOP even from a stylistic point of view luni: perhaps some examples from which to draw inspiration would be fine *: alextee[m] uploaded an image: Screenshot from 2020-04-03 16-12-08.png (95KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/xStaRYjwMZwmUSThKPrEVWhn > alextee[m]: the guile scripting interface is complete! i went with the C approach: https://git.zrythm.org/cgit/zrythm/tree/src/gui/widgets/scripting_window.c?h=bugfixes manumanumanu: Ahoy hoy, guilers! manumanumanu: Is there a reason we don't have define-inlinable* with keyword and optional arguments? Looking at define-inlinable I think I could maybe make it work... manumanumanu: scissoring some stuff from ice-9 optargs civodul: manumanumanu: no good reason i guess! manumanumanu: define-inlinable could trivially be implemented using define-inlinable*: you could just validate that all the formals are identifiers and dispatch to lambda* which "downgrades" to lambda when there are no keywords manumanumanu: civodul: would there be any interest in such a patch? I understand adding things to boot-9 isn't really anything anybody wants to do, but I know I have not been alone in trying and being frustrated that it did not work. civodul: manumanumanu: why not, worth discussing manumanumanu: I'll make a post in guile-devel manumanumanu: better forum civodul: yeah str1ngs: hello, when using a public parameter is it advisable to use the % naming prefix? chrislck: dsmith-work: SWIG-4 is out, no? dsmith-work: Hmm. Supports guile 2.0 anyway. http://www.swig.org/Doc4.0/Guile.html#Guile_nn1 mwette: swig-4 suggests running with --no-auto-compile mwette: I'm currently working on nyacc's ffi-helper now. Right now the typedef expander and constant expression compiler (e.g., enum { A = sizeof(foo_t) };). It currently only generate guile source. Would C wrapper code be useful? mwette: Last two sentences were about the ffi-helper itself. chrislck: maybe need to see how c+swig+guile generates assembly :( alextee[m]: mwette: i'd personally prefer having the C wrapper code, but not sure how useful it would be, i just like C :P alextee[m]: i'll try nyacc tomorrow, hopefully it works for my project alextee[m]: mwette: i read the whole guide btw, though i have a question. does the ffi-helper work for binaries? alextee[m]: or would i have to create a library as an intermediate step? roptat: is there a simple way to convert from hexadecimal to decimal in guile? dsmith-work: roptat: number->string I think. dsmith-work: scheme@(guile-user)> (number->string 255 16) dsmith-work: $1 = "ff" roptat: oh thanks! dsmith-work: Of course, you can also fire up the mighty (format) dsmith-work: Which is kind of like printf brendyyn: guix also has (guix base16) for turning it into a bytevector if needed, but it only works with hexadecimals padded to even numbers of digits roptat: nah it's fine, I wanted to do (string->number) anyway :) roptat: I didn't know you could add a base mwette: alextee[m]: not sure what you mean. The FH assumes you have a shared object library (e.g., libcairo.so) and an associated header file (e.g., cairo.h). mwette: alextee[m]: I get it. You are writing C code and want to interface. You'll need to compile it and load via dynamic-link. So having C wrapper may be better. Making the FH compile to scheme or C means I need two back ends, so that would be a project. dsmith-work: wingo: regarding https://gitlab.com/wingo/lightening/-/issues/12 , yeah, that just might be it. dsmith-work: wingo: emit_veneer yep. That's the code that's failing. dsmith-work: sneek: later tell wingo Yep, https://gitlab.com/wingo/lightening/-/issues/12 is probably what I'm seeing. sneek: Okay. dsmith-work: sneek: botsnack sneek: :) *: sneek wags dsmith-work: So why isn't this failing for me on by beaglbone? Because it was native compiled? dsmith-work: I don't think this part of the lightening code changed between 3.0.0 and 3.0.2 alextee[m]: mwette: ah I see, thanks. in that case it does sound more appropriate to have a C wrapper daviid: jcowan: tx - pleased to learn its 'secondary meaning' - I sort of thought that weasel (2dary meaning) meant 'good thing(s)', because the word, to my ears, sounds very beautifully - which how mistaken we can be when we just don't know ... daviid: *which show how ... wingo: o/ sneek: wingo, you have 1 message! sneek: wingo, dsmith-work says: Yep, https://gitlab.com/wingo/lightening/-/issues/12 is probably what I'm seeing. mbakke: I'm trying to concatenate two sexps with (append ...), but need to add a single ')' in between due to pattern matching shenanigans. Any ideas how? Creating a one-element list containing #\) just inserts the #\). RhodiumToad: what exactly do the input and desired output look like? civodul: mbakke: an sexp is necessarily well-balanced civodul: do you have an example? *: rekado looks at guile-for-guile-emacs *: civodul .oO( do we have guile-studio-for-guile-for-guile-emacs? ) rekado: haha *: rekado tries to find the latest version of the code rekado: there’s git://git.hcoop.net/git/bpt/guile.git, and then there is wip-elisp and wip-bpt-elisp in the official repository rekado: looks like wip-elisp in the official Guile repo is the correct one. civodul: it's even more of a maze than the Hurd repos, no? ;-) rekado: hah, close call! mwette: I think he wants (a b c) + (d e f) => (a b c (d e f)) mwette: nope mbakke: civodul: the problem is that the first sexp is produced by pattern matching another sexp, and the opening token is stripped off. The result is then spliced into another sexp that has the desired opening... mbakke: there is an extremely contrived example here that depends on some Guix internals: https://paste.debian.net/1137956/ mbakke: I guess I need include the outer parens in the initial match pattern and strip off the unwanted parts later *: rekado doesn’t understand the diff mbakke: rekado: the intention is to inherit a (modify-phases body), but strip out a single phase. rekado: ok mbakke: it's further complicated because the modify-phases body we inherit are already using substitute-keyword-arguments, and thus contains multiple (modify-phases ...) layers. mbakke: "original" in the diff are the phases from Python 2, while "added" are the phases from Python 3. civodul: mbakke: perhaps i'm missing something, but i think it doesn't have to be this complicated rekado: modify-phases is a macro that returns … an alist of symbols to procedures(?). Can you work on the expanded code? rekado: oh, no, you can’t. civodul: in python-boot0, just do `(modify-phases ,phases (delete 'phase-that-patches) ...) civodul: does that make sense? mbakke: civodul: that's the obvious solution, but it runs at "build time" and thus produces a different derivation. mbakke: i.e. the build script will be (modify-phases all-the-phases-including-that-we-dont-want (delete 'that-unwanted-phase). civodul: ah oh! civodul: i see civodul: hmm rekado: I hope that getting started with Guile’s elisp implementation is the hardest part. rekado: so far I don’t know how to load an elisp file yet, because “load” is undefined in (elisp-functions) mwette: sorry, got nerdsniped: I reformatted the + from the diff and added one simplification in https://paste.debian.net/1137990/ mwette: the lower form uses match to root out the apply-alignment-patch forms mwette: and do you want that form to return result rather than '() ? dsmith-work: UGT Greetings, Guilers mbakke: mwette: thanks for the improvement, I'm about to try a hopefully simpler approach from a suggestion over at #guix :-) guix-vits: Hi there. *: guix-vits afk guix-vits: Can someone, please, point me to readings about how to: "scheme@(guile-user)> " ---> "io-ho-ho@(guser)> "? rekado: guix-vits: ,option prompt "io-ho-ho@(guser)> " guix-vits: thanks, rekado. rekado: it won’t change the module name, though, as you enter other modules rekado: it’s just a string rekado: you can do this, though: ,option prompt (lambda () (format #f "io-ho-ho@~a> " (module-name (current-module)))) guix-vits: wow. thanks rekado. wingo: rerro wingo: civodul: do you have a reproducer for that guix graft bug manumanumanu: RhodiumToad: I wrote oleg and told him about the error, so let's see if he's feeling nice. manumanumanu: BTW: I have been thinking about implementing better string searching for guile. I have had some luck with srfi-135's boyer-moore-horspool algorithm (being faster than the C-based naive search in guile for long strings). Are there any libraries for guile for string searhcing? lfam: It would be great to have a boyers-moore implementation in Guile. There is actually an implementation in Guix but it's limited to one part of the code and not avaiable for use throughout Guix jcowan: What about the license? jcowan: (all SRFIs are MIT, unless you reimplement from scratch, which is possible of course) manumanumanu: jcowan: I haven't released anything yet, and if I do and MIT is not the license I chose, MIT is sublicenseable (iirc?) jcowan: Yes, it is. That's unusual now. jcowan: (MIT says it does not grant a patent license, but several IP lawyers have opined that the use of patent-grant verbs like "use" and "sublicense" implicitly does so.) lfam: The Guix implementaiton is in here: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/graft.scm lfam: Specifically in the replace-store-references procedure manumanumanu: I just like to have it as a baseline. The implementation from srfi-135 performs better than the KMP one from srfi-13 under guile, and I managed to tweak it some more. That makes it a good baseline manumanumanu: Found a max-shift boyer moore paper that seemed simple enough, with pretty astonishing claims of performance improvement over regular boyer-moore and also over the BMH algorithm. manumanumanu: https://www.jstage.jst.go.jp/article/ipsjjip/20/2/20_2_419/_article manumanumanu: "astonishing" was maybe the wrong word: "an incremental speed improvement almost across the board" would be more suiting. I don't know how they crafted the needles though. civodul: hey wingo! civodul: my own reproducer no longer reproduced the bug civodul: but there's a new bug report civodul: lemme see civodul: wingo: https://issues.guix.gnu.org/issue/40315 civodul: this bug was for the short window during which we used Guile 3.0.2 for grafting civodul: so i suppose one could try: guix pull --commit=735a8d997a92518d7d19926e1c8a1e385a98fdce && guix build java-jwt civodul: i'll see if i can reproduce it in a simpler context str1ngs: sneek later tell daviid. can you confirm for me that changing the test 'test-g-value-get-pointer to use /dev/null is okay. guix build environement does not have /dev/tty. I'm pretty confident /dev/null is okay WDYT? I can substitute this so no need to change it. sneek: Okay. alextee[m]: guild: unknown script "compile-ffi" alextee[m]: do i need guile 3? civodul: i think "compile-ffi" is part of nyacc, no? alextee[m]: i would think so, but this page executes `guild` https://www.nongnu.org/nyacc/nyacc-fh-ug.html alextee[m]: i thought guild was something shipped with guile, but maybe it allows you to extend it, idk civodul: "guix environment --ad-hoc guile@2 nyacc -- guild compile-ffi --help" does the trick civodul: right, nyacc extends the "guild" command here alextee[m]: ah i see, i just installed nyacc and now the command is there alextee[m]: thanks :) civodul: yw! *: spk121 is finally writing a GTK3 program in Guile for real str1ngs: spk121: I added vte aka terminal-mode to nomad :) https://bufio.org/images/2020-04-02-022415_1916x2117_scrot.png str1ngs: nomad is about 97% scheme now. spk121: str1ngs: sweet. I've seen all the talk about the tech details of nomad, but, what is the "elevator pitch" spk121: (Is "elevator pitch" a phrase people know, or is it a California thing?) str1ngs: spk121: nomad is an extensible web browser using guile scheme. think emacs for the web. though it's becoming more like emacs. spk121: str1ngs: neat! alextee[m]: i'm trying to follow the nyacc example and i'm getting this when i compile the ffi file with nyacc: ERROR: In procedure dynamic-link: alextee[m]: In procedure dynamic-link: file: "libcairo", message: "file not found" str1ngs: most the of the heaving lifting is done by emacsy. keybinds, buffers, windows echo-area and modeline. you get the idea. str1ngs: alextee[m]: you are using guix? alextee[m]: str1ngs: yep str1ngs: also I assume this is guile-cairo? str1ngs: alextee[m]: do you install guile-cairo manually? alextee[m]: no just this (define-ffi-module (ffi cairo) alextee[m]: #:pkg-config "cairo" alextee[m]: #:include '("cairo.h" "cairo-pdf.h" "cairo-svg.h")) alextee[m]: why would i need guile-cairo? i thought the point of this was to run the c library directly from scheme str1ngs: oh this is when using nyacc? alextee[m]: yeah str1ngs: either way because you are on guix you need to substitute the full path of the library alextee[m]: it seems to write the .scm file successfully but fails during compilation spk121: alextee[m]: you don't need for what you are trying to do. It is just that a couple of days ago there was talk of the guile-cairo project str1ngs: for libcairo.so str1ngs: IMHO as spk121 is saying its best to just use guile-cairo. since this work as been done already. alextee[m]: str1ngs: are you sure? i would imagine since im passing a pkg-config name it would know the paths spk121: Nah, man. Do whatever makes you energized. alextee[m]: str1ngs: im trying to see how this works so i can generate a scheme library for my project also, just trying to follow the example for now :-) catonano: Hi 😁️ catonano: I mean catonano: Hi, hexteex: catonano: bah civodul: alextee[m]: unless your goal is to play with nyacc's FFI support, you should really consider using Guile-Cairo alextee[m]: i have no need for guile-cairo, i want the ffi support though to generate scheme code for my C code str1ngs: alextee[m]: dynamic-link works like glibc . it searches assumed paths. should not have much to do with pkg-config. you can set LD_LIBRARY_PATH though. but for guix that's not recommended. though I have not used nyacc myself. str1ngs: alextee[m]: what's the point of generating scheme code to use in C code. in such case you can use C directly str1ngs: and why generate scheme code, when a scheme binding exists. see what we are saying here? alextee[m]: str1ngs: let me show you what im trying to do spk121: nyacc is the bomb. I wish I had some reason to write a new language so I could do something with it. *: alextee[m] uploaded an image: Screenshot from 2020-04-02 21-56-10.png (161KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/QCbvbtaDduDFMDkBODQUBMlN > alextee[m]: this is zrythm, a software for making music, and i want to expose a scripting interface in that window where you execute script commands, for example to generate some midi notes str1ngs: right gotcah str1ngs: gotcha* str1ngs: looks cool btw :) alextee[m]: thanks! cooler with scheme :D str1ngs: alextee[m]: I'm assuming this is written mostly in C? alextee[m]: str1ngs: 100% C alextee[m]: nice, i managed to compile the ffi example now alextee[m]: str1ngs: i was planning to do everything manually like so: https://git.zrythm.org/cgit/zrythm/tree/src/guile/audio/position.c alextee[m]: until someone mentioned the ffi thing alextee[m]: i mean, i don't really have to expose everything, just the relevant/useful things str1ngs: alextee[m]: right for cairo just have C do the cairo bits. and expose the SCM_DEFINES str1ngs: alextee[m]: unless you want to auto generate your scheme from you C? alextee[m]: with nyacc's ffi? alextee[m]: i don't know. what would be better? i personally like doing it manually because i have full control over the docs and what to expose and whatnot, but the ffi generator would save me time alextee[m]: it looks like you can filter what to generate with the ffi helper so that could do it str1ngs: SCM_DEFINES with snarfing is pretty good. but personally I would use guile extention. since you can then use the code from a REPL etc. str1ngs: for nomad I use a custom type lib. so that things like guile-gi and g-golf can use the functions via scheme. GI does the exposing. str1ngs: alextee[m]: see http://git.savannah.nongnu.org/cgit/nomad.git/tree/typelib/util.h?h=feature-g-golf. all these are exposed to scheme. eg. nomad_spawn_terminal is now 'nomad-spawn-terminal str1ngs: those it hard to pass SCM types this way. alextee[m]: str1ngs: where exactly are you exposing them? for example nomad_app_run_javascript () str1ngs: alextee[m]: before this though I wrote nomad as a guile extention. which might work well for you use case. str1ngs: alextee[m]: it's exposed to scheme. well anything that has GI bindings. would work in python as well alextee[m]: oh you're using g object introspection alextee[m]: and guile-gi converts that to guile somehow? str1ngs: that's correct. what GUI tookit are you using? str1ngs: it does not convert. GI tells guile how to FFI the library. alextee[m]: i use gtk+3, but i don't really plan to expose any UI related things, and i don't use gobject's for anything, just plain old C structs str1ngs: in that case I would write libzrythm as a guile extention alextee[m]: i see. not really sure i'm understanding what a guile extension is though str1ngs: and just manually use SCM_DEFINE. if you need to use cairo just wrap it in an expose SCM_DEFINE using C spk121: alextee[m]: there's more than one way to do a thing. i've done Gtk+3 C applications with Guile script bits before. It works fine. alextee[m]: so i guess i'll just continue SCM_DEFINE'ing things little by little str1ngs: alextee[m]: btw you can also use SCM_DEFINE_PUBLIC alextee[m]: i already have the execution of the script working. when you click the execute button it executes it and prints the output in a label there alextee[m]: btw, i also want to print the guile errors, is that possible? str1ngs: alextee[m]: also I would snarf so you don't manually have to maintain. https://git.zrythm.org/cgit/zrythm/tree/src/guile/audio/position.c#n102 alextee[m]: str1ngs: yeah i am already generating the .x files, even snarfing docs. i had some problems when including the x files though that i haven't figured out yet str1ngs: alextee[m]: here on the master branch of nomad I use a guile extention with snarfing. maybe this can help you. see http://git.savannah.nongnu.org/cgit/nomad.git/tree/guile alextee[m]: i can't find SCM_DEFINE_PUBLIC in the guile docs str1ngs str1ngs: alextee[m]: this model is more like what you are using now. before I switched to GI alextee[m]: nice, thanks! str1ngs: alextee[m]: I also used modules in C. but that might be overkill for you alextee[m]: yes it would. this is nice example code though, thanks! str1ngs: no problem. I find GI easier to use now. but for your current model this should work for you. str1ngs: you might need to translate to meson of course. alextee[m]: using GI means you have to convert your structs into GObject's right? ThomasAlbers: hello alextee[m]: i'm concerned about bloat and loss of performance if i use it on audio-related structs, so i went with plain C structs, but i'll investigate that too str1ngs: alextee[m] potentially yes, mostyly you would just BOX your type as private GObject. for me I'm using GTK classes etc anyways. does not matter. my core types are already scheme. ThomasAlbers: one question, could anyone help me with POSIX pipes? spk121: ThomasAlbers: ask away. maybe someone will know str1ngs: alextee[m]: I would use scm_from_pointer to move your types from C to scheme anyways. and then scm_from_pointer to get it back in C ThomasAlbers: i'm trying to use dmenu from guile, but i don't know how to separate stdin from stdout ThomasAlbers: i need to send a end of file through stdin keeping stdout accesible alextee[m]: str1ngs: i'm not really sure what the difference between that and a foreign object is, even after reading the docs :-) foreign object seemed to work best in the things i tried str1ngs: alextee[m]: I think I had those reversed. you get the idea though str1ngs: alextee[m]: I have not use foreign objects. maybe I should lol alextee[m]: i'm looking at text.c, maybe it's easier to use pointers. with foreign objects for some reason you need to encapsulate the pointer in a list of size 1, which didn't make much sense to me. i'll give pointers a try str1ngs: alextee[m]: I think most of this code is okay. when I first started writing this I had not use guile befoer. str1ngs: before* str1ngs: alextee[m]: but I think this is very close to your current model. alextee[m]: yeah it looks like it's similar jcowan: ThomasAlbers: "Sending an end of file" means "closing the output side of the pipe". ThomasAlbers: yes ThomasAlbers: if i understand it correctly jcowan: You do. ThomasAlbers: what i'm trying to archieve is something like var=$(echo foo | cat) in bash ThomasAlbers: where foo is a scheme string jcowan: Okay, so when echo terminates it closes its stdout, cat sees that as EOF, and bash reads the stdout of cat and inserts it into the command line ThomasAlbers: exactly ThomasAlbers: and by using (open-pipe* OPEN_WRITE) i can get the first part to work, but i don't know how to get the program's output ThomasAlbers: I thought it would be as easy as using "with-output-to-string" or someting similar ThomasAlbers: because the documentation says the process has the same "current-output-port" jcowan: You want to call it with OPEN_READ, because you are going to read from the pipe jcowan: what that returns is an ordinary input port to which you can apply read-char or read-string or read or whatever you want. ThomasAlbers: but then i dont have how to give it the input jcowan: the names READ and WRITE are from the perspective of the parent. ThomasAlbers: but if i use OPEN_READ can pipe input into "cat" without using a shell (open-pipe) ThomasAlbers: ? alextee[m]: before I run my procedure in C, i do scm_set_current_output_port() and scm_set_current_error_port(), then run the procedure, and afterwards do scm_get_output_string() on the ports followed by scm_to_locale_string(). This seems to work for output produced by the procedure, but i also want to get guile's compilation output, like it prints in my terminal: "madvise failed: Invalid argument" alextee[m]: i want to display that to the user, so is there any way to receive such errors as C strings? alextee[m]: so i was thinking to write a snarfer that reads doxygen docs and gathers C functions and auto-generates the "glue code" in C for exposing them into guile, and also the glue code for the structs that are used. it shouldn't be TOO hard to do for my project because my sources all follow specific patterns. Before I start working on such a thing, is there something like this already available somewhere? i believe i would need alextee[m]: something like a C analyzer to extract the info, and then after that it's mostly a piece of cake to generate the glue code alextee[m]: also, im curious, let's say i have a C function that takes in a GTK widget (in C). if i use guile to create a gtk widget and pass that to my c function, will it work? jackhill: alextee[m]: as far as automatic bindgin generation goes, perhaps https://www.nongnu.org/nyacc/nyacc-fh-ug.html is informative. jackhill: I know there are others here who know more about GTK :) alextee[m]: jackhill: thanks! oh i had this bookmarked hugo: Is there any way to get hygienic macros to leak the environment from where they are called? hugo: I want to use (current-module) to find where a macro was used mwette: hugo: try object properties; see make-object-property in the ref guide. You could add (current-module) to some object you create in that macro. chrislck: small question about guile's VM: does it inherently use multithreading to work? hugo: mwette: Do you mean something along the lines of (with-syntax ((mod ...)) (set! (calling-module mod) (current-module)) #'mod) mwette: hugo: hmm. Somehow you need to have a global or per-module object-property; call it foo. Then say your macro defines a expression `expr'. Your macro would do (let ((expr (...))) (set! (foo expr) (current-module)) expr). mwette: you may need to replace foo with (@ (my debug module) foo) mwette: but you have take care where (current-module) is evaluated. You might need eval-when hugo: mwette: I tried (let ((x #f)) (set! ((@@ (util config) curmod) x) (eval-when '(compile) hugo: (current-module))) hugo: x hugo: ), but with the error "invalid situation in subform ..." hugo: I might just settle with a carefully written define-macro. I hoped for an easy `with-leak', or similar *: mwette is out for a bit daviid: hello guilers daviid: english quiz: in a debian page somewhere i read "For reasons that weasel no longer is sure actually still apply nowadays .." and wish to understand what weasel refers to in this s/w and/or sysadmin context? I know the animal, called a furet in french .. terpri_: daviid, a person named weasel :) probably Peter Palfrader daviid: terpri_: ah ok, i thought it might be a 'wizard' sort of word ... tx daviid: or fictional character ... daviid: with, in this context, a double meaning ... tx rlb: with open-pipe* how do you control the port encodings for the open-pipe* ports? rlb: i.e. the child out, err, and in? daviid: str1ngs: np! glad you found where this 'lack of proper' (oop goops), (g-golf) #:duplicate config was 'hidding itself' ... such proper config is _mandatory_ for any G-Golf use/lib/æpp (it is, I think, described in the manual, but if you think it is not clear or well described enough, let me know ...) rlb: And is there a straightforward way to safely specify the environment for an open-pipe* subprocess when it differs? guix-vits: Hi there. str1ngs: daviid`: my understanding is much better now. unfortunately I rarely use the main script it tiny part the program. all is working nicely now. spk121: rlb: open-pipe remaps stdin/stdout for its subprocesses. You can set the encoding explicitly for stdin/stdout in those subprocesses with set-port-encoding! rlb: spk121: not sure I follow -- I was wondering how to tell guile to set the port encoding for the bytes I'm getting back from the subprocess fd to say utf-8 and the encoding for the strings I'm writing to the pipe fd as latin-1. i.e. if I say (display "whatever" pipe) I'd like guile to encode that via latin-1 when guile writes it to the underlying fd, and I'd like for it to interpret the bytes coming back from the pipe as utf-8 (as rlb: examples). spk121: rlb: wouldn't that just then be (set-port-encoding! (current-input-port) "iso-8859-1") spk121: and then something similar for the subprocess? rlb: Maybe I'm just confused, but open-pipe* returns a bidirectional port, and so I'd need to be able to set an input and output encoding for it? spk121: rlb: so you've set a pipe to receive info from a subprocess, so your pipe is either OPEN_READ or OPEN_BOTH. If your subprocess is sending you back latin-1, you can set the encoding of the current-input-port to latin-1 so when you read, it works rlb: And when I write and want my string to be encoded as utf-8? rlb: Oh, hmm. spk121: (set-port-encoding! (current-output-port) "utf-8") rlb: I'm really not following. I've called open-pipe! and now I have a bidirectional port. What does that have to do with current-output-port and current-input port? rlb: s/open-pipe!/open-pipe*/ spk121: lemme make an example, gimme a sec rlb: wrt your initial comment, I don't have control over the subprocess. rlb: i.e. if you're suggesting that the subprocess is a guile program too where I can change the encodings on *its* current-input/output-port, that's not the situation I'm wondering about. spk121: so your subprocess has a given locale, right? and that subprocess expects its input and output to be in that locale? rlb: No, let's assume that the subprocess might have different encodings for it's input and its output, and that it might even change them while its running in ways we can predict. rlb: s/it's/its/ rlb: i.e. it's not sufficient to just set a single locale anywhere rlb: And the input and output we send to and receive from the subprocess might need to vary wrt encoding in either direction. spk121: so in that case, it is correct to say that your subprocess has no locale whatsoever, but, it instead sending out 8-bit clean data spk121: since if it changes locale at random, it can't be said to have a locale, really rlb: But even in the simpler case, the subprocess itself doesn't have a locale, but it's ports do. rlb: (or rather say they have a fixed encoding) rlb: More generally, the locale isn't relevant -- it's just the encoding. rlb: Basically, I was wondering if as it stands maybe guile just doesn't treat the input and output encoding of a bidirectional port separately? rlb: (that was my original question I suppose) rlb: e.g. in the java world, the encoding is "per direction" because you can wrap any binary port (input or output) with a "decoder" for a given encoding, so you can wrap the input port with utf-8 and the output port with utf-32. rlb: (as an example) spk121: in your specific case, are you opening a bidirectional pipe to a subprocess, or a read-only pipe rlb: And I was trying to figure out if guile had some way to do that for the "halves" of the pipe port, or maybe it just can't do that right now. rlb: bidirectiona rlb: "or if maybe" spk121: the docs say that for a bidirectional pipe, the subprocess's stdin and stdout will be inherited from guile (current-input-port) and (current-output-port) spk121: and you can set the encoding on the guile side of the current input and current output port independently using set-port-encoding! spk121: so if you wanted to write to a process that expected CP437 and returned UTF32 you'd set the encoding of current-input and current-output respectively before reading and writing to the subprocess spk121: gimme a sec rlb: Hmm, I suspect it'll inherit the underlying fds, but not the encoders since it's not a guile program rlb: And even a guile subprogram would "start over" when it execed, i.e. don't think it'd have the encoders/decoders either. spk121: OK. I guess I don't understand how your case could exist. But as a failsafe, if you set the encoding on your pipe to iso-8859-1, you can treat everything as 8-bit clean rlb: Perhaps a program that expects binary data on stdin, but reports status as utf-8 on stdout, for example. But right, I can just set the pipe to iso-8859-1 or similar, as you say, and handle everything manually, just wondered if there was a built-in way. rlb: In any case, thanks for the help. wingo: o/ chrislck: anyone is intimately familiar with SWIG<->guile? after (let ((results (call-C-function))) (process results)), if results is a newly-allocated object, does SWIG reliably call the %typemap(newfree) when result is out of scope? dsmith-work: Wednesday Greetings, Guilers mwette: Same! dsmith-work: wingo: So what's with guile 3 jit on arm? dsmith-work: I haven't been paying close attention. dsmith-work: 32bit arm dsmith-work: Cross compiling with buildroot doesn't segfault with --enable-jit=no jcowan: daviid: Weaseling is escaping one's obligations (legal, professional, moral) by clever or devious means, and a weasel is someone who makes a habit of this. dsmith-work: wingo: Got any advice on debugging an "Illegal instruction" with jit enabled on arm? dsmith-work: chrislck: Has swig been keeping up with guile? I got the impression it had bitrotted long ago. wingo: dsmith-work: is it https://gitlab.com/wingo/lightening/-/issues/12 ? dsmith-work: wingo: Not at all sure. Currently just trying to get a handle on too many things at once. ;^} wingo: :) wingo: run with GUILE_JIT_THRESHOLD=-1 if you are not sure dsmith-work: IF I run guile with GUILE_JIT_LOG=4, Is "mcode" machine code? dsmith-work: As in dsmith-work: jit: mcode: 0x74edb080,+200 dsmith-work: jit: created /tmp/perf-252.map dsmith-work: jit: entering mcode: 0x74edb080 wingo: mcode is machine code, yes wingo: i assume you have hardfp? dsmith-work: And then should disassemble /r 0x74edb080,+200 in gdb show that code? wingo: yes dsmith-work: hardfp? Not sure. rpi3 BR2_ARM_EABIHF=y *: wingo nod dsmith-work: and BR2_ARM_FPU_NEON_VFPV4=y dsmith-work: So probably yes dsmith-work: So that disassembly looks wack to me. Not familar with arm, but it looks totally bogus. dsmith-work: sneek: paste? sneek: Someone once said paste is https://paste.debian.net dsmith-work: disassemble out https://paste.debian.net/1137872/ dsmith-work: The => is at the dsmith-work: Thread 1 "guile" received signal SIGILL, Illegal instruction. dsmith-work: 0x74edb130 in ?? () dsmith-work: With GUILE_JIT_THRESHOLD=-1 guile seems happy wingo: perhaps the address needed to be tagged with 0x1 wingo: i don't recall how this works on arm dsmith-work: Do those look like thunmb opcodes? dsmith-work: A whole lot of UNDEFINED in there. dsmith-work: Oooo dsmith-work: Looks better! dsmith-work: Thanks! dsmith-work: Here is the dis asm ored with 0x1: https://paste.debian.net/1137874/ wingo: lightening only emits thumb dsmith-work: Ahh dsmith-work: So the failing instruction and the one before it: dsmith-work: 0x74edb12f: be 00 bkpt 0x0000 dsmith-work: 0x74edb131: 4f bf ldr r7, [pc, #0] ; (0x74edb134) dsmith-work: Breakpoint ? dsmith-work: This is set to thumb mode: https://paste.debian.net/1137875/ wingo: guile does emit breakpoints in some unreachable code (see invocations of jit_breakpoint) dsmith-work: Could that 0x0000 just be a filler to get the next location to a 4 byte boundary? dsmith-work: That next location (the "Illegal instruction) is the target of a branch. From 0x74edb09c dsmith-work: Well, I assume "blx 0x74edb130" is some kind of branch. dsmith-work: The stuff at 0x134, 0x13c, and 0x144 look like addresses that are loaded into the pc through r7 dsmith-work: wingo: emit_veneer() in libguile/lightening/lightening/arm-cpu.c looks like the emitter for that "illegal instruction". dsmith-work: To my eyes, the generated code *looks* right. dsmith-work: btw: working fine on my 64bit arm device. dsmith-work: Ahh, that BLX changes to ARM. dsmith-work: Maybe that's the problem? Because it's branching to thumb code? RhodiumToad: manumanumanu: for the record, I'm Andrew Gierth str1ngs: daviid: I can get around the flag by use void's 'none since it's 0 . it's not ideal. can you confirm that type-desc does not support callback yet? daviid: str1ngs: manually patching here and there is very 'brave' of you, but I hope I can find a real solution to what appears to be a GI problem daviid: this said, type-desc is the name of a slot, and local vr where that applies, which is used to store further description for arguments and retured values that are taged as 'interface daviid: flags are working, but they depend on a proper registered name,which apars not to be the case for "GLib" "SpawnFlags", for some reasons yet to identify, propb with the help of the #introspection folks ... str1ngs: daviid: I ended up calling this function from my typelib, I could not get around the Throw to key `match-error' with args `("match" "no matching pattern" callback) child-setup-data argument throws in though this argument should really take #f anyway. as far as I can tell it's not matching callback for type-desc 'callback in prepare-gi-args-in. str1ngs: daviid: I'll remind you about this when you are not as busy. I was trying to avoid add C depends is all. daviid: str1ngs: i thought you were talking about 'flag (interface type), within the context of a call to vte-terminal-spawn-async - but indeed there is no callback type-tag implementation yet daviid: now, if you have an example of this code you refer to that raises the callback related error, i'll add it to the tofo list ... daviid: str1ngs: also, do y have a snipset callng this vte-termnal-... that i can use to debug ? str1ngs: daviid: I'll put quick example together. mainly it's just importing (gi-import "Vte") creating the control with (make ) add it to a container then call vte-terminal-spawn-async. on debian you'll probably need to install gir1.2-vte-2.91 as well. or what ever version it has. daviid: please do str1ngs: daviid: almost done. daviid: great str1ngs: daviid http://paste.debian.net/1137506 str1ngs: daviid: it has alot of arguements. laid it was easier to compare against the documentation. str1ngs: laid it out* daviid: str1ngs: yes, much better tx str1ngs: argument 3 which is working_directory. should take #f but it's a minor issue. I think my argv is right but not 100% sure. str1ngs: atleast it works in C with "/bin/bash" str1ngs: daviid spawnflags is working with '(default) like it should with async. as far as I can tell anyways. daviid: but any other value fails then? let me try ... str1ngs: daviid: as far as I can see child-setup fails when trying to match callback str1ngs: it should take #f since it's nullable IIRC? str1ngs: well allow-none guix-vits: Hi there. str1ngs: hello guix-vits daviid: str1ngs: i know why it refuses #f for the working_directory arg, and I'm gona fix this first :) daviid: because it's easier to fix :) - mean while I think ... to the other problems ... str1ngs: daviid: no worries, it's not a rush. I'm just calling this from my typelib meantime. I was just trying to avoid the C dependencies. also (getcwd) is not to bad to use but it should take #f as well. daviid: str1ngs: I pushed a fix for that specific bug (the one reveled by the working_directory argument ...) str1ngs: daviid: okay, I cant test that for awhile since. I'm still on hash 9e890031a1664608d0422b18867d75719deab864. due to the !type issue. daviid: it's ok str1ngs: daviid: here's a screenshot of a buffer in nomad. https://bufio.org/images/2020-03-30-231943_2044x2117_scrot.png :) daviid: str1ngs: cool, very nice daviid: str1ngs: why d you stay on e928900 commit? I thought the duplicate warning accessor was present in all recent versions? str1ngs: daviid: also ibuffer https://bufio.org/images/2020-03-30-232623_2044x2117_scrot.png str1ngs: daviid: if I move to the new gdk event useing !type throw an error. don't recall str1ngs: don't you recall. talking about !type? daviid: yeah, this change introduced that !type accessor duplicate warning, but other version still had and have a !state accessor duplicate warning right? the same example you're using ... ? str1ngs: daviid: when I consolidated all of my imports to (nomad gtk gi) !state was fixed but not !type daviid: ok, anyway, it is a serious bug, that i'd like to fix ... but i need to understand what causes it :) hence this proc i was talking about, i'm writing it now, to find, if any, GObject subclass that have a 'name' property ... str1ngs: daviid: one sec I forget to stash my gdk event port. should be easy to change though str1ngs: during compile time I get. str1ngs: WARNING: (g-golf): `!type' imported from both (g-golf gdk events) and (g-golf hl-api gobject) str1ngs: WARNING: (g-golf): `!window' imported from both (g-golf gdk events) and (g-golf hl-api gobject) daviid: right, these bugs are all related ... daviid: but i need a snispet, hence this proc i'm writing to help us find a 'symptom' gobject calss daviid: these are warnings, but ultimately wouls crash your app ... str1ngs: okay, I mean the other thing is I can push the port and you cant pull nomad from git? str1ngs: just my configure.ac is not ideal right now. to many depends daviid: str1ngs: i'd rather narrow down as much as possible daviid: we should be able to reproduce with just a few lines of code str1ngs: I can probably narrow it down in frame. but if I use a single trivial file it won't replicated. because it seems to be a module merge issue. str1ngs: err frame.scm str1ngs: what I mean I can create a trivial example that fails in the effected file. I think that's the best I can do. daviid: str1ngs: wait till i have that proc i'm talking about daviid: few minutes str1ngs: okay lets do that. the proc would be useful for introspection anyways. str1ngs: meantime I'm using an older hash so I can do continue hacking on nomad. daviid: str1ngs: ok, I pushed, i'd like you to pull/make, then try (gi-find-by-property-name namespace "type") for all namespaces that nomad imports daviid: *for each daviid: and/or (gi-find-by-property-name namespace "state") str1ngs: okay one sec daviid: take your time str1ngs: daviid http://paste.debian.net/1137516 daviid: is that Gtk then? daviid: can you call g-base-info-get-name on that ponter? daviid: *pointer daviid: i get it her it's ok str1ngs: okay one sec. daviid: could you try !type str1ngs: though !state is okay now, show we not check with "type"? daviid: it's not as ok as you think str1ngs: with type I get ((#) () () (#) () ()) str1ngs: same mapping daviid: right, i need to think how tosolve this daviid: but it is a g-golf bug as i thougth str1ngs: (g-base-info-get-name (car (car $3))) is Device str1ngs: from Gdk daviid: by the way it seems state is guile core prog, that escaped my 'eyes' to daviid: ah no, my mistake, it's a clutter 'thing' daviid: better daviid: anyway, I think i know what's wrong str1ngs: *scheme@(guile-user)> (g-base-info-get-name (car (gi-find-by-property-name "Gtk" "type"))) str1ngs: $9 = "Window" str1ngs: so Gdk and Gtk both have type properties I guess. daviid: yes tx daviid: but the bug s exactly what i thought, now need to fix :) daviid: str1ngs: actually, i can't reroduce the problem you face in noamd, are you sure all your modules both #:use-module g-golf and #:duplicate ... ? str1ngs: daviid: let me check daviid: i mean (oop goops) and #:duplicates (merge-generics replace warn-override-core warn last) daviid: str1ngs: #:duplicates (merge-generics replace warn-override-core warn last) should work right? daviid: maybe soe of your modules do not need g-golf, but if they do, then you must have (oop goops) and daviid: str1ngs: but the module must import (oop goop) daviid: and (g-golf) daviid: unless it's a utils module that does not use goops nor g-golf of coure ... str1ngs: this is the module that does all of the gi-imports http://paste.debian.net/1137520 str1ngs: do I need to merge in modules that use (oop goops) and (g-golf) ? daviid: but the other modules daviid: Nomad ... str1ngs: I don't understand do I need to merge in the other modules as well? daviid: in those namond modules, do you use goops, and /or g-golf? str1ngs: yes of course daviid: str1ngs: what i'm trying to say, what i suspect, maybe, is that y hve a module somewhere, that do use goops and/or g-golf, and does not have the proper module #:duplicate (merge-generics ...) , maybe, i'd like to be sure str1ngs: daviid: I see some that do not. let see if I have some orphaned g-golf uses str1ngs: daviid do i *need* to merge when using g-golf in a module.. yes or no? daviid: str1ngs: yes, _and_ it must import (oop goops) as well daviid: just like (nomad gtk gi) str1ngs: okay I have some orphaned g-golf uses I think let me clean these modules up daviid: str1ngs: even in a repl you'd have to do that str1ngs: dunno have not had a problem with this until now. str1ngs: the (oop goops) requirement is kind strange to daviid: but does it solve the problem? str1ngs: daviid I've updated all my modules any module that uses g-golf now used oop goops and merges str1ngs: still throw an error when I use !type str1ngs: daviid: if do #:use-module (g-golf gdk events) it's fixed daviid: can i see the module code, a link str1ngs: (g-golf gdk events) get re-exported so it's some merge issue str1ngs: I can do a paste I have in tree changes daviid: he module you just added the #:use-module (g-golf gdk events) str1ngs: and now I cant paste to debian. do not spam ffs daviid: use gnome paste daviid: https://paste.gnome.org/ str1ngs: try this https://paste.centos.org/view/9868930b str1ngs: I can paste to gnome if it helps daviid: no it's ok daviid: if you comment line 29, move line 31 above the duplicates, does it solve the problem? str1ngs: does help. I don't think define-module is order dependant? str1ngs: you know i love generic methods. but merging is a PITA! :P daviid: when you say does help, does it solve? daviid: it doesn't make sense ou need to import (g-golf gdk events), if you import (g-golf) daviid: whch re-export the publc nterface of all its modules ... str1ngs: sorry I meant does *not* help str1ngs: daviid: right I checked g-golf.scm encase it was not being exported str1ngs: (gi-import-by-name "Gdk" "Event" #:with-methods? #f) should not effect anything in g-golf.scm? daviid: it shoudln't daviid: i think i need to clone nomad, where is it hsted? str1ngs: daviid: one sec let me commit my stash daviid: not sure i have the dependencies here though .. str1ngs: daviid: http://git.savannah.nongnu.org/cgit/nomad.git str1ngs: the only weird depend might be lcov str1ngs: actually not true you'll need emacsy str1ngs: https://git.savannah.nongnu.org/cgit/emacsy.git use the wip branch of emacsy daviid: let's try omething lese first daviid: else daviid: can you star a fresh repl, then daviid: ,use (g-golf) daviid: (gi-import-by-name "Gdk" "Device") daviid: (gi-import-by-name "Gtk" "Window") daviid: !type daviid: an paste here what you see str1ngs: $1 done $2 done $3 #< !type (5)> daviid: 5? i only have 3 here str1ngs: one sec should be $3 = #< !type (2)> str1ngs: I had some extra helper stuff in ~/.guile daviid: it should be #< !type (3)> daviid: try (describe $3) - if $3 is the extended-generic... str1ngs: I get 2 str1ngs: one sec daviid: that's not normal str1ngs: Method #< () 7fabd5cddc40> Method #< () 7fabd6d5b5a0> str1ngs: daviid: hmm str1ngs: daviid: hmmm could it be because I'm use as a super class? daviid: but in this fresh repl, you didn't daviid: anyway, can ou try a fresh repl, then daviid: ,use (nomad gtk frame) daviid: ,m (nomad gtk frame) daviid: !type daviid: tell me what yu see str1ngs: $1 = #< !type (5)> daviid: (describe $1) daviid: but did you comment the line 29? daviid: commenting #:use-module (g-golf gdk events) daviid: then start afresh erpl ... str1ngs: daviid: https://paste.gnome.org/pssr9yrpu str1ngs: it's commented out daviid: ok i need to think and rest as well str1ngs: okay, thanks for the help. now I have an idea whats going on I can see if my modules causing the problem str1ngs: and I have a hacky fix for now so that alright too. str1ngs: daviid: FYI when i call (describe !type) in key-press-event there is no Method #< () 7fabd5cddc40> like the REPL. daviid: but you can see for yourself that even commenting the import it is there ... str1ngs: which is really strnage daviid: right that is the problem str1ngs: could it a compilation issue? daviid: very much doubt it str1ngs: has to be an issue with my modules I think at this point. str1ngs: don't worry to much on this I think I can debug this more. daviid: and (describe event) in that signalcallback gives a instance? daviid: and (describe !state) in that same key-press-event does show in its methods right? daviid: still commenting the (g-golf gdk events) ... brendyyn: "KDE/Qt bindings could be generated from the C bindings, or using GOOPS 10 (which would require someone to rewrite parts of GOOPS in C)." - Mentioned in Why use Scheme (2002) brendyyn: thought it was interesting rekado: for a web application I’d like to add a debug mode to connect to a REPL and inspect the frames. rekado: so I wrapped the server in a catch and thought about starting a REPL server in the handler rekado: but I think this might be wrong str1ngs: html frames rekado ? rekado: no, stack frames str1ngs: okay that makes more sense. rekado: should I instead spawn a repl server first and run the web server in that thread? daviid: str1ngs: can you confirm that (describe !state in that same key press envent signalcallbck does show the in its methods/accessors? str1ngs: brendyyn: I wrote some experimental GI bindings to QT. so you can in theory use g-golf or guile-gi . see https://github.com/mrosset/giqt/blob/master/examples/hello.scm.in str1ngs: daviid: okay one sec. str1ngs: daviid: Methods defined for !state Method #< () 7f9109b7f5c0> daviid: how can that be, and not for !type? is a mistery ... daviid: that is with the import line commented right? daviid: difficult to debug 'on the phone ' :):) daviid: str1ngs: i think it shuld be possiblet write a sall module that just use gtk gdk, define a class of ours and a key-press event callback daviid: need to rest, bb tomorowo str1ngs: daviid: I can make a reduced module. brendyyn: str1ngs, amazing. rekado: I guess I can use (system repl error-handling) instead daviid: str1ngs: if yu can, just that, then we'll see daviid: copy the hello-world, add gdk, define a frame class and try ... daviid: we'll see str1ngs: brendyyn: also it works with sbcl python javascript. anything that has GI bindings. str1ngs: daviid: ummm I think I fixed it :) brendyyn: str1ngs, i will have to research this, i really dont know anything about GI wleslie: epic str1ngs: daviid: I think loading ~/.nomad is causing the problem str1ngs: daviid: I found the culprit. see http://git.savannah.nongnu.org/cgit/nomad.git/commit/?h=gdk-event&id=3573d3db0faf91de76295b367d25473bb0d877f1. thanks for the help. this was my first really annoying bug on my part. apologize I could not find it myself. dsmith-work: UGT Greetings, Guilers mwette: o/ chrislck: ------(1.5m)-----\o civodul: wingo: are ports thread-safe? civodul: i realize since 2.2 i never know the definite answer civodul: i thought the answer was "yes" but i don't see any locking in there wingo: civodul: they should never crash or write OOB if that is the question civodul: ok, that's the answer i expected civodul: thanks! wingo: :) spk121: I asked this a couple of months ago, but, drawing a plot. (in this case memory vs time) Any new and exciting chart libraries out there? spk121: I guess wingo 's guile-charting is still out there somewhere jcowan: How about old, boring, and reliable chart libraries jcowan: (not that I know of any; I would always defer charting to LibreOffice or such) spk121: jcowan: in my silly guile+gtk debugger project, I wanted to plot out the memory currently allocated. When I need to make regular charts, I'm usually a gnuplot fan. luni: i have a question about OOP. Now i have defined a slot like this: (dice #:init-value (list (make ) (make )) #:accessor dice-list) . How could be possible use instead of init-value a function that accepts a variable number of objects ())? str1ngs: spk121: maybe render with gnuplot then display in gtk as a pixbuf? spk121: str1ngs: sure. Would work great. It is just that is cheating according to my own self-imposed rules. But if I was going to go that route, I think I still have a guile script that calls that ancient GNU Plotutils program. spk121: I wonder if it still works. str1ngs: spk121: yeah, looking at this example https://gitlab.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Pipes/gnuplot5.c it's not pretty str1ngs: spk121: you could make a typelib that uses C++ binding. and only expose a C interface. that's what I used for QT str1ngs: basically it would be a gnuplot GI binding. you'd only have to stub out the functions you need. str1ngs: but then you are still use C it's just reusable from scheme. spk121: luni: it is a little odd to have an initializer that takes an argument. The short answer is that you probably shouldn't. luni: ok... thank you. i was thinking to use something like #:init-form that accepts a procedure but with no arguments. I need to pass the number of dice... or maybe have to think better about the utility of the Dice class used only to make a list of dice used by a roll generic method. I could create the list directly inside the generic method maybe luni: because of if i have a Die class i don't need the Dice class to define a group of dice spk121: luni: you could make a macro that makes a family of classes. Or you could have your initializer depend on a global. But, of course, in GOOPS you can do anything if you try hard enough. I'm just big on keeping things boring spk121: str1ngs: interesting dsmith-work: What was it again to get 3.0.x working on arm 32bit? Something about disabling jit ? dsmith-work: Was that to be passed to ./configure ? daviid: str1ngs: hello sneek: daviid, you have 1 message! sneek: daviid, str1ngs says: seems I can avoid No applicable method for #< !state (2)> in call (!state #< 7f6f67e1bd40>) if I don't compile the module I'm using !state in. does that give any indicator as to why it cant' find the method to you? daviid: str1ngs: no, it doesn't help me to find the cause - what I would need is an exampleI can use that reproduces the problem .., what I suspect is you import 'somehow/somewhere' a GObject subclass tht has a property named state, and the g-golf fails to detect it alredy has a generic function .. but it would be really nice to have a snipset that I culd use to analyse, reproduce and solve the problem ... daviid: *fails to detect that there a !state generic function daviid: but even that i just said i have some doubt, because the warning you pasted here says the !state generic function has 2 methods ... daviid: str1ngs: these are among the most complicated bugs to analyse and solve, each really needs an example we can use to reproduce ... alextee[m]: https://manual.zrythm.org/en/scripting/api/audio%20position.html \o/ guile API for zrythm published. everything gets created automatically now from my C sources, awesome *: alextee[m] uploaded an image: Screenshot from 2020-03-30 02-12-50.png (26KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/lZBCZRthEEiBgtxzhKSqtKGr > alextee[m]: i have a window like this while the program is running (obviously needs a revamp but it works) spk121: alextee: 👍 RhodiumToad: manumanumanu: I asked because he credited you as the finder in the code comments str1ngs: daviid: all I have is WARNING: (g-golf): `!type' imported from both (g-golf gdk events) and (g-golf hl-api gobject) daviid: str1ngs: I need to reproduce the problem here, can't you produce a snipset that reproduces the proble? str1ngs: daviid: as for repeating this. it's not so easy. since it only happens when using multiple modules. I've moved all of my imports into one modules and that does not help. this is the extent of my imports. str1ngs: daviid: http://paste.debian.net/1137321 str1ngs: daviid: no I can't reproduce it. the closes I have gotten to bisecting this is to not compile (nomad gtk gi) and to sue !type somewhere in the module. daviid: if you call this odule not (omad gtk gi), but (bluefox), then write soething in it that use either !type (or !state ?), then import it in a repl, so it is compiled, then 'do something, does that reproduces the probke? daviid: and not using emacsy daviid: neither nomad daviid: so i can ry it here ... str1ngs: again your trivial use case works. but my use case it not trivial have more then one moving part and use case. str1ngs: why don't we start with this waring. str1ngs: WARNING: (g-golf): `!type' imported from both (g-golf gdk events) and (g-golf hl-api gobject) daviid: because i can't reproduce it str1ngs: how do avoid this warning since !type is the problem anyways str1ngs: looks to me (g-golf gdk events) and (g-golf hl-api gobject) both have !type yes? daviid: no daviid: i did explain above what i suspect may be (but i am not sure either) the cause of the roblem str1ngs: g-golf/gdk/events.scm:(define-method (!type (self )) str1ngs: which !type should be used here? daviid: str1ngs: i'm working on the gdk display bug you and your user posted, and it's a complicated bug to solve to ... but thinking ... can you change the definition of your modules so that all (a) :#use-module (oop goops), then (b) also have a #:duplicate ... (grab an example in any of the g-golf modules ...) - then try again daviid: this example you pasted mixes a way to work we use for scrits and a way to work that we use to define modules, that complicates things, debugging wise, as well daviid: hum, maybe we can't avoid that actually ... another thng str1ngs: daviid normally I use #:use-module. I'll change it back if you can verify my merge is correct daviid: could you write a procedure, say gi-irepository-find-by-property-name namespace name, that returns a list (possibly empty) that list the pointers to the GObjectInfo that have a property named 'name' ... str1ngs: daviid: can you check this is okay http://paste.debian.net/1137330 str1ngs: daviid: I'll see about not sure what you are ask str1ngs: err see about gi-irepository-find-by-property-name daviid: I first wish to identify which namespace (not the nomad ones) imports a GObject subclass daviid: str1ngs: ok, i'll do that , but not exacly now daviid: fighting another ghost ... need to eat something as well ... str1ngs: daviid: sorry I mean I'll write. gi-irepository-find-by-property-name str1ngs: daviid: (gi-import "GIRepository") should work right? str1ngs: or should I use g-golf primitives for this? daviid: no it won't daviid: i shouldn't have asked, i'll write it, don't worry str1ngs: daviid: okay guix-vits: Hi Guile rekado: alextee[m]: amazing progress! This really makes me want to try zrythm! wingo: moin civodul: Hello! alextee[m]: rekado: thanks :) brendyyn: Hmm I'm a little puzzled. I'm writing a module that provides some procedures, but they based on another set of procedures which can all have variants (they come as a set). im trying to find a way so that i can import this module with the particular variant without needed to write a duplicate module for each one. brendyyn: maybe i need to create some define-variant macro civodul: did we lose old release tarballs of guile-lib? civodul: https://download.savannah.gnu.org/releases/guile-lib/old/ civodul: like, ca. 2005 weinholt: civodul, maybe they were never there? copies are at http://snapshot.debian.org/package/guile-lib/ and even older info is on rotty's old site: https://web.archive.org/web/20041114175005/http://stud3.tuwien.ac.at/~e9926584/GuileLib civodul: weinholt: oh nice, thanks! rekado: brendyyn: I’m not sure I understand. You can import modules with a prefix so that there are no conflicts. rekado: brendyyn: would it make sense to provide a procedure that takes the variant and spits out a parameterized procedure using that specific variant? rekado: this way the dependency is made explicit brendyyn: well there isn't just one but a whole set of procedures, so its a little confusing rekado: brendyyn: can you provide an example perhaps? brendyyn: rekado, I'm implementing SPAKE2 from python-spake2. you define a spake session with a group, which defines the set of math functions used brendyyn: you could for example choose sha256 instead of sha512 or something like that brendyyn: in python its all done with classes but thats different from scheme rotty: weinholt: uh, the net really never forgets :-) RhodiumToad: well you can do it in classes with scheme if you like brendyyn: i dont even know what scheme classes are weinholt: rotty, :) rekado: brendyyn: classes with Scheme: see GOOPS rekado: brendyyn: but you don’t really need GOOPS for this rekado: brendyyn: you can have a configuration object that contains all of the procedures you need rekado: instead of calling the procedures directly you first look them up in the configuration object rekado: you know, like function pointers in C. brendyyn: is this using set! ? rekado: e.g. (define config-A `((algorithm . ,sha256) (name . "A"))) (define (magic config) ((assoc-ref config 'algorithm) "whatever")) rekado: you could then have different configurations and have “magic” do the right thing dependent on what configuration it is given. rekado: you don’t have to use alists for this, of course. You can use records. brendyyn: so ive got this for example (define Y* (ed25519:add-elements Y (ed25519:scalar-multiple N password))) brendyyn: thats hard coded with the config from ed25519. but im trying to swap them for generic `add-elements' etc. how do they magically follow a config that is set after they re defined rekado: Y* would need to accept a config as its argument brendyyn: since with lexical scoping everything saves the closure that existed at the time, as i learnt in sicp rekado: (this pattern is also known as the Reader monad, by the way. It really just means that all your procedures accept a read-only argument of configurations.) rekado: (define (Y* config) ((config-add-elements config) Y ((config-scalar-multiple config) N password))) rekado: where “config-add-elements” is an accessor for the record value “config” that returns a procedure. rekado: (define ed25519-config (make-config #:add-elements ed25519:add-elements #:scalar-multiple ed25519:scalar-multiple …)) rekado: i.e. you create a config value “ed25519-config”, a record with a bunch of fields for the different procedures. brendyyn: yep i can do that, but then its not just Y*, but X* and various others. how can i have it so the config is set once, and not manually for every single function, since it would be wrong to missmatch anything rekado: parameters rekado: See 6.13.12 Parameters brendyyn: alright ill have a read brendyyn: sicp taught me to be scared of mutation and global stuff :p im still need to learn more useful tools rekado: that’s good! rekado: it’s neither mutation (the values are read-only) nor is it global rekado: (this is scoped with parameterize) brendyyn: so it makes becomes some big (let .... ) thing? rekado: but if you want to do without parameters you can go all in and define a monad… rekado: kinda rekado: it lets all calls to the parameter name return the parameterized value. rekado: within the scope of the parameterize expression brendyyn: oh great. so i can make the session with this kind of thing brendyyn: a spake sessions starts by generating a random number and then computing all these other session specific values spk121: wingo: so moving guile-cairo to foreign objects was painless but it makes two api changes: can't define an equals operator the same way as a SMOB, and the default printer changes, but, otherwise should be quite similar wingo: spk121: you can define-method (equal? (x ) (y )) i think spk121: wingo: that's true dsmith-work: Monday Greetings, Guilers dsmith-work: alextee[m]: The doc snarfer for C that guile uses internally to create the help files is not installed. dsmith-work: alextee[m]: The scheme doc snarf is not for C files. alextee[m]: dsmith-work: i figured.. it says it accepts a C language which was a bit misleading alextee[m]: fwiw, this is what i ended up doing https://git.zrythm.org/cgit/zrythm/tree/scripts/guile_gen_texi_docs.sh alextee[m]: it has a dependency on the compiled guile sources (which are not installed!) which is not very nice alextee[m]: where GUILE_SNARF_DOCS_BIN is "/libguile/guile-snarf-docs" alextee[m]: dsmith-work: shouldn't the C snarfer be installed along with the rest of the guile tools? how is one supposed to extend their C programs properly without a tool to generate documentation for it? dsmith-work: alextee[m]: Well.. I suspect there is not much motivation. The end goal is to make the ffi really great and just use that instead of hand-coding C modules. dsmith-work: alextee[m]: Another thing to consider is that auto-generated docs are usually rather poor. Better to write a real manual. dsmith-work: alextee[m]: I'd really like to see the C doc snarfer installed! alextee[m]: dsmith-work: well, as a user you'd at least want to know what functions are available to use! that's my main motivation for needing the snarfed docs alextee[m]: not sure how the ffi would work but sounds pretty cool if you don't need to write wrappers of your C stuff mwette: alextee[m]: I have a tool that automates generating the ffis, but it can generate a lot of code. Look here: https://www.nongnu.org/nyacc/nyacc-fh-ug.html alextee[m]: mwette: oh wow, thank you. i'll give it a spin b4284[m]1: hello b4284[m]1: alextee: many thanks alextee[m]: 👍️ dsmith-work: alextee[m]: I'm a *huge* fan of automation, but most doxygen generated (for example) library docs are near useless. Mostly just showing the argument names, which I can just see for myself by reading the headers. dsmith-work: alextee[m]: So while I really like having an automated tool, I've not seen much good use of it. alextee[m]: well, some projects do it right. doxygen-like gtk-doc docs for example are amazing documentation dsmith-work: alextee[m]: Yes, there some very excellent generated docs. alextee[m]: that with the dev-help program is my go-to for pango/cairo/gtk documentation, and it's pretty much just from comments on the sources alextee[m]: i have a guile bug in mingw alextee[m]: doing `guile -s @SOME_ABSOLUTE_PATH@/myscript.scm` results in a double'd path and guile fails to run the script, but doing `cd @SOME_ABSOLUTE_PATH@ && guile -s myscript.scm` works fine alextee[m]: doubled up path and error message: In procedure stat: No such file or directory: "/home/alex/git/zrythm/build/C:/msys64/home/alex/git/zrythm/build/meson-post-install.scm" alextee[m]: but i have checked and @SOME_ABSOLUTE_PATH@ is "C:/msys64/home/alex/git/zrythm/build" alextee[m]: maybe i should report this or is this a known thing/im doing something wrong? alextee[m]: can be replicated with commit 7090e1e1ff9765824fd77769d158cf3e763bc7b0 when installing zrythm https://git.zrythm.org/cgit/zrythm str1ngs: alextee[m]: if you if use guile -s from a mingw terminal? alextee[m]: str1ngs: ok i found the exact cause alextee[m]: when you use the C:/.... format, it prepends the current path alextee[m]: when you use the unix format /.... it works fine alextee[m]: if you use a relative dir it also works fine alextee[m]: can replicate this easily with just `guile -s C:/..../some-script.scm` alextee[m]: i guess it sees that there's no starting "/" so it thinks it's a relative path alextee[m]: meson seems to pass paths in the C:/.... format and i replace those paths in my files before building so... that's a problem with guile wingo: good evening :) dsmith-work: wingo: Greetings. dsmith-work: Currnetly attempting to cross-build with musl as C lib... dsmith-work: Now building gdb so I can find out what dsmith-work: # guile dsmith-work: Illegal instruction dsmith-work: means str1ngs: daviid hello sorry to bother you. quick question I need to call this function. https://developer.gnome.org/vte/unstable/VteTerminal.html#vte-terminal-spawn-sync but I can't get the enum for GSpawnFlags. the argument introspection looks like this. http://paste.debian.net/1137450 notice this type-desc is void. Glib namespace should have the GSpawnFlags enum. is there an easy way for me to provide this enum without making more work for str1ngs: you? daviid: str1ngs: that function is deprecated, but it seems vte-terminal-spawn-async, the recommended one instead, gets its flags definition correct daviid: hum, no daviid: but you still shold try to use vte-terminal-spawn-async daviid: not sure why so many type have void as their name in so many namespaces, need to ask #introspection about this, ... daviid: str1ngs: i can't look into this till i solved the other 2 problems i'm working on str1ngs: daviid ahh I'll try with vte-terminal-spawn-async this API has changed a few times. manumanumanu: RhodiumToad: oh. The mail I sent to him mentions you by your irc handle, as in "RhodiumToad over in #guile found this bug...". If you want to I can point it out to him alextee[m]: i already found myself writing a 4th scheme program, and i have some common procedures i want to abstract away. what's the recommended way to do this? i tried using (include) but that didn't work very well alextee[m]: https://paste.debian.net/1137161/ this is what i'm (include) 'ing daviid: alextee[m]: you should put those in a separate module - but look if anyone of us won't have done that already, somewhere, so good to ask her as well ... daviid: alextee[m]: indeed, everuthing you may dream of in rlation to manipulate filenames and path is i guix already alextee[m]: daviid: can i specify a local path for a module when i do #:use-module? i just want something quick-n-dirty to get the job done for now alextee[m]: oh nice i'll look at the guix modules when im done daviid: alextee[m]: no, but you may use add-to-load-path ... which is one line of code ... daviid: alextee[m]: yes look and snarf, you'll learn quite a lot rading guix code ... daviid: i think the module is (guix utils), not sure alextee[m]: daviid: awesome, thank you! alextee[m]: although this is for build scripts for my program so i don't think i should add any external module dependencies that guile doesn't provide daviid: why not? why would a series of scrpts not sharing commo functionalitie ... daviid: we all do that, all the time, if i may say so ... alextee[m]: because if someone wants to build my program, they would need to go and install all the guile libs alextee[m]: some distros might not have them alextee[m]: also mac (homebrew), windows (mingw) alextee[m]: not sure how popular guix utils is though daviid: alextee[m]: here https://git.savannah.gnu.org/cgit/guix.git/tree/guix/utils.scm look for file*, dir*, lcation* ... for inspiration, and ask here as well ... alextee[m]: daviid: thanks! daviid: alextee[m]: if you are that serious about your progam, so as to want it to be avilable cross-platform, with the idea many will grb it, yu should first and above all autotool it, then distro will package it daviid: but limiting yourself to what guile has is, limiting 'non sense' alextee[m]: daviid: it's this btw https://www.zrythm.org/en/ alextee[m]: not a guile program, im just writing some build helper scripts in guile, hence no need for external libs daviid: ah, but is it autotooled? alextee[m]: daviid: meson'd daviid: ok, then you certainly can spit in modules and make those available ... at build or execute time ... alextee[m]: there's no easy way to compile stuff with guile-snarf so writing a wrapper for it atm, and i just call my wrapper to compile a .x file from a .c file alextee[m]: yep, trying to do that now. not sure how exactly load-from-path is supposed to work though alextee[m]: add-to-load-path* sorry alextee[m]: if i do "(add-to-load-path (dirname (current-filename)))" before the (define-module) , it can't find "dirname" *: alextee[m] looks around in the guix code daviid: alextee[m]: i autotool, we'd write a .in file that needs substitution for thos cases, then the build phase produces a file that knows where to find the modules, either in the build tre, or in the istalled tree ... alextee[m]: daviid: the problem is that there's no way to get the cflags of my project to pass that to guile-snarf alextee[m]: meson has "dependency" objects among other things and they don't provide that info alextee[m]: so i'm doing some hacky things where i call pkg-config --cflags-only-I in the scheme script im writing daviid: alextee[m]: why would you need cflags to write a guile scheme modle? alextee[m]: i know the pkg-config names from the meson "dependency" objects daviid: alextee[m]: anyway, i was willing to help wrt to guile, but i don't know meson alextee[m]: daviid: oh i thought you were talking about guile-snarf sorry. so i would do something like (add-to-load-path @PATH_HERE@)? alextee[m]: and replace that before calling the script rlb: alextee[m]: sometimes I just create a wrapper like this: rlb: #!/usr/bin/env bash rlb: export GUILE_LOAD_PATH="${GUILE_LOAD_PATH:+$GUILE_LOAD_PATH:}$(pwd)/mod" rlb: export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$(pwd)/lib/.libs" rlb: exec guile-3.0 "$@" rlb: daviid: meson should build the 'user' file fr you rlb: and then invoke it like ./foo ... for doing things in the local tree. alextee[m]: daviid: yeah i know how to do that. thanks, let me try alextee[m]: rlb: this can work too, except i need to replace guile-3.0 with the correct guile binary again lol rlb: Sure daviid: rlb: yes, but when that is needed, we generally autotool chain it as well, the 'famus' pre-inst-env script that accompanies almost all our projects ... rlb: My "wrapper" is autogenerated from a guile.in via automake... rlb: i.e. exec guile-@GUILE_EFFECTIVE_VERSION@ "$@" rlb: that's in the local ./guile.in I have in one project I mean, i.e. in that project ./foo is ./guile ... rlb: daviid: ahh, ok, don't know exactly what you mean, but yeah, also have any number of foo-env scripts that are more general... alextee[m]: so this is found at /home/alex/Documents/git/zrythm/scripts/guile_utils.scm : https://paste.debian.net/1137168/ RhodiumToad: (add-to-load-path (dirname (current-filename))) ;; I did it that way alextee[m]: and this is in the same dir : https://paste.debian.net/1137169/ alextee[m]: but when i run it i get "no code for module (zrythm guile-utils)" rlb: alextee[m]: your dir tree has to match your module path? alextee[m]: it.. does? rlb: i.e. if the module is (x y z) then it has to be located in x/y/ somewhere in the GUILE_LOAD_PATH. rlb: i.e. the "shape" of your GUILE_LOAD_PATH trees has to match the shapes of your module (x y z) paths. rlb: trees -> "filesystem trees" rlb: so in my wrapper above, I add ./mod to the GUILE_LOAD_PATH, and then all my project specific modules are in there as ./mod/x/y/z.scm, etc. alextee[m]: rlb: i made the module a single value, but i still get the same error rlb: And the LD_LIBRARY_PATH augmentation is (kind of a hack for now) so I can load ./lib/libfoo.so via (load-extension "libfoo.so" "init_foo"). Likely a better way than embedding libtools "secret" path, but it works. alextee[m]: (define-module my-guile-utils ....) and then #:usemodule (my-guile-utils) rlb: If you have a module named (foo), then it'll have to be foo.scm in one of the dirs in GUILE_LOAD_PATH (or just your %load-path really, which picks up GUILE_LOAD_PATH). rlb: module names have to be lists. rlb: (I think) rlb: i.e. (define-module (foo) ...) alextee[m]: heh, that worked alextee[m]: thanks rlb i thought the module names were arbitrary but apparently they must match the dirs and the filenames (which is good) RhodiumToad: how would it know where to look if they did not match? RhodiumToad: using LD_LIBRARY_PATH like that is definitely a hack, kill it with fire alextee[m]: i dont know, i thought it would scan .scm files in the path or something rlb: alextee[m]: yeah, it's similar to python module names, or jvm classes. alextee[m]: interesting RhodiumToad: scanning everything in the path would be slow alextee[m]: indeed, although a lot of software do things like that alextee[m]: matching the filesystem is great alextee[m]: ok so i successfully snarfed my C code and have the .x files, is there some kind of tool to extract documentation from them (and even better, create HTML from them) ? alextee[m]: i basically want to publish this scripting API somewhere rlb: I imagine there's a way to at least get texi since I think guile itself does that? rlb: Might look in the guile source tree ...procedures.texi rings a vague bell. alextee[m]: oh thanks, i found something in module/scripts/doc-snarf.scm rlb: certainly seepel: Hi guile! I am feeling a bit daft, but for the life of me I can't figure out how to call scheme from c, and can't seem to find it in the manual. I'm trying to figure out how to load and call exported procedures from a a guile module in c. alextee[m]: seepel: i hope this can help https://git.zrythm.org/cgit/zrythm/tree/src/guile/audio/position.c?h=bugfixes seepel: alextee[m]: Looking at that code it seems to me like this is c code that defines a guile module? alextee[m]: yeah, im not sure how to do the other way around yet though, sorry rlb: seepel: if these are functions that have c versions, of course call that, if not then you might want scm_call_??? and friends. rlb: And you can find the function you want via scm_module_ref, etc. rlb: or scm_c_module_ref rlb: iirc RhodiumToad: there's also scm_c_eval_string to evaluate an arbitrary string rlb: ahh scm_c_module_lookup seepel: rlb: I'm going to write the modules. Right now I have written a module exporting a single procedure and I wolud like to call that procedure from c rlb: so something like scm_call_2 (scm_c_module_lookup (mod, "foo), scm_from_uint32 (4), scm_from_utf8 ("bar")); etc. rlb: And you can find mod via scm_c_resolve_module. seepel: Sorry, I fell into the classic trap of explaining what I thought the solution was, rather than explaining my actual problem. I'd like to write a bunch of scheme modules and call them from a c a program. seepel: I'd basically like to just write a portion of the program in guile scheme. So compile a bunch of modules and link them into my c program. And of course visa versa to expose some of my c program to guile. Though I think I have found the reference documentation for the latter. rlb: I think that unless your needs are fairly simple (such that eval is enough), and assuming you don't want to write your some C wrapper(s) on top of your module(s), then scm_call*, scm_apply*, etc., coupled with scm_c_resolve_module and scm_c_module_lookup might be plausible. rlb: Though of course you might well want to cache the resolves and lookups in static SCM vars or something, i.e. only look them up at startup. rlb: (or a struct, or whatever) seepel: What would writing C wrappers on top of my modules entail? rlb: Well if it's C calling scheme, then I'd guess it might mostly be a wrapper hiding the above bits. seepel: Got it. rlb: i.e. you'd have a some_thing() that internally knew how to find the right SCMs to pass to scm_call, scm_apply, etc. seepel: What section of the manual am I looking for to find the details of those bits? rlb: https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Accessing-Modules-from-C.html seepel: Yes! rlb: https://www.gnu.org/software/guile/manual/html_node/Fly-Evaluation.html seepel: Yeah I found fly evaluation and I was thinking, what I'm looking for must be around here somewhere, just couldn't find it for some reason. Thank you! rlb: happy to help alextee[m]: how can I use doc-snarf.scm? it seems nothing happens when i run it rlb: (and of course you'l need the scm_list... related bits for apply and/or any calls with more than 9 args) alextee[m]: am i supposed to compile guile to produce a usable version? rlb: alextee[m]: noidea -- though I'd guess that if it has a "main" you might need to call that with (program-arguments) or whatever args you want. rlb: i.e. the module may not do anything if you just load it. rlb: not like python with say __main__... alextee[m]: oh found info in the README rlb: And looks like there are some docs at the top of the module too. alextee[m]: yeah it looks like it does exactly what i want, just need to build it somehow. building guile now rlb: alextee[m]: note that building guile from source will take a *lot* longer than from the release archives fwiw (because you won't have the bootstrap files). rlb: Where that just means 30-60m on say amd64. alextee[m]: how long are we talking? my pc is pretty fast but if we're talking > 5 minutes i'll bail alextee[m]: oh god rlb: But you'll only have to do that once... rlb: well hmm, I wonder if "make clean" clobbers them... rlb: I think it's supposed to be a lot faster from the archives, but I'm always building from source. alextee[m]: meanwhile i'll try using the module from scheme code as it suggests in the readme rlb: sample build times: https://buildd.debian.org/status/logs.php?pkg=guile-3.0&arch=amd64 rlb: And of course a tiny machine takes (a *lot*) longer: https://buildd.debian.org/status/logs.php?pkg=guile-3.0&arch=mipsel alextee[m]: i see alextee[m]: well, ice-9/eval.go is done rlb: well they're not all physically tiny I suppose, and there are some fairly small faster systems, but I imagine you know what I mean :) alextee[m]: heh alextee[m]: i managed to run it in the guile REPL alextee[m]: (use-modules (scripts doc-snarf)) (doc-snarf) alextee[m]: didn't work, but i found this: http://www.gnuvola.org/software/guile/doc/guile_002dtools-c2doc.html#guile_002dtools-c2doc alextee[m]: although when i run that it says guild: unknown script "c2doc" spk121: alextee: "guild doc-snarf -l c weak-vector.c -o output.txt" spk121: replace weak-vector.c with your source file alextee[m]: spk121: i did, i get nothing spk121: most of the stuff on gnuvola.org concerns TTN's unique fork of Guile. He's keeping guile 1.4 alive for his own applications spk121: and you have SCM_DEFINE macros in your source file? alextee[m]: spk121: https://git.zrythm.org/cgit/zrythm/tree/src/guile/audio/position.c?h=bugfixes alextee[m]: ah i see, so i guess c2doc is an older version that was merged into doc-snarf alextee[m]: i have an SCM_DEFINE at line 41 but it gets ignored spk121: lemme try alextee[m]: i even ran it on this https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=libguile/alist.h;h=7bc86be9f62ffd47a453ae63701eb3e61bec0f27;hb=HEAD alextee[m]: and i still get no output spk121: what about 'guile-snarf position.c -I /path/to/includes' alextee[m]: that makes a 80k line .x file spk121: wait, nevermind, that's for making .x files spk121: sorry, it has been awhile alextee[m]: np thanks for your help :) alextee[m]: fwiw doc-snarf works on scheme files, but haven't successfully ran it on any C file yet str1ngs: hello daviid. did you get my report about 'gdk-display-get-default ? daviid: str1ngs: hello daviid: no, wa it per email? str1ngs: daviid I left a sneek massage. daviid: str1ngs: fwiw, I won't be able to look at it before I finish what I'm doing now, which is related to this boostrap binding 'problem ... daviid: str1ngs: not sure what/why you are trying to 'mess-u' with so low level stuff .. :), reaaaaalllly dangerous you know? :) str1ngs: daviid: mainly a user report that 'gdk-display-get-default does not work on wayland. for X11 I can import (gi-import "GdkX11") but I'm not sure what to import for wayland. or I'm kinding wondering if I sould need to import these backends at all? str1ngs: daviid mess-u? I don't understand daviid: I don't know enough about backends to properly answer, but depending on the distro, the backend is now wayland for most of them daviid: which is the case for deban, and gdk-display-get-default indeed returns #f (the %null-pointer) str1ngs: daviid: right but is not found. daviid: you'd have to ask the gnome team about this I guess daviid: there is no such calss daviid: *class str1ngs: daviid: if you use X11 you can import (gi-import "GdkX11") str1ngs: but from my use of GTK. importing (gi-import "GdkX11") seems wrong. daviid: you prob are on a wayland bacjend daviid: but again, what is the final aim of all this? str1ngs: the end user uses wayland. and reports that is not found. daviid: can't gtk provide the ifo the user is looking for? str1ngs: I use X11 daviid: that class does not exists str1ngs: in C all you do is use C. you need to specify any backends daviid: not sure what they're up to str1ngs: what modules does the class exist in to import? daviid: str1ngs: i don't understand the question daviid: you import namespaces, not module str1ngs: what namespace daviid: those you want to 'play with' using g-golf :), Gtk, Clutter ... daviid: webkit ... str1ngs: daviid why most we do this song and dance before you will accept my bug reports. str1ngs: 'gdk-display-get-default does not work right. IMHO even with the X11 backend. str1ngs: and this is not low level. if you want to use clipboard events. I'm not even sure why you would say that. str1ngs: it's not working properly. daviid: ok, but i can't look at it right no, and didn't get the example to reproduce - not sure why, sneek might be asleep ... daviid: gdk is by definiftion, very low stuff str1ngs: I send the REPL example via sneek daviid: str1ngs: didn't see it str1ngs: just import Gdk Gtk gtk_init and then call. (gdk-display-get-default) daviid: please paste here again, but again won't look at it right now ... str1ngs: this doesnt need an example. just call the functions. easy peasy str1ngs: daviid http://paste.debian.net/1137179 daviid: str1ngs: better, please paste again, asking for a full backtrace daviid: ,bt #:full? #t daviid: str1ngs: then will look into this asap, but not exactly right now, I must finalize what I'm workig on ... str1ngs: daviid: no worries daviid: ,bt #:full? #t #:width 1000 str1ngs: I can't ,bt right now. I had to switch to wayland to run that REPL code. and I saved the log. str1ngs: and I can't switch to wayland right now daviid: np, i can't work on it now ... whenever you can ... daviid: I'm fighting other g-golf ghosts ... there ar still many ... str1ngs: daviid if you use wayland just run the REPL and ,bt. if you can't work on it now that's fine. str1ngs: actually the I'll get the end user to ,bt daviid: ,bt #:full? #t #:width 1000 daviid: not just ,bt str1ngs: yes guix-vits: str1ngs: http://paste.debian.net/1137182 the backtrace. guix-vits: Hi there. str1ngs: daviid http://paste.debian.net/1137182 str1ngs: guix-vits: thank you daviid: ok, thnaks both, will look asap str1ngs: no thank you :) daviid: fighting a big gohst, wonder if I should call harry potter at rescue :):) daviid: *ghost guix-vits: daviid: better take a Hermione :P guix-vits: *no 'a' before names daviid: :) str1ngs: anything I can help with daviid? daviid: str1ngs: no thanks str1ngs: okay, good luck :) daviid: str1ngs: i just pushed a patch, a code review/enhancement patch, which shouldn't change things on your side, but if (when you pull/make) ... let me know str1ngs: daviid: thanks, will check this out soon. str1ngs: daviid (gi-import "Gio") now throws ERROR: In procedure scm-error: str1ngs: No variable named in # daviid: str1ngs: ok, tx, will check str1ngs: daviid: offtopic, what video driver do you use with bullseye? daviid: str1ngs: pushed a fix wrt Gio importing bug above daviid: wrt video, not sure, what ever xserver-xorg picks up to manage my intel integrated graphic card of the relatively old laptop I'm using str1ngs: daviid will pull and test. daviid: tx str1ngs: daviid: looks good. though I need to port the old gdk key events to the new ones. daviid: str1ngs: ok, that's quite easy, just need to rename daviid: str1ngs: here, the gdk-event example - http://paste.debian.net/1137196/ str1ngs: (!state event) should work right? str1ngs: daviid ^ daviid: yes str1ngs: strange (!state event) won't work with my 'key-press-event works with your example. daviid: hat is strang daviid: that is strange RhodiumToad: sneek, later tell manumanumanu did you not mention me to oleg, or did he ignore that? sneek: Okay. str1ngs: daviid: it's working. I just think my imports are not right. so looks good to me. daviid: ok str1ngs: daviid this is more like my use case http://paste.debian.net/1137197 . this examples works so I think it's just a import issue. str1ngs: aha! WARNING: (g-golf): `!state' imported from both (g-golf gdk events) and (g-golf hl-api gobject) str1ngs: even when I don't import Gdk I get. No applicable method for #< !state (2)> in call (!state #< 7f3048a267c0>) daviid: hum daviid: i'm away from the kb, bb a bit later str1ngs: pretty confident it's a import issue not a g-golf issue. I'll figure it out. daviid: str1ngs: i thin it is an import g-golf issue str1ngs: wigh g-golf or my imports? daviid: g-golf i think daviid: be right back daviid: half an hour or so str1ngs: daviid: these are my imports for this module. http://paste.debian.net/1137199 str1ngs: if it helps daviid: str1ngs: i can't reproduce the problem here, but my .gule file has a (use-modules (oop goops) (default-duplicate...) call daviid: str1ngs: can you add the (use-modules (oop goops) in the eval-when clause, before to call default-duplicate-binding-handler, then also add (use-modules (g-golf)), just before the (gi-import "Gdk") call and see daviid: like this http://paste.debian.net/1137202/ str1ngs: daviid: no luck. I's probably another module I'm using str1ngs: the trivial examples work fine daviid: if you can work on an example that reproduce, i still think it is a g-golf problem ... maybe ... str1ngs: I'll try and bisect the modules. it's not as trivial as these examples. str1ngs: I've pasted so much to http://paste.debian.net/. I'm getting do not spam lol guix-vits: str1ngs: time to use the CentOs paste until then. guix-vits: 24hr-keep-only afaik alextee[m]: so is doc-snarf supposed to be working for C files? it seems to work for scheme but not for C (i get empty output when I run it on C files containing SCM_DEFINE) alextee[m]: well, i guess ill write my own parser lol alextee[m]: using libguile/guile-snarf-docs extracts the strings correctly, while doc-snarf doesnt. weird. i reported a bug alextee[m]: this was very helpful fwiw https://pimpmycode.blogspot.com/2013/11/how-to-add-docstrings-for-c-procedures.html brendyyn: How can I translate Python int(binascii.hexlify(x),16) into guile? alextee[m]: fedora only has 2.0, even rawhide! jesus alextee[m]: oh it's listed as guile22 guix-vits: alextee[m]: do you use a https://src.fedoraproject.org ? alextee[m]: guix-vits: i was searching through this https://apps.fedoraproject.org/packages/s/guile but i was told it's broken, so i guess i'll look at src. from now on mwette: alextee[m]: Does your Fedora have /usr/bin/guild2.2? It's missing on my Fedora-31 install, and that has caused problems for me using guile.m4. Ubuntu has /usr/bin/guile-2.2 but not /usr/bin/guild-2.2. mwette: alextee[m]: Ah, "dnf install guile-devel" adds it. mwette: But "apt install guile-2.2-dev" on Ubuntu does not. guix-vits: mwette, alextee[m]: afaik, `dnf` has 'search --provides' or smth alike (if you know what file name is, though). mwette: guix-vits: thanks -- this works: dnf provides /usr/bin/guild2.2 alextee[m]: mwette: will try soon, it's in a CI. but it looks like the specfile does provide a guild{version} alextee[m]: oh yeah it's in -devel alextee[m]: how can i pass a list to (system* )? mwette: lol. On ubuntu the apt man page says "if you are looking for a particular file, try apt-file(1), but apt-file does not exist. alextee[m]: im not sure what the difference between `(list x y z)` and `arg1 arg2 arg3...` is guix-vits: mwette: and to know which package provides apt-file ... :) mwette: alextee[m]: apply: (system a b c) == (apply system (list a b c)) guix-vits: mwette: https://wiki.debian.org/apt-file mwette: guix-vits: "dnf install apt-file" got it mwette: guix-vits: oops, "apt install apt-file" guix-vits: mwette: it should be updated before use, or it's automatic now? alextee[m]: mwette: nice! thanks mwette: guix-vits: I got error message "need to update" guix-vits: mwette: see the link above, then (debian wiki :) mwette: guix-vits: thanks! mwette: alextee[m]: and == (apply system a (list b c)) mwette: though there are small performance hits for using apply: lists must be constructed and de-constructed spk121: wingo: I see you've poked a bit at guile-cairo. Do you have future plans for the API? alextee[m]: i see tohoyn: should GOOPS-style object system be standardized in RnRS? alextee[m]: what's the easiest way to read the contents of a file into a string? alextee[m]: getting confused with all the port-related procedures alextee[m]: i read that racket has file->string tohoyn: alextee: use read-char and test when it returns EOF alextee[m]: is there no built in way to do that? tohoyn alextee[m]: looks like a common thing to do tohoyn: alextee: guile has get-string-all alextee[m]: oh there it is, thanks rotty: tohoyn: given that even R6RS was consider too large of a standard by many, I don't think adding something like goops would be too welcome rotty: (that's just my personal impression, of course) str1ngs: spk121: did my patch help with guile-gi? alextee[m]: has anyone got success with using libguile in mingw? alextee[m]: there seems to be a guile-devel package but not a mingw-w64-x86_64-libguile-devel alextee[m]: so it doesn't get picked up by pkg-config when configuring str1ngs: alextee[m]: does the guile package not have the pc file? str1ngs: alextee[m] maybe there is a mingw-w64-x86_64-guile ? alextee[m]: nope alextee[m]: i only found guile and libguile-devel manumanumanu: RhodiumToad: I told him you found the bug and linked to my patch in the guile mailing list sneek: manumanumanu, you have 1 message! sneek: manumanumanu, RhodiumToad says: did you not mention me to oleg, or did he ignore that? manumanumanu: I did not mention the issue in the mailing list, but since he said he hadn't migrated it from CVS (which became unsupported some time ago), I doubt he is doing much as a maintainer with regards to ssax str1ngs: alextee[m]: does msys compiler work? alextee[m]: not sure what the msys compiler is supposed to be. i always build just by running meson build && ninja -C build, and the libraries are from mingw-w64-x86_64-* packages alextee[m]: and it just works (tm) alextee[m]: maybe i should build guile from source instead of using the packages alextee[m]: https://github.com/msys2/MINGW-packages/issues/3298 alextee[m]: which links to this "long standing issue with the guile package itself" https://github.com/msys2/MINGW-packages/issues/699 manumanumanu: does guile do any funciton special optimizations? Like turn a (remainder n 128) into (logand n 127)? manumanumanu: (which doesn't work for negative numbers, but you get what I mean) spk121: str1ngs: we're going to definitely need something like that patch. right now we're still pondering how interacting with cairo should work. have to go from guile-cairo smob to pointer to GOOPS subclass of and back again wingo: spk121: hey :) regarding guile-cairo i have no plans. i use it in the software i have to render presentations and i hacked on it recently to attempt to render to svg. ended up not being the right thing for what i was looking for spk121: str1ngs: it would not surprise me if, at some point, someone will want to modernize guile-cairo and move from smobs to foreign objects and move from installing in 'lib' to installing in 'guileextensiondir' str1ngs: spk121: in guile-gi for the draw event. what does the callback signature look like. for g-golf it's signature is GtkWidget scm pointer. so this patch translates well. wingo: spk121: do you have any plans? spk121: wingo: need to connect guile-gi to guile-cairo, somehow. right now guile-cairo smob to pointer to guile-gi GOOPS or whatever str1ngs: wingo: hello, I want to propose this patch for guile-cairo. http://paste.debian.net/1137282. this helps with using guile-cairo with g-golf. str1ngs: spk121: smobs to foreign pointer might be a good start. wingo: str1ngs: is there a reason you can't use the ffi for that? wingo: i.e. call those C functions using the ffi spk121: wingo: maybe I'll branch a foreign objects of guile-cairo to see how it feels wingo: spk121: that would be interesting! wingo: see if foreign objects are any good :P i don't know of any experience reports with them... str1ngs: wingo: I think with ffi it would not be easy to do scm_from_cairo. which is need for calling guile-cairo functions. g-golf's cairo_to is a foreign pointer. so this just converts from that. str1ngs: if though spk121 is going to do some work port from smobs to foreign this patch might not be needed. mwette: str1ngs: hmm ... seems doable offhand wingo: str1ngs: pretty sure you can just wrap scm_to_cairo using pointer->procedure, argument of type '* and return type 'scm wingo: or how does that work... wingo: no it returns '* and then you call pointer->scm on the result str1ngs: I don't think scm_to_cairo is exposed but I can try with that. wingo: you should be able to get it via dynamic-func from the cairo object str1ngs: when I revisit g-golf and cairo I'll try with FFI. I was tring to keep things mostly in scheme. since GI uses it's own FFI in away. str1ngs: it's FFI is a little safer IMHO wingo: i get what you are saying but ultimately guile-cairo has two stable APIs: one for Scheme and one for C. you want the C one. you can call it from scheme using the FFI. adding scm_cairo_pointer_to_scm doesn't add any safety, because you are already starting with a foreign pointer, so you are already doing FFI things wingo: best to call the C API from Scheme using the FFI, IMO wingo: or rather, adding cairo-pointer->scm doesn't add safety, is what i mean to say wingo: scheme API that takes foreign pointers str1ngs: I will see if I can do this with FFI. for my use cases I ended up using libgv_guile.so instead. but there are other cause I'll need cairo eventually. if spk121 does some work with foreign pointers it might note be needed after all. str1ngs: s/cause/cases schaeffer: hello! this might be a silly question but how do i use the ioctl syscall in guile? seems like it's not available wingo: schaeffer: indeed not available directly. ideally someone should make a package for guile like luajit's ljsyscall. guix has an ioctl wrapper built using the ffi fwiw wingo: see guix/build/syscalls.scm mwette: While people are on the topic of ffi, does anyone know why libffi is included in the gcc source distribution? Is libffi used by gcc somehow? schaeffer: wingo: interesting. maybe another reason for me to finally try guix schaeffer: not that i know where to start really...i don't want to trash my main box by doing something wrong wingo: well it's just a function to extract from its source and use it wingo: i don't know that installing guix makes it more accessible wingo: i love guix but this is not a reason to install it :) str1ngs: sneek: late tell daviid. seems I can avoid No applicable method for #< !state (2)> in call (!state #< 7f6f67e1bd40>) if I don't compile the module I'm using !state in. does that give any indicator as to why it cant' find the method to you? sneek: daviid., str1ngs says: seems I can avoid No applicable method for #< !state (2)> in call (!state #< 7f6f67e1bd40>) if I don't compile the module I'm using !state in. does that give any indicator as to why it cant' find the method to you? str1ngs: sneek: later tell daviid. seems I can avoid No applicable method for #< !state (2)> in call (!state #< 7f6f67e1bd40>) if I don't compile the module I'm using !state in. does that give any indicator as to why it cant' find the method to you? sneek: Got it. alextee[m]: https://paste.debian.net/1137293/ is line 78 the correct way to do `cat myfile.doc | guild snarf-check-and-output-texi > myfile.texi` ? alextee[m]: i should probably do this in a shell file and read the results instead spk121: wingo: guile-cairo with foreign objects : https://gitlab.com/spk121/guile-cairo/ spk121: str1ngs: ^ spk121: need to update docs, test, etc, but that's the basic outline of it all spk121: from here, you can (slot-ref some-cairo-var 'ptr) to get the pointer str1ngs: with g-golf I need to go from scm pointer to a guile cairo type. is that feasible? str1ngs: spk121: as long as scm_to_cairo is exposed the this should work. I might have to use ffi as wingo mentioned. spk121: str1ngs: with regular guile-cairo, or the dirty hack I just did. With regular guile-cairo, you gotta ffi the scm_to_cairo. With the dirty hack, you'd load GOOPS then (define x (make )) (slot-set! x 'ptr #x12341234)) str1ngs: spk121: great that works thank you. str1ngs: spk121: out of curiosity how does guile-gi handle closures with cairo_t * arguements? spk121: str1ngs: if someone has loaded Gtk or such, it will start loading dependent typelibs, including cairo-1.0.typelib. Now cairo-1.0.typelib is not actually libcairo, but, libcairo-gobject.so, which only has GTypes for cairo types, but, no functions or anything like that spk121: so we end up with GType GBoxed like and such, but, no way to use them or look into them str1ngs: gotcha I think GObject does some bootstrapping for cairo GTypes hence the need for libcairo-gobject.so. str1ngs: it's kinda a chicken and egg scenario IIRC spk121: seems like it str1ngs: spk121: 'ptr have an init-keyword. so I could do this maybe. (make #:ptr ctx) ? spk121: str1ngs: that seems to work. (I've only done like 10 minutes of testing, haha) str1ngs: nice good work :) str1ngs: spk121: does this look right to you? http://paste.debian.net/1137300 str1ngs: ctx is #< 7fe79a61ce10> str1ngs: I get Wrong type (expecting exact integer): #. I think I'm doing this wrong spk121: str1ngs: foreign object's slots are always just raw integers, I think, so spk121: dereference-pointer is probably needed spk121: (dereference-pointer (scm->pointer obj)) str1ngs: (make #:ptr (pointer-address ctx)) works str1ngs: spk121: LGMT! :) spk121: str1ngs: note that I haven't thought at all about how GC works here. str1ngs: I thought of that as well. str1ngs: (make #:ptr (pointer-address ctx)) works. as long as that doesn't change. I can look more into this later. I'm not useing much cairo. but I have some C code I can try porting when I have more time. anadon: Is there syntax associated with making hash tables so that when you define a variable to be a hash table that you also define some contents of that hash table rather than populating it later? alextee[m]: hmm fold doesn't work https://paste.debian.net/1137008/ alextee[m]: it looks like i get a list of #undefined RhodiumToad: anadon: builtin hashtables ot srfi-69 or something else? RhodiumToad: alextee[m]: your lambda is returning undefined if the (when) condition is not satisfied, I think? RhodiumToad: alextee[m]: if you just don't want to add such cases to the list, then return the accumulator unchanged alextee[m]: RhodiumToad: right, thank you! that worked alextee[m]: i did (if ...) and returned the accumulator in the else statement RhodiumToad: anadon: actually I think both builtin and srfi-69 have an alist->hash_table function alextee[m]: the previous car/cdr thing looked a lot cooler though ArneBab: manumanumanu: a lessons-learned piece would be awesome! ArneBab: I think that’s something we’re still lacking. alextee[m]: how do you join paths with guile? searching doesn't bring up many useful results alextee[m]: i see a file-name-separator but there's gotta be a (join-path ...) somewhere ArneBab: manumanumanu: I realized that when looking at the awesome speedup in string-replace-substring: https://www.mail-archive.com/guile-devel@gnu.org/msg15175.html ArneBab: It’s not obvious how much speen in Guile can be improved if you know how. ArneBab: s/speen/speed/ RhodiumToad: alextee[m]: I don't see a better way than using string-join RhodiumToad: (define (join-path . args) (string-join args file-name-separator-string)) ;; or something like that alextee[m]: RhodiumToad: that doesn't work very well alextee[m]: i defined my own function RhodiumToad: well it was only a suggestion RhodiumToad: what did you do for yours? alextee[m]: https://paste.debian.net/1137020/ alextee[m]: im surprised there's no built in way though, there probably is RhodiumToad: I didn't find one alextee[m]: where file-name-sep-char is defined as (string-ref file-name-separator-string 0) RhodiumToad: there's (basename) and (dirname) in the posix lib, but I didn't see anything for constructing paths RhodiumToad: you're assuming the separator string is 1 character RhodiumToad: which I guess is probably always going to be true, but still... alextee[m]: i know otherwise i can't trim hmm RhodiumToad: how exactly do you want it to behave? alextee[m]: i want it to remove any trailing s from each previous string when appending a and a new string alextee[m]: so it still works if you join /usr/something/ with /something-else/ alextee[m]: and also trim off the last RhodiumToad: only trailing separators and not leading ones? alextee[m]: ah right, leading ones from the 2nd string too alextee[m]: except those at the very first arg alextee[m]: basically, it must always have 1 separator only when joining strings, so it should take care to remove any extra ones in-between the joining RhodiumToad: ok, let me think for a sec alextee[m]: also, are there some helper functions for invoking commands or checking if a program exists, other than using (system) or (system*)? alextee[m]: i recall seeing (invoke) in guix alextee[m]: python has shutil.which() for example, but im not sure if that's exactly equivalent to (system* "which" ) alextee[m]: (eq? (system* "which" ) 0) ;; like this maybe RhodiumToad: hm. predicting whether a new copy of a string will be allocated is not simple RhodiumToad: what do you want to do about empty components? alextee[m]: RhodiumToad: there shouldn't be any, but if there are just skip them i guess alextee[m]: https://paste.debian.net/1137022/ here's my 3rd guile program! rewrote the post-install script of my software from python to this RhodiumToad: how's this: https://dpaste.org/YUAC RhodiumToad: (my version is based on the idea that it's better to consume a few pairs than to allocate multiple strings) alextee[m]: interesting RhodiumToad: mine may still end up allocating intermediate strings depending on whether the input strings have mutable buffers or not alextee[m]: doesn't guile have a garbage collector anyway? RhodiumToad: yes chrislck: alextee[m]: it's about minimising the number of internal string-copy loops... chrislck: also minimising set! calls - see https://www.gnu.org/software/guile/manual/html_node/Variables-and-the-VM.html#Variables-and-the-VM about set! chrislck: also see https://www.gnu.org/software/guile/manual/html_node/Strings.html entirely alextee[m]: chrislck: i see, thanks rekado: alextee[m]: when using a fold you should not use set!; instead you can just return the new accumulator. rekado: alextee[m]: here’s the same thing but without set!: https://paste.debian.net/1137038/ rekado: next I’d look into reducing the number of string-appends rekado: (string-append "" x) is effectively just x rekado: you seem to be doing two things here: 1) trimming off “/” from the individual file name components, and 2) joining them to one string rekado: you can do these two things separately: 1) in a map, and 2) with string-join rekado: you don’t need to trim the accumulator (the resulting string in progress) if you have previously trimmed the individual components. rekado: your getenv-or-default calls getenv twice. You can use “or” to avoid this: (or (getenv name) default) rekado: in “program-found?” you can use “zero?” instead of “eq? 0” alextee[m]: rekado: thanks! will fix these now alextee[m]: working on interfacing my C structs to guile now, i managed to expose a couple of functions and to create a foreign object, but im not sure how to access its members once i have the object *: alextee[m] uploaded an image: Screenshot from 2020-03-28 07-07-28.png (36KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/pvZBeIiUtzPgXnmDnoQMDXuq > alextee[m]: ^ rekado: I’m not very familiar with this, but I think you would use pointers alextee[m]: pointers in guile? i'm trying to access things inside "mypos" for example alextee[m]: oh 6.21.5.2 Foreign Variables str1ngs: alextee[m]: also there are smobs alextee[m]: str1ngs: the manual says they're gonna be deprecated str1ngs: that makes sense. now that I think about it. rekado: alextee[m]: also 6.21.5.4 Foreign Structs alextee[m]: apparently it's a struct and a foreign object because (struct? mypos) returns true although i created a foreign object in C alextee[m]: apparently what im looking for is (struct-ref ) but that gives me an error *: alextee[m] needs sleep alextee[m]: o/ lampilelo: are the bindings in guile3.0-gnutls not thread-safe? when I switched from guile 2 to 3 it started throwing handshake errors on concurrent calls to http-get: (# handshake) lampilelo: maybe it's http module's problem in guile3? alextee[m]: i found a problem inside mingw on windows: https://paste.debian.net/1137068/ alextee[m]: running `C:\\tools\\msys64\\usr\\bin/guile.EXE C:/Users/travis/build/zrythm/zrythm/scripts/meson_post_install.scm` makes guile prepend the local path for some reason alextee[m]: In procedure stat: No such file or directory: "/c/Users/travis/build/zrythm/zrythm/build/C:/Users/travis/build/zrythm/zrythm/scripts/meson_post_install.scm" manumanumanu: ArneBab: The difference there is because andy does no copying of strings, and builds a string using with-output-to-string. That will lead to exponentially better performance the longer the string and the more matches you find manumanumanu: ArneBab: I am doing some tests to see if a KMP string search in guile is faster than the naive search in string-contains. manumanumanu: I believe SRFI-13 has a KMP search with access to restart vectors and such. if so, the procedure you linked to can be made even faster manumanumanu: SRFI-13 is MIT-licensed, and if the kmp search is actually useful, it could be included in string-fun. I doubt it will be even close for shorter strings, but maybe for longer ones with many patterns. manumanumanu: for the "replace substrings (plural)" one could just re-use the restart vector, which is what makes re-use of kmp-enabled string-contains expensive. manumanumanu: ArneBab: Whoa! For big strings, KMP is a lot faster. manumanumanu: under guile 3 manumanumanu: oops. no manumanumanu: ArneBab: disregard that :D manumanumanu: it is about as fast for 7kb of text the pattern "krigsmetaforer" which occurs towards the end of the text. This is comparing C code (for guile native string-contains) and scheme code (srfi-13 string-contains). RhodiumToad: rekado: your ideas about alextee[m]'s question look similar to mine? did you look at my version of join-path? *: spk121 ponders how to connect guile-cairo to guile-gi *: janneke sadly hasn't played with guile-gi and guimax for almost a year... manumanumanu: So: I have just spent 25 minutes testing out KMP string searching and naive string searching and the KMP string search fails to beat even a naive scheme string search. Has modern processors made KMP obsolete? I used a pattern that wasn't even close to bad for KMP, and it still lost to a scheme string-contains (that wasn't even noticeably slower than the built-in guile one!) manumanumanu: Or is the SRFI-13 KMP slow? RhodiumToad: how long a string? manumanumanu: 7kb. Pattern 12 chars. manumanumanu: Chicken went with a naive search by commenting out the KMP one in srfi-13, and using Olin's naive one. Racket has a kmp-based search. manumanumanu: the racket one is trivial to port. Will try that one next :D jcowan: manumanumanu: I recommend SRFI 135,which adaptively uses naive, BMH, or Rabin-Karp jcowan: the only issue is that texts are not strings, but if you just want containment, a global search and replace should deal with that *: jcowan should update SRFI 152 to use that instead of KMP jcowan: Texts are really lovely: high performance, O(1) reference, modern algorithms jcowan: The only problem with texts is that they aren't strings (though the text API accepts strings), thos rekado: RhodiumToad: yes, I just wanted to show how to get there janneke: #guix janneke: /gnu/store/ng1ibixsaggc7swvbfg6v3084xqw509i-guile-3.0.1/bin/guile -c '(display (uname))' janneke: #(GNU debian 0.9 GNU-Mach 1.8+git20191117-486/Hurd-0.9 i686-AT386) janneke: finally, got guile-3 built on the hurd janneke: the test suite is still hangs at several tests, so more work todo mwette: janneke: great work! janneke: mwette: thanks :) spk121: janneke: neat. (I wonder if I still have a hurd VM someplace) civodul: janneke: woohoo! congrats! civodul: that's quite something civodul: what does %host-type look like? janneke: it looks nice: janneke@debian:~/src/guix$ /gnu/store/ng1ibixsaggc7swvbfg6v3084xqw509i-guile-3.0.1/bin/guile -c '(display %host-type)' janneke: i586-unknown-gnu *: janneke hopes while unknown, it's still a friendly gnu janneke: still need ~10 pretty hack'y patches in guix, but oh well, that's just some work janneke: (for some other packages) civodul: the unknown gnu civodul: hacky package portability patches are OK IMO janneke: okay -- i had a patch that comments-out three tests for guile-2, now disabled them all; i'd like to be a bit more specific i think janneke: anyway, now just keep taking small steps civodul: yeah str1ngs: spk121: can you test this patch works for guile-gi. http://paste.debian.net/1137106 str1ngs: spk121: regards getting guile-cairo to work. str1ngs: spk121: you can use the draw event with a GtkDrawingArea to test. spk121: str1ngs: cool, thanks! str1ngs: spk121: if that works for you, i'll email the patch to guile-users. maybe wingo can review it. str1ngs: spk121: I used this g-golf example to test. should not be hard port it to guile-gi http://paste.debian.net/1137111 jcowan: https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Compiled-Procedures.html#Compiled-Procedures does not seem to document correctly what the arity functions actually do on 2.2: after loading (system vm program) program-arities is unbound, the arity:* procedures work on any procedure, and arity:nreq (number of required arguments) seems to always return 0. jcowan: A workaround is to parse the answer out of what program-arguments-alist returns. jcowan: I don't know if this bug persists in Guile 3 mwette: jcowan: program-arities not defined after loading (system vm program) in 3.0.2 jcowan: thanks, I'll file a bug alextee[m]: Wrong type (expecting position): # alextee[m]: is this not a position? alextee[m]: that is an object returned by C using: scm_make_foreign_object_1() alextee[m]: and it fails when i pass it to another function i exposed when I do: scm_assert_foreign_object_type() alextee[m]: oh it worked now nvm, apparently you're only supposed to use 1 object type created wtih scm_make_foreign_object_type() and keep it around rlb: Not sure it would be advisable to add it, but today I could have used a scm_take_size_t_vector() (just an alias to the appropriate u32, etc. version). manumanumanu: jcowan: yeah! srfi-135 is my favourite string srfi :D manumanumanu: civodul: regarding my patch to fix sxml handling of CDATA: oleg just applied that patch, but it will take him some time to migrate the old SourceForge account from CVS. He posted the updated versions on his webpage. I'll check whether there are any other changes except what I did and make a new patch if that is the case manumanumanu: RhodiumToad: ^ manumanumanu: jcowan: It looks portable, btw. Will try :D alextee[m]: when i want to return a bunch of items, i should be returning a list and not an array/vector, right? i don't really understand the use-case of arrays/vectors when you have lists rlb: alextee[m]: it depends? i.e. i.e. if the callers need better memory efficiency, and constant time lookups, then a vector would be preferable, and if all the items are the "same" a srfi-4 homogeneous vector better still. rlb: But of course in some contexts, the callers would be wanting/expecting a list (to past too map, or fold, or...). seepel: rlb: How would you decide when to use values vs returning a structure? rlb: s/too/to/ rlb: seepel: you mean values as in multiple values, i.e. (values ...)? seepel: Yes rlb: I suppose some of it's an aesthetic judgement, though there are also efficiency arguments in the limiting cases? I think guile might be able to avoid allocation for small numbers of (values ...) in some cases... rlb: But unless you're in a performance critical region, that's likely not the key concern. alextee[m]: rlb: thanks. i'm just exposing some of my program internals for easy scripting for non-programming users so i guess i'll use lists then, they seem to be the simplest. memory is not a problem at all, i expect my program to hog lots of memory anyway (it's music production software) :D seepel: rlb: Thanks, so in the general case (values ...) would be performance-wise about the same as returning a list in guile? rlb: Can also use alists for smallish cases where you might otherwise use a hash table (or nested hash tables). fwiw, I tend to use hash-tables (maps) a lot (and it's very idomatic there) working in clojure. rlb: Though there there are a lot more convenience facilities (destructuring, etc.) for maps that tend to shove you that direction. rlb: seepel: well I think (values ...) may be roughly "no cost" as opposed to "some cost" for building and then rummaging around in the list, but in the common case it likely won't matter at all. rlb: alextee[m]: alists are also nice in that they read/write trivially. manumanumanu: i suspect the case is that when the caller and callee is known, (values ...) will always be faster manumanumanu: unless you of course want a list :D alextee[m]: oh alists look nice jcowan: I'm trying to put together a package to use alists as fake hash tables, with update by pushing on the alist and delete not allowed. manumanumanu: jcowan: I have one of those somewhere jcowan: What should an a-list walker like map or filter do when it hits a duplicate key? rlb: (for config-ish data -- that or just plain lists of lists -- you can use assoc/ref etc without using dotted forms if you prefer the "nicer" output for a config file, you'll just need an extra car to get the values, etc.), e.g. (car (assoc-ref '((some thing) (another other)) 'some)) jcowan: To detect dups requires O(n) time, which feels awful.\ jcowan: So my inclination is to have it carry on regardless jcowan: and just eat the fact that you may get the same key more than once. manumanumanu: i suspect that is what I did. manumanumanu: I can't remember. The whole process ended up with me discovering HAMTs alextee[m]: btw, is there some form of documentation generator from the stuff exposed through C? rlb: alextee[m]: not sure I understand the question. alextee[m]: let's say i expose a few modules like (zrythm audio position) (zrythm audio track) etc.. and some functions like (make-position ...) (print-position ...) alextee[m]: i want to create documentation about all of these exposed symbols automatically rlb: https://www.gnu.org/software/guile/manual/html_node/Function-Snarfing.html ? rlb: And you can see a lot of other examples in guile's libguile/*.c files, i.e. strings.c, etc. alextee[m]: oh! right i remember reading that, thanks manumanumanu: jcowan: The textual searching actually manages to be faster than guile's naive search! The scheme is beating C :D rlb: One thing that page doesn't mention is that if you're using automake, you'll also need to add a "BUILT_SOURCES = .../foo.x" for all the .x files to avoid a circular dependency. manumanumanu: but only for 10 megs of data :D alextee[m]: eh, i don't suppose anyone used this with meson yet.... i'll need to figure it out rlb: The tricky bit there is just that the .c file #includes the .x file but the .x file is generated from the .c file, so "someone has to go first". alextee[m]: i see rlb: So you just need to run the snarfer the first time unconditionally. rlb: (I think.) rlb: likely won't be hard from meson, and it's not hard from automake once you actually remember that's what BUILT_SOURCES is for (I didn't for a bit...). alextee[m]: yeah doesn't sound that hard. i'll do it now actually jcowan: manumanumanu: Awesome jcowan: Which of the 3 kernels did you use? manumanumanu: jcowan: I just ported the search algorithm to use guile-native strings jcowan: Cool manumanumanu: But I wonder if the rabin-karp algorithm is ever worth it manumanumanu: I might just factor out the boyer-moore-horspool algorithm and change the API a little (ie: allow for a pre-computed table) jcowan: You saw the comments? manumanumanu: yup, but I can't get it to be faster than guile's naive search even when trying :D manumanumanu: (if you mean the source comments) manumanumanu: but I can't really say I can really wrap my head around that. I suspect will has a better idea about these things than I :D For most of the time I couldn't even maake the rabin-karp case trigger... jcowan: Try 100 MB of text or somethiung' manumanumanu: I'll figure something out. It is getting late over here manumanumanu: good night everyone rlb: manumanumanu: happen to know offhand how srfi-135 makes textual-ref O(1) in general, say for the "utf-8" example kernel? manumanumanu: I am reading said kernel as a bedtime story rlb: hah, ok. Sleep well. civodul: manumanumanu: sure, please send a link when Oleg has uploaded something civodul: or a patch that just incorporates that into our copy manumanumanu: rlb: https://github.com/scheme-requests-for-implementation/srfi-135/blob/master/srfi/135/kernel8.body.scm#L93 by storing ascii text in bytevector chunks of 128 and utf8 text in chunks of something else. manumanumanu: rlb: so, that would be "o(1) ish" if most of the text is us-ascii. rlb: Ahh, ok -- that makes sense. When they said O(1) I'd imagined at worst a parallel "index array", but of course chunking makes it a lot more memory efficient without too much extra computational cost... manumanumanu: rlb: but check out what pypy does. It has some kind of index structure for utf8 strings manumanumanu: now, good night! rlb: (parallel index array of all indexes) jcowan: rlb: The utf8 kernel is only meant to be used in interpreters when using the built-in string-ref is faster than writing similar code in Scheme jcowan: oh, sorry, that's kernel0 I'm talking about. jcowan: Yes, "O(1)" does not mean constant, and SRFI 135 exploits that alextee[m]: someone should write a build system in guile *: alextee[m] wishes meson was written in guile *: alextee[m] rewrites a bunch of python scripts to guile because why not dsmith-work: alextee[m]: There was an attempt years ago. Had a lot of fun naming it. dsmith-work: Kind of like make, with all the power of scheme. dsmith-work: spells I think dsmith-work: Conjure dsmith-work: https://programming-musings.org/2006/01/09/conjure_a_make_replacement_in_scheme/index.html ear-the-art: alextee[m], dsmith-work , GNU make has official guile support dsmith-work: jao: Whatever became of that? Is it work resurrecting? Or does guix replace it? ear-the-art: https://www.gnu.org/software/make/manual/html_node/Guile-Integration.html alextee[m]: omg nice ear-the-art: yeh =) dsmith-work: Was just talking about that the other day. Guile uses make to build which guile... jao: dsmith-work, i know very little about guix, but conjure is dead and buried dsmith-work: Awww jao: has been for, i don't know, a decade? dsmith-work: Sure brendyyn: ive written my first module but havnt got a build script for it. ive never made one before. what is the current recommendation? make and libtool? dsmith-work: Seems like every project invents a new build system these days. jao: (i remember it was really fun naming it) dsmith-work: jao: Yeah, we had a blast alextee[m]: still doesnt look simple enough. im expecting something like (define-binary ...) (define-library ...) like meson does, except cooler! alextee[m]: or automake which i will never comprehend or understand its documentation dsmith-work: alextee[m]: Nope. Not that simple. It's still make. Just with added Guile functions. alextee[m]: yeah looks like it alextee[m]: (find-library ...) (find-header ...) it would be so awesome dsmith-work: Conjures Original Name Judged Unsuitable: Rms's Email dsmith-work: soemthing like that jao: something like that brendyyn: Is the Jan that posted in guile-user in this channel? spk121: I despise autotools as a build system, but, it is my default for everything. I do love old-school makefiles brendyyn: spk121: Thanks for guile-gi 0.3 jcowan: When you type "./configure" in the Chibi source directory, it prints out: jcowan: Autoconf is an evil piece of bloatware encouraging cargo-cult programming. jcowan: Make, on the other hand, is a beautiful little prolog for the filesystem. jcowan: Just run 'make'. ear-the-art: interesting description that is =) jcowan: Chibi figures out inside make whether you are on MacOS, *BSD, Cygwin, Windows, Android, Linux, or Solaris, and writes out a .h file with the proper defines as welll as setting build-time variables. If you want it to run on VMS or z/OS, you port it yourself dsmith-work: Sounds wonderful jcowan: Chicken takes the same approach, but until just now it didn't have the auto-detection. Now it does *: jcowan buffs fingernails dsmith-work: heh vidjuheffex: hello all, guix keeps telling me that package not found for version 3.0.1 vidjuheffex: ive run guix pull vidjuheffex: I literally have never used guile or guix before so apologies for the dumb question brendyyn: vidjuheffex: default "guile" is 2.2 at the moment vidjuheffex: i understand vidjuheffex: instructions said i could guix install guile@3.0.1 to specify a version brendyyn: there is guile-next brendyyn: I don't know why but they haven't yet got to updating guile to 3.0.1 vidjuheffex: it seems none of the 3's are on there vidjuheffex: i tried @3.0 like it says on the homepage vidjuheffex: then i figured I had to be more specific lol vidjuheffex: thanks for your help! I'll just stick with the default. (trying to use chickadee for an upcoming gamejam, I'm guessing it works fine with 2.2) brendyyn: I think so but it will be less efficient i think. vidjuheffex: so is guile-next the way to go? brendyyn: id say so. you can easily switch back to the guile package when its updated vidjuheffex: sorry for all the questions... would I then need to modify geiser and stuff to point to guile-next, etc... trying to gauge how much effort I want to put into getting decent tooling vs just getting up and running as a beginner vidjuheffex: or does is still get called with `guile` vidjuheffex: i forget IRC doesnt have markdown brendyyn: are you setting them in your .bash_profile? brendyyn: i dont think you need to do that. You just use the guix environment command vidjuheffex: ill google that, thanks again for the help and pointers brendyyn: perhaps if your GUILE_LOAD_PATH if its set to refer to the 2.2 site path, maybe change it to 3.0 brendyyn: or make it automatically find what ever is there brendyyn: vidjuheffex: are you using chickadee from source? vidjuheffex: havent gotten that far yet vidjuheffex: just installed guile-next vidjuheffex: trying to figure out how to run it vidjuheffex: i thought it installed to /var/guix or /gnu vidjuheffex: oh I'll try that, but im not terribly comfortable trying that much stuff i don't really understand at once brendyyn: everything goes in /gnu/store. You don't need to go and find those paths. that is crude. Trust me, what you want to do is easier than you think. vidjuheffex: i don't understand what that command does for me vidjuheffex: will I be able to run guile in my terminal and open the guile I want vidjuheffex: do I start every session with that command? brendyyn: guix environment downloads the required packages, and then sets the appropriate environment variables for you like PATH vidjuheffex: running it now, fingers crossed brendyyn: its downloading slowly for me brendyyn: 6KiB/s vidjuheffex: yeah this is taking awhile :D brendyyn: I wish we could get more donation money to run better servers (/ brendyyn: and i heard with people isolating globally, the entire backbone of the internet is peaking in some places vidjuheffex: sweet guile 3.0 runs when I call guile brendyyn: do you use emacs? vidjuheffex: but do i have to run these each time vidjuheffex: if i open a new terminal tab and run guile vidjuheffex: its 2.2 vidjuheffex: which is why i think i need to set the paths vidjuheffex: so i can tell emacs where tf this executable is brendyyn: if you want it globally just run guix package -r guile -i guile-next vidjuheffex: guix package: error: package 'guile' not found in profile vidjuheffex: ear-the-art: 'which guile' ? /usr/bin may be override /usr/local/bin ? vidjuheffex: /gnu/store/......-profile/bin/guile brendyyn: just install guile-next then vidjuheffex: i did vidjuheffex: but i can't figure out how to run it vidjuheffex: guile runs 2.2 ear-the-art: vidjuheffex, ah oops. vidjuheffex: guile-next isnt a command brendyyn: Do you have ~/.guix-profile/bin at the start of your PATH? vidjuheffex: echo $PATH vidjuheffex: /home/jules/bin:/gnu/store/pxr4f20cwwmlsq8ahw50mk1l5sz8h49l-profile/bin:/home/jules/.config/guix/current/bin:/home/jules/bin:/home/jules/.nvm/versions/node/v10.16.3/bin:/home/jules/.local/bin:/home/jules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin vidjuheffex: vidjuheffex: not quite brendyyn: what is /gnu/store/pxr4f20cwwmlsq8ahw50mk1l5sz8h49l-profile/bin how did that get there brendyyn: was this from within the guix environment? vidjuheffex: yeah chrislck: thanks vidjuheffex for voicing newbie difficulties with guix ! vidjuheffex: in a new tab vidjuheffex: thats not present brendyyn: anyway there is no ./home/jules/.guix-profile/bin, so i think that's why it is not finding it. vidjuheffex: @chrislck someone on the scheme discord had mentioned issues getting started with guile, I can see why, though to be fair it seems if i wanted to use 2.2 it would have been as easy as using apt vidjuheffex: brendyyn: thanks I'll try adding that brendyyn: vidjuheffex: I think i will try improve the guix manual to explain this stuff better. technically the information is there, but it doesn't make it easy for you vidjuheffex: i think the main thing would be to remove: To install a particular version, add a version suffix like @3.0, as appropriate. vidjuheffex: until that's true vidjuheffex: either way im not too bothered, nothing like a good challenge and getting to chat with folks in the scheme community vidjuheffex: maybe genius-by-osmosis is a thing lol vidjuheffex: adding that to my path worked, thanks brendyyn: vidjuheffex: You should move the bit where you add /home/jules/bin from .bashrc into .bash_profile. vidjuheffex: thanks, will do brendyyn: hmm it seems that guix environment doesnt set GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH automatically *: chrislck has given up on guix for now. no offence, just no time and energy to dive into it. brendyyn: thats fine. many people are working on it and it gets bettor over time vidjuheffex: WARNING: compilation of /home/jules/Code/flappy-bird/main.scm failed: vidjuheffex: ;;; no code for module (chickadee) vidjuheffex: brendyyn: what does `env |grep GUILE` say vidjuheffex: i got disconnected vidjuheffex: hope i didn't miss any answers, apologies brendyyn: what does `env |grep GUILE` say vidjuheffex: (reason #34398 why i can't understand IRC popularity but thats another topic) vidjuheffex: okay so install guix install guile-chickadee vidjuheffex: is that installed globally? brendyyn: Noone has ever created anything better than matrix for its purpose, perhaps matrix qualifies? brendyyn: better than irc* brendyyn: yes vidjuheffex: im a discord person, but i've learned better than to mention satan in front of FOSS people lol vidjuheffex: anyway, im used to akku where packages are per akku-init'd folder vidjuheffex: is guix installing it globally brendyyn: indeed. i respect discords voice channel functionality. but it is proprietary and has no privacy what so ever. for large groups, the text channels are worse in terms of the number of people it can support, i.e., the lines of text that fits on the screen brendyyn: Never heard of akku vidjuheffex: its a package manager for r6rs vidjuheffex: and its dope vidjuheffex: copies snow and makes r7rs packages on there work for r6rs so you end up with a lot of options vidjuheffex: env grep guile returns nothing brendyyn: yep so you want them set too... give me a sec vidjuheffex: oh and this is using guile 2.3 again vidjuheffex: da fuq vidjuheffex: oh sorry about my language :facepalm: vidjuheffex: bad habits brendyyn: actually I think maybe you want to load .guix-profile/etc/profile brendyyn: sorry i sorta forgot this stuff. I'm on Guix SD so everything Just Works(TM) brendyyn: In the guix manual there is this: brendyyn: GUIX_PROFILE="`echo ~root`/.config/guix/current" ; \ brendyyn: source $GUIX_PROFILE/etc/profile brendyyn: oops. sorry thats for root vidjuheffex: it's all good, going to get off here soon and maybe look at some other options for the upcoming gamejam brendyyn: giving up? vidjuheffex: not permanently vidjuheffex: but im def concerned vidjuheffex: is every speed bump i hit going to feel like a mountain? brendyyn: it seems hard, but all you need to do is set your environment variables right vidjuheffex: the install instructions for guile were misleading. (the @3.0 command doesn't work) vidjuheffex: the install instructions for guix were misleading (just run this script, when in fact you also have to set other stuff like langs) vidju[05:00:04]: id say it is, but its in the ~/.guix-profile/etc/profile file, which you aren't loading brendyyn: can you check that please vidjuheffex: i think i did? was that the grep command you had me run? vidjuheffex: that return nothing vidjuheffex: *returned brendyyn: export GUILE_LOAD_PATH=~/.guix-profile/share/guile/site/3.0:$GUILE_LOAD_PATH brendyyn: export GUILE_LOAD_COMPILED_PATH=~/.guix-profile/lib/guile/3.0/site-ccache:$GUILE_LOAD_COMPILED_PATH brendyyn: ... hopefully this works vidjuheffex: add these to bash_profile I assume? brendyyn: yeah. not that .bash_profile isnt activated until you log out and log back in again vidjuheffex: no same thing brendyyn: try just pasting it in the terminal with chickadee to test it vidjuheffex: no code for module (chickadee) vidjuheffex: thats what im doing vidjuheffex: running guile vidjuheffex: then calling (use-modules (chickadee)) brendyyn: i hope it hasnt installed the chickadee with 2.2 :/ brendyyn: since they have the same package name, that could be a bug vidjuheffex: nah if I run guile-2.2 vidjuheffex: i get the same thing importing chickadee brendyyn: im installing it to test vidjuheffex: i think i should start over and ignore 3.0? Chickadee doesn't seem to need it and I think all the stuff I did to get 3.0 to work broke stuff that might have otherwise just worked? I dunno just spitballing? brendyyn: sure vidjuheffex: illl wait until after your test brendyyn: i found it didn set the variables in .../etc/profile either brendyyn: i guess just use the default guile and see how it works vidjuheffex: okay, im goiing to delete /gnu and /var/guix vidjuheffex: remove the lines from bash_profile vidjuheffex: and start over brendyyn: i dont think you need to do that brendyyn: i foudn its installed chickadee with 2.2 i think brendyyn: I believe there is a bug brendyyn: it should be called "guile3.0-chickadee" but both the 2.2 and 3.0 version have the same name, and it picks the first one by default vidjuheffex: okay, rebooting ill brb brendyyn: so if you just go back to guile instead of guile-next, and chanege the 3.0 to 2.2 in it should work vidjuheffex: okay im back vidjuheffex: guix pull is almost done vidjuheffex: or so i thought :) vidjuheffex: hint: After setting `PATH', run `hash guix' to make sure your shell refers to`/home/jules/.config/guix/current/bin/guix'. vidjuheffex: hash guix doesn't show anything vidjuheffex: after setting path to what? vidjuheffex: disconnected again, apologies if I missed a response vidjuheffex: wifi card in dell xps is trash vidjuheffex: no dice :( vidjuheffex: oh well thanks for the help tonight vidjuheffex: jules@jules-XPS-15-9570:~/Downloads/guile-sdl2-0.4.0$ make GEN sdl2.go./pre-inst-env: 32: exec: compile: not foundMakefile:1082: recipe for target 'sdl2.go' failedmake: *** [sdl2.go] Error 127 vidjuheffex: trying to install guile sdl2 and avoiding guix like the plague vidjuheffex: anyone can help with the above error? vidjuheffex: ./configure runs fine str1ngs: vidjuheffex: sounds like it's trying to call guile compile. check the Makefile.am. probably $(GUILE) is not expanding properply str1ngs: err $(GUILD) str1ngs: vidjuheffex: ^ vidjuheffex: hmm it says GUILE_TOOLS vidjuheffex: ill change that vidjuheffex: make-1.15 --foreign MakefileMakefile.am:90: warning: user target 'dvi' defined here ...automake-1.15: ... overrides Automake target 'dvi' defined hereMakefile.am:90: consider using dvi-local instead of dvi cd . && /bin/bash ./config.status Makefile config.status: creating Makefile GEN sdl2.go./pre-inst-env: 32: exec: compile: not vidjuheffex: foundMakefile:1082: recipe for target 'sdl2.go' failedmake: *** [sdl2.go] Error 127 vidjuheffex: same error but a bit more verbose? vidjuheffex: i just hardcoded guild in there rather than $(GUILD) str1ngs: it's trying to call compile. when it should call $(GUILD) compile. in which case GUILD is not expanding right. str1ngs: vidjuheffex: that will work, though it's kinda hack str1ngs: normally that should expand to the full path. vidjuheffex: i wish i could expand on that, total newb sorry, and IN WAY OVER MY HEAD vidjuheffex: lol str1ngs: see if configure.ac using GUILE_PROGS? str1ngs: grep GUILE_PROGS configure.acs str1ngs: err configure.ac str1ngs: I've seen this before what I used instead is. AC_PATH_PROG(GUILD, guild, no) str1ngs: AC_SUBST(GUILD) str1ngs: then I make sure it's set with. if test "$GUILD" = "no"; then str1ngs: AC_MSG_ERROR([program guild is required]) str1ngs: fi vidjuheffex: yeah its using GUILE_PROGS str1ngs: what disto are you using? str1ngs: maybe GUILE_PROGS is trying to find a multi version guild like guild-2.2. dunno str1ngs: hmm maybe $(GUILE_TOOLS) is the right variable. str1ngs: GUILE_TOOLS=$GUILD str1ngs: so GUILE_TOOLS should work if it finds GUILD str1ngs: AC_PATH_PROG(GUILD,[guild$_guile_suffix]) might be the culprite. str1ngs: from guile.m4 vidjuheffex: shrug vidjuheffex: ubuntu vidjuheffex: now im trying the ./configure command in chickadee vidjuheffex: checking if (gl) is available... noconfigure: error: required guile module not found: (gl) vidjuheffex: nothing can be easy tonight :( vidjuheffex: had to add --prefix=/usr to the sdl2 and gl configure commands for chickadee configure command to find them vidjuheffex: found off github for guile-sly vidjuheffex: otherwise I'd never know that str1ngs: it happens :) str1ngs: configure is working now though? vidjuheffex: yes i finally have chickadee working brendyyn: congratulations vidjuheffex: started at around 8:30pm and its 1:11am :| vidjuheffex: hoping as i get more used to command lines that this sort of troubleshooting goes faster vidjuheffex: thanks vidjuheffex: to you both brendyyn: I think I will work on improving the guix documentation ;) vidjuheffex: last set of questions vidjuheffex: anyone use geiser? vidjuheffex: https://dthompson.us/manuals/chickadee/Kernel.html#Live-Coding vidjuheffex: if i run that and try connect-to-guile I get "no prompt found" vidjuheffex: if i then quit geiser it says "connection broken by remote repl" str1ngs: vidjuheffex: do you have anything in ~/.guile ? vidjuheffex: it both seems to know its connected and not know its connected str1ngs: can't find prompt is not a connection error its a read errore. vidjuheffex: no i don't have a guile str1ngs: it's trying to magically find the guile prompt vidjuheffex: which is weird because the prompt is the same if i run guile --listen vidjuheffex: which works (but goes against chickadees docs) vidjuheffex: or does it need both? vidjuheffex: wait no, that can be as it would get an address in use error str1ngs: I don't know about chickadee vidjuheffex: ok, thanks anyway vidjuheffex: is there a way to press "up" and get the previous commands like in chez vidjuheffex: i get ^[[A vidjuheffex: ctrl + up gives me ^[[1;5A RhodiumToad: you have to load the readline module vidjuheffex: in the remote repl or is this in geiser? RhodiumToad: (use-modules (ice-9 readline)) (activate-readline) in your .guile vidjuheffex: thanks RhodiumToad: dunno about geiser vidjuheffex: i will give that a shot vidjuheffex: thanks vidjuheffex: yeah i can't tell if i need to run-guile and then connect-to-guile vidjuheffex: or ifthose replace one another? vidjuheffex: i think they replace the usage of the other, since it works with listen vidjuheffex: what i don't understand is how it can find the prompt with one and not the other despite the prompt and port being identicak vidjuheffex: *identical vidjuheffex: I'll check back in tommorow and see if anyone has used connect-to-guile without --listen before, thanks vidjuheffex: hmm i have to call all the stuff in chickadees docs vidjuheffex: then execute (poll-coop-repl-server repl) a bunch vidjuheffex: until it registers in emacs vidjuheffex: hmm well that only half works vidjuheffex: each command requires me going into the repl and running that a bunch vidjuheffex: until emacs unlocks up vidjuheffex: if i put these commands in my .scm file itself, and run guile main.scm, I can then connect with geiser vidjuheffex: but the terminal windows isn't a repl as I'd expect vidjuheffex: (though in emacs there is a repl) vidjuheffex: and nothing about it is live, as in I can't change for example the text on screen, eval it, and see the change vidjuheffex: so I doubt thats correct civodul: Hello Guilers! wingo: morning :) wleslie: hi ludo civodul: i've been trying to profile memory usage in the compiler civodul: when compiling a large file civodul: there are places where the heap grows by 100 MiB or more rekado_: woah civodul: but it's hard to figure out whether it's "expected" or whether we're leaking or doing something wrong civodul: for example, 'renumber' in (language cps renumber) is very hungry civodul: on my example, before lower-cps we're at 97MiB civodul: after split-rec (part of lower-cps) -> 113MiB civodul: after convert-closures -> 161MiB wingo: how are you measuring memory usage? civodul: (gc-stats) civodul: lemme show you civodul: that's the kind of trace i get: https://paste.debian.net/1136902/ civodul: low tech :-) civodul: with a macro to print stats before/after: https://paste.debian.net/1136903/ wingo: interesting :) wingo: for renumber specifically it would be possible to use different strategies, i.e. collect the conts in a flat vector, use side u32vector for renumbering values, etc wingo: dunno civodul: instead of using intmaps you mean? wingo: yes civodul: ok civodul: though it's not clear to me that we can do better, in fact civodul: i thought you had written a blog post on intmaps/intsets but i can't find it civodul: maybe i should be less ambitious for today civodul: wingo: how about releasing 3.0.2? sounds like a good day for that :-) civodul: it fixes a couple of crashes wingo: yes that would be great! i am a bit out of time, if you want to do it go ahead wingo: otherwise can help over the weekend wingo: "weekend" wingo: all days are mushing together :P civodul: heh civodul: yeah civodul: i should be able to do it kalcode: Yo! kalcode: I wanna use this https://dthompson.us/projects/chickadee.html kalcode: But on OSX, cant get it to run due to "#version 130", i think the the shaders? I changed them to #120 (see if that work and update in and out). Nada. kalcode: Not an expert at any of this stuff by guile seemed interesting and chickadee. brendyyn: We just had another newbie today wanting to learn to use chickadee ;) kalcode: Probably my friend lol brendyyn: are you doing some game jam? kalcode: I know we were gonna try to use it for game jam. Reminded me a lot of pyglet/pygame kalcode: Yah kalcode: I helped him with his issues yesterday, but I couldnt unblock myself lol brendyyn: its quite basic at the moment. you will be building up from scratch kalcode: YAH! brendyyn: OSX is.... can't help you much there. kalcode: I just want to draw some sprite and move things around not much. Just motivating myself to learn scheme. kalcode: Not a functional programmer really, so its gonna be fun! brendyyn: but I thought 130 was compatible with a lot. did you research it to find it doesnt work on osx? kalcode: It does, but i get lost when they say i need to tell it to use the CORE_PROFILE of sots, unfortunately that a C call when you init the the display, think that in guild-opengl2d? kalcode: I feel like that might be the wrong way to do it, also that serious deep dive to get it to work. So definitely hoping i overlooked something lol kalcode: im really install chikadee from source again to get the error. Ill post it in-case anyone has an idea kalcode: Coool, got the same error again. So here is the dump. Anyone who looks at it, i really appreciate it! kalcode: Also not a big deal, just playing around. Ill probably use Racket built-in stuff. But chickadee just looked nice from my perspective to play with brendyyn: Does it say it can work on OSX? kalcode: https://paste.ofcode.org/qTHcceGV85TdZ29qPEKZGE kalcode: Might not be able to, but Id think it fail during make and make install no? brendyyn: the creator of chickadee is in this channel sometimes kalcode: oh nice, thank you. Maybe I get lucky, or I might send an email kalcode: thanks for lookin out brendyyn! rekado: kalcode: does your graphics card support OpenGL 3.x? rekado: the shaders in chickadee require it. kalcode: hahaha, its a mac. I wonder. Never thought of that. I cant remember the last time something didnt but never did game stuff on the mac. I only use it for webdev. Social isolation im using it as my main currently. Let me see if I can figure out real quick how to check that kalcode: it has a Radeon_RX_500_series, but it also has intel. So it using two GPU. I wonder if that makes it where by default it returns its lowest supporting shared version? kalcode: I suspect its mac bs for now :( kalcode: Sent an email to the creator will look into it later. dsmith-work: Happy Friday, Guilers!! mwette: o/ *: civodul updates NEWS wingo: woo dsmith-work: NEWS update on a Friday... dsmith-work: I sense a release approaching. mbakke: 🎉 mwette: off topic: i'm reading this all in emacs - I get off glyph from mbakke's last comment ; any clue what font I am missing (on Ubuntu)? mwette: s/off/odd civodul: same question for, on Guix :-) dsmith-work: Copy pasted it into another app (slack). Also known as :tada: brendyyn: i see it in termite and leafpad but somehow emacs fails dsmith-work: It's a yellow/orange cone with red and blue particles emitting from the open end. *: sneek .oO(Kids these days and their "emojis") wingo: i also get that broken glyph thing on guix wingo: would be nice to fix brendyyn: wingo: M-x package-install emojify, M-x emoji-mode wingo: i am in hexchat, fwiw brendyyn: oh ok. it displays for me in some applications and not others. in ice cat it displays in html, but not in the url bar civodul: hmm emojify-mode wants to download images civodul: a bug in the Guix package? dsmith-work: The emacs package also wanted to dsmith-work: Worked, btw brendyyn: it seems to be related to something called Emoji One in unicode. *: sneek :tada: vidjuheffex: (fyi the log link is a dead link) vidjuheffex: in the chanserv message brendyyn: i hope its not proprietary what i just made yall install brendyyn: nvm its ok. it uses the free version 2 rekado: vidjuheffex: it’s not? *: mwette is hunting ... https://unicode.org/emoji/charts/full-emoji-list.html and emacs/lisp/international/fontset.el rekado: I have no problem visiting http://logs.guix.gnu.org/guile/ vidjuheffex: Welcome to #guile! This channel is logged, see . vidjuheffex: ^thats the chanserv message i get when I log in rekado: oh, I only see the /topic civodul: here we go! https://www.gnu.org/software/guile/news/gnu-guile-302-released.html chrislck: \o/ wingo: wooo :) mwette: Alright! (Was the 38486 fix pushed to the 2.2 branch? That's where it was reported.) dsmith-work: Yey rekado: neat! *: sneek dances *: jonsger provides the update for openSUSE. Let's see when it gets accepted wingo: mwette: you can check :) (yes it was) mwette: wingo: I'm in git hell right now. I checked out only the master branch and can't figure out how to fetch the stable-2.2 branch. Is it "git branch -t stable-2.2 origin/stable-2.2" ? *: civodul provides the update for Guix. Let's see when it gets accepted, too! civodul: :-) jonsger: :P thats unfair mwette: civodul: signed agreement sent via horse-and-buggy civodul: mwette: yay, thank you! dsmith-work: Ah. hasn't hit the mirrors yet. alextee[m]: TIL you can define a function inside a function. scheme is awesome alextee[m]: is there a utility to compare version strings? jackhill: alextee[m]: would https://ngyro.com/software/guile-semver.html be useful for what you're doing? alextee[m]: jackhill: nice, thanks! alextee[m]: hacking on the guix website, trying to make packages that are their latest versions not have a "-{version}" suffix in the URL. so need something like that to compare versions with other packages with the same name alextee[m]: not sure how using libraries works with guile yet though, i'll try to figure it out jackhill: alextee[m]: cool, I knew about it because one of the guix package importers (rust's maybe) uses it. alextee[m]: oh, nice mwette: if a define-module uses #:version then you can get the version with (module-version (resolve-module '(foo bar baz))) mwette: without loading manumanumanu: ArneBab: sure! That would be fun. I am not really sure whether I'm the right guy though. I came from ruby, where a lot of things did not have the same performance characteristics as guile. I ported some code and fixed bottlenecks, and started reading scheme code and then suddenly I understood what was idiomatic and _why_ it was idiomatic. Transducers are a really simple concept once you understand lambdas manumanumanu: returning lambdas. My for loops are like "The macro writer's bill of rights" exemplified, apart from that it doesn't rely on cross-module in-lining (which isn't supported). My guile-vsd uses the same state-machine like parsing of DSV-files as andy's and nalaginrut's guile-csv, but more-like-c since it uses string buffers to make up for the performance impact of the added flexibility. I could write a "lessons manumanumanu: learned" aggregate piece :D manumanumanu: What I haven't written is "real world software". I just write libraries that are fun to write :D alextee[m]: is there a way to return a value from a function immediately inside some nested loop? RhodiumToad: you want to abort the loop? alextee[m]: yeah and return a value alextee[m]: like "ok, i found what i wanted and now i want to return false from this function, just stop everything and return false" alextee[m]: maybe that doesnt work in scheme lol RhodiumToad: there's a bunch of ways to do it RhodiumToad: and I guess which is best may depend on what exactly the function looks like alextee[m]: let me show you my mess :) manumanumanu: please! alextee[m]: https://paste.debian.net/1136985/ alextee[m]: where i do "#f" i basically want to "return false;" manumanumanu: first of all, for-each is not really meant for that stuff manumanumanu: you should probably use a named let loop instead, since they will return whatever the last expression is. manumanumanu: or, you could be lazy and wrap it in (let/ec return ... (return #f)) manumanumanu: but that isn't portable to other schemes, and it will go in your permanent record. RhodiumToad: heh alextee[m]: like this? https://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Iteration.html manumanumanu: exactly. manumanumanu: for-each is one of those things that you rarely see: it is usually reserved for things when all you want is the side effect and where the result of the whole computation is to be discarded. alextee[m]: thanks! gonna give it a spin manumanumanu: but, just so you know: if you want to write imperative-ish code, there is always let/ec. The performance penalty is surprisingly small. Usually you can't even measure it. manumanumanu: anyway, to sleep! alextee[m]: i see, good night o/ mwette: Guile has methods to (return #f) but that's not Scheme. If you're learning Scheme, you need to learn about named let, which is much better: https://www.scheme.com/tspl4/control.html#./control:h4 wingo: heyooo mwette: wingo: What's the next frontier after JIT? RhodiumToad: "JIT, the final frontier..." wingo: hehe wingo: yeah i don't know! i am still irritated that chez scheme is so much faster on a number of µbenchmarks wingo: so there are frontiers there, some that i don't even know what they are wingo: but maybe that's not the most important thing? i am still coasting a bit on 3.0, haven't thought terribly much about the future :P wingo: dunno whether i should pick up some more fundamental racketization plan wingo: or just noodle on incremental improvements. probably incremental things best for guile at this point in its stable cycle mwette: The GC? To me it seems in some applications (e.g., web server) that would be a driver. wingo: so like improving exceptions to mostly be using structured exceptions and key+args being more rare wingo: or improving the syntax expander, maybe making it more capable like racket's scope sets wingo: or adding #lang (someone had a patch for that, was it you?) wingo: but perf-wise i think a generational gc would be quite useful. mwette: It was me on the #lang issue. I did get something working, but probably needs review. mwette: for #lang See #30094. wingo: nice wingo: great wingo: bugs are great, that's a nice mindless list of things to work down mwette: I have worked on-and-off on debugging. I added "-g" flag to compile. The first approach was to remove all other optimization and then hack the cps compiler to not reuse slots. Do you think that is useful? wingo: hard to say tho. i will probably not have day-job time to do guile this year so i can't bite off too much wingo: and i am out of the habit of helping others do good things, perhaps i should make that more of an explicit priority wingo: mwette: neat :) how does it differ from somethign like -O0 ? wingo: i guess it would be the no slot re-use bit mwette: check https://paste.debian.net/1136994/ mwette: My code was not working. I think because the cps expects returns slots to be somewhere special. Am I right? wingo: yes, that and control-flow joins have parallel moves corresponding to the values that predecessors provide to the continuation wingo: those moves are computed based on the slot allocations, so you can't just reallocate slots after the moves are calculated mwette: So then allocate-slots would have to have a hook for #:debug ? vidjuheffex: https://dthompson.us/manuals/chickadee/Kernel.html#Live-Coding <- anyone got some time to help me figure this out? I think this documentation is missing some crucial steps and would love to get this working vidjuheffex: Issue: if I run those two commands in a seperate geiser repl, connecting to guile from geiser says "no repl prompt found" vidjuheffex: for the repl prompt to be found the code in the update definition needs to be running in a loop vidjuheffex: to run the code in the buffer the repl prompt has to be found, catch 22 vidjuheffex: if I add the commands to the my code file instead of a new repl, and call guile main.scm im able to connect (because its running the game loop) but I'm not able to send stuff becuase at that point there is no repl jus an executing script vidjuheffex: I feel like I'm missing something obvious, maybe misusing geiser, or misunderstanding these fairly vague directions.but this one paragraph makes it sound like its dead simple and I'm just dead stupid. mwette: vidjuheffex: I tried testing with: (while #t (lambda () (sleep 1) (poll-coop-repl-server repl))) , then "telnet localhost 37146" from another terminal. It connects, but nothing happens when I type '(display "hello\n")' mwette: wingo: mwette: like it does for slot precoloring, yeah *: wingo zzz, night! vidjuheffex: mwette thanks for taking a look! vidjuheffex: I probably just need to hang tight for another email reply from the author vidjuheffex: I'm just impatient haha mwette: vidjuheffex: did you look here: https://www.gnu.org/software/guile/manual/html_node/Cooperative-REPL-Servers.html#Cooperative-REPL-Servers vidjuheffex: yeah, and thats where i discovered why the poll command has to be executing in a loop for geiser to connect vidjuheffex: things i've tried include, in the repl, running the poll command as geiser is trying to connect vidjuheffex: this works, but I can't send over code, without mashing the poll command vidjuheffex: its like on connect-to-guile I need to also send the entire buffer over and run it vidjuheffex: so that can kick in the loop alextee[m]: if i want to return a filled in list, do i have to pass a list to the function? or can i return a list created inside the function to the outside world? mwette: working for me now, in two terminals mwette: alextee[m]: the latter ; (define (f) (let loop ((l '()) (ix 3)) (if (zero? ix) l (loop (cons ix l) (1- ix))))) alextee[m]: mwette: ah thank you, that looks exactly like what im doing alextee[m]: final working thing: https://paste.debian.net/1137004/ thanks for the help str1ngs: daviid: hello, I'm having a problem with 'gdk-display-get-default when the display is wayland. see http://paste.debian.net/1137005 str1ngs: daviid: with X11 I can use (gi-import "GdkX11"). but I'm not sure what needs to be imported with wayland str1ngs: actually seems kinda odd I would need to import that as well. rekado: alextee[m]: you can use fold instead of a custom loop with set! rekado: (in srfi-1) alextee[m]: rekado: "Apply proc to the elements of lst1 lst2 … to build a result, and return that result. " this sounds like exactly what i want to do, thanks rekado: something to get you started: (fold (lambda (item accumulator) (cons (* item 2) accumulator)) '() '(1 2 3 4)) alextee[m]: awesome! daviid: str1ngs: hello! and hello guilers sneek: Welcome back daviid, you have 2 messages! sneek: daviid, str1ngs says: it seems for language bindings the glib functions/macros g_error g_warning won't work. same with g_log. it looks like g_log_variant should probably work though. does g-golf have enough GVariant support to call 'g-log-variant? if not it's okay this mostly just a request for comment. the documentation for 'g-log-variant. can be found here sneek: daviid, str1ngs says: https://developer.gnome.org/glib/stable/glib-Message-Logging.html#g-log-variant daviid: str1ngs: if you need a GError arg and return the error essage if there ws an error use with-gerror from (g-golf gi utils), examples in (g-golf typelib) and (g-golf gi repository) daviid: there is no support (at all) for GVariant in G-Golf, and I hope I can avoid it all, but not sure yet ... outside the obligation to lead with GError arg, when that applies, as for g-irepository-require, why would you not use scheme for message otput and debugging functions? spk121: dsmith-work: in that tree I definitely removed libltdl from dynl.c but that's just for loading extensions spk121: daviid: there's also g_log_structured_array daviid: spk121: indeed, but I wonder why not keeping all this in scheme 'in the first place' spk121: true str1ngs: daviid: I'm not sure how you can avoid GVariant. I though it was specifically designed to handle conversions for language bindings. str1ngs: thought* daviid: str1ngs: what 'conversions'? daviid: str1ngs: so far none of the examples we're working with needs GVariant, which is not a 'definitive' justficatin of course, but we have needs for GValues, since ther are the signals/callback closure required args, and GIArguments because thats what g-fuction-invoke needs, very unfortunatelly, imo everything should have been made usig GValue(s), but that wwill never happen daviid: str1ngs: i pushed many patches so g-glf does not import info from GLib GObject anymore, unless #:force? - it's a lot cleaner and better, although I can see still a few 'corner cases', this cleaned the 'strange' duplicates warning in th hello-world and gdk-events script examples scottviteri: Hello, is there a way to tell how much memory certain variables are taking up from the scheme shell? daviid: str1ngs: it should not make any diff to you, but please pull/make whenever you have the opportunity, to confirm everything still ok on yourside ... tx scottviteri: When I run my code, htop shows that memory is being eaten. This memory is freed upon restarting the shell. Looking at the ,bindings I do not see any obviously large binding. str1ngs: daviid: I will try to pull in the next couple of days. I've been putting off pulling since I'm kinda busy working on some end user enhancements. str1ngs: daviid re logging I'll just use (logging logger) I guess daviid: str1ngs: I highly recommend to stick to scheme, unless forced not to, and logging is really not a "C thing" - if (logging logger) isn't good enough, we/you can certainly improve it ... daviid: str1ngs: is this the guile-lib package? daviid: I think I have seen other guile-scheme packages doing this, I hope if true, others will mnfest hemselves here, otherwise, ask on guile-user ... str1ngs: daviid: the point of use glib for logging is so I don't have to mix to logggers. but it's not a big deal str1ngs: s/to/two * daviid: why do you use glib in the fris place? can't everything be i scheme in your app? daviid: *irst :) daviid: *first (my kb s old and has many none working keys ... str1ngs: because when you want to debug gtk or glib. you can use G_MESSAGES_DEBUG which effects g_log rbarraud: o/ rekado: hmm, (match #(1 2 3) (#(first ___) first)) does not work even though the manual lists ___ as a valid ellipsis. janneke: rekado: that really puzzeled me when i first started with match *: janneke found match doc next to impossible to read janneke: i should have just asked, at the time :-( rekado: this works: (match (list 1 2 3) ((first rest ___) first)) rekado: and this works too: (match #(1 2 3) (#(first rest ___) first)) janneke: hmm, no something else must have puzzeled me: this works: (match '(1 2 3) ((first ___) first)) janneke: yes, hmm rekado: it matches the whole list rekado: I think that’s expected because “...” or “___” should match zero or more items…? *: rekado is confused civodul: what's ___ supposed to do? janneke: the doc has this: janneke: ooo ::= ... zero or more janneke: | ___ zero or more janneke: | ..1 1 or more janneke: where "ooo" is not used at all -- ah; that defines "ooo", and .../___ are not defined (or only in text) *: janneke mis-took that as a sloppy definition of ... and ___ civodul: ooo, oh oh! janneke: sorry for my years old frustration! civodul: this doc is frustration-prone, i admit :-) civodul: the reference is taken from Shinn's implementation civodul: better than nothing but a bit rough janneke: yes, "please, send a patch" applies brendyyn: civodul: Hi sorry I'm back with a question :) Do you know if it's possible to get the name of an algorithm from its representation like mac-size gets the size, there is no mac-name? civodul: janneke: that's not what i meant :-), but sure scottviteri: (exit) civodul: brendyyn: i think that's currently missing, but would be worth adding civodul: the application probably knows what algorithm it's using, though brendyyn: civodul: Thanks. I wanted to print an error message saying the algorithm chosen didnt support something, but noticed i didn't know how to refer to it civodul: i see civodul: for now you might need to carry the name next to the algorithm janneke: civodul: sorry for trying to put words into your mouth! civodul: heh :-) manumanumanu: civodul: manumanumanu: thanks manumanumanu: i am happy to contribute manumanumanu: Nice to get it off my list as well. manumanumanu: civodul: good news for guile though: the transducer version of (map 1+ (filter odd? lst)) runs a lot faster under guile3. It runs only about 50% faster, compared to almost twice as fast in 2.2. The difference is of course a lot larger when there are more steps, but that isn't surprising. manumanumanu: jesus. Don't read that. I meant that the transducer version of (map 1+ (filter odd? lst)) is only about 50% faster, compared to 100% under 2.2. manumanumanu: and the overhead of (list-transduce (tmap 1+) rcons lst) over (map 1+ lst) is a lot smaller under 3.0 as well :D dsmith-work: {appropriate time} Greetings, Guilers manumanumanu: good morning, dsmith-work manumanumanu: Are there any fuzzers for guile? manumanumanu: I have an old thing I used to fuzz my delimited separated values library, but I am at a point where I either extend it or use something else. brendyyn: I've Implemented HKDF (RFC 5869). https://notabug.org/Brendan/guile-hkdf/src/master/hkdf.scm brendyyn: I was puzzled for a bit about what should be inputs and keys. ArneBab: manumanumanu: you’ve written quite a few high-performance tools for Guile now — any chance that you’d write a short text on optimizing Guile code for with-guise-and-guile? https://www.draketo.de/proj/with-guise-and-guile/ chrislck: alextee[m]: instead of (unless (eq? (length args) 13) ...) you can actually insert a second MATCH clause with (_ (display "Need 12 arguments") ..etc..) where _ is the 'anything else' match clause chrislck: next, now that (main . args) now only does (match args ...), you can now (define main (match-lambda ((this output-file ...)) (_ (display "error"))) thereby can eliminate args rekado_: alextee[m]: instead of reading character by character you could use (dump-port source target) to put everything from the source port (an opened file port) to the target port (e.g. an output file) edoput: good morning, is there any guidance on how to do FFI with guile from the community? I've read about SMOB, new foreign types, snarfing macros and finally the dynamic FFI and I'm lost now. It would really help if I could know which approach is useful when, e.g. I guess I should define new types when I want to manipulate them as scheme values but is then required to always add the C layer when I can do dynamic edoput: FFI? edoput: the dynamic FFI does not expose C structs as scheme values right? I would still need to do this bindings myself? alextee[m]: rekado_: oh nice! thanks alextee[m]: chrislck: i'll try that, thanks chrislck: alextee[m]: finally, as much as I love match, I think you can use case-lambda instead, which removes the need to import ice-9 match chrislck: lisp is the epitome of TIMTOWTDI alextee[m]: chrislck: can you show me an example/docs? alextee[m]: oh found it in the guile manual brendyyn: civodul: with (gcrypt mac), is there way to conveniently specify algorithm and get it's length. mac-algorithm just takes an unquoted symbol and returns the id number for it. lookup-mac-algorithm appears to be the same except you give it a quoted symbol. mac-size can't take either and must actually receive the id number, so you must do something like (mac-size (lookup-mac-algorithm 'hmac-sha256)). brendyyn: As a user of the module I'd just like to specify the hash, and get the size of. going via this internal gcrypt number is breaking the abstraction layer it seems. i cant do (mac-size 'hmac-sha256) civodul: on the contrary! :-) civodul: the "number" is actually an opaque object representing a hash algorithm civodul: it turns out to not be so opaque, i admit brendyyn: apaque like mud. civodul: like water, rather brendyyn: that's not opaque... civodul: that's my point :-) brendyyn: i mean, on a serious note, do you think thats how it should be? civodul: yes civodul: ideally with a disjoint type for hash algorithms brendyyn: what's the difference between mac-algorithm and lookup-math-algorithm? civodul: try: ,expand (mac-algorithm hmac-sha256) civodul: it's a macro-expansion-time lookup civodul: with an expansion-time error if you pass an incorrect name brendyyn: I have almost finished implementing HKDF (RFC 5869) civodul: conversely, lookup-mac-algorithm is a run-time thing brendyyn: ok but why should those two different things exist? *: civodul looks it up brendyyn: I'm implementing SPAKE2. it's what Magic Wormhole uses. i plan to implement the whole thing in guile. You can lookup that on youtube brendyyn: I've never written a macro before, and have only really experienced the fact that they make things confusing and obscure errors. civodul: you seem very positive today :-) brendyyn: im super positive civodul: there's some truth regarding obscure errors, it's a known issue brendyyn: im just trying to get to understand things. My simple brain says (mac-algorithm hmac-sha256) and (mac-size hmac-sha256) seem perfectly logical and provide the module user with what they want? civodul: mac-size takes a "hash algorithm" civodul: a "hash algorithm" is something returned by mac-algorithm or lookup-mac-algorithm civodul: a symbol is not a "hash algorithm" civodul: that's the way to look at it brendyyn: it makes sense civodul: "(guile-gcrypt) Message Authentication Codes" mentions it but it needs to be expanded brendyyn: ok thanks brendyyn: civodul: Oh I just realised I'm an idiot. after the algorithm is provided, it'll probably be called brendyyn: algorithm in the function, so you then just run (mac-size algorithm) brendyyn: that makes a lot more sense dsmith-work: {appropriate time} Greetings, Guilers str1ngs: sneek: later tell daviid. it seems for language bindings the glib functions/macros g_error g_warning won't work. same with g_log. it looks like g_log_variant should probably work though. does g-golf have enough GVariant support to call 'g-log-variant? if not it's okay this mostly just a request for comment. the documentation for 'g-log-variant. can be found here str1ngs: https://developer.gnome.org/glib/stable/glib-Message-Logging.html#g-log-variant sneek: Got it. str1ngs: sneek: later tell daviid. https://developer.gnome.org/glib/stable/glib-Message-Logging.html#g-log-variant sneek: Got it. dsmith-work: goodbot dsmith-work: Is Mike Gran in here? dsmith-work: spk121: Hey hey. dsmith-work: spk121: Just built guile with the gmodule branch. dsmith-work: spk121: I think the guile executable is still using libtool instead. *: civodul applies the (srfi srfi-171) patch civodul: thanks, manumanumanu! :-) lfam: How can I make Guile not abbreviate backtraces? apteryx: lfam: there's supposed to be a COLUMN environment variable taken into account, but I haven't been able to make it work. apteryx: Perhaps because on Guix most Guile code is run by the daemon so you have to inject this variable into the daemon's environment (service). spk121: apteryx: it is "COLUMNS", not COLUMN lfam: apteryx: I have set COLUMNS=9999 in the systemd service file but it doesn't have any effect :/ lfam: I figured out the problem I was having. I don't need to read the backtrace anymore. But I wish I knew how to view it when I need to lfam: It's possible that it gets reset by Guix somehow lfam: I see that it gets set to 200 in (guix self) rekado: alextee[m]: instead of (when (not …) …) you can use (unless …) alextee[m]: omg this language is great rekado: alextee[m]: you also don’t need the begin on line 119 because that’s implicitly provided by “when” rekado: same two points on lines 124 and 125 alextee[m]: rekado: nice, thanks! just fixed that rekado: if you want to improve option handling somewhat (it may not be worth it for a short script like this) you can take a look at srfi-37 args-fold rekado: if you want to go super fancy you could even use https://gitlab.com/a-sassmannshausen/guile-config rekado: but I think your script looks fine rekado: it’s a great first program! alextee[m]: thanks! i'll use those anyway just so i have them there for future reference rekado: I haven’t used guile-config myself yet, but I always wanted to give it a try. alextee[m]: it looks really useful for an actual program with --help and --version and all that rekado: yes, and I think the declaration looks nicer than the somewhat cryptic way srfi-37 options are declared. chrislck: alextee[m]: now is a good time to learn emacs which will multiply your .scm productivity :) wleslie: it's a good time to binge zamansky alextee[m]: i prefer vim lol, sorry (pray for me) chrislck: you have our condolences chrislck: it's been nice hugo: Did my message about him and emacs get delivered? I seem to have some problems with my irc app wleslie: not that I saw wleslie: just myself, chris, and alex wleslie: also (begin) and (ice-9 rdelim) alextee[m]: hugo: nope brendyyn: how can i append bytevectors? civodul: there's no standard bytevector-append, alas brendyyn: does that alas mean you think there should be? civodul: yeah brendyyn: ok well i thought there might be a Good Reason for it. How can I define that procedure then? brendyyn: do i have to just make-vector a new one, and measure all their lengths etc...? *: brendyyn notes Racket has vector-append mwette: create bv3 with size(bv1)+size(bv2), then use bytevector-copy! civodul: yeah brendyyn: Python just uses + brendyyn: I'm translating some python code into guile. I've never written python though. it's an interesting experience. civodul: you could define a GOOPS method if you want to use + for everything :-) civodul: i would not recommend it, though brendyyn: probably not a good idea spk121: I wonder how hard it would be to extract g_module from GLib to replace libltdl? I find libltdl's error message uninformative, but, unfortunately libtool is effectively unmaintained wingo: spk121: i would dearly love to kill our ltdl dep wingo: i gave it a look at one point but it was gnarlier than expected civodul: does macOS have dlopen now? mwette: civodul: yes mwette: civodul: at least dynamic-link works on my guile on macOS; let me check lower level spk121: civodul: google says there is a macos man page for dlopen() spk121: brendyyn: the README for guile-gi should now be closer to correct for Guix brendyyn: spk121: Thank you kindly. mwette: verified on 10.14.6, program using only /usr/bin/gcc, and dlopen("/path/to/lib", RTLD_NOW) civodul: spk121: ok spk121: gnulib's dlopen would get your everything common except mingw & native windows brendyyn: bytevector-append https://paste.debian.net/1136350/ spk121: brendyyn: nice. works for me brendyyn: spk121: do you think my implementation is good? brendyyn: $_$ bye chrislck: the (begin) is redundant brendyyn: right. i had an if there before brendyyn: for bytevector-copy!, eldoc is only showing the first 3 arguments in the modeline bricewge: Hello bricewge: Can get-bytevector-n! block? civodul: bricewge: i think so bricewge: civodul: Are there any non blocking procedure to get bytevector? I can't manage to find one. civodul: bricewge: not as such, but see "suspendable ports" bricewge: Thanks, I'm reading it. mwette: bricewge: maybe (ice-9 futures) can help mwette: oops, missed the context -- nevermind wingo: mooooo mwette: alextee[m]: my fav book is this: https://www.scheme.com/tspl4/ alextee[m]: mwette: thanks mwette: named-let is the coolest thing ever *: alextee[m] is trying to figure out why his hello world example says auto-compilation failed hugo: alextee[m]: I can give you some pointers if you want alextee[m]: hugo: yes, please! this is what i'm getting when i run the example program https://paste.debian.net/1136055/ hugo: That's a weird problem hugo: Guile usually places it's auto-complied files under ~/.cache/guile/ccache/ hugo: Check if you have write access there alextee[m]: https://paste.debian.net/1136056/ here's the script alextee[m]: it's owned by root for some reason hugo: The code in itself looks good. Are you sure that the coding: utf-8 can be in the shebang-lines? hugo: But it being owned by root would be the problem alextee[m]: hugo: worked now! thanks hugo: Hurray! alextee[m]: im not sure about the coding: utf-8, it said in the manual it had to be in the first 5 lines so i assumed that's where it goes. i guess i should put it in a comment after the !# hugo: When I bother placing it's in a commend below the !# hugo: However, usually I don't bother. UTF-8 is enough of a standard to be able to do that alextee[m]: oh i'll omit it then. i thought it was needed but probably not hugo: Might be a problem on windows hugo: But everything is a problem on windows alextee[m]: that's true lol alextee[m]: well, i just read a file and wrote to another file \o/ snowball from here hugo: Check out with-input-from-file and with-output-to-file if you haven't already. default input and output to a given file *: alextee[m] looks for examples hugo: https://git.hornquist.se/calparse/tree/module/output/html.scm#n416 hugo: Maybe not the best example, but it's the one I have in front of me hugo: Whenever i run display or similar inside html-generate without a specified port it gets written to fname mwette: alextee[m]: suggest in your example you use (main . args) and add an expression at the end: (apply main (program-arguments)) alextee[m]: ah so it's basically a shorthand for call-with-output-file, except you dont need to specify the output port? alextee[m]: (when printing) hugo: Yes. It's just a simple wrapper alextee[m]: mwette: what does (main . args) do ? hugo: Wait, it's not a simple wrapper, since it modifies state mwette: you get args as a list of the arguments so if I call (main "A" "B" "C") you get args defined as (list "A" "B" "C") mwette: (program-arguments) is a procedure that returns the command line arguments) mwette: if (program-arguments) returns ("A" "B" "C") then (apply main (program-arguments)) runs main with those args: (main "A" "B" "C") mwette: (a . b) is notation for a pair (cons a b). A list ("A" "B" "C") is shorthand for (cons "A" (cons "B" (cons "C" . '()))) mwette: where '() is "end of list" hugo: mwette: '() is the empty list, and a list is defined as either the empty list, or a pair which contains a list in it's cdr slot. alextee[m]: https://paste.debian.net/1136060/ alextee[m]: mwette: like this? it seems to run the program twice now mwette: right, take out the "-e main" alextee[m]: oh, nice mwette: another way would be to use "-e run-main" and (define (run-main) (apply main (program-arguments))) mwette: like "def main(args): ..." in python, you still need to execute main and pass the args alextee[m]: i guess this is useful when you have more than 1 functions you want to be able to call from outside the file hugo: I would recommend using `-e function' for the same reason you use `__name__ == "__main__"' in python *: alextee[m] doesn't know what that does in python hugo: __name__ == "__main__" checks if the file was loaded as a script (instead of as an library). Allows one file to do double duty as both program and library alextee[m]: ah i see. so it's probably better practice to use -e run-main alextee[m]: well, i'll skip that for now, i only intend to use this as a standalone program mwette: yeah, just get something running and start learning alextee[m]: 👍 daviid: str1ngs, spk121: I am thinking to change the gtype-id slot, init-kw and acc to g-type, #:g-type and !g-type wdyt? mwette: anyone know what font in x11 I get for the thumbs-up? It shows up as garbage here daviid: str1ngs: don't shoot at me :), but i'm also thinking to change accessors (which are actually methods in this particular case) for !button, !click-count, !coords ... instead of the 'old' (guile-gnome inspired) names, gdk-event:buttton ... which would be quite a lot more 'consistent' with the rest of G-Golf ... wdyt? str1ngs: daviid: not a problem with me I have not had a chance to port to the new accesses yet :). I got busy fixing nomad bugs :) str1ngs: accessors* daviid: ok, I'm gona do it daviid: let yu know ... str1ngs: sounds good spk121: daviid: could be fine for slot, init-kw. is exclamation-point + type used elsewhere in g-golf for accessors? daviid: spk121: everywhere, for reasons described here - https://www.gnu.org/software/g-golf/manual/html_node/GOOPS-Notes-and-Conventions.html#GOOPS-Notes-and-Conventions - Accessors Naming Convention spk121: cool. it is sad that both modern day keyboards and Scheme the language are so conservative with regards to punctuation and sigils. If only there were frustrated APL programmers in the scheme world. haha daviid: :):) and by everywhere, it also means all imported GObject subclass properties, all have a slot, init-kw and accessor respecting this convention daviid: like, just to give 1 example, (!background-color (make )) -| (0 0 0 0) spk121: makes sense jcowan: Languages are conservative because the keyboards are. jcowan: The SRFI for immutable texts proposes (double) guillemets for literals, but that's not required for conformance. When everything else in R7RS-large is finished (Deo volente) there will be a docket for voting on lexical-syntax proposals. spk121: Maybe your accessors should use left arrow, ;-) ↤g-golf daviid: spk121: I did think quite a long time about all this (several years), looking for a 'better' character, but because accessors may be used to mutate the sot value, it si an ascii char, very 'visible', very easy o 'identify' ... I always came back to use ! spk121: daviid: fair. Unless you are writing for personal use, you need to stick to the common denominator characters daviid: spk121: also, because/thanks to the MOP, you and users may change that if they wish to, but I must tell you that I have been quite pleased with that convention (and its character) daviid: left arrow, by convntion, to me, would mean to reverse of a transformation, that would not be good in the context, imo daviid: i thougut about @, but to texi, urli, and does not 'trigger' a schemer 'danger signal for the mutability daviid: which we can not avoid (only if using libguile, whch I don't want to in G-Golf) daviid: str1ngs: I ushed the announced change about accessors, here is an updated version of the related example - http://paste.debian.net/1136081/ - this is looks quite a lot 'cleaner' imo daviid: str1ngs: is this nomad bug g-golf related maybe? wheeler: Does anyone know if the *substitute function is regex or verbatim? I'd like to replace a line in the configure phase beginning with "plugindir=" for example. str1ngs: daviid: bug's what not the best choice of works. more like user requested enhancments str1ngs: was not* daviid: str1ngs: ok str1ngs: daviid: if your plate is clear, I have some backlog stuff you can look at if you want? lol daviid: str1ngs: hum :):), i really want to fix the 'mutiple' import problem first, then gi-arguments bugs and missing types str1ngs: daviid: anything in here are workarounds for g-golf http://git.savannah.nongnu.org/cgit/nomad.git/tree/typelib/util.h?h=feature-windows#n27 str1ngs: though some might be fixed now. I can go through them and double check if you want str1ngs: nomad_app_send_message is fixed you can ignore that I think. daviid: str1ngs: i'm not going to look at these now daviid: because the above is by far more urgent, as it is, one can not write a simple gtk app str1ngs: okay that's why I've left these on the back burner. let me know when your plate is not as full daviid: *that would use a trevview and/or a list sore ... daviid: ot: a few years ago, someone here pointed to a vpn h/w equiment, i kind of thn i remember the name was 'cube' or something like that, and the (free h/w somehow) company was, iirc, in belgium, anyone knows/remember and could give me a link? spk121: daviid: before importing stuff from goops from multiple modules, you can ask GOOPS to merge all the generics by using "(default-duplicate-binding-handler (cons 'merge-generics (default-duplicate-binding-handler)))" spk121: that's a procedure from (oop goops) daviid: spk121: this is not sufficient daviid: you need to do this per module daviid: trust me :) and this gives terrible heinsenbugs daviid: spk121: i've add ned less conversations with andy about this, and he didn't accept to keep the previous behavior, guile-2.0 was doing what you think is 'owrking', but it fails - guile 2.2 nd 3.0 must see the declareation on a per module basis, and in the repl, to actually implement correctly the expeted behavior daviid: tought i think it is a design mistake, that 's what it is, 2.2 and a later do not take the single call 'in consideration' daviid: spk121: also, connect is a guile core procedure, be carefull, and if you wish, look at wha does g-golf for it ... i copied from guile-gnome ... daviid: spk121: when things work, the warning should not appear - if a user report such a warning, the generics were not merged chrislck: fun: (= +inf.0 +inf.0) -> #t chrislck: some mathematicians would have a seizure RhodiumToad: why would +inf not be equal to itself? abcd: I guess because there can be infinities of different magnitudes RhodiumToad: maybe so, but +inf represents only one of them abcd: or a non-specified representative of the set of them RhodiumToad: anyway, it is usual in floating-point work for infinities to be equal, the only value not equal to itself is NaN bricewge: Hello RhodiumToad: good morning bricewge: Is there a function like for-each but that fail when proc return #f bricewge: ? wingo: moo wingo: bricewge: and-map bricewge: wingo: Thanks. I already used it but I forgot about it... bricewge: Strangely I can't find it in the manual https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html#Procedure-Index_fn_letter-A RhodiumToad: it is indeed not documented chrislck: RhodiumToad: I'm just being facetious :P chrislck: https://www.quora.com/Is-infinity-equal-to-infinity chrislck: next, I'll expect guile to do differential equations and fluid dynamics just by manipulating symbols :P chrislck: (hmm maybe the macro system is turing complete and can actually do it?) RhodiumToad: those answers are pretty crap, frankly chrislck: i'm sure someone will explain why (number? +inf.0) is #t chrislck: (because the spec say so!) luni: i would to ask a question about the maximum dimension of a vector i could use in Guile. I notice than when the i try to use a vector with the maximum size that exceeds #e1e7 i have that the requested amount can't be allocated in the heap. How to circumvent / solve this issue? Thanks in advance RhodiumToad: what do you want to store in your vector? luni: non integer numbers luni: this is because i'm trying to use the finite difference method for a simple fluid cavity problem and in my simple implementation i still have to store the full vector using iterative technique to advance in time RhodiumToad: floats? of what precision? luni: maybe few decimal digits would be enough RhodiumToad: you probably want to use a uniform numeric array rather than a vector luni: but there is any difference between a vector and an array if not in the number of dimensions? RhodiumToad: the difference is using a uniform numeric vector rather than a plain vector luni: so what i have to do to use a uniform numeric array? ... now i'm looking at the documentation (6.6.13 Arrays) ... is this what i have to use? luni: i don't realize the difference between a uniform numeric vector and a plain vector to be honest... lloda: a plain vector can have anything in it lloda: #(a 1.3 (a list of symbols)) lloda: a uniform numeric vector can only have numbers of the particular type RhodiumToad: luni: in addition to the arrays part, see also srfi-4 lloda: and it's a memory fixed format, so you can pass it to C etc with just a pointer luni: ok... thank you a lot for the help lloda: tbh if you won't care about passing the numbers to and from C a plain vector works just as well RhodiumToad: from the point of view of memory usage? luni: anyway even using uniform numeric arrays [e.g. (make-u8vector upper-limit)] the upper limit is the same that when i used (make-vector upper-limit 0). My question was about what to do to increase the upper limit luni: basically maybe i have to see how to extend the heap size ... but i don't know for sure so for that reason i was asking information about peanutbutterandc: Hey there! peanutbutterandc: Do we have any haunt-hackers here? (the static site generator written in guile) jonsger: peanutbutterandc: what is your problem? peanutbutterandc: jonsger, I am trying to deploy a dummy haunt site using gitlab: https://gitlab.com/peanutbutterandcrackers/hello-haunt peanutbutterandc: But all the links to posts throw a 404: https://peanutbutterandcrackers.gitlab.io/hello-haunt/ peanutbutterandc: I was wondering if there is a clean solution to that issue somewhere. I can see that if I set #:prefix "hello-haunt" to builders and then move the index.html out from hello-haunt directory to the one above it, the problem might be solved. But that's quite ugly. And I was wondering if there was a clean solution to it daviid: luni: fwiw, I se on #scheme that you are doing matrix stuff using vectors, you might be interested to look at guile-cv - https://www.gnu.org/software/guile-cv/ - which does that (the manual is available online, with a procedure index ... code available o savannah - ll on the website) - I never come to the upper-limit you refer, although manipulating hude images daviid: daviid: luni: for performance reasons, most of the 'expensive procedures' are written in C luni: thank you daviid peanutbutterandc: jonsger, any ideas, please? jonsger: not really. I'm also starting to learn haunt and not an expert of guile daviid: luni: np! peanutbutterandc: jonsger, I see. Well, we're two peas in the same pod for now, then. :) Happy hacking with guile! peanutbutterandc: daviid, You do not happen to be Mr. David Thompson, do you? daviid: peanutbutterandc: no peanutbutterandc: daviid, I see. I was wondering if we were talking about haunt in front of the creator of haunt itself. :) peanutbutterandc: Do you might have any ideas regarding the matter, perchance? daviid: peanutbutterandc: no, i don't use haunt, though i should, all my website use custom sxml static generators as well, never had tme to port to haunt, which would be better peanutbutterandc: daviid, I see. During this time, I realize that guix and guile's websites are powered by haunt. So that is super cool. I have also found something that compiles s-expressions (in guile) to JS. But have forgotten it's name. daviid: luni: welcome! if you happen to give it a try, highly recommened to read the 'Configuring Guile for Guile-CV' and 'Image Structure and Accessors' sections of the manual, then you good to try and have little fun, hopefully, it can be used even by none advanced schemers, includig beginners (just guile's config s a bit 'scary', unfortuately, but if you follow the steps i the manual, even 'blindingly', you'll be good ... daviid: daviid: daviid: sneek: how about you copy my last message to luni and keep it till they appear, then deliver nicely, ca yu do that for me? :) daviid: peanutbutterandc: I'll other answer the JS related qiz, I know nothing about JS civodul: sometimes in statprof/gcprof, the "cumulative seconds" column is completely crazy civodul: like some procedures have a figure 100x the total execution time *: jonsger submitted Guile 3.0.1 to openSUSE :) civodul: woohoo! jonsger: it's the first of 3.0 branch. So it will be a bigger migration... jonsger: I could done that earlier but I waited for Guix 1.1.0 :P civodul: heheh *: daviid hopes that maintainers will look at and integrate what ever they feel best for what is in the wip-exception-truncate branch, for 3.0.2 wingo: civodul: that's because each activation on the stack counts wingo: gprof does the same fwiw alextee[m]: is there an easy way to get the nth element from a list other than using the car/cdr stuff? alextee[m]: built-in way* brendyyn: alextee[m]: list-ref alextee[m]: brendyyn: thanks bjoli: ArneBab: too late for me. A guy that visited me yesterday called me today and said he woke up with dry coughs and fever. I'm working from home anyway, but it is not like I am looking forward to a 3 week isolation with my 3 year old. bjoli: alextee[m]: just so you know, list-ref is O(N). If you find yourself doing a lot ot list-refs, you should probably switch to using vectors instead of lists alextee[m]: ah i see. well i dont care about performance for this. i'm just trying to store each argument in a variable alextee[m]: i am doing this btw: (let* ((myarg1 (list-ref args 1)) (myarg2 (list-ref args 2)) ... ) alextee[m]: there's probably a shorthand for it somewhere peanutbutterandc: Is there any haunt user here currently? bjoli: alextee[m]: (ice-9 match) is the module you are looking for. That way you can do destructuring of a list manumanumanu: alextee[m]: https://www.gnu.org/software/guile/manual/html_node/Pattern-Matching.html manumanumanu: (match args ((arg1 arg2 arg3) code here)) alextee[m]: manumanumanu: nice, thanks! manumanumanu: alextee[m]: I have been thinking about porting the racket pattern matcher, since it produces better code than the guile one for some cases. That code is intense though, so I'm not really sure I could :P manumanumanu: it is under a MIT or apache license (you may chose), which is sublicenseable hugo: manumanumanu: Might take a look at the racket pattern matcher then. hugo: In my current project I extended let* with my own simple pattern matcher manumanumanu: hugo: you are the kind of guy that could actually manage :D manumanumanu: there is a great video about the compilation process it has (yes, it is a macro, but it is more like a compiler) manumanumanu: hugo: https://www.youtube.com/watch?v=IikGK8XP5_Q alextee[m]: i noticed that i could use format without including use-modules (ice-9 format)). is that not needed? hugo: I will check it out when I have a bit of time! civodul: wingo: hmm ok hugo: I took a quick look at the source, and it already has started to look a bit scary https://github.com/racket/racket/tree/5bb837661c12a9752c6a99f952c0e1b267645b33/racket/collects/racket/match manumanumanu: the benefits of the compilation is mostly for clauses like ((list a b 3) ...) ((list 1 b 3) ...) which will be a lot faster with the racket matcher for more complex patterns hugo: alextee[m]: (ice-9 format) is included in the default repl module list. It is however not included in complied code, but a weaker version of ice-9 format is included there. wingo: civodul: kcachegrind also has something similar fwiw hugo: In short, include it if you plan to use it wingo: there is a checkbox for whether to count cycles or not hugo: manumanumanu: match being more or less a compiler isn't that suprising. Isn't most of compilation just reducing the syntax tree through pattern mathes? alextee[m]: hugo: ah i see manumanumanu: much of the complexity comes from: being racket (ie: having to work across languages (including typed racket) and working with the racket internals) manumanumanu: hugo: there is a very nice optimizer manumanumanu: as well hugo: I really need to read up on this. How does the racket internals compare to guile's? hugo: (Guile is the only scheme I have looked at in depth) manumanumanu: it will do racket's counter-part of syntax-local-binding to be able to inspect manumanumanu: what something will be at runtime wingo: manumanumanu: fwiw there is a lot of optimization left to do for match-like patterns in guile manumanumanu: the coolest things it brings is of course being user expandable. That could be implemented without much of the fanciness of the racket pattern matcher in general wingo: that is independent of code generation wingo: i.e. guile could do a better job without changing match macro implementatin manumanumanu: wingo: yup, but I really think implementing optimizing the conditional branches of (a b 3) (1 b 2) is easier to do in the pattern matching. It would be nice to have it in the compiler, which would make it general, but it is a rather special case. manumanumanu: wingo: what would be nice with a new pattern matcher is that it could be made user-extensible. wingo: is it? seems to fall under "macro writer's bill of rights" to me wingo: dunno manumanumanu: I love that talk as well :D wingo: yes agreed, there are other reasons to change pattern matcher implementation :) hugo: wingo: What are the macro writer's bill of rights? manumanumanu: a talk by kent dybvid manumanumanu: g manumanumanu: dybvig manumanumanu: you can find it on youtube mwette: wingo: If you have a few minutes, I tracked down bug #38486, compile does not terminate, to named-let in compute-significant-bits in cps/specialize-numbers.scm. This case works in 3.0.1. hugo: https://www.youtube.com/watch?v=LIEX3tUliHw mwette: I'm not sure I'd be good at going down further. Any hints? mwette: wingo: bug #38486 is reproducable in 2.2.7 wingo: interesting wingo: i wonder why it's not a bug in 3.0 manumanumanu: wingo: the talk on racket's insides (by samth) on the pattern matcher explains what kind of optimizations the racket pattern matcher does. I suspect I am too dumb to implement something like it, though :D wingo: mwette: you have nerdsniped me :P mwette: lol alextee[m]: is there a way to have named arguments when formatting strings? alextee[m]: like i want to replace all ~a's with the same string, and also i don't know how many ~a's there will be alextee[m]: quick look here doesn't show anything resembling that https://www.gnu.org/software/guile/manual/html_node/Formatted-Output.html wingo: mwette: fixed :) mwette: sweet manumanumanu: civodul: I will submit a fixed patch for adding SRFI-171 later tonight with most of your feedback fixed (and good reasons for not fixing one thing). Trying to compile against it now. If that works, there is a patch coming your way. civodul: manumanumanu: awesome! manumanumanu: This is my first non-trivial addition to an OSS project that isn't my own, so I am just happy that you took your time to review the patches. :D manumanumanu: transducers are great, and I think it complements john's generator srfi's with a nice, eager construct. manumanumanu: The hardest part of this whole srfi thingie has been the english. I am happy for Arthur's history as a copywriter, since he cleaned up a lot of stupid mistakes. dsmith-work: Hey Hi Howdy, Guilers manumanumanu: good morning, dsmith-work manumanumanu: civodul: regarding the question about #:declarative #t. Are the modules declarative by default? I thought I had to add it myself civodul: manumanumanu: they're declarative by default at -O2 and above, if i'm not mistaken manumanumanu: thanks. manumanumanu: that makes sense. alextee[m]: my first guile program is ready! i use this to generate a manifest.ttl as part of my build https://git.zrythm.org/cgit/zplugins/tree/plugins/manifest_gen.scm alextee[m]: probably very badly written scheme/guile :D civodul: alextee[m]: not bad! :-) civodul: instead of (eq? x #t), you can just write x alextee[m]: oh! thanks hugo: alextee[m]: Good work! Some notes: I assume your cons on line 119 is to allow two statements inside the true-clause of the if. Instead use begin, which is made for that exact grouping (or in this case just use when instead of if, since you lack an else-clause). hugo: Also take a look at (ice-9 rdelim), which contains more advanced IO operations (so you don't have to reimplement cat yourself). alextee[m]: hugo: thank you! i was searching for something like "when", that's what i wanted alextee[m]: i'll look into rdelim, there's got to be an easier way of cat'ing a file stis: heya guilers! str1ngs: hello stis mwette: civodul: I have another one for you: #21076: make dynamic-link work if you give it the exact name. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21076. I did resend the cr agreement form for this and the tmpnam one. civodul: mwette: thanks! civodul: actually there was a similar patch by someone else right before civodul: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21076#14 daviid: mwette: just a curious/learning quiz of mine: reading your email wrt enable_tmpnam, I see in the test - if test "$enable_tmpnam" = yes - you have spaces 'around' the = sign, and I sort of remember I did read somewhere that this was 'incorrect', in shell expressions, i wonder if i miss remember or miss red, wdyt? mwette: daviid: I will chedk RhodiumToad: no, the spaces are required in shell test expressions RhodiumToad: test a = b # the "a", "=" and "b" are all separate arguments to the "test" command daviid: ok tx mwette: yea. The man page for test indicates spaces. Some posts have quotes around yes (i.e., "yes") but I can't believe that is required. RhodiumToad: it's not RhodiumToad: if there are no expansions of any kind in a word, it doesn't need quoting (but it does no harm) mwette: civodul: I see it the prev patch on #21076. I have no pref on which you take. rlb: From within say syntax-case, is there a way to find out which module a given top-level binding came from, i.e. to find out that for say (some-syntax reduce), reduce actually came from (srfi srfi-1)? wxie: Hi, is geiser not needed anymore? wxie: Emacs is asking for deleting geiser package. mwette: hmm... which version of emacs wxie: GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2019-09-23, modified by Debian mwette: I'm on 25.2. nothing signficant in release notes https://www.gnu.org/savannah-checkouts/gnu/emacs/news/NEWS.26.1 rlb: Hmm, (module-import-interface (... (syntax-module #'x)) (syntax->datum #'x)) might be in the general direction of what I wanted, depending on the details... chrislck: o/ (<---2.0m--->) luni: Hi all... i'm in troubles using modules. I have a module defined in a .scm file but when do in the repl (use-modules (my-module)) or ,reload my-module looks like the updates made in the .scm file are not considered at all. Any kind advice to solve? Thank you in advance lloda: luni does the (use-modules (my-module)) work the first time? or is it just the reload that doesn't do anything? luni: yes...it works. lloda: if a module is already loaded then (use-modules ...) won't do anything, this is normal. luni: anyway if i modify a function no problem even after ,reload my-module .... but with macros i'm having difficulty since updates are not considered lloda: however ,reload should work lloda: ah macros :-| luni: yes... what i have to do? lloda: difficult question lloda: I'd put the macros in a different module so you can ,reload the rest independently lloda: you may need strategic use of (eval-when (load compile eval) macro-def) lloda: worst case restart Guile :-/ Zelphir: The hammer method for times when not using the REPL and calling guile from command line is using the `--fresh-auto-compile` flag. Zelphir: Not sure what that maps to when using REPL. hugo: Hi! Does anyone have some good examples of how to handle user config in a program. Similar to init.el for emacs. hugo: Currently in my main I do a prmitive-load on a config.scm, along with a module filled with parameters which the user can override. But it doesn't feel that solid rlb: hugo: not sure which kind of solid you're more concerned about, but if you're worried about some flavors of safety, there's (ice-9 sandbox) and friends. rlb: (Or I suppose even just a #:pure module where you add back in just the functions you need.) hugo: rlb: I'm mostly concerned about program scaleability, and the ease of having a ton of config options hugo: Since it's up to the user to actually run the code I'm not concerned about runtime safety rlb: Depending on your needs, in clojure, nested maps/sets/lists/vectors are common for config values, and are assisted by get-in, assoc-in (assoc there is the opposite of scheme's), and destructuring. You could arrange something similar for guile if that were part of your issue (even if just via nested lists, etc., assisted perhaps by (ice-9 match). rlb: But not sure that's the kind of concern you're contemplating. mwette: civodul: sent "git format-patch" version to #29001 hugo: Do you mean that the user provides some form of struct close to everything? hugo: I think I want something close to how emacs init.el work. Where almost any code can easily add configuration options, and the user can setq on a whole bunch of values rlb: maybe, or just by having "chunkier" (more complex) config values, you might be able to simplify the set of functions you need to provide, or... rlb: (if that were anything you were concerned about, but it sounds like that's not a concern) abcd: hugo: I am trying to do a similar thing, but I am very new to guile so it is taking me a while to figure out everything hugo: abcd: Have you made any progress? abcd: my idea is a bit different than yours, I would like to use guile to parse the CLI and parse a configuration file from the user that is in JSON abcd: since I do not trust the user I can check if the JSON is properly formatted with guile abcd: but I am not loading a scm file hugo: It's still the problem of exposing the right set of options hugo: I would recommend to not use json for configuration files. It's teadius and error prone for humans to write, and it doesn't support comments! abcd: I am wondering why would you need a full configuration script instead of a file with some configuration parameters rlb: abcd: if you're not set on JSON (or receiving it from somewhere else), I tend to prefer sexps for config files, i.e. just use read/write or similar. hugo: A full scripting language for configuration allows infinite extensions. I keep pointing towards emacs, and for a good reason. Configurations and plugins are the same thing rlb: (particularly if it's a schemeish audience) abcd: we have been using JSON for some years now, I think my users would be really pissed off if I change rlb: ahh, no of course then :) abcd: besides the users come from a C/C++ background so they would be even more pissed of from a scheme syntax (I think) hugo: A good reason for keeping JSON support. I would however still recommend adding sexp support alongside the json rlb: My personal favorite right now is edn, but I'd need to write us a parser first :) https://github.com/edn-format/edn (May eventually...) abcd: at the time I chose JSON because it is ubiquitous and the syntax is not that bad abcd: and it is very practical to ship it over sockets abcd: the lack of comments is still the most annoying part rlb: ...there's HOCON, which adds that, but also a bunch of other stuff... https://github.com/lightbend/config/blob/master/HOCON.md abcd: we sorta solved it adding fields that are not significant for the parser, i.e. {"note": "this is a comment"} rlb: (specified as a "json superset" I think) abcd: I will look into it, thanks! abcd: there are some JSON parsers that would allow comments, though rlb: Of course you could also just define your own comment syntax and then have a pre-parser that strips them out, but that's potentially messy, depending on how careful you want it to be i.e. effectivelly grepping out all lines that start with whitespace followed by #... is not very pretty :) (And of course doesn't work if you don't control all the consumers. civodul: mwette: great; pushed, thank you! rlb: Yeah. I'd imagine it's a common extension. hugo: I would recommend /* block comments */ over newline-ended comments for json. Since it's much safer when minifying the json abcd: that makes sense abcd: going back to the initial topic, I managed to embed the guile script in the source of my C program abcd: I pass to the guile script the argc and argv values and I do the parsing in there abcd: if the config file is specified I read it with a JSON parser abcd: it is actually straight forward the implementation of this, now that I figured it out abcd: it is just a few lines of code abcd: what I am missing is pushing the configuration back to the C side hugo: Guile can call C procedures. So just have a procedure in C lang which takes the parsed config abcd: yup, that is what I am working on right now abcd: well, in these days *: alextee[m] is writing his first program in guile mwette: alextee[m]: have fun ... it can be addicting hugo: alextee[m]: Exiting! Writting anything in scheme before? hugo: (Another scheme that is) alextee[m]: thanks :) only guix packages and i loved it. i'm very excited hugo: It's not my favorite language without reason alextee[m]: i normally program in C but i'm trying to make it my go-to language for scripting instead of using python. just writing some scripts to produce files for my builds now hugo: Sounds like a good project. My recommendation is to do everything in s-expressions as far as possible, and only serialize to strings at the very end alextee[m]: thanks, i will keep that in mind ArneBab: rlb, manumanumanu: what I built from the basic tools we talked about: https://hg.sr.ht/~arnebab/draketo/browse/default/wissen/covid-19-naiver-blick.org#L46 → https://www.draketo.de/wissen/covid-19-naiver-blick.html rlb: ArneBab: sadly I can't read the German, but interesting. mwette: lloda: There is an old bug on this: #21076, so I posted my patch there. Also, bug report on this to libtool, submitted by wingo 8+ years ago : https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8976 seepel: Hi there Guilers! I'm wondering how usable Guile 3 is in Guix System. It seems like a lot of libraries have added support for Guile 3, but it seems like most of the guix packages are still at 2.2. Is this correct, or is there something else I'm missing? rlb: By the way -- I'm trying to finally push guile-2.0 out of debian and while I haven't done any detailed testing yet, both the make and mcron packages build just fine with no more than changing the autoconf macros from 2.0 to 3.0. And that's without any newer upstream versions (i.e. whatever's in debian/sid). narispo: https://news.ycombinator.com/item?id=22640980 🤔 lloda: mwette: thx for the patch (and the context). I hope wingo or civodul will ok it, it certainly lgtm. chrislck: o/ (<---1.5m--->) rlb: Finally got 3.0.1 and 2.2.7 built on all the release architectures in debian so they'll be able to propagate to testing now. mwette: rlb: awesome! rlb: I'll probably try removing the --enable-jit=no in 3.0.1 for a few archs to see if we can relax that after it propagates. I can't recall for sure whether I tried that with 3.0.1 vs 3.0.0. For now we specify it for arm* and x32 iirc. mwette: civodul: I have a patch for #40075, guile 3.0 does not build if --without-threads mwette: civodul: posted to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40075 spk121: mwette: on 2.2, you also needed https://git.savannah.gnu.org/cgit/guile.git/commit/?h=wip-mingw-guile-2.2&id=d21e7074c77a4d169ca996188bd673e35aa11530 . don't know if that is still true mwette: spk121: that fix appears applied in 3.0.1 spk121: cool civodul: mwette: awesome, pushed! civodul: will reply by mail mwette: civodul: got it civodul: BTW, consider assigning copyright to the FSF for Guile if you haven't done it yet civodul: we can discuss the details if you want mwette: civodul: whatever helps, let me know via mail civodul: mwette: actually the procedure is simply to fill out and send https://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/Copyright/request-assign.future civodul: happy to answer any questions you may have mwette: civodul: got it rlb: civodul: if there's not a way to tell guile to refuse to use "older" compiled files, I'd like to add one if it's not something we'd be opposed to. I almost never want guile to just use whatever version it can find if there's something wrong with the first version in the path. rlb: That's bitten me more than once (not noticing guile just decided to run the wrong code). rlb: I suppose one possibility would be a new GUILE_AUTO_COMPILE option. rlb: say GUILE_AUTO_COMPILE=pedantic|halt-on-error or something. rlb: "strict", dunno civodul: rlb: Guile does reject incompatible .go files, with a warning civodul: or did you mean something different? civodul: overall, given that this is a core mechanism, i don't think we can change it during a stable series rlb: I don't want a warning, I want guile to just exit with non-zero status rlb: And sure - I'd imagine it'd have to go into a Y release. rlb: Right now guile just proceeds, and uses a foo.go that doesn't match the newest foo.scm. That's what I want to prevent (for me). lloda: i thought it would just recompile if that happened :-/ rlb: it will try the next time you run guile rlb: ...but it'll use the old .go for the current run, I think. rlb: Perhaps that's what most people want by default, but it's not what I want. rlb: (at least I think it's not what I want :) ) mwette: civodul: I have a patch for #29001, allow --disable-tmpnam as configure option. And tmpnam is marked deprecated; not sure you want that. I posted to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29001. rlb: hmm, define-syntax-rule's expansion fails in a #:pure module -- guessing it's because it needs some additional #:selections from (guile), but the error message doesn't really say anything meaningful. If I get time, I'll try to isolate it and file a bug, but basically (define-syntax-rule (foo x ...) (list x ...)) crashes expanding (foo) if you define it in a #:pure module, even if you've selected list and define-syntax-rule. rlb: (if it actually is a bug and not expected behavior) rlb: for now I can just avoid it -- define-syntax/syntax-case works fine. rlb: Oh, hah, now I remember. I think I figured this out a while back and forgot. You must also #:select ..., but the error doesn't actually tell you that. rlb: ok, that allows syntax-rules and syntax-case to work, but not define-syntax-rule. rlb: For that we get: rlb: ;;; Syntax error: rlb: ;;; unknown location: ...: bad use of '...' syntactic keyword in subform ... of ... rlb: mwette: For the purpose of providing patches to guile which git branch should I be working on? rlb: ...offhand I'd imagine stable-2.2 if it's something that might should go into both 2.2 and 3.0, otherwise master. *: rlb gueses rlb: I don't believe there's a stable-3.0 yet. seepel: Hopefully quick question: Is there a way to put the guile repl with readline into vi mode? seepel: My muscle memory is proving to be a hinderence to me rlb: I suspect you can do it via ~/.inputrc rlb: ...as occurs impressively often, archlinux wiki to the rescue? https://wiki.archlinux.org/index.php/Readline rlb: (I've never used arch, but have found their wiki invaluable on any number of occasions.) seepel: rlb: That worked! Thank you for the link! rlb: certainly rlb: Do we already have anything like "walk" (or even just postwalk), i.e. something like this, even if just for nested proper lists? https://clojure.github.io/clojure/clojure.walk-api.html#clojure.walk/postwalk rlb: built in I mean mwette: seepel: try adding "set mode vi" to ~/.inputrc mwette: Oh, see someone got it: set editing-mode vi seepel: mwette: Yup, I had originally tried to do "set mode vi" myself lloda: imo there's no excuse for dynamic-link not finding the exact filename you gave it. If it's necessary to try adding exts first for compat reasons, then maybe the exact filename can be tried last. Dunno. daviid: str1ngs: right, wrt msys2, i really have been impressed by it, the overall thig and packages, and the devs are very nice, always happy to help in a friendly way, on #msys2 (irc://irc.oftc.net:6667/msys2) str1ngs: daviid: when I get closer to need a new alpha release for nomad. I'll submit a g-golf.scm package if someone else has not already. str1ngs: daviid: I might need to do a new alpha release for nomad. since it's about 260 revisions from my last alpha :( daviid: ok, absolutely as you wish - I am gona concentrate on upstream 'only' - but I thnk you should start to talk with mainainers/contributors to solve the dynamicl-link 'bug' on guix str1ngs: daviid: I have a better understanding to that bug and how to avoid it. daviid: perfect str1ngs: addition paths in GI_TYPELIB_PATH can cause problems. str1ngs: also I noticed to order issues importing. but it's still not 100% resolved so I agree with you theree. daviid: str1ngs: for info https://www.msys2.org/ and https://packages.msys2.org/base, where you can see they have a GObject-Introspection package ... str1ngs: I have used msys2 before. it's mainly I just don't use windows :P daviid: str1ngs: you shouldn't wait to talk to maintainers and contribuors, on guix-devel, to grab help and info on how to best solve this very serious problem daviid: anyway, as/when you wish ... back to hack str1ngs: I have discussed the guix issues in #guix some maybe guix-devel might be a better approach. though it's really hard to replicate the problem without including g-golf into guix. and possible even replicating the situation that causes it. daviid: can't guix-devel participant just grab the package def anywhere you left it and try? str1ngs: yes, it's just less work for people I guess. daviid: str1ngs: it surely must be possible to work 'to prepare things' for later 'official inclusion in guix ... don't know but sounds plausible str1ngs: daviid: I have done that with the g-golf.scm in the nomad source tree. short of this odd guix related issue. though it seems pretty stable right now for me. str1ngs: daviid: I'm currently testing g-golf nomad on debian bullseye as well. due to getting a new pinebook pro :) daviid: great, i'm on bullseye as well str1ngs: daviid: I like buster more then bullseye is it worth using on a regular basis? str1ngs: I meant I like bullseye better then buster. daviid: str1ngs: imo yes, but i have no option, the libs i need, not only for g-golf, but guile-cv, octave ... are far too old on debia stable (in general) str1ngs: daviid that's the same issue I'm having as well. thanks for your input anadon: Hello all. I'm trying to change from a eBNF grammar to Guile since eBNF does not play well with representing dictionaries. Is there any particular reference I should read for doing this? wleslie: representing dictionaries? bavier`: anadon: guile has a nice peg parser anadon: bavier`: peg parser? daviid: any skilled/expert automake guiler here? I just added the following to my Makefile.am https://paste.debian.net/1135672/ and when i call 'make uninstall' or 'mke install', i see it displays the code in ther terminal, but the files are still there ... I wonder how to acheive the removal of 'old' mod/go files? bavier`: anadon: "parsing expression grammar" bavier`: see "PEG Parsing" in the manual str1ngs: daviid won't adding g-golf/gdk/event-structures.scm to SOURCES have the same effect? daviid: str1ngs: it's to be removed daviid: if it exists anadon: Looking at it, I'm not sure how it'll cover recognizing dictionary entries properly yet. I have a finite set of keys which can appear in any order and may only exist 0 or 1 times. str1ngs: daviid: a this is an upgrade path that makes more sense. daviid: I asked for help on #autotools, but so far didn't receive the correct' tip/trick to acheive the ressult daviid: hence i ak here as well ... str1ngs: daviid does $(moddir) expand correctly? str1ngs: iirc local is the way to do this daviid: str1ngs: i hope it does, if not, nothing wold ever instll ... daviid: but feel free to add those lines and help to debug ... tx! daviid: if you do, you must rerun ./autogen.sh; ./configure ... daviid: if you wan to confirm $moddir expands, you may even add a printf: target tht does that ... str1ngs: I assume this g-golf's topelevel Makefile.am? daviid: yes, once we fix this, we'll do this for its corresponding doc file daviid: str1ngs: tx, but don't loose too much time ... daviid: you should have this file instlled, so you may see if what you do works ... daviid: by daviid: listing the cntent of the installed dir, after make unstall str1ngs: yep ~/local/share/g-golf/g-golf/gdk/event-structures.scm daviid: it should only contain dirs, but here, it lists the files that were not adequately removed ... str1ngs: I'm using with-guile-site=no daviid: then it should be in $prefix daviid: what i do here is str1ngs: after make uninstall it should be removed correct? daviid: cd /opt2; ls -lsa | grep g-golf daviid: it should only lists dirs, after make uninstall, but it lsts the files tha i'mtrying to remove ... daviid: yes, that's the objective str1ngs: seems to be working for me daviid: as well as after make install, but to debug it's easier to tests with make uninstall, till the files are removd ... str1ngs: try with this instead . make install DESTDIR="$PWD/test" find t3est daviid: but i don't want to use DESTDIR str1ngs: it's useful for testing. daviid: it won't work for those of us who use --with-guile-sute, exactçy why it mst work with moodor, godir str1ngs: for me when I make uninstall it removes all files. no orphans are left daviid: that does'n make sense :):) daviid: why would it wok for you and ot here? str1ngs: could it be --with-guile-sute is an edge case? str1ngs: I'm behind by 3 commits would that be a factor daviid: anything could be the bug, i just don't know daviid: no, i just dded manually daviid: thos lnes str1ngs: one sec let me pull with prestine triee daviid: it won't change anything daviid: i didn't push these changes, which is why sted str1ngs: still no orphans daviid: doesn't make sens daviid: are these files there after make install? daviid: ./lib/guile/2.2/site-ccache/g-golf/gdk/event-structures.go daviid: daviid: and ./share/guile/site/g-golf/gdk/event-structures.scm str1ngs: I can't test with --with-guile-site=yes daviid: it shouldn't make any dffernece daviid: moddir and godir is what is used ... no matter what daviid: but you didn't answer my last question str1ngs: but when I run make uninstall . no files are orphaned daviid: are these files istalled in the first place? daviid: do run make instll daviid: and check these file re there daviid: i have a little doubt daviid: but ... i could be wrong daviid: ah daviid: i know daviid: wait a minute str1ngs: prefix is ~/local . see log http://paste.debian.net/1135677 str1ngs: this is after make uninstall daviid: i did alter the Mkefile.am here to delete the entry i SOURCES daviid: bah, sorry daviid: then you'll be in the same situation str1ngs: no changes to any sources. and using commit cb53df6692281d34da84753b912d162c4c71d915 daviid: str1ngs: delete the line of the source file daviid: in Makefile.am str1ngs: gotcha, so you want to remove this if it exists so the file is not orphaned once it's been removed? str1ngs: sorry what I mean. is you plan to remove this file eventually so you want some upgrade path daviid: i removed the file in the SOURCES entry in the top level MAkefile.am daviid: and added these lines i posted to remove those from the moddir/godir if there are there ... daviid: this is to clean users installed dris from the file that no longer is distributed ... str1ngs: right, I'm wondering how import it is to add this daviid: i was hoping not to have to commit inermediate state daviid: terrible str1ngs: this only effects people that use make install. and really they should be handling prefix ya? str1ngs: package managers should not suffer from this upgrade IMHO daviid: lstenm, i want this to work, not matter what daviid: i'm an upstream guy daviid: no packahge manager daviid: i want to remove the files that are no longer distributed, using autotool daviid: the rest does not interest me, to be honest str1ngs: I get the reasoning. just normally when people use make install. they need to handle prefix daviid: forget about prefic daviid: prefix daviid: it has to work nor matter what daviid: with or without prefix str1ngs: so make install. remove the file from SOURCE. than run make install again. it should remove the file. sound right to you? daviid: no daviid: str1ngs: for get about this daviid: i got tired daviid: thanks daviid: i can't commit the preparation and it seems you don't understand, fair enaough daviid: i need an autotool expert daviid: add the lines, i pasted long above, remove the file from the list of SOURCES, run ./autogen.sh; ./configure ...; and then make uninstall str1ngs: I do understand. stop insulting my intelligence daviid: :) str1ngs: test/home/mrosset/local/share/g-golf/g-golf/gdk/event-structures.scm gets orphaned daviid: ok daviid: i wonder why, here it displayes the lines refering to the uninstall-local target, as expected, but does not remove the files ... daviid: may be a stupid bug, but i couldn't find what i did wrong daviid: it seems the uninstall-local target is run first, then the autotool uninstall 'default' target steps are run str1ngs: daviid: $(SOURCESTOREREMOVE) expands to nothing daviid: ah str1ngs: so when it loops in for it does nothing str1ngs: let me verfiy this more daviid: ok tx str1ngs: ok here str1ngs: fix is for f in $(SOURCESTOREMOVE) see typo str1ngs: I suggest to use SOURCES_TO_REMOVE str1ngs: verbose easier to read str1ngs: same with GOBJECTSTOREREMOVE is a typo daviid: ok str1ngs: seems to work when I fix those typo's WDYT? daviid: perfect! thanks what a stupid typo daviid: it workd here to str1ngs: nobody likes orphaned files :P daviid: i shall work a bit more on this, still need to clean and add the gdk-event doc that was in the gdk-event-structures, the i'll push daviid: will let you know when it's ready daviid: have to go, bbl, tx str1ngs: okay let me know if I need to test anything str1ngs: ttyl daviid: str1ngs: I just pushed a patch, wrt the GdkEvent implementtion simplification I was talking about a while ago, with a (hopefully) good explaination in the commit log daviid: str1ngs: i had to sligthly change the Makefile.am changes, so it would not fail if these file do/did not exist ... daviid: str1ngs: here an updatd example that illustrate thse changes - http://paste.debian.net/1135692/ daviid: note that on wayland there is no more diff between coords and root-coords daviid: let me know if there is any problem with this quite long (bug prone) patch ... daviid: I updated the doc as well daviid: (but in the distro, not on line yet) daviid: *in the source tree (not the distro) nly: roptat: hi! nly: how do you work with functions that give huge outputs? '(call-with-input-file "example.torrent" bdecode) nly: emacs-geiser pretty much hangs lloda: what could cause srfi-64 to ignore my setting test-log-to-file to #f? lloda: i've pk'ed inside test-on-group-begin-simple and it's still #f whether I set! it or not. It's an exported variable, I don't get it. lloda: (@@ (srfi srfi-64) test-log-to-file) gives the value I set :-( nly: fixed an issue with reading bencode. better handling of non utf8 values. lloda: apparently I cannot access test-log-to-file from outside srfi-64. The exported test-log-to-file appears to be a different binding. I tested this by definiting a function give-test-log-to-file inside srfi-64 which returns the internal value. lloda: this looks like a bug, can anyone confirm? lloda: mwette: I've tried your test. It looks like a libltdl bug to me from reading their doc but your patch also lgtm lloda: why do I get 'attempt to include relative file name but could not determine base dir' when I do (include "file-in-this-directory.scm") ?? mwette: lloda: the libtool code says "if it already has extension, load that"; the problem here is that the extension is not what it's looking for. mwette: I will send the patch to the guile-devel elist mwette: if I can get it cleaned up dsmith-work: Happy Friday, Guilers!! abcd: dsmith-work: Howdy! civodul: hey, Happy Friday! *: spk121 isn't allowed to go to the office anymore spk121: happy Friday rlb: wingo, civodul: I *think* I ran in to a case where capturing (class-of record-instance) didn't work quite right as a goops method specializer, but it does work sometimes. My question is, would we be open to the idea of making that a requirement (if it's not already the intention), i.e. that record types can be used as goops method specialization types "somehow"? rlb: I ask because syntax expansion can handle records, but not goops instances which is sometimes useful. rlb: i.e. being able to define something that both goops methods and the syntax expander can recognize/match. civodul: rlb: no idea! civodul: could you submit an example to bug-guile? civodul: then we'll try to draw the attention of wingo or someone else knowledgeable about GOOPS :-) rlb: Of the case where (I think) it didn't work? I can try, but it was a while ago, assuming I'm right, so I might not be able to reproduce it. Right now I'm mostly wondering what we might be willing to *promise*, regardless of what we actually do now, because that could affect the way I design some things. rlb: i.e. would we be willing to say that's expected to work, or do we intend for it to be "undefined"? civodul: i really don't know civodul: but if you have an example with what you expected vs. what you got, that might give ideas str1ngs: daviid: okay will try this out. the main one for me is 'key-press-event dsmith-work: Hey Guilers, have a safe and clean weekend. jackhill: :) jackhill: thanks dsmith-work! mwette: civodul: Is there a written guide for helping to fix bugs. Do I checkout master git and send someone patch, or what? rlb: mwette: I've been git-send-email-ing patches (or just attaching) to either the bug tracker or guile-devel, but I was also thinking about asking what's "preferred". brendyyn: mwette: https://guix.gnu.org/manual/en/html_node/Contributing.html mwette: brendyyn: Thanks for that! brendyyn: mwette: when you get stuck you can put your code on paste.debian.net and ask for help her mwette: brendyyn: awesome -- thx brendyyn: mwette: sorry i thought we were in the guix channel. oops. i should link here https://www.gnu.org/software/guile/contribute/ mwette: civodul, wingo: I'm working on 29001: configure flag to disable tmpnam. I was thinking to also make use of tmpnam deprecated. WDYT? mwette: brendyyn: that one is a little less clear; I will work on something and start poking this channel brendyyn: Value out of range: 36 brendyyn: my code loads and runs fine in the repl, but i get that when i guile tries to compile it brendyyn: in procedure primitive-load-path brendyyn: Why does * with no arguments output 1, but - with no arguments doesn't output 0? oni-on-ion: hmm.. wleslie: brendyyn: x - 0 = x yet x * 1 = x wleslie: it's nice to be able to rely on standard group properties brendyyn: so this is more correct? wleslie: not only more correct, it's expected by the traditional definitions of + and * brendyyn: but this is with no x brendyyn: + outputs 0 wleslie: sure, but 0 + x + y + z = x + y + z, it doesn't matter how many elements are involved wleslie: 0 is the identity in any group where + is the operator brendyyn: same with -? wleslie: - is a special case of + brendyyn: i believe you are right, but do not understand how that implies - shouldnt also output 0 brendyyn: if - output 0, what would be an undesirable consequence? wleslie: didn't you say - outputs 0? brendyyn: wleslie: no, check my initial question and test in your guile repl. (*) => 1, (+) => 0, (-) => error wleslie: ah. brendyyn: do you believe this behaviour is correct? a bug? or is unimportant? oni-on-ion: same with common lisp wleslie: look, I don't know, really. nary (-) in scheme is kind of wierd. it doesn't associate with itself, for example, as + and * do. wleslie: making it an error forces you to declare what you mean. brendyyn: with +, you could imagine summing up some things, and if there was a case where there were none, you assume it adds up to 0. thats why i assume its 0. but the same logic seems to hold for -? brendyyn: assume its a reasonable choice* wleslie: the trouble is that the first argument is wierd, right wleslie: *weird brendyyn: what's weird? wleslie: (= (+ x (+ y z)) (+ x y z)); (!= (- x (- y z)) (- x y z)) wleslie: oops wleslie: yes wleslie: the first argument isn't treated as a negative brendyyn: but -0 = +0 anyway wleslie: the first argument is not the 0. 0 is the hidden argument. brendyyn: well now we have two hidden arguments ;) wleslie: then you're not talking about - brendyyn: if there are no arguments, then you could assume its like (- 0 0) wleslie: can you though? given that it isn't associative? brendyyn: why does that matter since there are no arguments oni-on-ion: some answers have been collected: http://ix.io/2eEc/text wilfredh: howdy folks :) wilfredh: I noticed a few missing parens in the guile docs: (cons 3 '(2 1) wilfredh: from https://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Fold-and-Map.html wilfredh: what should I do with docs bugs? chrislck: o/ lloda: hi, how do you debug issues with dynamic-link not finding a file that's 'obviously there'? civodul: lloda: LD_DEBUG=files :-) civodul: or strace janneke: or running 'file' to find out it's the wrong ELF lloda: thx civodul lloda: LD_DEBUG reports .so being loaded but then dynamic-link still fails with a message of 'file not found' lloda: I have to assume the message is bogus somehow civodul: yes, the message is bogus civodul: it's an old and terrible issue with ltdl lloda: do you know what the actual cause is? or could be lloda: I have it fail on one machine and succeed on another fwiw civodul: there are many reasons why dlopen could fail civodul: file not found, symbol not found, etc. civodul: LD_DEBUG=files should give you a hint, at least civodul: and then you can try LD_DEBUG=bindings or similar civodul: perhaps it's a dependency of your .so that couldn't be found Zelphir: Hi : ) Zelphir: @lloda: I took a short look at https://www.gnu.org/software/guile/manual/html_node/Dynamic-FFI.html and did not see anything sticking out, except, that there only the name of the library is used, as in "libm", but not a whole path. lloda: yeah Zelphir that's why the default name is just 'libcblas' lloda: so if that's on the dynamic library load path, you shouldn't need to set any variables dsmith-work: Morning Greetings, Guilers lloda: have you tried LD_DEBUG=files as per civodul suggestion? Zelphir: Could it be somehow installed the wrong way? So that it is not dynamic or something? Zelphir: Ah ok let me see ... Zelphir: lots of output, should I post it here or in the issue (more persistent)? lloda: Zelphir: paste.debian.net Zelphir: (I have a feeling it has to do with installing Guile through Guix package manager.) Zelphir: https://paste.debian.net/1135589/ Zelphir: I just noticed, even with libm it does not work, when I use the example from the docs :O Zelphir: Also "cannot find" it. lloda: seems to be dying on this line lloda: 6069: file=libatlas.so.3 [0]; needed by /usr/lib/libcblas.so [0] lloda: but I cannot really interpret this :-/ Zelphir: I could compile Guile into some user directory as prefix and try using that, to see if it is about Guile being installed via Guix. rlb: We finally have 3.0 (3.0.1) building on all the debian release architectures -- should be eligible to propagate to testing now: https://buildd.debian.org/status/package.php?p=guile%2d3%2e0 civodul: yay, congrats, rlb! rlb: (And 2.2.7 should start building soon.) Zelphir: sounds great lloda: civodul if you have minute to look at Zelphir logs I'd really appreciate it rlb: civodul: thanks -- and that's still with the jit disabled on arm* and x32. I can try relaxing the restriction, but I might wait until the current version propagates first. civodul: Zelphir: the problem here is that you're loading /usr/lib/libcblas.so from a Guix-provided Guile civodul: Guile is linked against Guix's libc, whereas libcblas.so is linked against the host distro's libc civodul: that cannot work rlb: ("jit disabled" just means we have --enable-jit=no set there.) civodul: instead, you need to use Guix for everything civodul: (or the host distro, but hey ;-)) civodul: IOW, you need to use libcblas from Guix Zelphir: Ah, OK, thanks, but how would I use "libcblas from Guix"? (So far I've only used Guix as a package manager, to get more up to date versions and not mess with the system.) Zelphir: I will check if it exists as package in Guix civodul: Zelphir: there's openblas for instance lloda: thx civodul Zelphir: And I found lapack. Which one should one use? civodul: hmm, that's probably a quest for lloda actually :-) lloda: you don't need lapack for guile-ffi-cblas lloda: but if you install lapack it will have a dependency on blas Zelphir: OK I will try with openblas first : ) lloda: openblas should be good I think lloda: yeah Zelphir: I also initially considered using schemetran, but when I looked at the source, I realized, that I would need to know how to write Fortran code. I never wrote any, so I looked further and found guile-ffi-cblas. Zelphir: OK, after installing openblas using `guix install openblas`: Without environment variables, it still says, that it cannot find libcblas. I think I need to find out where libcblas in the Guix directories is now, so that I can try it with setting the environment variables. civodul: Zelphir: probably you'll need to export LTDL_LIBRARY_PATH=$HOME/.guix-profile/lib civodul: so that dynamic-link searches for blas in your profile civodul: it's not called "libcblas.so", though, so perhaps you need to adjust guile-ffi-cblas Zelphir: OK, What does LTDL stand for? Link target dynamic link? oni-on-ion: LD_ is all ive seen on that lloda: there is GUILE_FFI_CBLAS_LIBNAME to set a non-default library name civodul: Zelphir: libltdl (part of GNU Libtool) is a portability wrapper around dlopen civodul: and LTDL_LIBRARY_PATH is its environment variable Zelphir: There is `libopenblas.so` in that directory :) I guess that could work. I will try with libname and the LTDL var Zelphir: Ha, the error changed! Getting closer perhaps. Zelphir: https://paste.debian.net/1135595/ Zelphir: I guess the name of the functions is now different, because it is openblas. Perhaps now the names are all prefixed with "openblas"? lloda: the old blas fortran77 bindings have names like crotg_ while the cblas bindings have names like cblas_crotg Zelphir: Ah, here is better output: https://paste.debian.net/1135598/ lloda: guile-ffi-cblas uses the latter, but openblas should provide those too Zelphir: The openblas I installed is version 0.3.7 lloda: can you paste nm /home/user/.guix-profile/lib/libopenblas.so ? lloda: the binding names are standard, otherwise nothing would work :-( Zelphir: Too long for the paste.debian.net ^^ I will need to cut it in pieces. lloda: can you check that it has cblas_crotg or any cblas_ symbols really Zelphir: ok Zelphir: There are some cblas_ ... but not cblas_crotg. Zelphir: I can post all those starting with cblas perhaps. Zelphir: https://paste.debian.net/1135602/ Zelphir: So I guess only for double (d) and single (s) the rotations are there, but not for complex? (c) lloda: I guess Zelphir: If I interpret those names correctly. lloda: I'm not sure why they aren't there tho Zelphir: OK, how about I try the other library, lapack? lloda: I guess there's no harm in trying lloda: if some functions aren't supported widely I could patch them out lloda: rotg etc aren't as important as gemm etc. I guess lloda: still it's annoying to need these workarounds Zelphir: For my actual use case (implementing linear regression) I guess I also would not need complex numbers usually, but I don't know about other use cases. lloda: you could try BLIS :-) lloda: it's nicer and there's only one source so no disagreements over what's included or not lloda: but not as widely available as BLAS on repos etc. lloda: I digress lloda: lmk if installing lapack gives you those functions and if not I can find a way to not require them Zelphir: :D in that installed lapack now the cblas_srotg is not found ... I guess I cannot have all^^' Zelphir: https://paste.debian.net/1135603/ lloda: ouch Zelphir: Actually there are no cblas_ symbols in there at all. Just checked using `nm ...` Zelphir: OK, I mean, I could still try and compile CBLAS from netlib. civodul: we should add a netlib package civodul: it could be that gsl would work Zelphir: I tried that before, but had issues there as well, because `blas_LINUX.a` does not exist on my system, and I need to set the path to it in some `Makefile.in` according to the web and there is an error exactly about that path being wrong when I don't -.- Zelphir: (I mean, I tried compiling CBLAS before, not making a netlib package) civodul: "objdump -T $(guix build gsl)/lib/libgslcblas.so|grep crotg" turns up nothing lloda: I've pushed a branch norotg lloda: could you try that? Zelphir: I will try. Zelphir: It passes many tests and shows errors on some only. Zelphir: I think I can make a paste of all the errors and the other ones all pass. lloda: thx Zelphir: Ah actually I think the errors are all before the tests. lloda: oh Zelphir: https://paste.debian.net/1135608/ There you can see everything up to the first test and all tests afterwards pass up to 2104 and then there is some more output from LD_DEBUG=files. lloda: that looks good those are all the tests lloda: I'll see if I can support rotg conditionally then Zelphir: Should I try the BLIS test as well? lloda: if you want lloda: it's independent lloda: I like BLIS better because it has better support for strides & the like lloda: but you would use one or the other Zelphir: OK, I guess BLIS needs another library from guix installed, because it starts again with "file not found". Zelphir: There is blis on guix, lets see. Zelphir: "It's compiling" (Guix is compiling BLIS) ^^ lloda: nice Zelphir: uff, that 'check' phase takes its time civodul: Zelphir: yeah these things take an awful lot of time Zelphir: aha, it is running its test suite nlyy: hello str1ngs: hello nlyy nly: greetings str1ngs str1ngs: how goes things nly? Zelphir: (Check phase took 1h45min approximately on my X200 :D) nly: str1ngs: great, i am reviving guile-torrent str1ngs: nly: nice doe that handle downloading torrents? nly: nah, just reads .torrent files nly: i just found out a great solution to a problem in metainfo. I'll use first class macros nly: it's good fun Zelphir: @lloda: Do I need to set a different environment variable for BLIS or is it GUILE_FFI_CBLAS_LIBNAME for BLIS too? Zelphir: Nevermind, I already figured it out: replace CBLAS with BLIS. I think it might need to be added to the readme though. Zelphir: All successful using: GUILE_FFI_BLIS_LIBNAME=libblis GUILE_FFI_BLIS_LIBPATH=${HOME}/.guix-profile/lib guile -L mod -s test/test-ffi-blis.scm Zelphir: # of expected passes 19752 lloda: nice lloda: I think libblis is the default so it should work w/o that lloda: and if you set the path for guix as civodul explained then the other shouldn't be needed either lloda: GUILE_FFI_BLIS_LIBPATH and GUILE_FFI_BLIS_LIBNAME are already mentioned in the README that I see Zelphir: Ah now I see it. Zelphir: Setting LTDL_LIBRARY_PATH=$HOME/.guix-profile/lib also works. lloda: great lloda: thx for checking it out Zelphir. I started these bindings long ago and I haven't received feedback really lloda: there should be some examples, and more of the functions should be covered lloda: I just wrapped what I needed myself I suppose Zelphir: It is great, that there is such a library at all. Otherwise I would probably have implemented some naive matrix multiplication in Guile and an interface, so that someone else can replace it with performant solution. Zelphir: Now I already have a chance to implement a performant library. lloda: +1 Zelphir: Thanks for all your help! And also thanks to civodul! Zelphir: Oh I will try the version from master branch with BLIS as well. str1ngs: nly: nice, sounds intresting. nly: amen, thanks civodul. I use Guile everyday, i forget to thank the maintainers nly: thanks wingo and mark Zelphir: (Yep, also works with the version from master.) nly: i'm making (some) money using Guile! nly: (not a lot, lol) mwette: lloda: I was getting the same thing. Are you on fedora,redhat,centos by chance? mwette: I found the problem in libguile/dynl.c. Patch https://paste.debian.net/1135632/ mwette: s/found/found a fix for/ lloda: I'm on debian mwette lloda: doesn't lt_dlopenext try no ext first, then the extensions? lloda: if your patch works that looks like a bug in libltdl mwette: check both with https://paste.debian.net/1135642/ mwette: I think it just adds extensions. lloda: I'll check tomorrow lloda: I've been alternating office days with wfh this week lloda: ty for looking into it ruffni: how can i extend a list with all the elements of another list? (list 'a 'b) (list 'c 'd) -> (list 'a 'b 'c 'd) ? rlb: list-append? ruffni: thanks! rlb: oh, wait "append"? ruffni: it's append rlb: and apply? rlb: Oh, no, typo here, append it is. mwette: abcd: When I worked to get guile2.2 (?) to compile under FreeBSD the builtin make would not work. ruffni: why is guile scripting not supported by my gdb? GDB 8.3.1 rlb: ruffni: why do you think it's not? Could it just be that your build didn't enable it? rlb: i.e. rlb: (gdb) gr rlb: Guile scripting is not supported in this copy of GDB. rlb: ruffni: it's totally possible. i got it from debian testing repos. do i have to build it myself? rlb: I don't see a debian " rlb: gdb-guile" package, so maybe? rlb: (like we have wrt make-guile...) ruffni: we where? guix? rlb: debian rlb: sorry oni-on-ion: is anyone using guile-wm? seepel2: oni-on-ion: I am not but would love to try it out! It crashes on start for me and I haven't yet had the time to dig in more rlb: ruffni: looks like you might be able to "apt-get source gdb" then (as root) "apt build-dep gdb" and then edit debian/rules in the gdb dir to change --without-guile to --with-guile, and then "fakeroot debian/rules binary" to make your own packages. Of course you'll also have to install a guile-X.Y-dev that gdb recognizes (not sure which, likely 2.2, at least). ruffni: already on it :) oni-on-ion: seepel, i see. i have been using EXWM ruffni: so your goto debugger isn't gdb? or am i mixing things up here..? seepel: oni-on-ion: I've been using i3, but would love to use guile for scripting instead brendyyn: sway is in C. maybe extend it with guile? seepel: Not a terrible suggestion... oni-on-ion: sway looks nice brendyyn: i run it. *: rlb too brendyyn: i realised yesterday you can move tiled with me mouse brendyyn: wiled windows with the mouse *: brendyyn can't english while tired. *: oni-on-ion has no mouse atm tohoyn: daviid: it seems that many GValue-related procedures get overloaded. I have to use @@ to access the correct versions in (g-golf gobject). tohoyn: daviid: I'm trying to implement GValue argument support in hl-api/function.scm tohoyn: daviid: if I use the default GValue procedures there I get infinite loop daviid: I don't understand this way of expressing things, 'overloaded', I am sorry but daviid: you should not even have to use any of those procedures, their for developers daviid: function uses giarguments, not gvalues tohoyn: daviid: I'm implementing the case where a function needs a GValue argument tohoyn: daviid: I actually convert Scheme types to GValues tohoyn: daviid: this is needed e.g. in gtk-list-store-set-value tohoyn: daviid: it does not work in the current release of G-Golf daviid: ok, i'm pleased to improve the situation of course, but i'd like you to send me a snipset that i can use to spot and reproduce the problem, then i can fix it ... daviid: as i said, there are many things to do stll tohoyn: daviid: I'll send you a patch daviid: i don't want a patch, i need to think about how i want to fix this 'problem' you spot first ... daviid: but please send an example daviid: and that module needs another fix, which i am thinking still how to best address the problem ... tohoyn: daviid: ok. I'll send you an example program. tohoyn: daviid: I also fixed the case where a procedure needs an Gtk Interface argument tohoyn: daviid: and implemented GType array as an argument daviid: the smalest possible code snipset that allows to see the 'missing ' ... daviid: that was supposed to be fixed already daviid: actually fixed in the context of closures and signals, i was going to iplement the 'similar' fix for gi-arguments tohoyn: daviid: email sent daviid: ok tohoyn: daviid: what does it look like? daviid: tohoyn: it looks like i cn use the example to spot 'problems' and think about how i want to improve the situation, tx. but riht now, i'am on somethig else, so please be a little patient .. and rmember, thought it's getting better everydy, g-golf is still experimental daviid: but here is what i can say just loking at the example: (-) it would be nice to only import what the example requires, if you manage to do that, paste it here, i'm using an old computer, and importing gtk takes a couple of secnds here .. daviid: we shold be able to call gtk-list-store-new passing th list of fundmental types daviid: we should be able to pass the list of fundmental type symbols, you shoudl'nt have to call symbol->g-type 'yourself', i gess you did that because something is missing in g-golf, i'll look into this of course daviid: you should never (have to) call g-value-set!/ref yourself, which sounds like also something was missig for you to work 'properly tohoyn: daviid: I suspect that the g-value-related procedure in subdirectory gobject get redefined somewhere tohoyn: daviid: and the new procedures don't work correctly tohoyn: daviid: I'll fix the example for imports daviid: tohoyn: probably, it's another important thing i need to fix, not to let g-golf import things that are manally defined - it's a bootstrap problem, in order to write a GI binding, we need a minimal set of glib, gobject 'things' to be defined, then it tries to reimport those but it shouldn't ... rotty: weinholt: got no response to my bug reports and guile-devel post yet, unless I missed it (https://lists.gnu.org/archive/html/bug-guile/2020-02/msg00021.html, https://lists.gnu.org/archive/html/guile-devel/2020-02/msg00053.html) tohoyn: daviid: the gvalue struct is defined to have field types unsigned-long, double, and double. I think that having type double here is not good when these kind of structs are parsed or created in bytevector level. tohoyn: daviid: I think that double should be replaced by some integer type. weinholt: rotty, a workaround might be to close the port after writing to it (assuming the interaction is a single write followed by a read). to fix it properly, i would look at how the close-port procedure flushes the output (assuming that it isn't buggy as well) rotty: weinholt: that workaround is not an option for dorodango; looking at `close-port` more closely (heh!) is a good idea -- thanks daviid: tohoyn: you shouldn't even try to set! nor ref a g-value 'yourself, less try to parse its struct content, why are you ding this tohoyn: daviid: parsing the structs didn't work for GValue daviid: tohoyn: but you shouldn't do that daviid: tohoyn: anyway, i see this 're-importing already defined gobject -things-, gvalue and its methods, must be blocked before we can even go further daviid: have to go, bb tomorrow civodul: Hello Guilers! tohoyn: civodul: hello brendyyn: I ran file-system-tree on a directory with symlinked directories., but it does not show the contents of them. the wiki says the default enter? will traverse everything brendyyn: documentation* heisenberg-25: does the scheme pattern matcher ignore whitespaces or newlines? manumanumanu: heisenberg-25: yes. Not the literal char #\newline, though :D heisenberg-25: is there a way to make the pattern matcher not match whitespace? manumanumanu: it does not? Show me an example of what you would like it to do. heisenberg-25: manumanumanu https://pastr.io/view/HWsQLEF5h8G manumanumanu: heisenberg-25: that works as expected, no? heisenberg-25: did it work for you? manumanumanu: it printed A and B and returned two true values? heisenberg-25: weird, it is matching the unknown case for me heisenberg-25: I'm on guile 2.2 manumanumanu: or rather, it returns (#t #t) manumanumanu: heisenberg-25: i'm on 2.9.2, but that shouldn't matter heisenberg-25: (expr->graph (ListLink (Concept "A") (Concept "B"))) heisenberg-25: this not working as expected for me manumanumanu: oh, but you must quote it manumanumanu: '(ListLink (Concept "A") (Concept "B")) heisenberg-25: ohhh heisenberg-25: manumanumanu thank you! manumanumanu: np :D heisenberg-25: but what if i want to pass s-expr directly without quoiting heisenberg-25: manumanumanu manumanumanu: heisenberg-25: then you will have to match on the result of the procedure ListLink manumanumanu: What does ListLink return? heisenberg-25: it is a scheme binding for an underlying c++ class that holds objects. heisenberg-25: actually my question should have been how would I pass a quoted input to this function when it is called from another function? dsmith-work: Wednesday Greetings, Guilers manumanumanu: heisenberg-25: wrap it in a srfi-9 record and you can match against that. ArneBab: I tried to find a replacement for hashmap that plays well with fold. Vhashes sound good, but I can’t get only the newest values. Is there a set-datastructure with O(1) membership test that I missed? RhodiumToad: you want fast membership tests and iteration in reverse order of insertion? ArneBab: the latter would be ideal, yes. But only the newest values. ArneBab: or rather: What I want is a way to aggregate on keys RhodiumToad: not sure what you mean civodul: ArneBab: what do you mean by "newest values"? civodul: (vhash-assoc 'a (vhash-cons 'a 2 (vhash-cons 'a 1 vlist-null))) civodul: ⇒ 2 civodul: well, (a . 2) ArneBab: what I need is folding over all vhash keys. ArneBab: here’s my code: (fold (λ (element table) (vhash-cons (second element) (+ (third element) (cdr (or (vhash-assoc (second element) table) '(#f . 0)))) table)) (alist->vhash '()) flattened)) civodul: yeah in this case you would see 'a twice ArneBab: I then save as simple file: (map (λ(x) (format #t "~a ~a\n" (car x) (cdr x))) (vlist->list sum-by-date)) ArneBab: but I only want to see each key once ArneBab: RhodiumToad: (not having reverse order is OK, though reverse order would be optimal) ArneBab: here’s the code in readable: https://paste.debian.net/1135436/ RhodiumToad: λ RhodiumToad: oops jcowan: λ is never out of place on these channels! RhodiumToad: it looks like emacs is messing up on greek fonts :-( jcowan: I thought Emacs finally had a good Unicode story now (I don't use it, so I don't know) RhodiumToad: it's not unicode as such that's the problem, it's somehow selecting a bad font for output in some cases jcowan: Ah. Perhaps switching to a monowidth full-Unicode font would help. RhodiumToad: yeah, changing almost anything about the font choices makes it work, it's just the default one that's coming out wrong RhodiumToad: ok. blacklisting the offending font in fontconfig seemed to be the best solution. ArneBab: civodul: is there a way to elegantly get a list of only the newest set values from the vhash? https://paste.debian.net/1135436/ ArneBab: I have an inelegant way: just create a hash-map and check for membership. But … its just not nice. civodul: ArneBab: yeah, or convert to an alist, but that's about it civodul: note that there's vhash-fold* if you wish to iterate over all the values associated with a key civodul: not quite what you're asking for though manumanumanu: ArneBab: you could try andy's fash. manumanumanu: sorry. vhashes are the same. manumanumanu: I don't really understand what you are trying to do, but can't you just vhash-cons into one vhash and fold over another? with fashes you can fold over one add to a transient copy of the same one. manumanumanu: no duplicate values, and in-place updates of the new fash manumanumanu: could that achieve what you want? manumanumanu: ArneBab: https://hg.sr.ht/~bjoli/guile-fash/raw/default/readme.md manumanumanu: sorry about the shitty formatting manumanumanu: sourcehut does no automagically made readme.md (lowercase) the project start manumanumanu: I am adapting andy's fectors to use rrb-trees, btw. That way we get very fast appends, splits and inserts, at the cost of an extra vector-length per tree height. manumanumanu: one could make it a bit less space efficient, but provide amortized o(1) prepends as well (or maybe make a prepended rrb-fector a special case where the first 32 elements are in reverse order to get amortized o(1) prepend at the cost of some computation) manumanumanu: I wish I could understand the fashes though. They are very fast, but currently lacks the ability to properly remove elements. I tried, but never managed to add it rlb: ArneBab: yeah, if it'll do what you need, I've been using fash successfully for a bit: https://wingolog.org/pub/fash.scm rlb: I may propose fash-update and fash-delete at some point. I have the former, but haven't attempted the latter yet. rlb: i.e. (fash-update fash key f . args) where it calls (apply f prev-val args) to compute the new value. manumanumanu: rlb: I took andy's fash and fector and put it in a repo. I never got to add any nicities to fash, but the fectors I added some srfi-1 inspired things from. https://hg.sr.ht/~bjoli/guile-fash jcowan: Henry Baker has an interesting implementation of functional vectors on top of ordinary vectors plus mutable pairs. The nice thing is that if you are consistently accessing a particular state of the vector, you get O(1) ref and set, and only work hard which you switch to accessing another state. manumanumanu: is that the one linked to in the r7rs dockets? manumanumanu: anyway, anything unless you provide split, append and insert like rrb-trees, I am pretty sure I don't want it :D :D jcowan: yes it is jcowan: Well, that's not *vectors*. rlb: fwiw, I have a guile implementation of clj's persistent vectors (mostly in C) that I may try to clean up and publish when I have time (including the tail optimization, etc.). https://hypirion.com/musings/understanding-persistent-vector-pt-1 And assuming I actually understood and did it right... jcowan: Nice jcowan: Another approach would be HAMTs whose keys happen to be numeric, in which case you can insert elements between 2 and 3 by calling them #e2.1, #e2.2, etc. manumanumanu: rlb: guile-fector is andy's implementation of those as well https://hg.sr.ht/~bjoli/guile-fector rlb: Hah, oh -- well if it's close, then I probably wish I'd knew about that before I did all that work :) rlb: "if it's even close" manumanumanu: anyway, good night! jcowan: IMO a vector without fast random access doesn't count as a vector, but I certainly don't demand fast insert and delete too. jcowan: A Dijkstra array, which is kind of the dual of a circular buffer, does have O(1) everything, which is nice, at the expense of havimng to copy it when the underlying vector gets full. rlb: Hmm, I suppose my "ref" might be faster, depending on what wingo did -- I use a duff's device to find the right leaf in one quick fallthrough :) jcowan: (A circular buffer of size k has two indices, i to the first cell in use and j to the last cell in use (or just past that), so the area between i and j is the content and everything below i and above j is garbage. rlb: And _builtin_clz() to find the tree "depth" for the index. *: rlb bets Andy does similar tricks -- will look later. jcowan: In a Dijkstra array, everything below i is part of the array and everything above j is too, and between i and j is garbage. jcowan: and there is a third index telling you where the zeroth element is. jcowan: So ref, set, push, pop are all O(1) until the buffer is full jcowan: also shift is O(1) because of the third index rlb: fwiw: regarding the duff device: https://paste.debian.net/hidden/0af6338e/ rlb: wait, that's not the right thing. rlb: (...and obviously not a duff's device) rlb: (last part here is what I meant https://paste.debian.net/hidden/5a179018/ ) ArneBab: manumanumanu, rlb: there are so many cool datastructures, but I look for something that’s included in Guile. It would be cool to have these datastructures as default part of Guile. rlb: Agreed -- I've written my clj vectors to try to at least leave open that possibility if it ends up being of interest, but if Andy's behave even close to as well (or better) and are pure scheme, that's very likely preferable if including them is otherwise acceptable. rlb: In the end, I'd just love to have a few more "core" persistent data structures in guile proper, e.g. perhaps at least vector, map, and set. ArneBab: same for me — it surprised me today for the second time that we actually have serious missing pieces there rlb: I wrote a chunk of a simple (I *think* maybe mostly standards compliant) JSON parser last night :) If I get a chance to finish it up, clean it up and add tests, I thought I might propose it for inclusion. Seems like it'd be nice if it's not much code to have at least something basic there in the core... ArneBab: an efficient data-sharing set-implementation (thread safety would also be nice), efficient trees. Currently we mostly have list, alist, and vlist. ArneBab: rlb: sounds good — do you know guile-json? rlb: Nope. ArneBab: that’s what I used today ArneBab: I don’t know the difference ArneBab: https://github.com/aconchillo/guile-json rlb: But whatever it is, I think it might be good to have something "built in", even if you need an external library for more sophisticated or higher performance cases. rlb: i.e. I'm not proposing implementing/adding anything like cheshire/jackson :) manumanumanu: jcowan: rrb-trees are a strict superset of the vectors used in clojure civodul: rlb: davexunit (David Thompson) posted an (ice-9 json) patch to guile-devel maybe... 2 years ago? civodul: IIRC, it was almost ready for inclusion civodul: so perhaps we could start from there manumanumanu: the penalty for splitting and inserting is only paid after an insert. manumanumanu: civodul: there is a json srfi coming up manumanumanu: with a streaming interface civodul: oh, didn't know that manumanumanu: jcowan: seriously, there are very few-reasons to use clojure's tries over rrb-trees. The only difference is that the rrb-trees contain a lookup table, but only after a split or insert has taken place. In practice, this means a vector-length check (32 = no splits, 33 = lookup table). The lookup table can be branch local, so the cost is really really low. jcowan: I believe you. But how do they compare with the Baker and Dijkstra approaches for fixed-length vectors? manumanumanu: I suspect indice-based access will be slower, but iterating through it from start to end (or reversed) will be only slightly slower. manumanumanu: anyway, now good night for real! manumanumanu: civodul: the json srfi is amirouches. I think the interface is actually quite good. civodul: here's the one i had in mind: https://lists.gnu.org/archive/html/guile-devel/2015-08/msg00003.html civodul: 2015?! time flies civodul: what have the maintainers been doin' :-) dsmith-work: Wasting time playing with compilers and packaging... dsmith-work: civodul: Just curious: what's the 3.0.2 timeframe looking like? civodul: dsmith-work: i'd like to release it soonish, but i'd like to know what wingo thinks too civodul: there are a few more bugs we could fix civodul: help welcome! dsmith-work: I'm a bit confused with what needs jit disabled. civodul: on current master, JIT works on all supported platforms rlb: sneek: later tell civodul looks like we'll still need --enable-jit=no on some platforms (I cherry-picked your fix in -7 and re-enabled the jit everywhere, including armel): https://buildd.debian.org/status/package.php?p=guile-3.0 sneek: Will do. rlb: Unless there's some other fix in 3.0.1 that might matter -- that's obviously still 3.0.0. manumanumanu: RhodiumToad: I got a hold of Oleg, btw. He will take a look at my patch when he has time. There is too much going on right now with the covid going around civodul: Hello Guilers! civodul: rlb: not sure i understand https://buildd.debian.org/status/package.php?p=guile-3.0 civodul: (sneek delivered your message on #guix) civodul: there are test failures on some platforms, right? civodul: but it's 3.0.0 + patch, not 3.0.1 + patch, right? dsmith-work: Tuesday Greetings, Guilers chrislck: o/ abcd: Hello, I have some questions on how to embed guile in a C application rlb: civodul: yes, I was trying to finish stabilizing 3.0.0 if it was easy, so it could be propagating to testing before working on and introducing 3.0.1 because I looked, and I *thought* there weren't any other patches in 3.0.1 that were likely to affect the segfaults. But perhaps I was mistaken. (And now amd64 failed in the tests on "FAIL: asyncs.test: preemption via sigprof".) dsmith-work: abcd: Best if you ask them then.. ;^} rlb: Is that's known to fail sometimes, or more likely a real problem? abcd: dsmith-work: Thanks! abcd: My use case would be using a guile script in a C program to 1. parse the command line arguments 2. read a JSON configuration file 3. generate a configuration object to be passed back to the calling C program abcd: I have read the tutorial, but it just explains how to run an interactive shell and I cannot find a reference on how to execute a C string as a guile script rlb: abcd: if I understand you, you can't drive it that direction (at least not until/unless guile has a C dialect) -- i.e. you'll still need to compile the C program, and link it against libguile. rlb: (Or compile the C program to a shared library and load it from guile.) abcd: yes the idea to use the guile script is to simplify on my side the configuration reading abcd: because right now I am doing the JSON parsing and command line arguments parsing directly in C and it's horrible abcd: I was hoping to use a scripting language just for the configuration of the C program abcd: the rest of the programm will stay in C, so for sure I am compiling it abcd: the configuration script could be a separate file loaded at runtime, but I would like to embed it in the C source as a string and execute it abcd: so the program would be self-sufficient and would not need an external file abcd: I found the tool xxd that can read a file and create a header-like file that can be included in a C program rlb: That's the part I don't follow -- you can't embed the C source and execute it, but you can link your C application (binary) against libguile. rlb: I mean for some versions of "can't". rlb: And which tutorial did you mean? abcd: let me find it again abcd: https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html abcd: this one, that teaches how to write a logo application abcd: let me explain it again abcd: I have this program (called waps) that right now is a C99 only program rlb: abcd: so what I would typically favor is just driving my whole application from guile itself, and then put all my C code into a libfoo.so that guile can load and call. At first you could have nearly all your application in there, and your top-level guile script might just call (my-c-main ...), but then later you could move more bits to the scheme side if you liked. i.e. your application would just be a "#!/usr/bin/env guile -s" rlb: script... rlb: But you can also make it more "C oriented". abcd: at the startup it parses the command line and it reads a JSON file to configure itself abcd: waps is a rather intesive number crunching application so I wanted to avoid using a scripting language for the rest abcd: I wanted to use guile just for the initial configuration rlb: Ahh, looking at that tutorial, maybe you were specifically wondering about the scm_shell(). rlb: i.e. you don't have to to call that. rlb: You can call scm_with_guile, and then do whatever you like. abcd: indeed in the reference manual they suggest that function rlb: So instead of scm_shell, you could call my_config_loader(), that returns your C config struct after using guile to build it. rlb: (using guile functions I mean) abcd: but I cannot find a function that can evaluate a C string rlb: And then pass that C struct to your normal C code. rlb: you can't evaluate a C string. abcd: yes that is exactly what I wanted to do rlb: You'd compile your C program as normal, and presumably it'll have a do_a_thing(config) function. abcd: so the libguile would only evaluate either an external file or an interactive session? rlb: Then you'd link your C code via gcc or whatever against libguile with a main that looks vaguely like this: rlb: int rlb: main(int argc, char **argv) rlb: { RhodiumToad: and of course you can evaluate a C string rlb: scm_with_guile (®ister_functions, NULL); rlb: config_t config; rlb: load_config_via_guile (&config); rlb: return do_a_thing(&config); rlb: } rlb: rlb: In guile as-is? RhodiumToad: convert the C string to a scheme string and pass it to scm_eval_string? rlb: (I mean I know there are C interpreters, and we *could* have a C dialect, but we don't have one in guile ATM?). RhodiumToad: "C string" doesn't mean "string of C code" but rather "string as used in the C language" rlb: Umm, oh, yeah, so apparently ENOCOFFEE. jcowan: The (chibi show c) library allows you to generate C from s-expressions, and it's quite portable. rlb: Of course that's what abcd meant... abcd: rlb: yes it was what I had in my mind abcd: RhodiumToad: that is the function I was missing! rlb: abcd: apologies, I was clearly assuming you were saying something entirely unlikely. RhodiumToad: oh there's even a scm_c_eval_string RhodiumToad: so no need to even convert to a scheme string first abcd: Sorry but the reference manual is rather complicated and I got lost rlb: abcd: https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Conversion-to_002ffrom-C.html rlb: ? RhodiumToad: see under "Fly Evaluation" under "Read/Load/Eval/Compile" RhodiumToad: -- C Function: SCM scm_c_eval_string (const char *string) rlb: If you just want to convert C strings to guile and vice versa -- and what RhodiumToad says for actual evaluating scheme code in a C string. abcd: great! Thanks for the help on this abcd: and now it comes my second question rlb: (In my defense -- I heard "evaluate a C string" as "evaluate a *C* string" -- been working on compilation related stuff too much lately I guess...) abcd: rlb: no problem! abcd: so what would you suggest to use in guile as a configuration object? abcd: I was looking into records abcd: and the reference manual suggests to use SRFI-9 Records, but they apparently do not have a C API rlb: abcd: you can also call scheme procedures directly via the scm_call_... functions after looking up the function via the symbol, creating the args via the right scm_from... functions, etc. abcd: would you have some suggestions on how to generate some object in guile to be translated to a C struct? dsmith-work: abcd: These structs are known to C at compile time, right? abcd: yes rlb: abcd: if the thing's eventually destined for a C struct, I might either just have the guile side fill in the C struct (by providing functions to the guile side), or just (if it's simple enough) use alists or hash tables or combinations on the guile side, and then make the relevant calls into guile at the end to fill in the C struct from C before passing it to the C code. abcd: well, the configuration would actually be an array of structs rlb: for the former, see "foreign objects" in the info pages. rlb: for the latter, see all the functions like scm_assoc_*, etc. abcd: I was looking into the foreign objects section in the manual abcd: I do not understand what these slots are meant to be abcd: would they be some piece of memory that is handled by guile? RhodiumToad: each slot contains a pointer, integer, or scheme value RhodiumToad: think of the foreign object as having an array of slots abcd: so I could use a slot with a pointer to the struct RhodiumToad: yes abcd: instead of having a series of slots one per struct element abcd: how would you handle an array of structs? abcd: in a single slot or one struct per slot? RhodiumToad: depends what you want to do with them, I guess RhodiumToad: the number of slots for a given object type is fixed afaik abcd: oh ok, that has to be dynamically generated reading the JSON abcd: so it is not known at compile time RhodiumToad: might be easier then to read stuff into a scheme list, and then process that from C abcd: a list of records? or hash tables? RhodiumToad: whatever makes sense for the app rlb: abcd: you could just "cons" up the list of items and then reverse it at the end, but if you're going to be parsing json, I'd imagine that a key determinant of the rest of the process will be the json module's API, i.e. what does it return, or is it callback based or... I haven't don't json work from guile much lately, so don't know what the likely options are. abcd: good point rlb: ...since guile has a js dialect, I'm a little surprised we don't have a built-in json parser, but don't see it in the info pages. abcd: I found this module: https://github.com/aconchillo/guile-json abcd: the annoying thing is that it is another dependency for my software, that is not packaged in the major linux distributions brendyyn: this has mysteriously popped up on hn https://news.ycombinator.com/item?id=22591194 RhodiumToad: hm. the point about the circular dep is a good one, how best to break that? RhodiumToad: bleh, did my last comment get through? rekado: sneek: later tell brendyyn See also https://github.com/bl0b/nabs sneek: Got it. abcd: RhodiumToad: is GNU make really necessary for compiling guile? Using the old bsd make could break the dependency cyle chrislck: abcd: see srfi-180 still incomplete. abcd: chrislck: Thanks! RhodiumToad: the freebsd guile port specifies gmake, so it probably does need it, though I haven't looked at why abcd: maybe it's just because nobody bothered to try :) jcowan: One possibility is to use an option to build gmake without Guile and use that to build Guile. RhodiumToad: that's awkward from a packaging point of view RhodiumToad: yes, you can end up installing gmake-minimal and gmake-full or whatever RhodiumToad: or gmake and gmake-guile RhodiumToad: of course, most people will have built gmake without guile dsmith-work: Debian make seems to be missing guile support. jcowan: Another option is to build Guile with (OMG!) a shell script dsmith-work: More exciting: Have guile's Makefile depend on a guile-enabled make. jcowan: Compiling Chicken depends on having a Chicken compiler. RhodiumToad: that's true of many languages rekado: see http://bootstrappable.org/ RhodiumToad: worst case, some languages (looking at you rust) require a very recent version of their own compiler jcowan: However, because the generated C is system-independent, you can rely on the project to provide you with the C in the tarball. heisenberg-25: Hi, Is there a gRPC implementation for scheme(guile)? jcowan: so to build the head, you either get a recent binary of Chicken for your system, or you grab the latest tarball with the C code, build it, and hope it is recent enough to build the head. rekado: generated C is not really “source” code civodul: s/really// :-) jcowan: In the sense of the GPL, no. dsmith-work: That really fast (and pretty good) Scheme compiler that I can't remember about r6rs timeframe also needed a copy of itself to bootstrap. dsmith-work: Sheesh. I can't remember it. weinholt: Ikarus? dsmith-work: Yes! dsmith-work: Happy Happy Joy Joy dsmith-work: And Vicare was the following continued development. abcd: Going back to the JSON parsing problem, what if I use the ecmascript compiler to parse the JSON? Isn't JSON a subset of javascript? jcowan: The reason for forking SBCL from CMUCL was precisely that CMUCL can only be bootstrapped from itself, whereas SBCL can be bootstrapped with itself, CMUCL, OpenMCL, and even CLISP (which needs no bootstrap) rlb: debian has both "make" and "make-guile" packages iirc. rlb: (binary packages anyway) *: rlb is considering a deb make nmu to update the guile version... jcowan: abcd: That is a *very* unsafe thing to do. Use a proper JSON parser. dsmith-work: rlb: Ahh, didn't realize that. (make-guile package) oni-on-ion: how come they didnt accept the changes into CMUCL and continue jcowan: You'd have to talk to the CMUCL maintainers. jcowan: As of now they have been separated for 20+ years, but there is still cross-fertilization going on wingo: civodul: you still working on weird threading bugs? civodul: wingo: on and off, yes civodul: did you see the patch i posted a couple of days ago? civodul: https://issues.guix.gnu.org/issue/28211#23 weinholt: rotty, what's the latest on the pipe bug? wingo: civodul: weirdly, i wrote a reply but i can't find it atm wingo: maybe lost as a draft on my work machine that is in quarantine :P civodul: oh :-) wingo: found it and sent the reply :) civodul: yay! wingo: civodul: fwiw i think your patch is close but not quite the right thing, eagerly resetting the SP will prevent some live values from being marked civodul: wingo: ah! civodul: could you show me what you have in mind? civodul: i read your message and wasn't sure wingo: so i think the right strategy is to reset FP (collapsing the top N frames into one big frame), then the shuffle down, then setting SP (shrinking the top stack frame) civodul: oooh wingo: no need to mess with volatile pointers afaiu wingo: i.e. basically just move up the vp->fp = new_fp line before the value shuffle wingo: does that make any sense? :) civodul: wingo: yes, it does! civodul: i think the other bug i was chasing must have been because of my broken patch wingo: i don't doubt it, unmarked values can be gnarly wingo: ok zzz wingo: night! civodul: night! brendyyn: so when is guile gonna become a Rust extension language and jump on the hype train? civodul: isn't it hype already? :-) rlb: civodul: so all the release archs built fine with that one patch of yours *and* some disabling of the jit, *except* for a "FAIL: asyncs.test: preemption via sigprof" failure on amd64. I suppose I'll try integrating 3.0.1 and just defer the 3.0 testing migration a bit longer, but any idea offhand if bits in 3.0.1 might be expected to affect that asyncs test? brendyyn: civodul: I was wondering if it could be used with c++ and found a 2015 thread about it. i dont understand anything about that exception stuff, but python works with c++, why couldnt guile brendyyn: lots of graphics and game stuff, qt etc is c++ civodul: rlb: i don't think anything in 3.0.1 affects this tset civodul: i've never seen this test failure though, so i don't know rlb: ok, thanks. rlb: Knowing that helps too (i.e. not known to be unpredictable). civodul: yeah civodul: either way, i'd recommend moving to 3.0.1 rlb: oh, sure -- was just trying to isolate variables a bit if I could, but didn't work out :) rlb: (i.e. thought I might be able to stabilize 3.0.0 first, and then add 3.0.1) civodul: heh, i see :-) lfam: What's the push URL for guix-artwork? lfam: Sorry, wrong channel rlb: What's a reasonably efficient way to build a string char by char right now? i.e. if you're parsing and appending chars as you read them. Do I likely need to manage my own buffer? rlb: (or maybe string ports would already handle that (well enough for now) for me...?) oni-on-ion: whoa, nice! https://www.gnu.org/software/make/manual/html_node/Guile-Integration.html spk121: rlb: I would (define str (make-string LENGTH)) (string-set! x i #\c) rlb: spk121: ahh, right, so manage my own buffer. I suspect that's where I'll end up eventually... spk121: rlb: but don't prematurely optimize. Try writing to a string port to see if it is good enough. rlb: spk121: agreed - that's what I'm doing for now. regtur: civodul: did you receive my copyright assignment in good order? regtur: assignment request that is civodul: hi regtur! civodul: yes, we received the request and the message from the copyright clerk civodul: i have to comment on your latest patch wingo: o/ janneke: \o chrislck: o\ lloda: //o nerdypepper: \\o regtur: civodul: comment to whom? civodul: regtur: to you i guess :-) civodul: maybe there's not much left to discuss though regtur: just let me know if there is civodul: sure regtur: thank you dsmith-work: UGT Greetings, Guilers wingo: rerro spk121: ooh, compiling Guile with -Wshadow reveals some interesting possible sources of confusion, but probably no bugs as far as I can tell civodul: spk121: yeah -Wshadow was prompted by actual confusion in Guix :-) tohoyn: in Gtk the constructors usually have return type GtkWidget. it would be could to have constructors having type of the constructed object as a result type. tohoyn: s/could/good/g tohoyn: the introspection library (Golf) has a flag for constructors tohoyn: but how to obtain the type to be constructed? daviid: tohoyn: (gtk-window-new 'toplevel) -| #< 556143c74aa0> daviid: so does (make ) tohoyn: daviid: gtk-label-new returns tohoyn: daviid: AFAIK this is an usual convention in Gtk tohoyn: daviid: of course the dynamic type of the object is the type to be constructed daviid: (gtk-label-new "Bluefox") -| #< 556143ca0940> tohoyn: daviid: yes tohoyn: daviid: I'm developing a programming language with static type declarations tohoyn: daviid: so it would be good if I could declare the return type of gtk-label-new to be tohoyn: daviid: or have a constructor with different name for this tohoyn: daviid: of course it is possible to define this kind of constructors manually daviid: tohoyn: the 'type' is mfg: Hi guile, i have a question regarding the following stackoverflow question: https://stackoverflow.com/questions/48559030/flatten-top-level-sublists-in-scheme mfg: the first answer gives an outline on how to solve that problem, but i seem to have an off-by-one error somewhere. mfg: https://dpaste.org/D78r is what i thought would be correct, but i have (() 1 2 3 (((4 . 3))) (5 (6)) . 7) as an result for the example given in the answer... mfg: so what did i do wrong here> mfg: ? RhodiumToad: you want to flatten just one level? mfg: exactly mfg: well at least i think i want that, i'm not a schemer, so there might be a better solution for my problem... i'm trying to get this: mfg: ("cc_library_headers" mfg: (("name" "libcutils_headers") mfg: (("vendor_available" #t) mfg: (("recovery_available" #t) mfg: (("host_supported" #t) mfg: (("export_include_dirs" ("include")))))))) mfg: into one list, but flattening destroys the sublists which i don't want RhodiumToad: why is that adding a nesting level each time? mfg: it is generated by a parser and the grammar rule is right recursive RhodiumToad: hm RhodiumToad: and the result you want is ("cc_library_headers" ("name" "libcutils_headers") ("vendor_available" #t) ...) ? mfg: yes, that is my goal RhodiumToad: or in short, (1 (2 (3 (4 (5))))) becomes (1 2 3 4 5) mfg: with numbers it should look that way yes RhodiumToad: how about (let loop ((lst lst)) (cond ((and (pair? lst) (pair? (cdr lst))) (cons (car lst) (loop (cadr lst)))) (#t lst))) RhodiumToad: or the equivalent with (match) RhodiumToad: or RhodiumToad: (define (unnest-right lst) (match lst ((h t) (cons h (unnest-right t))) (x x))) RhodiumToad: I think your question was not well stated mfg: what is your difficulty with my question? i'll try to clarify :) RhodiumToad: the question you asked didn't seem to have anything to do with the example you just showed above RhodiumToad: the code I gave is for the example above, not for the original question mfg: the original question arose, because i tried to solve what i showed in the example. i thought i could recursively take the car of such a nested list and flatten it one level after each recursion step mfg: but i didn't get the flattening right mfg: i don't even know about match :D, i have seen it in code but i never looked it up (it's the first time i'm using guile) RhodiumToad: needs (use-module ((ice-9 match))) RhodiumToad: er, use-modules mfg: i noticed that, it seems to work. that means i really have to read the documentation about it :D mfg: thanks for your help :) rlb: It looks like more or less all the files in guile-3.0-dev are now versions except aclocal/guile.m4. I'm guessing that's intentionally "shared"/cross-version and you'd normally want the newest one, so I should perhaps either put it in a separate guile-X.Y-autotools package, or just handle it via update-alternatives? rlb: (Oh, and context here is wrt the debian packages.) rlb: The latter approach might be a bit less desirable if we don't want an update-alternatives call to select say 2.2, instead of 3.0, to also downgrade the guile.m4. rlb: sneek: later tell civodul any idea if that bug you just fixed might cause the "Aborted" failures we're seeing? sneek: Will do. daviid: mwette: I don't know a good tutorial about GObject memory layout daviid: i confess I don't understnd what you're trying to acheive, but i suggets you speak to str1ngs, wh know better then i how to make things so that they become instrospectable, then, g-golf or any other language can use it ... str1ngs: mwette I don't have a backlog here. I just have daviid's comment were you needing to create a custom GObject or something? gagbo: Hello, is there a way to append stuff to a vector ? Or should I really create a new vector and allocate it correctly from the start (if I want to (append vec '(lot of stuff))) ) RhodiumToad: vectors are supposed to be fixed lengths, no? RhodiumToad: quoth the manual, "Unlike lists, the length of a vector, once the vector is created, cannot be changed." gagbo: fair enough, I wondered if there was some function that created a vector filling the first n spots with a copy of the previous one RhodiumToad: srfi-43 has a command to copy one vector to part of another one RhodiumToad: (vector-copy oldvec 0 newlen) gagbo: I was weirded out because I forgot to evaluate my buffer in emacs once I added (srfi-43). Thanks again for reading the docs better than I do :) stis: hej guilers! civodul: civodul, rlb says: any idea if that bug you just fixed might cause the civodul: "Aborted" failures we're seeing? civodul: rlb: what "Aborted" failures are you talking about? rlb: civodul: https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=i386&ver=3.0.0%2B1-6&stamp=1584209247&raw=0 rlb: I finally got all the archs building, just not at the same time :) i.e. once I fixed the failures that disabling the jit appears to fix, that happened on i386, which had been "fine" for the previous 5 builds of the same version :) https://buildd.debian.org/status/package.php?p=guile-3.0 rlb: e.g. https://buildd.debian.org/status/logs.php?pkg=guile-3.0&arch=i386 rlb: civodul: and I didn't realize sneek could only remember one thing at a time... Also previously -- my "clever" plan to make a more efficient pcre2 wrapper might not work out for common cases. So far it doesn't look like pcre2 can be asked to treat an ios-8859-1 byte sequence as a unicode subset, i.e. for byte-width units, it looks like it can only do utf-8 or "not unicode" with somewhat differing behaviors. dsmith: rl dsmith: rlb: YEah, if you tell the bot to "remember" something more than once, it randomly grabs one of them. dsmith: sneek: foo is bar sneek: Okay. dsmith: sneek: foo is baz sneek: Okay. dsmith: sneek: foo is zap sneek: Understood. dsmith: sneek: foo? sneek: From what I understand, foo is zap dsmith: sneek: foo? sneek: I could be wrong, but foo is zap dsmith: sneek: foo? sneek: Last time I checked foo is baz dsmith: sneek: foo? sneek: From what I understand, foo is possibly sane dsmith: sneek: foo? sneek: foo is not sane dsmith: sneek: foo? sneek: I could be wrong, but foo is possibly sane dsmith: sneek: forget foo sneek: Okay. dsmith: sneek: foo? dsmith: But it forgets all. dsmith: sneek: foo? civodul: rlb: re crashes, you should try 3.0.1 + patch for https://issues.guix.gnu.org/issue/39266 civodul: we'll probably make a 3.0.2 soonish rlb: civodul: hah, right, that's exactly what I was asking. rlb: civodul: and for now I ended up disabling the jit on armel, armhf and x32 (basically wherever I saw what looked like the same "Segfault" (not the "Aborted"). Does that sound appropriate for now? civodul: rlb: that's an option, but the best one is the one above IMO :-) civodul: that's what we did in Guix, and now all arches pass fine (well, it's just: x86_64, i686, armv7, aarch64) rlb: Ahh, ok, so your fix might well resolve the same problems that disabling the jit did -- if so that's excellent, and I'll plan to try it soon. rlb: (And thanks for the info.) rlb: ...ok, think I may have figured out the arrangements to allow installing multiple guile-X.Y-dev debs at the same time -- under the assumption that guile.m4 is meant to be "shared", and we'll handle it via update-alternatives (separately from everything else, so that even if you change the guile-config, etc. alternative, it won't affect the m4). civodul: rlb: yeah, we were seeing a segfault on ARMv7 with JIT enabled that this patch fixed civodul: there's quite a few bugs that were merged if you look at the top of the page civodul: always pleasant :-) rlb: yeah, I'm finishing up some issues with the 2.2.6 and 3.0.0 debs, and then I'm going to see about merging the new releases. spk121: rlb: you can check if a string is wide or narrow with (define (is-wide? x) (assv-ref (%string-dump x) 'stringbuf-wide)) rlb: spk121: yeah - I'd imagine; but since I'm on the C side in this case, I can just use the scm_i_ calls. I was just speculating about whether we might be able to offer some supported way to do that, even if it might become less efficient if we change the internal representations some day. rlb: But for now, I may just accept the risk of the scm_i_ calls... spk121: rlb: makes sense. There have been discussions of UTF-8 as the internal representation, someday spk121: If we ever redo the internal representation, we could add in Perl's trick where the string representation also can represent both unicode codepoints and unencoded bytes. Emacs does something similar jcowan: "Trick" is the word. daviid: tohoyn: in g-golf, struct are instances, not class daviid: all 'struct' are cached under the 'boxed key, because some actually are 'seen' as 'boxed, not very sure why that is, but it happens that most of the time, GVlaue fundamental type tag for those will be 'boxed, not 'struct ... daviid: now daviid: some of these are opaque, or semi-opaque, which means g-golf won't (as it shouldn't) neither encode nor decode those, but 'blindingly' pass its pointer, and users must use the struct procedures and 'methods' api daviid: but looking at (gi-import-by-name "Pango" "Attribute"), although it's not opaque nor semi-opaque, its name is wrong, and its registered type sems suspicious as well, not sure why, i'll ask on #introspection daviid: tohoyn: so you may try (gi-import-by-name "Pango" "Attribute") - then use (describe $xx) to see its def/content, as see for yourself that the name is 'wrong' and the registered type is rather suspcious daviid: tohoyn: it's probably ben imported already, it is cached under 'struct 'void, and that is a problem because qute a few struct/boxed will also have "void" as their registered name, I have to figure out why ... daviid: tohoyn: to nswer a previous question, all methods of imported GObject subclass are always imported, so far though, using their long name only, getting their equicvalent short name method is on the todo list ... daviid: *cached under 'boxed 'void, not 'struct 'void tohoyn: daviid: is there going to be an alpha release of g-golf? rbarraud: Hiy'all rbarraud: It's peak ADHD/imsomnia wide-awake time here. rbarraud: :-/ rbarraud: RhodiumToad: Might even be up for some packagin' :-) rbarraud: First I'll RTFM on the subject... rbarraud: Weirdly. my Handbook seems to have evaporated... probably as a result of 'make install/deinstall/reinstall' of ports cascade from wanting Just One Simple Thing to work.... :;-/ rbarraud: ... @ least 12.1 is a bit kinder than the poor tired ol'11.x I replaced it with (after too long) rbarraud: FreeBSD* rbarraud: rbarraud: Also suspect I may have an MSG buzz on at the moment - Wonton noodle soup reheated from last nigght from local (best I've found here yet) Sichuan place. rbarraud: :-) rbarraud: Yup, we don't all live inside hillsides, have hairy feet or wear grass skirts down here... amazingly :-) rbarraud: [NZ] rbarraud: Hi catonano rbarraud: Hope you are keeping well rbarraud: :/ rbarraud: :-/ * rbarraud: Interesting Times... tohoyn: the argumen type descriptor of the third argument of procedure gtk-drag-dest-set is "(c -1 #f 2 interface)". What does it mean? tohoyn: this is g-golf mwette: daviid: I started laying out something here: https://paste.debian.net/1134913/ mwette: The objective is to look at object layouts to try to come up with something that could be common amoung a set of different language front-ends on to of Guile rlb: spk121: I'd have to think about that -- the clearest handling I've seen so far of "reality" is rust's string vs osstring. I'm hoping that eventually Guile will be able to do something similar, i.e. so it can more cleanly handle paths, usernames, groups, etc. For now, I've just been trying to be very careful and "carry" them as iso-8859-1 (i.e. make sure they encode/decode via "narrow" strings). rlb: sneek: later tell civodul my "clever" plan to make a more efficient pcre2 wrapper might not work out for common cases. So far it doesn't look like pcre2 can be asked to treat an ioso-8859-1 byte sequence as a unicode subset, i.e. for byte-width units, it looks like it can only do utf-8 or "not unicode" with differing behaviors. sneek: Okay. rlb: Still chasing 3.0 failures in the debian buildds -- disabled the jit on a number of archs (armel armhf x32, etc.), but now a new failure on *i386* (where it was passing fine before). Anyone recognize this (see the "Aborted" at the end)? https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=i386&ver=3.0.0%2B1-6&stamp=1584209247&raw=0 rlb: was fine there 5 times out of 6 (none of those revs should have changed anything material to i386): https://buildd.debian.org/status/logs.php?pkg=guile-3.0&arch=i386 rlb: It'd be nice if we could eventually have better output when you accidentally create a use-modules dependency cycle. At the moment I just see indirect failures not obviously related to the problem and have to go hunting. mwette: civodul: yea, pretty cool quote; guix will generate more lisp fans, for sure jcowan: Or fewer guix fans, whichever mwette: jcowan: you have a point rbarraud: LOL :-) rbarraud: Maybe in here... rbarraud: Does 3.x have the malloc race bug? rbarraud: Or did we leave it behind in 2.2.x? rbarraud: [While building guix on high-core-count/huge-RAM b0[r]xen] rbarraud: I looked at the [archived mailing-list] threads around it to some extent, didn't see a resolution... to what extent has it been investigated? Who is/was looking into it? rbarraud: Confession: I have been [slooowly] thinking/working on an x86-64 [eventually] on-the-metal Scheme for a while... thinking Guile 3.x might make it moot. rbarraud: Initially ASM-only, x86-64/amd64-only rbarraud: ..but intending to bootstrap it by some means or other [fair or foul? ;-) ] rbarraud: To my mind, Scheme [thru Racket et al, and now from the looks of it, Guile] subsumes pretty much everything else in the languages space, semantically. rbarraud: In my mind I anecdotally/vaguely (?) feel some sort of congruence with FORTH at some level too. rbarraud: [Yeah I know, the Devil is in the Details :-)] rbarraud: I've had it running the SICP metacircular evaluator [to some extent at least], so kinda getting there... between dealing with Real Lif Issues [MMMV :-/ ] rbarraud: Anyhoo I'll say no more here about it at this stage... since it's essentially related but strictly OT. rbarraud: *On* topic though: rbarraud: I see that 3.0.[01] has some included language-y bits ... incl brainf*** rbarraud: :-) rbarraud: [LazyIRL] did 2.2 have those? rbarraud: What's the philosophy? wleslie: from the start guile was supposed to be a multi-language runtime rbarraud: Can't only be as a bootstrap mechanism for building Guile per se ... as I find it hard to imagine it actually depends on anything useful written *in* BF :-) rbarraud: Ahhh OK rbarraud: So it's historic from way back? rbarraud: That confirms mu hunch re subsumption of languages :-) rbarraud: my* wleslie: well, there was this point the maintainers hit where they thought, we don't really have any good examples of how to do this in-project rbarraud: So it's somewhat vestigial at this point? wleslie: no, not at all wleslie: there is one major "other language rbarraud: ...potentially something which people could take up again should Guile be sufficiently popular? rbarraud: Sorry, crossing in the 'mail' there. wleslie: " that lived on guile at the time, in the form of lilypond, but guile broke lilypond significantly with the 2.0 release rbarraud: Yeah :-/ wleslie: so guile needed a good "here's how to do it, this is the way we support building different languages" rbarraud: And on FreeBSD at least, you can't have 1.8.x and 2.2.x at the same time - @ least not using the vanilla pkg's wleslie: my understanding is that the small included languages are a sort of sample for how to integrate wleslie: and a bit of a test suite for compiler changes rbarraud: Ah OK well that makes sense rbarraud: I shall explore it some more in non-[LazyIRC] mode then :-) wleslie: http://wingolog.org/archives/2009/02/25/callcc-and-ecmascript wleslie: http://wingolog.org/archives/2009/02/22/ecmascript-for-guile rbarraud: Another Q for any takers: What is the relationship between MIT Scheme and Guile, both in terms of the codebase, and personnel (teams, leadership, philosophy) from the POV of denizens in here? rbarraud: So I take it Andy is head honcho? rbarraud: [at least in a modulo-GNU sense] :-) wleslie: guile is effectively a large language, with a good C integration story and modern compiler rbarraud: Is MIT/GNU Scheme still being maintained ? Separately from Guile? rbarraud: What if any is the overlap? rbarraud: I'm more aware of MIT-Scheme Hx, looked fairly intensively at it... but not sure what the 'modern'/current situation is for it. rbarraud: Apologies if this is not the place to ask :-/ wleslie: tbh I'm actually quite ignorant of the latest in the MIT/GNU Scheme space, but it looks like it's had recent fixes and updates rbarraud: So presumably there'll be an active MIT-scheme IRC channel... ZombieChicken: Is 3.0 compatable with 2.2? Just want to know if there are any breaking changes wleslie: Goops classes are not redefinable by default, so that's at least one breaking change wleslie: default gettext alias is G_ wleslie: and check out new deprecations and removal of old deprecations in https://lists.gnu.org/archive/html/guile-devel/2020-01/msg00080.html ZombieChicken: ty dsmith: rbarraud: I've noticed parallels between Scheme and Forth too. Not so much at the language level. dsmith: rbarraud: I can't really put it into words very well. It's like how you approach thinking about solutions. dsmith: Well, and having a REPL. dsmith: IN both, you end up writing some kind of domain-sepecific language, and work the problem domain with that. rbarraud: Yup rbarraud: But there are some more basic congruences. rbarraud: OTOH there is no intrinsic (necessary) equivalent of FORTH's data stack rbarraud: ...but there could be an implementational correspondence. rbarraud: I see Andy W's comment (from 2009) re gdb et al (and debuggers generally?) not being able to deal with a non-C-style interleaving of control-flow and data stacks... jcowan: The mutable-stack view of Forth has a dual: the purely functional view in which all Forth words take a stack as their only argument and return a stack. rbarraud: I'm not entirely convinced... jcowan: I'm a pretty good Scheme programmer, a terrible Forth(-like) programmer, but I did write a Forth-like (Joy) in Scheme. rbarraud: My Scheme 'plan' if you can call it that, is/was going to experiment with that congruence, so I need to find out whether he is right or not. jcowan: where a Forth stack is just a list rbarraud: Hiya jcowan jcowan: hey ho rbarraud rbarraud: I'm just about trembling - recognized the name... jcowan: pffft rbarraud: I shouldn't be I guess... While not in the UeberKlass, I have earned my neckbeard ;-) rbarraud: LOL rbarraud: And have a supply of nickels at the ready ;-) rbarraud: Ah yes - Basically a FORTH-monad rbarraud: ? rbarraud: I would think the implementational difference would amount to whether one chases a list to walk the (synthetic) stack(s) rbarraud: jcowan: BTW as an aside, a friend (now working in .ca for Amazon) and I *almost* met Slave when he was in Wellington... we flew down from AKL. He blew us off :'( rbarraud: [FactorMan] rbarraud: We had a good trip though, despite that. rbarraud: I'll remind him if I ever do get to meet him :-/ rbarraud: ...so anyhoo, the assertion that it's impossible/impractical for debuggers (gdb specifically?) to grok a non-C-style stack fpr Guile bewilders me a bit. rbarraud: for* rbarraud: [ADHD moment: Wonders whether I should call Seth Green and ask whether Robot Chicken wanna make an episode of Celebrity DeathMatch with Factor vs. Julia...] rbarraud: jcowan: The only people who have to *earn* a beard are transmen. Everyone else either doesn't get one or just has to let it happen. jcowan: anyhoo, I have no idea who Slave is rbarraud: Slava* rbarraud: Author of Factor rbarraud: LOL yeah rbarraud: Perhaps I've earned the right to retain it though :-) rbarraud: "Two kinds of people have no beards: Women and Boys. I am neither" ;-) wleslie: also, those who shaved this morning rbarraud: Trudat :-) rbarraud: Your Shaveage May Vary rbarraud: [Mines's usually consistent == 0] rbarraud: Anyone written an HAP in Guile? rbarraud: * Hirsuteness Assertion Prover apteryx: how do I sort strings in decreasing length? apteryx: ok, this works: (sort '("/" "gnu" "/gnu/store") (lambda (x y) (< (string-length y) (string-length x)))); anything simpler? apteryx: ah, string? jcowan: rbarraud: Oh, got it, thanks rbarraud: jcowan: Yeah sorry, I kinda misplaced the links... been a while. jcowan: In my case, my wife was for it, which seems to be unusual in the US. When I talk to other men about why they don't wear beards, they always point to their significant others spk121: All the young male techies in my part of Los Angeles seem to be rocking a constant 7-day stubble. rbarraud: Heheh rbarraud: Mine prefers [well preferred, I'm not there at the moment :'( ] me to have it but not too long. rbarraud: Stubble is spiky. rbarraud: I suspect many of the SO's have never gone beyond the short-term local optimum. rbarraud: jcowan: Are you from the US originally? rbarraud: I'm from - and still in - NZ rbarraud: Good Scots name yours :-) rbarraud: Any relation to Andrew, the rally driver? rbarraud: He drove a Mini in NZ to great effect back in the day... rbarraud: ...and not one of the ersatz BMW modern knockoffs either :-) rbarraud: But I digrees ;-) rbarraud: digress* rbarraud: For my part re not-mainstream langs, I'll confess to confusing Julia with Joy rbarraud: from time to time rbarraud: Joy is I believe a FORTH-like / contatenative lang jcowan: rbarraud: From and in the U.S. My grandfather immigrated from Ireland (native Irish, not Ulster Scots). jcowan: Cowan is Mac Eoghain, the son of Owen, and appears in both Ireland and the Scottish Highlands. jcowan: Joy is very like Forth except that instead of gotos it has substacks. rbarraud: Right. rbarraud: My lot have been in NZ since ~1840 rbarraud: French by way of England (Huguenot exodus, 1704) rbarraud: ...and I feel kinda stranded down here :-/ rbarraud: Considering going to Canada for a while. rbarraud: :-) rbarraud: Never been past Nadi, Geelong or Newcastle, NSW yet.. and until ~ 2 years ago, hadn't seen most of the South Island. rbarraud: Sad eh - waited for Bro, friends etc to go with me on a M/C tour ... set too long a timeout (~30 years :-/ ) ... finally caught my own signal and did the tour :-) rbarraud: Loved it. jcowan: I traveled a lot during sumers with my parents, but I've only adulted in a few states, if you discount conferences rbarraud: :-) rbarraud: Discounted confs sound good do me ;-) rbarraud: WWDC would be nice... ;-) rbarraud: Anyhoo... I snarfed julia<$v>.pdf rbarraud: so having a proper look rbarraud: Thanks :-) rbarraud: BTW not sure whether this is helpful since the Manual is avwoedly a WIP, but... rbarraud: Ch 99 and 100 have the same title... and very-related content. rbarraud: jcowan: rbarraud: Also Ch 106 title is a little Meta for me... s/Documentation of// perhaps? rbarraud: :-) rbarraud: [Not that there's anything wrong with meta ... in the right places :-) ] rbarraud: Phonetically, makes a great conductor. rbarraud: [Spot the Cryptic crosswords fanboi ;-) ] rbarraud: 'Nite USA and Canada :-) rbarraud: Dinnertime here in Middle Earth... rbarraud: Upside of Globally Homogeneous Monoculture: I can haz Uber Eats :-) rbarraud: 0mn0mn0m rbarraud: [Meta: That's about all by way of intro from me here ... will dial back the Chatty from here on out.] rbarraud: [Meta: All welcome over @ #SICP ... more NZers in there too, not all as chatty as me. OT and meanderings tolerated/welcome. Cheers] ZombieChicken: in Racket I was using a variant of vectors called growable vectors for something, but those seem specific to Racket. Is there anything in Guile that would allow for easy insertion/deletion of an entry at arbitrary points? ZombieChicken: list feel kinda like crap for something like that (bad access time, need a new list anytime a change is made), and none of the other options seem like obvious options to me ZombieChicken: nvm. I think I figured something out rekado_: ZombieChicken: Guile has arrays, which give you better access times. rekado_: doesn’t help with deletions or insertions, though spk121: Hmm. The C API for hooks never made it into libguile.h spk121: Apparently, I'm the first person to ever want to try to use it. spk121: civodul: ^ do you care if I add libguile/hooks.h into libguile.h? It looks like it was an oversight not to include it. spk121: wingo: ^ dsmith-work: Happy Friday, Guilers!! civodul: spk121: sure, it looks like an oversight civodul: hey ho, happy Friday! dsmith-work: jcowan: Thinking of Forth words as taking and returning one thing, the stack, and thinking of that stak as a list is *very* interesting. Never thought of it like that. spk121: OK. I'm gonna push a patch. jcowan: dsmith-work: Check out http://www.kevinalbrecht.com/code/joy-mirror/j00rat.html by Manfred von Thun, who invented Joy. Joy itself is based on the insight that since nested lists are straightforward, so are nested stacks: an example of Joy's conditional is [3 4 +] [5 6 +] [1 0 =] if, which evaluates [3 4 +] and returns 7. jcowan: Since there are no names except the global names of Joy functions (which are just abbreviations), there is no name-binding problem, and every Joy datum is also Joy code: [5 6 +] is a list that when evaluated becomes 11, and 11 considered as a function is one that accepts a random list q and returns q with 11 prepended to it. dsmith-work: jcowan: Thanks! wingo: hey hey! wingo: omg civodul 7c17655cd3d859bf0c5a86d9782a7788205fc05a is amazing wingo: my sincere apologies! chrislck: nly: sorry to ask about rastache... stalled? rekado_: civodul: I’m very impressed with the macrology in guix/monads.scm — it’s a wonderful learning resource civodul: rekado_: heh, glad you like it :-) civodul: wingo: np! civodul: here's another one for you to review: https://issues.guix.gnu.org/issue/28211#23 civodul: lmk what you think! civodul: apparently it's not the end of the story, i'm head-down in rr rlb: civodul: this may not be acceptable, but I feel like I might really like to have some way to officially ask for a pointer to the string bytes in a specific width (and an official way to ask the current width). Use case: efficient pcre2 wrapper. And if/when we ever change the storage again, those functions could specifically not define whether they might transform/copy (though for now they wouldn't). rlb: Then the process would be "ask the width", "request the pointer at that width" (which would be "free"), then call the pcre2 functions of the appropriate width. rlb: Though I need to double check some things, i.e. the 1-byte case -- if pcre2 can't handle that as latin-1, then this might or might not pan out (for the common case). civodul: there's scm_i_string_chars, but it's not good as a public interface civodul: i understand the need, though rlb: Yeah - I thought about just using that and accepting the risk. Which might be "just as good", i.e. if we changed our rep to require copying, then I might want to rewrite anyway. rlb: or "good enough for now"... wingo: fwiw you might be able to implement something using compiler interfaces rlb: I *am* in favor of the current position of reserving the right to change the storage, since we've done that more than once :) rlb: wingo: ? wingo: rlb: see module/language/tree-il/compile-cps.scm:1140 wingo: it's really version-specific though :) wingo: probably safest is to foreign-call some C function wingo: the tail-pointer-ref gives you the pointer and there is some branchiness about how to know if it is narrow or wide rlb: wingo: ahh, ok thanks. rlb: fwiw, may be about to have 3.0 building on all the debian release archs finally -- so it can propagate to testing. I'm also thinking about relaxing the current mutual-exclusion between the various guile-X.Y-dev packages. I don't think it'd be hard these days (given the now solid --prefix support). mwette: FYI, I've found that dynamic-link does not work reliably on Redhat, Centos, Fedora. So far, I have traced this back to libtool's lt_dlopen. In standalone C program, I can load with native dlopen, but lt_dlopen segfaults on same filename argument. mwette: scratch that; found error in C code tohoyn: daviid: gtk-container-add isn't there either daviid: tohoyn: hello! did you import "Gtk" tohoyn: tohoyn: yes tohoyn: I wrote a small script to print all the names of imported baseinfos tohoyn: daviid: do you want to look at it? daviid: tohoyn: let me paste an example we use, I and users, that is a simple hello-world ... daviid: tohoyn: here http://paste.debian.net/1134822/ daviid: try this and let's see ... tohoyn: daviid: thanks daviid: tohoyn: when you want to see what has been imported, use the cache, not the ifo daviid: (gi-cache-show) daviid: then (gi-cache-show 'function) daviid: or any other cache key og course ... tohoyn: ok tohoyn: daviid: is it so that gi-import-by-name imports the methods belonging to the classes, too? daviid: so, in this case you'd do: (gi-cache-ref 'function 'gtk-container-add) daviid: tohoyn: yes daviid: tohoyn: you cam iport the all namspace of course, (gi-import "Gtk"), but that may take a few seconds on 'old' not so powefull machines ... tohoyn: btw, you might be intersted in http://www.tohoyn.fi/theme-d/theme-d-gnome.html tohoyn: daviid: I have to leave now. thanks for help. daviid: wc! daviid: sneek: later tell tohoyn did the example work on your side then? sneek: Got it. mwette: So I found the problem with dynamic-link on Fedora et al: Fedora does not use .so as extension on shared library objects, and guile uses lt_dlopenext (i.e., not lt_dlopen), which slaps on .so and never finds the file. What to do? weinholt: mwette, will using lt_dlopen fix the perennial problem that (dynamic-link "libcurl") requires the -dev package? mwette: weinholt: I don't know. Are you on Fedora? Is that a libcurl specific issue? weinholt: mwette, i'm on debian. it affects curl because the .so file is in the -dev package; otherwise you just have e.g. libcurl.so.4 and libcurl.so.4.5.0 weinholt: hmm. or perhaps the real issue is that (dynamic-link "libcurl.so.4") doesn't work mwette: weinholt: Ah. Thanks. Let me see ... tohoyn: daviid: hello again. is there any way I can obtain all the methods belonging to some imported class? sneek: Welcome back tohoyn, you have 1 message! sneek: tohoyn, daviid says: did the example work on your side then? tohoyn: sneek: yes, it did. weinholt: mwette, strace says that (dynamic-link "libcurl.so.4") searches for "libcurl.so.4.so" tohoyn: I tried to import namespace Pango but I can't find the PangoAttribute class. tohoyn: I have tried and tohoyn: also Attribute and PangoAttribute mwette: weinholt: indeed, dnf install libyaml-devel installs a .so file, but I can't get the standalong C code to load it (yet). tohoyn: daviid: it says in the documentation that there can be only one instance of GIRepository in one process. Is it still possible to import several namespaces, e.g. Gtk and Pango? rekado_: I’m trying to write two cooperative macros. Can I access the *expansion* of the first macro in the second one? tohoyn: gi-cache-show seems to be what I need tohoyn: I still can't access the Pango attribute classes mwette: rekado_: not sure, but maybe the syntax transformer lambda is the way to go (using syntax-case) dsmith-work: weinholt: Does (dynamic-link "libcurl") find the file? tohoyn: (gi-cache-show 'boxed) shows pango-color but neither or work tohoyn: class pango-attribute is not listed at all weinholt: dsmith-work, (dynamic-link "libcurl") does not find libcurl.so.4 unless a -dev package is installed. according to strace it looks for "libcurl.la" dsmith-work: Ah dsmith-work: And indeed, using apt-file, libcurl.so is only in libcurl4-gnutls-dev, libcurl4-nss-dev, or libcurl4-openssl-dev dsmith-work: Debian Buster dsmith-work: Things have changed I think, but the way it used to work on Solaris, is you pass the .so to the linker, but the .so.x.y.z gets encoded into the executbale. dsmith-work: So when a new version of the .so is install, things linked against the older lib still work. dsmith-work: With that in mind, I guess it does make some sense for the .so to be only in the -dev package. dsmith-work: There are two kinds of dynamic loading. I don't know the right words to differentiate them. dsmith-work: One kind is encoded into the exectable, and it won't start unless it can be loaded. You can see these with ldd. dsmith-work: The other kind are loaded under program control. Like plugins. dsmith-work: The first kind need to be in the LD_LIBRARY_PATH (or known to ldconfig?) and need to be named "lib*.so*". dsmith-work: The second kind can be anywhere and can be named anything. mwette: dsmith-work: thanks. The behavior is odd in that strace shows file openeing but then lt_dlopen returning null ; mwette: openat(AT_FDCWD, "/usr/lib64/libyaml.so", O_RDONLY|O_CLOEXEC) = 3 *: dsmith-work shakes fust at libtool *: dsmith-work shakes his fist also mwette: but then goes to open /usr/lib64/libyaml.0.so.2, a symlink, so odd; so I thought maybe libyaml.so is a hardlink to libyaml.0.so.2, but it's not ; go fiture mwette: s/fiture/figure dsmith-work: Yeah, usually the .so is a symlink to the .so.x.y.z dsmith-work: I am really puzzled why that .so is only in the -dev. It's only a symlink, so just a few bytes. dsmith-work: Maybe it's becuse there could be several different implementations? (gnutls,openssl) dsmith-work: Maybe I just never noticed dsmith-work: sneek: file not found? sneek: file not found is use strace -efile or set LD_DEBUG=all dsmith-work: rlb: Did you recently trace through dynamic loading for that misleading "file not found" message? dsmith-work: rlb: Where it's really a symbol that is not found? dsmith-work: Hhm. Never realized the bare .so symlink should only be in the -dev package: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#development-files dsmith-work: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html "However, there are some exceptions for unusual shared libraries or for shared libraries that are also loaded as dynamic modules by other programs." mwette: lol, /usr/lib64/libyaml.so is a text file w/ entire content: INPUT(libyaml-0.so.2) dsmith-work: heh rlb: dsmith: hah, I'd forgotten about that -- yeah, though I didn't really do much other than figure out that was the problem, fix it the missing symbol, and move on... nly: chrislck: stalled? yes, stopped? no dsmith-work: rlb: Was it in libtool code? I dsmith-work: 'd really like fix that. rlb: I don't know -- I mean it was guile's load-library that I was calling, so likely going through libtool at some point? rlb: I don't recall for sure, but I think may have just been that the syscall was returning ENOENT (maybe meaning the symbol?) and so the sys_errlist string just said "no such file or directory". dsmith-work: Ahh, that may be. ZombieChicken: Uh, got a backtrace when compiling chickadee. Weird thing is this line: no code for module (gl) ZombieChicken: hold up ZombieChicken: Yep. Was missing a library path. Got it sorted out mwette: for guile-3.0.0, typing 'scheme@(guile-user)> ,L ecmascript', does anyone get 'Unbound variable: langauge-title' ? oni-on-ion: mwette, yep, i get that error./ mwette: maybe system/repl/command.scm : #:autoload (system base language) (...) need language-title and language-name added mwette: 3.0.1 seems to be working (running on installed system) RhodiumToad: redkahuna: to answer your question from yesterday, probably the two usages came about in different ways but just happened to use the same word RhodiumToad: a function with bindings for its free variables was called a "closed expression", shortened to "closure" RhodiumToad: whereas the other usage you mentioned comes from abstract algebra and topology rbarraud: RhodiumToad: Hiya RhodiumToad: hello rbarraud: I tried to look at Poudriere to retry pkg installs (once I learn how to actually make the pkgs :-) ) rbarraud: but FreeBSD 12.1 spits the dummy with a checksum mismatch with poudriere pkg :-/ rbarraud: Will try to look more in the next few days - long overdue to learn how to make pkg / port. rbarraud: Been using FreeBSD for around 4 years at this stage. mostly pretty happy with it. rbarraud: Wondering how many ppl have tried 3.0.1 on FreeBSD already? rbarraud: I'd be a bit surprised if I'm the first...? rbarraud: It's 1am here again so off to Zzzz again RhodiumToad: poudriere works fine for me rbarraud: Kewl rbarraud: at present? as in installing the pkg? RhodiumToad: which pkg? rbarraud: On 12.1? rbarraud: "sudo pkg install poudriere" RhodiumToad: what error did you get? RhodiumToad: (I actually build poudriere from ports initially) rbarraud: "[1/2] Fetching poudriere-3.3.3.txz: 100% 725 KiB 371.1kB/s 00:02 rbarraud: pkg: cached package poudriere-3.3.3: size mismatch, fetching from remote rbarraud: [2/2] Fetching poudriere-3.3.3.txz: 100% 725 KiB 247.4kB/s 00:03 rbarraud: pkg: cached package poudriere-3.3.3: size mismatch, cannot continue rbarraud: " rbarraud: Yeah I thought that might be the appropriate workaround RhodiumToad: weird, how big is the downloaded file, what arch are you on, and what repo? rbarraud: I struck another one with radare2 this evening too. RhodiumToad: and does pkg update help? rbarraud: FreeBSD latka. 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64 rbarraud: Nope rbarraud: :-/ RhodiumToad: ls -l https://itsosticky.com/1434pi0-rwe4da-1slu9y9-2al02l-134gfpf RhodiumToad: oops RhodiumToad: ignore that RhodiumToad: ls -l /var/cache/pkg/poudriere-3.3.3* dsmith-work: UGT Greetings, Guilers RhodiumToad: good afternoon janneke: happy UGT, dsmith-work! rbarraud: RhodiumToad: no matches found: /var/cache/pkg/poudriere-3.3.3* RhodiumToad: try pkg fetch poudriere ? rbarraud: The problem seems to be with the fetched file ... not sure what it's comparing with ... some manifest file entry presumably - local or on the remote repo? rbarraud: Same result :-/ rbarraud: (With the fetch vs install) RhodiumToad: try just doing fetch http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/poudriere-3.3.3.txz rbarraud: pkg: No packages matching 'http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/poudriere-3.3.3.txz' have been found in the repositories RhodiumToad: no, fetch, not pkg fetch RhodiumToad: literally just fetch http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/poudriere-3.3.3.txz chrislck: sneek: botsnack sneek: :) chrislck: yay rbarraud: RhodiumToad: Succeded, file is in cwd. *: sneek wags RhodiumToad: rbarraud: how big is it? rbarraud: So should I put it into /var/cache/pkg/ ? rbarraud: 742300 RhodiumToad: hm RhodiumToad: have you tried doing a pkg update -f ? rbarraud: Not with the -f lately, no... RhodiumToad: do it rbarraud: Yup ... that fixed it! rbarraud: Thanks :-) rbarraud: So what was scrambled, and how did it get scrambled? RhodiumToad: sounds like something up with the local copy of the repo manifest rbarraud: Yup RhodiumToad: update -f forces it to download the repo metadata again from the remote repo even if it's apparently up to date rbarraud: That also fixed the issue with the radare-cutter install. rbarraud: I would have thought there would havce been a checksum over the manifest that update or pkg install would have been checking as a matter of course. rbarraud: TIL... :-) rbarraud: Now I really should be in bed :-) rbarraud: Thanks :-) rbarraud: zzz rbarraud: PS: I guess this is the sort of thing that Guix aims to fix. rbarraud: zzzz RhodiumToad: I'm pretty sure there are checksums, but the data is stored locally in an sqlite db and it's not entirely unknown for that to be corrupted in various ways civodul: mwette: i like that quote of Steele that you posted to guile-user :-) gagbo_: quick question : if I'm creating a record-type in a module, I have to #:export all the accessors/constructor/predicate it has individually or is there a helper to just "export this record-type" ? gagbo: (Maybe duplicate because I disconnected apparently) quick question : if I'm creating a record-type in a module, I have to #:export all the accessors/constructor/predicate it has individually or is there a helper to just "export this record-type" ? gagbo: Bonus : How can I (map) a function on a vector ? Seems like I have a wrong type argument when I try so RhodiumToad: vector-map from srfi-43 ? RhodiumToad: also iirc the array functions work on vectors too gagbo: RhodiumToad: (vector-map string->symbol #("Hello" "World")) errors out while (map string->symbol '("Hello" "World")) works fine gagbo: I'll try the array one gagbo: (I was confused because I was searching the "concept index" instead of the "procedure index" ; I think that's why I didn't find out vector-map, but now I'm at the relevant part of the manual) RhodiumToad: gagbo: did you load srfi-43 ? RhodiumToad: ah, and vector-map passes the index as the first arg to the function RhodiumToad: (vector-map (lambda (i s) (string->symbol s)) #("Hello" "World")) gagbo: yeah just found that out, thanks for your time RhodiumToad gagbo: Oh, and for exporting a record from a module there's no trick right ? Have to #:export every accessor by hand ? *: RhodiumToad not an expert on modules gagbo: I'll export everything for now, it's not that important gagbo: It looks like there's a mismatch between doc and code : manual tells there's a define-immutable-record-type in srfi-9 https://www.gnu.org/software/guile/manual/html_node/SRFI_002d9-Records.html#index-define_002dimmutable_002drecord_002dtype but it looks like it's not there actually http://git.savannah.gnu.org/cgit/guile.git/tree/module/srfi/srfi-9.scm#n62 daviid: str1ngs: I found the cause and pushed a fix, please try and let me know if also works on your side ... str1ngs: daviid: working now thanks. FYI there is a orphaned dimfi somewhere. I'm seeing ;; param-n value 2 daviid: str1ngs: ok good, will remove the ghost dmfi, tx spk121: . mwette: I have discovered that dynamic-link does not work on redhat distributions (redhat, centos, fedora): the response to this command is often "file not found". Any clues? daviid: str1ngs: pushed a code review fixed removing the calls to dimfi daviid: mwette: I would first and above all :) double check that the lib itself has all its dependencies fulfilled, using ldd ... and search for eventuall not found ... daviid: mwette: this is a typical guile-cv dynamic-link 'problem', wrt vigra, then o find out hlf of the lib vigra depends on were not installed ... daviid: mwette: if tht work, then it should work on redha as for any other distro, but guix, which needs 'full pathname', since it doen't use libtool (per design) mwette: no issue on other oses (ubuntu, debian, macos); the lib I'm loading is in /usr/lib64; outside of guix; tried full path, no luck daviid: mwette: my advice is to check the lib using lddyou need to daviid: mwette: my advice is to check the lib using ldd mwette: will do, thanks for the ti daviid: and make sure there no occurrence of 'not found' daviid: then, double check it is 'knwn to ldconfig' mwette: s/ti/tip/ mwette: all the deps from the "ldd libyaml.so" also appear in "ldd /usr/bin/guile" daviid: mwette: maybe try strace -o strace.out guile -c "(dynamic-link blabla)" spk121: mwette: if you run with the environment variable LD_DEBUG=all, you can find the culprit to the "file not found" dsmith: spk121: Cool. Does that also show the misleading "file" not found when the symbol is not found or the init function return an error? dsmith: s/show the /show the true cause of the / spk121: dsmith: I think so. I haven't had to use that trick lately. dsmith: I'll need to try it next time too. dsmith: Hm.. Shouldn't be too hard to fake up an error condition. dsmith: While strace does show what files are looked for and where, it might not be available on all systems. dsmith: sneek file not found? dsmith: sneek file not found is use strace -efile or set LD_DEBUG=all sneek: Got it. dsmith: sneek file not found? sneek: Someone once said file not found is use strace -efile or set LD_DEBUG=all dsmith: sneek: botsnack sneek: :) dsmith: good bot sneek: Mmm sneek: ??? dsmith: Hmm. sneek: ??? *: sneek wags redkahuna: Hey All, how did you handle to get one connexion to db in guile ? explication: in oop we have singleton to be sure that we have only one connexion opened to the db, how did you handle these type of probleme in guil mwette: spk121: got it -- thanks rekado_: redkahuna: you can always define state to keep track of things like this (e.g. a procedure that stores a connection handle and returns it when called again); but in the case of database connections I usually prefer to define a macro “with-db” that takes care of opening and closing db connections for the body. mwette: spk121: for guile 2.0.14, LD_DEBUG reports 'file=/usr/lib64/libyaml.so [0]; dynamically loaded by /lib64/libltdl.so.7 [0]' but then guile, apparently, reports 'ERROR: In procedure dynamic-link: file: "libyaml", message: "file not found"' spk121: mwette: that is a 'red herring' because libltdl is garbage. The real problem is not with yaml, but with one of its dependencies spk121: if you go to the end of all that LD_DEBUG output and work your way backwards, you'll find an error spk121: Hopefully mwette: not seeing it mwette: '/lib64/ld-linux-x86-64.so.2 --list /usr/lib64/libyaml-0.so.2' gives normal stuff: linux-vd.so, libc.so only; no other dependencies redkahuna: rekado_: So you need to use a global variable to do that no ? rekado_: redkahuna: no, it can be a local variable in a closure. redkahuna: rekado_: sorry, can you please send me an example rekado_: redkahuna: roughly this: (define db-connection (let ((connection #f)) (lambda () (if connection connection (let ((c (connect-to-the-db …))) (set! connection c) c))))) dsmith-work: Wednesday Greetings, Guilers rekado_: redkahuna: whenever you call (db-connection) you’ll get the already established db connection. rekado_: “connect-to-the-db” is a placeholder for whatever method you use to connect. redkahuna: rekado_: ah thanks i understant now ! thanks a lot rekado_: you’re welcome! regtur: civodul: can you get me started on the FSF copyright assignment (for the pipeline patch)? dongcarl: Hi! is there documentation on the "@" synatx? dongcarl: like (@ (gnu packages guile) guile-1.8) rekado_: dongcarl: hah, actually there is! rekado_: dongcarl: in the info document hit “i” (for index) and then @ rekado_: hit RET and you’ll get to the right place in 6.20.2 Using Guile Modules rekado_: it doesn’t have much to say about it, though. dongcarl: True! dongcarl: Very nice! catonano: ehy rbarraud :-) civodul: hi regtur! sure! civodul: regtur: you would need to email https://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/Copyright/request-assign.future to assign@gnu.org civodul: let me know if there's anything you'd like to discuss civodul: (i agree that paperwork is a bit of a bummer, but hopefully it'll be quick enough) regtur: I dislike redtape, but it should be worth it civodul: i think so! regtur: I'll get going on this regtur: thanks civodul: yw janneke: as a reward you might even get a shoutout on twitter nowadays :) regtur: janneke: for disliking redtape? regtur: civodul: done BTW janneke: regtur: hehe civodul: thanks, regtur! civodul: the patch looks pretty much ready BTW civodul: we'll check what wingo thinks but i think it'd be fine to add in 3.0.x regtur: great dsmith-work: civodul: Ahh. While I'm thinking about it: The 3.0.1 release announcement mentions 3.0.0. Probably should be 3.0.x dsmith-work: civodul: https://lists.gnu.org/archive/html/guile-devel/2020-03/msg00012.html dsmith-work: "Guile 3.0.0 can be installed in parallel with Guile 2.2.x; see" civodul: dsmith-work: indeed, thanks for the heads-up! civodul: now we know of one person who actually read it ;-) dsmith-work: Sure! dsmith-work: civodul: Do you know of a simple, non-guix test that can trigger the malloc struct bug? civodul: dsmith-work: no civodul: it seems to be hard to trigger given rekado_: dustyweb: are you still maintaining guile-webutils? I think I may have a few additions in the future. civodul: bah, looks like my honey moon with rr has already ended: https://github.com/mozilla/rr/issues/2454 civodul: :-/ civodul: i always feel like all the great debugging tools (sanitizers, gdb record/replay, valgrind, etc.) will never quite work for Guile redkahuna: Hey all, may be not the right place but: why we use the term closure property to talk about function like cons ( can apply cons to the result of cons) and the same term closure to the abilitfy of use nonlocal variable in function to store state. ? chrislck: sneek:botsnack chrislck: :( wleslie: needs more space wleslie: sneek: botsnack sneek: :) rbarraud: Howdy rbarraud: Anyone [else] got Guile-3.0.1 running under FreeBSD 12.1 yet? rbarraud: Looks like I have. rbarraud: Anyhoo Big Thanks to the team behind the new release. rbarraud: :-) rbarraud: I'm in NZ BTW rbarraud: Getting lateish down here... rbarraud: And the nights are lengthening... rbarraud: Snarfed my wonton soup, zzz follows shortly. rbarraud: [Modulo ADHD-related insomnia :-/ ] rbarraud: Who's awake and who's where, I wonder? rbarraud: Came here from #SICP which y'all alre welcome to visit and hang out in :-) daviid: str1ngs: I didn't have time yet, but I will look into this problem asap, thanks for the report , and sorry for the regression, will let you know asa have a solutin rbarraud: What would be a suggested test suite to give guile-3.0.1 a "Jolly Good Thrashing" [Fawlty Towers ref] rbarraud: ? rbarraud: Off to logbot page to catch up a bit. dsmith: rbarraud: Did it Just Work, or did you need to adjust something? (for fbsd) rbarraud: dsmith: I had to RTFM ;-) rbarraud: ...which told me which packages Guile-3 depends on; Installed those. rbarraud: And there is an additional --something-or-other parameter to ./configure which I had neglected. rbarraud: Once the configure worked it was painless. rbarraud: It's overwritten guile2.2 though ... probably avoidable, proably mea cupla and more RTFM'ing reqd rbarraud: :-) RhodiumToad: do you have any experience with freebsd ports? I can assist, or I can write up what you did as a port rbarraud: Not as such rbarraud: I'd consider trying though. rbarraud: Not tonight ;-) rbarraud: 0135 NZDT here (UTC+1300) rbarraud: Kewl - thanks for the offer. rbarraud: I'll attempt to recover shell Hx for what I did and try to put together a sensible sequence from that. rbarraud: ...tomorrow :-) RhodiumToad: right now there's guile1 and guile2 ports that install a "guile" binary rbarraud: Cheers, I'm off to (overdue) Zzz's rbarraud: Yup rbarraud: It's quite irritating that you have to remove 1.8.8 to install 2.2 RhodiumToad: getting guile2 and guile3 to coexist should be possible, but might require calling the new binary "guile3" at least to begin with rbarraud: from ports or pkg rbarraud: consequentially IIRC LilyPond and GNU-radio (and osmocom?) have to be removed as well rbarraud: It should IMO work more like the way Python 2.7, 3.x do rbarraud: Exactly... that's how it should be IMO too RhodiumToad: well, I'm trying to get that sort of thing done for Lua right now rbarraud: Kewl rbarraud: The alt is 'Version Heck' ;-) RhodiumToad: having another windmill to tilt at probably wouldn't hurt much :-) rbarraud: I'm a bit short of donkeys at the moment... rbarraud: ...but not asses ;-) rbarraud: It's a bit sad how many ports have no maintainer now rbarraud: Anyhoo better Zzzz rbarraud: Catch you soonish again rbarraud: Cheerzzz dsmith-work: Hey Hi Howdy, Guilers nerdypepper: o/ roelj: Do the web modules in Guile support chunked transfers? I'd imagine write-response that takes a port which I can write chunks of data to? chrde: in a shell script, how can I call pretty-print on some code that I receive from stdin? sneek: Welcome back chrde, you have 1 message. sneek: chrde, ng0 says: I feel like there's a misunderstanding, and whatever happened last year can remain where it is, in the past. If you need help with updating PyBitmessage guix definition, get in touch ng0: Oo well please don't, I have no idea when I wrote this. ng0: 2018? 2019? Slow mode of communication :D chrde: i want to run this script (formatter.scm) like "less some_file.scm | formatter.scm" chrde: #!/usr/bin/env shcontent=`cat`exec guile -e main -s "$0" "'$content"!#(use-modules (ice-9 pretty-print))(define (main args) (write (pretty-print (read (cadr args)))) (newline)) chrde: oh that's bad formatted chrde: well the issue is that `args` is a string containing scheme code, and in the documentation I see examples like chrde: (pretty print '(define ...)) chrde: how do I go from a string to a quoted version of its content? RhodiumToad: maybe (with-input-from-string str read) ? RhodiumToad: or better, (call-with-input-string str read) RhodiumToad: why have a string when you could just read from stdin, though? chrde: im fairly new to guile/scheme - not sure what is the best approach RhodiumToad: so rather than suck stdin into a shell var, just use (read) in the scheme code - that'll read one s-expression from stdin and return it, or return an eof object at end of file janneke: chrde: (with-input-from-string read)? chrde: (define (main args) (write (pretty-print(read))) (newline)) RhodiumToad: that'll read just one s-expr chrde: well on top of that I can build some sort of loop tile chrde: right? Thanks RhodiumToad RhodiumToad: (let loop ((s (read))) (unless (eof-object? s) (pretty-print s) (loop (read)))) RhodiumToad: or something of that ilk chrde: works like a charm, thank you rbarraud: Hey catonano rbarraud: :-) rbarraud: Nice to see you again :-) daviid: str1ngs: hey! as usual, can you provide a snipset or minimal script I can run here to reproduce? daviid: str1ngs: I changed the open.scm script example so it uses a thread within which I call g-application-run, and the main procedure returns app (the variable), soI can call gtk-application-get-activ-window and so I can reproduce ... daviid: str1ngs: however, I'd like to enhance this example so it effectively launch the app, which it doesn't ... I'm used to the gtk2/show-all/gtk-main way of 'doing things' ... could you do that for me? So users do not have to launch twice the app in a temrinal ... a complete 'heresy', to me :) daviid: str1ngs: ok, I foxed this bug, good catch, tanks - will review my fix and push asap, will let you know dadinn: hi all dadinn: i am looking at this manual page: https://www.gnu.org/software/guile/manual/html_node/Miscellaneous-String-Operations.html dadinn: at the end it says that string-replace-substring is a function defined in (ice-9 string-fun) dadinn: I am getting the error that it is not available dadinn: I mean this function is not defined or exported in that module RhodiumToad: in what version of guile? sirgazil: daddin: That is Guile 3.x manual I think. dadinn: ah, I am using version 2.0.13 sirgazil: daddin: You can find the manuals for older versions in https://www.gnu.org/software/guile/learn/ dadinn: Debian Stretch sirgazil: daddin: You can use GNU Guix to get newer versions of Guile and its libraries. dadinn: sirgazil: yeah, actually Guix is something which I am really interested in dadinn: sirgazil: just another reason to bite the bullet sirgazil: :) daviid: str1ngs: I a series of parches, the last being a fix to the gtk-application-get-active-window bug you reported above daviid: *I pushed a series of patches ... str1ngs: daviid: great will check this out. str1ngs: daviid: for this test case 'open is not required it could be tested in 'activate simply by not using a GtkApplicationWindow and calling (gtk-application-get-active-window app) from withing 'activate. I would not advise using threads etc for this either, if you do I would defiantly not reuse app more then once. It might work but I would question the sanity of that IMHO. str1ngs: daviid: does the gtk-application-get-active-window fix handle other functions and methods that might return NULL as well. I can't help but think 'gtk-application-get-active-window was not the only function effected by this? civodul: Hello Guilers! daviid: str1ngs: the fix should fix any procedure that return an 'object, not just gtk-applicaton-get-active-window daviid: any procedure that return or has 'out argument(s) that are of 'object type daviid: all those should now either return #f or an goops instance wingo: civodul: nice work on the releases! civodul: wingo: thanks! i felt it was needed civodul: but... civodul: it didn't quite meet my expectations in terms of bug solving :-) civodul: https://issues.guix.gnu.org/issue/39988 civodul: so i'm head-down on weak tables again wingo: yarr wingo: civodul: hey wingo: have you heard the good news wingo: rr-project.org wingo: it is *amazing* wingo: i am now an follower of the church of rr wingo: *a civodul: oh! civodul: looks like it could be very helpful in this kind of situation wingo: yes wingo: you just run "rr record guile argument..." civodul: it produces a trace in the same format as gdb's reverse-debugging support, right? wingo: then "rr replay" puts you into a gdb civodul: crazy stuff wingo: where you can "cont" to the end of the program, set hardware watchpoints and then do "reverse-cont", etc wingo: reverse-next, reverse-finish wingo: it is great civodul: awesome wingo: i think it runs a local server and has gdb access it over a socket or something civodul: ok wingo: anyway, it is amazing and i fixed a couple guile bugs with it i think wingo: i hesitated before starting because i am a stick in the mud who does not learn new tools ;) but i should have started with it much earlier wingo: it's verry easy and incredibly effective wingo: the bug i found and fixed was the fibers one (cc30168878972652ddde4489351b76dc53f20142) wingo: having reverse-stepi was amazing *: civodul goes make a package jonsger: civodul: thanks for 2.2.7 and 3.0.1 release! dsmith: wingo: Are the recorded files huge? wingo: dsmith: no not really. all rr has to do is record syscalls -- the program runs deterministically between syscalls wingo: it also makes it so that multiple threads run on the same core, and records their switches dsmith: Hmm. Interesting. I wonder if it can be saved off-host (as in an embedded system with a ro rootfs). dsmith: Ah, depends on x86 gagbo: I have a design question. I'm coming from oop languages and I wonder if I should use a class to encapsulate state with my functions. rekado_: gagbo: that’s a matter of taste. You don’t *have* to do that. You can use closures if you want to keep state associated with procedures. gagbo: Oh, no Shift-enter. Sorry. Question : I want callbacks to modify an "instance attribute" (i.e. a "view_id" in my case) which is a string that I want linked to a ncurses window gagbo: Ok, so 2 solutions are : make a class with goops, or craft it manually with the methods used in SICP ? I don't know if SICP code is simple just for educational purposes but hard to maintain in big source files later ; or if it's really the way people use it rekado_: I don’t understand your use case and I have no experience with ncurses rekado_: but here’s an example of a procedure with internal state: rekado_: (define (make-counter) (let ((count 0)) (lambda () (set! count (1+ count)) count))) rekado_: (make-counter) returns a procedure that has an internal count value. rekado_: Whenever you call it, the count will be increased. gagbo: fair enough. rekado_: for more complex state you can use complex values (such as records); or you could reveal internal state dependent on a procedure argument. rekado_: but if you’re doing this a lot, you might benefit from using GOOPS. rekado_: for just a bit of state here and there I think GOOPS is a bit too much. gagbo: One day paste.centos.org will respond and I'll paste some code just for the record. I think I'll start with the simple approach and see if I need more machinery then. Thanks gagbo: https://paste.centos.org/view/142efbf6 rekado_: gagbo: would it make sense to have a record for buffers and simply use accessor procedures to get the fields of a value? gagbo: I think it would yeah. But the type would still need to be the return value or this make-buffer procedure now that I think about it (visible lines, current selection, active colorscheme are part -local state) rekado_: gagbo: that’s not a problem, is it? Your make-buffer procedure can assemble the record value and return it. RhodiumToad: speaking of goops, is there a good way to do singleton objects? dsmith: civodul: /topic *: civodul ChanServ op #guile civodul civodul: no civodul: hmm civodul: yay dsmith: civodul: tack civodul: thanks for the heads-up, dsmith! gagbo: rekado_: not a problem indeed, I'll do this I think civodul: rr is just incredible civodul: wingo: in struct.c:142, something's wrong civodul: there's a mismatch between the arg to scm_gc_malloc_pointerless and that to memset civodul: looks like the 2nd one is correct civodul: gcc could have told us, bah *: janneke finds that some native hurd build "fixes" broke earlier cross-build-to-hurd "fixes" janneke: the good thing about cross builds is that they offload very well janneke: oops that was meant for #guix dsmith-work: Monday Greetings, Guilers janneke: hello dsmith-work civodul: gcc doesn't emit a warning for: memset(malloc(123), 0, 1234) civodul: sadness janneke: oh my... dftxbs3e: hah! *: dftxbs3e goes to look up what is 3.0.1 about. dftxbs3e: cool! oni-on-ion: '.sld' ? hmmm dsmith-work: civodul: Too bad that struct alloc size fix didn't make it into 3.0.1 civodul: dsmith-work: yes, but OTOH, there'll always be a 3.0.(N+1) with more bugs fixed civodul: i'm so happy i was able to find it this quickly civodul: it really made my day civodul: it's the kind of thing that can keep you busy for ages, without rr dsmith-work: Yes, that's very impressive dsmith-work: Reminds me of the "time traveling debugger" in Elm. dftxbs3e: I met a heap corruption abort error the other day but couldnt capture any useful debug information :-/ dftxbs3e: while running GNU Guix dftxbs3e: Has GNU Guile ever been fuzzed? civodul: probably not hugo: 7,99dftxbs3e99,99: how do you mean fuzzed? RhodiumToad: fuzzing is the process of generating random input to a program and seeing if it crashes or otherwise misbehaves, it's a common technique now RhodiumToad: exposes all sorts of weird bugs dftxbs3e: hugo, software such as this does it: http://lcamtuf.coredump.cx/afl/ dftxbs3e: It would be vital to fuzz GNU Guile, I'll have a look if I can.. dftxbs3e: One can do coverage guided fuzzing, adjusting generated input to maximize the amount of code that gets executed in response to the input. Also to avoid testing with input that doesnt discover new zones of code. ryanprior: The Haunt site generator looks like it was last updated in 2015. Anybody still using & enjoying it? rekado_: ryanprior: I’m using it. Haven’t published anything new in years, though. janneke: ryanprior: i'm using it and so is guix; haunt could do with some of the custom extensions from the guix website, imho str1ngs: hello daviid 'gtk-application-get-active-window is now working. However there seems to be a regression with 'open arguments again. using this example case http://paste.debian.net/1134171 an running with ./open.scm ./foo .bar . 'open does not seem to be called and it now hangs. note, we can simplify this test case simply by calling ./open.scm with arguments it does not require an default application to be running. in other words no need str1ngs: for threads or running open.scm twice. str1ngs: daviid: my intuition tells me that it's probably trying to parse a NULL termination that does not exist. maybe 2e32c99b5379eafc2d95b5f9789522243c9f073f needs some more tweaking? enderby: Hi, wondering if there's a library for CSS like there is for HTML (with SXML)? enderby: i thought i saw one somewhere once dsmith-work: sneek: software-list? dsmith-work: sneek: software? dsmith-work: sneek: guile-software? sneek: guile-software is http://sph.mn/foreign/guile-software.html dsmith-work: enderby: http://www.nongnu.org/scss/ perhaps dsmith-work: sneek: botsnack sneek: :) dsmith-work: enderby: Check out the above guile-software link enderby: dsmith-work: ya! ty daviid: str1ngs: ok, great sneek: daviid, you have 1 message. sneek: daviid, str1ngs says: thanks will check this out ASAP. dsmith: Ooo.. Sounds like 3.0.1 is immanent! manumanumanu: civodul: there is a bug in how sxml handles CDATA. I submitted a guile patch, but it should probably be updated upstream. manumanumanu: regarding what RhodiumToad said manumanumanu: I did it just as an intellectual curiosity, so I didn't bother actually subitting it upstream manumanumanu: because I did not have a sourceforge account :=) manumanumanu: Does anybody know of an rrb-tree fector for scheme or guile? I only know of "regular" fectors. I have read enough about them to be able to implement them myself, so I might give it a shot civodul: hi manumanumanu! civodul: do you have the URL of the patch? manumanumanu: 2 seconds manumanumanu: civodul: https://lists.gnu.org/archive/html/guile-devel/2020-01/msg00081.html manumanumanu: It passes the internat ssax tests, but I did not verify it more than just playing around with it. It is a rather straight-forward patch: IIRC I simply removed the handling of & from CDATA, which is the correct way to handle it anyway. The complexity of the patch comes from the changes to the test suite, which were NOT straight-forward to do since guile does not write out what went wrong or which test was manumanumanu: affected. civodul: are you sure there's no upstream fix? civodul: i'd rather avoid diverging from upstream civodul: especially in a file that contains "upstream" in its name :-) civodul: (it might be that there really isn't an "upstream" anymore) manumanumanu: well, all scheme implementations use the upstream manumanumanu: even the racket pkg manumanumanu: I'll shoot an email to oleg or whoever is in charge of the repo manumanumanu: and see what happens stis: hej guilers! civodul: manumanumanu: awesome, thanks! civodul: manumanumanu: oh there's also this srfi-171 patch of yours that's still pending civodul: i see you have a copyright assignment on file, great dftxbs3e: hi! I'll ask again since this was unanswered, is it possible to launch services with shepherd while GNU Guix is running on top of another distro, say a minimal install of Gentoo with OpenRC? civodul: hi dftxbs3e! civodul: i think that's the wrong channel :-) civodul: but the short answer is yes, Shepherd is not Guix-specific civodul: however, you'll have work to do to define your services civodul: you won't be able to use the Guix System infrastructure dftxbs3e: civodul, oh woops!! sorry dftxbs3e: thanks for the answer nonetheless civodul: yw! *: civodul prepares 3.0.1 str1ngs: hello daviid, (gtk-application-get-active-window app) does not seem to work right if no active window exists. It should return NULL or in the case of scheme #f. You could test this by not calling activate and trying to open files. something like ./open.scm ./foo ./bar. if no default application is running or active window exists this will throw 'wrong-type-arg. For now I just catch 'wrong-type-arg and create a frame if needed. But str1ngs: typically in C I would just use something like this. if (!gtk_application_get_active_window (GTK_APPLICATION (app))) { create frame here... } str1ngs: daviid: here is the documentation for 'gtk-application-get-active-window https://developer.gnome.org/gtk3/stable/GtkApplication.html#gtk-application-get-active-window civodul: Guile 3.0.1 is out! :-) civodul: (it's a recurring theme this week-end) mbakke: civodul: \o/ mbakke: any news on the ARM/AArch64 issues? RhodiumToad: civodul: re. the sxml thing, I mentioned the bug on the supposed "upstream" sourceforge repo, but no response (not all that surprising since there had been no messages for 4 or so years) civodul: https://www.gnu.org/software/guile/news/gnu-guile-301-released.html civodul: mbakke: the ARM JIT issue is not fixed, but we can still --disable-jit civodul: the AArch64 issue is "fixed" as a side effect of some other change civodul: as in, it's able to build Guix now civodul: but the root cause may still be there rekado: I’m confused about port encodings when using the web server. The port encoding of (current-output-port) is set to ASCII. Is it okay to set that to UTF-8 or will that lead to problems when sending responses to the client? rekado: This is motivated by broken file name encoding when handling form data. mwette: civodul: congrat's on the release civodul: thanks, mwette! civodul: rekado: shouldn't it be a function of "content-encoding"? rekado: civodul: content-encoding is for compression. Do you mean content-type? rekado: content-type here is multipart/form-data RhodiumToad: encoding could be different for each part, then, at least in theory RhodiumToad: the wonders of MIME rndd: Hello everyone! RhodiumToad: good evening rndd: i have a question. A newbe one. Suppose I have a character that may be a member of the list, and if my character is a member, i need to know its index in list. How i can do such thing in guile? RhodiumToad: list of characters? i.e. like '(#\a #\b \#c etc) rndd: RhodiumToad: ye RhodiumToad: list-index from srfi-1 seems like a good place to start? RhodiumToad: though if you do this a lot, then maybe lists aren't the best data structure to use rndd: RhodiumToad: maybe, i'm just practising new language. thanks, it seems list-index fits my needs rekado: apart from the content-type: in the server handler I use “(open-file "ä" "ab")” and then write a bytevector to the file; the file that is created, however, is called “?”. rekado: why is that? RhodiumToad: what's telling you that it is called ? rekado: I’m ignoring whatever might come from the form. rekado: my file system rekado: I look at the current directory in a shell RhodiumToad: what OS and looking with what utility? rekado: there is a new file “?” when I run “ls” rekado: brb RhodiumToad: ls will have an option to display file names with escapes for non-ascii characters, try it rndd: RhodiumToad: sorry, maybe i dont understand, but when i enter example from manual "(list-index odd? '(2 4 6 9))" in repl, i get an error "In procedure car: Wrong type argument in position 1 (expecting pair): #" sirgazil: rndd: You need (use-modules (srfi srfi-1)) rekado: rndd: run ,use(srfi srfi-1) frist sirgazil: :) RhodiumToad: there's a list-index in base that isn't in the manual? RhodiumToad: yeah, and it looks like it has a completely different calling convention rekado: oops rndd: okay =) rndd: guys, where i can find source code of these moduls in guix& rndd: ? RhodiumToad: ya, found it; ice-9 boot has a definition of (list-index l k) that just uses eq? for comparison rekado: here’s a test case for a ’?’ file: rekado: (import (web server)) (run-server (lambda _ (open-file "ä" "ab")) 'http) rekado: after making a request to localhost:8080 you should have an empty ’?’ file. RhodiumToad: what encoding is that a-umlaut in, though, when you typed it? rekado: UTF-8 RhodiumToad: what OS are you using? rekado: GNU rekado: it seems to me that the default port encoding is set to ASCII inside the web server. RhodiumToad: look with LC_ALL=C ls -b rekado: I see ’?’ rekado: brb RhodiumToad: make sure you're not specifying any -q option to ls anywhere (e.g. via alias) RhodiumToad: alternatively do ls | cat -vet rekado: ls | cat -vet says: ?$ rekado: I have no aliases rekado: can someone else reproduce my little test case? rekado: gotta go for about 2 hrs RhodiumToad: just (open-file "ä" "ab") should be a sufficient test sirgazil: sneek: later tell rekado: I can't reproduce the problem. I get a file named ä. sneek: Got it. sirgazil: I'm in GNU too. rndd: guys! Assume i want return integer from function, how to do it in scheme? sirgazil: Eh! There is no "Procedure" term in the Concept index?! sirgazil: rndd: Example: (define (square x) (* x x)) sirgazil: rndd: Check https://www.gnu.org/software/guile/manual/html_node/About-Procedures.html for more information. sirgazil: rndd: Specially https://www.gnu.org/software/guile/manual/html_node/Lambda-Alternatives.html rndd: sirgazil: will read, thanks sirgazil: The information about creating procedures is one of the parts of the manual I think is complicated for beginners. It starts with lambda instead of (define (name [arg1 [arg2 …]]) body ...) mbakke: rekado: I also can't reproduce the umlaut example (using en_US.utf8 locale). mbakke: what are good ways to serialize a sexp for transporting over the wire? scm->json-string from guile-json can not work with completely arbitrary sexps. chrislck: mbakke: srfi-180 rekado: RhodiumToad: but it is not sufficient in my case. Just (open-file "ä" "ab") works fine. sneek: Welcome back rekado, you have 1 message. sneek: rekado, sirgazil says: I can't reproduce the problem. I get a file named ä. rekado: It’s just with the web server. rekado: (and visiting localhost:8080 with Icecat; haven’t tested any other client yet) rekado: visiting with wget I do get a file named “ä”. rekado: I wonder if perhaps icecat is running in a different locale… mbakke: rekado: I get the umlaut also when using IceCat. rekado: hmm, it’s fine with epiphany. rekado: icecat runs with LANG set to en_US.UTF-8 rekado: weird. rekado: and it’s fine with a newly started icecat. I wonder if there’s something special about the way the former icecat instance was started. rekado: gah, it’s much simpler… I ran my server in a pure Guix environment. This means that LANG was not set in the environment where the server ran. That’s all. rekado: thanks everyone for trying to reproduce this! sirgazil: :) civodul: rekado: ah yes, maybe that was content-type civodul: perhaps (guix scripts publish) contains useful hints civodul: i always forget what needs to be done manumanumanu: civodul: thanks for the feedback! I will try to do it all within a week or two. civodul: yw! rndd: guys! how to return boolean from function? civodul: s/guys/people/ :-) civodul: the boolean values are #true and #false civodul: so you can return one of these civodul: rndd: ↑ civodul: but note that all Scheme values except #false have truth value rndd: civodul: could you show an example? =) rekado: rndd: (define (this-is-false) #false) rekado: rndd: (this-is-false) rekado: (define (this-is-true) 123) rekado: (define (this-is-also-true) #true) rekado: these procedures both return a truthy value when called. rndd: (define (this-is-false) #false) rndd: rekado: ok, got it. thank you! rndd: hi people! rndd: trying to get index of list argument (list-index (= 2) '(1 2 4)) ;; => Wrong type argument: #t. rndd: dont really understand what is wrong rekado: you need a procedure rekado: (= 2) is not a procedure, it’s a value rekado: evaluate it in a REPL and you’ll see. rekado: so what you’re actually trying to evaluate here is (list-index #t ’(1 2 4)) rekado: and that’s why you get an error rekado: you want a procedure that takes a single value as an argument and compares that with 2. rekado: for example: (lambda (value) (= value 2)) rekado: or after (import (srfi srfi-26)) you can do (cut = <> 2) rekado: where <> is a placeholder rndd: well, (list-index (lambda (value) (= value 2)) '(1 2 4)) is works =| rndd: as i understand (list-index) takes values from list and put it inside procedure rndd: well, thank you very much. rekado: your understanding is correct rekado: procedures that take a value and return either a truthy value or #false are called predicates. rekado: in the manual this is often abbreviated as “pred” dsmith: Yey! 3.0.0! longshi: 3.0.1. even! roptat: Hi, I'm trying to modify an xml file that has an "xmlns". xml->sxml gives me something like this: http://maven.apache.org/POM/4.0.0:project for the top-level element. I can modify the sxml representation, but when I try to use sxml->xml to convert it back to xml, I get this error: "Invalid QName: more than one colon http://maven.apache.org/POM/4.0.0:project" roptat: what can I do to get a document that starts with a element? roptat: should I process every element to change their name? dftxbs3e: hello dftxbs3e: I'm getting an error in GNU Guile: 'VM: Bad instruction: 71a8', any ideas? mwette: Are you by any chance using .go files across multiple guile versions or multiple machine architectures? dftxbs3e: mwette, not sure. GNU Guix master in latest versions mixes GNU Guile 2.2 and GNU Guile 3.0 dftxbs3e: but I'd think it would handle that properly mwette: agree daviid: str1ngs: I pushed a series of patches, and now signal callback that have pointers to interface(s) argument should work - it works here but ... deserves more tests as usual daviid: whenever you have the opportunity, pull, run the make dance and try, you should be able to fully implement the 'open (as example) signal callback in scgheme as well ... let me know daviid: I will improve this, but not in a way that should affect your code daviid: at least not in any 'anooying' or complex way, it might need adjustemnts, let's see (once these interfces becomes goops classes and instances) str1ngs: sneek: later tell daviid, thanks will check this out ASAP. sneek: Welcome back str1ngs, you have 2 messages. sneek: str1ngs, nly says: thanks sneek: str1ngs, nly says: i need this variable 'WEBKIT_NETWORK_PROXY_MODE': https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebContext.html#WebKitNetworkProxyMode sneek: Okay. str1ngs: sneek: later tell nly, try with 'custom sneek: Got it. nly: thanks str1ngs sneek: Welcome back nly, you have 1 message. sneek: nly, str1ngs says: try with 'custom nly: it works RhodiumToad: roptat: sxml's support for namespaces is rather ... minimal chrislck: sneek: botsnack sneek: :) chrislck: good bot MtotheM: I don't know who packages guile. but come there is no package for guile3 in the Arch Linux repo? must I build it myself then? spk121: MtotheM: You will probably have to build it yourself. As I recall, Arch Linux uses pacman packages. I do not know of any unofficial Arch pacman packages for Guile that you can use. oni-on-ion: happy that debian testing got 3.0 no more than a week after its release civodul: wingo: i've updated NEWS on master civodul: i'd like to release today or tomorrow, WDYT? civodul: Guile 2.2.7 is out! :-) outtabwz: congrats! civodul: thanks, i didn't do that much actually RhodiumToad: no sxml fix :-( civodul: i did go through debbugs, but obviously didn't fix everything :-) civodul: please do ping people if something's important has been overlooked! civodul: we might be able to fix it for 3.0.1, too rndd: hi everyone! is there any (dolist) from emacs alternative in guile? RhodiumToad: well, dunno if you'd call it important, given that it's about 20 years old and nobody seemed to have ever noticed it RhodiumToad: rndd: (for-each) ? RhodiumToad: rndd: it's a bit different in detail but you could probably do a (dolist) macro easily enough civodul: https://www.gnu.org/software/guile/news/gnu-guile-227-released.html rndd: RhodiumToad: ok, found definitions, thank you rlb: civodul: I was wondering whether it might be plausible to try --disable-jit on debian armel for now for 3.0, see if that might at least allow it to build/migrate. Any opinion? https://buildd.debian.org/status/package.php?p=guile-3.0&suite=sid I'm not at all sure what the problem is, but I thought someone said something earlier making me wonder about that as a potential stopgap. civodul: rlb: in Guix we --disable-jit on ARMv7 for now civodul: it sounds like the right option until we have a proper fix rlb: Ahh, maybe it was you that said something :) i.e. I didn't remember for sure that we thought there was a relationship (and/or that --disable-jit worked). Thanks -- I'll do that in the next upload. civodul: heh, cool :-) str1ngs: hello daviid. the new closure works well. at-least I've tested with 'open so far. mwette: civodul: congrats on the 2.2.7 release gagbo_: Hello, sorry to disturb, I'm trying to make a header and a footer window with ncurses bindings and I can't make it appear. Can someone quickly check if I'm doing something terribly wrong ? (56 lines example here that can run anywhere ncurses is available) https://paste.centos.org/view/5c2cc94e gagbo_: Using derwin instead of newwin seems to work, but I wonder if that has performance implications gagbo_: I'm also worried because I want to remember the number of visible lines in the main window, so I'm not sure that (lines) will still be update (i.e. with footer/header heights substracted) automatically when I call the function gagbo_: going offline for a bit, if someone tries to use sneek , I'll probably reconnect as gagbo later. Have fun obyz: hi, I'm getting error while building guile 3.0 (Windows10 + cygwin): make[2]: *** No rule to make target '../bootstrap/ice-9/eval.go', needed by 'ice-9/and-let-star.go'. Stop. obyz: can someone help please RhodiumToad: sneek, later tell gagbo curses doesn't handle overlapping windows, so if you want a header+footer, also create a window for the space in between and use that instead of stdscr sneek: Will do. RhodiumToad: sneek, later tell gagbo though of course using subwindows is another option as you noted sneek: Got it. chrislck: question regarding named lets: see http://paste.debian.net/1133717/ I've seen old code use an ugly named let recipe (A) whereas modern (B) is nicer. Was (A) common in the past? RhodiumToad: well, A doesn't assume the availability of (match ...) rekado: (length lst) traverses the whole list first, doesn’t it? rekado: if match isn’t available one could do the same with car, cdr, and null? rekado: well, very much like in A. rekado: I think the single-branched if in A is rather ugly. rekado: I’d use an inner let. chrislck: gah I was trying to highlight the (xloop (car rest) (cdr rest)) construct vs (xloop rest) chrislck: was it common in the past? RhodiumToad: well it saves doing either multiple (car ...) or using another let RhodiumToad: i.e. you'd need something more like RhodiumToad: (let xloop ((lst lst)) (let ((this (car lst)) (rest (cdr lst))) ... RhodiumToad: so the (xloop (car ...) (cdr ...)) style simplifies it slightly *: RhodiumToad has no idea what was or was not common in the past jcowan: Single-branched if should be when (or unless) jcowan: and in this case cond would be better gagbo: Documentation of guile-ncurses seems to say I should be able to properly make multiple windows :( I'll try something else then sneek: gagbo, you have 2 messages. sneek: gagbo, RhodiumToad says: curses doesn't handle overlapping windows, so if you want a header+footer, also create a window for the space in between and use that instead of stdscr sneek: gagbo, RhodiumToad says: though of course using subwindows is another option as you noted gagbo: Oh right, make a middle window. Thanks RhodiumToad civodul: hey ho! civodul: wingo: i'm all for a 3.0.1 (and perhaps 2.2.7) release, WDYT? civodul: i'm happy to help with that, like updating NEWS or something wingo: civodul: yeah i have been a bit time-limited recently, but i agree! wingo: would be nice to fix that hash bug wingo: the one with arrays and subarrays wingo: but i guess it's been with us for forever civodul: wingo: yes, i can take a look at the hash bug janneke: also, could someone (possibly spk121?) reply to rutger's piped-process patch some time (he's still working on the peg patch that i promised and will probably have to get paperwork done first civodul: janneke: i think i haven't seen it yet but yes, it sounds worth a look! janneke: it's a patch we've been using for a popular non-posix operating system, that allows a pipepeline without forking (guile-devel) janneke: could be nice for gash, esp. wip-mingw-guile-2.2 gets merged civodul: i see manumanumanu: janneke: that is one hell of a nice patch! One question is whether it should use the shell by default, or if there should be one pipeline and one pipeline* manumanumanu: I just got a new keyboard, and I'm not typing the wrong characters anymore. it feels liberating. AND: it's clicky. Let's see if I have to get a divorce. oni-on-ion: ah! that is great news. cant wait to upgrade mine as well janneke: manumanumanu: thanks, yeah i gues a pipeline* variant could be nice janneke: anyway, also we could not figure out how to do the docstring manumanumanu: wingo: btw: if there is still interest I made all the changes that you wanted to srfi-171 (transducers). The only thing I am unsure of is the commit message :D :D No stress, though. And there is a fix for sxml in the discussion about ssax not treating CDATA correctly. That should probably be done upstream, though. manumanumanu: janneke: there has been some discussion about exposing open-process anyway. Maybe rutger's patch could be a part of a little larger thing to redo the whole working with processes? open-process still does not allow you to get the error port iirc. manumanumanu: anyway. Not time for work. janneke: manumanumanu: sounds nice dsmith-work: Happy Friday, Guilers!! janneke: manumanumanu: indeed, handling/piping stderr could be interesting too dsmith-work: civodul: https://lists.gnu.org/archive/html/guile-user/2016-06/msg00055.html dsmith-work: I'm seeing that with 3.0.0 civodul: dsmith-work: you're seeing what precisely? :-) dsmith-work: Seems to work when I change "ISO-1588-1" to "UTF-8" in the call to mem_iconnvh() in libguile/strings.c dsmith-work: civodul: Guile wont start. Errror out reading boot-9. "cannot convert narrow string to output locale" dsmith-work: Had to reboot, so I've lost my context. dsmith-work: civodul: So I'm attempting to get guile 8 running on arm64 using buildroot. dsmith-work: My actual error message is dsmith-work: Pre-boot error; key: encoding-error, args: ("scm_to_stringn" "cannot convert narrow string to output locale" 22 #f #f)Aborted civodul: dsmith-work: what libc are you using? under what locale? civodul: perhaps you could mail this to bug-guile dsmith-work: Yes, I'm planning on it. Gathering info. dsmith-work: The toolchain is pre-built Linaro. Pretty sure is glibc dsmith-work: LOCALE env is not set. What should I set it to? civodul: what about the LC_* variables, as well as LANG and LANGUAGE? dsmith-work: None of that is set. I think the default is C ? dsmith-work: I'm not that up on locale things. civodul: then yes, it must be the "C" locale dsmith-work: So it's attempting to convert "ice-9/eval" from "ISO-8859-1", to "ANSI_X3.4-1968" and returning an error. dsmith-work: Maybe the C lib was configured in some incompatible way. dsmith-work: Hmm. Guile is attempting to open /usr/lib/gconv/gconv-modules.cache and /usr/lib/gconv/gconv-modules, which apparently don't exist. dsmith-work: And I see an option to include gconv libs. Rebuilding with that option set. chrislck: does anyone know a C profiler as easy to use as (statprof slow-fn) ??? wingo: perf is pretty good wingo: run your program under "perf record ..." and then do "perf report" chrislck: perf... nice! (thx for all the statprof.py.scm!) dsmith-work: Woo! I think that was it! dsmith-work: scheme@(guile-user)> (version) dsmith-work: $1 = "3.0.0" dsmith-work: scheme@(guile-user)> (system "uname -a") dsmith-work: Linux maaxboard 4.14.78 #1 SMP PREEMPT Fri Mar 6 09:53:40 EST 2020 aarch64 GNU/Linux civodul: dsmith-work: yay, neat! civodul: wingo: do you have a lead on the ARMv7/JIT segfault: https://issues.guix.gnu.org/issue/39208 ? civodul: we briefly discussed it in Brussels and ISTR you had an idea lampilelo: how do you install guile3 with guix? jackhill: lampilelo: guile-next currently lampilelo: jackhill: ah, thanks jackhill: lampilelo: you're welcome dsmith: Hey hey theruran: is Guile getting Scheme bindings for GTK3/4? str1ngs: theruran: there is g-golf and guile-gi dsmith-work: Thursday Greetings, Guilers mwette: Good day! dsmith-work: So. "cannot convert narrow string to output locale" dsmith-work: The env doesn't have any locale things set. dsmith-work: I'm pretty clueless here. What would be the minimal. Like a basic C locale or so. dsmith-work: Well the string that it can't convert is |ice-9/eval.scm| dsmith-work: Ahh. Doesn't like ISO-8859-1 dsmith-work: Woo dsmith-work: Looks same as this: https://lists.gnu.org/archive/html/guile-user/2016-06/msg00055.html Jmabsd: (doublepost) guys, how do you implement the following in syntax-case: Jmabsd: (define-macro (hello-world) '(print "Hello, World!\n")) Jmabsd: (define-macro (begin0 arg1 . rest) (define g (gensym)) `(let ((,g ,arg1)) ,@rest ,g))) Jmabsd: syntax-case is not trivial to learn, your pointer here would be much appreciated Jmabsd: also there are no syntax-case learning resources for people who don't know syntax-case already, kiiinda chrislck: try syntax-rules, much easier dsmith-work: Indeed dsmith-work: And define-syntax-rule is even simpler Jmabsd: chrislck: i like to learn syntax-case today chrislck: well this is a hill that many have failed to climb, including myself Jmabsd: chrislck: at least guile has a man page on it lol. Jmabsd: (define-syntax hello-world (lambda (syntax-object) #'(print "Hello, world!\n"))) Jmabsd: this seems to work dsmith-work: scheme@(guile-user)> (define-syntax-rule (hello-world) (display "Hello World\n")) dsmith-work: scheme@(guile-user)> (hello-world) dsmith-work: Hello World dsmith-work: And there it is using define-syntax-rule dsmith-work: Great for trivial things like that. Jmabsd: dsmith-work: yeah that's syntax-rules, i like to learn how to do it in syntax-case. Jmabsd: yea sure, syntax-rules is great. today studying other Jmabsd: ok got it all clarified on #scheme, great, also #gerbil-scheme str1ngs: sneek: later tell nly you probably want to use webkit_web_context_set_network_proxy_settings with the default context which you can get with webkit_web_context_get_default. see https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebContext.html. This will set the proxy for all GtkWebView's . sneek: Will do. str1ngs: sneek: later tell nly, try setting this in startup-hook for now. sneek: Okay. schaeffer: apapsch, killmeplease: if you're interested in how 8sync handles concurrency, here's what my little program does: https://gist.github.com/jnschaeffer/51a6024e56e11812d498fbbbfdf955f3 schaeffer: for anyone who's curious, i'm looking to use 8sync such that an actor handles each message coming in one at a time instead of handling all of them concurrently. the program i just linked is doing the latter and i'd like it not to do that *: spk121 thinks test coverage of 80% in guile-gi smell like 'beta' wingo: moin dsmith-work: UGT Greetings, Guilers dsmith-work: So I've been building a lot of rootfs images for a 64bit arm board, and thought I'd see how well guile 3 builds for that. dsmith-work: During the install of the cross-compiled go files, I see this error for every .go file: dsmith-work: ERROR: architecture for "/usr/lib/guile/3.0/ccache/ice-9/and-let-star.go" is "None", should be "AArch64" dsmith-work: Anyone ever see that before? dsmith-work: I'm not sure at this point what program is generating that error, though I suspect it's "install". dsmith-work: Ah. It's because BR2_READELF_ARCH_NAME "AArch64" dsmith-work: So GUILE_BIN_ARCH_EXCLUDE = /usr/lib/guile/3.0 dsmith-work: gets around that problem. dsmith-work: Anyone see this next error? dsmith-work: # guile dsmith-work: Pre-boot error; key: encoding-error, args: ("scm_to_stringn" "cannot convert narrow string to output locale" 22 #f #f)Aborted dsmith-work: Maybe locale isn't set correctly? wingo: yeah it's passed to /bin/sh chrislck: the lack of an easy built-in cross-platform gui toolkit is annoying imo chrislck: alternatively is it easy to create a standalone text-based ui? nly: hi daviid nly: can you tell me how g-golf is supposed to be used in terms of libraries, for example which one is better 1. hard-coding the gobject glib and libgirepository into g-golf at build time 2. dynamically loading gobject glib and gobject-introspection from user profile? str1ngs: nly: the typical way is to use a standard path like /usr/lib. if not then you can add the library path to LD_LIBRARY_PATH str1ngs: nly: for guix we substitute which is good for guix. nly: oh man, given you do everthing right, still it doesn't quite work. Maybe I am looking in the wrong spot for problems? nly: str1ngs: [appropriate time] greetings! str1ngs: is this the in regards to the class GdkPixbuf is already registered issue? str1ngs: hello :) nly: guix package -L ./guix -i nomad && nomad str1ngs: what error do you get? nly: no or something str1ngs: before error do you get a glib error? nly: but get this, ./pre-inst-env nomad # the one installed in profile nly: works nly: missing some wrapped path? nly: 1 sec, i'll paste the log nly: str1ngs: no, it works. haha nly: sorry for the noise str1ngs: guix package -L ./guix -i nomad && nomad work nly? nly: >guix package -L ./guix -i nomad && nomad nly: yes, works str1ngs: also you might want to use nomad-git str1ngs: and don't use local IMHO str1ngs: nly: does guix.git environment --ad-hoc nomad-git -- nomad work? nly: nope nly: >Typelib file for namespace 'Gdk' (any version) not found str1ngs: well you modified nomad.scm no? nly: well, yes but actually ran `nomad -Q` str1ngs: right but you modified the propagates right? nly: feature-windows: dcd44aa7df68033b16601cc2eb7aaf688ac2f97f str1ngs: guix.git environment --ad-hoc nomad-git -- nomad works for me str1ngs: disregard the guix.git though nly: let's trade computers nly: lol nly: help! nly: i have modified nomad pkg in guix, does that affect? nly: this is the local change :https://git.piviq.ga/guix.git/commit/?id=04f15cf3725d26130f5b749afed0846400a08b5d str1ngs: right I asked you if you modified nomad.scm str1ngs: also that's not nomad.scm nly: this is the checked out source: http://git.piviq.ga/nomad/nomad.git/log/?h=feature-windows str1ngs: guix show nomad-git nly: http://nly.info.tm/guile/nomad.guix nly: str1ngs: ^ str1ngs: and guix environment --ad-hoc nomad-git then in the environment echo $GI_TYPELIB_PATH nly: /gnu/store/dcfwzgcwnipk7c71j51czkb7bjm6svmm-profile/lib/girepository-1.0 str1ngs: looks good now run nomad same error? nly: no error str1ngs: then guix environment --ad-hoc nomad-git -- nomad . should work too nly: that worked str1ngs: okay I thought you said it didnt work str1ngs: okay so everything seems to be working now then? nly: >guix environment --ad-hoc nomad-git -- nomad nly: works str1ngs: I think the issue was you were not using nomad-git? nly: >guix package -L ./guix -i nomad-git -- nomad *: nly building nly: but doesn't work, was the complain str1ngs: okay so installing to your profile does not work then? nly: yes str1ngs: okay with Typelib file for namespace 'Gdk' (any version) not found ? str1ngs: if so start a new terminal and then run nomad nly: >if so start a new terminal and then run nomad str1ngs: seems maybe you ignored hint: Consider setting the necessary environment variables by running ? nly: same error nly: echo $GI_TYPELIB_PATH is empty str1ngs: GI_TYPELIB_PATH should not be empty please start a new terminal nly: >please start a new terminal nly: C-u M-x shell nomad str1ngs: and source ~/.guix-profile/etc/profile && nomad nly: >source ~/.guix-profile/etc/profile && nomad nly: works str1ngs: your shell is not setup to source ~/.guix-profile/etc/profile str1ngs: as far as I can see nomad.scm is fine. provided you source ~/.guix-profile/etc/profile str1ngs: which is intended nly: thanks for the patience str1ngs: one thing to keep in mind is feature-window is a nly: # added to .bashrc nly: source ~/.guix-profile/etc/profile str1ngs: a moving target. that's why I'm using propagates etc. it's mainly only intended for development str1ngs: also propagates is less likely to cause the cannot register existing type 'GdkPixbuf' issue nly: thanks nly: makes sense now str1ngs: later maybe we can wrap nomad and provide GI_TYPELIB_PATH. str1ngs: if you want to experiment with that. it's possible we can avoid propagates. str1ngs: but then you might get the cannot register type issue str1ngs: also we might be able to switch back to using glib-or-gtk-build-system. since libguile-nomad.so guile extention str1ngs: is no longer a guile extention* nly: thanks again str1ngs: nly: no problem. if you want to refine nomad.scm that would be helpful. since I mainly work locally for development reasons str1ngs: nly: also regards to ibuffer I don't think right arrow and left arrow is all that important. for now we could unbind them. or bind them to ibuffer-next-line etc str1ngs: roptat: spk121 I have a hack that I got from gash for lcov that filters non project files. http://git.savannah.nongnu.org/cgit/nomad.git/tree/tools/coverage.in?h=feature-windows#n97 it's mainly designed to be used with a test suite of some sort. roptat: Is it possible to do xml->sxml without parsing entities? Basically "&" -> (foo "&") roptat: I managed to do almost that by defining default-entities-handler and entities keywords, but handling & that way raises a [norecursion] broken error RhodiumToad: that would be very broken RhodiumToad: why do you want that? roptat: I'm trying to extract the content of a script element roptat: Imagine something like . The browser shows 4, but I would get 1 in a js interpreter in guile roptat: Oh if I set a to "" it's even worse, since the parser thinks the html tags are unbalanced roptat: So… is there a way to get the correct behavior for the script element? RhodiumToad: that's not xml, though? RhodiumToad: html is not xml RhodiumToad: parsing html is a _whole other world_ than parsing xml RhodiumToad: in xml, or even in xml representation of xml, you'd solve that by putting the script in a CDATA RhodiumToad: er, even in xml representation of html RhodiumToad: but obviously in plain html you can't do that roptat: Oh, ok roptat: So how do I do that with html? roptat: Does guile provide a parser? RhodiumToad: not that I know of, but don't take that as definitive oni-on-ion: it must exist.. weinholt: there is htmlprag in guile-lib oni-on-ion: weinholt, yea, i see this recommendation on guile-user mailling list wingo: good evening spk121: roptat: thanks! wingo: moin peanutbutterandc: Hey there, I am using lilypond and I need to #(define symbol preexistingsymbol #1) with the space between them. (string-append does not work). Any ideas? lloda: hi peanutbutterandc, not sure I understand your question, but there is symbol-append lloda: (symbol-append 'a 'b 'c) -> 'abc peanutbutterandc: lloda, Hey there, thank you for responding. I'm trying to follow this: https://lilypond.org/doc/v2.18/Documentation/notation/common-notation-for-fretted-strings (The section on Right Hand Fingerings) peanutbutterandc: The documentation does say one can: peanutbutterandc: #(define RH rightHandFinger) peanutbutterandc: and then use '\RH #1' in lilypond peanutbutterandc: What I want to do is: peanutbutterandc: #(define RH1 rightHandFinger #1) ; I know the syntax is incorrect peanutbutterandc: #(define RH2 rightHandFinger #2) ; again, incorrect syntax peanutbutterandc: I am not entirely sure what 'rightHandFinger even is. But it seems to be a macro or something. That takes an argument of a number. peanutbutterandc: I was wondering if something like that is possible in guile lloda: iiuc you are trying to do something like going from `(a ,b c) to `(a ,@'(b0 b1) c) RhodiumToad: moo lloda: but you can only do that if the context of RH1 #1 etc. concatenates lloda: and I don't know anything about lilypond, so I don't think I can help :-/ dsmith-work: Morning Greetings, Guilers apteryx: can I use pipes like on the shell when using (system ...) ? apteryx: a: yes! wleslie: sneek: botsnack sneek: :) luxurymode: Are there any IDEs that support Guile on MacOS? luxurymode: Does DrRacket support it? Can't seem to find any info online. daviid: luxurymode: i kow nothng about mac, but if available, mos of us use emacs+geiser - drracket is 'stricktly' for racket, afaict luxurymode: Got it, thanks daviid daviid: guilers, is there an easy way to ask for backtrace not to truncate? i kind of remember someone asked, and iirc there was a possibilty using an env variable? spk121: daviid: the backtrace command has two options. #:width , and #:full? spk121: ,bt #:width 1000 daviid: spk121: ah thanks daviid: what about when we run a script in a terminal? thugh i can load the script and call main .. spk121: in that case, set the environment variable COLUMNS daviid: spk121: ok, thanks daviid: since i improved and , which manipulates GValue(s), I now have a wierd bug wrt , which manpulate GIArghuments, how is that? :):) spk121: It is weird that there is GIArgument and GValue. They should choose one or the other daviid: spk121: i had a long converation with the team a while back about exactly this, for us it's twice the wrk, ful of potential bugs, but ... so they say giargumenta are 'more powerfull', gvalues couldnt ... so i answered why didn't you extend/improve gvalue ... i still beleive that's the way they should have done things daviid: anyway, it was more a 'cusiosity of mine' chat then a wish to change, it would be next to impossible to change 'now' ... to much has been done, to many years, to many depenencies ... daviid: ah, there is 'a link', what fails is g-closure-new-simple, i guess somethng is wrong with my enhancement, i'll find out daviid: spk121: are you using python, or just C and scheme? daviid: i mean for guile-gi str1ngs: daviid: do you know if gir files are used by GI. or are they only source reference and the typelib is used. I would imagine it's the later? str1ngs: for context when resolving shared libs daviid: str1ngs: i thnk they are used to compile tose into typelibs daviid: str1ngs: there is a document somewhere which describe the prcess of how to builda typelib daviid: str1ngs: now we, gi api users, do not use gir file, afaict daviid: iiuc str1ngs: right, I just trying to figure out tybelib issue and if GIR_PATH I think thats the name would effect it daviid: str1ngs: i don't much about the 'intern cooking' of those i'm afraid, better ask on #introspection str1ngs: generally gi-scanner scans headers creates a gir file and that used to generate the typelib daviid: i do visit gi files from time t time, to double check enum and flags values mostly str1ngs: I think the gir files are installed for reference daviid: they are yes str1ngs: they are like header files lol str1ngs: nomad generates a typelib but it use m4 marcros so it's kinda abstracted. I should probably pay better attention to this. daviid: i think they are complete, not just headers str1ngs: it was an analogy :) daviid: ok, just wanted to (try to) be 'correct', just in case ... str1ngs: the nice thing about use a typelib with g-golf. is I get one to one functions/methods without having to use SCM_DEFINE. it's kinda nice daviid: yep, but about all this, you'd better talk to them, on #introspection, i'm really not knowledgeable enough to help str1ngs: when talked to #introspection about this guix issue. they seemed to think that multiple store path of a library are being loaded which is kinda the impression I'm getting as well. but I have yet figure out away to test that theory. str1ngs: #guix is saying it could be GI_TYPELIB_PATH order, which could make sense. but that seems pretty brittle to me. daviid: str1ngs: are you refering to this g-golf test failure on #guix? because if, there is only one path for all typelbs right? the same for all, afaict str1ngs: daviid: guix has a patch that hard codes the shlib path when generating a typelib str1ngs: see http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/glib.scm#n394 daviid: str1ngs: i m a bit to busy now, with this closure/signal enhancement daviid: and then, know next to nothing about guix (internals) str1ngs: if I disable that patch we don't get class already define etc. and tests won't fail. but it's not ideal to remove that patch for guix. daviid: i remember the #intrspection firends mentionning that it was the symptom of multiple typelib daviid: i hope some guix super pro come t help you there ... str1ngs: I think if I'll play with ordering and maybe I can find a culprit and hopefully fixing that will resolve it. daviid: but why would guix have two version of the same typelib? daviid: iiuc that that is the problem ... str1ngs: it's probably that there are two paths for a shared library. one typelib load one and another loads the other str1ngs: they are not different version even just not the same path str1ngs: because the shard libary paths are hardcoded to ensure functional inputs daviid: you can ask the typelib path using g-golf, if that hepls str1ngs: I have been using that . depaste is not working for me so I can paste my test script str1ngs: there is not obvious multi paths. but I think it might require recursive depends to catch this issue daviid: str1ngs: maybe post a message on guix-devel, asking for help ... don't know str1ngs: i've been holding off until nomad and g-golf closer to a release. then it will be more important to fix str1ngs: not a rush, just nomad and g-golf are still moving targets which is okay. daviid: i understand, but it is not a g-golf problem, and won't go away 'alone', might take some time to fix, and it would be nice to have a 'good/strong' guix package soon, so imo, the sooner the better str1ngs: right, I've been picking away at it myself. it's just that I use g-golf mostly and I have not submitted a patch to guix yet for that. mainly because I'm busy working on nomad. daviid: i understand str1ngs: it's just a matter of priorities. I wish I had more details on the issue to send an email as well. str1ngs: right now my test script that was failing is not failing now lol daviid: maybe you can suggest nly to resend his bug-report to guix, syaing that upstream make check pass daviid: just that should be easy enough str1ngs: that's a good idea. I'm not effected by this like him because though I use guix I develop nomad mostly locally str1ngs: though via a guix environment daviid: str1ngs: i have a working solution to the signal callback args that hold a pointer to an array of utf8, filename and ... interface :) daviid: here http://paste.debian.net/1132978/ str1ngs: oh nice str1ngs: http://paste.debian.net is really slow for me. is it slow for you? str1ngs: let just hangs forever str1ngs: then finally it will load daviid: no, it's ok daviid: here is the example, so you see the callback - http://paste.debian.net/1132979/ str1ngs: I'm still waiting on the first example haha daviid: now, these warnings are new, anda bit scary: (g-golf hl-api function) doe not define nor re-export the (g-golf gobject) module, nor any of the g-closure-new-simple, g-closure-ref and g-closure-sink - i have no idea, except that it is a module related problem of course ... we'll see daviid: ok, i didn't push yet, i need to clean, i'll do this tomorow or the day after ... str1ngs: no worrie, and no rush. I just can't look at the example here daviid: that's strange daviid: try another browser maybe daviid: have to go, bb tomorow str1ngs: daviid: might be a routing issue. I just used a browser via X11 forwarding from another geo location. this examples looks about right to me. spk121: daviid: it is all C and Scheme. Some of the original C came straight out of the PyGObject, but, it is mostly unrecognizeable as pygobject now killmeplease: str1ngs: ssh -XC 4 life killmeplease: Got that as a tattoo killmeplease: you may need the -C in there if the connection isn't really fast. It's also quite latency bound so it could be that efraim: I'm trying to use scandir to get return a list of .scm files in a directory but i'm getting caught up on the select? part of the function. I'm not sure how to reference each file for the test RhodiumToad: the select? function, if you provide one, must be a predicate, meaning it's called with one arg RhodiumToad: in this case the arg is a filename efraim: I was trying to do it without defining it outside the function, once I defined the function I could pass that for select? and it all worked RhodiumToad: you can put the function inline as a lambda RhodiumToad: e.g. (scandir "." (lambda (fn) (not (string-any #\. fn 0 1)))) RhodiumToad: or RhodiumToad: (scandir "." (lambda (fn) (not (char=? #\. (string-ref fn 0))))) roptat: hi, I'm trying to follow https://www.gnu.org/software/guile/manual/html_node/Code-Coverage.html to get some coverage information, but using the example, lcov reports 0% coverage for every file efraim: RhodiumToad: thanks! roptat: also the example uses file which is undefined chrislck: roptat: see https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/standard-reports/test/test-transaction.scm example code-coverage use roptat: thank you! chrislck: iirc you need add-to-load-path current .scm roptat: that doesn't really seem to help chrislck: are you calling lcov via something like "../lcov/bin/genhtml /tmp/lcov.info --output-directory html" chrislck: i cannot help anymore roptat: yeah, it says coverage is 0% (0/some number), functions are 0/0 covered schaeffer: hello hello schaeffer: for anyone using 8sync; what's the most appropriate way to handle mutex logic? i'd like an actor to only process one message at a time for a resource it owns (a counter in this case) but from what i can tell actors will potentially handle many messages at a time, not just one spk121: roptat: I'd like to figure that out too. I've got lcov working for the C side of a C+Guile library but not on the Scheme side. chrislck: odd. lcov never gave me trouble as above. roptat: not sure what it means, but the lcov.info file I get is full of these lines: DA:536,0 roptat: always 0 at the end, so it looks a bit suspicious apapsch: schaeffer: usually in an actor system each actor has their own private message queue, thus processing one message at a time, but I don't know about 8sync apapsch: how do you tell it processes messages in parallel? mwette: I have a syntax-rules with (pat exp ...) transforming to (begin exp ...). If the source is (my-pat) I get an error from ice-9/psyntax-pp.scm that says "syntax error: sequence of zero expressions in form (begin)". Why is this a syntax error? mwette: example: (sx-match '(foo) ((foo))) using https://paste.debian.net/1133024/ mwette: guile has no issue w/ (begin) mwette: got it: begin requires at least one expression mwette: I changed to expand exp ... as (begin (if #f #f) exp ...) killmeplease: schaeffer: can you link me some stuff about 8sync killmeplease: I'm getting musical band things killmeplease: Something about Casio watches too mwette: google "Scheme 8sync" mwette: or "guile 8sync' killmeplease: It could be that I don't use Google actually - hopefully not killmeplease: Yeah found it, gnu project yeah? nly: is this a good idea? nly: (set! %load-should-auto-compile #f) in "~/.guile" nly: it speeds up using guix-modules(compiled) in local checkout, which doesn't make any sense to me. but i'll take it. Marnen: Hey there! I'm having what looks like a Guile segfault issue, and I can't figure out how to troubleshoot or fix it. I've been packaging 64-bit Mac builds of LilyPond, which includes libguile 1.8. The builds work well for myself and for nearly everyone else, but one user (on Mojave, as am I) consistently reports a segfault right around the time Marnen: libguile is loaded; see https://gitlab.com/marnen/lilypond-mac-builder/issues/16 . The LilyPond group hasn't provided much help on figuring out this particular issue, so I thought I'd come over here... Marnen: I just really don't know where to start in figuring out why Guile is segfaulting on one particular build on one particular computer. mwette: Marnen: try searching trac.macports.org; IIRC, macports has lilypond mwette: Marnen: here are the patchfiles they use: https://github.com/macports/macports-ports/tree/master/textproc/lilypond/files mwette: gdb-9.1/gdb/configure.ac contains: try_guile_versions="guile-2.0" mwette: meaning it does not work with 2.2(.4) or 3.0(.0) rlb: rotty: assuming I'm hitting the same thing that flush problem you reported is fairly bad -- i.e. no way to tell what went wrong unless you're at a repl nor where it happened, form the output. I just get "Error while printing exception." and nothing else. rlb: s/same thing/same thing,/ mwette: . rotty: rlb: i my case it was a silent hang, but fortunately I had a hunch almost immediately rlb: Here, I *think* at least in some cases, (error (format ...)) causes "no output", but (scm-error ...) works fine. ZombieChicken: Is there any place with a comprehensive set of libs for guile? ZombieChicken: I'm specifically looking for something for termbox and, I think, linenoise daviid: ZombieChicken: here is , imo, the best list around - http://sph.mn/foreign/guile-software.html ZombieChicken: Thanks. Hopefully that will save me time in the long run daviid: dsmith-work: coud you tell our bot about this list, it is a bit foa faq i think daviid: *of a ZombieChicken: Hmm. I found something for termbox, but apparently the github is gone ZombieChicken: so Guile is R5 and R6 compliant? longshi: ZombieChicken: it's mostly r6rs compatible https://www.gnu.org/software/guile/manual/html_node/R6RS-Support.html ZombieChicken: okay, ty longshi: np :) daviid: str1ngs: I have worked and added support for GIInterfaceInfo, and so you ahould be bl to use it now, here is a tiny example - http://paste.debian.net/1132644/ daviid: str1ngs: this is a wip, an as it is, any procedure or method that has interface arg or return value, expect and return the 'gnome' pointer, just like 'opaque' structures ... however, i need to enhance this so they become instances of their cprrespondng subclass, being a subclass (just like ) daviid: str1ngs: this because (a) interfaces may have properties, and (b) they are a way that single inheritance languages found to paliate the lack of multiple inheritance ... so, in their 'world', properties are declared, but they must be 'implemented' by the class(es) that, well, 'implement' those interfaces ... it's such a mess, that they needed to 'change' the significance of fundamental words like implementing .., but anyway, in g-golf, daviid: after I enhance what I just did for GIInterfaceInfo, sublasses that 'have' interfaces should just inherit those ... that's the plan, but i need to think a bit more about the design and the work on it ... daviid: str1ngs: but you should already be able to use iterfaces, in signal callback, interface args are pointers, that you my use to call interface methods, like in the example i pasted ... once these args/return value become instances, your code should even not change at all daviid: str1ngs: so, when you re willing to, pull, make ... and try ... tell me if your 'open signal callback (or any other) let you work with its GFile arg ... daviid: str1ngs: what won't work, till i enhance as describe here above, is/are interface properties, when they have properties (not all do have properties - g-file does not have properties) daviid: str1ngs: you may call g-object-type-name on an iterface pointer to get its 'subtype name' (which is considered an implementtion detail by the gnome team, so they are not 'public') daviid: for example, (g-object-type-name $3) -| $5 = "GLocalFile" daviid: str1ngs: afaict, all interface methods are now imported in g-golf str1ngs: daviid: good news, will test this out ASAP. thank you lispmacs: can we efficiently iterate through a bytevector without writing a C function? I mean, obviously we could make iterative calls to -ref functions, but that would require a large memory jump on each -ref call, right? lispmacs: as opposed to in C, where you could just increment a pointer lispmacs: like, say, if you wanted to multiple each float in a bytevector by 2 daviid: lispmacs: you should use srfi-4, i think lispmacs: daviid: i do, but srfi-4 only allows you to reference by index lispmacs: so, presumably, each reference call must jump from the beginning of the bytevector to indexed element lispmacs: as opposed to simply grabbing the element that is, say, 4 bytes ahead in memory wleslie: "jump" ? daviid: lispmacs: grabbing the 4th element means you compute the position, that is what index will do using srfi-4, but you need homogeneous content wleslie: multiplication by a small, fixed power of two is not such a slow operation daviid: lispmacs: you can access bytevectors, exactly as in C, but notced those are actually slower then srfi-4 daviid: basically, you tke the pointer address and increase by what ever value you need ... lispmacs: wleslie: so, say I've got a bytevector with 2 million elements, and I want to loop through, doing multiplication or whatever. Say, I call f32vector ref 10000 lispmacs: f32vector must access the beginning of the bytevector, to figure out starting place of the data lispmacs: then grab the memory that is 10000 floats ahead of that wleslie: then the system multiplies the index, checks that it is within bounds, adds the base, fetches the value, and builds an SCM lispmacs: then next call is f32vector ref 10001 lispmacs: so again, read beginning of bytevector, then read ahead 10001 float wleslie: it doesn't read the whole thing, no lispmacs: wleslie: well, yes, of course lispmacs: but point is it must read beginning of vector, then much later part of vector, each time lispmacs: whereas in C, I just increment the pointer 4 bytes, and read what is there, right next to my last read wleslie: I don't know if the compiler removes the read of the size field (it can't always do so), still, that value is going to be in cache lispmacs: hmm, okay. probably still more efficient with C, though, but the incrementing pointer could be in a register lispmacs: *but->because wleslie: right, but computing the pointer is not actually going to cost much daviid: the cost is in the conversion daviid: which is why in guile-cv, i wrote all these ops in C daviid: lispmacs: you might wana look at guile-cv, it's all done wleslie: ah, so you want to avoid tagging the index altogether? wleslie: I couldn't help but think that the newer compiler happily worked with untagged values lispmacs: I'm not sured exactly what that means, but I need to process like 8 million bytes per second, so efficiency definitely relevant in my case lispmacs: or, 8 million samples, like 64 million bytes in complex numbers lispmacs: daviid: is vigra C or C++ in the backend? a little confused daviid: lispmacs: i didn't use the C++ procs, because, Vigra C didn't bind those at the time, i think some are now available, but i already did write the algebra calculus in C, so i'll stick to this, till our compiler allows to 'reuse' the scheme code,which i kept commented ... str1ngs: daviid: in the example of this 'open callback (open app g-files n-files hint) is should g-files be a pointer? str1ngs: I would think it would be a list of pointers daviid: str1ngs: ah, that is still missing daviid: sorry daviid: i'll work on that asap, i forgot, i thought it was a *GFile, not a **GFile str1ngs: ok good to know, I want to make sure this was working as intended. str1ngs: I'll have to see if any of my other C functions use interfaces maybe I can convert those to scheme daviid: lispmacs: vigra_c is a wrapper of vigra str1ngs: the (open app g-files n-files hint) requires access to g-files to be useful for me. lispmacs: okay, so you effectively need to depend on a C++ library? daviid: i can only bind, in gule-cv, what is in vigra_c ... but vigra itself is C++ daviid: str1ngs: will work on this top priority, will let you know daviid: lispmacs: more then half of the guile-cv code is pure scheme or C code that i wrote str1ngs: daviid: not a huge rush. I'll just hold off porting this signal from C to scheme. daviid: vigra is missing (i don't kow why actually) some fundamental image procesing procs, so i wrte those in either C or scheme str1ngs: I'll have to find another interface to test this further. daviid: lispmacs: delinate, imag reconstructon ... are not in vigra daviid: to name two :) daviid: lispmacs: anyway, one thing i should mention is that guile-cv is (because vibgra is) strict f32 based image processing lib daviid: i did think of generalizing and support other type, but right now, agebra calculus and all other img proc algorithms are f32 baased daviid: lispmacs: it would be easy to generalize and implement everything that's in guile-cv (for f32) for f64 as well lispmacs: when using statprof, how do you figure out what function an entry like "anon #x1db7d38" is referring to? disassembler output gives different addresses wleslie: you know that latest email on guile-dev about jitmaps? that. wleslie: otherwise, if you haven't built guile and your libraries with -g, that may give you something matching that address. lispmacs: I'm not subscribed to that list. Do you have a link to the thread handy daviid: wleslie: this 'problem' also happens with 2.0, 2.2, afaict wleslie: sure, but is the address within a library that needs to be compiled with debug symbols, or is it within your code compiled by guile? wleslie: on jitmaps: https://lists.gnu.org/archive/html/guile-devel/2020-02/msg00060.html wleslie: ah right, statprof is the guile-specific thing wleslie: this may be above my head, sorry b5n: Noob question, I'm trying to learn guile and I'm having some difficulty deciphering the manual. For instance, I am trying to sort a list, according the the manual https://www.gnu.org/software/guile/manual/html_node/Sorting.html#Sorting and (help sort-list) the command takes two argument a list and 'less' or 'less?'. When I use 'less' I get an unbound variable error, if I don't use 'less' I get a b5n: missing argument error. My goal is not to get help sorting a list, but too make sure I am reading the documentation correctly. Also, if anyone can point me to a doc outlining how to list loaded modules/procedures in an emacs helm buffer linking to documentation that would be really helpful, I haven't been able to find anything, but it seems like it should be relatively simple. Guile 3.0.0, Debian b5n: testing. daviid: b5n: less in the manual refers to the nme of the argument, you need to pass an adequate predicate for your list elements daviid: b5n: for example (sort-list '(5 4 3 2 1) <) -| (1 2 3 4 5) b5n: Thanks daviid. daviid: welcome daviid: str1ngs: in order to solve the 'open signal callback first argument, so you receive a lst of pointers to GFile, and in the future a list of instances, I need a bit of time: I need to enhance the way g-closure-marshal builds the callback arg list, which means to enhance g-closure-marshal-g-value-ref - which as it is, only knows that the argument gvalue holds a pointer daviid: str1ngs: to enahnce this 'state of things', g-closure-marshal should be able to access more info then those required to set!/ref gvalues. In order to achieve this, I need to effectively import signals (till now, g-golf dynmically build a instance calling g-signal-query, and that returns a fundamental type tag) and cache the information 'in a way that' both g-closure-marshal and g-closure-marshal-g-value-ref have access, so they daviid: can 'decode' the gvalue value ... it's going to take a few days I think str1ngs: daviid: okay it's not a rush, for now I just use this signal via C. which is pretty trivial with a custom typelib and g-golf. daviid: ok, will let you know ... apapsch: rotty: thanks for the pointer to fmt, from a first look it looks very promising rotty: in case it is helpful, there is an (very stale) R6Rs packaging of `fmt` at it might be useful to derive suitable Guile module definitions dsmith-work: Happy Friday, Guilers!! dsmith-work: daviid: sure dsmith-work: sneek: guile-software is at http://sph.mn/foreign/guile-software.html sneek: So noted. dsmith-work: sneek: guile-software? sneek: guile-software is at http://sph.mn/foreign/guile-software.html dftxbs3e: hello, what is the ",@(" syntax called? RhodiumToad: unquote-splicing? dftxbs3e: RhodiumToad, hmm okay. It looks like it solves issues with accessing variables in different scopes? RhodiumToad: not quite sure what you mean dftxbs3e: when I don't use ",@(" I get undefined variable error, and when I use it, it's gone RhodiumToad: right, but that depends on the context chrislck: ,@(x) means call procedure x which returns a list, and insert the list in-place in the outer quasiquoted list mwette: Yes. See the Guile manual section "Reading and Evaluating Scheme Code" dftxbs3e: hmm dftxbs3e: I'm still new to Scheme. Thanks chrislck: `(a b c ,@(iota 3) d e f) --> '(a b c 0 1 2 d e f). that's all. RhodiumToad: more precisely ,@x evaluates x and splices in the result mwette: `(a ,(list b c) d) => (a (b c) d); `(a ,@(list b c) d) => (a b c d) dftxbs3e: That's what I want. But why does it throw an undefined variable error? dftxbs3e: (if I don't use it) RhodiumToad: just as ,x evaluates x and substitutes the result in place RhodiumToad: what's the surrounding context? dftxbs3e: https://gitlab.com/lle-bout/guix/-/commit/65bb12dfce6814eccefe5b7291362b75393c5805 chrislck: mwette: I call ,@ the bully equivalent of , -- takes up more space in the bus! RhodiumToad: i.e. what are you doing with the result of the quasiquote expression? dftxbs3e: RhodiumToad, ^ RhodiumToad: dftxbs3e: there must be a quasiquote (i.e. `xxx ) somewhere outside that? dftxbs3e: RhodiumToad, full file: https://gitlab.com/lle-bout/guix/-/blob/65bb12dfce6814eccefe5b7291362b75393c5805/gnu/packages/cmake.scm mwette: the code that follows , or ,@ must be a legal expression (x y) is not legal unless x and y defined and x is a procedure (or a is a macro) mwette: s/or a is a macro/or x is a macro/ RhodiumToad: mwette: in this case it's ,@(if ...stuff...) dftxbs3e: I see the difference now dftxbs3e: Quite subtle dftxbs3e: is there a difference in how GNU Guile handles ` and ' ? RhodiumToad: ` is quasiquote and ' is quote RhodiumToad: 'x evaluates to x mwette: '(a ,@(list b c) d) => (a ,@(list b c) d); `(a ,@(list b c) d) => (a b c d) dftxbs3e: hmmm RhodiumToad: except that b and c are both evaluated in the second case mwette: oops : (list b c) => (list 'b 'c) chrislck: ` is more clever than ' because ` can be temporarily disabled via , dftxbs3e: o_O mwette: and you can imbed: `(... ,@(x ... `(... ,@(...) ) ) ) chrislck: ok enough fun {farewell} dftxbs3e: I'll read a full book on it some day dftxbs3e: what can you recommend? chrislck: guile.pdf the manual ;) dftxbs3e: heh mwette: If you can download and build guile, then: cd doc/ref; make pdf mwette: guile.pdf is a ~1000 page manual with lots of useful info and good index mwette: my fav' book on scheme is "The Scheme Programming Language" mwette: dftxbs3e: your ,@(if ... ) needs to return '() for the false case dsmith-work: sneek: botsnack sneek: :) g0d_shatter: hey yall, I'm trying to compile gdb with guile scripting enabled and getting weird pkg-config errors, specifically "usable guile not found" g0d_shatter: this is the output from make https://dpaste.org/bmVS g0d_shatter: the configure options I used were: ../configure --prefix=/usr/local --with-system-readline --with-guile=/usr/bin/guile mwette: what system? (if ubuntu I know) g0d_shatter: debian mwette: may be the same. Is there /usr/bin/guile-2.2 but no /usr/bin/guild-2.2? g0d_shatter: nope g0d_shatter: no guile-2.2 mwette: I'm lost; I've run into this (not for gdb) and ended up hacking things. mwette: does this work?: pkg-config --variable=guild guile-2.0 mwette: you seem to have guile-2.0 ? mwette: guile --version returns what/ g0d_shatter: yes its guile-2.0 str1ngs: g0d_shatter: pkg-config --list-all | grep guile str1ngs: probably you need to install guile-2.2-dev str1ngs: or 2.0-dev I think 2.2 is probably preffered g0d_shatter: str1ngs: thank you for the help, it looks like i've got it to work now g0d_shatter: it was a wrong option being fed to the configure script dsmith-work: g0d_shatter: What was the correct option? g0d_shatter: dsmith-work: ../configure --prefix=/usr/local --with-system-readline --with-guile g0d_shatter: --with-guile being the correct invocation dsmith-work: Ahh g0d_shatter: I had been giving it --with-guile=/usr/bin/guile g0d_shatter: which is not kosher, apparently g0d_shatter: hence all of the pkg-config g0d_shatter: *pkg-config errors mwette: hmm. I just downloaded gdb-9.1 and I get the error wrt 2.0 you got, but guile --version returns 3.0.0. I used "--with-guile" in the configure. mwette: when I point (PATH and PKG_CONFIG_PATH) to my guile-2.0 install it seems to be working rndd: hi everyone! rndd: could I ask newbe question here? mwette: rndd: yes rlb: sneek later tell rndd of course sneek: Okay. wingo: o/ rndd: i have question about guile compiler. i found function compile-file rndd: and argument #:output-file. but the result is a bite-code. can i rndd: build machine code out of guile file? rndd: and, of cource, hi everyone wingo: rndd: guile doesn't currently do ahead-of-time compilation to native code; it has a just-in-time compiler instea wingo: d wingo: i.e. guile does ahead-of-time scheme -> bytecode, and just-in-time bytecode -> native code RhodiumToad: moo gagbo: .go is the bytecode file extension then ? RhodiumToad: yes gagbo: Good to know thanks :) rndd: wingo: thank you for answer wingo: np chrislck: mooo wingo: moorning :) chrislck: or good ewe-ning! rekado_: janneke: unfortunately, GNU rarely feels like a cohesive project. GNU is best when its packages are well integrated with one another. rekado_: janneke: in the case of Guile Studio I think the concern is misplaced, though. Emacs cannot possibly be everything to everyone out of the box. janneke: rekado_: :-( / :-) rekado_: Guile Studio tweaks the defaults to be a better tool for new Guile users. janneke: rekado_: Hmm...it would like to see it less black/white rekado_: those who don’t want to use Emacs for Emacs’ sake. janneke: on the one hand, rms had a vision: gnu packages shall use guile as extension language janneke: and also, gnu uses emacs as its editor janneke: rekado_: sure, but that group is potentially bigger than guile newbies janneke: oh well...let's keep on nudging :-) rekado_: janneke: I’m not confident enough in the objective value of my changes to propose them to the Emacs developers, and I don’t feel like defending these changes over weeks on emacs-devel. rekado_: others have tried to change the defaults but met resistance. One example is the better-defaults package — which I don’t use for Guile Studio, because it removes the menus… rekado_: I don’t think it’s possible to find consensus on changes to the defaults. rekado_: it would take a vision rekado_: I have one for the very specific use case of a Guile editor for newbies. But that’s not necessarily the best for Emacs in the general case. rekado_: … I do not want to see Guile Studio becoming too big, though. Whatever *can* go into Emacs *should* make its way into Emacs (or relevant packages). janneke: rekado_: yeah, i'm not trying to criticize you, i think guile studio is great janneke: i imagine so much could be done if people got together for a week to just make things better RhodiumToad: in an ideal world, yes, because people would agree on what needed to be done apapsch: hello guilers apapsch: some time ago I used m4 to generate PHP code (yes, double d'oh). I'm wondering how guile could be leveraged instead to generate PHP, and make it a single d'oh ;-) apapsch: iirc, there was some effort to generate C code. that might be a starting point. do you know where I can find it? mwette: apapsch: I don't see anything wrong w/ using M4. I've found it to be very flexible. Before the days of automake I used M4 to generate Makefiles; I think that worked better than automake does. apapsch: mwette: It's not inherently bad. it has some warts though, i.e. everything being a string or the arcane looping dsmith-work: Thursday Greetings, Guilers mwette: do you write looping macros? check https://paste.debian.net/1132536/ dsmith-work: Years ago, I was using some 68K assmembers (on DOS!) that didn't have any macros. M4 was *very* useful! apapsch: mwette: yes I wrote some foreach macro, though I may have gleaned it from the manual: https://paste.debian.net/1132544/ apapsch: dsmith-work: isn't everything a macro in m4? :-) dsmith-work: apapsch: Can be. dsmith-work: The diversions are cool. Can create symbol tables and things. I've often wished the C pp had something like that. *: rotty used, aeons ago, m4 to generate C++ "variadic" templates, before variadic templates were added to the language. much fun debugging the compiler messages *: rotty copied this strategy from libsigc++ at the time rotty: apapsch: http://synthcode.com/scheme/fmt/ may be of interest; formatting combinators are really nice for such thing, and you probably could base PHP combinators on the C combinators provided *: rotty used `fmt` to generate C code for a university assignment once, to work around the lack of generics in C rotty: you cannot really tell the difference from hand-written code, IIRC rotty: rekado_, janneke: speaking of making things better in Emacs, the Scheme mode could really take some love; the thing that annoys me most is the very low-level indentation customization via symbol properties; e.g. see rotty: I once added improved support for that to an abandoned (I think) fork of scheme mode: https://launchpad.net/scheme-mode rotty: i never got around to upstreaming that into Emacs, tough stis: sneek bugs sneek: From what I understand, bugs is send reports to bug-guile@gnu.org, and see bug reports at http://bugs.gnu.org/guile longshi: Hello! I've come back to scheme hacking from using go for my (mostly hobbyist) programming and (re-)started with guile as my implementation after reading a blog. I must say, i'm delighted -- and now i've got myself a perfect setup. longshi: I switched to spacemacs some time ago (was using nvim and have run code using chez interpreter) longshi: So now i have geiser, paredit -- and also like a week ago i discoveded nov.el, with allows to read .epub books in a regular buffer longshi: Only thing missing is a package manager longshi: Is akku alright? guildhall seems inferior, but it appears more default longshi: Do you recommend anything? str1ngs: longshi: assuming you use guix works well if say you use GNU/Linux str1ngs: longshi: I meant, guix works well if you use GNU/Linux longshi: yeah, i'm on manjaro, so compatibility shouldn't be a problem -- thanks! longshi: Wow, i never knew such thing existed *: longshi thinks it seems nice nuclearkev: rlb: Right. That's actually what I'm trying, which a fairly basic example nuclearkev: (just prints out the name you enter) nuclearkev: When I attempt to use the `-static` option for GCC, I receive an error stating "ld: library not found for -lcrt0.o" rlb: hmm, it's been a long time, but my vague recollection is that that may not have anything to do with guile. rlb: (recollection which may also be dead wrong :) ) nuclearkev: Hmm, I will try it with a plain C program and see what happens :) rlb: Also, while I've found libtool to sometimes be a double-edged sword, I've also found that from time to time it knows how to do a thing that I didn't. rlb: (if you're not using libtool -- but if you are, potentially different problems...) rlb: Looks like libtool has an info page on "When static libraries are not wanted" which may or may not be relevant. nuclearkev: rlb: you are correct, it doesn't have to do with guile nuclearkev: Just tried it with a basic hello-world C nuclearkev: got the same error nuclearkev: I will investigate this. rlb: I'd guess that you might not have quite the right compile and/or link options yet. rlb: (which of course libtool's designed to try to paper over) rlb: Also, if you don't absolutely need a fully static thing, you can sometimes get away with creative use of LD_LIBRARY_PATH, etc. rlb: i.e. copy guile into a suitable subtree (or install it there) and then run everything "sandboxed" -- of course depends entirely on what the goal is. nuclearkev: found my problem: https://stackoverflow.com/a/3801032 rlb: But guile can generally run fine with a suitable PATH and LD_LIBRARY_PATH (at least last time I was trying something "clever"). rlb: nuclearkev: oh, right forgot to ask first "what platform" :) rlb: Wonder if homebrew can help there... nuclearkev: rlb: this shouldn't be an issue, I'm just on my work machine and was testing out if one would statically compile with guile nuclearkev: Normally I'm on gnu/linux so no stress :) nuclearkev: rlb: I may need to enable static when building guile nuclearkev: `--enable-static=yes` rlb: I suspect you'll at least need a libguile.a, and if that's how you get one, then yep. nuclearkev: Not too sure, but I'll try it! nuclearkev: Thanks for your help, rlb rlb: Hmm, though we have a libguile-3.0.a in guile-3.0-dev in debian, though I'm not sure if we did anything special to get it. *: rlb forgets nuclearkev: is that package built with the `--enable-static=yes` option? rlb: noidea? :) *: rlb looks nuclearkev: I could probably check the repo rlb: I don't think we specify that -- unless dpkg-buildflags does, which I doubt. rlb: (seriously doubt) rlb: I'd guess that you might get it with the defaults, depending, perhaps, on the platform rlb: . nuclearkev: Hmm, I see nuclearkev: Lemme check /user/lib nuclearkev: usr* nuclearkev: I have a libguile-2.2.la and .so rlb: you'll need the .a I think? rlb: In debian, that's in the -dev packages. rlb: But on linux at least, you may get one from any build with the defaults (I'm guessing). nuclearkev: Looks like the default _is_ enabled static nuclearkev: Also enabled dynamic nuclearkev: Well, I'll see what happens *: rlb will bbl lispmacs: hi, what is the least expensive way to output a raw float value lispmacs: to stdout, assuming you start with some scheme double value? It lispmacs: seemed like the only way to do it with just the builtin scheme lispmacs: procedures is to initialize a 4 value bytevector, use lispmacs: f32vector-set!, and then use put-bytevector I guess I could write lispmacs: my own C function to just convert over the Scheme value to a lispmacs: float, and output that with a C function... spk121: lispmacs: yeah something like that. As far a I understand it, there are no 'native' f32s in Guile, so you have to do some sort of conversion like that. mwette: maybe use (system foreign) to generate interface to write() dsmith-work: Hey Hi Howdy, Guilers gagbo_: Another noob question : is there a common pattern/function to add type checks in code ? Or should I just make it myself with (unless (pair? arg) (error "arg doesn't have the correct type!")) ? sneek: gagbo_, you have 1 message. sneek: gagbo_, rlb says: not that I'm recommending it, but I had a project using automake, and so I added the automake "make check" TAP adapter and then wrote a srfi-64 driver to produce TAP, and have been using that some lately. Though it needs help wrt getting more info when something goes wrong (I'd like it to print the full stdout/stderr for a failed test, and it doesn't yet). gagbo_: Oh, I should try to keep my username consistent then gagbo: rlb: I just wanted quick tests so I can at least iterate / refactor. So it definitely works for me for the time being. wingo: o/ janneke: rekado_: eli could have had a kinder response...but he does voice a frustration that i also feel: too little cooperation within gnu janneke: back in 2014, i tried to get emacs + gud + guile to work together and this time the emacs folks helped integrate my work, but i heard nothing from the guile side : https://lists.gnu.org/archive/html/guile-user/2014-08/msg00014.html janneke: it's probably a matter of timing, attention etc., but feeling discouraged or frustrated is something that can happen fast janneke: i pinged two years later, again no replies https://lists.gnu.org/archive/html/guile-devel/2016-09/msg00032.html killmeplease: I've noticed a lambda (like the letter lambda, unicode and shit) in some guile things I've been looking at killmeplease: Is that a quirky variable name which the interpreter allows or do I have to learn some keybindings? lloda: the first lloda: you don't have to use it and I don't killmeplease: variable name or syntatic sugar for the word lambda or something BTW? killmeplease: I can't find it I just had it open spk121: killmeplease: the greek lambda lambda is a syntax rule in core guile that maps directly to the world lambda spk121: it is in boot-9.scm spk121: janneke: Did you ever find a way to make Guile debugging meet your needs? dsmith-work: UGT Greetings, Guilers janneke: spk121: no...my patch also had a puzzle (and probable bug) about breakpoints janneke: spk121: i wanted to raise/address those issues /after/ guile backtraces would be GNU/GUD-friendly janneke: i did not spend any more efforts there, it was probably not the right time spk121: janneke: I've tried a few times to make Guile's breakpoints work in a way that makes sense to me, but, without much success. Mostly now, I use my fancy logging library when I develop in scheme. janneke: spk121: it was pretty hard to introduce guile in my workplace and have people "go back to the 70s printf debugging" as one co-worker framed it janneke: one day, we'll gave Guile Studio (TM) with wonderful guile debugger integration janneke: at the time, i was not ready to look deep enough into guile internals, i'm slowly warming up to the idea mwette: Hi folks. I looked into adding "-g" flag to compile.scm and using that to flag the cps utilities to not reuse registers. If you hit a breakpoint ,locals whould show everything, hopefully. I had to put it down for a bit, though. janneke: mwette: very nice; that would be super helpful mwette: here is (non-working) patch for 2.2.4: https://paste.debian.net/1132122/ mwette: off to work ... janneke: ty mwette: yw dsmith-work: I used edebug for the first time ever yesterday. Pretty cool. spk121: dsmith-work: is edebug a guile thing or an emacs thing? dsmith-work: emacs thing. But it is lispy. Didn't know what to expect. killmeplease: spk121: ah so syntatic sugar. Thanks. I'd lost the tab with the code in it you see, otherwise I'd have posted it. killmeplease: Have a good night jcowan: What are people here's views of the Guile Studio effort? It's intended to be a newbie-friendly skin of GUI Emacs. I've been reading about it on the ML dsmith-work: jcowan: I saw that message. Nothing there for me I think. I already have long years of emacs experience. Don't want something that makes it "user/newbie friendly". dsmith-work: I'm all for better Guile support. But not for dumbing-down emacs. dsmith-work: Just me, of course. jcowan: killmeplease was complaining that Emacs was too alien for him to learn, and I wonder if GS would help. dsmith-work: Probably so. He seems to like eclipse. dsmith-work: Eclipse is the tool of choice for embedded vendors to make a gui. dsmith-work: And I *always* have a hard time with it. I can never figure out how to do what I want. dsmith-work: Like, please don dsmith-work: t "help" me by writing/OVERwriting my makefiles for me. Ugh. *: dsmith-work takes a timeout to make some tea jcowan: "The IDE is emacs. The build tool is make." --Not Sepp Herberger oni-on-ion: =) dsmith-work: One nice thing about emacs, is the interface has been pretty much constant over decades and whatever fad-of-the-day OS you are using. jcowan: "Constant", that is, if you take your .emacsrc around with you. dsmith-work: Yeah. But I don't change too much stuff. OrangeShark: hmm, for Guile Studio, it would be a similar idea to Lispbox? oni-on-ion: does it have a web page or screenshots? OrangeShark: oh the other one that I am aware of is called portacle which combines emacs + sbcl + quicklisp + git in a package oni-on-ion: thats just emacs and CL oni-on-ion: cannot find anything about guile-studio, and having searched before. so to me it is vapourware oni-on-ion: gambit comes with an IDE afaik. oni-on-ion: http://gambit-project.org/gambit13/gui.html oni-on-ion: but i do not know how to access it, or what it is all about. OrangeShark: oni-on-ion: it is a package on guix https://guix.gnu.org/packages/guile-studio-0.0.2/ oni-on-ion: ahh. its emacs with a couple changes oni-on-ion: guile picture language i've installed, its great =) gagbo: Hello, I'm trying to make a xi-editor frontend (just for context, not relevant here). I have 2 ports for IO using json-rpc with the back-end process, but I have no idea about how usually communication is done (that's why I'm trying to do this project) gagbo: I can't have the "send" functions synchronously wait for the backend answer (it seems bad) ; but currently my "listener" thread design doesn't have the context of the "sent message" call. Should I use continuations somehow to make it work ("it" : I send a "new_view" message => I get a "view_id" response from the backend ; and somehow in Guile I can have code like (xi-msg "new_view") that evaluates at some point to the gagbo: "view_id" response of the backend) wingo: moin linas: Hey wingo or civodul, would you be interested in a patch to add Zipfian random numbers to libguile/random.c and if so, best way to submit it? linas: Based on a port of this code: https://github.com/opencog/cogutil/blob/master/opencog/util/zipf.h wingo: i don't know what zipfian numbers are :) wingo: i think we could consider it but there are a few questions wingo: - how useful is it? what fraction of random number users would want it? RhodiumToad: Zipf is a statistical distribution RhodiumToad: it shows up quite often wingo: - it would nice a precise but brief description in the manual with a pointer to where to learn more wingo: RhodiumToad: good to know :) RhodiumToad: https://en.wikipedia.org/wiki/Zipf%27s_law wingo: - how would a c implementation compare to a scheme implementation? i assume you can implement on top of a linear random number implementation linas: Zihttps://en.wikipedia.org/wiki/Zipf%27s_law linas: Yeah, its a very non-obvious implementation on top of a uniform distribution. linas: Not a lot of cpu cycles, but .. just very non-obvious linas: it shows up in scale-free networks: natural language, genomics, proteomics linas: I have existing C++ code, and I was going to write a guile wrapper for that code .. anyway, cause I need it. wingo: the c/scheme question comes from two places, one is that c code costs more to maintain so i hesitate more wingo: and the other is that i would like for scheme to be fast enough to use as implementation for this kind of thing. linas: ah, yes, it is easy enough I could just write it in scheme... wingo: with unboxed floats i think it may be workable linas: like 4-5-6 lines of scheme, I guess... wingo: store any state you need as a f32vector / f64vector and things will pop out of the state unboxed, and will remain that way unless they hit an operator that doesn't yet have support for unboxed floats wingo: which points to an area that we should work on :) linas: should I send a patch on debbugs mailing list, or something else? some git pull req? *: janneke is considering calling Scheme "A functional Lisp" instead of "Modern" jcowan: All Lisps are functional Lisps. And CL is technically more recent than Scheme, though it has not turned its back on the Lisp past as Scheme has (to a degree, not entirely of course) dsmith-work: Hey Hi Howdy, Guilers sirgazil: o/ wingo: 'evening weinholt: yes wingo: quite. ZombieChicken: Does Guile support UTF-8? Seems like there is some variation between scheme revisions and I'd like to know ZombieChicken: and I'm not finding anything specific on it when searching spk121: ZombieChicken: guile does support UTF-8. It can read and write files in UTF-8, and its characters are unicode codepoints ZombieChicken: thanks. I finally found references to that. Apparently my search-fu isn't strong enough spk121: Guile 1.8 and before were only 8-bit characters, and early guile 2.0 still had many unicode bugs ZombieChicken: well, I'm on 2.2.6. I'll assume things should Just Work then ZombieChicken: spk121: Is guile R5 or 6RS? spk121: guile 2.2 has all of R5 and a fair chunk of R6 ZombieChicken: k, ty gagbo: Hello, what do you use for unit testing usually ? Just a scheme file that errors on assertion failures ? I found ggspec on github, but it's really old and not packaged in guix so I assumed it's not used too much nly: hi gagbo, i use this: https://git.savannah.nongnu.org/cgit/emacsy.git/tree/test/check.scm nly: in my-project/testsuites/foo.scm: nly: (use-modules (check)) nly: (check (foobar? baz) => #t) ;; check if (foobar? baz) = #t dftxbs3e: oh guile can run brainfuck erkin: Naturally. ;-P dftxbs3e: erkin, I've been looking at the ECMAScript code in GNU Guile, it's so small! Is it that simple to implement an ECMAScript interpreter? erkin: I don't see why not. erkin: There are quite a few minimal ES interpreters out there. dftxbs3e: I am curious to replace the Node.js crap with GNU Guile at some point, Quickjs was another hope erkin: They're all purely interpreted, mind you. Web browsers almost always JIT compile JS, which is a much harder task. dftxbs3e: GNU Guile also JIT compiles ECMAScript, correct? dftxbs3e: (indirectly through IL) civodul: dftxbs3e: it does, but the JS frontend in Guile is more of a toy currently dftxbs3e: Ah okay. dftxbs3e: Node.js's value is also its standard library civodul: also its compiler (v8) dftxbs3e: civodul, for sure, but at least that can be replaced without interfering with existing JavaScript code nly: great blog: https://guix.gnu.org/blog/2020/meet-guix-at-fosdem-2020/ gagbo: nly: could you just "use-modules check" with the file in the current working directory ? nly: not without (add-to-load-path "/the/tests-path") gagbo: I see, thanks nly: gagbo: try (load "check.scm") in your-project/tests/foo.scm gagbo: it takes me a while to get going nly: gagbo: sorry to go back and forth: nly: (load "check.scm") nly: (use-modules (check)) ;; you're set now gagbo: nly: yay ! thanks a lot nly: :) nly: yw str1ngs: sneek later tell nly I fixed the window growth bug on completions. the echo area now wraps text. which means it now grows horizontally but that's easier to improve on later. sneek: Got it. daviid: str1ngs: just pushed a series of patches to fix the problem I had after rewritting gi-gflags->integer and gi-integer->gflags, so whe you have some time, please pull, run the make dance and check that your based app gets its flags and run the appropriate signal callbacks ... str1ngs: daviid: great news will test with our example app right now. daviid: str1ngs: just wait one more min, i see one change is missing daviid: ok, you may pull now, sorry daviid: let's see how it works now str1ngs: I'll pull again so far though handles-open and can-override-app-id are working as expected str1ngs: you cant test with ./open & sleep 1; ./open foo str1ngs: I think though g-golf can't handle 'open arguments right? the signature looks like this. (define (open app g-files n-files hint)) str1ngs: if can't handle g-files yet that's okay I just wanted to confirm if it should or not. daviid: str1ngs: what is the error daviid: i mean what is the g-files type str1ngs: g-files is a pointer. but is an array of GFile str1ngs: for reference https://developer.gnome.org/gio/stable/GApplication.html#GApplication-open daviid: ok str1ngs: I have a work around for this encase you have other priorities this is just a FY str1ngs: err FYI str1ngs: the output (dimfi app g-files n-files hint) ;; #< 7f26b4c15020> # 1 daviid: where is the gfile type defined str1ngs: it's part of GIO IIRC str1ngs: https://developer.gnome.org/gio/stable/GFile.html str1ngs: could it be because it's an array? daviid: let me read daviid: there are quite a few type still missing in g-golf daviid: but gio is introspectable str1ngs: no worries. daviid: str1ngs: so, indeed is is a pointer, can't you use the gio procedures to use it? daviid: what is missing on the g-golf part? str1ngs: hmmm I'm not sure how I would iterator over a pointer. I would have though this would be a list of ? pseudo name used there str1ngs: actually probably it would be dunno str1ngs: only types I see for gio in the repl is . but I used tab completion not introspection daviid: struct and boxed type would not show using tab copletion str1ngs: GFile does not have an iterator unless there is some generic glib iterator for this which is doubtfully. normally I would just for loop this array in C. I guess the scheme way would be for this to be a list of GFiles daviid: i can't find the definition f a GFile as g-gold sees it after i import Gio daviid: can you? str1ngs: find the defintion in g-golf you mean? daviid: str1ngs: when we import "Gio", it should import everything th Gio typelyb offers daviid: i can't find the definition of GFile after i imported Gio str1ngs: (g-file-new-for-path "./foo") works but returns nothing str1ngs: is there something like ,m but for namespaces? :) daviid: le me see the signature of g-file-new-for-path daviid: good idea daviid: ok, let me play with this daviid: i see type-desc = (interface g-file #f 94356499624864 #f) daviid: which is a good startm, but the two #f precisely to indicate the type is 'incomplete' daviid: which expected, i only implmented, and only patially, the types that are in glib and gobject str1ngs: okay that's good to know, I don't want to impact your current todo list here. str1ngs: for now I can just connect this signal in C and use a C callback to open the URI's use SCM functions. so not biggy str1ngs: the argv and argc and the handles-open removes a big chunk of C as it is daviid: what surprises me is there is no 'boxed 'g-file in the cache daviid: i'll talk to the #introspection friends see what they suggest str1ngs: sounds good, thanks for looking at the handles-open issue that resolve two things here. daviid: if it was a 'normal' struct opaque type, it would work already, g-golf would rturn a lis of pointers ... but for soe reason, it did not happen daviid: but i don't much about gio str1ngs: here's my callback now http://git.savannah.nongnu.org/cgit/nomad.git/tree/typelib/util.c?h=feature-windows#n67 str1ngs: it's mainly used for when you click a link etc. it opens the URI in the current nomad str1ngs: specifically it creates a new daviid: it's ok, i'll look into this asap str1ngs: great work, thanks for the help RhodiumToad: interesting, I see that GParamFlags actually exercises several edge cases RhodiumToad: it has a multiple-bit flag (readwrite . 3) representing the OR of (readable . 1) and (writable . 2) RhodiumToad: and it has non-contiguous bits, with explicit-notify and deprecated RhodiumToad: the corrected logic for gi-integer->gflags should comvert 3 to (readable writable readwrite) RhodiumToad: it should be safe to uncomment (private . 32) too if you need to daviid: hello RhodiumToad indeed, i was defining these 'mnually', now i got the values from their respective gir xml file daviid: RhodiumToad: wrt private, i did see it commented in other lang binding, but i never asked on #introspection why .. i'll do that RhodiumToad: well if it's usually commented then no reason to uncomment it RhodiumToad: you understand how the logic I gave you works in the case of overlapping or duplicate flag values? daviid: the thing is i don't know why :), it'd be nice to confir, i suspect just a renaming daviid: wrt readwite, not sure daviid: either daviid: but it would be no harm to return (readable writable readwrite) i guess RhodiumToad: ok. the integer->flags logic is: if the flag is defined as (foo . 0) then we include it in the output list only if the integer input is exactly 0, RhodiumToad: otherwise we include the flag in the output if all of the bits set in the flag definition are also set in the input RhodiumToad: thing is we don't necessarily know what the caller is testing for daviid: agreed RhodiumToad: so returning all the correct values is better than returning just some of them daviid: yep daviid: to answer your question '... overlapping or duplicate flag values', no, i just trusted you :) daviid: and some checks workd fine so, but it might be good to enhance the test-suite .. RhodiumToad: right. testing various combinations of GParamFlags would be a good test for the flags conversion funcs. daviid: yes, it would be nice daviid: the test-suite is not as structured as i would like it to be, another todo ... but we could easily enhance the flags tests daviid: these could be aded to the ./test-suite/tests/gobject.scm i guess daviid: what is there uses clutter-actor flags, because when i wrote the tests about this, i was working on GValues, (g-golf gobject params-vals), but didn't even have a (g-golf gobject param-spec) module yet ... daviid: RhodiumToad: in (tests support), i updated test-flag as this - http://paste.debian.net/1131513/ wdyt RhodiumToad: sneek, later tell daviid test looks ok to me sneek: Got it. gagbo: Hello, I have a beginner question again : I'm getting close to getting pipes the way I want them to work for async io, but I have a small issue with thunks in (with-output-to-port) : https://paste.centos.org/view/3e5c5e87 gagbo: How can I get the (with-output-to-port .... ) call evaluate to (list from-xi to-xi) ? gagbo: Got it, had to return a (lambda () (list from-xi to-xi)) in the inner let body pinoaffe: I have a list with 747111 elements and need to count how often certain alphanumeric hashes occur in said list, the naive alist-based implementation is way too slow, any ideas as to what might work? lampilelo: make it a sorted list and use binary search? is the order important in your use-case? pinoaffe: order is not important, I just need to know the frequency of each hash pinoaffe: so yeah, I guess sorting might help pinoaffe: thanks! lampilelo: actually binary search won't work on lists lampilelo: so it won't help much lampilelo: pinoaffe: maybe you could use a hash-table that will have the count for every entry and you could increment it instead of adding new things to the list chrislck: pinoaffe: depends how often you want to count these hashes, one off or multiple... I guess you want (list "a" "z" "a" "b" "b") -> '(("a" . 2) ("z" . 1) ("b" . 2)) ? pinoaffe: chrislck: that is indeed what I want pinoaffe: lampilelo: well once the list is sorted, I can count occurences in linear time chrislck: pinoaffe: are you're willing to do a full scan of all 747111 elements once to create the secondary list? the secondary list can be a hash-table lampilelo: you can count them in linear time if they're not sorted too pinoaffe: lampilelo: only if the hash-table has constant lookup time, right? chrislck: that's the idea of hash-table chrislck: (define bins (make-hash-table)) (for-each (lambda (elt) (hash-set! bins elt (1+ (hash-ref bins elt 0)))) long-list) chrislck: then you can experiment what hashing function is best lampilelo: i mean that technically regardless of how you'll structure the data in your list - (list "a" "z" "a" "b" "b") or (("a" . 2) ("z" . 1) ("b" . 2)) - the lookup for the hash in question would have linear complexity lampilelo: it doesn't matter, chrislck has a good solution lampilelo: pinoaffe: my question is: how do you obtain your list of hashes? pinoaffe: chrislck: thanks, I'll try that chrislck: depends how often you'll update your long-list.... whether long-list will be altered in the future... how many times you'll need to access the counts etc pinoaffe: lampilelo: I read a list from disk as an s-expression, filter said list, then count chrislck: pinoaffe: you'll shorten time by accumulating the bins hash-table *as* you read from disk. lampilelo: yeah nly: just found out about this syntax: (let foo ((a 1) (b 2)) foo) sneek: Welcome back nly, you have 1 message. sneek: nly, str1ngs says: I fixed the window growth bug on completions. the echo area now wraps text. which means it now grows horizontally but that's easier to improve on later. nly: still wondering what's it's use nly: thank you str1ngs chrislck: nly: named let? it's one of the most versatile looping structures you can have nly: oh it's a named let, thanks nly: this was in rastache source: (let _token-print ([the-token token] [depth 0])...) nly: i probably should use srfi-9 records instead of racket structs lampilelo: named let is pretty much a recursive lambda str1ngs: nly: pasting now works as well \o/. the echo area has a caveat where you need to use the context menu to paste. still working on that. also when killing a buffer the controls are destroyed and it the new buffer is presented. this is feature-windows branch nly: nice ! str1ngs: dont's spit windows what ever you do haha! nly: haha, got it. str1ngs: I plan to remove those key binds for now. We'll keep the single window model for now str1ngs: thought it's a single window model it's still using emacys windows. so the frame work is there atleast str1ngs: ibuffer-mode is surprising useful too nly: ibuffer looks a lot useful for viewing guix pkgs too nly: or something similar str1ngs: I think we can make ibuffer derive from a more generic list-buffer and then use a rich GridView. str1ngs: though I think we'll stick to text-buffer for now they are simple and are platform agnostic str1ngs: if you want to consider a bookmarks-mode that might give you an idea of what we might need str1ngs: nly: one thing with ibuffer-mode is I'm still trying to figure out how to syncronize emacsy buffer marks with textview. basically marking something in the emacsy buffer should mark the textview as well. str1ngs: right now you just hit RET on the line to switch to buffer. should be intuitive enough I think str1ngs: nly: I think I can merge feature-windows back into feature-g-golf now WDYT? nly: yes, sounds good str1ngs: I think that covers your bugs for now? unless you can think of anything else? nly: the build is still a problem i think, but i don't have a reproducible example nly: atm *: nly -> indian dinner, lol str1ngs: nly: until I can resolve the guix GI interaction issue. you can install locally with make install. and launch with ./pre-inst-env nomad. the development and installed variant use different application-id's so they wont clash. and if you use my ~/.nomad snippet you can have two repl's rlb: Any further thoughts about the best way to write code to work with both 2.2 and 3.0 if it needs to "replace" symbols? If I'm not misunderstanding, right now 3.0 requires #:require-and-replace to work properly, but guile 2.2 rejects that, and it doesn't look like cond-expand will work there. rlb: (I mean it may not "work" within the define-module.) rlb: s/require-and-replace/re-export-and-replace/ rlb: wingo: ^ I suppose one option might be to add a (re-export-and-replace ...) to 3.0 and then use cond-expand after the define-module for the relevant symbols (if that would still work right). oni-on-ion: hmm killmeplease: Is there an IDE for Guile? #guix has convinced me that it's worth a look, I'm not new to functional programming (although I have never used it for what I'd call a "real" project) I'd love to talk to someone who uses it professionally oni-on-ion: emacs ? oni-on-ion: with "geiser" lampilelo: and with info-lookmore for documentation on the spot jcowan: Someone should probably write a really pretty skinnable editor with Emacs at the core, just to get people to shut up about its alleged deficiencies. killmeplease: oni-on-ion: lololol good one oni-on-ion: jcowan, yeah. something awesome for anything geiser/slime with sexp would be great. lampilelo: jcowan: doom emacs? oni-on-ion: but emacs+paredit+{slime,geiser,skewer(js)} is quite a lot nicer than other tools already. *: jcowan laughs killmeplease: seriously can we stop suggesting emacs, it was funny the first time jcowan: It is not a joke. Emacs *is* the IDE Lispers use. jcowan: I see there is an Emacs Lisp plugin for Atom, though that doesn't make Atom an Emacs. But Atom would be a good target to aim at / steal from. jcowan: in terms of UX killmeplease: Fuck killmeplease: So don't bother with guile then it seems:( jcowan: Have you tried Emacs? You know the saying, I'm sure. killmeplease: The problem is you have to learn so much shit to do trivial tasks killmeplease: Say what you want about eclipse, there's still a fucktonne of menus and shit it can do that I've /never/ used but it is gradual lampilelo: emacs is written in c and elisp, you'll learn some functional programming stuff while learning how to configure emacs rlb: killmeplease: it's also the primary IDE for clojure fwiw. oni-on-ion: among many other langs/platforms =) rlb: Indeed. rlb: killmeplease: it may also be at least somewhat language dependent, i.e. I get the impression that it may be a much bigger deal for a language like java (the extent to which some people find the eclipse-style IDEs are even more important to them). rlb: (Not saying you wouldn't prefer it for guile too, just suspect the language itself factors in too.) killmeplease: lampilelo: maybe I don't want to learn how to configure emacs! killmeplease: You must be a gentoo guy. It's not the destination it's the journey right? :P You love a good set up killmeplease: rlb: I mainly use C++ and Python BTW. I ahven't used Eclipse for Java since 2012 ish with some Android stuff. I like it because it's generally been good to me, and I wasn't fucked when I tried to use it killmeplease: Like I gingerly went from text-editor-with-highlighting to more and more of what it can do killmeplease: rlb: in all seriousness I may love Emacs if I got to grips with it. I am not saying all you freaks are crazy or anything - no not at all, nor do I think you're dangerous so I wont just say that rlb: killmeplease: while I don't know much about it, if you're fine with vi-style modal bindings, I know a lot of people who use spacemacs and seem to prefer it -- I think it's a more "curated" emacs, with a large pile of packages and configuration already applied (which I think sometimes unsurprisingly makes emacs slower and/or spacemacs upgrades a bit more "exciting"). killmeplease: But I don't want to deal with emacs + new langauge, where the language is so distant from my meat and balls of wor killmeplease: *work ft: There is nothing wrong with using guile with any random editor. Emacs just has geiser, which makes for a little tighter integration. But it's hardly required. rlb: Also, for whatever it's worth, I've never once regretted the time over the years I've spent learning emacs :) It's one of, if not my most, critical tool. killmeplease: ft: there's nothing right about it either ft: Says who? killmeplease: rlb: the people who did regret learning emacs were probably 'silenced' by those who did not, so not an easy population to sample ;) rlb: I'm only speaking for myself of course. killmeplease: ft: if you think a text-editor, unaware of context, is on par with emacs, or any IDE you're wrong, simple as that. Yes you /can/ but you could probably also flip bits in RAM using gamma rays instead, or some other retarded method - it's not better, it's retarded. killmeplease: Retarded comes from the Latin retardi which is someone who does retarded things killmeplease: So yeah nothing wrong, but nothing right either killmeplease: Case closed lampilelo: lol, emacs community is a lot more friendly than you lampilelo: i've never heard of someone from that community trashing any other editor lampilelo: if you don't want to - don't use it, we won't make you, just find an editor that suits you str1ngs: emacs with geiser is all you need. thinking you need to configure a whole much of emacs is a misconception. str1ngs: s/much/bunch oni-on-ion: ^_^ str1ngs: and if you use guix you don't even need to configure emacs just install emacs-geiser. str1ngs: so your statement is pretty biased IMHO str1ngs: though you might want geiser to default to guile, but that might be a small snippet. anyone in #eamcs #guile or #guix would help you with that. oni-on-ion: heh @ "regret learning" and 'silenced' ... oni-on-ion: yea geiser asks what scheme on M-x geiser, can be told to "not ask" with a default (from a list) spk121: for what it is worth, I never use geiser. I do use emacs, because I am used to its indentation. I wouldn't be a big deal for me to use another editor, but, I've never bothered to to figure out a different solution that does scheme indentation dddddd: What about drracket, anyone here uses it? killmeplease: lampilelo: I'm sorry if I'm not friendly enough for you - I thought were inclusive now and allowed to be our true selves :( killmeplease: lampilelo: I just wanted to not indulge the tone, "well actually a text editor is usable" - yeah it is, but this adds nothing. dddddd: Setting it to "Pretty Big" seems to do a good job with scheme code. oni-on-ion: what are you on about, are you making a point? this does not feel guile-related, killmeplease . just use whtever you want. no one is forcing you to do nothing. it may not make any sense to worry about or get emotionally worked up for things that are not part of your life. no one is trying to sell you anything =) nly: hello killmeplease: oni-on-ion: I apologise I was trying to explain myself to lampilelo and also remind people that bastards are people too. killmeplease: I'm trying to assess who is worth taking notice of and who is worth taking under advisement, 'cept for cat ern (one word, don't want to ping him) I don't recognise anyone here oni-on-ion: ah, well.. wait, what ? oni-on-ion: is this a hollywood who's-who gala party ? killmeplease: I don't understand nly: there is atleast one person who uses vim or some variant with guix, i think killmeplease: "no"? oni-on-ion: "who is worth taking notice of" ... not sure freenode irc is that kind of place. perhaps instagram ?? holomorph: ez /ignore nly: i'm not him, I only know that Emacs works well. oni-on-ion: both true things killmeplease: oni-on-ion: ah... see freenode has A LOT of students on it, like the guy who went "well actually you can use a text editor" - a little inaccuracy saves a lot of explanation and it missed the point entirely. IDEs (generally) help, that's why we have them oni-on-ion: killmeplease, ah ok. that is also true. editing text one character at a time, and using arrow keys, is to me quite an ancient way to produce text and work with characters. oni-on-ion: http://danmidwood.com/content/2014/11/21/animated-paredit.html killmeplease: I don't do social media but I don't judge people who do either oni-on-ion - so if you take notice of people based on those I don't judge killmeplease: oni-on-ion: I'm a ctrl+space whore killmeplease: I think I probably type 1/5th to 1/3rd of the code by character count oni-on-ion: killmeplease, dont know. i am not commiting to any ideas of beliefs about myself. just observing the language used killmeplease: oni-on-ion: okay how about this: killmeplease: do you take notice of people proclaiming the world is flat, irrespective of their looks? (except to notice them as idiots) oni-on-ion: yes typing is one aspect. but there is refactoring. like moving convenient blocks of code -- paredit is a *great* tool for many uses when working with s-expressions. oni-on-ion: (see the animated guide examples) killmeplease: Writing people off as authoritative sources is a good optimisation. oni-on-ion: yep. dont think anyone here is being too pushy though. but have spoke what they use for IDE with guile. ^_ killmeplease: I wouldn't call gedit and IDE right ft? str1ngs: are you trying to make some poor attempt at describing emacs as a text editor? oni-on-ion: integrated development environment, we can call the shell or terminal an IDE as well oni-on-ion: unix/bsd as a whole is essentially a C IDE. spk121: ed(1) is the one true editor killmeplease: str1ngs: if you dont' read what I say, I'm not sure how to answer killmeplease: Anyway BRB good luck killmeplease: str1ngs: seriously man read up, you were here when it was said str1ngs: seriously it's like you just walked into a Toyota dealership with a hate on for Toyota's lampilelo: str1ngs: it's not #emacs, so not quite str1ngs: okay so we are Toyota racing development :P oni-on-ion: okay, so he enters a race track where most drivers are in toyotas. oni-on-ion: =p gagbo: Back on track, what should I use in Guile to make TUI ? some curses bindings ? spk121: gagbo: guile does have some ncurses binding. Ncurses is a bit old school. I don't know if there is a more modern toolkit for TUIs. gagbo: hmm ok thanks spk121: fwiw, I am the maintainer of guile-ncurses, so feel free to reach out if you have any questions oni-on-ion: fwiw, emacs is nice for TUI. surprisingly: has buttons, lists, trees, images, etc. gagbo: I'm making a xi front-end in guile to play with the language, it's really about the software I'm making, not the one I'm using to make it :p gagbo: spk121: Oh, did you happen to push a guile 3.0 version on guix packages gagbo: ? spk121: gagbo: it does build on 3.0. I don't maintain the guix package. killmeplease: str1ngs: I had no idea there was ONLY emacs? killmeplease: So I walked into a car dealership thinking there might be more than just ones that use internal combustion engines, but they all do - might be more apt killmeplease: Thanks lampilelo bandali: it's not ONLY emacs but emacs is very popular in the guile/guix development circles spk121: killmeplease: if you want an alternative, there are scheme modes for the microsoft code IDE, but, they don't have any real integration with Guile, last I checked killmeplease: spk121: I'm okay if the IDE doesn't interface with the language like emacs (to my knowledge) does! I'll check for Eclipse killmeplease: So if you mean that sort of hard core integration, yeah, also wary of using Microsoft stuff in general. Just saying of course you couldn't know this. oni-on-ion: well, there are a lot of text editors, if working char-by-char is fine. daviid: killmeplease: you should first and above all, try to use emacs+geiser or guile-studio - you have spent, here 'just' today, quite a lot more more time 'discussing things' then it would have taken you to read an introduction and/or watch one of the hunderds of tutorial videos ... I've had intern, 17y old, zero lisp/scheme knowledge, zero computer sc. background, started in 15' ... sneek: daviid, you have 1 message. sneek: daviid, RhodiumToad says: test looks ok to me oni-on-ion: what is this guile-studio ? could not find any info. daviid: RhodiumToad: tx, will push dsmith: Personally, I won't work on something or somewhere unless I can use emacs. Everything else is just too hard or too clumsy or too slow. daviid: everything else id a joke oni-on-ion: yea. daviid: *is nly: I am trying to do: nly: (make-record-type "hype" '()) nly: (make-record-type "hype-train" '(content) write #:parent "hype") nly: killmeplease: daviid: I've gotta say programmers without formal computer science knowledge are not good things, state machines for example - a working knowledge of this is EXTREMELY important, I will admit parsing is perhaps a bit overrated. killmeplease: So I don't take "was taught to children" as an endorsement. nly: but looks like make-record-type no longer takes #:parent argument: https://www.gnu.org/software/guile/manual/guile.html#Records daviid: that was to answer your 'it is so difficult to learn ...' daviid: but i'm off the conversatin, it is a complete total loss of time, afaic, good luck with eclispe ... *: dsmith shudders killmeplease: daviid: those of us with productive IDEs can afford the time I have "wasted" here it seems ;) oni-on-ion: write a blog post about it killmeplease: Hope this channel has a burn ward dustyweb: killmeplease: I'd rather have people be nice than have a burn ward though killmeplease: oni-on-ion: I don't do that either, blogs are not authoritative sources killmeplease: yeah daviid be nice eta-expanse: such troll oni-on-ion: WRITE the post. YOU are the authority for your own world. ^_^ killmeplease: oni-on-ion: you mean notes? oni-on-ion: whatever you are talking about here oni-on-ion: expressing opinions and stuff. we all have 'em dustyweb: I think we also shouldn't be dismissive of people who don't have a formal CS background. I wasn't one, and gained a CS background participaing with this community largely oni-on-ion: isnt that why people blog ? because then we get the audience that wants to hear about it. killmeplease: dustyweb: formal CS background and formal CS study are different things oni-on-ion: dustyweb, i relate to this ^_^ dustyweb: a lot of programmers start out as glue programmers. Some programmers only do glue programming; there's so much to be done that honestly you can do a lot of valuable work that way dustyweb: if people were really hard on me for not having a formal CS background when I came in here dustyweb: I wouldn't have picked one up by participating dustyweb: so I really like to be welcoming to everyone dustyweb: get people excited killmeplease: But it can't be denied there's a massive deterioration in software quality and terms like hard core real time are being massive diluted - things like control systems are an entire area of formal study, not some if statements dustyweb: that's how to improve the world oni-on-ion: this convo will be endless. like putting quarters in the plastic horse at the mall . but it does not go anywhere killmeplease: oni-on-ion: mathematics has proofs, yet it also does not go anywhere oni-on-ion: ^ thx for the example. *: nly (define-record-type name *ctor* pred fields) ;; wishes it was ctor -> constructor killmeplease: It was a counter example oni-on-ion! killmeplease: If it has a proof there is no talk to be had, it is done. oni-on-ion: killmeplease, it was an example of putting quarters in the horse. for feeding the aimless convo. i thank for the example which had proved this nicely killmeplease: oni-on-ion: "QED motherfucker" what you say when you're arguing with someone in maths, and they just have to take it 'cos it's proved! oni-on-ion: its a lot of politics of the state of tech and human-computer interaction and etc, there could be much to talk about. there "is" a lot to talk about =) str1ngs: the TLDR version of this conversation. Hi what IDE should I use for guile. Answer is emacs. proceed to now bash emacs oni-on-ion: going to have to back out oni-on-ion: =p killmeplease: str1ngs: where did I once bash emacs? *: eta-expanse inserts quarter *: killmeplease rides eta-expanse killmeplease: quarter of what BTW? killmeplease: I can't think of anything other than a certain shaft. dustyweb: killmeplease: ok, stop killmeplease: so seriously now, if we can stop hazing the new guy, it really is /just/ emacs? nly: well, Guile has a certain DIY culture. So, just like everybody uses different programming libs, it might be fine to use whatever IDE you like, but as you can see most people are happy with Emacs, doesn't mean you cannot use whatever you like. killmeplease: nly: oh not this again nly: >just emacs nly: yes killmeplease: "just emacs" as in "something which could be called emacs" 'cos there's like 13 different emacs before plugins and stuff str1ngs: not once did I bash emacs did he say :P killmeplease: I didn't! nly: this one: killmeplease: gnu.org/s/emacs nly: https://www.gnu.org/software/emacs/* killmeplease: nly: or any other emacs 'cos there's loads nly: killmeplease: sure, i could guide you with the plugins and basic config str1ngs: for this you dont' really need much just emacs and *maybe* geiser killmeplease: Maybe in the future dustyweb: Emacs is the only editor with super nice support. If you prefer vim keybindings, there's the spacemacs emacs configuration suite nly: >Maybe in the future nly: sure :) str1ngs: maybe is progress from never at-least :) nly: hi dustyweb: I love the ircbot in 8sync dustyweb: hi nly dustyweb: thanks nly: is there any authentication mechanism dustyweb: nly: no... it's pretty demo-quality ;P str1ngs: dustyweb: yes I was also looking at your haunt.scm for 8sync will be useful later. killmeplease: dustyweb: lets not bring up vim either dustyweb: str1ngs: cool, hope it's helpful dustyweb: I've learned a lot since starting work on Spritely dustyweb: I hope to bring what I've been building in Racket-land back over to Guile soon killmeplease: str1ngs: I'm not going to reject the gracious offer of help from nly outright, it's sensible for me to keep it as an option, but right now... I've got enough pain to fight through dustyweb: but I want the distributed programming stuff to work first lampilelo: killmeplease: what do you use for programming in c++ and python? killmeplease: Eclipse killmeplease: Again str1ngs: nly: I wonder if we could use 8sync in place of emacy's agenda thingy nly: dustyweb: thanks nly: str1ngs: no idea nly: ah, yes, i guess killmeplease: lampilelo: eclipse CDT, PyDev killmeplease: and sometimes PHP - but only in small bursts otherwise it makes me want to join ISIS killmeplease: ... dustyweb: killmeplease: heya, I've asked it before already; I'm asking again for you to tone it down a little. killmeplease: Tone what down? killmeplease: I was asked a question dustyweb: the bombastic way you're saying everything, particularly references to unrequested sexual actions and violence, and the large amount of dismissiveness dustyweb: it's not needed and changes the tone of this place killmeplease: sexual what? dustyweb: * eta-expanse inserts quarter dustyweb: * killmeplease rides eta-expanse dustyweb: quarter of what BTW? dustyweb: I can't think of anything other than a certain shaft. killmeplease: rides as in "on the back of a horse" dustyweb: then what's the "certain shaft" killmeplease: And I don'tknow WTF the quarter is a reference to even now killmeplease: I didn't mean putting a quarter of my dick in eta-expanse seriously I have no idea how you got that from it eta-expanse: i regret engaging with this person at all killmeplease: Yeah that's why I phrased it that way killmeplease: I was trying to be tactful killmeplease: If quater horse riding is a beastality thing this is honestly news to me (and I am surprised too - I didn't think it would be a "certain shaft" which is why I asked) - I was not the first to bring that up eta-expanse: maybw best to cool off and post somewhere else for a bit killmeplease killmeplease: It was you and oni-on-ion though not me dustyweb: killmeplease: how about this dustyweb: hard reset dustyweb: just be nice. dustyweb: requesting now killmeplease: I'll do my best :) dustyweb: okay, thanks. dsmith: It's good to remember that not everyone here is a native english speaker. malaclyps: I'm trying to install a software package in git that has a guix.scm -- I've tried `guix build --install-from-file ./guix.scm` but there are two packages defined in the guix.scm, so it is returning a list of packages, not a single one to install. How do I specifiy just one of the packages? malaclyps: oops! sorry, wrong channel dustyweb: malaclyps: :) malaclyps: hah! hi, dustyweb! dustyweb: heya malaclyps *: dustyweb is writing an email to cap-talk trying to figure out if intuitive ocap-safe macros are possible... thinks they have figured out such a system killmeplease: Who's they? The cap-talk people? eta-expanse: killmeplease: just stop killmeplease: ? killmeplease: I think I'm misreading it malaclyps: dustyweb, I chatted with a few folks internally at EFF about the crypto autonomy license. malaclyps: it's a little frustrating to have missed the main discussion, but that's on me: I hadn't realised all the ramifications until you pointed it out killmeplease: anywhere I can read up on this? killmeplease: I'm just curious so if it'd be difficult to find don't bother malaclyps: anyway, it's part of a broader attempt to understand if there are any wider ramifications (negative, positive) to copyright activism wrt people's new experimentation with licenses malaclyps: meanwhile, back to guix/guile! killmeplease: malaclyps: I know the FSF has been looked at negatively for not "looking after" copyright assigned to it. Any relation? dustyweb: killmeplease: different issue, not really about copyright stewardship but stewardship of a list of licenses on the osi license list dustyweb: malaclyps: I plan on writing up more on what I think about the scope of FOSS licenses should be dustyweb: as well as some framing about free software through the lens of agency dustyweb: malaclyps: would you be interested in reviewing before I posting? malaclyps: dustyweb, sure! killmeplease: Oh that clusterfuck, I don't envy you guys. The worst thing is that these license guides are largely untested killmeplease: Fortunately in most cases it is clearly stated what the intention of the license is, so the spirit or motivation is clear killmeplease: I do not envy you at all malaclyps - then there's the international issues killmeplease: Nor you dustyweb it's a very tough area, good luck killmeplease: BTW malaclyps / dustyweb there's a project called wxWidgets (WX4LIFE) it was called wxWindows but Microsoft wanted to be more like oracle and was going through a phase. The license wording is the same and the wxWindows license is OSI approved. It JUST changed its name killmeplease: Any hope of that getting done? killmeplease: It changed its name years ago too. killmeplease: All this was before 2005 killmeplease: dustyweb: malaclyps the last I'll say of it is this: the wxWidgets project states in a few places "the wxWindows license was OSI approved, it's the same license but the name changed, we have written to the OSI about resubmission" in a few places - as you're here, maybe you can help me get something done. wx is a geat and alive project, also screw qt (I didn't use the "F" word there and it should be F'ed hard) eta-expanse: killmeplease you're dominating this channel with comments that make me very uncomfortable holomorph: plonk and move on, it's easy nly: is there any order-independent match in guile? killmeplease: eta-expanse: how? killmeplease: eta-expanse: if you tell me how I can stop killmeplease: What should I do? Bring it up when he returns? malaclyps: killmeplease, I think I can see what you're doing. If you don't mind going quiet on this channel for a bit, I can discuss it with you in private messages? chrislck: nly: order-independent (ice-9 match)? how/why would this be useful? killmeplease: Sure please do [not sure what I'm doing BTW, but I can find out there] nly: chrislck: your point makes sense, it's just some code i found, that looks buggy, but it can't be right? chrislck: show nly: https://git.piviq.ga/rastache.git/tree/rastache/commons.rkt?h=guile-port2#n130 nly: procedure: rast-ref* chrislck: it's definitely not orderindependent nly: i would think if keys 'ks' were (list 'a 'b) then the 2nd match would be ideal, but first would also match. nly: oh, ok chrislck: racket/match uses (list k) whereas (ice-9 match) uses (k) nly: yup, thank you nly: :) chrislck: yw daviid: heya guilers sneek: daviid, you have 4 messages. sneek: daviid, str1ngs says: great news and excellent timing. I will look at this ASAP. sneek: daviid, str1ngs says: looks good so far. just to clarify #:flags '(handles-open can-override-app-id) is known to not work right? also for the language binding does it make more sense to have drop argc? seems redundant for people to use and might be a source of gotcha for non C programmers. just a thought. also passing the wrong value to argc can cause a seg faults. WDTY? for now this signature is okay if it means to much work. sneek: daviid, str1ngs says: what I'm proposing is something like this. (g-application-run (command-line)) the length is implied. sneek: daviid, str1ngs says: (g-application-run app (command-line)) ** to be more precise. daviid: str1ngs: let's talk about the flags as a separate matter, we need to fix this, but I want to make sure tha g-application argc and argv work fine: I mean by that I would like you to confirm that when you pass these args with sensible values for your usage, it does use those, and you cn 'prove it', so to speak, is the case? daviid: str1ngs: wrt g-application arg list, this is something users can do, if/whn they wish, for example, you could well provide nomad with a nomad-run procedure that does what you suggested ... g-golf however will nevr do that, the reson being things must be 100% automatic, and based, stricktly, on the GI typelib(s) it imports daviid: so for g-golf, gtk-init, clutter-init ... have 2 args, g-application-run has 3 args ... and g-golf does not make 'jugements' about that, of course not ... this being said, there are two know well justified (and documented) exceptions daviid: (1) 'out args must _not_ be provided, g-golf allocates mem and return those ... and (b) the boolean values, upon user request only, can be stripped from the results, when the boolean merely tells the user if the procedure call succeeded (this is describe in g-golf's manual) daviid: *reason daviid: *judgments daviid: g-golf provide users with the scheme representation of the objects, properties, functions, methods ... as an exact scheme representation of what is in the GI typelib, except for the two above lested exceptions daviid: wrt why flags do not 'behave' the way you say it should - there is no bug though, which makes things a bit more complicated to 'debug' - i have no idea, but i want you to connect (even tmporarily) to this signal the warning claims it's missing, and try the app, see if everything then behave as expected ... if every signal closure is called, iow, if the app runs fine then ... daviid: if yu do that, with the shortest posssible app/scrpt, then i can ask to the #introspection folks why it stop working if we comment the 'missing' connect ... daviid: I still need to wotk on the 'inout and double check the 'out arguments 'preparation (which preceeds the call to invoke ...) str1ngs: daviid: in terms of passing argc to gtk-init etc. I understand your reasoning in terms of automatic one to one bindings. I'm passing on that for none C programmers this could be a real gotcha. And also give the wrong input it will it will segfault. str1ngs: daviid: as for the open signal handling this is not working as expected. connecting to command-line or handle-local-options just to by pass this does not help fix the problem. Given the example I gave you. the flags #:flags '(handles-open) should call the 'open signal when passed non flag arguments on the command line. if this does not work now that's fine. but I don't see the benefit of trying to get this to work with any of the other str1ngs: signals. Since I've have never had to use those before. daviid: str1ngs: i am sorry you are not willing to help, but without a workning snipsett, i can' tven check that the flags are being set properly ... str1ngs: I have provide two examples one in C and the other in scheme, I'm not sure how much more helpful I can be. daviid: str1ngs: you gona reapeat this ... the scheme example does not even launch, so i cant even track the flags ... str1ngs: when setting the 'handles-open flags previously I've only had to use 'open and 'activate as it's documented. 'command-line and 'handle-local-options could by pass the error but they do different things str1ngs: we are only repeating this because you are insisting the use of command-line which actually makes the example more complicated. daviid: str1ngs: i've added a 'command-line signal, just to be able to track the flags daviid: and it seems at least ther are being set properly daviid: but then raised another exception, do i have to pass an argumnt to launch it? daviid: here the example i run - http://paste.debian.net/1131335/ str1ngs: the signature for the lambda should be (lambda (app command-line)) daviid: str1ngs: . args will do str1ngs: I'm not sure how . args works sorry str1ngs: also I would provide #:application-id "org.gnu.example.open" daviid: i just wanted to double check that the app flags are being set correctly by g-golf, which seems thecase str1ngs: you need a dbus ID since it uses dbus to communicate with the primary application daviid: str1ngs: i know nothing and don't really want to know, which is why i wanted you to provide an exmple ... str1ngs: what does . args do? or can you point to the documentation so I can better understand that daviid: please patch the above and paste, tell me with what args i should launch the app and let's try to figure out why .... str1ngs: http://paste.debian.net/1131337 this example works but really not that useful daviid: str1ngs: . args, args is bound to what ever arguments the singllsend ... i didn't know how may, what they are ... at this point i didn't care ... str1ngs: ah like so a variadic argument? I guees daviid: str1ngs: all ths is just temporary, we need to 'do something' to track ... hence, i don't care about the command-line signal args, i don't know, don't want to know ... then you can use (lambda (. args) 'nothing) ... just a temporary trick str1ngs: daviid: I think to test with local-options or command-line I need to provide an options group str1ngs: actually --help should work mabye daviid: str1ngs: i didnt wna test 'command-line, i wanted to check the flags, that's done daviid: there are correct daviid: do we agree? then why would they not trigger the same expected behavior in scheme then in C .. that is the mistery, but they are set, i think daviid: the last example you pasted works, but it doesn use the same flags ... daviid: do you pass an arg on the cmmand-line? str1ngs: well you need a primary instance so do ./foo.scm & disown str1ngs: then test with ./foo.scm file daviid: what file str1ngs: but local-options and command-line deals with arguments but I always just use 'open since it handles files and I can just make an option group for the reaset str1ngs: file can be anything it just treats it as a "file to open" str1ngs: which should then be opened on by the primary instance using the 'open signal str1ngs: handle-local-options can theoretically open files too. but it has many edge cases. str1ngs: see https://developer.gnome.org/gio/stable/GApplication.html#GApplication-handle-local-options daviid: let's try to figure, now that we agree the flags are being set properly, do we? why the 'open does sem to be 'sufficient' in scheme, while it is in C str1ngs: https://developer.gnome.org/gio/stable/GApplication.html#g-application-open says the application must be registerd first daviid: str1ngs: i don't know gio - that much daviid: gnome became unusable daviid: gtk2 is a billion better then all this :):) daviid: what a mess daviid: so, back to our example, the ./open.scm daviid: let's focus, it is supposed to work just like this? daviid: i mean commentig the 'command-line signal daviid: this one - http://paste.debian.net/1131341/ str1ngs: daviid: you only need on open signal but yes that looks right str1ngs: also maybe comment out can-override-app-id for now because it caused it's own issues str1ngs: daviid: s/on/one daviid: http://paste.debian.net/1131342/ str1ngs: also you need a application property for application-id like this #:application-id "org.gnu.example.open" daviid: and i only have to launch it once? with ot without command-line argument(s)? str1ngs: the way this should work is. the first call with ./open.scm & disown will call 'activate. once it is running if you do ./open.scm ./test-file . it will call 'open but on the primary instance str1ngs: it's like emacsclient works to open files str1ngs: like how* daviid: i don't laubch gimp twice ... this is chineeese for me ... but ok str1ngs: well this avoids launching gimp twice. it just tell the main program to open the file and exits str1ngs: it's basically a RPC call over DBUS str1ngs: some times is handle purely by dbus with a service file. you just don't notice this if use double click and not a shell. daviid: str1ngs: i wish to have an exmple i only launch once daviid: so i can post on #introspection str1ngs: well that would require a threads str1ngs: give them this example it's pretty text book. they should understand how the primary and local application works str1ngs: this is atypical gtk program as far as I'm concerned spk121: . daviid: spk121: do you have a scheme code i can snarf for gi-gflags->integer daviid: or look at, i found there is a bug in mie :):) spk121: daviid: the way we handle flags is slightly complicated. A flag is a goops class that has a symbol slot and a number slot, created during introspection. To convert flag to integer, we just look at the integer slot of the goops instance daviid: spk121: in g-golf, flags are instances, the code to convert a list of flags to an integer is here (I snarfed it from sbank iirc - not to justify myself, just fwiw), just 4 lies of code - http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/support/flag.scm?h=devel line 69 ... daviid: spk121: g-application-flags are like this: http://paste.debian.net/1131347/ daviid: when i call (gi-gflags->integer $3 '(handles-open)) -| 8, but i should get 4 daviid: or any bitwise pro here can help of course daviid: here is the list of flags daviid: (flags-none is-service is-launcher handles-open handles-command-line send-environment non-unique can-override-app-id allow-replacement replace) daviid: here the list of one flag, to test: '(handles-open) daviid: here is the list of booleans i obtain: $7 = (#f #f #f #t #f #f #f #f #f #f) daviid: then (list->integer (reverse ...)) gives me 8 - what am i doing wrong here? RhodiumToad: list->integer isn't the right thing there? RhodiumToad: flags-none is 0, not 1 daviid: the gnome team tells me it should be 4 RhodiumToad: no I mean it's not the right thing to use RhodiumToad: the presence of flags-none is pushing everything left by one bit daviid: hum RhodiumToad: it's easier to understand the problem if you think about the case when there's actually only one flag RhodiumToad: shouldn't you get the value from the enum-set slot rather than assuming that they are contiguous bits? daviid: RhodiumToad: i don't have a clear picture yet, because it did work fine so far, whch mans that allother flags i somewhat 'played' with, clutter, gtk ... including in the tst-suite, prob didnt have a zero entry RhodiumToad: (so think about the case where there's actually only one flag but it has the value 8, not 1, because other flags were deprecated) daviid: RhodiumToad: this the most hidden bug i faced in years, because (gi-integer->gflags $3 (gi-gflags->integer $3 '(handles-open))) -| $11 = (handles-open) _but_ it passes the integer to the gnome app, as 8, and the gnome app expect 4 ... it took me days to find out this RhodiumToad: that suggests you've made a compensating bug in the conversion from integer back to flag daviid: RhodiumToad: both algo are just a few ies, here - http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/support/flag.scm?h=devel line 69 ... RhodiumToad: sec, just cloning your repo for convenient access RhodiumToad: devel branch, yes? daviid: RhodiumToad: oh, ok :) daviid: yes, the devel branch RhodiumToad: ok, well both functions are clearly making the same fundamental mistake RhodiumToad: they are assuming that the symbols list represent bits starting from bit 0 and increasing contiguously, with no symbol for 0 (i.e. no bits set at all) and no gaps RhodiumToad: this assumption is not sane sneek: I'll keep that in mind. daviid: RhodiumToad: can you suggest a patch? RhodiumToad: (what'd I say that triggered the bot?) daviid: RhodiumToad: yes:):) our bot is listening to everything we say haha str1ngs: RhodiumToad: I know that was kinda random of him lol str1ngs: sneek: settle down please :) RhodiumToad: blah, test RhodiumToad: heh str1ngs: this is a word sneek str1ngs: this assumption is not sane sneek: Okay. RhodiumToad: daviid: so let me test my understanding, a gi-flag is just a gi-enum where the enum values are intended to be OR'd into an integer? str1ngs: hmm this assumption seems to trigger something daviid: RhodiumToad: the enum vlues are given by the GI descrition of the flags 'instance' RhodiumToad: so given a list of symbols you should be converting them to an integer by ORing the values, and converting an integer to a list by testing each bit daviid: hum, i need to double check what i just said, but i am almost certain the values are given at import time RhodiumToad: this assumption maybe is relevant to the bot RhodiumToad: this assumption is strange RhodiumToad: this bot is not sane sneek: I'll keep that in mind. RhodiumToad: hah str1ngs: lol daviid: RhodiumToad: not sure what the algo should be exactly :(, i thought i got it right :) daviid: i think it should be based on the values we receive from GI introspection daviid: RhodiumToad: asking on #introspection, it seems most flags descriptions star with a flag that is zero 'associated', but not _always_ RhodiumToad: right, basing it on the enum values is exactly what I said you should do RhodiumToad: I'm thinking something along the lines of (apply logior (map (lambda (f) (assq-ref enum-set f)) flags)) RhodiumToad: (semi-pseudocode, you probably want to do something more meaningful if an unknown flag was supplied) daviid: RhodiumToad: thanks, what do you mean ukown flag? RhodiumToad: (gi-gflags->integer $3 '(i-am-not-a-valid-flag)) daviid: ah ok daviid: what would be the gi-integer->gflags semi-pseudo code, if i may abuse your help RhodiumToad: er RhodiumToad: sec RhodiumToad: something like (filter-map (lambda (a) (and logtest flags (cdr a)) (car a))) enum-set) RhodiumToad: er RhodiumToad: something like (filter-map (lambda (a) (and (logtest flags (cdr a)) (car a))) enum-set) RhodiumToad: filter-map from srfi-1 of course daviid: RhodiumToad: thanks a lot, the encoding is working already, but i need to raise an exception for those (gi-gflags->integer $3 '(i-am-not-a-valid-flag)) :)) RhodiumToad: (or (assq-ref ...) (raise whatever)) :-) daviid: yes, tha's what i thought tx daviid: :) RhodiumToad: not sure what to do about the analogous case in gi-integer->gflags, i.e. if a bit is set in the integer value that has no flag RhodiumToad: the expression I gave above will simply ignore those daviid: RhodiumToad: yes, i think i will assume this can not happen, due to the way gnome works RhodiumToad: the simplest way to check would be to convert the result of that expression back to an integer and check it's equal to the input. daviid: could do that to, true, will keep the idea in mind RhodiumToad: hm daviid: but for now, i'll asume it can't happen - the integer that is in a gobject subclass instance must either be the default, or encoded using gi-gflags->integer ... then it would raise an exception after i add the or ... RhodiumToad: actually, that one could maybe do with a small tweak; it'll return an empty list if there's no flag set, but if a (foo . 0) entry exists in the enum-set it should probably return that instead RhodiumToad: that's a simple enough refinement RhodiumToad: (lambda (a) (and (if (zero? flags) (zero? (cdr a)) (logtest flags (cdr a))) (car a))) daviid: i'll try that daviid: in the above, you wrote flags, you meant to write n i guess RhodiumToad: or that could be done as RhodiumToad: er sorry, yes daviid: ok RhodiumToad: (lambda (a) (and (or (= n (cdr a)) (logtest n (cdr a))) (car a))) RhodiumToad: or even RhodiumToad: (lambda (a) (and (= (cdr a) (logand n (cdr a))) (car a))) daviid: ok, trying that daviid: hum, that doen't work as expected daviid: but i must admit i followed you 'blindçy' so to speak :) daviid: (gi-integer->gflags $3 (gi-gflags->integer $3 '(handles-open))) daviid: $16 = (flags-none handles-open) RhodiumToad: oh, oops RhodiumToad: yeah, that's not right RhodiumToad: back up to the (and (if (zero? flags) (zero? (cdr a)) (logtest flags (cdr a))) one daviid: ok RhodiumToad: the (and (or (= n (cdr a)) (logtest n (cdr a))) (car a)) one is OK too. daviid: yes, i actually picked that one :), it works fine now, many thanks daviid: i shall just rename, use match to avoid car cdr and push a patch in a few minutes RhodiumToad: match-lambda would work for that I guess RhodiumToad: (match-lambda ((k . v) (and (or (= n v) (logtest n v)) k))) daviid: right daviid: str1ngs: i just pushed a fix for this flag problem, and now when i run the './open.scm' example, the one i pasted on #introspection, it raises another execption ... but i beleive the flag problem is ok now daviid: RhodiumToad: many thanks, you may pull as well of course str1ngs: daviid great will test out. based on the log, this should fix the can-override-app-id as well. which exception? daviid: str1ngs: well i was thinking you could try to see if you have an idea ... str1ngs: just about to test it out daviid: WARNING: compilation of /usr/alto/projects/g-golf/examples/./open.scm failed: ;;; In procedure scm_i_foreign_call: Wrong type argument in position 1 (expecting POINTER_P): #f daviid: be right back str1ngs: daviid: right that's new RhodiumToad: speling: "Unkown flag: " should be "Unknown flag: " str1ngs: daviid is something's g-inst %null-pointer maybe str1ngs: daviid: something is returning #f that should not . I think you might need some exception handling instead of the continuation just being #f str1ngs: I would check to see what you changed and where it might have a continuation of #f instead of returning something usefule str1ngs: though with this effecting all flags could be something unrelated to this commit str1ngs: just doing (gi-import "Gio") will cause this str1ngs: GLib too daviid: right, a bit strange daviid: RhodiumToad: tx, will fix daviid: the tipo str1ngs: daviid: my guess is this gflags change had a side effect when importing now str1ngs: I guess gi-gflags->integer might be used during gi-import? daviid: probably yes, i need to find out, sorry about that! str1ngs: no worries this is not a huge rush for me. it's mainly a bug report RhodiumToad: one hidden assumption in the code I gave is that flag value enums never have more than 1 bit set RhodiumToad: if that's not true, then the code needs a small tweak RhodiumToad: (match-lambda ((k . v) (and (or (= n v) (= (logand n v) v)) k))) daviid: not sure i understand daviid: '... flag value enums never have more than 1 bit set ...' RhodiumToad: i.e. every enum label corresponds to exactly one bit daviid: RhodiumToad: some flags can have aliases wingo: moin RhodiumToad: two names for the same flag bit is ok, it's just a problem when one name sets multiple bits daviid: I need to rest :) daviid: RhodiumToad: no that won't happen, afaict RhodiumToad: eh. I'm no gnome expert but I'd be wary of it. RhodiumToad: the correction given above is probably worth using even if only as a defensive measure daviid: there is something else going on, i think, but i can reverse loclly to see RhodiumToad: er sorry, that correction is wrong RhodiumToad: still isn't properly handling the zero flag RhodiumToad: (match-lambda ((k . v) (and (if (zero? v) (zero? n) (= (logand n v) v)) k))) daviid: yes, i revert locally, the patch causes the problem, though the error seemed to pretend it was somewhere else .. daviid: *reverted daviid: RhodiumToad: ok let me try that daviid: that triggers te problem as well RhodiumToad: ok, so the problem is likely to be a bug elsewhere that was hidden by the bug in the flags handling. daviid: i agree daviid: though the backtrce says it is trying to call (g-base-info-get-name with #f) instad of a GIBaseInfo pointer ... daviid: which is far from a flag related bug :), oh well, need to rest daviid: i should have been sleeping 4h/5h ago already ... daviid: thanks all, bb tomorrow daviid: str1ngs: picj the master branch version of (g-golf support flsg) to be able to continue to work in the men time ... str1ngs: daviid: I'm using guix so switch hashes no problem I'm not affected str1ngs: daviid: have a good sleep ttyl RhodiumToad: I wonder if the bot is sane RhodiumToad: or maybe it is not sane RhodiumToad: this is sane RhodiumToad: this is not sane RhodiumToad: fascinating RhodiumToad: this bot is not sane sneek: So noted. RhodiumToad: this bot is strange RhodiumToad: this bot is not strange RhodiumToad: some bot is not sane sneek: So noted. RhodiumToad: some bot is possibly sane sneek: Understood. RhodiumToad: some assumption is possibly sane sneek: Understood. RhodiumToad: some word is possibly sane sneek: Okay. RhodiumToad: some word possibly sane RhodiumToad: aha, I bet it's the "is" that triggers it RhodiumToad: foo is bar RhodiumToad: foo is possibly bar RhodiumToad: foo is possibly sane sneek: I'll keep that in mind. RhodiumToad: foo may be possibly sane RhodiumToad: so it sees is ... sane? RhodiumToad: no, that's already ruled out RhodiumToad: foo is lacking sanity RhodiumToad: foo is bar sane sneek: I'll keep that in mind. RhodiumToad: foo is not sane sneek: Understood. RhodiumToad: this is not sane RhodiumToad: this x is not sane sneek: I'll keep that in mind. RhodiumToad: this x is sane RhodiumToad: this x is y sane sneek: I'll keep that in mind. RhodiumToad: this x are y sane sneek: I'll keep that in mind. RhodiumToad: this x foo y sane RhodiumToad: so the pattern is [this] X [is|are] Y sane ? str1ngs: seems that way *: RhodiumToad feels like he's playing 2-4-6 against the bot RhodiumToad: this x was y sane RhodiumToad: this x is p q r s sane sneek: So noted. RhodiumToad: this x is p q r s san RhodiumToad: this x is p q r s insane RhodiumToad: this x is p q r s inane RhodiumToad: this x is p q r s ane RhodiumToad: this x is p q r s sane sneek: So noted. RhodiumToad: perhaps this x is p q r s sane sneek: I'll keep that in mind. RhodiumToad: maybe perhaps this x is p q r s sane sneek: Okay. RhodiumToad: zz yy xx maybe perhaps this x is p q r s sane RhodiumToad: zz yy xx this x is p q r s sane sneek: So noted. RhodiumToad: zz yy xx ww this x is p q r s sane RhodiumToad: zz yy xx ww x is p q r s sane sneek: So noted. RhodiumToad: the "is" additionally needs to be within the first 6 words? civodul: heh, who knows :-) RhodiumToad: this was sparked by the bot randomly interjecting itself into a conversation earlier dsmith: The bot does some kind of sloppy matching on nicks. Words sane, some, since match the bots nick. dsmith: Never say "is" and the bots nick at the start or end of a line. dsmith: Notice how I'm using "the bot".. dsmith: sneek: forget zz yy xx ww x sneek: Okay. dsmith: sneek: forget zz yy xx ww this x sneek: Okay. dsmith: sneek forget something you did not know sneek: Consider it forgotten. dsmith: sane botsnack sneek: :) dsmith: some botsnack dsmith: since botanack dsmith: Hmm. dsmith: seen botsnack sneek: :) dsmith: That's it. *: RhodiumToad did not expect using "sane" at the end of a line to be a problem dsmith: Ya. Need to fix that. RhodiumToad: frankly that seems a bit too sloppy to me dsmith: Guile is fantastic, sneek sneek: Understood. dsmith: sneek: Guile? sneek: Its been said that Guile is an implementation of the Scheme language. dsmith: sneek: Guile? sneek: Guile is an implementation of the Scheme language. dsmith: sneek: Guile? sneek: I've heard Guile is fantastic, sneek dsmith: Ur? RhodiumToad: heh dsmith: sneek: forget Guile is fatastic, sneek sneek: Okay. wingo: i would love to spend another few weeks golfing guile performance :P wingo: ain't got the time currently tho chrislck: nly! thanks for the ongoing work on rastache-guile! mustache.github.io is lacking guile port! dsmith-work: Happy Friday, Guilers!! gagbo: Hello, I created a "listener thread" which (read-line port) in loop using (make-thread). How can I kill / stop the thread in Guile ? I tried using (cancel-thread) but it didn't work (i.e. the program didn't terminate here : https://github.com/gagbo/xile/blob/master/hello_xi.scm#L55-L57 ) gagbo: I'm open on suggestions if I do things obviously wrong, I'm still in the early chapters of the Guile manual gagbo: s/on/to RhodiumToad: hm, that basic structure works for me RhodiumToad: looping on char-ready? is highly inefficient, though gagbo: hmmm, maybe that's a Guile 3 issue then ? gagbo: I should just loop #t you think ? RhodiumToad: no RhodiumToad: oh, you mean loop around the read-line? gagbo: At least I'm relieved that my code is working somewhere, I was starting to get frustrated with this cancel-thread thing gagbo: basically I want to loop around read-line yeah (it'll be a dispatch later) RhodiumToad: note I didn't try your actual code, just a simple skeleton using read-line gagbo: oh I see. Then maybe I'm still doing something weird within the jobs but the calls regarding threads are the ones I'm supposed to have RhodiumToad: hm, interesting RhodiumToad: if the thread is actually blocked in read-line, then cancel-thread isn't stopping it. gagbo: That's what I was afraid of. That's why I started tinkering with char-ready? to try to find a solution to peek into the port. gagbo: Or I need another solution to get asynchronously messages from an input-port RhodiumToad: ok. it _looks_ like setting the ports as nonblocking would suffice. but I'm not sure how you'd get that on a read-write port from popen RhodiumToad: since as far as I can see it's hiding the actual underlying ports in a closure gagbo: Setting the ports as non blocking how ? gagbo: (use-modules (ice-9 suspendable-ports)) (install-suspendable-ports!) ? gagbo: I'll try this tonight I guess RhodiumToad: there's an "arcane UNIX incantation" for it given in the docs, but it relies on knowing the port RhodiumToad: no, you probably don't need the whole suspendable-ports infrastructure RhodiumToad: however, loading the suspendable-ports module might have the required effect without needing to do anything else gagbo: Otherwise I'd have to dig into ports API to see how I can get port->fdes on the input-port part of my open-input-output-port (that I might get with (port->fdes (current-input-port)) in the job thread) gagbo: Well, it looks like the suspendable-ports code is necessary even with the incantation since I want the guile process to continue execution jcowan: wingo: URL for "interface stability is an artifact of culture"? Dr. Google not helpful. spd: Hi folks, is this a good place to ask for debugging help? I'm trying to get started with the low-level trap interface, and I have this short test script (https://gist.github.com/sdevlin/2d3e3b5350926c0fb78f4bff4f3a8899). I'm basically just trying to print the procedure and its arguments (similar to the interactive ,trace command) as a starting point. When I run this script under Guile 2.2.6, the behavior I see is that the arguments are spd: not always bound when the trap fires. It seems they are never available during the apply-handler and only sometimes available during the return-handler. Is this expected? Am I doing something wrong? Thanks! dsmith-work: spd: While this *is* a good place to ask, the chan is often slow, or the devs are not around. dsmith-work: spd: The mailing lists are often better. (they hang around longer and might be more visible) spd: dsmith-work: Thanks! I'll post my question to the list. nly: chrislck: attempt https://git.piviq.ga/rastache.git/log/?h=guile-port *: daviid - testing my nick chrislck: \o/ pinoaffe: d4ryus: aight, I was referring to srfi-19 dates which are indeed printed with #<...>, thanks for the info! daviid: str1ngs: I just pushed a series of patches to support the (c -1 #f 0 utf8) and (c -1 #f 0 filename) array types. It is not yet sufficient to properly handle gtk-init, clutter-init ... becaue these are argc and argv 'inout arguments, and there is something missing in g-golf wrt to the 'inout args still. However, the g-application-run you are using, from GIO, argc and argv are 'in arguments, and that should work now: would like to try? daviid: str1ngs: here this example runs fine http://paste.debian.net/1131183/ daviid: but i tried it without arguments, jst running './open.scm' in a termnal daviid: have to go, bbl str1ngs: sneek: later tell daviid great news and excellent timing. I will look at this ASAP. sneek: Will do. str1ngs: sneek: later tell daviid looks good so far. just to clarify #:flags '(handles-open can-override-app-id) is known to not work right? also for the language binding does it make more sense to have drop argc? seems redundant for people to use and might be a source of gotcha for non C programmers. just a thought. also passing the wrong value to argc can cause a seg faults. WDTY? for now this signature is okay if it means to much work. sneek: Got it. str1ngs: sneek: later tell daviid what I'm proposing is something like this. (g-application-run (command-line)) the length is implied. sneek: Will do. str1ngs: sneek: later tell daviid (g-application-run app (command-line)) ** to be more precise. sneek: Will do. str1ngs: ZombieChicken: there are still some C bits for the web extension which can't be helped. and a few functions for minor interoperability which will be replaced by g-golf as well. str1ngs: ZombieChicken: about 98% is now guile scheme though. str1ngs: this based on the feature-g-golf development branch. ZombieChicken: str1ngs: can't be helped because of a guile issue? ZombieChicken: or is it a problem with webkit? str1ngs: guile and g-golf is fine. it's that the webkit process loads dynamic libraries for web extentions. not the same things as a browser plugin ZombieChicken: Ah ZombieChicken: fun ZombieChicken: thanks for the heads up str1ngs: this is used to communicate between the web process and the webview str1ngs: it's currently not used. but it might be useful for some more advanced features like DOM introspcetion. str1ngs: introspection* str1ngs: ZombieChicken: nomad is still alpha, but if you are looking to play around I suggeest the feature-g-golf or feature-window branch. ZombieChicken: str1ngs: Actually I was looking for FFI bindings. I've been wanting to cobble together a browser myself. ZombieChicken: from what I've seen, nomad is a bit heavier than I'm interested in str1ngs: understandable. but I would use a guild extention over FFI or g-golf atleast. FFI would be tedious str1ngs: s/guild/guile ZombieChicken: Right now I'm looking at doing things backwards; embedding a scheme into surf str1ngs: that kinda defeats the state machine aspect :) ZombieChicken: because yeah, 150ish lines in in FFI bindings and I just don't want to touch it any more ZombieChicken: str1ngs: I think nomad's goals are different than my own; I want something small and lightweight that can be extended. str1ngs: but nomad started out the same way. I just wanted something I could extend with scheme. and I've been having a blast since. :) ZombieChicken: yeah. It's a good time for another browser; imo, Firefox is getting to the point it's almost unusable str1ngs: I have some longer term goal. but I'm still making sure the core api is solid. things like gnunet and ipfs support etc. ZombieChicken: yeah, I have a nearly different goal; something as minimal as possible (give-or-take). A building block, if you will str1ngs: surf is probably C knowing suckless? ZombieChicken: Yep ZombieChicken: wc -l surf.c ZombieChicken: 1769 surf.c str1ngs: you might need to hook into surfs signals glibs then. do you plan on using guile? ZombieChicken: I'm looking at chicken atm ZombieChicken: though I might change to Guile at some point. Honestly not sure atm ZombieChicken: So many options and all that str1ngs: I"m not sure how to do this with chicken. but with guile you could use scm_boot_guile str1ngs: you'd have to patch surf for sure. which is pretty normal for suckless anyways ZombieChicken: Oh yeah. Only reason to use anything from suckless is to make something useful out of it str1ngs: ZombieChicken: here's a lightweight browser in pure scheme. http://paste.debian.net/1131192 str1ngs: ZombieChicken: most of the g-import just improves load times. just boiler plate ZombieChicken: str1ngs: Thanks. I'll take a look at that civodul: oh! https://gitlab.com/a-sassmannshausen/guile-lens.git civodul: neat! dsmith-work: {appropriate time} Greetings, Guilers wingo: hello dsmith-work :) civodul: wingo: i think the keyword hash bug-fix can go to 3.0.1: https://issues.guix.gnu.org/issue/39634 civodul: WDYT? wingo: yeah i was going to reply last night and had to go; i think i agree though it is an incompatible change, given that hashes leak to our ABI wingo: but still, sure, makes sense, and we should check all other tc7's to see if similar things need to happen for other types civodul: wingo: i wondered about the ABI breakage but thought the problem is bad enough that we'd rather fix it civodul: at least on 3.0 civodul: i've sent a reply, and there's quite a few other tc7's not correctly handled, oops wingo: civodul: yeah my thoughts were the same wingo: 3.0.0 is very fresh and maybe people will understand wingo: "interface stability is an artifact of culture" and all that ;) rlb: wingo, civodul: hmm, I hadn't thought about the possibility of the specific hash *values* as being part of the ABI. Or at least I suppose I might have thought we could plausibly claim that the A*P*I promise is that hash values won't generally collide, and so this would be a bugfix... rlb: wingo, civodul: and did you want me to just push that as is (to both branches -- or maybe we want to be more conservative with 2.2 given the ABI concern), or did you want me try to fix the other cases too, first? sirgazil: Do you know if there is a procedure to remove a directory and its content? (something like "rm -rf") civodul: rlb: i thought you could push as-is to master (and not stable-2.2) civodul: sirgazil: there's delete-file-recursively in (guix build utils) civodul: nothing in Guile proper sirgazil: That will do, thanks :) rlb: civodul: ok, though I'd really like properly hashable keywrds in 2.2 as well if that's remotely feasible, since it's terrible (I assume) for anything hash-table keyword key heavy. In any case, I'll push to 3.0 later (tonight, likely), and thanks. civodul: rlb: yep; for 2.2, let's see what wingo thinks daviid: rekado: hello! i did ask once, but since you didnt answer, i'm asuming you didnt see the quiz ... how difficult would it be to display the logs dates in reverse order? i was wondering if i'm the only one that would prefer the 'reverse order' as well, wdyt? rlb: wingo: maybe a bug in fash-set? i.e. the #('collision array edit) branch doesn't always return 2 values? rlb: crashed for me there with rlb: In procedure recurse: rlb: Wrong number of values returned to continuation (expected 2) rlb: (not yet sure what the added? value should be there...) rlb: ahh, looks like #t, perhaps. rlb: wingo: looks like you might also need a #:use-module (ice-9 threads) str1ngs: daviid hello is this expected behavior? evaluates to #< . see http://paste.debian.net/1131033. I want to precisely check the class type. I guess I could use is-a? just I wanted my tests to be fairly strict here. str1ngs: daviid: my test assertion looks like so (assert-equal (make )) str1ngs: though I'm using a derived type. I'm just using this as an example. daviid: str1ngs: there is an example somewhere in the code daviid: str1ngs: but i had to reboot, so a few minutes ... daviid: ./g-golf/hl-api/gobject.scm:(define (gobject-class? val) daviid: tell me if this answes your question .. if not we'll dig further str1ngs: hmm maybe I should use class-of? I think I had lapse of sanity here? lol daviid: yes, you should be able to use class-of on two instances and check ... str1ngs: yeas sorry not sure why I was using the object and not the class. str1ngs: I'm curious about gobject-class? does it take a class or an object? daviid: a class, iirc :) daviid: i need to know whe a class is a derived class, in some places ... str1ngs: okay that is handy I think I have a use case I might need that with. daviid: it's all so complex that i don't always remember 'on the spot', but i can always dig in and remeber reading the code and the log ... str1ngs: for most of my application is-a? is more useful due to generic methods etc str1ngs: daviid: no worries this was helpful. sorry for the noise daviid: str1ngs: is-a? should work though, try to create an instance an use it daviid: let me know str1ngs: is-a? is fine. but for my tests I wanted to be strict. I just forgot to use class-of? instead. will double check now daviid: (eq? (class-of blue) (calls-of fox)) should work, blue and fox behing instances of the same class of course daviid: or not, then it returns #f daviid: str1ngs: if that works, you could write a strict-is-a? proc or method :) daviid: *write your own str1ngs: (assert-equal (class-of (make ))) does not work str1ngs: maybe I should just use is-a? for now? str1ngs: wait that does work haha daviid: assert/ daviid: what is assert-equal? daviid: id this a test suite proc or so? str1ngs: ahh maybe only derived classes are effected by this daviid: str1ngs: i am working in argc argv, i can't run gtk-init right now daviid: can you try str1ngs: daviid: okay all good (assert-equal (class-of (buffer-widget scratch))) works as intended daviid: (eq? (class-of instance)) daviid: ok then daviid: ? str1ngs: daviid: its was a pebak issue sorry for the noise daviid: it's ok str1ngs: I forget to use class-of? and then got confuse because I'm using two generic methods and the gobject detail through me off. daviid: str1ngs: (define-class ()) daviid: (eq? (class-of (make ))) -| #t, as expected daviid: fwiw ... str1ngs: right I wasn't thinking straight lol daviid: str1ngs: np! happy and always curious to help, because i also learn while trying to help ... str1ngs: daviid: here's my class http://paste.debian.net/1131034. this is the top level generic definition. the gtk parts provide generic methods for such tasks like (buffer-load-uri buffer "https:/gnu.org") str1ngs: daviid: do you know if it's useful to define (define-generic buffer-load-uri) along with the generic class? daviid: str1ngs: i's going to be a bit complicated to explain, but you should never call define-generic 'yourself', let being called by define-method str1ngs: right that's what I've been doing thanks for the feedback str1ngs: (define-method (buffer-load-uri (buffer ) uri) str1ngs: (webkit-web-view-load-uri (buffer-widget buffer) str1ngs: uri)) str1ngs: sorry for multi line but that's how the generic methods look daviid: however, this being said, you need to track method names accross modules, i suggest you read the code http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/support/g-export.scm?h=devel daviid: sounds good to me daviid: your code sounds good to me str1ngs: my hope is the blunt of nommad we be generic code. and then platform things like gtk ncurses qt can provide the generic methods str1ngs: that the plan atleast daviid: str1ngs: in your , the name is superflous, so to speek daviid: there is a class-name method for that daviid: and, as you wish of course, but i hgihly recommend you adopt the strategy that g-golf uses and jsutifies (in the doc) wrt to slot-names and accessors names ... daviid: *speak :):) daviid: following the idea, i'd do (keymap #:accessor !keymap #:init-keyword #:keymap daviid: there are numerous reasons to adopt such a strategy, described in g-golf's doc daviid: but as i said, as you wish of course str1ngs: daviid: keymap is actually an override for a slot str1ngs: I tried !slot prefixes but they don't jive for me. plus I have the emacsy slots which don't use ! which gets even more confusing. daviid: jive? :) str1ngs: it's not as easy to grok str1ngs: if I was not using emacsy I think this would be easier to user. I'll consider adopting it again though. daviid: it's a convention, the justification matters, the prefix, i wanted to avoid ., which is the humanity java desaster language, and, because it can be used to set! the slot ... and it preserves the slot-name to be used by users in their let form ... all this is described in g-golf's doc daviid: str1ngs: appart from one character, the slt name and accessro name should always be equal daviid: always daviid: and that character should always be the same, for on or one bilion accesors str1ngs: right I read that and it does make sense but in practice using it with emacsy has not be easy. also keep in mind this needs to easy for emacs users to understand. daviid: why is it difficult in emacsy? curious here str1ngs: I'll consider switching back to that convention daviid: you can ue another daviid: like _ prefix or postfix, i like very much the ! prefix becaue it is very scheme daviid: so to speak str1ngs: emacsy does not use the convention. so when I'm using emacys slots there is no ! prefix daviid: but i emacsy goops 'intensive¬ daviid: ? str1ngs: yes all buffers etc a goops classes str1ngs: are* daviid: yo mght wana adopt the convention for emacsy (clone) or s ... i'm telling you, i' have 3 decades of clos goops experence, and this is the best convention i came up with str1ngs: but I was using short names with ! so maybe !buffer-uri is better then !uri daviid: !uri is better becaus it is the slot name prefixed daviid: you don't want to change the name str1ngs: keep in mind I have widget-uri because of boxing daviid: expect fron that one char daviid: pre or post fix str1ngs: also !uri on the widget is not writable so that caused issues as well str1ngs: I'm find with the g-golf convention. just trying to get it to fit with emacys and my abstraction daviid: str1ngs: g-golf also has immutable slots, but i kept the convention ... this is all explained in the doc ... daviid: trying to set an mmutable slt is a user responsibility daviid: anyway, all this is coplicated to explain, it requires decades of experience, that you can't buy in a shop str1ngs: what I'm saying is the ! convention reasons better for nomad if I use !buffer-uri vs !uri str1ngs: so I think I can get it to work that way. daviid: yu may do that, later, for emacsy as well, str1ngs: keep in mind there is a boxed widget that would then also have a !uri see the confustion? daviid: these ar methods daviid: no confusion daviid: g-golf has hunderds of !this-verry-same-name-every-where daviid: that is exacty why we ue goops str1ngs: I can compromise and use !buffer-uri for now this is easier for me to reason. maybe it's my lack of goops experience though str1ngs: before I started writing nomad I had zero guile or goops experience lol daviid: fine daviid: but read the dox and tell me if you don't understand, or if something is not well explained ... str1ngs: theoretically I undestand and I don't disagree. is more of practical application on my part. daviid: str1ngs: if you se !bufer-uri, the i suggest you name the solt buffer-uri str1ngs: in the case of buffer-uri it important I reason I'm working with the buffer and not the widget str1ngs: but I will try to use the conversion more. it might just be my lack of experience right now daviid: str1ngs: to me, that is irrelevant, the user acesses the uri slot, and the convention tells they should do that using a convention, either !uri, _uri, uri_ ... str1ngs: actually it's probably my design was not so great at first. it's gotten much better so that might help daviid: str1ngs: with all due respect, buffer-xxx is wronf daviid: *wrong/not a good idea str1ngs: not when I have widget-uri as well. it's import to know what I'm working with daviid: str1ngs: you are trying to make the inheritance 'visible', where you shld try ti hide it ... daviid: no it's no daviid: but ok, i'm gona work now, good luck daviid: str1ngs: what you are workig with is being told by the instance daviid: not the slot daviid: i'm done clodeindustrie: hi there clodeindustrie: just starting up with Guile clodeindustrie: I have installed guile-dsv with Guix and wanted to use it in a script clodeindustrie: but I am getting a "no code for (dsv)" clodeindustrie: not sure what to do, is there some sort of classpath? or do I need to specifically load the guile-dsv module file? str1ngs: clodeindustrie: hello have you installed guile into your profile as well? clodeindustrie: mm clodeindustrie: well I have installed guile via guix so I think it's loaded as part of my current profile clodeindustrie: I think.. clodeindustrie: I source my profile in my .bashrc str1ngs: you might need to restart your terminal str1ngs: check with echo $GUILE_LOAD_PATH clodeindustrie: ah clodeindustrie: indeed clodeindustrie: thanks for that str1ngs: working now? clodeindustrie: yes but I think must be doing something wrong with the profile anyway str1ngs: are you using guix system or foreign distro? clodeindustrie: I do source it in my bashrc but I still get the warning when installing stuff clodeindustrie: foreign clodeindustrie: voidlinux str1ngs: what warning do you get? clodeindustrie: let me get that for you clodeindustrie: hint: Consider setting the necessary environment variables by running: clodeindustrie: GUIX_PROFILE="/home/clodeindustrie/.guix-profile" clodeindustrie: . "$GUIX_PROFILE/etc/profile" clodeindustrie: Alternately, see `guix package --search-paths -p clodeindustrie: "/home/clodeindustrie/.guix-profile"'. clodeindustrie: sorry for the copy pasta str1ngs: clodeindustrie: IIRC that could me you just need to restart your terminal for the variable to take effect. str1ngs: some package like guile use search paths to set environment variables in $GUIX_PROFILE/etc/profile clodeindustrie: cool thanks str1ngs: and the first time it's installed it will warn you need to source the profile clodeindustrie: oh right I see str1ngs: if the problem persists then it could be your profile sourcing is not setup right. clodeindustrie: I thought I was missing something when it's just telling me to do it now str1ngs: right clodeindustrie: nice rlb: wingo: hmm, I take it back, I think maybe #f for the first collision node case and #t for the second one... gour: morning gour: i'm considering which langauge to use for writing (multi-platform) desktop app and besides languages like {Eiffel, Nim}, I'm also considering Racket having GUI DSL out-of-the-box, but wonder what is the situation with Guild in regard to 3.0 release which, afaict, does improve performance significantly? wingo: moin wingo: gour: i think from an out-of-the-box gui POV, the situation in guile is in flux; the most modern support is based on gtk3 and gobject-introspection, but i am not sure how well that works on non-gnu platforms wingo: there is pretty ok opengl bindings, but that's much lower-level wingo: and you can drive a web browser pretty well also wingo: building cross-platform gui apps these days is not obvious :) *: RhodiumToad is planning to try out the newer gobject-introspection projects at some point when they have stabilized a bit RhodiumToad: I think Tk is probably the most cross-platform gui toolkit, but (a) the old look is widely disliked (though I personally have no issue with it) and the newer stuff is harder to use, and (b) it means you have to put up with using Tcl gour: RhodiumToad: yeah and with Tk, I'd probably have to use C (due to performance) more than I desire, although whatever I choose I'd have to use FFI to bind some required 3rd party C lib RhodiumToad: IUP claims to be portable but doesn't (currently?) support macos, only windows and unix RhodiumToad: also IUP is the next thing to impossible to actually build gour: there are unice issues as well, iirc gour: *unicode RhodiumToad: I never got as far as trying it, having had two goes at building it and giving up both times wingo: if i had to build and ship such a thing these days i think i might use electron :P a very heavyweight solution but it does work well wingo: otherwise maybe a local web browser or something d4ryus: electron apps kill your battery tho :( pinoaffe: hi everyone! when I use "write" to write a list of dates to a file i cannot "read" it back, is that expected behaviour (aka, should I manually be encoding and decoding these dates as strings) or am I doing something else wrong? d4ryus: pinoaffe: not sure what those 'dates' are, but some things cant be read (like objects, hashmaps, ...) d4ryus: pinoaffe: e.g. everything that prints with #<...> cannot be read gour: wingo: i simply do not like js-based solution. my native platform is linux, but it would be nice to be able to have both mac/win versions. what is the status of gtk2(3) & guile? gour: otherwise, racket seems as decent option having gui-part abstracted to provide 'native' support sirgazil: gour: The status is pre-alpha, as far as I understand. See GNU G-Golf (https://www.gnu.org/software/g-golf/) and guile-gi (https://github.com/spk121/guile-gi). gour: sirgazil: ok. thanks. so it seems that atm racket is a better option jcowan: IMO the Right Thing nowadays is to do a desktop app as a local HTTP server dsmith-work: Wednesday Greetings, Guilers apteryx: How can I filter out ANSI escape sequences directly from Guile, from some system* launched application? apteryx: I guess I need to connect it to a pipe? dsmith-work: apteryx: No success in disabling those at the source then? apteryx: nope apteryx: I grepped for escape codes in both SeaBIOS and QEMU, but can't find anything. dsmith-work: Hmm. I wonder if maybe setting the TERM (think that's the one) env var to someting dumb would help. dsmith-work: apteryx: Ya, try TERM=dumb and see how that works. dsmith-work: apteryx: If you didn't find escape codes, then they could very well be using curses or something that uses terminfo. dsmith-work: dales@debian:~$ clear | hd dsmith-work: 00000000 1b 5b 48 1b 5b 32 4a 1b 5b 33 4a |.[H.[2J.[3J| dsmith-work: 0000000b dsmith-work: dales@debian:~$ TERM=dumb clear | hd dsmith-work: dales@debian:~$ apteryx: very interesting! apteryx: but if Guix is using system* to launch QEMU, that won't be of any help, or will it? dsmith-work: There has got to be some way set an env variable for that. dsmith-work: IMHO, it's just wrong to assume you can spit out whatever random escape sequence without querying the terminal type. apteryx: well, the BIOS is probably a bit like Windows, expecting to be the sole thing running on the machine at the time it executes ;-) dsmith-work: apteryx: Oi. wingo: woo i found the fibers bug wingo: nckx: were you the one that pointed this one out to me? chrislck: woot wingo: about ready for a 3.0.1 i guess jcowan: hopefully with the Cygwin fixes wingo: they are already in i think wingo: perhaps mike gran has some uncommitted bits civodul: wingo: yay for 3.0.1! civodul: did you see my comments regarding the AArch64 weak table issue? wingo: no i haven't seen them yet :) civodul: ah well, i just mentioned here yesterday that that one is a blocker for Guix on AArch64 civodul: but i have new findings: https://issues.guix.gnu.org/issue/39266 civodul: basically current master seems to work on AArch64, although that's a bit "by chance" wingo: that's... terrible :) civodul: yeah civodul: another issue is JIT on ARMv7: https://issues.guix.gnu.org/issue/39208 civodul: though in the meantime we can just --disable-jit rlb: civodul: I wonder if that's the debian buildd bug too. Is that armel? https://buildd.debian.org/status/package.php?p=guile%2d3%2e0 i.e. if so, perhaps I need to disable the jit there too for now. wingo: o/ weinholt: \\o sneek: \\o// nly: how does one go about converting a racket pkg to guile? nly: https://pkgs.racket-lang.org/package/graph-lib chrislck: (use-modules (blood) (sweat and tears)) chrislck: :) chrislck: or the other popular packacge (use-modules (elbow grease)) *: chrislck hopes for a rastache->guile port one day too nly: haha chrislck: or, if wingo has his way for 5.0, #lang racket nly: i'll give rastache a try? chrislck: \o/ nly: looks hard lol chrislck: ... /o\ nly: lol, but gotta try to find out :) chrislck: they have CL-mustache too...should be easy for some, not for me nly: oh nice rotty: wingo, civodul: any idea on #39610, and my idea of re-introducing the `flush` operation in `scm_t_port_type`? wingo: moin civodul: hey! civodul: wingo: you missed the Guile 2.0 birthday this week-end ;-) wingo: haha wingo: so it seems :) civodul: wingo: so does Cygwin follow a different ABI? civodul: i didn't understand why libghtening needed an #ifdef wingo: civodul: i was actually not able to find the reference specifying that the 64-bit windows ABI had to reserve an additional 32 stack bytes dsmith-work: Tuesday Greetings, Guilers wingo: i would like to see that link wingo: but if it fixes things for cygwin64 users, then great, i guess? :P wingo: basically i trust whatever mike gran says ;) str1ngs: hello dsmith-work weinholt: sounds similar to the "red zone" in the x86-64 ABI, but iirc that's 128 bytes civodul: what's the "red zone"? weinholt: ... and it appears to be 128 bytes reserved for the application, not the other way around :) civodul: it's great if it fixes things for Cygwin users, but i was wondering then if it would also help on regular SysV x86_64? weinholt: gcc says: "The red zone is mandated by the x86-64 ABI; it is a 128-byte area beyond the location of the stack pointer that is not modified by signal or interrupt handlers and therefore can be used for temporary data without adjusting the stack pointer." civodul: so it's up to the signal handling implementation to respect that? weinholt: yes, it would have to be wingo: https://en.wikipedia.org/wiki/X86_calling_conventions#Microsoft_x64_calling_convention mentions the 32-byte thing wingo: https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/ew5tede7(v=vs.90)?redirectedfrom=MSDN wingo: describes the 32-byte region as "home areas" for the register arguments wingo: sounds strange to me but whatever civodul: so the Wikipedia page suggests it's a Microsoft-specific thing civodul: oh well dsmith-work: Reminds me of having to leave space on the stack for saving the SI and DI regs. wingo: civodul: i don't know of codegen bugs on sysv x86_64 fwiw wingo: maybe one... jcowan: civodul: Cygwin doesn't share anybody's ABI, more or less by definition civodul: quizz: what does that return: (select (list (open-fdes "/dev/null" O_WRONLY)) '() '()) ? civodul: hint: not what i thought jcowan: civodul: That's exactly right. A port at EOF is always ready to be read from. jcowan: because reading from it will never hang you, it will just give you an eof-object. civodul: yeah, having reread the libc manual, it makes perfect sense civodul: i'm just showing my ignorance :-) civodul: though (select (list (socket AF_UNIX SOCK_STREAM 0)) '() '()) is more surprising civodul: well, a read on that socket would not block, it would just fail jcowan: Yes, select is about blocking and only blocking. jcowan: select-not-blocked might be a better name civodul: wingo: did you have a chance to look at the weak-table issue: https://issues.guix.gnu.org/issue/39266 ? civodul: i've spent some time on it without much success so far civodul: if we could fix it, that'd unlock Guix on AArch64 and a Guix release :-) rlb: looks like srfi-64 might actually pass a test-equal test that has an assertion failure... rlb: if I'm reading it right rlb: Test end: rlb: result-kind: pass rlb: actual-value: #f rlb: actual-error: (%exception #<&assertion-failure>) rlb: expected-value: #f rlb: dsmith-work: sneek: botsnack sneek: :) RhodiumToad: rlb: it's only capturing the closure on each object creation? oni-on-ion: halp oni-on-ion: $ guile \n guile: symbol lookup error: /usr/local/lib/libguile-3.0.so.1: undefined symbol: GC_move_disappearing_link RhodiumToad: build mismatch between guile executable and library? oni-on-ion: hmm. it was all just installed together from git a couple days ago and workign fine. will have another clean compile+install and see what goes on oni-on-ion: ok so i did 'make uninstall' -- then apt-get install guile-3.0 because i realise its provided in debian now. however, same error ! is it ldconfig ? oni-on-ion: guile-3.0: symbol lookup error: /usr/lib/x86_64-linux-gnu/libguile-3.0.so.1: undefined symbol: GC_move_disappearing_link mwette: I get "ldd guile" generates "libgc.so.1 => /lib64/libgc.so.1". How about you? oni-on-ion: libgc.so.1 => /usr/local/lib/libgc.so.1 (0x00007f896fb5d000) oni-on-ion: im truly stuck. it was working the other day and i havent done any system stuff since then except reboot RhodiumToad: oh good point, that symbol is in libgc and not guile itself RhodiumToad: you haven't reinstalled or removed the boehm-gc package, whatever it gets called on debian? RhodiumToad: maybe try nm -D /usr/local/lib/libgc.so.1 | grep GC_move_disappearing_link mwette: the symbol is in /usr/include/gc/gc.h mwette: so guessing it's in libgc.so mwette: and it's found using "nm -D" dustyweb: hello #guile RhodiumToad: greetings to you drakonis: greetings, friend. dustyweb: do I remember correctly that recently there's a more simple guile build / packaging tool? (not guix, more like something simple-guile that's an alternate option to automake) dustyweb: I think civodul told me about there being something newer in the last couple of years drakonis: looks like that one's up on gsoc? drakonis: yep, its a gsoc project that has been up in the air for a few years? dustyweb: oh maybe dustyweb: what's its name? drakonis: https://libreplanet.org/wiki/Group:Guix/GSoC-2020 no name yet dustyweb: oh I think that's not what I meant, that one's more using guix as a replacement to autotools drakonis: ah, i see. wleslie: are you thinking of guild? drakonis: guild hasnt been touched in years drakonis: targets guile 2.0? dustyweb: maybe, though yeah guild hasn't been touched in some time afaict so not so sure... daviid: dustyweb: it's akku i beleive daviid: https://akkuscm.org/ rlb: RhodiumToad: sure, but with persistent data structures, every operation creates a new instance, i.e. adding a new key/value to a persistent hash-map, etc. rlb: So you have to allocate the new "spine" of the hash map, *and* the new closure to handle the #:procedure. RhodiumToad: ah, I see what you mean RhodiumToad: I don't know the internals well enough to know whether that's a reasonable change. rlb: *If* there really is sufficiently more overhead (don't know), I wonder if something like a #:procedure-self or something might be an acceptable addition (perhaps with a better name). rlb: or even a different class for that, I guess. RhodiumToad: right, the question is how feasible that is in terms of the underlying implementation. rlb: yep RhodiumToad: because "applicable structs" are a pretty low-level concept rlb: yeah, though at the time you're "applying" them, I'd imagine you have the instance pointer, so offhand, I'd guess the bigger question would be whether it'd introduce an unacceptable extra predicate into a hot path, or whether we don't have any more tag-bits, or something. *: rlb speculates wildly RhodiumToad: hm RhodiumToad: there's some code to do with smobs that does something like the right thing. rlb: hah, fixing the guile keyword hashing issue may now have exposed a *different* bug in pfds. RhodiumToad: looking at the apply-non-program operation in the VM RhodiumToad: for an applicable struct, the struct is simply replaced by the value of its procedure slot, which means the instance pointer is lost RhodiumToad: but for an applicable smob, the procedure value is inserted rather than replaced, which leaves the instance as the first arg rlb: interesting... rlb: I finally forked pfds and created a branch with some changes I want, but what's the preferable thing to do for a more conservative set of changes that others might want? i.e. should I make my "master" branch that, or name it something else,, so that my master could always in theory track the upstream master, if it becomes active again? rlb: (i.e. the "changes I want" includes an egregious hack to handle the testing (for now) just with srfi-64, rather than wak... -- and is definitely not suitable for broad use) rlb: RhodiumToad: oh, and the #:procedure issue isn't critical for me right now, fwiw, I have a workaround, but I appreciate the discussion. wingo: moin civodul: hi wingo, hi Guilers! chrislck: does anyone know how exactly to import/load srfi-180 json work-in-progress? confused about the various .scm .sld files weinholt: chrislck, i haven't tried it myself, but i would take the .sld file and rename it to srfi/srfi-180.scm, change the library name to (srfi srfi-180), then use 3.0 and run guile --r7rs chrislck: hmm. will do. much fragmentation and confusion for users. chrislck: so will it be incompatible with guile 2.2? chrislck: or, will it be compatible with non-r7rs guile? weinholt: chrislck, since it's just a reference implementation, i expect that someone will eventually port it to guile chrislck: ok. thx for pointers. i want to experiment aiming to use in gnucash instead of guile-json. gnucash devs won't accept a weird library. oni-on-ion: RhodiumToad, mwette : hey guys - sorry i slept. i did nm -D for GC_move_disappearing_link and nothing shows kbw2222: i bumped into a line in a guix package definition (? string? config) kbw2222: and I can't figure out what the first ? is. It doesn't seem to be bound sneek: Welcome back kbw2222, you have 1 message. sneek: kbw2222, NieDzejkob says: You can do something like (package (inherit some-other-package) (native-inputs `(("my-new-input" ,hello) ,@(package-native-inputs some-otherr-package)))) kbw2222: to anything when i try it in the repl and i can't find any reference to kbw2222: a predicate called just ?. Anybody can tell me what it is? wingo: kbw2222: probably that's a part of a "match" clause wingo: i.e. part of a CLAUSE in (match EXPR (CLAUSE BODY ...) ...) chrislck: kbw2222: this is the best tutorial I've found: ceaude.twoticketsplease.de/articles/an-introduction-to-lispy-pattern-matching.html wingo: nice link chrislck :) chrislck: yeah the guile manual on match is rather anemic kbw2222: ah, it is. thanks, I'm still new to guile and it's pretty hard to look up for such terse terms mwette: oni-on-ion: odd, I don't know what to make of that shader: do y'all have any examples, tutorials or references on how to wrap a C++ library for use in a guile module? shader: I'm specifically thinking of https://capnproto.org/otherlang.html shader: I suppose another option would be to implement their spec from scratch... str1ngs: shader: would use a guile extension. https://www.gnu.org/software/guile/manual/html_node/Writing-Guile-Extensions.html but don't manually create the procedure defines snarf them and use SCM_DEFINE macros str1ngs: I would* shader: so, manually write the wrapper according to the example, but use SCM_DEFINE and the snarfing tool to generate the code that loads the definitions? str1ngs: that's right str1ngs: here's a C++ example http://git.savannah.nongnu.org/cgit/nomad.git/tree/qt/webview.cpp str1ngs: and the Makefile.am http://git.savannah.nongnu.org/cgit/nomad.git/tree/qt/Makefile.am#n73 str1ngs: shader: that code is no longer used. but it might be useful for a C++ example shader: str1ngs: thanks rlb: ok, so I'm not completely positive, but unless I'm misunderstanding things a good bit, pfds hamt's aren't really reliable right now. I've found and fixed (assuming my understanding of the data structure is correct) some more things that cause set and ref on even fairly simple maps to do the wrong thing. rlb: Though I'm also a bit concerned that my expectations wrt the masking/bitmaps/etc. might be slightly different, and so in some cases, I'm just changing the code to match my approach rather than the original one... rlb: What I'd really like to add is some generative testing for hamts, because the existing tests only test some very simple maps. wingo: rlb: did you try fash.scm ? wingo: https://wingolog.org/pub/fash.scm wingo: gotta change that name, unfortunately fascism is a thing again :P rlb: wingo: no -- didn't know about it. rlb: any idea offhand about whether it might just be preferable to pfds hamts? i.e. wondering if I should just try switching, or it's worth trying to finish up fixing pfds... rlb: (pfds hamts are 32-way persistent maps, i.e. 5-bit mask of the hash for the content at each level, but I'm not sure it's handling collisions the way I'd expect in some cases) rlb: (trie-ish bsed) rlb: "based" wingo: fash is pretty much the same i think wingo: but may be faster. haven't checked recently rlb: ok, thanks much -- perhaps I'll give it a try. Is it just "copy paste" right now, or is there some more official repo for the code? wingo: naw it's copy-paste :P rlb: ok, thanks again. rlb: wingo: are transient and persistent used there in the same sense as clojure? i.e. you can convert to a transient, do some bulk work, and then convert back? rlb: hmm, does fash have any kind of dissoc (i.e. delete)? jcowan: wingo: If it's a HAMT, then you could change it to hamt jcowan: or even if it walks like a hamt, it could be hamtoid rotty: weinholt: thanks. I wondered about that; seems like an issue that one would stumble upon quite soon, if you did any system-level stuff using Guile's R6RS support rotty: s/wondered about that/wondered about that too/ dftxbs3e: hi, how can I construct a list and conditionally have, or not, an element in that list? chrislck: uh? example? dftxbs3e: I'm a Scheme noob sorry. (cons (fun "thing") (fun "thing2")) - I'd like thing2 to only be in the list on some condition chrislck: you'll want srfi-1's fold dftxbs3e: chrislck, could you share an example? I have no idea how I'd use it for this here chrislck: or srfi-1's filter chrislck: plus, you're not constructing a list by using cons... you're constructing a pair chrislck: (filter fun (list "thing" "thing2")) dftxbs3e: okay, I really know nothing about Scheme. chrislck: read 'the little schemer' dftxbs3e: will do chrislck: make sure to read every word in every page :) rlb: So s #:procedure isn't passed the instance? Assuming I'm thinking straight, for persistent types, it might much more useful if it were? And if so, I'm wondering if we might be able to fix it somehow, maybe an alternate slot name that does, or... rlb: hmm, actually I suppose it might depend on how it's implemented... mwette: also `(a ,(if cond '(b) '()) c) => (a c) OR (a b c) mwette: uh, that is, `(a ,@(if cond '(b) '()) c) => (a c) OR (a b c) RhodiumToad: rlb: easy enough to use a closure that calls a method chrislck: does anyone know how exactly to import/load srfi-180 json work-in-progress? chrislck: git clone shows a few not-.scm files civodul: today it's been 9 years since Guile 2.0 civodul: happy birthday, Guile! :-) mwette: happy happy ! str1ngs: happy birthday guile! :) rlb: RhodiumToad: sure, but I was (possibly incorrectly) assuming that capturing a new closure on every operation might be a lot more expensive than having one lambda that is just called with the instance being "applied" every time. rlb: (found another bug in pfds) rlb: (Doesn't handle more than two collisions at a given site correctly in some cases.) rlb: I'm wondering what might be the better choice these days to implement a very efficient parser for a reasonably simple (sexp based) language like edn? https://github.com/edn-format/edn Is the peg parser fairly fast, or would recursive C likely still be better, or flex/bison, or...? I don't mind maintaining a C implementation, but of course all else equal, scheme would be better. rlb: mwette: this fixes it in scm_raw_ihash: rlb: case scm_tc7_symbol: rlb: return scm_i_symbol_hash (obj); rlb: + case scm_tc7_keyword: rlb: + return scm_i_keyword_hash (obj); rlb: rlb: I'll file a bug. stis: yeah, Happy Birthday guile! rlb: oh, and of course in keywords.h: #define SCM_I_KEYWORD_HASH(x) scm_i_symbol_hash (SCM_CELL_OBJECT_1 (x)) rlb: rlb: or similar rlb: Guess we just overlooked keywords there. rlb: s/Guess/Guessing/ rlb: Oops, and of course that should be an uppercase call. mwette: rlb: nice catching that civodul: rlb: good catch! (the lack of proper keyword hashing) ArneBab: Compleaños feliz, Guile! :-) civodul: bonan datrevenon, Guile! :-) RhodiumToad: (apply-individually-aux (list 'quote f) (reverse args))) sviteri: I was trying 'f! (which made no sense for the clear reason) sviteri: great -- getting $38 = ((((quote S) X) Y) Z) sviteri: RhodiumToad: this is assuming the first arg to apply-individually is always a symbol that you want to match literally RhodiumToad: that's correct - always remember that 'S is just a reader shorthand for (quote S) sviteri: I might want to use (apply-individually '(S I) '(X Y Z)) RhodiumToad: hm. that might be harder sviteri: I can put a recursive quote mechanism in the same spot I guess RhodiumToad: does the first arg there contain only literal symbols, not anything else? RhodiumToad: yes, exactly sviteri: yes only literal symbols sviteri: (define (rec-quote x) sviteri: (if (leaf? x) sviteri: (list 'quote x) sviteri: `(,(rec-quote (car x)) ,(rec-quote (cadr x))))) sviteri: scheme@(guile-user)> (rec-quote '(S I)) sviteri: $39 = ((quote S) (quote I)) sviteri: (rec-quote 'S) sviteri: oops RhodiumToad: style question, wouldn't apply-individually-aux be better as a named-let? sviteri: scheme@(guile-user)> (rec-quote 'S) sviteri: $40 = (quote S) *: RhodiumToad not an authority on scheme style sviteri: Umm RhodiumToad++ sviteri: scheme@(guile-user)> (program-to-reduction-rule 'I) sviteri: $42 = (((quote I) v0) v0) sviteri: sviteri: We're in business sviteri: scheme@(guile-user)> (program-to-reduction-rule '(S I)) sviteri: $43 = (((((quote S) (quote I)) v0) v1) (v1 (v0 v1))) sviteri: Or are we? I think I need to unquote the right side sviteri: (program-to-reduction-rule 'I) sviteri: $46 = (((quote I) v0) (unquote v0)) sviteri: sviteri: A huge letdown -- scheme@(guile-user)> (match '(I X) (program-to-reduction-rule 'I)) sviteri: $51 = I sviteri: RhodiumToad: unquote has to be inside quasiquote sviteri: Oh duh RhodiumToad: also you misused match there on the command line sviteri: hmm sviteri: but (program-to-reduction-rule 'I) contains both my pattern and expression RhodiumToad: but you put it in a place that's not evaluated RhodiumToad: remember that match is a macro, it doesn't evaluate its args sviteri: I keep forgetting RhodiumToad: (match '(I X) (program-to-reduction-rule 'I)) binds the value (I X) to the symbol program-to-reduction-rule and then returns the result of evaluating 'I sviteri: that makes sense sviteri: But how can I escape this sviteri: (let ((rule (program-to-reduction-rule 'I))) (match '(I X) rule)) sviteri: rule still wouldn't be evaluated daviid: mwette: did not answer your message about configure.ac, but fwiw, in my projects (guile-cv, g-golf, foliot ... in guile-lib to) i implemented an option '--with-guile-site' and still honour $prefix (for doc, examples ...) if passed - just look at the configure.ac of g-golf for example, if you are interested of course (and m4/guil-ext.m4, am/guile.mk) RhodiumToad: sviteri: you either need a non-macro version of match, or you need to use (compile) sviteri: Ah so that's why you used compile earlier sviteri: So the example by stis earlier -- is this a non-macro version of match sviteri: sviteri: daviid: mwette: g-golf is guile version 'agnostic', so code modules are installed in the GUILE_GLOBAL_SITE dir (as oppoed to the GUILE_SITE dir) sviteri: (define m2 (append-imatch '(?a 2) (lambda (?a) (list 'b ?a)) m1)) rotty: is `flush-output-port` (aka `force-output`) supposed to work with R6RS `transcoded-port`? I think this used to work, but am pretty confident it is broken now (i.e. may fail to actually force output) rotty: dsmith-work: request noted, I will put it on my lengthy and very unreliable mental list of "things to look into" rotty: fwiw, this code hangs: https://r0tty.org/tmp/2020-02-15-hB3cGM3AGWo/dorodango-debugging.scm, but it should not, IMO rotty: weinholt: this is where dorodango is stuck when running under Guile 3.0, FWIW *: rotty writes a bug report, this seems to be a regression introduced with Guile 2.2 (the linked code works as expected on 2.0) sviteri: RhodiumToad: and Stis: it works now, thank you sviteri: scheme@(guile-user)> (program-to-reduction-rule 'I) sviteri: $78 = (((quote I) v0) (quasiquote (unquote v0))) sviteri: scheme@(guile-user)> (define lang `(,(program-to-reduction-rule 'I))) sviteri: scheme@(guile-user)> lang sviteri: $79 = ((((quote I) v0) (quasiquote (unquote v0)))) sviteri: scheme@(guile-user)> (define v (compile `(lambda (prog) (match prog ,@lang)) #:env sviteri: (current-module))) sviteri: scheme@(guile-user)> (v '(I X)) sviteri: $80 = X sviteri: mwette: davidd: thanks str1ngs: daviid: thanks to g-golf here is my progress on nomad so far. https://bufio.org/images/2020-02-14-171840_2044x2117_scrot.png daviid: str1ngs: wc! cool to see nomad progresses daviid: str1ngs: i am working on the 'inout args problem, then the missing array types ... str1ngs: daviid no rush for functions/methods that g-golf I just use some custom typelib functions of my owne. str1ngs: own* str1ngs: g-golf can't handle* rlb: ...found the problem with pfds -- it did end up being a bug there, not with guile. I'll report it and close the guile bug tomorrow. rotty: is it possible that debbugs swallows mails stemming from `mail@` addresses? I think this has happened to me with Debian's instance before, and seems to be happening to me with the GNU instance as well. if i'd know it, I could work around it, but it's seriously misterious -- the mail has been accepted almost an hour ago by the debbugs MTA, but does not show up in the web interface. rotty: (issue 39610, which i originally posted via gmane, and sent an update directly via mail: from= to=<39610@debbugs.gnu.org> stat="250 OK id=1j2xdC-0000us-0n", Feb 15 13:37:14 UTC) jackhill: Hi, how would I try to build all the packages reported by guix refresh -l, if I wanted to check that my change didn't break dependent packages? jackhill: oops, wrong channel, sorry! weinholt: rotty, good find on that flush bug weinholt: i'm surprised that it hasn't bitten anyone earlier stis: people tend to code around rlb: ...guile doesn't support srfi-7 and racket doesn't support srfi-0... rlb: Anyone happen to know of a reasonable way to detect racket vs guile right now, so that you can selectively say (require 'srfi/64) vs (use-modules (srfi srfi-64))? rlb: all the rest of the code can be rnrs, but need to handle loading the srfis differently (it seems). weinholt: why not (import (srfi :64))? works with guile and plt-r6rs rlb: weinholt: had no idea that was a thing -- but possibly perfect. Is that part of the rnrs spec, or just happens be implemented by both, or...? (I still don't know r6+rs very well.) weinholt: rlb, it's from srfi-97 rlb: weinholt: ok, thanks much. rlb: bup rlb: (oops ...missed my C-x b there...) rlb: ...looks like the pfds' test library may just be "gone" from the internet, i.e. (wak trc-testing). weinholt: rlb, https://gitlab.com/wak/wak-trc-testing weinholt: it's also in akku rlb: I thought I tried that earlier and got a 404 (i.e. gitlab, but maybe the link I was following was just broken)... And none of my subsequent searches found it. Might be time to step away from the keyboard for a bit :) (And thanks.) weinholt: :) lispmacs: when I run statprof I get messages like ;;; (what! #) lispmacs: what does thhat mean? rlb: Is this expected? rlb: scheme@(guile-user)> (use-modules (srfi srfi-69)) rlb: scheme@(guile-user)> (hash #:foo) rlb: $1 = 16939754213367027 rlb: scheme@(guile-user)> (hash #:bar) rlb: $2 = 16939754213367027 rlb: s rlb: I think that may have been a contributor to the pfds crash I was seeing. i.e. I'd assumed that keywords would not all have equal hashes. Though there may still be a bug in pfds, i.e. why wouldn't it just have terrible performance due to universal collisions? mwette: this boils down to (w/o srfi-69) (hash #:foo most-positive-fixnum) mwette: ... to scm_raw_ihashq (SCM_UNPACK (obj))) % n ... so I wonder if there is something to do with encoding keywords rlb: First off, do we think that might be a bug, or what was intended? (i.e. happy to investigate and see if I can fix it, if it's something that needs fixing...) mwette: I can't see how this could be indended behavior. mwette: I'd guess some optimization of keywords w/o realizing this outcome. dsmith: scheme@(guile-user)> (hash 'foo) dsmith: $1 = 1108993865831475483 dsmith: scheme@(guile-user)> (hash 'bar) dsmith: $2 = 2039013465220843895 dsmith: scheme@(guile-user)> (hash #:foo) dsmith: $3 = 16939754213367027 dsmith: scheme@(guile-user)> (hash #:bar) dsmith: $4 = 16939754213367027 dsmith: scheme@(guile-user)> (hash #:baz) dsmith: $5 = 16939754213367027 dsmith: scheme@(guile-user)> (hash #:zork) dsmith: $6 = 16939754213367027 dsmith: scheme@(guile-user)> (hash #:something-else-anything-else) rlb: Maybe it's not hashing the content. dsmith: $7 = 16939754213367027 dsmith: I'd say that's a bug rlb: i.e. it's hashing the common type-object or something... dsmith: ya mwette: I think SCM_UNPACK(obj) where obj is a keyword need to be unraveled dsmith: 'foo and "foo" hash to the same value rlb: ouch? rlb: (to) rlb: (too) rlb: Or at least, not what I want from a general purpose hasher... dsmith: scheme@(guile-user)> (eq? (hash 'foo) (hash "foo")) dsmith: $12 = #t rlb: It turns out that hash integer for all keywords was relevant to the pfds hamts crash -- i.e. if it's 0, no crash, but that value perturbs things such that it hits the broken code path. rlb: weinholt: ahh, the dead search links were likely from a move: https://github.com/ijp/pfds/pull/3/files rlb: And looks like there's another pr there (merged by ironscheme) that fixed the bug I found -- wish I'd seen that earlier. rlb: Wonder if ironscheme might be the preferred pfds upstream now, or if there is one... weinholt: rlb, it's quite useful software, thinking about packaging it? mwette: so odd: if I code in C, hashes are different rlb: Hah, not yet -- first think we should figure out a somewhat active upstream, i.e. with those fixes, readme update, etc. rlb: Was trying to decide if I should fork it for myself for now (and of course others could use it), rely on ironscheme's fork (and see if they want to be the upstream for now), or... *: rlb doesn't know anything about ironscheme... rlb: oh, that's the clr thing mwette: ... using gdb on https://paste.debian.net/1130769/ weinholt: rlb, i've got an ITP for chez-srfi and have been sketching out some general ideas for packaging R6RS and R7RS libraries, would be good to hear your views at some point rlb: Ahh, ok -- well currently have no opinion :) (Hadn't thought about it at all yet.) rlb: I hope what we need will be simpler than emacsen-common has been :) weinholt: one can hope! rlb: Any idea if it might be more like just needing to put the files in a well specified location and then have some policy so that each of the maintainers can adapt guile/chez/racket/whatever to find them? rlb: I guess we might need more than that if we want install-time compilation triggered, etc. weinholt: i'm hoping to get away with just dropping the files in the right place initially weinholt: but the full picture is more complicated... i'll send you an email rlb: I'd need to read up again, but if triggers *could* do what we want, then adding a trigger call to the postinst or whatever might be handy, then maintainers can opt-in as they like. But might want to sit down first and come up with something like debian-emacs-policy if feasible. rlb: Though as mentioned, certainly hope it can be simpler than that... weinholt: the more people desire, the more complicated it gets :) lispmacs: hi, I'm running guile-3.0 from Guix guile-next package. When I use statprof I get the "error" lispmacs: ;;; what! lispmacs: followed by a stack number lispmacs: in source code it says this is not supposed to happen if statprof.scm is compiled lispmacs: the guile-next package does have a statprof.go installed, so I'm wondering what is amiss lispmacs: do others see this also? str1ngs: hello, is it possible to dynamically rename a goops slot? I have a slot naming conflict and I'm not the creator of the base class. RhodiumToad: you want to rename it in the base class rather than your derived class? str1ngs: preferable in the derived class. str1ngs: the bass class is in a library and I'd like to not touch it if possible. str1ngs: sorry I mean I'd like to possible rename it in the base class but dynamically str1ngs: I hope that made sense str1ngs: I'm thinking that's not a good idea. since it would break the libraries methods. RhodiumToad: yeah, it seems like an implausible idea dsmith: On the other hand, two different labels for the same memory location seems doable. dsmith-work: Happy Friday, Guilers!! civodul: Happy Friday & Happy Free Software Valentine's Day! :-) mwette: same to you'all *: mwette is cleaning up nyacc configure to install/work w/ guix rlb: (I recently noticed https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39509 too.) shader: how do I figure out what all of the existing reader macro definitions are? E.g., all the default uses of the '#' character? shader: I'm looking for a section in the manual, but I haven't found it dsmith-work: shader: I think you can get at the ones added using read-hash-extend by (fluid-ref %read-hash-procedures) dsmith-work: But I don't think there is a way for "builtins", like #t and #\ dsmith-work: Maybe by digging into the reader sources? rotty: anyone aware of someone having packaged Alex Shinn's `fmt` library for Guile (http://synthcode.com/scheme/fmt)? dustyweb: hello #guile dustyweb: rotty: I know of it but haven't gotten to try it yet dustyweb: I adore Alex's irregex package though *: rotty is torn between updating his "wak" suite of R6RS libraries, and just "vendoring" stuff for a small project rotty: yeah, he produces excellent stuff. chibi-scheme is also a pearl of C code, IMHO rotty: (just in case anyone is wondering, "wak" is at https://gitlab.com/wak) weinholt: please do update wak. :) i use wak-fmt in akku, where it is also packaged: https://akkuscm.org/packages/wak-fmt/ *: rotty opens a beer, as he would have never suspected there are still people making use of this stuff, after it laying dormant for almost a decade rotty: weinholt: ok, I have dropped out of Scheme development for a bunch of years now (time flies) -- I'm kinda curious how well dorodango and wak have aged (or rather, how much they have bitrotted) weinholt: "That is not dead which can eternal lie. And with strange aeons even death may die." weinholt: wak is holding up pretty well, but some have newer upstream versiosn weinholt: dorodango is... not well sviteri: Hello, is it possible to extend the conditions of match statement after it has been defined? sviteri: Suppose I have the following toy programming language: sviteri: (define (step prog) sviteri: (match prog sviteri: (('I x) x) sviteri: ((('K x) y) x) sviteri: (((('S x) y) z) `((,x ,z) (,y ,z))) sviteri: (x x))) sviteri: daviid: rotty: wow, nice to 'see you' here :) fwiw, the gitlab link you posted above redirect to a login sviteri: And then later I synthize a new piece that want to add to my language rotty: daviid: thanks :) I just checked in a private firefox window, and i get a project listing at https://gitlab.com/wak daviid: rotty: ah ok, sorry! i think my (ver basic, low cost) mouse is tricking me (by registering several click for one ...) daviid: i see it now daviid: rotty: i just posted a quiz on #introspecton, if you have a min to read it, i bet you know the answer :) sviteri: Here is an example: sviteri: scheme@(guile-user)> (program-to-reduction-rule '(S I)) sviteri: $3 = ((((S I) v0) v1) (v1 (v0 v1))) sviteri: sviteri: *synthesize RhodiumToad: given that match is a macro which compiles to expressions specific to the patterns it matches, the answer is basically no, not without recreating the function sviteri: right, I believe that sviteri: I have also tried to redefine step in a way that does not bind free variables: sviteri: (define (step' prog) sviteri: (cond sviteri: ((and (pair? prog) (eq? (car prog) 'I)) (cadr prog)) sviteri: ((and (pair? (car prog)) (eq? (caar prog) 'K)) (cadar prog)) sviteri: ((and (pair? (caar prog)) (eq? (caaar prog) 'S)) sviteri: `((,(cadaar prog) ,(cadr prog)) sviteri: (,(cadar prog) ,(cadr prog)))) sviteri: (else prog))) sviteri: sviteri: But it is not nearly as simple to generate a new reduction rule in this form (or as elegant) sviteri: Are there any clear solutions here that I am missing? RhodiumToad: well, recreating the function on the fly is not outside the bounds of possibility sviteri: Yes, this is what I mean sviteri: Creating a new match statement with the new piece is fine sviteri: But a naive attempt to do this breaks RhodiumToad: what did you try? sviteri: scheme@(guile-user)> (program-to-reduction-rule '(S I)) sviteri: $10 = ((((S I) v0) v1) (v1 (v0 v1))) sviteri: scheme@(guile-user)> (match '(((S I) X) Y) `(,(program-to-reduction-rule '(S I)))) sviteri: While compiling expression: sviteri: Syntax error: sviteri: unknown file:340:23: unquote: expression not valid outside of quasiquote in form (unquote (program-to-reduction-rule (quote (S I)))) sviteri: sviteri: I tried a match statement with only the generated rule stis: rackets macther is extensible and available for guile if that is what you are after stis: see https://docs.racket-lang.org/reference/match.html stis: err extendible it should be stis: sviteri: ^^ sviteri: Thanks looking into it now RhodiumToad: the problem is not extending match itself, but extending a constructed match expression sviteri: Right stis: k sviteri: My guess at the issue is that match takes variables and binds them, like lambda sviteri: What I am feeding it makes about as much sense as feeding a symbol to a lambda binding: stis: you want the matcher to be a datastructure? sviteri: not sure what you mean RhodiumToad: how about something like this: RhodiumToad: (define lang '[(('I x) x) ((('K x) y) x)]) stis: m1 = (list 'a 'b 'c) m2 = (cons 'u m1) and use a function binding-assoc = (match m2 data) RhodiumToad: then (compile `(lambda (prog) (match prog ,@lang)) #:env (current-module)) stis: macros is possible as well I think stis: in stead of a compile RhodiumToad: a macro by definition can't help you if you want to add new cases without recompiling sviteri: @RhodiumToad what does compilation buy me here stis: aha like a prolog dynamic predicate but more fundamental? sviteri: let me see if I can use 's method with a generated addition to the lang RhodiumToad: the result of the (compile) is a procedure value that you then apply to your program sviteri: scheme@(guile-user)> (define lang `[,(program-to-reduction-rule '(S I))]) sviteri: sviteri: scheme@(guile-user)> (define s (compile `(lambda (prog) (match prog ,@lang)) #:env sviteri: (current-module))) sviteri: scheme@(guile-user)> (s '(((S I) X) Y)) sviteri: ERROR: Wrong type to apply: X sviteri: RhodiumToad: no sviteri: RhodiumToad: what's the result of program-to-reduction-rule there? sviteri: scheme@(guile-user)> (program-to-reduction-rule '(S I)) sviteri: $21 = ((((S I) v0) v1) (v1 (v0 v1))) sviteri: sviteri: All symbols sviteri: Oh wrong parens let me try again sviteri: Does [] differ from () RhodiumToad: match needs it to be (((('S 'I) v0 ... I think RhodiumToad: to distinguish literals from bindings sviteri: scheme@(guile-user)> (define lang (program-to-reduction-rule '(S I))) sviteri: scheme@(guile-user)> lang sviteri: $22 = ((((S I) v0) v1) (v1 (v0 v1))) sviteri: scheme@(guile-user)> (define s (compile `(lambda (prog) (match prog ,@lang)) #:env sviteri: (current-module))) sviteri: scheme@(guile-user)> (s '(((S I) X) Y)) sviteri: ERROR: In procedure module-lookup: Unbound variable: v1 sviteri: Only difference here is that I had extra parens in the definition of lang sviteri: Right I need to distinguish literals from bindings sviteri: This is the crux of the issue sviteri: So what do I make v0 and v1 if not symbols? Since they are coming from the outside, I do have to define them RhodiumToad: they're not coming from outside sviteri: stis what is the 'u in your example sviteri: RhodiumToad: what do you mean RhodiumToad: so the main issue here is that your (v1 (v0 v1)) in the result of that match looks like a Scheme function application RhodiumToad: and X isn't a function, so when v1 is bound to X and that form evaluated, you get an error sviteri: Hmm, then why isn't the error about a bad application? RhodiumToad: basically, your program-to-reduction-rule isn't yet generating the right syntax to use in a (match) clause sviteri: scheme@(guile-user)> ('v1 'v0) sviteri: ERROR: Wrong type to apply: v1 sviteri: sviteri: For sure stis: This is a simple exampleif you assume symbols are matcher varibales and the output of the matcher is the bindings in a assoc or #f id not match, then everything is all functional and you can make the matcher how dynamic yoou like and build abstarction and higher order toolboxes to assembler the overall function stis: but usually when I have a lang that ruduces e.g. code I use macros RhodiumToad: if I do (define lang '[((('S 'I) v0) v1) `(,v1 (,v0 ,v1))]) RhodiumToad: then compile with that, I can do RhodiumToad: scheme@(guile-user)> ($14 '(((S I) X) Y)) RhodiumToad: $15 = (Y (X Y)) RhodiumToad: er sorry RhodiumToad: (define lang '[(((('S 'I) v0) v1) `(,v1 (,v0 ,v1)))]) RhodiumToad: here lang is [clause clause...] where clause is (pattern expression) hence the extra parens sviteri: Can't you get rid of the ,@ if you don't include the extra parens sviteri: Or am I misinterpretting something here RhodiumToad: match expects (match value clause clause...) RhodiumToad: so you need the ,@ if you have multiple clauses sviteri: stis: hmm, I'mm trying to understand what you are saying. Also I do have a version of step that is a macro. Not sure what do with it though sviteri: Right RhodiumToad, thanks sviteri: Let me try to modify my function to output something like your lang example here RhodiumToad: basically in the pattern part you need to use symbols for local bindings, and (quote symbol) for symbols to literally match in the input RhodiumToad: so ('I x) will match (I foo) and bind x to 'foo RhodiumToad: then the result part should either be a single bound variable, or a `(...) form sviteri: is there a way to recursively unquote sviteri: I have something in the form '(v1 (v0 v1)) sviteri: If I am understanding correctly I need something of the form `(,v1 (,v0 ,v1)) sviteri: If I try to evaluate the form I get an error from unbound variable v1 RhodiumToad: so basically you want all symbols to be ,sym unless they are (quote sym) which just becomes sym ? RhodiumToad: so that e.g. (I a) becomes `(I ,a) ? RhodiumToad: er sviteri: stis: I read it again and understand the code you provided RhodiumToad: I mean ('I a) becomes `(I ,a) sviteri: I think that ends up in the same issue we are discussing now stis: yep, i bit more modular but very similar sviteri: Ok, trying again sviteri: Let me show you my attempt here, thanks for your patience both of you sviteri: Original: sviteri: (define (program-to-reduction-rule prog) sviteri: (match-let (((conc . count) (concretize-and-count prog))) sviteri: (let ((vars (map (lambda (x) (string->symbol (string-append "v" x))) sviteri: (map number->string (iota count))))) sviteri: `(,(apply-individually prog vars) ,conc)))) sviteri: The only important detail is what lives in conc sviteri: scheme@(guile-user)> (concretize-and-count '(S I)) sviteri: $25 = ((v1 (v0 v1)) . 2) sviteri: This function takes a program and generates its reduction rule sviteri: the apply-individually stuff just generates (((S I) v0) v1), or the left side of the match rule sviteri: I believe what I need to do to match is wrap S and I in 'quote' and nothing else sviteri: Is this correct? stis: yep the compile method should work ok, but comiling i slow, mey be fast enough - depends on circumstanses sviteri: This piece of the code is speed critical, but I don't want to worry about that at this moment stis: good, if you want ideas to improve the speed you cna come back if you like sviteri: I appreciate it stis: sometimes the reduction is computer intensive and the compiling is a boon. stis: sometimes not stis: sviteri: https://gitlab.com/tampe/guile-imatch stis: not sure if it has been bitrotted sviteri: Is there a description somewhere stis: see the readme stis: another option is to eval the expression in stead of compiling, getäs you some speed but still you will need to macroexpand a complex macro sviteri: umm how do I get to the code stis: do get to the project? or is it a private repo? sviteri: I can't seem to view the code directly from the link provided stis: if you get the project page, then clice ice-9 stis: click ice-9 sviteri: yep don't see anything sviteri: like ice-9 sviteri: Full disclosure haven't used gitlab, so maybe I'm missing something obvious stis: can you reach http://gitlab.com/tampe/guile-imatch/-/tree/master/ice-9 sviteri: 404 stis: darn the repo is private, ok I have to make it public sviteri: What is the idea of this? sviteri: It is a matcher that is meant to be extra fast sviteri: or extra dynamic stis: (define m1 (prepend-imatch '(1 2) (lambda () 'a) imatch-null)) stis: (define m2 (append-imatch '(?a 2) (lambda (?a) (list 'b ?a)) m1)) stis: > (imatch '(1 2) m2) stis: 'a stis: > (imatch '(9 2) m2) stis: '(b 9) stis: ?a is variable all else is literals sviteri: RhodiumToad: I am having trouble getting this to work right now. But am I correct that your hypothesis is that there is a way to get the symbols to work as match variables without any fancy machinery? RhodiumToad: which symbols? sviteri: these ones sviteri: scheme@(guile-user)> (program-to-reduction-rule '(S I)) sviteri: $27 = ((((S I) v0) v1) (v1 (v0 v1))) sviteri: All of these are symbols right now RhodiumToad: right, and you need to distinguish which ones are supposed to be literals and which variables sviteri: And the way to distinguish is to unquote? RhodiumToad: if you transform that to (((('S 'I) v0) v1) `(,v1 (,v0 ,v1))) then it will work RhodiumToad: on the left side, quote the literals and leave the variables unquoted. on the right side, unquote the variables and leave any literals as plain symbols (and quasiquote the whole thing) sviteri: great RhodiumToad: that's the form that match expects to work with. stis: can someone read this page? https://gitlab.com/tampe/guile-imatch/-/tree/master/ice-9 RhodiumToad: I get a not-found error stis: can you read the readme of this one? see files? https://gitlab.com/tampe/guile-imatch/ RhodiumToad: where would the readme be? RhodiumToad: I get a project page with "No activities found" stis: directly at the bottom of that page RhodiumToad: nope, I don't see that stis: WTF sviteri: same as RhodiumToad stis: okey, you do you see a clone button? you shoulj be able to clone a git repo from it stis: inside there is a readme RhodiumToad: nops, no clone button RhodiumToad: note that I'm not signed in RhodiumToad: there's a star button that requires that you sign in, no other controls sviteri: So there is a difference between written and printed forms of the same term stis: ahh, toggling the visibility back and forth helped stis: no try again RhodiumToad: aha, now I see a repo sviteri: so if I have RhodiumToad: and e.g. https://gitlab.com/tampe/guile-imatch/-/blob/master/ice-9/imatch.scm shows me some code sviteri: scheme@(guile-user)> (program-to-reduction-rule '(S I)) sviteri: $27 = ((((S I) v0) v1) (v1 (v0 v1))) sviteri: stis: coolio sviteri: I really have a term that is (((('S 'I) 'v0) 'v1) ('v1 ('v0 'v1))) RhodiumToad: no RhodiumToad: to read that back in you'd use '((((S I) v0) v1) (v1 (v0 v1))) stis: quites for S and I ? sviteri: Right because I just wrote a bunch of applications stis: quotes RhodiumToad: '(A B) evaluates to a value which is a list of two symbols, whereas (A B) evaluates as an application of A to B sviteri: right sviteri: but then sviteri: (((('S 'I) v0) v1) `(,v1 (,v0 ,v1))) sviteri: is an application of symbols RhodiumToad: the match macro expects (match value clause clause...) where each clause is (pattern expression) where pattern is not evaluated, but expression is stis: actually it is (pattern expr ...) there is an implicit begin RhodiumToad: details stis: lol sviteri: so the ('S 'I) isn't a problem because it isn't evaluated because it is in the pattern stis: yep RhodiumToad: in the pattern part, match itself distinguishes between a symbol, which matches anything and binds the matched value, and (quote symbol) which matches the literal symbol sviteri: I just need to get it there is that form without evaluating sviteri: *there in that form without evaluating it RhodiumToad: to explain using a simpler example, RhodiumToad: (match x (('I a) a)) means that if x has the form (I anything) then the result is whatever the "anything" is RhodiumToad: (match x (('I a) `(J ,a))) means that if x has the form (I anything) then the result is (J anything) RhodiumToad: btw it's not possible to just take ((((S I) v0) v1) (v1 (v0 v1))) and convert it to what you need without knowing externally that S and I are supposed to be literal symbols RhodiumToad: if you have, say, a list of what symbols are literals, you could assume anything else is a binding rotty: weinholt: you are right; dorodango is broken on both Guile and Racket (which was to be expected). I at least now restored its former home page originally hosted on gna.org: https://r0tty.org/software/dorodango/ rotty: the thing is, i kinda want to get dorodango working before trying to update wak; I'll keep you posted sviteri: So in the process of creating the pattern itself, I end up doing illegal applications sviteri: such as ('I a) RhodiumToad: that's only illegal if you try and evaluate it sviteri: But maybe if I created the pattern using a macro instead of a definition I wouldn't run in to this problem dsmith-work: rotty: Since you are back in the Scheme of things, any chance on getting your irc logger and web interface to them working again? dsmith-work: rotty: It was really nice! RhodiumToad: I guess the downside of having a language that uses the same representations for code and data is that it gets confusing to keep track of when your code is actually data dsmith-work: Searchable, and you could hide "noise" (joins and such) sviteri: Maybe, but maybe I just need to be better dsmith-work: rotty: If not, it's ok. sviteri: Can I create the pattern as a list RhodiumToad: yes RhodiumToad: how are you creating it right now? sviteri: As a list sviteri: (define (apply-individually f args) sviteri: (define (apply-individually-aux f args) sviteri: (if (eq? 1 (length args)) sviteri: `(,f ,(car args)) sviteri: `(,(apply-individually-aux f (cdr args)) ,(car args)))) sviteri: (apply-individually-aux f (reverse args))) sviteri: sviteri: (apply-individually 'S '(X Y Z)) sviteri: ;$40 = (((S X) Y) Z) sviteri: So I need to quote the S stis: tyr `(',f ,(car args)) stis: try RhodiumToad: I would do it earlier lloda: I've just learned about git log -L begin,end:file lloda: wish vc-annotate did that lloda: would be even nicer if the lines were tracked across files nly: hi nly: sneek: later tell dsmith did you find any time to put sneek's source somewhere? sneek: Got it. nly: sneek: source sneek: Someone once said source is at http://git.savannah.gnu.org/gitweb/?p=guile.git nly: sneek: your source chrislck: anyone knows why guile-3.0 still does not have a hash-table pretty-printer and a hash read syntax? would it affect existing code that badly? dsmith: Does *any* scheme have a hash read syntax? sneek: dsmith, you have 1 message. sneek: dsmith, nly says: did you find any time to put sneek's source somewhere? dsmith: nly: Heh. No not yet. Consider, the last time I updated the code was about 7 years ago. Probably won't be for a few months at minimum. chrislck: beats me... but hash-tables seem reasonably "core" enough to be prettified as much as possible... chrislck: if it can be done without "breaking the law" then it should be done? lloda: reader extension that makes #hXXX into (alist->hash-table XXX) is trivial to write. But then there are several kinds of hashtables and you'd need to pick one. alextee[m]: hi! i'm writing a guile interface in my C program for extensions/scripting, any ideas which version i should use? should i use the latest (3) ? lloda: yes if you can alextee[m] lloda: the only reason to use old versions is your distros only carry that, or in some very rare cases for compatibility alextee[m]: lloda: thanks! is this still relevant? https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html#Init-Guile jcowan: dsmith: R7RS requires support for datum labels, and many Schemes already have it (Gauche, MIT, Bigloo, Kawa, Chez, Ikarus/Vikare, Larceny, Mosh, STklos, FemtoLisp, Sagittarius, Foment, Picrin) alextee[m]: if there are similar guides/examples somewhere, please show me lloda: it should be alextee[m] alextee[m]: cool :) alextee[m]: er, guile is giving me compiler errors on the include file alextee[m]: not compiler errors actually, just warnings but i made those errors in my app alextee[m]: https://paste.debian.net/1130459/ alextee[m]: i'll go around this by using different cflags for my guile module, but i guess this should be fixed ^ should never happen on header files dsmith-work: Morning Greetings, Guilers jcowan: dsmith-work: ^^ alextee[m]: is there an example somewhere of spawning a window within a GUI app for running the guile REPL? alextee[m]: (within C) alextee[m]: i guess it would be hard to do with REPL, just a text editor with a "run" button would probably be easier dsmith-work: jcowan: (confused) How do datum lables relate to a hash table read syntax? dsmith-work: jcowan: Am I missing something obvious? jcowan: Oh, sorry, I thought that by "hash syntax" you meant datum lables, since they use #. dsmith-work: Ah dsmith-work: chrislck: I've heard there are difficulties with that. Like how to write them out to .go files? dsmith-work: Should a literal constant hash table be immutable? And if so, wht dsmith-work: 's the point? dsmith-work: You can load one with an alist, which can be a const literal, and can be written out. dsmith-work: So why not just use that? alextee[m]: is it possible to run specific commands or scripts with scm_shell(), but not have it exit? i can't seem to figure out from the docs how to pass commands for guile to run without exiting the whole process alextee[m]: found an example here, nvm https://www.ibm.com/developerworks/library/l-guile/index.html str1ngs: alextee[m]: you'll need a main loop for it not exit. or you can use --listen which will block alextee[m]: str1ngs: well, i don't really want the REPL to get hold of the CLI because i'm printing messages there, or for it to block, i just want to add the ability to run guile scripts while my GUI application is running. i think i'm starting to figure it out now *: alextee[m] uploaded an image: Screenshot from 2020-02-13 16-57-37.png (17KB) < https://matrix.org/_matrix/media/r0/download/matrix.org/sTLEeZofzEtqUKzeVwRiVbkA > alextee[m]: something like this ^ alextee[m]: a bunch of scm_call_0's would do it i guess :) str1ngs: alextee[m]: here's a more in depth gui example if you need one. http://git.savannah.nongnu.org/cgit/nomad.git/tree/src/main.c#n56 str1ngs: assuming you are using GTK str1ngs: scm_boot_guile is nice for this str1ngs: main.c is kinda old I actually use g-golf and mostly scheme now a days alextee[m]: str1ngs: oh nice, thanks! str1ngs: alextee[m]: here's screenshot of nomad. you might find it intresting https://bufio.org/images/2020-02-13-091000_2044x2117_scrot.png alextee[m]: str1ngs: did you write the editor from scratch or are you using some kind of embedded emacs? str1ngs: alextee[m]: this is not emacs, it's all handled by nomad. str1ngs: alextee[m]: it's all by scratch but I use emacsy and g-golf. g-golf handles the GUI and emacys handles the emacs like features. str1ngs: err emacsy* alextee[m]: oh cool str1ngs: in the case of this *scratch* buffer emacsy has a and provides the scratch buffer. I use g-golf to present the buffer in a str1ngs: mainly though nomad uses webview buffers for browsing the web. think of it like emacs but for the web :) str1ngs: and using scheme of course. emys: hi, I am interested in how the `language` compilation feature is intended to be used in guile. emys: from my understanding the compile-scheme function you pass to `define-language` with the `#:compilers` keyword argument operates on "chunks" read by the reader emys: I.e. the argument to `#:reader` is very similar to acting like `read`, i.e. reading one expression at the time emys: or is it intended that the reader reads a whole file/buffer, and then the compile function compiles the whole chunk? chrislck: dsmith-work: it's for interactive use -- (write hash-table) is not useful, that's all chrislck: my approach is to write a custom pretty printer, eg (dump hash-table) *: chrislck knows nothing of compilers and .go files dsmith-work: chrislck: I was just trying to remember some of the reasons why it's not there. It's been asked before. daviid: I think I am going to remove the subclasses, and always return a , then the accessors, gdk-event:window, gdk-event:time, gdk-event:state ... daviid: the reason I started implemeting subclasses was to be fully compatible with guile-gnome, but guile-gnome was accessing the C struct instance element, where g-golf uses the gdk-event api, which is the same for all and every gdk-event daviid: this will save quite a bit of unusefull code, and greatly simplify the doc as well ... daviid: if anyone has an opinionated opinion, now is the time :) str1ngs: daviid: I'm happy with your choice. I don't have an opinion. I would imagine this will impact guile-gnome users more. daviid: str1ngs: ok, tx for the feedback, i'll ahead and simplify daviid: str1ngs: this will also allow users to access any GdkEvent(structure), and right now, they can only acces a few of the many ... so this will be a win as well str1ngs: nice, my GdkEvent usage is pretty basic. but latter I can see this being really helpful. daviid: the reason that motivates me is that the GdkEvent api won't raise exception if the struct doen't offer the 'element', but return #f ... it has been planed to work on any GdkEvent ... daviid: by the gnome team i mean .... daviid: str1ngs: in this makefile example you posted yesterdy, i see 2 tests daviid: from a scheme point of view, what would './open & disown' mean? daviid: str1ngs: i guess i can use './open https://www.gnu.org/software/guile' as an example daviid: though ... daviid: str1ngs: in this example you posted, you wrote ';; This does not work\n(g-application-run app (length args) args)' when running a gule script, args is bound to a string that contains first the script name, then the user args ..k daviid: so, peekeing args for ./open.scm https://www.gnu.org/software/guile and you get daviid: ;; ((./open.scm https://www.gnu.org/software/guile)) daviid: where i think the (g-application-run app ...) you want to pass 1 arg, in this example of course, and that is https://www.gnu.org/software/guile str1ngs: daviid ./open & disown forks a default appliation. and then the next call ./open https://gnu.org opens those files on the default application. it's like how emacsclient would work daviid: str1ngs: but can i just try ./open.scm https://www.gnu.org/software/guile, for the sake of testing argc, argv in a pure scheme script? daviid: actually, i should try this from a repl str1ngs: if you an get argv to work yep, and the 'open works daviid: working on this with a scrpt is pita :) str1ngs: just make sure to thread the g_application_run call so it doesn't block str1ngs: this is actually hard to test in a REPL unless you have a good understanding of stat. str1ngs: state* daviid: maybe i can work and test using gtk-ini, or clutter-initt daviid: but i'd neeed a 'sensible example', and it's been decades that we (not only me) always call those passing nul pointers str1ngs: I think that will confuse things. because activate setups all the application uniqueness daviid: noone actually use this to initialize an app, which is ok, bit i' not familiar daviid: i'm going to ask for a imple example for gtk-init or clutter-init on introspectionf str1ngs: umm this is GTK recommend way to create a gtk application. str1ngs: gtk-init is for trivial applications. str1ngs: see the tutorial https://developer.gnome.org/gtk3/stable/gtk-getting-started.html daviid: str1ngs: yes, well i don't beleive much int this 'modern way is better', but ... fine daviid: str1ngs: not going to do this now, but thanks daviid: i need to work on the mechanic str1ngs: well the main thing is argv. this can be done with gtk-init so no biggy daviid: that does not depend on any thread, nor 'specific' artillary .. just two iit args daviid: argc is 'backward' filled by those init functions daviid: so g-golf problem is array, all arrays, not just these utf8, but it's a stat str1ngs: two do this in a REPL you need arv to work. and two thread app runs with two apps with the same application-id str1ngs: to do* daviid: yep, and i don't want to try that, i want to try using clutter-iit or gtk-init daviid: lt me ask on introspection str1ngs: if you focus on argv I will worry about the GApplication aspect. or provided with a testable example daviid: str1ngs: exactly str1ngs: great thanks str1ngs: I know you like gtk-init. but for a large scale application I need the features GApplication provides. namely application uniqueness and its dbus integration daviid: str1ngs: sure, it's not that i don't like g-application-run and friends, it is that is unusefully raisng the complexity daviid: str1ngs: i don't need that complexity to work on and solve the missig array type in g-golf daviid: once it works for gtk-init, clutter-init ... it will work for your use case ... str1ngs: right makes sense str1ngs: whatever makes things easier for you daviid just let me know what you need from me. daviid: str1ngs: they just told me on itrospection gtk4 won't accept any argument daviid: but i'll work on this anyway str1ngs: gtk4 wont take any command arguements? daviid: str1ngs: in your scheme script, you should play with and use (command-line) and compare to what arg is bound to (in the main procedure), because as it is you are truying to pass to many args ... daviid: gtk4 gtk-init function str1ngs: ahh okay str1ngs: also daviid I have this list->argv might be useful http://git.savannah.nongnu.org/cgit/nomad.git/tree/typelib/util.c?h=feature-g-golf#n93 str1ngs: see the scm_nomad_free_argv above it as well daviid: introspection floks suggested to lok at this instead https://developer.gnome.org/gtk3/stable/gtk-running.html daviid: i'll use one or more of those, as i told you, it doesn't matter, i jst need a few 'sensible' test examples daviid: could use the --name str1ngs: do you need a gtk-init example from me. I'm confused. I thought it was established argv was not working? daviid: str1ngs: no, tx daviid: i usd the wrong channel str1ngs: ah okay apteryx: hello! Apparently, running QEMU with -nographic resets the terminal (perhaps sending a character such as '\033c'). QEMU is currently launched using Guile's 'execl'. What should I use to be able to filter out any potential \033c character? A pipe? dsmith: apteryx: Hmm. That's two chars. '\033' and 'c'. Is that like a vt52 control code dsmith: ? dsmith: Nope. That seems to be ANSI reset terminal to initial state. RhodiumToad: where do you think ANSI got it :-) RhodiumToad: it's a vt52/vt100/xterm etc. control code dsmith: vt52 was way simpler than vt100 dsmith: apteryx: Maybe there is an option to prevent quemu from doing that? dsmith: Maybe "-display none" ? (I've only ever used quemu with debootstrap) apteryx: dsmith: I don't think there's a user controllable switch for this in QEMU. I've read the man page, and asked #QEMU. apteryx: I was told it's probably the BIOS doing it (not sure about this, since I think for the system tests in Guix most boot straight from the kernel, without involving a BIOS). apteryx: dsmith: but I'll try your '-display none', seems it may be related apteryx: idea* apteryx: nope, didn't do it :-/. Perhaps the Linux kernel itself sends the reset code. I can't scroll back past: "[ 0.000000] Linux version 5.4.18-gnu ..." rlb: Say you have a big module with a lot of exports/replaces/etc. -- what's the recommended way to write it to work with 2.2 and 3.0 without "overrides" warnings? i.e. in 3.0 you need #:re-export-and-replace, but 2.2 will reject that, and you can't use cond-expand in define-module as far as I know. rlb: I suppose if there were a re-export! that did replacement like export!, then maybe you could use cond-expand after the main define-module to handle just the replaces for each guile, but doesn't look like there is one yet. dftxbs3e: hey, is GNU Guile being tested on big endian systems at all? lloda: dftxbs3e: there was a flurry of mails in the list about hppa, I think that's big endian, isn't it? lloda: so yes? dftxbs3e: lloda, alright, thanks. I'll have a go at the test suite in a minute. dftxbs3e: (compiling from sources..) dftxbs3e: ((((bootstrap taking **forever**)))) nerdypepper: /join #termux nerdypepper: erm my bad dsmith: dftxbs3e: Yes. Good news is, it usually finishes before the next release comes out. mwette: Is object code generated by the JIT translater cached to files on disk? dsmith-work: Hey Hi Howdy, Guilers wingo: mwette: no wingo: otoh i am not sure if that would improve things; certainly not for spinning metal, maybe not even for ssd. it's not quite object code either stis: heya guileres! oni-on-ion: hi =) dftxbs3e: GNU Guile's `make check` passed fully on IBM POWER9 ppc64 big endian -- lloda dftxbs3e: guile (GNU Guile) 2.2.4 dftxbs3e: Is GNU Guile's bytecode format portable if built on a little endian system and then used with guile on a big endian system? dsmith-work: dftxbs3e: Nope. There are 4 total flavors of .go files. A combo of 32/64 and be/le. dftxbs3e: dsmith-work, ah! GNU Guix, when it cross compiles bootstrap binaries embeds the bootstrap .go built from from say little endian amd64 and then you execute it on big endian.. would that be an issue? dsmith-work: Yep dftxbs3e: dsmith-work, how would you cross compile GNU Guile bytecode? dsmith-work: But the packaged tarball already has .go files of different kinds. So the build knows somehow. dsmith-work: Unless I'm mistaken.. dsmith-work: dftxbs3e: Take a look in guile-3.0.0/prebuilt/ from the release tarball. dftxbs3e: dsmith-work, FYI, I use guile 2.2 here dsmith-work: It's in there too. dftxbs3e: dsmith-work, okay dftxbs3e: dmiles, I am on a 64bit big endian system, it seems no other platform has that combination dsmith-work: :( dftxbs3e: A statically linked GNU Guile binary compiled with GNU Guix just segfaults, I'm trying to find the cause dftxbs3e: 2.2 binary dftxbs3e: It segfaults short after loading `ice-9/psyntax-pp.go` and using '_llseek(5, 0, [506061], SEEK_END)' then mmap PROT_READ and mprotect PROT_READ|PROT_WRITE dftxbs3e: The segfault also happens if I set GUILE_SYSTEM_PATH=/usr/lib64/guile/2.2/ -- a directory that contains compiled bytecode that work with a dynamically linked version of GNU Guile 2.2.4 -- statically linked version is 2.2.6 dsmith-work: dftxbs3e: What does "file psyntax-pp.go" say? Should tell bit size and what endian. dsmith-work: (they are elf files) dftxbs3e: dsmith-work, /tmp/lib/guile/2.2/ccache/ice-9/psyntax-pp.go: ELF 64-bit MSB shared object, no machine, version 1 (embedded), dynamically linked, with debug_info, not stripped dftxbs3e: Looks wrong dftxbs3e: Is it not? dsmith-work: 64 be dftxbs3e: Where do you see BE? dsmith-work: le would be LSB dftxbs3e: Okay dftxbs3e: Then it should work? dsmith-work: That part of it anyway. Sounds like there may be bugs there. Doens't look like that combo is used much. dsmith-work: dftxbs3e: Sounds like bug report time. dsmith-work: sneek: bugs? sneek: bugs is send reports to bug-guile@gnu.org, and see bug reports at http://bugs.gnu.org/guile dftxbs3e: dsmith-work, I'll do it ASAP. It seems that it worked by using the system's .go files instead of the files included in the statically linked's version archive mfg: Hi there, i'm having trouble with the peg module. I'm trying to parse Androids .bp files. I have this grammar: https://pastebin.com/6egs1A8g , but it fails to parse the test snippet because the string contains numbers which i don't match in my string non termianl. after adding 0-9 to the character class it doesn't work anymore. mfg: Can anyone help me? This is the first time i'm using pegs ... daviid: str1ngs: how about resolving the problems pointed by the message? daviid: adding a command-signal signal handler and what is this does not implement g_application_command_line() ... i have no idea str1ngs: well like I've been trying to explain the message should not happens since 'open is connected. daviid: str1ngs: i would try that first daviid: i trust these messages str1ngs: try which? str1ngs: I don't need command-line since I'm using 'open which satisfies this. the C example does work it's pretty much on par with the scheme example daviid: str1ngs: we have to try something right? how about adding a command-lind signal, then we'd figure out if that solves, or not, and why is it that usig g-golf the 'open is not sufficiant ... str1ngs: the problem is the 'command-line and 'handle-local-options greatly complicates things. where 'open does not. so I'm not sure how else to address this. For now I have just set the flags from C and that resolves it. then even the 'open signal works from scheme. but with out Gfile *files which is another issue. from everthing I've looked at there is an issue with setting 'flags from scheme but I don't know enough about g-golf to trace the str1ngs: probleme. rekado_: hey there, is it possible to define a GOOPS object that can be applied as a procedure? rekado_: I tried defining “apply” as a method, but that doesn’t work rekado_: apply-generic exists but just doing ((make )) throws an error. daviid: str1ngs: i'm going to ask for some ideas/hints on introspection RhodiumToad: rekado_: yes it is RhodiumToad: (someone else asked that recently and I worked out how) daviid: setting flags 'per se' works fine, afaict, but ... this might be a 'corner cae' RhodiumToad: rekado_: make it a subclass of or rekado_: RhodiumToad: ah, neat! Thank you! RhodiumToad: rekado_: I have a working example if you want to see? rekado_: yes, that would be great! str1ngs: if you see my C example there is no 'commad-line signale only 'open. no need to run it I can confirm it works RhodiumToad: https://dpaste.org/p4NC <-- it got a bit tab-damaged, sorry, and it uses srfi-88 because I prefer it str1ngs: daviid: ^^ str1ngs: daviid: I will join #introspection maybe it would help if I understand g-gofl internals beter daviid: str1ngs: i was trying to convince you to just try adding a command-line signal str1ngs: I have that satisfies the error but does not satify my use-case. daviid: it is a debug attempt, not a full solution to the problem ... str1ngs: where is 'open should satisfy not having the error at all as well rekado_: RhodiumToad: thank you for the example! RhodiumToad: yw daviid: str1ngs: i was actually working on something else, before we spoke about the WebkitUserMessage argument problem, so I decided to finalize that work, i jst pushed it, which about , the widget enter and leave notify events daviid: here is an example http://paste.debian.net/1130118/ daviid: both the window and the button track the signal ... just to show all widget subclass instances can track those signals ... daviid: str1ngs: now I want to solve the g-closure-marshal-g-value-ref bug, then I wish to solve the gtk-init, clutter-init and g-application-run argc/argv problem, then i'll try to solve the 'open signal (somewhat hidden) bug daviid: str1ngs: here is an attempt to solve the g-closure arg rlated problem: http://paste.debian.net/1130120/ daviid: could you please try and tell me if it works? here it compiles fine, but as you knw, I can't try it ... let me know ... thanks str1ngs: daviid: the new g-closure-marshal-g-value-ref looks good now. **** class-of #< 7f6dfe848e60> daviid: str1ngs: great str1ngs: daviid: what was the status of GVariant again? daviid: str1ngs: no binding for GVariant str1ngs: okay mean time I can use webkit_user_message_get_name () for message passing that helps thanks str1ngs: can you ping me when you push that. I was using REPL socket it will be easier integrate this better from an installed package. REPL is nice. but not so much when you have state and moving parts :) str1ngs: thanks for looking at this BTW daviid: str1ngs: will push asap, prob toorrow, will let you know yes str1ngs: daviid: regards to the your TODO list sounds like a good plan. the gtk-init argv issue is a logical step. and we can revisit that flag issue later. it's definitely not acting as expected though but with argv in place. I put a better example together for you. str1ngs: thanks for looking at this it's much appreciated. daviid: wc! rlb: Is anyone using pfds much with 2.2 or 3.0, in particular hamt-fold? rlb: (I just hit an assertion failure in both versions for fold when I go from a two element to three element map.) rlb: Might just have something wrong, but for example: https://paste.debian.net/hidden/1f1c9d14/ roelj: What's the most efficient way to write data coming from an input port to an output port? (basically passing a stream of data from one port to another) dsmith-work: Morning Greetings, Guilers d4ryus: roelj: guile has pipe, but not sure how efficient it is roelj: d4ryus: That looks exactly like what I need. Thanks! :) dsmith-work: roelj: If going from a file to a socket, sendfile is probably fastest, but I don't know if guile exposes that. roelj: dsmith-work: Ayeah, like Guix does as well. Unfortunately, I am passing data from one network socket to another. dsmith-work: s/fastest/most effient/ civodul: roelj: sendfile works when both the source and destination are "file ports", such as sockets civodul: so you should be able to use it roelj: civodul: What if I don't know how many bytes are being sent? roelj: repeat with N bytes until all is transferred? civodul: roelj: or 'stat' the source port? civodul: if you know it's a file port civodul: and not a socket civodul: hmm roelj: How does sendfile handle EOF? civodul: not sure civodul: i think it returns the number of bytes actually sent and everything's fine civodul: but you'd need to try or check the code roelj: what's a good paste website? roelj: I have an example code roelj: Ah, it indeed works roelj: (while (> (sendfile out in (expt 2 12)) 0)) roelj: nice! dsmith-work: Sweet dsmith-work: civodul: Didn't realize it would do socket->socket dsmith-work: civodul: Did some high performance embedded a while back and used splice. Implemented it in our kernel driver. civodul: dsmith-work: nice, i haven't used splice civodul: sendfile is a must for web servers dsmith-work: civodul: This new io_uring looks *very* intereting. Wish I had it back then. (I don't work there anymore) jcowan: dsmith-work: What we have here is the progressive reinvention of TOPS-10 and earlier operating systems jcowan: One of the design principles of Unix is that other than the locations actually read or written by read() and write(), there were no kernel data structures in user space where they could be cabbaged by userland randomness. dsmith-work: jcowan: Yeah. The open,close,read,write interface is *so* simple and clean. daviid: str1ngs: I pushed the patch to the devel branch str1ngs: daviid: great thanks, will pull daviid: str1ngs: g-closure-marshal-g-value-ref will need to be further improved, to properly handle all other 'interface' types, keep this in mind, so if you come to a 'similar' error while using signal(s), it probably will be a missing type conversion in g-closure-marshal-g-value-ref str1ngs: daviid thanks I keep that in mind. I'll assuming it will be a such as this case then? daviid: str1ngs: not necessarily, but it definitely will be an inadequate value, you'll spot it ... str1ngs: understandable. thank you str1ngs: daviid looks good. this greatly simplifies message passing between the webview and web process. I don't need to create my own client/server dbus implementation now :) daviid: str1ngs: great oni-on-ion: does (use-module (oop dict)) exist ? required by guile-persist daviid: oni-on-ion: that is not a guile goops 'core' module, but i mhght exists elsewhere, don't know oni-on-ion: daviid, yeah, thats what i've surmised. i've looked around but i dont see any real way to "reverse lookup" use-module forms oni-on-ion: i've commented it out. my assumption is that (oop dict) was merged into goops oni-on-ion: well, i've tried to compile this, but i am now given up: https://gitlab.com/gule-log/guile-log oni-on-ion: "no code for module (logic guile-log primitive)" is as far as i can get after all the dependencies. i would be iterested to hear if anyone else is using guile-log, because it looks really great. daviid: oni-on-ion: the guile-log author appears here (i this channel), he was here earlier today, try to ping him, his nick is 'stis' oni-on-ion: daviid, ah cool! thank you. daviid: wc! dsmith: sneek: seen stis? sneek: I last saw stis on Feb 09 at 09:03 pm UTC, saying: hmm, lot of legacy in the reader who knows you may have spotted a bug.. rlb: Here with 3.0 right now, this does not print "test": (error (format #f "test")) rlb: But (error "test") does. rlb: 3.0.0 oni-on-ion: rlb, error procedure is (message . args) oni-on-ion: format procedure is not a message, but is (dest fmt-str . fmt-args) wingo: i think rlb found a real bug fwiw wingo: the result of calling (format #f "foo") is just "foo" wingo: so it's the same as (error "test") oni-on-ion: ohhh. wingo: rlb: apparently there is a bug in message-irritants, see (with-exception-handler values (lambda () (error (format #f "foo"))) #:unwind? #t) wingo: vs (with-exception-handler values (lambda () (error "foo")) #:unwind? #t) wingo: for the first I get "?", whereas for the second it is () wingo: i think the irritants should indeed be a list g0d_shatter: anyone awake here, I'm trying to figure out how to get pkg-config to find a guile.pc file wingo: pkg-config --cflags guile-3.0 wingo: ^ doesn't show you anything? wingo: if not, your PKG_CONFIG_PATH env var is missing the dir that contains guile-3.0.pc wingo: (or guile-2.2.pc, etc) g0d_shatter: ack g0d_shatter: sorry andy i didn't see this right away g0d_shatter: wingo: I'm trying to build gdb manually with guile-2.0 so I can use guile as an extension language wingo: neat wingo: is there a reason not to use guile-2.2 ? g0d_shatter: I was under the impression gdb won't build with 2.2? g0d_shatter: I thought there was a blocking bug of some sort civodul: ah true civodul: we should fix that wingo: ah i didn't know about that :) wingo: should have fixed that over fosdem :P wingo: w tromey and pedro in the room ;) civodul: yup! g0d_shatter: My goals for the moment are to finish the project using it and then work on the patch civodul: it's just the port API stuff wingo: ah, should be easy to make a shim for 2.2 api implemented for 2.0 then g0d_shatter: si wingo: g0d_shatter: anyway i would see what pkg-config --cflags guile-2.0 prints g0d_shatter: as far as the original question though g0d_shatter: haha wingo: and if it's not finding the guile-2.0, then check your PKG_CONFIG_PATH env var wingo: *the guile-2.0.pc g0d_shatter: wingo: it prints out -pthread -I/usr/include/guile/2.0 wingo: that looks good then g0d_shatter: wingo: this is the output from trying to build https://dpaste.org/Q11j g0d_shatter: when I call: echo $PKG_CONFIG_PATH I get nothing g0d_shatter: I"m guessing I'm doing it wrong wingo: i am not sure that pkg-config is what is being used at this stage, fwiw wingo: like, that message seems to check that /usr/bin/guile works wingo: it just happens to follow a check for the pkg-config program wingo: does /usr/bin/guile --version print out something sensible? g0d_shatter: wingo: guile --version gives me sensible output wingo: is it 2.0? g0d_shatter: yes wingo: k wingo: in that case i would check the config.log to see precisely what check is being run and what is failing wingo: it's a lot of output, but it's the only way to know :P wingo: search for the strings in the output around where the problem occurs g0d_shatter: running file on /usr/bin/guile leads to /usr/alternatives/guile which is a symbolic link to /usr/lib/x86_64-linux-gnu/guile-2.0/bin/guile g0d_shatter: wingo: good call, thank you g0d_shatter: wingo: so grepping config.log for relevant strings didn't turn up anything useful, strangely, so I'm trying to run the configure script with a different option this time, instead of --with-guile=/usr/bin/guile I'm trying --with-guile=/usr/bin/guile-2.0 g0d_shatter: in the hope that that will work this time? its still running in the background g0d_shatter: still no dice, man this is frustrating wingo: :( wingo: did you manage to find the specific thing that caused configure to say "no guile" ? g0d_shatter: nope g0d_shatter: thats what I'm trying to figure out now g0d_shatter: I've never used pkg-config (that I remember) other than with this, and I've had this issue before on an older ubuntu install g0d_shatter: where would I find the guile.pc file? g0d_shatter: i downloaded the source to see if there is one there and simply put it where it belongs in my path wingo: the file is called guile-2.0.pc wingo: probably you could "locate guile-2.0.pc" if your locatedb works wingo: ok here's a dumb question, did you install the development package for guile 2.0 from your distro? g0d_shatter: wingo, I'm just installing locatedb now g0d_shatter: wingo: I did! wingo: locatedb isn't necessary fwiw, just a useful thing when you want to know where a file is g0d_shatter: for sure, my find command fu is weak though g0d_shatter: alright!! we're getting somewhere, its located at /usr/lib/x86_64-linux-gnu/pkgconfig/guile-2.0.pc g0d_shatter: so it does exist on my system, theres that much at least g0d_shatter: wingo: do you know how I would tell pkg-config to find it here? or maybe its a naming conflict of some kind? like its looking for guile and can't find guile-2.0 or something wingo: i am sure your pkg-config is already finding it wingo: because of what pkg-config --cflags guile-2.0 printed g0d_shatter: should it matter that pkg-config --cflags guile fails? wingo: no, because it should be pkg-config --cflags guile-2.0 wingo: fwiw it would seem that the right argument to --with-guile is a version wingo: so ./configure --with-guile=2.0 g0d_shatter: I will try that now g0d_shatter: so this is the configure command I'm using g0d_shatter: ../configure --prefix=/usr --with-system-readline --with-python=/usr/bin/python3 --with-guile=/usr/bin/guile-2.0 && make g0d_shatter: I just tried it with the option for guile being --with-guile=2.0 and no dice on that one either g0d_shatter: fwiw I just realized that the command thats failing is make g0d_shatter: embarrassing g0d_shatter: wingo:just wanted to thank you for taking the time to help me, I'm about to sign off for the night/morning, but at some point I'm going to solve this madness g0d_shatter: wingo: and I appreciate you helping me get closer to that wingo: hey sorry that it's not working for you, good luck! rekado_: Is it possible for a macro to return not one but multiple expressions, so that they would be spliced into the location of the macro call site? rekado_: like this: (list 1 2 3 (my-macro 10 11 12) 4 5) –> (list 1 2 3 10 11 12 4 5) civodul: rekado_: nope! civodul: macros are "singled-valued" civodul: it'd be an interesting extension though civodul: in the meantime you'd need to make 'list' a cooperative macro str1ngs: sneek later tell daviid later when you have time. these flags do not seem to be working properly you can verify this is right? (g-application-set-flags app '(handles-open can-override-app-id)) . This might not be easy for you to test since it requires argv conversion. Which I'm doing in C for now, maybe we can revisit this once arrays are complete? can-override-app-id should allow passing --gapplication-app-id but instead I get Unknown str1ngs: option --gapplication-app-id. If I set the flags via C it works okay. like so g_application_set_flags (G_APPLICATION (app), G_APPLICATION_HANDLES_OPEN | G_APPLICATION_CAN_OVERRIDE_APP_ID); . setting the 'flag slot has the same result. I used the method for simplicity sneek: Got it. str1ngs: sneek: later tell daviid the error was truncated. here is the error 'Unknown option --gapplication-app-id' sneek: Will do. str1ngs: sneek: later tell daviid here's the enum reference if it helps. https://developer.gnome.org/gio/stable/GApplication.html#GApplicationFlags sneek: Will do. rekado_: civodul: thanks for the hint. Does “cooperative macro” mean that I’d replace “list” with a macro that takes care of splicing in the result of “my-macro”? civodul: rekado_: yes rekado_: thanks! dsmith-work: Monday Greetings, Guilers faLUCE: hello. Which function can I use for sorting a list of integers? d4ryus: faLUCE: hmm, what about sort? faLUCE: d4ryus: '(2 8 7 4) ---> '(2 4 7 8) faLUCE: d4ryus: I don't understand how to apply sort d4ryus: faLUCE: (sort '(2 8 7 4) <) => '(2 4 7 8) faLUCE: d4ryus: thanks! Why is the online doc so bad?? faLUCE: https://www.gnu.org/software/guile/manual/html_node/Sorting.html faLUCE: a list of functions without any example of how to apply the _syntax_ faLUCE: and it's the only one doc daviid: faLUCE: the doc is very good, excellent imo, as a reference manual, not a user guide nor a tutorial - if/when you wish examples, just search for some, like duckduckgo 'scheme programming sort examples' ... sneek: daviid, you have 3 messages. sneek: daviid, str1ngs says: later when you have time. these flags do not seem to be working properly you can verify this is right? (g-application-set-flags app '(handles-open can-override-app-id)) . This might not be easy for you to test since it requires argv conversion. Which I'm doing in C for now, maybe we can revisit this once arrays are complete? can-override-app-id should allow passing --gapplication-app-id but instead I get Unknown sneek: daviid, str1ngs says: the error was truncated. here is the error 'Unknown option --gapplication-app-id' sneek: daviid, str1ngs says: here's the enum reference if it helps. https://developer.gnome.org/gio/stable/GApplication.html#GApplicationFlags daviid: str1ngs: ok will look asap, could you paste a self executable example using this (g-application-set-flags app '(handles-open can-override-app-id)), so i can save, chmode, execute and .. . compare what it does with what is expected, that would save me a bit of time ... tx the shortest possible example that does exactly that ... tx daviid: str1ngs: sorry for the lttle delay wrt closure args, i've been dragged to solve something else, but should solve this later today faLUCE: daviid: there's some problem with the google search key faLUCE: daviid: In fact I did not know what is the right search key faLUCE: maybe the word "scheme" is too common oni-on-ion: it definately is for duckduckgo , having troubles finding stuff yesterday. daviid: don't use gaagle daviid: just paste the search i posted here, comes with top search result as scheme programming examples of sort ... daviid: don't use 'scheme' alne, use 'programming scheme' or the like ... scheme programming language blablabla ... this generally works well, for me at least daviid: anyway, back to hack oni-on-ion: davexunit, even 'guile' is difficult. my search history yesterday is like iterative updates =/ daviid: oni-on-ion: yes, you prob want to use 'guile scheme' then the serch words ... oni-on-ion: daviid, tried that too! there were many attempts. my search terms are generally hyper-accurate so it was a hit to my pride as well oni-on-ion: search-fu dsmith-work: It's good to have a unique name for a project/language nowadays. oni-on-ion: ahem. does anyone know anything about "guile-studio" ? dsmith-work: Searching for go stuff is often difficult. "golang" usually works. oni-on-ion: ah, yep! truth. done the same, the one time i searched on it oni-on-ion: i wish "quotes" were as useful as before. (both ddg and ggl seem to ignore it) searching for syntax and errors especially *: dsmith-work invents a new concatenaive languge: "and" daviid: guile and guild, alone will almost always trigger search within diff context, hence, 'no matter what', you prob want to add 'scheme, programming ...' oni-on-ion: =( oni-on-ion: yep, daviid . maybe we need a specialised searcher =) jcowan: Google Search pretty much requires quotation marks on search terms, at least for the (obscure) things I search for. Otherwise it will ruthlessly disregard my search terms on the assumption that I actually care about something altogether different. jcowan: but evidently more popular dsmith-work: A long time ago, there was google code search. Very useful to find something being used in the wild. dsmith-work: Too bead they turned that off. dsmith-work: bad wleslie: that is one packed graveyard wleslie: not many results include anything relevant. include results that are relevant? {y n} dsmith-work: Nah, I'd rather have the non-relevant ones, of course. dsmith-work: WHo wouldn't? wleslie: < google> however will you learn and discover new things? dsmith-work: Excatly what I was thinking! oni-on-ion: there is stuff like github code search now though -- microsoft's latest IDEs uses it for autocompletion mfg: Hey mfg: i'm trying to use the peg module. What predefined Character Classes are available and how do i add '/' to one? mfg: nvm i forgot something else :) str1ngs: daviid: will see what I can do. 'can-override-app-id might be hard to model because it requires passing argv to g_application_run which is not possible without use C to convert **char from say a list. I'll try with 'handles-open at least hopefully the two issues are related. daviid: **char is in g-golf daviid: is supported str1ngs: daviid: does it use string list? I will double check but I thought that's what you meant by you need to work on arrays? daviid: str1ngs: but you were talking about flags 'not working', i'd like a snipset just for that if possible str1ngs: well the two are related in these case. since in order to use can-override-app-id you need to satisfy **char to g-application-run str1ngs: basically argv needs to pass to somehow g-application-run daviid: str1ngs: yu tell me, but i'd like to see why this flags settings are not working str1ngs: I'll have an example here in a sec might help daviid: but setting the app glags is not related? daviid: *flags mfg: Hm now i think i have a question ... How do you add the - to a character class escaping does not seem to work :( wleslie: you could put it as the first or last in the character class str1ngs: daviid: yes its related since you can't pass commands arguments like --gapplication-app-id to satisfy the 'can-override-app-id flag str1ngs: same with handles-open now that I think about it mfg: wleslie: When i try [-a-z] or [a-z-] guile complains about unbound variables, without the minus it doesn't complain in either case ... wleslie: hmm. the other possibility is maybe you have to double-escape it to get the escape past the reader. daviid: str1ngs: ok, please send a snipset i can try here .. daviid: str1ngs: it should be possible to pass **char, just pass a list of trings str1ngs: daviid: here's a simple use-case http://paste.debian.net/1130083 note g-files is not available I don't know if its related to argv but that is a GFile aarray. I don't want to overload use with issues here. daviid: it should be converted to **gchar, but if not, we'll debug of coure ... mfg: wleslie: double esacping also doesn't work ... i'm trying to escape with a backslash are there other escape methods in scheme? (i don't knoiw scheme that well ...) daviid: so far i always use #f #f ... str1ngs: passing arguments use this error Warning: Unimplemented type - array;: (c -1 #f 0 filename) daviid: str1ngs: but i think i kind of remember you did try in the recent past, to send a list of argv str1ngs: I mentioned this long time ago. I thought it was related to arrays mfg: or is there another way to write that particular character? mfg: direct ascii code or smth? daviid: i know g-golf does have arrays, but that is diff them argv ... i'll try to see if i find your example daviid: str1ngs: of course i also will fix the array type, but tht id not the same as **gchar, which should work str1ngs: daviid I've gotten around it by converting a list to **char using C meantime. daviid: the warnig is a surprise, because we pass #f #F, it should not even try to do anything, but pass %null-pointer ... str1ngs: see the commented out call though that produces that str1ngs: actually I think the warning is produced regardless. I'm assuming that has to do with argv str1ngs: I just thought since **char is an array and the array says array are not supported. it was related to array support :) str1ngs: err warning says* daviid: str1ngs: i know the warning, ever since g-golf exists daviid: clutter-init produces it ... gtk-init, any init daviid: but that has nothing to do the argv daviid: or at least should not be related daviid: anyway str1ngs: well not using any special flags and calling with (g-application-run app (length args) args) gives (process:12372): GLib-GIO-CRITICAL **: 13:44:41.160: g_application_run: assertion 'argc == 0 || argv != NULL' failed my guess is argv is NULL str1ngs: also gtk-init takes argv are you sure there not related? you can shoot me if I'm wrong :) str1ngs: daviid ^ daviid: str1ngs: i was hoping to look at the flags problem, this init warning exists ever since i worked on g-golf, and it's something i need to work on, not urgent: most of the time, we call all init function using #f #f ... daviid: str1ngs: but without a snipset ... str1ngs: daviid: did you not get my snippet? daviid: str1ngs: please copy paste the hello-world.scm scrpt, change it so it has a minimum executable code that reproduce this flag problem daviid: that i can save chnode and run daviid: or load in a repl daviid: *save/chmod and execute loclly daviid: tx str1ngs: daviid: http://paste.debian.net/1130091 this is not copied verbatim from hello-world.scm but it should satisfy your requirements. str1ngs: maybe I can find another flag that has issues that not related to command arguments I dunno daviid: tx, will look at this asap str1ngs: the error seems wrong because 'open should satisfy this no problem. daviid: this snipset doesn't seem to call gtk-init? str1ngs: you don't need gtk-init with GtkApplication daviid: ok str1ngs: activate handles all of that. str1ngs: here is my C use-case that works http://git.savannah.nongnu.org/cgit/nomad.git/tree/typelib/util.c?h=feature-g-golf#n129 it might be a good reference as well str1ngs: the point in the use case is the C code is pretty much on par with the scheme in term of expectations str1ngs: don't mind the scm_c_eval_string ("(command-line)"); hack I was being lazy :P str1ngs: more precisely GApplication handles 'active GtkApplication is derived for course. str1ngs: s/for/of daviid: str1ngs: i can't find the flags property def daviid: if i comment that line, it's ok, still have the init related warning of course, as expected, but the app launches ... then i wanted to lookmat the flags property ef, i can't find it :) str1ngs: daviid does this help https://developer.gnome.org/gio/stable/GApplication.html#GApplicationFlags ? daviid: ok, when i do not comment the lie, here i get this message daviid: guile:29176): GLib-GIO-WARNING **: 19:51:26.199: Your application claims to support custom command line handling but does not implement g_application_command_line() and has no handlers connected to the 'command-line' signal. str1ngs: right 'open should satisfy that daviid: and it doesn't launch the app str1ngs: right str1ngs: but this C example does not suffer from this. http://paste.debian.net/1130097 daviid: str1ngs: worth mremembereing that i am not familiar with neither gtk-pplicatio not gtk-application-window, which is not a 'problem', but of course i need help to find out if it is a g-golf or an app problem .. str1ngs: understandable str1ngs: here's a make file for the C example if it helps http://paste.debian.net/1130098 rlb: OK, I can reproduce the armel debian buildd failure on a porterbox now: https://buildd.debian.org/status/fetch.php?pkg=guile-3.0&arch=armel&ver=3.0.0%2B1-1&stamp=1580701721&raw=0 rlb: Any suggestions for the fastest way to track that down? As you can see it appears to be failing when trying to build guile-procedures.texi, but assuming guild runs guile itself, I'd guess it's a more general guile issue. rlb: (And this seems vaguely familiar...) drakonis: guild still works? rlb: noidea rlb: Apparently not there it doesn't, though :) rlb: I'm trying a "plain" upstream build now (see if it might be any of the debian mess I've made). rlb: hmm, still fails -- gdb suggests it's a corrupt stack. rlb: "previous frame identical to this frame" dsmith: rlb: Yeah, I belive building guile-procedures.texi is the very first time the freshly build guile runs anything. oni-on-ion: i hope someday for guile-emacs . exwm is real nice. drakonis: somebody's gotta resume that work oni-on-ion: ah hmmm. oni-on-ion: elisp can JIT with 3.0? drakonis: there's elisp on guile drakonis: i think it extends to the whole compiler tower, not just guile lang oni-on-ion: ok great. that was a better way of putting it chrislck: guile-studio would be nice oni-on-ion: any particular feature/ability in a -studio ? drakonis: guile studio could see a lot of improvement oni-on-ion: if it already exists, can't find much info davidl: is there a way to make functions in pip packages available to guile, or to at least wrap them in a python module and then use python-on-guile to have them accessible? The problem is I can't write a pycodetoguile.scm which has a import mypippackage statement in it and use anything from that package. davidl: pycodetoguile.py* file and then mypycode.scm with (load-compiled "pycodetoguile.go") janneke: hmm, how do i get comments in markdown for haunt? janneke: the interwebs have all types of ideas and that don't seem to work dustyweb: janneke: hm you'd need a separate service dustyweb: since haunt builds static stuff janneke: dustyweb: tnx, i put comments out-of-band -- terrible :-( dustyweb: janneke: comments are often a headache to manage these days due to spam :\ janneke: dustyweb: oh, no -- i mean just like % in latex -- static writer's comments *: janneke laughs dustyweb: aha :) dustyweb: that's different :) dustyweb: some markdown parsers use which is ugly janneke: it seems there are all kinds of nice dialects for that janneke: yeah -- i have tried to avoid markdown, but this helps to really hate it :-/ dustyweb: janneke: use Skribe! ;) janneke: dustyweb: ah, that sounds nice -- i'll check it out! roptat: is there an equivalent of call-with-output-file that appends to the file? jcowan: roptat: You can use open-output-file with the nonstandard file-options symbol append, and then use call-with-port. rlb: Does the guile reader require the input to be at least partially ascii compatible? Seemed like it might given (if I understood correctly) bits like this: https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/read.c?h=v3.0.0#n242 i.e. raw byte comparisons with say '}', etc. stis: utf8? the ascii chars are the same for utf8 and ascii bricewge: How can I get the number of arguments a procedure is expecting? stis: procedure-minimum-arity bricewge: stis: Thanks! But why can't I find it in the manual? Where should I look for such a things? stis: also https://www.gnu.org/software/guile/manual/html_node/Compiled-Procedures.html#index-program_002darity oni-on-ion: how do i rebuild "info" pages? guile is not showing up, but everything is in /usr/local/share/info bricewge: stis: Yes I skimmed through it, before asking, but didn't thought much of it because it was for programs instead of procedures. stis: the program structure is whats make a procedure work stis: (use-modules (system vm program)) stis: scheme@(guile-user)> (program? +) stis: #t oni-on-ion: info "(guile) Procedure Properties" oni-on-ion: curious - where does the term "ice-9" come from? wingo: an old kurt vonnegut novel wingo: https://lists.gnu.org/archive/html/guile-devel/2010-07/msg00046.html oni-on-ion: ohh, interesting! thanks =) my search ended up with 'ice 9' song by some guitar dude wingo: :) oni-on-ion: ahhh guile-emacs would be so nice *: RhodiumToad still curious about the next-method problem. stis: hey wingo: stis: what do you think about bug#39315 stis: I can code around it but it's a bit uggly daviid: RhodiumToad: you can call next-method without arg or with an instance and a list of initargs stis: also it wold be nice to discuss gc properies of continuations (I think the stored stack may lead to possible gc leaks as things are stored untagged) daviid: for example, (next-method), (next-method self #:port port) or (next-method self '()) RhodiumToad: huh, that works? it's not documented *: RhodiumToad goes off to try wingo: stis: better to code around it imo, is the short answer. i will try to make a long answer on the list stis: Then we need to go through the guile sources as well to code around it as well. As it is now, variables exposed in the intefaces has no effect unless you are lucky and can use set-cdr rlb: stis: sure for utf-8, but not for some other encodings. That's what I was trying to verify -- whether the existing reader code assumes some minimum ascii compatibility when it's reading, checking the raw bytes. Seems like it may, but wanted to double-check. RhodiumToad: huh, it does indeed work RhodiumToad: that needs documenting stis: I managed to code around it by simply redefineig the whole interfce of the module lol rlb: wingo: any current sense about e.g. whether it's likely to stick around or not? rlb: It'd be handy for some things I might want to do, but didn't know if it was reasonable to rely on it in at least the medium-term... stis: see warning var in system/base/message rlb: "on it for" stis: I do hope that it will remain, use it for python (for guile) objects and classes rlb: stis: you mean wrt ? stis: yes stis: you call a python class to get a python object rlb: Ahh, interesting -- ok, well that at least tells me I wouldn't be the only one :) rlb: thanks stis: rlb, my memory is weak but wasn't guile using utf-8 internally for strings rlb: Think now it may be hybrid, but the bit I was mentioning (I think) may be at the level of reading raw bytes from a port, i.e. no locale/encoding/decoding involved yet. stis: hmm, lot of legacy in the reader who knows you may have spotted a bug. wingo: rlb: it will stick around wingo: stis: yes using a mutable data structure (e.g. (make-variable ...)) is a good option oni-on-ion: nice!! https://git.elephly.net/gitweb.cgi?p=software/guile-picture-language.git daviid: i was thinking a returned value, but this is an argument str1ngs: I think the return value is handled okay daviid: it's unfortunate i can't play with a snipset, and also that i kow nothig about webkit :) daviid: str1ngs: yes, the returned value is a boolean, iiuc str1ngs: I understand, that's party why I didnt want to bother you with it. even if you installed unstable webkitgtk you would need a web extention to talk too. daviid: but the argument value, since the ignal callbackis scheme code, what are you doing with it? (not sure my question is clear) str1ngs: I'm using this to communicate with the webprocess. primarily right now it just loads and calls some javascript str1ngs: but later I'd like to use it for dom introspection ie html forms etc daviid: str1ngs: so your signal code look like this: have (lambda (web-page message) ...)? str1ngs: it looks like that but it's actually (webview message) daviid: ok, and you say that message is #f, instead of a ponter to ... str1ngs: right daviid: instead of a instance I meant to write str1ngs: that's correct its str1ngs: with the value of #f daviid: str1ngs: but it shuld be a instance? daviid: str1ngs: the code to look at wrt g-closure invocation args is g-closure-marshal and g-closure-marshal-g-value-ref, line 223 and 251 respectively daviid: to see what webkit 'gives you', you can peek (or dimfi) the value, line 252 daviid: (let ((value (dimfi (g-value-ref g-value)))) instead of (let ((value (g-value-ref g-value))), at least tempo daviid: i think t might be a bug on g-golf daviid: I wish you can paste the result of the peek, if it is a 'valid pointer', then there is a bug i g-golf str1ngs: daviid: will peek and let you know daviid: str1ngs: can you also peek the type daviid: (case (dimfi (g-value->g-type g-value)) insteas of (case (g-value->g-type g-value), tempo as wel ... str1ngs: g-value->g-type? daviid: it should be object daviid: line 253, do this (case (dimfi (g-value->g-type g-value)) str1ngs: okay daviid: then you'll revert these small debug changes ... daviid: it will show those peeks for both arguments of course, and webview should be a pointer and should have the object type as well ... daviid: let's see str1ngs: will take a bit to switch to local build of g-golf vs guix package. str1ngs: I can't easily test this in a REPL daviid: it's ok, take your time daviid: ah yes, patching g-golf in guix isn't that easy daviid: maybe you can do that in your host distro instead ... str1ngs: I have a local build of g-golf on my host ubuntu. but lately I've been using guix more lol str1ngs: let me reboot. it will be easier to use a local buidl for this daviid: i understand daviid: i didn't think you had to reboot, thought you were running guix as an ubuntu host ... too bad str1ngs: daviid will be while before I can test this. I have a chicken egg problem were webkit is to old on my host system. at least I know where to look now thanks. and it's getting late in my work day daviid: str1ngs: it's ok, but i think it is a g-golf bug. can you tell me fro the top of your head if this argument receives a new instance, each call? str1ngs: daviid off hand I'm not sure . I make a new instance of the message when replying . but because this uses dbus it might get marshalled and unmarshalled. daviid: str1ngs: but it not an isance 'of yours' right? str1ngs: **** replay is 0x7f31c8005ab0 str1ngs: **** massage: is class: #< 7fc5787eb2d0> str1ngs: daviid: looks the instance is the same from creation till when the message is passed to the closure daviid: str1ngs: so the pointer is a valid pointer str1ngs: it's valid at creation. but let me double check daviid: i wanted to know the type daviid: the ... is suspicious to me, as i that is not what i wanted, i thik, what i wnted, is this daviid: (g-value->g-type g-value) daviid: that is never a class, it is a symbol, or am i wrong? daviid: did you patch line 253 for this: (case (dimfi (g-value->g-type g-value)) ... that is the type i'm looking for daviid: it should be a long, like this 94891814062432 daviid: just an example of course ... daviid: this i patsed is the class gtype-id - which is a dynamic value, it changes from session to seson ... daviid: str1ngs: do you have access to a repl? where you'd have imported the WebKitUserMessage class? str1ngs: I can't use a REPL because it requires a webkit process str1ngs: ie a web extention so there is no way to message daviid: ok, but i did mis exprss myself, let me paste a code daviid: just a minute daviid: if you did change the line 253, i'd expect that in the (current-output-port) you's see 'object daviid: can you confirm this? str1ngs: to debug g-golf I need to a local install g-golf on guix which is not possible. or local webkit won host system daviid: because (g-value->g-type g-value) in this argument case is 'object daviid: right? str1ngs: so I can not confirm that right now. I can make the changes just it will take sometime to setup daviid: let's stick to your ubutu image for now ... daviid: i just need a few confirmation str1ngs: yes but then ubuntu's webkit is to old then I need to locally build webkit daviid: ah str1ngs: so it will take some time to set this up. but I can set this up. the main thing is I know where to look now as well daviid: str1ngs: i'll pste a version of g-closure-marshal-g-value-ref i'd like you to use in a sec str1ngs: ok that will help or a patch even daviid: i don't want to patch, because it's going to peek, a temporary thing daviid: str1ngs: https://paste.debian.net/1129729/ daviid: could you paste and use this version temporarily, in (g-golf hl-api closure) str1ngs: okay will take me bit to text str1ngs: test* str1ngs: daviid: ;; object str1ngs: ;; 35914080 str1ngs: ;; string str1ngs: I'm not sure if that's the right signal. I'd have to isolate more daviid: that 35914080 doesn't sound correct, i din't know where the 'string' comes from, there are only to peeks i the paste i proposed str1ngs: daviid: that's not right i forgot to uncomment the scheme closure daviid: but lt me add another peek, just a sec str1ngs: daviid: let me isolate this more so there is less signal noise str1ngs: **** sending message as pointer: 0x7f61400050d0 str1ngs: ;; object str1ngs: ;; 34692928 str1ngs: ;; object str1ngs: ;; 32580400 str1ngs: I'm not sure why there are two signals there daviid: str1ngs: two argumets, not two signals str1ngs: ah that makes more sense daviid: but i think that's what i thought, not a bug, but a 'limitation', which i know what to do, let me try to fix this daviid: if not today, i hope by tomorrow ... str1ngs: ahh great, sorry for the slow debugging. and it's not important I have a work around daviid: str1ngs: it is very important for g-golf, thanks for this report .. str1ngs: no worries, this is a hard example to work with lol daviid: str1ngs: it's ok, i know what happens, but i'll need you to test, i don't have such a example 'at hand' ... rlb: There's no facility for defining GOOPs subclasses is there? i.e. to be able to have something that behaves exactly like a procedure, but is also recognizable via define-method? oni-on-ion: surely with MOP oni-on-ion: there must surely be a way for just that. do you have a small code sample ? RhodiumToad: ooh RhodiumToad: you can subclass and put something in the #:procedure slot RhodiumToad: this appears not to be documented at all rlb: RhodiumToad: ahh, yeah, that sounds like exactly the kind of thing that'd work. rlb: oni-on-ion: I would just need to be able to create an instance that when placed in the first position in a call, i.e. the foo in (foo 1 2 3) would result in a call to a function I specify. But foo must also be recognizable as some class via define-methods. RhodiumToad: well I tried a trivial example and it worked RhodiumToad: (define-class ()) (let ((o (make #:procedure (lambda x (pk x))))) (o 'foo')) oni-on-ion: rlb, ahh yeah. let us know how it worked out rlb: wingo: any idea if that's something that might be "stable" and/or we might eventually support officially, or think relying on it is likely to be forseeably "risky"? RhodiumToad: that last ' was a typo but it still works RhodiumToad: I tested on 2.2.6. rlb: RhodiumToad: ok, right -- thanks much. rlb: For what it's worth (and ignoring any questions about their advisability), one use case is something like clojure's "invokable" sets and maps (including vectors), i.e. (some-map :key) looks up the key in the map: https://clojure.org/reference/data_structures#Maps rlb: (Which are sometimes handy, e.g. compositionally.) RhodiumToad: with goops, is it possible for the constructor for some class to provide new/different initialization parameters for the initialization of a superclass? rlb: RhodiumToad: without delving, I'd imagine that'd be via specialization of initialize, use of next-method, etc. RhodiumToad: right, but next-method doesn't take args, it can only pass on the exact args from the caller RhodiumToad: there's no way to say "call the next-less-specialized method but with these other args instead" RhodiumToad: hence the question rlb: Oh, I hadn't noticed/remembered that (clearly). rlb: (I forget what clos does there...) RhodiumToad: it seems a fairly serious limitation rlb: Unless there's a workaround, could certainly affect some class designs. RhodiumToad: if there's a workaround it's not documented and nor is it obvious mwette: wingo: my html5 parser is written in CPS (in the classical sense) wingo: sneek: later tell mwette where is your parser? :) manumanumanu: Wow. The computer had been feeling sluggish for a while and I ran top. My wifes login showed chrome using 76% cpu and 6gb memory (on an 8gb imac from 2016). Her account had been inactive since early january, but chrome was logged into facebook. Something there was doing weird stuff and was pegging several cpu cores at 100%. No wonder compiling guile master took so much time yesterday :D lloda: the NOTE here is wrong now, yes? https://www.gnu.org/software/guile/manual/html_node/Vector-Accessors.html#index-vector_002dset_0021 lloda: (vector-set! #(1 2 3) 0 0) does signal an error at least manumanumanu: The note is correct. Guile doesn't care lloda: it does tho? manumanumanu: Does it work? lloda: try what I wrote a line above yours manumanumanu: guile 3 warns about mutating a literal vector lloda: precisely lloda: not a warning, an error manumanumanu: yes lloda: 'expecting mutable vector' manumanumanu: ah lloda: so the note is wrong manumanumanu: Yeah. When was that changed? It is recent thing iirc manumanumanu: 2.2.x? or between 2.2 and 3? lloda: I'm just not sure if this is true of every case, like compiled/interpreted etc. lloda: it was a while ago manumanumanu lloda: after 2.2 for sure manumanumanu: I remember when literal lists became immutable manumanumanu: 2017 manumanumanu: http://git.savannah.gnu.org/cgit/guile.git/commit/?id=7ed54fd36d2e381aa46ef8a7d2fc13a6776b573a lloda: sounds about right lloda: I remember having to patch my C++ array conversions b/c guile wouldn't give non-const * anymore from certain Guile arrays manumanumanu: It is a bit of a shame that you can't make immutable vectors from guile. lloda: yeah lloda: you can in C, just not in Scheme lloda: well there is no interface, I'm just used to poking in Guile lloda: it's just a bit in the various objects lloda: what do you think would work for interface? (make-immutable ...) ? add a mutable-* version of every constructor out there? immutable by default? lloda: some stuff does have immutable versions, like records manumanumanu: Racket does vector->immutable-vector and vector-immutable. lloda: that would be trivial to add tbh manumanumanu: it is a bit clunky. lloda: yeah manumanumanu: make-immutable seems icky since you might have already passed it somewhere where mutability is expected lloda: true lloda: still it could be left to responsible use manumanumanu: i'd say immutable constructors like immutable-vector and vector->immutable-vector is the most sane. lloda: vector->immutable-vector is the same as make-immutable isn't it? lloda: also I'd prefer vector-immutable to immutable-vector haha lloda: well I take that back lloda: there's already immutable-vector? in Guile lloda: in the vm rekado: I found that (current-filename) does not work in Wisp source files when using the Wisp reader with LOAD. rekado: this is odd because the Wisp reader uses READ internally, and that should record positions (including the filename). lloda: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=0e660fc925a751a53c206bafa87567dbb4042c78 lloda: the mod immutable error isn't raised inside primitive-eval, only inside compile lloda: I don't know where to go to fix that manumanumanu: rekado: ArneBab_ probably has some idea about WISP :D dsmith-work: Happy Friday, Guilers!! manumanumanu: Good morning, dsmith-work ! jlicht: wingo: amazing blog post(/talk that I could not attend) :-) lloda: want to remove all the contiguous fluff in arrays.[hc] lloda: isn't used and never will be lloda: overengineering imo wingo: jlicht: tx :) wingo: lloda: you are the array boss :) compatibility is the only constraint, and that can be worked around with replace/deprecate/remove lloda: im bulldozing atm, figured I'd do the deprecations later or I'd never get to it lloda: but the contiguous flag was never used anywhere nor documented so I don't think it's user visible lloda: am curious about bytevectors tho, b/c I think those are always contiguous yet there is a contiguous flag as well lloda: cannot see where it's set wingo: i think that's for when the data is allocated inline wingo: right? lloda: dunno lloda: the name is confusing then wingo: well, data contiguous with header words lloda: ah wingo: but i understand the confusion :P lloda: there are only so many words lloda: did you see my question above about immutable vector? why don't we get mutation errors with primitive-eval? wingo: lloda: didn't see that question. could it be that a vector produced via `read' doesn't have the immutable flag? lloda: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=0e660fc925a751a53c206bafa87567dbb4042c78;ds=sidebyside lloda: wingo ^ lloda: the exception is throwin with (compile) but not with (eval) lloda: thx for the pointer, I'll look there wingo: lloda: patch lgtm lloda: but the note would be wrong if the mutation doesn't raise error with primitive-eval, wouldn't it? lloda: i.e. Guile still fails to detect the error, sometimes lloda: or flag it or w/e wingo: lloda: i think the right fix is to have a separate read function, unfortunately :/ besides returning syntax objects, it would be sure to mark vectors as immutable wingo: i am not sure we can change `read' as it has other purposes wingo: and for primitive-eval, it is perfectly possible (though horrible :P) to do (primitive-eval `(vector-set! ,(vector 1 2 3) 0 42)) wingo: so, weird situation :P lloda: hmm lloda: I'll leave the patch there for the time being then str1ngs: hello daviid, thanks to g-golf nomad is down to only using 4 C functions. And those are used via g-golf as well. see http://git.savannah.nongnu.org/cgit/nomad.git/tree/typelib/util.h?h=feature-g-golf#n27 str1ngs: daviid I have another issue but it's not something I want to bother you with since it uses features from unstable webkitgtk. But maybe I can do some digging myself. I have a signal closure that should pass WebKitUserMessage as an argument. but instead it's passing a boolean. Can you point out the code that handles closure arguements? daviid: str1ngs: hello! daviid: str1ngs: the class, methods and procedures are in (g-golf hl-api closure) str1ngs: daviid: great thanks will check that out. daviid: str1ngs: a closure instance parameters are GValues, those are handled in (g-golf gobject params-vals) str1ngs: okay will dig through there in the next couple of days. daviid: the procedure that 'prepares' the input args is prepare-g-value-in, in (g-golf hl-api closure) str1ngs: also FYI in regards to link hovering and updating a control. WebKitDOMGTK is deprecated and JavaScriptCore should be used instead. I'm using web extension with WebKitUserMessage . but it might be possible to just use run_javascript and JSValue. I'll look into this more. it's not something I actually need but some of the principles are nice to know academically. there are bits I might use later. str1ngs: unfortunately JavaScriptCore leaves a reliance on javascript :( daviid: where is the WebKitUserMessage definitin? str1ngs: https://webkitgtk.org/reference/webkit2gtk/unstable/WebKitUserMessage.html it's part of unstable so not something you could use from g-golf currently str1ngs: I have a guix webkitgkt-unstable package str1ngs: WebKitUserMessage makes message passing from the WebKitView and WebKitPage much easier . without the need to roll your own DBUS service. str1ngs: here's the signal say for the webview to recieve a message from the wekitwebpage https://webkitgtk.org/reference/webkit2gtk/unstable/WebKitWebView.html#WebKitWebView-user-message-received. this would be sent by the webkitprocess via a web extention str1ngs: this handles receiving singlas from the webview to the webprocess. https://webkitgtk.org/reference/webkit2gtk/unstable/WebKitWebPage.html#WebKitWebPage-user-message-received str1ngs: signals* daviid: str1ngs: a WebKitUserMessage is a gobject subclass, so if yu can import the typelib, even if unstable, g-golf should handle it 'fie', just like , ofr a , afaict at least str1ngs: daviid: I thought that as well. but from some reason is I connect to https://webkitgtk.org/reference/webkit2gtk/unstable/WebKitWebView.html#WebKitWebView-user-message-received to receive signals from the web process. the parameters are WebKitWebView * and boolean. and not WebKitWebView * and WebKitUserMessage * str1ngs: the boolean is #f btw daviid: a signal that use those should assume it receivs a goops instance, and you should have nothing to do, because g-golf will find and pass the pointer to the GObject instance, and if it is a returned value, will receive a/the GObject instance and retrieves the goops instance for you, and return it ... str1ngs: right so for that has been my experience accept for this case. maybe it's an issue with the typlib and not related to g-golf at all. C is fine though str1ngs: it's not that important. I just created a custom signal and connect to and emit my custom signal from C and then g-golf handles the custom signal surprisingly :) btw g-signal-new would be a nice touch later down the road. :) str1ngs: my method adds an extra layer to the signal is all daviid: str1ngs: you could peek the value you receive from webkit, by changing tempo this line daviid: hum, wat rekado: hey there, I’m still cleaning up the GWL code that deals with Wisp rekado: I’m trying to use LOAD with the Wisp reader, but I’m getting the error “definition in expression context, where definitions are not allowed” rekado: that’s with Guile 2.2.6 rekado: (load "/tmp/test.w" wisp-scheme-read-chunk) rekado: the file contains just one definition: define hello "hello" rekado: (load "/tmp/test.scm" read) obviously works fine, where “test.scm” contains (define hello "hello") rekado: looks like wisp-scheme-read-chunk is just not the right kind of procedure for this task. rekado: wisp itself defines a private read-one-wisp-sexp procedure that wraps wisp-scheme-read-chunk — and that seems to work rlb: Do procedures with setters have a usable goops class? i.e. they don't appear to be subclassed from or I may be able to work around the issue, but it'd be convenient for them to work smoothly with goops. rlb: In 3.0 at least they do satisfy procedure?, but appear via class-of to have a generic class or something. rlb: (or that's just how structs always appear via class-of) wingo: moin :) fnstudio: hi, is there a default pattern for modifying a list element and returning that list? fnstudio: i know there's `list-set!` but i'm wondering if there's anything similar that doesn't change the list in place fnstudio: otoh, i'd be curious to know why the provided built-in is the `!` (in-place modification) version fnstudio: i suppose that one can create a copy of the original list, apply `list-set!` to the copy and finally return it (hence without modifying the original version) fnstudio: would that be a good pattern? anything i'm missing? lloda: racket has that fnstudio, it's called list-set lloda: you only need to copy the list up to i, not all the list lloda: e.g. https://paste.debian.net/1129397/ ? lloda: you should do this walking the list once but i'm lazy lloda: I think it's a good function and we should have it in guile fwiw lloda: why the provided version is ! I guess it's because it doesn't copy anything. But if you use that a lot you need a vector instead. fnstudio: hey lloda, thanks so much! vvv helpful lloda: yw wingo: did anyone implement https://html.spec.whatwg.org/multipage/parsing.html ? mwette: wish I'd seen that long ago when I tried html5 from the spec, but gave up: https://paste.debian.net/1129432/ mwette: I used http://www.w3.org/TR/html5/syntax.html dsmith-work: Thursday Greetings, Guilers mwette: wingo: same thing -- so the incomplete work I generated is against the spec;o There was some discussion on one of the email lists back then dsmith-work: What about htmlprag? dsmith-work: In guile-lib: https://www.nongnu.org/guile-lib/doc/ref/htmlprag/ mwette: wingo: https://lists.gnu.org/archive/html/guile-user/2016-07/msg00035.html mwette: dsmith-work: I've used that. It chokes sometimes, but otherwise has been useful. mwette: . wingo: dsmith-work: i think htmlprag should be considered to be obsolete. the whole notion of "pragmatic" vs "strict" is one from the xhtml days wingo: i think the specified parser is a real step forward dsmith-work: Agreed! jcowan: There's still a difference between correct and incorrect HTML5, though. ManDay: Why does (iota count start step) not work despite the docs of guile about srfi-1 ? ManDay: only (iota count) works lloda: ManDay: (iota count start step) works if you (import (srfi :1)) first lloda: that was fixed in 3.0 btw ManDay: oh, there is guile-3? lol ManDay: good to know, thanks for the info ^^ ManDay: thanks for the answer, too lloda: np lloda: this was the fix lloda: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=2b6083865a69c44c09ac493cb4a1d65fffb83d81 jcowan: It should be documented somewhere that you can say (import (only (guile) foo bar baz ...) to get Guile-specific identifiers into R6RS programs. I found that out by guessing it. daviid: heya guilers sneek: Welcome back daviid, you have 3 messages. sneek: daviid, str1ngs says: thank you I would start with this example. sneek: daviid, str1ngs says: hello daviid when you have a second can you look at this example. http://paste.debian.net/1128761 . calling run javcript gives "match" "no matching pattern" callback. Here is the webkit reference https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#webkit-web-view-run-javascript . I'm assuming GAsyncReadyCallback has not been implemented? note I'm not actually calling using this asynchronously sneek: daviid, str1ngs says: also GAsyncReadyCallback reference https://developer.gnome.org/gio/stable/GAsyncResult.html#GAsyncReadyCallback dsmith: greets dsmith: Does anyone remember some Guile code that would make a dot dependency graph of which modules use which modules? daviid: dsmith: greets dsmith: I can't seem to find it in the guile sources. Or the scwm sources. And I *know* I was using something like that at one time.. dsmith: Was tracking down circular dependencies in scwm. dsmith: Heya daviid daviid: dsmith: I can't help, though I have a (very) vague memory of this being mentioned here, a (few? :)) decade(s) ago, not sure dsmith: No worries. dsmith: grep and sed and echo to the rescue. dsmith: echo 'digraph g {' ;grep ':use-module (app scwm' *.scm | sed -n 's/.scm:.*#:use-module (app scwm//p' | tr -d \) | sed 's/ / -> /'; echo '}' ) > ~/deps.dot dsmith: (as a start anyway) daviid: dsmith: if scwm is in guix, guix has one, afaict, i still don't use guix :) daviid: https://guix.gnu.org/manual/en/html_node/Invoking-guix-graph.html daviid: oh, you mean strict guile scheme modules, forget about mu suggestion then ... daviid: str1ngs: could you please repost, the debia pate expired, sorry daviid: str1ngs: this link expired http://paste.debian.net/1128761 str1ngs: daviid: here you go. http://paste.debian.net/1129210 daviid: ok tx, will look at it asap str1ngs: my closure might be wrong. it replicates the C signature. though passing NULL or #f would be enough for now. dsmith: daviid: Yeah, just within scwm. It's old. From around Guile 1.3.5 I think. apteryx: what's the most idiomatic way to solve a problem where I have two same length lists, and one of the lists contains a boolean that "enables" or "disables" the values of the second list? The goal is to recreate a list with only the "enabled" values. dsmith: I'd look at filter. Can filter take multiple args like map? RhodiumToad: fold-right? RhodiumToad: filter only takes a predicate and one list dsmith: Bah. Battery died. apteryx: dsmith: yikes. This used to happen to me a lot because of my use of ratpoison (lack of any notification system). apteryx: now I have an mcron job that beeps the battery before it does ;-) apteryx: beeps the PC speaker* apteryx: RhodiumToad: fold-right. Will read on it. apteryx: thanks dsmith: scheme@(guile-user)> (use-modules (srfi srfi-1)) dsmith: scheme@(guile-user)> (filter-map (lambda (p v) (if p v #f)) '(#t #f #t #f) '(a b c d)) dsmith: $1 = (a c) RhodiumToad: ahh, filter-map RhodiumToad: hm dsmith: Only tricky thing, is if your "value list" has any #f values, they will be removed.. RhodiumToad: that'll be a problem if any element of the list is itself #f, though? dsmith: Yep dsmith: In Haskell, I'd try some combo of zip filter and map. But I'm just learning. daviid: str1ngs: the problem is that g-golf still misses an implementation for callback GIArgument types daviid: str1ngs: for info, when the type-tag of an argumet is interface, currently g-golf handles enum, flags, struct and object, so I need to work on this to also handle callback - for info as well, you may look at (g-golf hl-api function), prepare-gi-args-in (line 562 ...), then the match type-desc starts line 580, and fails since there is no 'callback type-desc code yet :) chrislck: (fold-right (lambda (a b c) (if a (cons b c) c)) '() p v) dsmith: There ya go. daviid: str1ngs: i run your example, manually scroll down and how funny: on the bottom right of the page, "Today's random package…" Guile-gome :):) dsmith: So no one does corba with gnome anymore, right? daviid: str1ngs: it might be interesting to display the 'full url' 'somewhere' when we hover over a link (?) daviid: dsmith I don't know, but isn't it that corba has been deprecated, not sure daviid: str1ngs: because of this missing callback type, even if yu pass #f or %null-pointer, it will raie an exception str1ngs: davexunit: thanks for the feedback. for now I'll use a typelib function when I need to call javascript. str1ngs: daviid: hovering over a link my actually be more of a challenge then you might thing. unless webkit has some primitive for this. Which as far as I know it does not. you would have to use DOM introspection. which requires either javascript injection or IPC via a web extension. javascript would need the missing GAsyncReadyCallback at the very least. for nomad I'm hoping to add some kinda DOM introspection that uses scheme, but I think str1ngs: that will be quite the challenge. see https://wiki.gnome.org/Projects/WebKitGtk/ProgrammingGuide/Cookbook#Dealing_with_DOM_Tree for reference. str1ngs: daviid: if you think of anything in regards to DOM introspection. let me know it's not going to be an easy problem to solve I think. civodul: Hello Guilers! nly: hi civodul :) lloda: scm_array_handle_bit_elements_offset is undocumented (?) lloda: oh it's mentioned, just no heading and not in the index :-/ dsmith-work: {appropriate time} Greetings, Guilers bandali: greetings bandali: dsmith-work, are you the author/maintainer of sneek? sneek: I'll keep that in mind. dsmith-work: bandali: Ya bandali: dsmith-work, cool! would you consider changing the "tell" functionality to default to "later", and only relay the message immediately with "now"? bandali: it's a somewhat regular occurrence over at #guix :-) bandali: also, is it free software? dsmith-work: bandali: Yes, I'd like to fix that. Its just very lightly warmed over port of the old sarahbot that used to inhabit #scheme bandali: dsmith-work, ah, thanks. i'd be happy to send a patch if it's free software. if not, i'll leave you to it :-) dsmith-work: Which was running on some JVM based Scheme. (can't remember at the moment) dsmith-work: bandali: I'd like to release it, but I have a lot of work to do on it first. And i've just been busy with other stuff. bandali: dsmith-work, awesome! and gotcha, no worries. would appreciate a ping if/when you get around to doing it sneek: Will do. daviid: str1ngs: I want to fix the missing gi-argument and g-value array types first - and while working on it, I can look at and fix 'implemented feature' bugs - then I will look at the callback gi-argument type daviid: str1ngs: wrt webkit2 'hover feedback', I know next to nothing about webkit2 and even less about DOM ... but I'd look at and snarf some of the epiphany-browser code, which does exactly that ... my 2c daviid: *hver user feedback str1ngs: daviid: regards to g-value array etc . thanks for looking at that. meantime it's not a huge rush. for types g-golf can't handle right now I just call via my typelib. str1ngs: daviid: epiphany uses a web extension . which means a client/server model using DBUS str1ngs: eventually though maybe if I wire up an extension I could use g-golf with https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebPage.html. that might allow DOM introspection with scheme :) daviid: str1ngs: you should be able to just introspect a WebKitDOMDocument str1ngs: daviid: yep, but that's only available from the webkit process when it loads an extension. which is the PITA part civodul: i see "anon" entries in (statprof) profiles and i wonder in which case we should expect Guile to lack source location info *: civodul just watched https://fosdem.org/2020/schedule/event/guile2020/ -- pleasant & insightful! lfam: Agreed, great talk from wingo! civodul: it's good to hear a reflection on the user base, handling changes, etc. civodul: i tend to be conservative, but i think Guile 2.0 upwards has done a great job at handling changes civodul: the 1.8 to 2.0 was a bit more bumpy :-), but that was probably unavoidable civodul: *transition dsmith-work: civodul: Yes. Getting the bot running on 3.0 was not near as traumatic some of the previous efforts. civodul: yeah civodul: changing GCs would have the potential to be traumatic, as wingo mentions gnufr33d0m: I'm trying to install guile 3 on my PureOS with guix and can't see to figure out how. Is this possible? sneek: Welcome back gnufr33d0m, you have 2 messages. sneek: gnufr33d0m, str1ngs says: if you are on foreign distro. you also have to install the glibc-locales into root's current-guix profile. like so guix install -p .config/guix/profile glibc-locales . then you need to restart guix-daemon. assuming you are using systemd . sudo systemctl restart guix-daemon . sneek: gnufr33d0m, str1ngs says: ~root/.config/guix/profile to be more precise rlb: s390x may be fine -- I just built the debs on zelenka successfully, so I'll see about a buildd "give back" there (i.e. rebuild). jackhill: gnufr33d0m: I believe guile 3 on guix is still called guile-next for now jackhill: additional library are called guile3.0-whatever wingo: moin civodul: howdy wingo! jcowan: RhodiumToad: The SXML 3.0 doc says that (*COMMENT* "foo") is the SXML representation of , but that the SXML parser ignores comments. I don't know if the SXML printer renders them, but I don't see why it wouldn't. RhodiumToad: well, there is no code to render them RhodiumToad: hence my "hemipygian" comment; stuff is missing for no good reason dsmith-work: UGT Greetings, Guilers RhodiumToad: greetings to you dsmith-work: RhodiumToad: "hemipygian" is new to me. RhodiumToad: half-assed RhodiumToad: (cf. callipygian = nice-assed, and steatopygous = fat-assed) wingo: you seem to take a half-empty approach to glass fullness :) RhodiumToad: wrong size glass civodul: wingo: just emailed interesting findings about bignums on guile-devel civodul: it made my day! civodul: and i'm sure it can make us all happier, especially the Guix among us :-) manumanumanu: wingo:" Looking at a glass you can interpret it two ways. Life, however, is always half empty." Quote from a Norwegian TV-series I identified with as a 20-something old. :D jcowan: RhodiumToad: The "good reason" why things are missing is that the author didn't care about them. The Curse of Lisp strikes: http://www.winestockwebdesign.com/Essays/Lisp_Curse.html dsmith-work: jcowan: (without reading all the way through yet) I think Rob Pike was saying something similar about OS reserch. Things have been basically stagnant since Unix. dsmith-work: AH, this: https://tianyin.github.io/misc/irrelevant.pdf dsmith-work: jcowan: Nope. Nevermind. RhodiumToad: jcowan: yes, that explains a lot jcowan: I know that Pike talk, and I don't agree. Plenty of research is going on, but it's a matter of finer details than before. (There's also the problem that "engineering" papers have become unwelcome in CS journals, and so their insights don't get into the citable literature). jcowan: That's like saying the development of book fonts has been stagnant since the 19C: it hasn't, it's just that the broad outlines of what readers expect from a book font are set. Nobody's going to read a book in Comic Sans or (Ghu forbid it!) Stop. jcowan: https://fontzone.net/font-details/stop dsmith-work: Ugh! dsmith-work: Is Mathieu Othacehe in here? stis: time to give my SICP to my daughter and install guile. I asked her and she is interested. dsmith-work: stis: A family heirloom. Nice. linas: I recently started getting this message: WARNING: Use of `load' in declarative module (opencog matrix). Add #:declarative? #f to your define-module invocation. linas: but google does not know what it means ... linas: The module is using `load` to load all of the assorted files that define it ... linas: Hmm this: https://www.gnu.org/software/guile/manual/html_node/Declarative-Modules.html linas: but what does the use of `load` have to do with it? linas: or rather, how do I tell guile that, yes, it is declarative, anyway. linas: ohh .. manye I need to `include` instead of `load` ? ahh that must be it ... linas: Hmm `include-from-path` since plain `include` pukes OK, got it... fnstudio: Hi, if I were looking for something comparable to Python f-strings, where should I start from? fnstudio: or something comparable to Python's `.format()` fnstudio: i.e. a way of injecting variables in a string lloda: fnstudio: (ice-9 format) fnstudio: lloda: super, thanks! lloda: yw dsmith-work: {appropriate time} Greetings, Guilers erkin: Heya dsmith-work: sneek: paste? sneek: Last time I checked paste is https://paste.debian.net rlb: guile-3.0 has been approved for debian unstable/sid: https://buildd.debian.org/status/package.php?p=guile-3.0&suite=sid Looks like we have some work to do on armel, mipsel, and s390x, though with luck, maybe mipsel just needs a longer timeout... rlb: And of course it'd be nice if we can track down the failures on the non-release archtectures too... rlb: Do we expect the build time on non-jit platforms to be about the same as 2.2? dsmith-work: Woo! jonsger: rlb: I think I have the same build failure on armv7l on openSUSE like on debians armel https://build.opensuse.org/package/live_build_log/devel:languages:misc/guile/openSUSE_Factory/armv7l jonsger: rlb: I think the build time on non-jit platforms is longer then on 2.2. That's at least my impression jonsger: rlb: I have data: build time on non-jit platforms is around factor 2x. e.g. https://build.opensuse.org/packages/guile/job_history/devel:languages:misc/openSUSE_Factory/ppc64 rlb: Yeah, was asking because it looks like some may have been coming in a 7h vs 3h for mips64el, but there may also be buildd host differences... rlb: ahh, ok, thanks. rlb: Looks like you saw an illegal instruction where the deb saw a segmentation fault? jonsger: yes jonsger: our armv7l build is in qemu of aarch64 builders. Is "hasse" a native armel build node? rlb: looks like real hardware: https://db.debian.org/machines.cgi rlb: https://db.debian.org/machines.cgi?host=hasse jonsger: maybe I just should setup the little armv7 board I have on my desk :P rlb: Looked like s390x might not have even made it through configure -- maybe I'll poke at that one first. Had trouble in the past with s390 (though I think that was emacs) because it was a 31-bit arch, but s390x shouldn't have that issue iirc. jonsger: rlb: s390x is fine on openSUSE: https://build.opensuse.org/package/live_build_log/devel:languages:misc/guile/openSUSE_Factory/s390x rlb: ok, thanks. Sometimes it's also the default debian build options -- we've had to omit some in the past. rlb: e.g. maybe stack-protector? jonsger: rlb: it gets build with those flags https://paste.opensuse.org/view/raw/84512338 plus the ones in the spec file rlb: jonsger: ok, thanks again. jonsger: without HDMI cable, SD card and u-boot image for the board it seems to be pretty hard rlb: hah drakonis: what's the current guile package manager? drakonis: is it still guildhall or guix replaced it? jonsger: drakonis: I think guildhall is not really used anymore, so kind of replaced by guix :) civodul: rlb: great that guile-3.0 was approved for Debian! civodul: there's a couple of bugs to address on ARMv7 and AArch64, but yeah, we'll get there stis: please also the nasty bug#39315 dsmith-work: Any other Guile talks at FOSDEM? civodul: dsmith-work: there were talks about things around Guile, but only one on Guile proper i guess civodul: see https://fosdem.org/2020/schedule/track/minimalistic_experimental_and_emerging_languages/ civodul: and https://guix.gnu.org/blog/2020/meet-guix-at-fosdem-2020/ dsmith-work: thanks! dsmith-work: Ooo! Guix instead of yocto! civodul: i find it nice to see all these things being done with Guile! civodul: heh civodul: that one was great IMO civodul: in a way we're all shamelessly taking advantage of Guile goodness :-) dsmith-work: I have *never* gotten anything building, let alone working, with yocto. *: stis use buildroot dsmith-work: Buildroot is my tool of choice jonsger: rlb: did you made progress on armel? rlb: jonsger: no - haven't had time to mess with it yet, and may not for a bit. rlb: i.e. might be "days". jonsger: oke, then I'll just open a bug. As I'm struggling hard to get an armv7l qemu guest running on aarch64... rlb: when I get around to it, I can test directly on a porterbox, which may or may not help me :) sneek: .oO( Hours seem like days... ) drakonis: how did guix days go? rekado: I’m working on the Guix Workflow Language again and the compilation of my modules takes a *very* long time. rekado: They are not complicated modules at all. rekado: long time = several minutes rekado: this is with Guile 2.2.6 rekado: The modules use GOOPS, so I think that might be why; but is there a way to profile the compiler and figure out what is taking so long? rekado: the test suite also runs very slowly even though the tests are rather simple. civodul: heya rekado! civodul: rekado: you could try: ,pr (compile-file "...") civodul: or perhaps ,time to start with (to see if it's a GC issue) rekado: thanks, I’ll give it a try rekado: huh, it takes mere seconds when comping like that. rekado: oh… civodul: oh, could it be that you're evaluating many of your dependencies? rekado: YES! civodul: e.g., because GUILE_LOAD_COMPILED_PATH isn't correct rekado: all of Guix civodul: ah! that takes a while :-) rekado: embarrassing… civodul: heh, that happens rekado: the “env” script was wrong civodul: we'll pretend nothing happened civodul: hey rekado, hi! rekado: oh hello! rekado: long time no see civodul: :-) civodul: we missed you in Brussels! rekado: I really wanted to attend. I missed the energy, the collaboration, and the joy of meeting fellow Guix hackers. rekado: I’m looking forward to reports from the Guix Days and FOSDEM civodul: yes, we'll hopefully send notes soon MutoShack: I'm having trouble with the SXML modules MutoShack: Is there a way to output "" HTML comments from sxml->xml ? RhodiumToad: apparently not RhodiumToad: but, RhodiumToad: you can put a procedure in the sxml tree, which will be called with output directed to the appropriate port RhodiumToad: (and obviously that can write anything it pleases) MutoShack: Thanks, RhodiumToad. I'm in no hurry, so I'll just put it in my todo list for now! RhodiumToad: sxml is a bit hemipygian in places *: chrislck watching janneke chrislck: go wingo fnstudio: hi all, i'm using emacs+geiser+readline and i'd like to remap my keys so that / bring me back/forth in my history fnstudio: which is the usual behaviour you get on the cli fnstudio: whereas, if i understand it correcly, the default in the geiser repl is M-p/M-n, respectively fnstudio: is there a specific reason why i might *not* want to remap them over up/down? fnstudio: if not, any pointer on how this can be done? mwette: IIRC in geiser you can do C-/ (or is it S-/) ? fnstudio: mwette: let me try fnstudio: mwette: hm, nope, that doesn't seem to work here dsmith: It's been a while, but I remember is was better to not enable readline while using geiser. dsmith: So this is more of an emacs question. But look into local-set-key (emacs function) chrislck: fnstudio: you can use M-p M-n dsmith: As in C-h f local-set-key fnstudio: dsmith: yeah, the fact i don't find anything on the web re that remapping makes me suspicious, as there might be some reason why i should not be going that way... mwette: fnstudio: also, I set up things so that in geiser readline is not enabled fnstudio: chrislck: yes, i know, but i was wondering if there might be a way to use up/down instead dsmith: It's pretty normal in emacs to use M-p and M-n for moving though history in most interavtive modes. mwette: C- works for me dsmith: For example, that's the bindings for erc mwette: and I don't find anything in my .emacs to set it up dsmith: fnstudio: Type C-h k C- and see what it's bound to. fnstudio: dsmith: i see, consistency is a good reason for me to get used to it fnstudio: dsmith: cool, that helps, let me try that dsmith: You can rebind anything you want. It's emacs! mwette: mine is bound to (comint-previous-input ARG) fnstudio: mwette, dsmith: it seems mapped to `backward-paragraph` fnstudio: and it says "found in global-map" fnstudio: ooops dsmith: fnstudio: Make sure you run that while in geiser-mode fnstudio: yeah that was me... it's in my init file :) fnstudio: ok, that explains everything fnstudio: dsmith, mwette: thanks so much, that solves my problem i think - `C-h k` was super helpful fnstudio: thanks both! dsmith: np! dsmith: Emacs is a huge beast. You can spend decades learning stuff and still be surprised by new things. mwette: exactly mwette: I've tried to find out how to add #! ... !# as comment block but failed. manumanumanu: rlb: That seems like something that should not work :D But if it did work in 2.2 it is technically a regression. rlb: manumanumanu: looks like it did. And I suppose it could just be considered say undocumented behavior, but the define-generic description in the manual perhaps suggests otherwise. rlb: e.g. " If symbol was previously bound to a Scheme procedure (or procedure-with-setter), the old procedure (and setter) is incorporated into the new generic function as its default procedure (and setter)." manumanumanu: oh. manumanumanu: I had no idea. rlb: I've worked around it, but perhaps it's worth a bug report... manumanumanu: That indeed seems like a regression dsmith: rlb: There were some changes in goops. iirc something about no longer able to dynamically change things by default. (Still possible, but you need to ask for it some how). dsmith: The wingo knows! rlb: (This conversation is giving me a bit of deja-vu. I have this vague idea I may have been poking at something a bit similar when 2.2 was released.) drakonis1: the guile 2020 talk is nice drakonis1: suggests that what's next for guile is stealing as many racket features as possible drakonis1: https://video.fosdem.org/2020/AW1.125/guile2020.mp4 rlb: I take it back -- that didn't work in 2.2 either. rlb: (Accidentally tested my "test fix" with 2.2 rather than the broken version.) dsmith: drakonis1: Ah cool! But they cut off the screen! drakonis1: Narrator: they have not drakonis1: it cuts into the screen later dsmith: I see! mwette: for #lang see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30094; my 2.2.4 patch worked as-is on 3.0.0 drakonis1: neat. drakonis1: that rules. drakonis1: slowly walk towards absorbing racket into it mwette: not tested on 3.0.0 yet -- building now -- but no rejected patch fragments rlb: filed a bug. drakonis1: cool talk though mwette: my #lang patch test failing in 3.0.0 -- needs work -- does not look bad rlb: So is there a normal way to avoid the undefined variable warning if you use say foo in a scheme module and foo is being defined by a shared lib that it loads? rlb: In 2.2 you could just (define foo #f) (load-lib) and then use foo, to silence the warning, but in 3.0, foo stays #f. mwette: rlb: maybe (define foo (make-parameter #f)) and have load lib do (foo ) mwette: Then of course you need to reference using (foo) all the time. mwette: but not sure that works either, because any new thread will start with foo as #f mwette: rlb: Do you have "#:declarative? #f" in your define-module form? mwette: I think the "#:declarative? #f" is what you want. Look at section 6.20.9 in the Guile 3.0.0 manual rlb: mwette: thanks, though that doesn't appear to affect the warnings. I assume the warnings might be because the shared lib isn't being loaded at compile time, so guile doesn't know about the definitions the shared library is going to establish at runtime. So I did try putting the load-extension inside a suitable eval-when, which did in fact fix the warnings for one shared lib, and caused the other to crash. That's when I thought I rlb: should ask what the preferred way is to handle this case before any further guessing. mwette: The compiler just assumes foo is always #f and so expands references to foo in your code as `#f'. https://www.gnu.org/software/guile/manual/html_node/Declarative-Modules.html#Declarative-Modules mwette: rlb: just try adding "#:declarative? #f" in (define-module ...) rlb: I did -- no effect. rlb: I still see all the undefined warnings. rlb: (unless I did i wrong -- I'll try again later) rlb: Oh, wait. *: rlb may have done the opposite of what he intended... mwette: rlb: it says you can also reload the module after (load-lib) rlb: wingo: is this expected? rlb: $ nm -D /usr/lib/x86_64-linux-gnu/libguile-2.2.so.1 | grep scm_sym_unquote rlb: 0000000000127300 B scm_sym_unquote rlb: $ nm -D /usr/lib/x86_64-linux-gnu/libguile-3.0.so.1 | grep scm_sym_unquote rlb: $ rlb: rlb: i.e. no scm_sym_unquote in 3.0? rlb: No current preference either way -- I can work around it, but that's what caused my load-extension to start failing mysteriously. rlb: So just thought I'd ask if we meant to do that. jcowan: When I did one of those tests, what seemed to paritcularly impress the judges was that I had included a README file. rlb: In a module that dynamic-link's some code and then uses some of the SCM_DEFINEs from the shared lib, 3.0 now gives a bunch of "possibly unbound variable" warnings. Is there a typical way to handle that? rlb: s/link's/links/ wingo: rlb: https://git.savannah.gnu.org/cgit/guile.git/commit/?id=228ae549ca651d9e9e7a7b02d282d0408bd6c9e6 pinoaffe: wingo: I mean, aren't function arguments already (part of) a single data structure? akhetopnu: Hello. I'm trying to install guile 3.0 and I can't. The command on the download page https://www.gnu.org/software/guile/download/ is not working. I'm specifying `guix install guile@3.0` and it says 'package not found for version 3.0'. I tried some bugfix versions 3.0.1 to 3.0.5 but they couldn't be found either. akhetopnu: I did `guix pull` and the news part says guix is now running on guile 3.0 akhetopnu: `guix search guile` shows only 2.2.* akhetopnu: (and one 1.8*) w96k: Hello. How to get current directory in guile? w96k: I tried to use (system "pwd"), but it returns a code status and I need stdout w96k: Sorry for such newbie question lloda: w96k: getcwd lloda: https://www.gnu.org/software/guile/manual/html_node/Concept-Index.html & search 'directory' lloda: it would be cool if ,a / apropos searched docstrings lloda: maybe another command tho w96k: Thank you. I tried to find it myself, but failed (: lloda: np, ask any questions you have lloda: you can also do it with system pwd with like (read (open-input-pipe "pwd")) dsmith: rlb: What was it you were doing that you discoverd the missing symbols in libguile*.so ? dsmith-work: Happy Friday, Guilers!! ioa: good morning rlb: wingo: hah, thanks. rlb: dsmith: just had a shared lib that was creating/returning a unquoted data structure from a SCM_DEFINED function, i.e. scm_cons_2(scm_sym_unquote, x, y); dsmith-work: rlb: Ahh. mwette: xb *: chrislck wonders why call-with-values is part of scheme at all. so unschemy. wingo: chrislck: what do you think (call/cc (lambda (k) (k 1 2))) should evaluate to? *: davexunit was just using call-with-values this morning (first time using guile in months, 3.0 wooooooo) chrislck: uh oh... wasn't trying to wake up the boss. *: chrislck uses srfi-1's partition... it'd be easier to return (cons yes-values no-values) imho lloda: you don't need to use call-with-values chrislck . Use srfi-71 (better) or srfi-8 davexunit: I wonder what the performance implications of using data structures explicitly are. I have this assumption that it would be more costly than the language handling multiple return values. davexunit: I don't know if that is true, of course. davexunit: but my preference would be to avoid allocation whenever possible. davexunit: and using cons is definitely allocating. wingo: davexunit: is it? :) ,c (match (cons 1 2) ((a . b) (+ a b))) wingo: compiles to 3 davexunit: I was waiting for this :) wingo: i am sympathetic to "just use data structures" but then the logical conclusion is that function arguments should also be a single data structure davexunit: wingo can have little a bait wingo: :) davexunit: dusted off some code last night. before burn out set in a few months ago I had written some openal, libvorbisfile, libmpg123 bindings for a love2d-like audio system. still works with guile 3. phew. dustyweb: hi davexunit dustyweb: very cool :) davexunit: hey dustyweb dustyweb: hi davexunit ! dsmith-work: Thursday Greetings, Guilers rlb: dsmith, wingo: found the dynamic-link/load-extension problem w 3.0.0, but don't know *why* yet. A shared lib that just has a SCM_DEFINEd function that returns scm_sym_unquote will cause the ENOENT load failure. I'm guessing it's because it can't find the symbol, and wonder if the visibility/location of that changed? rlb: "worked fine" in 2.2.6 *: rlb wishes the loader had a way to tell me what was missing (or he knew about it, if there is one)... rlb: "already is one" dsmith-work: Yeah, sure would be nice to differentiate "file not found" and "symbol not found". nly: hi rlb: dsmith-work: hmm wonder if it's coming from dlopen(), and if so, if we're not using dlerror(), if that might produce something more details... (Not deeply familiar with those apis/behaviors.) rlb: dsmith-work: maybe I'll test that later. rlb: dsmith-work: looks like that *is* the dlerror() output (via dynl.c), so unsurprisingly, it might require changes to libdl or similar. dsmith-work: rlb: Sounds familiar. I looked into it at one time. dsmith-work: The sterror messges are mostly right most of the time. But sometimes not. dsmith-work: Trying to mount sometthing when the kenrel wasn't configured for that filesystem returns a misleading message. dsmith-work: Like the permissions are wrong, or file not found. jcowan: In the Mesa programming languages, function arguments are the elements of an anonymous record, and returned values are the elements of another anonymous record. jcowan: so let f = foo(a, b) where foo says return(c, d) and you can use f.c and f.d to get the values. jcowan: In Chicken, returning multiple values is no more or less efficient than returning a single value, because it is just calling the continuation with multiple arguments. Similarly, invoking a call/cc procedure is the same as invoking any other procedure, with no special stack munging required. *: sneek yawns lfam: Do pay attention sneek daviid: str1ngs: sneek: Welcome back daviid, you have 1 message. sneek: daviid, str1ngs says: thanks for the reply. no rush on gtk-css-provider-load-from-data I just wrote a typlelib function types supported by g-golf for now. thanks for the details. daviid: str1ngs: I hope to work on this soon, but I have been and still am 'less available' these days, due to a move - which takes an awful lot of time ... - but I hope to be back to 'normal' working hours soon, let's see :) daviid: str1ngs: I really want to solve this 'missing array type' in g-golf, obviously, and i will be nice to count on you to test :) str1ngs: daviid no problem, because I have still have a nomad typelib I can work around small issues no problem. also I have this patch for guile-cairo. it might be of interest to you. http://paste.debian.net/1128080 str1ngs: daviid the patch helps when using guile-cairo with g-golf. here is an example http://paste.debian.net/1128081 str1ngs: daviid http://paste.debian.net/1128159 is a working example. wrong paste sorry daviid: str1ngs: ok, i hope wingo will find some time to answer soom - I really can't look at this now, but thanks, will try to look at this later ... daviid: str1ngs: did you look at how thigs are passed between guile-cairo and guie-clutter? str1ngs: not really because I'm only using g-golf with nomad. the main take away it g-golf and guile-cairo seem compatible with this patch. str1ngs: s/it/is daviid: ok daviid: str1ngs: it would be nice to port the clock exaple I wrote using guile-clutter - but using g-golf ... str1ngs: I'll just email to guile-user for posterity. I ended up using graphviz instead because it was better for mapping class hierarchy. daviid: ok str1ngs: do any g-golf clutter signals take CairoContext *cr at all? daviid: but I wish I can port all my clutter examples using g-golf ... str1ngs: actually do you have any working g-golf clutter examples. maybe I can port my cairo example to clutter daviid: str1ngs: have to look at my 'old' code str1ngs: old code as in g-golf git history? daviid: str1ngs: i don't, i have guile-clutter examples, which I posted a while ago str1ngs: last time I used clutter was when I make a image viewer that worked on desktop and android. yet android daviid: str1ngs: no, guile-clutter, not g-golf (yet) daviid: str1ngs: here are the examples: str1ngs: I can just translate a C clutter example to g-golf. the API is easy to reason daviid: https://www.nongnu.org/grip/learn.html daviid: str1ngs: no C pleas, pure scheme only daviid: all these old examples are pure scheme code daviid: using guile-clutter str1ngs: the examples are not clickable are the in the source tree? str1ngs: they* daviid: str1ngs: no, need to build ... daviid: str1ngs: but you could just read the code and see if it works with g-golf str1ngs: okay no problem I will clone. but first I need to see if any of the clutter API takes CairoContext *cr. if so my patch should work for that too daviid: (I can do that to of course, but i'd rather complete g-golf ...) str1ngs: understandable daviid: str1ngs: guile-clutter is difficult to install, i warn you, but if you follow the steps, very well, then it's ok ... becasue it neeeds an old version of clutter, the cherry pick a patch ... and unfortunetaly, no guixers ever build a package for guix ... daviid: str1ngs: https://www.gnu.org/software/guile-gnome/clutter/ daviid: str1ngs: but you might as well skip guile-clutter and wite the example using g-golf str1ngs: okay but is it worth installing guile-clutter. can't I just the code as reference and port say the clock to g-golf? str1ngs: okay yes, we think alike I see :) daviid: str1ngs: i'd try to 'port' to g-golf by just reading the code and write it using g-golf ... daviid: all these are very small examples ... str1ngs: right no problem. and I've used clutter before so not that hard to reason. it mainly uses lower glib primitives then gtk really. with actor model daviid: http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/clutter str1ngs: great thanks will test this out. daviid: when sing g-golf, in order to see the stage on the screen, you need to set an env variable, let me find it for you daviid: str1ngs: the clock is the only one that uses guile-cairo - i'd like to see what you think, and why you need to patch guile-cairo ... str1ngs: its possible the patch is not needed, but I did'nt see anything that exposed converting CairoContext *cr. to guile-cairo's smob SCM daviid: str1ngs: you need to set this env var daviid: export CLUTTER_BACKEND=x11 str1ngs: noted thanks str1ngs: maybe I can get https://github.com/clutter-project/clutter-android working again then we can use g-golf on android :) daviid: str1ngs: librem 5 phone yes, but android i doubt we can str1ngs: I was thinking of getting a pinephone might be a cheaper alternative. daviid: str1ngs: i really want to invest in debian based phone daviid: i don't want 'another os' daviid: or guixsd phone daviid: i'm sure the guix folks will port guix to the librem 5 phone daviid: just a matter of time - meanwhile, i need to copete g-golf and get it stable ... str1ngs: ise librem 5 the best option for debina? str1ngs: der debian* daviid: str1ngs: i think so, but not a specialist, by far daviid: what is the pinephone os? daviid: i don't want android, and i don't want firmware, so i think th e oly option today is the librem 5 phone, but happy to be proved wrong ... str1ngs: pinephone is pretty open. and should run Debian Mainline based on the wiki str1ngs: it's just not as expensive hardware as librem 5 daviid: ok daviid: but does it need firmware? str1ngs: https://www.pine64.org/pinephone/ str1ngs: it seems pretty open, but you have to really read the fine print daviid: str1ngs: actually, clutter 'scripts' examples are here daviid: http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/clutter/examples daviid: but each depend on 'upper dir' series of modules ... daviid: i'll try to port the bouncer str1ngs: daviid: do we need clue for this? daviid: str1ngs: yes, all depend on clue daviid: *all grip clutter examples depend on (grip clutter examples clue) str1ngs: okay, let me first try a simple clutter application with cairo. just basic. then see what I can to do create an example using clue. but this relies alot on porting grip to g-golf yes? daviid: str1ngs: yes, i agree with you, and first, just a stage with s simple exmaple that do not even use cairo daviid: might be a start daviid: str1ngs: here out to get a stage on screen drakonis: g-golf? drakonis: ah nevermind that daviid: str1ngs: https://paste.debian.net/1128162/ daviid: drakonis: fwiw, https://www.gnu.org/software/g-golf/ drakonis: i was wondering what it was because i spotted its inclusion on nomad drakonis: neat that there's two lisp browsers now daviid: drakonis: nomad is 'just' an example, g-golf should allow you to build any modern gnome app using guile scheme, any drakonis: rad. daviid: str1ngs: here is a clutter stage with two basic signals ... https://paste.debian.net/1128163/ drakonis: nomad needs a pretty page now drakonis: next-browser looks very presentable daviid: drop this any where, i.e. clutter-stage.scm, then chmod a+x clutter-stage.scm, then ./clutter-stage.scm daviid: have to go, bbl daviid: str1ngs: before ileave :), i added support for motion events, two days ago ... gdk-event-motion>, gdk-event-motion:time, gdk-event-motion:state, gdk-event-motion:coords ... see the log and the doc, maybe yu'd like that in nomad, don't know ... str1ngs: drakonis: thanks for the feed back we are working on a website. could use some help with artwork and graphic design though. this is the current site though it's more of a blog then a site right now. https://www.nongnu.org/nomad/ drakonis: you might want to take a bit of inspiration from guile, guix and next's pages str1ngs: drakonis: and to be fair nomad is still very alpha. so a website is pretty premature drakonis: they're surprisingly presentable. drakonis: of course. str1ngs: I like guil's artwork etc. but my primary focus is developing nomad. str1ngs: guile* drakonis: right-o. str1ngs: our current alpha release does not even contain g-golf so we have a ways to go yet. drakonis: a lot to look forward to, then. str1ngs: sneek later tell daviid, thank you I would start with this example. sneek: Will do. rlb: Anyone seeing dynamic-link "file not found" errors in 3.0 as compared to 2.2? So far I'm not sure what's causing it, but commenting out a single call inside a function (that's not called via the init function) "fixes" the problem... (this is via load-extension if it matters). lloda: rlb: I use load-extension and haven't seen this lloda: it's funny that Guile has 3 different hash table implementations jcowan: lloda: Your average large C program probably has 10 hash-table implementations, all more or less buggy (see Greenspun's Tenth Rule) lloda: heh. nly: (define *assoc* `((nly . something))) nly: (assoc-remove! *assoc* 'nly) nly: $10 = () nly: *assoc* lloda: still I think Guile's native should be the best of them all, and that doesn't appear to be the case. nly: $11 = ((nly . something)) nly: i thought things ending with a bang! will set! stuff lloda: b/c it makes a lot more sense to pass hash/assoc when you create the table like rnrs does and not when you look it up like Guile's native hashtables do lloda: nly: they might, but they don't necessarily do lloda: srfi-1 explains this I think lloda: 'It is allowed, but not required, to alter cons cells from the alist parameter to construct the result' lloda: i.e. the result of the function is the return value, not the modification of the parameter nly: thanks nly: trips me up all the time. lloda: if it's the other way (result through the argument) they would return unspecified, but I do agree it's not obvious nly: welcome veere nly: veere: help nly: ah, crap i wanted to show you the bot lloda lloda: drat nly: lloda by any chance do you know about sneek's source? lloda: I don't nly: oh, no prob nly: thanks for the help lloda: yw! jcowan: lloda: There is no particular reason why Guile's original hash tables should be better than what came along later; on the contrary. lloda: they should be updated or replaced so they are better str1ngs: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs nly: hi dsmith nly: do you know the whereabouts of sneek's sources? dsmith-work: {appropriate time} Greetings, Guilers dsmith-work: nly: It's a port of the old sarahbot in #scheme dsmith-work: nly: No public repo anywhere. dsmith-work: Uses bobot++ for the irc heavy lifting. nly: dsmith-work: thanks nly: would you like to make it public? :P dsmith-work: nly: I'd like to, but there is a lot I'd need to do. Like figure out how to install it and stuff. dsmith-work: I don't even remeber how I created the db. I've just been copying it around for years. dsmith-work: (uses sqlite. Not 3, the older one) nly: just toss it over the fence, haha. Janneke was also looking for it. nly: that would be helpful, i think dustyweb: wingo: btw, another crossover episode if you're interested (and it's not too much a distraction). I plan on porting Goblins to Guile once I get some more stuff done in the reference (Racket) implementation so I can get Racket <-> Guile programs speaking through it. dustyweb: in general I think it shouldn't be too hard to get them communicating dustyweb: and ocap isolation may (mayyyy) be a bit easier in guile mostly, with one exception possibly dustyweb: one thing that I pshaw'ed early on in Racket and as I went more into ocap stuff I'm like "oh dang this is important" from Racket is immutable cons cells dustyweb: since cons cells are everywhere in scheme programs, it's an easy place to introduce surprises. but it seems like retrofitting immutable cons cells into guile in a clean way could be hard. wingo: dustyweb: in your context, it not sufficient to just not expose set-car!, reverse!, etc? dustyweb: wingo: it might be sufficient I suppose dustyweb: actually it may be fine. wingo: i mean you don't expose pointer->scm either, right? dustyweb: wingo: right that's true wingo: there's always unsafe primitives below dustyweb: good point! dustyweb: ok, that alleviates one thing I've been mulling over then :) wingo: see docs for https://www.gnu.org/software/guile/manual/html_node/Sandboxed-Evaluation.html for a discussion dustyweb: wingo: yeah I've read it a few times :) wingo: :) dustyweb: I guess I just wasn't thinking very clearly about the restricting those as "low-level primitives" dustyweb: when phrased that way, obviously that's correct. dustyweb: anyway, I plan on doing the port not too far in the future but I'd like to get the main reference implementation in a nice place so I don't have to keep adjusting two things in parallel dustyweb: if that makes sense dustyweb: I have learned a lot from the ocap community in the last couple of years dustyweb: and would like to bring that back over to guile-land dustyweb: wingo: I also don't remember if I said it to you directly, but I think Guile is in a great place right now, and 3.0 is really thrilling. dustyweb: really excited/happy with the stuff that's happening. dustyweb: so thanks for keeping at it wingo: tx! drakonis: what's next for guile now that 3.0 is out? RhodiumToad: fixing the bugs? :-) drakonis: i mean, feature wise, after fixing all the bugs drakonis: cant fix them all but can sure as hell try tho dsmith-work: Oo. I'd like to eventually see native compilation. Binary ELF executables. dsmith-work: How cool would that be! jcowan: It would simplify deployment, but there are better ways to approach that. Otherwise AOC has no real advantages over JIT, and sometimes it is disadvantageous. drakonis: static typing? rlb: lloda: thanks -- and yeah, it's fine for one of my shared libs, but not the other. rlb: ...the one that fails fails with the "file not found" error -- though I can see that it does open the correct shared lib, mmap some bits, and then move on. rlb: If I comment out the one function call (inside another function) it's fine. I wondered if maybe I was missing a -lfoo that's now needed but guile-config doesn't supply -- didn't see anything obvious via ldd, but plan to revisit. dsmith-work: rlb: Try under good old strace perhaps? rlb: hah, that's where I saw the open/mmap, etc. rlb: i.e. it does open the right shared lib, and then abandons it. dsmith-work: Hmm. rlb: I think that function call is an indirect internal recursion, but no idea why that would matter yet... dsmith-work: There is a long standing issue with shared libs. Even though the file is found, if there is an error in the init func (or something like that) it is still reported as "not found". rlb: Thanks -- I'm pretty sure that function wasn't being called by the init function (I'd pared it down to almost nothing while testing), but I'll double check. dsmith-work: I've seen that on the lists and here several times. dsmith-work: The message is the confusing part. And IIRC it's not a Guile message. rlb: Imagine it's just the sys_errlist (perror) value for dlopen or something -- though I suppose we could consider eventually (if we don't already) having a way to ask guile to at least be more verbose wrt load-extension, etc. if we might be able to say something more helpful. dsmith-work: apteryx: Hey daviid: str1ngs: wrt 'later tell daviid' msg, (a) indeed g-golf is still missing an implementation for arrays both wrt gi-argument (which is the use case you posted, gtk-css-provider-load-from-data) and gvalue (that would be for signals and callback ...) I need to work on this sneek: Welcome back daviid, you have 1 message. sneek: daviid, str1ngs says: . Hello daviid when you have time can you take a look at why this is not working? http://paste.debian.net/1127946. I suspect Warning: Unimplemented type - array;: (c -1 #f 1 uint8) might be a hint? also can you confirm when passing SCM strings to functions/methods that take say const *char they are NULL terminated? daviid: str1ngs: wrt to the second question, whenever g-golf passes a string to a gnome lib you are using, it always use string->pointer (which yes, 'produces' null terminated strings str1ngs: sneek later daviid. thanks for the reply. no rush on gtk-css-provider-load-from-data I just wrote a typlelib function types supported by g-golf for now. thanks for the details. str1ngs: sneek later tell daviid. thanks for the reply. no rush on gtk-css-provider-load-from-data I just wrote a typlelib function types supported by g-golf for now. thanks for the details. sneek: Will do. str1ngs: sneek: bot snack str1ngs: o.O str1ngs: sneek: botsnack sneek: :) lfam: sneek is picky sneek: Welcome back lfam, you have 1 message. sneek: lfam, NieDzejkob says: I've just submitted a patch to update Go to 1.13.6: https://debbugs.gnu.org/39317 str1ngs: lfam: sneek is like a cat. won't take just any old botsnack :) lfam: Yes ;) wingo: moin erkin: Moin erkin: Arch packagers are really dragging their feet about updating the Guile package. lloda: pushed the rl_get_keymap thing wingo: cool lloda: I want to remove array-handle from vectors.c lloda: it's low hanging fruit lloda: technically incompatible, but only for cases that shouldn't be supported anyway wingo: incompatible changes should go on a branch for 3.2 i think lloda: do you have ideas for 4.0 :-) wingo: lloda: for 4.0, dunno :) i have a list of things somewhere :) Blackbeard[m]: Hi guile ٩(◕‿◕。)۶ str1ngs: would compiling to wasm be a good candidate for 4.0? str1ngs: wingo: I have a small patch for guile-cairo http://paste.debian.net/1128080 primary for using guile-cairo from g-golf. would this be worth submitting to guile-user? str1ngs: wingo: this is an example g-golf use case for reference http://paste.debian.net/1128081 apteryx: is there anything like in Python to construct strings like 3 * " " == " " in Guile? apteryx: perhaps (ice-9 format) ? chrislck: (string-join (make-list 3 " ") "") apteryx: chrislck: thanks! rlb: guile-3.0 3.0.0+1-1 uploaded to debian NEW -- won't be in unstable until it's evaluated by the ftp-masters. dsmith`: Yey! dsmith: Yey! chrislck: o/ yay rlb: I suspect it might end up being somewhat longer before it makes it into testing -- anticipate arguing with some of the buildds (i.e. arch-specific build/test issues), but we'll see. wingo: moin sneek: wingo, you have 1 message. sneek: wingo, dsmith says: https://github.com/BurntSushi/wingo rlb: So I'm back to wondering if this might be a bug in "promotion to generic", or expected behavior. It works if the first define is changed to a define-method: rlb: (use-modules (oop goops)) rlb: (define (foo) 0) rlb: (define-method (foo x) 1) rlb: (display (foo)) (newline) rlb: (display (foo 1)) (newline) rlb: rlb: Crashes as is. wingo: bugs are possible wingo: besides the class redefinition thing, there was no intended change to goops or generics in 3.0 wingo: relatedly, it would still be a great thing if someone wanted to implement the generic function dispatch MOP :) lloda: guile-readline/readline.c uses rl_get_keymap_name and on OS X libreadline is an alias to libedit and that function isn't provided spk121: wingo: if in Guile 3.0 you are requiring C99, I wonder if it could be a good opportunity to shrink configure.ac by presuming headers/functions required by C99 lloda: is it enough to add rl_get_keymap_name to AC_CHECK_FUNCS([rl_get_keymap]) in acinclude.m4? I don't understand the comment above. wingo: lloda: dunno, give it a go :) wingo: spk121: could be a good idea! i am not sure what exactly might need to change tho fwiw wingo: patches welcome of course wingo: some of those tests might be brought in by gnulib fwiw lloda: im on it spk121: wingo: what made me think of it was when I saw a tests for complex.h and fenv.h scroll by spk121: lloda: you'll probably need to stub out the call to rl_get_keymap_name in init_bouncing_parens in guile-readline/readline.c lloda: I could just replace the check for rl_get_keymap for rl_get_keymap_name and then use HAVE_RL_GET_KEYMAP_NAME in readline.c lloda: it's weird that libedit provides ...keymap and not ...keymap_name dsmith-work: apteryx_: re python 3 * " "; (make-string 3 #\space) dsmith-work: apteryx_: Also (xsubstring " " 0 3) dsmith-work: sneek: later tell apteryx Re python 3 * " "; see (make-string 3 #\space) or (xsubstring " " 0 3) sneek: Okay. rlb: wingo: I'm not sure it's a regression -- i.e. I think 2.2 might do the same thing (not positive yet). I was mostly interested in what was intended there. i.e. the docs do describe define-method automatically promoting an existing procedure to the generic default, and that's worked I think, so the question is, should it work in this case? dsmith-work: Monday Greetings, Guilers stis: Darn, found an annoying bug in guile 3.0 stis: posted it to the list stis: sneek: where is bugs stis: sneek: botsnack sneek: :) stis: sneek: where is bugs stis: sneek where is bugs dsmith-work: sneek: bugs? sneek: From what I understand, bugs is send reports to bug-guile@gnu.org, and see bug reports at http://bugs.gnu.org/guile dsmith-work: sneek: where? dsmith-work: Good str1ngs: sneek: later tell daviid . Hello daviid when you have time can you take a look at why this is not working? http://paste.debian.net/1127946. I suspect Warning: Unimplemented type - array;: (c -1 #f 1 uint8) might be a hint? also can you confirm when passing SCM strings to functions/methods that take say const *char they are NULL terminated? sneek: Got it. lloda: https://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=c11fb23fc2e060b434c9c490636c12907b8ccc15 lloda: fixes the libreadline thing on os x for me on 10.14 lloda: if someone can test on 10.15 that would be sweet lloda: I tested by removing libreadline from my macports install and building without --with-libreadline-prefix lloda: readline still works and all lloda: not sure about the missing feature tho (paren bouncing? vi?) I don't think I've ever used it civodul: lloda: the comment says "Check for rl_get_keymap and rl_get_keymap_name." but it only checks for the latter, right? lloda: yes lloda: I'm assuming that one implies the other lloda: it seems a waste to check two functions cause configure is already very slow lloda: dunno lloda: I can make that clearer in the comment civodul: yeah civodul: apart from that it LGTM! lloda: ok lloda: I'll fix & push tomorrow :-) jcowan: I blazon my favorite two logos thus: Argent, in fess dexter the word "Guile" sable, sinister a lower-case lambda gules; and Sable, in fess dexter the word "Guile argent, sinister a Greek lower-case lambda Or. mwette: b dsmith: sneek strace? dsmith: sneek bugs? sneek: I've heard bugs is send reports to bug-guile@gnu.org, and see bug reports at http://bugs.gnu.org/guile apteryx: Why isn't the source expression matching the pattern here?: (let-syntax ((mtest (syntax-rules () ((_ (n s) ..1) (list n ..1))))) (mtest (1 2) (3 4))) apteryx: changing ..1 to ... makes it work, but I thought ..1 was same except it ensured at least one argument were present rather than potentially none terpri: apteryx, ..1 is just a regular pattern variable in syntax-rules/syntax-case apteryx: ah right. I was reading the doc of Pattern Matching (ice-9 match) and somehow thought it applied here. apteryx: thank you! gnufr33d0m: I can't seem to get rid of this message guile: warning: failed to install locale gnufr33d0m: I'm trying to build the haunt example gnufr33d0m: https://paste.gnome.org/p3kxdgul5 gnufr33d0m: how do I set the locale? I'm running PureOS and GUIX package manager Blackbeard[m]: gnufr33d0m: hey Blackbeard[m]: That's more of a #guix channel question, but give me a second. I'll send you the solution Blackbeard[m]: gnufr33d0m: here https://guix.gnu.org/manual/en/guix.html#Application-Setup Blackbeard[m]: Make sure to do that from your user after you instal Guix lispmacs: hi, I trying to pass a scheme complex number to a function which takes a "_Complex float" gnufr33d0m: thanks, I just tried that lispmacs: there doesn't seem to be a scm_to_complex_float procedure Blackbeard[m]: gnufr33d0m: hope it helps :) but the warning may not go away. Just ignore it lispmacs: I could extract the floating point numbers from the complex and then build a _Complex float gnufr33d0m: I still can't build the haunt sample it errors out Blackbeard[m]: lispmacs: I can't help with that :( spk121: gnufr33d0m: what if you try 'LANG=C haunt build'? lispmacs: but I can't figure out how to build a _Complex float from a pair of floats lispmacs: does anybody know gnufr33d0m: yes, that worked? spk121: lispmacs: do you mean in Scheme? or in C lispmacs: spk121: I'm trying to pass a value to a C function that requires a "_Complex float" value lispmacs: but I don't know how to convert from a SCM complex number object to a "_Complex float" value spk121: gnufr33d0m: OK. what do you get when you type 'env | grep LANG' from the command line? gnufr33d0m: LANG=C.UTF-8 gnufr33d0m: GDM_LANG=C.UTF-8 lispmacs: oh wait, I just found a "CMPLXF(x, y)" macro in the complex.h header lispmacs: I'll try that spk121: lispmacs: that's a macro. If you need a real function for FFI, go with __builtin_complex spk121: gnufr33d0m: could you be missing some sort of basic locale information package for guix? lispmacs: spk121: okay, I'm not using FFI, but thanks. Embedded guile spk121: lispmacs: ok then, CMPLXF is definitely what you need lispmacs: ack, keep forgetting those stupid C semicolons gnufr33d0m: thanks for the help, any ideas where to look to fix spk121: gnufr33d0m: sorry, dunno str1ngs: sneek: later tell gnufr33d0m if you are on foreign distro. you also have to install the glibc-locales into root's current-guix profile. like so guix install -p .config/guix/profile glibc-locales . then you need to restart guix-daemon. assuming you are using systemd . sudo systemctl restart guix-daemon . sneek: Will do. str1ngs: sneek: later tell gnufr33d0m ~root/.config/guix/profile to be more precise sneek: Okay. rlb: Anyone know if this supposed to be an error in 3.0 (was "fine" in 2.2): rlb: (use-modules (oop goops)) rlb: (define (foo x) #t) rlb: (define-method (foo) #t) rlb: rlb: In 3.0 we have "# is not a valid generic function" rlb: Hmm, maybe something else is going on -- nevermind for now... *: mwette has made a little progress w/ SElinux *: mwette posted to wrong channel str1ngs: where do we find such creative people to make logos and art? The young gnu and with the robot on the guile website is pretty cute. rlb: sneek: later tell civodul I suspect my misunderstanding is that I was thinking in terms of clj dynamic vars, where a sub-thread (often) sees the exact same "fluid" as the parent, but in guile, the current *value* of the fluid conveys, not the actual fluid? sneek: Got it. zap`: str1ngs: I really like guile web page too. I think sigrazil made very cool designs nly: hi str1ngs: hello nly rlb: (hmm, actually I think I was wrong about an aspect of how clj dynamics work too as compared to fluids...) civodul: rlb: futures are executed by threads from a pool (it's "work stealing") that does not restore the dynamic extent where the 'future' or 'touch' calls appear civodul: so you need to explicitly capture/restore bits you care about d4ryus: hmm, could it be that there is no way to connect to an abstract unix socket from scheme? unix(7) states that sun_path[0] has to be a null byte and it seems (from what i read in socket.c (scm_connect)) that this would not work as it converts the scheme path (string) to an empty string due to the leading \0... manumanumanu: jcowan: building on mac os x isn't fun. I just gave up and rewrote the formula for guile2.2 which works. This seems to be a general problem with building on mac os x though, as I have had to do it with quite some packages. spk121: . jcowan: Thinking further on sirgazil's proposed logos, I now favor row 3 on a white background, and row 1 on a black background. rlb: civodul: thanks I think I realized that -- what I hadn't thought hard about yet was the relationship between a fluid in the parent thread and child. I'd just vaguely assumed they might share the same fluid but that's not right, and not even what I'd want (in the case I care about). rlb: And yeah, I fixed the issue with dynamic-state related bits. rlb: Thanks Jeanne-Kamikaze: Hello. I am trying to install the chickadee library, but it seems to fail to find the gl package. I downloaded and sudo make install'ed guile-opengl, which appears to place libraries in guile's system path, but chickadee is still unable to find them. Can someone please help? Thanks. Jeanne-Kamikaze: The output of: $ ls /usr/local/lib/guile/2.2/ccache Jeanne-Kamikaze: gl gl.go glu glu.go glut glut.go glx glx.go dsmith: Jeanne-Kamikaze: The usual trick is to run the command under "strace -efile". That will show where it's looking, and NOT looking! Jeanne-Kamikaze: It doesn't even appear to be looking for any path that contains "gl" Jeanne-Kamikaze: Found the path. Seems like guile on Ubuntu uses /usr/lib/x86_64-linux-gnu/guile/2.2 instead. drakonis: so, guile and guix should sign up for the google season of docs to further improve the docs drakonis: https://www.gnu.org/software/guile/docs/docs.html oh and this should be updated to point to guile 3 str1ngs: Jeanne-Kamikaze if you export GUILE_LOAD_COMPILED_PATH=/usr/local/lib/guile/2.2/ccache . does that help chrislck: rlb: nice! dsmith: hey dsmith: sneek: botsnack sneek: :) rlb: ...any known races wrt ice-9 future and touch? I'm seeing some odd behavior that might well be my fault, but also somewhat looks like it might be a race condition. rlb: (2.2.6 if it matters) lispmacs: sneek: help lispmacs: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs rlb: If I run this with 2.2.6 here in a loop, i.e. "while guile -s test.scm; do true; done" it fails fairly quickly: https://paste.debian.net/hidden/1fd52fd8/ rlb: Is that expected? rlb: I'd assumed that a future always started with a "clean slate" with respect to fluids, but it looks like sometimes it doesn't? rlb: civodul: any idea if this might be a bug or my misunderstanding? It crashes here with a value mismatch with 2.2 if you run it via guile -s in a loop. https://paste.debian.net/hidden/1fd52fd8/ civodul: rlb: i think you can't tell what dynamic extent the future will run in civodul: so in short, mixing fluids and futures is risky civodul: as in you don't know what value you're going to get civodul: BTW, Guilers: https://guix.gnu.org/blog/2020/guile-3-and-guix/ \o/ rlb: sneek: tell civodul even though the (touch (future ...)) is entirely within the with-fluids form? It looked to me (naively) like the second future's thread "remembered" the changed fluid value, which I thought might be due to the pool, i.e. re-using the thread. That might make sense if say threads capture the current non-thread-local-fluid values at creation and aren't influenced by subsequent changes to (in this case restoration of) rlb: the original fluid? sneek: civodul, rlb says: even though the (touch (future ...)) is entirely within the with-fluids form? It looked to me (naively) like the second future's thread "remembered" the changed fluid value, which I thought might be due to the pool, i.e. re-using the thread. That might make sense if say threads capture the current non-thread-local-fluid values at creation and aren't influenced by subsequent changes to (in this case restoration of) rlb: hmm, did I do that wrong? RhodiumToad: maybe you need "later tell ..." rlb: oh, hah. rlb: sneek: later tell civodul even though the (touch (future ...)) is entirely within the with-fluids form? It looked to me (naively) like the second future's thread "remembered" the altered fluid value, which I thought might be due to the pool, i.e. thread re-use. That might make sense if say threads capture the current non-thread-local-fluid values at creation and aren't influenced by subsequent changes to (say restoration of) the fluid rlb: value? sneek: Okay. dsmith-work: Happy Friday, Guilers!! rlb: indeed dsmith-work: rlb: How's 3.0 looking for Debian? rlb: We fixed the only issue I know about so far (test-repl), and so if nothing else comes up, I hope to upload 3.0.0+1-1 by the end of the weekend. dsmith-work: Yey! rlb: And then we get to argue with all the buildds :) rlb: Find out just how portable arch-wise 3.0 really is... nly: hi all jcowan: Building on MacOS (using brew for deps) is not working, per my last message to the list jcowan: also, Cygwin works but only with JIT disabled jcowan: rlb: ^^ rlb: jcowan: was that for me in the sense of arch/platform issue examples? jcowan: yes, for 3.0.0 jcowan: so I'd say not very portable yet rlb: Ahh, ok, thanks. nly: It's official. This year #nomad-browser intends to apply for and participate in Google Summer of Code. Guix being an organisation that has participated in Gsoc before, we'd be super grateful if anyone from Guix can guide us in the process. *: jcowan muses on the spectacle of a program with a huuuuuge ./configure file that runs only on Linux nly: I'll be sending out formal emails later *: jcowan takes the Chicken/Chibi view of autotools generally nly: rekado I'd be super happy if you can guide us. Not just through Gsoc, but in community building as well. jcowan: "Just type make. There is probably a sub-Makefile with the options for your OS and architecture, and we autodetect when possible (not yet on Chicken, but *this* close). If you want a totally OS/arch, write your own sub-Makefile and send it to us." jcowan: s/totally/totally nerw jcowan: s/nerw/new jcowan: arrgh Macbook Pro keyboard RhodiumToad: autotools has its uses RhodiumToad: separate makefile for os/arch only goes so far, once you start depending on stuff that changes between OS releases rlb: (...and there's bootstrapping new architectures, cross-compiling, etc.) rlb: I'm not sure how many harnesses handle that to the extent that the autotools do... rlb: (Of course that's not critical for a lot of projects.) jcowan: Well, exactly. That's why I made an explicit comparison with two other Schemes jcowan: In any case, it is not a separate Makefile, just a short section that writes various #defines into a suitable .h file. dsmith-work: It really is discouraging to have megabyte sized configure scripts for a C program with only a few hundred lines. dsmith-work: Just seems out of proportion. RhodiumToad: why would you have one that big? RhodiumToad: though there is a lot of boilerplate in the script, intended to work around shell issues and so on RhodiumToad: postgresql's configure is ~0.5 megs, and that's from over 80kb of configure.in dsmith-work: RhodiumToad: Oh, I'm probably exaggerating too much. dsmith-work: dales@debian:~/src/guile-sqlite$ wc configure sqlite.c dsmith-work: 14517 50200 436583 configure dsmith-work: 182 540 4577 sqlite.c dsmith-work: Yeah, not as bad as said. But still! RhodiumToad: probably most of that is shell boilerplate dsmith-work: Yep sirgazil: I'm not happy with Guile logo. I'm fine with the G in parentheses, but the expanded version of the logo bothers me. The overlapping of text and the closing parenthesis doesn't feel right. sirgazil: I propose these alternatives: https://multimedialib.files.wordpress.com/2020/01/guile-logo-proposal-2020-01-24.png sirgazil: They are not very original, though. jcowan: I don't think they have to be: there is no question of trademark here. jcowan: FWIW which is not much, I like the third row best. sirgazil: jcowan: me to (third row). sirgazil: *too apteryx: Am I expecting too much from syntax-rules in breaking down ellipsised patters such as used here: https://paste.debian.net/1127218/ ? apteryx: *patterns apteryx: any suggestions to make that a valid macro? :-) mwette: change (delete-file ...) (substitute...) to (begin (delete-file ..) (sub...)) apteryx: eh; thanks! I wasn't too far :-) manumanumanu: Macro hygiene problems can be beaten to death by simply throwing code and hours at the problem! manumanumanu: I ended up being so damn smart I almost peed myself. civodul: oops, sent bug to the wrong bug tracker: https://bugs.gnu.org/39251 chrislck: ok stupid question -> how do I install guile-3.0 on ubuntu. sudo apt install guile-3.0 doesn't find it. civodul: chrislck: we'd need to ask rlb but i suppose it's not available yet str1ngs: chrislck: you could manually build it. the dependencies are not that bad chrislck: true but not too comfortable with installing into /usr/bin yet, and guix is still too weird. I think I'll have to wait. str1ngs: chrislck: if you have sources enabled you can do something like apt build-dep guile-2.2. then do the GNU three finger salute. ./configure && make && make install. that should default to /usr/local/bin/guile chrislck: and how to swap back to guile-2.2 at will? civodul: chrislck: what makes Guix look weird to you? (honest question!) chrislck: because i'm just a script kiddie... don't have gray beard on unix conventions. I only know enough bash to apt update, enough emacs to hack scheme, and just about enough cmake/ninja to build gnucash. lloda: chrislck: I install to a local directory in my account. The only thing you need to do afterwards is call the right binary and set pkg-config so other packages look for your local Guile. lloda: you can have several versions installed. lloda: there is no need to mess with system paths. str1ngs: chrislck: if you pass --program-suffix=3.0 it will use guile-3.0 for the program name. str1ngs: to ./configure chrislck: all i know is guix environment --ad-hoc guile-next can make it available to run, but then can't find readline chrislck: appreciate all the help, but have very little need/time to learn guix properly. this is not my day job :) lloda: I don't use guix myself lloda: I've been building Guile from git since forever str1ngs: chrislck: you might need to do a guix pull str1ngs: and use guile3.0-readline with guile chrislck: str1ngs: O_o thx. not obvious! str1ngs: I think guix --ad-hoc guile-next guile3.0-readline should do the trick str1ngs: though my guix is lagging so you'll have to confirm after pull. spk121: . civodul: chrislck: interesting that you got that impression :-) civodul: i'm pretty sure you can handle commands like "guix install" tho ;-) chrislck: well my understanding is guix == docker on steroids. but guix install will make the package globally available, so guix = snap/apt. but, guix can create dev environments, so guix = virtualenv. are you surprised we're confused? chrislck: and nix as well ... chrislck: (I know the answer is, 'all of the above' :) chrislck: anyway, guix --ad-hoc guile-next guile3.0-readline guile3.0-colorized did the trick for now jonsger: chrislck: is your work on guile 3.0 for gnucash already on a public branch chrislck: nopes haven't even managed to compile yet chrislck: this will be better done by gjanssens who knows about gnucash paths much better than I str1ngs: chrislck: just to clarify guix install makes the package available for the user not system wide. you could make a system wide profile. but that is generally something that is used by guix system str1ngs: guix install is not like apt install at all. it's mainly called that ease of use. you can think of it as guix add this to my profile. str1ngs: chrislck: ^ chrislck: hehe, another confusionism lloda: next time someone invents a cli interface like git, guix, etc. they should call the commands 1, 2, 3... or A, B, C... lloda: that way no one will be confused :-p manumanumanu: My for loops are done for now! Check'em out here: https://hg.sr.ht/~bjoli/guile-for-loops The new hot stuff is right folds letting you express lazy or non-tail-recursive loops mwette: di chrislck: I think a major difficulty for guix is the vocabulary. a 2D grid with col-labels=channel/store/environment/package/substitutes and row-labels=guix environment/add/pull/etc would be useful to know what's doing what. chrislck: is a summary to guix in the style of https://nvie.com/posts/a-successful-git-branching-model/ possible at all? spk121: ooh, for loops. neat civodul: chrislck: maybe, yes! civodul: to get started there's a 1-to-1 mapping from apt-get/yum civodul: but yeah, perhaps that should be clarified chrislck: civodul: sure, but also keen to know what's happening behind the scenes. what store/channel/package is being modified via guix chrislck: what's considered available(remote), available(local), installed(local) etc dsmith-work: Morning Greetings, Guilers manumanumanu: dsmith-work: good afternoon! dsmith-work: sneek: ugt? sneek: Last time I checked UGT is http://www.total-knowledge.com/~ilya/mips/ugt.html manumanumanu: dsmith: consider my ass laminated! rlb: chrislck, civodul: given the repl-server fix, if I don't hit anything else, I suspect I'll be able to finish/upload the initial guile-3.0 packages in the next few days, likely by the end of the weekend. rlb: chrislck: you can always "./configure --prefix="$HOME"/opt/guile-3.0" and then when you "make install" it'll be put there. Then iirc you should be able to run guile from there with something like PATH="$HOME/opt/guile-3.0/bin:$PATH" LD_LIBRARY_PATH="$HOME/guile-3.0/lib" guile ... civodul: rlb: awesome! akhetopnu: hello. I'm trying to make guix show me where is guile-json installed, I checked with --help flat that I can use `guile package --list-installed[=REGEXP]` so I tried `guile package --list-installed=json` but it doesn't work. I tried `guile package --list-installed=/json/` but it also doesn't work akhetopnu: I get an error: `guix package: error: --list-installed=json: unrecognized option`. Any ideas? akhetopnu: putting the `json` part in quotes doesn't help... manumanumanu: Ahoy hoy! I have gotten to going through my repl prelude, and I wonder: are there any nice libraries that add ergonomics to the repl? What I am using now is (ice-9 match), my for loops, threading macros and megacut (a clojuresque lambda shorthand). Are there any other things that you use? manumanumanu: I have a bunch of small comfort procedures as well, like (port->list proc) and get-line from r6rs. manumanumanu: also: can i get all exported bindings from a module using he module reflection? manumanumanu: ah! module-map and (resolve-interface) zig: module-interface IIRC zig: oops zig: manumanumanu: I do not have REPL helpers, my .guile is empty at the moment, but I use (help foobar) and readline. zig: nowadays, I rely on rlwrap because lazy. zig: I recently discovered (apropos "list") zig: which works withotu guile-fu numerobis: Hi #guile! I'm trying to read a line from a pipe, but the example in the example open-input-pipe returns the error "In procedure module-lookup: Unbound variable: read-line". Is there a function to read a line from a pipe? erkin: Are you importing rdelim? dsmith-work: enderby: https://www.gnu.org/software/guile/manual/html_node/Formatted-Output.html enderby: dsmith-work: gotcha dsmith-work: As in ~f enderby: yeah ic ty dsmith-work: More powerfuller than printf erkin: Why doesn't guile respect the use-modules I put in ~/.guile? erkin: It recognises the file inclusion and read/print option toggles but the modules don't get imported. erkin: If the module imports get discarded after the file is loaded (so that eg (ice-9 readline) procedures don't clutter the repl), then how can I automatically import a module at startup? dsmith: erkin: For an interactive session? erkin: Yeah erkin: I've got a preamble file containing a bunch of quality-of-life macros. dsmith: Hmm. I was going to mention that .guile isn't loaded for scripts, but that's not your issue. dsmith: It sure would be nice to be able to tone down the compiler chattiness a bit. daviid: erkin: are you sure? i use that feature, and it seems to work fine here erkin: ~/.guile contains (use-modules (mine)), preceded by the inclusion of its file. erkin: ,import doesn't list (mine) and sure enough I can't call anything exported from it. erkin: But I can (use-modules (mine)) in the repl, meaning the file inclusion was successful. daviid: erkin: not sure i unerstand 'preceeded by the inclusion', but here, i do erkin: (include-from-path "/home/erkin/src/mine.sls") (use-modules (mine)) daviid: erkin: i think the include should go in your mine module daviid: but not sure either erkin: But the mine module is the file that's getting included. erkin: mine.sls contains (define-module (mine) ...) daviid: anyway, i use that feature all the time and it works as expected erkin: I'm trying to import (mine) into the interactive repl at startup. erkin: How do you do it? daviid: erkin: then just do (use-modules (mine)) daviid: no need to include anything erkin: No I want to import it automatically, without having to type use-modules in the repl every single time. daviid: the (use-modules (mine)) from goes into your .guile file daviid: *form erkin: It's there, but it doesn't get loaded at startup. daviid: precisely erkin: But I want it to get loaded at startup. daviid: erkin: delete the include stuff erkin: How will it know where the mine module is then? daviid: you just need (use-modules (mine)) erkin: Well "no code for module (mine)" daviid: erkin: ok, that is because you miss the path and must add it daviid: can do that in your .guile file as well erkin: I assume include-from-path isn't the canonical way to do it then. daviid: (add-to-load-path "the path of the ine module") daviid: forget about include daviid: it has a totally different objective erkin: All right daviid: launch a repl and check erkin: Still "no code for module (mine)" erkin: With (add-to-load-path "/home/erkin/src/guile.sls") daviid: %load-pat daviid: %load-path daviid: until the path of the mine module is there, guile won't find it erkin: Oh it needs a folder, not a file. erkin: I guess I need to put it in an empty folder then. daviid: the parent mine dir must be i the load path daviid: *in daviid: what is the full pathname of your mine module? erkin: Okay, I made a specific folder for it. erkin: It works now! daviid: perfect erkin: Thanks! daviid: welcome str1ngs: hello wingo I have a small patch for guile-cairo. the patch adds a new procedure cairo-pointer->scm . this converts a SCM pointer with the value cairo_t to guile cairo SCM . mainly it's for use with g-golf. here is my proposed patch http://paste.debian.net/1127061. and this a g-golf use case http://paste.debian.net/1127062. if this is useful let me know and I'll mail to guile-user . dsmith: sneek: seen unknown_lamer sneek: I last saw unknown_lamer on Jan 16 at 03:34 pm UTC, saying: basically working is a start after ten years of gathering dust :). unknown_lamer: dsmith: hey, just been busy for a few days (work week is basically impossible for me to hack :-\), got your email and I'll merge it in at some point in the next few days dsmith: unknown_lamer: I understand! btw, got some more changes too. manumanumanu: Finally I have gotten myself into a problem with macro hygiene! manumanumanu: it took 3 years of trying my hardest, but now I guess I'll have to concede at least one event to all those whining CLers. ZombieChicken: there are arguments for both approaches, it's just one is less likely to shoot you in the foot manumanumanu: Oh, I know, but now I have ended up with (let-syntax ((a (identifier-syntax (next-iter)))) (cons b a)) where I for the love of me can't get both "a" to be the same ones. manumanumanu: the macro expands to about 40 lines of code generated and copied from all over the place manumanumanu: It is the result of a macro generating a local let-syntax that gets the macro transformer from a procedure, so the different "a" are the same from the beginning, but not in the end. manumanumanu: In racket I could use (syntax-local-introduce), but that is based on the scope theory of macro hygiene, so it isn't available. manumanumanu: anyway, with gratious use of syntax->datum->syntax I can make it work, but that is icky. ZombieChicken: manumanumanu: Might look at how Racket does it's thing and see if it's portable. You never know. manumanumanu: ZombieChicken: it is not. I am pretty certain. syntax-local-introduce is quite tethered to macros as sets of scopes iirc. ZombieChicken: Might fire off an email to the mailing list and see if some dev might think about picking it up manumanumanu: ZombieChicken: I managed to make it work, but it aint pretty :) I managed to do it while being only moderately bad. I will have to think about this for some time though. I would love to not have to use datum->syntax, especially since I am doing it on an identifier passed to me by the user. manumanumanu: my for loops now support non-tail-recursive (as in: you can build arbitrary long conses) loops, that way I can express for/list (working like built-in map) and for/stream without resorting to manually writing weird syntax. manumanumanu: (for/list ((a (in-range 10))) a) becomes equivilent to (cons 0 (cons 1 (cons 2 (cons ... although through loops. manumanumanu: expressed as a right fold, which now also has general support for lazy expansion. manumanumanu: ah the joys of programming on a wednesday! manumanumanu: What are you all up to? mwette: manumanumanu: I've had issues with syntax calling syntax years ago. At that time, one of the developers thought it might be related to some modifications of psyntax in the Guile implementation to deal with identifier scope. manumanumanu: mwette: that was not the case now. I was introducing syntax like this: (let-syntax ((my-internal-recur (procedure-returning-a-syntax-transformer (list (syntax id) ...)))) (stuff)).. Had I just defined procedure-returning-a-syntax-transformer as a macro directly I believe syntax information would have been intact. mwette: manumanumanu: got it manumanumanu: these are probably the hairiest macros I have ever made. something like 500 lines manumanumanu: of code jcowan: 500 lines of macros makes a compiler manumanumanu: jcowan: it is. implemented using syntax-case. manumanumanu: I just finished porting a subset of racket's for/foldr which can be used to express not-TCO'd loops. That added a lot of complexity. manumanumanu: I dare not touch the emitting macro any longer. manumanumanu: jcowan: it is actually not that bad. Most of it is just syntactic versions of for/fold, which are added for comfort. *: jcowan nods jcowan: every macro is to some degree a compiler manumanumanu: I just watched the "inside racket: pattern matcher". I want to implement that for r6rs (or at least in easily portable guile). manumanumanu: there we can talk about a compiler! manumanumanu: andy has a quote somewhere on the blog that every scheme programmer want't to be a compiler writer :D lloda: that's a classic jcowan: Not all. Some think that Lisp has been ruined for the sake of compiler writers and that its True Nature is expressible only in an interpreter. jcowan: At the beginning of the R7RS-small process there was a bunch of noise about how fexprs should be standardized, even though humans can barely understand them, never mind compilers str1ngs: does the F mean what I think it means? :P jcowan: AFAIK it doesn't mean anything jcowan: https://en.wikipedia.org/wiki/Fexpr is quite good jcowan: Because fexprs are first-class, a compiler can't optimize (foo (+ 1 2)) to (foo 3), because (+ 1 2) might be unevaluated data jcowan: My best guess is that the F in fexpr stands for "special Form", as that's what it is for, defining new first-class special forms. Neither CL nor Scheme allows this. dustyweb: ok I just also sent this to guile-user but dustyweb: WHAT how have I never seen this before??? https://github.com/siraben/zkeme80 dsmith-work: Heh. Forth is awesome on little machines. dustyweb: oh, I gues I need something like CEmu to try it https://github.com/CE-Programming/CEmu/wiki/Building-CEmu dustyweb: it was really easy to build zkeme80, was surprised nckx: dustyweb: Omg cool. nckx: Someone's TI-84+ is going to go mysteriously missing after she's finished her exams. bandali: whoopsie manumanumanu: stis: how's it going?! stis: Well, got python-on-guile and guile-log to run on guile-3.0 ArneBab_: stis: nice! ArneBab_: stis: does that mean you could run benchmarks vs. CPython? :-) stis: PLease do try, but don't expect it to be fast. I've concentrated on good interoperability and semantics stis: Some interations can be faster though if you produce some simple tal call function stis: (and don't blow the stack) ArneBab_: doesn’t the stack expand automatically in Guile 3? stis: yes, but you may run out of memory still if you so sommething 10billion times and the allocation overhead will be high ArneBab_: ah, yes :-) ArneBab_: is python-on-guile in guix? stis: I think people there is trying to use it, so most likly there will be a version. probably not for guile-3.0 ArneBab_: ah, yes … ArneBab_: that’s always the danger when the distro uses the language you use: The distro must always stay working, so it’s likely that it’s a bit conservative with changing the language version. ArneBab_: Though in guix that’s not as dangerous as in other distros, because users can have different versions than the system (and still be distro-managed). stis: guix is really cool ArneBab_: $ guix search python-on-guile ArneBab_: name: python-on-guile ArneBab_: version: 0.1.0-3.00a51a2 ArneBab_: ^ nice! ArneBab_: yes, but it took me a long time to switch to Guix, and now I have quite a few hacks to get it usable for work ArneBab_: Stuff like calling a separately installed maven as LD_LIBRARY_PATH=$HOME/.guix-profile/lib mvn stis: nice! stis: do not use it myself though ArneBab_: wow, there’s already a guile3.0-guix stis: lovely manumanumanu: stis: great! stis: :) lispmacs[work]: mwette: https://www.emacswiki.org/emacs/GuileEmacs lispmacs[work]: branch of GNU Emacs that replaces Emacs’s own EmacsLisp engine with the Elisp compiler of Guile lispmacs[work]: ideally, also able to run Elisp code as well as Guile code lispmacs[work]: I'm actually trying to build it right now through Guix package manager lispmacs[work]: It is really Guile able to runnign Elisp, rather than the other way around dsmith: Was funded by a few Google Summer of Code's iirc mwette: lispmacs[work]: thanks lispmacs[work]: mwette: latest repository commit for the emacs part of the project was May 12 2015. I'm going to check on the guile side of it lispmacs[work]: out of curiousity lispmacs[work]: mwette: may 10 2015 lispmacs[work]: there was a blistering talk at emacsconf this year arguing that we needed to switched over to Guile or something else, for Emacs to survive. Not sure if that got anybody motivated enough to keep working on it dsmith: iirc, current Guile does have some elisp support. There is some magic for handling how #f, '(), and nil are either the same or different depending on Scheme or Elisp. dsmith: For example. jcowan: Actually they are the same on both sides of the fence. A list created with Guile ends in () and one created with Elisp ends in #nil. mwette: Has the performance parameters (or fluids) improved over the last several years? jcowan: The trick is that both Scheme #f and #nil are falsy, and that both () and #nil return true to null? (or Elisp null). jcowan: So if you do un-Schemey tests like (eq? x #f) or (eq? x '()) you will get the wrong answers on Elisp data. dsmith: But isn't '() also falsy in elisp? (Or did I misunderstand you?) jcowan: Yes, correct. jcowan: So all of '(), #nil, and #f are falsy in Guile Elisp. jcowan: There is a Scheme predicate nil? as well. dsmith: But in Guile Scheme? dsmith: #f is false. #nil ? mwette: (null? #nil) => #t in guile 2.2 jcowan: Yes, #nil is a unique object that is both falsy and an empty list, but distinct in the sense of eq? from either #f or '() dsmith: Ok. Cool. Thanks for the clarifications. jcowan: On the Elisp side, you will fail if you write (eq x 'nil), because the symbol nil is not falsy. jcowan: sorry, I meant (eq nil 'nil) jcowan: I'm assuming that #nil is also a symbol at least on elisp, but perhaps not. mwette: in guile elisp, nil is printed as #nil mwette: but the character sequence `#nil' generates a read error mwette: (this is in guile 2.2, after ,L elisp) lispmacs[work]: hi, I'm in the guile reference manual, but having trouble figuring out how to call an external program from within guile lispmacs[work]: wait, there is the POSIX section jcowan: Doing .L elisp replaces the evaluator of the REPL, but not the reader or the printer. mwette: (system "ls") lispmacs[work]: `system' call should be what I need jcowan: or maybe it's just the printer that's no replaced jcowan: at any rate I remember some inconsistencies. mwette: the printer, it seems; the reader is `read-elisp' jcowan: How did you find that out? mwette: look at language/elisp/spec.scm dsmith: lispmacs[work]: Do you need to talk stdin or stdout to the program? jcowan: I remember typing '(a b c) or something like that and it printed (a b c), not (a b c . #nil), though jcowan: But perhaps the printer just uses null? to check jcowan: and there really is a #nil in the tail. lispmacs[work]: dsmith: not in this case I think, thanks mwette: jcowan: in scheme, '(a b c . #nil) => (a b c), so the scheme printer is #nil0aware jcowan: Or nil-unaware, depending on how you look at it. mwette: ha ha -- yes rlb: the impression I'd gotten a while back was that guile's elisp was mostly "complete" -- the main work remaining (and quite nontrivial) was the *other* bits in emacs that are in say C like, in particular, the buffer/text handling. rlb: s/in particular/for example/ rlb: at least that's one of the bits I think was mentioned back then. rlb: 3.0.0 printing \u2026 on a terminal rather than ... doesn't seem ideal... rlb: (in backtraces) rlb: what in the world... rlb: I think I found the 00-repl-server.test issue -- it was actually that root was blocking any further attempts to run the test as non root, because (I think) the test just hard-codes /tmp/repl-serer (and doesn't always clean it up). Perhaps we should use a real temp file? *: rlb investigates... rlb: (further) rlb: (preliminary patch filed at bug-guile) civodul: OrangeShark: congrats on the Guile-Git release! civodul: somehow i had overlooked it civodul: looks like my (git proxy) addition arrived one day too late civodul: next time! jonsger: catched the guile-git 0.3.0 release :) brandelune_: Hello, I just git-cloned the savannah repository but could not find an INSTALL file at the root of the project. brandelune_: Am I missing something ? lloda: read HACKING brandelune_ brandelune_: Thank you. brandelune_: But the README file has: brandelune_: "Generic instructions for configuring and compiling Guile can be found brandelune_: in the INSTALL file." lloda: that's for the package lloda: you have to run ./autogen.sh lloda: that will create INSTALL brandelune_: Ok, thank you. brandelune_: But autogen.sh fails on my mac. lloda: the README could be improved I think lloda: how does it fail brandelune_: So I was looking for info in how to build on macos brandelune_: Fail: brandelune_: ~~~~~~~~~~~~~ brandelune_: glibtoolize: copying file 'm4/lt~obsolete.m4' brandelune_: configure.ac:706: warning: macro 'AM_GNU_GETTEXT' not found in library brandelune_: autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf --force brandelune_: configure.ac:706: error: possibly undefined macro: AM_GNU_GETTEXT brandelune_: If this token and others are legitimate, please use m4_pattern_allow. brandelune_: See the Autoconf documentation. brandelune_: autoreconf: /usr/local/Cellar/autoconf/2.69/bin/autoconf failed with exit status: 1 brandelune_: ~~~~~~~~~~~~~~ lloda: I'm not on my mac atm, but you probably need to have autoconf, automake, gettext, gsed, some other stuff installed lloda: I use MacPorts brandelune_: :-) lloda: the versions that come with Mac OS are too old brandelune_: Hence the need to have an INSTALL file that gives that info before hand ;-) lloda: you aren't wrong, but INSTALL is supposed to come with ./configure so you don't need to run autogen in that case brandelune_: I was surprised to see that brew only has 2.2.6 at the moment. brandelune_: Ok, so maybe add a few lines to README ? brandelune_: When I have the thing working, I can send a patch for that. brandelune_: Oh and the README has: brandelune_: "This is a prerelease of version 3.0 of Guile," brandelune_: I thought 3.0 was officially released ? lloda: you can fix that in your patch ;-) brandelune_: I will. I just subscribed to guile-devel. I'll continue the conversation there. brandelune_: Thank you for the hints. lloda: but really README should say that if you don't have a configure, you have to look at HACKING, and HACKING could also be improved lloda: np! brandelune: indeed I seem to have an old flex. 2.5.37 is recommended but Apple only provides 2.5.35 brandelune: updating now :) *: jonsger makes good progress on bringing 3.0 to Tumbleweed. Even use it as default Guile :) brandelune: ok, it seems to not only be a flex problem... brandelune: ~~~~~~~~~~ brandelune: configure.ac:706: warning: macro 'AM_GNU_GETTEXT' not found in library brandelune: autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf --force brandelune: configure.ac:706: error: possibly undefined macro: AM_GNU_GETTEXT brandelune: If this token and others are legitimate, please use m4_pattern_allow. brandelune: See the Autoconf documentation. brandelune: autoreconf: /usr/local/Cellar/autoconf/2.69/bin/autoconf failed with exit status: 1 brandelune: ~~~~~~~~~~ brandelune: autoconf (GNU Autoconf) 2.69 brandelune: automake (GNU automake) 1.16.1 brandelune: glibtoolize (GNU libtool) 2.4.6 brandelune: GNU M4 1.4.6 brandelune: flex 2.6.4 dsmith: brandelune: Hmm, that's about what I have on my Debian box. Except m4 is 1.4.18 lloda: I think that's just gettext missing brandelune dsmith: Ya dsmith: Also, watch out for readline. macos provides something that's almost close, but not quite there. brandelune: lloda I have macport gettext I think brandelune: which gettext brandelune: /usr/local/opt/gettext/bin/gettext brandelune: gettext -V brandelune: gettext (GNU gettext-runtime) 0.20.1 lloda: then I dunno lloda: maybe automake doesn't know where the gettext macros are lloda: if you installed that differently brandelune: looks like brandelune: ok, checking again, I'll be back when I have something :) brandelune: weird, brew has gettext properly installed... :( manumanumanu: brandelune: compiling guile on mac os x is configure file voodoo. brandelune: :) manumanumanu: I just gave up when trying to submit a patch, and compiled it on my rock pi 4. it took a lot longer to compile, but had I gone with that path before deciding to try to do it on a mac I would still be up something like 5 hours. brandelune: it looks like the #machomebrew is not super active so I'm not sure what the issue is with gettext, but right now they're the only one able to help I guess... manumanumanu: so now I am building a small linux machine with an amd 3200g to 1. replace all my SBCs and my NAS and 2. do all my development on. manumanumanu: emacs makes that nice enough brandelune: yes, well, I'm kind of stuck with my mac for the moment... :( manumanumanu: you can copy the formula from the git PR and use that to build from master manumanumanu: (or download 3.0) brandelune: I'm eyeing cheap 2nd hand laptops just for the fun (and I want to run picolisp natively too) manumanumanu: that just works. brandelune: ? brandelune: ok, so trying to got he git way is a waste of time ? :) brandelune: #machomebrew is *very* silent... lloda: brandelune: if you know where the gettext macros are installed you can try setting ACLOCAL_PATH I think brandelune: omg lloda: ? brandelune: also, I just read the guile 3.0 PR for the brew package. Not making much sense to me but it looks blocked: brandelune: https://github.com/Homebrew/homebrew-core/pull/49121 brandelune: lloda, I just wish I had not to resort to that kind of magic :( lloda: understandabl lloda: e lloda: macports works for me. That said version fences like those on the ticket in your link pretty much require that things be updated in several places by human hands brandelune: ok, my macros are here: brandelune: /usr/local/Cellar/gettext/0.20.1/share/aclocal/ brandelune: so I just set ACLOCAL_PATH with an export ? lloda: probably? lloda: I'm not an autotools expert :-| brandelune: right now I have: brandelune: aclocal --print-ac-dir brandelune: /usr/local/Cellar/automake/1.16.1_1/share/aclocal brandelune: Oh ! There is a dirlist there brandelune: with /usr/local/share/aclocal brandelune: /usr/share/aclocal brandelune: so I guess just maybe adding the gettext aclocal path would do...!?!?!?! brandelune: Yeeeeeeees !!!!!! lloda: nice :) brandelune: Ok, so maybe there is an issue with the gettext install not properly adding a path to that file, maybe because I installed them in the wrong order... brandelune: Now I can see the INSTALL file :) dsmith: Yey! brandelune: did the guile team create the r5rs.info file ? brandelune: ok, I had an issue with libffi but just exporting LDFLAGS and PKG_CONFIG_PATH was enough... brandelune: now configure exited properly, and I'm trying a make ! lloda: maybe we should have --with-libffi-prefix like with the other deps peanutbutterandc: Okay, so I just poked around with `guile -l foo.scm --language=ecmascript` (guile 2.x) and I could call (foo 1) as foo(1); zig: ! peanutbutterandc: Can someone please tell me the limitations to that? Because it seems to me that if emacs were to have guile instead of elisp, the users could do all that is being done with emacs, with ecmascript peanutbutterandc: I heard that python support was something in the works. I wonder: could one `guile --language=python` and then `import python_modules_here`, too? brandelune: lloda: please :) brandelune: guile is at 150% cpu use, slowly moving through the BOOTSTRAP GUILEC things... lloda: ya that takes a while brandelune: how many are there ? brandelune: makeinfo on the doc seems to have issues brandelune: makeinfo --html --no-split --css-ref=./r5rs.css guile.texi brandelune: guile.texi:10: @include: could not find version.texi brandelune: guile.texi:11: @include: could not find effective-version.texi brandelune: maybe I need to do something before... brandelune: maybe make has not reached the point where it works on the docs... mwette: the first make has to complete before you can build the documentation brandelune: thank you mwette brandelune: lloda: big issue with guile-readline.la brandelune: ~~~~~~~~~~ brandelune: Making all in guile-readline brandelune: SNARF readline.x brandelune: CC readline.lo brandelune: readline.c:432:7: warning: implicitly declaring library function 'strncmp' with type 'int (const char *, const char *, unsigned long)' [-Wimplicit-function-declaration] brandelune: if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2)) brandelune: ^ brandelune: readline.c:432:7: note: include the header or explicitly provide a declaration for 'strncmp' brandelune: readline.c:432:16: warning: implicit declaration of function 'rl_get_keymap_name' is invalid in C99 [-Wimplicit-function-declaration] brandelune: if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2)) brandelune: ^ brandelune: readline.c:432:16: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion] brandelune: if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2)) brandelune: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ brandelune: 3 warnings generated. brandelune: CCLD guile-readline.la brandelune: Undefined symbols for architecture x86_64: brandelune: "_rl_get_keymap_name", referenced from: brandelune: _scm_init_readline in readline.o brandelune: ld: symbol(s) not found for architecture x86_64 lloda: did you pass libreadline to configure brandelune: clang: error: linker command failed with exit code 1 (use -v to see invocation) brandelune: ~~~~~~~~~~ lloda: there is --with-libreadline-prefix= for that brandelune: the README says "It will also use the libreadline library if it is available." jonsger: brandelune: please use a paste service for such long logs :P brandelune: so I was not expecting make to choke on that, especially after autogen and configure worked brandelune: jonsger: apologies, would you mind clarifying ? brandelune: are there preferred paste services ? jonsger: brandelune: not really, pastebin.com is not good for TOR users. brandelune: I doubt tor users are interested in my super beginner level inquiries :) lloda: maybe configure should detect that lloda: but readline in mac os is probably outdated lloda: I know I do need to pass my macports path to libreadliine when I build Guile lloda: brandelune: you can use https://paste.debian.net/ brandelune: yes, configure should definitely detect that :) brandelune: So maybe the README should have that readline is required ? brandelune: thank you for the paste service brandelune: (I'm updating my local copy of the README as I work through the build process :) lloda: I think there should still be some way not to use readline with Guile, b/c of license issues lloda: so if you didn't have any libreadline in the system then maybe make would have completed, just you wouldn't have readline lloda: but I'm not entirely sure brandelune: I had readline but from Brew and the various paths were not exported, so it was not visible to the build process brandelune: weird, now I doing configure again and this time it won't recognise libffi brandelune: already midnight here, maybe it's time to call it a day... :( brandelune: ok, back to make... brandelune: ok, I'm giving up. whatever I do to set the path to libffi it won't recognize it during make but configure won't say a thing about that... dsmith-work: Tuesday Greetings, Guilers dsmith-work: brandelune: The above readline errors sound like macos readline was found instead of gnu readline. brandelune: thank you. I think I had that fixed by setting correct paths to brew readline, and now that I'm starting again I have issues that I thought were fixed with libffi... chrislck: ok i'm 2.5 years into guile, not exactly green nor gray. do you guys think, for is a well-written algorithm in guile potentially faster than a well-written python? dsmith-work: Sure. I think the only way Python code becomes performant it by using external compiled libs. chrislck: nice :) dsmith-work: chrislck: As wingo mentioned in the release announcement, the current Scheme evaluator is about par with the old C evaluator. Beccause of JIT. chrislck: my work in gnucash is continuing. now there are very few unreasonable set! left in internal code. I think this is an achievement :) chrislck: and the reports have had numerous upgrades chrislck: all hail the mighty '() jonsger: chrislck: congrats :) brandelune: Ok, no idea what's going on and way past bedtime... brandelune: configure says: brandelune: checking for libffi... no brandelune: configure: error: Package requirements (libffi) were not met: brandelune: No package 'libffi' found brandelune: Consider adjusting the PKG_CONFIG_PATH environment variable if you brandelune: installed software in a non-standard prefix. brandelune: Alternatively, you may set the environment variables LIBFFI_CFLAGS brandelune: and LIBFFI_LIBS to avoid the need to call pkg-config. brandelune: but then brew says: brandelune: For compilers to find libffi you may need to set: brandelune: export LDFLAGS="-L/usr/local/opt/libffi/lib" brandelune: For pkg-config to find libffi you may need to set: brandelune: export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" brandelune: which is what I did. brandelune: and I sourced the .zshrc file, etc. brandelune: I have a few mods to the README (even if I failed to build), I'll be sending them to the dev list. lloda: you can look in config.log to see why configure failed to find libffi lloda: in mine (linux) it says configure:47309: $PKG_CONFIG --exists --print-errors "libffi" lloda: configure:47312: $? = 0 lloda: so that worked brandelune: configure:50612: checking for libffi brandelune: configure:50619: $PKG_CONFIG --exists --print-errors "libffi" brandelune: Package libffi was not found in the pkg-config search path. brandelune: Perhaps you should add the directory containing `libffi.pc' brandelune: No package 'libffi' found brandelune: but brandelune: export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" lloda: does the --exists etc line work outside configure? brandelune: let me check brandelune: I've cleaned up a bit my shell init files... maybe there were conflicts there, I don't know. brandelune: ok, I had silly mistakes in my export commands. Shame on me. brandelune: Now I'm back to normal autogen exit, normal configure exit, and make seemingly munching through all the stuff that it did earlier before hitting the readline wall. brandelune: too bad I can only check that tomorrow morning :) brandelune: but I'm definitely back to smiley mode, plus I fixed my environment. dsmith-work: brandelune: yey brandelune: yey indeed :) brandelune: oh cool. brandelune: all the bootstrap stuff having been done earlier I'm now jumping through those hoops and I got real quickly to the readline error brandelune: Now, "Making all in guile-readline" brandelune: is what breaks the thing. brandelune: and I'm back clearly to the early error. dsmith-work: At one time I had a patch that lets it use macos readline. There are some symbols that ./configure is specifically looking for that are not in the macos implementaiton. But those symbols are not actually used. dsmith-work: But that was a while ago. brandelune: but I'm supposed to be using brew readline brandelune: stable 8.0.1 brandelune: and they suggest: brandelune: For compilers to find readline you may need to set: brandelune: export LDFLAGS="-L/usr/local/opt/readline/lib" brandelune: export CPPFLAGS="-I/usr/local/opt/readline/include" brandelune: For pkg-config to find readline you may need to set: brandelune: export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig" brandelune: which I put in my .zshrc dsmith-work: Yes, I never submitted it. I'm sure the GNU folks would rather encourage the use of GNU readline. brandelune: the error is: brandelune: Undefined symbols for architecture x86_64: brandelune: "_rl_get_keymap_name", referenced from: brandelune: _scm_init_readline in readline.o brandelune: ld: symbol(s) not found for architecture x86_64 brandelune: does that make sense to you ? :) lloda: the libreadline paths should be set with --with-libreadline-prefix= brandelune: lloda: where should I set that ? lloda: ./configure --help brandelune: ok brandelune: :) lloda :) make succeeded brandelune: make install fails though...? brandelune: /usr/bin/install -c -m 644 libguile-2.2-gdb.scm /usr/local/lib/libguile-3.0.a-gdb.scm brandelune: sed: -e: No such file or directory brandelune: weird civodul: brandelune: oops, that's a mistake *: civodul looks dsmith-work: Sounds like some @VALUE@ wasn't updated properly? brandelune: if you say so... :) dsmith-work: Or is that because macos sed doesn't know '-e' ? brandelune: possible too brandelune: SYNOPSIS brandelune: sed [-Ealn] command [file ...] brandelune: sed [-Ealn] [-e command] [-f command_file] [-i extension] [file ...] brandelune: looks like it should work brandelune: what is the purpose of -e in non-macos sed ? civodul: brandelune: commit 491cc23f93f622e067e120f875424ed76d73cf8f fixes it brandelune: :) RhodiumToad: -e in any standard sed just means "the following argument is an edit command" RhodiumToad: a common porting mistake is to forget the "options before positional parameters" rule brandelune: thank you RhodiumToad dsmith-work: RhodiumToad: Ahh! RhodiumToad: GNU software ignores this long-standing rule, which only leads to further confusion in the cases where it really matters brandelune: civodul: after a git pull a redoing everything just to make sure, I have another instance of that error: brandelune: /usr/bin/install -c -m 644 libguile-3.0-gdb.scm /usr/local/lib/libguile-3.0.a-gdb.scm brandelune: sed: -e: No such file or directory dustyweb: hm dustyweb: I don't remember running into this before in geiser dustyweb: C-c C-k in a module and then dustyweb: ERROR: In procedure scm-error: dustyweb: failed to create path for auto-compiled file "/home/cwebber/sandbox/foo.scm" civodul: brandelune: hmm that must be something else then civodul: could you check what libguile/Makefile looks like there? civodul: well i did fix something, but not the same thing :-) brandelune: Where is libguile ? brandelune: you mean guile/lib ? dsmith-work: brandelune: Guile is really a library. The "guile" executable is really just a thin layer over it. The bulk of the C code is infact in the "libguile" dir. brandelune: sure but in my savannah clone, I don't have a libguile directory brandelune: oh yes I do :) brandelune: civodul, what am I supposed to check in that Makefile ? civodul: brandelune: i'd look for the faulty sed invocation lloda: I get around that by installing gsed brandelune iirc lloda: I think configure will check if gsed exists before trying sed brandelune: ok, installing... brandelune: (which means I have to reconfigure and remake everything... :( ) lloda: I mentioned gsed on my 1st reply ;-) lloda: I think that's a bug somewhere, b/c autoconf is supposed to cover that sort of incompatibility lloda: I would think NieDzejkob: https://www.youtube.com/watch?v=ohdhaVBYMRo brandelune: lloda including the thing with readline that should be caught in configure, I think brandelune: and sorry for the gsed reference I missed... lloda: I wasn't very specific :-( brandelune: ok gsed installed and recognised as sed... restarting the whole thing... jcowan: Just reported two elisp bugs: there is no proper elisp printer, and nil is not a symbol. brandelune: ➜ guile git:(master) ✗ guile -v brandelune: guile (GNU Guile) 3.0.0.8-1b8e-dirty brandelune: :) brandelune: ok, so as far as I'm concerned there are 2 configuration "bugs" brandelune: 1) configure should figure out that I'm not using the right readline brandelune: 2) configure should figure out that I'm not using the right sed brandelune: it took about 10h to fix all that :) brandelune: 3am, definitely time to go to bed. brandelune: thank you lloda civodul dsmith-work and the other who helped. brandelune: other*s* dsmith-work: A lot of effort, but well worth it! lloda: cheers & gn lloda: brandelune: lloda: hopefully it will help others as well brandelune: I'm sending a README patch to the dev list, there maybe things you wan to edit. lloda: I'm subbed, will check it for sure brandelune: re. the configure "bugs", should I send 2 separate mails to bug-guile@gnu.org ? lloda: I would send two roelj: I have this piece: (build-response #:code 405 #:headers `((Allow . ,allowed-methods))), where "allowed-methods" is '(GET), and the error thrown is "bad-response: (Bad value for header ~a: ~s (Allow (GET)))". In what way should I put the method(s) in? `((Allow . ((GET))))? And why? rotty: roelj: being ignorant about the actual implementation, I would dare to bet that the header values must be string-like rotty: for the "why", I would assume that this restriction is due to there being no sensible serialization of arbitrary values that works in all cases rotty: (i.e. the implementation probably carries no knowlege for specific header fields and how to map their values to bytes sent on the wire) roelj: rotty: You are right. :) A string works. roelj: So, I should just deal with building a string for multiple methods rotty: yup, that's what I would do, at least roelj: Thanks roelj: This saved me quite some debugging time. :) stis: Hej guilers! stis: yay! guile-log runs under guile-3.0 stis: That was a bit difficult dsmith-work: stis: Congrats enderby: does (string-replace-substring "a ring of strings" "ring" "rut") work for anyone? enderby: https://www.gnu.org/software/guile/manual/html_node/Miscellaneous-String-Operations.html says it should, but i get unbound variable jcowan: What library did you require or import? enderby: (use-modules (ice-9 string-fun)) as it says zig: enderby: what is the output of guile --version? zig: first two lines are enough. enderby: 2.2.6 zig: enderby: that is too old ;) enderby: oh what version do i need? dsmith-work: guile 3.0: dsmith-work: scheme@(guile-user)> (string-replace-substring "a ring of strings" "ring" "rut") dsmith-work: $1 = "a rut of struts" enderby: ic zig: you need guile 300, preferably installed via guix, follow the instructions in red at https://guix.gnu.org/manual/en/html_node/Binary-Installation.html enderby: thanks, i do use guix zig: then use: guix install guile-next enderby: will do enderby: thank you zig: after: guix pull. zig: yw dsmith-work: When does guile-next become not-next? Is there a guile-after-next? dsmith-work: Yeah, being a little snarky, but I *am* curious. dsmith-work: Not a guix user, btw. Not yet. Soon maybe. jackhill: dsmith-work: https://lists.gnu.org/archive/html/guix-devel/2020-01/msg00299.html "Guile 3 migration plan" may be of interest dsmith-work: jackhill: Thanks! enderby: is there really not a built-in for rounding a number to a fixed amount of decimal places dsmith-work: Someone somewhere (Hacker News?) was asking what the "killer Guile app" is. I'm thinking guix dsmith-work: enderby: Not that I know of. But look into format. I imagine that could do what you need. Assuming you are talking about string. dsmith-work: strings. dsmith: Hey! It built. With only a few changes. Two functions difference. A needed #include, and updating configure for 3.0 erkin: Nice ZombieChicken: back ZombieChicken: dsmith: scwm? mwette: I'm guessing scwm is a window manager in scheme. There used to be sawfish (aka sawmill). ZombieChicken: I'd assume so, too, but there are so many acronyms, I'd rather ask and be sure str1ngs: daviid: thank you for looking at this. I had to step out for awhile. For reference I use this documentation https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-load-changed . I will test your fix now. daviid: str1ngs: no problem, let's see if it is a 'real' fix, i think so but ... str1ngs: daviid: looks good so far. thank you. daviid: str1ngs: welcome, tx for the report mwette: ZombieChicken: http://scwm.sourceforge.net/ str1ngs: daviid: it was an odd bug for sure. webkit has strange IPC though. was that related? daviid: str1ngs: no, it was a very big bug of mine! daviid: str1ngs: such a bug that i deserv a brown bag for at least a week :):) str1ngs: daviid: bugs happen :). though in all fairness events have worked quite well since inception. I thought I might find more bugs by now. dsmith: ZombieChicken: Yes, Scheme Configurable Window Manager. daviid: str1ngs: wrt to the example 'per se', you know you could use eq? (rather then equal?), then you may even use case, which would, imo, make the code 'cleaner', like this - https://paste.debian.net/1126732/ daviid: str1ngs: the case for will also allow to treat more then one load-event at the same time - ... (case load-event ((started redirected) ) ((commited) ...)) ... daviid: *form daviid: str1ngs: just some thought ... fwiw rlb: wingo: in v3.0.0 it's still libguile/libguile-2.2-gdb.scm? (Fine with me, just noticed it while working on the debs.) mwette: rlb, wingo: when I install 3.0.0 the only "gdb" file I see installed is libguile-3.0.so.1.0.1-gdb.scm apteryx: erkin, dsmith, erkin: thanks for the inputs regarding my question about "partitioning" :-). I'll have a closer look at what's in srfi-1. str1ngs: daviid: thank you. civodul: Hello Guilers! rgherdt: hi civodul dsmith: sneek: later tell wingo https://github.com/BurntSushi/wingo sneek: Okay. civodul: do people see segfaults while building Guile 3 on ARMv7? *: civodul does but it might be non-deterministic jonsger: civodul: I see a different then you. Unrelated civodul: jonsger: but you do see a segfault while it's building, right? *: civodul tries to get a backtrace jonsger: https://build.opensuse.org/package/live_build_log/devel:languages:misc/guile/openSUSE_Factory/armv7l my assumption is that it's the "wrong" ARMv7 civodul: that looks quite different civodul: so yeah, SIGILL might be because you're not on the right arch or something jonsger: yes. Thats why I said unreleated :P civodul: yup! dsmith: civodul: I did not get a segfault on armv7l gcc 6.3.0 civodul: dsmith: oh ok civodul: would have been too easy it everyone had the same problem ;-) dsmith: civodul: I would suspect a different compiler version handling something "unspecified" in a different way. civodul: could be dsmith: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs dsmith: civodul: The bot is on 3.0 on arm civodul: yeah, nice! jonsger: wingo: do you have a guile 3.0 compatible version of guile-charting? lloda: guile-cairo does work on Guile 3 w/o issue lloda: other than maybe the install, I haven't checked that str1ngs: funny I was just going to see if I could map out some goop classes with g-golf and cairo *: civodul reported ARMv7 JIT crash: https://issues.guix.gnu.org/issue/39208 daviid: str1ngs: cairo is not introspectable, but we have guile-cairo str1ngs: darn I was hoping to use it to draw things with g-golf daviid: str1ngs: it is possible, maybe it needs some special treatment, but that has been done for guile-gnome and gle-clutter - so they can use a cairo surface ... str1ngs: gobject-introspection ships with cairo-1.0.gir but I think that is just providing some type information. daviid: str1ngs: here is an example (which I posted already, but ...) - https://www.nongnu.org/grip/learn.html - the clock example str1ngs: maybe clutter would work just as well daviid: str1ngs: no, cairo is a complete and necessary 'tol' for it offers - clutter is a complete diff best daviid: *complete different and necessary tool daviid: *beast str1ngs: I've used clutter before, cairo would be better for what I need. I just want to map out goops class hierarchy daviid: str1ngs: you generally need both, in my experience daviid: str1ngs: here the code i was talking about http://git.savannah.gnu.org/cgit/grip.git/tree/grip/clutter/clock.scm str1ngs: I think I can draw to a GtkDrawingArea str1ngs: but without the cairo GI. i'd have to do the drawing in C str1ngs: see https://developer.gnome.org/gtk3/stable/GtkDrawingArea.html daviid: str1ngs: i don't have time now, but everything can be done in scheme, i just posted an example and the code ... in gtk4, clutter is included in gtk ... daviid: somehow ... daviid: have to hack o somethng else now... bbl daviid: this none truncat excaption is a disaster daviid: a total disaster rekado_: trying to build pfds with Guile 3 but get “Unbound variable: &assertion” in procedure “raise-exception”. rlb: With 3.0.0 00-repl-server test is failing here with fport_read EINVAL (in I think the read-line) when I build and run it as root, but not when run as another user. Any idea why that might be? rlb: (and of course I don't know that "root" is the critical difference, just that's when it appeared, and it's completely reproducible -- happens every time) rlb: ...looks like it's the ptob->c_read in scm_i_read_bytes that's throwing the EINVAL. rlb: ...odd -- at that call ptob->c_read is neither a pointer to read() nor to trampoline_to_scm_read, and I can't see any other places c_read would be set to any other value. rlb: (though I'm guessing that's not the issue...) rlb: Current guess is either something's wrong with the repl socket when building/running as that other (root) account, or there's a race that's plays out differently there... rlb: "that plays out" rlb: Oh, well -- I'll come back to this, but looks like 3.0 debs will be delayed a bit longer. rlb: civodul: ahh -- I noticed you'd had to deal with some 00-repl-server test issues in the past, and right now I'm finding that the test reliably fails when I build 3.0.0 from the v3.0.0 tag as root, but not as a normal user. (Could well not be "root" related.) It fails with an fport_read EINVAL in the read-line in read-until-prompt in the "simple expression" test every time. rlb: Ring any bells? civodul: hi rlb! civodul: rlb: that doesn't ring a bell, but i wouldn't run tests as root :-) civodul: it could be root-related indeed rlb: They'll always run as root when the debs are building on the buildds. (Debian packages have to be built as root -- or fakeroot.). rlb: But no, I don't normally do that, day to day... rlb: I traced it down into scm_i_read_bytes -- the ptob->c_read() call there, but no idea why... rlb: yet civodul: oh, weird rlb: also, not sure this is relevant, but the c_read pointer there isn't either read or the trampoline_read -- it's some other address. rlb: (couldn't see how that could happen) rlb: (I mean at that point -- I printed them via %p) rlb: But I'm sure c_read could be getting assigned some way other than the obvious ones... rlb: s/sure/imagine/ rlb: Anyway, I'll have to figure this out before I can finish the 3.0.0 debs. akhetopnu: has anyone here used websockets in guile? what library did you use? is it available through guix? outtabwz: looks like there is interest in guile emacs outtabwz: https://old.reddit.com/r/emacs/comments/equuct/i_would_help_fund_the_development_of_guile_emacs/ outtabwz: i haven't used it, but sounds cool rlb: I'm certainly interested, but as mentioned there, I suspect who really has to be(come) interested is the Emacs maintainers. janneke: it's packaged in guix, but yes it's important to get emacs hackers "on board" outtabwz: some people are very protective of elisp outtabwz: elisp and scheme are both considered lisp1 right? jcowan: No, Elisp is a Lisp-2. jcowan: That is, an identifier can be bound to both a value and a function, and (foo x) uses the function binding. If you want to use the value binding, you have to write (funcall foo x). jcowan: There are some Lisp-1s that aren't Scheme, but I can't think of any offhand. outtabwz: oh yeah outtabwz: i think there are some other things though RhodiumToad: quite a lot of elisp code exists outtabwz: it's true outtabwz: github is full of elisp RhodiumToad: including things like magit, which is extremely useful outtabwz: it would be neat if guile's elisp module could handle all that' zig: akhetopnu: there is https://github.com/a-guile-mind/guile-websocket/commits/master it needs some love zig: in particular, IIRC the last two commits are garbage. dsmith: Wooo. Got finally got the scwm simple.scmrc working. dsmith: define*-public doesn't curry any more. rekado_: It seems that (rnrs condition) has a bug: it exports &assertion but only imports &assertion-failure as &assertion-violation, so &assertion is actually undefined. *: rekado_ submitted a bug report dsmith: screen cap: https://drive.google.com/open?id=176CqHg_z8Fzj5ZWui__01YC1YFWZP-1L mwette: Can someone define what Guile Emacs is? Is this guile used as emacs-engine running elisp, but also providing bindings in scheme (for the stuff in emacs lisp books)? spk121: daviid: oh yes, of course. Gotta have gtk3 for events. But with glib and gobject by itself, I think you can do main loops with socket events, but, that's about it. daviid: spk121: ok, it was jut to confirm, tx akhetopnu: Is there a built-in macro in guile for transforming code a.k.a. pipeline operator that would transform this (>> 2 (add 1 ?) (add ? 3)) into (add (add 1 2) 3)? chrislck: akhetopnu check out srfi-171 I think chrislck: or https://bitbucket.org/bjoli/guile-threading-macros/src/default/ dsmith: sneek: botsnack sneek: :) dsmith: sneek: later tell dsmith-test hey sneek: Got it. dsmith-test: go sneek: Welcome back dsmith-test, you have 1 message. dsmith-test: sneek: later tell dsmith hey sneek: Got it. dsmith: ok sneek: Welcome back dsmith, you have 1 message. sneek: dsmith, dsmith-test says: hey dsmith: sneek: botsnack sneek: :) dsmith: !uname dsmith: ~uname dsmith: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs dsmith: !uptime sneek: what? dsmith: sneek: seen wingo sneek: I last saw wingo on Jan 17 at 01:51 pm UTC, saying: what did you change? :). dsmith: !uptime sneek: 23:23:43 up 2 days, 1:37, 1 user, load average: 0.00, 0.01, 0.06 dsmith: !uname sneek: Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux sneek: Yey, back home again! d4ryus: How can i get the pid of a process spawned by open-pipe so i can terminate it? there is port/pid-table, but a comment in the code says its deprecated manumanumanu: d4ryus: There is an unexposed procedure from (ice-9 popen) called open-process. Import that: (define open-process (@@ (ice-9 popen) open-process)). That returns 3 values: an output port, an input port and the pid manumanumanu: (but double check the order of the ports...) manumanumanu: I don't know why that isn't exposed, since closing one of the pipes returned from popen is not possible, so implementing piping using it does not work. manumanumanu: IIRC there was some work to expose it, but it went nowhere. manumanumanu: I will submit a patch for it when I am finished with my for loops. d4ryus: manumanumanu: nice :) thank you lloda: manumanumanu: that is https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15228 which has been sitting there with a patch for quite a while lloda: wingo asked for doc but the patch is essentially only doc so I'm not sure what's missing lloda: looks committable to me str1ngs: hello daviid I seemed have run into a with webview load-changed signal. If I have more then one view. only the first views signal is called. I have put this example together as you will see. view-b 'load-changed is never called. here is the scheme example http://paste.debian.net/1126672. The C example here http://paste.debian.net/1126675 does not have this problem. str1ngs: daviid: into a issue* apteryx: is there something I can use to separate a list in two lists, one with filtered items and the other minus filtered items? Such as could be obtained by successively using `filter' then `remove' using the same predicate, but in one time? erkin: I don't think so, but I don't think it'd be too hard to write one with two accumulators with a `values' in the tail. erkin: Something like this: https://0x0.st/zFEC.txt erkin: Like R6RS div-and-mod. daviid: str1ngs: how do i trigger the problem? in any case, it doesn't look like your event variable is bound to a gdk event, but just a symbol? daviid: i can't find the documentatin about webkitwebview and its singals daviid: looking here https://webkitgtk.org/reference/webkit2gtk/stable/index.html manumanumanu: apteryx: partition? manumanumanu: (partition even? '(1 2 3 4)) => (2 4) (1 3) manumanumanu: from srfi-1 dsmith: apteryx: Was going to mention srfi-1. *Lots* of cool stuff in there. manumanumanu: apteryx: I have a partition-all somewhere that partitions a list into N amounts of lists, where N is as large s the different values returned by the predicate. manumanumanu: so if even? in my example would have returned 'bananas for the number 1 you would get the result (1) (2 4) (3). If you want to I can go look for it. manumanumanu: implemented using hash-tables, so it is pretty trivial. emys: hey, under guile 3.0, changing language in the repl fails for me. emys: ,L brainfuck manumanumanu: apteryx: but yeah, folloing dsmith's advice: srfi-1 is mandatory reading if you want to work with lists emys: for example doesn't work and complains about a missing `language-title` or something (sorry, didn't keep the error message emys: going back to 2.2, it works mwette: emys: on 2.9.8 for me: "Unbound variable: language-title" mwette: and before that "While executing meta-command:" daviid: str1ngs: it doesn't sound like a g-golf problem, g-golf does not trigger nor block signals daviid: str1ngs: you should be a lot more carefull about the way you name things - all args of all your signals have 'wrong naes' - this makes it quite difficult to even just read the code str1ngs: daviid: my variable names are fine. please consider this as a bug report. thank you daviid: str1ngs: the destroy signal callback single arg is a widget (pointer from the gtk point of view), in this case, a instance, not an event - it would be better to keep event to name args that receive a or subclass instance daviid: str1ngs: but i have no idea why view-b does not receive its signal str1ngs: daviid: gtk-window is derived from gtk-widget. and had nothing the the issue I'm reporting. mwette: emys: I think this may have do w/ change to records; (system base syntax) has change wrt how the record containing language-title is created. daviid: str1ngs: as i said, there is nothing in g-golf that 'blocks' signals mwette: emys: I reported as bug, #39196 str1ngs: daviid: with g-golf you can not have two webviews that use load-changed at the same time. I'm sorry you don't like my example. write your own examples. that is my bug report. matijja: Hello! matijja: Does web client has support for socks proxy? daviid: str1ngs: where is the webview and signal doc? erkin: Is the #{foo bar}# syntax unique to Guile? civodul: erkin: i think so daviid: str1ngs: i think i found why view-b does not respond to its signals, at a lower level, as expected, it recieves them daviid: i'll cook a patch rndd: Hi everyone daviid: str1ngs: I pushed a fix, please try and let me know if it effectively solves the problem rndd: Could anybody tell how to compile static binaries that can be transferred? rndd: Or mention part in manual i should read? 0_0 rndd: Or maybe example of doing that ? rndd: Okay ;( zig: oops! erkin: Why are newcomers on IRC so impatient? ;-P zig: sure zig: guix pack something is the answer to the question civodul: uh, Guile 3 segfaults during build on ARMv7: https://ci.guix.gnu.org/log/8b8c0hxvm9qa5kff168vdr3943cc2s61-guile-next-3.0.0 zig: lloda: re https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15228, please reply LGMT if it is good for you. FWIW, this is my patch, I can LGMT tho ;) zig: s/LGMT/LGTM/ zig: I need to pratice... zig: it is been a while, a people keep asking how to do what this patch make public. renken: hi, what text editors are extensible in guile? renken: searching the web can't seem to output much useful results ZombieChicken: there is/was an emacs written in guile, though I don't know what it's status currently is zig: renken: https://github.com/a-guile-mind/azul.scm zig: cc erkin ZombieChicken: Ah. Good ol' termbox zig: renken: I did not try it with guile 3.0, it probably rusty! erkin: ZombieChicken: I'd like to see Guile Emacs revived sometime. zig: renken: there is also zile-on-guile, but never succeed to make it do what I want (there is too much C code ;) erkin: I'm currently poking around to see if there's any interest in starting a project to continue development on Guile Emacs. ZombieChicken: isn't Guile and elisp more-or-less incompatable? ZombieChicken: I recall issues with the nil/false values, at the very least erkin: Guile Emacs doesn't seek to replace Elisp with Guile. zig: they were some fixes in guile to make it more compatible, like the existence of nil. ZombieChicken: yeah, but I recall that the difference in how the languges work was causing problems at some point erkin: I don't think that should cause a problem much, since ideally you don't want to comingle the languages too much. zig: ZombieChicken: like dynamic scoping? ZombieChicken: tbh, not sure why you'd want to use elisp when you can use scheme erkin: If we can implement Tcl on Guile, why not Elisp? renken: thanks for the help zig, I think zile is something interesting zig: ZombieChicken: +1 ZombieChicken: zig: I'm just recalling issues I heard about before and thought I'd mention them erkin: Anyway, the idea is replacing the opaque and crufty C interpreter at the heart of Emacs with a clean Guile implementation. ZombieChicken: Guile hopes to be the one-stop-interpreter for a bunch of languages, doesn't it? Or at least let you run more than just Scheme? zig: yes erkin: That would yield 1. a better garbage-collector, 2. natively compiled Elisp modules, 3. multithreading, 4. overall better performance, 5. maintainable code, 6. tail-call optimisation (Emacs is full of dirty hacks to avoid hitting the stack depth limit when recursing over beefy procedures) erkin: Ideally, you'd be able to write modules in either Guile or Emacs Lisp. zig: Maintaining a fork of emacs: I think the cost outweights to benefits. ZombieChicken: Oh, #6 there would be nice. Makes one wonder why Emacs doesn't do that already. Even CL implementations have TCO... zig: using a trampoline? erkin: zig: I think #5 will eventually outweigh it but it might be too late by then. zig: #5 you would still have to maintain elisp. erkin: I mean, Guile Emacs was, at its conception, meant to replace GNU Emacs. zig: By a lone dev without leadership over the original project. erkin: I'm fairly sure if things somehow magically turn out well and Guile Emacs is completed in pristine completion, rms wouldn't have any qualms christening it as the official. erkin: It was his idea in the first place anyway. mwette: emys: I found a fix: add language-title and language-name to the #:autoload (system base language) entry in system/repl/command.scm zig: the thing is that every year there is a few new editors, that gain steam. It is not clear to me as schemer or guiler why I would like my editor to be written in a mix of elisp and guile. erkin: Why do you prefer it written in a mix of C and Elisp then? zig: maybe it is a case for 50 years old running and it is the Good Thing, instead of my NIH and re-inventing the wheel. erkin: Literally everyone who's seen the internals of Emacs curse at the decades of hacks accumulated in there. (Especially the display code.) It's going to be have to be rewritten (either from the ground or in chunks) sometime but no one wants to touch it. erkin: There's a difference between reinventing the wheel and cleaning up spaghetti on a better platform. zig: I just read some thing like that, I was not sure about the state of the code... zig: since I do not have a first hand view. mwette: elisp is dynamically scoped, I believe; scheme is lexically scoped zig: speaking of display code, I have been struggling with that myself. I am wondering how emacs manage to have both terminal interface and rich gtk interface. ZombieChicken: Honestly, do we really want/need an emacs replacement? How about just writing an editor that can be embedded properly and can properly call userland over a selection of the file? Yeah, it'll break $OLD_TYMEY_USER's workflow. Let them use Emacs until it implodes erkin: It's not an Emacs replacement. erkin: It's an Emacs cleanup project, if you will. erkin: zig: There's more to just curses and GTK in there actually. It still supports Athena and Motif. Both of which surprisingly work well actually. zig: wow! ZombieChicken: iirc, it's not GTK, just kinda-sorta GTK with some straight up X hacks in there drakonis: erkin: there is interest ZombieChicken: which is why emacs doesn't work with Wayland zig: oh no! erkin: Yeah, it's way too deeply tangled in X11 code. erkin: And no one can untangle it because... xdisp.c is >35k lines of C code. ZombieChicken: ... ZombieChicken: 35k? There are operating systems with fewer lines of code... erkin: Note that xdisp.c isn't the only portion of the display code. zig: erkin: I will say it: what is the advantage of cleaning up emacs, instead of starting from scratch in pure guile? zig: s/pure// ZombieChicken: still being able to use modules that were written over the last 40 years? erkin: zig: That's a good question, honestly. I'd say the benefit is preserving existing functionality. Despite the massive amount of C in there, Elisp makes up large majority of Emacs's functionality. erkin: In addition, you'd get to use existing Emacs modules as well. ZombieChicken: Anyone here familiar with migrating code from Racket to Guile? drakonis: execute a slow transition into guile over the decade erkin: So ideally, it'd be a completely seamless drop-in replacement. erkin: The end user wouldn't notice anything. erkin: Other than speed up maybe. drakonis: it would also make emacs into a guile frontrunner, its great for marketing erkin: Yeah, good point. ZombieChicken: drakonis: So long as the initial releases break nothing whatsoever. zig: maybe drakonis: make sure all the big software still runs fine tazjin: is there a library for generic DNS lookups? (e.g. for TXT records) thought to ask before writing bindings to res_query or something zig: tazjin: what is rez_query? isn't getaddrinfo a dns resolver? tazjin: zig: getaddrinfo only resolves addresses (A records and such), but I need other information from DNS mwette: Are you guys aware of https://savannah.nongnu.org/projects/emacsy tazjin: zig: res_query - https://linux.die.net/man/3/res_query zig: tazjin: I looked up, res_query, btw it would be nice to have a guile only dns resolver for guile fibers to be able to resolve dns asynchronously. erkin: mwette: Oh yeah, I've seen that. Never got to use it myself though, since I don't really write much C. drakonis: that's for embedding emacs-y software into things zig: tazjin: IIRC DNS protocol is UDP... should be manageable and guile has udp ports. drakonis: its a unique thing erkin: ZombieChicken: I'd try to reduce the Racketisms into R6RS (using #lang r6rs) and then move it over to Guile. drakonis: erkin: ring up dlowe on lobsters if you want to get someone else who's interested in working on this tazjin: zig: I'd currently prefer not to write one from scratch, I'm a common lisper just exploring guile and need to do DNS stuff for my example project drakonis: he's interested ZombieChicken: erkin: Yeah. Do you happen to know if there is anything comparable to Racket's gvector (growable vector)? mwette: zig: IIRC, at the lisp-C border emacs functions have compile-time switch to implement against X11 or (n)curses zig: oh zig: speaking of editor, someone recommended me the design of "hemlock" ZombieChicken: yeah. I think that's an emacs in CL erkin: I tried Hemlock before. erkin: It comes from the same lineage as Zmacs, the Lisp Machine Emacs. erkin: It's got a few interesting features. For instance instead of `M-x eval-buffer' it's `Extended command: Evaluate Buffer' erkin: s/feature/difference/ ZombieChicken: iirc, the underlying design of zmacs/hemlock would let it do things gnu emacs wouldn't be able to do well. Being written in CL and having no security features has it's advantages erkin: ZombieChicken: I just checked gvector.rkt erkin: It's an abstraction over vector. zig: https://en.wikipedia.org/wiki/Hemlock_(editor) erkin: https://github.com/racket/data/blob/master/data-lib/data/gvector.rkt ZombieChicken: 325 line abstraction. Thanks for the link, but you really didn't need to go through all that trouble erkin: I was curious. ;-P erkin: Yeah, it comes with a bunch of macros for iterating over it, some code for marshalling, some contracts etc. erkin: You can most likely trim it under 100 lines. ZombieChicken: honestly, I'd probably be better off accepting list as the One True Data Structure and do everything with that (and take the hit performance hit) since it would likely be the most portable across Scheme implementations erkin: Haha zig: so, in fact, looking at emacs or guile-emacs code will be useful for my future self. I will probably means that I am in. zig: erkin: what is the plan regarding guile-emacs? Do you have idea on how to get started? outside reading emacs manual :p ZombieChicken: I'm using gvecs in a (tiny) editor I've cobbled together to save display time erkin: There's also Edwin, written in MIT/GNU Scheme. ZombieChicken: but who really needs O(1) access times? ZombieChicken: (and by tny, I mean it's a subset of ed's functionality) zig: ZombieChicken: for what purpose are you using growable vectors? erkin: zig: Not sure yet. The first steps would be surveying the state of the code in both branches, comparing the changes, acquainting myself with the codebase, then going through the TODO list. erkin: It might be more feasible to dike out the Elisp interpreter in Guile, get it working in isolation, clean and polish it, then embed it back in there. ZombieChicken: zig: Storing the file. One line per entry, cut at the /n. Displaying any series of lines should be ~O(1) instead of O(n) zig: erkin: where are the sources? erkin: http://git.hcoop.net/?p=bpt/emacs.git zig: ZombieChicken: why is it growable? ZombieChicken: zig: To allow one to add lines to the file? erkin: It's five years behind the main branch, and on Guile v2.0. rekado: I’d like to use LOAD to load a source file that’s written in a language other than Scheme. Is this possible? ZombieChicken: It let me (hopefully) avoid having to copy the entire data struct whenever an addition is made dsmith: iirc, guile currently *does* have some internal support for elisp around the #f '() nil differnces. erkin: IIRC the version of Guile used in Guile Emacs contained patches that never made it upstream. rekado: I wasn’t able to figure out how to do this, so I’m using a horrible work around to compile the file first and then use LOAD-COMPILED. erkin: https://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-elisp erkin: This one. erkin: ZombieChicken: https://ecc-comp.blogspot.com/2015/05/a-brief-glance-at-how-5-text-editors.html ZombieChicken: erkin: What's that? erkin: How different editors implement lines. ZombieChicken: Ah. Thanks ZombieChicken: but I'm pretty dedicated to the route I've gone. I was asking about guile and gvecs for no other reason than we were discussing editors and was quickly pondering whether or not attempting to port my code over might help some other purpose erkin: Ah, I see. zig: (also rewriting is the noob approach, arguably) ZombieChicken: Depends on what one starts with, or how old it is ZombieChicken: erkin: Thanks for the link, though. It was interesting erkin: I'll see how DrRacket does it. ZombieChicken: Go for it, but I'm not particularly interested. I have my own ideas on how to do things, and havn't seen it through enough yet to watch it blow up erkin: Just out of curiosity. ZombieChicken: Yeah, that's certainly fine, and I'm listening if you run into something interesting zig: ZombieChicken: there pfds finger trees, if you want to quickly insert stuff between two indices or remove one row completly while keeping the order. zig: zig: that is what is used in azul.scm zig: for representing the text buffer... ZombieChicken: zig: pfds? ZombieChicken: hmm erkin: DrRacket uses a very complicated system of heterogeneous data structures. ZombieChicken: what is a finger tree? some flavor of b-tree? erkin: Editors can contain "snips" that contain images, richly formatted text objects or other editors. ZombieChicken: erkin: I'm not suprised. DrRacket can also be really slow in some cases erkin: Yeah, I suppose that's the price to pay. ZombieChicken: and yeah, it handles image inlining, at least in the output. I've no interest in doing something like that ZombieChicken: Hell, the 'editor' I have completely barfs if you try to read in, then write out, something that isn't text. ZombieChicken: Tried it with a PDF. I think it dropped about a megabyte of data SOMEWHERE erkin: Text is held in "string-snip" objects that contain the string with positional and stylistic metadata, and can be marshalled into text in a format called WXME. zig: ZombieChicken: https://github.com/ijp/pfds/blob/master/fingertrees.sls erkin: And... the editor holds the snips in a linked list! erkin: There we go. ZombieChicken: zig: Thanks. dsmith: Hmm. scm_memory_error seems to have gone away with no mention of a replacement in NEWS ZombieChicken: afk *: dsmith is working on scwm once again dsmith: sneek: later tell dsmith-testing Something dsmith: sneek: later tell dsmith-testing Something sneek: Got it. dsmith: sneek: later tell dsmith-testing Something else sneek: Got it. dsmith-test: hej sneek: dsmith-test!, you have 2 messages! sneek: dsmith-test, dsmith says: Something sneek: dsmith-test, dsmith says: Something else dsmith-test: great! dsmith: wingo: I changed the for-each to a named let and it's working fine. akhetopnu: what is the recommended websocket library for guile? dthompson's guile-websocket? akhetopnu: also where can I get a library for base64? `guix search base64` doesn't yield any results for guile, is it hidden somewhere in the ice-9 or r_rs ? dsmith: akhetopnu: Did you ever get your guile working? (no clue about the websocket lib, sorry) akhetopnu: yes I managed to install it through guix, it's impossible to find a *working* solution for emacs to make it run guile with proper loading paths, so I just run `guile --listen` in the terminal and then connect to it from emacs........ akhetopnu: incredibly frustrating, but I'm not aware of any better IDE for guile (or any scheme) dsmith: Especially if you are used to slime. (which I hear is quite awesome) akhetopnu: I switched to sly but yes, it's like you're programming on another level compared to other languages dsmith: Geiser is pretty good though. Been a while since I've used it (or scheme). akhetopnu: the introspection and live-coding capabilities are refreshing (if you can say that about something that's existed for decades :P ) akhetopnu: do you use something else for scheme? akhetopnu: by something else I mean 'not geiser' dsmith: Yeah. All these other IDE's are really just playing catch-up. dsmith: $DAYJOB is C and Bash an Python mostly. Embedded bare metal and Linux drivers. And MQTT and stuff. str1ngs: akhetopnu: geiser kinda does this well str1ngs: akhetopnu: geiser even has geiser-connect-local which does exactly what you want akhetopnu: I think i'm using connect-to-geiser or something akhetopnu: so that might be it str1ngs: geiser-connect creates its own REPL IIRC. so geiser-connect-local is preferred to connect to an existing REPL dsmith: I'm currently working on the build system to make install images for this guy: https://www.element14.com/community/docs/DOC-91420/l/avnet-industrial-iot-gateway-powered-by-raspberry-pi akhetopnu: I dream of an 'IDE' that you install and it doesn't do anything, it would have a list of well namespaces commands that you could use to build your own 'user profile', save it to a simple file with a list of key=value pairs per line that you could simply copy onto another computer and it would just work. You start with a blank screen and once you type a new unrecognized keybinding the editor asks you what did you intend to do. All the akhetopnu: editors I'm aware of start off with a ton of assumptions about how you're supposed to use them. akhetopnu: dsmith: that's low level stuff, do you enjoy doing it or are you thinking or switching to something else perhaps akhetopnu: not implying anything, just genuinely curious dsmith: Oh, I've always enjoyed being close to the metal. dsmith: Yeah, even emacs assumes a lot of things, though you can bend it around anyway you want if needed. akhetopnu: I can't find a base64 conversion package for guile anywhere, am I missing something or do people really write their own base64 conversion functions in every application they use? str1ngs: akhetopnu: maybe in guile-gcrypt ? str1ngs: (gcrypt base64) IIRC str1ngs: akhetopnu: https://notabug.org/cwebber/guile-gcrypt/src/master/gcrypt/base64.scm encode and decode suffice? akhetopnu: yes, I see this library can do hashes and other stuff too, should be good akhetopnu: I installed it through guix but guile doesn't see it, I need to sort these loading paths out... str1ngs: if you manual set GUIL_LOAD_PATH use the format found in ~/.guix-profile/etc/profile. or you could clobber it str1ngs: also GUILE_LOAD_COMPILED_PATH is helpful as well. str1ngs: also after installing if guix say source ~/.guix-profile/etc/profile . basically you need to restart your shell str1ngs: s/say/says akhetopnu: I added the `GUIX_PROFILE="/home/akhetopnu/.guix-profile"` and `. "$GUIX_PROFILE/etc/profile"` to my .bashrc but I guix didn't install the package into that folder str1ngs: guix install guile-crypt did not use that profile? akhetopnu: it installed it into /gnu/store/c64fi1b6qy4apvc8nza3palfii13fb5i-guile-gcrypt-0.2.1 str1ngs: guix package -l . does it list guile-gcrypt? akhetopnu: yes, all in `/gnu/store/...` str1ngs: install technically does not apply to guix. it is only used as a comfort to people used to traditional managers. str1ngs: guix install creates a profile of symlinks to the store str1ngs: thing of it as a modern GNU stow str1ngs: think* akhetopnu: im not familiar with GNU stow str1ngs: I made have just dated myself then :P akhetopnu: lol str1ngs: basically when you do guix install it creates link from the store to ~/.guix-profile/bin/* etc akhetopnu: but those are all executable files str1ngs: guix build actually do the installing to /gnu/store this is how guix is multi user and atomic at the same time. str1ngs: ls -l ~/.guix-profile/bin you will see they are all symlinks akhetopnu: only guile-tools is, th[02:31:08] it fired up guile repl str1ngs: then you did not use the file command akhetopnu: ah str1ngs: use stat instead if this is causing confusion akhetopnu: it says it's an ELF 64 bit LSB executable, dynamically linked etc str1ngs: that seems work str1ngs: wrong* str1ngs: stat ~/.guix-profile akhetopnu: it's a symlink to /var/guix/profiles/per-user/akhetopnu/guix-profile str1ngs: that is corrent str1ngs: now stat ~/.guix-profile/bin/guile ? akhetopnu: regular file str1ngs: and stat /var/guix/profiles/per-user/$USER/guix-profile akhetopnu: symbolic link str1ngs: ~/.guix-profile/bin/guile should be a symlink. you did use stat and not file? akhetopnu: I used stat akhetopnu: and it says 'regular file' str1ngs: I don't get that at all akhetopnu: I feel like I should remove it all and reinstall guix + guile, because the whole installation process isn't obvious to me and I was trying to make the loading paths work while installing, removing and reinstalling stuff over and over str1ngs: installing and removing with guix should not have adverse effects. it's multi user and atomic akhetopnu: if I installed guile through guix, should guile automatically see all consecutive packages installed through guix? str1ngs: are you on foreign distro? I'm assuming you are? akhetopnu: i'm on void linux str1ngs: yes, but it might require you to restart bash str1ngs: so given this guix install guile-grypt . guix package -i | grep gcyrpt should list guile-gcrypt akhetopnu: I did, and guile cannot find code for module (gcrypt base64) akhetopnu: hmm str1ngs: okay, but if you manually set GUILE_LOAD_PATH you can clobber guix's load paths akhetopnu: my GUILE_LOAD_PATH is set to /home/akhetopnu/.guix-profile/share/guile/site/3.0:/home/akhetopnu/.guix-profile/share/guile/site/3.0 str1ngs: if you do need to set them. use the format that ~/.guix-profile/etc/profile uses. str1ngs: yes but flatten guile-gcrypts file list and I bet you the site is 2.2 :P akhetopnu: it is str1ngs: try with find $(guix build guile-gcrypt) akhetopnu: so guile 3.0 won't see it str1ngs: right you are on the bleeding edge and probably using the latest and greatest guix pull ? akhetopnu: yes akhetopnu: from guix pull straight into my veins str1ngs: mainlining guix and guile o.O akhetopnu: the find $(guix build guile-gcrypt) listed probably all the files in all subfolders in my home folder str1ngs: no it list guile-gcypts files only akhetopnu: can't be because I'm seeing some node_modules and .js files str1ngs: akhetopnu: let me guix pull I think we can fix this by using guile 2 only in the profile meantime str1ngs: first do guix build guile-gcrypt str1ngs: does it error str1ngs: that sub bash command is bittle sorry not the best command at time akhetopnu: ah, i need the daemon for it str1ngs: umm that that's implied haha akhetopnu: ok now it listed some guile files 2.2 akhetopnu: so I should probably stick to the 2.2 version for now str1ngs: okay let me guix pull see if there is an easy way to resolve tis str1ngs: its api compatible not binary compatible akhetopnu: i see str1ngs: meaning you need to rebuild for 3.0 akhetopnu: the guile-fibers installation is taking its time huh... I wonder why it's taking so long, it's just 1 library akhetopnu: I don't understand how am I supposed to run `guile --listen`, should I create a fifo pipe and pass it as the argument to --listen? I try `--listen=guile.sock` and it's showing me the help message akhetopnu: if I run `guile --listen guile.sock` it tries to compile the guile.sock file akhetopnu: it says 'listen on a local port or a path for REPL clients` akhetopnu: I can run `guile --listen` and it will listen on some default port on localhost. So when I connect to it with emacs a strange thing happens. When I type `(use-modules (gcr` it company mode doesn't autocomplete it, but if I finish typing it and C-c C-c it will load and then I can use the base64-* functions str1ngs: akhetopnu: does gule --listen=$PWD/guile.socket work? str1ngs: guile* akhetopnu: permission denied akhetopnu: i feel like I shouldn't need to run it as a superuser str1ngs: no lol str1ngs: see if the file exists already akhetopnu: ah, sec str1ngs: you need to clean up your socket when you are done with it akhetopnu: yes, it works, I was in another directory akhetopnu: however it doesn't autocomplete gcrypt for some reason str1ngs: maybe it only handles absolute paths. not relative paths. try with --listen=./guile.socket vs --listen=$PWD/guile.socket akhetopnu: in emacs, I mean str1ngs: probably because emacs is using an order GUILE_LOAD_PATH akhetopnu: I get autocompletion for ice-9 and all that though str1ngs: assuming you are using GUI EMacs akhetopnu: yes str1ngs: you probably need to relog your X11 session str1ngs: or.. use emacs-guix and load the environment :P pro trick str1ngs: akhetopnu: .. use emacs-guix and load the environment :P pro trick akhetopnu: there is no such package available akhetopnu: also after rebooting emacs still doesn't autocomplete it akhetopnu: it must be residing in some unexpected folder akhetopnu: weird, because my GUILE_LOAD_PATH is .guix-profile/share/guile/site/2.2 and `find . -name gcrypt` found 2 paths with this name akhetopnu: one of them being the GUILE_LOAD_PATH str1ngs: and in emacs (getenv "GUILE_LOAD_PATH") ? akhetopnu: nil, lovely str1ngs: did you install emacs with guix? akhetopnu: no akhetopnu: ...should I? str1ngs: don't have to . the main thing is you need provdie X11 with variables str1ngs: or emacs akhetopnu: i started emacs from terminal and now it shows proper GUILE_LOAD_PATH but it still cannot autocomplete use-modules with gcrypt str1ngs: I would not worry about that completion. what about once you use the package? str1ngs: completion whould work then akhetopnu: the functions are available to use str1ngs: (use-modules (gcrypt base64)) does not complete for me. but the bindings do once it's used str1ngs: think that pretty normal akhetopnu: weird. I jumped to the source of (ice-9 futures) and it's inside some /gnu/store/...-guile-2.2.6-1/share/guile/2.2/ folder. There is also a `web` folder but I cannot get autocompletion for it akhetopnu: at least it works once loaded str1ngs: akhetopnu: I think that gets you setup based on your workflow? akhetopnu: more or less, but I'm sure something will get borked soon enough akhetopnu: knowing myself akhetopnu: thanks for help, it would've taken me much longer otherwise spk121: daviid: guile-gi doesn't require libgtk-3-dev except for its examples and test suite. But depending on your distro gobject-introspection may have a package dependency with libgtk-3-dev zig: hello #guile :) chrislck: a bit annoying how emacs indents call-with-values... mwette: chrislck: add (put 'call-with-values 'scheme-indent-function 0) in your *scratch* buffer and hit C-x C-e; if you don't like that change 0 to something you like akhetopnu: could've ended the sentence at 'emacs' /s mwette: change 0 meaning 1 or 2 chrislck: thanks... makes you wonder what they're trying to promote/indicate with their indent chrislck: unless it's a genuine bug mwette: I've seen others with this type of indent behavior akhetopnu: I'm looking at (ice-9 match) and I'm not sure how would I go about matching a list of lists of certain shape and store it into a variable akhetopnu: I see I can match (pat_1 ... pat_n) but I have to actually know the number of elements akhetopnu: do I have to manually do an if-else type of check and manually type (let ((x )) ...) to do something with it? mwette: akhetopnu: maybe match on (head . tail) and loop with counter ? akhetopnu: yeah I can do the head and tail thing but I still have to do my own check on every element and then next a body of stuff to do with it akhetopnu: ideally I would do something like (match ((my-list ... (symbol _)) (display my-list))) and this would print the list of pairs of (symbol ) onto the screen, otherwise do nothing akhetopnu: it seems like a basic thing to do but I can't figure out if one of the patterns in guild manual fits this case akhetopnu: guile* mwette: you can match parts at the front and leave the rest to `. rest)' mwette: or write a custom matcher with syntax -- look at system/base/pmatch.scm akhetopnu: ok, let me put it this way akhetopnu: is it possible to match a list of numbers? any length akhetopnu: it's possible, via pattern (number ..1) (this matches 1+) akhetopnu: analogically (number ..2) matches 2+ numbers : D akhetopnu: I don't understand this match library... I can match a list of 2 numbers with (number ..2) but I can't say (list number number) or even (number number) mwette: check the `catamorphisms' subsection in the sxml-match section of the guile manual; there are some examples there daviid: str1ngs: so, none of the distro I am aware of offer to install libgdk-3 without libgtk-3 daviid: str1ngs: and hence, it would be a complete loss of time to write somethng that checks if libgdk-3.so - in all distro i am aware of, this means the gtk+-3.0 is installed, and therefore, not can we, but must we call PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.24.0) daviid: spk121: no matter what, if a guile-gi user wants gdk event support, he/she must install gtk+-3.0, right? mwette: FYI, I ported bug to ubuntu against 18.04: they install guile as guile-2.2 and guile, but none of the other *-2.2 tools, only guild, etc; this hoses guile extension config scripts written w/ guile.m4 if you have a different version installed daviid: mwette: I think manual installation, running the make dance using a tarball, als fals to add the postfix to those scripts, I did mention that quite a lng time ago, never checked if this was solved zig: s-expr based regexp are very neat. daviid: str1ngs: to make it short, there is no way to only install libgdk-3 daviid: hence I decide to get this PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.24.0) back in the configure.ac file of GGolf daviid: *g-golf akhetopnu: is there a way to destructure function arguments? example: (define (fn a b (c d)) ...) where you would call it like (fn 1 2 (list 3 4)) so c = 3 and d = 4? mwette: daviid: not sure what you are referring to: for my package nyacc I have added workarounds in my config scripts to deal with it. I let user provide GUILE= argument to configure daviid: str1ngs: fyi, libclutter-1.0-dev depends on it as well, because it needs Gdk Event support, not becaue it needs gtk support ... that's thw way the gnome team orginazed thing, there is nothing we can do about this daviid: mwette: ok daviid: str1ngs: i pushed the configure.ac fix daviid: now I shall work on other gdk events dsmith: Should (debug-enable 'debug) still work? zig: akhetopnu: look into define* zig: akhetopnu: or match zig: akhetopnu: btw if you don't know it yet, the procedure index is a very handy bookmark: https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html zig: akhetopnu: sorry, I did not read that you already know about match zig: akhetopnu: did you try the (a b c . rest) pattern to solve your problem? akhetopnu: I didn't, but by destructuring I mean something like javascript's `function asd(arg1, arg2, { key }) { }` akhetopnu: but I guess I can use match for that akhetopnu: There are lots of these 'SRFI-*' libraries, is there some sort of 'srfi index' website where I can browse the contents of all of these libraries? It would allow newbies like me to learn the APIs much faster akhetopnu: ah, the index you linked seems to list methods in those libraries lampilelo: the ones that are implemented in guile are in its info manual lampilelo: if you want to see more documentation you can look here: https://srfi.schemers.org/ dsmith: sneek: seen unknown_lamer sneek: unknown_lamer was here Jan 16 at 03:34 pm UTC, saying: basically working is a start after ten years of gathering dust :). dsmith: unknown_lamer: I think I found the -D and -S options problem dsmith: unknown_lamer: guile 3 doesn't like "(debug-enable 'debug)" in Main.C daviid: lloda: one can 'simply' merge the wip-truncated-exception brach on master right? dsmith: unknown_lamer: One other thing I'd like to see. Get rid of the Mutex Init... Mutex: 0x1b67e14 Thread: 0xbfe8a46c dsmith: *** sneek_ (~sneek@cpe-65-185-85-154.neo.res.rr.com) has quit: Remote host dsmith: closed the connection dsmith: *** sneek (~sneek@cpe-65-185-85-154.neo.res.rr.com) has joined channel #guile dsmith: [14:1 zig: akhetopnu: lookup define* and lambda* what you are looking for (it seems like) keyword argument. There is no way to destructure the equivalent of {a: b, c: d, ...} the way javascript does. zig: but you can use keyword arguments. jayspeer: hello, is this a good channel to ask general scheme question? dsmith: jayspeer: Sure, but you might want #scheme instead. jayspeer: I'll be sure to check it out :) thanks dsmith: But feel free to ask here jayspeer: so, I'm going through sicp and I'm stuck on 2.54 jayspeer: I'm trying to define "equal?" function and I'm clueless why it doesn't work jayspeer: here is the code snippet jayspeer: https://paste.debian.net/1126566/ jcowan: jayspeer: What does not work exactly? jayspeer: it fails on "car", though it should not get there in the first place jayspeer: if you test (my-equal? '(a) '(a)) it fails with "expecting pair" in procedure car jayspeer: oh, I think I know what's going on jayspeer: first condition fails cause nil is not a symbol, but I though it was jayspeer: then car can't get anything out of nil cause it is not a pair dsmith: You might want pair? instead of list? jayspeer: I tried pair? and then lists '(a) '(a) are not equal :) this will need further investigation from me :D jayspeer: I need to handle nil case better dsmith: In guile, (list? '()) => #t dsmith: dsmith: '() is nil for you I think. jayspeer: yeah I'm aware of that, thanks dsmith: And can't take the car of that.. jayspeer: ok I got it. I switched first if condition to (or (symbol? a) (nil? a) ...) and it works as expected. I took longer than I'm willing to admit to finish this exercise :D jcowan: A style point: anything of the form (if p #t #f) can be reduced to just p jcowan: that would declutter you code quite a bit. jayspeer: jcowan: it sure did, thanks narispo: hey, thanks a lot to the devs for Guile 3 JIT. What would it take to obtain a ppc64[le,be] JIT as well? dsmith: sneek: botsnack sneek: :) dsmith: sneek: later tell dsmith Testing sneek: Got it. dsmith: hey sneek: Welcome back dsmith, you have 1 message. dsmith: bah *: sneek yawns bandali: woah dsmith: sneek: later tell dsmith Testing again sneek: Will do. dsmith: hey sneek: Welcome back dsmith, you have 1 message. dsmith: Ok, why would for-each be unbound? daviid: dsmith: being in a module that doesn't use core guile? this quiz you asked on the ml ... maybe related, don't know dsmith: hey dsmith: sneek: later tell dsmith Testing again sneek: Got it. dsmith: hey sneek: Welcome back dsmith, you have 1 message. dsmith: sneek: later tell dsmith Testing again 3 sneek: Will do. dsmith: sneek: later tell dsmith Testing again 4 sneek: Welcome back dsmith, you have 1 message. dsmith: sneek: later tell dsmith Testing sneek: Got it. dsmith: hey sneek: Welcome back dsmith, you have 1 message. dsmith: "Unbound variable: for-each" How can that be? dsmith: sneek: later tell dsmith Testing sneek: Got it. dsmith: hey sneek: Welcome back dsmith, you have 1 message! daviid: dsmith: do you have a repl, while working on this bot code? you could try things like (module-bound? the-root-module 'for-each), (module-bound? (current-module) 'for-each) ... dsmith: Nope dsmith: sneek: later tell dsmith Testing sneek: Got it. dsmith: Nope sneek: Welcome back dsmith, you have 1 message! dsmith: sneek: later tell dsmith Testing dsmith: Oooo dsmith: sneek: later tell dsmith Testing dsmith: sneek: later tell dsmith Testing sneek: Got it. dsmith: hey sneek: Welcome back dsmith!, you have 1 message! dsmith: sneek: later tell dsmith Testing sneek: Got it. dsmith: hey sneek: Welcome back dsmith!, you have 1 message! sneek: dsmith, dsmith says: Testing dsmith: Well. Sorry for the noise dsmith: sneek: later tell dsmith-test Testing 1 sneek: Will do. dsmith: sneek: later tell dsmith-test Testing 2 sneek: Got it. dsmith: sneek: later tell dsmith-test Testing 3 sneek: Got it. dsmith: ok dsmith-test: hey sneek: Welcome back dsmith-test!, you have 3 messages! sneek: dsmith-test, dsmith says: Testing 1 sneek: dsmith-test, dsmith says: Testing 2 sneek: dsmith-test, dsmith says: Testing 3 dsmith: sneek: botsnack sneek: :) *: sneek wags dsmith: sneek: later tell civodul Topic needs updating! sneek: Will do. dsmith: sneek: later tell wingo Topic needs updating! sneek: Okay. nly: ah, thanks zig dsmith: akhetopnu: You are on 64bit intel? (well, "amd") right? dsmith: not ppc or mips or something? dsmith: sneek: later ask wingo Why would for-each be unbound? sneek: Okay. rlb: wingo: bootstrap time here for 2.2.6 ~44m, for 3.0 ~30m. str1ngs: hello daviid, I have been porting my key events to g-golf. And so far it's working great. akhetopnu: dsmith: yes I'm on 64bit akhetopnu: I did `guix pull` twice and it failed both times, it can't compile some dependencies... civodul: Hello Guilers 3! :-) zig: 2:) zig: oops zig: 3:) natrys: it could be great if there was a docker image or maybe an alpine package civodul: yeah civodul: someone could do that with "guix pack" civodul: natrys: here's a tarball: http://web.fdn.fr/~lcourtes/software/guile/guile-3.0.0.x86_64-linux.tar.gz (+ .asc) civodul: you can unpack it anywhere on your file system and run "./bin/guile" akhetopnu: will it properly setup all the dependencies? civodul: yes civodul: it's entirely self-contained natrys: civodul: can confirm it works, thanks :D civodul: awesome :-) akhetopnu: I downloaded the binary, and after running it and typing ctrl+c ctrl+d it gets into an infinite loop of messages akhetopnu: is that supposed to happen? wingo: akhetopnu: don't think so, it just keeps printing things out? sneek: Welcome back wingo!, you have 2 messages! sneek: wingo, dsmith says: Topic needs updating! sneek: wingo, dsmith says: Why would for-each be unbound? akhetopnu: wingo: yes wingo: weird wingo: works for me, fwiw akhetopnu: then when I type (or 'enter') i get a backtrace wingo: ah yes i see it now :P wingo: that is a bug :P civodul: the first 3.0 bug i guess, congrats! :-) akhetopnu: lol nice wingo: i wonder why it fails to install the locale wingo: civodul: do you know? civodul: the binary? wingo: yeah civodul: ah wingo: i run /tmp/bin/guile and it prints the warning civodul: i guess it lacks the relevant locale data civodul: wingo: you're not testing on a Guix machine, are you? civodul: (you'd get different results) wingo: i am testing on an ubuntu machine with guix userspace civodul: ok wingo: the binary does work tho civodul: i guess we could include glibc-utf8-locales in the pack wingo: would be nice if it included readline too :) civodul: ah yes civodul: lemme try again then :-) wingo: wow the C-c thing is bonkers, there seems to be a thread that outlives guile civodul: uh wingo: like it appears to put me back at the shell but then the next thing i press, infinite series of fport-related errors civodul: i think it happened to me on 2.2, though i don't remember under which circumstances wingo: i wonder if it's somehow specific to the wrapper in packs civodul: wingo, akhetopnu, natrys: i've uploaded a new version in place that contains guile-readline and locale data civodul: you need to do ". ./etc/profile" to set up env vars though civodul: wingo: it could be civodul: would be nice to strace it akhetopnu: I downloaded it again, ran . ./etc/profile and then ./bin/guile but the issue persists akhetopnu: and this time pressing Enter at the end doesn't stop it wingo: no code for module (ice-9 readline) wingo: civodul: ^ wingo: also still no locale data wingo: ah wingo: didn't know about the profile thing lloda: really readline should be set up by default lloda: it's a bump civodul: wingo: does it work if you do ". ./etc/profile" first? wingo: i had tried to do `bash --init-file etc/profile -c bin/guile` but lemme check sourcing the profile wingo: yeah same error civodul: so ". /etc/profile" has no effect? wingo: no effect on the behavior wingo: i do ". /tmp/etc/profile" of course wingo: because i extracted in /tmp but it splat gnu/, etc/, and bin/ right there wingo: which i thought was a bit rude but whatever :) civodul: it is a bit rude, indeed :-) civodul: i don't get why ". /tmp/etc/profile" wouldn't be enough civodul: it should define GUILE_LOAD_PATH & al, and they should be valid in the namespace of ./bin/guile civodul: wingo: BTW, is it on purpose that exception-with-kind-and-args?, quit-exception? etc. are not exported? wingo: civodul: regarding exception-with-kind-and-args?, i think the intention was that you would know when you need kind and args, and in that case just call exception-kind / exception-ars wingo: *exception-args wingo: with the understanding that if guile migrates to more structured exceptions, it could be those calls build the kind and args on the fly wingo: for quit-exception? i think it was simply that i didn't want to add to the default environment. but (ice-9 exceptions) should probably export it wingo: wdyt? civodul: adding quit-exception? to (ice-9 exceptions) sounds good to me wingo: plz do :) civodul: re exception-with-kind-and-args?, yeah, got it civodul: in my case, i have a srfi-34 handler and i wanted to check whether i have a key & arg thing so i can get the same behavior as on 2.x civodul: so i need to distinguish between &exception-with-kind-and-args and something else civodul: it's transitional though, so it's not all that important wingo: i see, yeah wingo: like you would pass on the exception in that case, if it's not a srfi-34 exception? wingo: i would use (exception-predicate &exception-with-kind-and-args) in that case i guess wingo: though it's tricky to know what you want, there civodul: yes, i've used exception-predicate, so no big deal civodul: i was just wondering why it wasn't exported *: wingo nod wingo: if you decide to export it that's fine too wingo: though it would need good docs to discourage use :) wingo: maybe write a mail to guile-user about how to manage the srfi-34 transition janneke: hmm, it seems guile does not find module files named `foo.bar.scm' civodul: wingo: yeah maybe it's best to not export this one civodul: i'll add the quit-exception? export though, for consistency janneke: although foo.bar/baz.scm does work (foo.bar baz) wingo: thumbsup janneke: eh. foo.bar/baz.scm (foo.bar baz) civodul: actually make-quit-exception is not exported either, i guess it should? civodul: hey janneke civodul: janneke: is that on 2.2? wingo: civodul: i guess! janneke: yeah! oops *: janneke not even tested it on 3.0 janneke: sorry! janneke: civodul: also on GNU Guile 2.9.8 /me goes to update guix janneke: should this be fixen in 3.0? civodul: janneke: no idea, i was just wondering civodul: perhaps it's still there janneke: yeah, i guess so janneke: i tried overriding %search-path, which also seems to have this bug; but it seems module loading does not use that, down the rabbit hole janneke: yes, also with guile 3.0 akhetopnu: what would be the closest equivalent of common lisp's defstruct in guile? I'd like to define a struct like (defstruct item id value) and then have all the functions generated for me, i.e. (item-id item) or (item-value item) returning corresponding slots in the struct natrys: civodul: shouldn't paths in etc/profile be relative for it to work? (it's absolute now e.g. /gnu/...) lloda: akhetopnu: https://www.gnu.org/software/guile/manual/html_node/Record-Overview.html lloda: or goops I guess akhetopnu: thanks civodul: natrys: they are absolute, but they're valid in the context of the running ./bin/guile wingo: janneke: i think it would be the same on 2.2 and 3.0 civodul: natrys: i've just tested it on Trisquel and it works for me BTW, so not sure what's going on str1ngs: hello janneke, using scheme what is the best way to catch emacsy-ran-undefined-command?. I seem to have to call emacsy-tick twice which doesn't seem right. str1ngs: janneke: I fixed this in the examples for C. but maybe I'm missing something in scheme. janneke: wingo: yes, it's the same janneke: str1ngs: what do you mean "catch"; i think "emacsy-ran-undefined-command?" is just a boolean? *: janneke hasn't looked at this for quite some time janneke: i seem to remember there was an unsolved puzzle here; great that you made it work in C! str1ngs: ell. str1ngs: well* str1ngs: emacsy_tick sets emacsy-ran-undefined-command? which indicates an unknown key. so keys can be passed down to controls str1ngs: the problem is in scheme you need to call (emacsy-tick) twice to test emacsy-ran-undefined-command? which works but causes other issues like minibuffer contents to be overwritten. str1ngs: janneke: I'll look into this more. seems like a common pain point. str1ngs: janneke: in short (emacsy-tick) needs to be called twice to catch emacsy-ran-undefined-command jonsger: Guile 3.0 news hit heise.de, a big German tech site, including your benchmark graph wingo https://www.heise.de/developer/meldung/Programmiersprache-Guile-3-0-fuehrt-Just-in-time-Codegenerierung-ein-4640315.html :) wingo: jonsger: neat :) jonsger: one comment: "Webassembly is Guile - just s-expressions" ("Webassembly ist quasi Guile - alles S-Expressions!") zig: :) nly: hello zig nly: are you planning to add srfi-173, hooks to Guile? zig: I had no such plan zig: nly: sorry I got disconected. No I had no plans to add srfi-173 to Guile, the implementation is straight forward, feel free to use / fork it. dsmith: wingo: What could possibly cause for-each to be unbound? I ended up use'ing srfi-1 as a workaround. wingo: dsmith: no idea! how did you produce that bug? wingo: did you perhaps #:export (for-each) in a module? wingo: or make a module #:pure? dsmith: Nope. And nope. nly: ok dsmith: wingo: Other files in same dir have no problem. dsmith: wingo: So there is code that queries the db for "later tell" messages. dsmith: It could return a list or #f dsmith: Mostly it returns #f. wingo: can you point me to the code? dsmith: Yeah. dsmith: sneek: paste? sneek: paste is https://paste.debian.net dsmith: wingo: https://paste.debian.net/1126405 dsmith: wingo: deliver-messages wingo: dsmith: does any of the other modules you import export a for-each ? dsmith: No dsmith: ../scripts/bot/infobot.scm: (for-each (lambda (line) (bot:say to line)) lines) dsmith: ../scripts/bot/infobot.scm: (for-each dsmith: ../scripts/bot/parsing.scm: (for-each (lambda (tok) dsmith: ../scripts/bot/tell.scm: (for-each send messages))))) dsmith: That's a grep wingo: weird dsmith: Indeed. for-each is in boot-9. You would think other stuff would be broke too. dsmith: wingo: Is there a way to disable some optimizations locally, like for one fuction? wingo: are these files even compiled? dsmith: Yes wingo: and you don't get a warning about for-each being unbound? dsmith: Well, there are .go files. wingo: do you have a link to the git dsmith: No. It't not in a repo. wingo: yeah dunno tho, i have to guess it's something about whatever it is that makes you need to call (module-public-interface (current-module)) dsmith: Yeah, that was suspicious to me. That's the bobot++ code doing that. dsmith: Not sure what that is attempting to do. dsmith: Adding the bobot code to the guile module I think. dsmith: This is 32bit x86, btw civodul: can you imagine? sneek may well end up being 4 times faster! civodul: perhaps it'll reply before we're done typing? dsmith: lol *: sneek giggles dsmith: sneek: later tell dsmith-testing something sneek: Will do. dsmith: sneek: later tell dsmith-testing something else sneek: Got it. dsmith: sneek: later tell dsmith-testing even more stuff sneek: Okay. dsmith-testing: Ok? sneek: dsmith-testing!, you have 3 messages! sneek: dsmith-testing, dsmith says: something sneek: dsmith-testing, dsmith says: something else sneek: dsmith-testing, dsmith says: even more stuff dsmith-testing: Yey dsmith: Working now. dsmith: Very puzzling dsmith: And suprising dsmith: wingo: Thanks again for all your efforts! dsmith: Amazing work. wingo: what did you change? :) dsmith: Using srfi-1 for-each chrislck: one of these days we'd need some help setting up a good environment for debugging guile-3.0 in gnucash... don't think other the devs have time for this *: janneke sent bug+patch for foo.bar.scm module dsmith-work: Happy Friday, Guilers!! mwette: I have a four-day weekend -- yay. daviid: happy friday! daviid: str1ngs: good! fyi, I just pushed a code review patch about event and event strucutres, the thing is, while talking about this on #introspection, one of the main dev highly recommended not to parse the gdk event structures, but rather, use their respective accessors - the main reason being that in GTK4, GdkEvent is an actual GObject, and it's completely opaque daviid: this means that forward-compatible code should consider GdkEvent and friends opaque pointers even in GTK3 daviid: because of this change, I also (had to) remove some of the previously defined accessors, the git log list those that I removed and those that are kept civodul: how does one disassemble the code around $ip, like "x" in GDB? daviid: wrt , users should probably only be interested by the gdk-event-key:state, gdk-event-key:keyval and gdk-event-key:keyname (which is not a 'real accessor', but I thought much better to make it appear 'as if' then to impose users to call gdk-keyval-name on the gdk-event-key:keyval ... daviid: now I should start to work o other gdk event structures, if you have a pririty wish let me know :) spk121: daviid: good to know. daviid: spk121: yes indeed :) lispmacs[work]: hi, last night I was troubleshooting some Guile code embedded in a C application linked to Guile 2.6.6. The program is multi-threaded (pthrea) where some guile code is running in a main thread and some in another thread. I was getting this strange effect where if lots of calculations were happening in the child thread, (sleep) calls in the main thread would complete faster than they were supposed to lispmacs[work]: like, a 10 second sleep was finishing nearly instantaneously, but if I reduced the amount of calculations in the other thread, it would increase to a 3 seconds wait lispmacs[work]: just wondering if anybody had any thoughts on what might explain that. It was running on a Gnu Guix amd64 system lispmacs[work]: *2.2.6 manumanumanu: lispmacs[work]: using srfi-18 threads or regular guile threads? akhetopnu: hello. I'm playing with fibers and I'm running the example through geiser. When I evaluate the (run-fibers ...) part everything is ok, however when I press C-c to have it evaluate in quick succession after about 2 seconds I get a message in the REPL: `scheme@(guile-user)> Aborted` and guile exits. I should probably add I'm running `guile --listen` in the terminal and then connecting to it from emacs using `M-x connect to guile RET RET` lispmacs[work]: manumanumanu: regular quile threads, though near as I can tell in the source thread-sleep! just maps to a sleep call lispmacs[work]: *guile lispmacs[work]: I suppose if Guile is just binding to coreutils sleep, than it would have to be some quirk of that C function lispmacs[work]: oh wait, coreutils is the command line version zig: akhetopnu: oops :) lispmacs[work]: I'm reading all kinds of interesting stuff in the libc info manual about how unsafe sleep() is akhetopnu: what is the recommended websocket library for guile? dthompson's guile-websocket? ng0: announcement of new major guile ve[20:44:12] *** Quits: lfam (~lfam@2607:fb90:631d:37ec:bd12:d1b9:ff09:41be) (Ping timeout: 260 seconds) str1ngs: daviid: okay good to know will this mean gtk can be dropped as a dependency as well? str1ngs: daviid I have no priorities, most of what I need is there in the accessors you mentioned already. But I will report any if I run into. Thanks daviid: str1ngs: I removed the 'explicit' gtk+-3.0 dependency in the configure.ac a little while ago - I only added it because I tried something in libg-golf, which needed the gtk libs and flags daviid: str1ngs: but I am a bit confused now, because the (g-golf init) module gained (define %libgdk (dynamic-link "libgdk-3")) - on debian, libgdk-3.so is part of the libgtk-3-dev:amd64 - so i think I might have to add it again? str1ngs: daviid right libgdk-3 makes gtk a dependency zig: ng0: neat ;) daviid: spk121: what do you do in guile-gi? wrt gdk event/gtk dependency i mean? str1ngs: but you can might need need libgtk-3-dev. since dynamic-link makes it a runtime dependency . not sure how to test this in configure.ac though. pkg-config is nicer but not exactly required. str1ngs: not need* str1ngs: maybe it's best to just use pkg-config for now so it all works nicely. I'm just thinking in cases where people are just using clutter or some lower other GI not related to GTK daviid: str1ngs: make will fail if it can't find "libgdk-3" daviid: str1ngs: it iwould next to impossible to use clutter without gdk events either str1ngs: I think it depends on the tests. I know libgirepository-1.0 is used during the test. str1ngs: in which case I'd test in configure.ac if clutter needs gdk daviid: i definitely need to get rid of using clutter in the tests daviid: but that is something else str1ngs: I think the clutter tests are still useful right now. but I understand your reasoning. str1ngs: maybe you can move clutter tests in a place that is not called by make check maybe make check-clutter str1ngs: so clutter is not a depend to run API checks daviid: str1ngs: i used clutter just as a convinient way of, but all tests can/should oly depend on what configure checks to be installed str1ngs: that's understandable. though with GI it's nice that things are not required explicitly since they are all loading at runtime. It's one of the benefits over C str1ngs: I guess I did'nt want the clutter tests to goto waste since they are convenient tests as you mentioned. daviid: i beleive if guile-gi offers gdk event support, it checks at configure time that libgtk-3-dev:amd64 is installed str1ngs: that makes sense, but as I mentioned if you don't use libgtk in headers or C files. you only need libgtk-3-0 not libgtk-3-dev. maybe too much of a nuance? daviid: i don't beleive it is possible to compile guile-gi without libgtk-3-dev, if it offers gdk event support?, let's see what spk121 has to daviid: *has to say :) str1ngs: sounds good, this ban be revisited when there are more users. I'm stilling groking how best to handle dynamic GI depends myself. in regards to scheme. str1ngs: s/ban/can daviid: i'll check the guile-gi configure.ac file - i think guile-gnome does only offer support when it finds gtk, but that complicates quite a lot the autotool chain 'arrangement' so to speak, maybe 'imposing' PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.24.0) is ok- after all, trying to use a GI typelib without gdk event sound highly improbable? daviid: have to go, bbl str1ngs: daviid that is the easiest way yep str1ngs: daviid I think though it would be nice to check only for libgdk useing dlopen if possible using autotools. but PKG_CHECK_MODULES will suffice for now. civodul: it seems that the md5 test of the latest guile-lib "hangs" with Guile 3 civodul: has anyone tried? bandali: slyfox, i think they froze it; but feel free to bump that bug and cc wingo i guess :) dsmith: unknown_lamer: The clues from wingo helped. Still not quite there yet. dsmith: The bot can write to the channel, but seems to have trouble responding from a db query. dsmith: I fussed with the db interface today at work, and it seems to be ok. dsmith: I might need to dump and restore the db. dsmith: The current plan is trying to bring the bot up on 3.0 on an intel box temporarily while I try to squeeze a Stable Debian into 2G (1.7G actually) dsmith: sneek: seen wingo sneek: wingo was here Jan 15 at 10:02 pm UTC, saying: night!. dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen unknown_lamer sneek: unknown_lamer was here Jan 15 at 03:24 pm UTC, saying: if you don't figure it out lmk and I can try to take a look later. dsmith: !uptime sneek: 20:34:51 up 53 days, 3:46, 1 user, load average: 0.44, 1.50, 1.52 dsmith: !uname sneek: Linux gpib 4.9.0-11-686 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) i686 GNU/Linux dsmith: sneek: info dsmith: !info dsmith: sneek: version sneek: Sneeky bot running on Guile version 2.9.9 using bobot++ 2.3.0-darcs dsmith: What! dsmith: sneek: version dsmith: sneek: botsnack sneek: :) dsmith: Hmm. dsmith: sneek: botsnack sneek: :) dsmith: !uptime sneek: 20:43:27 up 53 days, 3:54, 1 user, load average: 0.05, 0.36, 0.90 dsmith: sneek: version sneek: Sneeky bot running on Guile version 3.0.0 using bobot++ 2.3.0-darcs dsmith: Yesss!!! cnmne: yay !! manumanumanu: Good morning everyone! What are y'all up to? RhodiumToad: hating the tire fire that is the web and its browsers manumanumanu: RhodiumToad: Writing for the browsers or using them? RhodiumToad: having to randomly add or remove stuff from ill-defined markup languages in order to try and get sensible output manumanumanu: ah. Joyful times! manumanumanu: I write most of my things in an old XML doctype I wrote in 2006 and have XSLT that I don't dare touch that just works. RhodiumToad: hah *: RhodiumToad noticed that nobody cared about his sxml bug manumanumanu: What bug? RhodiumToad: incorrect parsing of CDATA manumanumanu: ouch. RhodiumToad: apparently the author misread the spec RhodiumToad: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38269 manumanumanu: did you try reporting it upstream? RhodiumToad: I've reported it everywhere I could find RhodiumToad: ssax mailing list, even though that's had nothing for years; comp.lang.scheme, etc. manumanumanu: hmpf. manumanumanu: that is indeed a very buggy bug manumanumanu: and quite obvious. RhodiumToad: I find it fascinating that it's been something like 20 years and nobody seems to have noticed before manumanumanu: It is not like it is a small bug. Maybe people only use SSAX to generate HTML from sxml? manumanumanu: I'll try to look into it and see if I can submit a patch upstream whatever use that might be. RhodiumToad: it would have been good if the standard xml validation suite had an instance of > inside cdata; it has tests for < and (iirc) & but not > RhodiumToad: probably because whoever wrote the tests didn't anticipate that anyone would misread the spec badly enough to process > but not < manumanumanu: the procedure is ssax:read-cdata-body manumanumanu: and it has special handles for tokens starting with #\&. Shouldn't that just be ripped out? manumanumanu: CDATA is anything that isn't literally ]]>, no? So there should be no handling of any &blah; manumanumanu: wrong. Both CDATA and PCDATA is handled by the same code. RhodiumToad: cdata needs to process two things: newlines (for canonicalization) and literal ]]> for end of cdata, nothing else RhodiumToad: so #\& needs to be removed from the delimiters, and the (#\&) section in the case ripped out peanutbutterandc: Hello there RhodiumToad: also if you care about the test cases, those do test for the wrong behavior, so that should be fixed too RhodiumToad: good morning peanutbutterandc: I know this is the last day for guile 2.2.x, but I think I have found something strange. I was trying to go through the book Simply Scheme and I did (load "simply.scm") (the book's extensions to scheme) and it works in scm, mit-scheme, tinyscheme; but with guile, running (word 'com 'puter) seems to be stuck in an infinite loop - with my cpu maxed out, too (one core atleast). peanutbutterandc: Good morning! peanutbutterandc: I am running `guix install guile-next` to see if that happens even in guile2.9.9 just to make sure peanutbutterandc: Here is the scheme initialization file from the book: https://people.eecs.berkeley.edu/~bh/ssch27/appendix-simply.html manumanumanu: RhodiumToad: The racket sxml version is the same. RhodiumToad: yup. every copy of the ssax parser I found is the same. RhodiumToad: peanutbutterandc: interesting, I get the same RhodiumToad: it seems to be looping in compile, not even getting to execute the code? peanutbutterandc: Whoa! Installing guile-next kinda' over-wrote guile in my guix profile. uh uh peanutbutterandc: I guess it was to be expected but still manumanumanu: RhodiumToad: submitting a bug report there. There has been some activity there, and I know it has seen some use in racket. Maybe the maintainer of the package knows his/her way around the code better than I do. peanutbutterandc: Is there an option to tell guile to not load any init files? manumanumanu: peanutbutterandc: in interactive mode you can use -q peanutbutterandc: manumanumanu, Great! Thank you! peanutbutterandc: RhodiumToad, (word 'comp 'uter) works just fine in guile2.9.9, however. So I suppose it is all right. It's only one more day for 2.x series anyways. :) peanutbutterandc: Guile isn't going to do the Python thing and extend support for the 2.x series for another decade, now, is it? :D RhodiumToad: peanutbutterandc: it's the strings-are-numbers thing at the end that breaks it peanutbutterandc: That reminds me, 2.x - will it be obsolete from tomorrow? RhodiumToad: I sincerely hope not peanutbutterandc: RhodiumToad, I see... I wouldn't know. Hmm... I thought guile2.x code was compatible with guile3.x... or so I think I heard/read manumanumanu: RhodiumToad: I think I got it. manumanumanu: ssax:read-cdata-body explicitly handles > but not <. RhodiumToad: got what? RhodiumToad: yes, that's the issue, it's converting > to > when it's not supposed to manumanumanu: Let's just duplicate the clause and see what happens :D RhodiumToad: wait, what? RhodiumToad: the dozen lines of code that does that conversion just need to be taken out peanutbutterandc: Okay... I think I just hit another issue. Mr. Wingo says that guile 3 is "essentially source compatible" (https://youtu.be/fWv4AlVbJZ8?t=48), however, with `guile-readline` installed, running guile2.9.9 is throwing an error manumanumanu: (and (string=? "gt" ent-ref) (eqv? (peek-char port) #\;)) => (and (or (string=? "gt" ent-ref) (or (string=? "lt" ent-ref) ... manumanumanu: RhodiumToad: no, because that code also handles PCDATA (i think). peanutbutterandc: Here is the error: https://termbin.com/57gd manumanumanu: peanutbutterandc: it is just because guile-2.9.9 can't find the readline .o-file peanutbutterandc: I am using `guile --fresh-auto-compile` peanutbutterandc: manumanumanu, I see. And how would I resolve that, please? (I am a n00b) manumanumanu: you _could_ symlink it into your guile 3 lib dir. Not saying you _should_, though. RhodiumToad: manumanumanu: I don't think so RhodiumToad: manumanumanu: read-cdata-body is called only after seeing CDSECT, which is " is a special char in CDATA, but only enumerates < and & in connection to the example. manumanumanu: RhodiumToad: https://github.com/jbclements/sxml/issues/7 manumanumanu: wingo: I will submit a patch and run tests RhodiumToad: (and ]]> can be escaped as ]]]]> which looks to me like some sort of demented fish, but whatever) RhodiumToad: er, ]]]]> manumanumanu: building from HEAD now. RhodiumToad: did the markup eat characters in your report? "... where < was converted to < inside ..." RhodiumToad: and #& for #\& manumanumanu: yes :( manumanumanu: now manumanumanu: and I got it wrong manumanumanu: now it is fixed wingo: guile 3 day woo manumanumanu: woop woop! manumanumanu: So, outing myself as a clueless classical musician: I have made changes to the SSAX code and tests in my local git repo. Is there any way I can rebuild the repo without having to make a complete rebuild? manumanumanu: just changing it and running make didn't cut it :D wingo: manumanumanu: ah that is because ssax.scm is "included" in some other file manumanumanu: wingo: thx. wingo: i would "find module/sxml -name '*.go' | xargs rm" :) manumanumanu: of course! wingo: then make manumanumanu: wingo: but then it does not run the tests it seems. wingo: run tests via ./check-guile manumanumanu: alles klar! wingo: possibly use instead ./check-guile sxml.ssax.test or whatever it is wingo: i.e. to run tests just from that file wingo: see "ls tests/test-suite/" to see list of tests manumanumanu: got it zig: guile 3.0 ftw manumanumanu: O_o. ssax tests output not only the failed expression, which happens to be 5. Not the values, mind you, only (equal? result expected-result). manumanumanu: I hve identified 4 of the offending tests! manumanumanu: all offending tests found! manumanumanu: this turned out to be quite an adventure! :D manumanumanu: only one seems kind of unexpected manumanumanu: all offending tests found. nly: hello nly: This has been sitting for a while now: https://lists.gnu.org/archive/html/guile-devel/2019-08/msg00029.html nly: "Add procedure list->hook in Guile" wingo: do you think it should be applied? i was not sure nly: This may not be usable code right off the bat wingo: i don't know, the hook interface in guile is not very nice wingo: i would prefer to move it to a module and deprecate the bindings in the default environment wingo: at that point list->hook would be fine obviously wingo: but adding something to the default environment has a high (tho not insurmountable) bar nly: I want to dive into the Guile source one day nly: maybe that comes later, but I can try to make the said hooks module nly: under the watch of the Guile hackers, ofcourse :) nly: I'll be back when I have something to show. nly: wingo: brettgilio: wingo: Congrats on the release! manumanumanu: phew! all tests passing wingo: thanks! wingo: all done now, mail sent, web site updated https://www.gnu.org/software/guile/news/gnu-guile-300-released.html weinholt: wingo, congratulations! now the real beta testing starts :) wingo: hah download page is a bit of a mess, will fix wingo: weinholt: indeed ;) wingo: & tx jonsger: wingo: congrats :) brettgilio: wingo: I'd love to help you with Guile some day when I have more time. Currently OCaml compiler hacking is taking up virtually all of my time :). lloda: 3.0!!!! lloda: I started using Guile back in the 1.6 days I think. It's come a long way.. lloda: or maybe even 1.4. I remember using the gh_ things manumanumanu: RhodiumToad: patch submitted to the guile-devel mailing list. manumanumanu: RhodiumToad: could you maybe send a link to the patch on teh ssax mailing list? jcowan: The term PCDATA means "parsed character data", and CDATA is implicitly "(non-parsed) character data". So indeed, nothing but ]]> should be specially handled in a CDATA section. *: jcowan is surprised Oleg got that wrong manumanumanu: I am more surprised it hasn't been fixed... A testament to how widespread scheme is, I guess :D jcowan: Charles The Great Knew All And Foresaw All -- not. jcowan: That, and a testament to how rarely & appears in CDATA sections. civodul: wingo: yeah! congrats! \o/ *: civodul -> happy dance manumanumanu: guile 3.0 is my new favourite guile release! civodul: :-) dsmith: Three! Point! Oh! Three! Point! Oh! Three! Point! Oh! dsmith: Woo *: sneek I'm a 3.0! sneek: Woo dsmith: unknown_lamer: What's the best way to get bobot patches to you? wingo: sneek: botsnack :) sneek: :) janneke: wingo: congrats!! nerdypepper: wooooop! *: wingo afk for a while ggoes: congrats all bandali: hello and congrats y’all! lxsameer: hey folks what does #+ do ? is it like referring to a field of current record or something ? bandali: see https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html lxsameer: thanks bandali: np davexunit: congrats on the release. dsmith-work: Thursday Greetings, Guilers dsmith-work: civodul: Needs a topic update! unknown_lamer: dsmith-work: email and a repo I can pull from dsmith-work: unknown_lamer: Ok. I emailed a patch earlier this morning. dsmith-work: unknown_lamer: You still at unknownlamer.org ? unknown_lamer: clinton@unknownlamer.org unknown_lamer: ah I see it now dsmith-work: Yeah, that's what I used. unknown_lamer: k9mail didn't refresh this morning dsmith-work: unknown_lamer: Still needs more work. As I mentioned, the -S and -D options are not working right. unknown_lamer: basically working is a start after ten years of gathering dust :) dsmith-work: heh daviid: hey hey gulers! congrat for the 3.0 release! so much progress since the early days ... amazing! sneek: daviid, you have 2 messages. dsmith-work: Aaannd.. they are...? dsmith-work: sneek: botsnack sneek: :) dsmith-work: Hmm. dsmith-work: sneek: seen unknown_lamer sneek: unknown_lamer was here Jan 16 at 03:34 pm UTC, saying: basically working is a start after ten years of gathering dust :). dsmith-work: daviid: Sorry, the bot has moved to a different box with the upgrade to 3.0 and is still recovering from surgery. daviid: :) np spk121: today I learned that compiling GCC takes longer than compiling Guile rotty: cloning guile on this machine in celebration of the 3.0 release, and noticed that the http git URL could be changed to https, and updated to avoid a redirect: rotty: warning: redirecting to https://git.savannah.gnu.org/r/guile.git/ rotty: (issued by `git clone https://git.sv.gnu.org/r/guile.git`) rotty: (although the latter may be deliberate for URL shortness reasons?) dsmith-work: spk121: Woah. I didn't think anything could take longer. akhetopnu: hi. I just cloned guile onto my computer and there is no './configure' script to run, and make tells me to run it first, what am I supposed to do? Also in the README file a file called INSTALL is mentioned, but it's not there... akhetopnu: I'm on commit a0fdb4efc18ce47520170a8ccfd7f3f4c5c99d47 (tag v3.0.0) dsmith-work: akhetopnu: ./autogen.sh But better to grab the release tarball, the build will be about 5 times faster. dsmith-work: Because of some pre-built bootstrapped files. akhetopnu: hmm after running `sudo make install` I get this erro akhetopnu: ldconfig: /usr/local/lib/libguile-3.0.so.1.0.1-gdb.scm is not an ELF file - it has the wrong magic bytes at the start akhetopnu: and this file is indeed some scheme code akhetopnu: this is the output of `sudo ldconfig` dsmith-work: akhetopnu: Yes, that's an issue with ldconfig. Not a problem. dsmith-work: ldconfig assumes that everythng in */lib/ *must* be a .so, and complains if not. akhetopnu: Ok, i get another error when running `guile` akhetopnu: guile: warning: failed to install locale akhetopnu: Pre-boot error; key: misc-error, args: ("primitive-load-path" "Unable to find file ~S in load path" ("ice-9/boot-9") #f)Aborted akhetopnu: is this something I should be able to figure out from the README file? *: sneek stretches dsmith-work: sneek: later tell gorf Testing Message sneek: Got it. dsmith-work: sneek: later tell dsmith-test Testing Message sneek: Okay. dsmith-test: hey sneek: Welcome back dsmith-test, you have 1 message. dsmith-work: sneek: seen dsmith-test? sneek: Sorry, no. dsmith-work: sneek: seen rotty? sneek: rotty was here Jan 16 at 05:11 pm UTC, saying: (although the latter may be deliberate for URL shortness reasons?). dsmith-work: sneek: seen akhetopnu? sneek: akhetopnu was here Jan 16 at 05:58 pm UTC, saying: is this something I should be able to figure out from the README file?. dsmith-work: Hmm dsmith-work: akhetopnu: No idea why you have that error. Do you have another guile installed perhaps? Like from a package manager? akhetopnu: I specifically uninstalled my distro's guile version first akhetopnu: it's a fairly fresh system too, nothing extraordinarily weird should've occured in any config file akhetopnu: maybe i'm simply missing something, I'm looking at GUILE_LOAD_PATH env variable but I added some directories to no avail dsmith-work: Shouldn't need to. Did you pass any args to ./configure ? akhetopnu: no dsmith-work: akhetopnu: What kind of machine are you on? akhetopnu: custom built PC dsmith-work: What os? akhetopnu: void linux akhetopnu: I want to try out the 3.0.0 version that just came out because void's repos have 2.0.something still dsmith-work: akhetopnu: Sorry I can't help much. I think the guile devs are all out partying. akhetopnu: that's too bad, thanks anyway dsmith-work: akhetopnu: Only thing I might suggest is running guile under strace -efile and see where it's looking for files. And where it's not looking. dsmith-work: that it should akhetopnu: omg thanks akhetopnu: strace explained everything akhetopnu: guile is getting Permission denied on those files akhetopnu: `sudo guile` worked, however I needed to run `sudo make install` because I was getting Permission denied too akhetopnu: should i chown those folders? dsmith-work: The guile dirs *ought* to be readable by mere mortals. dsmith-work: So yeah, granting read access to others is needed akhetopnu: brilliant, thanks akhetopnu: Hmm what does it mean when I try to define a function `(define (a b c) (+ b c))` and I get 'Unbound variable: compile' error? akhetopnu: also when I run guile it compiles a bunch of stuff and I get warnings about unbound variables like: akhetopnu: #> manumanumanu: Your guile install seems botched beyond repair... manumanumanu: were you bitten by a difference between "sudo make install" and actually running make install as a superuser? manumanumanu: I had that problem with another project a billion year ago on ubuntu, so I never do "sudo make install" anymore, I always do "su" first. manumanumanu: do a "sudo make uninstall" and then go back as a proper superuser and try a make install again... manumanumanu: akhetopnu: highlight to get your attention :D zig: nly: there is https://srfi.schemers.org/srfi-173/srfi-173.html zig: nly: for hooks zig: nly: feedback welcome. There hook->list zig: ahah wrt to guile 300: https://news.ycombinator.com/item?id=22063772 and https://lobste.rs/s/o7zmnk/gnu_guile_3_0_0_released_with_jit drakonis: HN is a goldmine drakonis: the comments in the bottom in HN are err drakonis: welp zig: "Guile is a leading implementation of Scheme. It's valuable by itself." OrangeShark: nice :) zig: Let's replace all REDIS clusters with guile ;) zig: (some dream of mine) akhetopnu: manumanumanu: I did `sudo make uninstall` then `su` and then I ran `make install` but I'm getting the same errors akhetopnu: also gettings lots of `no such language cps` etc akhetopnu: but that's probably something I can install separately (just guessing) akhetopnu: hmm I think I'm getting less of those errors now, mostly the `no such language` ones zig: no you can not install language cps separatly. I am backlog to try to understand your problem. zig: akhetopnu: what is your problem? zig: the locale warning is harmless. ft: Happy new major day. Someone change /topic. :) akhetopnu: I've got a bunchof error after cloning guile repo onto my computer and trying to install it akhetopnu: now I got `Stack overflow` during compilation of /usr/local/share/guile/3.0/system/vm/disassembler.scm zig: can you paste the errors at https://paste.gnome.org akhetopnu: yes zig: that strange zig: the other error about ELF is harmless too akhetopnu: https://paste.gnome.org/pvuu5zjmo akhetopnu: it's still going but I think the problem should be known from just this part zig: akhetopnu: re-do the autotools cli dance based on the released tarball (compilation will much faster) zig: akhetopnu: http://ftp.gnu.org/gnu/guile/guile-3.0.0.tar.gz zig: akhetopnu: here is the signature: http://ftp.gnu.org/gnu/guile/guile-3.0.0.tar.gz.sig zig: otherwise https://lists.gnu.org/archive/html/guile-devel/2020-01/msg00080.html zig: the cli dance is: ./configure && make && sudo make install zig: akhetopnu: what is the host operating system? akhetopnu: void linux zig: ok akhetopnu: I think the errors are from a tarball actually, because someone already told me to download one instead, but I'll do it again zig: fwiw, installing guix on top of any distro is painless and harmless, see https://guix.gnu.org/ akhetopnu: would it be easier to just install guile 3.0 through guix? zig: yes zig: follow the instruction in red at https://guix.gnu.org/manual/en/html_node/Binary-Installation.html zig: also in it will be easier to install packages related to guile. zig: that is guile modules... zig: akhetopnu: what is your programming / coding background? zig: akhetopnu: I mean to ask: what programming language(s) do you already know? zig: akhetopnu: I recommend you subscribe to guile-user mailing list at https://lists.gnu.org/mailman/listinfo/guile-user zig: akhetopnu: also... welcome onboard the guile software system :) akhetopnu: i'm a web developer, mostly javascript (browsers + nodejs), I had to use typescript/angular at work for a year html/css obviously, but trying new stuff, I guess i'm still a novice in common lisp but I can get around asdf, macros (to an extent, I get the different between symbols, keywords, packages etc, at work I have to do some java these days but I'm rather novice at it too akhetopnu: thanks, I've subscribed to the mailing list months ago and I've been reading the mails in spare time akhetopnu: I want to use guile for low level stuff like epoll/sockets/concurrency, common lisp is a lot of pain when it comes to libraries and guile has been on my radar for a year or two akhetopnu: not sure if it's possible to insert memory barriers into guile code (want to learn how to use it but using a lisp, not C) akhetopnu: so I ran `guix install guile` and I see it keeps downloading stuff, old gcc (4.9.4), sed, bash, is that going to clutter my system loading paths? akhetopnu: and, since your name is zig, I actually tried out zig some time ago but it wasn't very polished yet, so I put it on the back burner zig: I am not zig language user actually. I just like that name. zig: akhetopnu: what I do wrt to guix, I have guix.sh that I source before using guix sneek: FOR GREAT JUSTICE! zig: akhetopnu: you need to run `guix pull` then `guix package -i guile-next` then read about guile-fibers https://github.com/wingo/fibers/wiki/Manual#Introduction akhetopnu: did you write it yourself or was it generated by guix zig: akhetopnu: what is? akhetopnu: ok, should I abort the `guix install guile` process? zig: akhetopnu: yes you can. zig: sneek: botsnack sneek: :) zig: akhetopnu: I do not know what are "memory barriers", can you explain? akhetopnu: so basically when you code in C for example, you compile your program with clang or gcc akhetopnu: and since gcc/clang try to optimize your code, one of their 'optimizations' is to actually reorder the instructions, so the output binary might execute code withint a function or a block in a different order than you (as a developer) wrote akhetopnu: so you can insert a thing called 'memory barrier' telling the compiler not to move stuff over the barrier akhetopnu: it's useful if you have 2 threads and want 1 thread to wait for a variable to change its value from 0 to 1 for example, so if in the other thread you ensure instruction order to do something, and *then* change this variable's value, then in the other thread you can be sure that all the necessary steps that had to happen *before* this value was changed - happened. akhetopnu: that's how I understand it and hopefully I didn't make it too convoluted zig: I am not familiar with this concept. Also, if you have issues with guix I recommend you ask on guile-user mailing list or guix-help (https://lists.gnu.org/mailman/listinfo/help-guix) zig: akhetopnu: guile-fibers (the green threads or coroutine) does not forbid global states or shared states, but it recommends the use of channels and message passing (like go or erlang) zig: my understanding is that if one wants to have all instruction happen in parallel but some stuff must happen in serial, one would do some kind of map-reduce thingy akhetopnu: I haven't used such low level constructs either, I've been reading about them to understand what's going on, it might be that guile compiler/interpreter doesn't reorder instructions so these memory barriers might not be necessary akhetopnu: I'm curious what's the performance of these fibers compared to async/await in nodejs dsmith-work: akhetopnu: You might want to read the wingolog for some info on the guile compiler dsmith-work: akhetopnu: https://wingolog.org/tags/compilers akhetopnu: will do, thanks zig: akhetopnu: so far there is no benchmark, afaik, comparing guile with nodejs. Hint: guile fibers can work with multiple threads, so from a memory usage perspective it will prolly be better. akhetopnu: if they scaled to multiple threads that would be amazing, I'm not familiar with the guile ecosystem though, in nodejs when you use a database driver you know it's all asynchrounous, but in guile I have no idea (yet) zig: speaking of benchmark it would be nice to have a guile line at https://www.techempower.com/benchmarks/ (cc nalaginrut) dsmith-work: akhetopnu: So did you ever get a working guile installed? akhetopnu: I did `guix pull` 1 hour ago and it's still going lol akhetopnu: it's downloaded ~30-40 packages so far, building and configuring them akhetopnu: I used to tinker with guile 1 year ago but that was on arch and I think I had a version installed by pacman dsmith-work: Ahh, ok. dsmith-work: I need to try out guix sometime mwette: chrislck: thanks -- I'll need to look again not getting it. Is p then bound to the second argument? dsmith: unknown_lamer: Where is the current/lastest bobot++ source? unknown_lamer: dsmith: https://unknownlamer.org/darcsweb/browse?r=bobot%2B%2B;a=summary unknown_lamer: ten years ago last commits, yow unknown_lamer: I can convert it to git if you want dsmith: Hmm. Sure. unknown_lamer: there's something funky and my darcsweb is kind of broken (but pulling should work) dsmith: Tarball is ok. dsmith: I can't seem to find my sources anywhere. unknown_lamer: https://git.hcoop.net/clinton/bobotpp.git unknown_lamer: https://git.hcoop.net/clinton/bobotpp.git/tag/refs/tags/release-2.2.3 might be the last good release unknown_lamer: gitweb can dump a tarball dsmith: fatal: repository 'http://git.hcoop.net/clinton/bobotpp.git/' not found dsmith: dsmith: or dsmith: dsmith@gpib:~$ git clone https://git.hcoop.net/clinton/bobotpp.git/tag/refs/tags/release-2.2.3 dsmith: Cloning into 'release-2.2.3'... dsmith: fatal: repository 'https://git.hcoop.net/clinton/bobotpp.git/tag/refs/tags/release-2.2.3/' not found dsmith: Ahh dsmith: git clone git://git.hcoop.net/git/clinton/bobotpp.git works dsmith: Oi. Gotta port all that lazy-catch stuff dsmith: unknown_lamer: Ok, got it compiling! dsmith: Not sure if it works. dsmith: unknown_lamer: Accepting patches? unknown_lamer: dsmith: definitely dsmith: unknown_lamer: Well, it's compiling cleanly now. But I'm pretty sure I didn't do the lazy_catch stuff right. Getting errors in some scheme code somewhere. dsmith: !uptime sneek: 23:07:39 up 21:53, 1 user, load average: 0.00, 0.01, 0.05 dsmith: ~uptime dsmith: tsneek: botsnack dsmith: sneek: botsnack dsmith: sneek: botsnack dsmith: sneek: botsnack dsmith: unknown_lamer: What's bobotpp/bot.scm trying to do with %module-public-interface ? dsmith: Adding to (guile-user) ? dsmith: sneek: botsnack dsmith: sneek: botsnack dsmith: sneek: botsnack sneek: :) wingo: moin wingo: has anyone built guile 2.9.9 on mingw? rndd: hi everyone! rndd: could anybody help? how to convert an output of the function to string? zig: rndd: sure! paste the code you have already. chrislck: (display (fn args)) or (write (fn args)) will do usually... lloda: those write to any port lloda: call-with-output-string or (format #f ...) I guess rndd: https://pastebin.com/iTMKxfvw chrislck: ooh a few newbie issues: chrislck: don't use eq? to compare strings, use equal? or string=? chrislck: the case match should be: ((#t) (display "yes")) chrislck: no further comments chrislck: it's a nice start! lampilelo: eq? won't work on strings, equal? should, but string=? is preferred chrislck: in general I use eq? if I'm comparing symbols civodul: wingo: https://web.fdn.fr/~lcourtes/tmp/guile-3.svg (you need font-adobe-source-han-sans) rndd: chrislck, thanks for your answer, could you explain difference between #t and "#t"? civodul: https://web.fdn.fr/~lcourtes/tmp/guile-3.png wingo: civodul: nice :) chrislck: (equal? "a" "a") => #t; (string-join (list "#" "t") "") => "#t"... chrislck: #t is a TRUE/FALSE boolean; "#t" is a sequence of unicode code points that look like guile's TRUE output... :) lampilelo: and #\t is a character 't' rndd: ok, thanks chrislck: rndd: https://www.gnu.org/software/guile/manual/guile.html#Equality lloda: re: guile-json, I wish there was an option to wrap lines lloda: or to add newlines on nesting levels maybe lloda: pretty-print only works on one level it seems lloda: ok it seems it's only for nested vectors that there are no newlines rndd: there is another question. i'm trying to compare output of bash command with string but getting #f =( [ https://pastebin.com/W7qiCS5k ] chrislck: rndd: hint: type the whole thing out in a REPL and run (test) rndd: ok, got it rndd: (equal? (test) "bin\n") => #t rndd: could someone give link to any guide on parsing textfiles in guile? dsmith: sneek: paste? sneek: Someone once said paste is Try lisppaste at http://paste.lisp.org/ dsmith: sneek: paste? sneek: Last time I checked paste is Try lisppaste at http://paste.lisp.org/ dsmith: sneek: forget paste sneek: Okay. dsmith: sneek: paste? dsmith: wingo: What should %module-public-interface be replaced with: https://paste.debian.net/1126088 dsmith: Or anyone wingo: dsmith: probably (module-public-interface (current-module)) dsmith: sneek: paste is https://paste.debian.net sneek: Understood. wingo: search for %module-public-interface in the manual wingo: er wingo: the NEWS i mean dsmith: Yes, saw that. Didn't help *me* much though. ;^) Is why I'm asking. dsmith: sneek: botsnack dsmith: Hmm. dsmith: sneek: botsnack sneek: :) dsmith: Yes! dsmith: sneek: paste? dsmith: sneek: seen wingo? sneek: Not as far as I can remember. dsmith: Hmm dsmith: sneek: paste is https://paste.debian.net sneek: So noted. dsmith: sneek: paste? dsmith: Ahh well. mwette: in guile-1.8.8/ice-9/boot-9.scm: (define (module-public-interface m) mwette: (module-ref m '%module-public-interface #f)) mwette: (define (set-module-public-interface! m i) mwette: (module-define! m '%module-public-interface i)) mwette: unknown_lamer: dsmith: not sure at this point, probably some evil magic to export stuff from the bot unknown_lamer: if you don't figure it out lmk and I can try to take a look later *: wingo pushed a cheeky patch to master, la la la rlb: For any following along -- OK, *now* 2.2.6 built on all the debian arm* hosts and should finally be able to propagate to testing. Turns out the armel buildd was even slower still, i.e. 240 min was not enough for psyntax, but 300 min apparently did it. rlb: wingo: is 3.0 likely to bootstrap any faster, or should it be about the same (if you know). wingo: rlb: relative to 2.2 i think it is broadly similar but i don't know specifics rlb: (Mostly just curious -- since we should be fine as long as it's not *slower*.) rlb: Heh, OK, well I'll be able to tell you in a while -- though not working on it yet. wingo: if jit is not enabled, it will probably bootstrap slower jonsger: building Guile got very slow because of `make -j1` for reproducible .go files... *: jonsger is brave and tries to build gnucash with guile 3.0 :P civodul: jonsger: yeah that .go file reproducibility issue is a bummer civodul: we thought we fixed it ca. 2015 i think, but apparently not quite rlb: That's not the issue for debian (at least yet -- though arguably it should be). Right now the issue is just that (I think) 2.2.6 serialized the early bootstrap a bit, and so there's a much longer period with no output, which is what the buildd monitors (and it kills anything that's inactive for too long). rlb: The debs still build in parallel (or rather just use the dpkg-buildpackage defaults, which are normally parallel). wingo: rlb: does the debian build remove the .go files? wingo: the prebuilt ones rlb: yes, that's why it's so slow. rlb: well we don't actually remove them, we build from the git tag, not the release archive right now. *: wingo nod rlb: As a practical matter (not suggesting we should do this just for debian), if the compiler had some --verbose flag that ended up printing a line now and then, that'd fix the problem too, but since the arm* buildd admins ended up being willing to raise the timeout high enough for psyntax, we're hopefully fine for now. rlb: And I'm all in favor of reproducible builds for both guile and emacs. If it's just things I need to change in the debs, happy to do it, and also happy to help wrt the source if we know what needs doing and I have time. wingo: https://wingolog.org/pub/guile-3.0.0-vs-2.2.6-microbenchmarks.png wingo: https://wingolog.org/pub/guile-3.0.0-vs-chez-9.5.0-microbenchmarks.png drakonis1: still a long way to go before reaching chez speed? wingo: depends on the benchmark :) jonsger: wingo: could you also compare with 1.8 and 2.0? lispmacs[work]: Is there a way to pull the type of an object when you aren't using goops? civodul: jonsger: comparing with 1.8 may be hard (and somewhat irrelevant IMO :-)) because it lacks many language features and modules jonsger: civodul: yeah that's what I tought. str1ngs: lispmacs[work] you mean (class-of foo) is that what you need? drakonis1: where in the repository is the hook system? lispmacs[work]: str1ngs: I believe class-of foo is a goops function drakonis1: oops i'm in a roll drakonis1: wrong channel again lispmacs[work]: str1ngs: I was just wondering if you could view the type of an object when you are using goops system lispmacs[work]: *aren't drakonis1: wingo: how much does guile 3.0 speed up guix? str1ngs: drakonis1: libguile/hooks.c I think drakonis1: i was thinking about guix's hooks that are run when the system is altered str1ngs: lispmacs[work]: it's defined in oop goops but it can work on other types. though some of those types might be goops classes anyways. str1ngs: ,eval (class-of 1) str1ngs: sneek: ! str1ngs: ,(class-of 1) str1ngs: sneek compute! str1ngs: drakonis1: ahh depends which hooks you mean build hooks? I know profile are in guix/profile.scm drakonis1: profile hooks, yeah. str1ngs: don't ask me how I know! I would never do something like this ;; manual-database drakonis1: i found it already drakonis1: but its not relevant to guile itself str1ngs: I reposted in #guix for posterity manumanumanu: wingo: Those are impressive numbers! manumanumanu: what is going on with mbrot? manumanumanu: jeez. manumanumanu: Is that a current "best case" for guile optimizations? If that reproduces on ecraven's benchmarks (if it is the same code) that should easily give guile the no 1 spot. lispmacs[work]: ,eval (+ 1 1) lispmacs[work]: sneek: ! lispmacs[work]: sneek computer! lispmacs[work]: sneek compute! lispmacs[work]: sneek: help wingo: good evening wingo: so. wingo: what if we make a test 3.0.0 tarball *: wingo hates libtool civodul: hey hey wingo! wingo: hey hey! wingo: so wingo: i think we can freeze guile for 3.0 this evening! wingo: wdyt? drakonis: nice! civodul: wingo: i say go for it! civodul: and then tomorrow: party time! wingo: yay wingo: civodul: so we send mails and make blog posts tomorrow 14h CET or so? civodul: yes, that sounds good civodul: do you need help for anything? wingo: hum, dunno, i think if i just do it like previous releases we will be pretty good wingo: write a blog post if you like :) wingo: wdyt? wingo: configure: autobuild revision... 3.0.0 wingo: incidentally blog posts are something that everyone in this channel can do :) rndd: hi everyone, found simple command (crypt key salt), and how i can decrypt the result of this function? civodul: wingo: yes, you did very well civodul: i could write the post for 3.0.0 but i feel like you know better what to highlight & co. wingo: civodul: yeah i am ok writing the gnu.org one civodul: awesome wingo: will make it relatively short but a quick link from the guix blog is also nice ;) civodul: yeah i offer help just to say it'd be better if you did it, silly me ;-) wingo: haha :) civodul: ah yes, we could have a blog post on Guix civodul: i wonder if we should wait until Guix fully works on 3.0 though civodul: maybe it doesn't matter, we're almost there civodul: yeah i'll look into that tomorrow, then! wingo: civodul: spreading out things over time is fine too, however you see it is fine *: wingo turned network off during distcheck b/c apparently that damn netdb test fails on my home network :P wingo: i think i wanted to check the change in requests/sec for the http server but didn't get around to it drakonis: civodul: wait you haven't tested 3.0 on guix yet? wingo: he has. just that there are a few test failures. wingo: for guix itself on guile 3.0 wingo: guix has built a number of guile packages on guile 3.0 tho drakonis: ah, okay. drakonis: i want to see how much better guix can be under 3.0 civodul: wingo: ok i'll see what i can do but will definitely post something, either tomorrow or later on wingo: coo *: wingo uploading 3.0.0 docs wingo: fyi there is a guile 3.0.0 on https://ftp.gnu.org/gnu/guile/ :) drakonis: nice. civodul: woow, now this is for real :-) wingo: https://www.gnu.org/software/guile/manual/ :) drakonis: ohhh drakonis: its coming drakonis: do guix's repos now! drakonis: its like a magic trick drakonis: oh you sneaky sneaky folks drakonis: its there already wingo: :) wingo: ok, draft email ready, blog ready, tarballs up. all ready i think wingo: night! civodul: night, wingo! sleep well! :-) ng0: does this mean 3.0 is out of testing now? ng0: looking at the numbers alone slyfox: maybe it's not too late for http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38112 fix? :) jcowan: make check on Cygwin has 2 minor errors, probably newlib/glibc incompatibilities in strftime daviid: jcowan: but iirc, you pass -1 a the jit option, which means iirc, no jit, that's not good daviid: this means that 3.0 perfs will be inferrior, o cygwin, to 2.2, in general daviid: jcowan: or was the jit option just for the make step? not sure, worth asking i guess ... daviid: str1ngs: i pushed a series of pactahes to document the , class, procedures, accessors and methods daviid: also, the gdk-event-key:state now returns a proper list of state modifiers, like, for example, '( shift-mask control-mask mod5-mask), not just the state bitmask intenger daviid: *patches daviid: the state modifiers doc entry points to the GdkModifierTyp doc, so one can read more about this s well ... daviid: have to go, bbl mwette: wingo: wrt #lang, a while ago I posted some code for #lang to bug 30094; and it's also under github.com/mwette/guile-contrib. str1ngs: sneek, later tell daviid thank you. Will take a look first thing tomrrow. sneek: Got it. sp1ff: Hi-- I have a question around Autotools & Guile. I've found examples of how to write Makefile.am for Guile modules, specifically around compiling the Scheme and installing the .go files. I'm trying to write a Makefile.am for a Guile script; that is, a file that starts with "#!/usr/local/bin/guile -e main -s..." and gets installed into ${prefix}/bin. sp1ff: What are Guile's rules for where the .go files should go for scripts? sp1ff: Just ran strace on a test script & I see guile looking in the usual place: /usr/local/lib/guile/2.2/ccache//usr/local/bin/test-script.go sp1ff: I'm still wondering if this is documented anywhere, and whether anyone else has done this? jcowan: sneek, later tell daviid yes, only during make sneek: Got it. mwette: sp1ff: I think GUILE_SITE_DIR config macro will set GUILE_SITE_CCACHE which is where you should install .go files; check guile.m4 mwette: wingo: if you are looking for future efforts please consider working on the debugger; debugging in 1.X was much more satisfying than it is in 2.X mwette: wingo: I tried some hacks but fell short: for example, added a "-g" flag to "guile compile" and then tried to use that to remove reuse of allocated slots sp1ff: Thanks mwette dsmith: Hey hey guilers. Started building 2.9.9 on my beaglebone. Getting that socklen_t problm from configure. dsmith: Looks like I'm running wheezy. I fear I'll neet to upgrade first. dsmith: checking for socklen_t equivalent... configure: error: Cannot find a type to use in place of socklen_t dsmith: drakonis: oh man, wheezy is old drakonis: its nearly 7 years since it released, its definitely time to go up a few versions dsmith: Yeah. Question is, should I just jump to current stable, or walk through each release. dsmith: So next would be Jessie dsmith: Here we go. Upgrading to jessie... drakonis: actually jessie is also EOLed drakonis: after jessie you still have to go through stretch to reach buster dsmith: Yes dsmith: https://ewen.mcneill.gen.nz/blog/entry/2017-06-07-debian-wheezy-to-stretch-in-two-larger-steps/ dsmith: sneek: botsnack sneek: :) dsmith: ~uname dsmith: ~uptime dsmith: sneek: uptime dsmith: Hmmm. dsmith: sneek: uname dsmith: sneek: seen rlb sneek: rlb was here Jan 13 at 02:11 am UTC, saying: wingo: thanks wrt fluid-ref -- obviously I hadn't attempted it yet.. dsmith: !uptime sneek: 00:19:33 up 7 min, 2 users, load average: 1.09, 1.12, 0.51 dsmith: !uname sneek: Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux dsmith: sneek: seen wingo sneek: wingo was here Jan 13 at 08:41 pm UTC, saying: jcowan: does it work if you compile with GUILE_JIT_THRESHOLD=-1 set in the environment?. dsmith: sneek: botsnack sneek: :) dsmith: yey, running jessie dsmith: !uname sneek: Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux dsmith: sneek: info dsmith: sneek: version sneek: Sneeky bot running on Guile version 2.0.11 using bobot++ 2.3.0-darcs str1ngs: sp1ff: if you are writing a shebang script with autotools I would not compile it . And I would use configure.ac to substitute the guile path. this makes your script more portable. str1ngs: sp1ff: typically these files are have an .in extention. you can also use Makefile.am and sed to do the substitution str1ngs: as well dsmith: Bah! Running out of "disk". Currently using 1.4G of 1.7G. dsmith: 180M free dsmith: Well, guile ./configure'ed on jessie. Doesn't like the libreadline though. dsmith: Let's see if it finished before tomorrow morning... wingo: hoo, doing a benchmark run takes around 2 hours :P civodul: wingo: for two different Guiles? civodul: that's why you should make Guile faster ;-) wingo: for one guile *: jonsger prepared Guile 3.0 on openSUSE Tumbleweed :P wingo: i just made a change so that (eq? proc proc) would be true, but it means i need to re-run benchmarks civodul: oh, i see wingo: but no need to re-run old benchmarks to make a comparison civodul: i've prepared for package migration to Guile 3.0 in Guix civodul: good news is we have quite a few Guile packages these days :-) civodul: and many run just fine on Guile 3 wingo: what kinds of problems do you see? :) jonsger: civodul: I saw it. I proposed patches for guile 3.0 to https://gitlab.com/mothacehe/guile-parted/merge_requests/1 and https://gitlab.com/mothacehe/guile-newt/merge_requests/1 civodul: wingo: that's the thing: i don't see problems so far! civodul: apart from adding "3.0" in configure.ac, like jonsger writes jonsger: and updating m4 for guile 2.9.x civodul: yes, "guile.m4" civodul: i still to come back to Guix itself though, there were some issues, but hopefully nothing terrible wingo: jonsger: great! wingo: https://wingolog.org/pub/guile-2.9.7-vs-guile-2.9.9-with-eq-change-microbenchmarks.png wingo: looks like the eq change is acceptable dsmith: Aww. Fouey. Compile failed. dsmith: wingo: Can 2.9.9 be compiled for 32bit arm? dsmith: I might need a newer compiler dsmith: I have 4.9.2 wingo: dsmith pretty sure we had a positive report dsmith: Hmm. I don't have enough free flash space to upgrade. dsmith: wingo: Two kinds of errors in jit.c: dsmith: error: initializer element is not constant dsmith: warning: left shift count >= width of type dsmith: Well, that's a warning. wingo: line number for the left-shift thing? wingo: or is that in hash.c dsmith: Yes, hash.c. 3 of them. hash.c:123:3 hash.c:132:3 hash.c:221:5 jonsger: wingo: I still have illegal instruction for armv7l https://build.opensuse.org/package/live_build_log/home:jbrielmaier:guile-3.0/guile3.0/openSUSE_Factory_ARM/armv7l but I think this is due to the wrong subset of ARM *: wingo nod wingo: realistically guile 3.0.0 is going to have some build and codegen issues that will have to be fixed during the stable series wingo: i am ok with that, as i don't have unlimited resources :P civodul: yes, i assume there'll be a 3.0.1 someday :-) chrislck: mwette: i found out how to use a fender... use the (=> continue) clause as described in http://ceaude.twoticketsplease.de/articles/an-introduction-to-lispy-pattern-matching.html and is not described in the manual at all chrislck: so, not obvious at all, but at least it exists dsmith: wingo: Fouey, I'm outof time. I'll get you a proper report on the lists. dsmith: I might need to do a fresh install on this box. mwette: chrislck: thanks! chrislck: plus, it seems that we could use the (? predicate?) somewhere deep *inside* the pattern, although I can't seem to find the right incantations yet :/ jonsger: wingo: the aarch64 build is fine. That's good, because most modern ARM platforms are 64bit :P wingo: :) wingo: that's good to hear! wingo: i did check guile on armv7 and aarch64 but it was a few months ago wingo: so good that it's still working jonsger: oke, I didn't tested on runtime yet, but lets see wingo: if it builds it's probably ok wingo: because the compiler exercises itself d4ryus: hi #guile, does anyone know of any code that makes use of the GNU Make guile bindings (e.g. to generate templates)? OrangeShark: hello everyone civodul: d4ryus: no, i suspect it's not much used rlb: OK, for any interested, timeout has been lengthened drastically for the debian arm* buildds, and 2.2.6 has finally built there: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid Should now be able to migrate to testing/bullseye. rlb: (well, assuming armel finishes successfully -- armhf was fine) chrislck: mwette: using (? predicate? var) in match: \o/ https://pastebin.com/raw/nuTqQPFt zig: o/ zig: I am not sure if the Guile announcement message was changed recently but it really sound good. zig: that : https://paste.gnome.org/pubrydvun davidl: zig: it is good :-D davidl: I recommended guile here: https://www.slant.co/topics/15491/~general-purpose-programming-languages davidl: In case anyone's interested; I wrote some examples for using guile-bash and python-on-guile and to extend guile in C, here: https://gitlab.com/methuselah-0/bash-c-guile-python-examples zig: good idea about slant.co, I submitted my review. zig: davidl: I did not know it was possible davidl: zig; nice. What did you now know was possible? davidl: not* zig: davidl: I did not know about guile-bash actually davidl: If I remember correctly, it was made by some russian math guy whom I think went to prison for a Tor node, but I dont remember exactly. He announced it on Guix a few years ago, but then announced he wouldn't be able to maintain it. It needs updated for Guile 3.0. I managed to fix it for 2.2, but I don't understand the code. davidl: it=the guix package for it. rgherdt: davidl: nice, thanks for the initiative. Also added some points mwette: chrislck: better place to look for example is system/base/pmatch.scm rlb: terpri: fwiw, longest command on "abel" (arm porterbox) was unsurprisingly psyntax at just over 3 hours. rlb: I think we'll probably just raise the global limit on arm* to say 200m on the debian buildds, but we'll see -- not my department :) rlb: wingo: thanks wrt fluid-ref -- obviously I hadn't attempted it yet. wingo: moin *: wingo cuts a 2.9.9 civodul: Hello Guilers! wingo: https://www.gnu.org/software/guile/news/gnu-guile-299-beta-released.html wingo: civodul: ^ :) lloda: Scheme should be about doing the right thing, not about compromises. Having many implementations is a strength. If there's disagreement let everyone try and see what works best, not hurry things. Future code is more important than past code. lloda: Just my opinion ofc. wingo: lloda: what is that statement in reference to? wingo: i agree but i compromise on things all the time :0 wingo: :)rather lloda: the cond-expand exchange earlier lloda: surely, things must work, I need a practical system too lloda: it's an outlook civodul: wingo: yay! civodul: that's without the (web client) changes, right? civodul: the NEWS entries are nice, lots of new things again! wingo: civodul: yes, feel free to land those changes if they work for you wingo: with NEWS etc please :) civodul: wingo: alright! civodul: i was waiting for feedback, though with intermittent email fetches :-) wingo: civodul: i thought we talked over irc :) wingo: anyway, no problem civodul: yes we discussed it briefly wingo: civodul: do you think a pull-request kind of system would help guile? civodul: wingo: it wouldn't help me :-), but i understand many people are used to that workflow civodul: so in that respect it could help wingo: just thinking that it might be clearer sometimes when someone gives r+ wingo: anyway :) civodul: i guess the question is the extent to which an email-based workflow scares away potential contributors civodul: "r+"? wingo: like positive review, patch accepted, looks good to me, etc civodul: ah, maybe civodul: in this case, it's perhaps a misunderstanding on my side: i viewed our discussion as just that, not as a formal "LGTM" civodul: but again, no big deal! wingo: :) civodul: (also i just realized you had replied by email, which i hadn't seen, oops) zig: o/ wingo: civodul: we still good for 3.0.0 on friday? wingo: or thursday maybe civodul: wingo: yes, i'll do my best to do some more testing by then civodul: i haven't checked the patch backlog civodul: did lloda or anyone have patches that change the API somewhere? wingo: https://wingolog.org/pub/guile-2.9.7-vs-chez-9.5.0-microbenchmarks.png civodul: i think you already merged some of that, right? civodul: woow! civodul: the ultimate challenge :-) wingo: :) currently we're definitely slower tho :) civodul: except on mbrot, we should do mbrot more often :-) wingo: civodul: i looked through guile-devel and there is nothing i need to apply, going back to last august or so. there may be older patches tho as i am not up to date. similarly for bug-guile wingo: i omitted ctak, fwiw :P ecraven: wingo: congratulations! civodul: wingo: excellent wingo: ecraven: that is chez --optimization-level=2 fwiw :) wingo: i.e. no unsafe optimizations drakonis: oh that's nice. drakonis: when's R7RS-large though? wingo: i think r7rs-large is more appropriate to an out-of-tree project wingo: pretty sure there are two main things we would need to do to get closer to chez: generational GC and better compilation of things like "case" wingo: register allocation would help also. wingo: generational gc would be a big change tho :) drakonis: by the way, last year's guile talk on fosdem included a line on the slides about getting closer to racket, how that one works? wingo: slowly :) we do mixed definitions and expressions now, and the exceptions rebase goes in that direction civodul: the social bit isn't quite happening yet, it seems ;-) wingo: :) racket is also doing some pretty bold stuff right now with racket2 wingo: anyway, guile 3 required a specific set of low-level skills; i think a lot of the rapprochement work can build on that without needing to go so deep into the compiler drakonis: racket 2 you say? wingo: https://groups.google.com/forum/#!msg/racket-users/3aIPOGbGgmc/A4HHSbdxAwAJ drakonis: ah, that's neat. lloda: civodul: my patches already got merged, thx :-) civodul: yay! civodul: after reading "we next explore the possibly of changing to an infix-oriented syntax", i checked the date of the post, just to be sure civodul: apparently one can send such a message even if it's not April 1st civodul: (this reminds me of Hop.js) lloda: the syntax thing looks like a massive timewaster to me :-/ daviid: massive and totally dead stuíd wingo: civodul: honu is pretty nice tho https://www.cs.utah.edu/plt/publications/gpce12-rf.pdf daviid: *massive waste of time and ... wingo: quite elegant wingo: still, it is not something that inspires me. to my eyes it is "software for other people", which i can only make so much of; I need to make things for myself :P lloda: customers tend to be wayward lloda: you show them one thing and they want another wingo: but maybe matthew & co come out with something really compelling. i am glad that racket is willing to explore this space :) civodul: yeah, let's watch it from a distance :-) daviid: a great(big) distance yes :) zig: this space (reader syntax) was explored several times in srfi process (sweet expression, wisp, ...) with barely any success afaik. zig: my tiny experience with wisp, is that it is much more difficult to read that s-expr based on parens. zig: racket is, willy nilly, into the idea of DSL with completly different syntax, that is why they have the #lang thing. I think that is time that is wasted. zig: I think one of the goal of racket2 is to reach users that are used to C-like syntax. I think, they miss the point. People do not want to use racket because it is a lisp, but because there is basically no software that use racket as language or compiler. It seems to me it is easier and better to try to proove and convince people that s-expr are the Good Thing by building software that is useful. zig: from a programming language perspective, I think time would be better invested into things like typed racket, themed and take insipiration from haskell, rust, idris... that is code for which the compiler can proove more stuff and do more optimizations.. wingo: all the language variations are enabled by #lang zig: (this is theme-d, I am thinking about http://www.tohoyn.fi/theme-d/) wingo: i have thought for a long time that guile should add #lang, for its own reasons daviid: wrt optimization, I quite like the CL declare way of things, where we can inform the compiler using declare form(s) (as opposed in typing the args in the arg list itself, which is terrible imo): (declare (fixnum n) (igore m) ...) _and_ (declare (optimize (safety 0) (space 0) (speed 3) (debug 0))) wingo: types aren't mainly about optimization fwiw daviid: but it helps the compiler, and that is very important, no? zig: If one was going to add optional static typing, it should be backward compatible with regular scheme, that is type annotations should be no-op, if the host Scheme does not support static types. In this regard, I like srfi-145 approach: https://srfi.schemers.org/srfi-145/ wingo: typed racket is essentially about being able to prove properties about your program. it is an additional expressive capability on top of untyped racket. sometimes those properties help the optimizer, sometimes they add overhead (contracts) daviid: wrt 'gaining more users', I beleive it is more important to take care of 'little things' like default truncated printing in the repl/raised-exception/backtrace, providing a simple toggle mechanism to revert this to full print (which I beleive will almost always be the excpetion) - and other things probably, but this is a newbie blocker, in my experience daviid: i would avoid contract daviid: and i understand the theretical objectivem, but mine is purely speed wingo: then you would avoid interaction with untyped scheme :) wingo: hard to do in a composable manner daviid: zig: declare is backward compatible, since you use it or not ... daviid: it is beautiful daviid: wingo: i just hope 'we get there', declare is a good way to get closer, imo daviid: cl proved it daviid: i hadprogam fster in cl then in C daviid: usig declarations of course spk121: (I did like coding in Ada back in the day. Best language ever for strong typing.) daviid: but i want to remain in scheme, just wish one day we can declare type and speed space ... options daviid: *speed, space, debug ... options so the compiler can optimize 'on demand' daviid: wingo: I beleive the dclare way of things will allow guile to acheive 'full speed' in a composable manner dsmith-work: {appropriate time} Greetings, Guilers jcowan: daviid: If your objective is solely speed, you should be using Chez rather than either Racket or Guile. (Racket-on-Chez will probably not be faster than existing Racket: the main motive is maintainability by cutting down the amount of C.) daviid: jcowan: goops is the key ... and i'll remain onnscheme, i als beleive that speed should be not mine, but our objective, and, optional, hence the 'declare way of things' daviid: *I'll remain on/using guile jcowan: Oh, I see. Well, speed is a very good objective, but there are others. That's part of the reason why a hundred Scheme flowers (almost) bloom. jcowan: Some people obviously value flexibility and debuggability first. daviid: sure, but speed became guile's objective startig with 2.0, and is now more important then ever, you can see how many post we'had the last few weeks just about this (comparing other schemes ...)f daviid: jcowan: the 'declare way of things' is 100% compatible with your claim jcowan: Declaration and inference, yes. But I'm talking about whether an implementation is *optimized* for speed or not. SBCL supports the CL tuning knobs very well, but I know of no equivalents to them in Scheme. jcowan: I should say, in any Scheme implementation. wingo: people who want to quickly compute members of the mandlebrot set might prefer guile ;) *: jcowan chuckles. jcowan: Put not your faith in benchmarks. daviid: jcowan: I don't see any theoretical limitation for guile, being a scheme, to be able to have and us a set of declare optimization options, both type and spce, speed, debug, that would 'forbid' to become as fast as a cl implementation, once we have an AOT of course daviid: zig: unlike you, i have zero interest in this 'declare way of thing' to be compatible with other scheme daviid: it should be for guile, and the guile compiler jcowan: Neither do I. But there may be practical limitations in retrofitting this into the Guile code base while maintaining the original objective of being embeddable in desktop apps daviid: only practicle ... i trust our maintainers to get there with a certin ease zig: declaration should be opt-in, not mandatory. Unlike theme-d, it should not require learn a new syntax to declare types or contracts or whatever. jcowan: sbcl for example is not embeddable because it needs to own the memory model, so it can call out to C but can't be called from C. daviid: zig: declare is optinal daviid: declare does not require any new syntax either zig: Then, it seems like what I have in mind. jcowan: zig: Take a look at http://clhs.lisp.se/Body/03_c.htm and its linked subpages. jcowan: In practice, if you want a CL embedded in your C app, you go to ECL; in your Java app, to ABCL. Neither of which delivers the performance of SBCL. Changing that is a Small Matter Of Programming jcowan: (that is, easy to describe but too big to be practical unless you have huge resources) jcowan: Like changing your favorite Fortran compiler to accept Cobol too. zig: interesting. jcowan: There is a parallel dialect of CL called *Lisp, which we know is pronounced "Star-Lisp" because there is a section in the manual called "*ting up *Lisp". manumanumanu: drakonis, wingo: about getting closer to racket: I am approaching feature parity with my for loops :) A bunch of things are not really the same, since racket has a bunch of generic interface nicities, but the bulk of the loops are there. When I thought I was done, alexis went on and wrote for/foldr which has me making the loop-emit macro more general. peanutbutterandc: Hey there wingo: moo peanutbutterandc: moo whoo! ft: ft: oops wingo: so i updated the web site to have 3.0 be the current major version, in anticipation of later this week wingo: helps to get a bit of this cvs tomfoolery done early wingo: lmk if anyone spots an issue jcowan: wingo: Still not building on cygwin, per my post to guile-deve@ jcowan: devel@ civodul: wingo: woohoo! wingo: probably will ship 3.0 without cygwin support then, there has been no debugging on cygwin wingo: jcowan: does it work if you compile with GUILE_JIT_THRESHOLD=-1 set in the environment? jcowan: Trying *: wingo zzz drakonis: 3.0 in a week? drakonis: oho this friday jcowan: build worked in Cygwin with JIT disabled (as above) jcowan: running make check manumanumanu: jcowan: how 'bout WSL? jcowan: Can't run it on this corporate box jcowan: anyway, it doesn't prove anything much, it's just Linux, as long as you aren't trying to call an unsupported syscall manumanumanu: Just curious about how I would best run guile on windows. manumanumanu: Good night! drakonis: wsl2 maybe? drakonis: its linux on a hyper-v vm daviid: manumanumanu: i use msys2, which has a guile package daviid: https://www.msys2.org/ daviid: https://packages.msys2.org/base/guile dsmith-work: daviid: Does it now! Cool. dsmith-work: I need to verify new guile builds and runs on my beaglebone black. dsmith-work: So tedious though. dsmith-work: Tarball is faster at least. dsmith-work: About 5 times faster on my desktop here. dsmith-work: 13 minutes for 2.9.9 dsmith-work: 75 minutes for v2.9.9-7-g10fdd88cb chrislck: cndidate chrislck: oops str1ngs: hello daviid great work thank you. LGTM so far. I will test further tomorrow and report on any issues I might find. chrislck: does (ice-9 match) have something similar to racket's #:when clause? chrislck: doesn't look like it chrislck: basically I want to do something like: (match '(1 2 (3 4)) (((a b . rest)) #:when (my-predicate? b) ...) chrislck: the guide is not that obvious mwette: you want a fender? chrislck: ? mwette: I think you use (match .... ((and (? my-predicate) ...) ...) mwette: my-predicate is passed the expression argument to match IIRC chrislck: but at which part of the pattern do we use it? very confusing mwette: oh, and you don't need the and; (? my-predicate pat1 ...) : (my-predicate x) returns #t and pat1 ... patn match mwette: where x is the 1st argument to match chrislck: still not easy mwette: (match 1 ((? even) (display "even")) (_ (display "odd"))) chrislck: ok the use case is something like (match lst ((head next . tail) ...... I want to match where (predicate? next) is #t chrislck: not easy isnt it mwette: you have to write predicate to take lst as argument chrislck: ah. chrislck: not as smooth as racket's #:when chrislck: (match lst ((head next . tail) #:when (predicate? next) ...) mwette: that looks better chrislck: it does, doesn't it. shame it's not available to ice-9 match. mwette: you could write a custom matcher; it's a good exercise in CPS chrislck: O_o chrislck: thanks for assistance... gtg ;) mwette: OK. I wrote a custom one to replace sxml-match; look in nyacc at module/nyacc/lang/sx-util.scm ft: Hm. I used to use @@ to test module internal functions in test-suites. Seems like that won't work necessarily with declarative modules. wingo: in r7rs, a cond-expand without matching clauses is unspecified. lol civodul: wingo: woow, sounds like a recipe for breakage wingo: civodul: check out the peval bug fix i just pushed :) wingo: both branches jcowan: wingo: That's true, but else-clauses match anything. The trouble was that falling off the end was equivalent to (else) in some implementations but threw an error in others, so it was left unspecified. jcowan: So just make sure you have an else-clause. wingo: i think it's a badly specified form. shrug civodul: wingo: ouch! so the bug had been there since 2.0? civodul: ,optimize ((lambda (x y) (+ x y)) 1 2 3 4) civodul: $8 = 3 civodul: how nice :-) wingo: :-) wingo: the bug was not in 2.0 i think wingo: but it was in 2.2 civodul: ok wingo: well, all blockers fixed afaiu wingo: should probably do the locale thing; i have a patch at work but have hesitated to apply wingo: will try to send another prerel tomorrow civodul: wingo: yay! civodul: should i merge the (web client) changes, BTW? *: civodul lagging behind on email *: daviid crosses his fingers so maintainers decide to include the wip-trunacted-exception branch patches (or something 'alike') in 3.0, instead of after 3.0 chrislck: mwette: thx I'll have a peek. I was hoping match could do some magic like: (match lst ((head (? predicate? next) . tail)) ...) chrislck: wingo: peval bug was found when developing code with bug in 2.2 and passing, yet pushing to travis and guile-2.0 failed. \o/ mwette: chrislck: yw. I went through similar experience. I used the term ``fender'' from syntax-case. If you look at the definition of syntax-case you will see it supports forms `(pattern output)' and `(pattern fender output)'. ``fender'' is the term used for a predicate that acts as an additional constraint for the rule to match. raghav-gururajan: test sneek: Welcome back raghav-gururajan, you have 1 message. sneek: raghav-gururajan, raghav-gururajan says: what mehlon: does #guile not allow connections from kiwiirc? mehlon: it seems a user had trouble sending messages in here rndd: hi everyone! bandali: mehlon, not sure, but they may have to be a registered freenode user bandali: also, hi :) mehlon: I guess that might be it. or just a client issue rndd: I'm newbe in guix. Trying to find out how to print output of function to file. here is a pastebin https://pastebin.com/egDyas9f . Ask for help =) bandali: rndd, this may be useful: https://stackoverflow.com/a/43361469 bandali: try replacing "hello, world" in there with (print) rndd: bandali, thanks but error the same https://pastebin.com/mW9B5VT4 mehlon: https://www.gnu.org/software/guile/manual/html_node/Pipes.html#Pipes mehlon: you need to pipe the output of the command first bandali: rndd, ^ bandali: also, you need to actually call the display function, i think rndd: bandali, adding print just write exit code to file (for this situation it writes 0) bandali: rndd, you mean adding display? like (display (print) output-port) ? bandali: then i guess you need to use pipes, as mehlon mentioned rndd: bandali, yes bandali: ok rndd: i'm sorry, dont understand how to use pipes. could ask for examples? for example what MODE i should use? etc bandali: the above page explains what MODE to choose bandali: based on your “ls” example, you need OPEN_READ bandali: oh bandali: actually, that’s the C procedure bandali: you should use the open-input-pipe function bandali: just read that manual page bandali: they even give you an example rndd: ok rndd: is there any guile-mode for emacs with syntax highlighting and smart-tabs? bandali: there’s scheme-mode bandali: so yes rndd: bandali, oh thanks. dont know it is built-in bandali: rndd, no problem :) it’s built-in indeed rndd: ok, i've copy-pasted example from manual https://pastebin.com/xBZTAZcW and got error "unbound variable read-line". Do i need to use something else? any module to access read-line? bandali: rndd, try adding (use-modules (ice-9 rdelim)) to your file rndd: does pipes in guile input only shell commands? spk121: . daviid: str1ngs: I pushed a series of patches related to gdk-event(s), no doc yet, but here our 'test-bed' hello-world examples adapted, see the 'key-press-event code - the event is now a instance (not 'just' a foreign pointer anymore), and one can use its accessors, just like i the example daviid: http://paste.debian.net/1125643/ daviid: of course I will add other gdk-event struct def and acc one by one ... but feedback welcome daviid: spk121: your feedback would be most welcome as well of course, if you 'play' with this and have a comment, please ping me ... spk121: daviid: I'm super sick, so my brain in a muddle, but, the code looks pretty at first glance daviid: spk121: oh, take care of yourself then! tx for the nice words of course, once you recover, if you try, let me know ... wingo: moin wingo: is it a week from guile 3? :) wingo: maybe we can get some patches in to fix blockers today and make another prerel jonsger: still no fix for this 32bit build issue lloda: some of the https://debbugs.gnu.org/cgi/pkgreport.cgi?package=guile are old civodul: yeah :-/ civodul: bug triage is hard civodul: hey wingo! civodul: wingo: i noticed TLS support in (web client) in Guile still lacks certificate verification civodul: i could backport it from Guix wingo: please do! lloda: what about #15228 lloda: is there anything wrong with the last patches? lloda: I think that has been a recurrent question in the lists, or something of the sort wingo: how is that bug a 3.0 blocker? lloda: oh I don't think it is :-/ lloda: sorry I missed the context wingo: regarding that bug, just documentation missing; link to the patch? wingo: reasonable bugfixes that can be done compatibly can land at any time of course :) wingo: we don't have to freeze entirely this week but we should be a little more conservative than usual lloda: np I shouldn't distract you atm wingo: civodul: wdyt of https://lists.gnu.org/archive/html/guile-devel/2020-01/msg00022.html wingo: ? jonsger: talking about https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38890 at least we should make clear in the release notes, that 32bit is not building atm wingo: i will just try to fix it, it looks like a simple fix jonsger: it's broken since 2.9.3 civodul: wingo: it's tough! clearly, unwinding just to evaluate the cond clauses and then potentially rewinding seems crazy civodul: now, not doing that means that there could be observable changes, in particular wrt. parameters wingo: civodul: you are right in a strict sense but i doubt that many people are accessing the dynamic environment from the test of a guard clause wingo: i.e. they are usually type predicates wingo: so as a tradeoff it might be the best we can do civodul: wingo: right, that makes sense civodul: i was thinking about current output/error ports which could be different, but you're right that they're typically not accessed from the predicates civodul: so i'm in favor of not doing the unwind danse wingo: civodul: did you make any progress regarding autoloads and guix? wingo: probably we need to roll back the change in guile i guess civodul: wingo: it's fixed on the Guix side! civodul: that is, if you take Guix master and add "3.0" to configure.ac, it builds civodul: i have yet to address remaining test failures wingo: nice!! wingo: was it a big ol' pain or was it ok? civodul: a bit tedious because i had to check every autoload clause, but ok wingo: i.e. do we need to be roll back the change in guile or is a NEWS entry sufficient civodul: i think a NEWS entry is sufficient civodul: but i really don't know if i was the only one doing that nasty thing or not :-) wingo: we'll see i guess civodul: yeah *: civodul updates (web client) wrt. TLS civodul: wingo & all: i've pushed a branch with better TLS support in (web client): https://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-https-client civodul: that'd be for 3.0 civodul: but i'd rather have feedback on the API civodul: (the code is mostly from Guix) wingo: excellent!! wingo: would be ideal to use exception objects of course wingo: though i understand if it's not possible civodul: i wondered, the rest of these modules still uses symbol + args wingo: yeah. can transition later wingo: it's fair amount of work and we don't want to block 3.0 because of it civodul: yeah civodul: i'm emailed guile-devel as well dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work civodul: Happy Friday! rlb: wingo: So, 2.2.6 is not in debian testing yet because it can't make it past the build timeout on the arm* buidds, i.e. the debian buildds kill a build if there's *no* output for 150m, and I'm guessing that became the case after the build order serialization changes (i.e. 2.2.4 was fine). I tested on a porterbox, and the overall time is now 502m, but it's that "no output" time that's really matters. rlb: wingo: we *may* be able to raise the timeout, but right now, there's no (longer a) per-package timeout, so it'd have to be for all debian packages. I was wondering about the possibility of hacking in some kind of progress canary (perhaps only in the debs) for the really slow phase... rlb: s/only in the debs/only in the debian build/ terpri: rlb, any idea what it's spending its build time on (e.g. with data from strace, ltrace, ...) could be something easily optimizatble rlb: It's just CPU, I think, and completely expected right now, i.e. guile's full bootstrap (which the debian packages do -- they don't rely on (nor have) the archive .go files) is *very* expensive in the initial stages. terpri: yeah the full bullstrap is relatively slow terpri: i have some ideas for optimizing profile hook scripts and such but they won't help if the core build is too slow rlb: Ahh, well in this particular (unusual) case, it's not the overall time, that's the problem. It's the length of time with no output to stdout/stderr. rlb: (more than 150m) rlb: Worst case, if it's not deemed too big a hack by the relevant parties, I can just add a canary to the build that prints something random every so often, but I thought I'd ask in case there was something obvious, and less hackish we might do via guile itself. terpri: rlb, do you have an example of where it gets "stucks" under your build system? terpri: i'm imaginging it happens during long single-file compiles like "BOOTSTRAP GUILEC ice-9/eval.go" rlb: yep, I think that's right -- I'm about to run another build using ts(1) so that I can see exactly where the "long poles" are time-wise, since they buildd admins might be willing to raise the overall limit a bit, but likely not as high as 500+ minutes. terpri: could perhaps be useful to add guix-style progress bars for build processes (both for finicky auto builds and better interactive ux) terpri: rlb, nice, let us know if you see anything interesting janneke: grrr, unfortunate that we have two list-index functions wingo: moo nly: hi sneek: nly, you have 2 messages. sneek: nly, str1ngs says: there are some examples here https://github.com/mrosset/giqt/tree/master/examples. I have ones for scheme, lisp, python and javascript. though I'm sure you are only interested in the guile one sneek: nly, str1ngs says: for a speech interface I would prefer some thing that is either a C library or GTK related. vs QT lispmacs: performance wise, do you think it is better to join two strings and then print it, or print each string separately? wingo: nii wingo: lispmacs: print separately wingo: but in this as in all perf questions, if possible the questions should be answered by measuring :) davidl: Where can I find a base64 library for guile-2.2? Im looking for something similar to ice-9 base64 davidl: so here is a base64 module for guile: https://github.com/adamemerson/tekuti-azure/blob/master/tekuti/base64.scm but isn't there any built-in way in Guile to encode something in base64? RhodiumToad: oddly, I don't see one ft: Not in core guile I don't think. RhodiumToad: obviously one can be written in scheme ft: Guix seems to have a base64 implementation. ft: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/base64.scm davidl: that guix bas64 module looks good davidl: thx ft: They have some stuff that would be cool if it was in guile core... davidl: ft: I agree lloda: send a patch! wingo: i never know when to stop with guile core so sometimes i don't start :) peanutbutterandc: Hello there, I have a quick question: GNUCash is featured prominently in the guile website as one of the softwares that use guile as an extension language (and I have asked this in their irc too, and am waiting for a reply but can't trust my internet connection that well)... peanutbutterandc: ... and in light of section 5.7.5 of the guile reference manual, I would like to know if guile integration with gnucash is sky-is-the-limit-we're-doing-things-like-emacs-here or is it only relegated to reports? wingo: peanutbutterandc: afaiu it's just reports :/ the gnucash dev community has different factions afaiu and only some are very guile-positive :) wingo: there are some gnucash devs here tho; if you wait around they might answer peanutbutterandc: wingo, Whoa! You are Mr. Andy Wingo! peanutbutterandc: The maintainer!!! peanutbutterandc: Super cool! Thank you for your work! And Guile 3! Yay! (Even though I'm just a n00b and it's just been a few months since I started trying to learn scheme properly) peanutbutterandc: I see. I wish guile was like emacslisp for gnucash. I need to extend it for my personal use. *sigh* Thank you very much, anyways. :) wingo: happy hacking with guile :) peanutbutterandc: wingo, Thank you, Mr. Wingo. Perhaps someday I might be able to send you a patch myself (wishful thinking). I liked your talks too. Please do continue making guile even better, sir. :) wingo: it's not just me, guile is a collective project :) but thanks :) peanutbutterandc: wingo, I understand. Still. Yours are the only talks I found on YouTube regarding Guile (or atleast the only ones I've watched - despite not understand most of what was being said). An honor, sir. *salutes* laurus: Regarding Emacs Lisp support in Guile, how do I find which functions are supported? For example, can I use buffer related functions even though there is no "buffer" on the screen? laurus: Never mind, I answered my own questino. laurus: question. lispmacs[work]: I there some syntax like set!, but that evaluates the first argument before set it? lispmacs[work]: so you could do something like (let ((x 'y)) (set! x 12)) and then y is set to 12 daviid: guilers, guile-gnome defines gdk-event accessors like this, gdk-event:type, gdk-event-button:x ... but I was wondering if to maintain this iterface or to use -> instead of :, so we'd have gdk-event->type, gdk-event-button->x ... daviid: *to maintain this interface in g-golf, nothing will cahnge in guile-gnoe of course :) daviid: I guess using : is fine, asking because the C folks use -> to access struct fields ... but in scheme, -> generally imply a transformation str1ngs: daviid: for scheme : is fine. I don't see any gains for -> in scheme daviid: ok good jcowan: I wish there was a bit more documentation on Guile/Elisp sharing conventions, for example how to get the value of an Elisp dynamic variable in Guile or a Guile (lexical) global in Elisp. RTFS is not an answer I'm happy with. str1ngs: jcowan: I did not even know that was possible. though I searched jcowan: it may not be, but that's my point lispmacs[work]: okay, I think boxes is what I was looking for, SRFI 111 lispmacs[work]: I'm mildly curious how boxes are implemented, but not quite enough free time available here at work to dive into it jcowan: They are just records with a single field. jcowan: lispmacs[work]: ^^ d4ryus: for convenience i'd like to re-export symbols of some modules form a single module, is there a way to do that (besides writing all symbols by hand)? d4ryus: s/form/from dsmith-work: {appropriate time} Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) str1ngs: d4ryus: see https://git.savannah.nongnu.org/cgit/emacsy.git/tree/emacsy/emacsy.scm str1ngs: d4ryus: namely re-export-modules d4ryus: str1ngs: ah, perfect! thanks str1ngs: d4ryus: you can refine this to your liking. I just thought a more complete example would help. str1ngs: no problem rlb: wingo: right -- I suspect it is, since that patch was directly on 2.2.6, but I'll double-check. daviid: str1ngs: I am sorry gdk-event are taking more time the what I initially announced here - it's actually a bit more complex then I initially thought, then I also had (and still have) to dedicate some timeon another task ... but I am working on it ... str1ngs: sneek: later tell daviid. no rush I'm still working on this guix gobject issues. which effects guile-gi as well. sneek: Got it. str1ngs: sneek: later tell nly there are some examples here https://github.com/mrosset/giqt/tree/master/examples. I have ones for scheme, lisp, python and javascript. though I'm sure you are only interested in the guile one sneek: Got it. str1ngs: sneek: later tell nly. for a speech interface I would prefer some thing that is either a C library or GTK related. vs QT sneek: Okay. str1ngs: sneek: later tell daviid also I have a work around for the key press event issue. I just pass the goops class to a typlib function and setup the signal there. so the end result is the same. sneek: Will do. rlb: Is there any way to use string->keyword and keyword->string without changing the reader globally -- i.e. I want to use those functions without breaking compilation of something like (use-modules (guile web)) which has a #:prefix foo: in it. If not, I wonder if we might want to provide alternate access to those two functions. rlb: You can demonstrate the problem by creating a module containing (define-module (foo) #:use-module ((srfi srfi-4) #:prefix bar:)) and make sure it's not in your ~/.cache, then from a repl, (use-modules (srfi srfi-88)) followed by (use-mouldes (foo)). rlb: Here, with 2.2.6 compiling/loading foo crashes because it reads bar: as a keyword. rlb: (same thing happens with (web client) -- what I meant to say above, rather than (guile web)) rlb: Oh, well, I guess I can just side-step it for now -- didn't realize those two functions were just trivial indirections... rgherdt: Hi! I'm trying to run the tortoise example on guile-2.2 and gnuplot 5.2 and somehow when I run scm_shell and try out tortoise-move etc. nothing is drawn. Did someone experience the same problem? Here the code: https://github.com/nov314k/tortoise-guile/blob/master/tortoise.c rgherdt: If I call tortoise_move direct out of C it works rgherdt: I solved the problem. The issue was fprintf was outputting commas instead of dots for floating points, changing the locale fixed it chrislck: I have a (for-each) vs (ice-9 match) query... not sure how to express myself. chrislck: Having discovered the magic of (ice-9 match), is it possible to translate its conciseness into for-each? chrislck: e.g. consider a regular alist (define greeks '((a alpha) (b beta) ...etc...)) is it possible via macro to create an uber-for-each? chrislck: (for-each! (lambda ((letter greek)) (format #t "~a->~a in greek" letter greek) greeks) chrislck: ... I suppose there's no harm trying lloda: you can do that with match-lambda iiu what you mean lloda: I use it all the time chrislck: ooh fancy chrislck: how clever they are chrislck: (for-each (match-lambda ((letter greek)) ...) greeks); much conciseness chrislck: does it makes it possible to write a whole scheme prog without any car? >:) daviid: str1ngs: I pushed a few patches, wip, so that g-value-get-boxed 'blindingly' return its (pointer) value when the boxed type is union, so we can start to play with gdk-events, but i have a strainge results when asking for the event type sneek: daviid, you have 2 messages. sneek: daviid, str1ngs says: no rush I'm still working on this guix gobject issues. which effects guile-gi as well. sneek: daviid, str1ngs says: also I have a work around for the key press event issue. I just pass the goops class to a typlib function and setup the signal there. so the end result is the same. daviid: str1ngs: if you could pull and make ... then try this example - https://paste.debian.net/1125162/ - but in a repl, like this daviid: ,use (g-golf), then (load "hello-world.scm"), then (main '()) and then hit a key of the keyboard and hit the top-level right button of the window bar, the cross, so the delete-event is triggered daviid: then in the repl: (gdk-event-get-event-type %delete-event) and/or (gdk-event-get-event-type %key-press-event) daviid: big surprise, here it returns 469802720 for the former, instead of 0 )(zero) daviid: actually, to trace the problem, I added a call to display the result of the call to gdk_event_get_event_type, then it displays 469802720, and gdk-event-get-event-type returns #f, since there is no such gdkevent type ... daviid: at this point, I don't know what I could do to try to figure out what the problem is, anyone has an idea? str1ngs: I can test this now daviid: technically, I didn't even have to bind gdk-event-get-event-type, because g-golf provides scheme support to C union types, in (g-golf support union), c-union-ref and c-union-set!, but that returns exactly the same value (which is why I did bind gdk_event_get_event_type, thinking there might be a bug in my c-union-ref, but both return the same value daviid: (c-union-ref %delete-event 96 int) -| 469802080 daviid: 96 is the size of the union daviid: (describe (gi-cache-ref 'boxed 'gdk-event)) to see the complete def str1ngs: (describe (gi-cache-ref 'boxed 'gdk-event)) works for me str1ngs: the lamba signature for key-press-event looks more inline is the C closure which is a nice change daviid: str1ngs: yes, expected, what does not work is what i talked about above daviid: str1ngs: things will change still, but i first have to solve the bug daviid: of this low level first attempt ... gdk-event-get-event-type returns 'fancy' values str1ngs: I'm still groking the issue you having give me sec str1ngs: you are* daviid: sure daviid: so does return strange values - (c-union-ref %delete-event 96 int) and (c-union-ref %key-press-event 96 int) daviid: I asked on #introspection if anyone has a idea of what could be the cause, but nobody could thnk of something daviid: str1ngs: what is the include i would need to add to libg-golf.c to have access to GdkEvent nd friends ...? daviid: or maybe the #include glib-object.h is enough str1ngs: daviid: important note the continuation for the key-press-event is not doing what you think it is doing. str1ngs: TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further. str1ngs: taken from https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget-key-press-event daviid: i know that thanks, but this is not related to the problem str1ngs: nvm I read this wront str1ngs: wrong it is do *not* sorry daviid: both need to return #f, which is what the example shoews, but again, this is not the problem str1ngs: I read the comment wrong your understanding is correct daviid: let's concentrate on the bug daviid: str1ngs: do you know the include i need to add to libg-golf? it complains nknown type name ‘GdkEvent’ str1ngs: another thing since you are have an event that main quits when the windows is destroyed you don't need to all it after destroy the window on button click str1ngs: to call main quit I meant daviid: please let focus on the bug daviid: tx str1ngs: I will find GdkEvent str1ngs: #include daviid: tx daviid: libg-golf.c:35:10: fatal error: gdk/gdk.h: No such file or director daviid: or maybe i'm missing some -dev debian packages str1ngs: need pkg-config --cflags gtk+-3.0 str1ngs: and libgtk-3-dev str1ngs: daviid: making progess here give me a sec daviid: str1ngs: i wrte a C func, and it gves wrong vlaue as well daviid: here https://paste.debian.net/1125185/ daviid: i think the pointer is invalid, but why don't know yet str1ngs: daviid: please try with http://paste.debian.net/1125186 does delete-event give you the right value? str1ngs: no need to use a repl daviid: yes it does str1ngs: I think the use of set! is problematic it's best to stay within the signals. but you would understand the underlying guile aspect. str1ngs: think if the event is unreffed after the signal is run str1ngs: un-referenced I meant daviid: str1ngs: the only explanation would be that the events are becoming invalid after gtk-main-quit - the set! was purely to test/try ... str1ngs: yes gtk-main-quit will not even return from the signal. and it does clean up. I have structured where gtk-main-quit should be called daviid: did ask on #instrospection daviid: but it make sense str1ngs: I hoped this helped? daviid: ok, tx for the help daviid: to test, i'll use a thread and no quit ... in the future daviid: *a separate thread str1ngs: right I was going to mention that for repl use str1ngs: daviid: I'm pretty confident the event is un referenced after the closure is called. str1ngs: if you add this signal snippet you can see what I mean. http://paste.debian.net/1125204 daviid: str1ngs: yes they are, should have thought about this but ... tired I guess str1ngs: no worries daviid: note that your commet related to 'no need to #f in the delete-event callback' is 'inaccurate, here is what happens: the window is destroyed, the gtk main loop quits, but the scheme glosure-marshaller still runs, and it expects a boolean daviid: when you comment this last value, you may try, it raises an exception daviid: which is expected daviid: it raises an exception because gtk-main-quit returned value is void, and a delete-event callback must return one value, a boolean ... str1ngs: good to know thanks. str1ngs: though personally 'destroy is probably a better for gtk_main_quit str1ngs: a better signal* str1ngs: 'delete-event is mainly if you want to protect the window from being closed. str1ngs: or more accurately protect it from being destroyed daviid: not sure, but these small example are so that i can test ... i know quite a lot of uers click on the delete (top roght button on the wndow bar) to delete the window, precisely daviid: but everyone will be able to do what ever he/she thinks best str1ngs: that's understandable. but that also destroys the window so 'destroy is always called on destruction daviid: my task is to provide signal and gdk-event processing fnctionality .. str1ngs: with 'delete-event you can by pass destruction str1ngs: say hide the window instead. daviid: yes, if that is what you want, like you personally daviid: for that users would clck the _ instead str1ngs: right, but with this example both click button and delete window achieve program quit. simply by the window being destroyed. daviid: str1ngs: it is merely a test code, it does not reflect real app daviid: str1ngs: in real app though, you'll almost alwys will find both a quit menu entry or button and the delet-event str1ngs: that's understandable daviid: but let's not argue, i have other things to do, really, do as you wish in your app, of course str1ngs: the gdkevent is looking much better even up to this point. thanks for the work davvid str1ngs: daviid* daviid: str1ngs: tx, it's going to be much better still, basically, like guile-gnome, i want to 'copy' the guile-gnome interface, but I still have quite a few difficult little thing to do to get there ... str1ngs: makes sense, that's one aspect I like about g-golf. considering I'm used to the C interfaces myself rlb: So if all read options are completely global, how do you get the current value of a read option for use in a dynamic-wind to restore the original value? rlb: (I mean, ignoring the newer port-specific options.) artyom-poptsov: Hello Guilers! FWIW, I released new version of Guile-SSH: https://lists.gnu.org/archive/html/guile-user/2020-01/msg00016.html Please let me know if there's any problems with the new version. artyom-poptsov: I saw that someone tries to package Guile-SSH for Debian (https://tracker.debian.org/pkg/guile-ssh). Kudos for that. Some time ago I prepared a Docker container based on Debian with Guile-SSH and the latest Guile: https://hub.docker.com/r/avvp/debian-guile rlb: wingo: I don't know if anyone's noticed this, but it'd be nice to have it fixed in any future 2.2 (and the 3.0 release if it's not already): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38534 rlb: ...and to answer my earlier question about the reader -- looks like you might use dynamic-wind along with (read-options) to save the current settings, and (read-options previous-result) to restore them. rlb: Unless I missed it, the docs don't say anything on the topic, i.e. I found it in options.c (had forgotten about that). If I get time, I may see about a doc patch, at least for the reader, if not for the broader subsystem described in options.c. wingo: rlb: hey good catch and fix! wingo: please feel free to push, the patch looks great lloda: hi wingo wingo: moin :) lloda: can we fix this... lloda: > (error) lloda: "ice-9/boot-9.scm":1656:16: In procedure raise-exception: lloda: I mean, every time there's an error somewhere, the source line is that one in boot-9 lloda: you need to ,bt to have a clue where the error was at all lloda: I don't remember that happening before lloda: it's not a big deal or anything wingo: was this the case in 2.2 ? wingo: the answer of course is that yes we can fix this :) lloda: it wasn't the case lloda: on 2.2 lloda: > (error) lloda: :1:0: ? lloda: etc. lloda: or clearer I think lloda: cat > x.scm lloda: (error) lloda: ^D lloda: guile2.2 lloda: > (load "x.scm") lloda: /home/danielo/sys/obj/guile3/x.scm:1:0: ? lloda: while on 2.9 you'd get the raise-exception line from boot-9 instead lloda: I mean x.scm is just one stack frame up, so it's there lloda: but it's worse than before I think civodul: 'lo! artyom-poptsov: Hello civodul civodul: hey artyom-poptsov civodul: artyom-poptsov: i have test failures when building Guile-SSH 0.12.0 in Guix: https://paste.debian.net/1124959/ artyom-poptsov: Oh. Which version of Guile do you use? civodul: it's 2.2.6 civodul: looks like something broken in the test infrastructure, but i can't see what artyom-poptsov: I saw that with the latest Guile versions some test fail due to strange (mis)behaviour in tests when two references to one procedure are compared and they're looking different to Guile although should be the same (as it was in older Guile versions.) civodul: as in (eq? proc1 proc2) ? civodul: you cannot rely on that civodul: like (eq? (lambda (x) x) (lambda (x) x)) might be true, or it might be false artyom-poptsov: Here, for example: https://github.com/artyom-poptsov/guile-ssh/blob/master/tests/log.scm#L33 artyom-poptsov: Or here: https://github.com/artyom-poptsov/guile-ssh/blob/master/tests/log.scm#L39 civodul: ah well, this one should be fine civodul: yeah, i think these are ok civodul: anyway, there's something else going on here :-) artyom-poptsov: So I need to re-check. BTW, I ran tests in my Docker container: https://hub.docker.com/r/avvp/debian-guile civodul: ok civodul: so no hints in the test-suite.log i pasted above? artyom-poptsov: Maybe I'll try to run tests again this evening and see what will happen. Should I consider 2.2.6, or other Guile version? civodul: 2.2.6 is a good start! civodul: i'll also check with the latest 2.9 wingo: artyom-poptsov: regarding https://github.com/artyom-poptsov/guile-ssh/blob/master/tests/log.scm#L33 indeed in declarative modules, it could be that the -O2 optimizations can make some procedures not eq? in places where they were eq? in 2.2 artyom-poptsov: Okay. This means I have to re-write some tests. What is the right way to compare procedures then? wingo: it's really quite unspecified :/ wingo: like (eqv? x x) may be #f, if x is a procedure, afaiu wingo: but if you are asking for a workaround, you can change to have the logging handler be defined not at the top-level but rather lexically (within a `let') civodul: wingo: i think these tests are fine though: they amount to (set! x proc) (eq? x proc) wingo: that is your intuition :) civodul: oh, what am i missing? wingo: in practice i think what is happening is that the references to the declarative binding `proc' are getting eta-expanded wingo: to (lambda (...) (proc ...)) wingo: allows proc itself to be contified within the compilation unit civodul: hmm, ok civodul: but anyway, that's with 2.2 and i think it's evaluated, not compiled wingo: which is precisely why procedure equality is unspecified in scheme civodul: yeah wingo: civodul: i think artyom-poptsov mentioned "latest guile versions" so i assumed 2.9.x wingo: anyway civodul: oh right, maybe artyom-poptsov: Yeah, I tried 2.9.0 and 2.9.3, I think. jonsger: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38890 happens also on Guix http://ci.guix.gnu.org/log/n8b41039d475rmyg9qkxpl99icl0vkjh-guile-next-2.9.8 and on 32bit Solaris https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38516 nerdypepper: hiya guilers nerdypepper: https://files.nerdypepper.tech/tI.txt any idea what causes this? nerdypepper: source file that im tryin to exec: https://files.nerdypepper.tech/1Y.txt nerdypepper: seems to occur only when i pass 'and' as the argument to the 'accumulate' function nerdypepper: i ran the program with `guile -l sets.scm`, if that matters wingo: nerdypepper: it's a not-great error but the issue is that and is a macro, not a function wingo: i.e. (and #t (error "what")) never evaluates the error nerdypepper: ah gotcha, thanks wingo nerdypepper: is there anything i can do to pass 'and' as a function? wingo: nerdypepper: (lambda (x y) (and x y)) nerdypepper: oh. nerdypepper: thanks wingo! wingo: np :) *: janneke is fighting with `make TESTS=tests/peg.test' SCM_TESTS=... etc janneke: there must be a way to run a single test janneke: hmm, guile-test is executed from libguile, not inside test-suite janneke: so, no automake test runner... lloda: is that ./meta/build-env test-suite/standalone/test-etc janneke ? janneke: lloda: thanks, no not standalone; test-suite/tests/peg.test, e.g janneke: runnig `guile-test' apparently, looking to see if that is parameterized janneke: hmm, this kind of works.. janneke: ../build/meta/guile -L ../module -C ../build/module -C . -L . -e main guile-test rlb: wingo: ok, thanks -- now we'll see if I really still can. What's the convention, should I just push that to master? (Looks like there are merge-ups, but not recently?) janneke: ha, this works: cd test-suite; ../build/meta/guile -C . -L . -e main guile-test tests/peg.test rlb: Also, I wasn't sure if my commit message was OK, i.e. I didn't include ChangeLog style entries, but I can try to add those if that's preferred. civodul: janneke: ./check-guile peg.test :-) civodul: i believe that's the official way wingo: rlb: yes please rebase and push on master wingo: i mean rebase the patch on top of master obvs janneke: civodul: ty janneke: beautiful! janneke: trying to upstream some peg enhancements...no promises yet civodul: ooh! rlb: wingo: ok, and cherry-pick it to stable-2.2 too, or just leave it out there? nerdypepper: i jcowan: In R5RS and R7RS, procedures have location tags that are set (behind the scenes) when a closure is created; they might be the address of the closure object in memory. R5RS requires both eq? and eqv? to return #t if its arguments have the same location tag; R6RS has no notion of location tags; R7RS compromises and requires eqv? to return #t but leaves the behavior of eq? open. jcowan: This was done in R6RS to allow compilers to transform references to a procedure in object position to lambdas, but it interferes with things like a procedure which takes an argument that is either +, -, *, or / (say) and dispatching on it. wingo: rlb: i would think it's fine to cherry-pick, as long as you are sure the bug is present there wingo: moo daviid: lxsameer: on that page, click more news and search for "GNU Guile 2.0.0 released!", second paragraph, then look for " GNU Guile 2.9.1 (beta) released", second paragraph as well - in the middle of these two, you'll also find a release about 'reproducible go files' ... lxsameer: daviid: seriously dude, you went through all these in order to avoid answering a simple question ??? pkill9: award for pettiest message of the day goes to daviid pkill9: only 50 minutes left (in the UK), will anyone top it? mwette: before execution it compiles to bytecodes, then executes the bytecode on a virtual machine; if the bytecode runs multiple times guile then comiles to native code on the fly (staring w/ V 3.0) lxsameer: mwette: so it's not a AOT compiler lxsameer: am I right ? mwette: lxsameer: to bytecode yes, to native code no -- to my knowledge seepel: Hello Guilers, I've just started working on a GTK application that I would like to develop in Guile as much as possible. I noticed that guile-gnome is still using GTK2. Does anyone have a recommendation on if I should try using guile-gnome on gtk2, or should I wrap gtk3 myself? seepel: Or if there isn't a clear winner, what concerns might I want to weigh in making my choice? I will eventually want to also integrate WebKitGTK if that matters. mwette: seepel: check guile-gi seepel: Oh cool! mwette: https://github.com/spk121/guile-gi/blob/master/examples/browser.scm seepel: mwette: Thanks, this looks promising! spk121: seepel: I need to make a new release 0.2.2 soon because of a bug in 0.2.1 that is fixed in the repo. But guile-gi is basically functioning now. seepel: Just read through the documentation, seems like a really nice project! I'm still a bit of a noob in dealing with gnu build tools (linking and all that), so I'm trying to sort through that at the moment :D. Running in Guix System, and Guile can't find guile-gi jackhill: seepel: You may also be interested in g-golf and Nomad as an example. jackhill: having not used either guile-gi or g-golf, I can never keep them straight it my head, but I think they are two different approches to using gobject introspection for bindings. jackhill: but since spk121 is here, trying guile-gi might be a winner :) seepel: I have been following along between autotools hello world, nomad, and the gtk tutorials so far. Managed to get a hello world gtk app running with C, so that was exciting. I probably need to stumble around enough that I start to get an intuition as to how all the pieces fit together. I haven't really messed around with linux at all since 2005 or so :) str1ngs: regard nomad and g-golf. g-golf integration working is being done on the feature-g-golf branch is close to completion yet str1ngs: s/working/work spk121: seepel: weird that you're seeing that problem with guix. There is a guile-gi package in guix, so it should "just work" spk121: seepel: autotools is a nightmare, but, there have been many Guile programs that have made it work. seepel: I installed that, I do indeed see the library hiding in /gnu/store seepel: spk121: Seems like most of the guile projects I've seen do use autotools, so I figured it is worth learning, even if it is not the prefered build system. My experience has mostly been that most build tools are a nightmare until you understand how they work :D daviid: seepel: fwiw, here is a hello world example using g-golf - http://paste.debian.net/1124813/ seepel: spk121: I can't seem to get either of the examples in the top level README to run. Seems like with the first the guile-gi command is simply not available, and in the second after I run make there is no tools/guile-gi. Do you expect them to run? I tried on both master and v0.2.1 spk121: seepel: If you actually built master, you could go to the directory where you unpacked it and then to "./tools/uninstalled-env guile examples/browser.scm" spk121: or rather "./tools/uninstalled-env guile examples/browser.scm" seepel: spk121: Ahh, yes I tried that as well and get many errors: http://paste.debian.net/hidden/a41b0b45/ This could all be down to me not knowing how to guix though, probably not worth you spending any time digging in, but if there is something off the top of your head I'd be all ears. spk121: honestly no idea. it looks pretty catastrophic. but if you have a chance to "make check" from the build directory and send me the "test-suite.log" file it generates, I can try to figure it out. seepel: hmmm, seemed to get stuck after `test/gtk.scm - init` spk121: seepel: weird. and you are running this from a gui with Gtk installed, and not from the console? str1ngs: seepel: I'm assuming you are using guix? str1ngs: using guix environment -l ./guix.scm --ad-hoc gtk+ webkitgtk and ./tools/uninstalled-env guile examples/browser.scm I get this this error as well. in fact it's similar to an issue I've been tracking down with in regards to g-golf. I have a fix that fixs this issue as well but it's not ideal str1ngs: spk121: ^ str1ngs: here the patch I used to get around this for now. http://paste.debian.net/1124820 it requires not building gobject-instrospection package with the gobject-introspection-absolute-shlib-path patch. but then you need to use LD_LIBRARY_PATH. so something related to how typelibs are generated or library paths is causing this problem. str1ngs: spk121: ^ if you can an reproduce the cannot register existing type 'GtkWidget' error with guile-gi let me know please. spk121: str1ngs: ok. I don't have that problem on my dev box or my Travis-CI instance which is Ubuntu. I should add some sort of vanilla Guix instance to my continuous integration str1ngs: the problem does not happen on debian or ubuntu bases systems only guix str1ngs: based* str1ngs: make check passes as well. I suspect its related to the tyeplib or gir paths. or there generation str1ngs: removing the shlib patch fixs the issue str1ngs: oddly though I cant get gjs or pygobject to produce this error either str1ngs: spk121: it's not a guile-gi or g-golf issue . some guix related. but I've yet to find the specific issue. just narrowed it down to remove that patch resolves the issue. spk121: str1ngs: ok, good to know. When I get a chance, I'll try it again with a clean Guix VM str1ngs: if I figure out more I'll let you str1ngs: .. know* lloda: anyone else has an opinion on string-replace-substring vs string-replace-all ? I do like the second better and if it's already in Guix it's a point in favor I guess lloda: oh it's string-replace-substring in Guix lloda: w/e if anyone has arguments either way let me know rlb: I don't know why, but I'd imagined that reader options would be reset at the end of a module load, so that it'd be safe say change the keyword style before a define module. But reader options are just always global, right? So even if you wanted to use a different keyword style in a module, you have to stick with the default syntax for the define-module form? rlb: ...*and* you risk breaking other modules if you don't restore the defaults carefully? Or do I still misunderstand? wingo: moin lloda: hi wingo lloda: is it an ok thing to do (let () (import (a b) c)) ? lloda: sorry, (let () (import (a b)) c) lloda: I do get a compilation warning for c lloda: and c is available after, so the names are imported into the current module I guess? lloda: is there a way to import names for a scope only wingo: that would be nice! but i don't think guile supports that currently lloda: np, just wondering lloda: ok to push? http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=6cfee365434ca8a18053600575c79dde6775bc2d lloda: I did keep the old name instead of daviid's suggestion wingo: lgtm wingo: thanks :-) lloda: done lloda: sneek: later tell daviid I did like string-replace-all better, but there is already a function string-replace that replaces all chars, so string-replace-substring seems to be a clearer name sneek: Got it. civodul: Hello Guilers! wingo: morning :) pkill9: morning civodul: wingo: so it seems that the last blocker for Guix on Guile 3 is civodul: well i guess it's a semi-blocker because it could be addressed on the Guix side too wingo: hmm wingo: can be fixed, of course wingo: i guess i didn't realize that cb14fd2143 would be a breaking change, that people do #:autoload and expect to get the whole module wingo: why does guix do this? wingo: i think it's something worth deprecating fwiw, and in that case guix would probably want to change wingo: so i am unsure whether to fix it. of course it would need to be in NEWS, as i didn't realize that i had made that change :/ wingo: what's your preferred option civodul ? civodul: wingo: i can try fixing it and see how tricky that is (it shouldn't be that hard, but who knows...) civodul: but yeah, i've been used to that behavior since... forever! civodul: it is kinda ugly, though, for sure wingo: do you agree that we should move towards the behavior in guile master? wingo: (question in that case would be whether to move quickly or slowly) civodul: yes, probably civodul: now, the less friction, the better wingo: of course civodul: so perhaps we could deprecate it and change it later? civodul: though it may be hard to emit deprecation warnings here civodul: it'd take a bit of machinery to simply detect the "legacy" base *: civodul looks at the 93 #:autoload in Guix wingo: maybe adding a module binder to autoload interfaces for any other exported identifier civodul: yeah lloda: how do I get guile-json to interpret a lists of lists as a list of lists and not as an alist? lloda: ok use vectors I guess civodul: lloda: yes, in Guile-JSON 3 you have to use vectors for lists lloda: yeah I had to update, had an older version. Thx civodul daviid: hello guilers sneek: Welcome back daviid, you have 1 message. sneek: daviid, lloda says: I did like string-replace-all better, but there is already a function string-replace that replaces all chars, so string-replace-substring seems to be a clearer name daviid: lloda: ok, understood, thanks for the feedback rlb: So is there any typical way to use say (read-set! keywords 'postfix) in a module without risk of breaking other modules? This came up when a module did that, and then a later (use-modules (web client)) broke because it has a "#:prefix foo:". (I'm actually now surprised nothing else broke.) lispmacs[work]: Hi, i was wondering if somebody would suggest a particular study-guide/workbook for advancing your scheme skills, ideally that could be downloaded for free off the Internet. In the past I went through the land of lisp book, which was entertaining, but focused for the most part on introductory instruction count3rmeasure: The Scheme Programming Language by Kent Dybvig is a web book, i.e. html, you can also buy a dead tree version count3rmeasure: lispmacs: if you live near a university of a decent enough size or with an engineering focus they are almost certain to have some edition of it, its what I use when I want to refresh wingo: moo jcowan: Fluids interact badly with threads, so I'd avoid them crab1: Hey, I'm playing with the guile web server, and I can't find all the different options for content-type in the manual anywhere, can anyone help? sneek: Welcome back crab1, you have 1 message. sneek: crab1, atw says: could you post your operating-system config and talk a bit about how you're installing? wingo: jcowan: the whole point of fluids is to interact nicely with threads. bandali: wingo, have you seen this? https://drewdevault.com/2020/01/04/Slow.html bandali: made me curious what the number of syscalls for a guile hello world looked like bandali: so i wrote bandali: #!/home/bandali/.guix-profile/bin/guile -s bandali: !# bandali: (display "hello world") bandali: and then bandali: strace -o trace ./hello.scm bandali: wc -l trace bandali: gave me 698 bandali: which...is quite a few :p that’s with guile 2.2.6 bandali: anyone know what it looks like with the 2.9.x series? terpri: bandali, 947 with guile-next, after running it once for auto-compilation bandali: oof bandali: terpri, thanks for the data point bandali: that’s even more than node and julia, but still less than cpython and ruby, i guess spk121: there's a thread over on bug-make about how Make targets C90 but "libguile.h" headers aren't C90 compatible spk121: so the Guile extension for make is problematic mwette: on 8/3/19 wingo sent to guile-devel this: "** scm_t_uint8, etc deprecated in favor of C99 stdint.h" spk121: looks like GNU Make's strategy is going to be to more completely avoid parsing libguile.h when not using the Guile extension mwette: and 6/23/18 wingo posted email to guile-devel w/ subject "c99 support" mwette: no one caught the make dependence I guess ArneBab: Realized today that I’ve already been working with Guile for over 5 years mwette: ArneBab: nice work -- I first worked w/ Guile late 90's with mostly 1.6 (maybe 1.4?); then quit for a while and came back when it was 2.0 ArneBab: I got my basics for dryads-wake ready toady: https://hg.sr.ht/~arnebab/dryads-wake/browse/d5056953e3def507f580acc0feb61ffbb221deaa/dryads-wake.w#L32 ArneBab: This is now natural script writing with structure ArneBab: calling functions inline within dialog via ,(fun), while having full access to all of Guile wingo: spk121: why does gnu make target c90 ? wingo: anyway they can always include gnulib stdint.h before including libguile afaiu wingo: or stay with guile 2.2 in the meantime spk121: wingo: i doubt there are any systems that have native compiler that is c89/c90 and that also can compile Guile. Pretty much, Guile is linux, cygwin, and some BSDs only in terms of portability, so the gcc (or clang of OpenBSD) are all c99+. Windows native C compiler is C89 *: wingo nod jcowan: wingo: Oh, sorry, Guile fluids /= SRFI 15 fluids, which are the bad fluids. But I still agree with the Guile docs: use parameters instead jcowan: I ran the strace and wc -l on (display "hello world") with the Chicken interpreter (lines) and a Chicken-compiled version (421 lines). jcowan: s/lines/593 lines lxsameer: hey folks, I'm new to Guile. Is it a interpreter only language or does it have an actual compiler to compile scheme to native binday image ? daviid: lxsameer: https://www.gnu.org/software/guile/ lxsameer: daviid: yeah i saw the web page mwette: I've read wingo's http://wingolog.org/archives/2019/06/26/fibs-lies-and-benchmarks that states (in my words) mutable top-level bindings in modules are old school. If so, is replacing top-level variables with fluids or parameters enough? mwette: I have done this in nyacc, but wonder if I should do a scrub of everything. lispmacs: if I created a scheme procedure with scm_c_define_gsubr, is there a way I can add a documentation string to that procedure? lispmacs: does the documentation string get stored in a property? RhodiumToad: it seems so RhodiumToad: specifically the 'documentation property manumanumanu: wingo, civodul: There are some small things I did not include in the transducers patch (sorry, Haven't had a computer over christmas and new years): I thought a little over christmas, and realized I forgot to add a cond-expand sho-be-do for srfi-171. manumanumanu: Should I add that and make a new patch with everything added? like a squashed commit, or whatever the git folks call it. wingo: evening *: wingo updated graphs on https://www.gnu.org/software/guile/news/ to be more comprehensible civodul: wingo: neat, the graphs do look nicer this way! lloda: hi guilers, happy new year lloda: wingo: no blockers really lloda: the truncation thing but it's not an obvious fix I guess lloda: would like to get this patch in http://git.savannah.gnu.org/cgit/guile.git/commit/?h=wip-exception-truncate&id=5b0075651536784ae9694e5e14c808c3f060c0e9 lloda: I sent it to the list before xmas wingo: lloda: i think we should fix the truncation thing but afaiu it can also be fixed during 3.0 wingo: for the vector-fill! thing, sgtm. can you please declare scm_vector_fill_partial_x as static and use SCM_DEFINE_STATIC in the definition wingo: sneek: later tell jonsger i think you might be deleting the ".version" file from the tarball sneek: Will do. wingo: sneek: later tell civodul maybe we can add a third option to GUILE_INSTALL_LOCALE, to install without warnings, and make that option the default sneek: Will do. lloda: wingo: you mean SCM_INTERNAL? I don't see SCM_DEFINE_STATIC anywhere wingo: ah indeed wingo: but not SCM_INTERNAL *: wingo looks wingo: we need this: http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/private.h#n31 wingo: can you add it to gsubr.h ? :) wingo: otherwise you can land and i can fix up lloda: wingo: let me give it a shot lloda: will check back with you *: jonsger found another bug wingo: what kind? :) lloda: wingo: #1 http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commit;h=b8e7a73ea0a123a36f5c0a6d0918ba4b93e09c08 lloda: #2 http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commit;h=cb24c0614d146a88b8ce1ab86ea79bc22ca7f4c9 lloda: lmk wingo: lloda: it was broken for 1-dimensional arrays before? wingo: i agree with the breaking change fwiw, but it needs a NEWS entry lloda: yes, b/c inc was used wrong wingo: lgtm otherwise wingo: great lloda: I'll add the NEWS entry np wingo: thumbs up jonsger: wingo: build failure on 32bit. It's already on bug-guile :P sneek: Welcome back jonsger, you have 1 message. sneek: jonsger, wingo says: i think you might be deleting the ".version" file from the tarball jonsger: ah. Never saw that file. It says still 2.9.1-... :P lloda: wingo: pushed with the NEWS lloda: I've messed the whitespace again :-( I've repushed jonsger: version.test is now green :) wingo: jonsger: it gets generated as part of tarball releases wingo: or from git describe if you have a git checkout wingo: evidently you have a git checkout but no tags maybe ? jonsger: wingo: that one alpha.gnu.org/gnu/guile/guile-2.9.8.tar.xz has 2.9.1 in the .version file wingo: that's exciting! wingo: i wonder how that happened *: civodul found the autoload problem that prevents Guix from building with 2.9.7+ \o/ wingo: yay :) mwette: sweet tsmish: hi #guile. I didn't really study this thoroughly, so sorry if this is documented somewhere, but why does (equal? (vector-ref #('a) 0) 'a) evaluate to #f. brettgilio: tsmish: because there is a difference in the object accessing a vector of position 0 being 'a and the object 'a itself. I think instead of equality you want matching. tsmish: brettgilio: errm, I still don't understand. Don't symbols eq? each other if their string representation match. brettgilio: tsmish: Scheme Procedure: eq?99,99 x y99,99C Function: scm_eq_p99,99 (x, y)99,99 brettgilio: Return #t if x and y are the same object, except for numbers and characters. For example, brettgilio: (define x (vector 1 2 3)) (define y (vector 1 2 3)) (eq? x x) ⇒ #t (eq? x y) ⇒ #f brettgilio: The docs seem to say no brettgilio: In other words, equality checks for object memory spaces, not representations. brettgilio: Which is why I suggest you use pattern matching instead tsmish: brettgilio: these are vectors, not symbols. I compare symbol with symbol. Docs say that eq? can be used while comparing symbols, it's said in Equality section for eq?. tsmish: please note that i compare result of vector-ref (which should give me a symbol) with 'a. tsmish: Also i use equal? which should work for majority of cases, anyway. brettgilio: tsmish: what do the pointers of memq return for each object? tsmish: brettgilio: ok, i actually need assistance on this one. What do you mean by pointers of memq? chrislck: tsmith: the problem is #('a) is not the same as (vector 'a) brettgilio: chrislck: agreed chrislck: tmisth: #('a) == (vector ''a) == (vector (quote 'a)) == (vector (quote (quote a))) chrislck: remember 'a != ''a tsmish: oh, i see. #(a) quotes a. chrislck: # also quotes similar to ' tsmish: (equal? (vector-ref #('a) 0) ''a) actually evaluates to #t. thanks. chrislck: or, (equal? (vector-ref #(a) 0) 'a) ==> #t wingo: happy new year's, ppl :) daviid: hey hey, happy new year all indeed! chrislck: (set! year 2020) (yay) daviid: anyone has a haunt powered website somewhere that includes the fsf header and footer? wingo: yay, fixed that compile error that people were seeing wingo: happily it was neither a jit nor an optimizer bug :P wingo: so wingo: 2.9.8 tomorrow i guess?? wingo: or today, why not wingo: https://www.gnu.org/software/guile/news/gnu-guile-298-beta-released.html Wojciech_K: \o/ wingo: mwette: just made a new release that should fix the ubuntu 18.04 issue mwette: wingo: compiling now ... mwette: wingo: make and make check succeeds w/ 2.9.8 on Ubunu 18.04 / x86_64 mwette: there were a number of warnings of the form "using load, use #:delcarative? #f" jcowan: It seems to be a common error to think that #(...) is shorthand for a vector constructor, like [...] in Python, rather than a literal. jcowan: wingo: testing new release on Cygwin and Ubuntu 16.04, both of which were failing civodul: oh, new Guile release! civodul: yay! davexunit: 8) nerdypepper: nice! wingo: moo wingo: lloda: can you think of any blockers for 3.0 ? wingo: i.e. things that can't be fixed during 3.0 and that can't wait for 3.2 wingo: or anyone else, obvs wingo: civodul: we should come to some resolution on the locale thing. you are arguing for setlocale, but no warning? jonsger: tries to fix Guile 2.9.8 on Tumbleweed :) wingo: jonsger: is it broken? :) jonsger: wingo: no only the tests :P wingo: ah :) wingo: is it the net-db test? wingo: actually i guess i mean to ask: which tests? :) wingo: maybe you can send a mail with the info wingo: obvs it would be best for guile's tests to pass on suse jonsger: version.test (could be caused by something in the RPM packaging) and test-out-of-memory (don't if this worked ever reliable) wingo: yeah test-out-of-memory is squirrely, i can understand downstreams disabling it, though i would like to fix the issues it might have jonsger: wingo: does increasing the required memory make it more stable? wingo: no idea wingo: on my systems it does not fail jcowan: built Guile 2.9.8 successfully on Ubuntu Xenial jcowan: On Cygwin, it blew up on the flag -Oresolve-primitives, so I removed that from the Makefile and now building again. wingo: jcowan: bug reports to bug-guile or guile-devel plz jonsger: scheme@(guile-user)> (version) jonsger: $1 = "UNKNOWN" jonsger: so I know what is failing, but not yet why :P civodul: hi wingo! civodul: wingo: yes, i was suggesting setlocale with no warnings civodul: BTW, i have other issues since 2.9.7 on Guix (doesn't build, presumably related to the changes to the module system for #:replace & co.) civodul: i have yet to debug that daviid: it is my current high priority, a matter of hours, days at most zig: happy new year #guile! civodul: yay! :-) str1ngs: daviid: ahh (gi-cache-show 'flag) is nice thank you. I've been trying to move more to introspection discovery this helps mwette: . ZombieChicken: mwette: hi ZombieChicken: How is guile's memory usage? I have something I'm wanting to write, but Racket is taking up a bit too much memory for my liking; just the libs I'm wanting to use are taking up ~50MB, which imo is insane for what amounts to little more than what will be a minimal IRC client spk121: happy new year. If anyone who know nyacc wants to help me get started, I send a question to guile-user mwette: spk121: did you look at the javascript example? Looking at your email. I will try mwette: spk121: https://paste.debian.net/1123907/ mwette: sorry javascript is not ecma-48; mwette: and have you looked at the PEG parser in guile? spk121: mwette: there's a PEG parser? haha. I'd never noticed that. I don't do a lot of formal parsing? Thanks mwette: also (main ($empty) (lf) (osc) ...) should bd (main ($empty) (main lf) (main osc) ...) str1ngs: hello daviid when you have time can you look at this example when you have time.http://paste.debian.net/1123263 mainly the 'key-press-event issue str1ngs: daviid: and also the application property for does not seem right. I can put smaller example together if you like. str1ngs: daviid: my paste was truncated please use http://paste.debian.net/1123264 instead daviid: str1ngs: will look at it asap sneek: Welcome back daviid, you have 1 message. sneek: daviid, str1ngs says: no problem. will test this out. str1ngs: daviid: thank you. the important issue is 'key-press-event but I am concerned about the #:application property form a GC and memory safety standpoint. roelj: Is there some kind of static-analysis tool for Guile to spot unnecessary “use-module” declarations? daviid: str1ngs: so, (a) key-press-event signals receive (among other things) and event argument, which are GdkEvent instances, and GdkEvent is a union type, described in GI using GIUnionInfo, which are mising and I am working on this with 'high priority', as I did mention to you when pasting the 'hello world' example a few days ago daviid: (b) the #:application init-keyword is indeed mandatory at make time, since it is mandatory argument of the gtk_application_window_new ... you can(should) use (!g-inst app) - accessors are compiled - instead of (slot-ref ...) - slot-ref is interpreted mwette: roelj: I don't know, but that sounds useful; like a guile-lint; maybe one could compile to tree-il and check that code str1ngs: daviid ah I did not realize that the GdkEvent issue might be somehow related to events being remove. as long as you are aware. thanks str1ngs: err event removable caveat you mentioned I meant str1ngs: daviid: just to clarify the issue with the property is not so much it requirement as I'm concerned that using the g-inst pointer. using a goops class just seems safer, but if you deem it safe I'm okay with that. I would use gtk-application-new but this is being used in an inherited class so it's easier to a property. unless of course I could use g-object-new or g-golf providing gtk_application_init hierarchy. I'm thinking the property str1ngs: is the best method? str1ngs: use a property* daviid: both will return a goops instance, but i'd rather always use the goops interface rather then the 'contructor' provided by the gnome lib you're using - all will return goops instances ... daviid: there is no problem refering to the g-inst slot of a goops instance classs, and in this particular case, you have to anyway, this is not g-golf, this is the gtk-application protocl str1ngs: I agree, apologies I'm still translating from C scheme. good to hear about reference g-inst as needed. daviid: np" daviid: np! daviid: you should never ever have to use g-object-new str1ngs: one other thing and I apologize for this because you mentioned it already. can you point in the manual how to use an enumerator again. the only example can't think of a simple example right now sorry str1ngs: example as in a simple use case function daviid: what is the enum lib name? alextee[m]: oh wow theres glib/gtk in guile str1ngs: daviid: say GApplicationFlags found in Gio IIRC daviid: alextee[m]: guile-nome is almost 20y old :):) alextee[m]: wow daviid: str1ngs: when in doubt, you can always 'cache show' was has been imported and define daviid: (gi-cache-show 'flag) RhodiumToad: alextee[m]: guile-gnome works as long as you avoid idle and timeout events (those tend to crash it) daviid: str1ngs: then you may -ref those like this: (gi-cache-ref 'flag 'g-application-flags) str1ngs: daviid: also for C classes I generally use private struct members for widget building and reference. where I would init those then in the GOjbects init function. with g-golf I have replicated this by using initialize in conjunction with (next-method) then I initialize set and initialize the slots there. I think this is pretty safe from a goops perspective. does the method seem okay to you? str1ngs: daviid: thanks for the enumerator snippet I will write this down this time. str1ngs: also noted I need move this to using the setter not slot-set, thanks for that tidbit daviid: alextee[m]: i have no idea why you didn't know about guile-gnome, guile-clutter, but anyway, there are two 'modern' gnome bindings projects, under active development, guile-gi and g-golf *: alextee[m] has never used guile before besides writing guix package definitions str1ngs: alextee[m]: welcome then :) alextee[m]: :D daviid: alextee[m]: it's ok, i did ask becaue of the way you wrote about this, as if you did search and did not find ... daviid: str1ngs: i don't understand the question about 'C classes ...' alextee[m]: daviid: im just surprised at how many languages gnome/gtk has been ported into daviid: alextee[m]: fwiw, gnome is not 'ported' into a language, but rather, languages do bind the GObject Introspection api, then can instantenaously provide access to any GI typelib ... str1ngs: daviid: I did not have explained will let me rephrase. for inherited g-golf goops classes is it safe to set slots with new gopps classes within initialize? alextee[m]: yeah i remember seeing something like that in the guides. that's pretty cool daviid: str1ngs: it's ok, kust make sure not to 'hide' users provided init-keyword value for those slts then ... daviid: *just make sure ... str1ngs: daviid okay that makes sense. also are you open to contributed examples? if so would you prefer in texinfo? or maybe something like ./contrib/examples? str1ngs: ./contrib/examples would be easier for me texinfo is kinda a learning curve I've been avoiding daviid: str1ngs: in the near future 'maybe', but not now - what i am interested in, now, is to have you as a user str1ngs: understandable, I have some examples here that I've been refining mayb later when you are not busy with more important things we can revisit. str1ngs: daviid: I think g-golf signals was my best holiday present. thanks again. daviid: :) you're welcome daviid: tx for the nice words ... i should have those event (gdk-event) working soon as well str1ngs: no problem. the gdk-even I can work around meantime so it's not a huge rush. I can create typelib function to setup up that once signal. it's not ideal but it's not a huge blocker either. str1ngs: err gdk-event* str1ngs: s/once/one mwette: janneke: lalr.scm does use syntax-case, which is critical to parsing the grammars: I use a fender to distinguish terminals from non-temrinals mwette: janneke: however, if you got cppmach to work that should not be the issue ng0: mwette: does tat mean janneke's variant of your(?) upstream is no longer necessary? (sorry if you are not the maintainer of the original one, sometimes it's good to not remember all the things I've looked at) mwette: ng0: janneke is working to that end; I think he is there or at least close ng0: ah, good :) I'd rather merge the one source than both of them as packages daviid: mwette: totally out of curiosity, why is the releae 1.00.1 and not 1.0.1? daviid: lispmacs: how simple is that gui you would like to have? just a few lables, a few buttons ... ? or is there other more complex widget involved? mwette: daviid: I like to keep two minor digits, makes it clearer when you get a list of all the releases (e.g., 1.10 is next to 1.09 and not next to 1.1) daviid: mwette: ok daviid: RhodiumToad: i never faced that frustration you are talking about, I've used and still usse guile-gnome for almost 2 decades now, and it is just next to perfect - i use glade 3.8.5 to design and maintai the interface, then load the xml file, use get widget to the widget instances 'in hand', add signals (callbacks) and that's it, real real piece of cake :) RhodiumToad: until it crashes :-) daviid: and that is the right path, imo, use glade, don't even think programming the iterface 'design', that is a nightmare, but using glade, get-widget and callback is so easy and so productive ... daviid: RhodiumToad: what crashes, i've had 3 pro apps, used in industry, never, ever had a crash RhodiumToad: once I started making significant use of idle and timeout handlers, it started crashing all over the place daviid: RhodiumToad: without using timeouts, but a normal app doesn't need that RhodiumToad: uh RhodiumToad: we may have different concepts of "normal" daviid: RhodiumToad: i'm talking about gimp, gnucash ... that sort of app, buttons, labels, ... but ok, granted timeout do not owrk in guile-gnome, they do perfectly work in g-golf though :) RhodiumToad: I don't think I'm actually using timeout handlers, only idle ones daviid: RhodiumToad: idles and timeouts are not working, in guile-gnome RhodiumToad: yes, that's what I discovered :-) daviid: RhodiumToad: what is the app you are working on? daviid: the knd of app RhodiumToad: as a learning exercise, I ported a little sudoku thing I wrote ages ago in tcl to it daviid: the only app that uses idle/timeout that i'm aware of is guile-async and guile-async2, and that is about coroutines, not gui - the author already has switched to use g-golf ... RhodiumToad: (I'm not working on any app in guile right at this moment) daviid: RhodiumToad: ok, for that i'd use clutter, which you can use right now with g-golf, if you are interested ... daviid: RhodiumToad: i'd use clutter, like in not gtk ... daviid: RhodiumToad: or guile-clutter, but unfortunately, no guixers ever made a guix package and guile-clutter is very difficult to install ... daviid: RhodiumToad: here are some examples using guile-clutter https://www.nongnu.org/grip/learn.html daviid: out of those, the only one that needs timeout is the clock - i bet it's possible to develop a sudoku game using gule-clutter without timeout RhodiumToad: the timeouts are to show steps in analysis daviid: ah ok RhodiumToad: as for the frustration with using things that aren't tk, that's at least partly the fact that I don't _want_ to use some UI designer, and in tk I have no need for one daviid: RhodiumToad: you can program directly in gtk/clutter, though i perso would never recommend this hugo: What makes the (system vm coverage) module work? I'm trying to run it along with sandboxed environments (inside or outside doesn't really matter). But I always get 0% coverage RhodiumToad: daviid: I know you can, I have done gtk ports of some of my old tcl apps in Lua (using a gobject-introspection binding lib for lua) daviid: RhodiumToad: ok, fwiw, even a tiny app, few labels few buttons, i'd use glade RhodiumToad: other examples of why tk is easier: it has a better model of event handling, since events are bound to tags, not to objects mwette: btw, I ran the nyacc ffi-helper on tk.h and it came up with a number of function typedefs that it could not handle; maybe to be fixed at some point but does not look promising now daviid: RhodiumToad: i guess this is all relative, because afaic, nothing is easier then glade, then get-widget and callbacks in scheme ... RhodiumToad: have you ever written anything in tcl+tk? daviid: RhodiumToad: a tiny attempt, a long long time ago, but i was terribly desapointed iirc daviid: anyway, let's hack, gui, design ... is like religion, not to talk about :) str1ngs: daviid: hello, I having working with g-golf and signal so far no blaring issues. great work. couple of notes seems class inheritance is looking quite nicely. ie (define-class ()) this pattern could avoid the need to ever register classes dynamically, nice work there. one small issue and I'm going to assume that this is due to signals being early days. the argument passed to the signal closures tend to str1ngs: be pointers. eg. (connect button 'clicked (lambda (x) (dmifi x))) . I hope it would be possible to have goop classes for those at one point? daviid: str1ngs: good point, let me fix this str1ngs: daviid: I hope this is not to much of a technical challenge. It's not a rush I have structured my code to work around it. daviid: str1ngs: but it's somehow a bug, have to fix it, thanks for the catch str1ngs: daviid a good to pass this on then. now I just need to fix my other guix related issue :) str1ngs: mean time I have fix or I can use debian str1ngs: daviid: I think g-golf will rival glade eventually str1ngs: maybe glade is faster for a quick prototype though daviid: str1ngs: there are two totally different things spk121: mwette: pity about tk. The only other C API GUI toolkit I know is IUP, but, I haven't used it lately. str1ngs: daviid: no complete different. defining classes in xml vs guile str1ngs: what about WX spk121: str1ngs: wx is C++ str1ngs: oh and you still write win32 programs in C :P daviid: no one on earth wants to design the app by 'programming'm this is total heresy, imo *: RhodiumToad refutes that argument by existing as a counterexample str1ngs: maybe no good UX elements ever came from a programmer :) which might explain why we have glade, qml etc str1ngs: qml is quite nice though :) spk121: For money, I've done a fair bit of Qt C++, which is nice. Also C# UWP and C++ UWP which are acceptable. In free software, I've stuck with Gtk w/ various language bindings, but, Qt suits me better. str1ngs: hugo: one sec, I did some coverage on a project recently. let me re visit it RhodiumToad: what I _want_, ideally, is something that's easy to use in the same way that Tk is, but which doesn't require bringing in Tcl along with it str1ngs: hugo: http://paste.debian.net/1123116 maybe this will help str1ngs: hugo: the run code here denotes the code that should be covered str1ngs: hugo: I snarfed this from http://git.savannah.nongnu.org/cgit/gash.git/tree/tools/coverage.in . and adapted for guile-lib unit-tests daviid: str1ngs: i fixed that bug, please pull and try, tx for the catch str1ngs: sneek later tell daviid no problem. will test this out. sneek: Got it. lispmacs: /quit mwette: tk is an interesting idea ... RhodiumToad: every time I use some other gui I get frustrated by how hard it is to do things that are trivial in tk RhodiumToad: but the downside of tk is that you have to use tcl# spk121: Tk is the most popular Python GUI toolkit, via the Tkinter library. spk121: In the world of programs that don't need to exist, I'm almost done writing the 'ed' line editor in Guile mwette: spk121: awesome, I actually use ed a lot in scripts: a fine scalpel compared to sed and awk jcowan: spk121: Awesome! As a heavy user of "ex", I love it. jcowan: (I know "ed" is the standard editor, but I am willing to trade a little standardosity for a little convenience) d4ryus: hi, when i have some kind of container (hash-map/alist/...) which contains a symbol, how can i loopup the value of that symbol? (eg (begin (define x 3) (hash-set! some-table "/" 'x)) how to retrieve the value of x given only some-table and the key "/")? eval would work, but i guess there some other way? zig: scheme@(guile-user)> (define x 42) zig: scheme@(guile-user)> (eval 'x (interaction-environment)) zig: $1 = 42 zig: d4ryus: ^ spk121: d4ryus: it may be that what you really want is a box. Check 'make-variable', 'variable-ref', 'variable-set!' pkill9: is it possible to get the resulting code of a function as data? For example, if I made a function `(define (something a) (display a))`, would it be possible to get a result of '(display "test") from doing something with (something "test")? pkill9: i know i could define the function as data and then evaluate it, but i'm wondering if it's possible to do it the other way round, define it as a normal function and get the code as data d4ryus: zig, spk121: thank you, box will do what i want :) zig: pkill9: there is `procedure-source` but it does not always work. A workaround could be to parse the file where the given procedure is defined. pkill9: i'm gonna have the function provide an "evaluate?" keyword and just evaluat eit by default pkill9: hmm eval is a bit meh, since it's not quite the same as a regular function pkill9: e.g. running it in the repl, it doesn't see the modules that were imported from the module it's from mwette: pkill9: not sure about your use case, but maybe you could define a macro to define your function and add a property that provides the body in some other way janneke: mwette: rel-1.00 fixes #if FOO problem; running a full mes build to check the rest mwette: janneke: good to hear -- sorry about the error, was hoping 1.00.0 would be solid mwette: I even had a failed test, but that didn't stop the make, so I need to check that out. janneke: mwette: yeah, i was sorry too; you took such good care doing all the 0.9x stuff and all janneke: i guess thats how things go :) janneke: mwette: another thing, nyacc comes with pre-generated files for the c99, right? mwette: yup. Also, ran into problems compiling on (my) ubuntu because it has guile-2.2 in /usr/bin but no guild-2.2 (only guild). And someone else was trying to build for 3.0 using 2.9.7 but that was running into configure issues also; I think it's all working now; we are testing mwette: janneke: yes, the tables are generated for each release, I run "make dist-files" prior to release janneke: mwette: i haven't looked into that, we might have a bootstrap problem there? *: janneke hopes this is a red herring mwette: janneke: depends on how you define bootstrap; the needed files are part of the distribution, and they are Scheme source code, nothing machine dependent janneke: well, generally we d not consider generated files to be source code janneke: *we do mwette: the files are also included in the repository janneke: true...but generated source can be just as opaque as a binary mwette: look at the "dist-files" entry in nyacc-0.00.0/modules/Makefile.in janneke: is nyacc needed to create those files, or just guile? janneke: i should have a look if they can be produces with mes janneke: it's not urgent, but we do want to have a clean bootstrap path, some day mwette: you'll need to run gen-cpp-files and gen-c99-files janneke: ok mwette: not gen-c99cx-files, I assume janneke: mwette: meanwhile, mes builds with rel-1.00 mwette: janneke: good -- thanks for checking janneke: yw mwette: different versions of guile could presumably generate different c99 table files janneke: mwette: well, this is going to be interesting; running cppmach.scm depends on psyntax, which is in itself a bootstrap cycle that we haven't cut yet janneke: i sort of managed to generate cpp-act.scm.new; but cpp-tab.scm.new needs letrec*, which mes does not support yet *: janneke just recently learned that letrec* ought to be in mes C core; we'll see :-) janneke: i'll first have a stab at letrec* using define-macro -- odd that it's not in psyntax.ss; prolly too old? mwette: do you have letrec? mwette: I may be able to replace with let*; it appears in nyacc/lang/util.scm mwette: totally looks like the one use of letrec* could be replaced with let* janneke: mwette: oh, that's great; yes, i have letrec and let* jcowan: letrec* dates only to R6RS or a little before janneke: jcowan: ah, i am using a pre-r5rs syntax case, with some extensions janneke: mwette: it seems that one letrec* can be changed to let*, the other to letrec matijja: Hello #guile! matijja: Why when I run command "guild update" it throws me error "Unbound variable: =>"? zig: what are you trying to achieve? mwette: janneke: found them (nyacc/util.scm and nyacc/lang/util.scm); I have changed them for future 1.00.1 janneke: mwette: thanks! janneke: i just got mes to run gen-cpp-mach! mwette: sweet ; that should exercise a lot janneke: hmm, yes -- however gen-mach bombs out inside my psyntax ; oh well, later! *: mwette has released nyacc 1.00.1 slyfox: should disassemble-file always be able to disassemble guile's own .go files? Looks like it fails sometimes: http://dpaste.com/3K1N5ZZ.txt spk121: . ahungry: . mwette: . rycee: Hey, quick question. Anybody know if there is any dbus library I could use? Couldn't find anything on https://www.gnu.org/software/guile/libraries/ spk121: mwette: congrats on the 1.0.0! mwette: spk121: thanks -- found some config issues, but I am feeling likes it's reasonably robust now mwette: rycee: nyacc has dbus in examples mwette: wget https://download.savannah.gnu.org/releases/nyacc/nyacc-1.00.tar.gz mwette: cd nyacc-1.00.0/examples; . env.sh rycee: mwette: I'll have a look. Thanks! mwette: guild compile-ffi ffi/dbus.ffi mwette: cd nyacc/lang/ffi-help mwette: guile dbus-01.scm mwette: there are also gdbus examples using glib mwette: oops: tarball is nyacc-1.00.0.tar.gz daviid: heya guiler sneek: daviid, you have 2 messages. sneek: daviid, str1ngs says: thanks I had thought of modifying autotools next to account for the re basing. I'll see if this will work for g-golf as well. particularly the use of $GUILE_EFFECTIVE_VERSION is nice. sneek: daviid, str1ngs says: it took a while for me to grok why using GUILE_GGOLF_UNINSTALLED was better. I've switched the substitution to work like guile-cv. thanks for pointing this out. I'm not confident substituting configure is better then just re basing the modules by simply moving them. but I've switched to using that as well. daviid: str1ngs: wrt the g-golf guix package definitin, I recommend to copy(adapting wrt dependencies of course) 'exactly' what has been done for guile-cv daviid: str1ngs, spk121, I just pushed a seris of patches, so g-golf now has working signals - w surely will find 'corner cases' still, bt at least this basic example works fine http://paste.debian.net/1122976/ - so, please pull, run the make dance and test :) daviid: rycee: you may also consider using guile-gi or g-golf and the GIO dbus high (and/or) low level api ... str1ngs: daviid: great news, will try this out ASAP daviid: str1ngs: one thing that won't work for the moment is the delete-event signal, because its seconf argument is a gdk-event, which is a union type, and although g-golf has some low level support for C union types, it still misses bindings to the GIUnionInfo type and method. I'll bid those with priority and wil let you know .. str1ngs: daviid: sounds good. I almost all of my signals are created during classing initialization so I should not run into that issue right now. though I can see how it's still needed. str1ngs: class* pkill9: hello guilers str1ngs: hello pkill9 rycee: daviid: Thanks, guile-gi seems intriguing. Do you know of any example code using it? I'm pretty new with Guile. Just know a bit of elisp :-) rycee: g-gold as well. I will dig into these. Many thanks lispmacs: hi, I was just wondering if there were any other GUI toolkits for Guile, other than Chickadee, which I think is really a lower level than a tool kit lispmacs: *a little lower level lispmacs: i suppose I could just make a gtk app and embed guile in it spk121: lispmacs: you could make a binding to gtk using gobject introspection. there are a couple of projects that can do that spk121: and there's an ncurses binding (lol) lispmacs: spk121: hmm, I wonder how much work that is going to be spk121: lispmacs: still a bit of work, sadly, but, here's one I did https://github.com/spk121/guile-gi/blob/master/examples/browser.scm spk121: since there's a lot of work being invested into the gtk3/4 problem right now with a couple of different strategies, I think by Spring, the Guile GTK3 problem will be solved lispmacs: hmm, do you think in the mean time I should try to connect up to some simpler toolkit? I understook TK used to be pretty simple, but not sure if it is now or not lispmacs: just trying to add a GUI without making the GUI my main project spk121: seems like the GUI functionality that is most complete and ready to go is Guile's internal webserver, so there's that. Looks like the GTK solution is only a couple of months away. There's a couple of SDL libraries out there. Depends on what you want. RhodiumToad: guile-gnome sort of works, if you don't need to make much use of idle or timeout events RhodiumToad: tk is simple but it's tied to tcl. lispmacs: i don't think i need anything super fancy, but didn't want to have to code my own buttons and toolboxes spk121: back in the guile v1.4 days there was a tk binding. it has long since bitrotten spk121: And last year, I did a combo GTK3 app in C with Guile as an extension language for the Lisp Game Jam. https://github.com/spk121/burro I had a lot of fun with it, but, it was not so easy to merge GTK's main loop and events with Guile. It was that experience that led me to do guile-gi which is a gobject introspection layer for guile mwette: nyacc has demos for gtk2; though it's a bit like writing C; code posted at https://paste.debian.net/1122991/ spk121: That's true. there's always nyacc. If you could find a toolkit where the C headers are a clean API, nyacc would make binding that pretty easy. spk121: My first UNIX GUI was Motif or Lesstif, as I recall. I wonder if that still exists? str1ngs: hello daviid I fixed the libg-golf issue on guix by substituting after install phase. see https://github.com/mrosset/giqt/blob/master/guix/giqt/packages/g-golf.scm#L80 daviid: str1ngs: hello, nice, but it seems you are doing things in a different way then what has been done for guile-cv, and I think it would be better to do 'exactly' (except for the number and name of the dependencies of course) what is done for guile-cv, in general and in particular for its init.scm for g-golf in general and in particular for its init.scm file daviid: str1ngs: the guile-cv guix package def has been added by a guix maintainer, I am pretty sure not only does he know exactly what needs to be done, but most probably does he also know the best way to acheive the results ... and notably when the package is or not yet installed, running the tests needs uninstalled libg-golg ... str1ngs: sneek: later tell daviid. thanks I had thought of modifying autotools next to account for the re basing. I'll see if this will work for g-golf as well. particularly the use of $GUILE_EFFECTIVE_VERSION is nice. sneek: Okay. rgherdt: hi all! Any suggestion, when one should prefer writing C extensions over using Dynamic FFI or vice-versa? Specially when one has to deal with complex C structs malloced by an external library, I suspect C extensions are quite more flexible regarding memory management and such, am I right? rgherdt: and are there any performance differences between both approaches? str1ngs: rgherdt: C extensions are nice if you want to call scheme from C as well. str1ngs: sneek: later tell daviid. it took a while for me to grok why using GUILE_GGOLF_UNINSTALLED was better. I've switched the substitution to work like guile-cv. thanks for pointing this out. I'm not confident substituting configure is better then just re basing the modules by simply moving them. but I've switched to using that as well. sneek: Okay. rgherdt: thanks str1ngs, that's a trivial advantage I overlooked str1ngs: rgherdt: also in IMHO C extensions can be somewhat safer. since you get compile time type checking. and you can structure your code to only pass and return SCM types. FFI is still handy though in that it does not require C completion or the library to exist at all. which means you can enable disable the feature at runtime. str1ngs: s/completion/compilation rgherdt: good point, thx str1ngs: daviid: I need to investigate more as to why propagation fix its and what effect this shlibs patch has. I think the reason the non patched version works is due to LD_LIBRARY_PATH searching. str1ngs: daviid which brings me to another issues. can you check that (define %libgirepository (dynamic-link "libgirepository-1.0")) is not evaluated at compile time. I think it is. which makes substituting it hard on guix. the other dynamic-link's substitute okay. I can get around this buy using LD_LIBRARY_PATH but that will cause issues on foreign distros. str1ngs: daviid: I have some other guix related issues. but I need to add them to tests daviid: guix needs the full path, but you should talk about all this on #guix str1ngs: I can't for this library because it's evaluated during compile time for some reason daviid: as far as i am concern, when make distcheck works fine on debian, upstream is good, anything that wouldn't work is a distro problem daviid: only a advanced guix user or maintaner will be able t tell you str1ngs: this is a guile issues daviid: i don't know, except that guix isn't libtool aware, therefore it needs the full path ... daviid: o its not str1ngs: (define %libgirepository (dynamic-link "libgirepository-1.0")) needs to not evaluate at compile time to substitute properly. str1ngs: maybe I can get around it with guix meantime. also I can use LD_LIBRARY_PATH. but LD_LIBRARY_PATH breaks on foreign distro's as I mentioned daviid: str1ngs: please talk to guix, i am telling you, you need to substitute the init.scm file for guix, and you must pas the full pathname ... there are tons of example daviid: on other guix packahes daviid: pick any other package on guix that does a dynamic-link ... any daviid: (dynamic-link "libgirepository-1.0") can not work on guix, it just cant daviid: by design daviid: please study this with guixers str1ngs: I have done that. I will investigate further str1ngs: https://github.com/mrosset/giqt/blob/master/guix/giqt/packages/g-golf.scm#L64 see str1ngs: actually it's (define %libg-golf (dynamic-link "libg-golf")) that can not be substituted. because the full path does exist at compile time. either way I resolve this on my own. but it would be easier if this did not evaluate at compile time I guess daviid: str1ngs: what do other guix 'guile packages' that need to call dynamic-link upon a lib they build do? daviid: str1ngs: guile-cv does this to, look at how it's done, in gnu/guile-xyz.scm, line 2594 ... and snarf this and maybe other 'tips and tricks' ... daviid: that's funny, guile-cv comes right after your nomad package def in the gnu/guile-xyz.scm file :) - in the version i have here, it probably has changed since i last pull ... str1ngs_: daviid: once I get this g-golf nicely done. I'll submit g-golf.scm pkill9: what does it mean to put an '@' before an expression? I want to understand this guix package which inherits a package and adds an input https://www.irccloud.com/pastebin/mlsBkBUc/lmms-jack.scm zig: pkill9: that ,@expr is unquote-splicing, it will embeded EXPR inside the quoted datum it is part of zig: https://www.gnu.org/software/guile/manual/html_node/Expression-Syntax.html#index-unquote_002dsplicing zig: it works somewhat like unquote, but it will "splice" the EXPR list inside the outer list. pkill9: ah, thanks, i get it slyfox: looks like guile-2.2.6 crashes on 32-bit big-endian platforms: https://bugs.gentoo.org/676468#c19 slyfox: how do prebuilt/32-bit-big-endian get generated for release tarballs? slyfox: i wonder if i can generate it natively and check what is different from shipped in tarball slyfox: looking at dwarf data prebuilt bytecode was built by guile-2.2.3 to 2.2.6. are they compatible? daviid: str1ngs: g-golf depends on libgirepository-1.0, libglib-2.0, libgobject-2.0 and libg-golf, no g-ir-scanner and friends ... sneek: daviid, you have 2 messages. sneek: daviid, str1ngs says: will do. thanks again sneek: daviid, str1ngs says: guix python GI and GJS binding are working fine same with C. for reference my trivial tests are here https://github.com/mrosset/test-gir. when I down grade gobject-introspection to 1.58.3 test.scm works but not with guix's 1.60.2. daviid: str1ngs: it doesn't make sence, if all uses the same libs, that it would work in a lang bind and not in another, could add a call for g-irepository-get-typelib-path, g-irepository-get-shared-libraryyou, g-irepository-get-version and i would also try g-irepository-find-by-gtype on the registered type, in your tests daviid: *g-irepository-get-shared-library daviid: for all (each) namespace "Clutter", "GObject" and "GLib" daviid: str1ngs: here is the scheme version of your script http://paste.debian.net/1122619/ daviid: str1ngs: this made me find a typo in (g-golf gi utils) - which has nothing to do with this guix problem ... - please pull/make ... chrislck: merry xmas guilers! str1ngs: daviid: I did a pull. I agree it does not makes sense. Thanks for the snippet I'll add these to my tests over the next couple of days, maybe it will be more apparent what issue this shlibs patch introduces. Happy Holidays zig: hello #guile rgherdt: hi zig: what would it take to speed up foreign function interface? manumanumanu: Ho ho ho! What a christmas! I managed to send a patch with my transducers in, AND I managed to get my for loops to support foldr in a generic way. zig: \o/ manumanumanu: And now it's efficient! Next up, support a general lazy way of making it lazy! manumanumanu: what a dy to be alive! manumanumanu: this means for/stream can be efficiently expressed as (for/foldr ...) and be properly lazy. manumanumanu: What does goops call streams? I am trying to dispatch on but that doesn't work. manumanumanu: (define-method (blah (s )) ...) manumanumanu: unknown variable manumanumanu: And I do believe it worked in guile2.2... manumanumanu: nope, it did not... daviid: manumanumanu: these are records, not classes manumanumanu: is there a class defined for streams? daviid: someone ask a similar question, but about future ... the esiest way is you wrap the record in a class manumanumanu: I just thought it worked because class-of reported it as manumanumanu: in the same way it does (class-of 1), but as manumanumanu: whereas future is <> jcowan: I've made really good progress the other day on bitvectors jcowan: last few days, rather daviid: manumanumanu: visit the (oop goops), you'll see what classes are defined when goops is loaded manumanumanu: daviid: that's a shame :D Then I know where to look, though. manumanumanu: daviid: One _could_ monkey patch it... manumanumanu: jcowan: I like that you are catering to both #t/#f and 1/0 people :D jcowan: Right. At first I had just the first, but the second is cheap enough jcowan: It expands the API surface, of course, but only in a trivial way, and it accords with my principle for R7RS-large: "Reach for the Right Thing in data structure, not the one with the biggest library." str1ngs: daviid: I have resolved the (g-type-name type) issue. I needed to refine the propagated inputs for the g-golf package definition. str1ngs: daviid: it's not complete fix yet. but I think I can resolve it going forward. daviid: str1ngs: i don't understand what 'needed to refine the propagated inputs for the g-golf package definition' means, but glad you are on a route to solve the guix problem daviid: i still is a very very very big surprise to me that you have to do anything 'special' for g-golf on guix daviid: it stll does not make any sence to me daviid: and why for that particular base info, and not others ... is a mistery to daviid: but tx for tracking this, for the future guix g-golf users ... maybe good to also ask advanced guixers to check your diagnostic and solution as well, but as you wish of course str1ngs: sneek: later tell daviid. guix python GI and GJS binding are working fine same with C. for reference my trivial tests are here https://github.com/mrosset/test-gir. when I down grade gobject-introspection to 1.58.3 test.scm works but not with guix's 1.60.2. sneek: Okay. dsmith-work: Hey Hi Howdy, Guilers zig: heya! roelj: So, I have a program that hangs with Guile 2.9.7, but runs fine with Guile 2.2. How do I debug this? mwette: try setting env var GUILE_JIT_THRESHOLD=-1 mwette: if it works then there is a JIT issue mwette: another thing you can try is run under gdb then C-C (Control-C) during the hang: mwette: gdb path/to/guile roelj: Hm, it doesn't seem to be a JIT issue. mwette: gdb> run myscript.scm mwette: gdb> ^C roelj: Are threads in ‘sigsuspend’ idle? roelj: One is in ‘GC_mark_from’, and one in ‘read’. roelj: Can I somehow map which Guile code it is running? mwette: you can go "up" in frames and if you see scm object I think you can print that, though I'm not familiar with the guile-hooks for gdb (libguile-2.X.so.1.4.1-gdb.scm) roelj: Thanks mwette! roelj: I'm trying the "run ..." method, but I get "Unbound variable: run". roelj: Before I'd run the runscript of the program (which uses Guile as shell), and then "attach" with gdb to the running/hanging program. mwette: roelj: that sounds fine; could you stop the program when it hangs? mwette: roelj: are you loading your code into guile or running guile from your own main() ? roelj: mwette: Uhh.. I have a script that starts with #!/gnu/store/.../bin/guile --no-auto-compile, and goes on to run Guile code.. roelj: And I just ./my-script it roelj: I can stop it with ^C, or attach to it while it runs/hangs. mwette: hmm ... not much more I can help. for what it's worth, 2.9.7 will not even build on Ubuntu mwette: gotta go now .. roelj: Okay. Well, thanks a lot for your help! mwette: YW str1ngs: hello daviid. it seems this patch http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch is causing the issue guix. when I don't apply the patch g-golf works fine. but I can't seem to figure out this relates to g-golf at all. I'm pretty confident g-golf does not use g-ir-scanner and friends. any ideas? str1ngs: on second thought maybe a g-golf depend uses g-ir-scanner. and that effects g-golf. but that does not explain how GJS, python ancd C still work str1ngs: daviid: either way I'm pretty confident this is not a g-golf issue at this point. I'll post a bug report with guix. daviid: lloda: (or any bytevector 'pro') any idea why i don't ge twice the same value? https://paste.debian.net/1122187/ RhodiumToad: the index in bytevector-uint-ref looks like it's in bytes, not units of the specified integer size? daviid: RhodiumToad: the index, becaue tha's what i thought it should be, is the index :), just like vector-ref ... daviid: and i thought bytevector-uint-ref were going to compute the exact locaion i mem bsd on the index, e-ness and u-size, precisely jcowan: The entire (rnrs bytevectors) library uses byte indexes daviid: the manual shoud call these acrgument byte-index daviid: not to confuse users with what the index is, like in list-ref, vector-ref ... jcowan: Well, it is a bytevector library. It's not meant to do what SRFI 4 does daviid: and what is a byte index? jcowan: (Although there is an implementation on top of SRFI 4) daviid: jcowan: it shuld not use names that are commonly used in other context as for what they are, then change they siginificat ... daviid: but anyway jcowan: sorry, I meant there is an implementation of SRFI 4 on top of rnrs bytevectors daviid: not talking about that daviid: talkg about bytevector-uint-ref daviid: and frends *: jcowan nods RhodiumToad: if the index were in units of the size, it would be impossible to do unaligned fetches? daviid: *friends jcowan: The elements of a bytevector are bytes jcowan: so you'd expect a bytevector library to index bytes, just as a list/vector library indexes list/vector elements. daviid: i'm sorry, i didn't daviid: an index, ever since i whent to the fac, is a postion, not a size/position daviid: anyway, no worry daviid: but i still don' tknow what my 'i' should be daviid: could you patch y example daviid: pleae, so i can learn wha the hell is a byte index :) daviid: ok i got it daviid: (bytevector-uint-ref bv (* i u-size) e-ness u-size) daviid: i thought, you got that, but for others ... that bytevector-uint-ref was doing this 'for us', using i as an index, then u-size and e-ness ... i wa wrong daviid: RhodiumToad: why did you think it couldn't fetch, if we pass a 'normal index', since it has the data to compute the byte index? RhodiumToad: suppose you have 6 bytes of which the first 2 are a uint2 and the next 4 a uint4 RhodiumToad: how do you propose to access the uint4, if not by a byte index? daviid: this would break bytevector->uint-list, which is the context I was refering to, obviously ... RhodiumToad: it wouldn't work with bytevector->uint-list, correct RhodiumToad: but then who said it should? daviid: right daviid: but anyway, lets hack, i still think 'index' is a wrong name for any bytevector proc daviid: unfortunately, the manual only shows an example of 4 bytes addressed on a per byte, so the index is a 'real index' ... RhodiumToad: the docs could be clearer, yes daviid: i think we could patch the doc with your example nly: hello ahungry: hi nly: hi ahungry nly: is there any good resource for writing portable scheme? chrislck: sneek: tell faLUCE https://github.com/Gnucash/gnucash/blob/maint/libgnucash/scm/utilities.scm#L175 sneek: faLUCE, chrislck says: https://github.com/Gnucash/gnucash/blob/maint/libgnucash/scm/utilities.scm#L175 jcowan: nly: The R5RS, R6RS, and R7RS standards. faLUCE: hello. Which is there right syntax for redefining a function of a module? (module-define! mod 'function-name ... ? rgherdt: from the REPL you can either switch to the module with ,m and define the function, or you can use the ,in syntax rgherdt: ,help module lloda: daviid: you can do stuff like (s32vector-ref BYTEVECTOR i) in Guile and i is according to type (every 4 bytes in this case) lloda: you can also cast a bytevector to srfi-4 type with (bytevector->pointer ...) and (pointer->bytevector ...) lloda: these are in (system foreign) lloda: I think it's ill advised to use bytevector-type-ref at all unless you're really dealing with a blob and picking items out of the soup lloda: if you know something is a typed array, just use the srfi-4 functions :-/ lloda: I remember someone in the mailing list who also insisted in counting bytes in a floating number array and I really didn't understand why lloda: it seems they were copying code from somewhere else and following a recipe lloda: in/on, I'll never get that right daviid: lloda: right, tx. but I wanted to understand my mistake while using bytevector-type-ref ... and because the context of this (for me) is GLib/GObject, where none of these byte vectors ever store different size values, it neve occured to me we could :), and hence, did not even think I had to cimpute the 'exact byte offset' myself ... but obviously, after jcowan and RhodiumToad explaination, I realize how 'brown bag' that was :) daviid: if only the manual had such an example, I would have spoted m istake myself ... maybe I'll submit a manual patch/enhancement daviid: now, I think bytevector->uint-list and friends are substantially faster then srfi-4 (?) but didn't benchmark str1ngs: hello daviid. I'm still trying to resolve this g-golf issue on guix. see http://paste.debian.net/1122356 lloda: ,time (s32vector->list (make-s32vector #e5e6)) lloda: ;; 0.128391s real time, 0.128391s run time. 0.000000s spent in GC. lloda: ,time (bytevector->uint-list (make-s32vector #e5e6) 'little 4) lloda: ;; 0.569555s real time, 0.568521s run time. 0.000000s spent in GC. str1ngs: daviid: #:debut does not give more details other then can't constants that are not imported str1ngs: err #:debug daviid: lloda: ah, interesting! that's a surprise to me lloda: if it was the other way it would be a bug. I repeat myself but I don't see why people use bytevector functions for these things lloda: if the type is always X, use Xvector str1ngs: daviid: backtrace if it helps http://paste.debian.net/1122360 daviid: lloda: right, as I said, I wanted to understand ... but that srfi-4 is faster then (the C code) bytevector->uint-list is a bit of a surprise to me, I'll change that i my code then, thanks lloda: yw! still if it was slower, we should fix it instead of being forced to write needlessly low level code lloda: imo! daviid: lloda: yes, agreed, but I'm glad I plaid a bit with all this ... I learned a few things while at it ... but i'll use srfi-4 daviid: str1ngs: hello! daviid: str1ngs: can you locally modify a g-golf module on guix? str1ngs: daviid: yes not a problem. I'm using ./pre-inst-env daviid: ok, could you replace temp this def http://paste.debian.net/1122368/ daviid: and try again daviid: str1ngs: in the (g-golf hl-api object) module str1ngs: i can, will need a few minutes daviid: str1ngs: actually this version instead, sorry: http://paste.debian.net/1122371/ daviid: np, tke your time dsmith-work: Monday Greetings, Guilers daviid: hello dsmith-work! could you tll our bot to remember about this http://sph.mn/foreign/guile-software.html dsmith-work: sneek: guile-software is http://sph.mn/foreign/guile-software.html sneek: So noted. dsmith-work: sneek: guile-software? sneek: Its been said that guile-software is http://sph.mn/foreign/guile-software.html dsmith-work: sneek: botsnack sneek: :) daviid: cool dsmith-work: daviid: Unfortunately, there is currently no way to list remembered topics. daviid: dsmith-work: ok, it would be nice to have, but ... str1ngs: daviid: with (gi-import "Clutter") I get http://paste.debian.net/1122394. I truncated successful debug lines str1ngs: daviid: same error as well. ERROR: In procedure string-split: str1ngs: In procedure string-split: Wrong type argument in position 1 (expecting string): #f daviid: str1ngs: so, it should be http://paste.debian.net/1122396/ str1ngs: daviid: ha I found the difference seems this does not happen with gobject-introspection 1.58.3. debian uses 1.53.3 guix is 1.60.2 daviid: str1ngs: on debian buster, which i use, it is 1.62.0-2 str1ngs: hmm don't get that on my debian buster 10 str1ngs: apt show libgirepository-1.0-1 str1ngs: Package: libgirepository-1.0-1 str1ngs: Version: 1.58.3-2 str1ngs: sorry for multiline paste, I was being lazy :( str1ngs: lsb_release -a is Description: Debian GNU/Linux 10 (buster) str1ngs: but this helps either way. if 1.60.2 works for you could be an issue with 1.62.0 . but also there is a patch in guix that does not apply to 1.58 so potentially that could be suspect. daviid: str1ngs: you're definitely not sing buster, becaue on buster, gi is 1.62.0-2 str1ngs: deb http://deb.debian.org/debian/ buster main str1ngs: not sure how this could not be buster daviid: str1ngs: i am on buster daviid: and the version is 1.62.0-2 daviid: but anyway, the problem is on guix you said str1ngs: okay so the main thing is 1.62 works for you to. I just need to figure out what the issue is with guix 1.60.2 daviid: str1ngs: what is the clutter gir lib versio o guix daviid: i don't beleive it is a GI problem daviid: I beleive it is a gir problem daviid: on guix str1ngs: clutter is 1.26.2 note. guix does not split package the typelib. and I'm maybe a week behind master daviid: the function that returns #f is g-type-name, which is part of GObject Type-info, it probably works fine in any version ever, even the 0.1 decades ago daviid: i think, for some reason, the clutter gi repository is malformed daviid: on guix str1ngs: I can put a GJS test case together. daviid: on guix? str1ngs: yes str1ngs: the gjs GI is probably the best reference language daviid: yes, try str1ngs: okay will take some time to test this properly. this gives me a better idea as to where the issues is. daviid: try this http://paste.debian.net/1122406/ daviid: in a guix repl daviid: after ,use (g-golf) and (g-irepository-require "Clutter") str1ngs: (g-irepository-find-by-name "Clutter" "PaintNode") gives me ** (process:576): CRITICAL **: 09:01:10.118: g_irepository_find_by_name: assertion 'typelib != NULL' failed daviid: yes, you need (g-irepository-require "Clutter") daviid: sorry daviid: i pasted to quick ... str1ngs: which is the error I get when import Gtk str1ngs: okay no error with require daviid: so? str1ngs: (g-type-name $6) though returns #f daviid: right, and this is incorrect str1ngs: (g-type-name 196) simplifies the code daviid: but you don't know it will always be 196 :):) daviid: yu need the steps str1ngs: understandable daviid: you may try using gjs daviid: 'similar' steps str1ngs: with 1.58.3 I get "ClutterPaintNode" str1ngs: maybe C would be less abstraction daviid: if yu can try gjs, it would be better str1ngs: this helps though thanks. str1ngs: I will try with gjs, just can't do it right now. will probably later in the day. daviid: but using the exct same GLib, GObject, GI and Clutter/Cluuter gir lib of course ... daviid: which i am not sure it is possible on guix daviid: because gjs may have its own depenencies, that differs fro g-golf .. str1ngs: sneek later tell daviid will do. thanks again sneek: Okay. zig: hello guile! zig: there was an spam attack? again? I was quieted for a while. zig: ? RhodiumToad: don't think so? zig: sneek: botsnack sneek: :) peanutbutterandc: Good morning, there. I wonder if anyone has managed to run my guile-tutorial C code from yesterday and/or find the problem with it: https://termbin.com/3iy3 ? peanutbutterandc: The tutorial: https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html The problem: It compiles without errors but doesn't show any graph while running (no stdout stderr, $? = 0) peanutbutterandc: I see. turtle_reset() after start_gnuplot() is the culprit! peanutbutterandc: s/turtle/tortoise/ peanutbutterandc: For some reason, I am unable to `pkg-config --cflags --libs libguile` Any help, please? peanutbutterandc: Nevermind, it's apparently `pkg-config --cflags --libs guile-2.2` manumanumanu: What the flying friggindoodle?! string-ci= and string-ci=? behaves differently in srfi-69 hashtables manumanumanu: aaaah. srfi-69 detects string-ci=? but not string-ci= and chooses a hash manumanumanu: dang. manumanumanu: RTFM :D manumanumanu: My first guile patch(es) submitted! I am actually quite proud. zig``: o/ zig``: wingo: seems like you are correct about the ffi slowing down my program. Also, the JIT kicks in, that is in small database files it 5 times slower but on bigger it is 3 times slower (only) zig``: maybe it is time to add ffi to the benchmark cc ecraven ;) nly: str1ngs jcowan I think a global stack is just a bad idea, i.e. buffer-stack in (emacsy buffer). But Lists can implement stack very well. faLUCE: hello. What's wrong in this syntax? (list (cons "editableClass" editableClass)(cons "editableSubclass" editableClass)) faLUCE: [01:02] it's ok for (list (cons "editableClass" editableClass)) daviid: lloda: guix has a string-replace-substring, here http://git.savannah.gnu.org/cgit/guix.git/tree/guix/utils.scm, but i think it should be called string-replace-all, so i snarfed and renamed it, here http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/string.scm RhodiumToad: faLUCE: looks ok to me? manumanumanu: Ahoy guilers! manumanumanu: Do I have to have xcode to have any chance of building anything from source on osx? manumanumanu: And why is ./autogen.sh not finding AM_GNU_GETTEXT? manumanumanu: Because I hadn't linked it properly! manumanumanu: Has anybody successfully built guile outside brew on mac os x? Regardless of my --with-libltdl-prefix it outputs a warning that it can't find libltdl manumanumanu: eff this. I'll do all guile development on my rpi. manumanumanu: can I use an existing guile2.2.x to bootstrap 3.0? peanutbutterandc: Hello there, n00b here, trying to go through this tutorial: https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html but for some reason my code does not work (the backend .c program): https://termbin.com/3iy3 peanutbutterandc: Any ideas, please? peanutbutterandc: By the way, it compiles without any errors. `gcc -Wall ...` is silent. str1ngs: peanutbutterandc: what error do you get when you run the program? peanutbutterandc: str1ngs, Hey there. I get no errors even while running. And it is exiting with $? 0, too. I just can't see anything. I thought I was supposed to see the turtle peanutbutterandc: Also, I did try putting in `sleep (1)` inside the for-loop that draws str1ngs: peanutbutterandc: does anything print to stdout? peanutbutterandc: str1ngs, Not at all. Does it work on your machine? peanutbutterandc: I am using gnuplot off of guix, BTW. On a foreign distro. str1ngs: to me everything seems fine. it's just not obvious to me what gnuplot is doing with the piped input peanutbutterandc: str1ngs, I lack the knowledge about C and gnuplot to know it peanutbutterandc: The first part where I had to deviate (apart from the function prototypes) from the tutorial was execlp() function. Instead of "gnuplot" it's "gnuplot", "gnuplot" (stack overflow-ed it) peanutbutterandc: wonder if that makes any difference. Wasn't compiling without the change str1ngs: peanutbutterandc: output = fdopen (pipes[1], "w"); it's not obvious to me what pipes[1] is peanutbutterandc: str1ngs, If it were not for pipe() it would have been an uninitialized array... so it must have something to do with pipe() ? str1ngs: actually to me it just writes to the gnuplut process peanutbutterandc: ... that seems to be what was intended, too. I wonder why gnuplot window isn't showing up str1ngs: peanutbutterandc: I just figured out gnuplot creates a window too str1ngs: peanutbutterandc: does echo "clear" | gnuplot create a window. if for a short time? peanutbutterandc: No, sir. But I have seen a window blink in while trying to run ./tortoise, occasionally. I then put sleep(1) in the loop but the window didn't show up at all. str1ngs: peanutbutterandc: everything looks okay. just seems gnuplot is not displaying str1ngs: try running gnuplut and plotting a simple example str1ngs: by hand peanutbutterandc: str1ngs, plot sin(x) does give me a plot peanutbutterandc: in the interactive gnuplot prompt str1ngs: peanutbutterandc: maybe there is a problem with the syntax piped to gnuplot manumanumanu: wingo: the REPL message still says 2.9.2 for me, which wasted 1SEK of energy on a rebuild because I don't understand OSX :D peanutbutterandc: str1ngs, I have just emailed the author of the tutorial. Hopefully he will be able to pin-point the issue? manumanumanu: Which is weird, since (micro-version) is 7, but (version) reports 2.9.2~COMMIT manumanumanu: Which seems odd, since that should not pass all the tests if I read test-suite/tests/version.test correctly. manumanumanu: wingo: Now I have everything in place, including tests and everything. Is there anything extra I need to do? The documentation is in srfi-modules.texi, the modules are in the srfi directory, the tests are in the test directory named srfi-171.test. Do I have to add it anywhere else? manumanumanu: and btw, that weird version thing was a left over from me not doing a make clean manumanumanu: oh. The makefile.am's manumanumanu: building guile again to see if it works now! nly: sneek later tell janneke Manuals are up https://www.nongnu.org/emacsy/manual/emacsy.html sneek: Okay. bandali: niice nly: :) jcowan: nly: I just looked through the manual: impressive for a WiP. Is there going to be a published Guile interface too, so that Guile programmers can use it without stuffing things through the C API? str1ngs: jcowan: emacsy can be used from guile without needed the C API str1ngs: nly: nice work, thank you str1ngs: neeeding* nly: jcowan: Emacsy already can do a lot without using C. I think you might be asking about the event loop, let me see nly: heyyy :) str1ngs: you just need a loop with emacsy-tick IIRC the right procedure name str1ngs: from what a gleamed when reading the C source. it simply exposes some C functions to make life easier for a C program. the C functions wrap scheme code. str1ngs: see https://git.savannah.nongnu.org/cgit/emacsy.git/tree/emacsy/emacsy.c#n113. emacsy_tick is just a C helper for scheme emacsy-tick nly: this is much better than i could say nly: everything you need should be in (emacsy core) module nly: no c required str1ngs: actually (emacsy emacsy) exports everyting. str1ngs: IIRC nly: yep str1ngs: emacsy is well designed. expect for the stack. lets not talk about that lol str1ngs: except* nly: lol str1ngs: how is the release going nly? nly: it's done str1ngs: nice thank you. I just had a chance to look at it str1ngs: and tarballs! :) jcowan: str1ngs: You mean it eats Scheme stack? str1ngs: jcowan: nothing like that, just it uses a stack library for buffers jcowan: Ah jcowan: I may write a ring-buffer library at some point, but not right away *: spk121 is revisiting some of my 10yo Guile code. Strange to read... str1ngs: jcowan: we are looking to see if we can improve on the custom one emacsy is using. str1ngs: jcowan: I think nly was looking at using a srfi if possible ArneBab: spk121: how your coding style changed would be a very interesting blog post, I think. manumanumanu: wingo, civodul: regarding srfi-171, I doubt I will have any time to hack on it during the christmas holidays. What is the policy on when to include srfis? I will miss 3.0 (I have probably missed any feature window if there is such a thing). Does srfi-171 have to wait for 3.2? I also have a bunch of non-portable transducers that were not included in the srfi. Should those go in (srfi srfi-171 gnu) if I were to manumanumanu: judge some of them actually usable for mainstream use? manumanumanu: Happy friday, btw! lloda: manumanumanu: I think a new srfi could go in 3.1 since it's not an incompatible change lloda: oh I mean it could go in at any time manumanumanu: lloda: I read through some old NEWS and the extended let-form was included in a 2.2.x release. manumanumanu: Anyway, I will probably finish it by the end of january. lloda: also srfi-71 was introduced in 2.2.5 lloda: or .6, anyway roptat: hi! I'm looking for a way to compact a url, like "https://example.com/test/../foo" -> "https://example.com/foo". I've been looking at (web uri) but there's nothing obvious... I tried (uri->string (string->uri "https://example.com/test/../foo")) but that didn't work :) roptat: it's more like "get a canonical url/uri" actually manumanumanu: lloda: that was what I was referring to :D manumanumanu: hmmm... srfi-171 binds intermediate values where let-values does not manumanumanu: srfi-71 lloda: wdym let-values doesn't bind? lloda: isn't that what let is about? manumanumanu: lloda: they both expand to lambdas with call-with-values. srfi-71 expands to code using extra temporary variables manumanumanu: where they are not necessary. lloda: oh lloda: an implementation artifact? manumanumanu: probably. Maybe it is needed to handle some of the (values ...) semantics manumanumanu: I should compare the assembler though to see if the code is any different. lloda: hmm lloda: I'm a fan of srfi-71, I don't use -11 or -8 anymore in fact manumanumanu: oh! sorry lloda: why :D manumanumanu: the optimizer solves it. lloda: oh lloda: I didn't realize that there is already an (ice-9 string-fun) module in Guile :O lloda: I thought chrislck yesterday was talking about creating it lloda: it's all undocumented it seems! lloda: I think it's no problem to add string-replace-substring in there lloda: I'll make a patch manumanumanu: lloda: so, most examples I have thrown at it produces similr ,opt code, and when the code ,opt prodeces isn't "optimal" it still produces similarly fast assembler. manumanumanu: I might start using it as well! lloda: it's a big help with long let* chains tbh lloda: well, it's just neater looking lloda: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=cf5b4a1db8ad4c1060f08f07113791dd34374266 manumanumanu: The beauty of having to add a let-values in-between a chain of let* is questionable :D :D lloda: you'd use let*-values for the whole chain and then it would be full of redundant parens :-/ manumanumanu: exactly. lloda: I'll send that patch to the list later today manumanumanu: is string-contains? based on KMP-search? manumanumanu: One could benchmark it against the srfi-13 implementation. roptat: oh well, I read the RFC and implemented what I needed :) ArneBab: manumanumanu: nowadays I mostly use define and avoid let* jcowan: I mostly use top-level define and do my own lambda-lifting manumanumanu: ArneBab: well, if you want it to run fast on 2.2, there is some overhead using define. Porting pvector from racket actually showed that the overhead was quite substantial. dsmith-work: Happy Friday, Guilers!! faLUCE: hello. myString is "". How can I replace "" with "token2" ? zig: is this supposed to remain in the code: module/statprof.scm zig: 271: (pk 'what! (make-stack #t))))) zig: 883: (pk 'what! (make-stack #t))))) chrislck: faLUCE: https://lists.gnu.org/archive/html/guile-devel/2013-09/msg00029.html faLUCE: thanks chrislck faLUCE: could not imagine that it had to be implemented chrislck: faLUCE: here's a followup. https://lists.gnu.org/archive/html/guile-devel/2014-03/msg00058.html this fn is not defined in srfi-13 or srfi-152. lloda: well I for one think that should be in Guile lloda: I'd create (ice-9 strings) and merge -13 and all the core functions in there lloda: I don't know if there are incompatible ones tho chrislck: o/ agree chrislck: the question is who will be in charge of creating it? lloda: it seems -13 is in core always, so there's no need to merge lloda: I've read that there is a concern of bloating the core lloda: but if there is broad agreement that such or such function belongs in Guile itself and not some library, then I'd just add it lloda: the patch would be trivial, but maintainers have to agree, or allow someone else to make the decision. lloda: once I did create (ice-9 arrays) that has a couple functions only, just to avoid putting them in core lloda: it is p. weird that you need to import (rnrs bytevectors) to get bytevector-length, but something like string-normalize-nfkc is just there chrislck: (ice-9 string-fun) could have an additional function nly: hi nly: sneek help nly: sneek later tell janneke web manuals made it into the cvs web repo sneek: Will do. janneke: what could mpi be, /me wonders... sneek: janneke, you have 1 message. sneek: janneke, nly says: web manuals made it into the cvs web repo janneke: ah, wrong channel still good! janneke: nly: that's great, thanks! manumanumanu: Ahoy hoy! jcowan: manumanumanu: Ho de do de do! janneke: sneek: botsnack sneek: :) faLUCE: hello. myVar contains the content of a text file, which I have to copy inside a html document. Then, according to HTML standard, I have to replace special characters like <, >, / etc. What's the easiest way to do that, in scheme(guile)? faLUCE: do I have to implement myself the function or is there anything for doing that? zig: ArneBab: are you sure? did you benchmark the release or git master? zig: related to the leak zig: I did no do extensive benchmark yet. lloda: pls remind me how to adjust the number of columns in backtrace output? lloda: oh export COLUMNS=xxx lloda: I wrote @{vec} instead of @var{vec} in a docstring lloda: I got >Throw to key `parser-error' with args `(#f "Expecting @end for " deffn ", got " (END . #f))'.< lloda: then I spent the next hour going through texinfo.scm until I saw the error T_T lloda: it's really too bad that C99 doesn't have optional arguments :-/ lloda: makes extending an API harder lloda: wingo: would like to get this in 3.0 http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=f8285eef9bcb261db425be61cd66b54c3cbf26c5 lloda: so the problem with extending bytevector-fill! from (... bv fill) to (... bv fill start end) is that the C function scm_bytevector_fill_x becomes incompatible. So you'd have to go through the deprecation cycle :-/ lloda: and all for a function that isn't all that useful in C anyway lloda: so I'd just leave scm_bytevector_fill_x as it is and extend only the Scheme function. jcowan: lloda: I agree ArneBab: zig: I just ran a guile-fibers server and attacked it with wrk. I can drive the memory consumption quite high with that. I’ll ask my employer whether I can release the tool as free software. zig: ArneBab: it would be nice. daviid: spk121_: guile-gi has been added to http://sph.mn/foreign/guile-software.html daviid: str1ngs: hello! I pushed a series of doc patches for the (g-golf) high level api, and although I think you aready know about most of this, if not all about this, I'd recommend you pull, run the make/ make check/make install/make install-html dance, and carefully read the doc for gi-import-function, as well as the some how 'associated' %gi-strip-boolean-result variable str1ngs: daviid: thank you will read this ASAP. lloda: why would it be that (major/minor/micro-version) return "2"/"9"/"7" but (version) returns "UNKNOWN" ? lloda: I don't remember if this happened before but I'd say it's a bug https://paste.debian.net/1121359/ lloda: you can ofc ,bt but the first location report is not useful zig: I am actively looking for ways to get paid for my work on nomunofu, babelia and datae. Any advice welcome. zig: btw, I just tried blazegraph (the database used by wikidata), nomunofu is query is 4 times faster. zig: btw, I just tried blazegraph (the database used by wikidata), nomunofu query is 4 times faster. zig: I could not benchmark reliably the import time. stis: tja guilers! ArneBab: zig: async-std sounds awesome ArneBab: zig: but the real test will be whether servers implemented with that outperform other servers ArneBab: zig: my main issue with guile-fibers is currently that it never reduces memory consumption: there is no mechanism to reap no longer needed fibers. ArneBab: (at least not in the (fibers web server)) ArneBab: zig: so they’ll need to release their minihttp with async-std and get it into the TechEmpower benchmark *: bavier really wanting truncated-print in the repl right now... daviid: bavier: if it is just the repl, follow the instructions here https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile_0027s-repl_002dprint-procedure.html#Configuring-Guile_0027s-repl_002dprint-procedure daviid: bavier: for the rasied exceptin system, try to find and apply the patches in the wip-truncate-exception, for you guile version ... or 'manually' the next section steps of the above link ... daviid: spk121: I just sent an email to the 'guile s/w list' (earlier posted) link owner and maintainer so he adds guile-gi and g-golf ... spk121: daviid: ok, sweet. I think the next guile-gi (v0.2.2) will be stable enough to declare as a beta. 0.2.1 had a nasty bug where my callbacks were being garbage collected because their pointers were held in C daviid: spk121: great! I glad you found the bug you were tracking for a while ... cool! wdkrnls: How can I figure out what guile modules provides a procedure? wdkrnls: (help "function-name") seems to work well enough for now. lloda: actually I didn't know that (help "fname") and (help fname) did different things lloda: I only ever used (help fname) catonano: lloda: to me (help "fname") claims "fname" is not a symbol and it hangs catonano: (expecting symbol): "fname" catonano: what's your experience ? RhodiumToad: in my test, you only get that error if it didn't find anything using the string RhodiumToad: try e.g. (help "car") zig: catonano: do you have in ~/.guile the following line: (use-modules (texinfo reflection)) ;; help catonano: zig: yes catonano: RhodiumToad: thanks. I was in the user module catonano: oh wow wingo: is anyone able to debug the build failure that mwette reported? wingo: mwette: if you try to compile linker.go with GUILE_JIT_THRESHOLD=-1 but with -Oresolve-primitives, does it change the result? wingo: mwette: did you have this build error before 2.9.5 ? wingo: do you build with make -jN or is it a straight make wingo: ? *: civodul just stumbled upon http://akrl.sdf.org/gccemacs.html jcowan: Astonishingsauce. I suppose now that Emacs is small potatoes rather than the biggest process on most people's systems, the overhead of keeping gcc in memory isn't that bad. civodul: heh jcowan: It certainly puts pressure on (a) ancient dynamically-bound Elisp code, which will run much more slowly, and (b) Guilemacs. jcowan: The last especially because it won't trigger any worries about splitting the community: you still have to write Elisp to customize Emacs, even though the definition of "Elisp" is changing over time. jcowan: Perhaps another approach is to provide an Elisp back end for Rapid Scheme (which currently has only a Scheme back end) to allow people to write Scheme-with-Elisp-libraries. jcowan: You'd have to either run RS outboard or translate it into Elisp, though. jcowan: (The latter is a much bigger job than adding Elisp support, though that's not trivial either.) wingo: i just did a fresh -j1 build with no failure jonsger: wingo: I finally start working on the power port of guile 3.0 this week again jonsger: let's see how far I can come str1ngs: jonsger: I have access to power8 and power9 if you need any help testing. jonsger: str1ngs: I have a blackbird my self and develop on it. But thanks for the offer :) str1ngs: jonsger: I've been meaning to look at that and some guix related power things. but been swamp with other projects lately str1ngs: I can at least run tests or something though jonsger: str1ngs: nice. Guix is a little difficult due to the stuff we have to change in the bootstrap process for gcc6... wingo: jonsger: nice :) i would start with lightening's test suite fwiw :) wingo: ah i guess you could get it working without jit first, i would guess it works already but who knows str1ngs: jonsger: I don't have root access on the power machines. so I created a rootless container to run guix which was neat in it's self. wingo: definitely try the libgc test suite too jonsger: wingo: so you mean guile-3.0 on power? wingo: yes regarding guile 3 on power i would do: (1) make sure libgc tests pass (2) build guile without jit, make sure it works (probably it does) (3) start to work on the power port of https://gitlab.com/wingo/lightening wingo: once those are done then guile 3 jit should work jonsger: 1 and 2 should already be the case. I have already started on 3 in August, now I need to understand what I did :P jonsger: somehow guile 2.9.7 seems to be super slow to compile wingo: jonsger: is it a 64-bit big-endian system? jonsger: wingo: now powerpc64le wingo: k wingo: 64-bit little-endian should have prebuilt .go files fwiw jonsger: yes, it has mwette: wingo: with GUILE_JIT_THRESHOLD=-1 still segfaults; this did not happen with 2.9.4 IIRC; I can try again; I'm just using make wingo: mwette: interesting info, tx :) wingo: mwette: can you do "ulimit -c unlimited" wingo: then run it so it produces the segfault wingo: then "gdb libguile/.libs/guile path/to/core/file", then "bt" wingo: could be ubuntu stashes the core file elsewhere tho, you might need to look up how to get a core file mwette: (gdb) bt mwette: #0 abort_to_prompt (thread=0x56531d1b0d80, saved_mra=) mwette: at vm.c:1449 mwette: #1 0x00007f1e462e960b in vm_regular_engine (thread=0x56531d1b0d80) mwette: at vm-engine.c:1106 mwette: #2 0x00007f1e462ea9d4 in scm_call_n (proc=0x7f1e46736008, mwette: argv=argv@entry=0x7fff27bf38c8, nargs=nargs@entry=1) at vm.c:1586 mwette: #3 0x00007f1e4626fea7 in scm_primitive_eval (exp=, mwette: wingo: that's exciting mwette: (gdb) p vp mwette: $3 = (struct scm_vm *) 0x56531d1b0d88 mwette: (gdb) p vp->sp mwette: $4 = (union scm_vm_stack_element *) 0x7f1e4674c020 mwette: ( mwette: p vp->sp - sp = -2059 mwette: cont = 0x04 RhodiumToad: this is linux on powerpc? RhodiumToad: how deep on the stack is that? because we (postgres) ran into an issue with stack extension on power mwette: mine is x86_64 on Ubuntu 18.04 RhodiumToad: oh, ok jcowan: Removing -Oresolve-primitives from bootstrap/Makefile allowed me to build 2.9.7 on Ubuntu Xenial, and I'll try later today to build on Cygwin as well. jonsger: wingo: is there a reason why `jit_gpr` is a struct and not just an `uint8_t`? wingo: type safety wingo: does the power abi not pass it in a register? jonsger: wingo: no it's fine. Just seemed a little boilerplatish to me :P wingo: it goes away at the backend level :) wingo: the issue is, you don't want to confuse immediates, fprs, and gprs wingo: that kind of bug is really easy for the user to make if the type system doesn't help you out wingo: that's a problem the original lightning api as wingo: *has jonsger: ah, that's what I tought :) johnjay: jcowan: changing compiler flags for different platforms based on guesswork sounds like a nightmarish web jcowan: Yes, it's just a hack to get things going for me on my two boxen johnjay: maybe it's the fact you said ubuntu xenial johnjay: as in, it might compile on fedora but then for ubuntu the flags have to fiddled with johnjay: or like bionic -> xenial (i'm on 18.04) jcowan: I'm not running bionic, so I have no idea jcowan: $EMPLOYER will remain on xenial until the LTS runs out johnjay: i'm not sure what the LTS means in practice. i just went with 18 since security updates sounded good johnjay: but i think maybe i should have just used the latest one jcowan: It means that Ubuntu is providing support for five years after release, whereas other releases are supported only a short time wingo: regarding ubuntu 18.04, it's good that it's not a jit bug, and that the backtrace is in c rather than the vm. i suspect a gc bug fwiw wingo: someone will need to spend some time with a VM, but i am away for a couple weeks. have a nice holiday, ppl :) mwette: same to you ! jcowan: so the current release (Eoan) willl expire next July, whereas bionic is good until 2023 and even xenial until 2021, *and* security patches until 5 years later in each case zig: might be interesting to fibers https://async.rs/blog/stop-worrying-about-blocking-the-new-async-std-runtime/ zig: "The new runtime detects blocking automatically. We don’t need spawn_blocking anymore and can simply deprecate it." Seems like a GC kind of work, we know what it brings in terms of feature, but do not know the price. zig: funny that is use the 'spawn' term, I made exactly the same choice of name a few years back. rekado_: I’m getting the same error when using the fibers backend instead of the standalone web server in (fibers web server) str1ngs: daviid: hello I have been doing some thinking about methods. I think you mentioned you were going to add support for them. ie (gtk-window-show-all window) vs (show-all window) this might allow for generic methods. daviid: str1ngs: yes, after i finish the doc for what g-gplf has in its high level api, then signals, i should work to get these 'long name method names' as short names method to ... str1ngs: daviid: good to know thanks. I'm looking at it from a generic method stand point. not so much the inconvenience of the long names rlb: Is there any more or less approved way to detect when a macro is expanding at the top level, or alternately to detect when a "name" passed to a syntax expander is going to be a toplevel-ref from within the expander? chrislck: something stumps me.... (define (proc arg1) ...), and later we call (proc arg1 arg2) which should fail. is this something that changed guile-2.0 to 2.2? daviid: chrislck: cold you post the exact sinpset that doesn't do what you think it should ... just you saying so, we can't test and prove ... daviid: bbl chrislck: sent to bug-guile chrislck: fwiw the (IMHO incorrect) behaviour seen when (proc) is an *internal* define chrislck: http://paste.debian.net/1121118/ chrislck: using guile-2.2.6 daviid: chrislck: here, using 2.2.6, it complains at interpreted/compile time already daviid: but fail to raise the exception when the situation happens ... daviid: i thnk extra args are ignored, you'd receive an exception for insuficient ar number daviid: someone familiar with the scheme spec might tell ... chrislck: the odd thing is 2.0 raises exception as IIUC it should, but I don't know what the spec says daviid: chrislck: you are bing warned at compile time though ... and this doe not produce wrong results either chrislck: not sure what you mean by compile. "guild compile try.scm" says no error. not sure if genuinely is an error, yet is a change of behaviour 2.0->2.2 and causes unexpected failure in 2.0, or passes unexpectedly in 2.2 chrislck: will await spec geniuses to chip in daviid: chrislck: one of the 'problem' is that these procedures have to deal with multiple values, without coplaining daviid: chrislck: i said warning, not error daviid: it is not an error, extra eargs are 'dismissed', but there is no error chrislck: sure... a 2.0 -> 2.2 change nonetheless, and haven't found documentation about it chrislck: just, surprising daviid: management of mltiple values has changed between 2.0 and 2.2, iirc chrislck: if add1 was a define* then I'd agree no issue, but a standard define IMHO would have borked daviid: chrislck: but again, there is no error, what is your concern wrt this? chrislck: ah because code developed in 2.2 yet users may run in 2.0 and get an unexpected error daviid: chrislck: so, you don't have to do 'anything', 2.0 users will have to change their 'calls', but 2.2 and newer guiler versions won't complain, rightfully ... progress, not rgression ... daviid: and invite everyone to use 2.2, soon 3.0 ... chrislck: :) if only... some users refuse to upgrade and keep posting bug reports on releases 2 years old. "It's my right to demand you maintain old releases" daviid: chrislck: then the buf is theirs, not yours, since there are calling with extra agrs ... daviid: *bug zig: hello #guile rlb: Answering my own question, maybe syntax-local-binding (to detect a top-level id), if that's likely to stick around. johnjay: daviid: looking at that list i don't see anything concrete like a mp3 player or a notepad editor or a image viewer johnjay: everything is a library or kit or some kind of framework daviid: johnjay: that list is the mst complete list of guile apps and libs we have, time for you to hlp us to complete it ... johnjay: well i want to make sure i understand what guile is johnjay: if nobody is writing a GUI calculator in guile there must be a reason johnjay: i'm trying to install guix but so far no luck daviid: johnjay: wrt guix, try to share your difficulties on #guix johnjay: i bring it up because maybe it will have some applications written in scheme johnjay: i'm a little concerned you can't seem to name any johnjay: and i didn't see any on that list johnjay: am I wrong? daviid: johnjay: thre are tons of apps written in guile scheme, i wrote some :) many other wrote many others .. make yur shoping on that list ... daviid: and build your own ... catonano: johnjay: you' re right to be concerned. Guile has a problem. As reference you might take the talk by christopher Lemmer Webber about how it lacks libraries catonano: as for GUI apps, the integration layer with Gnome is in the works currently, there are some small demos around but it' s gonna be a looong walk and it' s just beginning catonano: johnjay: you can read my own take here https://quisquiliae.hashbase.io/guile-and-free-software.html johnjay: catonano: the one from FOSDEM 2019? catonano: johnjay: I don' t remember if it was Fosdem 2018 ro Fosdem 2019 catonano: they announced their adoption of Racket and proposd the community the idea of thinking about some convergence between Racket and Guile catonano: if I remember correctly spk121: yeah. for me personally I've written a couple of fully scheme GTK programs or ncurses programs, but, they are not much more than demos johnjay: catonano: ah ok. as a rule of thumb having games like tetris or sokoban is the first sign of a healthy software ecosystem johnjay: thanks for the link catonano: johnjay: :-) spk121: i've got a guile tetris using ncurses, haha johnjay: ^ str1ngs: sneek: later tell spk121 how hard would it be to create a generic program that uses either gtk or ncurses? sneek: Okay. *: mwette back to working toward nyacc 1.0 release mwette: I can now parse "enum { FOO = 1, }; enum { BAR = 1 + FOO };" and generate constant association `(BAR . 2)' spk121: mwette: nice! sneek: Welcome back spk121, you have 1 message. sneek: spk121, str1ngs says: how hard would it be to create a generic program that uses either gtk or ncurses? spk121: str1ngs: hmm. gtk is a high level toolkit and handles mouse and keyboard automatically. Ncurses is lower level, analogous to the GDK, Cairo, and libinput. So to both ncurses and Gtk, you'd have to write a widget in ncurses the mostly behaves like the Gtk widget, and then go from there mwette: sneek: emacs does that, methinks rekado: I can’t seem to build fibers with Guile 2.9.7. jcowan: johnjay: There's not that much advantage to replacing an existing C/C__ application with a Guile version. Better to integrate the application with Guile to make it scriptable johnjay: ok johnjay: that makes sense johnjay: that webber talk hard for me to follow but i did get the impression racket is "the best" w.r.t. libraries and guis johnjay: and something about mutable toplevels being good for games for some reason johnjay: ah the only comment mentions immutable top level jcowan: okay, configure ran, now in the CC stage jcowan: Ouch, I had a hard crash: can anyone diagnose this? jcowan: BOOTSTRAP GUILEC srfi/srfi-1.go jcowan: /bin/sh: line 6: 51400 Segmentation fault (core dumped) GUILE_AUTO_COMPILE=0 ../meta/build-env guild compile --target="x86_64-unknown-cygwin" -O1 -Oresolve-primitives -L "/home/rr828893/Downloads/guile-2.9.7/module" -L "/home/rr828893/Downloads/guile-2.9.7/guile-readline" -o "srfi/srfi-1.go" "../module/srfi/srfi-1.scm" mwette: wingo: so guile-2.9.7 is not building for me on ubuntu; crashes building linker.go; if I remove "-Oresolve-primitives" it works; if I run under gdb-uninstalled-guile I get end up with "Inferior 1 (process 10064) exited normally]" but the linker.go file is not created. I tried ... mwette: wingo: ubuntu 18.04 x86_64 daviid: mwette: it compiles fine on debian buster - did you make sure to clean any previous compilation mwette: daviid: yes jcowan: Okay, I am getting the same crash on Ubuntu Xenial jcowan: reporting to the ml zig: hello #guile rgherdt: hi lampilelo: how can I make guile compiled by me to know where to find system's gnutls module? civodul: uh, Guix no longer builds on 2.9.7 civodul: seems there's some eager binding resolution taking place lampilelo: adding system's stuff to GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH doesn't seem to work, maybe I'm doing something wrong civodul: lampilelo: what error do you get specifically? civodul: normally, if gnutls.scm is in GUILE_LOAD_PATH, it should just work lampilelo: Throw to key `gnutls-not-available' with args `("(gnutls) module not available")'. lampilelo: I don't have gnutls.scm, just gnutls.go but I'm not sure how to load it zig: lampilelo: you use guix? lampilelo: zig: no lampilelo: I compiled 2.9.7, installed it in /usr/local/* and http-get stopped working lampilelo: so for now, I'll use /usr/bin/guile until I figure it out zig: while importing triples, 2.9.7 is 2% faster than 2.9.6 zig: I will compare nomunofu against blazegraph zig: well blazegraph is can not be installed on ubuntu 18.04, I will try 4store instead. mwette: lampilelo: you may need to use LD_LIBRARY_PATH to specify location of shared object; that is find out where libgnutls.so is and provide that in executing guile: LD_LIBRARY_PATH=/path/to/dir guile yourscript.scm lampilelo: mwette: i'll try that lampilelo: it doesn't make any difference lampilelo: oh, wait lampilelo: now it aborts with "incompatible bytecode kind" lampilelo: I guess I need gnutls.scm after all zig: 4store is 4 times faster. zig: 4store is around 4 or 3 times faster. It is written in C. mwette: lampilelo: yes, guile needs to find gnutls.scm and gnutls.scm needs to find libgnutls.so civodul: lampilelo: the system gnutls is probably built against Guile 2.2 though, not 2.9 johnjay: are there any applications completely written in guile johnjay: or is guilt meant literally to just extend an existing program in a non-scheme? johnjay: *guile zig: 5 times slower than virtuoso (which the biggest player foss competitor) zig: I did compare query times against virtuoso, but virtuoso cache query results very aggressively and report a query time of 0ms. zig: query times over a smaller than ram database seems very similar. zig: scheme@(guile-user)> ,time (nomunofu-query nomunofu '((http://www.wikidata.org/entity/L17895 (var p) (var o))) 100 0) zig: ;; 0.014304s real time, 0.011656s run time. 0.000000s spent in GC. zig: or does it?! 0.014 is 14ms unlike virtuoso which report 2ms zig: :P zig: first query virtuosos query, before caching, takes around 15ms ie. the same time. str1ngs: lampilelo: it's probably easier to just build gnutls with guile support into the same prefix as guile zig: (or use guix) rekado_: I’m getting this error when using (fibers web server): In procedure custom_binary_input_port_read: Value out of range: 1024 rekado_: I only see “1024” as the size argument of read-bytes, get-bytevector-n!, and port-read. rekado_: I don’t see this error when using (web server) rekado_: this is all with Guile 2.2.6 rekado_: the error is triggered by the use of xml->sxml *: rekado_ checks if there’s a flag to play with daviid: johnjay: http://sph.mn/foreign/guile-software.html spk121: . nerdypepper: profound lloda: why does bytevector-copy! take start & len args but bytevector-fill! doesn't :-( lloda: are these standard or is it something we can fix? lloda: http://www.r6rs.org/final/r6rs-lib.pdf#chapter.2 lloda: that's too bad lloda: perhaps it can be extended lloda: (bytevector-fill! bytevector fill start k) wingo: lloda: it can certainly be extended. fwiw i have had "subbytevectors" on my list for a long time also wingo: we have all the machinery, just need to add the constructor lloda: I only think it's necessary as a low level mechanism lloda: because it ends in a memset, etc lloda: I think if you need 'view' objects, arrays is what should be used lloda: they just need to be better lloda: also bytevector-/vector- have very different interfaces, even though vectors and bytevectors are more or less the same thing, even the implementation lloda: I don't know if some merging could be done there lloda: so imo bytevector/vector-copy/fill should offer start/length and even stride, like s/d/c/zcopy in BLAS, but I don't like the idea of a subbytevector object tbh lloda: there are already too many of these things :-/ lloda: just my opinion ofc wingo: well my issue is that sometimes you have a big piece of memory and you want to give it to a subroutine wingo: right now you have to pass the whole thing, or use arrays which are somewhat less efficient than straight-up bytevectors wingo: if i could pass a subbytevector then i get bounds-checking in the subroutine wingo: s/give it to/give a piece of it to/ lloda: I do see the use case lloda: you think it's too much of a burden to pass start/len explicitly in those cases? lloda: ideally arrays wouldn't be less efficient lloda: I'm concerned that introducing this middle layer will make arrays even less efficient lloda: because of the redundant ranges lloda: also would all the operations that now take bytevectors, be able to handle subbytevectors? lloda: how does that work wingo: yes i think passing start/len is too much of a burden because it's not reliable. wingo: fwiw subbytevectors don't add any conceptual complexity wingo: they are just bytevectors. wingo: the compiler already assumes that any bytevector can alias any other bytevector wingo: and bytevectors already have a "parent" field if their memory is "owned" by some other object wingo: so a subbytevector is just a bytevector that has another as a parent, and which aliases a part of its memory wingo: it's not a new type of object lloda: ok that sounds a lot better than what I thought lloda: handling aliasing will be up to the user? lloda: like it is for arrays now I guess wingo: you mean managing the fact that one bytevector can mutate another? yes that's right lloda: ok wingo: note that it is possible to flag some bytevectors as immutable but given that they can alias mutable memory it doesn't give you much lloda: shouldn't the flag be only on the memory and not on the bytevector then lloda: 'memory' as w/e object that is lloda: also (sub)bytevectors will still be contiguous memory I assume weinholt: if you have shared subbytevectors then -ref/-set! can't assume alignment civodul: howdy! wingo: weinholt: that's already the case fwiw in guile, because you can make a bytevector out of a foreign pointer weinholt: ah. carry on :) wingo: i think we will just emit unaligned load/set ops and pretend it's the cpu's job :) wingo: lloda: memory isn't an object; it has no flags that we can easily access wingo: sometimes you can rely on os-level protections but guile doesn't do that right now as you'd need to catch sigsegv in weird places lloda: ok I was thinking you'd get some kind of metadata on the allocated pieces or something wingo: some of the memory is static in the .go files wingo: or from const static C memory, etc lloda: I see. Not a big problem I don't think lloda: yes to contiguous memory? wingo: right wingo: it's still a bytevector lloda: that's fine I think lloda: bytevector-copy! is massively faster than some of the other copy!s in Guile so I think those should be rebased as far as possible lloda: it's a special case, but a very common one wingo: it's faster than vector-copy! ? lloda: they don't work on the same types so I dunno lloda: I was thinking about array-copy! which is super slow lloda: I know vector-copy in core uses memmove or memcpy same as the unrollable case of array-copy! #t lloda: but array-copy! has to handle all the type conversions so it just does the dumb loop when the types are srfi4 lloda: just benched these lloda: bytevector-copy! on s64 x 50000 and vector-copy! x 50000 are about the same lloda: array-copy! is about the same with vectors (special case of #t -> #t copy) but it's horrible with 's64 as expected lloda: so the question is, if you have subbytevectors, will you also have subvectors, and will it be the same re: not a new type, etc. wingo: lloda: i don't think we will have subvectors. wingo: reason being, vectors deal in gc-managed memory and don't have this behavior of needing to be able to adopt memory from elsewhere wingo: i can see a consistency argument but the mechanics are too different lloda: hmm zig: hello #guile! roelj: hello zig wingo: civodul: fixed that closed-stdin bug and cutting a 2.9.7 civodul: wingo: neat! *: civodul can't keep up! wingo: lol :) wingo: i probably won't get to do any guile things over the next 3 weeks fwiw civodul: ah ha! so that's when i should start playing with it :-) civodul: i'll also be partly offline in fact wingo: oh yay distcheck worked the first time :) zig: roelj: As you might have figured, I cycled back to my rdf work. I read the documentation of sparqling-genomics. It is interesting. Like you told me previously, I need to support sparql 1.1 to be able to interop with your project. zig: ref: https://github.com/UMCUGenetics/sparqling-genomics/ *: wingo finished release, just waiting on mailman to post the release announcement roelj: zig: Well, if your store can do RDF then I want to look at it already. Maybe I can help implementing SPARQL 1.1 stuff! zig: I am not sure how to tell the thing I am thinking about. wingo: https://www.gnu.org/software/guile/news/gnu-guile-297-beta-released.html spk121: looks like I didn't make the cut for minlang room in FOSDEM, but, the schedule looks fun jcowan: roelj: Yes, and it generalized from triples to arbitrary tuples, so you can handle common RDF extensions like provenance. roelj: jcowan: That's interesting zig: bbl civodul: unscientific benchmark: "time guix build guile3.0-minikanren --check --no-grafts -v1" civodul: guile2.0-minikanren -> 8s civodul: guile-minikanren -> 27s civodul: guile3.0-minikanren -> 28s civodul: (with 2.9.6) zig: on my side, query times were good with babelia. I did not compare with guile 2.2 tho. I might have time to do that during the holydays maybe. jcowan: I'm testing Guile 2.9.7 on Cygwin now zig: I also benchmark nomunofu against blazegraph (jvm) zig: but later. jcowan: I had to build libunistring, which Cygwin doesn't package, and ./configure is dog-slow on Cygwin; the Guile one is especially large and it's still running. jcowan: Pig fucker crashed with "libunistring not compiled with iconv support". I do wish Guile would check dependencies *first*. davexunit: guile checks tons of stuff during configure. sounds like a simple omission. jcowan: I'm assuming that libunistring couldn't find Cygwin's iconv, so I'm rebuilding it jcowan: But the ordering consideration has been the case since at least 2.0, when I spent most of a day configuring, aborting, installing a dependency, rinse repeat. jcowan: At least now I know what the dependencies are up front, and hopefully it won't have to recompile *everything*, as Guile 2.0 did. jcowan: Okay, it's libiconv-devel that I needed to install (Cygwin uses Fedora package names, unsurprisingly) jcowan: and also libffi-devel, configuring for the 3rd time daviid: wingo: congrat for the release! i hope the next one includes lloda's wip-truncate-exception 2 patches - if you're going to be a bit 'away from guile' for 3 weeks, please don't forget to look at it ... tx! zig: hello #guix wingo: ArneBab: not sure, unfortunately i don't have any contact from mark since the beginning of november wingo: there will always be future releases tho zig: hello #guile too :) rlb: Is there documentation somewhere regarding the general performance characteristics of goops -- in particular, say the cost of (typical) method dispatch? I assume that's the same as slot access if you use a getter rather than slot-ref, though I'm also curious about slot-ref. wingo: rlb: i don't know about documentation, sorry :/ but it's all implemented in scheme so you can poke around wingo: basically slot-ref is an interpreter and using a getter is a compiler wingo: with associated perf characteristics wingo: getters are generic functions that have a dispatch procedure that has fast-paths for the types they have seen sneek: So noted. wingo: heh wingo: for slot access, those dispatch procedures are basically (lambda (x) (struct-ref x n)) wingo: but, since 2.0 or so, goops has only had "linear" dispatch procedures, which correspond to what e.g. javascript does for polymorphic dispatch wingo: but not "hash" dispatch procedures, which is what js does for megamorphic dispatch civodul: hey there! wingo: heya :) wingo: civodul: afaiu you should be able to re-check the guix issues using 2.9.6 wingo: 2.9.7 is just performance improvements civodul: wingo: great, i'll give it a spin civodul: good that you're still able to get some more performance improvements! wingo: indeed :) wingo: reminds me to re-do 2.9.6 vs 2.9.7 comparisons... wingo: takes a couple hours to collect the data d4ryus: is there a built-in way to calculate the checksum (sha1, md5, ...) of a file? zig: no, us guile-crypt (available via guix) zig: no. I use guile-crypt (available via guix) civodul: guile-gcrypt even :-) civodul: https://notabug.org/cwebber/guile-gcrypt civodul: or: "hashing", by weinholt: https://github.com/weinholt/hashing civodul: pure Scheme, so much slower civodul: well, i'd like to see how slow it is on Guile 2.9 civodul: we may get close to libgcrypt performance, who knows! civodul: wingo: that's a good benchmark for you ;-) wingo: :) wingo: seems to use r6rs fx+ et al wingo: which are unoptimized in guile *: wingo does not like fx+ civodul: right, but unboxing may still happen, no? wingo: maybe but not as well as with + civodul: i don't like that either, because i think type inference should give the same result where it matters wingo: because fx+ is effectively opaque to guile's compiler civodul: "hashing" brings its own fixnum module though wingo: ah that's true civodul: oh but that's not for fx+, only for other things wingo: right civodul: wingo: in (rnrs arithmetic fixnums), why not inline fx+ & co? civodul: i guess in hot loops the compiler would be able to get rid of all the assert-fixnum calls etc., no? wingo: could be a good option :) civodul: the risk of code bloat would be low, i'd guess wingo: anyway i think i don't have time to look into that atm :) civodul: understood! civodul: i can give it a try though no promise on the timeline wingo: if you want to inline, it would need to be before 3.0 fwiw civodul: yes d4ryus: Thank you! wingo: https://wingolog.org/pub/guile-2.9.6-vs-2.9.7-microbenchmarks.png wingo: some small regressions between 2.9.6 and 2.9.7 due to some benchmarks taking out-of-line paths more often (ray, which uses floating-point ops but the compiler is unable to infer that) wingo: but i am ok with that wingo: the string benchmark is related to heap size and how many GC's happen; it's not something the compiler can help with civodul: wingo: so the difference in the string benchmark is mostly noise? wingo: civodul: imo yes wingo: as you can see it's in the range of the previous commit civodul: ok roelj: So if I request a large file using ‘http-get’, what's an efficient way of writing to a file on the filesystem? sneek: roelj, you have 1 message. sneek: roelj, zig` says: is Virtuoso a hardwired requirements? I am asking because my work is directly competiting with that kind of software. reepca: the documentation for mkdir seems a bit unclear - "If MODE is omitted then the permissions of the directory are set to '#o777' masked with the current umask. Otherwise they are set to value specified with MODE" would seem to imply that MODE isn't masked with the current umask if it's specified, but it is. roelj: sneek: botsnack sneek: :) roelj: zig: Re: Virtuoso: No, any RDF store with SPARQL 1.1 support would do. zig: they are gone. zig: I was just going to emacs nomunofu.js rlb: wingo: thanks much for the summary. rlb: wingo: and to check that I understood, sounds like you're saying that we always have linear cost dispatch now -- i.e. some kind of roughly linear search for the correct method in the generic. wingo: rlb: linear in the number of distinct types seen by each getter. zig: I think I will to guix fringe event at FOSDEM2020 and then actually go to FOSDEM unlike last year. zig: the minimalist language track looks very good https://fosdem.org/2020/schedule/track/minimalistic_experimental_and_emerging_languages/ zig: here is the link to guix fringe event: https://libreplanet.org/wiki/Group:Guix/FOSDEM2020 wingo: good evening civodul: hey! ArneBab: wingo: 3.0 is a chance to get in things with high visibility (because "oh, it has a zero at the end" vibes well with news-folks :-) ), so if there’s something almost done in Marks pipe, he might want to get it in — or ensure that something still gets in which could break things if introduced later. ArneBab: civodul: for the string benchmark (and also divrec), have a look at the errorbar. For the purposes of uncertainty, there is no difference between 2.9.6 and 2.9.7 in these two benchmarks :-) ArneBab: wingo: all in all that’s awesome work! wingo: ArneBab: agreed but i have limited time :) so rather than delay the release i would prefer to make a 3.2 sooner civodul: wingo: in 2.9.6 "guile --version >&-" aborts, but differently compared to 2.9.5 wingo: that's exciting wingo: i thought i fixed that :) civodul: well, you did! it's no longer a stack overflow, but the wrong-type-arg is still there wingo: i think it should print something to stderr and exit with failure tho, right? wingo: just that it shouldn't abort() i guess civodul: "guile -c 1 >&-" should always succeed, though civodul: because it doesn't attempt to write to stdout wingo: civodul: it does succeed, right? wingo: hah wingo: no it doesn't :) wingo: exciting daviid: wingo: civodul: hello! what about the lloda wip-exception-truncate (two smal patches)? it seems good, 'straight forward' and afaict, 'inofensive', wdyt? wingo: probably a good idea! will have to look again daviid: wingo: ok, thanks manumanumanu: Good morning guilers! peanutbutterandc: On a Debian 10.2 machine, inside my guix profile, I have install guile-gnome and am trying to play around with it. However, I get the following error: no code for module (gnome gobject). Yes, I have $ eval `guix package --search-paths=prefix` as well. Any ideas as to why it might not be working? sneek: Welcome back peanutbutterandc, you have 2 messages. sneek: peanutbutterandc, nckx says: I promise that I'm not ignoring you, I've simply not been on-line for the past few days. sneek: peanutbutterandc, nckx says: Like, at all. 🙂 peanutbutterandc: s/install/installed/ manumanumanu: peanutbutterandc: which guile do you have? manumanumanu: if you are on guile-next, guile-gnome is not available peanutbutterandc: manumanumanu, It has been figured out. I didn't use (use-modules (gnome-2)) beforehand. It works now. Thank you very much. daviid: manumanumanu: afaict, guile-gnome work with the latest guile daviid: you need to ,use (gnome-2) first manumanumanu: daviid: ooh. I didn't know. The website says "now works with guile.2.2". daviid: ah, you figure itout, ok wingo: new results vs 2.2: https://wingolog.org/pub/guile-2.2.6-vs-2.9.7-microbenchmarks.png manumanumanu: wow! manumanumanu: good wwork on the right side of the diagram! wingo: tx :) manumanumanu: wingo: killing it with the array1 benchmark! wingo: the recipe for success is to write a broken thing and then fix it ;) manumanumanu: and sum! and destruc! manumanumanu: wowza wingo: those functions had a weird pathology where a recursive call would make them be JIT-compiled, but other activations on the stack that were doing the recursive calls wouldn't tier up wingo: so just a jit bug manumanumanu: I asked a question about sum and array1 in the mailing list. I was surprised that they were slower, since they were just tight loops. manumanumanu: Nice to know that they also became faster. wingo: yeah i thought that was the explanation too, initially wingo: turns out my intuitions are malleable :) wingo: i think ArneBab pointed out a few months ago that run-time was v different with GUILE_JIT_THRESHOLD=0; that was the clue that something was wrong zig`: hello! Good to see progress on the compiler :) roelj: Is there an ODBC library/package for Guile? lloda: some guile-newra benchmarks got twice as fast overnight :-) zig`: roelj: there is https://github.com/eestrada/guile-dbi, but I will gladly guide and help you to use wiredtiger. wingo: lloda: neat :) zig`: roelj: what is your use-case? manumanumanu: Ah, beating racket on my old project euler code with latest master :D :D Easy to port using my for loops as well. manumanumanu: wingo: about writing documentation. I am writing texi from the srfi-171 document, and I don't really know how to document the rany? reducer, at least in a clear way compared to rcons: https://srfi.schemers.org/srfi-171/srfi-171.html rcons is a three arity procedure, but in the context of transducers it is never applied in user-facing code. rany? however takes a predicate to return a reducer. How would you manumanumanu: suggest documenting that in a way that is not obtuse? Right now i am documenting rcons as @deffn rcons without arguments and then describing the arities in the text, wheres rany? in @deffn rany? pred and documenting the returned reducer in the text. wingo: i would use deffnx and repeat the thing three times for the different arities wingo: (if i understand the question) manumanumanu: But (rany? pred) returns a reducer similar to rcons manumanumanu: So I would be documenting two different things manumanumanu: so: rcons IS a three arity reducer. (rany pred?) RETURNS a three arity reducer. manumanumanu: For text clarity, I would do just @deffn rcons and then document the arities in the text, but for things like emacs code completion I start thinking I did the wrong decision not making everything a procedure that returns a reducer :D roelj: zig`: Thanks for the pointer. Unfortunatly I don't see ODBC support in guile-dbi; only database-specific implementations for postgresql, mysql and sqlite. I don't use wiredTiger; I want to execute commands on Virtuoso's ISQL prompt. wingo: manumanumanu: yeah dunno then :) manumanumanu: I'll do like I did in the srfi. Seems the clearest. zig`: sneek: later tell roelj, is Virtuoso a hardwired requirements? I am asking because my work is directly competiting with that kind of software. sneek: Will do. zig`: sneek: later tell roelj, see for example my recent work on nomunofu (https://github.com/amirouche/nomunofu/) that is *only* a *glimpse* of what is possible. Of course if you have shares in Virtuoso Inc., I understand it will not be possible. zig: I am wondering why nobody believes me or trust me when I say that wiredtiger (and foundationdb) are the way forward. What can I do to help this situation? RhodiumToad: way forward for what? zig: for on disk persistence zig: distributed and resilient on disk persistence in the case of foundationdb RhodiumToad: persistence of what, though? zig: persistence of data. wiredtiger and foundationdb are ordered key-value store, they store data on disk with strong guarantees, ACID and CP. RhodiumToad: as a database guy, I'm generally skeptical of both key/value stores and "one true way" arguments zig: in particular, roelj I think they have been looking for on disk persistence of data for several year, I already proposed to help, but for some reasons, they do not want my help. I wish I was a wasp. zig: RhodiumToad: Ah! What is your background in databases? what do you mean by database guy? key/value store is not key/value store in the sense of memcached or REDIS or Aerospike. It is not the "one true way" for all data needs, but for on-disk persistence of structured data, it is. It can even manage OLAP workload with some help. *: RhodiumToad is a postgres developer zig: you develop postgres the software or you work with postgres? RhodiumToad: both at various times zig: interesting. zig: you do no seem to know what is an OKVS, tho. zig: OKVS = Ordered Key-Value Store. manumanumanu: hmh. git.savannah.gnu.org has been down a lot lately lloda: ^ i've noticed it too davexunit: is there somewhere I can see the benchmark results for guile 2.9.6? sneek: davexunit, you have 1 message. sneek: davexunit, leoprikler says: did you ever get to implement the guix environment shebang? davexunit: this page http://ecraven.github.io/r7rs-benchmarks/ only has the latest stable release, which makes sense. davexunit: I've seen the benchmarks talked about davexunit: ah! I didn't realize the blog post had stuff that the mailing list post doesn't have. https://www.gnu.org/software/guile/news/gnu-guile-296-beta-released.html wingo: davexunit: note that things are significantly better since 2.9.6 :) see https://wingolog.org/pub/guile-2.2.6-vs-2.9.7-microbenchmarks.png davexunit: wingo: oh cool. thanks for sharing. :) davexunit: looking at them side-by-side to compare. a little tricky due to the non-linear y-axis wingo: log-scale as well :P davexunit: but it does look significant! wingo: ah i guess that is what you meant davexunit: yes sorry if I wasn't clear wingo: yeah basically i fixed the regressions relative to 2.2 wingo: and made some incremental improvements, and also somehow mbrot jumped way ahead davexunit: I was about to ask about mbrot. davexunit: so this is basically just regression fixes? what a great result wingo: yeah i am pleased :) i think i am done doing perf things for 3.0 davexunit: now I am curious to know where this will put guile 3.0 relative to the other scheme implementations, but I guess we'll just have to wait for a stable release to see an update to r7rs benchmarks page wingo: just need to fix bugs and anything that fits in between now and january 15 or so (aiming to release around then) wingo: davexunit: i will be running my own fork of that comparison fwiw soon, comparing against larceny, chez, and gambit wingo: i am assuming racket will be approximately chez wingo: we are generally faster than chicken now so i am not comparing any more davexunit: wow! davexunit: that is a great achievement wingo: but gambit and chez are quite good davexunit: yes davexunit: are the benchmarks using AOT compilation with chez? wingo: but, the ones that ecraven runs are less interesting to me because gambit and chez are run in an unsafe mode, so i am doing my own davexunit: ah davexunit: didn't know that detail wingo: yes they use AOT with everything pretty much wingo: even if it's compiling at run-time, compilation doesn't happen during the benchmark rgherdt: are you running chicken with -O5? wingo: rgherdt: i actually haven't been able to run the chicken benchmarks as they depend on some libraries that aren't packaged in guix. i was surprised to find fwiw that chicken didn't support r7rs natively wingo: i thought adding r7rs support would be somehow magic regarding ease of benchmarking but it's simply not the case :/ davexunit: I'm super excited for guile 3.0. amazed by how much life has improved with jit. wingo: but you can look at the configuration in https://github.com/ecraven/r7rs-benchmarks/blob/master/bench fwiw wingo: https://github.com/ecraven/r7rs-benchmarks/blob/master/bench#L370 rgherdt: hmm, I also didn't try to run the benchmarks, I can give it a try with the r7rs egg. Anyway congratulations for the amazing work davexunit: I ran my sprite rendering stress test with 2.9.6. 27k non-rotated sprites with linear motion rendering at 60fps on average on a thinkpad x1. davexunit: very happy with that. davexunit: I wish I had kept records of previous releases, but I didn't. davexunit: but I can say that going from no jit to jit improved performance immensely, and most pre-releases show small gains. jcowan: An OKVS would be an excellent modern substrate for a Codasyl ("network") database. I've been investigating those lately out of pure historical curiosity, and they have their virtues. ng0: zig: you have a nice redefinition of "small" being 7GB with your wikidata database server :O ng0: i guess for wiki that's small though ecraven: wingo: no time to actually implement it right now, but just to let you know: I'm planning to change the tests so that safe and unsafe are both run and shown, so people can decide what they want to see wingo: cool wingo: :) wingo: i will still need to have tests on the side to make e.g. https://wingolog.org/pub/guile-2.2.6-vs-2.9.7-microbenchmarks.png with error bars, to run it against git snapshots, etc zig: ng0: the whole database is 1.7TB zig: s/database/data/ ng0: oof zig: thanks john for the reference (https://en.wikipedia.org/wiki/CODASYL) ArneBab: wingo: that’s awesome! I’m happy that some one-off comment of mine helped you find this :-) ArneBab: wingo: for a blog post you might want to use a non-logscale axis, because that shows more clearly which speedups people might see in their applications. Also at work my highest impact change to show the higher ups some metrics I created was to byte the bullet and switch to linear scale. It’s less exact but a lot more impressive and easier to understand. bandali: davexunit, is it possible to have `haunt serve -w` terminate with one C-c rather than two? bandali: is that inherent to the underlying guile threads library used in haunt? or something easily configurable? davexunit: bandali: yes, it's possible. davexunit: at the time I didn't know how but I think I need to trap a certain signal bandali: ha i see bandali: do you know where i could learn more? davexunit: the guile manual has a section on signals davexunit: sigaction is the procedure needed bandali: alrighty, will have a look, thanks! davexunit: np bandali: one last question: if i were to send you patches, would your @gnu.org address be okay? or do you prefer another address? davexunit: that one works. it will forward to the proper address. bandali: okay cool, ty davexunit: np! ArneBab: wingo: if you look at the numbers for ack and array1, the changes already put guile in the same ballpark as racket and chez ArneBab: in the tests of ecraven as they are (unsafe?) wingo: i don't think racket does unsafe optimizations wingo: so wingo: civodul: wdyt about a 2.9.7 on 13 dec; it would have been next friday but holidays. then 2.9.8 two weeks from next friday (3 jan). then 3.0.0 on 17 jan kernigh: Hello, does my IRC work? bandali: hey kernigh, yup; message received here kernigh: Thank you. Didn't get a "cannot send" error like I got a moment ago. bandali: cheers :) kernigh: I'm looking for help with Guile 2.2.6 on 32-bit-big-endian kernigh: The files in prebuilt/32-bit-big-endian are broken, kernigh: cause a core dump while building the source code. kernigh: I got it to work by moving those files away, kernigh: but the "bootstrap" part of the build is very slow. kernigh: Suspect that the prebuilt files are from a little-endian machine kernigh: but system/vm/assembler.scm might be missing a byte-swap. bandali: i'm personally not knowledgeable about that, so unfortunately i won't be able to help bandali: but if you don't hear from the others, feel free to write to one of the guile mailing lists kernigh: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26854 looks like the same bug. kernigh: It says to email 26584 AT debbugs... so I'm writing a mail now. bandali: alrighty :) your email will show up as a reply to that thread/bug report civodul: wingo: sure, why not civodul: i'd like to make sure i can recheck the issues i found out with Guix ArneBab: wingo: is there something additional that Mark sees as required feature for 3.0? sakirious: Heya, I'm trying to get into using Guile from Common Lisp. I wanted to ask if there was any QuickLisp alternative or a standard method of managing libraries for the Guile environment? johnjay: sakirious: i have no idea. i also want to get into guile johnjay: right now i'm git cloning it i think. sakirious: Ah. I had thought about dropping the libraries in my working directory and building that way, but it seemed unpleasant. johnjay: i'm trying to get guilemacs up and running. emacswiki don't let me down johnjay: so what kind of stuff did you do in CL? zig: sakirious: that is guix johnjay: hrm. johnjay: i guess i just realized these instructions are saying to download and compile guile first johnjay: then to clone a repo that has "emacs" in it johnjay: i already have guile-2.2 in my apt-get install though johnjay: do i still need to compile guile directly? johnjay: here's the instructions i'm following: https://www.emacswiki.org/emacs/GuileEmacsBuild wingo: moin lloda: johnjay: you need to git clone b/c that's where the wip-elisp branch is lloda: iiu what you mean manumanumanu: Hello people! zig: hello manumanumanu manumanumanu: What a wonderful day! zig: ... to hack with guile :) manumanumanu: I am finished porting tests to the guile "test-lib", and now I will just have to rewrite the srfi-171-document in texinfo and I can submit a patch to guile :D manumanumanu: Writing texinfo is about as fun as eating cardboard, so I might go out and do some gardening before manumanumanu: it is finally dropping so far below 0 so that I will have to harvest the last of my carrots and other roots. manumanumanu: I just don't know what to do with them. I thing we have at least 50 kg still in the ground! nalkri: Soup nalkri: Quite a lot of soup lloda: wingo: I don't understand how I should do this, replace doesn't work either :-\ lloda: https://paste.debian.net/1120466/ lloda: accepting the warning seems to be the only solution lloda: the warning with #:export I mean wingo: lloda: #:re-export-and-replace wingo: new in 2.9.6 lloda: O_o lloda: I should have read the NEWS! lloda: thx wingo wingo: :) jmercouris: hi guys, I'm trying to compile guile-lib jmercouris: here is what happens: http://dpaste.com/2Q7GXRH jmercouris: it also happens with other libraries that I get the exact same error jmercouris: Error: ice-9/boot-9.scm:752:25: In procedure dispatch-exception: no code for module (unit-test) jmercouris: No idea what this means, any help or guidance would be greatly appreciatd! jmercouris: s/appreciatd/appreciated civodul: hi jmercouris! civodul: s/guys/people/ :-) civodul: the (unit-test) module is provided by guile-lib civodul: and here the error means it isn't found civodul: could it be that your guile-lib installation is not in $GUILE_LOAD_PATH? jmercouris: civodul: guys means people in the MidWest, please see a regional map for usage of ya'll, guys, etc jmercouris: let me try setting the $GUILE_LOAD_PATH jmercouris: civodul: please see this map: https://www.dailymail.co.uk/news/article-2336660/Yall-you-guys-Dialect-maps-showcase-Americas-linguistic-divides.html jmercouris: nobody says 'people', guys is assumed to be gender neutral, a group of women is often called guys jmercouris: anyways, I digress jmercouris: so I've now set it: echo $GUILE_LOAD_PATH -> /Users/jmercouris/Source/Lisp jmercouris: pwd -> /Users/jmercouris/Source/Lisp/guile-lib jmercouris: same exact erorr, perhaps cache needs to be cleaned? jmercouris: ok, just deleted ~/.cache/guile, unfortunately the same error :'( jmercouris: I also haven't found anything very enlightening in the INSTALL file johnjay: let's see, i have libjpeg-dev installed but configure hasn't found it. johnjay: suggestions? str1ngs: jmercouris: you may need to set GUILE_LOAD_COMPILED_PATH as well jmercouris: str1ngs: OK, I will give that a try, one moment please str1ngs: jmercouris: /Users/jmercouris/Source/Lisp does not seem right. search the install prefix for unit-test.go and unit-test.scm jmercouris: str1ngs: that's the directory that I've download guile-lib to. I only have Guile installed, nothing else str1ngs: jmercouris: you did not build guile-lib then? jmercouris: str1ngs: no, I am trying to build it str1ngs: use the GNU three finger salute method. ./confgure && make && make install . :) jmercouris: str1ngs: but that's what happens when I run ./configure and make! jmercouris: I will post the output of the above, one second str1ngs: right but ./configure with default to /usr/local and make install will install to there. jmercouris: str1ngs: http://dpaste.com/0ZZJQWT jmercouris: so when I specify a standard ./configure I get the warning messages jmercouris: for sitedir and siteccachedir str1ngs: you are using --prefix=/opt/local? jmercouris: str1ngs: that is correct jmercouris: which guile -> /opt/local/bin/guile str1ngs: did you install guile by hand? jmercouris: no, I installed it via my package manager, MacPorts str1ngs: try with ./configure --prefix=/opt/local. and see if the error continues str1ngs: also what version for guile-lib is this? str1ngs: of* johnjay: this is the result of my configure. is this somewhat typical? https://paste.ubuntu.com/p/3JgjVPDJjP/ str1ngs: johnjay: for graphical emacs yes it looks okay johnjay: ok. not finding libjpeg and some other stuff seemed odd to me str1ngs: johnjay: though emacs should give a summary on cconfigure jmercouris: str1ngs: the version of guile-lib is: 0.2.5.1 jmercouris: str1ngs: sorry, 0.2.6 str1ngs: jmercouris: okay, did you try setting the prefix flag? jmercouris: str1ngs: yes jmercouris: str1ngs: same exact error johnjay: str1ngs: ok. i'm a little uneasy at it being called "emacs" and not guile-macs or something else johnjay: i accidentally overwrote my actual emacs source tree str1ngs: johnjay: do you actually need jpeg suport? johnjay: no. i don't think so. i'm just trying to test guile-emacs johnjay: i thought it odd because i have libjpeg and it says version 8c str1ngs: oh this is the guile-emacs branch? johnjay: i sudo apt installed guile-2.2-{dev,libs} then tried to configure guile emacs johnjay: right... johnjay: i'm following the wiki: https://www.emacswiki.org/emacs/GuileEmacsBuild str1ngs: you may be interested also in nomad a emacs like web browser using guile jmercouris: or you might be interested in Next, an emacs like web browser with a language that is good str1ngs: that's a shamless plug considering I'm the author :) jmercouris: that's a shameless plug considering I'm one of the authors :) jmercouris: str1ngs: it is nice to finally meet you! Ambrevar has spoken about you str1ngs: hello :) jmercouris: he has said very good things str1ngs: I've been working on making QT use-able from both next and nomad without RPC johnjay: str1ngs: is your emacs like web browser perfect? jmercouris: str1ngs: that's precisely why we are having this conversation actually :-) str1ngs: johnjay: no software is perfect. :P jmercouris: str1ngs: I'm trying to use gobject introspection to bind to Qt str1ngs: jmercouris: https://github.com/mrosset/giqt jmercouris: str1ngs: how ever in order to run GiQt, https://github.com/mrosset/giqt, I need to actually get some of this stuff to run jmercouris: str1ngs: exactly, yes str1ngs: oh haha str1ngs: I'm the author of that to jmercouris: Aha! jmercouris: I didn't know you were the same person str1ngs: in guile what is the output of %load-path johnjay: str1ngs: i was trying to make a star trek joke there jmercouris: one second please str1ngs: jmercouris: see https://github.com/mrosset/giqt/tree/master/examples for the sbcl example aka lisp str1ngs: johnjay: oh sorry went over my head :( johnjay: let's see, make failed with undefined reference to scm_intern johnjay: https://paste.ubuntu.com/p/T8PBzdtpm2/ jmercouris: str1ngs: http://dpaste.com/0ZT6FA4 str1ngs: johnjay: maybe this uses an older version of guile? johnjay: i don't know. i have guile-2.2-dev and libs installed johnjay: maybe i should go with the guide and manually compile like it said? str1ngs: jmercouris: I think ./configure --prefix=/opt/local && make install should resolve this jmercouris: str1ngs: I will try once more for posterity :-D johnjay: i sudo apt-geted guile stuff then went directly to trying to compile guile macs str1ngs: jmercouris: and I think guile-lib git master has better support for guile-site jmercouris: str1ngs: same thing :-( jmercouris: str1ngs: do you have a link to the repository? str1ngs: jmercouris: first try with ./configure --guile-site=yes --prefix=/opt/local jmercouris: ok, one second str1ngs: jmercouris: btw giqt has only been tested on linux so far str1ngs: theoretically it should work on macos though str1ngs: also there is #nomad-browser jmercouris: str1ngs: bindings generated in Linux would work on a macOS system? johnjay: str1ngs: is working with Qt that hard? str1ngs: this is more complex then just binginds. this is use GI. but I'm pretty sure this is useable jmercouris: str1ngs: configure: error: unrecognized option: `--guile-site=yes' jmercouris: I do have --with-guile-site str1ngs: did you download guile-lib here http://download.savannah.nongnu.org/releases/guile-lib/guile-lib-0.2.6.tar.gz ? str1ngs: jmercouris: I think maybe it's better to use the git repo jmercouris: I did donwload it from there jmercouris: I'll clone it now and see if that makes a difference lloda: daviid might be able to help jmercouris: str1ngs: just out of curiosity, would it be possible to rewrite giqt in CL? is there something special about scheme that makes it necessary to use? str1ngs: giqt is not written in in scheme. it's written in C and C++. it allows gi bindings to scheme and common use giqt str1ngs: or python for that matter str1ngs: see the examples in https://github.com/mrosset/giqt/tree/master/examples jmercouris: I guess I don't fully understand what I am doing then str1ngs: basically giqt is a typelib library jmercouris: something like swag for ffi? str1ngs: this is better the swag, since it introspection at runtime. not generated by some declaration file johnjay: erm. i'm totally lost, where should i look for result of compiling guile? jmercouris: I'm just trying to get a metaphor here so I understand :-) str1ngs: jmercouris: GI is like glib FFI jmercouris: Right jmercouris: so, in a most practical sense, how would I use giqt? jmercouris: because now I am wholly confused :D str1ngs: see the exmamples jmercouris: I've seen them jmercouris: I understand the CL one str1ngs: in the context of next https://github.com/mrosset/giqt/blob/master/examples/hello.lisp.in jmercouris: what I don't understand is this, should I be able to just fire up the CL example, and it will work? str1ngs: basically qiqt provides the same API ask GTK but for QT str1ngs: yes you can do. make run-lisp and should work str1ngs: but this is highly alpha, and there is many moving parts expect some issues :) jmercouris: I'm going to try loading the code directly jmercouris: one moment please str1ngs: np str1ngs: also I use quicklisp which is a hack to install cl-gobject-introspection. str1ngs: https://github.com/mrosset/giqt/blob/master/examples/hello.lisp.in#L22 str1ngs: I don't actually use CL so any improvements in the examples is appreciated str1ngs: also there is #nomad-browser since this might be OT jmercouris: str1ngs: ok, I'll join there johnjay: what would undefined references to scm_intern, scm_find_symbol, and scm_obarray_for_each mean? str1ngs: johnjay: when it's linking it cant' find those functions johnjay: this is all in lread.o johnjay: when i try running guile itself it says Uncaught exception: johnjay: Throw to key misc-error with args ("primitive-load-path" "Unable to find file ~S in load path" ("ice-9/boot-9") #f)Threads explicit registering is not previously enabled RhodiumToad: what version of guile? RhodiumToad: I believe scm_intern is deprecated johnjay: whatever was downloaded with the command i used johnjay: https://www.emacswiki.org/emacs/GuileEmacsBuild johnjay: ^i'm trying to follow this guide RhodiumToad: deprecated and removed, apparently johnjay: to be clear i have the guile-2.2 from my repo installed johnjay: i have NOT yet installed the version i downloaded johnjay: so i tried first to compile emacs with the guile-2.2 from ubuntu binary johnjay: which file should I check for the version? johnjay: i checked README and it said guile2.0 johnjay: everything in libguile says 2.2 so i think i'm good zig: johnjay: 2.2 is not 2.0 johnjay: well i went to the guile page and it had the same git clone command johnjay: so i'm confident it's the latest 3.0 prerelease ng0: whoever maintains guile-json: i don't think a plain dump of the git log is a good Changelog format. johnjay: i'm recloning now but i still need to build it johnjay: so hopefully somebody who knows that can help me out later when it finishes jcowan: Young woman: "Of course a group of women can be called 'guys'. Even guys do that!" johnjay: jcowan: you wouldn't happen to know how to compile guile emacs would you? johnjay: right now i'm planning to blindly configure and make and hope it works somehow johnjay: i typed make -j3 even though idk if that even matters jcowan: johnjay: I don't use Emacs except very occasionally, so no johnjay: there's an emacs subdirectory in guile so i'm hopeful johnjay: the reason i asked you about making userland apps in chicken before johnjay: was i was curious what would be the best lispy platform for a new emacs johnjay: if one were to do it in scheme would it matter which scheme was used a great deal? johnjay: guile has posix threads i understand as well jcowan: Chicken has Posix threads, but you can't run Scheme in them because of what Chicken does to the stack. jcowan: I guess it depends on how much compute-bound code is actually being executed ZombieChicken: Are you talking about a new emacs that can run current emacs code? daviid: str1ngs: did jmercouris solved his/her guile-lib installation problem? daviid: asking you because he/she left, and it's not clear from the log ... daviid: i should improve the guile-lb web pages, the download page doesn't provide anything about how to install, where the developers page does ... oh well johnjay: ZombieChicken: that is what guile emacs is i believe johnjay: that's what i'm trying to investigate at any rate johnjay: daviid: do you know how to build emacs with guile? the README doesn't say how johnjay: and the instructions on emacswiki are 5 years old and possibly not valid johnjay: https://www.emacswiki.org/emacs/GuileEmacs johnjay: hrm. i think the emacs folder is not emacs. it's just a few el files to use with guile mode str1ngs: daviid: he's trying to avoid guile-lib altogether. it's not actually a hard requirement for giqt but I use it for unit-testing daviid: sneek: later tell jmercouris you need th pass an additional when you want to install the source modules in the guile's tree, like this ./configure --prefix=/opt --with-guile-site=yes - these options are displayed at te end of the configure step, as well as the list of path related variables, so you have a way to know exactly where things are indeed installed ... sneek: Will do. daviid: guile-lib is fine daviid: and very easy to install str1ngs: daviid: I already explained the --with-guile-site. but he only wants to use the sbcl portion of giqt daviid: sneek: later tell jmercouris you should grab the latest tarball guile-lib-0.2.6.1.tar.gz which enhanced these configure display messages at the end of the configure step sneek: Okay. str1ngs: I suggested using git since I know it had the enhanced output I was not sure if 2.6.1 had it or not daviid: str1ngs: ok, jut to make ure, it is --with-guile-site=yes, just --with-guile-site won't work str1ngs: right, I mentioned that. he had not actually run make install either. daviid: str1ngs: oh ok, yes from the source is fine of course str1ngs: that's good to know for next time. I though 2.6.1 had it but I was not 100% sure str1ngs: turns out he might not need guile-lib since I have a sbcl gtk example for hit that does not use guile-lib daviid: str1ngs: ah ok when in this case of course guile won't find the guile-lib modules, unless using ./pre-inst-env ... str1ngs: right, the user dislikes guile which is not helping the issue str1ngs: giqt is a joint guile sbcl project. so I have tests in guile and sbcl . and they are kinda required for my on sanity daviid: why sbcl? does sbcl doesn't have a qt binding? *: daviid thinks sbcl has all the bindings in the world :), just like python str1ngs: the sbcl is using cl-gobject-introspeciton fot access the giqt typelib which provides bindings for QT str1ngs: it's a way for nomad and next browser to share common code str1ngs: thanks to g-golf of course daviid: ok str1ngs: I don't know much about sbcl if it has native QT bindings str1ngs: currently next is use a client server model with RPC daviid: wrt g-golf, i pushed a few doc enhancement patches, i should work more on this today, then get back to signals str1ngs: I saw that. I do get a gettext error on that btw daviid: gettext error? str1ngs: yes once sec I'll post the error str1ngs: err texinfo error I meant str1ngs: specifically makeinfo ./api-hl-api-import.texi:141: unmatched `@end deffn' str1ngs: but I wanted to verified I get the error with debian before I did a report daviid: oh, i get here to, i mst have been very tired, it was early in the morning after a nght work ... let me fix str1ngs: ah good, saves me checking on debian str1ngs: I still get the GI GTK errors with make check (process:6317): GLib-GObject-CRITICAL **: 14:08:42.485: g_param_spec_pool_lookup: assertion 'pool != NULL' failed str1ngs: but only on guix so I can't report anything quite yet on that sorry str1ngs: something in Running test case: test-g-property-accessor str1ngs: also (process:6317): GLib-GObject-WARNING **: 14:08:42.480: g_object_get_is_valid_property: object class 'ClutterGridLayout' has no property named 'orientation' str1ngs: daviid one that that will help the tests is adding export G_DEBUG="fatal-warnings" to pre-inst-env str1ngs: since this will make the test faile right away. or in bash env daviid: str1ngs: pushed a fix for the texinfo bug daviid: wait, savannah not responding str1ngs: thanks I can then now keep my g-golf.scm declaration on tip again. daviid: ok, the push went through .. ypu may pull daviid: str1ngs: make check works fine here str1ngs: ok thanks, hopefully I can resolve this guix issue sooner than later daviid: no idea why you get those johnjay: str1ngs: are you using Guix right now? daviid: i would never, unless a mistake/bug on my side of course, push something if make check fails str1ngs: johnjay: yes johnjay: and you can install emacs with guile from the guix package manager? str1ngs: johnjay: oh no, last I check emacs with guile it had bit rotted johnjay: well. i thought maybe if i downloaded and installed Guix in a virtual machine maybe i could get guile emacs that way str1ngs: personally I think using guile for emacs elisp would be a great. but elisp/emacs users/developers dont' want that I think daviid: str1ngs: do you also have a debian version or only guix? daviid: debian system i mean str1ngs: I preffer to develop with only autotools . but nomad target audience is mainly guix users so I keep package declarations daviid: str1ngs: https://developer.gnome.org/clutter/stable/ClutterGridLayout.html in the Properties section, 'orientation' ... str1ngs: I don't think it a problem with clutter but property introspection str1ngs: and definitely guix related for some reason str1ngs: when I bisected the issue seems to be introduced with inheritance daviid: str1ngs: https://paste.debian.net/1120574/ str1ngs: daviid: 79024e29967aaa33e632c1a356fecc999185b3a5 is the last working commit str1ngs: and 3d755ec3c51e07b19c3a4b8b420c89482d87d14c is the first failing commit daviid: str1ngs: I think that you should target all distros, and hence develop on a debian system 'first', make sure nomad works there only using the autotool chain, then make the guix package available for your users of course ... str1ngs: daviid: right thats how I primarily develop with autotools first johnjay: hmm, i think virtualbox just crashed. or the Guix installer did daviid: but you do that on guix, i wouldn't do that str1ngs: no I have package declarations for guix daviid: str1ngs: i don't quite follow daviid: does it work on your debia system then? str1ngs: right it works on debain and ubuntu as I mentioned str1ngs: I'm trying to isolate what the issue is for guix daviid: ah ok, fair enough then, i have no idea str1ngs: I'll figure it out eventually. sorry for the noise. I though maybe it might ring a bell for you daviid: it surprises me quite a lot that it gve you problems on guix though daviid: chrislck: is it you that has a guix g-golf package def? sneek: daviid, you have 1 message. sneek: daviid, str1ngs says: sound good thanks. daviid: *have daviid: who ever it is, please make it point to the latest master commit ..., tx! daviid: chrislck: wrt your email, i don't think it is feasible to reimplement car and cdr, though in theory it is, you'd still need to parse the data every 'consult' and won't be able to use any scheme list functionality ... unpractical imo daviid: chrislck: you should try to use g-golf, which does a prepend reverse as well of course, but it uses both the ffi and GI to get the data (most often gobject subclass instances, in this case you get goops instances) ... daviid: the data conversion is incomplete at the moment (it works for gobject subclass instances though), but extrememly easy to complete, something i will do 'on demand' since i wana work on signals ... but i can extend what misses on demand in // with what ever it is i'm working on ... chrislck: daviid: very little time here; (7;55am) my approach was to define a C struct Pair which has car & cdr, and car points to data, cdr points to rest. daviid: chrislck: see gi-glist->scm and gi-gslist->scm (I see looking at this g-golf still misses their counter part scm->... but that's soething i can provide extremely easily as well ... daviid: daviid: chrislck: yes, but it won't get you 'nowhere', imo chrislck: so, SWIG would expose the opaque struct and we use car/cdr accessors for using the struct. we are hoping for a neater approach. chrislck: gtg daviid: if only to get th car cdr pointer, from scheme, then i'd recommend to use g-golf chrislck: ok thx gtg daviid: chrislck: https://www.gnu.org/software/g-golf/manual/html_node/Doubly_002dLinked-Lists.html#Doubly_002dLinked-Lists and the next section daviid: chrislck: part of the runtime time is consumed by parse-c-struct, whenever i find sometime, after impemeting signals, i'd like to snarf the magical tool civodul wrote for guix and that allow us to compile C struct accesors ... that is a winner and should find its way to guile core imo daviid: chrislck: here is the guix module that does that https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/syscalls.scm line 184 -> 359, then line 641 for an example of use ... apteryx: I still need to understand how I can input #'something as a literal in a quoted list in Guile (I couldn't workaround it with a string, after all) apteryx: if anyone would know :-) RhodiumToad: not sure I understand the question? apteryx: RhodiumToad: basically, I'm trying to make the following function call: (emacs-batch-eval (format #f "(mapc #'load ~a)" autoloads)) apteryx: rather, this: (emacs-batch-eval `(mapc #'load ,autoloads)) apteryx: and it fails because #'load is expanded to (syntax load) by Guile. RhodiumToad: use (function load) instead? RhodiumToad: (since that's what #'load expands to in elisp) ZombieChicken: This isn't exactly a guile question, but I think it's Close Enough; Is anyone aware of a way to get org-babel to execute code in a REPL via geiser? spk121: RhodiumToad: `(mapc #{#'load}# ,autoloads) str1ngs: daviid: i have updated to the latest hash. if any one needs a guix package declaration. https://github.com/mrosset/giqt/blob/master/guix/giqt/packages/g-golf.scm daviid: str1ngs: ok, thanks. i have to leave now, bbl str1ngs: daviid: there are some issues with g-golf and guix. but I can't repclicate it on on the systems like debian/ubuntu so I'm trying to figure it out on my on for now str1ngs: on other systems* daviid: str1ngs: ok, try to see hose with #guix, unless it is s g-golf proble of course ... daviid: need to go, bbl str1ngs: it's more a GI GTK issue with g-golf and guix. I will try to narrow down the issue and report it str1ngs: but it does not happen on other systems so related to guix only at this time. str1ngs: ttl zig: nomonofu parsed 110 000 000 triples out of 9 000 000 000 triples, that will be a very long process. wingo: moin civodul: 'lo Guilers! zig: o/ wingo: moo RhodiumToad: rlb: that set of fluids tests could probably do with including a test of make-unbound-fluid somewhere nerdypepper: hihi nerdypepper: I had asked about building with readline support, and it turns out it was an issue with the prefix supplied to the "withlibreadline" option. thanks guilers! wingo: nice :) lloda: wingo: another bogus warning I think (?) https://paste.debian.net/1120350/ lloda: this is a1e88ebc124b3f6183d1ff59052d3ba74385716c nvm the tag wingo: lloda: not a bug i think. re-export doesn't mark its bindings as being replacements wingo: to silence the warning you need #:replace, which is only available as a define-module arg lloda: oh thx lloda: I think I've never used #:replace lloda: doc says I can also do (export!) lloda: it feels strange b/c the redef of format is not in the same module, but it's imported lloda: I have to be careful with those core bindings... wingo: yeah it's weird. in the past one module marking a binding as being a replacement would mean that any re-exporter would also propagate that mark on through wingo: but that might not be what you want. like one module might want to re-export raise-exception as raise and mark it as replacement, but another might not lloda: I see. This also fixes the bug I had the other day. civodul: found a funny bug in Guile that would occasionally crash PID 1 (shepherd): https://issues.guix.gnu.org/issue/37757 wingo: nice!! wingo: crashing pid 1 sounds... not nice civodul: yeah, that's when you realize the impact of a misplaced abort/assert :-) civodul: but that gave us a proper crash handler as a side effect, which is good civodul: i hadn't thought about how to get a core dump from PID 1 until now zig: re database work: I read there is several people working in bio info (computer science applied in biology) around, others can help too: I am looking for a dataset to test an "approximate string matching" algorithm, do you know such a dataset that is freely available? zig: At a meetup, last week, a person working biology told me that they work on matching dna sequences in giant repositories and that it was very slow... I happens that I have an algorithm to do exactly that, I would like to test it in a real world scenario. zig: I tried to search the Internet, but it does not give meaningful results. rlb: RhodiumToad: ok, happy to add it -- I need to figure out what the conventions are, haven't committed actual code to guile in a while, i.e. are patch revisions on the list preferred, or followups to the bug tracker, or either... spk121: guile3 will need work to compile with the standard Debian hardening flags rlb: spk121: haven't tried it yet, but thanks for the note. Worst case we can probably just back the flags off until the issues are sorted. rgrinberg: Is there a good example of a guile project with a standard way to setup tests/compilation/dependencies? daviid: rgrinberg: most of us use the (gnu autotool chain, there are numerous guile projects to look at if yu fllow that 'route' daviid: str1ngs: fwiw, I pushed the (new) doc for the 'Closure' high levelAPI, then I merged everythig I did so far to mster as well daviid: I should provide some (new) doc for the g-idle (and friends ) procs, then get back to work on signals ... catonano_: rgrinberg: there' s a project called "guile-hall" it creates a project skeleton for you with building (with tetss for dependencies) and testing.The weak point is when you have to wrap C libraries. It doesn' t support them, you' ll have to edit your config.ac file by hand, in that case catonano_: rgrinberg: the project it prepares for you is based on the autotools. Autoconf supports Guile to some extent and guile-hall leverages that catonano_: rgrinberg: https://gitlab.com/a-sassmannshausen/guile-hall catonano_: rgrinberg: does that help ? wingo: spk121: what hardening flags are those? feel v free to commit any fixes directly btw wingo: something is wrong about in-loop tier-up wingo: i.e. not kicking in like it should wingo: array1 takes 23s with normal GUILE_JIT_THRESHOLD and 6s with GUILE_JIT_THRESHOLD=0 str1ngs: sneek: later tell daviid sound good thanks. sneek: Okay. optima: I want to improve my guile skills for guix, but I can't pin point the use case for guile optima: Because when I look at python, I know it's great for short scripts or glue code optima: C for speed and accuracy optima: But what do I do with guile? rotucer: Achieve enlightenment.. Jk. Guix is good reason on it's own to learn it tbh zig: optima: I am using guile to create a multithread web application that can query wikidata, this is not possible as-is with known Python implementations. zig: in the sense that all Python implementation (except Jython 2.7) have a global interpreter lock, and for my work I need multiple threads. rgrinberg: catonano_ yeah that looks like a good start, thanks. I thought I could avoid autotools though :/ zig: optima: also, if you forgo goops, guile is much simpler that Python (i never used goops so far, 5 years of guile) zig: optima: there is also the fact that guile is lisp, the syntax is a no-brainer. catonano_: rgrinberg: you can avoid them. They are needed only in some cases. If your project wraps a C library AND you want to distribute it. Or if you want to distribute your project in a way that it can be installed for all the users on a system. Otherwise you can keep your source files scattered around and they will be compiled automatically when you use them catonano_: optima: you can use Guile for all the tasks where bash is used. Further Guile can wrap C libraries and access to data structures (without marshalling the output to test and parsing that again every time) catonano_: optima: you could easly do a lsp server or an xmpp node catonano_: optima: you could do something that creates svg files that get visualized by external tools chrislck: #guilers! chrislck: I've just discovered that when guile is called from C, structs are accessible via structname-varname-set structname-varname-get chrislck: Is this a supported API? chrislck: or is it an implementation detail? zig: nomunofu is almost ready. I am trying with a one billion triples. It might take a few days. zig: then guix pack, then something, then profit! zig: ;-) apteryx_: Hello! I'm trying to format an Elisp expr to pass to Emacs, and I can't seem to escape that one: (emacs-batch-eval `(mapc \#'load ,autoloads)) apteryx_: the #' is giving me troubles; Guile expands it to: (mapc #{\#'load}# ("some-file.elc")), for example. apteryx_: any idea? apteryx: basically, can I form a symbol starting by the # key in Scheme? chrislck: '#{#sym}# apteryx: It seems for the use case at hand, it makes more sense to just pre-format the string, as it eventually gets formatted as such apteryx: chrislck: interesting, that's how Guile expands a variable named with \#some-name. How would you later evaluate (refer to) such a variable? civodul: hey there! civodul: wingo: congrats on the 2.9.6 release and associated benchmarks! civodul: the performance difference compared to 2.2 is impressive civodul: the right-hand side of the graph is more intriguing, but hey ;-) rlb: wingo zig: I ended up fixing the earlier compile hang by just switching to a goops wrapper class, i.e. not calling (class-of (future ...)) during compilation to get the class. Thanks for the help. It'd eventually be nice if were available and something you could use in method specializations. rlb: (Might also be nice if threads didn't hang compilation, but not critical.) rlb: wingo: regarding flags -- not sure exactly what spk121 was seeing, but current flags appear to be: rlb: $ dpkg-buildflags --dump rlb: CFLAGS=-g -O2 -fdebug-prefix-map=/home/rlb=. -fstack-protector-strong -Wformat -Werror=format-security rlb: CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 rlb: rlb: via "dpkg-buildflags --dump" rlb: RhodiumToad: filed bug with patch for the thread local fluid-ref problem. Thanks again. dftxbs3e: hey, why does GNU Guile not use all the available threads to compile? dftxbs3e: Only 8 of them are used at 100% even though 24 are available dftxbs3e: GNU Guile spawns 24 threads, but only uses 8 of them wingo: fixed the array1 problem :P wingo: https://wingolog.org/pub/guile-2.2.6-vs-2.9.7-microbenchmarks.png wingo: the mbrot result is... surprising jcowan: I think the slowdowns at the other end are more surprising jcowan: Mandelbrot benefits hugely from compiling away boxing civodul: wingo: i'm sure you precompiled the result of mbrot, didn't you ;-) wingo: i mean that result is top of the leaderboard wingo: 1.9s on this machine, compared to gerbil/gambit getting around 3.3s on ecraven's benchmark rungs. dunno how that is happening wingo: *runs wingo: ah well, outliers. rlb: Huh? Maybe my expectations are wrong? rlb: scheme@(guile-user)> (define foo (make-thread-local-fluid 1)) rlb: scheme@(guile-user)> (fluid-ref foo) rlb: $1 = #f rlb: RhodiumToad: that's quite weird alextee[m]: hi, can someone convince me that guile is better than python? ie, how does guile handle packages and environments? daviid: rlb: (fluid-ref* foo 1) RhodiumToad: that's ... not documented daviid: rlb: i think this is because "fluid created with make-thread-local-fluid won’t be captured by current-dynamic-state and won’t be propagated to new threads" RhodiumToad: I mean fluid-ref* is, but the behavior of make-thread-local-fluid like that is not RhodiumToad: I'm looking at the C code and I can't see why daviid: and 'practically', you will probably use those (any) fluid(s) within the contet of with-fluids, and that works ... RhodiumToad: so fluid-ref first checks a local cache which won't have the value since we just created it RhodiumToad: then it does scm_hashq_ref(dynamic_state->thread_local_values, fluid, SCM_UNDEFINED) RhodiumToad: and that should return SCM_UNDEFINED since the value's not there? (nothing can have added it yet?) RhodiumToad: then it does if (SCM_UNBNDP (val)) val = SCM_I_FLUID_DEFAULT (fluid); RhodiumToad: and I checked that the default value really is in the fluid cell where it should be RhodiumToad: so I literally do not see where the #f is coming from rlb: At least from the docs, I'd have assumed that the dflt provided to make-thread-local-fluid would be the default in all cases where there wasn't an intervening with-fluids, etc. *: RhodiumToad too rlb: otherwise, what's the dflt for? RhodiumToad: and I'd make the same assumption from reading the C code, which means that there's something weird going on that I'm not seeing RhodiumToad: I literally cannot find any code path that results in returning #f daviid: I agree , I just tried 'a bit out of the blue' ... rlb: Well, #f is the default if you don't provide a dflt, I think, so maybe that's at play here. rlb: Anyway, I can work around it, but wondered if I was misunderstanding or should file a bug. RhodiumToad: but that default is set in the make-thread-local-fluid func RhodiumToad: return new_fluid (SCM_UNBNDP (dflt) ? SCM_BOOL_F : dflt, ... rlb: Yeah, you're well ahead of me -- haven't looked at the code yet (2.2.6 here). RhodiumToad: also 2.2.6 here rlb: In any case, thanks for the help wrt sanity checking. RhodiumToad: and I checked by peeking at the fluid with pointer->bytevector that the value 1 was actually in the fluid's cell rlb: And it was, I take it? RhodiumToad: yes RhodiumToad: also if it wasn't, then (fluid-ref* foo 1) wouldn't have worked rlb: hmm, noidea -- perhaps a bug then? RhodiumToad: hm. rlb: If so, should be easy to add a test once we track it down. RhodiumToad: AHHH RhodiumToad: I see it RhodiumToad: I would call it a bug RhodiumToad: here's why it happens RhodiumToad: when fluid-ref fails to find the value in the cache, it looks for it in the thread_local_values hashtable RhodiumToad: which it accesses with scm_hashq_ref(dynamic_state->thread_local_values, fluid, SCM_UNDEFINED) as I mentioned above RhodiumToad: but passing SCM_UNDEFINED as the third value there makes scm_hashq_ref think that no default was supplied, so it substitutes #f RhodiumToad: I think the more correct way would be to do RhodiumToad: scm_hashq_ref(dynamic_state->thread_local_values, fluid, SCM_I_FLUID_DEFAULT (fluid)) RhodiumToad: or use scm_hash_fn_ref but that's a bit uglier RhodiumToad: looking at the git repo, this hasn't been fixed RhodiumToad: hm, even that only works because you can't make an unbound thread-local fluid rlb: RhodiumToad: ok, so if it still seems like a bug would you like to file one, or should I? RhodiumToad: please do, you can include my analysis above rlb: Sounds good -- I'll try to get to that tomorrow. Thanks for the help. RhodiumToad: yw daviid: I wonder what the test-suite checks about this, didn't have time to look at it ... RhodiumToad: there are no tests for thread-local fluids rlb: And regarding the (future 1) call at the top-level problem (locks up compilation), I just worked around it by creating an actual goops wrapper class around the scheme future (which is acceptable for now in the case I care about), but it'd be nice if we eventually have a sensible way to specialize goops methods on futures. RhodiumToad: there's a test that normal fluids have thread-local values, that seems to be all rlb: mooooore tests... *: rlb likely wanders off for a bit RhodiumToad: looking at the code, the bug appears to be primordial, dating from the addition of thread-local fluids zig: alextee[m]: Guile does not have GIL :) RhodiumToad: I suspect python has better libraries *: RhodiumToad does not do python rgrinberg: How does goto definition work in geiser? Does it send a command to guile to get the location of a symbol? rgrinberg: I see this lookup-procedure function, but I can't its definition anywhere zig: btw there is https://github.com/Johni0702/guile-language-server zig: not tested tho zig: and wip johnjay: can i embed guile into any old C app and get a bunch of libraries to use for stuff? str1ngs: johnjay: you can embed guile into C programs yes. I don't understand the libraries question though. johnjay: i saw a talk on youtube about how guile had a bunch of libraries for things johnjay: you know, xml, networking, databases, parsing regular expressions, etc johnjay: i'm saying, if i embed guile do i get a bunch of stuff like that for free? str1ngs: right, if you embed guile into a C program. then you can call any guile scheme code from C str1ngs: there are some caveats though like threads and memory management mainly on the C side of things mind you. johnjay: right johnjay: i thought about doing a project to try it out. johnjay: i just wondered what my expectations should be str1ngs: I would only use C if there is a very good reason for it. johnjay: well i have projects in C already johnjay: so that's why i want to test it str1ngs: that makes sense then johnjay: is guile like for c++ or something only? str1ngs: guile only has a C interface. but you can use it with C++ johnjay: ok. the only concrete example I can think of what i want is gimp johnjay: where you can script things in scheme johnjay: is guile scheme involved with Guix too? i thought i read that str1ngs: use guix uses guile scheme str1ngs: yes* johnjay: ok coool. johnjay: *cool johnjay: there's a lot of other schemes so i just wanted to look for reasons to try guile ArneBab: alextee[m]: for my argumentation, see http://draketo.de/py2guile — it stayed the same the past 4 years, though I now have more refined solution in Guile. ArneBab: … and though Python adding async and await as keywords broke some an old Python codebase I maintain (but did not write) alextee[m]: ArneBab: interesting read, thanks! ArneBab: the full pdf is available for free: http://draketo.de/proj/py2guile/py2guile.pdf (as nagware — to get rid of the "please buy me" pages, just build it yourself after removing the part which includes nagware) bandali: ArneBab, hey, can i /msg you with a quick question? ArneBab: sure bandali: thanks rlb: johnjay: fwiw, make and gdb can now also be built with guile support, though I haven't used it in either much yet. johnjay: rlb: how would you use guile in make? str1ngs: johnjay: for C or for compiling scheme byte code? str1ngs: or maybe you meant guile support in make? johnjay: yes. make kinda just does one thing so idk how you could extend it str1ngs: it depends on what you are trying to do johnjay . build a C program with guile support, build scheme byte code. or use guile for make recipes rlb: In both those cases, it's used for extension. rlb: e.g. https://www.gnu.org/software/make/manual/html_node/Guile-Example.html#Guile-Example rlb: I don't know the other, current schemes all that well, but I'd say that Guile's quite good if/when you need to integrate with C or C libraries, or if you think you might eventually want to use C for performance critical parts, as is often done in python, but unlike python, guile has (more serious) threading support, and I suspect better performance. As compared to say the jvm (perhaps for example clojure), guile is much lighter-weight rlb: (than the jvm, though that's gotten better these days), much better startup time, and good support for *nix apis (including for example filesystem sockets). rlb: ...but I suspect guile doesn't currently have nearly the breadth of "easily accessible" extension libraries like python and say clojure do (and maybe the other schemes). rlb: s/like/that/ ArneBab: johnjay: I used guile in make to get its string handling when doing the same with shell functionality got too annoying. zig: does anybody, by any chance, has multithread based web server implementation around? zig: also it should pass to the handler the client port :) zig: I want to do a quick project, I have all the pieces except that webserver, to be feature complete. rlb: zig: I imagine you've seen this? (don't know offhand if it's threaded) https://www.gnu.org/software/make/manual/html_node/Guile-Example.html#Guile-Example spk121: hi rlb: (And the section after that has examples.) rlb: zig: wait, that was the wrong link... https://www.gnu.org/software/guile/manual/html_node/Web-Server.html#Web-Server zig: rlb: I saw that, thanks. Actually, it not very difficult to hack together multithread server using the code from (web http), I mean got some thing together, will see if it works. johnjay: ArneBab: ah ok so you changed the way make functioned directly soda__hobart: what do I do if I get an unbound variable error because it says a module binding overrides a guile binding? soda__hobart: I tried using the #:select and #:prefix keyword args with (use-modules) to assign a namespace prefix to resolve the problem,but then I get an error saying that the module doesn't have that binding :| rlb: Think I'd have to know more about the context -- e.g. is it complaining about a (define foo ...) in your module when you've already imported a foo from somewhere else, or...? soda__hobart: I get `WARNING: (guile-user): `quit' imported from both (guile) and (redis)` and then I get a the resolve-variable procedure throws an unbound variable error. rlb: Hmm, not sure if you've tried this, but in general, I tend to always use select these days, and so I'd probably ((redis) select: (...)) omitting quit if I didn't need it, or renaming it if I did, i.e. ((redis) select: (... (quit . redis-quit) ...)) or similar. rlb: i.e. clojure convinced me to generally name all my imports -- it's wordier, no doubt, but it's a lot easier to track things down when I come along mater. rlb: (or if I'm looking at unfamiliar code) soda__hobart: so that's the thing, I did that, but I got: `no binding `quit' in module (redis)` soda__hobart: I'm down with naming all the imports, I think that's a good practice in general rlb: Hmm, that makes me suspicious -- have you tried narrowing it down to a really small test example? rlb: e.g. rlb: say just a single file containing something like this: soda__hobart: yeah, it's so weird. I've been working on this project for a few weeks and have not encountered this problem before. If I just go in the REPL and do (use-modules (redis)), everything works fine. rlb: (define-module huh rlb: #:use-module ((redis) #:select (quit . something-else))) rlb: (display something-else) (newline) rlb: rlb: And then run it with guile -s foo.scm rlb: plus or minus a suitable GUILE_LOAD_PATH=... guile -s foo.scm rlb: If that works, then likely something else in your actual file is interfering... soda__hobart: yeah, did that, no luck rlb: so that simple example crashes too? soda__hobart: yeah. I was trying to define a module earlier, but then stopped making changes to that file. Could that have anything to do with it? rlb: Well, every now and then I'll apply the sledgehammer "just to be sure", i.e. here "rm -rf ~/.cache/guile/ccache/2.2-LE-8-3.A/home/rlb/whatever/dir/im/working/in" rlb: i.e. to make sure some cached bits aren't causing trouble (and force all the macros to be recompiled) soda__hobart: I'll try that. I've never made a module before, so I probably screwed something up with some haphazard calls to (define-public) and (define-module) rlb: but I'd guess that's not going to help here, if I had to guess. rlb: was the error on the trivial foo.scm the same as the one with your normal file, I guess? rlb: And is there any chance the load-path is different between the case you care about and the case in the repl where it "works"? rlb: i.e. maybe you have a broken redis in one case... soda__hobart: yeah the trivial error is the same one as on the normal file (which is still pretty trivial, haha) rlb: oh, and if it *were* the cached files somehow, you'd of course need to clobber all of them that matter, i.e. the ones for redis too, if that's in some other tree. rlb: You can compare the load-paths by printing %load-path in both cases if you like. rlb: fwiw zig: seems like I have the pices for my guile plan of the week end }:) zig: all the pieces soda__hobart: hm well maybe I'll restart the computer, maybe reinstall these modules ArneBab: johnjay: no, I just used guile in a rule ArneBab: via $(guile …) zig: I got brilliant idea for few days worth project, see https://github.com/amirouche/nomunofu zig: the server is written in guile :) zig: ahah! jcowan: Nice. You might want to ship it in a container zig: jcowan: that is what I was thinking, guix pack --format=docker zig: or something. daviid: zig: why don't you push your idea(s) on sourcehut instead ... and definitely close your github account ... for a good 2020 start :) zig: that is an idea, I am thinking about a lot. But honestly I can not close my github account for the time being... jcowan: I have no desire to leave Github, as part of my stuff is still on Bitbucket ArneBab: I have a strong desire to leave both bitbucket (kills hg) and github (m$) … ArneBab: But I wish I could automate changing every single BitBucket URL … ArneBab: I used them because I thought "it’s a profitable company, repositories there will persist". Ha… alextee[m]: i use cgit and mirror my stuff on github/gitlab/framagit etc alextee[m]: it's very easy to mirror stuff with crontab and a git --mirror ArneBab: does this still apply if it has to continue working without major maintenance for 10 years? zig: there is software heritage for that, no? ArneBab: can I throw them links to repositories to ask them to keep them available? zig: IDK ArneBab: same for me … zig: they partenered with github also zig: I hope they support source hut or will. ArneBab: yes daviid: be careful with github and other 'such' companies, always prefer those association/ong ... like sourcehut, that strictly respect the fundamental human rights, such as privacy, zero tracking ... not to mention the danger that of all of sudden, 'they' apply some of their terrible clauses of their unacceptable contract(s) ... these compamies can die/disapear, the sooner the better ... ArneBab: what I also like about sr.ht is that I can easily pay for an account ArneBab: … just need to get to doing it … ArneBab: … or not. No credit card … daviid: ArneBab: send an email or ask how you can acheive a payement on #sr.ht (freenode, ddevault is the author) jcowan: ArneBab: I'm using githgmirror.com to mirror my BitBucket hg repos on Github, so when the time comes I just switch. jcowan: It's a free service you just set up. daviid: nothing is free with these bad companies, that's an illusion jcowan: The vast majority of all companies are honest and ethical, and there is no shortage of crooks in the nonprofit sector. daviid: in my experience, the vast majority of all companies everywhere in the world, are unhonest and unethical jcowan: That's as much as to say that the people who make them up are. And if that were so, business would be impossible. "Trust, but verify" daviid: you can't trust any company anywhere in the world jcowan: I presume then that you have taken the precaution of acquiring modern weapons, including artillery and missiles? zig: I was foolish to say that is a couple of days of work. zig: As usual. jcowan: How to estimate: Take your best shot, double it, and move up to the next higher unit of time. jcowan: Thus 1 day = 2 weeks. zig: ^^ daviid: 'artillery and missiles' are a 'corporate/cmpany' terrible vocabulary, but if I had to quote you, then I'd say my 'artillery and missiles' are free s/w and education jcowan: What good are those if you can't trust your neighbors not to attack you, steal from you, or cheat you, since they are so corrupt and unethical? ArneBab: jcowan: I don’t want to go to go to github ArneBab: jcowan: but I just discovered https://hg.sr.ht/~sircmpwn/invertbucket ArneBab: and am trying to add "if name not allowed, prompt for new name" daviid: I'am sorry to hear that you have neighbours that threaten you that much, I don't have this problem, but then I teach them what free s/w, to use free s/w and why ... and offer to also educate their children, then they thank me ... daviid: anyway, back to hack spk121: I like github. I do put the release source tarballs on a javascript-free personal site, though, for people that worry about that sort of thing. Although that non-github, non-javascript website is hosted by GoDaddy over the AT&T backbone zig: (maybe it will be ready for 2020-01-01) jcowan: daviid: Of course I don't, and probably neither do you. But if the companies are Evil, their employees are servants or masters of Evil, and that includes your neighbors. But you're right: enough of this. bandali: hey folks, anyone know how i could access a post's metadata in footer, when using haunt? bandali: (i.e. in my site #:layout) bandali: i'd like to have different license years per posts/pages daviid: str1ngs: I pushed a series of patches, code, doc and tests, so g-golf can import namespace constants (on demand, see %g-priorities in (g-golf hl-api glib) for ane example, then added this optional argument T was refering to, to g-idle-add, g-timeout-add, g-timeout-add-seconds and g-unix-fd-add sneek: Welcome back daviid, you have 1 message. sneek: daviid, str1ngs says: looks good thanks. rlb: Any thoughts about what might cause (begin-thread #t) to hang? It doesn't from a prompt, but it does in a case here during a module's compilation (though there are a lot of other moving parts -- but no other intentional threads/concurrency). wingo: rlb: is there forking involved? zig: rlb: did you try to pre-compile all the files before executing your program? zig: rlb: previously my program was crashing because of the module system involved in posix threads zig: I think I figured the bug with my for-each-par-map, I need to manage the job queue, instead of expecting some magic to happen in the channel. lloda: how about we put srfi-1 iota in core and reexport that? the iota in core is incompatible and not documented :-/ bandali: hey rekado, are you around? davidl_: Why can't I use ~/.guix-profile/bin/guile as the shebang for my guile-scripts? Also, using /usr/bin/env guile -s -e main doesn't work either unfortunately. Is this fixable? wingo: ~ doesn't get expanded in shebang lines wingo: (right?) davidl_: wingo: correct, it's perhaps more of a bash/shell issue than a guile one. davidl_: I am using Guix on a foreigh distro, so I don't have /run/current-system/profile/bin/guile and I don't want to hardcode which user's guile-binary to use either; so really Im just looking for some kind of workaround. lloda: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=98252bff643ac05b9fb53f28c25f216f090b2495 lloda: technically an incompatible change I guess b/c the old (iota -9) => () lloda: but still lloda: suite passes and I think it's right for that to be an error as in srfi-1 lloda: wdyt? roelj: I used “dynamic-func” to call the C function. Now I only need to pass it two numbers that were originally defined as #DEFINE macros in C. How does that work? Can I create a bytevector and then bytevector->pointer, and pass a call to dereference-pointer of that pointer to the C function? roelj: Can I just pass it numbers? zig: if the number were original defined as #define, then they are not part of the shared library. zig: you need to copy those number scheme side. roelj: zig: Right, and how do I specify the numbers on the Scheme side? Must it be a bytevector, or can it be just (define number 3)? zig: roelj: it depends on what the function expects as arguments. If it expects some kind for char ** you can use a bytevector, otherwise just pass a scheme integer. zig: s/some kind for/some kind of/ roelj: Alright roelj: thanks zig! zig: yw wingo: lloda: sgtm; please add a NEWS entry tho, and wait to commit until after the release (in progress) lloda: thx wingo, will do. RhodiumToad: roelj: how exactly are you calling the function? roelj: RhodiumToad: First I do: (define my-func (pointer->procedure '* (dynamic-func ...) ...)), and then I call it as (my-func 1 2 3). RhodiumToad: ok. so as the docs say, " arguments and return values from foreign functions are represented as Scheme values." RhodiumToad: you will have to specify the argument type as expected by the C function in the arg types parameter to pointer->procedure lloda: when I call fortran I need to do (bytevector->pointer (s64vector x)) or w/e since all fortran args are pointers roelj: I'm only puzzling now how to pass a pointer to the number. lloda: I think that's what you need RhodiumToad: roelj: how is the C function declared? roelj: RhodiumToad: LDAP_F( int ) ldap_set_option LDAP_P((LDAP *ld, int option, LDAP_CONST void *invalue)); roelj: So number to void* RhodiumToad: so the "option" parameter is not a pointer, and you don't pass it as such RhodiumToad: the "invalue" parameter is a pointer, and what you pass depends on what the option expects? RhodiumToad: ah. I think I see the issue. RhodiumToad: you're trying to pass LDAP_OPT_ON / LDAP_OPT_OFF ? roelj: RhodiumToad: In the source code it indeed handles the type per "option". roelj: RhodiumToad: For the option I want to use it does: int vers = * (const int *) invalue; roelj: RhodiumToad: So I suppose I need to create a signed integer, but how do I know which length? roelj: RhodiumToad: Is it always 32-bit? roelj: And.. How can I determine the endianness? RhodiumToad: you could use make-c-struct to make a struct containing one int, and pass that RhodiumToad: since it so happens that in C, a pointer to a struct is the same thing as a pointer to its first element roelj: RhodiumToad: That's very clever! roelj: So if I want to pass the value 3, I could do: (make-c-struct (list int) (list 3)) ? RhodiumToad: yes roelj: And “make-c-struct” gives a pointer to that struct, so I can just pass the value of (make-c-struct ...) directly to that int* parameter? RhodiumToad: yes roelj: Should I “free” it afterwards? roelj: I guess not :) roelj: RhodiumToad: Thanks a lot! I wouldn't have thought of using make-c-struct myself. Very clever! RhodiumToad: the other way would be to make a one-element bytevector of a type chosen based on (sizeof int) RhodiumToad: more complex, and seems no obvious advantage roelj: SRFI-4 makes it a bit easier.. roelj: But I have more faith in the C struct, because I can understand how that works. lloda: wingo: pushed lloda: oh I'm sorry about the whitespace :-( lloda: I'll fix it lloda: re-pushed wingo: great lloda: I was getting warnings like WARNING: (guile-user): imported module (srfi srfi-1) overrides core binding `iota' even with the #:replace lloda: this fixes it, but I'm not sure why it happened before tbh wingo: humm if that were the concern it could indicate a bug somewhere lloda: well more like the trigger lloda: there are ther :replace'd functions like map for-each etc. lloda: s/ther/other wingo: yes but i was working in that area recently and i need to know if i caused bugs lloda: ooh wingo: i.e. the #:re-export-and-replace things lloda: I'll see if I can get a test case pre-patch wingo: (does guile-devel take a while to deliver? usually not but i changed somemthing about my mail setup that makes it maybe slow) wingo: weird, my messages to guile-devel are taking a while to go thru wingo: anyway, https://wingolog.org/pub/guile-2.2.6-vs-2.9.6-microbenchmarks.png lloda: that's a bit better wingo, but why is Guile slower than 2.0 there? it's just vector-ref vector-set! etc wingo: i looked into that today wingo: just for context, guile 2.9.6 is faster than 2.2.6 in almost all benchmarks. there are about 4 for which it's slower wingo: for array1, the code is here: https://github.com/ecraven/r7rs-benchmarks/blob/master/src/array1.scm wingo: if you look at the generated bytecode, this is a case where we see more instructions in 3.0 vs 2.2 because its instructions are lower-level wingo: 2.2 actually compiles really nice loops for these, for its vm wingo: and one of the instructions is vector-set!, which is something of a macro-instruction wingo: so it effectively benefits from better register allocation, whereas between the more numerous instructions for 3.0 we are always storing to the stack wingo: and then there's an optimization that fails in 3.0; we can't hoist the in-bounds check, because the range inferrer can't say "I don't know what the range of X is but I do know it's always lower than whatever Y is" wingo: if it were a "normal" loop forward to the vector length it would have worked, but it's a loop counting down wingo: but, i don't know exactly what to do there yet lloda: we can fix the benchmark to count upwards :-D lloda: I can see that sophisticated range analysis is a larger task lloda: nested loops etc. as well wingo: i am sure there are textbook approaches that we could just take wingo: there's something called "abcd" that is apparently the thing: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.33.6386&rep=rep1&type=pdf lloda: if you use array map etc. the bound checks are all done outside and aren't necessary lloda: but you cannot tell the xxx-ref function that's the case lloda: so the compiler has to be smarter like that lloda: that's a bit frustrating lloda: that you convert the map to a loop and then the compiler has to figure out that the loop was a map wingo: hehe yeah jonsger: oke, at least the git:// link still works for cloning :) wingo: apparently gnu servers are being hit by a botnet and so everything savannah-related is slow. apparently mail delivery also. bandali: a bunch of others things like debbugs are also down bandali: the fsf sysadmins have been notified lloda: I have a test for the bogus :replace warning wingo jonsger: I know. I'm just happy that there is still a way for fetching :) lloda: https://paste.debian.net/1119787/ lloda: on 2.9.6 before my iota patch wingo: your iota patch removes the export from srfi-1 wingo: right?? lloda: it moves iota from :replace to :re-export wingo: ah i see, cool. wingo: ok so it is a problem with the interfaces made by `import` bandali: debbugs is back *: wingo sent a guile 2.9.6 release mail but it hasn't arrived yet :P bandali: hrm bandali: yeah something's fishy *: chrislck would like to ask for code review..... one inefficiency I see in gnucash is the GList <-> scm_list conversion chrislck: the glib g_list is traversed, building scm_cons cells in reverse and scm_reverse() chrislck: i.e. beautiful but obviously O(2N) chrislck: I'm exploring creating a C struct splitpair_s with car/cdr/nullp chrislck: and instead of C Glist -> SCM list traversal, we traverse these mycons cells in scm chrislck: the question is whether anyone has any example similar code I can peek chrislck: because my attempt (which works well btw) is at https://github.com/christopherlam/gnucash/commit/6ad027cacd chrislck: anyone done anything similar? wingo: lloda: fixed lloda: thx wingo :-) wingo: tx for the report :) lloda: \o/ lloda: While compiling expression: lloda: Warning: Unwind-only stack overflow exception; skipping pre-unwind handler. lloda: this is new wingo: is the stack overflow a bug in guile? wingo: or is it in your code somehow, like in a macro or something lloda: I'm checking it now, it worked before tho lloda: looks like a normal function (?) lloda: I need to revert to make it work, will have to look at it later dsmith-work: Happy Friday, Guilers!! zig: happy friday :) chrislck: happy Friday all zig: I am trying to understand tree-il, in the following snippet: https://paste.gnome.org/phldsvuhn zig: the + lambda I defined in the let, is translated into ((lambda ((name . +)) (lambda-case (((a b) ... I understand the purpose of lambda-case but what is the purpose of (lambda ((name . +)) zig: the s-expr immediatly following `lambda` symbol, is an association list of properties. in the above case it means the 'name of the lambda is the symbol '+ zig: that is explained in the manual. wingo: https://www.gnu.org/software/guile/news/gnu-guile-296-beta-released.html dsmith-work: That graph is for 2.9.5, not 2.9.6? dsmith-work: wingo: ^ wingo: dsmith-work: it's actually 2.9.6 wingo: will fix dsmith-work: Very nice wingo: fixed wingo: it's that thing where you don't autoreconf and it doesn't regen your version :P davidl_: join #jq ArneBab: That’s a pretty nice speedup! Is there something that can be done to fix those 4 slowdowns? rlb: wingo, zig: no explicit forking involved, but maybe that's it i.e. (as a hack) I was trying to get the class of a future so I could use it in a method specialization, i.e. (define (class-of (future #t))) (since it's not normally provided?). And that would be happening at compile time by default. rlb: So potentially not ok to use threads during compilation? (Ignoring for the moment whether or not I should have been attempting what I was attempting.) rlb: (And I'm not even sure that was going to work right -- I seem to recall noticing that record-derived classes might not always play nice with goops.) zig: wasm became w3c recommendation ref: https://www.w3.org/2019/12/pressrelease-wasm-rec.html.en jonsger: where are the logs for test-suite/tests/*.test saved? wingo: check-guile.log jonsger: version.test fails but there's only "FAIL: version.test: version reporting works" in the log. No backtrace wingo: jonsger: are you building from git or from the release jonsger: wingo: from current master wingo: then you need to autoreconf again jonsger: wingo: I do run autogen.sh before `make check` wingo: i guess that should be sufficient. weird that you are seeing those errors str1ngs: sneek: later tell nly. oh great . is that when exporting to html? sneek: Okay. zig: do you people can recommend a journal where hobbist can publish stuff? zig: arxiv requires a recommendation. zig: I know about https://programming-journal.org/ zig: and http://joss.theoj.org/ wingo: good question! wingo: try twitter perhaps? can rt wingo: which part of publishing are you interested in? wingo: like what benefit are you looking for zig: I would like to reach more people or users with the idea behind the generic tuple store (srfi-168), and also a motivation to do the work required to write paper. I could do the work and publish on my blog, but it seems worthless... There is also the wikiversity (wikimedia university) option, but there is not much users on that platform yet. zig: wikiversity is mostly walled garden since I have to write the paper in wikimarkup. zig: Oh! I see mflatt from racket in the board of programming-journal.org, https://programming-journal.org/boards/ zig: netsplit weather is bad. zig: In my wanna be search engine, I have the following error: https://paste.gnome.org/pn3kkmr0s zig: any idea what happens? in the same process, similar request go through. zig: perhaps the same url works in another execution. zig: the previous paste was deleted, here another https://paste.gnome.org/pfwppum9l zig: the last line is: In procedure custom_binary_input_port_read: Value out of range: 1024 wingo: https://wingolog.org/pub/guile-2.2.6-vs-2.9.5-microbenchmarks.png zig: \o/ wingo: points out some things to fix :) dsmith-work: Thursday Greetings, Guilers wingo: heya dsmith-work wingo: seems the compiler has a problem where it's unable to hoist e.g. vector-length like it used to be able to do. it gets lowered too early to a low-level memory reference, then the compiler starts to think that any vector-set! could invalidate the result of any vector-length wingo: humm it's not precisely that... wingo: tricky :) zig: I have problems with my fiber mainthread + posix thread worker that try to implement some kind of for-each-par-map in fibers for blocking operations. zig: it could work :) marusich: The Guile manual doesn't talk about any scheme libraries for tree data structures or priority queue data structures (e.g., a min-heap). Do they exist in Guile, or is one expected to use a third-party library or roll their own if they need such data structures? daviid: marusich: if something, it will be listed here http://sph.mn/foreign/guile-software.html daviid: https://savannah.nongnu.org/projects/guile-aa-tree/ marusich: Oh, neat page! Thank you for the link. daviid: welcome! daviid: str1ngs: I pushed a series of patches, mainly to add g-unix-fd-add (and removed g-io-add-watch-fd0, which is a better solution to watch a file descriptor (and slightly more efficient as well), so ... whenever you may, please push and run the make dance ... then, the fd watch example becomes this - https://paste.debian.net/1119386/ daviid: str1ngs: I still need to work a bit more on this, becaus they all need an optional priority argument, then add soe doc for closures and these idle-add, ... g-unix-fd-add, then get back to work on signals ... manumanumanu: marusich: I am just uploading 2 heap datastructures if you are interested. One vector-based mutable heap and a functional pairing-heap. RhodiumToad: actually I'm interested in that last one, since pairing heap is one of my usual "learning a new language" exercises manumanumanu: RhodiumToad: https://hg.sr.ht/~bjoli/data-structures manumanumanu: and of course marusich ^ manumanumanu: in my benchmarks, it has been ever so sliiightly faster than a leftist tree manumanumanu: found a persistent fifo as well. Will add that marusich: Thank you for the link! zig: marusich: there is srfi libraries also. Not sure about priority queue, but there is red-black tree as known as mapping. zig: https://srfi.schemers.org/srfi-146/ davidl: How do you setup the M-. to jump to an object definition in emacs? I did the add-to-load-path stuff as explained here> https://guix.gnu.org/manual/en/html_node/The-Perfect-Setup.html but it didn't help for the files in that folder. Im still getting the "Couldn't find edit location for.." error. davidl: I mean the add-to-list stuff. zig: I do not use jump-to-definition, I use silversearcher-ag zig: ymmv davidl: zig: ok, and you think that is a better tool? zig: davidl: it works all the time, I have an emacs bindings for it as C-x C-r overriding the default tool that rely on grep. zig: davidl: In guile I do not rely on jump-to-def, but I know it helps in other programming languages, so maybe it is worth settings. The thing is that I always end up using ag or grep zig: the drawback of ag or grep is that it look in given directory, it can not search for the entire dependency graph. zig: so it doesn't work all-the-time. zig: like I wrote earlier. davidl: zig: still sounds like a nice tool. I can still use the geiser stuff to look up built-ins, and then ag for my own code. Ill see if I can set it up. zig: davidl: I started using ag *because* of the binding C-x C-r that is very handy. There is also C-x r to find a file (it support globing). zig: related to ag vs grep... I don't know, I use ag because it is said to be faster, but I can work with grep. zig: davidl: btw, talking about file navigation and emacs. I have also bm (aka. bookmark) extension set up. So, there is the following ways I navigate code: C-x C-f to find a file, C-x b to go back to previous buffer or navigate most recently used buffer, C-x C-r to find the definition or uses of a given symbol, then I also rely on manual bookmark using bm and at last I use marks with M-x pop-global-mark and M-x zig: pop-to-mark-command zig: (global-set-key (kbd "C-c ") 'pop-global-mark) zig: (global-set-key (kbd "C-c ") 'pop-to-mark-command) zig: also I extensively use C-s and C-r to search in the current buffer. zig: pop-fu-mark work somewhat like internet browser history. davidl: zig: your setup seems pretty good. I also got ag setup now and I think its gonna be worth it. Especially the ag-project command seems very useful; for refactoring. davidl: zig: so I figured out how to use the geiser-edit-symbol-at-point function; you need to make your scheme file into a module with (define module (mymodule)) and then load the module in the REPL before it works. manumanumanu: zig: Andy actually wrote a HAMT-mapping that I added some extra features to: https://hg.sr.ht/~bjoli/guile-fash/browse manumanumanu: What it lacks is actually removing mappings, but you could hack that with a value. manumanumanu: The downside being: we are using the current thread as the boundary for when a transient is allowed to be used, which means it probably won't play well with fibers. manumanumanu: the same is true for the fectors. manumanumanu: (in another repo). manumanumanu: Because I suspect a single fiber will be executed over different threads. str1ngs: sneek: later tell daviid. looks good thanks. sneek: Got it. manumanumanu: I have done more funny things than writing tests using guile's test suite... manumanumanu: About hash tables: is there any reason to _not_ associate an equality predicate with the hash table upon creation? mixing hashq, hash and hashv seems like a bad idea. manumanumanu: I have been using the r6rs hash tables because of that. Now I have to write a procedure that supports all 3 kinds, and not associating an equality predicate complicates things :D jcowan: manumanumanu: the native Guiel hash tables are really messy because of that, which is why SRFI 125can't be layered on top of them (but work fine on R6RS hash tables) manumanumanu: jcowan: I don't really understand _why_ though. Maybe some C interop? jcowan: Shortsightedness, mostly, I think jcowan: It's obvious in hindsight that a hash table should support an arbitrary hash function and equivalence predicate, and should provide a way, given a hash table, to make another hash table just like it but empty (short of copying and deleting) jcowan: But (at least as of 2015 when I wrote SRFI 125) Gauche, S7, SISC, Scheme48, RScheme, Scheme 9, Rep, Femtolisp, and SCM all failed this test manumanumanu: Hash tables seem a little bit like an afterthought for scheme in general :) jcowan: Every Scheme has to have one to hold symbols, and the common thing is just to expose the internal API. manumanumanu: ah. Because scheme generally has a few well thought out, well chosen primitives. Hash tables seem clunky in just about every scheme out there dsmith-work: Hey Hi Howdy, Guilers zig: it is clunky based on Scheme standard of clukyness, see other languages hash table are much less featured that the one in e.g. guile. zig: o/ jcowan: One of my objectives with the R7RS-large SRFIs is to improve the mindset that says "s are really the Right Thing here, but there are so many more convenience procedures for lists; I'll use lists." manumanumanu: btw: does anyone know how to write a function with multiple arities in texinfo? Not optional arguments, but 2 distinct arities. zig: jcowan: the next docket is orange docket? ref: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/ColorDockets.md jcowan: zig: yes jcowan: the bottleneck right now is writing implementations zig: I am not very knowledgeable in the subject touched by orange docket, but I could learn... but I am busy with my search engine stuff. manumanumanu: ah, @deffnx *: jcowan laments: everybody's busy *: zig nods manumanumanu: jcowan: I am elbows deep in writing a srfi from my for loops, fyi :D I simplified the implementation a bit to allow for easier porting jcowan: awesome, link? manumanumanu: jcowan: no document available for reading just yet, but the for loops can be found here: https://hg.sr.ht/~bjoli/guile-for-loops manumanumanu: The documentation on man.sr.ht is out of date, but the docs in the repo are correct. manumanumanu: Ignore the "Going forward" part. That is a dream right now :D manumanumanu: The changes has been mostly to the #:incr and #:decr part. Now there are specific macro forms instead: (in-range a b #:incr c) becomes (in-range/incr a b c). manumanumanu: and removing some things that led to phasing issues in porting to chez. manumanumanu: with the downside of compiler errors when "unsupported" sequence creators were used. jcowan: long long ago I was working my way through the manual for a proprietary library for terminal control jcowan: it was for version 1.0, and I noticed that many routines were marked "1.5 only" or "2.0 only" jcowan: On investigation these turned out to mean "We want this but haven't gotten to it" and "This would be great to have, but we have no clue how to do it" manumanumanu: :D manumanumanu: I know how to do that, making sequence creators return syntax objects and bending hygiene. manumanumanu: But it adds little (over for/fold) and complicates things. *: jcowan nods jcowan: IMO syntax-parameters are a Really Good Thing; unfortunately they cannot be implemented portably jcowan: Note that you will have to relicense or dual-license your code under the SRFI (= MIT) license manumanumanu: Sure thing. I did that with the transducers srfi as well. SRFI license or ISC-ish. zig: does anybody know a website that is HTTP without TLS, I need it to test something quickly zig: that is http://example.org/ zig: weird behavior: scheme@(guile-user)> (string=? 'symbol) zig: $5 = #t jcowan: It probably returns #t without checking if there is just one argument jcowan: er, if there is just one argument it returns #t without checking anything wingo: that is weird behavior tho dsmith-work: Also returns #t for no args. dsmith-work: ! manumanumanu: dsmith-work: that is less surprising. manumanumanu: that is just the functions identity. dsmith-work: I understand, but it still doesn't sit right for me. (*) and (+) make sense to me, for example. dsmith-work: I guess no string is pretty much equal to another no string.. manumanumanu: dsmith-work: I think that is just the case for all equality predicates. dsmith-work: Hmm. Never realized that before. manumanumanu: I found it handy when writing some macros. Not having to check the amount of arguments, just being able to rely on the predicate having an identity and the partial evaluator to solve the rest :D manumanumanu: Kent Dybvig has a nice talk on youtube about "the macro writer's bill of rights" which touches on the subject. dsmith-work: Cool. Sounds interesting! manumanumanu: I recommend it to everyone with questions about how to manage macro complexity manumanumanu: I learned by watching the output of ,expand and ,opt, which makes these things a lot easier. zig: manumanumanu: do you know if ,expand can be turned into a procedure that I can use in guile code? like chez expand procedure? manumanumanu: zig: there was a thread on guile-user not too long ago about someone wanting an expand-1 where Mark had some tricks up his sleeve manumanumanu: zig: but try: (macroexpand ...) manumanumanu: :D manumanumanu: that expands into tree-il iirc dsmith-work: zig: Everytime I see your nick, I have this desire to spout "FOR GREAT JUSTICE!" zig: dsmith-work: it is not a reference to the game, but thanks for noticing. It is a word in french that means 'dude' or 'person' dsmith-work: Ah zig: I am feeling lucky :) jcowan: If we define equality as "false if any pair is different, otherwise true", then the behavior of 1-arg and 0-arg equality makes sense jcowan: CL defines /= as "true if all elements are distinct", which means it basically has to sort its arguments zig: fwiw, chez has a different approach, every argument must be of string type: Chez Scheme Version 9.5 zig: Copyright 1984-2017 Cisco Systems, Inc. zig: > (string=? 'symbol) zig: Exception in string=?: symbol is not a string *: jcowan nods jcowan: Scheme is very flexible about "it is an error" situations manumanumanu: talking about errors, the new guile error system is neat! jcowan: manumanumanu: Pointer? decent-username: I acidentally shut down my connection to freenode and didn't notice it. decent-username: Q . Q ZombieChicken: Anyone have a URL for the nomad browser? daviid: ZombieChicken: http://git.savannah.nongnu.org/cgit/nomad.git/ ZombieChicken: daviid: Thanks. Is ##nomad the channel for that project? daviid: ZombieChicken: I don't think so, but the author is here very regurlarly, as a matter of fact, he's here now :) str1ngs str1ngs: ZombieChicken: the channel is #nomad-browser ZombieChicken: thanks zig: hello #guile dsmith-work: Hey Hi Howdy, Guilers manumanumanu: Hey ho! manumanumanu: I have decided to never again store documentation in HTML. It is a sucky format. What options do I have? I could roll my own XML for just documenting procedures and rolling my own xslt for outputting pretty other formats. dsmith-work: manumanumanu: I usually do things in org-mode. Exports to html, libreoffice, LaTeX, more. dsmith-work: And I can use things like graphviz and plantuml with it easily. manumanumanu: Which is what I have used as well, but now suddenly I have to do texi dsmith-work: I like texinfo too. manumanumanu: I don't really mind xml, and with NXML and a proper DTD it is really not bad. lloda: it's too bad texinfo doesn't do math in html exports lloda: they only thing I miss lloda: s/they/the jcowan: I have come to prefer markdown for writing documentation dsmith-work: I was messing with xml/docbook for a while. Heh, even helped with the org->docbook exporter. jcowan: and editing it lloda: I like the autoindex etc. from texinfo lloda: the easiest to set up & use lloda: I would just do latex if it wasn't for the rotten html export options lloda: a colleague proposed sphinx to me, but it depends on Python lloda: I've tried the racket system too, but only a bit jcowan: What's wrong with depending on Python? dsmith-work: Because... Python lloda: I don't like releasing a pure Guile or Guile + C package that depends on Python lloda: it's an ever growing pile nerdypepper: anyone participating in AoC '19? nerdypepper: is there a #guile leaderboard? jcowan: dsmith-work: Well, translate the Python code into Guile, then. Or translate CLPython into Scheme. Or implement Python as a Guile language. dsmith-work: jcowan: Heh. Neglected a ;^} Been doing Python at last two $DAYJOBs for about 4-5 years now. dsmith-work: Frustrating some times. jcowan: Ditto jcowan: Ditto ditto dsmith-work: There are worse things. jcowan: My first professional job was writing a file sort in Dibol, a sort of combination of Cobol and Fortran *: dsmith-work shudders manumanumanu: jcowan: stis is already at it! (regarding python in guile). jcowan: manumanumanu: Excellent! Any emails, posts, or other artifacts to look at yet? manumanumanu: jcowan: https://gitlab.com/python-on-guile/python-on-guile jcowan: nm, found it, thanks stis: jcowan: any questions? jcowan: stis: going through the manual atm, looks very nice! jcowan: I take it that it's primarily aimed at new development rather than porting existing Python applications decent-username: Good evening any fellow Schemers here? manumanumanu: oh yes manumanumanu: lots manumanumanu: decent-username: welcome! decent-username: I wanted to try out the Chickadee game engine, but I'm not familiar with using modules. I've only worked through the first 3 chapters of SICP. decent-username: Guile doesn't seem to find the module "chickadee". How do I make guile use it? decent-username: I executes "guile chickadee-hello-world.scm", but it just gives me an error. decent-username: see https://paste.gnome.org/pdcjwq5jn/9rhaer/raw decent-username: I've installed everything via Guix. stis: jcowan: a good part of the pytyhon lib is implemented as well so with luck an already made application might run jcowan: That's encouraging. stis: but to be compatiable there is a lot of more work needed. manumanumanu: decent-username: Did you try loading (chickadee) from the repl? jcowan: Bridging the FFIs would no doubt be hard. decent-username: manumanumanu: I ran the file from withing Bash. stis: yah and I did not do anything regarding asynchs as I feel scheme have better approaches manumanumanu: decent-username: I just find it weird: it says that your (run-game ...) does not support the keyword argument #:draw. decent-username: It's looking for chickadee.scm in the same directory as my game file. decent-username: That's the issue apparently. But I have no clue how to tell guile about the existence of that library. decent-username: Or rather where to find it. manumanumanu: if you have installed everything from guix, that should work. stis: pickling works but not according to standard protocol. Also python parser format is not the same as python's and we don't support the interface to the parser as python allows stis: A cool thing is that python-on-guile can serialize python generators and iterators decent-username: manumanumanu: I'm not on GuixSD though. I had to export a bunch of environment variables in order to make things work. manumanumanu: decent-username: run guile from the terminal without any arguments and try (use-modules (chickadee)) stis: python doesn not allow that decent-username: manumanumanu: works decent-username: weird manumanumanu: it finds everything, but it believes your run-game procedure does _not_ accept the keyword #:draw. decent-username: manumanumanu: I'm using Emacs and installed Geiser. When using Geisers "run-guile"-REPL and try to load the file via "(load "chickadee-hello-world.scm)" I get the following error: ERROR: In procedure primitive-load: In procedure open-file: No such file or directory: "/home/user/Informatik/guile/chickadee.scm" manumanumanu: where is the file located then? decent-username: I don't know decent-username: where are modules installed? decent-username: manumanumanu: I don't want to bother you though, if you're busy or have better things to do. I just don't want to read through the entire Guile documentation. I'm already proficient in Common Lisp and decent at writing Scheme, so I thought I could get things to work. manumanumanu: decent-username: check the variable %load-path decent-username: ("/home/user/.emacs.d/elpa/geiser-20191126.933/scheme/guile/" "/gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/share/guile/2.2" "/gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/share/guile/site/2.2" "/gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/share/guile/site" "/gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/share/guile") manumanumanu: decent-username: I should be doing a bunch of boring stuff. This is more fun :D decent-username: let me check if it's somewhere in there manumanumanu: It will be. manumanumanu: check "which guile" decent-username: it's not. decent-username: user@computer:/gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/share/guile/2.2$ ls -R | grep chickadee decent-username: returns nothing decent-username: I used "guix package --install guile-chickadee". I've also installed guile-sdl2 and guile-opengl manumanumanu: it might be in the site dirs as well manumanumanu: If your guix-guile can load it, it's there manumanumanu: That is not the problem. manumanumanu: The only difference you have compared to the example "text.scm" is your (display "hello"), but that shouldn't be a problem. decent-username: manumanumanu: Yes. I'm right now redifining %load-path inside the guile-repl to the value which guile returned when it was run inside a terminal outside of Emacs. manumanumanu: oooh, you should use (add-to-load-path ....) *: decent-username just learned another thing. manumanumanu: I am sorry to say, I am on a mac, so I can't run any code you are pasting. I had enough problems getting guile2.9.4 to work. decent-username: I think I'm getting close though. It seems to find chickadee. It's located in "/home/user/.guix-profile/share/guile/site/2.2/". manumanumanu: decent-username: Try running the example in a repl. manumanumanu: I have to do some christmas planning with the family... sorry. Maybe someone with chickadee installed can help you better than I can. decent-username: you've already helped decent-username: thanks. manumanumanu: decent-username: getting anywhere? manumanumanu: The error you are getting is so weird. manumanumanu: unrecognized keyword #:draw manumanumanu: is there any unicode trickery going on? manumanumanu: and run-game is on line 200-something in chickadee.scm, not 59 decent-username: manumanumanu: Let me quickly finish my university homework and then I'll give you a proper answer. ;D manumanumanu: decent-username: It's bedtime in my timezone, so I'll read whatever reply you have at a later time. Best of luck! decent-username: manumanumanu: Alright. see ya. daviid: manumanumanu: I use texinfo, but if you don't like it you may try https://www.nongnu.org/skribilo/ daviid: lloda: ^^ skribilo is written in guile daviid: guile has stexi a well ... dsmith: Yey! I did get the Guile mail today. Whew. daviid: str1ngs: I was working on glib io-channels, because the guile-async2 authors needs at least one g-io-add-watch* procedure, and out of this came a few important enhancements, not 'directly relevant' to your usecase I think, but whenever you are free to do so, please pull and run the make/install dance ... daviid: str1ngs: only if you are interested, here is a simple test example for the new g-io-add-watch-fd procedure - https://paste.debian.net/1118999/ - drop it in a file, save, chmod a+x and run/try it ... it should not crash :) str1ngs: daviid: looks good. will test this out thanks. zig: hello #guile wingo: ecraven: tx for info but i can't find your r7rs libs for chez scheme wingo: there is no link in the README wingo: found it: https://github.com/ecraven/chez-scheme-libraries wingo: but then it won't find srfi-9 ? weird zig: do you know a glob pattern matcher for guile? zig: (or at least scheme zig: ) wingo: zig: there is an slib one wingo: and a guile version is somewhere in guile-gnome wingo: zig: guix seems to have one wingo: guix/glob.scm wingo: http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gw/support/glob.scm wingo: http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gw/support/slib.scm nerdypepper: o/ i was building guile 2.2 and it looks like the readline module was not built/installed nerdypepper: any hints on getting that working? nerdypepper: aka, libguilereadline.a is not present under ${prefix}/lib nerdypepper: the readme does mention "this will be installed if a recent enough readline library can be found" nerdypepper: i have libreadline8-8 installed lloda: was libreadline detected in configure nerdypepper? you may need configure --with-libreadline-prefix if configure doesn't understand your setup dsmith-work: nerdypepper: Might need the -dev package installed. nerdypepper: lloda, dsmith-work: thanks for the help nerdypepper: its probably an issue with prefix, ill check it out in a moment nerdypepper: dsmith-work: ah, my distro dosent seem to package that, ill have to look into that as well zig: tx wingo I will look into those. The guix implementation is out, because i need foo*bar kind of glob. daviid: zig: the same glob that is in guile-gnome is in grip, but with an slib module which includes it and export the golb:make-matcher, so one can do ,use (grip support slib) ... fwiw http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/support zig: tx roelj: How can write the number "1.056e7" as "10560000" in scheme? roelj: (I don't want the scientific notation) rekado_: roelj: do you mean write using “write” or print it or convert it to a string? roelj: rekado_: print as a string daviid: roelj: (number->string 10560000) roelj: daviid: ha! I calculate the number and use "round" to round it to the nearest integer. When I then convert it to a string with number->string I get the scientific notation. daviid: oh you men to 'expand' the scientific notation daviid: *mean roelj: yes daviid: maybe format will do that, not sure, ot this 'new' srfi i forgot the name roelj: Well, I just want to number printed in full, so that something that expects bytes can just interpret it. roelj: Hm, the best I can come up with is: (string-drop-right (format #f "~,0,f" the-number) 1) daviid: roelj: was refering to this sfri https://srfi.schemers.org/srfi-159/srfi-159.html but i don't know if it does what you want, and if does, if it 'works' out-of-the-box for guile ... nly: hello roelj: daviid: Thanks. That looks like a possible solution daviid: roelj: it might be substantially faster to write your own proc for this though, using the string since you 'have it' anyway, split for #\e and if, drop the dot and add as many #\0 it needs ... decent-username: Good evening. I've just installed guile-chickadee as well as guile-sdl2 and guile-opengl. Right now I'm trying to test the example provided on https://dthompson.us/projects/chickadee.html and I get the following error https://paste.gnome.org/pdf8nqvwc/yxzsua/raw. decent-username: I've installed guile-chickadee via guix on Debian and I think Scheme doesn't find the package. How could I fix that? seepel: Hello Guilers! I dropped in last week to ask about best practices for project structure. I'm afraid I have somehow found my self in a weird spot. Does anyone recognize this error: Wrong __data_start/_end pair? seepel: It occurs when I try to run Guile 2.2.4 that I installed via the ubuntu package manager. Googling around I have only found this that seems related to guile: https://github.com/weechat/weechat/issues/988 and this that seems related ulimit (though I don't remember changing anything related): https://askubuntu.com/questions/1142308/cannot-launch-inkscape-and-w3m-with-same-error-message-wrong-data-start-end seepel: Funny enough if I run guile via gdb it does start up into the repl just fine so I'm at a bit of a loss as to how to go about figuring out what the problem is... daviid: seepel: don't know how to help, but you can certainly 'play with' ulimit an see ... seepel: I have done that, the link I posted was related to an unlimited stack size, mine is set to 8192. I tried changing to different values and nothing seemed to change. daviid: seepel: be careful with multiple scheme instllation as well, iirc you do have more then one guile installed ... seepel: I guess it would be helpful to have some idea of where that error might be emitted from or even what it is supposed to mean daviid: seepel: never heard of that error here, in decades :) seepel: I figured that might be the problem so I removed the other installation seepel: Haha seepel: Go me :D seepel: I have a sinking suspicion it is my Ubuntu installation, but the error seemed like it might be guile specific so figured I'd ask here before hosing my install and re-installing. daviid: data_start is not listed in any guile related file, nor scheme nor C daviid: it must be the 'os' or whatever ... daviid: seepel: try guix? you don't want to loose your time with these problems while learning ... seepel: Yeah, I've been thinking that as well. I'm on a Windows laptop so have been trying to do most things through Windows Subsystem for Linux. I've read a bit into guix, but I'm not quite sure the best way to run it on my current system. daviid: oh window, try msys2, it has a guile package, I use it daviid: i've used it, recently, it works perfectly daviid: for me at least seepel: Grepping the guile source code I did find this in change log from 2008 :D ./libguile/ChangeLog-2008: (DATASTART): Use _fdata instead of __data_start. seepel: So your decade comment seems right. daviid: ah, I searched the .c and .scm files ... no occurrence seepel: Yeah, it ends up in some of the binaries after it is built, but nothing explicit daviid: seepel: I would try to install msys2, then install their guile packages (there are 2 or 3 iirc) daviid: unless you have a need for gui on that platform, like guile-gnome, that won't work on msys2, at least not 'out-of-the-box seepel: Eventually I'll want that, I have successfully run GUI under X through WSL before, was planning to give that brief shot by the time I need to work on the gui, but if it was difficult at all bail out and either dual boot or develop that on another machine. seepel: But I will try that suggestion, at this point anything that runs is good for me :D daviid: msys2 won't let you develop gui stuff i guile daviid: dual boot is much better then running ubuntu on top of win, imo daviid: window is a disaster seepel: Hehe, starting to come around to that. seepel: Maybe I'll just byte the bullet and dual boot now. seepel: Thanks for the help again, it's super encouraging how responsive you are! daviid: I would install debian, not ubuntu, then guix, which has and will always have everythibg you need as a guile user ... debian has a guix package, I think, but you can instll guix from the latest tarball of course daviid: seepel: if yu go that root, talk to #guix, there are very nice and friendly ... seepel: That's a good suggestion, I wonder how hard it would be to run guixSD on top of a custom kernel daviid: ask them ... i think it is h/w 'dependent' jcowan: seepel: WSL1 or WSL2? seepel: WSL1 I haven't jumped to the next preview yet. seepel: Was hoping to just code and not devops, but at this point anything is on the table I suppose. jcowan: "All problems are config problems." seepel: Ain't it the truth, with my team at work I've been trying to colloquialize the phrase "Today I had to pay deity to the build gods" benjamin-l: is there a way to add custom specializer types to goops using metaobject protocol stuff benjamin-l: I'm trying to port over the "eql" specializers from common lisp mwette: seepel: __data_start misalign looks like a linker error; but I found a reference to guile here: https://github.com/weechat/weechat/issues/988 stis: hello guilers! zig: o/ dsmith: sneek: botsnack sneek: :) dsmith: Goodbot dsmith: Heya All, has there been any mail on any of the lists since Nov 29th? dsmith: I've been getting a temendous increase in spam. And no real messages. dsmith: Just wondering if they got the spam filters reversed or something dsmith: Last good mail I got was from Andy about bug # 38388 stis: I have gmail and have not seen any spam. rgherdt: there was an e-mail today regarding the Guile 2.9.5 release SrainUser: Hey there, how does guile find modules within the "module path"? does the filename have to match the module name or Does it scan each *.scm file for (define-modules) commands and builds a mapping from filename to modulename? RhodiumToad: the filename is constructed from the module name and then looked up relative to directories in %load-path RhodiumToad: see node "Modules and the File System" in the docs SrainUser: oh ok thx. WIll have a look SrainUser: so I do have 2 source files - a, b - in my folder "tls". SrainUser: "a" does have to define the module like this: (define-module (tls a)) doesnt it? SrainUser: that would be analog to the (ice-9 popen) example on " SrainUser: 6.20.4 Modules and the File System" RhodiumToad: yes, afaik ArneBab: Great article which is also important for Guile: Software developers should avoid traumatic changes → https://drewdevault.com/2019/11/26/Avoid-traumatic-changes.html *: RhodiumToad wonders where the break-even point is for checking for unique symbols using a hash table vs. a simple list and memq RhodiumToad: hm. is there a good way to match an sexp that looks like (foo [optional stuff] . bar) ? ecraven: wingo: I don't think I ever checked in graph.scm, it is a total mess :-/ ecraven: for chez, there should be a link in the README.org to my r7rs shims chrislck: ooh https://everything2.com/user/jimb q66: hello, do you think it would be possible to tag a 2.0.15 release for the oldstable series? there has been none since early 2017 and it seems the gnulib update commit (which is an ~8KLOC commit so it's impractical to ship it downstream) fixed some strange build errors on powerpc(64): https://gist.github.com/q66/1b5917cb398e2b8837d8676bcf1f142a q66: alternatively i'll just switch it to a git snapshot, but i'd prefer not to q66: hrm, still getting these errors on latest git when compiling for musl libc... strange :/ q66: time to dig around more zig: Sure thing multithread POSIX threads, fibers and the module system do not play nice together... zig: The take away of this afternoon of debug is that, I will avoid bash bang to start a main procedure and instead rely on (scheme process-content)'s program-arguments procedure. zig: It seems like when program is also a guile module, there is some stuff happenning that made my program segfault. zig: the positive side of things is that it seems that the for-each-par-map I have been working on that can be used in mainthread fiber to execute database queries seems to work. zig: that is execute database queries or cpu intensive task without blocking the mainthread that is running a guile-fibers scheduler. zig: \o/ q66: i think i have the same problem as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=941218 q66: no idea what to do though q66: what even q66: the issue disappears when i compile it with -Os jcowan: manumanumanu: Yes, absolutely. But until now a parameter has always been bound to a global variable in actual use. Nobody uses parameters as procedure arguments, or returns a parameter from a procedure, or stores parameters in data structures -- yet. jcowan: I wish someone research-minded (which I am not) would take up the question. bandali: in haunt, is it possible to get the site domain in the context of a post (e.g. when setting #:post-template) ? zig: hello #guile catonano: what does "module-submodules" return ? wingo: moin nly: morning wingo: civodul: hey going to take a look at adding a new hash table to modules to record what bindings are intended to replace core bindings wingo: so that a binding being a replacement is a property of module + name, rather than a property of the variable object wingo: sound good to you? wingo: will make a corresponding change to the duplicates handler, to look in the interface to see if the var is a replacement instead of looking at the object-property on the variable civodul: hello! civodul: wingo: i'm fine with the current object-property hack civodul: but a hash table can't hurt either civodul: well properties are a hash table too civodul: ah, got it civodul: hmm civodul: yes, it makes more sense for "replacement" to be a property of module + name wingo: this enables re-export-and-replace civodul: right civodul: yeah, got it now :-) civodul: so sure, that sounds like a worthy improvement! wingo: and prevents a re-export of a #:replace to unintentionally replace wingo: *from unintentionally replacing civodul: yup wingo: coolio civodul: and it will allow us to just #:replace ((&external-error . &error)) civodul: or whatever that was wingo: almost :/ currently #:replace does a module-ensure-local-variable wingo: which i don't think we can change wingo: so it would be #:re-export-and-replace ((&external-error . &error)) or something :/ civodul: ah, oh well rekado: uhm, I just tried to work a little on mumi and I see a weird error in parsing the XML responses from Debbugs — but only when done with the web server, not when done on its own. Super weird. wingo: weird! civodul: howdy rekado! civodul: "with the web server", you mean on the "web server" machine? wingo: civodul: i am going to use the keyword #:re-export/replace unless you have a better idea wingo: gah wingo: nasty :P civodul: dunno, we can't hack module-replace! to DTRT? wingo: civodul: if we could do that we would also be able to hack module-export! to DTRT wingo: but i don't think it's possible. consider (define-module (foo) #:replace (bar)) ... (define (bar) 42) wingo: at the point of the define-module, we don't know that there's going to be a local definition for bar wingo: like bar could come from an imported module wingo: right now #:replace causes a module-ensure-local-variable! on bar wingo: so that you know if you see #:replace, the binding is local to the module wingo: same concerns for #:export wingo: we could perhaps change to only create the local variable if there's not an imported variable wingo: but i don't know if it's a compat risk wingo: in that case we don't need #:re-export any more rekado: civodul: no, I mean when something is called in a request handler of the Guile web server. wingo: i can imagine a user being surprised if an imported binding is re-exported, instead of their local binding wingo: but, there are a number of pitfalls in the current system, perhaps an improvement is in order; if we could eventually kill #:re-export that would be nice :) civodul: wingo: ah yes, i see, i agree that there would be compatibility concerns wingo: but r6rs modules manage to figure this out automatically wingo: so maybe like you say, we can just make a change wingo: it would be a better system; risk is just compat. wingo: maybe we can add a warning on module-ensure-local-variable! if the public interface already has an export under that name... wingo: like define-module would add a tombstone for the internal name of the re-exported binding to some set associated with the module. if module-ensure-local-variable! would then define a binding for that name, it would issue a warning civodul: so in what case exactly would one get different behavior? *: civodul has a hard time wrapping his head around it wingo: let's say you have (define-module (foo) #:export (raise)) (define (raise x) (throw 'foo x)) wingo: guile has a binding for `raise' already. at the point of the define-module, guile wouldn't see the local definition, and would re-export the imported binding from (guile) civodul: if you had #:re-export, not #:export, right? wingo: sorry, i am making a shortcut. if we have #:replace automatically detect whether a binding is local or re-exported, that is the same as having #:export do it. so my question was, can we make #:export DTRT wingo: if we can't, then we need #:re-export-and-replace civodul: i mean, (define-module (foo) #:export (raise)) should definitely export the module-local "raise", not guile's civodul: so to me, that part is non-negotiable ;-) wingo: :) wingo: here is another option to get #:export and #:replace to DTRT regardless of whether bindings are local or imported: define-module re-exports imported bindings if there is no local binding. if a local binding is defined later, we arrange to update the public interface to replace the re-exported binding with the local binding civodul: that means keeping track of top-level defines as the module is loaded, right? wingo: that creates a window in which, for circular module graphs, users might see the "wrong" import. not nice wingo: civodul: yes it means instrumentation into module-ensure-local-variable!, which is what (define ...) ends up calling civodul: ok civodul: at this point i'd lean towards #:re-export-and-replace wingo: (and=> (hashq-ref (module-re-exports module) name) (lambda (external-name) (module-add! (module-public-interface mod) external-name var)) civodul: note that it's not a very common use case anyway, so having that extra #:re-export-and-replace is not that bad IMO wingo: yeah civodul: yeah wingo: well, something we can think on for the future wingo: #:re-export-and-replace it is civodul: ok wingo: neat, this change correctly causes more replacement warnings rekado: hmm, so this problem only happens when using the web server from (fibers web server). wingo: that's irritating :/ wingo: ecraven: where can i find the graph.scm that you use to make the benchmark html output? wingo: ecraven: also how do you run chez scheme with r7rs support? lispmacs: Hi, I was wondering how other Guile/Emacs users handle the issue of initializing load-paths for their project directories. Geiser has a geiser-guile-load-path variable which is supposed to used in conjunction with .dir-locals.el files, but I'm having trouble getting that to actually work. sneek: lispmacs, you have 2 messages. sneek: lispmacs, nckx says: chrislck says: this particular gnucash bug is resolved in recent maint. sneek: lispmacs, chrislck says: https://github.com/Gnucash/gnucash/commit/ee260d8e3 nckx: TIL that sneek is cross-channel 😮 lispmacs: nckx: apparently. very handy chrislck: it looks like (case str (("a" "b" "c") "str is 'a' 'b' or 'c'")) should work but doesn't. is it intentional? chrislck: str is a string Guest93493: chrislck: case do not worj with strings, you'd nee to use string->symbol daviid: that was me :) daviid: chrislck: I thnk it is described in the manual? chrislck: it's not, actually chrislck: "it would be nice" if it did work ;) chrislck: but agree string->symbol sounds like the way to proceed RhodiumToad: case compares with eqv? and that's not what you want for strings RhodiumToad: that it compares with eqv? is documented, the consequences mostly aren't lispmacs: is there some built-in or SRFI shortcut procedure for the common (set! lst (cons value lst)) operation? lispmacs: seems like something that somebody would have thought of already chrislck: no chrislck: because the powers that be want you to try avoid this construct ;) zig: hello #guile lloda: When I learned about match I stopped using case, even for symbols. lloda: Error on no match is almost always what I want, so it also saves me from having to write an else zig: I read racket in its new language will make "error on no match" default in 'cond' and 'case' chrislck: good idea to use match. zig: on the subject of record, using guile-next 2.9.5. I have two things to report: zig: a) the manual, says the follow: Scheme Procedure: record-accessor rtd k zig: Returns the record field accessor procedure for the kth field of the record-type descriptor rtd. zig: but when I use a number of argument K, it fails: zig: it works with the symbol, see : https://paste.gnome.org/pv72h7vbt zig: b) is somewhat related, the exception cannot be displayed, see the same paste at https://paste.gnome.org/pv72h7vbt zig: the print error is: ice-9/boot-9.scm:1650:16: In procedure raise-exception: zig: Error while printing exception. lloda: yeah that's when the exception printer throws. I'm not sure why it doesn't at least print the k & the args to the handler. I have that patched in my boot-9.scm. lloda: that could be a bug in the exception printer, but regardless lloda: also now every error backtrace starts there, and it's the only line that gets printed until you ,bt which isn't very informative zig: I added a 'record store' to babelia, that allows to defined a subspace for whatever record type you defined with the following code: (define rstore (make-rstore engine '(rstore) )) zig: where is the record type identifier. zig: Then you can do one of the following: zig: - (rstore-insert transaction rstore instance) zig: the above procedure will return an unique identifier as bytevector. zig: - (rstore-update transaction rstore uid instance) will return no value zig: - (rstore-delete transaction rstore uid) will delete the record with unique identifier UID zig: it rely on r6rs record reflection (which works with srfi-9 record, they also work with r7rs records) zig: see https://git.sr.ht/~amz3/guile-babelia/tree/master/babelia/okvs/rstore.scm zig: now I can stop procrastinating a do the actual web ui stuff. zig: or leave that to downstream :) zig: btw compilation times are good with guile 2.9.5 zig: I think, ui is difficult mainly because there is lot of input, hence lot of validation, and so far I am not good at validation. spk121: zig: neat bandali: hi, any haunt users around? bandali: i'd like to know how i could have a custom name for the front page of my site/blog bandali: i found `page-file-name', but am not sure how to use it in a layout bandali: okay i think librelounge.org does something like that; i'll check their sources rekado_: bandali: what do you mean by “custom name”? bandali: rekado_, sorry, i meant a different bandali: i prefer a simple <title>xyz for my front page, rather than recent posts - xyz rekado_: bandali: I do the same at elephly.net; sources are here: https://git.elephly.net/?p=software/elephly-net.git;a=summary bandali: rekado_, great, will check it out, thanks a bunch manumanumanu: jcowan: Thanks, John. I have always wondered why parameters or fluids aren't more often used, at least inside the parts of a program not exposed to the outer world. Then I saw that srfi-166 mentions specifically _not_ using parameters in favour of the environment monad, and jumped to conclusions. jcowan: Fluids are really problematic in the presence of threads because they are normally implemented with shallow binding. jcowan: IMO we don't really understand the full power of parameters yet manumanumanu: How do you mean? manumanumanu: jcowan: I have always found (parameterize ...) to be a very nice way to let programs change internal behaviour of otherwise opaque code. Keyword arguments are nice as well, but there are times when parameters are nices to use. chrislck: daviid: no I'm not working in AI nor vision. I'll check manual and consider the set of snippets. zig: hello #guile zig: sneek: what is later? sneek: later is the friend of never wingo: zig: nice bug :) wingo: the floor/ one wingo: i haven't tracked it down yet but it's a gnarly compiler bug wingo: zig: took a while, but fixed in master zig: tx dsmith-work: Wednesday Greetings, Guilers mwette: o/ dsmith-work: Home Inet is down, so sneek can't get in. zig: hello #guile *: RhodiumToad ponders whether using parameters is a good idea zig: RhodiumToad: what it is the context? RhodiumToad: wondering whether it would simplify a case that would otherwise require a bunch of optional arguments passed down through various functions RhodiumToad: the context is trying to do a better job of outputting xml with namespaces than SXML currently does zig: hmm idk zig: I just did some statistics about words used in bug-guix mailling list, and without surprise, the term 'ludovic' appears in the top: https://paste.gnome.org/po69flbyv wingo: moin wleslie: what's new, andy? zig: is it possible to pass -O3 to guile command? does it make sense? zig: also how to force the JIT to kick in? wingo: zig: -O3 is mostly used in "guild compile" currently wingo: civodul: for that crc32 bug -- it is on x86-64 ? wingo: ah i see it is a compiler bug, not a jit bug wingo: nice :) wingo: nice, nice wingo: fixed civodul: woow, that was fast :-) civodul: it was on x86_64 civodul: i was happy the test was able to catch a real obscure bug chrislck: daviid: looking at guile-cv, was initially intrigued... but guile-cv suffers from 'gnu webpage syndrome' chrislck: good documentation and instructions, and not enough 'pop' chrislck: small snippets showing power of guile-cv, hiding just enough tech to whet appetite chrislck: https://www.gnu.org/software/guile/ is the level that we want to see chrislck: perhaps a minimal project description using raspberrypi's camera module, distro, guile, guile-cv, and catcam ;) zig: wingo: fwiw, an numerical-overflow error is raised when compiling the following program: https://paste.gnome.org/pextmlevy zig: the parens are not good, line 7 should be inside the "if". zig: another bug: when a file is already compiled, and the new compilation fails, guile will run the previously compiled file. dsmith-work: Tuesday Greetings, Guilers bandali: davexunit, hey are you around? manumanumanu: About Parameters: are they slow? jcowan: manumanumanu: Binding them or reading them? Reading is a procedure call, so should be fast. jcowan: Depending on the implementation, forking a new thread when lots of parameters exist may be slow. daviid: chrislck: thanks for the nice words wrt guile-cv, are you 'from the domain'? you might be interested take to take look/use aiscm as well daviid: chrislck: I will get back to guile-cv as soon as g-golf is 'complete' ... there are tons of things to be done still ... daviid: chrislck: wrt its doc, I will only concentrate on the reference manual as I am developing, till guile-cv has what I consider a minimum functionality set (it still misses fundamental things, like watershed, fast fourier transforms ... and many many other fundamental bits), meanwhile, if a user wants to help and write 'pop' small snipsets :), I certainly can review and include some in the user part of the manual ... if you want to work on daviid: this, make sure the images are GPL licensed daviid: *the images you would use daviid: * there are tons of things to be done still on guile-cv, g-golf is getting close to be fully usable (though there will always be room for improvements, once 'complete', maintenance and enhancement will demand less effort then it is demanding now ...) daviid: chrislck: aiscm is here http://wedesoft.github.io/aiscm/ ArneBab: chrislck: if you need free images, you can use those from the RPG I write: https://bitbucket.org/ArneBab/1w6/src/default/Quelldateien/ daviid: chrislck: did you actually install and try guile-cv, or just looked at the online doc? just curious ... seepel: Hi there Guilers, I'm looking for some guidance on how to setup/structure an application written in guile. I have only found this so far: https://www.erikedrosa.com/2017/10/29/guile-projects-with-autotools.html would this be the recommendation? seepel: I should probably also note that I am not very familiar with gnu build tooling daviid: seepel: yes, that link is a good sart daviid: then look at some 'living' project and of course you may ask for help here as well seepel: Do you know of any living project that creates an executable. The link I posted seems to be geared towards building a library, it is still a bit of a mental leap for me to figure out how to create an executable seepel: Or would I be looking to start with a c file that contains a main function that links to/and calls out to a guile library that would be my real application code? daviid: seepel: you can't create 'executables', but scripts, that are installed in $prefix/bin, no autocompile, short and that 'just' import your app compiled installed modules and starts or runs what ever it is you developpped ... daviid: seepel: no C code is better daviid: anyway, look at this link and pick a project you'd like to 'copy', it will take a certain amount of time/investment to learn about the autotool chain and how we use it for our guile projects ... seepel: Happy to invest the time as it seems like the investment will be worth it, but I'm really not sure where to start. Based on my question and your response I think I am even more confused than I originally thought :). By "this link" you mean the link I posted? daviid: yes I would strat by carefully read that and 'play' with a toy project while reading daviid: that link you osted ... daviid: *posted daviid: it misses a few things, for example the doc, a test suites ... but it's an excellent start daviid: then, as said, pick a 'real project' you like and read the autotool chain part of it daviid: what are you working on? seepel: I have lots of ideas, but primarily I want to get real life hands on experience with scheme, and Guile Scheme in particular seems to match my sensibilities. I was thinking I'd like to make an email client in GTK. seepel: Eventually I'd like to also get to the point of being able to hack on top of guile itself as well. daviid: great, maybe to start to learn scheme, and guile scheme, a 'none graphical' projet would be better, maybe ... seepel: Heh, that is probably good advice. The reason I wanted to choose this project is that in my previous job I built an email client for both iOS and desktop (using electron). So I know the architecture of the application really well, leaving the unknowns of the project being scheme and GTK. seepel: Over the last couple years I've made a conserted effort to learn scheme and I feel like I have a good idea of what's possible, but not a good intuition of the gotchyas. Of course I've mostly focused on learning scheme itself, so I'd like to tackle a project where the goal is to get something useable in scheme itself. seepel: I figure I'll start on the data layer using the gmail api/sqlite which would start acclimating me to thinking "scheme" before I had to go figure out how to think "GTK". And then if I don't lose interest go back and fill in IMAP and maybe have a nice little mail client. daviid: cool seepel: Oh, and WebkitGTK of course, course HTML email is all the rage :D daviid: ok, not my domain 'at all', but there are other guilers working in this area, for example someone here is developing a web browser, called nomad, usig webkitgtk, i think :) seepel: Oh, no kidding! That sounds awesome, is it this? https://github.com/mrosset/nomad daviid: yes, that one, the author is here in the channel very often, his nick is str1ngs seepel: Anyway, fingers crossed it seems like WebKitGTK does come with a WebView style widget that without diving too deep sounds like it will suffice for my purposes. seepel: Also, thanks for the friendly responses, working on getting the example repo from my link to compile now. daviid: seepel: welcome seepel: Thanks! seepel: Sorted out how to compile for 2.2, big struggle is that at one point I had compiled 2.9.4 from source and it was in my path before 2.2 so I tried modifying configure.ac for 3.0, but ended up getting errors like this: checking for Guile version >= 3.0... configure: error: Guile 3.0 required, but 2.9.4 found. Which seems to be coming from the fact that the effective-version for my self built guile was 3.0, but the actualy version was seepel: 2.9.4.6-d1cf89. Is there a way to specify the beta in configure.ac? seepel: Totally separately make with the 2.9.5 sources segfaults for me, and I'm actually using WSL which doesn't actually save core dumps! So no idea on that one, but it happens on BOOTSTRAP GUILEC system/vm/linker.go daviid: savannah is down it appears, i can't pull/push daviid: seepel: if you could compile 2.9.4, it is suspicious (to me) that it would fail to compile 2.9.5, make sure you don't have 'strange' PATH settings maybe ... don't know daviid: in you project configure.ac? try with 2.9.4, or what ever is installed (but don't 'touch' the guile configure.ac) daviid: RhodiumToad: str1ngs: spk121: I finally got the source and closure 'problem' right, and users won't have to free these themselves when making call to g-idle-add, g-timeout-add and g-timeout-add-seconds, which is great (and a relief, I was unhappy with what I had till I found the right approach ...) str1ngs: daviid: great, that sounds more ideal daviid: unfortunayely, savannah is down, so i can't push the commits daviid: str1ngs: yes, this is much better for users of course daviid: can someone confirm savannah is down, just to make sure the problem is not on 'my side' str1ngs: seepel: https://github.com/mrosset/nomad is the project though github is just a backup to http://git.savannah.nongnu.org/cgit/nomad.git. but Savannah is down right now seepel: daviid: At least trying to visit the savannah web is not loading for me. daviid: seepel: ok tx seepel: As far as my project configure.ac specifying 2.9.4 fails to find guile at all as the .pc file was installed as guile-3.0.pc seepel: I'm going to have to sign off for bit, thanks for all your help, I'll come back to try to tackle this again at a later time. daviid: seepel: i don't have time to go to the details with you on this, i'm sorry daviid: ok seepel: No worries at all, very thankful for the help you did provide, I did manage to build something after all! daviid: congratulation! str1ngs: seepel: it's okay to use 3.0 with GUILE_PKG macro daviid: str1ngs: (and who's using g-golf), meanwhile (savannah down ...) here are two (3d valid) links to the two (g-golf) modules that fixes the source and (g-)closure 'problem' ... daviid: (g-golf hl-api closure) https://paste.debian.net/1117813/ daviid: (g-golf hl-api glib) https://paste.debian.net/1117811/ daviid: later, when savannah is back, you may checkout these two files to retrieve their respective uptream version ... zig: o/ zig: why gettimeofday return a pair instead of a single integer? zig: there is slight issue with raise in scheme base: WARNING: (tests): imported module (scheme base) overrides core binding `raise' zig: i think (scheme base) should (re-export! raise) or something like that. lloda: I rebased my boot-9 exception format hack on top of current master lloda: as I didn't see how set-exception-printer! could be used to do the same thing lloda: :-/ wingo: lloda: what's the issue? wingo: i wrote some code using exceptions the other days and found the default exception printer to be pretty nice! rekado_: spk121: the test passes when run in an environment that has an X server. rekado_: (the upgrade of the guile-gi package in Guix is only waiting for Savannah to come back up…) lloda: wingo: I need to fix the printer for every exception. Can I say (set-exception-printer! #t ...) ? lloda: only uses I see are in Guile itself wingo: lloda: did you consider installing your own exception handler? wingo: i imagine you did, wondering why that wasn't a good solution wingo: brb lloda: wingo: I didn't consider it tbh. How would I do that globally? *: chrislck has first positive experience with guix during nomad compilation... wow... lloda: something like (with-throw-handler #t (lambda () (run-repl (make-repl 'scheme))) (lambda (k . args) (pk 'IDID k) (apply throw k args))) ?? lloda: I'm clueless :-| spk121: rekado: great. One test in main-loop.scm may randomly fail. It seems to be a GC race condition bug. I'm trying to track it down. wingo: lloda: ah with the repl it is more complicated. and call-with-error-handling needs updating to work more with exceptions than with key+args wingo: lloda: why do you need to fix the printer for every exception? just curious lloda: wingo: because the printers for standard exceptions like out-of-range or misc-error or anything really print untruncated objects wingo: lloda: ah so you want those printers to truncate arrays. wingo: i understand wingo: probably for that concrete problem we should change to make the printers truncate civodul: Hello Guilers 2.9! :-) wingo: :) civodul: wingo: i have Guix running on 2.9.5, with some remaining test failures wingo: nice! civodul: most have to do with mocking that sets global variables *: wingo wrote a script with fibers and the web client that does a HEAD over a list of paths, in parallel; seems to work with 2.9.5 civodul: cool! civodul: also, all the dependencies of Guix are now packaged as 'guile3.0-*' civodul: that went fine, most of the time without changes civodul: in terms of performance, it seems there's very roughly 10% improvement on "guix build libreoffice -nd" civodul: sometimes less, depending on the exact workload civodul: but Guix does a lot of i/o and a lot of GC, so... str1ngs: daviid: looks like Savannah is back up zig: neat! wingo: civodul: neat :) probably could take another look too to see if there are hot spots that can be whittled down further civodul: yup civodul: i tried (statprof) but it seemed to always see 0.00 for the "self" timings civodul: which is weird civodul: s/see/say/ zig: guile 2.9.5 is between 4% and 8% faster on my side. civodul: zig: faster than 2.2? civodul: on what kind of code? zig: faster than 2.9.4 zig: that is mostly cffi, I guess. wingo: neat wingo: zig: do you use -O3 ? zig: no wingo: it doesn't match with all development workflows but if you need to squeeze out some speed it can be an interesting strategy civodul: i'm getting: In procedure raise-exception: Wrong type (expecting resumable continuation): # civodul: i haven't managed to boil it down to a simple test, though wingo: civodul: for what? wingo: ah you are working on the "what" :) civodul: wingo: it's a simple srfi-34 raise with a srfi-35 &message wingo: i think that means when that continuation was captured, it had recursed through C wingo: ah. humm. wingo: yes. civodul: but srfi-34 raise is not continuable (right?), and there's no C stack in the middle i believe civodul: needs investigation... wingo: no, the situation is this: wingo: srfi-34 specifies that the handler for with-exception-handler runs within the continuation of the raise. not necessarily in tail position, but within that dynamic environment wingo: but, guard specifies that the guard predicates (the cond clauses) and the consequents run in the continuation of the guard. wingo: so if you have a guard, the exception handler installed by the guard should unwind the stack to the guard, run the clauses, and if non matches and if there's not an "else" clause, it should rewind (!!!!) the stack back to the exception to continue propagating the exception wingo: srfi-34 wasn't doing the rewinding before. i changed it to conform to the (stupid, IMO) spec wingo: but i used delimited continuations instead of full continuations wingo: because it's cheaper and nicer that way wingo: but it would seem that you are hitting a case in which delimited continuations don't work :/ civodul: uh civodul: here's the C stack: https://paste.debian.net/1117854/ civodul: would JIT code in the middle prevent rewinding? wingo: civodul: no wingo: jit does not prevent rewinding wingo: you won't see the interesting frame on the stack civodul: i always thought the guard clauses were running before unwinding had taken place wingo: because it was already unwound civodul: yeah wingo: civodul: see "git log" on srfi-34.scm wingo: if you want to try a fix, replace the "(rewind)" call on the last line with (raise-exception exn) zig: compared to 2.2.6, see guile 3 to be around 20% faster without -O3 https://paste.gnome.org/pfktukqde *: civodul checks https://srfi.schemers.org/srfi-34/srfi-34.html civodul: so in previous versions of Guile, the 'guard' clauses were evaluated before unwinding, right? civodul: contrary to what the spec says *: civodul would happily keep the non-conforming behavior :-) civodul: wingo: the C frame preventing rewinding is scm_force civodul: looks like promises could easily be moved to Scheme wingo: civodul: for me it is perfectly fine to keep our non-conforming behavior from before wingo: i have an alternate non-conforming behavior that might be interesting also wingo: it would be to evaluate the test clauses of the guard in the context of the error d4ryus: hi, why aren't fibers shipped with guile? wingo: and if any is true, we jump back to the guard, because we know that we won't need to rewind wingo: d4ryus: i was wondering that earlier today :) hard to know what to bundle with guile and what to let move forward on its own wingo: move forward or die on its own, even. if something gets in guile it never dies, which is good and bad :) d4ryus: i'd argue that doing anything with sockets in a blocking way is a bug, so there should be a way to do it right :) d4ryus: s/a way/a easy way/ mwette: IIRC, fibers requires epoll, which does not exist on the macOS, FreeBSD, etc wingo: mwette: there is a patch to add support for kqueue wingo: i think aleix is going to merge it mwette: wingo: good deal civodul: wingo: re the 2nd non-conforming option, it sounds fine: the test clauses are supposedly pure, so it shouldn't matter whether they run before or after unwinding wingo: i argued for this behavior during r6rs standardization and didn't win civodul: i vote for either that or the old behavior :-) wingo: but now that standards are dead we can perhaps choose to break them :) civodul: ah ah :-) *: wingo trololol :) civodul: well we'd been breaking it for years without even noticing wingo: yes i found that interesting wingo: oh savannah is back, good bandali: git.sv is, sv itself not yet daviid: str1ngs: just pushed all pending fixes, + a new one (there was a missing call to g-source-set-closure in g-timeout-add, g-timeout-add-seconds, copy paste bug :) ... fixed) str1ngs: daviid: okay thanks daviid: lloda: did you do this in a branch? *: daviid desperately need truncated print to be guile's default, for the repl and raised exception as well (as it is for the backtrace), for guile-cv users, then guile to provide a 'dead easy toggle mechanism' to switch from truncated print to full print 'on demand' ... daviid: *needs lloda: it's the same hack I had before, branch wip-exception-truncate lloda: daviid: lloda: I just had to redo it because of the recent changes in boot-9 lloda: but I wanted to check out set-exception-printer! that was mentioned by civodul & wingo and confirm that wasn't enough for us lloda: unfortunately daviid: yes I know, thank you for this work, although only usable by avery very advanced users, like us ... - as you perfectly know, it is impossible for any user, sometimes not even advance hackers, to use guile to do anything with large data, wether lists, avectors, arrays ... it is just impossible, how terribly sad, several years i can't even have a single guile-cv user ... depressig to be honest lloda: we'll get there daviid daviid: lloda: yes, I'm confident as well, but I got my 'phases' of it would only take few minutes, if and only if, one of the maintainer installs guile-cv, then try 'something', they wll understand ... just a few minutes ... daviid: then they'd think they want tehir children to install and ue guile-cv to learn scheme and img proc ... daviid: good luck! :) daviid: and there is a guile-cv guix pckage somewhere, so it really would take literly less then a few minutes for them to try and see by themselves how unsuable guile is in dong anything with large data ... daviid: try to open any picture they tke with a phone .. just open an image ... daviid: then try (error img) daviid: to understand that the threee 'things' must be configured to truncate by default , the repl, the raised exception ystem and tye bracktrace (which does that by default, so why the backtrace and not the 'others' ... is a mistery to me) daviid: ok, back to hack g-golf daviid: heya guilers! daviid: I am facing problem in g-golf, that although I can see what causes the exception to be raised, can't find a rational explamation to why g-golf 'reaches that weird state', nor a solution to the problem ... daviid: so I am going to 'speak it loudly', lets see if it helps :), or if someone here can point to a solution ... mwette: go for it daviid: all this is related to the Glib/GObject GSource and GClosure, provided so one can define a procedure, then ask Glib/GObject to execute it 'on demand', such as a callback, just to name ean example daviid: in g-golf (as any 'advnaced ' language binding to glib/gobject and/or gobject introspection, the g-idle-add and g-idle-timeout* procedures are implemetd 'manually', becaue they manipulate a 'high level' object (a goops instance in the case of guile) and can't 'just' call the provided g_idle_add, g_timeout_add*( functions ... these steps are very well defined, recommended in the glib manual daviid: so, let's focus on g-idle-add, the code is very short and here - http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/glib.scm?h=devel line 6- - 69 daviid: as it has to, it needs a (pointer to a) GSource instance, called source in the g-gold code, and a GClosure instance, called closure (actually a goops instance, i'll come to it in a second daviid: the source is needed because it hold' on the gclosure and is attached to a main context glib main-loop daviid: th gclosure is the part that provides the interface between gobject and the languae, it will execute a scheme rocedure on demand, and it does so by the use of what is called a marshaller, in g-golf the closure/ŋclosure infrastructure is define here http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/closure.scm?h=devel daviid: now, here is how it works: (a) a user calls g-idle-add, passing a lambda that accept no argument and returns a boolean, here is a simple example daviid: (g-idle-add (lambda () (display ".") #f)) daviid: the lambda is used to define a instance daviid: and all tha matters for those who follow, is the (specialized) initialize instance method, defined in http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/closure.scm?h=devel line 73 - 89 daviid: and what it does instantiate a gclosure (gobject) instance, tells it what is the marshaller is should use (the marshaller will execute the procedure), sink and ref the gclosure so its count ref is 1 daviid: it also permit to associate a g-closure-add-invalidate-notifier, which will be called when the gclosure count (un)ref reaches zero, which means glib will recover its memory daviid: now daviid: it also does a very important thing, which is to hold on a reference to the scheme procedure the instance is being created 'for', and that is line 83 in the closure module: (gi-closure-cache-set! g-closure function) daviid: which associated in a hash table, to the address of the pointer to the gclosure, the procedure, see line 287 - 289 i the same module, if interested, but for now, it is enough to 'trust' that the scheme procedure is cached, hence 'protected from gc' daviid: one more word about g-idle-add, then i'll aspte the example that raies the exmption :) daviid: the lambda passed to g-idle-add returns a boolean, and that boolean deterines if the idle is kept or not in the maincontext of the glib main-loop is is associated with *: RhodiumToad pays careful attention daviid`: hum, bad internet connection daviid: ok RhodiumToad: we saw "the lambda passed to g-idle-add returns a boolean ... main-loop is is associated with" as the last line from you daviid: RhodiumToad: ah, let me check the log to rewrite what misses :), sorry about this daviid: only one sentence missed, here it is daviid: the standard way of doing things, using g-idle-add, is a 'one shot callback', so as in the example above, the lambda returns #f, which means that once the main-loop has excecuted the gclosure, it destroys (g-source-destroy source) the source daviid: the example bove is this one daviid: (g-idle-add (lambda () (display ".") #f)) daviid: here is a repl example, just to make things a bit easier to understand, before the exmple that crashes and see what people think .. daviid: https://paste.debian.net/1117657/ daviid: this is a manual 'one shot' run of a closure, as a idle and a glib main loop RhodiumToad: yup RhodiumToad: (I already discovered that you can crash guile-gnome by heavy use of idle cb's) RhodiumToad: I assume this is an attempt to do that bit right :-) daviid: to show that after the code has been executed, the source has been destroyed, _but_ not unref, neither the gclosure, till their respective ref_count reches zero ... daviid: RhodiumToad: yes, let's focus on g-golf daviid: all this mens that the user, not g-golf but the user, must free the source and the gclosure 'when approriate', and her comes the difficulty, which can be illustrated by running the following example RhodiumToad: hm, that sounds like a really bad idea to me daviid: which will finally let me point to the bug daviid: here https://paste.debian.net/1117658/ daviid: line 33, is the g-gidle-add call daviid: being done in a thread, repeatidly using a named let, perfect daviid: within the loop, the source and the closure instances are 'accumulated' in the to-free variable, and when the loop counter reaches n-cycle, it calls unref-and-fre, which, if and only if the source has been destroyed, unref both the source and the closure till their ref count reaches zero, so glib recovers the memory ... daviid: so far so good daviid: when a closure is freed, it triggers the g-closure-invalidate-notifier, which removes the (gclosure procedure) entry from the hash table, so the guile gc can recover the procedure memory daviid: but in realatity, wht happens is this daviid: in the gclosure/procedure hash table, i can see that gclosure pointer addresses are always new, but the procedure is always 'the same', because guile's compiler detects the idle 'core' is always the same, and to prove this, i added (loclly didn't push of course) a few displays _and_ what happens, 'the bug' daviid: here is a paste of a runnig session of the example that raises the exception daviid: https://paste.debian.net/1117659/ daviid: this trace i added has been added in the gclosure marshaller daviid: line 226, instaed of (function (gi-closure-cache-ref g-closure)) mwette: yikes ... daviid: i have lcally (function (dimfi g-closure " " (g-closure-ref-count g-closure) " " (gi-closure-cache-ref g-closure))) daviid: daviid: and that shows 'the impossible': the scheme procedure has been freed before the gclosure has been executed daviid: which in principle is impossible RhodiumToad: ok. so the first question that comes to mind is this, there are obviously two different threads in play, how sure are you of the thread safety of this? daviid: RhodiumToad: the problem is glib does not provide a way to know when a idel has been executed and its source destroyed daviid: RhodiumToad: things only happen i one thread RhodiumToad: not so? daviid: the named let runs in one thread daviid: so the idle call and the unref-and-free procedure run in the same thread RhodiumToad: no? RhodiumToad: the idle call will come from the thread running g-main-loop, surely daviid: of course the gclosure will be executed by the glib main-loop in a unknown time, but, afaict, unref-and-free will only run if and only f (g-source-is-destroyed? source) is true RhodiumToad: as will the invalidate notifier daviid: yes daviid: but RhodiumToad: both threads are touching the hash table, yes? daviid: as said above, unref-and-free will only free those sources and closures for which the source has been destroyed daviid: both threads are indeed, but let me add one explanation daviid: (a) the scheme thread is always been called 'before', what triggers the invalidate norifier is the fact that the gclosure ref-count reaches zero, which only happens because unref-and-free calls (free closure), line 145 - 148 of the clsoure module daviid: that code should never be executed unless the (parent source) has been destroyed daviid: then (b), the invalidate notifier, in this case, does nothing because the hash entry has been removed already daviid: the problem that raises the bug is that the hash entry has been removed befre the idle has benn executed daviid: it's a bit like qauntum mechanic: you can read in the example that the unref-and-free code will only run if the source has been destroyed, which in principle can only happen in the glib main-loop and only if the idle has been executed daviid: RhodiumToad: do yo have a cpoy of g-golf by any chance? RhodiumToad: not at present, though I can try it out later daviid: as you wish, i was curios RhodiumToad: still reading the code daviid: i'm like facing a quantu mecanic stae daviid: :) RhodiumToad: I make heavy use of idle callbacks in another language binding, but not at present using threads which obviously complicates things daviid: although nothing of this can happen if the source hasn't been destroyed, it appears it does daviid: RhodiumToad: yeah, this is complicated daviid: if you had g-golf, i can paste an exmaple of almost the same code that never crashes RhodiumToad: aha. this situation is described in the docs daviid: really? daviid: woh RhodiumToad: https://www.gnu.org/software/guile/manual/html_node/Multi_002dThreading.html#Multi_002dThreading RhodiumToad: see the part "taking hashtables as an example" daviid: ok, let me read daviid: RhodiumToad: meanwhile, here is a example that works indefinitely, does not crash nor leaks, but i consider not robust, hence my 'other' attempts that leaded to this dscussion daviid: in this example that 'runs ok', it is just a matter of 'luck' daviid: just because of the usleep, the idle has alawys beene xecuted before the free procs are called ... daviid: RhodiumToad: not sure, as i tried to explain, there is only one thread touching the hash daviid: in my case RhodiumToad: no daviid: not in the pste of the bug, the seconf value, 4, is the ref count of the closure: thismeans that the invalidate-notifier has _not_ been called daviid: 'note' daviid: https://paste.debian.net/1117659/ RhodiumToad: you're missing the point that the hashtable can contain more or less anything RhodiumToad: you seem to be thinking of the hashtable as an atomic thing which is either updated or not, which is false RhodiumToad: and I don't understand why you think it's accessed only from one thread, daviid: ah, yes i thought it was RhodiumToad: because the main thread calls the invalidate notifier which calls gi-closure-cache-remove! which modifies the hash table, RhodiumToad: and the loop thread also modifies the hash table daviid: the invalidate notifer as not been called RhodiumToad: it's been called on some other object daviid: but if, it is a reasult of the unref, that happens in one thread RhodiumToad: you're queueing up thousands of idle callbacks for the main thread, no? daviid: yes RhodiumToad: modifying the hash table from one thread while modifying a different value from another thread can screw it up, if I read the docs right daviid: or the second thread i should say RhodiumToad: clearly, the hash table might be reorganized as a result of one of the inserts, and that could interact poorly with modifications from another thread daviid: hum, we are talkng passed each other RhodiumToad: have you done much work with threads? daviid: have to change place, bb in a min RhodiumToad: time to go read the guile sources... RhodiumToad: anyway, there's a fairly easy way to confirm or refute my theory here. daviid: :), i am going to remove the invalidate notifier, give me a sec daviid: as an experiment RhodiumToad: what I was going to suggest was using a (with-mutex) form around the hashtable accesses in the gi-closure-cache functions daviid: RhodiumToad: will try that to, many thanks for your help spk121: daviid: Not sure if I've followed the whole point, but, the idle will be called from the glib-main-loop thread, while your guile code is running in the guile main thread, so maybe a mutex is the way to go daviid: spk121: the idle is called from the main thread, but the unref-free always from the scheme thread daviid: anyway, will try the suggestions spk121: oh, ok daviid: and i'm certain the invalidate notifier is never called _before_ the unref-free, but will try to prove that in a second RhodiumToad: that isn't the point, you're still thinking of the hashtable as being atomic with respect to threads RhodiumToad: and it's really not daviid: RhodiumToad: within one thread it must be, no? RhodiumToad: no RhodiumToad: not while another thread might be modifying it, even to change a completely separate value daviid: the other thread doesn not modify it daviid: nbut let me prove this daviid: maybe :) RhodiumToad: what, I'm just imagining this call to gi-closure-cache-remove! in g-closure-invalidate-notifier? daviid: exatcly, I have removed the call to the invalidate daviid: and it still crashes RhodiumToad: can you paste the actual code changes you made daviid: here is the 'new definition' https://paste.debian.net/1117665/, which comments the call to g-closure-add-invalidate-notifier RhodiumToad: ok, so the invalidate notifier is out of play daviid: yes RhodiumToad: hm RhodiumToad: but your debug output is from g-closure-marshal? daviid: yes daviid: the marshaller runs in the main thread RhodiumToad: which again is being called on the main thread daviid: right, but no thread could have deleted the source before the mashaler is run RhodiumToad: but the other thread could be modifying the hashtable. daviid: not until the idle hs been executed RhodiumToad: if one thread is inserting into the hashtable while another thread reads from it, there is no guarantee that it will correctly find even an existing value daviid: ah ok, i issed that daviid: sorry daviid: my bad RhodiumToad: the idle for object 1 could be running while the main thread is inserting object 2, no? daviid: yes RhodiumToad: and if object 2 causes the hash table to be resized/rehashed, then the main thread might search for object 1 and not find it daviid: i thought from one thread, reading the entry on a gclosure address woud never fail daviid: even if removing another entry, but these ops are in the same thread as well ... but that 'a removing' may affect a retreival puzzles me RhodiumToad: it's probably the insertion that affects the retrieval and not the removal daviid: probbly, because if i wait 'enogh time', it works RhodiumToad: if I read this hashtable code right, then on a rehash, it swaps in the empty "new" vector before populating it, RhodiumToad: so the likely failure mode of a concurrent lookup is to find nothing daviid: so, i should 'rehabilitate the invalidate-notifier and protect https://paste.debian.net/1117665/ with a mutex, line 11 daviid: RhodiumToad: that explains everything, mny thanks RhodiumToad: that's the thing to test to see if this is a correct analysis of the problem daviid: i wonder how performance will be affected RhodiumToad: you can try it even without putting the invalidate-notifier back RhodiumToad: just protect every single hash-ref/hash-set/hash-remove call on this hashtable with the same mutex RhodiumToad: see if that fixes it RhodiumToad: (with-mutex) does the whole dynamic-wind dance. you might use the lower-level mutex functions instead, but I'd worry about thrown errors daviid: i'll start usig with-mutex, then improve later ... daviid: in this code, http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/closure.scm?h=devel you would then protect in the definition of gi-closure-cache-ref (line 282), gi-closure-cache-set! and gi-closure-cache-remove! right? daviid: long time didnt use with-mutex ... RhodiumToad: right (as far as I can tell from just reading this) daviid: of course daviid: i bear the full responsability :) RhodiumToad: of course if I'm wrong then adding the mutex won't help and we'll have to take another look *: RhodiumToad still very interested in having working gui functionality from guile daviid: RhodiumToad: yeah, when this is solved, i'll work o signals, then g-golf becomes 'fully' usable daviid: should i define the mutex as a top-level variable? RhodiumToad: define it where you defined the hash table daviid: ok RhodiumToad: they are conceptually a single object daviid: RhodiumToad: bingo, it works fine now! spk121 thanks as well ... thanks both RhodiumToad: ok. so the immediate problem analyzed, I'm wondering if this is actually the best approach RhodiumToad: you said that glib doesn't provide a way to know when an idle source is destroyed, daviid: RhodiumToad: I wish the user wouldnt have to free the source and the gclosure, but although we can check if a source has been destroyed, there is o (very nfrtunately) g-source-destroy-invalidate-norifier RhodiumToad: but surely this is what GDestroyNotify in g_idle_add_full is for daviid: RhodiumToad: but, that is obly avalable to those bindigs that use g_idle_add_full, which g-golf can't RhodiumToad: why can't it? daviid: because g-golf is pure scheme, and closures are impemented using goops RhodiumToad: yes, and? daviid: but it is a glib design mistake really, i complained about this but ... RhodiumToad: ah. GDestroyNotify can only be a C function? not a closure? daviid: RhodiumToad: g-golf does not even call g_idle_add, not g_timeout_add functions RhodiumToad: ? daviid: yeah, it's complicated i don't have time to explain this to you now, but feel free to look at the code, (g-golf hl-api glib) and (g-golf hl-api closure) RhodiumToad: oh I see what you mean daviid: the thing is, glib does not provide g-source-add-invalidate-notifier daviid: which is terrible daviid: maybe i can write one mysekf, i'll see about that daviid: it's an idea actually daviid: GDestroyNotify 'has to be a C function' is not the roblem, marshallers also have to be C functions ... the proble is that without usig g_idle_add_full, there is no way to 'attach' a destroy norifier, afaict daviid: I mean these must be defined and 'respect' a C function template, if you look at g-closure-marshal and %g-closure-marshal daviid: the problem is even if i define a scheme procedure that respect the GDestroyNotify C def template, there is no way i can attach it to the source 'as it is' (but maybe i ca cook something in C i'll see about that) str1ngs: hello daviid, this was a pretty long thread. do you need me to test anything here? daviid: str1ngs: no, many thanks daviid: it's all solved now str1ngs: oh great, sorry for the slow response. I just saw your query now daviid: no problem, i was actually speaking loud, but lucky to receive help from li daviid: RhodiumToad: and spk121 to .. daviid: str1ngs: I pushed a fix, you should pull and run the make dance ... daviid: have to run, tx again, b tomorrow ... zig: hello #guile zig: new episode of gnu guile hacking where I debug a babelia: http://hyper.dev/gnu-guile-hacking/gnu-guile-hacking-16.mkv rekado: spk121: hey, I was going to upgrade the Guix package for guile-gi, but the “init_check” test fails. rekado: it’s the only test that fails. rekado: Do you have an idea why that might be? spk121: rekado: Hmmm. I don't know. spk121: It is a pretty simple test, but it relies on the characteristics of the Gtk typelib and library spk121: rekado: is your build environment console only? Gtk init_check may just be failing because Gtk thinks that there is no X11 rekado: spk121: yes, this might be it. I’ll try to work around it. Thanks for the hint! stis: tja guilers! zig: o/ str1ngs: rekado: assuming this is a guix package. with nomad I use this hack https://github.com/mrosset/nomad/blob/master/guix/gnu/packages/nomad.scm#L76 which I snarfed from a package in guix. str1ngs: nomad also need to init gtk for tests. so maybe that will help. zig: I will just use wiredtiger memory backend as thread safe hashtable. That will lead to less lines of code, which is known to keep problems away. Bonus, I can reuse that very in-memory okvs (written in C) to store the enigmatic parsed query AND parsed texts. Much much much less lines of code. zig: and maybe performance will at the rendez-vous :) zig: if cache tuning is not involved. wingo: o/ dsmith-work: What would be a better name for "bytevector"? It just feels clumsy as a name. "string" is nice. No one says characterarray or charactervector. RhodiumToad: string is a sequence of characters though. dsmith-work: Yes. But back in the day, that was also a sequence of bytes. RhodiumToad: bytevector is probably as good a name as any, unless you want to go with "blob" RhodiumToad: in postgresql we call them "bytea", which is probably not a good name dsmith-work: Something like blob, but different. Something along those lines. Single syllable. dsmith-work: "poab" Plain Old Array of Bytes. But I don't like that at all. jcowan: In Algol 68, and in early drafts of R6RS, the term was "bytes". One bytes, two byteses, ... jcowan: I did push for blob, but the R7RS-small committee thought it was gratuitously different from R6RS dsmith-work: In some ways, blob is not bad at all. But is suppposely for "large" things. (Firmware images, videos, ..) dsmith-work: Bytearray is ok. Just wishing there was something nicer that's all. dsmith-work: jcowan: Did you actualy ever use algol? jcowan: Algol 60 in one college class (with punch cards) jcowan: I studied A68 closely but never used it in anger. jcowan: I have a preso on A60 .... jcowan: http://vrici.lojban.org/~cowan/Algol60.ppt jcowan: I started out by playing the William Tell Overture jcowan: "Return with me to those thrilling days of yesteryear, when coders wrote on coding forms, I/O was on punch cards and line printers, and computers were used to ... compute!" RhodiumToad: year or two ago I installed a copy of the mainframe OS I used at university just out of nostalgia. there was an algol-w compiler in there somewhere RhodiumToad: also a fairly early xlisp dsmith-work: Ahh xlisp. RhodiumToad: not all that many compilers unfortunately due to licensing issues dsmith-work: The first lispy thing I ever touched was advsys, an interactive fiction thing by David Betz, of xlisp fame. dsmith-work: Didn't they put xlisp into AutoCAD ? RhodiumToad: dunno. RhodiumToad: lisp was I think the third high-level language I learned as a kid RhodiumToad: after basic and forth dsmith-work: Yey Forth. dsmith-work: Did several embedded systems with Forth. jcowan: Algol W was halfway from A60 to Pascal jcowan: there are about five A60 compilers/interpreters available now RhodiumToad: I never did algol 60, but I did encounter Simula jcowan: RhodiumToad: Indeed, the Simula compiler can handle A60 programs just fine: it's one of the five I mentioned: jcowan: GNU Marst (compiler to C) jcowan: Nase A60 (interpreter) jcowan: Algol60i (interpreter written in Python) jcowan: Racket Algol 60 (compiler to Scheme) jcowan: Cim (Simula 67 compiler, near-superset) lispmacs: ok, I'm about to take the plunge and convert my desktop PC from Debian to Guix System lispmacs: here it goes, see ya on the other side, hopefully! *: lispmacs emerges on other side of his Debian -> Guix desktop conversion zig: o/ lispmacs: now, I've got Guix system and emacs *: lispmacs goes to bed zig: fwiw, I pushed a definition for guile-2.9.5 (and guile-arew (previously known as guile-r7rs)) in my guix channel at https://git.sr.ht/~amz3/guix-amz3-channel/ civodul: zig: i've also updated "guile-next" in guix.git :-) zig: neat zig: gnutls requires a patch to be build with guile-next civodul: zig: yeah, the changes were committed upstream but we're using an older version civodul: i think we should add a "guile3.0-gnutls" package based on that newer version civodul: wingo: there are a few "guile3.0-" packages and they're happy with 2.9.5: http://ci.guix.gnu.org/eval/8882?status=succeeded civodul: gdb support in Guile 3.0 is broken zig: bumping gnutls to 3.6.10 is not enough, the build segfault on a call to guild command. retropikzel: How can I get parameter from POST request body easily? retropikzel: No, not from body but from place they are supposed to be. Are they supposed to be in the body? ng0: wasn't a new gdb released? I've just seen gdb being merged for my system, but this might be unrelated to gdb support.. zig: retropikzel: yes POST params are in body. use https://github.com/a-guile-mind/guile-web/blob/master/src/web/decode.scm zig: retropikzel: the default encoding is the same as query string. retropikzel: zig, thank you very much :) zig: retropikzel: file uploads use something else. zig: the code of decode could be better retropikzel: I have version 2.0.11, on the website it says that to install 2.2 in Trisquel but there is no package guile-2.2, only guile-2.0. I need to compile to update. zig: retropikzel: or install guix on top of trisquel zig: retropikzel: yes, it says 2.2 because that is what was stable on ubuntu / guix at the time. zig: retropikzel: you can use those files with guile 2.0 I think. zig: or check the NEWS file in git master zig: retropikzel: mind the fact that the above link is just slapped together procedures that I had will *experimenting* webdev. zig: retropikzel: hence there is prolly better implementation and missing stuff (like file upload retropikzel: Ok zig: retropikzel: I made it work for my usecase, but once you have a good enough grasp of scheme or guile, look also at artanis. zig: I hesitated to delete the repo, but... promised myself to never delete anything. zig: I hesitated because it is far from perfect. retropikzel: Dont delete anything retropikzel: I have deleted so much stuff over the years and I regret it zig: yes zig: I learned that the hardway retropikzel: I get the value from body like this now: https://paste.artemix.org/s/HRkIYN was fun to do and fits my case for now eiro: hello people eiro: is there a way for a lambda to call itself? something like the perl __SUB__ symbol ? eiro: http://mc.aude.re/pub/tmp/1574434800/tcrguile.txt < i would like to replace the inner function but maybe it's better to write that way ? civodul: hi eiro! civodul: eiro: you can do: (define (fib x) (if (zero? x) 1 (fib (- x 1)))) civodul: it's a recursive function eiro: civodul: i know but in the case of factorial, you need 2 arguments to get a tcr eiro: so what i did is a 1 arg function based on the definition then the call of a 2 args function eiro: i used a function instead of a lambda just because i don't know how to make a lambda recursive to itself eiro: (maybe it's just impossible to do so) mwette: eiro: you need a name, but you can use a let also (let ((f (lambda ...))) (f 1 2 3)) mwette: eiro: check out named-let (let foo ((a 1) (b 2) ...) xxx (foo 4 5 ..)) jcowan: see Chibi wingo: moin weinholt: greetings zig: o/ andrzejku: hello andrzejku: :) wingo: i wonder if we can release guile 3 before 2020 wingo: i think maybe i get a 2.9.5 out today if i am lucky and then 2-3 more releases before FOSDEM wingo: civodul: wdyt about this for release schedule: guile 2.9.5 today maybe, and ~biweekly releases until FOSDEM, at which point we have a guile 3.0 wingo: hello also :) civodul: hi wingo! civodul: well, why not! :-) civodul: though we'd need to test users somehow wingo: indeed civodul: to make sure we don't let compatibility issues through civodul: i could give it a try with guix wingo: that would be neat wingo: if guix uses nothing deprecated, it should work wingo: nothing deprecated in guile 2.2 i mean civodul: yes, that should be fine civodul: well i meant using Guix to build stuff with 3.0 :-) wingo: ah yes :) civodul: anyway, exciting times! wingo: :) civodul: wingo: BTW, you may want to submit a talk to the minimialist track! civodul: i think the deadline is in a couple of days jcowan: yes, you have to make sure the new users are fully compatible with the old users zig: rekado: http://issues.guix.info/ is buggy is returns 504 gateway timeout. zig: rekado: btw, what is the hardware setup? civodul: zig: should be back to life now civodul: rekado: i've restarted it on your behalf civodul: we should write a service for it :-) *: zig comparing issues.guix.info time to reponse vs. babelia. The first query against i.g.i is much more slower than the second, which is to be expected, but still very slow response time. babelia cli takes 400ms, whereas issues.guix.info takes 4000ms zig: on issues.guix.org the second query is much faster with 100ms zig: including network roundtrip. rekado: zig: that’s because there’s caching rekado: issues.guix.gnu.org is slow because debbugs is slow rekado: the first time you connect it queries debbugs and waits for a response rekado: I wanted to cut out the connection to debbugs, but I can’t free time to work on this rekado: it’s *almost* ready, but someone would have to implement the missing 2%. wingo: i sympathize *: wingo distchecks davexunit: civodul: the new declarative modules broke some stuff in my own projects so that's a potential source of issues for guix. davexunit: luckily, I was able to reimplement some things that made the affected modules compatible with 2.2 and 2.9 wingo: davexunit: what kinds of things broke? wingo: i am interested in hearing about the bugs :) could be that it should be off by default, dunno davexunit: I had a top-level mutable variable and all the modules that referenced it did not "see" updates to that variable because they just held onto its initial value. davexunit: like if I had a top-level (define foo #f) and later did (set! foo #t) it wouldn't matter because all of the modules that reference foo just took its initial value and got rid of the variable deferencing bit altogether davexunit: in my particular case, I was storing some information about opengl state this way. I switched to using a kind of box instead. wingo: davexunit: but the set! foo should have made that variable not declarative wingo: it could be that there is a bug somewhere wingo: or did you do set! foo from a different module? *: wingo distchecks a third time; fingers crossed :) bandali: hey davexunit, any plan to cut a 0.2.5 haunt release anytime soon? :) wingo: ok guile 2.9.5 release done :) zig: \o/ davexunit: wingo: IIRC the set! came from a different module. davexunit: my problems were completely alleviated when I switched to a boxing approach, which was the better design anyway. davexunit: rather than sprinking globals around to track gl state, I made a dedicated data type to track all of the relevant state. davexunit: the fix was a lot easier than figuring out why things had broken in the first place. my programs were not crashing, but my opengl windows were just black because all the state was messed up. davexunit: set!s were working, so I was scratching my head wondering how the program state could be so messed up if my program was setting the proper state at the proper time. davexunit: anyway, guile 2.9.5 woooooooo! davexunit: bandali: is there a change you are looking for in haunt? dsmith-work: Happy Friday, Guilers!! nly: hi zig: o/ zig: civodul: I think there is no mention of *thread safe* in the manual about weak hash-tables? zig: ref: https://www.gnu.org/software/guile/manual/html_node/Weak-hash-tables.html#Weak-hash-tables *: davexunit wishes that bytevector->pointer didn't allocate a new pointer object every time davexunit: bytevectors should just cache a pointer or something civodul: zig: ah, but they are thread-safe, really :-) civodul: davexunit: long ago i started looking at "immediate pointers", but i think there was a stumbling block davexunit: civodul: I have to cache pointers in lots of places to avoid generating lots of extra garbage davexunit: lots of let-over-lambda when wrapping ffi funcs davexunit: so that the bytevector and pointer only get allocated a single time davexunit: which only works under the assumption that you won't use these procedures in a multi threaded program (: civodul: yeah, that's not great civodul: i had: +#define scm_tc3_aligned_pointer 3 civodul: but that collides with immediate numbers, iirc davexunit: I wonder if a less general approach to help the bytevector pointer case would be ok? davexunit: I don't know about everyone else, but that is 99% of what I make pointers out of davexunit: the occasional string, but almost always bytevectors civodul: i guess a hack would be to allocate a pointer object together with the bytevector civodul: so that bytevector->pointer just needs to return that davexunit: yeah that or defer the allocation until a pointer is needed and then cache it civodul: yes davexunit: I am feeding lots of data via bytevectors to opengl and openal at 60hz so I cache as many pointers as possible in various data structures davexunit: as far as opengl goes, I have things like 4x4 matrices that cache the pointer to their underlying bytevector. same for 2d/3d vectors, colors, etc. civodul: woow, quite some overheat civodul: *overhead civodul: well overheat as well, maybe? davexunit: it just sucks to have to do this for *every* data type that uses bytevectors *: civodul nods davexunit: I've been meaning to refactor some of my code to take care of this redundancy davexunit: but if it could be solved at the core it would be great :) davexunit: but once I have this I'll start complaining about struct unboxing ;) davexunit: though now that I've taken a pretty deep dive into structs I think I will just make structs with a single field. that field will be a bytevector that has all the real data packed into it. davexunit: structs are... weird... but I was able to do something neat with them that I think is cool and hopefully not cursed. civodul: i guess you could have your own bytevector type that wraps a pointer + bytevector civodul: as an interim solution davexunit: yeah. davexunit: I worry that eventually this will be a multi-project problem for me. civodul: yes, sure, that's why i said "interim" :-) davexunit: yes of course :) bandali: davexunit, sort of, i'd like jakob's commit bandali: and overall, i think there are a couple of other nice commits sitting on master bandali: and there hasn't been a release for nearly a year bandali: is there anything blocking a new release? civodul: bandali: 2.9.4 wasn't long ago civodul: and wingo proposed to release 2.9.5 today or so bandali: civodul, agreed :) i was talking about davexunit's haunt though :p bandali: haunt's newest release is 0.2.4, from 2018-11-29 bandali: https://dthompson.us/projects/haunt.html wingo: civodul: done alerady :) wingo: could be we could optimize out the heap allocation in bytevector->pointer, in some cases *: wingo zzz civodul: wingo: i have a tentative patch for bytevector->pointer civodul: seems like it's easy, as long as one doesn't set a finalizer civodul: ooh, congrats on the release, wingo! *: civodul looks at backlog civodul: davexunit: what kind of breakage did you have with declarative modules? civodul: bandali: ah! a Haunt release would be very welcome, indeed! bandali: :) *: civodul gently prods davexunit dsmith-work: Hmm. Current .pdf Guile manual is only 954 pages long. dsmith-work: TOC ends on page 20. jcowan: Only. chrislck: manumanumanu: for my previous code I had simplified https://stackoverflow.com/questions/7313563/flatten-a-list-using-only-the-forms-in-the-little-schemer/7324493 chrislck: combine all 4 snippets into one, using srfi-1 forms as appropriate, and it becomes clear how it works chrislck: but I admit passing the named let as a parameter to fold was a noob genius that made the code beautifully simple manumanumanu: jcowan: Which is of course not strange once you think of it (at least for a language with proper TCO). Converting it to something else than regular recursive calls seems like a waste of life :) I was just surprised, since I had never seen it before. roelj: Does anyone have a small example on how to use 'flock'? zig: hello #guile roelj: What's an efficient way to do thread-safe file access in Guile? (I want to read to read a list from a file and cons a value to it) roelj: And do that without losing a value from multiple threads. wingo: do you want to update the file? roelj: yes wingo: what would the contents of the file look like before and after, if before had 2 items and after had 3? wingo: if the items were numbers, say roelj: ((D E F) (A B C)) -> ((G H I) (D E F) (A B C)) roelj: Oh, sorry, numbers: (2 1) -> (3 2 1) wingo: in that case, i would create a new file -- i see that guile's api here is not great wingo: see the private call-with-output-file/atomic from (system base compile) actually wingo: i think that's what you want roelj: Ah, let me see roelj: So, IIUC, it creates a temporary file, does its I/O and puts it in the target place. roelj: What happens when two actions are performed on it simultaneously? Only one will end up in the target (the last action)? cehteh: roelj: would storing the stuff in a sqlite be an option? roelj: cehteh: Currently my program does not have sqlite as dependency, so I'd prefer a solution without external dependencies :) roelj: Maybe a log structure would work better. Is 'write' thread-safe? wingo: roelj: ah :) that is a more tricky issue wingo: write is not safe in that sense wingo: i agree i would use a database of some kind wingo: sqlite maybe, or git, or something like that manumanumanu: Have a .lock file then. wingo: yes, file locking can work too zig: fwiw, sqlite is a lot ceremony because of the single-writer thing. SQLite recommends to avoid direct manipulation of files on the file system, as the file system does not do what you really except to do. (sure, a software vendor will not say that its very own software is useless). manumanumanu: until your users have an accident which crashes the program and they then can't access the files :D manumanumanu: maybe store a unique "session id" in the lock file manumanumanu: and warn if the lock file is there, but with an old session id manumanumanu: roelj: or use a dedicated writer thread that accepts input through a queue. manumanumanu: I'm full of ideas this morning! manumanumanu: I am just trying to postpone the inevitable: going back to editing XSLT and XML DTDs. zig: that is database work. cehteh: sqlite isnt the best for that, but if it would be an option then likely the easiest as it does all the synchonization in a bullet proof (but low performing) way roelj: Thanks for the ideas :) cehteh: if its not, then as manumanumanu saied, single writer threas is a good idea cehteh: otherwise you end up in locking any synchonization hell zig: cehteh: wiredtiger (or sqlite lsm extension) is a little bit lower level but much more versatile. cehteh: i wouldnt go into details but rolling that on your own with low levle posix/filesystem calls will be pita zig: +1 roelj: Hehe, I'm beginning to see the complexity of it cehteh: you can do a global lock thing and single writer cehteh: beware of deadlocks cehteh: and figure out how to prevent data races :D roelj: Reinvent a database :D cehteh: basically cehteh: lor just log writing, append only, still with locking (that you write full records) cehteh: once a while reconstruct the original file zig: it also depends whether the data is bigger than memory or not (oom killer is still around) wingo: made a little thing for wasm work: https://gitlab.com/wingo/guile-wasm wingo: i suppose we could compile wasm files into .go files manumanumanu: wingo: cool. What does "decode it into a scheme representation" mean? Actual scheme code? manumanumanu: But I guess that would not be a small side project :D :D manumanumanu: Answered my own question! zig: neat zig: TIL: there is popcount function wasm zig: TIL: there is popcount function in wasm zig: :/ manumanumanu: everybody needs it! zig: manumanumanu: really? when is it useful? zig: I think, i stumbled upon it while computing the hamming distance or something like that. zig: hamming distance between two bit strings. manumanumanu: I use it when I work with bitvectors. manumanumanu: but mostly, it is used in HAMTs manumanumanu: at least, that is where I have seen it most zig: oh it make sense. zig: hamming distance in C: __builtin_popcount(x ^ y) (ref: https://en.wikipedia.org/wiki/Hamming_distance#Algorithm_example) zig: it is the count of substituions required to make x == y manumanumanu: Is x a power of 2? (= 1 (logcount x)) zig: I used it in (novel?) algorithm with simhash to compute and query similar or duplicate document (ref: https://hyper.dev/blog/fuzzbuzz-hash-algorithm.html) wingo: i usually use (zero? (logand n (- n 1)) wingo: though that is true for 0 also zig: manumanumanu: no it is the simhash of something where simhash is a locality-senstive-hash. zig: I only have an implementation in another programming language. manumanumanu: wingo: the satisfaction of doing something with bitfiddling is enormous, isn't it? :D wingo: :) manumanumanu: When I finally understood that constant time hex encode I was euphoric wingo: i bitfiddle all the time & find it a bit gnarly, personally :P manumanumanu: For me, a lowly classical musician, it is still novel. Every time i think of solving anything using it, it is like an endeavour! "Will it work? Will it be fast? Will I survive?" jcowan: https://vaibhavsagar.com/blog/2019/09/08/popcount/ is pretty comprehensive manumanumanu: A friend of mine who is bitmucking professionally (embedded C stuff mostly) has popcount as a litmus test for programming languages. If it has popcount, it can probably be used for serious work. If it hasn't he can't be bothered. manumanumanu: wingo: that logand thing is much prettier. I expect popcount to use at least some cycles... wingo: if you like this sort of thing, you might enjoy the book "hacker's delight" manumanumanu: I will check it out, thanks jcowan: To each their own, as the devil said when he painted his tail sky-blue. jcowan: It's especially interesting that gcc and clang will *detect* an implementation of popcount they are compiling and replace it with the one instruction roptat: I think I already asked, but I can't remember how to put a string to lower case? manumanumanu: string-downcase manumanumanu: ? manumanumanu: or string-downcase! if you want to maybe-mutate it. zig: Thanks! manumanumanu: jcowan: it is surprising how many compiler optimizations are just regular pattern matching (x % 2) == 0 being the most famous one. manumanumanu: It has tricked millions of programmers into believing there is nothing slow with modulo... lloda: roptat: you can type ,a case at the REPL to find this sort of thing roptat: thanks, for some reason I couldn't find it in the manual, I must not have searched properly lloda: whish there was an override of sorts for format lloda: like (format p "BEGIN~pEND" (lambda (p) (write-things-to-p))) lloda: unnecessary I guess zig: there is call-with-output-string https://www.gnu.org/software/guile/manual/html_node/String-Ports.html#index-call_002dwith_002doutput_002dstring lloda: that'd work *: zig got greenlight for the one and only test directly related to full-text search in guile-babelia. stis: hey guilers! str1ngs: hello stis str1ngs: wingo: does guile-wasm mean guile scheme can be compiles to wasm? str1ngs: compiled* wingo: nope, just a toolkit for working with wasm file wingo: s str1ngs: ahh okay that's what I thought. str1ngs: I wonder if though a C to wasm, could compile guile to wasm. that would be intresting zig: I tried emscripten with another scheme, I gave up, IF I work on something related to that I will target wasm directly instead of compiling the whole compiler. str1ngs: zig: right, compiling direct to wasm would be ideal nly: hi str1ngs: hello nly nly: hey str1ngs nly: :) nly: str1ngs what do you think of this static website? https://o-nly.github.io/resonance/ generated using wintersmith str1ngs: nly: looks really nice. are you aware of https://dthompson.us/projects/haunt.html ? nly: yup nly: does nomad have a website yet? str1ngs: nly: btw I have a project maybe can be combined with https://o-nly.github.io/resonance/ str1ngs: nly: not yet about the time I start working on documentation I'll probably create a website str1ngs: nly: the project is https://github.com/mrosset/home nly: if you want i could try to setup a website using wintersmith or maybe haunt is even better? what say? str1ngs: nly: I think I rather have some documention first. it's definitely on my todo list though nly: maybe outsource some work :) nly: page not found https://github.com/mrosset/home str1ngs: nly: ahh it was private, try now nly: i saw it zig: I am confused both of you nly and str1ngs are working on a browser? str1ngs: zig: right it's called nomad which is an extensible web browser using guile nly: at this point i'd like to point you to a website for nomad zig nly: http://savannah.nongnu.org/projects/nomad nly: but it's not made yet nly: by website i mean just someplace with all the relevant links, irc, source, docs etc. zig: ah ok you are working on the same project? nly: i made the bookmarks and shroud module nly: yes zig: oh ok str1ngs: nly: I think ideally I'd like to create the manual with texinfo. then provide that online str1ngs: nly: like proper GNU projects do zig: what branch do you recommend to read? str1ngs: zig: feature-release is the stable branch str1ngs: zig: though there are newer branches that are moving the API towards gobject introspection. zig: ok nly: str1ngs that would best, but it's a start str1ngs: nly: if you wanted to work on something I'd say the manual would be a good start str1ngs: at least the autotools framework to generate a manual nly: ok, that seems reasonable str1ngs: nly: here is the guide line https://www.gnu.org/prep/standards/standards.html#Documentation str1ngs: nly: maybe we use texinfo to generate the web documention html and then haunt or something for the landing website. str1ngs: nly: then we can also provide the html documentation internally, why not it's a web browser after all zig: "The size of the cache is the single most important tuning knob for a WiredTiger application. Ideally the cache should be configured to be large enough to hold an application's working set." zig: :/ zig: https://source.wiredtiger.com/3.2.0/tune_cache.html zig: that is... sad to read. weinholt: zig, it would be true for any cache, no? zig: (a post about the future of databases http://www.cs.cmu.edu/~pavlo/blog/2015/09/the-next-50-years-of-databases.html) zig: what is the working set? to me there is "what is requested often" that I will call hot data and "what is requested less often" that I will call cold data. The cache should keep around only the hot data. Hence have statistics about the whole database one what is queried often or not. zig: So the cache assuming, it is a fraction of the total memory used by the database, should not be the whole database, it should only be the data that is requested often. zig: but at the moment, I am loading what I downloaded from scheme websites, html only is around 3GB. But it is more that 8G in memory. zig: AND I just figured, that I made a typo (!) and the database is using mmap. zig: that typo was not catched because I forgot to fix a bug reported during the SRFI process (related to keywors / options that must be checked). zig: For the search engine usecase, it is very difficult to figure what is the working set. zig: also the cache must be big enough to keep the data of the whole transaction in memory. weinholt: zig, are you working to bring the search engine back up? zig: weinholt: yes weinholt: nice weinholt: it will be like the old days of the internet: a search engine that actually finds interesting stuff :) str1ngs: is there a link to this search engine? jcowan: zig: A working set is all the data you have had to access in the last n time units, for some suitable choice of n. zig: str1ngs: the code is at https://git.sr.ht/~amz3/guile-babelia (only scheme, no goops ;) zig: weinholt: hopefully.. zig: jcowan: fwiw, there is n in time units that can be configured in wt. Instead one set the size of the cache, and min and max number of threads dedicated to eviction zig: here is the current config string: mmap=false,eviction=(threads_max=3,threads_min=2),log=(enabled=true,file_max=1024MB),create,cache_size=5120MB jcowan: you mean "there is no n"? zig: I have been trying since 20:00 jcowan: Anyway, that's an abstract definition, not an implementation zig: NO n yes. zig: there is no n. jcowan: That wouldn't be a cache config parameter anyway: it's what the application knows about its own history. zig: I am somewhat "happy" that wt documentation acknowledge that tuning eviction is difficult. jcowan: so for example a LRU cache is a good approximation in many cases, but not (for example) when the data are being accessed in a loop larger than the cache size, in which case evicting the least-recently-used is *exactly* the wrong thing. jcowan: What we really want is a cache that caches all the data we are about to use. jcowan: "Prediction is very difficult, especially about the future." str1ngs: zig: cool thanks. oh I don't mind goops. but then I've been trying to find an alternative data structure. I guess records is the scheme way to do things? str1ngs: zig: I'm kinda use to C a go structs str1ngs: zig: this looks very interesting, thanks for the link zig: yw zig: I guess I am not knowledge able enough to rule out oop from scheme. I never used goops. zig: at r7rs has nothing like oop. zig: at least r7rs has nothing like oop. str1ngs: one think I like goops is the generic methods str1ngs: zig: make check works but I had to hack stemmer.scm for my computed stemmer str1ngs: I'm using your channel btw jcowan: R7RS-large will, if I have anything to say about it, provide generic functions but not classes. jcowan: (that is, you can *have* classes, they just won't be in the standard) str1ngs: jcowan: thanks I will look into that anon987321: hey anon987321: about guile's support for other languages anon987321: does it mean that i can write scheme and compile it to another language such as emacs lisp or ecmascript? ft: No. There are different language frontends that all compile to Guile's VM. anon987321: thanks :) daviid: str1ngs: I pushed a new version of flatten, to (grip list), based on the one written by manumanumanu you pointed to me, thanks you both ... here http://git.savannah.nongnu.org/cgit/grip.git/commit/?id=537e8cc12fe2f3095f065084ea2b9376d548b6e6 str1ngs: daviid: IIRC that was somebody else str1ngs: daviid: this it was chrislck str1ngs: s/this/think daviid: oh, ok, well thanks chrislck (and sorry about this) wingo: moin zig: moin zig: For some reason, the naive crawler I put together using 'wget' is mirroring the whole gnu mailing archive... zig: while IFS= read -r line; do # read from stdin zig: echo "$line"; zig: wget -A "*.html" --random-wait --adjust-extension -q --mirror --no-parent "$line"; zig: done zig: here is stdin: https://git.sr.ht/~amz3/guile-babelia/tree/master/roots.txt zig: that probably because of a missing slash at the end of some the line :/ zig: anyway, I will do crawler that rely on http-get and fibers. zig: yeah, that is because it is missing a slash... chrislck: daviid: np i have plenty of commit history elsewhere ;) pinoaffe: RhodiumToad: come on, don't be such a hardass pinoaffe: it doesn't fail, it just breaks an assumption you think it shouldn't break RhodiumToad: um? RhodiumToad: any nontrivial xml file will have a namespace declaration somewhere RhodiumToad: if the input xml contains any namespace declaration that's not matched in #:namespaces, then sxml->xml will just error out on the result RhodiumToad: if it contains one that _is_ matched in #:namespaces, then sxml->xml will output invalid xml jcowan: Actually plenty of XML files don't use namespaces, because some XML-ites (including me) think they were a Great Big Mistake. jcowan: SGML had much better strategies than trying to make every name globally unique. RhodiumToad: of the ~100 xml files currently in my working directories, discounting the xml validation set, ~80% have namespaces and ~20% do not RhodiumToad: whether you think they are a big mistake is of no relevance to people who have to work with them manumanumanu: ArneBab: Well, it keeps about half of the memory if you clear longlonglist and longlonglist2 from memory as well. ArneBab: manumanumanu: yes manumanumanu: daviid: Why use match? It probably produces the same code in the end. Do you find it clearer? I am usually a match-lover, but for that case it seems to me it doesn't add much... daviid: manumanumanu: yes, a lot cleaner, but i guess all relative ... manumanumanu: :D manumanumanu: match is a thing of wonders. After watching Kent Dybvigs talk about "the macro writer's bill of rights" I love the idea of the implementation taking care of most of the dirty work to let your macros be zero cost :D manumanumanu: daviid: Happy someone uses code I wrote for good! jcowan: RhodiumToad: Yes, I know they are there and people have to work with them. I only objected to your claim that no non-trivial XML documents lack them (excluding the xml: namespace which is a special case). jcowan: About 10 years ago I was working with a company that had about a billion XML documents, all namespace-free. RhodiumToad: I'm guessing they produced them themselves daviid: a billion, really? RhodiumToad: I don't see why not jcowan: They formatted them themselves, yes, but did not produce the content. jcowan: LexisNexis has all the legislation for the U.S. and all 50 states, all the government regulations, court decisions, detailed information on all lawyers (defined as members of bar associations), legal news stories, .... jcowan: A billion was my best estimate at the time. When my team needed samples of documents of a given type to work on, they usually sent us about a hundred, but when we convinced them that we really could drink from the firehose, jcowan: the sample size went up to tens of thousands. jcowan: We then sent them back detailed transformation instructions to convert their XML into semantically much richer XML according to about 40 schemas (with about another 40 in the pipeline). And yes, our XML had namespaces, though they really weren't necessary at all. RhodiumToad: in fact, dealing with missing namespaces brings out even more issues with (sxml simple) manumanumanu: chrislck: the old code you replaced does something spectacular I didn't know was possible. it defines the named let lp and passes lp as a proc to fold. manumanumanu: is that supposed to work? is the expansion of named lets such that it should work, or is it implementation dependant? stis: http://c-lambda.se/units.html stis: have fun ... jcowan: manumanumanu: Named-let procedures are like any other procedures: they exist and are callable until the GC destroys them chrislck: daviid: isn't manumanumanu's flatten more efficient because it omits reverse! and append? daviid: chrislck: long time written, but does it solve the same 'class' of problems? like 'deep nested' lists ober: can the elisp support be used to say use the org-mode stuff directly in guile? amz3: idk amz3: elisp support is like one the most requested feature on this channel. amz3: wingo: I could not find the crawler I wrote about previously. I will need it, anyway, so I can do it today? zigzag: back zigzag: under a new nick (that does not look like a war game handle) wingo: RhodiumToad: regarding ssax bugs, in practice there is no ssax upstream, so we're all left to handle things as we see fit wingo: in guile we can fix ssax directly if appropriate. send a mail to bug-guile@gnu.org wingo: i had totally forgotten about mark's r7rs-wip branch from 5 years ago wingo: i wonder why things from there didn't make it in civodul: hello wingo! civodul: wingo: i'm guessing it fell through the cracks :-/ wingo: ah well chrislck: daviid: yes manumanumanu's https://pastebin.com/gX2vZM8A flattens arbitrarily deep nested lists chrislck: thanks manumanumanu... https://github.com/Gnucash/gnucash/commit/fbc7c902 roptat: how do you write a procedure that has side effects? like (define (add-1! a) (set! a (+ a 1))) roptat: if I have (define b 1) (add-1! b) I'd like b to be 2 now wingo: it needs to be a macro in that case RhodiumToad: ok, sent mail about the bug roptat: oh, ok wingo: hoo, the srfi-99 rationale is tedious jcowan: srfi-99 was highly political str1ngs: on the topic of records is there a srfi that provides features like guix's define-record-type* ? basically it provides syntax constructors with named fields wingo: $ meta/guile wingo: GNU Guile UNKNOWN wingo: 'doh jcowan: str1ngs: Not that I know of, no. str1ngs: jcowan: okay, thank you pinoaffe: I was unable to find a base set of utility functions for working with SXML (eg, a function to get an attribute given a tag, or something to find all tags matching a predicate) - do these exist somewhere? pinoaffe: I kinda feel like i'm reinventing the wheel zigzag: that is kinda scheme spirit :) zigzag: seriously, to work with xml, you need to work with sxml, that is, scheme lists. zigzag: if you need to traverse a (s)xml document, you can rely on sxpath. zigzag: pinoaffe: a snippet might help give a better answer. zigzag: "something to find all tags matching a predicate" I know no API that allows to do that without actually getting all attributes and apply a filter. RhodiumToad: sxpath allows predicates, no? zigzag: prolly, my guess is that it can. I never used that feature. RhodiumToad: the documentation isn't all that amazing RhodiumToad: (sxpath '(// (* (@ id)))) seems to work for "return all nodes that have id tags" zig: ack'ed. RhodiumToad: (sxpath '(// (* (@ (equal? (id "zzz")))))) seems to find a node with id "zzz", though I'd need to test that more RhodiumToad: pinoaffe: is this helping you any? pinoaffe: RhodiumToad: ah that seems to do (part of?) what I want, I guess I must've misunderstood the docs :) RhodiumToad: I only recently started playing with this myself, wasn't too impressed with the docs RhodiumToad: resorted to reading the sources instead, and immediately found an obvious bug *: RhodiumToad still thinking about the best way to parse xml without losing the namespace info he wants to keep pinoaffe: RhodiumToad: the code is indeed quite a bit clearer than the docs, node-closure does at least one of the things I need pinoaffe: so I can replace my own, buggy implementation with a probably way more sensible one ;) RhodiumToad: I think omitting namespace declarations from the generated sxml is a design error, but I'm not sure if it's easily worked around jcowan: Where a namespace declaration is and what the namespace prefix is, are really surfacey matters that shouldn't appear in the SXML. jcowan: The original design of namespaces required them to all appear uniquely at the beginning of the document, but people said "What if a component wants to generate elements in its own namespace that the outer components know nothing about?" So for that very very limited use case we are stuck with the baroque namespace machinery. jcowan: I think it's best practice to declare them on the root and only on the root.. jcowan: Definitely using two prefixes for the same namespace is a bad idea, and using the same prefix for two namespaces (in different scopes) is a REALLY bad idea. RhodiumToad: maybe so, but the existing sxml library just throws them away after qualifying the tag and attribute names jcowan: Because that's what the various data models say is the Right Thing. RhodiumToad: right now, if you just want to simply read in a document and write it out again, you have to manually trawl the sxml to find all the namespaces, synthesize prefixes for them all, rewrite the document to use them and then output it RhodiumToad: and really I'd like to preserve the original document's choices of prefixes and, importantly, its choice of default namespace RhodiumToad: (preserving the prefixes is just a "nice to have", but preserving the choice of default is more or less required) RhodiumToad: moving all the namespace declarations to the root node is acceptable RhodiumToad: I do wonder at the thought processes of someone who writes a library in which something as simple as (sxml->xml (xml->sxml blah)) fails ArneBab_: ober: see guile-emacs; in guix: guix install guile-emacs — slow due to missing optimizations but works. mange: Has anyone here used fibers within geiser? I'm struggling to figure out how to call run-fibers without blocking my REPL. I'm using the 1.0.0 release packaged in Guix. The ,spawn-fiber metacommand seems close to what I want, but the fibers get stuck "suspended" as soon as I run another command in the REPL. RhodiumToad: > is treated as an embedded #\> character ;;WHAT RhodiumToad: the whole _point_ of CDATA is that there are no special entities in it, the ONLY markup is ]]> RhodiumToad: fascinating how such an obvious bug apparently remains undetected for decades wingo: moin manumanumanu: Ahoy Guilers! wingo: :) civodul: howdy! manumanumanu: wingo, civodul : now that you both are here! I just finished srfi-171 (transducers), which are a generalization of map, filter and friends. If I were to provide a patch to include it in guile, would it have any chance of getting merged? The transducers are implemented in the same way as in clojure (ie: eagerly) with the same "protocol". wingo: manumanumanu: it's easy to merge support for a new srfi :) do you have copyright assignment on file? make sure to document the thing too civodul: yup, also with tests :-) manumanumanu: No copyright assignment, but that can be arranged. Documentation can be converted to texi without much fuzz. civodul: but it sounds like it would be a great addition! wingo: send me your email address and i can put you in contact with the fsf copyright clerk wingo: been a while since i did that so i don't know how fast they are these days manumanumanu: I need something to do before boredom makes me hack my for loops into a srfi like john asked me. It is such a daunting task :D manumanumanu: not only that, porting it to another scheme is somewhat of meh task. manumanumanu: Chez scheme would have been easy if it had been easier on the phasing and if it had had keywords. chrislck: tflatten. finally. amz3: manumanumanu: at least, you do not need to learn a new cffi interface :) amz3: well, chez scheme cffi looks like guile cffi, but chibi cffi is completly different. manumanumanu: chrislck: how come? manumanumanu: amz3: I really like the chez ffi, but for writing portable ffi code I usually just use the r6rs-ffi. amz3: I had some concerns regarding r6rs-ffi, but I don't remember exactly what it is. amz3: that r6rs ffi: https://github.com/ktakashi/r6rs-pffi manumanumanu: exactly manumanumanu: Quite a spectacular achievement :D chrislck: manumanumanu: srfi-1 doesn't have list-flatten and there's lots of bad implementations around chrislck: except: https://stackoverflow.com/questions/7313563/flatten-a-list-using-only-the-forms-in-the-little-schemer/7324493 manumanumanu: bad implementations? Isn't everyone using a regular tree walk? That should be O(n) and work on improper lists chrislck: lots use append... https://stackoverflow.com/questions/8387583/writing-flatten-method-in-scheme manumanumanu: That would be faster than using transducers. manumanumanu: wowza. manumanumanu: chrislck: this is mine: https://pastebin.com/gX2vZM8A manumanumanu: that uses no reverse and doesn't die on improper lists (although it properizes them :D) manumanumanu: It should be close to optimal. wingo: yeah that version is nice wingo: use the stack :thumbsup: manumanumanu: what I of course meant to say: for guile and racket that should be optimal. I don't know what other schemes have that very very nice optimization. manumanumanu: chrislck: if you want to spread that flatten around, please do. I claim no copyright to that piece of code. amz3: what is the plan regarding R7RS-large libraries? amz3: if any? manumanumanu: there should be plenty of time to decide. Have they voted on anything else than the red docket yet? amz3: re vote: I am not sure. I am not thinking about patches for guile, for the time being. I am considering a) one repository per SRFI b) a monorepo (like https://git.sr.ht/~amz3/guile-arew) amz3: also, I am not confortable with SRFI-64, but I prefer to avoid duplicated or wasted efforts... My current favorite test runner, rely on library reflection: https://git.sr.ht/~amz3/guile-arew/tree/d308be1b43267678253f499976a5506a614f6ada/check.scm wingo: amz3: i have no plan. i think that given the size, it would be best suited to a repo outside guile imo chrislck: manumanumanu: i'd settled on 2 similar functions from your srfi: https://github.com/Gnucash/gnucash/blob/maint/libgnucash/scm/utilities.scm#L202 chrislck: there were lots of comments decrying delete-duplicates in old code :-P chrislck: but the bottlenecks were never guile efficiency... lots of slowdowns in bad code elsewhere, now hopefully most gnucash scheme is now O(efficient) chrislck: see 1 example of old-code de-uglifying: https://github.com/Gnucash/gnucash/commit/ef3bc616 chrislck: and another another: https://github.com/Gnucash/gnucash/commit/cbd86491 chrislck: conclusion: hallelujah modern scheme tutorials :) manumanumanu: chrislck: list? is o(n) for gnc:list-flatten... I'd just use a hash-table for delete-duplicates :D manumanumanu: pair? is better chrislck: TIL chrislck: thx! manumanumanu: chrislck: yeah. I did that thing as well, but with match. It is because list? has to distinguish between proper and improper lists. spk121: . *: chrislck has a mission to remove all inappropriate use of set! :) manumanumanu: chrislck: talking about hidden costs :D amz3: wingo: ok. amz3: that is neat to read that much activity around guile. jcowan: manumanumanu, amz3: the Tangerine Docket has also been voted on RhodiumToad: so is there a place to report bugs in ssax/upstream, or shall I treat it as a guile bug? jcowan: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/TangerineEdition.md jcowan: RhodiumToad: You could send them directly to Oleg himself RhodiumToad: this is a bug apparently caused by misinterpreting the spec, so a public bug list would be better RhodiumToad: (and yes, I've checked with other experts and with other implementations to make sure it's not _me_ misinterpreting it) amz3: RhodiumToad: maybe comp.lang.scheme newsgroup? RhodiumToad: is that still going? huh *: RhodiumToad largely abandoned usenet after being a newsadmin for so long RhodiumToad: I don't see contact info for oleg? jcowan: Historically oleg@pobox.com; I have no idea if that still works jcowan: c.l.s is still quite useful despite being infested by THAT ITALIAN LOON WHO UPPERCASES ALL HIS RANTS *: RhodiumToad just signed up again for news.individual.net RhodiumToad: posted on c.l.s RhodiumToad: as for the loon, I assume groups-abuse at google is at least as clueless as they were back in the day when they asked me to teach them their jobs RhodiumToad: I nearly had them depeered at one point jcowan: I think they just simply are not listening RhodiumToad: they pretty much never did, getting them cut off was the only way I found to get their attention RhodiumToad: but I'm no longer in the business weinholt: RhodiumToad, groups-abuse just bounces RhodiumToad: hah weinholt: seems it was connected to a group and that group no longer exists RhodiumToad: typical weinholt: i find it odd that his rants are posted via Belgian ISPs. i sent abuse reports to them, one reported it was handled, but nothing came of it. also reported it to google's net-abuse (iirc) alias. nothing happened. amz3: that strengthen the idea that google groups (and news groups) will join killedbygoogle.com weinholt: amz3, usenet will still exist after google and will likely be better off :) jcowan: I used to subscribe to the RSS feed, but now I use the emailed daily summary amz3: www meh blah p2p blah blah gnunet blah. dsmith-work: Morning Greetings, Guilers RhodiumToad: good evening daviid: chrislck: wrt flatten, here is one :) http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/list.scm line 73+ daviid: maybe I should move it to guile-lib... it is almost a faq here :) count3rmeasure: morning! RhodiumToad: fascinating, W3's testsuite for xml contains exactly no instances of > inside CDATA str1ngs: daviid: hello, do you know of anything to help produce coverage for guile-lib (unit-test)? currently I'm using https://github.com/mrosset/home/blob/master/tools/coverage.in which I snarfed from gash. I'm wondering if there is a better way? wingo: amz3: do fibers work well with http clients/ wingo: ? wingo: i.e. can i http-get from within a fiber, and does all work as it should? daviid: str1ngs: hello - the link you pasted does not work str1ngs: daviid: one sec will paste to debpaste for you. str1ngs: daviid: http://paste.debian.net/1116832 str1ngs: this is some extra automake autotools stuff but the meat and potatoes is in coverage.in str1ngs: there is* str1ngs: the original is here http://git.savannah.nongnu.org/cgit/gash.git/tree/tools/coverage.in I just added some hacks for (unit-test) daviid: str1ngs: sorry, I'm not familiar with this, I just write what ever tests my projects needs and manually run 'make check' ... never used (system vm ...) str1ngs: daviid: I understand. I was wondering if this has been sovled before I guess. Thanks for looking at it. str1ngs: daviid: this piggy backs of make check. I just use make coverage to generate html from lconv.info. to see if I missed anything that might need testing str1ngs: good for finding dead code as well daviid: html, oh my god ... daviid: non merci :) amz3: wingo: i did not test recently with guile 2.9.x, but with guile 2.2 I think it works. amz3: Now I can recall that a version of my project was using fibers to crawl websites. amz3: To be honest, I did not do extensive benchmark. amz3: str1ngs: I think guile has coverage support, Let Me Check. amz3: str1ngs: yes there is: test-suite/guile-test. Nala Ginrut reported some feature missing in the coverage module of guile. I have a patch in my guile checkout that contains the following: https://paste.gnome.org/pzvvwlghv str1ngs: amz3: will check this out thanks ArneBab_: when using the append from manumanumanu, Guile does not release all of its memory on (gc). To reproduce: ArneBab_: flatten: https://pastebin.com/gX2vZM8A ArneBab_: (define longlonglist (iota 100000000)) (define longlonglist2 (iota 100000000)) ArneBab_: (begin (flatten (list longlonglist longlonglist2)) #f) ArneBab_: (gc) RhodiumToad: boehm-gc is never guaranteed to release all memory, it's a conservative collector ArneBab_: In this case it keeps 6GiB of memory (half of the peak memory) ArneBab_: it feels like this is a bit much RhodiumToad: um RhodiumToad: you still have the two original lists RhodiumToad: how much do they take up? ArneBab_: around 3 GiB RhodiumToad: I believe, from what I know of the boehm gc, that it's a potential issue if you have very long chains of connected cells, and a false match on the stack or heap ends up pointing to one of them RhodiumToad: that can potentially convince the gc that a long list is reachable when it is not RhodiumToad: how consistent is the effect if you make small changes to the lengths? RhodiumToad: proportionally small, that is ArneBab_: you mean whether I also see this if I use iota 90000000 ? jcowan: Also, some repls hang onto inputs and/or outputs ArneBab_: that’s why I used the (begin … #f) — otherwise the formatting of the output kills all performance. RhodiumToad: yes, does the memory retained at the end change much in response to proportionally small changes to input size ArneBab_: sneek: later tell ng0: however this many times slower might be changed by 2.9 sneek: Okay. ArneBab_: sneek: later tell ng0: as far as I understood, (read) got much slower with 2.0 — so much slower that some people couldn’t work with it. sneek: Got it. ArneBab_: sneek: later tell ng0: in addition some non-documented tricks used by lilypond stopped to work on 2.0 and some errors appeared multiple times, which cause frustration that led to reduced investment into getting to 2.0. My opinion is that this problem was caused by mistakes on Guiles side (you shouldn’t change things that break the one tool using your language that achieved total domination in its domain). But that’s done now, and I hope it ArneBab_: won’t happen again. sneek: Will do. numerobis: Hi #guile! I am writing a website using guile, and my pages are generated by something like: (static-page "Research" `(main ,(read-xml "html/research.html"))). Here 'static-page' is a function that adds header and footer, and 'research.html' contains only the contents of the main section of the page. I use mathjax, and it seems that the latex alignment character '&' causes issue with the function numerobis: read-xml. Does it look to any of you like there is an easy workaround to avoid this issue? RhodiumToad: html isn't necessarily valid xml amz3: +1, see htmlprag in guilelib. RhodiumToad: iirc, in xml & is always used for an entity except inside CDATA amz3: https://github.com/a-guile-mind/Culturia/raw/v0/src/htmlprag.scm RhodiumToad: speaking of xml, is the SXML module supposed to be actually useful? numerobis: RhodiumToad: yes, I hadn't really foreseen these sorts of issues. numerobis: amz3: thank you! numerobis: RhodiumToad: I don't know what it's supposed to be, but I find it very useful! RhodiumToad: it struck me as ... odd that sxml->xml basically does not work due to lack of any attempt to handle namespaces? RhodiumToad: I mean it can output valid xml, but only if you do all the namespace work yourself RhodiumToad: and if you just try and do xml->sxml on some input and then sxml->xml to output it, you just get garbage amz3: RhodiumToad: that is what yxml (https://dev.yorhel.nl/yxml) does ie. it does not handle namespaces, neither does microxml (https://www.w3.org/community/microxml/) RhodiumToad: uhh, so? amz3: RhodiumToad: what you mean with "do all the namespace work"? RhodiumToad: trivial example: (sxml->xml (xml->sxml "")) RhodiumToad: results in Invalid QName: more than one colon http://www.w3.org/2000/svg:svg amz3: yes RhodiumToad: and, (sxml->xml (xml->sxml "" #:namespaces '((svg . "http://www.w3.org/2000/svg")))) RhodiumToad: outputs amz3: I did not do extensive work with xml or xml namespaces. The thing is there are security issues related to namespaces handling that are adressed in microxml by dropping explicit namespace support. RhodiumToad: well I don't know what you're processing then but it's not xml, since namespaces are a rather fundamental part of that RhodiumToad: security issues? amz3: in past $WORK, xml namespaces seemed more like creating more problems. amz3: RhodiumToad: TEI, ATOM, RSS.. all those. amz3: RhodiumToad: IIRC, xml namespace requires to pull external files. RhodiumToad: not at all RhodiumToad: DTDs are what you're thinking of there amz3: maybe. RhodiumToad: namespace names may look like urls but they're never fetched RhodiumToad: they use that format only for uniqueness amz3: ok amz3: TIL amz3: still, what is the point of xml namespaces? RhodiumToad: the namespaces are to distinguish tags or attribute names that have the same name in different document formats. amz3: that is what I understand too. again based on my tiny past experience, it is useless. RhodiumToad: that doesn't really help when, for example, proper namespace declarations are required to generate valid output. amz3: the only thing that make xml namespaces maybe useful is when you need to interleave tag with the same name (but different namespaces), like ATOM does? but again, one could invent a xml format where there is no name class between tags (avoiding xml namespaces). amz3: s/name class/name clash/ amz3: RhodiumToad: yeah, that is prolly a bug in sxml, if it is still there it is because people using guile do not rely on namespaces. amz3: e.g. texmacs use xml but does rely (apparantly) on xml namespaces. amz3: e.g. texmacs use xml but does NOT rely (apparantly) on xml namespaces. RhodiumToad: how do you expect to do something as trivial as generating valid SVG without it? amz3: there is many ways, usually, one does a thing only when they need or enjoy it. numerobis: Something like this gets me closer to the solution: (sxml->xml (xml->sxml "

hola &align; hello

" #:entities '((align . "&")))) numerobis: It produces

hola & hello

. But I don't really understand the concept of 'entity' and the sxml documentation is quite terse on the topic, so I don't quite know how to adapt this to get just '&'. RhodiumToad: that seems a bit dubious RhodiumToad: entities are the &blah; things in html and xml RhodiumToad: < and & are basically essential in order to represent text containing < or & which, in xml, would otherwise be taken as tags RhodiumToad: in html, due to pressure of usage, there are various laxities numerobis: RhodiumToad: I agree, but at least that's a way to pass a special character. RhodiumToad: in xml, you can define entities within a document and do various tricks (some of which have security implications) numerobis: (xml->sxml "

hola &align; hello

" #:entities '((align . "SOMETHING"))) gives (*TOP* (p "hola SOMETHING hello")) numerobis: The thing is that now I'd like sxml->xml to interpret something as '&'. RhodiumToad: it's not legal to have a bare & in a text node in xml. you can have it in a cdata node or escaped as & RhodiumToad: so (p "foo & bar") outputs as

foo & bar

as it should RhodiumToad: sxml seems to have no ability to output CDATA. numerobis: RhodiumToad: yes, that's right. numerobis: In fact, it seems that putting & instead of & as the latex character just works, for some reason :) numerobis: (that is, '&' is interpreted by mathjax as just '&') amz3: numerobis: to generate to do sxml->html I use https://github.com/a-guile-mind/guile-web/blob/master/src/web/html.scm RhodiumToad: https://docs.mathjax.org/en/latest/input/tex/html.html#html-special-characters RhodiumToad: note that what the mathjax docs say about putting spaces around < and & only works for html and is explicitly invalid in xml numerobis: amz3: Thanks, will have a look at that. But the current solution seems fine. In fact, RhodiumToad docs seem to confirm that using < and all in math equations is actually officially supported by Mathjax? RhodiumToad: yes wingo: amz3: fwiw what i do is here: https://github.com/wingo/tekuti/blob/master/tekuti/page-helpers.scm#L89-L236 *: RhodiumToad was hoping for a simpler (than xslt) way to do simple xml transformations, but I guess this isn't it wingo: well html isn't xml :/ wingo: i tried to believe it was for a long time too, but it's better to accept that it's different RhodiumToad: I know, see earlier discussion wingo: some similar techniques can apply of course RhodiumToad: my problem (unlike numerobis') doesn't involve html jcowan: I'm receiving email about bug #38235, but I don't know how to see that bug on the Web. amz3: https://debbugs.gnu.org/ jcowan: ta RhodiumToad: hm. am I understanding this correctly: the SSAX parser will return QNames as (url . name), but those aren't considered valid in SXML? RhodiumToad: xml->sxml is smushing the url and name together itself, and everything else seems to assume that if (car tree) is a pair then it's looking at a node-set *: RhodiumToad trying to figure out the best way of outputting a document with its namespace declarations at least semantically equal to the input, and ideally using the same naming and positioning RhodiumToad: ugh, ssax makes it hard or impossible to find the original namespace declarations lispmacs: with goops, is there some way you calculate the intial value of a slot based an on init-keyword value passed in? E.g., calculate the initial value of a slot based on a frequency passed in? lispmacs: there is lispmacs: #:init-thunk, but that doesn't allow an argument, correct? lispmacs: *calculate the initial value of a period slot based on a frequency passed in str1ngs: lispmacs: thunks don't take arguments. str1ngs: lispmacs: example. (lambda () #t) is a thunk daviid: lispmacs: you should define an initialize method ... sneek: Welcome back daviid, you have 1 message. sneek: daviid, str1ngs says: thank you will test this out. I'm only using g-idle-add in an example right now. but I do have a use case later on when g-golf signals are further along. thanks for the update. lispmacs: daviid: well, I was trying to use 8sync, and the bootstrap funciton only allows you to pass in the class name and the keyword initializers lispmacs: daviid: though, I probably could figure out some way around that, if 8sync had a documented API lispmacs: (hint, hint, to 8sync developers) amz3: gettimeofday returns (seconds . microseconds), based on that I can compute milliseconds epoch wingo: ho ho ho ho, in guile apparently (call-with-input-string "(#;foo . a)" read) returns a wingo: that's a bug :P wingo: afaiu anyway wingo: ah this is because apparently (call-with-input-string "( . a)" read) in guile returns a wingo: which is... weird janneke: haha, mes has the same result janneke: ah guile's %get-pre-modules-obarray has # in its cdrs, hmm *: janneke has guile-1.8's boot-9 mostly running on mes, integration is still tricksy jcowan: civodul, wingo: Unicode case mapping is locale-independent, with the sole exceptions of Turkish/Azeri I/ı and İ/i. RhodiumToad: the infamous "turkish problem" jcowan: the real Turkish problem is that ı is really hard to read in handwriting: consider mınımum, which without dots is just a series of loops or zigzags amz3: this make me wonder why tifinagh latin transliteration use diacritics. Why not just rely on ascii (and make it (very) difficult to guess the pronounciation) RhodiumToad: jcowan: I believe I have seen worse handwriting examples in russian jcowan: Well, people have gotten sloppy about all handwritings in general jcowan: leaving the hooks off cyrillic m and l certainly does not help jcowan: amz3: I wouldn't call it a transliteration: if anything, Moroccan neo-Tifinagh is more of a transliteration of Berber Latin jcowan: there are simply three orthographies used by different people at different times in different circumstances marusich: civodul, thanks for the answer to my question the other day about vhash?. marusich: That's more or less what I figured, but I thought I'd ask in case I was missing something else. civodul: marusich: yw! ng0: is there a particular reason why lilypond seems to have not been ported to guile 2.0 or 2.2 so far, other than maybe it is being worked on or not having the time? daviid: ng0: becaue doing so, it becomes a few times slower then using 1.8, try to search their ml archives, there are millions of emails about this ... ng0: ah, ng0: thanks spk121: . sneek: spk121, you have 2 messages. sneek: spk121, daviid says: whenever you have a few minutes, you could pull and make (the latest g-golf devel branch - that I have enhanced since my last message) and then try/valgrind this g-idle-add example https://paste.debian.net/1116132/ (that I also updated today ...), it should not leak, it doesn't leak here anymore. If/once this is confirmed, I'd be happy to share some knowledge I gained wrt all this, including what i believe is a sneek: spk121, daviid says: I suggest read the channel log, I think our bot only got one part of the long sentence I wrote ... rozzin: Hey, all... rozzin: I'm trying to learn about Guile's VM and figure out what sort of safety assurances there are (if any) against bugs in bytecode programs--or if bytecode is basically not typesafe at all.... rozzin: Reading through the VM docs and C source, it looks to me like it's actually possible to run a branch instruction with a bogus offset and have the VM end up casting non-opcode data into opcodes and just start trying to execute them--no tag-checks on the opcodes before dereferencing them. rozzin: Am I missing something that should be obvious? rozzin: Or maybe, "what not-entirely-obvious thing am I ignoring"? Hrm. amz3: rozzin: hello, interesting question! come in a few hours or send a mail to the mailing list rozzin: Actually I'm pretty sure I'm overlooking something relating to OP() and the the operation-definition APIs..., but I'm not quite sure what--I'm afraid I'm having trouble allocating enough wetware stackspace to understand everything that's going on there. amz3: wingo is around GMT+2 rozzin: I'm -5, here. rozzin: Well, the timezone _here_ is -5. My personal timezone is frequently more like -7 or -10.... ;) amz3: try the mailing list then: https://lists.gnu.org/mailman/listinfo/guile-user rozzin: Well, there's a question, actually-- amz3: or: https://lists.gnu.org/mailman/listinfo/guile-devel rozzin: is this line of inquiry appropriate for guile-user, or should I be posting to guile-devel instead? amz3: rozzin: dunno! amz3: rozzin: I would say guile-user is fine. amz3: guile-devel is more like for submitting patches or coordinating work ? rozzin: I remember when Keisuke started the whole guile-vm thing 20 years ago those discussions were on guile-user. rozzin: Though that was... OMG that was a long time ago :) amz3: rozzin: are you looking at master branch or a stable branch? *: rozzin . o O ( OMG I've been using Guile for over 20 years... ) rozzin: I've been looking at both 2.2 and 2.0. amz3: 2.0 is deprecated. rozzin: Obviously :) amz3: and 2.9 and 3.x have major changes (like a JIT) rozzin: So I've been trying to focus on 2.2; rozzin: I noticed that the "unboxed arithmetic" ops came in for 2.2, coincidentally along with the register VM. amz3: I tried to read the vm code once or twice but not enough to understand a thing. amz3: I would like at some point add wasm target. I know what I want the target code to look like, but I am clueless about how to do it rozzin: I tried to read Racket's last week; Guile's seems pretty straightforward by comparison.... amz3: oh really amz3: I started my compilation course with nanopass framework amz3: (self-learning) amz3: never read racket code amz3: rozzin: I am working on a search engine amz3: sneek: what is culturia sneek: Last time I checked culturia is a re-search project rozzin: It felt like I was spending too much time staring at Racket's source and not really being able to make heads or tails of it (er..., cars or cdrs?), and so I set it aside and went looking at Guile instead.... rozzin: And, actually--then I heard a rumor that there had been some discussion about trying to plug Guile in as a back-end for Racket.... rozzin: That would be kind of exciting. amz3: I prefer r7rs rozzin: Oh? amz3: I am not sure what is appealing to racket, I don't know much of racket ouside the step macro expander. amz3: at least for my work, racket is not suitable, I need native threads. amz3: (and greenthreads) rozzin: "Racket continues to have everything" https://octodon.social/@cwebber/99796414911796158 rozzin: amz3: more background on that: "A Guiler's Year of Racket" https://archive.fosdem.org/2019/schedule/event/guileracket/ amz3: Yes, I saw that. amz3: there was several post on guile mailing list about it. spk121: rozzin: true. It is the bootstrapping problem: to be popular, you need to have everything. To have everything, you need to be popular. But Guile is more popular now than 5 years ago, and is starting to get more of the necessary libraries completed. rozzin: spk121: Yes. And apparently guile is where all of the VM work is happening..., which is actually what I'm interested in at the moment :) rozzin: The impression I have is that Racket's VM situation seems to be that there hasn't really been significant VM work in at least a decade, and at this point it looks like they're more interested in just doing direct-to-native compilation since Chez Scheme became available for use as a back-end and mostly giving up on the VM? rozzin: spk121: "Phosphorous, The Popular Lisp" http://web.archive.org/web/20090715095034/http://lambda-the-ultimate.org/node/3488 spk121: rozzin: lol rozzin: That paper really is a gem.... amz3: is it terse? amz3: (reference to bel language) spk121: amz3: you should make a terse version of Scheme by giving each RnRS procedure an alias which is a single Hanzi character. And you could shrink the parens by making them accents. Harzilein: spk121: heh Harzilein: spk121: and i thought that arabic rtl (naturally) lisp someone made as an art project was weird Harzilein: does the japanese r5(?)ns translation have kanji translations for the procedure names? Harzilein: rs* civodul: Hello Guilers! marusich: Why is it correct for (vhash? (vhash-delete "foo" (vhash-cons "foo" "bar" vlist-null))) to evaluate to #f? marusich: I am surprised by this. I expected vhash-delete to evaluate to a vhash, i.e., something that would always evaluate to #f when passed to vhash?. marusich: Let me rephrase my last sentence. I am surprised by this. I expected vhash-delete to evaluate to a vhash, i.e., something that would always evaluate to #t when passed to vhash?. *: civodul just looked at wip-exceptions, it's awesome! civodul: hi marusich! civodul: marusich: i think (vhash? vlist-null) => #false civodul: that's what you're seeing here civodul: it's debatable whether vhash? should return true in this case, but that's how it is wingo: o/ chrislck: \o wingo: :) wingo: tx for wip-exceptions review civodul civodul: hi wingo! civodul: that's a super high-level "review" ;-) civodul: it was interesting looking at it, and i'm really happy with this direction civodul: oh, another question: i think the record hierarchy is not officially documented, right? civodul: perhaps on purpose? wingo: civodul: there is documentation in make-record #:parent i think wingo: er make-record-type wingo: and also of course r6rs documents it, and exceptions document it wingo: what other documentation were you thinking might be needed? civodul: wingo: oh you're right, then i guess nothing's missing civodul: just an oversight on my part wingo: np *: wingo goes to finish r7rs stuff wingo: we have way too much srfi-1 things implemented in c :P civodul: heh, remnants of the past! civodul: BTW, 9de674e6e63ed1576c5b0660ac709f430822dbcf rewrote 'map' to be recursive to show off expandable stacks :-) civodul: do you remember how it affected performance, if at all? wingo: civodul: iirc it was equivalent. civodul: neat civodul: it makes backtraces less readable though wingo: but of course you can test. hard to test tho because it's basically an allocation benchmark civodul: because you can see all these map1 calls civodul: yeah wingo: civodul: hey is there something in guile that will (f "ßa") -> "SSA" besides string-locale-upcase ? wingo: srfi-13 string-upcase is restricted in that the result will have the same number of characters as the argument rozzin: wingo: good morning. Did you see my questions about bytecode/VM safety in your scrollback? :) RhodiumToad__: converting even ascii characters to uppercase correctly requires knowing the locale wingo: rozzin: no i missed them :) link? civodul: wingo: no it's just string-locale-upcase with a de_* locale wingo: my locale isn't de_* but it does produce ßa -> SSA civodul: ah perhaps that bit is duplicated in most locales civodul: because that's the only meaningful result anyway wingo: yeah civodul: ßa vs. cps rozzin: wingo: like to a web archive (is there such a thing?), or to a timestamp? rozzin: Oh, right--I see the URL in the welcome-message. rozzin: Oh, wrong--"The requested URL /bot/log/guile was not found on this server." rozzin: wingo: is there an updated archive base URL? The URL that ChanServ gave me is apparently wrong (or broken): "ChanServ‎: [notice] [#guile] Welcome to #guile! This channel is logged, see ." chrislck: logs.guix.gnu.org/guile/ rozzin: chrislck: thanks rozzin: wingo: http://logs.guix.gnu.org/guile/2019-11-15.log dsmith-work: Happy Friday, Guilers!! civodul: hey dsmith-work civodul: Happy Friday! davexunit: does guile have any handy dandy procedures for reading fixed point numbers from bytevectors? davexunit: I haven't found anything in my search davexunit: for some reason I decided, against all better judgement, to try writing a truetype font parser and there's a bunch of cases where some bytes are to be interpreted as fixed point numbers of various precision. probably I will just have to write my own procedure to do it. davexunit: but it's yet another yak to shave on this silly journey full of other yaks dsmith-work: davexunit: fixed point? Never seen that in guile. davexunit: neither have I :) I don't think it exists but worth asking davexunit: sometimes there's an undocumented life changing procedure somewhere dsmith-work: Heh *: dsmith-work used to hack on Analog Devices fixed-point DSP's years ago davexunit: truetype files are... strange. davexunit: they seem easy to parse at first glance but they aren't. amz3: if you by fixed point numbers you mean numbers encoded using a fixed number of bytes, you may look at industria struct pack procedure amz3: or bytevector as integer chapter from the documentation dsmith-work: fixed point numbers are "integers" but with the decimal point in the middle somehere instead of at the end. amz3: ok. amz3: tx. daviid: sneek: later tell spk121 whenever you have a few minutes, you could pull and make (the latest g-golf devel branch - that I have enhanced since my last message) and then try/valgrind this g-idle-add example https://paste.debian.net/1116132/ (that I also updated today ...), it should not leak, it doesn't leak here anymore. If/once this is confirmed, I'd be happy to share some knowledge I gained wrt all this, including what i believe is a daviid: bug in g-closure-unref (although it does not 'raise an exception') and how I finally decided t handle this 'mess' in G-Golf (I'm actually quoting one of the gnome developers, who, while I was explaing 'my problem', confirmed that the GSource and GClosure interfaces are 'less then optimal' ... sneek: Got it. daviid: sneek: later tell spk121 I suggest read the channel log, I think our bot only got one part of the long sentence I wrote ... sneek: Will do. daviid: str1ngs: if you use g-idle-add, g-time-out-add*, please pull, make and see this updated example - https://paste.debian.net/1116132/ - that shows how to use those procedures, receive their multiple values and free both the source and the closure ... daviid: *g-timeout-add* daviid: str1ngs: they all (g-idle-add, g-timeout-add*) return the source id, the source pointer and the istance, in that order, so th example 'serves for all' till I write some doc for the high level api (I updated the doc for the low level api already ...) daviid: of course the example shows how to free the source and the closure, which is appropirte i this case, because the idle 'callback' is not kept in the mai loop context (see line 20) ... you don't free anything until the source has been removed from its context ... str1ngs: sneek: later tell daviid, thank you will test this out. I'm only using g-idle-add in an example right now. but I do have a use case later on when g-golf signals are further along. thanks for the update. sneek: Will do. redkahuna: Hey all, i am novice in guile, i found the code `(web server ,impl) what does mean the "," here and the "`" d4ryus: redkahuna: its called quasiquote, works like ' (quote) but allows one to unquote part of the expression with , (komma), eg (setq x 3) `(1 2 ,x) would evaluate to (1 2 3) d4ryus: s/setq/define redkahuna: ah ok thanks, because i tought that the , have some relation with the , of system like ,d ,t dsmith-work: Morning Greetings, Guilers roelj: Is there a codebase that implements a web server that does SSL (via GNUtls?)? roelj: (obviously, written in Guile) amz3: hellooo #guile wingo: o/ wingo: ok exception stuff done, will merge tomorrow i think amz3: http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-exceptions wingo: civodul: hey :) i am headed to zzz but fyi i plan on merging http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-exceptions tomorrow, lmk if any objections civodul: wingo: cool, thanks for the heads-up! civodul: and sorry for not being more reactive civodul: i'm swamped and i've lost track of... many things daviid: spk121: hello! i was wondering if you could pull and make the latest (devel branch) of g-golf, then try this updated g-idle-add example https://paste.debian.net/1115994/ and see if still leaks or not, using valgrind (I tried valgrind here but couldn't interpret the results .. need to study a bit more about this ...) wingo: jcowan: i am aware of this wingo: moin ng0: is guile-git GPL3+ software or LGPL3+ ? ng0: ie, I have stared at too much packages today and forgot how gpl3 v lgpl3 works ng0: guix provides it as gpl3+, i think that's enough. i got confused for a moment, so it's a gpl3 project including lgpl3 files. redkahuna: Hey all, there is a difference between assq, assv, assoc? it's for get a specific header from (request-headers request) lloda: redkahuna: they use eq? or eqv? or equal? to compare iirc redkahuna: lloda: so best for my case it s to use assq ? because key in this case are scheme object wingo: moo wingo: moo spk121: so whilst brainstorming for my guile debugger project... There is a "break " command. So I want to make a list of all the procedures in a program, so I could populate a GUI element of procedure names. My best strategy so far is to use the undocumented 'module-defined-hook' to make a list of loaded modules, and then use the "module-obarray" procedure to pull a list of functions for each module. Seems clunky though. spk121: Suggestions? wingo: spk121: regarding "what procedures are there", there is a lot of this sort of thing in (system xref); also obviously the code that the low-level debugging infrastructure uses in (system vm debug) civodul: Hello Guilers! weinholt: hello civodul wingo: moin :) spk121: wingo: thx. I'll check it out wingo: okeysmokes, now just gotta document the exceptions stuff daviid: wingo: hello! does this work of 'rebasing' on top of ... will facilitate guile's customization so the (repl and the) raising exception printer(s)? wingo: well in the short term it won't do much. exception printing still goes through the current mechanism, customizable via set-exception-printer! wingo: in the medium term we should convert guile to always raise exceptions via raise-exception instead of throw wingo: and change the various interfaces that catch exceptions to use with-exception-handler wingo: and thereby avoid a conversion to/from an exception object as "key + args" daviid: as you know, i wish truncaed prit would be the default for the repl, the raised ecption system and the backtrace. right now, we are in a 'bizare' situaion, : one can reasonibly easili configure the repl, it is next to impossible ti configure the reaised exception system, _and_, by all surprise, the bactrace does truncate by default, but it does not us trucanted-prit and it is also 'next to impossible' to togle so it full ŕint ... wingo: and instead exception objects would always be structured values, except if a user uses "catch" wingo: backtraces do use truncated print fwiw wingo: via print-frame's use of the ~@y format specifier daviid: ah ok, but then why not the repl and the raised exception as well ... is a mistery to me ... which is not important: what is important is that we, those of us who uses large structures, lists ... can toggle 'in one click' from truncated to full printing and vis-e-versa, and for our users, the default being to truncate daviid: i wish the dauy can start to recommend to use guile to teach to young and not knowledgeable persons to learn and have fun to learn progromming, in scheme, using guile-cv ... is tomorrow :) daviid: i hope you can find some tie to think about this and make it happen for guile 3.0 daviid: to me, it is more important then speed ... saying this so you understand, of course speed is important, but if i had/could to choose, i'd select the truncacted 'version' and 'sacrifice' speed, then work on speed ... bcause right now, it is unsable (unless you are quite an advanced guile user ...) daviid: *guile-cv is unusable, not guile :) jcowan: wingo: R6RS allows raise to throw any object, not just an object of type &condition. mwette: wingo: modeling with-throw-handler for what purpose? amz3: unrelated to my database work. amz3: is it possible to have access to guile's expander, eventually, I would like to be able to expand a scheme expression, where there is no more syntax application or definitions. dsmith-work: Morning Greetings, Guilers RhodiumToad: ok. so what projects are currently ongoing for GUI stuff in guile, and how can I contribute? wingo: mwette: rebasing throw/catch/with-throw-handler on top of with-exception-handler/raise-exception str1ngs: RhodiumToad: there is g-golf, guile-gi, xlambda, nomad, guimax. these are the one I know about mwette: wingo: thanks RhodiumToad: so g-golf and guile-gi are duplicate projects? wingo: o/ ZombieChicken: \o ? wingo: a perplexed high five, very good wingo: ok all tests passing for exceptions rebase, woo davexunit: congrats :) amz3: RhodiumToad: similar goal, but different approach. RhodiumToad: what are the important differences? *: RhodiumToad has only looked at documentation so far, not code amz3: RhodiumToad: I just read: https://lists.gnu.org/archive/html/guile-user/2019-11/msg00000.html amz3: daviid: o/ redkahuna: Hey all,Is there in guile something like import pdb; pdb.set_trace(); of python ? amz3: redkahuna: no, I use (pk 'foo 'bar 'baz) that prints all arguments and return the last argument. amz3: and some thinking. nly: hi str1ngs: hello nly amz3: I considering the use of a sortable unique identifier (something that is easy to sort) for a database system. I already tried purely random bytes, it cause lot of fragmentation. So, I read about ULID (https://github.com/ulid/spec#specification) amz3: what I am wondering is about the timestamp in millisecond. As far as I know, guile provides on microseconds precision with gettimeofday. amz3: I want to optimize the thing, to avoid any transaction restart because commit-rollback-commit takes time. one reason for a transaction restart might a write-write conflict over the same uid hence the idea of random bytes. amz3: otherwise said, a given write transaction should spend less than 500ms and it should not restart because of write-write conflict. amz3: there is tradeoff between timestamp precision and the number of random bytes, but I don't know how to make a wise choice. amz3: nevermind, I will benchmark it later with the whole program. It will be easy to change. amz3: Still it is strange that they choosed milliseconds in ulid, instead of nanoseconds like gettimeofday provides. Also it would be better to put after the timestamp, 16 bits identifiying the processor to reduce fragmentation even more. amz3: (write-write conflict can happen because the nstore and full-text search will only store those idenfiers, and a mapping between the identifiers and the actual value will be provided in another subspace of the okvs) amz3: (there will be a race at index time, especially at cold start, to acquire identifiers for every words that appear in natural language) jcowan: amz3: What do you mean by "fragmentation"? RhodiumToad: most likely the well-known problem with, e.g., btree indexes on a database - inserting values in random order gives you an index that doesn't perform as well as one inserted sequentially amz3: what Rhodium said. amz3: also random bytes will not trigger prefix compression algorithm. amz3: one rebalance the tree, but it takes time. amz3: one *can* rebalance the tree, but it takes time. amz3: I am not sure "rebalancing the on-disk representation" is a thing in any okvs. It would be too much costly. jcowan: I'm currently using UUIDs (both random and in some cases DNS-based) because I have to guarantee that a row can be copied across multiple databases with different data owners without a collision jcowan: Yes, I see why in OKVSes it's a problem amz3: actually it is: http://source.wiredtiger.com/3.2.1/rebalance.html jcowan: but you can't do that in OLTP amz3: jcowan: what kind of OLTP like pgsql or sql server or oracle? jcowan: Online transaction processing in general, which nowadays is non-stop and 24/7/365. amz3: ok amz3: I posting this everywhere. because bigger than memory string matching: https://hyper.dev/blog/fuzzbuzz.html stis: hello guilers! wingo: faithfully modelling the weird semantics of with-throw-handler is tricky :) ArneBab: did anyone speed-test guile-aa-tree yet? https://qlfiles.net/guile-aa-tree/ ArneBab: wingo: did you see my note about (graphing)? wingo: ArneBab: i think i missed it; link? ArneBab: no link, just here on #guile ArneBab: wingo: I tried charting, but the example throws an error: ERROR: In procedure cairo-image-surface-create: Wrong type (expecting exact integer): 305.0 ArneBab: http://wingolog.org/projects/guile-charting/ ArneBab: wanted to try it, because I wanted to get rid of having to switch to gnuplot to do quick charts ArneBab: plus it looks pretty solid — the kind of visualizations I’d like to give quickly wingo: humm, where did you check it out from ArneBab: via guix install guile-charting wingo: i would try from git wingo: should make another release i gues wingo: s ArneBab: that would be great ArneBab: the page links to gitorious ArneBab: (which is dead) wingo: is on gitlab now wingo: gitlab.com/wingo/guile-charting *: wingo down to 4 test failures for rewrite of throw/catch on top of with-exception-handler/raise ArneBab: wingo: this one works, yes. I new release would be great! wingo: on my list, plz poke if no release in a week. not tonight tho :) wingo: night! ArneBab: ok, thank you! anon987321: hi anon987321: how can i set up libguile for C? anon987321: #include gives me errors anon987321: just "no such file or directory" anon987321: but everything's there ZombieChicken: so you're sure you have the dev headers installed and in the correct path? anon987321: yes anon987321: what i have noticed is that it tries to call stuff like it's in /usr/include/libguile.h and /usr/include/libguile/* anon987321: while it's actually in /usr/include/guile/2.2/* anon987321: i say /usr, but i'm using guix, so it's ~/.guix-profile/include anon987321: the path environment is set correctly anon987321: ...include/guile/2.2/libguile/__scm.h:54:10: fatal error: libguile/scmconfig.h: No such file or directory ZombieChicken: I can't help further, sorry ZombieChicken: Just asking the obvious question; you might try #guix and ask there as well ZombieChicken: or is it ##guix? I don't recall anon987321: it's #guix anon987321: don't think it's guix specific, as the /usr/include path for guile is the same anon987321: so both guix and the ones from ubuntu follow */include/guile/2.2 anon987321: while it seems like guile expects */include/libguile anon987321: managed to get libguile working. found the pkg-config command required for it to work on the manual. kind of hard to find tho RhodiumToad: (unless (let ((a (make-array #f 1))) (reset (array-index-map! a (lambda _ (suspendable-continuation? (default-prompt-tag))))) (array-ref a 0)) (display "I haz a sad\n")) RhodiumToad: I know why, but has anyone thought about doing resumable C functions? amz3: hello #guile! amz3: I find a way to workaround the slow query times in my search engine. amz3: Actually, I did not a find a better way than using map-reduce kind of algorithm. amz3: and a appropriate cachine of most common query results. amz3: s/cachine/caching/ amz3: I will work on that this week-end, along updating wiredtiger bindings to SRFI-167 and SRFI-168 (that were finalized today) nly: roptat: this is for you https://o-nly.github.io/articles/custom-repl-in-guile/ sneek: Welcome back nly, you have 2 messages. sneek: nly, str1ngs says: have you use secret sensitive system configuration? sneek: nly, str1ngs says: I meant have you used secret for sensitive system configuration? str1ngs: nly: ^ guix system configuration for context nly: str1ngs, no i havent nly: sounds cool, why did i not know of this *: RhodiumToad discovers that guile-gnome somehow finds it impossible to destroy a gtk object which is not a widget str1ngs: nly: it was a use case for secret that I thought of str1ngs: nly: nice blog by the way. I like the nomad screen shot :) nly: thanks, :) nly: btw which branch should i be using? str1ngs: I still think the stable release until g-golf branch is more stable str1ngs: g-golf should be use able but it's going to be fundamentally different then the stable branch moving forward. nly: str1ngs by secren do you mean shroud? nly: secret* str1ngs: ahh sorry shroud, which uses secret correct? nly: oh, i see nly: you can use it with an (use-modules (nomad shroud)) or just shroud in guix config nly: shroud doesn't use any program by the name of secret, it uses gnupg str1ngs: will try this out when I have time. btw maybe we can even better svg support down the road using cairo nly: str1ngs that blog misses out on animations str1ngs: by using a cairo bufffer, we could have better svg programmable support. nly: very cool str1ngs: also a VTE buffer support for an embedded REPL nly: how can i help? nly: str1ngs str1ngs: right now there is not much to do. there are some technical blockers that are almost done. once those are done. I'll be back working on nomad proper full time. str1ngs: mean time I've been experimenting with qt support str1ngs: nly: once I'm back working on nomad. I might need help with making the scheme code as generic as possible. my scheme fu is still pretty weak in that regrades. nly: ok, i'll see what i can do tomorrow nly: or day after nly: i recall that last time we were talking about documentation as well str1ngs: yes, documentation is dependent on the generic API as well str1ngs: nly: https://github.com/mrosset/giqt/blob/master/examples/hello.scm.in is an example of were I'm going in terms of generic code. I guess we need to reason how to make things generic in terms of gtk and qt. keep in mind I hope to use ncurses as well. so this is not specific to only QT str1ngs: nly: maybe it's as simple as having a and that inherit nly: str1ngs how would that work? nly: you'll still need to (make ) or qt equiv str1ngs: that's the trick part construction. but once we have the constructed type, the generic methods should just work. str1ngs: something like (define-class (gtk-webview-buffer ( )) (define-class (qt-webview-buffer ( )) nly: does it work then? nly: str1ngs str1ngs: theoretically yes, it's what I'm using currently. but when adding more platforms it needs to be generic as possible. str1ngs: I guess this could be a tested with dumby classes. I'll think more on it str1ngs: dummie* str1ngs: nly: either way it's much better then the two code bases I originally had. so this has come a long way. there is light at the end of the tunnel now. str1ngs: nly: not only that but it's runtime capable and eventually requires no C nly: nice spk121: str1ngs: I do have a vte repl running str1ngs: spk121: I too had one with nomad, but due to factoring I removed it. spk121: cool. If you do end up trying to use ncurses for something, feel free to reach out. I'm the maintainer of one of the ncurses bindings str1ngs: spk121: this might interest you as well. https://github.com/mrosset/giqt str1ngs: in terms of ncurses I do plan to support that at one point. the tricky part is making the UI code generic enough to support ncurses as well. as you can see with QT I use GI for that. but for ncurses that might not make sense. str1ngs: any input on that would be great. my scheme skills are not that great yet spk121: ncurses is difficult to abstract in a way that is similar to Qt or Gtk. It is an ancient API str1ngs: that was my thinking as well. I did a quick overview of it, more in the context of console html libraries though. str1ngs: I will add a guile-gi example to https://github.com/mrosset/giqt/tree/master/examples. rlb: When a thread inherits a fluid from a parent, are they then referring directly to the same fluid, so that changes on either side directly affect the other? rlb: (Wondering about what the promised semantics are.) spk121: rlb: fairly sure that if a thread inherits a fluid, any modification to the fluid in that thread are specific to that thread, but, that thread does inherit the initial value of the fluid from the parent rlb: Hmm, so maybe one way to think of it is that given a globally defined fluid x, any given thread makes a copy of the fluid when appropriate (say the first time the thread attempts to change it), and then relies on that copy -- and a child thread receives copies of its parent's "active" fluids (ones the parent has actually changed), when created? rlb: I suppose that would mean that a global fluid would never itself change values (which is a perfectly good model). spk121: rlb: I don't know about the "truth" but that's how think of it. amz3: I was going to say, "read the code" but seems like it fluids are defined in the compiler /cps/ language. rlb: OK, thanks -- I haven't yet worked with fluids in depth, but I've come to a point where I need to understand them in detail. rlb: amz3: yeah, that and/or experimentation was an obvious next stop, but figured I'd check to see if the precise semantics were already well defined/known somewhere. rlb: Thanks both. amz3: sure amz3: I used to work with fluids, but at the end of the day a fluid is a global and it was messing with the rest of my code. amz3: Now I prefer to pass arguments :) rlb: No doubt. amz3: like the database connection was a fluid, but then it would make working with multiple database impossible. amz3: there is surely cases where it is useful. It has added to Python under the name 'contextvars' for use with the asynchronous framework (similar to guile-fibers) where you need to configure e.g. decimal precision. amz3: configure decimal precision per fiber. amz3: instead of per-thread. amz3: decimal precision used to be global to the processus. spk121: https://paste.gnome.org/plzcu1a6r rlb: (FWIW, In this case, I'm trying to figure out how clojure's dynamic variables (and binding) might best map to Guile's facilities -- there bindings are not inherited by sub-threads, but can be "conveyed" to annother thread when it has been asked to take an action indirectly on behalf of the original thread via various forms (relating to agents, futures, etc.).) rlb: spk121: thanks civodul: spk121: re VTE, i learned about hyperlink escape codes yesterday: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda civodul: i'm sure a Guile REPL could put it to good use! civodul: like you click on an object to inspect it, things like that civodul: (so the REPL would typically need to run an HTTP server to receive "clicks") spk121: civodul: you kids and your hyperlinks. Back in my day, we had ECMA-48 escape codes and we were happy. ;-) spk121: that's an interesting idea. amz3: manumanumanu: tx for making https://bitbucket.org/bjoli/guile-fash/src/default/fash.scm amz3: manumanumanu: btw are you aware that hg will be gone from bitbucket in a few months (hint: https://hg.sr.ht/) spk121: I don't know if the following link will make it through the firewalls, but, this is a video of my interactive guile debugger, which, at the moment, is basically just Guile running in VTE. http://spikycactus.dnsalias.com/videos/vid1.webm amz3: spk121: hello work :) spk121: :) civodul: spk121: heh :-) civodul: i found it so revolutionary that i used them for "guix search" & co. :-) civodul: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7f0f38b54c98f13fed4cec1ee4785d493f29abee civodul: what's ironic is that i use M-x shell and sometimes xterm, none of which supports these escape sequences (yet) civodul: but i tried in those newfangled terminals and it's just wonderful ;-) rlb: ...interesting -- sounds like tmux might eventually support it. I've recently been trying out using tmux everywhere, i.e. locally it just runs a new-session in each stterm . Though not quite sure what I think about that arrangement yet (first time I've used tmux much either). rlb: (and perhaps an odd way to use tmux, but stterm needed something to handle history, etc...) spk121: civodul: cool rlb: I was trying to create a custom repl the other day, and unless I missed it, it looked like the current functions don't directly support providing a custom printer. For now I just adapted the existing code, but I'll try to propose a patch to allow that when I get some time. rlb: i.e. if you want to use the current repl infrastructure, but for a language that has a different printed output. amz3: the thing with custom printers, usually, REPL output can be read using `read` procedure. So you would have to also customize the reader. amz3: or forget about what i said :) rlb: Yeah, had to have that too, but there was a mechanism for that iirc. rlb: Another thing that I think I might want, though I'm not sure would/wouldn't be appropriate is the ability to specify a module that ",language" should switch to for a given language. i.e. one that has the right environment for the language, say foo-user as compared to guile-user. rlb: Right now you just have to ,module alongside ,language. rlb: Doesn't matter I think for languages like elisp that (I think) just compile all top-level references to a specific global namespace module, but may apply for languages that have separate namespaces like guile and want to use guile modules to provide the encapsulation. rlb: Anyway, assuming I don't think of something else, I'll probably bring it up on guile-devel at some point. daviid: spk121: hello! does guile-gi has glib main-loop idle/timeout functions? daviid: spk121: asking because g-golf has those, and they work fine, by that i mean they do not crash/segfault (guile-gnome had that problem ...) even if you let those run indefinitely, so that is very good news spk121: daviid: when GLib is loaded, the C function g_idle_add_full gets bound in Guile as idle-add. Similarly for timeout_add daviid: however, they leak, a tiny bit of mem, but steadily, and if you have those as well, maybe you could help me to see what's wrong i my implementation daviid: spk121: g-golf, like guile-gnome, implement those 'manually', following the steps as described in the glib manual, but i don't see how both gclosure and source are freed, and suspect that that is the cause of the leak ... spk121: daviid: ok. are you using the (GDestroyNotify) notify function of g_idle_add_full to call a free function? daviid: spk121: if you have a bit of free time, i could point you to where the code is (very short, reading is a matter of minutes ...), maybe you could spot the problem .. daviid: spk121: no, just the invalidade function daviid: let me tell you where the ocde is spk121: ok daviid: here is the making of a closure http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/closure.scm?h=devel - yu only eed to read the initialize method, line 77 to 91 daviid: the idle functions are here http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/glib.scm?h=devel - let's focus on g-idle-add, line 60 to 68 daviid: spk121: actually wrt closures, one more thing: the line 91, you see i add invalidate-notifier that is %g-closure-free, defined further below (the % is a convention(for me), it is a pointer to a scheme function, which will 'just' remove the instance from the g-golf cache (which is needed so the marshaller can find the function when given a gclosure ...) daviid: now, if you could pull and build g-golf (i thik you already have it so it should be easy and fast), then here is an example that shows the leak, i'll paste in a sec ... daviid: here: https://paste.debian.net/1114846/ daviid: now, what i thought was that since the idle is not kept (in that example), glib would call the invaldate-notifier and run my %g-closure-free, but that does nover happen spk121: ok, lemme look daviid: also, %g-closure-free uncache the closure instance, but i don't call g-closure-unref (because i thought this would be done by glib when/if it was calling the invalidate-notifier ... daviid: tx daviid: %g-closure-free is a pointer to a proc define line 247 - 248 daviid: i did read about GDestroyNotify, but didn't implement it (yet): guile-gnome doesn't have one either, nor cl-gobject-bindings, nor sbank, afaaaict at least ... which doesn't mean i shouldn't of course, and surely something is missing in g-golf to free gclosures and sources ... spk121: daviid: valgrind suggests that the output of g_idle_source_new is not being freed daviid: spk121: i read in the glib manual, Memory management of sources, in the main-loop section, but i still do not understand fully, nor do i know which solution would be best ... daviid: spk121: that's what i thought, and i also think the instance is never relese either, but let's focus on the surce first spk121: so, you need to hook a call to g_source_free someplace daviid: how should i be notified and how (where in the code i mean), to free it? daviid: ok, but when, where, do you happen to knw? daviid: you don't seem to call it in guile-gi? daviid: i can't find any such call in guile-gnome either spk121: True. guile-gi probably leaks that, too. Pragmatically, I'm unconcerend because g_idle_add_full it called at the beginning of programs and never freed. But. In C, the way you'd free that is to probably pass a UUID-like number to the paramater of g_idle_add_full(), add a callback procedure as the NOTIFY parameter of g_idle_add_full, and in that call back procedure call g_idle_remove_by_data on the UUID-like number you passed spk121: as DATA in g_idle_add_full() daviid: spk121: so far i did implement g_idle_add, g_timeout_add and g_timeout_add_seconds 'manually', and i fail to understand how i can pass/attach a but even vand not the *-full GDestroyNotify daviid: sorry, bad sentence daviid: spk121: so far i did implement g_idle_add, g_timeout_add and g_timeout_add_seconds 'manually', and i fail to understand how i can pass/attach a GDestroyNotify proc daviid: even for the *-full version of those, the glib manual says: "This internally creates a main loop source using g_timeout_source_new() and attaches it to the global GMainContext using g_source_attach(), so the callback will be invoked in whichever thread is running that main context. You can do these steps manually if you need greater control or to use a custom main context." daviid: that sentence does not ell me how to pass/attach a GDestroyNotify in the 'steps manually' spk121: OK. I see. It is a pretty different approach them, so I probably can't be of much use. But, lemme teach you how do to valgrind, if you don't know that already spk121: daviid: Here's calling your script with valgrind. https://paste.gnome.org/plyppde1g spk121: daviid: here's the valgrind.supp file mentioned in the call of that script. https://raw.githubusercontent.com/spk121/guile-gi/master/tools/valgrind.supp daviid: spk121: yes, it is a diff approach and tx, i don't kow how to valgrind daviid: spk121: tx, i'll kep that - i managed to loose the tips you gave me a while ago on how to gdb ... spk121: that makes a vgrind.out file, and the stuff in that file is ordered from least important to most important. So the end of the file is the most important daviid: spk121: ok, but i hope i can call for help :):), and right now, i'll keep a copy, but i 'm more concern on how to solve the problem ... if you come to have an idea, please ping me daviid: spk121: tx for your help so far by the way ... very nice of you ... spk121: daviid: well, in your g-idle-add, you've used GOOPS make to make a , and either you are holding a ref to that so it doesn't GC, or you need to add a destructor to your class that calls the C g_source_unref. daviid: spk121: ok, let me explain a bit more about this: yes i do hold a ref to instances, i need to so the marshaller can find the scheme proc when it's called, that ref is being hold in a cache, see line 87 of the closure.scm code daviid: spk121: then, i thought when a diel/timeout is _not_ kept in the main loop context, that the invalidate-notifier wold be called, and that is where i remove the instance from the cache, but I can trck that my invalidate-notifier proc is never called daviid: unless i miss underatood, but added loclly, a peek to see if it was called, and it's never called, i wonder why actually, something i missunderstood i guess daviid: spk121: i jus asked the exact same quiz on #introspection, but they did not aswer (yet, they are very nice and helpfull, but soetimes it takes time so someone answers) daviid: spk121: maybe i shoud hold the source ID in the instnce as well, then add an unref/free in my %g-closure-free procedure, though tilli find the answer to the previus question, i don't know how to make itso that it is called .. spk121: daviid: yeah. Well I'm giving up for today. Good luck. daviid: spk121: ok, thanks a lot! ArneBab: I sometimes use let-values — it’s pretty nice with wisp: let-values : : (a b) (values 'a 'b) chrislck: hello guilers o/ wingo: greets chrislck :) wingo: i have some draft patches that rebase throw/catch on top of raise-exception/with-throw-exception, in wip-exceptions. not quite working 100% yet tho civodul: wingo: woohoo! the big switch dsmith-work: Happy Friday, Guilers!! civodul: yay, happy Friday! nobodynogroup: so I am a bit of a noob to this guile stuff but it has really caught my attention and seems really cool. I have been wanting to create a heavily extendable onscreen keyboard for a while now. Ideally as cross platform as possible, but especially for linux, as I feel like the on screen keyboards for linux are a bit lacking compared to for example Multiling for android. So please tell me if this is a nobodynogroup: stupid idea: backend "api" for keyboard stuff written in whatever language is best for the platform (probably C or python for GNU, java for android), on top of that a guile keyboard that is heavily customizable, basically like an emacs sort of approach. My intuition is that this would allow a basically platform agnostic on screen keyboard (and easy to port between X and wayland etc) How foolish is nobodynogroup: this endevour? ArneBab: nobodynogroup: it does not seem foolish to me. The hardest part would be that you’ll have to provide packages for Windows (which I don’t know how to do with Guile, though GNU Cash does it) ArneBab: denemo does it, too: http://www.denemo.org/downloads-page/ ArneBab: did anyone speed-test guile-aa-tree yet? ArneBab: https://qlfiles.net/guile-aa-tree/ ArneBab: it sounds very intriguing ArneBab: wingo: I just tried charting, but the example throws an error: ArneBab: ERROR: In procedure cairo-image-surface-create: ArneBab: Wrong type (expecting exact integer): 305.0 ArneBab: ,bt ArneBab: In charting.scm: ArneBab: 312:13 2 (_ "Average Height at Iihenda JSS" (("Grade 9" (150 "Boys") (140 "Girls")) ("Grade 10" (150 "Boys") #)) # …) ArneBab: 114:18 1 (_ "Average Height at Iihenda JSS" 360 240 "Bitstream Vera Sans" 1 16 12 #f #f 5 (0 19.2 38.4 # 76.8 # …) …) ArneBab: In unknown file: ArneBab: 0 (cairo-image-surface-create argb32 305.0 413) amz3: actually, there is no bug https://github.com/wingo/fibers/issues/30 amz3: ;) nerdypepper: o/ nerdypepper: is (ice-9 debug) not present in 2.0? nerdypepper: i am looking to use trace to look at the outputs of recursive procedures wingo: nerdypepper: search for "trace" in the manual wingo: if you are at the repl, use ,trace civodul: Hello Guilers! wingo: good morning :) nerdypepper: ah thats it! thanks wingo RhodiumToad: so I'm curious: there are several syntax variants for dealing with binding to the result of a multiple-value function, are any of them commonly preferred over the others? RhodiumToad: so far I see, besides call-with-values itself, define-values, srfi-8 (receive ...), srfi-11 (let-values ...), srfi-71 (let ...) lloda: srfi-71 is newish chrislck: jcowan recommended srfi-11 lloda: in guile anyway lloda: -71 supersedes -11 amz3: RhodiumToad: call-with-values is more general I think (call-with-values thunk (lambda args args)) will return multiple values as a list. amz3: there is receive that is quite popular, but I prefer call/values RhodiumToad: yes but it's also rather clunky syntax, especially when mixed in with other bindings in a let chrislck: ^ amen amz3: how so? snippet? lloda: sometimes receive looks better than let (((values ... if you only have one, but I don't use let-values after having srfi-71 RhodiumToad: receive also has the drawback of being its own thing lloda: that is true RhodiumToad: so far I've been tending to use receive when there's just one, and srfi-71 when there's other bindings to do at the same time chrislck: see how i cope: https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/business-reports/new-aging.scm#L264 amz3: IIRC there is paper about call-with-values / receive that recommends yet-another form. I don't have the paper at hand. chrislck: https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/business-reports/new-aging.scm#L173 chrislck: srfi-71's values->list is a nice one... can pack multiple values and (let*) can unpack them lloda: 173 would look ok with call-with-values chrislck lloda: (call-with-values (lambda () ...) cons) amz3: l173, is equivalent to (call-with-values (lambda () (partition ...) cons), imo in L264 I would split the big let* into two lets with a call-with-values in between them. lloda: was saying yes chrislck: amz3: yeah well any of them would do lloda: the thunk is a bummer sometimes amz3: lloda: yes lloda: and you lose some explicitness in what the values mean RhodiumToad: I think I don't like the extra parens in let-values amz3: I seldom use let-values and define-values RhodiumToad: srfi-71 seems nicest so far amz3: at the REPL define-values can be handy, but guile REPL with $fu is good enough lloda: cannot put the $fu in scripts tho lloda: I remember some discussion about having $-1 etc. in the mailing list lloda: don't know how that ended lloda: it would be neat wingo: i like call-with-values and let-values / let*-values, fwiw wingo: just a personal preference tho wingo: guile doesn't compile define-values very optimally right now but perhaps that's fixable RhodiumToad: I have use-cases like (let* ((x y (compute-coords blah)) (thing1 (make some-gui-object x: x y: y)) (thing2 ...)) lloda: I have a lot of code like that RhodiumToad RhodiumToad: using call-with-values or receive would mean another nesting level for no especially good reason lloda: srfi-71 made it look a lot better wingo: i am curious to know when i will permit myself to use "define" instead of "let" :) jcowan: SRFI 11 is part of R7RS; SRFI 71 is compatible with it bu tnot part of it, and it's less widely supported since it involves redefining a standard Scheme macro. RhodiumToad: that's unfortunate, since I think I agree fairly strongly with srfi-71's rationale for why srfi-11 is bad civodul: yup, srfi-71 is an improvement IMO lloda: we cannot have (define (values ...) (values ...)) so it isn't an uniform pattern unfortunately RhodiumToad: in particular, let-values does not work nicely for the case I described above lloda: you'd have to put parens on every single value case yeah RhodiumToad: it'd have to be (let*-values (((x y) (compute-coords blah)) ((thing1) (make ...)) ((thing2) (make ...))) ... dsmith-work: Morning Greetings, Guilers jcowan: Multiple values contradict the functional mental model in which most of Scheme is written (the same with call/cc). I hope to get SRFI 8 into R7RS-large, as it has the nice property of working in most of the cases (even if it is voted down, it's a 5 line syntax-rules macro RhodiumToad: I only recently picked up scheme seriously (though I have on-and-off experience of various lisps, mostly _not_ using multiple values), but for whatever reason I've found myself using multiple values a lot RhodiumToad: I'd agree that call/cc doesn't really fit the model jcowan: It's hard to remember when writing a procedure with a functional argument to ask "What should happen if the passed function re-enters me unexpectedly?" jcowan: for this reason, map guarantees that previous results returned will not be mutated (so the final result can't be built up by mutation) jcowan: and the same for vector-map, which therefore needs to build up a list and call list->vector at the end. RhodiumToad: hm. amz3: o/ spk121: New guile-ncurses 3.0 release, now using foreign objects instead of SMOBs has been uploaded to GNU. civodul: spk121: yay! civodul: how much work was it to switch to foreign objects? spk121: civodul: the switch was easy because I'd already hidden the SMOB internals by a layer of abstraction. But I lost many cool features in the switch. spk121: I lost my custom type printer, so things like now are just print as spk121: And I lost custom equality predicates, so I can't make equal? mean s that have the same underlying C pointer. spk121: But, the code is shorter, so that's a win. RhodiumToad: can't foreign objects have an equality method? wingo: i think so, yes; (define-method (equal? (a ) (b ))) wingo: only works between objects of that type tho afaiu wingo: er, iirc :) amz3: does ice-9 futures work with a guile-fibers? wingo: probably not amz3: even if guile fibers is running in a single thread? wingo: joining a future would block fibers amz3: ty dsmith-work: Hey Hi Howdy, Guilers RhodiumToad: hmm. curiouser and curioser. looks like my armv7 build of guile has more general issues with (do ...) RhodiumToad: it looks like it's somehow getting the bindings screwed up amz3: I am trying to create a threadpool for calling blocking operations inside a single thread fibers scheduler. It seems to me run-fibers #:drain #t does not work as expected. amz3: I am using guile 2.2.4 amz3: here is a program where you can comment the line 41 to show the curious behavior https://paste.gnome.org/p36aeujb3#line-41 amz3: in the above snippet `fib` is the mocking the blocking behavior. RhodiumToad: hm. maybe it's not the fault of (do ...) amz3: s/the// amz3: it seems like the (get-message return) where turn is the channel that is used to return the value of the blocking operation, is not taken into account. amz3: https://github.com/wingo/fibers/blob/master/fibers/operations.scm#L148 amz3: it seems to me the block-fn procedures will block the fiber or thread amz3: https://github.com/wingo/fibers/blob/master/fibers/channels.scm#L104 amz3: very funny :) dsmith-work: amz3: ? amz3: dsmith-work: working on a small bug in guile-fibers RhodiumToad: hm. is there some reason why for-each over 3 lists would be 10x slower than over 2 lists, for the same lengths? lloda: RhodiumToad: special case for 2 args while 3 args depends on rest args and apply lloda: just a guess, and 10x is a lot, but it's a pattern I've seen sneek: So noted. lloda: what did you note sneek chrislck: sneek: what is just a guess, and 10x sneek: I've heard just a guess, and 10x is a lot, but it's a pattern I've seen chrislck: lol chrislck: sneek: botsnack sneek: :) nly: lol lloda: it's just the comma? haha RhodiumToad: fwiw, the context is: how best to do a function or macro that executes something a fixed set of times with a fixed set of values bound to variables RhodiumToad: like (for-each (lambda (a b c) ...) '(1 2 3) '(4 5 6) '(7 8 9)) chrislck: RhodiumToad: maybe your case would benefit from a custom for-each type macro RhodiumToad: the values could have been calculated by a do-loop, but using do in a macro is tickling some compiler bug RhodiumToad: winner so far is (let ((proc (lambda (a b c) ...))) (proc 1 4 7) (proc 2 5 8) (proc 3 6 9)) RhodiumToad: (there are actually more than 3 calls, but not that many more) RhodiumToad: this fails on a 32-bit arm build: https://dpaste.de/9gg6 lloda: RhodiumToad: I don't think that should take 10x longer for three args. for-each is the natural way to write it I'd say lloda: if your case is small enough I'd send it to the list wingo: civodul: i was wondering if we should adopt one of these fancy code review tools wingo: github pull requests are quite convenient but it's not great for a gnu project to be on github wingo: i use phabricator for firefox work, which is pretty nice also wingo: and gitlab is fine wingo: but perhaps gerritt might make sense? wingo: i know there's an instance that sourceware runs for other gnu projects that perhaps we could use wingo: i am on the gdb mailing list and they just switched to it wingo: the email bridge seems to work fairly well civodul: wingo: we could give Gerrit a try, sure wingo: i never know how many r's and t's are in gerrRiT civodul: me neither actually :-) civodul: i see an emacs-magit-gerrit package, so it must be great wingo: hehehe :) civodul: what would it take to set that up? civodul: perhaps we can use the sourceware instance? wingo: yeah perhaps, we can ask them wingo: ok let's float the idea on the mailing list maybe. gdb and glibc having experience with it recently can let us know how it would fit into our workflows daviid: wingo: does gerrit depend on js, possibly nonfree js? wingo: daviid: i wouldn't think so, given that glibc and gdb use it wingo: i mean it probably has js wingo: but probably not non-free js daviid: ok wingo: something to verify tho of course daviid: fwiw, i won't use (any of these) tools, so i hope what ever is pick-up has indeed a dead good interface with email, and copes with the current workflow, patch, ML, review ... wingo: apparently gerritt's email interface is pretty nice wingo: and there is a magit extension for it as well daviid: ok, great. saying this because sice gnome moved to discorse ( a total disaster imo), i can't contribute anymore (i don't want to, to be correct), of course just my 2c ... daviid: imo, if one has to browse to contribute, or review, there is 'something wrong' in the project 'design', again my 2c - i know there will always be a division between those of us who beleive in the pr workflow and those who prefer the email workflow ... *: wingo nod wingo: still, do look into gerritt and see what you think, i understand the concerns and we should investigate if this specific solution addresses the concerns civodul: i too wouldn't like to have to use the browser, but like you write, there are other options that seem to work well civodul: so i think it's reasonable to give it a try civodul: (says the person who hasn't committed anything in a while :-)) wingo: :) wingo: but thing is, pull requests can be a nice way to stay in development for those times when you're not committing :) wingo: i would love it if we could move to a workflow where my work also goes under PR's civodul: is it? civodul: my impression is that PRs are optimized for one-off contributions, but not so much for someone who wants to follow development civodul: though i guess there are tools and they can be customized to send notifications appropriately daviid: like emails ... :):) civodul: well, email is rather all or nothing :-) dsmith-work: Tuesday Greetings, Guilers civodul: howdy, dsmith-work! daviid: another problem is that these tools asks to create an account, and then they install cookes and start to track you ... dsmith-work: wingo: What are you working on in firefox? wingo: civodul: yes you can get notifications, like "send me a mail when there's a new PR or activity on a PR". it can be a bit overwhelming tho wingo: dsmith-work: currently, webassembly stuff. specifically https://github.com/WebAssembly/multi-value civodul: wingo: yeah i had that on gitlab.com and gitlab.inria.fr and it wasn't so great actually ;-) wingo: right :) daviid: wingo: i just did read about it, the presentation (60+ slides) and it seems it is not possible to maintain a gerrit WF and the 'old' WF as we have now (?) gerrit uses git, but it adds 'tons of things' and 'imposes' its workflow, so once our repos will be moved, it seems we won't be able to contribute 'the old (good :)) way' anymore, or am I wrong maybe? wingo: you can certainly do a normal email and git push wingo: there are differing degrees of how much you buy into gerritt wingo: like one is, "only gerrit" wingo: which probably isn't what we'd go for wingo: to be clear the current process is, to a first order, "andy pushes to git without review" :) daviid: well, that's the ultimate step :), you probably first did commit, locally, send a patch for review ... (i know you know ... but for the sake of our 'conversation', and compare both approach ...) daviid: anyway, i prefer the email wf, so i'm not being impartial here i guess :) ... wingo: i am not going to email all my patches, sorry :) daviid: i understand, but when we contribute ... daviid: if we could just try, but it seems already quite a lot of work just to try ... daviid: anyway, back to hack, g-golf idle functions leak mem, a tiny bit but steadily ... oh well, oh well wingo: emailed patches are as welcome as they have always been :-) wingo: (which is to say, very welcome, but i am bad at email :P) daviid: i'll look at emacs-magit-gerrit, may it solves 'everything' :) dsmith-work: What about patchwork? roptat: reading https://www.gnu.org/software/guile/docs/master/guile.html/Using-Other-Languages.html#Using-Other-Languages roptat: I'm wondering, can I implement my own language that way? roptat: well, not really a language, but I'd like to use the repl to send commands to my app roptat: maybe my question is about "meta-commands" for which I can't find documentation... roptat: to be more concrete, I'm trying to work again on my guile-torrent thing :) it uses fibers to download torrents, and I'd like to start a server and give it commands like this: ,start-torrent-server then (start-torrent "something.torrent") (pause-torrent "something.torrent") etc roptat: I think I can't just have start-torrent and pause-torrent be scheme procedures, because at the REPL, I'm outside of the function called by run-fiber roptat: actually, I can create a channel and send messages to it outside of the run-fibers call, so I think I don't need that roptat: but I'm still curious :) nly: hi roptat roptat: hey :) nly: i have used meta commands and custom repls, incidentally also in a torrent lib, inspired from yours :) nly: let me dig the source roptat: oh, so you have it working? roptat: I mean, you have a working guile torrent library? nly: nope, i am quite a ways off nly: i'll pick up the slack soon nly: https://github.com/o-nly/torrent/blob/master/torrent/repl.scm roptat: thanks! nly: this seems weirdly incomplete, i wonder where did i put the example nly: roptat here an example meta command https://github.com/o-nly/torrent/blob/master/torrent/bencode-reader.scm#L118 nly: this should work like this: nly: at Guile repl nly: ,bencode-reader nly: d4:word3:heye RET nly: -> (dict (str "word") (str "hey")) nly: i imagine you could use custom repl as in guix-monad-repl to avoid specifying the connection to the running app nly: meta commands can be convenient to enter such 'custom repls' at your whim roptat: Thanks roptat: That will help me a lot nly: :) nly: the documentation on the torrent lib is lacking nly: it has become a bencode-> s-expression thing nly: roptat https://o-nly.github.io/posts/torrent/ amz3: o/ amz3: hey, I intend to continue my work on the project that used to be called guile-r7rs. amz3: Do you think it will be best to change the name to something else? amz3: the project is a set of libraries from R7RS-large libraries. amz3: but since guile-3 has R7RS-small, it might lead to a confusion. I was thinking about renaming it, guile-seven. amz3: https://git.sr.ht/%7Eamz3/guile-r7rs jcowan: guile-seven-large perhaps? jcowan: But has R7RS-small definitely in Guile 3.0? The status page says it's being considered. amz3: There is this minor patch http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commit;h=2cca09126e8416e4b5d4be2b1edd0c9f15e0bffa amz3: also I stumbled upon conversation to include akku-r7rs-small AFAIU in guile 3 amz3: I don't know about the define-library form tho amz3: also there is work to implement r7rs raise amz3: IIUC amz3: (which I still don't fully understand how they work ;) jcowan: By intention R6RS and R7RS exception system (as opposed to conditions) is exactly the same, and raise and raise-continuable are expressed in the same words. jcowan: Except that R7RS doesn't give specific condition types. amz3: a condition type can be any scheme object? amz3: s/type// amz3: What i know, is that they are condition predicates. Is that correct? amz3: in R7RS-small for port related procedures jcowan: Two, yes. jcowan: And yes a condition type can be any object in both R6 and R7RS amz3: sorry, to take your precious time, but what does error procedure raise as a condition? jcowan: Something that satisfies error?, is all we can say. amz3: oh ok amz3: by the whay, inheritance of Exception class, is the only inhertiance I do in Python code nowadays. amz3: s/whay/way/ jcowan: Similarly, file-error? is basically &i/o-error-filename? and read-error? is basically &lexical?. amz3: so the predicate can return #t for multiple conditions? amz3: well, it can be, it depends on the condition and the predicate that you use, since the condition can be any scheme object, one can construct it so that it can inherit (somehow) a common error. amz3: That makes perfect sens. jcowan: R7rS-small has no notion of "types of conditions" independent of predicates. pinoaffe: is there a way to prevent a module from being loaded, or at least to "undefine" some of the things they export? mange: Are you trying to solve a particular issue you're having, pinoaffe? pinoaffe: mange: I'm just playing around with church numerals and am annoyed by the fact that the repl gives a bunch of warnings if I include a module that specifies a new definition for + mange: You can use something like (use-modules ((your module here) #:prefix p:)) to import things as p:+. There are some other ways to manipulate the names on import specified in the manual "(guile) Using Guile Modules". pinoaffe: that's not quite what I'm trying to do, tho - which might very well be impossible mange: What are you trying to do? pinoaffe: I would like to be able to use procedures with names such as + * by referring to them by those names mange: But you can already do that, and the annoying thing is that when you import a module that exports those bindings you get warnings? pinoaffe: yup mange: According to the manual "(guile) Creating Guile Modules" I think you can do something like (define-module (blah blah) #:use-modules (your module here) #:duplicates (last)), but I've not tried it. spk121: finally got the new guile-gi 0.2.1 uploaded. phew daviid: spk121: congratulation! daviid: slightly ot, but not 'that much ot either': trying to compile guile-lib (from th source) on msys2, which has autoconf and automake, but raises two errors wrt our guile.m4 autoconf macros, here https://paste.debian.net/1113499/ daviid: here is a copy of the latest guile.m4 macros http://git.savannah.nongnu.org/cgit/guile-lib.git/tree/m4/guile.m4 daviid: so, the first error, PKG_PROG_PKG_CONFIG: command not found, is line 63 of our guile.m4 macros daviid: the second error correspond to the lines 81 and 82 of our guile.m4 daviid: anyone familiar with win and/or msys2 could help? i did ask on msys2 (there on oftc.net, #msys2), there are very nice and usually help, but this question is a bit 'out of scope' for them ... daviid: now that i've asked, i may have to leave, the pace i'm working at will close soon ... if that happens, will read the log ... RhodiumToad: PKG_PROG_PKG_CONFIG is not from autoconf or automake, but from pkg-config, afaik RhodiumToad: not familiar with msys2 tho daviid: RhodiumToad: ah, will lokk ito this, not sure they have it on msys2, but will check, tx! daviid: not familiar either, jst started a few days ago .. daviid: RhodiumToad: i found the package, here (for info) https://packages.msys2.org/package/mingw-w64-x86_64-pkg-config?repo=mingw64 daviid: RhodiumToad: tx! didn't thik about that by myself, I will try, but i have to leave now, bb tomorrow daviid: actually the package is this one: https://packages.msys2.org/package/pkg-config?repo=msys&variant=x86_64 RhodiumToad: slow compiler is slow RhodiumToad: hm. but it shouldn't be _this_ slow I think. peanutbutterandc: Hello there, are there any guile-gnome hackers here (as suggested by https://www.gnu.org/software/guile-gnome/contact.html). I am a n00b with a few questions RhodiumToad: the guile-gnome guy is often around, but I don't know what times you're most likely to catch them RhodiumToad: however, ask anyway, I've been doing stuff using it recently peanutbutterandc: I see... That's great! First and foremost, what would you say will be the requirements for starting writing guile-gnome for UI and stuff for a beginner? I don't have any experience with gtk yet. Should I first learn gtk in C and then come back? RhodiumToad: do you have any experience with any other GUI toolkit? peanutbutterandc: No sir. Not yet. peanutbutterandc: Except pygame peanutbutterandc: if it counts RhodiumToad: and you're already familiar with guile? peanutbutterandc: RhodiumToad, I've been reading through a few books... and writing a bit of guix-package definitions for personal use peanutbutterandc: (and loving it!) RhodiumToad: my guess is that using gtk from guile will be a slightly easier introduction to it than using C. RhodiumToad: there are some examples in the guile-gnome source, they should be enough to get started peanutbutterandc: I see. That is such a relief. I don't have to learn C then. But I haven't managed to dig up a tutorial/manual thing for n00bs like me. Any ideas please? Could you please point me towards them? peanutbutterandc: Also, another question regarding guile/extensions in general. I want to extend gnucash so that day-to-day invoicing can be easier. And I want to integrate it seamlessly with the Gnucash UI so that anyone can use it without much trouble. While I am quite a long way off from that, I was wondering if what I am hoping to do can be done... RhodiumToad: I can't answer that one, sorry RhodiumToad: also I'm not much help when it comes to tutorials peanutbutterandc: I am under the impression that, if one knows how to do it, one can extend any program that has guile as an extension language to do anything at all. peanutbutterandc: I see... RhodiumToad: hmm. the compiler can't _possibly_ be this slow RhodiumToad: something must be wrong RhodiumToad: this code takes 2.5 seconds to compile on a fast intel cpu, but so far it's had an hour of cpu time on 32-bit arm and shows no sign of finishing RhodiumToad: ok, up to two hours of cpu time. this cannot possibly be working RhodiumToad: 69 minutes in one thread, 15 minutes in each of three more, and a few minutes in another thread RhodiumToad: it's not even an especially huge or complex program... heisenberg-25: Anyone has experienced this issue? heisenberg-25: Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS heisenberg-25: Aborted (core dumped) wingo: that's exciting :) wingo: never seen that heisenberg-25: I have set the GC_INITIAL_HEAP_SIZE=300G variable and running it on a server with > 300GB RAM, but it still fails :) wingo: in that case you may need to recompile libgc wingo: but, i have to say, stop-the-world collections on a heap that size will take a while! heisenberg-25: where can find the latest version? Harzilein: wingo: do you consider guildhall to be abandoned or are you still tangentially interested in occasional informal user reports? wingo: Harzilein: for me it's abandoned. i think some others may be using it tho, not sure. when i need a thing like that i just use guix spk121: After putting it off for three years, lets see if I can release guile-ncurses based on foreign objects instead of SMOBs wingo: nice! chrislck: a new guile-hall deserves the highest of fives o/ chrislck: a new guile-ncurses* deserves the highest of fives o/ Harzilein: wingo: perhaps guix could provide some guidance for people who only want it for the scheme side of things? i.e. they want it to be like virtualenv rather than pkgsrc *: chrislck is asked to rewrite a .scm function in C... oh so much pain:( wingo: chrislck: sympathies! wingo: is it for speed? how much faster does it need to be? wingo: or is it for another reason chrislck: they want to completely separate libgnucash (the engine, data, database) with gnucash (UI, reports). they wish to eradicate guile from libgnucash. that's it. chrislck: i've some heuristics in .scm to clean up old data and scm was shiny! chrislck: the idea is libgnucash can be portable to other OS eg iOS where interpreted languages may be difficult *: wingo nod wingo: yeah i guess i can see the reasoning :) chrislck: https://github.com/Gnucash/gnucash/pull/585/files#diff-bf2754900c3cc3b599e36a8f8df80194 is the super-easy-clean working scm which will expand to a mega-C multi-page headache :-/ chrislck: night 'all RhodiumToad: hm. anyone want to guess why compiling a simple script doesn't seem to be completing, on armv7 RhodiumToad: other stuff does compile, and there was no problem compiling the whole standard library RhodiumToad: hm. weird. putting an (eval-when (compile) (display ...)) form at the end of the file _does_ get run, after about the expected time wingo: strange RhodiumToad: but after that it just sits and east cpu RhodiumToad: *eats RhodiumToad: but other scripts work...? wingo: ah well actually that means it runs at expand-time wingo: so it's before compilation wingo: RhodiumToad: i assume you are on guile 2.2 ? RhodiumToad: 2.2.6 *: wingo nod RhodiumToad: running on an RPI 2B, originally using a cross-built copy of guile but a native-built one behaves exactly the same *: RhodiumToad tries deleting chunks out of the code RhodiumToad: ok, I think I've narrowed the issue down to one form RhodiumToad: https://dpaste.de/mK6R RhodiumToad: using for-cells just once, rather than nesting one inside another, doesn't trigger it - that compiles in under 0.1 second RhodiumToad: huh, there's a bug in that, but fixing it doesn't help RhodiumToad: https://dpaste.de/npBd RhodiumToad: https://dpaste.de/9gg6 <-- I think this is the smallest test case. Removing the reference to sym2, or using only one nested for-cells, allows it to compile quickly. RhodiumToad: in fact, just doing a (macroexpand ...) of the form can reproduce it RhodiumToad: no, scratch that, my mistake dsmith-work: Hey, dsmith-work: Morning Greetings, Guilers RhodiumToad: good evening roptat: hi, I'm using fibers for concurrency. on a fiber I want to use http-get (from (web client)), but it seems that it is using a blocking socket, and my program behaves strangely roptat: fibers manual says that I should use a non blocking socket instead, but I can't change the socket creation myself, so I tried to copy the source file for (web client) to my source code, and add the call to fcntl roptat: now, when connecting, gnutls-handshake return EAGAIN roptat: I don't know how to work around that, since the EAGAIN is documented in gnutls... roptat: ok, I did a loop over handshake, and it seems to work better, but now I get: Attempt to suspend fiber within continuation barrier spk121: . f-a: Hello, I am a new guile user f-a: is there a way to autocomplete an expression in the repl? f-a: like (nu for (null? chrislck: do you have readline ? f-a: I am sure it involves some readlin- I do chrislck chrislck: you'll want to type nu f-a: ho, it lists suggestions, silly me spk121: OK. Let's get a new release of guile-gi out the door. Trying to figure out what to put in NEWS is always the last task. civodul: spk121: woohoo! mwette: spk121: I checked out your stuff -- looking good. (I think MOP is usually overkill but this I want to try out.) spk121: mwette: originally we tried it without, but, it was just easier (from a implementer point of view) mwette: spk121: good to know your approach -- thanks davidl: Given a guile string varible that holds a big json document, what is the fastest way you can convert it to a list of lists representing the json list of objects? davidl: I have tried using the jansson C json library to walk through and create a list and return the list of lists as SCM to my guile program but that still takes a very long time to run for just a couple hundred megabytes of json. davidl: or, given a filename, what is the fastest way you can create a guile list of lists representing a json list of objects that is contained in the file? I am open to using the FFI and writing C code to read directly from a file just to get performance in building the guile lists. If anyone can explain even broadly what needs done I'd be grateful. My current attempt is still very slow. spk121: There are a couple of JSON libraries, but I don't know which is best for your use case. Sorry davidl: I have tried both sjson and json and both are slow in their json-string->scm methods. stis: davidl: have you tried to find which function does the most work in thise libraries? davidl: stis: no I have not stis: also how much time do you spend per atom in the messages? stis: what is your expectation? davidl: not sure I understand what you mean by "per atom in the messages". I expect that parsing 200MB of json text to a scheme datastructure should not take more than like 10-15 seconds. davidl: using python3.7 I could read, transform and write back to disk 200MB in 5.5 seconds. davidl: with guile the same operation takes around 40 seconds after leaving the read and writing to disk to a C extension module. davidl: most of those 40 seconds are spent on the read-json-from-string and write-json-to-string procedures. stis: yes the thing is if the time is in the parsing or creation of atoms. If it is in the parsing you can do better. More difficult if it is in the creation of the specific numbers strings etc in the messages davidl: I believe it is in the guile creation of lists and atoms. stis: if you only have substrings you could store just indecies in stead of creating substrings. I found that making strings are expensive stis: but you should do aproper analysis of which operation that really takes the time first. davidl: stis: ok thanks. this will take some time to figure out... :/ davidl: stis: what do you mean by "store just indecies" by the way? stis: instead of creating a string of a substring you store a pair of numbers indicating start and end in the original string. stis: Also you do 10-15 Million cons allocations per second so that is one limit stis: cons alloactions are pretty fast in guile davidl: ok, thx, maybe Ill try to something like that eventually. amz3: davidl: write-json-to-string is a mistake amz3: even if you don't rely on guile port, you can write the datastructure directly to the file descriptor amz3: no need for an intermediate big string. amz3: davidl: also, I was under the impression that you would give up. You really want you (tiny?) script(s) to be written in Guile :D amz3: davidl: what the json parser outputs? hash-tables? or alist? this might have performance impact downstream in the algorithm. davidl: amz3: I do want to do my work with guile whenever I can :-) the scripts are probably not going to be tiny in the end actually, which is why I wanted to switch from bash and jq to a "real" programming language like guile, which also has guile-bash which allows for a smooth transition or just certain parts to run as guile... but apparently performance didn't really improve with guile.. yet. davidl: amz3: reg json parser outputs; the guile-json library uses alist, and sjson uses "atlists" which are just regular 2-element lists with indices and values as elem 1 and 2 respectively. davidl: sjson do allow for parsing the json-strings to "fash", which is some hash data-structure. davidl: amz3: how do I write a datastructure directly to a file descriptor? (or file) davidl: amz3: thanks for your help and suggestions. I managed to create a C extension using the guile FFI stuff. I just called the module "cio" and it provides a "read-file" procedure that can read 200MB into a guile string variable in 1.5 seconds. Im gonna write a C extension for writing to file too now :-) ArneBab: davidl: wow … davidl: ArneBab: yeah it's a huge difference :-D davidl: ArneBab: still though, it takes almost 40 seconds for the same computation that takes 5-6 seconds in python... :/ davidl: Im considering that I need to write a C extension for parsing the string to a guile array. ArneBab: you might be able to golf this down to similar speeds davidl: I hope so eventually. ArneBab: it could even work in pure scheme — what mark did to the substring replacement felt magical :-) ArneBab: but it migh be better to have a read-lines procedure for this so you don’t have to split the string into lines in scheme davidl: ArneBab: here's the repo if you're interested https://gitlab.com/methuselah-0/guile-cio wingo: moo dsmith-work: Happy Friday, Guilers!! lloda: should or should not (when #t (define a 0) a) work? jcowan: It should not. jcowan: when takes a sequence of expressions, not a definition. If you want definitions, you can say (when #t (let () (define a 0) a)), or just (when #t (let ((a 0)) a)). b4283: didn't noticed there was "when" and "unless" until today jcowan: Yes. Some implementations specify the value of when/unless, but IMO one should not rely on it. jcowan: R6RS says if the test is true, it returns the value of the last expression, but if it is false, it returns an unspecified value -- which might by chance be the same as the value of the last expression. jcowan: So use when/unless for effect only. davidl: When Im reading and writing to disk with guile, even guile 2.9.x it takes ~10 times longer than in python3.7 - does that make sense or is it probably something with my implementations? davidl: Im using read-string from ice-9 rdelim and put-string from ice-9 textual ports davidl: python takes 5-6 seconds to read from file, transform it and write it back, guile takes ~55 seconds and it's all about the I/O. amz3: if you use raw files for storing data, that is probably the bottleneck. Actual data work, use data expert system, dubbed databases. Even in Python, you would not use an actual file for doing data work. Except for prototyping. amz3: davidl: ^ davidl: amz3: so if I transfer my 195Megabyte json-file to a database, would I see similar performance between a python-script and a guile-script loading and writing back data from/to the db? amz3: davidl: well, in guile you don't have GIL so... amz3: 195 is small. amz3: 195Mb davidl: amz3: I know, its why Im so surprised davidl: even my jq script doing the same thing is faster than guile davidl: what is GIL? amz3: jq is command line written in C? it is not comparable to guile, is it? amz3: Global Interpreter Lock. It means you can use multiple thread to do computation. amz3: unlike Python. amz3: well, in python you can use multiprocessing, but still, you would need to serialize in the mainthread using pickle or something to transfer that to the other process, unlikely to be faster using Python even in that case. amz3: IF you do some kind of computations. davidl: What are the strengths of guile compared to python? What can I possibly code "manually" to get a similar performance for simple I/O like this 195M file? amz3: GIL is the reason I started working with Guile. amz3: davidl: you can bind use C FFI to bind the glib primitives. amz3: davidl: you can bind *using* C FFI the glib primitives. amz3: maybe they are not glib but anyway. amz3: davidl: what are you up to do with guile? outside reading and writing files? davidl: yes, raw json text files davidl: reading them, small transformations which are fast enough, then writing them back as files. davidl: amz3: generally speaking I am doing some API programming projects. davidl: both json and xml, but currently just json stuff. amz3: davidl: and then you do what one the file is written to disk? amz3: is it a process that runs continuously or is it a command line one-shot-of-some-sort command? davidl: It will run basically like a cronjob. I have a json-list of json-objects in a text-file that get's downloaded regularly. I read the file and for each object I do a transformation and then I write the result to another file. amz3: then why you need performance if it is a background job? davidl: amz3: it is just one of a multitude of background jobs and this is only one part of many computations that will happen for this module. amz3: davidl: you should invest the time to write the same computation in python and guile and benchmark that. That is a real world benchmar (unlike microbenchmarks). davidl: well, just reading the string into a scm-list ("atlist" in sjson) takes longer than the whole I/O and transformation in python :/ amz3: I have to believe you. amz3: It is not what I find out in my own benchmarks. davidl: Im gonna try guile-json instead of sjson and read directly from an input port instead of to a string first. davidl: ..tomorrow. davidl: amz3: so just the part running (define myjson (json->scm (open-input-file "195megabytejson.json"))) takes 35 seconds with guile 2.2.6 using guile-json. davidl: amz3: what have you found in your benchmarks? amz3: I found that parsing s-expr using guile took 63ms where as in python it takes 247ms amz3: https://github.com/a-guile-mind/benchmarks/blob/master/guile-cx-read/time.log amz3: davidl: ^ amz3: the benchmark does include the time taken to read the file amz3: davidl: can you make you benchmark into a git repository so I can have a look at it. amz3: davidl: I plenty of json to test with so no need to include that in the repository. amz3: davidl: but if you can good :) amz3: the benchmark does NOT include the time taken to read the file amz3: $ cat cpython-cx-read/time.log guile-cx-read/time.log amz3: 13.841370582580566 amz3: 4 amz3: CPython is 3 times slower on this benchmark. amz3: and still slower when counting the f.read() file. amz3: (much slower that 185Mb) amz3: (much smaller that 185Mb) ArneBab: davidl: read-performance of ports isn’t perfect in Guile ArneBab: Python on the other hand is deferring writing right off to C ArneBab: davidl: the speedups mark managed to get into string-replace-substring just by optimizing the code were really impressive (easily factor 10) ArneBab: so you might be able to golf this down quite a bit ArneBab: davidl: and if there’s anything Python is really optimized at, then it’s reading line by line (with open(, 'r') as f: for line in f: print(line) *: jcowan wonders if some of the JSON processing in Python is happening in C bsima: if i have a lowercase char, how can i convert it to an uppercase char? is there a standard function for this? str1ngs: daviid oh, great will check that out ASAP str1ngs: davvid: which version of glib are you testing with? RhodiumToad: dsmith-work: there are two kinds of people in the world: those who believe that people can be divided into two kinds, and those who don't daviid: str1ngs: 2.62.2 str1ngs: daviid: with g-idle-add.scm I get (process:27756): GLib-GObject-CRITICAL **: 19:50:06.367: ../glib-2.60.6/gobject/gsourceclosure.c:261: closure cannot be set on GSource without GSourceFuncs::closure_callback str1ngs: daviid: I'll test further see if it's something related to my system. currently testing with guix daviid: str1ngs: no problem here, for all 3 examples, all fine str1ngs: daviid: could be guix or glib version related. my own local stack works no problem. I'll test further though daviid: what about the others? str1ngs: g-timeout-add works with my local stack. same with seconds daviid: g-idle-add should even work with very old glib, afaict str1ngs: my guess is it might be guix related. I'll investigate more tomorrow. so far it's looking good. nice work daviid: ok, let me know. i'm on debian testing str1ngs: hah I just used g-idle-add to emulate a gtk single :) str1ngs: this is huge progress str1ngs: signal* daviid: :) str1ngs: also I think I'm going to port my tests to use unit-test from guile-library. I think the only limitation with guile-library is it can only run serial? daviid: i thought g-idle-add didn't work for you daviid: guile-lib quiz, not sure str1ngs: it does not work with guix. but I also have my own glibc to g-golf stack str1ngs: I'm going to assume it's an issue with my guix stack, if my local stack works and your debian stack works str1ngs: I can test with ubuntu tomorrow as well daviid: ok str1ngs: great work :) daviid: tx Harzilein: hi count3rmeasure: hey yall, anybody have any macro heavy code/projects that they code point me toward? amz3: nanopassframework amz3: is it possible to port nanopass framework to guile? it rebinds quasiquote. wingo: modules can rename anything, including quasiquote dsmith-work: Thursday Greetings, Guilers wleslie: happy Thursday! amz3: tx amz3: I could try, instead of askin. dsmith-work: amz3: Asking first is cheaper, and could reduce wasted effort. amz3: ok wingo: moo jcowan: Those who rebind quote, quasiquote, unquote, and unquote-splicing deserve to lose, for lexical syntax is not hygienic. I have spoken. amz3: nanopassframework is very handy, tho. amz3: I am not sure it rebinds quasiquote. dsmith-work: Wednesday Greetings, Guilers dsmith-work: RhodiumToad: That reminds me: Three kinds of people in the world, those who can count, and those who can't. pinoaffe: or 10 types of people: those that know binary and those that don't *: jcowan likes negabinary best: there are three digits: -1, 0, +1. nerdypepper: >bi nerdypepper: >three digits pinoaffe: jcowan: I guess it's a neat choice of representatives for Z/3Z, a beautiful symmetry jcowan: "Euclid alone has looked on beauty bare" *: chrislck asks "what's z/3z?" https://www.google.com/search?q=z%2F3z O_o jcowan: On the first page is a link to an article called "Z/3Z = Z - Harvard Math Department", which I at first read as "Z/3Z equals Z minus the Harvard Math Department" daviid: str1ngs: spk121: g-golf now has g-idle-add, g-timeout-add and g-timeout-add-seconds, here are 3 examples to illustrate https://paste.debian.net/1112120/ str1ngs: daviid: right I get it. I guess I'm just being pragmatic and think that in term. typelibs still even for C++ is still more usable now then even SCM_DEFINE and guile's dynamic FFI. I will ponder your input some more. It's an intriguing and interesting discussion and problem to solve. dsmith-work: The thing with C++ that concerns me is exceptions. And how that fits in with Guile catch/throw or the r{6,7}rs stuff. str1ngs: though is it not normal for C++ libraries to a extern a C interface? dsmith-work: Desired, but not normal I would think. dsmith-work: I've been seeing a lot of C++ "header only" libs. str1ngs: I've been using https://isocpp.org/wiki/faq/mixing-c-and-cpp for reference myself dsmith-work: Not that I'm looking! I tend to avoid C++. str1ngs: I prefer C to C++ myself as well. and maybe when I reach scheme nirvana I can forgo that too :) dsmith-work: Yeah. C is my native tongue. dsmith-work: Though $DAYJOB as been mostly Python for the past 4-5 years. *: jcowan is a monoglot speaker and a polyglot programmer jcowan: I have no idea what my "native" programming language might be daviid: dsmith-work: yes, c++ exception is the problem, and vigra_c, imo, does the right thing daviid: str1ngs: most c++ lib do not have a C api, which is why it is a 'problem' for us, schemers, till a genius writes an automatic c++ to c wrapper or a libffi++ that takes care of c++ exceptions ... dsmith-work: daviid: This? https://github.com/BSeppke/vigra_c jcowan: Fortunately, it's a whole lot of "scripting" languages that can't talk to C++ jcowan: not just Scheme str1ngs: I think swig attempts that :P. but not exactly dynamic either jcowan: Does anyone know how Clasp does it? C++ is its native language daviid: dsmith-work: yes, that vigra_c is, imo, the right way to handle the problem, but it needs someone to write it 'maually' ... mwette: the nyacc ffi-helper is SWIG for Guile daviid: jcowan: yes, but if we could, we'd have octave and opencv 'in our hands' ... mwette: or at least intended to be jcowan: Chicken gave up on Swig a long time ago, I'm not even sure exactly why daviid: mwette: bcan nyacc ffi-helper provide c++ binding? if so, does it make guile c++ exceptions aware? mwette: daviid: no, C++ is too hard to parse, I looked into C++ parsing for a bit but decided too hard and I have little experience w/ C++ daviid: mwette: ok jcowan: the only thing you should parse C++ is a C++ compiler. nisstyre: does guile have a way of writing hash literals, better than doing (alist->hash-table '( (foo . bar) )) ? dsmith-work: No read syntax for hashes nisstyre: fair enough dsmith-work: nisstyre: See https://www.gnu.org/software/guile/manual/html_node/SRFI_002d10.html near the end nisstyre: dsmith-work: yeah, that's what I want nisstyre: kinda nisstyre: but it looks like the srfi is not recommended nisstyre: I'm trying to make it easy to configure a bunch of values nisstyre: maybe I should just create my own macro for that mwette: Right: clang is able to dump a parse tree. One could try that but it will be a moving target in terms for parse tree format. mwette: isn't hash-comma (#,) used by syntax case? dsmith-work: mwette: unsyntax jcowan: mwette: Yes dsmith-work: nisstyre: fwiw, The racket hash read syntax seems to just be a macro and an alist. dsmith-work: nisstyre: https://docs.racket-lang.org/reference/reader.html#%28part._parse-hashtable%29 daviid: dsmith-work: the vigra_c author is the author of vigracket, which is why he wrote vigra_c in the first place :) dsmith-work: That name is always looking like something getting past spam filters.. count3rmeasure: hi there, have a question about documentation and the binary I/O ports API count3rmeasure: its not listed in the docs for guile 2.0, but the module loads when I call it from the command-line, is there anything I should be worried about here? was it back-ported after 2.2? count3rmeasure: anyone awake here....? nerdypepper: yes. if someone knew the to answer your question, they would answer, don't have to ask. count3rmeasure: I mean, it is 2 am where I'm at count3rmeasure: and for what its worth, I've posted here multiple times and rarely get an answer! not trying to be a dick, just curious if anyone is up jcowan: bsima: KWER-ass is the historic pronunciation, but some say CURE-ass jcowan: I can provide IPA if that's more helpful civodul: howdy Guilers! amz3: o/ nly: how does compose work with multi-arity functions? nly: considering no function can return more than 1 value how will such a thing work. jcowan: Scheme procedures can and do return multiple values. However, I don't know that any implementation of compose can handle that: it would have to be done quite differently. jcowan: The cut and cute (read "cut e") are quite helpful in specializing procedures to have fewer arguments. nly: hi jcowan nly: thanks nly: i am trying to build procedures using graph-traversals, find path from a to X, then build a composition of procedures to go from a to X. Maybe someone has tried this? nly: 'converter' proc at https://github.com/o-nly/resonance/blob/master/resonance/try-again.scm#L93 dsmith-work: Happy Friday, Guilers!! daviid: yeah, happy friday! civodul: hey, happy Friday Guilers! amz3: nly: yes amz3: nly: what do you mean by 'graph-traversals' ? amz3: nly: did you look into gremlin DSL amz3: https://en.wikipedia.org/wiki/Gremlin_(programming_language)#Traversal_examples amz3: nly: ping me if you still want to discuss your project. amz3: I am not sure what graph traversal has to do with VCS. amz3: nly: https://github.com/awesome-data-distribution/datae jcowan: amz3: Any time you are changing things in a reversible way, you are traversing a graph. Usually it's a tree, but that isn't actually a requirement. nly: thanks amz3 nly: finding a path in a graph. I am using it to construct procedures to avoid specifying the sequence of instructions. nly: also storing the tree of a directory as a graph. daviid: pinoaffe: wrt guile-gnome, there are a series of example in the repo and the tarball, in the gtk/examples/ and gtk/examples/guile-gtk-demo project subdirs daviid: pinoaffe: most work with the latest guile-gnome version, but some do not - they were not adapted and won't be, unless someone wish to solve those, I won't, but patch welcome daviid: pinoaffe: this said, guile-gnome works fine, if you're happy with (very) old gtk bindings, but if yo are interested by gtk3, soon gtk4, you should rather use guile-gi daviid: pinoaffe: i'm also working on a gobject-introspection lib, called g-golf, but i can't recommend it if you are 'in a hurry', because it still misses some important 'bits', which i hope to complete 'soon', and although i don't want to commit to an official ETA wrt those missing features, by 'soon' i'm thiking something like within a month or two ... pinoaffe: daviid: thanks for the info! daviid: welcome! amz3: chrchr: maybe guile-opengl is required uranther: why does (scm->json #(1 2 3)) not work but (scm->json "hello") works? I get the error: Throw to key `json-invalid' with args `()'. Josh_2: Hi, are there any example programs that demonstrate guiles webserver? The docs are very primitive Josh_2: responding to post requests specifically houkime: hi. ‎I have a question about GOOPS. Since slot initialisers like init-thunk don't seem to have any access to "self", i.e. instance itself, i tried to use a specialist "initialize" method. It is called ok, but the problem is that initializers for superclasses are not called so this 'initialize' needs to do a lot of extra work. houkime: thus the question is - can i somehow explicitly call default initializers for superclasses? houkime: so i just call all default stuff and then do some work on top of that? houkime: this might be possible if one can call generic functions (including 'initialize') with explicitly defined class to operate on so that i can choose _which_ 'initialise' to call but I don't yet know how to do that. houkime: now that i look through document agiain one one can probably use 'next-method' houkime: *documents houkime: however in this case one can desire even more - to also call the default initialiser for the class itself (without creating an extra derivative class which would obviously do the trick) amz3: Josh_2: look at https://github.com/a-guile-mind/guile-web/ amz3: Josh_2: or guix web amz3: Josh_2: or guix cuirass amz3: Josh_2: or guile-pastebin (maybe that last one is the easiest to get started for reading purpose, but running it will be difficult, because bitrot) dsmith-work: Thursday Greetings, Guilers nerdypepper: evening o/ pinoaffe: does anyone have some example code using gnome-guile? or just a relatively simple ui program using the lib pinoaffe: never mind, I was able to find https://github.com/yang-qu/gtk-tutorial-using-guile-gnome bsima: how does one pronounce "cuirass"? reepca: I've just discovered some "interesting" behavior of the reader: (let ((ests "foo")) (list #tests)) => (#t "foo"). Not sure if technically a bug, but not behavior anyone should count on and confusing to people making syntax errors accidentally str1ngs: reepca: I don't think that's a bug. consider this (liset #t'est) => (#t est) str1ngs: err (list #t'est) str1ngs: maybe the bug is the lack of spacing between list items? reepca: quotes shouldn't normally be used to separate atoms. 2'3 is one symbol, as is foo'bar. I think it would make a lot of sense for #tests to be a syntax error, and for it to be necessary to write #t ests to get the current behavior. Though I'm not sure what the standards actually mandate in this area. str1ngs: reepca: probably more of how #t is evaluated then anything else str1ngs: #t is a boolean of course reepca: aye str1ngs: it's an interesting question. though not many scheme programmers would program like this. str1ngs: maybe someone new to scheme would run into this reepca: str1ngs: aye, it actually just happened to someone new to scheme writing a package over in #guix str1ngs: based on the context of #:test keyword issue in #guix anyways nisstyre: so they forgot a colon and it parsed it as two tokens amz3: r7rs ftw! nly: is there any way to get all the bound symbols in an environment? amz3: nly: no, in general scheme is has no or limited introspection. amz3: nly: no, in general scheme has no or limited introspection. amz3: sorry, maybe guile is different in this regard, you can introspect modules, so if an environment in guile is also a module you might be able to see what is bound. nly: amz3 ok amz3: nly: what are you trying to achieve? what is the big picture? maybe you could use a hash-table to store the variables? nly: i need a list of procedures applicable in a problem domain: say (+ - *) in arithemetic amz3: better create a hashtable, I had a similar problem years ago mark w. told me to use hash-table. That being said, you can also rely on module introspection, but that imo would be less nice. amz3: my problem was about the implementation of "filters" in template system. the filter were in the end, stored in hashtable. nly: ok, i can make some progress with that amz3: fwiw, in python relying on introspection (such as locals(), globals() or even getattr(some_module, 'some_object')) to achieve such behavior frowned upon. Introspection is nice at the REPL for discovery, but in real-world. I always rely on dict-switch pattern instead. It is more grep-able and it is also more efficient. amz3: I am not sure about Common Lisp or elisp, my understanding is that since they are LISP-2, that kind of behavior is common place. nly: thanks, i guess i should try both routes wingo: civodul: managed to rebase srfi-35 on top of core make-record-type; have a look if you like jcowan: I have a pre-SRFI for compound objects, a generalization of compound conditions, at https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/CompoundObjectsCowan.md jcowan: it tries to hide the difference between compound and non-compound objects as much as possible. wingo: jcowan: in what cases have you ever wanted a generic concept of compound objects? dsmith-work: Hey Hi Howdy, Guilers jcowan: It brings some of the power of multiple inheritance to single-inheritance systems without the many complications of full-blown multiple inheritance. ANSI CL has always had multiple inheritance, so it doesn't need compound exception. jcowan: s/exception/conditions wingo: guile has goops for the generalized multiple-inheritance case. for me multiple inheritance a better solution if you need perf; it's a more type-driven approach than object composition jcowan: Good point, but the implementation of compound objects doesn't have to be dumb. I don't know what R6RS systems do in general. wingo: i think for compound exceptions, it's more of a data composition thing than a type thing wingo: in implementations anyway chrislck: ok sorry to bother the greats, what's the issue with deprecating (make-record-type "string" ...) because it'll be a much harder work to fix this in gnc. chrislck: (record-constructor arg1 arg2) is nearly eradicated. wingo: i feel like every 5 years or so i get to uncruft some aspect about guile's records wingo: maybe one day that horrible layout symbol will go away amz3: my trying to understand why the blue zombies company use "fiber" word for their most successful software of all the time. amz3: formely they were advertising a free as free-beer forums. amz3: now it is just a spy agency. dsmith-work: A high-fiber diet keep "information" flowing? amz3: yes, slowly flowing, if you benchmark the form that captures your personal info. Private info harvesting is mostly done in the background, but keep being shutdown because: "no more battery". amz3: around 34 fields in the base record. amz3: and the code does only foo.xyz = bar.xyz otherwise said, a shallow copy. #XXX: OPTIM amz3: ditto, that is an optim because some a core language feature of the language is dubbed _too slow_ and because "This code is DEV-only so size is not a concern." amz3: well, I started reading that to become more clever, but I feel not very well, I think I have a very bad NIH syndrom. amz3: the code for development (DEV) is not the same than producion. amz3: the code is riddled with: if (__DEV__) { frob } where DEV means dev time. amz3: (from the point of view of the coder ;) amz3: here is the kind of helpful message, state-of-art computer engineering can produce in terms of literate^M documentation: amz3: if (__DEV__) { amz3: // DEV-only fields amz3: to get started, s/DEV/DEBUG/ amz3: to get started, s/DEV/DEBUG/g amz3: here be dragons and its children http://paste.debian.net/plain/1109418 amz3: s/its/their/ amz3: I added that to my to read list: https://scheme-lang.com/Screenshot_2019-10-23%20Continuations,%20coroutines,%20fibers,%20effects.png amz3: so far my understanding is they are building a "scheduler" in the sens of OS kernel to "batch" rendering operations, in the forms of DOM add/update/delete (update can include style attribute modifications) amz3: in oreder to give animation highest priorities, and actual knowledge low priority. amz3: that happens to be my experience with their so called book. amz3: from the start I made mistake rely on that software, but now, there is two possibily: a) it is genius hence not ready yet, (like the code and documentation mention it) d) ... amz3: s/d)/b) amz3: amz3: dsmith-work: you do not use their apps, I think, the web app is VERY slow. amz3: not mentioning a critical bug they claimed did not exsits and was fixed in later version. chrchr: Hi! I've just installed a guix system specifically to mess around with chickadee. So I do 'guix install chickadee' and I expect that I should then be able to do (use-modules (chickadee)) in guile, but I get "no code for module (chickadee)". Suggestions? civodul: chrchr: hi! perhaps you need to "guix install chickadee guile" and then follow the instructions to set GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH accordingly? chrchr: civodul: I will pursue that. Thank you! civodul: yw! chrchr: Progess! Now failing like so: "In procedure dynamic-pointer: Symbol not found: glGenTextures" str1ngs: sneek: later tell nly. were you going to use libchop with resonance? sneek: Got it. daviid: str1ngs: welcome! nly: hi sneek: nly, you have 2 messages. sneek: nly, str1ngs says: this looks really interesting sneek: nly, str1ngs says: were you going to use libchop with resonance? nly: sneek help nly: sneek later tell str1ngs probably, yes sneek: Will do. str1ngs: nly: ipfs might be useful here as I mentioned before. since I believe some work is being done to support ipfs in guix. Assuming you are using guix store sneek: str1ngs, you have 1 message. sneek: str1ngs, nly says: probably, yes str1ngs: nly: based on your current state of work. it would be nice if after saving you can diff the tree against the save state. I'm assuming this content aware like git? nly: str1ngs: diffs would be nice. nly: thanks for the suggestion nly: it's not really content aware yet str1ngs: gotcha, and I think you are using libchop for merkle tree's right? nly: nope, i am not using it yet str1ngs: but that would be the reasoning for using libchop? nly: i want to use it for storing compressed or encrypted content nly: but idk str1ngs: gotcha, I might have misunderstood the need for libchop then :) wingo: civodul: fyi a bit of a recap on what i'm working on -- wingo: i want a --r7rs option to guile, to complement --r6rs wingo: i have imported weinholt's work to guile but i would prefer to mostly layer r7rs on top of guile, instead of on r6rs wingo: but for exceptions, it's tricky. the guile r6rs code already does a fair amount of mostly-ok impedance matching between throw/catch/with-throw-handler and with-exception-handler/raise wingo: and i wouldn't really want to duplicate that wingo: at the same time, guile's error handling is historically something of a disaster wingo: like, i never know what the arguments to scm-error really mean :P wingo: so it would be better if possible to rebase guile's error handling on top of more structured exceptions wingo: i have a branch that rebases throw/catch on top of raise/with-exception-handler wingo: of course raise has to be called raise-exception because guile binds "raise" to the syscall ;) wingo: anyway wingo: so far so good -- but then there are some more exciting problems wingo: like, most schemes allow for subtyping among exceptions wingo: and we've never supported subtyping of records wingo: turns out there is a reasonable O(1) way of doing subtyping, so i am now fixing guile's records to allow subtyping, and also to be able to mark some types as final so that they don't incur any additional overhead wingo: types are currently marked final by default wingo: so once i get subtypable records, i will work on defining specific exception types for guile, mostly following what's already defined in boot-9 in the set-exception-printer! code wingo: once that's done, i'll add with-exception-handler and raise-exception, somewhat in parallel, then migrate uses in libguile over to raise exceptions instead of calling throw wingo: once that's done, then throw/catch sits on top of exceptions. exceptions that originate in guile can round-trip perfectly between key+args and an exception object, so it doesn't matter which you use wingo: "generic" exceptions will be represented as key=%exception, args=(val) wingo: i.e. exceptions that didn't originate in throw and which isn't a "known" type wingo: er civodul: hey wingo! *: civodul reads wingo: "generic" exceptions will be represented as key=%exception, args=(val), for the purposes of throw/catch wingo: braindump done. wdyt? :) civodul: so... :-) wingo: :) civodul: re rebasing exceptions on top of structured exceptions: i think that's a good idea civodul: my concern would be the cost of converting back and forth to key+args civodul: and also making sure that we really are compatible *: wingo nod civodul: i think it's quite common to write things like (catch 'system-error (lambda () xxx) (const #f)) civodul: so this would have to remain as fast as it is civodul: well i guess it's faster in 3.0 anyway, but still ;-) wingo: that's not as fast as it could be of course :) civodul: re record subtyping, that's great! civodul: we could even have SRFI-99 (?) then wingo: i mean that particular catch idiom civodul: ah yes civodul: hence the 'stat' 2n argument civodul: *2nd wingo: right civodul: but there are still many cases where we have no other options but to catch the thing civodul: *option civodul: you're planning on adding record subtyping directly at the level of structs, right? wingo: fwiw probably that case would be (with-exception-handler (lambda (exn) #f) (lambda () ...) #:unwind? #t #:unwind-for-type system-error?) wingo: there are some details civodul: ok wingo: the r6/r7 system defines exception handlers that run in the context of the error wingo: it's a pre-unwind system civodul: yes wingo: but in some emergency contexts in guile we can't run code there wingo: like stack-overflow in a hard limit case, or out-of-memory civodul: true wingo: so we need the ability to annotate the stack of exception handlers with data indicating what they might handle, as an optimization civodul: as in what exception data type they might handle? wingo: i.e. if this handler handles everything and is going to unwind the stack, we mark it as such, and unwind before calling the handler wingo: or if this handler handles all 'system-error exceptions and unwinds, same thign civodul: ok wingo: i think symbolic exception types would have to be a part of the system for the forseeable future, to be able to make this kind of check wingo: so my example should have been #:unwind-for-type 'system-error fwiw civodul: how does this play with "compound exceptions" à la srfi-35? civodul: also, in srfi-34 you can specify several handlers in one 'guard' clause, and i think that's pretty neat (better than 'catch') wingo: so e.g. (catch T THUNK HANDLER) => (with-exception-handler (lambda (exn) (apply HANDLER (exn-key exn) (exn-args exn))) THUNK #:unwind? #t #:unwind-for-type T) wingo: so there are multiple options there wingo: as you might recall i think srfi-34 guard is bonkers with respect to continuations -- jumping down to run the guard code then back into the context of the exception to continue dispatching... bonkers wingo: but i shouldn't have said that, it's a distraction wingo: i think you can build anything you like in terms of with-exception-handler and raise-exception (and raise-continuable) wingo: guard is built on top, as are anything related to inspecting exceptions, compound or otherwise civodul: ok wingo: the real question would be more like "should guile use compound exceptions" civodul: when you say with-exception-handler and raise-exception, these are r7? wingo: yes but they are very similar in r6 and in racket civodul: ok civodul: "should guile use compound exceptions" is a good question civodul: i think key+args has been used as compound exceptions: &message + a specific exception civodul: that's definitely the case for 'system-error civodul: there's data, and there's human-readable message civodul: i think it's a useful feature wingo: yeah, but you could see it as subtyping also. compound exceptions are more flexible but most of guile's exception types in practice are a DAG forest, given that we represent the data as a list davexunit: all the error throwing code I write sucks because I don't know what I'm actually supposed to do. so I just use 'error' and I know that's not great. wingo: davexunit: hoo me too yo wingo: fwiw racket appears to have an exception hierarchy for use internally; they don't appear to use compound exceptions wingo: internally anyway civodul: wingo: it would seem "weird" for &system-error to be a subtype of &message, though civodul: ok civodul: i guess i got very much used to the SRFI-35 way :-) wingo: yeah but if it were a subtype of &guile-exception-with-message it would be 'normal' :) civodul: ah sure :-) civodul: well dunno, no strong opinion wingo: so i actually don't have much experience here with structured exceptions wingo: so i probably have not-great instincts civodul: R6 does more or less the same as srfi-35, right? wingo: is this something you'd want to have a poke at? i can lay down a draft that can change; i think once the adapters are all there and throw/catch works as it does now, the concrete representation of guile exceptions can change until 3.0 wingo: civodul: afaiu yes though there are tie-ins with the r6 record system civodul: i can have a look and i'm happy to be in the loop, but i prefer not to commit to a specific timeline *: wingo nod civodul: in Guix i've been using compound exceptions more lately, mostly to have a user message + structured exception wingo: you ok with me working in this area? civodul: yes, sure wingo: coolio civodul: so re subtyping, this is something you'd add at the level of structs? wingo: civodul: no, at the level of records civodul: records... as in boot-9.scm, right? :-) wingo: :-) wingo: yep civodul: ok civodul: there's no shortage of records out there ;-) wingo: i am trying to unify them :) civodul: cool :-) civodul: it's not that bad actually wingo: i keep thinking that we should have some kind of basic define-record facility in boot-9 that is expressive enough for others to build off of wingo: dunno if it's possible civodul: i was going to suggest simply using srfi-35 or r6 exceptions as-is, not sure if that makes sense civodul: that would decorelate the exception work and the record work civodul: ("de-correlate" maybe?) wingo: but re subtyping, with goops supporting multiple supertypes, i don't want to preclude that nor push it into core wingo: right but there are bootstrap considerations, and r6 pulls in a lot more civodul: ah yes wingo: i would rather do a kind of rebase -i to get needed things from r6rs exceptions into core, and make the r6rs exceptions layer lighter civodul: so you'd need to isolate the relevant r6 bits civodul: ok, sounds reasonable civodul: then we should also arrange so that srfi-35 and r6 have a direct low-overhead mapping to the new exception type wingo: yes exactly civodul: ideally they'd be just syntactic sugar above that new exception type wingo: ideally, but in the case of r6 there are again those other record considerations, so more impedance matching might be needed civodul: arf, yes civodul: tricky wingo: srfi-35 doesn't specify any tie-ins with e.g. srfi-9 so that's easier to rebase civodul: probably wingo: (although already core records and srfi-9 are compatible) civodul: well anyway, exceptions are supposed to be... exceptional? :-) wingo: in terms of how they represent the record type objects internally i mean wingo: hah :) wingo: fwiw raise-exception takes any value :) civodul: ok wingo: doesn't have to be an exception wingo: fun times civodul: like throw wingo: yeah but at least the key has to be a symbol civodul: i'm sure there are people out there using throw for non-local exits but not-quite exceptions wingo: yep wingo: they should of course be doing let/ec, it's cheaper :) civodul: i think you can do (throw 42) provided you handle it correctly? civodul: yes, but that's another compat consideration wingo: civodul: nope, throw checks that the key is a symbol civodul: ah ok, good :-) wingo: i think we've had let/ec since 2.0 or so fwiw, so pretty good there civodul: yep dsmith-work: Hey Hi Howdy, Guilers civodul: howdy dsmith-work! wingo: civodul: landed subtypable records fwiw *: wingo back to what i should be working on :P nly: are lists as fast as arrays in guile? dsmith-work: wingo: Wow, that was quick! wingo: well, been thinking about it for a while :P wingo: nly: depends... generally vectors are faster but you should look at your use case :) chrislck: are srfi-9 records so much faster than record-constructor then? wingo: chrislck: there are a few things going on there; srfi-9 records are faster because they do more at syntax expansion time and make more interesting info available to the optimizer wingo: record-constructor is fine but the version that took two arguments was excruciatingly slow wingo: and not used in guile wingo: does gnucash use the two-arg record-constructor ? chrislck: ooh plenty :) wingo: fun :) *: chrislck will get busay wingo: perhaps i will have to undeprecate if it's really important but i think you will be happier with the one-arg version (that makes a constructor that takes all fields as args) wingo: lmk how it goes chrislck: tagging gjanssens so he knows why I'll continue srfi-9 conversions chrislck: no issues expected for the next 5 years at least, when the distros start shipping 3.0 chrislck: actually not that bad, most are 1-arg nly: thanks wingo gjanssens: chrislck: right, thanks for the heads up amz3: sneek: later tell soda__hobart I reported the bug against guile-redis regarding pub/sub at https://github.com/aconchillo/guile-redis/issues/3 sneek: Got it. heisenberg-25: Hi, does setting GC_INITIAL_HEAP_SIZE env variable affect the guile gc? Josh_2: How can I find out what type an object is? davexunit: Josh_2: there isn't any single procedure you can call to get the type of any object. davexunit: instead you'd ask questions about the data: (if (number? x) ...) davexunit: however, using guile's OOP system (GOOPS) will create a class hierarchy for all the core data types. davexunit: and then you could do things like (eq? (class-of 999) ) Josh_2: ahh alright Josh_2: thanks for the info :) davexunit: yw daviid: str1ngs: sorry about the debug info display, I just pushed a fix, please pull .. daviid: janneke: tx, but i found that msys2 has a guile 2.2.6 package already - i couldn't test it yet, i still do not have access to a win machine, so i don't know if it works 'fine', if it is a 64bits verion, and if t has threads ... but here https://packages.msys2.org/base/guile daviid: spk121: ^^ chrislck: ^^ it does work... chrislck: fwiw upgrading guile-in-gnucash from 2.0 to 2.2 has solved lots of problems daviid: chrislck: ok, do you happen to know if it is 64bits? and does it has threads? chrislck: erm how do i test chrislck: threads: ,use (ice-9 threads) -> ok daviid: chrislck: that sounds like a miracle :), saying this because unless i missunderstood, till very recently, those tryig to make this work on win reported that it was not working ... daviid: i don't know how to check if it is a 64bits version chrislck: kudos probably belong to the msys2 guys :) daviid: yes, but i beleive he/she is picking spk121 patches, or other patches maybe, because for sure out of the box guile wouldn't compile on w64 ... so i've been told, all this is very far from my domain and knowledge, i'm just very happy it works fine, and better if 64bits, but that don't know (yet) davexunit: yeah guile needs patching to compile with mingw davexunit: and 64 bit is more complicated than 32 bit. daviid: davexunit: are you using these msys2 package then? davexunit: no I don't know what that is davexunit: I've experimented with using guix to compile guile for windows using mingw in the recent past, though daviid: saying msys2, but they say it is a rewrite of msys and depends on cygwin, not mingw (?) davexunit: I got what seemed to be a working guile 2.2, but I didn't run any serious workloads on it. daviid: davexunit: here https://www.msys2.org/, and the guile packages here https://packages.msys2.org/base/guile davexunit: 32-bit guile 2.2, that is. 64 bit was causing me trouble. davexunit: daviid: neat! maybe I could borrow some of their patches. daviid: "... At its core is an independent rewrite of MSYS, based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 ..." davexunit: I want to continue using mingw because I can cross-compile my executables from linux with guix daviid: i'm interested in MinGW-w64 daviid: i mean a 64bits verion ... davexunit: the naming is confusing. mingw-w64 is a different project from mingw. seems to have superseded it. davexunit: but it can produce both 32 and 64 bit executables daviid: yes, all these names are very confusing for me, especially because so far i can only read about, not testing yet :) daviid: could be mistaken, but it did seems to me mingw-w64 is quite a lot better then mingw, don't know daviid: by all mean, the fact that one can install msys2 and that's it, after that just use pacman commands, is a must daviid: and they have an imressive list of packages ... davexunit: yeah it's nice davexunit: for myself, I'd like to produce binary bundles of software from linux that people can just unzip and run on windows. daviid: davexunit: i understand, but you could as well 'produce' an msys2 package, maybe, from guix ... daviid: will guix run o win one day, is it possivble i mean? davexunit: I don't think that would help me davexunit: might be possible amz3: what do you think about a nanopass framework for guile? davexunit: but I think anyone cares enough to do that daviid: davexunit: i had some doubt because of the guix daemon davexunit: there would surely be some porting issues to sort through davexunit: but I don't think there's anything making it an impossible task daviid: i understand it's far from the guix objective in the first place, but if it did exist, i would have used it instead of msys2 of course ... daviid: anyway, back to hack :) jcowan: So write a Linux kernel in Guile, and then it will run on Windows jcowan: or wait for better Win32/WSL integraton jcowan: Which is surely coming, now that Docker on Windows (as opposed to Windows programs running in Docker containers) is switching to WSL2. daviid: jcowan: i think guix pack is already able to produce 'something' that runs on win, but guix itself ... that would be another story :) daviid: and guix pack is order of mag better then docker ... jcowan: but guix pack has only userland binaries, right? jcowan: it doesn't package a vm vel sim daviid: jcowan: not sure daviid: others would know ... i'll let them answer that jcowan: ah, you say guix pack -f docker and then you get a docker image instead of a tarball ... nice davexunit: if guix was going to run on windows it would be "native" as in no WSL jcowan: So you could only package native Win32 apps? davexunit: the packages supported on windows would be cross-built for windows davexunit: each package object can say which systems it supports and can do different things depending on which system it is being built for. daviid: davexunit: you could cross build for mingw-w64, couldn't you? davexunit: daviid: yes daviid: ok, was just curious davexunit: that's exactly what I've done trying to make my own guile builds for windows jcowan: Makes sense, although sometimes you'd want to containerize programs that are not cross-platform, e.g. when doing Windows-specific devops. davexunit: that sounds like a higher layer issue davexunit: as opposed to the base package management tool jcowan: mmm daviid: str1ngs: while writing a tiny example for you, i found a bug in g-golf :), fixed and ushed it, please pull and make ... daviid: str1ngs: then you can do this, just as an example of course https://paste.debian.net/1108944/ daviid: str1ngs: one thing to mention, till i find the time to document, is about the type - #:return-type and #:param-types - which must either one of the %g-type-fundamental-types or instance, a instance, or subclass instance daviid: wrt to the last three, you have a few examples for each i the test-suite daviid: str1ngs: I am saying this, because of the confusion (maybe) with the fact that when usig the ffi, we need to pass the value of the type, not the symbol, and some type names are equal ... but this has nothing to do with glib/gobject and closures ... hope i'm clear :), not sure, ping me if not ... str1ngs: daviid: example closure works well. and thanks for fixing the g-import output issue. dsmith-work: Hey Hi Howdy, Guilers nly: hi str1ngs: hello nly! nly: str1ngs: hey str1ngs: nly: direct work on nomad has slowed down abit. but indirect work is still active. mainly in the form of qtwebengine/guix . How are things with you?\ nly: i did read the mail :) thanks for carrying it forward nly: i am a bit distracted with other things str1ngs: nly: no worries, I figured you were working some other interesting things :) nly: i found a problem with toggle-tabs, mouse clicking on tabs does not switch the current-buffer nly: not sure, why it's happening str1ngs: nly: which branch does this? nly: feature-g-golf str1ngs: I'm aware of why it does this and implemented a fix str1ngs: basically if you click a tab, there needs to be a signal that switches to that tabs emacsy buffer nly: yeah makes sense str1ngs: things are different on the g-golf branch. so it could be a regression. nly: oh nly: any clues str1ngs: mainly the issue is the tab control, needs to be aware of its emacsy buffer someone str1ngs: some how* str1ngs: for the non gtk branch I have a private GObject struct member that holds the controls emacsy buffer. for reference. str1ngs: ideally though g-golf is still highly experimental to use str1ngs: err not g-golf the g-golf branch I meant. :( nly: still, pretty solid :) str1ngs: g-golf is working great. it's our branch that's not complete yet. just to clarify nly: thanks. makes sense nly: str1ngs: what do you think of this? https://github.com/o-nly/resonance, some progress on version-control str1ngs: sneek: later tell nly. this looks really interesting sneek: Okay. dsmith-work: sneek: sneek? sneek: I could be wrong, but sneek is a good bot bsima: why are things called 'ice-9'? what is the history of this? bandali: https://lists.gnu.org/archive/html/guile-devel/2010-07/msg00046.html comes up bsima: mm thanks, i didn't think to search guile mail lists bandali: cheers bsima: if i write a library in guile, does that mean i have to open source it under the gpl? spk121: bsima: no. You can release code written in Guile under any license you like. But if you write a library to put in Guile itself, you need to follow GUile's license bsima: ok thanks daviid: spk121: ah ok, do you have any idea when? daviid: spk121: oh, i see there is a guile package i msys2 already, that says it is 2.2.6-1 based o arch? here https://packages.msys2.org/base/guile daviid: str1ngs: closures are now working in g-golf - undocumented yet, but you find some 'useless' examples in the thest-suite, that will give you an idea on how to create and call closures ... daviid: str1ngs: this is the first step toward signals ... though not very usefull untill they are 'usable' (like in callbacks and signals), they are the 'corner stone of those', if you want to play/test a few ... feedback bugreport welcome ... daviid: janneke: tx, but i need either an msys2 package, or instructions to build guile i a msys2 environment daviid: chrislck: hello! wrt gnucash on w64, do you use msys2 as well? chrislck: daviid: my experience with guile in windows stems from hacking & using gnucash only... (and have dislodged a few gnucash&guile bugs) the msys2 installer takes care of packaging it I'm afraid janneke: daviid: ah, i don't know what an msys2 package looks like janneke: could be trivial to create from a guix pack, ie in the cross build, could be pretty hard :-) soda__hobart: hi everybody, hoping that the scheming might help the guiless, I'm tripping on something--how do I access the multiple values returned from the web client? I'm kicking myself because I figured this out last week, but now I don't remember how I did it. soda__hobart: this is what I tried: (define gnu-site (call-with-values (http-get "https://www.gnu.org" #:decode-body? #t) (lambda (response body) (list response body)))) soda__hobart: but I get a "Wrong type to apply" error chrislck: (call-with-values(call-with-values (lambda () (http-get "http://192.168.20.1")) (lambda (response body) (list response body))) chrislck: (call-with-values (lambda () (http-get "http://192.168.20.1")) (lambda (response body) (list response body))) soda__hobart: so why does it do what I want when I wrap the (http-get) in a lambda? Doesn't (lambda () (http-get ...)) return the same thing as just plain (http-get...) ?? chrislck: no, (http-get ...) returns something which is not a thunk; call-with-values wants a thunk soda__hobart: oh...! soda__hobart: cool, thanks, learned something today chrislck: you're welcome! soda__hobart: so is that like a generally used pattern, wrapping a procedure in a lambda to make it a thunk so it can be passed around more easily? chrislck: sure, do a full-text-search for thunk in the manual to find all of them soda__hobart: or I guess it's kind of like memoization, or a promise object? Looking at the wikipedia. chrislck: no: memoize means the thunk output isn't called every time; it's called once then the output is retreived from cache chrislck: promise means the thunk is not evaluated immediately but can be another time chrislck: https://wiki.call-cc.org/eggref/4/memoize soda__hobart: oh ok, so it's like in SICP where they talk about evaluation and applicative order and stuff soda__hobart: so like a practical use could be something like downloading a big ol' file--we can see if the response is positive, and then the http-get can keep evaluating while we do something else? chrislck: huh this is about multithreading/fibers. I think http-get will freeze while downloading? soda__hobart: I've been reading about fibers, but I'm more just trying to understand the concepts in general. soda__hobart: like I was playing with guile-redis, and made a pub-sub channel on redis, and I defined a procedure to listen to the channel that was like (define (listen my-channel) ((if (redis-send subscribe (my-channel) (display message) (listen my-channel))))) amz3: if you want to convert multiple values into a list of scheme object you use (call-with-values thunk (lambda args args)) soda__hobart: roughly, like that, but I also used a named let to make it loop even if it does display a message soda__hobart: but it was using 100% of the CPU because it was just looping and burning rubber, so to speak. amz3: I am not sure about big files what happens amz3: soda__hobart: how is implemented redis-send? amz3: can you paste the code? soda__hobart: I will re-write it real quick, I wrote it in the REPL last week, just messing around, didn't save it soda__hobart: but guile-redis is just a really thin wrapper over redis-cli, it's not like python-redis where there's some sort of listener for the pub-sub amz3: you rely on guile-redis? soda__hobart: oh I did save it soda__hobart: https://bpaste.net/show/EAUCC soda__hobart: I don't rely on it, it's just fun to mess around with soda__hobart: like if I'm just experimenting in the REPL, I like to use it for data persistence amz3: data persistence and REDIS in the same sentence does sounds good (to me) amz3: well, first pub-sub in REDIS might not work like other request-reply commands soda__hobart: well, I don't really need it to be persistent, haha soda__hobart: yeah it works differently for sure. in the redis-cli if you use the subscribe command it will just block and print lines when it gets a message *: amz3 reading https://redis.io/topics/pubsub amz3: it seems to me that it might be a bug a guile-redis. amz3: soda__hobart: anyway, what are you trying to achieve, what is the big picture of your project? soda__hobart: the big picture is I'm trying to make some sort of BBS or chat room for sharing plain text soda__hobart: brb, got to take the girls to the mall, haha amz3: ok str1ngs: daviid: great thanks, will check this out ASAP. soda__hobart: so anyways, I run that sub-listen procedure (from here https://bpaste.net/show/EAUCC) and htop says that guile is using 105% CPU and the laptop fan is hissing... I'm guessing it's because the recursive function keeps re-initializing (or establishing or whatever the correct terminology is) the subscribe command about a zillion times per second. Is that right? amz3: soda__hobart: my recommendation is to create an issue on github against guile-redis str1ngs: daviid: one thing and I kinda mentioned it before. is gi-import does a bunch of console output. looking like this ;; GtkTreeView 15 signals. is this temporary debugging out? str1ngs: daviid: also I think this is a good example to play with? http://git.savannah.nongnu.org/cgit/g-golf.git/tree/test-suite/tests/hl-api.scm?h=devel#n123 Josh_2: Hi, am following this tutorial https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html I am at 3.2 but when I compile I keep getting this error https://plaster.tymoon.eu/view/1523#1523 Josh_2: wait Josh_2: maybe I fixed it Josh_2: well Josh_2: I don't know what I did but it works now xD Josh_2: Is there a tutorial calling c functions from guile? an ffi amz3: Josh_2: look at existing bindings for exemple : https://notabug.org/guile-sqlite3/guile-sqlite3/src/master/sqlite3.scm.in amz3: the ffi is straightforward amz3: Josh_2: here is a small tutorial https://hyper.dev/blog/gnu-guile-ffi.html amz3: Josh_2: but do not use dynamic-link* if you need to access a static varialbe in C Josh_2: I currently just have two functions I want to call amz3: read the manual Josh_2: I want to do an ioctl call in guile, this is possible right? Josh_2: Or would it be better to just created a dynamic library in C which does the ioctl calls I want and then just jimmy that into my guile program with ffi? Josh_2: well I managed to get my library to work in guile :) I'm happy about that daviid: spk121: hello! any news on the 'guile on msys2-w64 front'? lispmacs: I was remembering that guile had some kind of void type, used for evaluating to no result, but I can't remember what it is lispmacs: there seems to be a "unspecified" object, but I don't know how to make one lispmacs: in scheme, anyway, there is SCM_UNSPECIFIED in C spk121: daviid: I'm running to ground an annoying guile-gi bug, that seems to be taking forever. It is still 2nd on my TODO. spk121: First, guile-gi 0.3.0 Then guile-mingw 2.2.6. Then guile-ncurses 3.0. Then finally back to either YVDebug or my broken website spk121: This last bug is my guile-gi release blocker. jcowan: lispmacs: (if #f #f) usually works lispmacs: jcowan: okay, thx roptat: hi, I'd like to have my guile program gpg-sign some strings. What should I use for that? janneke: daviid: i have uploaded my Guix cross build package here -- https://gitlab.com/janneke/guix/blob/wip/gnu/packages/guile.scm#L297 roptat: I've found guile-gcrypt, but I need to at least manipulate a pem-encoded public key roptat: so I can either generate the key outside of my guile program, but then I need to load it in guile-gcrypt, or generate it with guile-gcrypt, which makes it easier to sign, but I don't know how to convert the public key to a pem format afterwards... amz3: roptat: otherwise look at scheme industria roptat: actually, I've found enough documentation on ASN.1 and PEM to be able to convert from guile-gcrypt objects roptat: thanks for the help :) d4ryus: to implement a binary protocol i need to be able to track and reset the current position in a port (socket for example). Is there a way to do this? If not, how would i do this besides wraping reads/writes? weinholt: d4ryus, seems very unusual since sockets don't have positions, you should probably look for a different approach, but you could maybe fake positions with custom ports weinholt: d4ryus, are the positions relative to an index in a packet? because then you can use bytevector ports as temporary storage d4ryus: weinholt: Yes, i need to be able to get the position relative to some initial position to tell how much padding is required weinholt: sounds like bytevector ports will do the job d4ryus: would require another copy, but i guess thats ok for a first shot, thank you very much! weinholt: np Josh_2: Hi, does guile work on rasp pi w, I think It's arm32? d4ryus: Josh_2: yes is does. Josh_2: d4ryus: thanks :) d4ryus: Josh_2: oh wait, rasp pi w => rasp pi zero w, right? Josh_2: Yeh Josh_2: sorry that was my mistake d4ryus: Josh_2: ok, yes, it does :) Josh_2: awesome thanks :) I'll write my app in guile then :D Josh_2: is there an irc channel like #guileschool or somethin? A channel for guile noobs davexunit: Josh_2: just this channel. :) davexunit: when I was a noob I got a lot of help here. Josh_2: okay sweet :) d4ryus: damn, once one calls the second value returned from open-bytevector-output-port to retrieve the bytevector, it gets reset :/ Josh_2: Is there a simple list of all guile functions? Josh_2: I am reading the R6RS which is helpful but I complete list of just the function names would also be helpful amz3: Josh_2: https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html dsmith-work: Happy Friday, Guilers!! nisstyre: I've noticed there are some C API functions that are called a certain thing in the docs but then either named slightly different in the actual header files, or don't exist at all in the latest guile 2.2 nisstyre: I wonder if the docs just need to be updated dsmith-work: nisstyre: Have you looked at the NEWS file? nisstyre: dsmith-work: no, why? dsmith-work: Changes are supposed to show up in there. Should reveal if an API old or has been renamed. nisstyre: ah ok nisstyre: yeah I will check it later and see if I can find anything Josh_2: amz3: thanks :) dongcarl: Hi all, is there documentation on the specifics of truthy and falsy values in guile? dongcarl: E.g. are all things truthy except `#f`? dongcarl: (in the context of conditionals like `if`) Josh_2: I don't know the specifics, but if you do (if "a" "t" "f") it'll eval to "t" so I guess so Josh_2: It's the same in CL but like I said, I don't know the specifics chrislck: guile commandment: "thou shalt read thy manual" https://www.gnu.org/software/guile/manual/html_node/Booleans.html amz3: dongcarl: only #f is false, otherwise you must use a predicate like null? davexunit: dongcarl: that is correct, #f is the only falsy thing. dongcarl: Ah! That's great... very clear davexunit: it's kind of refreshing when compared to some other languages dongcarl: Oh for sure... davexunit: (javascript) davexunit: even Ruby can be annoying because both nil and false are falsy dongcarl: The power of clarity! jcowan: Well, almost. #nil is falsy too, but you aren't likely to run up against it just doing Scheme. davexunit: I try to avoid discussing #nil :) *: jcowan chortles heisenberg-25: How do you evaluate a function from its name? that is how can I run a procedure named add from the string "add"? Josh_2: wouldn't you be better of storing string function pairs like ("add" . (λ () ))? Josh_2: then you can search a list for a string like "add" and then execute the function stored in the cdr of that cons Josh_2: just spitballin heisenberg-25: Josh_2: the functions have keyed arguments rekado_: heisenberg-25: you could do something like this: (variable-ref (module-variable (current-module) the-procedure-name-as-a-symbol)) rekado_: (let* ((args '(10 20 30)) rekado_: (proc-name '+) rekado_: (variable (module-variable (current-module) proc-name)) rekado_: (procedure (variable-ref variable))) rekado_: (apply procedure args)) heisenberg-25: rekado_: okay. Let me try that heisenberg-25: But to make my question clear, I am parsing an json and executing functions based on that heisenberg-25: Imagine I have this JSON {"func_name": "add"args: [{"name": "x", "value": 1}, {"name": "y", "value": 2 } ] }. I want to call (add #:x 2 :y ) based on the above JSON Josh_2: hey that's exactly what I did recently haha Josh_2: not in scheme though :P rekado_: if the JSON is static you could go through the compiler tower and compile this directly to Scheme. rekado_: doing this dynamically works just the way I outlined above. It’s up to you how you convert the JSON to a keyword list. amz3: +1 heisenberg-25: rekado_: Yeah your method works for converting the string function names to functions and parsing the json an easy task. But the tricky part is converting a string into a keyword argument i.e converting "#:x 1 #:y 3" into #:x 1 #:y 3 heisenberg-25: Josh_2: :) heisenberg-25: Btw what is the best way to share scheme code snippet in this channel? heisenberg-25: I was hoping (eval-string "#:x 1 #:y 2") would do the job but it just returns 2 rekado_: this needs more code to match on and iterate over the json data structure Josh_2: just a question, but do you actually need to use keywords? can't you just have for example (add a b) and then pass (add 1 3)? instead of (add #:x 1 #:y 3) if that's what you are doing heisenberg-25: rekado_: actually (apply procedure non-key-arg (list key-arg)) works :) heisenberg-25: Josh_2: the reason I am using keyword arguments is that I want the function to be also called as (add 1) and will use the default value for y or vice-versa for x dsmith-work: Is current master supposed to build in mere seconds instead of hours? dsmith-work: Maybe I had .go files already there? dsmith-work: Must have. Now it's back to it's lovable old slow self dsmith-work: yeah dsmith-work: real 34m5.382s dsmith-work: user 93m58.208s dsmith-work: sys 1m37.823s nisstyre: amz3: fwiw, CSRF is a special case of the "confused deputy problem" which is definitely not unique to the web nisstyre: but it is a bigger problem because it's a more common issue I guess now nisstyre: but it can happen even in totally non-web contexts, like for example https://seclists.org/oss-sec/2019/q2/131 nisstyre: (the analogy there is that you're trusting a path given to you by some entity with its own authority, but it's being used by another entity with their authority) nisstyre: it's also why linux doesn't let you suid root on shell scripts nisstyre: because it could execute the wrong thing maliciously *: stis does some math ... hmm can I link QED with GUTCP ideas (GUTCP is assumed to ne a fringe theory by the masses) spk121: hi guile manumanumanu: Good morning fellow guilers! wingo: good morning :) heisenberg-25: wingo: good morning :) wleslie: amz3 and nisstyre: of course, as a website, it was already really easy to avoid CSRF as a vulnerability, even before CORS was a thing: simply make authority-carrying resource names unguessable (make it a crypto-cap) amz3: weinholt and nisstyre: thanks for the input. The security issues were not the only reason I prefer not to rely on the webstack for my "project". It might seem far-fetched, but the client-server paradigm does not represent the world like I would like it to be. I call it the star-system in the sense where a small set of well-known-peers dictate what you can do and can not do. To that paradigm, I prefer the amz3: peer-to-peer model, where everybody has the chance to play an equal role. amz3: oops wleslie ^ wleslie: ah, that's what you meant by "gave up on the web" amz3: yes amz3: also, there is this quote that I find inspiring: "Personal Mastery: If a system is to serve the creative spirit, it must be entirely comprehensible to a single individual." amz3: taken from: https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk.html amz3: partly because of legacy, and because the problem the web stack try to solve is too difficult (maybe too big), the web stack namely browsers is difficult to create and maintain (html parser, css parser, layout algorithm, javascript-wasm vm, network, crypto, on-disk persistence, prolly others...). wingo: haha at work i am literally in a presentation about web specification work (tc39, html, etc); indeed the only way to understand a whole is to restrict yourself to a subset wingo: the web is like C++ i guess :) wleslie: I have less of an issue with complexity, and more of an issue with there being no way to DTRT wleslie: I work at a place that does web development - django and react you know - but convincing people to design apps with actual working security or concurrency is a hard sell amz3: those things are already solved, and maitained mostly in parallel and programming language standard libraries, that is there is effort duplication, which not bad in itself, but what if there was another way to have a similar creative freedom when it comes to internet application while avoid that much complexity. *: wingo nods rain1: hey wingo: hej nisstyre: amz3: I agree with that sentiment kinda nisstyre: decentralized is the way to go wingo: janneke: regarding mixed definitions and expressions in mes: there is a straightforward translation to letrec* wingo: i.e. (let () (foo) (define x 42) (bar x)) => (let () (letrec* ((_ (begin (foo) #f)) (x 42)) (bar x))) wingo: does that make sense to you? wingo: i also don't know precisely what mes would need; mixed definitions and expressions is a macro-expansion thing; i would guess that eventually you would load psyntax or something? wingo: dunno janneke: wingo: thanks ... i also don't really know. mes has an experimental option to load psyntax, but that is not working all that great. janneke: it's good to know this solution even though i don't know how to integrate it just yet, it does take away most of my worries :-) wingo: :) wingo: well, it's just layers. mixed definitions and expressions is a layer that is above letrec*, which can be a layer on top of let and set! wingo: so from a mes perspective i think there's probably not an issue but i am not sure of all the tradeoffs janneke: i'm starting to understand that, now that mes works :) janneke: currently, mes handles macro expansion (define-macro) in C and builds from that janneke: letrec* is defined as a define-macro...so eh, i don't see a very simple drop-in fix. however, this inspires me to revisit this; iwbn to do macro expansion in scheme but i could not get that to work/perform earlier wingo: janneke: here's another incremental thought. i understand that mes right now can do (let () (define x 42) (* x x)) wingo: the idea would be to turn wingo: (let () (foo) (define x 42) (* x x)) wingo: into wingo: (let () (define _ (begin (foo) #f)) (define x 42) (* x x)) wingo: where _ is a fresh identifier wingo: so basically, transform all expressions in a body that aren't in tail position to (define _ (begin expr #f)) janneke: wingo: that's a nice trick! janneke: yes, that should work janneke: i'm happy with this wingo, it takes away all my worries :) wingo: cool :) chrislck: jcowan: recurse on rest argument means what? chrislck: daviid: install MSYS2 gives you guile on windows daviid: chrislck: a very old version i think, so i'll wait spk121 patch and instructions to grab 2.2.6, tx chrislck: true chrislck: gnucash guile is 2.2 at least jcowan: chrislck: Something like this: (define (a . b) (apply f (cons a (car b) (cdr b))) jcowan: so a is the first argument and b is a list of the rest, and then we call a function f giving it the first two arguments and the remaining arguments. jcowan: try that again jcowan: (define f (a . b) (if null? b) a (apply f (g a (car b) (cdr b)))) jcowan: the trouble is that with f's signature, the list (cdr b) will be copied before calling f recursively. Which makes an O(n) function into O(n^2) joshuaBPMan: wingo: Hey Andy! Thanks for making guile bro! I've pretty much spent the entire day hacking away at a very simple website. guile is super fun to make websites in as it turns out! joshuaBPMan: jcowan: what does it mean to have a function like (define (a . b) ...) joshuaBPMan: I've seen (define (a b) ...) But what is (a . b)? jcowan: joshuaBPMan: It binds the first argument to a and a list of any other arguments to b. It's how Scheme does procedures with a variable number of arguments. jcowan: (define (foo a b) means that foo has exactly 2 arguments. jcowan: whereas (a . b) means it has one or more, (a b . c) means 2 or more, etc. nisstyre: jcowan: I always found that syntax confusing because it looks like a dotted pair nisstyre: maybe that was intentional jcowan: It is a dotted pair nisstyre: or is it actually a dotted pair? nisstyre: ok yeah jcowan: Lambda binding is a crude form of pattern matching: (a b c) is matched against the actual arguments, say (1 2 3). nisstyre: they could've done something like (define (foo a (rest args)) ...) at the expense of more typing jcowan: But not as neatly! jcowan: Matching the pair (a . b) against (1 2 3) naturally matches a with 1 and b with (2 3) nisstyre: true jcowan: As a degenerate case, (lambda x ...) would match x against (1 2 3) jcowan: a non-pair can be seen as an improper list. nisstyre: I'm only familiar with pattern matching in Racket and it works somewhat differently there nisstyre: actually no, it's the same nisstyre: nvm jcowan: the car of the formal arg list is bound to the car of the actual arg list, and then recurse on the cdr. When you get to the end ... nisstyre: I always do (match foo [(list-rest a bs) ... ]) though nisstyre: which is more verbose jcowan: you either have () in both, or () in just one (wrong number of argments) or a symbol in the formal args and a list in the actual args. jcowan: so they are bound together jcowan: In pre-CL meta-circular interpreters this is called "evlis"; it takes the lambda list and the cdr of the actual call (so each eleemnt of the latter has to be evaluated in the current context) spk121: joshuaBPMan: define (a . b) means that b holds any remaining arguments. So (a . b) means that the 1st arg is a and then 2nd through nth arg is in b *: chrislck enjoys lispy discussions chrislck: in other news, gnucash guile code is now much less ugly, and has some good algos https://github.com/Gnucash/gnucash/blob/maint/libgnucash/scm/utilities.scm roptat: how to find elements in common between two lists? roptat: like (in-common '(2 3 5 7 11) '(1 3 5 7 9)) -> '(3 5 7) roptat: is there an existing function for that, or should I create one myself? chrislck: roptat: srfi-1's lset-intersection roptat: wow, thanks :) chrislck: jcowan: thx for pointers on recursing on rest arguments, very useful. perhaps these pearls belong somewhere in documentation. jcowan: chrislck: It's easy to solve, fortunately: (define foo (a . b) (foo* a b)), where foo* does the actual recursive work. Because its second argument is a list, it is passed around as-is rather than being re-created for each recursion. apteryx: mmh, why doesn't this shell snippet do what I'd expect?: export TEST=something; guile -c '(getenv "TEST")' apteryx: mainly, TEST is not defined in the Guile child process apteryx: ah, silly me, I need to pk it ;-) apteryx: nevermind :-) amz3: I disagree with richard stallman behavior. I hope GNU project is not too much tainted with RMS bizar (!) positions. I wish you good luck! amz3: sneek: later tell joshuaBPMan regarding mime-type: https://github.com/a-guile-mind/guile-web/blob/master/src/web/mime-types.scm. there is database in /etc/mime.types that you might want to rely on. sneek: Got it. amz3: sneek: later tell joshuaBPMan I basically gave up on the web because of this https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF). It has been updated, tho. Unlikely to be a better story. My understanding was that one could not have a secure, useable and dynamic web application without running wasm or javascript. sneek: Got it. amz3: sneek: later tell joshuaBPMan I mean you can not even have forms without lots of trickery sneek: Will do. stis: hello guilers! weinholt: hej stis daviid: janneke: chrislck, tx, fyi, spk121 said he will produce a new patch and email guile-user sometimes this week, including all the steps one has to do to install dependencies, guile and compile install ... daviid: chrislck: you also uses spk121 branch i guess? chrislck: daviid: ?no daviid: chrislck: from the link you posted, i couldn't figure out how you install guile, but don't worry, i was just being curious, and want/will (to) use the msys2 and the method/guile version that spk121 spoke about and will update for us this week ... tx MaliRemorker: Morning everyone. I am currently playing around with the pattern matcher in Guile v2.2.6 MaliRemorker: (match '(1 2 3 4 5) ((a ... b) "match")) MaliRemorker: matches MaliRemorker: however MaliRemorker: (match '(1 2 3 4 5) ((a ... b . c) "match")) MaliRemorker: does not, despite this bit of documentation: | (pat_1 ... pat_n . pat_{n+1}) list of n or more amz3: the pattern prolly meant (a b c . d) not ellipsis. MaliRemorker: the error returned (match-syntax-error "dotted tail not allowed after ellipsis" c) MaliRemorker: but, isn't a ... b . c still a valid pattern? MaliRemorker: ... meaning that the error should not be a syntax error? weinholt: that kind of pattern seems to be the same as having multiple ..., which is also not allowed MaliRemorker: yeah, i did not think about the possible reduction to an invalid pattern MaliRemorker: basically, i did not _think_ :D MaliRemorker: however, the documentation can be understood as this being a valid form under all circumstances MaliRemorker: (at least to those who only have an intuitive understanding of ::=, | ... notation used to break down the logics of the pattern matching) weinholt: the typography is unfortunate MaliRemorker: still: (match '(1 2 3 4 . 5) ((a ... 4 . 5) #t)) MaliRemorker: this can't be reduced to multiple ... MaliRemorker: and raises the error that it is forbidden to follow ... by . MaliRemorker: which is in contradiction with the docs joshuaBPMan: hello, I'm trying to split my guile program into modules... joshuaBPMan: what's the best procedure for telling guile how to find these modules? joshuaBPMan: (use-module ...) is giving me an error no code for module (decode). wingo: joshuaBPMan: pass -L to Guile on the command-line wingo: alternately GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH; see the manual for more joshuaBPMan: thanks andy. I am seeing (add-to-load-path dir) might be an option too. wingo: yep joshuaBPMan: wingo: I also found some code to parse POST data: joshuaBPMan: https://stackoverflow.com/questions/46656074/how-to-read-post-data-in-the-guile-web-server joshuaBPMan: I should probably add that to the guile web module/manual proper. joshuaBPMan: because that would be handy to have! wingo: that is from amz3 :) wingo: i think wingo: but yes it might make sense to have in guile MaliRemorker: (hours later ...) ooooh, now i understand the docs for (ice-9 match) : The dot-dot-dot in the docs is just the human-readable dots, while ooo represents the dots in the pattern sense heisenberg-25: MaliRemorker, I also had this difficulty when I first came across (ice-9 match) :) amz3: joshuaBPMan: probably wrong answer amz3: joshuaBPMan: if it works for you good, it is been a long time. heisenberg-25: how do you pass keyword arguments as a rest argument? jcowan: Apply is the general way of passing a list of arguments (keywords or otherwise) to a procedure: (apply arg1 arg2 ... arglist) jcowan: However, never recurse on a rest argument ("variadic recursion") as it will kill your performance. joshuaBPMan: hmmm...that's weird. I just got my basic guile web server to serve css files, but my local machine is not accepting it as a css file. joshuaBPMan: I've got the response header to be text/css... joshuaBPMan: "content-type" header rather. joshuaBPMan: essentially I wonder what headers are necessary for my web server to get my browser to accept the css file... davexunit: wingo: I don't have any real numbers to back this up but the additional unboxed ops in 2.9.4 seem to have a positive impact! I know you asked me quite some time ago and I didn't have answer then. davexunit: I got frustrated hunting for a bug after upgrading to 2.9.4 so I put the project aside for a few weeks. daviid: hello, i 'm confused, is it possible to install and use guile 2.2 on win64? daviid: if yes, anyone would kindly know and share a mini 'howto'? or point to an existing oe maybe nisstyre: daviid: I don't use windows but I expect with the right toolchain you could compile and run it with the Windows Subsystem for Linux nisstyre: or cygwin nisstyre: you might have to download some shared libraries first daviid: nisstyre: i really need a step by step howto nisstyre: I don't have one, sorry nisstyre: if I used windows I might be able to write one nisstyre: you could try compiling it and I'm sure this channel can help with specific problems like "how do I link to this library" or whatever daviid: right, i hope someone can help, i have zero knowledge nisstyre: maybe look up generic instructions for how to compile stuff on WSL nisstyre: then try following the build instructions for Guile 2.2 daviid: nisstyre: i ned a step by step for guile 2.2, that includes every step ... dowload this, type this, download that, type that ... done. open a terminal and type guile nisstyre: fair enough nisstyre: what about docker? nisstyre: there might be an easier way to do it with that nisstyre: I heard docker runs ok on windows nisstyre: or you could boot up a virtual machine quite easily nisstyre: then you'd just `apt-get install guile` or whatever in ubuntu daviid: nisstyre: the person wh asked wanted to run guile in w64, not a vm nisstyre: daviid: this couldn't be easier IMO https://hub.docker.com/r/nacyot/scheme-guile/ daviid: ok let me check nisstyre: they would have to get docker for windows installed nisstyre: but there are easy instructions for that I'm sure nisstyre: I'm testing it right now daviid: ah, guile 2.0.9 nisstyre: yeah but you should be able to fix that nisstyre: in the Dockerfile, you'd just change the 4th line https://hub.docker.com/r/nacyot/scheme-guile/dockerfile nisstyre: I'll try it daviid: nisstyre: wait, it does not sound that easy, seems it runs an ubutu in a 'closed' environmnent ... i am looking a stp by step to istall dependencies than compile guil 2.2 ... on w64 nisstyre: daviid: yes that's right, docker can't run without some sort of compatibility layer, but it will let you run guile programs at least nisstyre: and you can mount volumes and stuff to share data from windows nisstyre: it's not as bad as a VM daviid: spk121: i see you wrote a series of patches ... wip-mingw-guile-2.2 is this for mingw or mingw64? would you hve such a 'howto' maybe? daviid: nisstyre: that is not what i am looking for, but tx nisstyre: fair enough daviid: i really hjope those who (have to) run guile on w64 can help spk121: daviid: those patches allowed me to build a non-threaded 32-bit Guile on Windows 10 using mingw64/msys2. It was for a game jam I did daviid: spk121: so if a user installs mingw64/msys2 does it has everything it needs, they can git clone that branch and run the kame danse? sorry, i have no idea about what needs to be installed 'out of mingw64 msys2' before to try to compile daviid: that 32bit non-threaded would be a good start spk121: Getting MinGW patches into core Guile has historically been difficult. Mark W used to give Eli Z endless notes on his MinGW patches, so I never even tried to push these MinGW patches into core Guile. Though most of my Cygwin patches are in. spk121: daviid: well, it "works for me", so, probably. "./configure --without-threads" as I recall daviid: i am very confused about mingw, mingw64, cygwin ... than what to install using those ... ? daviid: so, a user would install this http://mingw-w64.org/doku.php#tools spk121: definitely use mingw-w64.org over mingw, because mingw-w64 has a PacMan package manager to install prerequisites spk121: But to be honest, if you've never done this before and you have no background w/MinGW it is going to be a bit complicated daviid: spk121: it's not even for me, and i have no access to a w64 machine daviid: i think i'll have to rewrite my stuff using kawa spk121: daviid: I promised Vladimir Zhbanov that I'd make a new patches for Guile MinGW this week, so when I do, I'll send the instructions to guile-user daviid: spk121: ok, from tha above link, what does a user needs to install? daviid: cygwin, msys2 o both? daviid: http://mingw-w64.org/doku.php/download/msys2 which points to github spk121: not cygwin. yes msys2 because you need that to run configure. Then using the package manager, all the usual: autotools gcc make libffi libtool bdwgc libunistring libgmp. spk121: I'm just going from memory right now, so I probably won't get it right. nisstyre: wow I didn't know mingw shipped pacman with it daviid: a guess a user installs this http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20190524.exe nisstyre: that's interesting, as someone who has been an Arch user for years daviid: spk121: then they would run 'pacman -S autotools' ... 'pacman -S git' spk121: daviid: that's how I remember it. It has been a year, so I'm sure I don't have the names of the packages right daviid: spk121: ok, tx a lot, if happen to have the complete list of pacman commands somewhere, ping me ... tx spk121: daviid: will do. I will send a complete set of instructions to guile-user for Vladimir this week, but, probably not today/tomorrow daviid: spk121: ok, many thanks for that! *: daviid secretly hopes one day we have a 64bits with threads running on w64 as well bsima: why does (map display '(1 2)) print a list of #(unspecified) janneke: daviid: fwiw, i have been using spk121's mingw branch in a guix cross build package amz3: bsima: because display return an unspecified value lloda: raise could be kill with optional argument or viceversa. Waste of a good name heisenberg-25: Hi, is there a library function that does something similar to boost::bind in C++? heisenberg-25: https://www.boost.org/doc/libs/1_66_0/libs/bind/doc/html/bind.html janneke: heisenberg-25: cut/cute from srfi-26? lloda: cut doesn't let you reorder args tho heisenberg-25: janneke: Thank you! this is what I was looking for lloda: it's funny b/c since C++ got lambdas I don't use bind anymore janneke: yeah, lambda would have done/does the job [in c/c++] heisenberg-25: lloda: is there a library func to reoder the args? or should I write a wrapper procedure on top of cut to do that? lloda: heisenberg-25: nothing standard I believe lloda: I think the whole point of cut is to avoid naming the arguments, so if you need to do it might as well just use lambda *: chrislck struggles to understand the meaning/benefit of pair-fold... anyone uses it productively? chrislck: cf simple fold wingo: i have never used pair-fold lloda: I copied this from somewhere lloda: (define (pair-map f lis) lloda: (reverse! (pair-fold (lambda (a b) (cons (f a) b)) '() lis))) lloda: I was using this to run over the segments of a polygon or something chrislck: yeah pair-fold seems weird lloda: I think it's only useful if you need to do something with the tails lloda: for what I did with it I could have used (fold f l (cdr l) etc) heisenberg-25: lloda: yeah makes sense. chrislck: any realworld example? dsmith-work: {appropriate time} Greetings, Guilers jcowan: IRC Time: It's morning when you start up in a channel, night when you leave, independent of either your local time or UTC. dsmith-work: jcowan: yep chrislck: daviid guile-2.2 can absolutely be compiled on windows... after all GnuCash includes it chrislck: https://github.com/gnucash/gnucash-on-windows/ may give some clues nly: hi nly: how can i reset the get-u8 count on a binary port? heisenberg-25: does (future proc) in (ice-9 futures) block or return immediate? Basically I want to start threads in a loop nisstyre: does Guile not have immutable hash tables? nisstyre: or would I just use an alist nisstyre: amz3: I looked into fibers briefly for something and it sounded like if I wanted to integrate it with C code, it wouldn't be appropriate nisstyre: right? nisstyre: e.g. I wanted to do some GTK based stuff (webkit) in one thread nisstyre: sounded like GTK would block everything daviid: nisstyre: you should look at/possibly use guil-asunc2, it is the only library we have that integrates with the glib main-loop (gtk is single thrded by design) daviid: fibers and 8sync are glib main loo 'unaware' daviid: *guile-async2 daviid: nisstyre: here https://github.com/ChrisVine/guile-a-sync2 nisstyre: daviid: oh thank you, that might help a lot nisstyre: daviid: can it do any sort of message passing / channels ? daviid: "See the documentation mentioned below for further details, and the docs/example.scm and docs/example-glib.scm files" - so, docs/example-glib.scm will give you an idea daviid: nisstyre: i'm not the author and don't use it, so i'll let other answer that queston ... nisstyre: ok meeting is probably what I want then nisstyre: yeah fair nisstyre: https://github.com/ChrisVine/guile-a-sync2/wiki/meeting nisstyre: this sounds like it's exactly what I need daviid: but it is the only async lib we have that you can use in the cotext of a glib main-loop amz3: yes amz3: nisstyre: other ways: a) make fibers compatible with gtk event loop b) run fibers in another thread (channels can work across fibers and posix threads) daviid: nisstyre: you can't make fibers 'compatible with glib main-loop' daviid: unless the fibers author provide that of course, but i douvbt this wiil eve happen daviid: so, use guile-a-sunc2 soda__hobart: whatup hardcore homies in the house?! soda__hobart: I'm trying to install guile-ncurses for guile-2.2 on Linux Mint and it is failing to compile--I get "Makefile:1042: recipe for target 'curses.go' failed" when I run make. soda__hobart: any ideas? am I missing some dependency or something? It worked just fine on my Debian machine... soda__hobart: is it because I have libncurses5? Do I need a newer one? I bet that's it. I remember seeing something about needing ncurses >= 6 soda__hobart: dang, no luck nisstyre: amz3: do you know of an example of using channels with pthreads? soda__hobart: I think my problem has something to do with libtool *: amz3 looking amz3: nisstyre: try to look in guix-cuirass: http://git.savannah.gnu.org/cgit/guix/guix-cuirass.git/tree/src/cuirass/database.scm amz3: nisstyre: mind the fact that is in pratice, as simple as sharing a channel between two threads. That is you can (define channel (make-channel)) then (call-with-new-thread (lambda () use-channel-here-probably-in-loop)) nisstyre: amz3: ah yes, makes sense soda__hobart: this is the bit where make screws up: https://bpaste.net/show/2gA1 soda__hobart: trying to figure exactly what command is not found? amz3: soda__hobart: I think the missing "command" is `compile` amz3: /bin/bash: compile: command not found soda__hobart: amz3: oh ok, that's kinda what I thought. soda__hobart: but why's that one missing, I mean the C compiler is definitely there, haha! amz3: soda__hobart: can you give me link to the sources of guile-ncurse I look around. amz3: soda__hobart: compile might be defined as an alias in the autotools files... try to: grep -R compile . soda__hobart: amz3: yeah, just got it from the gnu FTP: http://ftp.gnu.org/gnu/guile-ncurses/ soda__hobart: amz3: right on, I'll try that soda__hobart: it looks like it's defined in libtool... amz3: soda__hobart: I have the same error, amz3: soda__hobart: look into build_aux/compile amz3: soda__hobart: oh no soda__hobart: hm, build_aux/compile looks like a shell script for parsing args and paths or something? I'm not real familiar with autotools. amz3: soda__hobart: I found a fix amz3: quickfix soda__hobart: oh yeah? What's the cause of the error? I'm on Linux Mint, but building guile-ncurses from source worked fine on my Debian machine. amz3: really? yeah, it seems to work on guix too. any i have the problem with ubuntu. amz3: soda__hobart: ./src/ncurses/Makefile:322:GUILD = /usr/bin/guild amz3: soda__hobart: look at line 322 in ./src/ncurses/Makefile and add /usr/bin/guild after the '=' amz3: soda__hobart: btw, you will be better prepared to code using guile if you install guix on top of mint. amz3: soda__hobart: then re-run make amz3: soda__hobart: I don't know what the proper fix is, but I successfuly compiled guile-ncurses soda__hobart: sweet, it worked, thanks so much! soda__hobart: yeah, so is guix for guile like what pip is to python? nisstyre: not really nisstyre: maybe closer to virtualenv, but still not really amz3: +1 soda__hobart: like pipenv? amz3: soda__hobart: there is no equivalent in python. amz3: soda__hobart: guix allows to install system dependencies. amz3: unlike pip and pipenv nisstyre: also I don't think virtualenv or pipenv will do any sort of deduplication of dependencies nisstyre: which I believe Guix and NixOS do amz3: to some extend you can configure setup.py to compile .c or even maybe c++ libraries but that is not comparable to guix amz3: guix is a superset of pip or pipenv amz3: soda__hobart: also you should know that python packaging is broken... amz3: I just read that (again) this morning, see https://lobste.rs/s/hln551/new_features_planned_for_python_4_0 nisstyre: the absolute worst is when projects will say `sudo pip install blah` nisstyre: that is terrible nisstyre: boto3 has that in their docs, and I opened an issue about it and they shrugged it off amz3: nisstyre: sorry, there is worse than that. setup.py that execute 'sudo'. nisstyre: actually it was awscli, not boto3 but yeah nisstyre: amz3: yeah that's awful amz3: I am not inventing that stuff. I wanted to build a dataset of python dependencies, so I ran thousands of setup.py via pipenv but the processus was crashing because some (among top20k packages) do sudo in setup.py nisstyre: yikes amz3: I was doing that in cloud vm. do not execute setup.py from non trusted sources. nisstyre: agreed amz3: my coworker in a previous $WORK were not happy by the fact that I was reviewing code of the dependencies we were relying on "wast of time" they said. The only problem is that even popular software can be hacked. nisstyre: amz3: my first instinct when there's a problem with some third party code (that isn't trivially solvable from the documentation) is to grep through the source nisstyre: I actually read the source code nisstyre: that's how I was figuring out how to use the Guile C api actually nisstyre: easier to read header files than search the web amz3: true, it took me time to figure this. Similarly, man pages are very helpful. amz3: here a recent exploit in python land: https://twitter.com/securitybrew/status/993997656589520896 nisstyre: amazing amz3: also typosquating https://www.theregister.co.uk/2017/09/15/pretend_python_packages_prey_on_poor_typing/ nisstyre: also, don't ever read the source of Ansible, you'll cry amz3: ah! amz3: at last someone who agree with me. nisstyre: I know at least one other person who agrees with me on that amz3: I mean, I did not read ansible code, I just read their varaible scoping documentation. nisstyre: and he basically rewrote the entire networking layer of ansible amz3: oh! nisstyre: https://mitogen.readthedocs.io/en/latest/ansible.html amz3: here is the doc: https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable nisstyre: yeah, it's crazy amz3: when I see this kind of stuff supported by dozens of people, I loose hope. amz3: s/dozens/thousands/ amz3: or something nisstyre: amz3: http://www.fabfile.org/ is much better nisstyre: I started an attempt to port it to Scheme, but lost interest amz3: yeah, there guile-ssh now which can help amz3: anyway, all this stuff i startup nation way of life. I dream in peer-to-peer nowadays. I think there is no point of having tools like fabric or ansible in p2p world. amz3: s/i/is/ nisstyre: amz3: actually part of my idea was that it would be possible to run code on multiple systems, and they would use some kind of system to communicate with each other, so you run code on system A, and it has a way to synchronize with system B nisstyre: but that's more distributed and not really decentralized (like p2p) nisstyre: I'm moving more towards the idea that decentralized by default is good nisstyre: which also brings in https://en.wikipedia.org/wiki/Capability-based_security jcowan: Simple pipes-over-TCP are the basic mechanism for a nice and well-understood kind of distributed programming. jcowan: nc is your friend in the shell amz3: nisstyre: thanks for the link, I read some stuff about it, but I do not understand it very well for the time being. amz3: nc is valuable anytime you network things. amz3: nc is valuable anytime you +do+ network things. nisstyre: amz3: this is the best intro to the subject I've found https://web.archive.org/web/20190423063056/http://habitatchronicles.com/2017/05/what-are-capabilities/ amz3: tx jcowan: Capability-based security tl;dr: You can't take an action A on an object B unless you have an object capability(A, B). You can't create this capability yourself by default: someone has to explicitly give it to you and not revoke it. jcowan: if you "own" B, you can hand out capabilities to people; if you only have a capability to do A on B, that may or may not allow you to hand that capability to someone else. amz3: oh nisstyre: amz3: the most common example of that is unix file descriptors. Your process can't access file descriptors that it doesn't already own, but it can give them to other processes (via unix sockets), and then those processes can use them without needing to have the privileges of the other process nisstyre: you can even have a process that can only read from a socket and no other files in theory, and then give it a set of fds for doing stuff through that amz3: I was under the impression that passing fd to other processes was not "legal" nisstyre: which would effectively limit it to only the files it needs to do its job nisstyre: (principle of least authority) nisstyre: amz3: it is totally legal nisstyre: you use unix domain sockets amz3: that prolly the part I was missing. nisstyre: https://keithp.com/blogs/fd-passing/ amz3: I follow C. Webber on the fediverse, they are working on software called spritely. A release is due next few days: https://octodon.social/@cwebber/102922109890210082 nisstyre: that's in the context of X though nisstyre: yeah I know that one jcowan: Also by fork, of course jcowan: Local domain sockets aren't Posix amz3: I am not sure what to think of ocaps. So far, ACL, trust, auth et al. have been topics I luckily avoided. I read some stuff about it, even tried to imagine how things would / could work as part of my work on property graphs (graphdb) because ACL can become very complex in "entreprise" setting and normal acl approach do not work (afaiu) jcowan: Oh, wait, they are jcowan: RBAC is much simpler than pure ACL to administer jcowan: at $FORMER_EMPLOYER, the whole security state was written in Prolog (but executed by a bespoke engine, not a general Prolog engine) jcowan: in_role(user,role) jcowan: can_do(role,action,resource) jcowan: resources had hierarchical names, so granting action on a resource grants on the resources below it in the tree unless explicitly switched off amz3: that is what I was thinking about. RBAC and also Prolog-kind of things. jcowan: there were groups alongside roles amz3: wiki: https://en.wikipedia.org/wiki/Role-based_access_control jcowan: the difference was that groups had a "distinguished member" such that if the rule compiler found that the distinguished member was no longer in fact a member, it was a compile-time fatal error. jcowan: Often the manager of the group. jcowan: Roles were hierarchically named for convenience in creating them, but did not inherit amz3: "compile-time fatal error" this is a way to speak, the system was computing access control every time, no? jcowan: No, only when the rules were changed by a human being. amz3: oh jcowan: I'm not sure what compiling actually did, maybe just wrote the rules into a secure "active place". amz3: so it was like a mix of miniadapton and minikanren? amz3: miniadapton, in the sense it was recomputing _only_ when rules changed. amz3: like a spreadsheet. jcowan: Just so, although it couldn't have compiled a rule for *every* resource, there were zillions of them jcowan: and constantly adding new ones jcowan: but just having a skeleton hierarchy and having to figure out where a resource's pathname falls in it would be relatively little runtime computation. manumanumanu: Ahoy! My computer works again! No more editing SRFI drafts on SSH from my phone to my raspberry pi! wingo: good evening :) manumanumanu: Good evening! wingo: a funny thing, i was going to implement with-exception-handler and raise in core guile, but guile already has a raise binding, wrapping the syscall :P wingo: raise-exception it is then :P dongcarl: Hey all, wondering what the `%` means in front of procedures and variables dongcarl: I'm guessing it's a convention? dongcarl: But what for? davexunit: dongcarl: typically it desginates a constant dongcarl: davexunit: but the language doesn't care about it right? as in it has no semantic meaning? davexunit: dongcarl: correct davexunit: just a convention that some people use davexunit: notably guix davexunit: as you are aware ;) dongcarl: :-) dongcarl: Thanks! davexunit: np! jcowan: dongcarl: It's also used as a convention for a private (non-exported) identifier from before most Schemes had modules/libraries. dongcarl: jcowan: like underscore in python? jcowan: Yes. Lispers don't like underscores for whatever reason, partly because they can use - as a word joiner dongcarl: gotcha! lavaflow: seems to me, - is prefered for joining words in scheme for the same reason it's prefered in english lavaflow: although the "german method" of just smashing words together seems popular in some other languages. ZombieChicken: unscore takes an extra keypress to type ZombieChicken: underscore* jcowan: Depends on the keyboard, perhaps ArneBab: lavaflow: however in the german language uppercase characters inside the word are forbidden, so what you’re talking about is the WikiMethod :-) davexunit: brendyyn: were you the one trying to use chickadee on guile 2.9.4? I pushed a commit to master that fixed the issue. brendyyn: davexunit: Yes I notice and it working now thanks! davexunit: great! brendyyn: Now im playing with creating windows. I notice guile-opengl can create freely resizable windows, whereas chickadee makes windows that are locked to a size. on my tiling window manager i can force the window to change size anyway, and that results in borking the output of the chickadee examples brendyyn: if the programmer wants a non resizable game, then it should center, or put the viewport at the top left when the window is resized regardless brendyyn: maybe its because run-game assumes the window size doesn't change brendyyn: I see. process-event could check window-resized-event?, but then whats the correct way to adjust the view-port brendyyn: davexunit: I modified particles.scm and chickadee.scm to center the game when the window is resized, and it works although it loses a lot of fps and it leaves a flickering image of where the viewport was before the window was resized. do you know how this old state can be deleted? brendyyn: i tried running apply-viewport and gl-scissor but they had no effect. brendyyn: maybe i should figure out how to make resizable windows first lispmacs: hi, not to sound lazy, but I was wondering if there was any more documentation forthcoming for 8sync? lispmacs: I'm working through the source code but it is pretty slow amz3: lispmacs: what are you trying to achieve? lispmacs: amz3: I thought I might use it for an SDR program I have been working on amz3: SDR? lispmacs: Software Defined Radio amz3: how fiber + 8sync will help? lispmacs: don't know anything about fiber. I thought I could turn the data generating processing blocks into Actors like in Actor Model amz3: if you program is CPU-bound, 8sync is unlikely to be a good solution. lispmacs: amz3: CPU-bound, what does that mean? lispmacs: just looked it up on Wikipedia amz3: lispmacs: it means it does more computation than networking. lispmacs: amz3: so, why not a good solution? amz3: lispmacs: because 8sync is built on top of guile-fibers which is meant for network applications lispmacs: amz3: well, I certainly could be disuassaded, but my thought was to view the blocks as networked together, so that if I block was on another machine that was okay amz3: fwiw, I find 8sync confusing. lispmacs: I would think it would help if there was an API reference, hence my question *: lispmacs goes to take a shower dongcarl: Any helper functions to negate a predicate? Or do I have to just define a lambda? dongcarl: apparently... It's `negate`... davexunit: dongcarl: yup, that's the one! lloda: I use (compose not f?) lloda: well that's not a lambda lloda: anyway lloda: well it is lloda: morning :-/ dsmith-work: Happy Friday, Guilers!! manumanumanu: Hey ho! manumanumanu: wingo_: Sorry to bother you this lovely friday evening, but will #:declarative? in module definitions be ignored in a future 2.2 release or do I have to autotoolify my poor little modules using it if I want 2.2-3.0 compatibility? davexunit: manumanumanu: I'm wondering the same thing! davexunit: I've figured out how to make the module that was causing me problems to be compatible with declarative modules, so I no longer have to use the new module syntax, but if it crops up again I'd love to know the proper backwards compatible way to deal with it. manumanumanu: Or rather: would a patch be accepted? davexunit: there's probably a way to make it work manumanumanu: ignoring #:declarative? x would be backwards compatible :) davexunit: but old guile's would need to have foreseen this. davexunit: but alas it's invalid syntax dfeng: Can Guile be built with different C libraries, e.g. musl? ng0: probably. the pkgsrc build links against native libc on netbsd, which is not glibc. musl might be different, your mileage may vary dsmith-work: Morning Greetings, Guilers jcowan: dfeng, ng0: It builds fine on Cygwin, which is newlib ng0: davexunit: wrt haunt. a while back I had captured a backtrace of haunt serve -w, but reading it today with some distance I think this is about a feature guile can not build native on netbsd. ng0: https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=blob;f=guile-haunt/TODO;h=e415a3cfdbe2aec63d1f268140201253ee69b22e;hb=HEAD davexunit: netbsd can't do threaded guile!? ng0: i have never tested guile this far on netbsd, only basic stuff ng0: this backtrace happens only with -w ng0: since I moved on to other domains, is there a test or a couple of tests i could run in guile to find out? ng0: make check or the equivalent in guile should cover this I guess? davexunit: ng0: it should be trivial to reproduce. open a repl, load the (ice-9 threads) module, and eval something like (call-with-new-thread (lambda () (display "hey!\n"))) davexunit: the -w flag in haunt spawns a separate thread that checks to see if any files have been updated/created/deleted and rebuilds the site when changes are detected. davexunit: the main thread runs a web server ng0: yep, same error ng0: at least I now have an explanation to add to the package makefile. thank you :) ng0: ah! davexunit: maybe haunt should detect a guile built without threads and display a clear error message in this case. ng0: comment in lang/guile22: ng0: # not until boehm-gc is threaded ng0: so we build --without-threads ng0: there is devel/boehm-gc-threaded in freebsd ports, which now looks just like an alias for the real boehm-gc, but the patch being upstreamed won't necessarily mean it's working for netbsd. ng0: maybe it's already working, i'll check. but your idea about a better error message upon detecting this is good. *: davexunit wishes he knew why chickadee doesn't work with guile 2.9.4 ng0: you use pthread_np includes, so i think that's a no but I have to look more into this *: davexunit found the chickadee bug davexunit: I hadn't considered how the new declarative module changes would affect things and that was the culprit. davexunit: so the issue was indeed on my end. davexunit: I have a module that keeps track of opengl state. there are procedures that simply the return the value of mutable top-level variables. but guile modules are considered "declarative" by default, so the compiler does some optimization and the initial values of those globals are all that anyone ever sees. davexunit: soooo *none* of the proper gl state was being setup and so people were just seeing a black screen. fun! Guest16914: spk121: hello! g-golf now has a GClosure low and high level implementation, clean and simple (very easy to read and short in terms of number of lines of code), but :), it raises an exception, even with among the most basic possible test call Guest16914: I was wondering if I could grab a little of your precious time to help me identify the cause: the code is very short, reads almost like english, and the exception happens, always, within ffi call to g_closure_invoke, although i can demonstrate that it properly calls my marshaller, which does its job and returns ... Guest16914: spk121: if you agree, please pull the latest from the g-golf devel branch (hoping you still have that somewhere on your comuter :)), then you may do this (willp apste in a seg) Guest16914: spk121: here https://paste.debian.net/1105479/ Guest16914: the source code is here http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/hl-api/closure.scm?h=devel Guest16914: the invoke method prepares the g-closure-invoke arguments, then calls g-closure-invoke, line 131 - the marshaller is 'dead simple', deined line 183, an as mentioned, does work fine Guest16914: so to be able to reprodube just the g-closure-invoke call and track the problem, i defined a temp var that grabs the arguments it eeds, the var is exported and its name is %g-closure-invoke-args, so after a first call to (invoke $2 1) as in the above paste, you ca see the args and t call 'manually' g-closure-invoke like this Guest16914: https://paste.debian.net/1105481/ Guest16914: to complete, the g_closure_invoke binding is also 'dead easy', here http://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/gobject/closures.scm?h=devel, line 70 and the ffi binding is line 119 nisstyre: I'm embedding Guile with a C program. I want to spawn a new thread, and I want to share some data between that thread and the main thread. It looks like there is no way to do this if I'm using "scm_boot_guile", is that right? nisstyre: every attempt I make results in a core dump nisstyre: the docs seem to imply that hash tables can be shared across threads but I don't see how nisstyre: I would of course not make concurrent writes to the data wingo: moin spk121: Guest16914: I'm kind of drowning in projects right now, but, I'll try daviid: spk121: tx! i'm actually daviid, i had some internet conection problems, and just after i posted, lost my connection ... daviid: spk121: of course it is when/if you have a bit of free time, but i would greatly apreciate your help ... lispmacs: hi, is there an admin here for guile-user mailing list? I tried to join about 7 hours ago but never got a confirmation email. dsmith-work: Hey Hi Howdy, Guilers gebrek: howdydo *: chrislck has just discovered (ice-9 match), oh myyy str1ngs: daviid: in g-closure-marshal where is the continuation (value) defined? str1ngs: err (values) to be more precise daviid: str1ngs: the marshaller, which must follow a predefined C function 'template' must return no value -> hence its last form being (values), _but_ I see %g-closure-marshal was defined (wrongly) to return int (line 206), and changing that to void solves the bug daviid: str1ngs: well spoted! tx str1ngs: daviid: I suspected that might be the issue. but was not 100% sure lispmacs: Hi, I had some questions about the Actor model and I was wondering if there was somebody in the room with some knowledge about that daviid: i'll push a fix later, in a few hours or so str1ngs: daviid: sound good daviid: spk121: tx to str1ngs, i found the cause of the problem, so you may forget about my request for help :), tx dsmith-work: lispmacs: Just ask your questions. Sooner or later, someone might answer. dsmith-work: lispmacs: Might also want to try #scheme stis: tja guilers! nisstyre: does guile have a good quality actor model library? nisstyre: also, can someone explain what "guile mode" is? nisstyre: I'm just skimming over the docs for embedding guile in C nisstyre: if I wanted to run a C function that blocks in another thread, would I have to leave "guile mode" before calling that function? daviid: nisstyre: only partially answering, look at 8sync sneek: daviid, you have 1 message. sneek: daviid, str1ngs says: I'm not sure where I implied any of that. I was pretty much saying hello, did I read these commit logs correctly. If anything it was a RFC and nothing more. nisstyre: daviid: ok I'll check that one out nisstyre: hmm, looks like I don't have to leave guile mode: "Starting from Guile 2.0, blocked threads no longer hinder garbage collection. Thus, the functions below are not needed anymore." nisstyre: so I could just call my function in another thread and it would all be fine nisstyre: still not sure what it means by "guile mode", I assume that's a catch all for code running under guile jlicht: Hey guile, can guile's `chmod' support relative modifiers, such as "+w"? Or am I forced to use the fully written out forms, such as #o755? jlicht: context: I have a directory of files that I want to "+w" for the current user, but some of these files are scripts and others are simply text, so there is not once value to pass to chmod if I simply want to make all of the files writable pinoaffe: hi everyone! is there a function kind of like find but unlike find it returns both the predicates value and the item it found? pinoaffe: I could of course just implement it myself, but don't feel like reinventing the wheel weinholt: jlicht, for your question earlier today, combine stat and chmod: (let ((st (stat fn))) (chmod fn (logior (stat:perms st) #o200))) jlicht: weinholt: that is much easier than I thought, thanks! dsmith-work: Morning Greetings, Guilers mbakke: malaclyps: it's on a branch that will be merged within the next few days malaclyps: mbakke, oh great thank you! brendyyn: davexunit: Hi, I just decided to have another play with chickadee. but I find none of the examples work. they all just open a black window, or in the case of grid.scm, black with red in the top right corner. Even the Hello World example just procudes a black window amz3: sneek: botsnack sneek: :) rekado_: brendyyn: here’s a WIP game using chickadee: https://git.elephly.net/software/inevitable.git brendyyn: rekado_: thanks i will try it dsmith-work: Monday Greetings, Guilers davexunit: brendyyn: which version of guile? davexunit: I have found that guile 2.9.4 completely breaks things but I haven't been able to figure out why. brendyyn: davexunit: i just download the git repo and ran guix environment -l guix.scm, ./bootstrap; ./configure; make -j brendyyn: so i think its guile-next davexunit: ah then it's guile 2.9.4 if you are using a recent version of guix brendyyn: i see davexunit: I'm not sure what happened. 2.9.3 works but 2.9.4 has completely messed up rendering. brendyyn: is your completely broken the same as mine? black windows davexunit: I suspect it has something to do with floating point math. davexunit: yeah the rendering math isn't working correctly. it's like everything is really zoomed in. brendyyn: oh davexunit: I suspect it's a guile bug davexunit: because any earlier version works. brendyyn: i see davexunit: but I haven't been able to create a minimal test case davexunit: sooooo brendyyn: then its over my head i'm afraid davexunit: since it's not a bug that causes a crash it's hard to track down davexunit: I'm not even convinced that it's related to floating point math. could be something else entirely. davexunit: perhaps the opengl viewport isn't being setup correctly somehow. I really don't know. davexunit: life of the bleeding edge can be difficult. davexunit: brendyyn: you can edit the guix.scm file to use guile-2.2 instead. davexunit: that should give you a usable environment. it just won't perform as well as guile with jit, but better than nothing. brendyyn: davexunit: heh, i just defining a guile-2.9.3 package, and then it turns out there was still a substitute for that so i didnt even need to compile it stis: hej guilers! dsmith-work: stis: Hej! jcowan: wingo: Yes, thanks! Added to the errata list. wingo: civodul: i think i have a way to redo our catch/throw/with-throw-handler on top of something more like r6rs's with-exception-handler + raise. the kinds of exceptions that are now thrown as key + args will also have a representation as exception or condition objects wingo: (not sure yet what vocabulary to use) wingo: this sounds like a good thing to you? wingo: right now r6rs includes a kind of adapter between conditions/raise/etc and guile's exceptions, and it would be nice if that adapter were closer to guile core so that srfi-34/35 and r7rs could also use it wingo: and obviously it would be nice to provide some kind of more structured api for exception consumers civodul: wingo: so you mean Guile's core would use something like srfi-35, and key + args would actually be "translated" from that? jcowan: particularly nice, since r7rs uses the exact same system as r6rs (though it does not have the specific r6rs condition hierarchy) soda__hobart: hi everybody, I am trying to install gnutls with the guile bindings, but when I run ./configure with --enable-guile, I get a warning that guile-snarf is not found, so it's not building the guile bindings. How do I get it to find guile-snarf, do I have to point it at a certain path or something? str1ngs: soda__hobart: which os/distro are you using? str1ngs: you might need to install development files soda__hobart: yeah I don't have the dev files, could have sworn I did str1ngs: which distro? soda__hobart: file this one in the "d'oh category" soda__hobart: debian soda__hobart: I just installed the dev files, so it should work now str1ngs: maybe guile-2.2-dev on debian soda__hobart: it is I just got with apt str1ngs: you can do $ which guile-snarf to verify it's now in your PATH soda__hobart: oh yeah, I'm in bay-bee soda__hobart: talkin like kojak soda__hobart: a lot of the debian guile packages are really old, like this guile-json one is a really early version that doesn't have a lot of functionality soda__hobart: I mean, typically debian packages aren't the bleeding edge, of course soda__hobart: I want to try out the Guix distro soda__hobart: I'm really having a lot of fun with guile str1ngs: soda__hobart: if you are building guix dependencies. most are not found by default in distro str1ngs: it's probably more ideal to install guix using the binaries. soda__hobart: so if a procedure returns multiple values, how to I get those values? should they have keywords? soda__hobart: nm, figured it out malaclyps: Before I file a bug on this, could somebody just double-check something? Do you get an GnuTLS error with (use-modules (web client)) (http-get "https://github.com") ? malaclyps: I'm getting an error on Guix's Guile 2.2.4. 2.2.6 and even next-guile... soda__hobart: do you have the guile bindings for gnutls set up? I just dealt with this problem. mwette: for the mac I had to first install gnutls w/o --enable-guile, then with; the issue was that during the build/install process guile could not bind to libgnutls in the distribution malaclyps: i think it's probably this bug https://issues.guix.gnu.org/issue/34102 , but Guix's gnutls package maybe isn't up to date with the fixed version wingo: jcowan: is the intention that (scheme r5rs) also exports "else" (and a "cond" that assumes "else" is bound), even though "else" isn't specified as bound in r5rs? wingo: (perhaps weinholt knows also) jcowan: wingo: Yes, I'd say so. It is listed among the exports in Appendix A, along with => and ... jcowan: I don't know of any Scheme implementation that lets you export unbound identifiers. wingo: jcowan: fwiw it is listed in the base library but the r5rs library just specifies "whatever r5rs defines", which is ambiguous in this context i think wingo: a strict reading would not include "else" jcowan: App A: The (scheme r5rs) library provides the identifiers defined by R5RS, except that transcript-on and transcript-off are not present. Note that the exact and inexact procedures appear under their R5RS names inexact->exact and exact->inexact respectively. However, if an implementation does not provide a particular library such as the complex library, the corresponding identifiers will not appear in this library either. wingo: ah sorry you are right! wingo: i misread wingo: friggin page breaks jcowan: The word "defined" was perhaps il-chosen jcowan: Note also that it does not say they have only R5RS semantics: `log` should probably accept two arguments. wingo: and curiously that list does not include "else" wingo: the list on p.76 wingo: which implies that that "cond" implementation expects "else" to be unbound wingo: right? jcowan: Okay, my bad. I was looking at R7RS-with-errata. Erratum 22 reads "22. In Appendix A, the (scheme r5rs) library should export syntax-rules, else, ..., => and _." wingo: ah, ok jcowan: Technically the errata are not _official_, in the sense that the Steering Committee has not met to ratify them, but I certainly recommend their use jcowan: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/R7RSSmallErrata.md wingo: jcowan: should there be a similar erratum for symbol=? wingo: ? jcowan: What's wrong with it? wingo: it should error when applied to non-symbols wingo: same erratum as boolean=? lispmacs: can one program a guile module in C? lispmacs: i mean, like that compiles to a .go? str1ngs: lispmacs: you can mix pure scheme modules with C module code. but no you can not compile from C to a .go file str1ngs: lispmacs: you could though use FFI from scheme avoiding C altogether daviid: str1ngs: as I wrote several time already, g-golf is still missing important/essencial bits, which I'm working on, and I especially wrote, among others, that (g)closures and (g)signals were missing daviid: I ever said g-golf would not implement these, it would just be ridiculous daviid: *never daviid: I'm working on those and will mention here when something start to be at least usable ... please be patient bsima: how do i get the guile manual in emacs' M-x info interface? it doesn't seem to be present on my NixOS system str1ngs: sneek: later tell daviid. I'm not sure where I implied any of that. I was pretty much saying hello, did I read these commit logs correctly. If anything it was a RFC and nothing more. sneek: Will do. rekado: bsima: is INFOPATH set? civodul: Hello Guilers! dsmith-work: Happy Friday, Guilers!! count3rmeasure: happy friday bsima: rekado: yeah, and the guile manual is found under ~/.nix-profile/share/guile but not ~/.nix-profile/share/info bsima: the latter is in INFOPATH but the former is not bsima: so i guess this is a problem with the guile package in nixpkgs? lispmacs: how do you read/set the current working directory in Guile? lispmacs: (chdir) lispmacs: (getcwd) lispmacs: i embedded guile in a C application, and registered some primitive functions with scm_c_define_gsubr lispmacs: can I get those primitive functions in a module that can be loaded by other modules I create? lispmacs: I don't see like a scm_define_module function lispmacs: problem is I create a module of helper functions, but thhe helper module does not see the primitive functions when I use it lispmacs: i suppose I could load a file that defines a module that exports those primitive functions? lispmacs: or, i guess, since it is scheme, I could embed that file in the C file and eval it lispmacs: wha HA HA lispmacs: off to bed enderby: hi, wondering what the correct way to document functions in scheme/guile is dsmith-work: lispmacs: The typical way to expose C funcs as a module, is to also have a companion .scm file. dsmith-work: lispmacs: But there are ways to do it directly. dsmith-work: lispmacs: Though writing stuff in C less desired these days. Scheme is better, and the comiler is gettting more awesome all the time. d4ryus: is there any guile dbus library or bindings for libdbus? dsmith-work: d4ryus: Yes I think so! dsmith-work: d4ryus: ISTR civodul had something... dsmith-work: But then there is my memory ... str1ngs: d4ryus: if you use Gio then possibly guile-gi or g-golf would work for you d4ryus: ok, guile-gi and g-golf looks interesting, thanks! str1ngs: if you need to use signals guile-gi is the most mature of the two. str1ngs: also you can still use guile-gi and g-golf and make your own typelib. that would be a last resort though str1ngs: I think you can do this with Gio dsmith-work: d4ryus: My mistake. It's guile-avahi I'm remembering, which *does* use dbus, but it's the avahi code that uses it. malaclyps: d4ryus, if you get something working, I'd love to see it. I played around getting dbus to work with guile, but eventually just ended up parsing qdbus's command line output d4ryus: malaclyps: funny you say that, i just started doing exactly that :D stis: hey guilers! ArneBab: wingo: re encoding 1.8/2.x: ah, yes, that’s going to make a difference ArneBab: wingo: I should re-do the comparison with LANG=C LC_ALL=C — don’t know when I’ll get to that wingo: ArneBab: LC_ALL=C isn't great either fwiw wingo: the optimized cases are iso-8859-1 and utf8 ArneBab: oh, ok ArneBab: my default is utf8 wingo: what if... what if we fix exception types in 3.0 wingo: like, native exceptions are condition objects instead of key plus args wingo: already we had to implement a wrapper for r6rs. wingo: i would prefer to layer r7 on top of guile rather than on top of r6 fwiw wingo: so that would suggest pushing conditions more towards guile core. ArneBab: wingo: current exceptions are hard to use; an improvement sounds good, as long as compatibility with r6rs and r7rs is possible. chrislck: dear guilers, any idea how to reliably get the current %TEMP% via guile? (getenv "TEMP") won't cut it dsmith-work: Hey Hi Howdy, Guilers dsmith-work: chrislck_, chrislck: Well, That concept *is* just an environment variable, right? What else are you thinking of? chrislck: my mistake. not guile issue at all, has to be sth like XDG_RUNTIME_DIR stis: Hi guilers! malaclyps: hello guilers! Is there a way to turn off the repl's shortening of arguments (with ellipsis) in backtraces? I'd like to see the full args... stis: use e,g ,bt with argument #:width 1000 civodul: weinholt: great announcement for Loko! weinholt: yes, it has been well received :) dsmith-work: weinholt: Ya looks really interesting bandali: hey weinholt, i saw your article was posted on lobsters https://lobste.rs/s/6gbneg/new_r6rs_scheme_compiler bandali: i’d be happy to send you an invite if you’d like to join and/or comment weinholt: thank you; i'm already a member bandali: oh! in that case sorry about the noise :p weinholt: np :) amz3: bandali: sorry, to be opportunistic, I can I have one? bandali: amz3, sure :) /msg me your email wingo: yes congrats weinholt on the announcement :) weinholt: this too shall pass wingo: :) wingo: it is amazing guile has lasted this long with such a crappy^Hfree-form exception system :) *: wingo pleased, looking back at ports documentation changes in 2.2 nly: hi nly: (define E '((b 3))) nly: (assoc-set! E 'b '(2)) nly: ERROR: In procedure assoc-set!: nly: In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): (b 3) nly: nly: why? and any workaround? lloda: nly: E is a literal lloda: do (define E (list (list 'b 3))) nly: ahh nly: thank you :) lloda: yw nly: does variable-unset! do what i think it does? nly: undefine a var chrislck: I found some obscure combo which undefines a var, but this required digging guile's c sources lloda: nly: yes lloda: (define a 3) lloda: (variable-unset! (module-local-variable (resolve-module '(guile-user)) 'a)) lloda: > a lloda: ERROR: Unbound variable: a chrislck: ah yes that one, easy to remember nly: thank you lloda :) lloda: np lloda: I've never used that in nearly 20 years of Guile wingo: i haven't ever used it either :P dsmith-work: Hey Hi Howdy, Guilers str1ngs: hello daviid is there some way to squelch the signal info console output when using gi-import? str1ngs: daviid: also the closure/signal work looks interesting. is it possible to connect to any gtk signals yet. Seems to me this is just lower level glib right now? That was my impression while checking the git log anyways. count3rmeasure: hey all, just doubling back to ask during waking hours: Does anyone know of any guile scripts for the guile->gdb api? count3rmeasure: I've searched pretty extensively, asked a couple places (including here, albeit at a bad time of day), emailed the author of the guile api code himself, and I've yet to find more than one project in the wild that uses these bindings wingo: good morning :) civodul: hello! lloda: wdyt of sizeof from (system foreign) accepting srfi-4 symbols civodul: lloda: you mean like (sizeof 'u8)? lloda: for example civodul: the thing is, sizeof doesn't take symbols right now, which i think is good lloda: then another function? lloda: it's not good having to tell srfi-4 what it already knows lloda: the sizes of its types wingo: lloda: for compile-time constants it may be useful to (define-syntax compile-time-sizeof ..._ wingo: honestly tho from a srfi-4 perspective, having a local sizeof definition doesn't sound so bad lloda: wdym local? lloda: if in srfi-4 itself, yeah, that would be fine by me civodul: speaking of compile-time, i did crazy bytestructure-like expansion-time things at https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/syscalls.scm#n184 civodul: as an alternative to parse-c-struct and all dsmith-work: {appropriate time} Greetings, Guilers str1ngs: hello dsmith-work unknown_lamer: hmm, is geiser still the best emacs interface to guile, or has something superseded it? amz3: ? amz3: no amz3: guile-studio maybe? unknown_lamer: looks like that uses geiser, will try and dust my old geiser setup off then... thanks (trying to get back into guile after an extended absence...) dsmith-work: unknown_lamer: Hey hey. Hows it going? Still doing CL? dsmith-work: I was just thinking of you yesterday! For some odd reason, I fired up sbcl and slime. anon987321: geiser is great anon987321: if you're having issues with your current setup, maybe a fresh start would help unknown_lamer: dsmith-work: sysadmin nowadays, actually just dusted off my CL env to work on some stuff over the weekend unknown_lamer: glad to see you're still around too unknown_lamer: anon987321: it's something like 7 years old and I'm using some random branch of guile with unboxed floats so ... dusting off is an understatement ;) dsmith-work: unknown_lamer: $DAYJOB is all Python, but some Kernel driver work. I'm mostly in here to make sure the bot hasn't died. unknown_lamer: sneek: botsnack sneek: :) unknown_lamer: still using bobot++ or something else? haven't checked if it still builds in forever. unknown_lamer: probably should convert my darcs repos to git sometime dsmith-work: Still on bobot++ dsmith-work: ~version dsmith-work: !version dsmith-work: Hmm dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 2.0.11 using bobot++ 2.3.0-darcs dsmith-work: !uptime sneek: 15:39:29 up 54 days, 2:14, 0 users, load average: 0.00, 0.01, 0.05 *: jackhill waves to unknown_lamer lampilelo: sneek: help gmaggior: hello, how can I read an input string in Guile? gmaggior: (readline) ok found d4ryus: hi! I have a problem with SIGACTION, it returns an 'Invalid argument' error when i try to set a handler for SIGSTOP. Other signals like SIGUSR1 or SIGCONT work. Any Ideas? d4ryus: to reproduce (guile 2.2.6 on Archlinux): (sigaction SIGSTOP (lambda (sig) (display "Oh no!"))) weinholt: d4ryus, from signal(7): "The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored." d4ryus: weinholt: oh well... Thank you very much dsmith: sneek: botsnack sneek: :) jcowan: The whole point of SIGSTOP is that it allows you to stop a process in order to examine it, just as the point of SIGKILL is that it allows you to kill a process, no matter what the process allows. SIGTSTP is the one a process might want to intercept, as that's sent by ^Z. mwette: . daviid: roptat: I am a bit late :), but wrt to your multithreading guile and single threaded SDL, you might want to take a look at guile-async2, which offers exactly that, but for Gtk (which is single threaded as well ...) and see how it's done/snarf ideas to do that using fibers ... daviid: rlb: it occurs to me, just 'now', incidentally, that (gnome gobject generics) does a (define-method (equal? (o1 ) (o2 )) ...), so may because equal? becoes a primti-generic once (oop goops) is used, unlike what needs to be done for guile core procedure (such as connect, in the same (gnome gobject generics) module), and just that (no #:replace, #:re-export ...) just adding the method you need, after importing (oop daviid: goops), may 'simply' do what you are expecting ... worth a try rlb: So far, it seems like right it works "fine" if I only try to extend equal? for new types, so I've just reworked everything to do that, and I just avoid equal?, i.e. use a new name, for anything that needs "full" goops functionality. Whether or not there's a bug, in 2.2 don't know, but I'm just avoiding the issue for now. rlb: "right now" daviid: rlb: I think if you 'just' add your equal? methods, after importing (oop goops), you are safe to use equal? daviid: to use and rely rlb: I'm not sure -- I'll have to double-check, but I think I found that it wont' work if you want to override an existing specialization, mingle your new type with existing types, or add a new arity. I mean it'll work within your module, but you can't export it in a way that others will "see". daviid: ok, i didn't know you wanted to redefine existing applicable methods ... neither why that does not work, so you're probably better usig another name indeed ... rlb: I think it may have been supposed to work, at least that's what the docs sound like iirc. rlb: but maybe the docs need adjustment rlb: See my followup here and Mikael's reply for some related bits: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37461#11 daviid: did see those emails rlb: Ahh, ok, then yeah, the main thing I'd tried to do was something like (define-method (equal? (x ) (y )) ...) and couldn't find a way to export it such that other modules could use that specialization. daviid: rlb: i bet if you just define-method, modules that import your's will see it/them, don't know daviid: rlb: not sure, jut wanted to point to this guile-gnme example, and guile-gnome works with 2.2 and 2.9 - but i didn't specifically try to call its equal? o1 o2 method either, so don't know 'for sure' wingo: good morning, guile civodul: morning! heisenberg-25: Any graph manipulation libs in scheme that you know? wingo: weinholt: i added hungry-eol-escapes and documented lack of unicode escapes in symbols wingo: so, r6rs is ready to go i think. i should have a crack at r7rs now weinholt: wingo, sweet jcowan: Very sweet apteryx: sweetness wingo: omg i just found a delicious bug wingo: related to mutation of quoted lists passed as arguments to define-module* wingo: gross stuff! daviid: rlb: fwiw, i can confirm that the way guile-gnome does 'things' wrt adding method(s) to primitive-generics, and those being seen/available by other moduless does work, here is a tny example https://paste.debian.net/1102995/ daviid: rlb: completing the above, listing the primitive-generic 'content' https://paste.debian.net/1102996/ rlb: Yes, it's fine if you're defining it for a new type, but not if you're defining it for existing types (and maybe combinations of new and existing types iirc). rlb: At least if I recall what I found correctly. enderby: is it possible to get a physical copy of the guile documentation or nah? jcowan: enderby: It's under a free license, so you could take it to a print shop. enderby: wouldn't that cost a lot tho? cehteh: print and bind it by yourself enderby: almost 1000 pages :0 cehteh: yeah makes not overly much sense, but i done similar things before, depending on the format, scaled it down to have 2 on 1 page landscape, duplex ... 250sheets is manageable enderby: ah true ecraven: wingo: is there an arch linux package for it? ecraven: guile-git probably.. I'll see what I can do wingo: ecraven: guile-git is really old fwiw, i don't know the maintainer wingo: well. anyway old enough to not be very interesting to test weinholt: wingo, for r6rs i think you'll also want (read-enable 'hungry-eol-escapes), and iirc hex escapes in symbols aren't supported but should be wingo: weinholt: tx! jonsger: wingo: what do you mean by "guile-git" is really old? wingo: jonsger: it's an arch package that's a few versions out of date wingo: for packaging git versions of guile wingo: guile-git is also a package i think! jonsger: ah,yes got it. It's confusing :) heisenberg-25: How do you run a guile script file without using the repl? nalkri: guile -s nalkri: If I understood the question nalkri: But also you can use hashbangs heisenberg-25: Yeah, I will use the hashbangs, thx lispmacs: i am curious if scheme could have "restarts" like common lisp, and if anybody liked that idea. jcowan: lispmacs: Yes. jcowan: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/RestartsCowan.md jcowan: There's an implementation of an earlier version of this (Riastradh's) lispmacs: jcowan: is it possible to clone your repo without using bitbucket? lispmacs: without using bitbucket javascript, I mean? lispmacs: I tried some hg clone commands from the site documentation but don't seem to have correct permissions ecraven: lispmacs: mit scheme *does* have restarts ecraven: maybe some other Schemes do too lispmacs: ecraven: oh, interesting. Guile is the scheme for me right now, though I sometimes use Racket for some math experiments lispmacs: restarts seem like a good idea, though I haven't used them much before ecraven: on the repl, they are great ecraven: I haven't used them purely programmatically yet lispmacs: ecraven: as I understood it, the main thrust behind restarts was to build code that could survive any kinds of exceptions and keep going lispmacs: though, you'd have to write a lot of restart cases, I would think, which might get tedious lispmacs: anyway, thanks for the info, I'll have to play around with them now that I see they are availablew wleslie: ecraven: hg clone https://bitbucket.org/cowan/r7rs-wg1-infra rlb: What's the right way to exclude some "core" bindings from a module -- say I want a normal module, but without the (guile) definitions of catch and throw, or at least with them bound to other symbols? heisenberg-25: civodul: Using the test driver at guile-gcrypt repo gives the following error when running `make check` heisenberg-25: In procedure primitive-load-path: Unable to find file "tests/parser-tests.scm" in load path heisenberg-25: But there is file in the tests/ dir with the name parser-tests.scm jcowan: lispmacs: the site is supposed to be public, I'll try cloning it nly: hi nly: does anyone use skribilo for creating slides? maybe i can steal, err copy from some examples count3rmeasure: anyone here with experience wrestling with pkg-config? roptat: what can I use instead of a chain of (if ... (if ... ( if ...))) statements? chrislck: roptat: cond! roptat: ah! roptat: thanks :) chrislck: converting these nested ifs into cond in emacs is a guilty pleasure heisenberg-25: hi, what env variables can use to increase the heap size for guile? ilyaigpetrov: I don't get the difference between `list a b c` and `cons* a b c` -- could you help, please? nly: ilyaigpetrov: (cons* element element1 ... list) nly: so, (cons* 3 2 '(1)) -> (3 2 1) nly: (list element element1 ...) nly: so, (list 3 2 '(1)) -> (3 2 (1)) nly: you will use cons* when you need to 'append' something to the front of a list. ilyaigpetrov: nly: thanks, it starts making sense wingo: civodul: weinholt: so, finally getting around to --r6rs. is this sufficient at this point? wingo: (define (install-r6rs!) wingo: (set! %load-extensions wingo: (cons ".guile.sls" (delete ".guile.sls" %load-extensions))) wingo: (read-enable 'r6rs-hex-escapes)) wingo: then i make --r6rs call that function wingo: i could also make that put the user in some other environment, other than guile-user, but i think that might not be necessary, as r6rs top-level programs have to start by importing the bindings they use anyway wingo: i guess we need to add .sls as well civodul: wingo: sounds good to me civodul: i thought we had something like --r6rs actually :-) wingo: there's --use-srfis or something like that :) *: wingo remembers the GH API and chuckles :) wingo: done civodul: cool wingo: ecraven: i see you ran a new benchmark :) i also see it is without the new guile :) civodul: wingo wouldn't overlook such a thing ;-) wingo: :) wingo: so weinholt has an implementation of r7rs for guile, made out to the public domain in so far as that is possible. do we need assignment, civodul, or can it be ok to import as-is? wingo: we would be forking it of course (taking responsibility for it) civodul: neat! civodul: i think we need assignment civodul: well, we'd need to look it up wingo: https://gitlab.com/akkuscm/akku-r7rs/tree/master/scheme civodul: if it's public domain, maybe we don't, after all civodul: because that works in the US civodul: oh it's CC0 so it should definitely work civodul: without assignment, that is wingo: ok :) civodul: apparently i type faster than i think today :-) wingo: np :) wingo: so it will take more time than i have this evening but i think it would be nice to import the r7rs module definitions from akku into guile. mostly it's just re-exportinng things wingo: the module names in r7rs are a disjoint set from guile's own module names and the r7rs module names wingo: so, fine. wingo: probably we import weinholt's r7rs tests as well wingo: err wingo: i mean foof's i guess wingo: anyway copyrights on tests aren't a big issue wingo: https://gitlab.com/akkuscm/akku-r7rs/blob/master/tests/test-r7rs.scm wingo: ArneBab: fwiw the read benchmarks will differ between guile 1.8 and guile 2 or later depending on your locale; 1.8 does no encoding conversion heisenberg-25: Hi, how do you run tests in guile? I using srfi-64 for writing the tests civodul: heisenberg-25: i use srfi-64 and Automake with its "test driver" for SRFI-64 civodul: see for example https://notabug.org/cwebber/guile-gcrypt heisenberg-25: civodul: This is exactly what I am looking for. Thanks chrislck: heisenberg-25: I use a custom test-runner see https://github.com/Gnucash/gnucash/blob/maint/libgnucash/engine/test/srfi64-extras.scm#L23 I think gives nicer output nly: hi heisenberg-25: chrislck: Okay I will check it out. Is it available as a separate module though? chrislck: huh no just copy and paste heisenberg-25: oh, I didn't open file and looking at it it only depends on srfi-64. Thanks chrislck: here's example usage https://github.com/Gnucash/gnucash/blob/maint/libgnucash/app-utils/test/test-date-utilities.scm lispmacs: is the a scheme project around providing something like a i/o buffer management framework? lispmacs: *there lispmacs: e.g., something like this: https://www.gnuradio.org/blog/2017-01-05-buffers/ lispmacs: or maybe a C based framework I could wrap with a guile scheme interface? jcowan: Not that I know of lispmacs: I guess I could make one, but it would be "yet another subproject" of my project jcowan: I've sketched out something for ring buffers, but I had characters in mind, not other buffers. Still, the idea is much the same. I copied most of it from Elisp anyway. jcowan: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/BuffersCowan.md jcowan: It would be easy to generalize the elements to be any Scheme objects jcowan: sorry, no, brain fart on my part: those are gap buffers lispmacs: ack, more code hidden behind the great wall of CloudFront! roptat: what's a good way to do multithreading with guile? I've tried guile-fibers and it's very fun, but I also use sdl that needs to run on just one thread (running it on a fiber means it can switch threads apparently) *: civodul thinks it's a question for davexunit and the other games 'round here :-) roptat: I found (ice-9 threads) and (srfi srfi-18) in the manual, but I'm not sure which I should use (if any)? roptat: it's confusing how so many things are reimplemented twice with small differences in different modules civodul: srfi-18 is just a layer above the core thread primitives civodul: an overall thing layer, just a bit too thick in some places civodul: *thin civodul: there's also (ice-9 futures) civodul: i guess it all depends on the type of program you have civodul: if you want parallel computations, i'd say futures civodul: if you want an event loop *and* parallelism, fibers civodul: if you want something fairly specific to placate SDL and what not, (ice-9 threads) roptat: I'll go with ice-9 civodul: :-) davexunit: roptat: you can multithread all you want, you just need to make sure that all SDL stuff happens on the main thread. davexunit: personally I haven't done multi-threaded programs with SDL yet. roptat: I'm not sure how to get communication actually roptat: the fibers part is supposed to do something and give feedback to the SDL part roptat: I'm not sure how to pass values between threads davexunit: I don't know if fibers will work well with sdl unless you force fibers to use a single thrad davexunit: thread* davexunit: because you don't have control over which pthread your fibers will run in roptat: exactly, I already tried that and failed davexunit: one of those times where C and Scheme aren't going to get along roptat: that's why I'm looking for a way to run SDL on a separate thread, and separate from the process I have in fibers davexunit: you could do that if you added some thread-safe message passing mechanism similar to fiber's channels roptat: the question is how to do it? *: heisenberg-25 also wants to know the answer to roptat's question davexunit: roptat: I guess you'll want to use the mutexes and stuff that guile provides chrislck: quick question about macros: I have a macro in X.scm (define-syntax macro... ) being (export macro), and later X.scm has (load-from-path "Y.scm"). it seems Y.scm cannot access the macro... any quick solution other than duplicating macro into Y.scm? chrislck: (obv I've confirmed duplicating macro in Y does work) civodul: roptat: maybe you can have an actual thread not managed by Fibers and dedicated to SDL, and use Fibers for the rest of your program civodul: the SDL thread could still put/get messages on channels davexunit: can you use channels from "outside"? I wasn't aware of that ability civodul: yes, i think so davexunit: neat. that seems like the way to go, then. amz3: yes you can chrislck: sneek: botsnack sneek: :) amz3: chrislck: try to move the macro to another file that is NOT a module and then use include form https://www.gnu.org/software/guile/manual/html_node/Local-Inclusion.html#index-include roptat: oh, nice roptat: I'll try that amz3: roptat: see https://github.com/wingo/fibers/wiki/Manual#user-content-index-get_002dmessage amz3: the very last sentence. chrislck: amz3: thank you! this trips me up heisenberg-25: is there any real-world or toy example of fibers? I am looking to improve my threading code amz3: heisenberg-25: there is many examples in fibers repository amz3: s/many/several/ heisenberg-25: amz3: thanks heisenberg-25: Anyone had this error `In procedure mkstemp!: Permission denied` while importing a locally build library amz3: heisenberg-25: are you using guix? amz3: or guix os? heisenberg-25: No. I am using ubuntu :) heisenberg-25: I am rebuilding guile 2.9.3 again mwette: /QUOIT////QU////QUIT daviid: str1ngs: I pushed a fix for (g-golf hl-api object), so that it also imports so called fundamental type classes, pull highly recommened civodul: we still have non-deterministic gensyms in .go files, as in: https://issues.guix.gnu.org/issue/20272 heisenberg-25: Hi, where can I find version 2.9 of guile? heisenberg-25: I am building it from the source at git://git.sv.gnu.org/guile.git and the build is failing civodul: hi heisenberg-25! civodul: you can find the latest pre-release at https://alpha.gnu.org/gnu/guile heisenberg-25: Hello civodul :) heisenberg-25: Okay, let me try that heisenberg-25: Btw, has anyone faced this issue `Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS`? civodul: did you see it while running the test suite? civodul: specifically the test-out-of-memory program heisenberg-25: no, I am get it when I stress test my program civodul: ok civodul: that's a message from libgc that one sees only when allocating huge amounts of memory heisenberg-25: guile uses boehm gc, right? civodul: yes civodul: aka. "libgc" heisenberg-25: I am building it with `./configure --enable-large-config` and then building guile manually heisenberg-25: hopefully that will fix it civodul: could be, i never had to use --enable-large-config heisenberg-25: yeah, I using guile to process huge dbs and it is complaining. civodul: heh heisenberg-25: are ther any benchmarks comparing guile's performance to other languages or scheme implementations? civodul: there's https://ecraven.github.io/r7rs-benchmarks/ civodul: see also the discussion at https://wingolog.org/archives/2019/06/26/fibs-lies-and-benchmarks civodul: which shows the broader picture jcowan: What would be the point of having benchmarks if you couldn't rig them in your favor? jcowan: (not ecraven's, he's an honest broker) ecraven: hehe, I'd love to rig things, but I still haven't started on writing my own implementation ecraven: well, I started many times and many years ago, but haven't gotten anywhere useful yet str1ngs: daviid: thanks will do nly: how to make a custom repl for Guile? I want the repl to do one extra step after evaluation, this didn't work: (define eval (compose display eval)) nly: make-language i think nly: got it :) heisenberg-25: Has anyone had Floating point exception while building guile 2.9.3? ArneBab: guile change in speed since 1.8: https://www.pictshare.net/nnnimj.png ArneBab: using https://bitbucket.org/ArneBab/wisp/src/default/examples/evaluate-r7rs-benchmark.w and https://bitbucket.org/ArneBab/wisp/src/default/examples/evaluate-r7rs-benchmark.gnuplot apteryx: hello; would someone know how to propagate an exception through a dynamic-wind? apteryx: any way to 're-throw' in the out guard? mwette: I don't believe dynamic-wind traps exceptions. I believe it executes the code in the out-guard and then that of the exception handler, if it exists. mwette: try (catch 'foo mwette: (lambda () mwette: (dynamic-wind mwette: (lambda () #f) mwette: (lambda () (throw 'foo)) mwette: (lambda () #f))) mwette: (lambda args (display "got it\n"))) jcowan: mwette: That's the idea, yes. Any exit from the middle thunk of dynamic-wind causes the exit thunk to run, just as any entrance into it causes the entry thunk to run. It's not an unwind-protect (try-except) thing at all; it's for when you need to set and restore something dynamically. soda__hobart: hi soda__hobart: hey I just started with scheme and I have been playing around. I tried to write a function that prints a list, like this: https://bpaste.net/show/VqJL It does what I want, but at the end it throws an error for "unbound variable: nil" My thinking is that it if the func gets () as an argument, it returns nil, but I guess scheme doesn't work the way I think it does. How do I get it to break out of the recursion? rlb: Anyone know if there's any substantial performance difference between (catch ...) and call-with-escape-continuation (i.e. call/ec), or if there some other reason why for simple purposes it'd be important to pick one or the other? mwette: nil is undefined in Scheme; use #f or '() rlb: Is it important to try to have a "base" definition for your generic functions somewhere such that modules always import that, augment it, and then re-export, or is it typical to just let each module "define-method" at will, export the generic, and expect callers to use merge-generics? ArneBab: wingo_: did you see my speed comparison of Guile versions? https://www.pictshare.net/nnnimj.png — it also shows the only part in which 2.9.4 is significantly slower than 1.8: read1 (there 2.0 was factor 45 slower than 1.8, now 2.9 is only factor 6 slower) ArneBab: with Geometric mean, Guile 1.8.8 is factor 5 slower than 2.9, 2.0 is still factor 3.25 slower and 2.2 is factor 2.3 slower than 2.9 rlb: So I would have imagined that extending equal? to handle new types was common, but it doesn't appear to work even if you're adding a whole new arity: rlb: scheme@(guile-user)> (use-modules (oop goops)) rlb: scheme@(guile-user)> (define-method (equal? x y z) 13) rlb: scheme@(guile-user)> equal? rlb: $1 = # rlb: rlb: Maybe it works if you're just adding a new pair of types? rlb: Suppose I can test that. rlb: (Same thing -- no effect.) daviid: rlb: not exactly answering your question, but you'd be on the safe side to do the 'conversion' 'by hand', as does guile-gnome,for example, for existing guile core procedures like connect - see http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/generics.scm line 142 and below ... sneek: daviid, you have 1 message. sneek: daviid, str1ngs says: thanks. It works for me I'm using my own typelib where I can connect the signasl on class initialization. it's unrelated to nomad. something else I'm working on daviid: str1ngs: ok daviid: rlb: note that for core procedures, guile-gnome uses #:replace i the module definition, like #:replace (connect) rlb: daviid: thanks much -- though I think here replace: (and export:) crashed with an undefined var error, even though I could see the (define (equal? ...) ...) in the module. Maybe something else was wrong. daviid: rlb: ok, i don't know exactly, but you could try to look in the oop goops module, it is easy to read, what is being done for those core procedures that are converted to primitive-generics (iirc) and try to figure out from there ... rlb: yeah, I saw that, though what it does specifically doesn't work (at least what it does for g-equals), or rather, it works within the module, but I haven't figured out any way to export the binding for the "promoted to generic" so that it overrides the same primitive in the module "using" the module that promoted the primitive. rlb: i.e. I can definitely promote equal? to a generic in a module, but I can't figure out how to let anyone else "see" it. rlb: And so far, not sure if that's a bug or my misunderstanding somewhere. heisenberg-25: Hi. are there libraries for using python code in scheme (guile)? ilyaigpetrov: > Quoting is used to obtain a literal symbol (instead of a variable reference) <- What is "a literal symbol", does it mean "string"? ilyaigpetrov: I guess I should read this: https://en.wikipedia.org/wiki/Symbol_(programming) str1ngs: ilyaigpetrov: symbol does not mean string. this is a string "foo" this is a symbol foo str1ngs: ilyaigpetrov: without a quote a symbol with evaluate. usually it's a variable. eg (define foo 1) (symbol? foo) (symbol? 'foo) notice the last call is #t and the first call is #f str1ngs: s/with/will ilyaigpetrov: thanks, I hope I will get used to it, symbols are not very common in js code from where I come str1ngs: ilyaigpetrov: https://www.gnu.org/software/guile/manual/html_node/Symbols.html might help str1ngs: in the context of guile atleast ilyaigpetrov: yes, very handy heisenberg-25: Any guile libraries to run python on scheme code? rlb: heisenberg-25: a quick search returns the pyguile project, but it looks like it's no longer maintained -- if I needed to use python libs from guile and the granularity were coarse enough, I might consider running python as a subprocess and communicating over a pipe, say via xml, or even edn (edn is close enough to elisp that it worked fine for me, communicating between emacs and clojure -- suspect that might be true for python and rlb: scheme too, if you're careful). civodul: rlb: there's also https://gitlab.com/python-on-guile/python-on-guile/ civodul: it's quite recent and ambitious civodul: maybe not "production-ready" heisenberg-25: civodul: Is it documented? civodul: i don't think so heisenberg-25: rlb: Yeah, I also came across pyguile and was looking if there were other alternatives rlb: Interesting - though if that's just for python code, I suppose it might not help if you really wanted to use the python libs. civodul: oh indeed, i had missed that part rlb: Oh, I'm not sure what's wanted -- just wondering. rlb: i.e. imagine it might depend on exactly what heisenberg-25 wants to do. heisenberg-25: rlb: there is a code in python that parses scheme (specifically atomese) to csv and I wanted to port that to my scheme app. So instead of writing the whole thing from scratch I was wondering if I could find a library that I can use to run that part of the code within my scheme modules *: rlb looks up atomese... amz3: why not interop via json? jcowan: It's called sexpdata, and I'm glad to have found out about it. amz3: https://github.com/jd-boyd/sexpdata ArneBab: civodul: I like the long #true and #false a lot — they make it much easier to show code to non-schemers civodul: yup str1ngs: sneek: later tell daviid. thanks. It works for me I'm using my own typelib where I can connect the signasl on class initialization. it's unrelated to nomad. something else I'm working on sneek: Got it. rlb: Is there something unusual about equal? The goops docs say that (define-generic foo) should promote any procedure foo to a generic and that works fine for say string-compare in 2.2.6, but not for equal? rlb: scheme@(guile-user)> (use-modules (oop goops)) rlb: scheme@(guile-user)> (define-generic equal?) rlb: scheme@(guile-user)> equal? rlb: $1 = # rlb: wingo: i think it's a primitive-generic wingo: primitive-generics first use primitive code then dispatch to a generic if the types aren't primitive wingo: they are pretty squirrely though as they break modularity *: spk121 is trying to understand how Guile starts up. 'compile-shell-switches' is a tangle civodul: spk121: what do you mean, "how Guile starts up"? civodul: it loads boot-9.scm :-) spk121: civodul: imagine some idiot wanted to write a graphical debugger for Guile in Guile w/ guile-gi. haha. You start off by launching the GUI and the kicking off a sort of sandboxed sub-guile to interpret the program to debug. It gets a bit complicated with call-with-prompt, capturing stdin/stdout, and splitting the debugger's command line switches w/ the programs command line switches spk121: not that you really wanted to know, ;-) civodul: spk121: i wouldn't call that person an idiot but rather a fearless hacker :-) civodul: when you say sandbox, do you mean container? lloda: it's weird how container has come to mean sandbox civodul: what's even more weird is how container has come to mean Docker civodul: but that's not what i meant in this case ;-) lloda: ok, sorry :D lloda: and yeah to the Docker thing :-/ civodul: heh jcowan: civodul: And indeed the fearless hacker would be able to reach that goal, were it not for ... moose and squirrel! civodul: heheh :-) jcowan: I think the English invented the word "squirrel" so as to have a word that no non-anglophone could pronounce properly. civodul: wait, i didn't even write it, how do you know i don't pronounce it correctly? ;-) rekado: “squowl.” jcowan: I don't. But with the English w, the English r, and the English dark l in its own syllable, that's a lot. jcowan: It basically has no regular vowels at all jcowan: "Strč prst skrz krk." jcowan: and that's just r-vowel, not also l-vowel ecraven: use sanskrit, it has l-vowel (but not m-vowel :-/) spk121: I am in a constant battle with squirrels over who gets to eat the avocados from my tree. So far, squirrels 1000, me 3. dsmith-work: Thursday Greetings, Guilers spk121: civodul: I suppose I mean container more than sandbox. I think, in practice I mean the evaluation of external code in the environment provided by a module. Where that environment is within a control-flow barrier or prompt. Where that environment mimics the environment available at the top REPL, but has redirected all the standard ports. Heck, i dunno. i wanna run the things but without the things getting to see a bunch of Gtk funct spk121: ions that it doesn't care about civodul: oh i see, so potentially a different process (or thread) to avoid blocking, but not necessarily a container in the Linux sense spk121: right. Probably a thread rather than a process, so that the debugger (the outer program that will spawn the thread that runs external code) will be able to add traps and capture hooks. rlb: wingo: thanks -- and I can get equal? promoted to a generic, just not via define-generic, i.e. I can stash equal? somewhere else, then (define equal? #f), and then define-generic works. Maybe this is a bug? rlb: i.e. this made it sound like it should have worked if I'm reading it right: https://www.gnu.org/software/guile/docs/master/guile.html/Extending-Primitives.html rlb: (extend-primitive-generic! doesn't work either) rlb: (on equal?) rlb: s/extend/enable/ rlb: Looks like goops itself has some special accommodations for equal? https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=module/oop/goops.scm;h=837a667e6025b6f8ed7818e5a8efe064cca7843d;hb=791cae940afcb2b2eb2c167fe438be1dc1008a73#l2335 Perhaps I'll file a bug later. Sounds like maybe (define-generic equal?) was intended to work. ilyaigpetrov: Hi. It seems like `(define deposit #f)` binds deposit to some temporary variable? Could you, please, tell me what hash symbol means here? It's from https://www.gnu.org/software/guile/docs/master/guile.html/Shared-Variable.html#Shared-Variable hugh_marera: is the logs.guix.gnu.org/guile/ down? i am getting this message "Resource not found: http://0.0.0.0:3333/guile" when i click on the link rekado: hugh_marera: oh, you’re right! rekado: looks like an older version of the tool got started after the reboot rekado: I’ll fix it in a moment hugh_marera: great rekado: it’s back. Sorry about that and thanks for the report! spk121: ilyaigpetrov: Unless I misunderstand the question, (define deposit #f) sets a the module-level variable 'deposit' to the value FALSE. So initially you can't call 'deposit' like a function, because it is just the FALSE constant. Later in the example 'deposit' gets set to a lambda: a procedure. At that point, you can call it like a function. spk121: #t and #T are TRUE, #f and #F are FALSE ilyaigpetrov: thank you civodul: #t is also #true, and #f is also #false :-) civodul: i've been thinking we should adopt the long names instead of #t and #f in our code bases davexunit: I had no idea that #true and #false existed civodul: it's from R7, i think zacts: how does goops differ from CLOS, or is it pretty much the same idea? davexunit: zacts: it's like a CLOS-lite zacts: oh, I see. cool davexunit: not as featureful as CLOS, but has a lot of good stuff. jcowan: #true and #false are indeed in R7. Alex Shinn came up with them because I had overlooked a test that I ran on many Schemes including Chibi and said that Chibi didn't pass, where in fact it did. jcowan: He thought that was because I didn't see the #t, but actually it was just that my eyes skipped over Chibi in the long, long list of outputs. jcowan: So he proposed #true and #false, but nobody, not even Chibi, outputs them, because backward compatibility. davidl: dsmith-work: you might be interested in https://docs.racket-lang.org/sxml/sxpath.html#%28def._%28%28lib._sxml%2Fmain..rkt%29._txpath%29%29 "Like sxpath, but only accepts an XPath query in string form, using the standard XPath syntax." wdkrnls: is there a setting to make guile instrument source code references to procedures by default? I've noticed that (procedure-source proc) usually can't find anything. spk121: wdkrnls: it is mostly non-functional, but, it is supposed to work after you call (read-enable 'copy) before loading something. str1ngs: daviid: I think you used g_application_run in a paste the other day? but they have since been removed does this look right for calling g-application-run? (g-application-run app 1 '(flags)). I'm trying to figure out how I should pass argc and argv. dsmith-work: {appropriate time} Greetings, Guilers schaeffer: hello daviid: str1ngs: here - https://paste.debian.net/1101487/ daviid: str1ngs: line 38 daviid: str1ngs: but as spk121 explained, it won't work, since the new design for gio, gtk3+ and later is that the 'empty' application must be instantiated and nothing can be done with that 'empty' instance before the 'startup and/or 'activate signal has/have been triggered ... daviid: spk121: it appears I didn't take note on how to run gdb, could you post these steps for me again? sorry I didn't took noe at that time ... daviid: spk121: here is a snipset that segfault g-golf - http://paste.debian.net/1101138/ spk121: daviid: could it be that you've failed to call gtk-init or gtk-init-check? daviid: spk121: it could, but you don't either in your borwser example? daviid: spk121: inieed, that solved the problem, but then why does it work in guile-gi? daviid: though i now have this warning (guile:14282): Gtk-CRITICAL **: 21:04:07.884: New application windows must be added after the GApplication::startup signal has been emitted. spk121: daviid: yeah, the order of operations in the guile-gi example is slightly different: 1. make the application, 2. run the application, 3. attach the window, 4 show the window daviid: spk121: but where do you call gtk-init? daviid: spk121: i just 'changed' the 'order' because i don't have signals in g-golf yet ... spk121: "Concretely, gtk_init() is called in the default handler for the “startup” signal. Therefore, GtkApplication subclasses should chain up in their “startup” handler before using any GTK+ API." Basically it gets call in application_run spk121: Or at least that's how I understand it. daviid: the default start-up signals should be triggered in g-golf to (?) spk121: not sure. Maybe start with g_application_new then call g_application_activate instead of gtk_application_new spk121: Or maybe "startup" is g_application_register daviid: spk121: here is soething that 'kind of' work: it starts the app, and loads the uri, then lock itself (i need kill-9 my guile ...) - http://paste.debian.net/1101146/ daviid: ah maybe a gtk-main as weel daviid: but i thought that was what g-application-run was doing ... daviid: spk121: i don't understand your suggestion, because it mixes gio and gtk, i have zero knowledge on how to make these colaborate, please help me by changing the code (last pasted) - if/when you have time of course ... spk121: daviid: a GtkApplication is a subclass of a GApplication, so you should be able to cast between them daviid: i also have zero knowledge about these new gtk-application* classes, methods ... i'm still 'stuck' in gtk2, which was a million time, at least, easier ... daviid: ah!!! then i reach a problem i know i have to address ever since i started to work on g-golf, and that is it import classes in a 'flat way' - which i know, of course, is insufficient, but i needed to bootstrap things, and so far so good, i'm very pleased with what g-golf has, though this class tree i a fundamental todo item, so is signals, gclosures ... daviid: spk121: but would it be possible to make the above paste work in the current g-golf 'state of things'? spk121: daviid: the above paste works for me, but, it won't kill until you can connect the destroy signal. daviid: that's fie, but here it locks daviid: for example, no uri in the page is active daviid: reactive, i can't click those for example daviid: oh, this time it did ... sorry daviid: ah no, it locks if the mouse goes out then in the app win again - this is not expected either, since it shoud at least ru all gtk default signals spk121: for me it tries to load a page, then dies. but I get "Warning: Unimplemented type - array;: (c -1 #f 0 utf8)" and the "New application windows must be added after GApplication::startup" daviid: the first warnig you may ignore, the second i don't know why neither how to solve this, do you? daviid: i mean it's not a g-golf problem, but a sequence of gio/gtk call problem, imo spk121: daviid: I don't really want to try to figure out how to do GObject w/o signals. It is pretty fundamental to how it is supposed to work. Maybe you can get it up and running by doing things more GTK2-like, but, I really don't know str1ngs: daviid: you need to use a signal. I have not seen it any other way str1ngs: g_application_run takes a GApplication which GtkApplication inherits str1ngs: daviid: https://wiki.gnome.org/HowDoI/GtkApplication for reference. str1ngs: typically the first window is created within activation. daviid: spk121: it's not that i don't want to implement signals :), it is that it shuld not, imo, influence this lock problem i face, there is no reason why the default signal callback would/should not work daviid: but anyway, tx str1ngs: daviid : application_run blocks str1ngs: err g-application-run I should say daviid: spk121: sorry, i stand corrected - the warning, in the case of g-/gtk-applic* indeed says "New application windows must be added after the GApplication::startup signal has been emitted." daviid: I just wanted to have a gtk/webkit tiny example to offer ... it'll have to wait signals then str1ngs: daviid: I can create a tiny webkit example. it just wont' use gtk-application and it won't handle the shutdown signal. so when you close the window the program will not stop str1ngs: I was under the impression though you wanted to use daviid: str1ngs: please do, we'll add those as examples for g-golf users str1ngs: I made this yeserday for a user http://paste.debian.net/1101158 . but instead of using a label I'll use a webview sound good? str1ngs: daviid ^ str1ngs: also I sould expand the imports? I didn't quite understand that yesterday. str1ngs: should* daviid: str1ngs: i didn't want to use gtkapp, i was 'just' copying, to learn about g-/gtk-applic*, the guile-gi exmple, and it still is a total surprise to me, that it won't work without signals - to me, this is a fundamental design mistake daviid: i mean it should always, work with default signakl callback 'only', user signal calçbacks should never be imposed, imo daviid: but let's not discuss this, it would be a waste of time ... str1ngs: daviid: that's understandable. the thing with gtk-application is it's use for more complete programs. It's for cases where your program need uniqueness and you might want to handle opening files. daviid: tx for the paste, is this the 'standard' gtk(3)+ hello world example as in C? curious str1ngs: it provides RPC for signals as well in that a new program instance will call something on the default instance. str1ngs: daviid: I would say this is the most simple use case. but if you were to talk to a GTK+ developer then would probably advocate GtkApplication str1ngs: they would* str1ngs: the stand GTK examples all use GtkApplication. see https://github.com/GNOME/gtk/blob/master/examples/hello-world.c and it's parent directory str1ngs: standard* str1ngs: daviid: I will extend this hello world to use a webview and link the paste. It's still a nice example IMHO. daviid: ok tx str1ngs: later when g-golf supports signals, we can add the shutdown signal for completeness. it will make for a simple example daviid: sure str1ngs: actually for this to work we connect to the windows destroy event and then call gtk-main-quit to end the main loop. str1ngs: Also we could maybe have our on mainloop but that complicates the example what do you think? str1ngs: our own* daviid: str1ngs: do as you wish, i really just wanted to see this beowser in g-golf, later, we'll have signals of course, i hope soon now str1ngs: daviid: I added a comment that should help daviid: it's a bootstrap problem, i need to fix/complete the missing bits one per one ... str1ngs: no worries I understand. str1ngs: and unfortunately the #:uri is not writable. so I'll just use the method daviid: what do you mean 'the #:uri is not writable'? is this another g-golf missing bit? str1ngs: daviid: http://paste.debian.net/1101164 daviid: ok tx str1ngs: daviid: no that's a webkit thing it's all good. you can only use the method. the #:uri property is read only I guess. ie (make ) would be handy str1ngs: daviid: hopefully my example helps daviid: str1ngs: yes, uri is a read only property, this is a webitk 'proble, ot a g-golf problem ... str1ngs: right str1ngs: daviid: also you pasted a eval when example yesterday that I did'nt grok completely str1ngs: does that help with handling when import occures? daviid: str1ngs: it is indispensable to create modules - so far, you wrote examples that you load ... but the recommend way is to write modules: in order for the module to compile without (rightfully) raising warnings, bindings must be available at compile time, hence the eval-when form daviid: modules will help you to structure your code/app as you probably know ... just look at g-golf :) - without modules, it would be unmanageable daviid: str1ngs: http://paste.debian.net/1101167/ - though it could import 'less then the all gtk namespace' str1ngs: daviid: makes more sense thank you. There are places where I think I should be using eval-when then. I will try to read up on this more daviid: str1ngs: just comment the eval-when in the above paste, you'll get a better idea of what i'm refering to lispmacs: is tms:clock, etc., returning values in nanoseconds? str1ngs: davidl: so eval-when ensures gi-import is only called during run time? lispmacs: that is what it looks like when I try (tms:clock (times)), but was wondering if that was a platform specific thing, or... daviid: str1ngs: no, the opposite, it ensures the forms it contains will be excuted at expand load eval time, as you can read str1ngs: daviid: I'm reading https://www.gnu.org/software/guile/manual/html_node/Eval-When.html and trying to understand. I guess I'm wonder the importance of this in regards to gi-import. Thanks for your patients. My scheme/lisps skills are still quite weak daviid: str1ngs: it is dead important :) lispmacs: must just be the times() system function daviid: str1ngs: as i said, just comment and compile the module again ... it should help you to understabd daviid: i mean comment the eval-when form, and copy paste its content as top-level module calls, then save and compile .... str1ngs: daviid: I will test your REPL example thank you. daviid: np! str1ngs: daviid: so far from my understanding using eval-when resolves unbound variables like warnings gtk-container-add still not grokking it completely but it's making more sense. I'm definitely going to start using this with nomad once I have a more complete understanding thanks for mentioning this. daviid: spk121: i was thinking about your desire for immutable bytevectors, the kernel 'immutable mem pages' ... maybe there is wwell designed, well maintained C lib 'out there' that povide the functionality you need, which the dynamic ffi would llow to bring to guile at relatively 'low cost' lloda: how is the alias (srfi :x) for (srfi srfi-x) implemented? civodul: Hello Guilers! weinholt: lloda, i think it's module/ice-9/r6rs-libraries.scm weinholt: hello civodul lloda: ooh thx weinholt lloda: looks tricky lloda: oh I was looking into this b/c (import (srfi :4 gnu)) used not to work lloda: but it does now lloda: was it changed recently? lloda: otoh you cannot do (@ (srfi :1) fold) for example lloda: actually, I'm not sure (import (srfi :9 gnu)) is working properly lloda: see https://paste.debian.net/1101181/ lloda: ?? lloda: import gives no error, but it doesn't import weinholt: lloda, (srfi :9 gnu) becomes just (srfi srfi-9), try (import (srfi :9 happy gnu)) or just (import (srfi srfi-9 gnu)) lloda: weinholt: that's not how it should be, right? lloda: e.g. the comment in r6rs-libraries says lloda: ;; (srfi :n ...) -> (srfi srfi-n ...) weinholt: ;; SRFI 97 says that the first identifier after the colon-n weinholt: ;; is used for the libraries name, so it must be ignored. weinholt: r6rs code will usually import e.g. (srfi :1 lists), but guile doesn't define a module with "lists" in its name, instead it just removes that part. in other r6rs implementations there are usually both (srfi :1) and (srfi :1 lists) as separate files, but guile's way also works weinholt: of course it becomes a little weird when there are other modules under the srfi namespace, but that's how it is :) lloda: well thx for the explanation weinholt lloda: :-\ lloda: I'll just avoid the :nn thing nly: why does sxml->xml does not have #:namespaces argument? sneek: Welcome back nly, you have 1 message. sneek: nly, rekado says: There’s an old discussion re XML namespace handling that might be of interest to you: https://issues.guix.gnu.org/issue/20339 nly: sneek: tell later rekado thanks! sneek: later, nly says: rekado thanks! nly: sneek: tell rekado thanks! sneek: rekado, nly says: thanks! nly: sneek: later tell rekado thanks! sneek: Got it. nly: sneek: botsnack sneek: :) dsmith-work: Tuesday Greetings, Guilers *: jcowan wishes there were a way to tell various allocators to use named shared memory jcowan: I don't even care about mutability, I just want to prevent the same heavyweight data from having to be kept in a whole bunch of processes heisenberg-25: Hi, where I can find the documentation for the module (scheme documentation) ? :) Sheilong: Do I need to import something in order to use list selectors? dsmith-work: Sheilong: Not sure what you mean. dsmith-work: Sheilong: Like c{a,d}r and friends? No. Sheilong: I"ve had to import (use-modules (srfi srfi-1)) to use drop and take selectors dsmith-work: Ah yes. dsmith-work: Ok, lets see if this works: dsmith-work: sneek: guile help drop dsmith-work: It did. but by /msg Sheilong: sneek: guile help drop davidl: does anyone have a link to some example code for SXPath selector statements? Im having trouble understanding the manual and need some predicate type xml selections, that would be expressed like: //div[@class=’ col-sm-12 google-sign-form’]/child::input[1] in "regular" XPath. rekado: davidl: guile-debbugs uses sxpath quite a bit, but still it’s nothing as complicated as what you’ve shown. davidl: rekado: ok thanks Ill check that one out dsmith-work: davidl: Does this help? https://docs.racket-lang.org/sxml/sxpath.html davidl: dsmith-work: thx, I think that helps too. I found also in the test-suite in this okmij.org/ftp/Scheme/lib/SXPath.scm there are some sxpath selections similar to whats covered in the guile manual, e.g. using select-kids and node-equal? corresponding to a search like /descendant::any()[child::text() == "third para"] dsmith-work: davidl: It would be nice to have something that takes an xpath string and spits out the equivalent sxpath. davidl: dsmith-work it sure would daviid: hum, i realize g-golg flag names still use _ instead of - ... todo daviid: str1ngs, spk121, here is an example, it compiles fine but it segfault here, do you have any idea why? I don't know Gio, nor WebKit2 ... http://paste.debian.net/1100958/ daviid: it segfault on make daviid: even without any argumet daviid: mistery daviid: here is a slightly updated version that doesn't segfault anymore, but still raises an exception http://paste.debian.net/1100962/ daviid: it seems it will be impossible to instantiate using the goops style? it seems in the 'working way' - (gtk-application-window-new app) - app is not a property ... spk121: daviid: that run is from Gio. I think that Gtk will intercept the command line argument "--name=" so you could try that chrislck: daviid: thx I don't indend to replace gnucash's C into guile -- they want to minimise guile. chrislck: just wanna hack! spk121: daviid: I did pull the master of g-golf to see if I could find your segfault, but, I get a compilation error https://paste.gnome.org/pvrhusisz spk121: daviid: also, in your configure.ac the line GUILE_PROGS([2.0.14]) seems suspect, unless that is really what you mean daviid: spk121: you need to checkout devel daviid: master is months 'late' daviid: GUILE_PROGS([2.0.14]) jut checks that you have at least guile >= 2.0.14, but it should find the gule you have, it does here at least daviid: anyway, if you could look at the latest paste ... i don't know enough about gio, webkit daviid: https://paste.gnome.org/pvrhusisz -> The page you are looking for does not exist. daviid: but you need devel, not master daviid: chrislck: fine daviid: spk121: once you have devel, look at the second paste, here http://paste.debian.net/1100962/ spk121: daviid: OK. I can reproduce spk121: first. I was actually using devel not master when I got a compilation error. here's the error again using debian paste https://paste.debian.net/1100968/ str1ngs: daviid I think gtk-application-window constructor takes a GtkAppliction str1ngs: daviid maybe gtk-application-new would work better str1ngs: err gtk-application-window-new spk121: daviid: sorry, couldn't figure it out. Gotta jump to another task. daviid: spk121: ok tx. i've no idea why g-golf does not compile on your side daviid: spk121: are you using 2.2 or 2.9? do you have 'local' def for get-keyword maybe ? that sounds really weird, g-golf uses get-keyword all over the places ... daviid: str1ngs: please try and tell me, i just don't know ... daviid: str1ngs: this is a trnscription of the guile-gi browser.scm file ... so you may see what works using guile-gi ... daviid: spk121: get-keyword is provided by goops daviid: spk121: hum!! i think you found a bug, but that might be in guile :) here is what happens - in (g-golf support enum), line 133, the call to get-keyword does _not_ pass its default optional argument, which being optional, should be initialized to #f, but in your case, it raises an exception ... are you on 2.9 ? because here i'm on 2.2.6, and it's fine daviid: spk121: i pushed a fix, although i shoudn't have to, but it should compile on your side now ... let me know daviid: spk121: on the devel branch daviid: spk121: here, "2.2.6.1-a69b5" - get-keyword -> $2 = # daviid: spk121: i bet you have another 'answer' on your system? daviid: spk121: it could be that 2.9 expects # daviid: spk121: can you try this (get-keyword #:foo '(#:foo bar)) in your repl daviid: then (get-keyword #:foo '(#:foo bar) #f) if it failed ... daviid: hum, just compiled/install 2.9 and this works fine to ,use (oop goops)\n (get-keyword #:foo '(#:foo bar)) -> bar daviid: using GNU Guile 2.9.4.8-374c1e spk121: daviid: I'm guile 2.2.4, and this patch does work for me daviid: wierd, 3 of us can compile it on 2.2, jst tried 2.9 as well daviid: and here make check make distcheck work fine daviid: spk121: so, can u try ,use (oop goops) then (get-keyword #:foo '(#:foo bar)) daviid: in a fresh repl spk121: $1 = bar daviid: amazing :) spk121: OK. I think I have it. The /usr/bin/guile on my system is guile 2.0.14, which has the old behavior requiring 3 parameters. I think the autoconfigury was picking up the default guile for compilation. I also have guile 2.2 as /usr/bin/guile2.2 so I think it is a parallel install problem daviid: right! but then tha patch should have fixed it spk121: yes, the patch did fix it daviid: ah, ok i just pushed another mini patch, a typo in the name of that gi-enum instance ... daviid: back on track then daviid: i thought i did read the patch didn't fix it, sorry daviid: hence i was pulling my hear :):) daviid: *my hair aha daviid: this what fails (gtk-application-window-new (make #:application-id "org.gtk.example")) daviid: if you import as in the eval-when in the pste, then paste the above, it reproduces the problem, which probably is a g-golf bug (a miss feature maybe, don't know yet) daviid: here is shorter example, it segfault as well http://paste.debian.net/1100986/ str1ngs: daviid: I can I test with this paste http://paste.debian.net/1100986/ ? I've been AFK but I have time now str1ngs: I'll try with your latest REPL paste maybe str1ngs: daviid: str1ngs: daviid: I don't think it makes sense to try and get GtkApplication to work without signals str1ngs: it relies on the activate signal str1ngs: basically you need to call g_application_run passing an application. which is going to then block. and you want to create your windows from within the activation signal callback str1ngs: daviid: so withing out being able to connect a callback to the applications activate callback g-golf wont be able to create application windows str1ngs: I hope this help you out nly: any resource for freely licensed svgs? spk121: nly: you can check out the svg icons from Tango. Lemme find a link... nly: thanks spk121 spk121: https://commons.wikimedia.org/wiki/Category:Tango_project dsmith-work: Hey Hi Howdy, Guilers amz3: o/ nly: hi rekado nly: (call-with-input-file wagon (compose make-pict xml->sxml)) nly: $7 = ERROR: In procedure scm-error: nly: Invalid QName: more than one colon http://www.w3.org/2000/svg:svg nly: nly: where wagon is this file: https://commons.wikimedia.org/wiki/File:Horse_Wagon2.svg nly: any ideas? str1ngs: nly: does make-pict handle the URL parsing? nly: nope nly: i am downloading it first nly: hey :) str1ngs: and hello :) str1ngs: based on the error svg:svg is causing issues str1ngs: I suspect it's something that is not parsing the URI properly str1ngs: or maybe the URI needs encoding str1ngs: : is a reserved URI character str1ngs: nly: also have you tris file https://upload.wikimedia.org/wikipedia/commons/1/19/Horse_Wagon2.svg str1ngs: the pages you linked is html not xml str1ngs: tried this* nly: str1ngs: ah i see nly: sorry for the late reply nly: (xml->sxml (*TOP* (http://www.w3.org/2000/svg:svg ...) ...) nly: so all tags are getting replaced in this pattern: -> http://www.w3.org/2000/svg:foo nly: i think i'll have to provide a namespace argument retropikzel: I have a hashtable with key "test", I'm trying to access it with (define t "test") (hashq-ref ht t) but it only returns #f. If I replace variable t with "test" it works. rekado: sneek: later tell nly There’s an old discussion re XML namespace handling that might be of interest to you: https://issues.guix.gnu.org/issue/20339 sneek: Okay. rekado: sneek: botsnack sneek: :) dsmith-work: sneek: sneek ? dsmith-work: sneek: sneek is a good bot sneek: So noted. *: sneek wags daviid: str1ngs: i don't think you need any signal callback, from a user, to make and run an application, at least it runs fine using clutter, and i bet it does using gtk 'only' (without gio) - the activate signal has been emited when guile-gi receives it, and spk121 decided to implement there the win min size and ... but that can be done at gtk-win creation ... and i don't think the app will 'lock' daviid: str1ngs: and that code segfault, probably a g-golg bug/missing feature, so let's investigate better ... it should never segfault, if passing good code of course, and that is where i needed help - is what is written correct? daviid: is there a 'granma' step-by-step guile to install guile on a w64 machine? daviid: * ... guide ... somewhere? ahungry: hi all - if one wanted to extend guile with a new language / syntax support, is there an existing guide for that? Maybe a "hello world" type sample? ahungry: Would it require writing a file into the languages/ directory in guile source and recompiling, or is it possible to do just in the "userspace" for prototyping such a thing? daviid: str1ngs: i pushed a few patches, one offers a new gi-import-by-name interface that you might be interested to use, like: (gi-import-by-name "Gtk" "Widget"), (gi-import-by-name "Gtk" "init") ... str1ngs: daviid: ah that's handy thank you. I kind wrote my own but I'll switch. mine didn't do any error handling lol str1ngs: daviid: I'll test this out tomorrow for sure daviid: ok nalaginrut: wingo: It seems suspendable-port has bug in 2.9.4 nalaginrut: Internal ERROR wrong-type-arg (bytevector-copy! Wrong type argument in position ~A (expecting ~A): ~S (3 mutable bytevector 1024) (1024))! nalaginrut: The location is "In ice-9/suspendable-ports.scm: nalaginrut: 340:16 1 (get-bytevector-some! _ _ 0 _)" nalaginrut: I think I have to fallback to 2.2, and I'll try to figure out what's wrong chrislck: question for g-golf hackers... from my understanding it's meant to be a forever-glue to gtk3; are there any hello world? like racket/gui? str1ngs: chrislck: g-golf uses gobject introspection as long as something has GObject typelibs g-golf can introspect it and it's now available to scheme. so yes it's kinda like forever-glue to gtk3 but it's not limited to gtk3 either. str1ngs: chrislck: did you need a hello world example for gtk3? chrislck: it would be nice yes, for people who are new to hacking guile chrislck: s/guile/guile programs chrislck: I could write applets that interface to/from gnucash *dreams* str1ngs: actually g-golf doesn't not support signals yet. so I proper example would be buggy str1ngs: does gnucase use gtk_main or does it use GtkApplication? str1ngs: err gnucash* chrislck: uh no idea, looks like gtk_main() str1ngs: I'm using g-golf with nomad, but I provide my own typelibs to handing signals and some other limitations meantime. just keep in mind g-golf is still in development. str1ngs: I can put a gtk_main example together for you chrislck: this looks like the main loop: https://github.com/Gnucash/gnucash/blob/maint/gnucash/gnome-utils/gnc-gnome-utils.c#L671 chrislck: (the wrapping gnc:set-ui-status is my hack to upgrade error-logging from console to use gtk ) chrislck: https://github.com/Gnucash/gnucash/commit/a731c9e str1ngs: I will put a basic gtk helle-world together for you. just keep in mind that closing the window won't stop the main process. since there is no way to attach a signal chrislck: thx! str1ngs: also I'm only a g-golf user. Daviid is the author. chrislck: guile needs a wiki IMO str1ngs: chrislck: also the g-golf introspected API very close to the C API so you should be able to get going pretty easily str1ngs: is very* chrislck: guile needs an *opininated wiki IMO... not easy to know if something is obsolete, bitrotted, or in development str1ngs: chrislck: a basic hello world http://paste.debian.net/1100882 chrislck: hmm so small... str1ngs: if you need a more complete example I can add to this if you like chrislck: gi-import can't be found, where's this from? chrislck: have libgirepository1.0-dev and libgirepository-1.0-1 already str1ngs: gi-import is part of g-golf chrislck: ah i'd compiled master rather than devel chrislck: my ubuntu has Makeinfo6.5 only :( str1ngs: chrislck: in configure.ac change the MAKEINFO_PROG([6.5]) to MAKEINFO_PROG str1ngs: also you might need to change GUILE_PROGS([2.0.14]) to GUILE_PROGS str1ngs: this is a hack for ubuntu. str1ngs: chrislck after that run ./autogen.sh str1ngs: and then ./configure str1ngs: err 6.6 not 6.5 I meant chrislck: ok finally did it.. that was painful str1ngs: chrislck: can you verify that you needed to modify GUILE_PROGS. if so I'll let daviid now this might be a bug chrislck: don't think i had to... first time round it did compile str1ngs: MAKEINFO_PROG can't be helped since 6.6 is a requirement. so that's an issue with ubuntu chrislck: ok GUILE_PROGS does work with 2.0.14 str1ngs: okay good to know, what is your ubuntu version. cat /etc/lsb-release will give you the version chrislck: DISTRIB_RELEASE=19.04 disco str1ngs: thanks chrislck: ideally i'd restart with a clean minimal ubuntu and make it work. the dependencies list is fine but CLI commands would be better str1ngs: I have a docker file for g-golf if you needed an isolated test environment chrislck: sudo apt install guile-library guile-2.2 autoconf chrislck: oh yes spk121: so, no such thing as marking a bytevector read-only? daviid: spk121: how would that even be possible? I mean unless another data strucutre has that information ... daviid: which is what guile struct offers if i'm not mistaken daviid: vtable spk121: daviid: dunno. Add an object property to the bytevector. Some magic with mprotect and read-only pages. ;-) daviid: does that exists, in the kernel? spk121: Sure. On Linux you can set and unset a page read-only but a page is 4KB. OpenBSD has a better mprotect with no 4KB minimum daviid: spk121: meanwhile, why don't you just rely on your uers not to mutate? you inform them not to, if they do that , it crashes or produces unreliable results ... sounds perfectly ok to me daviid: chrislck: g-golf works 2.0.14, but that is becoming quite old, and is also quite slower then the latest 2.2 stable releases. g-golf also works with 3.0 janneke: hmm, what's the name of latin1 encoding for ice-9 iconv in 2.0.9? these work on 2.0.14 but not on 2.0.9... (string->bytevector "bla" "latin1") (string->bytevector "bla" "ISO-8859-1") janneke: `#f' does not work :-( daviid: chrislck: g-golf currently lacks a few fundamental pieces - g-iddle-*, g-timeout-*, gclosures and signals, mainly, working on it ... janneke: hmm, maybe "ascii" ? janneke: or would i lose bits daviid: chrislck: you must (currently) checkout the devel branch indeed, and pull/make once a day or so ... just keep an eye here and on the repo ... daviid: chrislck: feedback welcome of course - ultimately, you should be able to get rid of most if not all your C code, gnome/gtk wise at least daviid: chrislck, str1ngs, whe you want to define a module, you need to import at expand time daviid: *when daviid: spk121: in your browser example in guile-gi, line 47, you call (run app (command-line)), is run from Gio or from guile-gi? what would be a good example for (command-line)? i'm trying to port this example to g-golf ... though without signal, but i wanted to see ... chrislck: we are still none the wiser what is (ice-9 poe) named after... daviid: pure object environment :) daviid: or edgar ... the misterious edgar allea poe guile's (ice-9 module) daviid: *allan daviid: * guile's (ice-9 poe) module i meant to write ... chrislck: wouldn't surprise me edgar allan poe was a closet lisper :) chrislck: (raven (quote nevermore)) iv-so: Hi iv-so: anyone here using guix? chrislck: iv-so: /join #guix iv-so: I guess my questions are more related to guile than to guix str1ngs: iv-so: It's best to ask your question. Than to ask if someone uses something. iv-so: #guix guys already answered lampilelo: lol lampilelo: that was productive mwette: ls spk121: ls spk121: lol str1ngs: ls: command not found str1ngs: :) lampilelo: try dir daviid: heya guilers! sneek: daviid, you have 1 message. sneek: daviid, str1ngs says: the critical console log error I mentioned last night. Was an issue with nomad selectively importing a non existing info object. So nothing to worry about in terms of g-golf. daviid: str1ngs: ok tx, that confirms what i thought ArneBab: jcowan: one more thing from the Fortran front: https://www.draketo.de/english/free-software/immutable-java-js-fortran jcowan: “I don't know what the language of the year 2000 will look like, but I know it will be called Fortran.” —Tony Hoare, winner of the 1980 Turing Award, in 1982. daviid: manumanumanu: you're aware we already had one guile-dsv implementation? https://github.com/artyom-poptsov/guile-dsv spk121: . wingo: i guess we can remove a number of define-inlinable invocations, given top-level inlining civodul: yay! civodul: it reminds me when i was(?) doing C: for a long time i'd happily put "inline" here and there civodul: that probably never made much sense chrislck: wingo: will the syntax-violation for _ affect gnucash which does (define _ gettext) ? chrislck: looks like it won't wingo: chrislck: i don't think that anything should change, if you were already able to (define _ gettext) -- since 2.2, (define _ gettext) means that you are making a new local definition of _, causing _ not to match a syntax keyword chrislck: cool thanks! dsmith-work: Happy Friday, Guilers!! wleslie: Happy Friday, dsmith-work ! spk121: Hey kids. Yesterday, whilst looking for a tarball of guile-ii, I came across this treasure trove of 1990s scheme on an old ftp site https://cs.indiana.edu/ftp/scheme-repository/ jcowan: yes, it was linked to in all Scheme reports until R7RS, when we removed the link; it hasn't been updated in this century. jcowan: It is linked from http://community.schemewiki.org/?scheme-faq-standards#libraries chrislck: cool, antiques! jcowan: In Lisp, bit-rot is a minimal effect. http://recycledknowledge.blogspot.com/2011/11/john-mccarthy-inventor-of-lisp-died.html contains John McCarthy's theorem prover from 1959 as Scheme, with only trivial changes. http://informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/wang.html is a closely related prover that is original code plus a shim that makes it valid CL. spk121: jcowan: wow jcowan: Interestingly, this code is so old that false and the empty list are not yet the same thing. redkahuna: Hey all, how can i do something like import pdb; pdb.set_trace() in gnu guile ? redkahuna: I think there is a function to call the interpreter with the current context or something like that amz3: a live REPL? amz3: redkahuna: I never found the answer to that question, really. redkahuna: yes redkahuna: I am sure there is a function amz3: redkahuna: I mostly use 'pk' procedure to print and return the last argument. redkahuna: because i used it before spk121: redkahuna: well, you can start a repl anytime by calling 'start-repl' from (system repl repl) spk121: and then, once in that repl, you can jump to a particular module with the ',m' command spk121: but I don't know how to make it work from any random location... I don't know how you'd start a repl in the middle of a function and have the repl see the local of that function spk121: *local variables dsmith-work: jcowan: Heh. In diapers at the time. (me too) redkahuna: spk121: i m sure this function exist, I m searching if it's somewhere in my code :p redkahuna: (sorry for my english) chrislck: redkahuna: also couldn't find a suitable function. I tried (system repl server)'s (run-server) which can open a terminal on 37146 but doesn't seem to expose the whole local environment manumanumanu: daviid: nope. Was not awae. manumanumanu: thanks for that. manumanumanu: daviid: I'll link to it. It looks a lot more thought out than mine :D manumanumanu: daviid: wow... finite state automata. Very pretty. daviid: manumanumanu: and fully autotool chained, together with a guix package file, fully texinfo docmented, a test-suite, gplv3+ ... and yes the author has a reputation :):) of super quality code ...worth working togetehr hen rewrite, imo at least ... dsmith-work: Heh daviid: str1ngs: I think I fixed the bug you reported, could you pull and try? please note that you _must_ get the iter after you modified the buffer content, otherwise it will also segfault, here is an example which works now - http://paste.debian.net/1100208/ daviid: str1ngs: here is example that fals, unfortunately with a segfault, when the iter is invalid - http://paste.debian.net/1100209/ daviid: it segfault, but it clearly explains why ... str1ngs: daviid: it's working now. will test more in the morning daviid: ok, good str1ngs: thanks, I'm getting close to removing most of my SCM_DEFINE's :) str1ngs: daviid: I noticed some critical console error message like. CRITICAL **: 00:02:21.365: g_object_info_get_n_properties: assertion 'GI_IS_OBJECT_INFO (info)' failed which are recent. I don't think they are related to the iter issues daviid: good to hear, but let's not 'rush', there are still corner cases ... and missing bits ... but hopefully g-golf will get 'there' ... tx for your help and patience ... str1ngs: I'll look more into what code is cause the critical errors make sure it's not an issue on my end. str1ngs: daviid: not a problem. this helps me out just as much daviid: hum, these msgs should only occur at 'gi-import' time, no? daviid: what is the namepace that trigger those? str1ngs: possibly , but it's kinda late for me to look into it. I'll check first thing in the morning daviid: *namespace daviid: ok str1ngs: I'll check this first thing and report back. thanks for the iter fix daviid: np! str1ngs: on a pure scheme note, I've been playing around with macro's and trying to reason out writing a DSL. do you know if its possible to expand a atom or symbol using a macro. or would that require a reader? daviid: str1ngs: I am not a syntax (very) knowledgeable person, Ill let others answer those quiz ... str1ngs: understandable maybe I should ask in #scheme. your tail recursive loops in g-golf have been educational. the pattern is a nice way to avoid using set! within lets dsmith-work: Morning Greetings, Guilers lloda: hi dsmith-work Tirifto: Hello all! Anyone got insight into the working of menus in guile-ncurses? spk121: Tirifto: I know a bit about it spk121: what's up? Tirifto: spk121: Ah! Do you know if a menu is supposed to have its associated menu set to #f by default, and if the rest of ncurses assumes ‘stdscr’ upon encountering #f in that context? spk121: Tirifto: I don't think that is how it is intended to work. The underlying ncurses menu functions encourage you make a window and subwindow for your menu that are appropriately sized. But if you just call post-menu w/o setting up those windows it will draw to stdscr. Tirifto: spk121: I see. When I create a menu and don't assign a window to it, (menu-win the-menu-in-question) just returns #f. spk121: Yeah. #f meaning the C function returned NULL. NULL meaning that no window was assigned to the menu. So #f doesn't mean stdscr, it means "i don't know" spk121: which is, in effect, stdscr Tirifto: Ah, so ncurses say ‘let's go with stdscr then’ upon funding #f, meaning ‘I don't know’, where a window is expected? spk121: I believe so. Tirifto: Okay, that makes sense. Thanks! Tirifto: If my Guile Scheme program has functions with only constants as inputs in it (or other functions as input, which in turn only have constants as input), which may get called multiple times, are they going to be reevaluated on every call, or will that be optimised out? (Just wondering if I should worry about this much in the program design.) ArneBab: manumanumanu: arg, yes, you’re right. I did not see that either, so nothing to be embarassed about! ArneBab: manumanumanu: dsv sounds interesting — parsing csv files is famous for being hard to do exactly right, and having something which just works would be great ArneBab: Tirifto: they will be re-evaluated, but you can easily wrap them to add a cache (so you can retrofit that if you find that you need it). chrislck: Tirifto: look up memoization chrislck: Tirifto: http://paste.debian.net/1100289/ Tirifto: ArneBab, chrislck: Thank you! janneke: chrislck: what's the reason for not using ice-9 poe? chrislck: janneke: umm because I've never encountered ice-9 poe before, and it looks horribly complex... anything wrong with mine? chrislck: guile modules are not always named very well chrislck: s/guile/scheme *: civodul didn't even know (ice-9 poe) was about memoization civodul: i've definitely seen it before, but it's one of these modules that came from another era civodul: with a not-so-descriptive name :-) chrislck: yeah could have been power-over-ethernet in guile janneke: chrislck: nothing wrong, just seems similar :) chrislck: phew janneke: iwbn if it had a nicer name (ice-9 memoization) or so and included some lambda memoization goodies from guix janneke: and was documented in the manual ;) civodul: heh :-) civodul: any idea why it's called "poe"? civodul: i must be missing a reference janneke: no idea, let me know when someone finds out :) dsmith-work: Pretty sure the #\p is is for "pure". civodul: it was apparently written in 1996 or before, first commit in the repo: https://git.savannah.gnu.org/cgit/guile.git/commit/?id=0f2d19dd46f83f41177f61d585732b32a866d613 civodul: it's like visiting the attic dsmith-work: Heh dsmith-work: There were tarball releases before then. guile-i guile-ii guile-iii (iirc) janneke: dsmith-work: yeah, that's what i figured..now for the o and e :) chrislck: http://www.susaaland.dk/sharedoc/guile-1.6.7/AUTHORS dsmith-work: Tom Lord eh? spk121: looks like Mikael Djurfeldt was the last one to make a functionality patch to poe.scm in 1996 civodul: if Mikael is around next FOSDEM, we should discuss it :-) jcowan: fwiw there is a Perl hacker named Chris Poe who's been involved in memoization manumanumanu: ArneBab: oh, yes, but I am just now writing some tests, and managed to crash the csv parser instantly :D ArneBab: :-) spk121: so (ice-9 poe) was not in guile-ii from 1995, but, was last functionally patched in 1996. I couldn't find the old RCS files, so that's as far as I can go, I guess enderby: what does ice stand for btw? Tirifto: Modules from the water-9 group after a feature freeze? spk121: enderby: well, if I recall correctly, the ice-9 from Kurt Vonnegut's fiction was supposedly so cold that froze anything it touched, so kind of always expanding. And the original intention of ice-9 was that is where it would absorb all the new libraries, like the ice-9 of fiction. spk121: So it is just a dumb joke from the 1990s enderby: icic, thanks! jcowan: not to be confused with actual ice IX, which was discovered later manumanumanu: Hmmm. why is it implemented like that? Guile can hash lists, so you can just use a hash table with the args as the key... manumanumanu: i have a define/hash which is just a 6 line macro. jcowan: The cost is a lot higher, and since multiple values are second-class, they make things even harder manumanumanu: define/memoized i mean jcowan: with an equal? hashtable? manumanumanu: yes jcowan: imo it is worthwhile having fast paths for 1-arg 1-value and many-args 1-value jcowan: and leave the many-value case to those who really need it enderby: is it not possible to load r7rs in guile yet? amz3: enderby: no with master, but maybe with r7rs-wip branch it works? ArneBab: sp1ff0: I don’t think that the joke is bad :-) ArneBab: enderby: the argument is that ice-9 crystallizes everything, so it’s a perfect seed for Guile. manumanumanu: soon, everything will be guile manumanumanu: ! ArneBab: But it’s been discussed (and not objected to) to alias it as guile or so. ArneBab: (that’s my last information at least) enderby: ah ArneBab: enderby: here’s some additional stuff which might help you get started: https://www.draketo.de/proj/guile-basics/ enderby: ArneBab: ty dsmith-work: Aren't there some incompatibilites between r6rs and r7rs? Like argument order on some functions? dsmith-work: Such that you can't be both r6 AND r7 ? manumanumanu: a lot of r7rs can be implemented portably in r6rs, but there are some reader incompatibilities iirc. jcowan: Only one function (bytevector-copy!) has significant arg-order issues. R6RS/R7RS systems have to give them different names if both libraries are loaded. jcowan: http://www.schemeworkshop.org/2015/sfpw1-2015-clinger.pdf <-- Will Clinger's paper on adding R7RS to Larceny, which is non-strict R6RS. jcowan: It goes into plenty of detail. str1ngs: sneek: later tell daviid. the critical console log error I mentioned last night. Was an issue with nomad selectively importing a non existing info object. So nothing to worry about in terms of g-golf. sneek: Got it. manumanumanu: Anyone knows why set! is slow in guile? In chez, any set! value is boxed, which adds overhead. Does guile do something similar? dsmith-work: manumanumanu: set! mutates. It's slow by design so you avoid it! dsmith-work: manumanumanu: Actually, my understanding is it really adds some constraints to the optimizer. manumanumanu: But why is it slow by design? I understand that it can make it a lot harder for the compiler to reason about what the code does. Why is mutation slower in guile than in a notoriously mutating language like python? dsmith-work: Oh, I was just being silly about "by design". ArneBab: manumanumanu: is it slower than in Python or only slower than other parts of Guile? dsmith-work: manumanumanu: Back in the "old days" of guile, like 1.4, 1.6. I was able to make some code *faster* by mutating. manumanumanu: ArneBab: adding mutation to avoid about 100000x (make-string 20) actually made my code slower dsmith-work: Because it was gc-ing a whole lot less. dsmith-work: Before the compiler. manumanumanu: having _one_ buffer instead of creating a new one for each row (in guile-dsv) actually made my code slower. manumanumanu: Not by much manumanumanu: but still. manumanumanu: Whatever happened ate the performance benefits of not allociting a new string for each row ArneBab: manumanumanu: allocating can be really cheap if you have enough memory ArneBab: manumanumanu: and here is why: (define foo (map (λ(x) (make-string 20)) (iota 100000))) → adds just 22MiB of memory ArneBab: (from 18 MiB to 40 MiB) ArneBab: res ArneBab: and from 130 VIRT to 219 VIRT dsmith-work: ("just" 22M of memory!) ArneBab: we’re talking about speed here, right? :-) ArneBab: 100k strings, each 20 characters ArneBab: if each character required only one byte, this would still consume 2 MiB. ArneBab: to test easily: run guile in one terminal, then open another terminal with `top -p $(pgrep guile) | grep guile` and ArneBab: now you can experiment with how much memory this takes ArneBab: a single string with 2 million chars takes 11 MiB ArneBab: (define foo (make-string (* 20 100000))) ArneBab: so the overhead of string delimiting and the cons cels of the list increases the memory by roughly factor 2 ArneBab: manumanumanu: so you likely only threw 11 MiB into the garbage collector ArneBab: which it likely happily ignored ArneBab: because you had enough left over ArneBab: (we’re far from the low level optimizations here for which L2 cache-hits actually matter) manumanumanu: That I understand. But why was it slower having _one_ string that I grow using set!? ArneBab: how did you grow it? manumanumanu: I do the same thing now if one field is too large: make a new string that is twice as long and copy the contents. manumanumanu: the difference was that I either had the string in the closure that encapsulates the reading procedure, or that I sent a new string along for each line. ArneBab: I don’t know enough about the string representation in Guile to say it with certainty ArneBab: ^ that’s what’s left over after I deleted everything I wasn’t sure about :-) manumanumanu: I don't think it has anything to do with that. I think set! is the criminal, but why? ArneBab: dsmith-work: is it possible with Guile to actually see the difference of hitting L2 caches? I did that with Fortran once ( https://www.draketo.de/english/free-software/fortran#orgheadline4 ) and I’d like to know whether we can get that 3-5x speedup in Guile, too. manumanumanu: I have a decent idea of what is fast and why. But this I don't understand ArneBab: maybe you can see it with (define foo) dsmith-work: ArneBab: wingo would know. ArneBab: ,disassemble (λ() (set! foo 5)) ArneBab: ,disassemble (λ() (make-string 20)) ArneBab: the main difference is box-set! vs. box-ref jcowan: Ah, another Fortran fan! jcowan: Fortran was the first computer language I learned and wrote programs in, though not the first in which my programs actually executed. ArneBab: jcowan: I’ve been the opposite, but roughly 3 years into my PhD I realized how wrong I was. It’s still outdated, but I now consider it the most unfaily underappreciated language. ArneBab: unfairly jcowan: Maybe Lisp (in all its forms) too. ArneBab: yes ArneBab: though Lisp has this air of superiority around it (and people consider it as too crazy), while Fortran has a bad reputation as this language everyone hates ArneBab: until a Pythonista (me) realizes that numerical code in Fortran actually looks more Pythonesque than Python-code with numpy. *: jcowan chuckles wingo: manumanumanu: guile does the same thing as chez for assigned variables (boxing) wingo: the name of the pass is "assignment conversion" fwiw wingo: s/pass/transformation/ wingo: it's done as part of tree-il->cps compilation manumanumanu: I had just disassembled it and had started getting familiar with the instruction set :D manumanumanu: ok manumanumanu: thanks! wingo: optimizations are possible (for non-escaping vars we could do a kind of ssa transformation) but not implemented as most guile programs aren't set!-heavy manumanumanu: I just thought: I am mutating the string. It is already thread-unsafe. It was a clear optimization manumanumanu: at least until I benchmarked :D manumanumanu: Good to know! manumanumanu: guile-dsv is now half as fast as python's csv parser, which is about 1200 lines of C :D wingo: :) jcowan: What are guile-dsv's options? wingo: weinholt: just landed a patch to bind else, =>, etc wingo: in master anyway manumanumanu: jcowan: separator, newline, escape char and trim? manumanumanu: or at least, soon it has trim? again. jcowan: Is newline respected on output only? I hope so (i.e. on input any newline will work) weinholt: wingo, cool; i'll need to start trying it out jcowan: Does trim? ignore escape-space sequences? manumanumanu: jcowan: it has #:newline 'lax :D jcowan: Ah. manumanumanu: which supports CR, LF, CRLF and CR jcowan: In today's world I can't imagine using anything else manumanumanu: escape-space sequences? jcowan: i.e if you have "foo\ , bar" with trim on, does that reduce to "foo " and "bar"? manumanumanu: no manumanumanu: It does not support escape characters outside double quoted strings manumanumanu: that will be a row like #("foo\\" "bar") jcowan: Oh, double quotes! jcowan: my current design (not yet filled out, never mind implemented) distinguishes between csv-per-the-RFC and dsv (one line each, single-char escape) jcowan: https://tools.ietf.org/html/rfc4180 manumanumanu: It supports that spec I believe. manumanumanu: but no headers yet! manumanumanu: I had forgotten about that. manumanumanu: So, I will have a #:skip-header? keyword argument as well. manumanumanu: at least until I support headers and dsv->hash-table :D manumanumanu: oh my, it has gotten late again. manumanumanu: Now I need some sleep. weinholt: that's just a myth weinholt: you need more coding manumanumanu: I am a grass widower until sunday. My life has fallen apart around me. I spent two nights coding and can't take it tonight :D weinholt: :) dsmith-work: What is a "grass widower" ? weinholt: gräsänkling, swedish expression i guess, basically means your spouse is on a trip dsmith-work: Ah. manumanumanu: weinholt: strohwitwe in german, grass widower in english manumanumanu: but probably not a common english expression. manumanumanu: In german it is pretty well known. manumanumanu: as in swedish. In english I suspect it is quite old fashioned. manumanumanu: jcowan: if you want to check guile-dsv out, you can find it here https://hg.sr.ht/~bjoli/guile-dsv Apart from the keyword stuff, and that I am using substring/copy it should be easily portable. jcowan: manumanumanu: Nice. I'll look at it in more detail later. jcowan: I would change reader to generator jcowan: also, is there any chance of having a more liberal license? The license of SRFIs is basically BSD. str1ngs: hello, I'm trying to create a syntax rule. I'd like match a variable lenght of arguments. my syntax rule looks like this ((~ . args) #t) the rule matchs something like (~ " str1ngs: matchs something like (~ "bar" "baz") but I can't seem to do much with args str1ngs: is args a list? or does it just get expanded out? daviid: str1ngs: i recommend you (debian or tor friendly) paste your definition, together with a comment explaining what you are trying to acheive ... otherwise, it is difficult to help str1ngs: I basically need to use args matched by this syntax rule. ((~ . args) #t) I'm not sure if that warrants a whole paste :) daviid: str1ngs: I pushed a series of patches to fix the gtk iter problem, and as matter of fact any C struct 'semi-opaque' args (see the logs for a descrition if you are iterested, but as a user, you may skip that if you wish) - here are two ways you can get your had on a gtk iter (among other ways): http://paste.debian.net/1099991/ daviid: *your hands str1ngs: daviid: this is great, actually easier then the C api. will test this out ASAP wleslie: sneek: seen mark_weaver ? sneek: I last saw mark_weaver on Jan 13 at 04:29 am UTC, saying: :). wleslie: sneek: botsnack sneek: :) lloda: posix has log2 which seems exact for arg = 2^n, guile should have that lloda: I had somewhere (define (log2 x) lloda: (* (log x) 1.44269504088896340735992468100189213742664595415299)) lloda: which is broken lloda: as in (log2 8) -> (define (log2 x) lloda: sorry lloda: as in (log2 8) -> 2.9999999999999996 civodul: not great *: civodul prepares a guile-gcrypt release jcowan: lloda: SRFI 144 is portable and has all of math.h lloda: jcowan: thanks heisenberg-25: any csv libraries guile? amz3: heisenberg-25: https://github.com/artyom-poptsov/guile-dsv rain2: amz3: hello what do you think abotu the new ML? for persistence dsmith-work: Morning Greetings, Guilers amz3: rain2: very good idea amz3: rain2: I subscribed. rain2: amz3: maybe I should post about serializable closures amz3: rain2: you should do it. hga was trying to convince to add stored procedure to okvs or nstore rain2: OK and I think serializing records is valuable to discuss rain2: but it would need a lot of preparation rain2: maybe someone has done a review across implementations already actually amz3: IIUC gambit has serializable closures str1ngs: daviid: gtk-text-buffer-get-start-iter looks to work now. though when trying to move a text view's cursor like so. http://paste.debian.net/1100113 both gtk-text-iter-forward-chars and gtk-text-buffer-place-cursor segfault str1ngs: daviid: this is complete paste http://paste.debian.net/1100116 lloda: what is preferred out of GUILE_PGK(), GUILE_PKG([3.0 2.2 2.0]) or GUILE_PKG([2.0 2.2 3.0]) lloda: no arguments seems to check 2.0 1.8 lloda: so start from the highest? str1ngs: lloda: I've always seen it start from the highest. I guess use the versions that your program supports spk121: lloda: lately, most of my stuff is 2.2 only, since I'm not testing 2.0, and waiting for 3.0 to be official lloda: thx str1ngs spk121 lloda: I was trying guile-dsv linked above and I had to patch it because it used GUILE_PKG([2.2 2.0]) and I use 3.0 lloda: well 2.0 lloda: well 2.9 lloda: tbh I don't understand the guile-lib install logic :-( lloda: for example guile-sqlite installs to prefix/share/guile/site/3.0/ if I give prefix lloda: but that's not enough for guile-lib, it installs to prefix/guile-lib if I just pass prefix (!) lloda: it's annoying daviid: lloda: afaict, guile-lib and other packages i (co)maintain offers the best and certainly most complete set of options so things are installed where you want ... but then may be there i a bug? i recently chnged guile-lib for you, so to speak, i'm very surprised to hear 'now' that it is annoying ... what is missing? daviid: str1ngs: tx, will look into this daviid: lloda: what you describe here above is exactly what one should expect when 'only' passsing prefix - if you want to install the source modules in guile's tree, and the go file in guile's ccache tree, you must pass --with-guile-site=yes, wether or not you used prefix ... daviid: which is listed by the configure step, so users are aware ... daviid: it is totally wrong, imo, to install in the guile's tree 'by default' and will never ever do that, sorry daviid: lloda: and what is it that you constantly have to reinstall guile-lib? this is 'funny' lloda: daviid: I remember having this chat before, and also that you fixed things lloda: maybe it's guile-sqlite that is at fault daviid: options are listed at the end of the configure step lloda: still I'm not sure why prefix isn't enough to install everything under prefix/ lloda: sorry if I asked this beforef daviid: it is enough, but source and go file will be installed there as well ... the you'd have to adapt guile load path and guile compile path ... of course ... daviid: 'but source and go file will be installed there' is exatly what you should expect daviid: to install src modules and gofile using guile ste vars, you must ask for that so it happens ... using --with-guile-site=yes lloda: ok, I see what you mean daviid: i don't co maintain guile-sqlite, but if it installs in guile's tree by default, then it is wrong lloda: it doesn't install in guile's tree though daviid: imo at least lloda: it installs in prefix/share/guile/site/version-number/ lloda: which is what I expected guile-lib to do when I passed prefix/ lloda: but it's ok daviid: lloda: it will if ypu pass --with-guile-site=yes daviid: lloda: last and nt least, where things ar einstalled is also listed at the end of the configure step daviid: so there is zero surprise lloda: I get that now - I'll make a note because I'm likely to forget it by next time lloda: daviid: yes, I saw the notice lloda: sorry for the trouble :-| daviid: np! daviid: lloda: answering your previous quiz, i'd start by listing the first major.minor numbers that your package needs, then following in ascending order if/when your package allows 3.0 ... daviid: meaining 2.2 required, 3.0 allowed ... lloda: daviid: then it's strange that when you pass no arguments, it tries 2.0 1.8 in descending order lloda: to me, best to worst makes sense lloda: and I'd expect most-recent = best daviid: that's the default in guile.m4 ... daviid: you can patch ... daviid: but i don't trust these defaults anyway, so explicitly list as decribed above ... daviid: how could guile know what your pkg needs, version wise... would be 'magic' :) lloda: daviid: you're right lloda: I guess packages need to be updated to support 3.0 is all dsmith-work: lloda: What guile-sqlite ? lloda: dsmith-work: https://notabug.org/guile-sqlite3/guile-sqlite3 dsmith-work: lloda: Thanks lloda: yw bsima: rekado_: what did you mean here by "recovering haskeller"? https://news.ycombinator.com/item?id=16490027 bsima: i'm just curious, as i do haskell+nix for work and scheme for fun manumanumanu: Ok, I am having a weeeird issue. I have a cond clause that looks the following: ((char? newline) (eqv? ch newline)). If I change that around to be ((eqv? newline ch) #t) it doesn't trigger. This _should_ be the same, no? manumanumanu: this is in 2.9.4+ manumanumanu: the latest master manumanumanu: Yay! I think I have found a bug! manumanumanu: Trying to create a simpler example makes the code work manumanumanu: Am I missing some edge case of eqv? manumanumanu: Shit. manumanumanu: Disregard everything I wrote above. ArneBab: manumanumanu: can you still explain what happened? rekado_: bsima: oh, I used to be into Haskell a lot. Used it everywhere I could. rekado_: but now I almost exclusively write Scheme. rekado_: I still appreciate Haskell for what it did to my brain, but now I just look at it from a distance. wingo: good evening wingo: civodul: afaics guile does not have translations. is that correct? wingo: i.e. guile itself is not localized wingo: file under ignorant questions from anglophones wingo: and do you think G_ is a good recommendation for a gettext alias? wingo: other answers welcome too wingo: i mean answers from other people :) spk121: wingo: libguile/guile.c doesn't have a bindtextdomain call, so it isn't translated, as far as I understand it wingo: okeydoke wingo: tx spk121 wingo: do you use gettext with guile spk121 ? if so did you run into problems with 2.2 and (define _ gettext) ? wingo: (the issue being that defining a local binding for _ prevented syntax-rules / syntax-case / match from recognizing _ as the catch-all pattern) spk121: wingo: oh gosh... In original guile-ncurses, I did try to do gettext, but, I eventually pulled it out because it was half-baked. I'm not the programmer that is likely to go big on syntax case, so I don't recall problems on that front spk121: but I probably wouldn't use '_' because it looks weird. More likely would have abbreviated gettext to something shorter wingo: i understand that _ is the conventional abbreviation tho wingo: like in C they recommend #define _(x) (gettext(x)) spk121: True. Have used in _ in C. But C is C. spk121: Not obvious to me exactly how problematic _ would be in scheme, tho. wingo: yeah that surprised me wingo: i like _ as the catch-all pattern and it wasn't apparent to me that using it as a gettext alias would be incompatible somehow janneke: you're probably aware that guix uses G_, i think that's okay wingo: janneke: yeah, i guess i was just looking to see if that has worked out fine wingo: in the guile manual we should recommend a convention i think wingo: (G_ "...") is fairly unidiomatic scheme but perhaps that's a virtue janneke: yes, i have used _ in the past, but that was before i used match or macros :-) janneke: yes, i think that's a feature... it stands out, more than constructs with a lower case g (g... manumanumanu: ArneBab: I'd prefer not to :) ((char? newline) (eqv? ...)) returned either #t or #f. I replaced it with a cond clause that only triggered if (eqv? ...) which meant that the case was only triggered if (eqv? ...) was true, which meant all other cases went unhandled. manumanumanu: Rather embarrassing manumanumanu: ArneBab: I have written a DSV (delimiter-separated values) parser that is slightly faster than guile-csv, but with more features :D manumanumanu: It allows for configurable escape characters, configurable newlines, configurable delimiters and soon also for trimming values! :D manumanumanu: guile-csv is probably the prettiest little parser I have ever seen. sneek: So noted. manumanumanu: it also has a streaming interface that lets you read one line at a time. jcowan: wingo: _ is an auxiliary keyword of syntax-rule jcowan: s/rule/rules jcowan: __ would work for me manumanumanu: ArneBab: https://hg.sr.ht/~bjoli/guile-dsv Code is really ugly now. It will be faster and prettier in a little while. manumanumanu: gnight! amz3: sneek: what is guile-csv sneek: Someone once said guile-csv is probably the prettiest little parser I have ever seen. rlb: Is there a typical way to launch a subprocess allowing capture stderr in addition to stdout? weinholt: rlb, it's a bit cumbersome but can be done, here's an example: https://github.com/rotty/spells/blob/master/spells/process/compat.guile.sls amz3: hello all! amz3: spk121: is webkit gtk already in a useable state? I need to crawl websites rendered using javascript. The "algorithm" is the following 1) go to url http://example.com 2) render the page 3) store the html of the page inside a .html file amz3: sometime it is called browser automation rlb: weinholt: ahh, I see -- was hoping to avoid primitive-fork given the potential threading issues, but I'll take a closer look later. Thanks. csed: Hoi hoi, so on the website I saw: "In addition to Scheme, Guile includes compiler front-ends for ECMAScript and Emacs Lisp" csed: What's the elisp bit mean? Does it compile to elisp byte code? ft: No, it can compile elisp source code to the guile vm. ft: So it would generally be possible to swap out emacs' elisp engine with guile. But it might be doubtful whether or not that will happen. rekado: this already happened (see Guile Emacs), but work on it has stalled. ft: Sure, I meant whether or not the default engine in emacs gets replace by guile. spk121: amz3: I'm not sure how much of WebKit is usable now. It works well enough to make small example work. https://github.com/spk121/guile-gi/blob/master/examples/browser.scm spk121: amz3: everything common is working except for struct accessors, GHashes, and some closure operations spk121: and the autogenerated documentation isn't great csed: ft, rekado: Ah, righto. Thanks! dsmith-work: Morning Greetings, Guilers spk121: dsmith-work: heya *: spk121 ponders bizarre plan to have a GNU-only website using GNU Serveez as http server, GNU Artanis as web framework, and GNU recutils as database backend civodul: :-) rotty: With glibc on the HURD, of course, spk121! ;-) rotty: Does guix run on the Hurd? Throwing guix into the mix would round the thing off nicely, IMNSSSO. rekado: rotty: it’s complicated, unfortunately. rekado: we’re having some problems with the cross-built bootstrap binaries on the Hurd. rotty: (IMNSSO = In my not so serious opinion) ;-) ArneBab: rotty: since the Hurd has been self-hosting its wiki for something like a decade now, that’s not as far-fetched as it sounds. rotty: ArneBab: my last hurd experience was in the early 2000's when I had a dual-boot with linux for a while rotty: I was really sad that the l4-based rewrite never seemed to pick up steam ArneBab: rotty: it didn’t pick up speed, because they found l4 to lack a bit too much. Once they focussed on Mach again, progress was slow but steady. rotty: ArneBab: do you happen to have any links regarding that? I'd love to read up on that decision, and the limitations of L4 discovered. ArneBab: http://darnassus.sceen.net/~hurd-web/history/port_to_another_microkernel/ ArneBab: you can try the Hurd again today: wget http://people.debian.org/~sthibault/hurd-i386/debian-hurd.img.tar.gz; tar xf de*hu*gz; qemu-system-x86_64 -hda de*hu*g -m 1G # user is root ArneBab: You might get more answers in #hurd rotty: ArneBab: thanks schaeffer: so, here's a question schaeffer: does anyone here write guile in an editor that isn't emacs? schaeffer: like, say...acme? Tirifto: Acme's one letter away from being an anagram of Emacs! schaeffer: and acme's is an anagram of emacs', depending on your ideas of what makes an anagram or a plural of emacs :^) Tirifto: xP spk121: schaeffer: what is a non-emacs that does decent auto-indent for scheme/lisp schaeffer: that's the real question, isn't it daviid: str1ngs: gtk-text-iter is not a class, it is an opaque struct, whch tou may look at doing this: (gi-cache-ref 'boxed 'gtk-text-iter) and then describe ... daviid: now, there is a bug when i try to call make-c-struct upon it def and init vals daviid: kere is a trace http://paste.debian.net/1099598/ daviid: any guilers familiar with make-c-struct could help? daviid: spk121: do you import the GtkTextIter in scheme, or refer and instantiate those from their C def 'only'? spk121: daviid: we pull its memory size from the BaseInfo and allocate it as bytevector space. There is a goops that wraps the bytevector pointer, and it is the goops class that labels it as a GtkTextIter. So far haven't tried to write the struct accessors spk121: GtkTextIter doesn't have a C instantiation procedure, otherwise we would have just wrapped that daviid: spk121: help much apriaciated, tx ... so far, i've never had a make-c-struct failure upon any imported GI struct (in g-golf, but this is for info, it irrelevant to the instatiation bug, which strictly use guile functionality, GI struct are imorted as instances daviid: spk121: unlike you seem to do, g-golf grabs the struct field types, then in thiscase guile isn't happy spk121: daviid: still haven't got around to actually doing struct fields on our side daviid: i could try to grab the base info size to, but now i dead curious why this failed - is it because of the void fields? daviid: spk121: ok, however, this is a guile bug, imo daviid: i'm clling make-c-struct passing 'valid' field types defined by gule, and 0 as the init val ... daviid: you can try in guile daviid: (make-c-struct '(0 0 8 8 8 8 8 8 0 0 8 8 8 0) '(0 0 0 0 0 0 0 0 0 0 0 0 0 0)) daviid: this works - (make-c-struct '(8 8 8 8 8 8 8 8 8) '(0 0 0 0 0 0 0 0 0)) daviid: which is the same as the above, but i removed the void (0 type def) from the feid def, and their corresponding 0 it vals ... spk121: the GTK+3 Reference Manual suggests that the struct is opaque and is supposed to be initialized by gtk_text_buffer_get_iter_*. I don't recall how that looks in its terminfo/gir. daviid: spk121: we must instantite initializa a pointer to a GtkTextIter, no matter what ... all these are out args ... daviid: spk121: hence you mus call make-c-struct, no matter what daviid: in this case, the C struct def includes a few void fields, that causes a bug in guile ... spk121: Yeah, that's why this one case is tough. GTK wants this one to be an opaque struct that you instantiate via malloc. daviid: spk121: but gtk surelly s enable to deternine from which lang the memory comes from? daviid: or am i being a bit ignorant here? daviid: spk121: do yu have a way to tell me what size guile-gi retruns for a GtkTextIter? removing these void fields, guile tells me it is 36 spk121: daviid: dunno. The C docs say this is an opaque struct, that you don't instantiate it yourself, but, it doesn't supply a constructor, so you have to use a static C GtkTextIter or malloc one for yourself. daviid: we should be able to use make-bytestructure, but i'm going to ask on #introspection daviid: (sizeof '(8 8 8 8 8 8 8 8 8)) -> 36 daviid: spk121: 0 is the type associated to void in guile scheme daviid: (sizeof '(0)) raises an exception spk121: I just wrote a C prog that did sizeof(GtkTextIter) and I got 80 on amd64 daviid: (sizeof '(8)) -> 4 and so on ... daviid: ah, terrible haha daviid: what a mess spk121: lemme see what guile-gi thinks its size is daviid: it surely will answer to same i guess - i can immediately write a constructor in C, for g-golf, but when i can avoid writig C code, i try to avoid ... spk121: guile-gi says that g_struct_info_get_size(info) for GtkTextIter returns 80 spk121: so maybe you need to compare your make-c-struct size to the struct-info-get-size, and if the differ, go for the bigger one? daviid: spk121: of curiosity, '(0 0 8 8 8 8 8 8 0 0 8 8 8 0) gives me 5 void fields, and (- 80 36) -> 44 is not even divisible by 5 ??? daviid: spk121: yes, that sounds a good remedy daviid: but i am a bit unhappy :):) so to speak daviid: spk121: by the way i can't compare because it raises an exception daviid: spk121: do you happen to know what this is supposed to tellus? g_struct_info_is_foreign daviid: it returns a boolen daviid: it that is opaque, then yes, i can use the struct-info size and use 0 as its iit val ... daviid: spk121: i didn't even bind g_struct_info_get_size yet, nor g_struct_info_is_foreign daviid: i'm going to do that right now daviid: there is the g_struct_info_get_alignment as well daviid: but so far i use guile's alignment (@@ (system foreign) align) spk121: OK. The 80 bytes should be chunked up as 8 8 4 4 4 4 4 4 8 8 4 4 *4* 8. the 4 are ints. the 8 are pointers, and the *4* is a padding that will be inserted on 64-bit systems to keep the last pointer aligned on an 8-byte. spk121: Or the last two might be 8 *4*. daviid: spk121: given the def i receive, is there any chance to write a robust algo to do this in scheme? daviid: i'm going to enhance so it lists the size and the alignment as well, s we can check those on the fly ... daviid: spk121: thanks a lot for your help spk121: daviid: no prob. good luck daviid: i'll get hose binded i 10min or so ... daviid: be right back daviid: is gsize site_t in guile? daviid: spk121: here is what i get http://paste.debian.net/1099601/ jcowan: I use emacs from the command line to justify Lispy code, even though I don't edit with it. daviid: have to leave, the place i'm is closing ... bbl tx again civodul: Hello Guilers! weinholt: good morning rain1: hi :) lloda: it seems you cannot have a docstring in a macro def, any ideas? civodul: lloda: you can have a docstring in syntax-rules and syntax-case civodul: like this: (define-syntax foo (syntax-rules () "docstring" ...)) civodul: or: (define foo (lambda (x) "docstring" (syntax-case x () ...))) lloda: ooh thx civodul lloda: I was trying in the wrong places heisenberg-25: Anyone has this error? heisenberg-25: GC Warning: Repeated allocation of very large block (appr. size 66064384): heisenberg-25: May lead to memory leak and poor performance lloda: heisenberg-25: all the time lloda: I just ignore it heisenberg-25: lloda: so would it cause performance degradation like it says? lloda: heisenberg-25: it probably does... if you have a long running program that has this issue, there might be large gc pauses sometimes. You may want to change your program to allocate once and then reuse or something. lloda: I guess you'd need to profile lloda: when it happens to me it's because I really need to allocate 10 big arrays, so there's no way around it lloda: 10 or however many lloda: if you search guile-user or guile-devel, there may be more info about this. I think it's come up a few times lloda: there are some environment variables that you can use to control the GC, should be in the manual dsmith-work: {appropriate time} Greetings, Guilers civodul: heya, dsmith-work! wingo: weinholt: anything other than else and => ? wingo: as far as aux keywords go i mean wingo: maybe i should define _ as well wingo: ... also wingo: as the r6rs says jcowan: You should bind all of (else => unquote unquote-splicing _ ...) wingo: tx wingo: i think unquote and unquote-splicing are already done wingo: was just else => _ ... wingo: hum, _ versus gettext :P jcowan: yes, I always thought _ was unschemely wingo: hehe jcowan: spell out the syntax keyword, dammit. wingo: civodul: so some macros (e.g. syntax-case) will use _ as an aux keyword. currently in guile, _ is not bound so those macros succeed as long as _ is not defined in the module. do you run into this problem when you use gettext wingo: i like using _ but yeah a bit of a mess wingo: also i wonder what racket does civodul: wingo: we had problems when switching to 2.2 because we were using _ for gettext civodul: so we renamed _ to G_ :-) civodul: (in Guix) wingo: :) civodul: the status of literals is a bit weird wingo: and xgettext or whatever is happy to do G_ wingo: ok. civodul: yeah, you can use whatever you want civodul: i don't think you need to bind _, though wingo: i was thinking, what if we did (define (_ . args) (error "bad usage of _")) ; and then programs wanting gettext would (set! _ gettext) civodul: _ is not like 'else', for instance wingo: civodul: so -- r6rs and r7rs specify that _ is bound civodul: oh wingo: yeah civodul: r6 even? wingo: yeah wingo: because syntax-case wingo: syntax-rules also civodul: but syntax-{rules,case} don't do anything special with _, do they? civodul: one could just as well write "foobar" wingo: of course they do! (define-syntax-rule (foo _ _) 42) wingo: that's different than (define-syntax-rule (foo a a) 42) wingo: latter is an error i think wingo: _ is used in `match' as well as an aux kw wingo: not r6rs tho civodul: ah true! wingo: anyway the same arguments that apply to 'else' apply to '_' civodul: i see now civodul: well, let it be bound wingo: and i'm sure like me you've been tripped up from time to time by (lambda (_) .... (match x (_ . ) ...)) civodul: yep, but i wasn't surprised :-) wingo: er, not quite syntactically correct, but you see the point (in the match _ is not recognized as a kw) civodul: yeah wingo: still not sure whether to make _ a syntactic binding or a "normal" binding. the standards specify syntactic, though currently in guile there is little different from an aux kw perspective wingo: syntactic i guess would be the thing wingo: i bet the manual tells people to (define _ gettext) :P wingo: it does, hehe wingo: civodul: do you think we should switch _ to be bound then? i guess gettext-related issues are already shaken out by 2.2 ? wingo: the whole aux-keywords-are-bound thing is a little weird to me, but it's consistent and macro nerds seem to want it, so i guess we can do that *: wingo a nerd for many things but not a high-culture macrologist civodul: wingo: in 2.2 you already run into troubles if you (define _ gettext) civodul: so in that sense, it seems to be quite safe civodul: we should maybe double-check on a few packages wingo: hehe wow, that was a bit of past incompatibility that i hadn't accounted for wingo: friggin americans wingo: no concept of other languages ;) wingo: well, good. in that case i will update the manual and make _ bound, removing a gratuitous r6/r7 incompatibility enderby: hi, which is "best practice" - using rnrs versions of modules or the srfi version? lispmacs: does guile have something like type-based procedure dispatch? lispmacs: wait, that is goops functionality, I think I remember now lispmacs: been a while daviid: str1ngs: will look into the (make ) you reproted asap, tx str1ngs: daviid: thank you nly: hi roptat nly: i've been learning a lot from guile-torrent nly: can i write the 'pieces' bytevector in a meaningful format? nly: such as a base16 string ft: nly: There is the (rnrs bytevectors) module, that contains all sorts of deserialisation functions like bytevector-u16-ref and utf16->string. ft: See API Reference → Data Types → Bytevectors in the manual. nly: thanks apteryx: hello; is there a set of libraries for parsing sexp already? I'm interested in writing some indentation code. apteryx: I need to know the level of parens, the scope of the encapsulating sexp, stuff like this. apteryx: (that question is a bit naive -- there has to be a sexp parser available, given that I can run scheme code, but I'm not sure if it's made available to the users through some neat interface) weinholt: apteryx, i'm sure there are other options, but here's mine: https://github.com/weinholt/laesare/ weinholt: it lacks much of guile's supported syntax though apteryx: weinholt: hey, thanks; it might be a good inspiration to define the very restricted set of things I need for my very limited use case. roptat: nly thanks, the project is a bit on hold for now though ^^ heisenberg-25: rain1: is #akku active? I asked there and didn't see any response weinholt: heisenberg-25, you just didn't hang around long enough :) chrislck: trying to create function which caches results. eg. (fib n) I wish to create (define fib (make-cached-function (lambda (n) ...))) whereby make-cached-function takes care of bookkeeping the hash-table. anyone done one before? nly: in guix there's a (guix memoization) module nly: 228 lines nly: i don't know much else about it, but i've used it before chrislck: Ok this works. http://paste.debian.net/1099511/ watch CPU spike when running (fib 30000) spk121: hello guilers. What is the best way to draw a plot in Guile. For my GUI project, I'm going to make a plot of memory usage as a function of time. mwette: GUI project w/ what package? spk121: We've been working on a GTK wrapper called guile-gi. And with that, I'm trying to write a graphical debugger for Guile called yvdebug. mwette: I googled and got gtkmm-plplot, but that is apparently far from gtk3 friendly mwette: cool -- been waiting for guile debugging support str1ngs: spk121: I would use cairo, should work with guile-gi spk121: i know someone make an SVG library at some point. It wouldn't be too hard to make my own plots in SVG, I guess. str1ngs: should work* str1ngs: spk121: I think you want something like gnome-system-monitors resource tab? str1ngs: in terms of plotting mwette: I have done graphics using SVG => Cairo in guile mwette: but I think you want a real-time plot that scrolls, yes? spk121: str1ngs: that's the general idea. There is a guile procedure called `gc-stats` that I want to poll str1ngs: I think cairo would be good for a trivial start str1ngs: I would think cairo has typelibs you can use with guile-gi spk121: cool. I'll start with cairo. I've done some work with it, so it should be ok. str1ngs: I'm curious what gnome-system-monitor uses if it's a custom control. or something that can be reused spk121: str1ngs: that's an interesting idea spk121: wingo: I want to make a gui widget for (gc-stats). Is guile-charting still workable? Do you know of anything better? janneke: spk121: trying to upgrade to guile-gi v0.2.0, how do i change (set-policy window POLICY_AUTOMATIC POLICY_AUTOMATIC)? janneke: i'm looking for symbol->...policy...; previously G_MESSAGES_DEBUG=all would show every symbol, but i cannot seem to find it spk121: janneke: lemme check janneke: hmm, and STATE_NORMAL .. iwbn if i could find the new names myself... :) janneke: (override-background-color ebox STATE_NORMAL bgc) spk121: janneke: i know. It was one of our discussions arguments about 0.2.0. Trying to solve the problem of enum groups, but, the cure may be worse than the disease janneke: spk121: i like the change in general, could be a documentation thing janneke: it's very schemy this way spk121: janneke: the problem is that we've made assumptions about typelibs being right, and they are often wrong janneke: ah, that's less than great spk121: janneke: (set-policy win (symbol->policy-type 'automatic) (symbol->policy-type 'automatic)) janneke: spk121: tnx! civodul: spk121: re plotting, there's guile-charting by wingo spk121: janneke: and the other is (symbol->state-type 'normal) janneke: spk121: thanks! spk121: civodul: cool, I'll check that out mwette: fyi guile-charting is now located at https://gitlab.com/wingo/guile-charting lispmacs: hi, is there a way to run an action upon collection of an object? lispmacs: make-guardian? lispmacs: why are there both procedure properties and object properties? Is there some reason you wouldn't just use object properties for everything, even procedures? wingo: lispmacs: guardians are a good option, yes. also search for finalizers in the manual wingo: the whole property situation is a bit historical. however some procedure properties can be compiled into the procedure itself, like the name, arity, docstring, so there is an implementation difference wingo: my advice would be to ignore them unless you are writing reflective code wingo: what would it take to have an r6rs mode, i wonder wingo: i wonder if language=r6rs is sufficient wingo: i.e. guile --language=r6rs weinholt: i see three areas where guile has a problem with r6rs: (1) .guile.sls is not in %load-extensions by default; (2) some read-enable calls are needed to get r6rs support in read (3) identifiers like else and => and not bound and exported weinholt: --language=r6rs seems like a big hammer wingo: yeah weinholt: point 2 could be fixed if read recognized #!r6rs and saved it on a per-port basis, but i think there was some objection to that wingo: given the global flags needed (the read options) i think an --r6rs command (but not a --language) might be the right thing; would add .sls, .guile.sls, and .sps (?) to the extensions list weinholt: .sps is just programs, i don't think it needs to be in that list wingo: and set the read/print flags, and set up the initial environment so that only "import" and "library" are available wingo: true weinholt: the problem with the global read flags is that r6rs code might want to load some native guile modules wingo: that's fine, modules in guile itself don't depend on a particular read flag afaiu wingo: it would just be third-party modules weinholt: ok wingo: probably we should issue deprecation warnings when the incompatible escapes are used, so we can migrate everybody to one syntax wingo: supporting multiple syntaxes is possible of course but would be nice to avoid it weinholt: makes sense wingo: incompatible == guile's historical syntax wingo: regarding "else", it could be that we should make it bound in guile's definition too wingo: i.e. to avoid incompatibilities between guile's case and r6rs's case wingo: the 3.0 release would be a good time to make that change i think. has an incompatibility risk but maybe it is manageable weinholt: it's nice to be alive to see this change :) wingo: hehe :) wingo: r6rs is 12 years old at this point :) wingo: incidentally i would like to add --r7rs too wingo: would make peoples' lives easier wingo: but, i was hoping someone would get to it before i did :) weinholt: guile can run r7rs code with the help of akku, but it would indeed be nice with native support wingo: yeah it would make sense. we have all the code, we just need the module definitions wingo: i wonder if racket's unparenthesized thing is going to work wingo: i am very happy to follow racket in many things but that is an interesting and speculative change that i am happy to let them experiment with :) wingo: the honu paper is v interesting btw if you haven't read it wingo: https://www.cs.utah.edu/~rafkind/papers/honu-2012.pdf weinholt: here are the module definitions from akku, could be reusable for guile: https://gitlab.com/akkuscm/akku-r7rs/ weinholt: i haven't; will check out it wingo: er, https://www.researchgate.net/profile/Matthew_Flatt/publication/262349592_Honu_Syntactic_Extension_for_Algebraic_Notation_through_Enforestation/links/5464ba3b0cf267ed84f259c3/Honu-Syntactic-Extension-for-Algebraic-Notation-through-Enforestation.pdf rather wingo: ^ that was the one i was thinking of wingo: weinholt: thanks!! wingo: i didn't know about akku weinholt: oh, i see :) wingo: neat :) weinholt: i accounced it in the basement of the internet: comp.lang.scheme (and also planet scheme) wingo: hehe wingo: i am totally out of the loop these days wingo: what guile time i have i spend noodling in the compiler instead of building applications :/ weinholt: it is very appreciated work though weinholt: i'm doing my own r6rs compiler now as well: https://scheme.fail/ and https://gitlab.com/weinholt/loko wingo: i'm glad for that but it is also personally gratifying :) wingo: neat! wingo: did it change names at some point? weinholt: a few times, but i haven't made this particular one public before wingo: ah that looks delightful weinholt: i ripped off your fibers API and based the code on your blog articles :) wingo: i did a little work recently on https://github.com/google/schism recently, which was pretty fun wingo: weinholt: excellent!! wingo: i'm glad it works for you :) weinholt: it does. the plan is to build hardware drivers etc using fibers. i even made an operation that waits for an interrupt wingo: nice! wingo: that sounds really delightful weinholt: :) wingo: i am very much in favor of efforts that make this timeline the one where r6rs won :) heisenberg-25: Does guile support the index operator [] for hash-tables? If not, can I write a custom function to do so? heisenberg-25: Basically, instead of writing (hash-ref (hash-ref (hash-ref (hash-ref scm "aggs") "operations") "terms") "field") it is much readable to write scm["aggs"]["operations"]["terms"]["field"] chrislck: heisenberg: go back to python and never come back again :) (or, interesting question which someone may suggest a define-syntax macro) janneke: heisenberg-25: something like (define (hash-refn table key . rest) ...) should be doable heisenberg-25: chrislck: I am actually trying to write a macro to achieve that. I know my python roots is affecting my scheme programming :) heisenberg-25: janneke: can you please explain a bit/ chrislck: (define (hash-refn table key . rest) chrislck: (let ((val (hash-ref table key))) chrislck: (if (null? rest) chrislck: val chrislck: (apply hash-refn val rest)))) chrislck: (hash-refn scm "aggs" "operations" "terms" "field") str1ngs: daviid: (make ) fails with ERROR: In procedure scm_i_foreign_call: Wrong type argument in position 1 (expecting POINTER_P): #f . GtkTextIter generally is not contructed as a pointer but like so. GtkTextIter iter; then usually passed as a pointer with &iter to receiving functions. I guess I'm not sure how to create a GtkTextIter other then with make. heisenberg-25: chrislck: oKay, this is better version than what I had in mind. Thank you! str1ngs: daviid here's my use case if it helps. http://git.savannah.nongnu.org/cgit/nomad.git/tree/guile/text.c?h=feature-g-golf#n84. note. source is a GtkSourceView which inherits GtkTextView lispmacs: is there a way to undefine a variable? heisenberg-25: lismacs: what do you mean by "undefine"? Also you can set it to #f if you want it to be "null" ft: There's (if #f #f) → # …but it sounds like lispmacs wants to remove something from the set of bound symbols. lispmacs: ft: yes, I was imagining the would be a way to remove a symbol from top level bound symbols lispmacs: which, i think is different from a let binding lispmacs: just something I wanted to do for garbage collection experiments and such like lispmacs: why doesn't this work as expected?: lispmacs: (let ((a (list 20 21 22))) (g a) (set-object-property! a 'cleanup (lambda () (display "AAAARRRgggh!\n")))) lispmacs: scheme@(guile-user)> (define k (g)) lispmacs: scheme@(guile-user)> k lispmacs: $53 = (20 21 22) lispmacs: scheme@(guile-user)> (object-property k 'cleanup) lispmacs: $56 = #f lispmacs: I'm expecting the procedure to still be attached to the object-property lispmacs: `g' being a guardian heisenberg-25: How do I install and import in guile a r6rs library? like this one here https://github.com/weinholt/uuid mwette: Look at the section on modules in the ref manual. You may have to use the module programming API heisenberg-25: I used akku to install the package and did (import (uuid)) in guile shell, but guile can't find the code rain1: try asking #akku lispmacs: just curious, how big is an SCM object? lispmacs: scm_t_bits and SCM variables have at least 32 bits chrislck: lispmacs: found it: (define X 'x) (variable-unset! (module-variable (current-module) 'X)) (defined? 'X) -> #f lispmacs: chrislck: thanks, worked for me also lispmacs: I'm still trying to figure out why my object properties are not preserved when the object is pulled out of a guardian lispmacs: been reading through the manual -- seems like they should be, but I'm not sure I fully understand weak references lispmacs: (let ((x (list 1 'a 3 'b 102934342342342342342))) (set-object-property! x 'color 'white) (g x)) lispmacs: (gc) lispmacs: (define w (g)) lispmacs: w lispmacs: $18 = (1 a 3 b 102934342342342342342) lispmacs: (object-properties w) lispmacs: $19 = () lispmacs: properties seem to disappear when the list goes out of scope in the original let expression lispmacs: well, I guess I don't have to use properties, but am curious what I am misunderstanding lispmacs: using guile-2.2.3 janneke: what is `g'? lispmacs: (define g (make-guardian)) jcowan: Most objects have either no references (numbers, strings, symbols) to other objects, or else they have strong reference (pairs, vectors, records). An object can be garbage collected if there are no strong references to it, because there's no way of getting to it. jcowan: Some objects (weak boxes, weak pairs, weak hash tables) hold weak references. These work exactly like strong references except that they do not prevent the referred-to object from being garbage collected. So a list made of weak pairs can be used to keep track of all objects used for a certain purpose, but if any of those objects become garbage, you'll no longer be able to get at them from the weak list. If you used a jcowan: strong list, they couldn't become garbage. jcowan: lispmacs: ^^ lispmacs: jcowan: okay, thanks for the great explanation. I'm still not quite clear on why object properties disappear when the object is returned from the guardian. I would think that the reference to the object from the guardian would be enough to keep the object properties around also, even though they are implemented with a weak key hash table. But maybe the guardian uses some kind of special reference...? jcowan: What do you mean by "object properties"? lispmacs: jcowan: like, (define a (list 1 2 3)) (set-object-property! a 'color 'blue) lispmacs: (object-property a 'color) lispmacs: evaluates to 'blue lispmacs: section 6.11.2 jcowan: Oh. Because the association between an object and its property list is weak, as it must be: you don't want the object -> plist association to hold a strong pointer to the object. cmaloney: 3a jcowan: The point of a guardian is to give an object containing weak references to purge them when the weak references break. In a weak hash table, it's not enough that the value is held weakly by the association; you want the whole association to be removed from the hash table when the key is garbage. jcowan: s/give/allow jcowan: the hash table can poll the guardian: Anything to remove now? daviid: heya daviid: str1ngs: the gtk-container-get-children you posted the other day is an example of use for glist returned value ... daviid: str1ngs: but yes, if you come to face another use then those gobject subclass instances glist(s), please post ... and i'll work on it, as i said, 'on demand' ... str1ngs: daviid: right I know for sure I use GList there. have not look at that portion of code yet. will look at it tomorrow. hopefully str1ngs: daviid: I can confirm notebook append is working now when passing #f daviid: ok tx lispmacs: hi, is there some trick for running an action when an object is garbage-collected? E.g., say you need to close a port that has been hanging out in a procedure's closure, and the procedure object is collected lispmacs: i remember doing something like this in Racket, I think it required using a special object definition form or something like that spk121: lispmacs: try (add-hook! after-gc-hook (lambda () ....)) spk121: but that doesn't exactly solve your problem. it just runs a procedure after a GC happens lloda: ft: I use this https://github.com/lloda/guile-ffi-fftw lloda: it's the bare minimum, just what I needed ft: lloda: Cheers! :) apteryx: how do I get a count of the number of occurences of a substring? apteryx: Python has `findall', IIRC. apteryx: What's the equivalent in Guile? civodul: apteryx: you could to regex-exec + fold-matches, but that's not quite the same civodul: i don't know of anything equivalent i guess apteryx: civodul:thanks, will try that apteryx: another question: suppose I have a string like ""listen on 127.0.0.1\n listen on ::1\n [...]", shouldn't (string-match ^listen on 127.0.0.1$" that-string) return a match object? (it returns #f) apteryx: ah, in the source string there's no carret (^) at the beginning apteryx: oh, I guess I need to make my regexp with (make-regexp patt regexp/newline) apteryx: civodul:the fold-matches documentation has an example to count matches :-) civodul: apteryx: heh, not that bad :-) apteryx: indeed :-) dsmith-work: Happy Friday, Guilers!! dsmith-work: sneek: botsnack sneek: :) dsmith-work: Has the bot been behaving itself? nly: yes, sneek is very helpful :) nly: happy friday! wingo: o/ daviid: str1ngs: i pushed a few patches so g-golf now supports glist returned values, when the glist type-tag is 'interface and the interface GI info type tag is 'object - see the commit log for a better explanation daviid: here is a contrete use example http://paste.debian.net/1098884/ daviid: i'll have to enhance this so glist are also possible for 'in 'inout args daviid: then, i'll have to enhance this so it works for other glist data types (int, guint ...) but i will do so 'on demand', that is when we reach a case that shows a need, because most of the time, afaict, glist are used to list gobject subclass instances - it will be easy to fix these other cases 'on demand' anyway heisenberg-25: Is there a json rpc library for guile? civodul: heisenberg-25: i haven't heard about one heisenberg-25: civodul: Yeah, I have looked at the gnu guile libraries list and didn't find one. heisenberg-25: Btw, is it possible to create parameters that are not thread-local? civodul: heisenberg-25: not really; these would essentially be global varaibles, though *: civodul gives up on ZeroMQ/Fibers integration civodul: zmq has its own communication thread(s) by default civodul: it's possible to turn them off, but it looks like you warranty is void when you do that heisenberg-25: Okay heisenberg-25: How do you define a custom equality function for rnrs records? spk121: Ooh. I made guile run in a VteTerminal widget. Fun. civodul: hey spk121, neat str1ngs: sneek: later tell dadiid, I'll find some thing that uses GList and port it. I think all more use cases right now gobject lists as you mentioned. sneek: Got it. str1ngs: sneek: later tell. nly thanks for looking at that generic method issue. That explains why it's not working. I'll define them in a single file see if that resolves it. str1ngs: sneek: later tell nly. thanks for looking at that generic method issue. That explains why it's not working. I'll define them in a single file see if that resolves it sneek: Got it. ft: Apparently there used to be guile bindings for GNU GSL (GNU Scientific Library), as http://community.schemewiki.org/?gee-guile-gsl suggests. The links seem dead though. Has one of you hooked into that library with modern Guile? jcowan: Why would people prefer it to good old Netlib and friends? ft: Oh, I don't really have a preference. I'm just looking to perform fourier transforms on data I got in a Guile program. And that was something that came up. :) ft: I realise I should have maybe asked my real question. ;) jcowan: Always a good idea ft: Any implementation of said transform that you know of that guile will be happy with? :) mwette: how about from https://www.scheme.com/tspl4/examples.html#./examples:h9 which has https://paste.debian.net/1099036/ ft: mwette: Thanks! That seems to be the cooley tukey variant. I'll give it a shot. :) daviid: str1ngs: yes, though you're not supposed to use it ... and the 'machinery' is in , from which inherit ... see (g-golf hl-api gobject) and (g-golf hl-api gtype) if you are interested str1ngs: daviid : good to know. thank you. I'm almost done porting all my SCM pointer's so I shouldn't need 'g-inst much longer str1ngs: GNUtoo: you can use class-of procedure from oop goops . to figure what a variable is type of it's good for debugging. just an FYI GNUtoo: oh nice, thanks str1ngs: I hope that made sense, I kinda messed up that last sentence lol daviid: str1ngs: ok, not sure how much time i will take for signals and gclosures, so no ruch ... str1ngs: daviid: I'm okay with signals for now. I understand that's not going to be an easy feature either. daviid: str1ngs: once i have gclosures, signals are 'easy', so to speak str1ngs: right, and there is the threading aspect. daviid: *once g-golf has ... str1ngs: be intresting to see how you do that. daviid: yes, like guile-gnome and any other bindings, g-idle-add* str1ngs: I'm assuming that we could pass a procedure with connect? daviid: *binding g-iddle-*, that is easy, but they also need gclosures str1ngs: right, some signals need that. I don't use them often my self daviid: str1ngs: yes og course, that is the objective str1ngs: if at all. my signals are pretty standard. but I can see some complicated cases. daviid: every signal will accept lambda (or proc) that acept th appropriate number of args ... str1ngs: I almost said lambda earlier. that seems to make the most sense. str1ngs: also this might be an edge case. https://developer.gnome.org/gtk3/stable/GtkNotebook.html#gtk-notebook-append-page when passing NULL. gtk will create the label for the tab. but when I pass #f like so (gtk-notebook-append-page notebook widget #f) seems to work str1ngs: to not work* str1ngs: I can work around it by passing a but I thought maybe either was passing the wrong argument in the form of #f. or this is just not supported yet daviid: str1ngs: are you in C for this 'queston', because NULL is alloed str1ngs: no I C I would use NULL, but for scheme I thought NULL was #f? daviid: in g-golf, #f is 'transformed' to %null-pointer str1ngs: okay, I will test this more. and come back with a simple example. daviid: maybe another bug :), could you paste a sneipset about htis? daviid: *snipset str1ngs: will do, I think I can replicate this quickly now daviid: str1ngs: foe example, this works fine when calling (gtk-init #f #f) (in this case the warning are nt due to these null pointers, but arrays, which i have to investigate ,... str1ngs: okay, will have a paste here shortly for you daviid: tx str1ngs: code http://paste.debian.net/1098678 error is (scm-error goops-error #f "No applicable method for ~S in call ~S" (#< !g-inst (270)> (!g-inst #f)) #) str1ngs: if I use (make #:lable "label") instead of #f it works okay. str1ngs: my first guess is this is an edge case str1ngs: #:label * daviid: will look at it asap str1ngs: no biggy, this is more a FYI. since it's trivial for me to work around daviid: this is extremely important for g-golf, thanks for the report and snpset str1ngs: I can just do (gtk-notebook-set-tab-label-text notebook widget page) which will set the label what I need after the fact. str1ngs: I agree, it's why I mention them :) daviid: str1ngs: i pushed a fix, tx again for the report str1ngs: daviid: no problem with test it out str1ngs: will* daviid: str1ngs: other missing bits are glist (and gslist, ghash), for example clutter-actor-get-children would fail in the current 'state of things', will work on this to ... str1ngs: daviid glist could be an issue for me as well. Since I use gtk_container_get_children which is probably on par with the clutter actor method. daviid: yes, i'll try to fix it asap str1ngs: no worries spk121: hmm. my first bug fix to guile-ncurses in two years. So many neglected projects need fixing... eiro: a/join #obs eiro: oops sorry apteryx: is the jargon "tuples" correct to denote lists of two elements or more in Scheme/Lisp? daviid: apteryx: i would it denotes a list of lists daviid: or a list of something, coud be records as well, anyway, it comes fro sql daviid: and 'something' is not necessary binary daviid: it could be any n-items in each tuple daviid: including 0 (zero), 1, 2 or more, is what I wanted to say jcowan: In statically typed languages, lists have all elements with the same type whereas tuples have a potentially different type for each element. In Lisp it makes no difference. jcowan: It's also typical for lists to be variable-length and tuples fixed-length. rlb: Let's say I need to get the actual binary argv values. It doesn't look like guile has a function for that right now, but I was trying to recall if I'd seen any coordinated plans on that front -- i.e. when you need binary args, env vars, paths, users, groups, etc. (some way to handle POSIX apis that really just return "char *"). For some of them, perhaps I can change the locale temporarily if that's safe, but perhaps not for argv? rlb: I can of course just handle it via C, but if I do end up needing to do a lot of that, I figured it might be worth trying to do something that could help guile proper, if we knew what something we might want. rlb: I thought I vaguely recalled some discussion a while back, but wasn't sure. rlb: Oh, and does guile already have some fast bytes<->hex-string converters? I wrote a couple, but imagined I might have overlooked a srfi or something. wingo: rlb: iirc we don't have a good solution yet. there has been a fair amount of discussion but you'll have to dig through the archives :/ lloda: is (let-syntax ((%macro (syntax-rules () ((_ a) a)))) (define (fun a) (%macro a))) an ok thing to do? re: fun being a top level or module level def wingo: lloda: fun is a top-level/module-level def in that case wingo: let-syntax does not create a lexical contour, at least at the top level lloda: wingo: ok, thanks lloda: (let-syntax ... (define f (case-lambda ...))) works fine, but (let-syntax ... (define-inlinable-case f (case-lambda ...))) throws psyntax errors, so I think my define-inlinable-case is borked lloda: This one fwiw https://notabug.org/lloda/guile-newra/src/master/mod/newra/base.scm#L98 lloda: oh the error is reference to identifier outside its scope for the macro introduced in let-syntax lloda: that sounds familiar g_bor: Hello gentle people! g_bor: It seems like that guile error reporting in srfi-19 is not quite right. g_bor: if string->date is given an empty string as first parameter, then it reports a bad-date-format-string. g_bor: It might well be that I misunderstand the intention of the error, but I believe that something like the input does not match the template should be reported. g_bor: The error text suggested to me to look for an error in the template... g_bor: Wdyt? civodul: g_bor: i guess string->date should accept the empty string, indeed civodul: we could also check what srfi-19 says, but i don't see why it wouldn't be allowed z0d: any recommendations for libraries to convert s-exps to HTML? something like html-writing, https://www.neilvandyke.org/racket/html-writing/ lloda: z0d: I've used this for kml https://www.gnu.org/software/guile/manual/html_node/SXML.html#SXML lloda: it's include with Guile lloda: included z0d: thanks jcowan: g_bor, civodul: What kind of sense does "" make as a date? Is it today, tomorrow, or the Unix epoch? An exception must be thrown; the only question is which exception, and SRFI 19 gives no guidance here, as it predates any stanardization of exceptions. g_bor: jcowan: yes, I agree with that. civodul: jcowan: oh, i think i was confused: i thought we were talking about the template of date->string, but no, we're really talking about string->date civodul: so yeah, you're prolly right g_bor: The only thing is that I feel that an exception referring to the input, not to the template should be thrown. g_bor: I think that the error message is misleading this way. jcowan: It's often hard to know which one is at fault: if you are trying to match "Monday" against "~a", it will match the "Mon" and not know what to do with the "day", but perhaps you meant "~A" after all. roelj: Is there a predicate to detect an alist item: (A . B)? Something like 'pair?'? jcowan: (lambda (x) (and (pair? x) (not (null? (cdr x))))) roelj: jcowan: Thanks, but inputting '(A B) returns #t. jcowan: Oh, if you want to match that, pair? is indeed your only option. roelj: But why is (pair? '(A B)) => #t? civodul: roelj: the tragedy of Scheme IMO is that there's no disjoint type for "proper list" civodul: hence all this weirdness, the O(N) 'list?' predicate, etc. civodul: maybe we should change that in Guile 5 roelj: heh roelj: Well, it's fun at times.. :) roelj: Can't wait for Guile 5 though.. ;) civodul: "can't wait" is ambiguous actually civodul: could mean you're impatient or that you literally cannot wait civodul: we'll let the ambiguity float around roelj: Or just that one is looking forward to it rlb: wingo: thanks - I'll poke around later. str1ngs: daviid: in g-golf all classes have a base class of and a slot 'g-inst? rlb: I was also thinking about mwette's mmap proposal a while back to add an mmap interface, and in particular the use of GC_exclude_static_roots to mark the mapped region to avoid scanning. I ended up wondering if that was actually necessary on most platforms (just from some hints in the libgc docs), and if it could also be a problem, since I didn't see any way to unmark a region, say after you munmap it... civodul: rlb: i think libgc looks at /proc/self/maps to determine the set of current mappings civodul: so if you munmap a page, it just won't scan it anymore rlb: But if you've marked that range as unscannable, and then you munmap it and it's reused my malloc later? civodul: hmm, good question civodul: yeah, dunno rlb: i.e. then it should be scanned, but won't, unless libgc knows how to notice that. civodul: though note that malloc areas are not scanned by default civodul: only GC_malloc areas are rlb: OK, well I really meant "malloc" in the general sense, i.e. if libgc grabs that region again, since it may use mmap to get memory? rlb: I think it can be configured that way, and may do that by default on some platforms, but not sure. rlb: But there was a change note talking about issues on irix that made it sound like maybe on most platforms libgc already ignores malloced regions (which is what you were saying?), and if so, then there you could avoid the problem by just not making the GC_exclude_static_roots call in the first place (if there's even a problem in first place). rlb: Anyway -- just wondering -- I'll investigate if/when it's relevant to the things I'm working on. civodul: wingo: BTW, shouldn't we add 'guile-3' and 'guile-3.0' to %cond-expand-features? heisenberg-25: Hi, is there any sample code or library that I can use for producer-consumer threads in guile? nly: hi heisenberg-25 nly: a sample generator https://git.savannah.nongnu.org/cgit/emacsy.git/tree/emacsy/circular.scm?h=new-mru#n94 GNUtoo: hi, GNUtoo: (define %vm-domain-name "ftp.replicant.cyberdimension.org") GNUtoo: (string-append "/etc/" %vm-domain-name "/config") GNUtoo: what is the type of %vm-domain-name? strings? GNUtoo: *string GNUtoo: when I copy that in a file and run guile ./file and (write (string-append "/etc/" %vm-domain-name "/config")) it does what I expect GNUtoo: it prints it GNUtoo: but in GuiX I get that: GNUtoo: ERROR: In procedure string-join: GNUtoo: procedure string-append: Wrong type (expecting string): %vm-domain-name GNUtoo: is it a GuiX specific issue? civodul: hi GNUtoo! GNUtoo: hi GNUtoo: ah the issue seem to be in some other part of the configuration civodul: GNUtoo: it looks as if you wrote: (string-append "/etc" '%vm-domain-name) civodul: note the ' (quote) civodul: Scheme has strings and symbols civodul: symbols are sorta like strings, but immutable, and without double quotes around them GNUtoo: ah it's ' not ` GNUtoo: I've been looking everywhere in the manual for what is ` civodul: right, but if you want to refer to the variable, you need to remove that quote GNUtoo: what does ' or ` do? GNUtoo: it eval what's inside the parenthesis? GNUtoo: is it like (eval %vm-domain-name) ? civodul: see "quote" and "quasiquote" at https://www.gnu.org/software/guile/manual/html_node/Expression-Syntax.html#Expression-Syntax GNUtoo: Thanks a lot! civodul: you can try things out at the REPL (read-eval-print loop) civodul: just run "guile" civodul: and then try: (define x 42) civodul: 'x civodul: x GNUtoo: I just tried that and I now understand that Tirifto: Hello! Anyone accustomed to editing Skribilo documents in Emacs here? str1ngs: daviid: no goop slots. I'm just using the NomadWebView to initialize signals and some struct members. maybe it's an issue with my typelib. I'll try to see if I can replicate without using the GObject inheritance daviid: if you debian paste a ,backtrace #:full? #t, i could look at it and see if it gives me some ideas of possible causes str1ngs: daviid: will do, just been a little busy I'll have something later today or tomorrow. daviid: str1ngs: it's ok, but it will only take a min to paste a full trace ... up to you rlb: Looks like this is failing again (on amd64 at least) -- just happened while building/testing for the 2.2.6 debs: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31776 rlb: I'll likely mark it as unresolved again. str1ngs: daviid: your intuition was right. If a goops class that inherits a gobject class has a slot it will cause this error. I'll paste my simple case daviid: right, i'm working on this now ... daviid: but please paste str1ngs: http://paste.debian.net/1098348 failing code. full backtrace http://paste.debian.net/1098349 str1ngs: daviid: ^ daviid: ok tx str1ngs: no problem, I apologize for just being able to report this now str1ngs: and I realized I'm using goops slots here due to the inheritance. so you were right to begin with daviid: it's ok, i did suspect and was already working on this problem, will fix asap daviid: str1ngs: i pushed a fix daviid: str1ngs: a series of fixes actually, make sure you pull and have this commit 04be8f13cd6369f58103f647ab2075bbb39b044b on your local clone before you try again ... rlb: guile-2.2 2.2.6+1-1 uploaded: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid wingo: o/ lloda: hello wingo lloda: how do I write a fender that a thing in macro args is a literal string lloda: like identifier? #'x lloda: string? #'x doesn't work lloda: I have this for define-inlinable + case-lambda lloda: https://paste.debian.net/1098382/ lloda: but the parts commented out don't work lloda: they work in the repl, but I get tree-il errors if I try it in a module lloda: I also use in a bunch of places (define x (let-syntax ... (case-lambda ...))) which I guess won't work with this macro :-( wingo: lloda: (string? (syntax->datum #'x)) wingo: not sure if that answers the question tho lloda: ouch lloda: yeah it does lloda: thank you wingo wingo: i think (define-syntax x (let-syntax ... (inlinable-case-lambda ...))) should work fine fwiw civodul: howdy! lloda: wingo: that works I guess, but not if x needs to be a function depending on context. Or I don't understand. wingo: lloda: yeah i guess that sounds about right wingo: incidentally, i had OK luck making "folder" macros wingo: i.e. instead (or in addition to...) of trying to inline some kind of fold function, wingo: instead do (define-syntax-rule (foo-folder f) (case-lambda (() nullary-body...) ((x) unary-body...) (args generic-body...))) wingo: so you invoke via ((foo-folder +) x) wingo: or you can (define-inlinable (foo-fold f arg ...) ((foo-folder f) arg ...)) g_bor: Hello gentle people! civodul: hey hey! g_bor: I am glad to announce that I've uploaded the first prototype of guile-kmp, a pure-guile implementation of the kmp string-search algorithm to https://gitlab.com/g_bor/guile-kmp. g_bor: This is a first prototype, and comments are very welcome. g_bor: civodul: hello! civodul: g_bor: nice! wingo: neat! g_bor: :) thanks! civodul: looks cool g_bor: I've seen the comment in the source file of string-contains-ci :) civodul: it could be useful to write the scanner of the Guix GC civodul: heh :-) g_bor: yes, that might be cool. g_bor: How does it work right now? civodul: it's written in C++ right now :-) civodul: but there's the 'guile-daemon' branch, which reepca has been contributing to lloda: wingo: hmm, I'll have to think about it g_bor: Oh, yes. I am aware of that effort. lloda: Actually it bothers me to have to write some stuff twice just to avoid the apply overhead, like in https://notabug.org/lloda/guile-newra/src/master/mod/newra/base.scm#L316 g_bor: Do you know about the status of guile-daemon? g_bor: civodul: Next on my roadmap is netlink :) civodul: g_bor: ah nice, that's be great! civodul: g_bor: re guile-daemon, i'm afraid reepca might be waiting on feedback from me :-/ civodul: basically it +/- allows you to build derivations civodul: but i think the GC isn't there yet civodul: there were architectural issues that we discussed a while back and we got stuck there g_bor: Ok, I see. g_bor: Do you know why recv-from! is so blocking? It's specially noted in the docs. civodul: that had to do with how to disentangle client code of (guix derivations) with lower-level code civodul: but i think that should be easier now civodul: i guess recvfrom is blocking unless your fd is O_NONBLOCK, no? g_bor: Also, would the reconfigure tolerate the blocking, or should I set up some select? g_bor: civodul: that's fine, but the docs notes that all threads are blocked... civodul: hmm? civodul: which docs? civodul: "reconfigure" as in "guix system reconfigure"? g_bor: yes, guix sytem reconfigure civodul: oh civodul: i guess the netlink library should rather be non-blocking g_bor: https://www.gnu.org/software/guile/manual/html_node/Network-Sockets-and-Communication.html g_bor: On a GNU/Linux system recvfrom! is not multi-threading, all threads stop while a recvfrom! call is in progress. An application may need to use select, O_NONBLOCK or MSG_DONTWAIT to avoid this. g_bor: civodul: ok, I also believe that would be better civodul: oh, didn't know that civodul: MSG_DONTWAIT_FOR_TOOLONG_PLZ lloda: where does autoconf look for share/aclocal/guile.m4? lloda: what is the recommended practice re GUILE_PKG? it looks wrong to me that you have to tell autoconf where guile is civodul: you don't have to civodul: 'aclocal' is the thing that looks for guile.m4 civodul: it looks for it in "standard locations" plus ACLOCAL_PATH lloda: so you have to set ACLOCAL_PATH civodul: that depends on your config lloda: this is orthogonal to PKG_CHECK_MODULES([GUILE] ...), right? one or the other? civodul: PKG_CHECK_MODULES is a macro that comes from pkg.m4 (pkg-config) lloda: right, that's not a problem for me because I use the system pkg-config, but I don't use the system Guile lloda: so is GUILE_PKG recommended over PKG_CHECK_MODULES or the other way around? civodul: GUILE_PKG is recommended civodul: it allows you to specify which major version(s) you're looking for lloda: thx civodul roelj: What's the Content-Type for S-expressions when either requesting or serving S-expressions over HTTP? rekado_: text/x-script.guile or text/x-script.scheme perhaps? roelj: rekado_: Well, S-expressions are not Guile or Scheme-specific, right? rekado_: these are the MIME types for Guile or Scheme scripts. rekado_: does the content type matter much at all? roelj: rekado_: Well, I'm building an API that can return JSON, XML or S-expressions. The "Accept" header can be used to specify the format to return. roelj: So I'm looking for what's most used for S-expressions.. *: wingo still very pleased about 10x improvement on mbrot str1ngs: daviid looks good now. thank you Tirifto: Hello! I have a question: Is there a standard format for writing Guile (or, more generally, Scheme) documentation? I'm thinking kinda like there is POD for Perl, which can be used for both code documentation (in between code) and separate manuals, and then exported to PDF or HTML or whatever. Tirifto: (Comments for code and Texinfo for manuals, I guess? :P) wingo: pretty much that :) wingo: there's docstrings too, and module commentaries, but there's not a standard literate-programming thing Tirifto: Also… if I want my Guile Scheme program to communicate with an IRC server, would the way to go be to find a library in C and make Guile talk to that? I haven't ever really done anything similar, so I don't know if there's any recommendation on that. nly: there is an 8sync tutorial with example irc bot: https://www.gnu.org/software/8sync/ str1ngs: lloda: if you don't use the system guile, you can add the local guile.pc directory path to PKG_CONFIG_PATH str1ngs: guile-2.2.pc directory path to be more specific Tirifto: nly: Ah, thanks! Skimming the tutorial, looks like 8sync handles the connection and communication with the server? Neat! nly: :) lloda: str1ngs: thanks, I had done that already. The problem is that autoconf doesn't find guile.m4 where GUILE_PKG is defined, so it's not enough to tell pkg-config, you have to tell autoconf. lloda: maybe autoconf could use pkg-config to find all packages that define autoconf macros or something nly: tirifto, yes. it has a module for irc Tirifto: nly: Perfect! I'll give it a try. :) mwette: I wrote a not-yet-robust emacs minor-mode that will read leading texi-like comments for a procedure def and generate formatted docstring. https://github.com/mwette/guile-contrib/scheme-texidoc.el mwette: it needs more love, but here is an example: https://paste.debian.net/1098415/ str1ngs: lloda: I use AC_CONFIG_MACRO_DIRS([m4] in configure.ac and then autoreconf -i should install m4 file there and look there. but for guile you might need to set ACLOCAL_PATH as for it to install. I personally just copy guile.m4 the m4 directory and add it to version to control. lloda: str1ngs: ACLOCAL_PATH is what I was missing, once I fixed that everything worked. I'd copy guile.m4, but it wasn't my package. lloda: may have helped to mention ACLOCAL_PATH in https://www.gnu.org/software/guile/manual/html_node/Autoconf-Macros.html daviid: lloda: i think, with some work that i don't know when i could find the time yet ..., that i should be able to use newra in guile-cv, and get a pointer to the low level f32 vector(s) when i need to call 'my' C procs, right? lloda: daviid: that would be excellent daviid: but is it feasable, as i think it is? daviid: i mean can i 'impose' on newra that it stricktly work with the loe level data to be f32vectors? lloda: sure, that's not a problem lloda: right now newra is just like Guile's array system, it's all by mutation, it doesn't create arrays lloda: so just as you do (bytevector->pointer (shared-array-root array)) you'd do (bytevector->pointer (ra-root ra)) daviid: lloda: i don't use gule-'s array system daviid: i use f32vectors, just that and always that lloda: I imagined so, but using f32vectors as underlying arrays is also supported by Guile's system lloda: Guile's arrays aren't container types, they are just thin wrappers above bytevectors or vectors or w/e lloda: and it's the same for newra daviid: ok, i cloned it, how do i install it? lloda: you copy the mod/newra folder somewhere in your Guile load path daviid: perfect lloda: map.scm takes a loooong time to compile lloda: minutes daviid: no problem lloda: in fact travis-ci is now failing b/c Guile sits more than 10min compiling and travis-ci thinks it's hanged :p lloda: it's 3-4 min on my computer lloda: I should trim some of that daviid: lloda: buti don't use travis here anyway right? lloda: no, it's just for the badge on notabug/github daviid: ok daviid: it'be nice to autotoolchain it no? spk121: lloda: on travis-ci, there is a 'travis_wait' wrapper script that you can use to tell it to not give up lloda: spk121: thx, I'll look lloda: daviid: it would be nice daviid: ok lloda: I hoped to get to a point where it was just flat out better than Guile's array system so I'd switch for my own progras lloda: programs lloda: it's not there yet, it's faster for some stuff and slower for other stuff lloda: and it's not as fast as writing your loop by hand using f32vector, although I think it can be done daviid: lloda: that is the objecticve lloda: yes daviid: actually i thought it was already as fast as writing my own loop by hand using f32vectors lloda: I have a small benchmark in sandbox.scm where a fold over a 10m element array takes 1.5s on newra and 0.5 to 0.8s using a raw loop with f64vector-ref, depending on how you write it lloda: which considering newra doesn't unbox the + or anything, it's not so bad daviid: ah, that's quite a big factor, for guile-cv i mean, it would have quite a big impact lloda: yes lloda: I don't think you could use to replace something that works right now lloda: I'm a heavy user of Guile arrays which are slower than hand loops and even I am not doing that lloda: one big advantage is it's all Scheme lloda: so you can Ctlr-C anything and it will sto lloda: stop lloda: including printouts etc lloda: I still think truncating is necessary, anyway lloda: anyway I think I'll get there, sooner if I get help, but I'll get there one way or another daviid: lloda: one problem is that guile-cv images are lists, width height n-chan f32-chan-0 ... f32-chan-n-1 and i do't think i want to change that, so maybe i did speak to fast :) lloda: n-chan is color or? lloda: and each f32-chan-i is an f32vector? daviid: i hope guile-3.0 will truncate both repl and raised exception outputs by default, and offer a 'toggle-from/to-full-printing/truncated-printing, using a column (a guile variable, not an ENV var, or not only a guile env var), then we can set the column to -1 (full-printing) or something else ... daviid: n-chan is the number of channels daviid: yes for the later daviid: lloda: http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/idata.scm?h=devel line 277 and below 300 and below for accessors... daviid: lloda: those accessors are for users, i do everything by had in guile-cv code, and most in C daviid: *hand daviid: lloda: here is an example of 'by hand' http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/adds.scm?h=devel line 230 im-rgba-channel->rgb-channel, and c, the first argument, is a channel lloda: daviid: if I was doing that without knowing anything else, then an image would be an array of rank 3 with shape [nchan height widht] and you'd get each channel with (ra-from img i), or all the channels at one point with (ra-from #t x y), and so on lloda: if you need to keep memory order always fixed and the type is always the same, then probably newra or Guile arrays aren't necessary daviid: lloda: yes, i don't thnk they are necessary, and it seems it would be a lot more wotk then i thought to move to newra, but i'll still keep an eye on it :) lloda: the main audience is people who would like to do matlab-ish or numpy-ish or modern fortran-ish things in Guile, interface to C, but be able to handle arrays at a higher level eventually, APL/J style is my goal daviid: lloda: in that same file, the last i pasted the link for, a bit below, you can see the linear algebra 'machinery', which calls C ... just for curiosity ... but contructive critiques welcome of course daviid: lloda: yes, that's why i thought moving to newra, people could do octave-ish (and not using matlab :):)) ... in guile-cv (in guile) lloda: yes, sorry :) daviid: then we can rewrite octave using newra, and guile-cv can use everything people would develop on top of newra ... lloda: haha that seems far fetched daviid: :) rewriting octave usig newra would only take a few years, given a few top notch delvloper :):) lloda: how many of those do you know who'd volunteer :D daviid: lloda: who knows? lloda: well it's true, I don't daviid: lloda: another far reachable goal would be to have newra/guile to use GPU, transparently lloda: but octave wouldn't exist if its language wasn't close to the m-language lloda: daviid: you can do those things in clojure iiuc, so it's mostly glue code, just as it is in numpy lloda: it's a lot of work to have an ecosystem like that, anyway lloda: I want to do one thing first, then think about the next lloda: you know lloda: daviid: which like did you have the C interfacing at? in the link you posted daviid: clojure is not good, kawa is a lot better, but kawa doesn't have much 'traction', just a few 'likers'... so it has a lot fewer libs lloda: which line I mean lloda: yes, the ecosystem is a separate thing daviid: and then it is incompatible with our plbn to 'conuer' the planet using guile and it doesn't have goops either ... lloda: I mean I don't think python is very good, but it's popular and it has everything daviid: line 349 for example daviid: *our plan to conquer :):) lloda: I see, you've written wrappers in C lloda: I think I'd prefer to use the ffi going forward, and call C libraries directly lloda: not have to write anything custom in C lloda: ideally daviid: it is impossible lloda: well lloda: if the thing you want to do in C doesn't exist in C, then sure, you need to write it yourself lloda: but most low level C stuff already exists in one form or another daviid: lloda: you'd find a few linear algebra funcs, but it would like hunderds, thousands of image processong procs, and the list gorws by hunderds every day daviid: *it would miss lloda: but you could write the image library in C and get help from everyone who isn't invested in Guile, and then use it from Guile without writing custom C code just for Guile daviid: vigra only has half of what guile-cv offers, just as an example daviid: tough it has also things i still need to bind daviid: lloda: i use the ffi lloda: I think the ffi could be extended lloda: for example when gfortran gets the ISO compatibility array descriptor, you could call a fortran 2008 function from the ffi passing arrays directly without having to dig inside for the strides & stuff lloda: something like that daviid: http://git.savannah.gnu.org/cgit/guile-cv.git/tree/libguile-cv/libguile-cv.c?h=devel - don't shoot me :):) i'm dong what i can, but wha i have is as fast as imagej, which quite an acheivment daviid: for a single maintainer - imagej has about 5000 developers lloda: daviid: that's better than using libguile.h, right? lloda: it's a cleaner separation daviid: oh yes, i wouldn't want to use libguile.h, that would be terrible daviid: at lest i can switch back ti gile anytime, when our aot gives us f32 proc perfs <= C ... one day ... i know someone is working on it :):) daviid: i beleive my sepration, in guile-cv, is very clean indeed daviid: and the C level does things usualy C folks don't do, like accepting any number of images (in their arg 'list') lloda: C is the ground we have for good or ill lloda: guile-2.2 is so slooooow omg civodul: lloda: been using 2.9 for too long? :-) lloda: I hope all the distros & dependents switch quickly this time lloda: civodul: yeah :-) civodul: heh, good jcowan: Tirifto: Let me look at Art Gleckler's list of which Schemes support which SRFIs. jcowan: Chicken, Guile, Gambit, Kawa, STklos. Not much portability, really. Tirifto: jcowan: Eh, better than '(), I guess! :D jcowan: I once wrote a whole Scheme program with () where I should have used '(), because at that time Chez would accept either. When I ported the code to Chicken, I got lots of complaints, so I replaced () with '() throughout, but of course (lambda '() ...) was a problem too. daviid: str1ngs: just pushed a very important patch, which fixes the construct and construct-only g-properties - I rewrote g-inst-construct so it may use g-object-new-with-properties daviid: so, this now works: (make #:type 'popup) apteryx: is there anything like enums in Guile/Scheme? spk121: apteryx: there is the (rnrs enums) is Guile itself, but, it is pretty limited apteryx: spk121: will check it out, thanks apteryx: looks good! apteryx: how can I recursively concatenate all elements of a list such as: '("iburst" ("version" 2) "debug") -> "iburst version 2 debug" ? chrislck: apteryx: this is flatten, a common scheme-intro task chrislck: in guile it's so tempting to constantly yak-shaving apteryx: There's this thing called context-flatten from PEG apteryx: but it seems designed for a particular use case apteryx: guess I'll shave a yak apteryx: ;-) chrislck: ugh, peg chrislck: https://stackoverflow.com/questions/8387583/writing-flatten-method-in-scheme take your pick chrislck: https://stackoverflow.com/questions/7313563/flatten-a-list-using-only-the-forms-in-the-little-schemer/7324493#7324493 is the most yak-shaved apparently apteryx: neat, thanks! chrislck: now, try rewrite it in 1 named-let :) g_bor: Hello gentle people! g_bor: I might be misunderstanding something, but it seems to me that the count argument of guile srfi-64 test-begin from does not conform to the specification with respect to nested test groups. g_bor: If I understand correctly a nested test group should count as one in the nesting group. chrislck: apteryx: (define (flatten1 . lst) (reverse! (let lp ((e lst) (res '())) (if (pair? e) (fold lp res e) (cons e res))))) apteryx: it's a bit mind binding to have the fold recurse the function where it's called, but I think I get it apteryx: it goes down anything that are lists recursively and cons the items chrislck: apteryx: even more mindboggling is that it already has bug: replace pair? with list? to handle nulls correctly apteryx: the variable names of the SO example don't help as well apteryx: lst becomes x and the result is named lst apteryx: isn't pair? ok to handle '()? It'll just get consed as is chrislck: no: the-little-schemer will teach this chrislck: pair? only returns #t for a non-empty list apteryx: yes; isn't that OK? there's no need to call fold on '() apteryx: or i'm missing something apteryx: ah! If the input is '(), it returns (list '()), which is not expected. This is the bug, right? chrislck: #t apteryx: thanks a lot! apteryx: surprisingly hard apteryx: maybe there should be a flatten in srfi-1 *: chrislck finds writing these algorithms the most rewarding of scheme chrislck: here's a prior work to manipulate nested-association-lists: https://github.com/Gnucash/gnucash/blob/master/gnucash/report/html-chart.scm#L29 chrislck: for cases whereby we want to target and modify a leaf node such as '(education school) in '((age . 25) (education . ((city . london) (school . lse)))) apteryx: interesting! apteryx: I've experimented a bit with (rnrs enums), and I'm not sure I understand how to use the enum predicate it defines, e.g.: (define-enumeration my-enum (a b c) make-my-enum), then testing the predicate: (my-enum a) works, but (my-enum 'a) fails. apteryx: suppose that this enum is to be used in a record, provided by the user. What would they need to enter as input, given that 'a doesn't work, and just a is undefined? apteryx: maybe they need to do (make-my-enum a) ? apteryx: nope... (my-enum (make-my-enum a)) fails apteryx: oh, maybe: (enum-set-member? symbol enum-set) jcowan: apteryx: The trouble is that an enumeration type knows what symbols it has, but a symbol knows nothing about enumeration types: the only property a symbol has is its name. apteryx: jcowan: yes, it seems what I want is a "set" rather than a type, as can be obtained with (make-enumeration '(a b c d) apteryx: ) apteryx: then I can use `enum-set-member? using a symbol on it jcowan: Yes, I forgot that R6RS conflates sets and types. jcowan: The whole thing is IMO badly designed. I have a much better design IMAO, but not an implementation yet. jcowan: It uses unique objects, not symbols, and they have four properties: a name (symbol), an ordinal (0 to n - 1 for an n-element enum type), the type object itself, and an arbitrary value. jcowan: A set is a separate kind of object from a type, basically a bitvector showing which members of the type are in the set. jcowan: details at https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/EnumsCowan.md apteryx: glad to know it might make it into r7rs? :-) apteryx: eh, I'm confused, r7rs appears to have been completed in 2013 ;-) str1ngs: sneek: later tell daviid. That is a nice addition will test this out. Also regards to you mentioning signal's the other day. Signals would be the only thing that blocks me from porting completely to scheme. However it's not a rush right now. Since I connect my signals during GObject initialization, basically in C. So when you get around to signals is when you get around to it. sneek: Okay. rain1: hello nly: hi str1ngs: sneek: later tell daviid. I'm noticing a problem with when constructing with a property. I'm currently getting "Wrong type (expecting ~A): ~S" ("exact integer" #f). I working on creating simple example of fails. Right now the constructor that is failing in non trivial in that it inherits two other classes. But if that error rings a bell let me know. Other wise I'll get back to with a more simplified case that is failing with this error sneek: Got it. wingo: woo finally able to match racket and chez for mbrot benchmark Tirifto: Congrats! :D nly: yay wingo: i think to catch up on "ray" we would need to optimize inexact->exact wingo: and maybe have more global type inference :P dunno wingo: davexunit: just landed a significant improvement for exact->inexact or otherwise converting s64 to f64 civodul: wingo: yay! rain1: how does unboxing work in scheme? like across procedure boundaries daviid: heya sneek: daviid, you have 2 messages. sneek: daviid, str1ngs says: That is a nice addition will test this out. Also regards to you mentioning signal's the other day. Signals would be the only thing that blocks me from porting completely to scheme. However it's not a rush right now. Since I connect my signals during GObject initialization, basically in C. So when you get around to signals is when you get around to it. sneek: daviid, str1ngs says: I'm noticing a problem with when constructing with a property. I'm currently getting "Wrong type (expecting ~A): ~S" ("exact integer" #f). I working on creating simple example of fails. Right now the constructor that is failing in non trivial in that it inherits two other classes. But if that error rings a bell let me know. Other wise I'll get back to with a more simplified case that is failing with this error daviid: wingo: great! wingo: rain1: mostly doesn't -- you need inlining to allow guile to unbox wingo: inlining or contification or similar things daviid: str1ngs: the backtrace should tell you in whch part of the code it fails, but when you have an example i can use to reproduce, let m know str1ngs: daviid: I agree an example will be better. I'll try go put something together today or tomorrow for you. daviid: ok daviid: does it say on which property it fails, and if yes, does it work if you just make a instance of that class and that property? str1ngs: daviid: I thought maybe it was but that seems to be okay. but it could have something to do with the fact I'm inheriting WebKitWebView as NomadWebView which makes this non trivial. So when I have more time, I'll simplify it and see if I can isolate it better. daviid: str1ngs: is this class having 'none g-property' slots? maybe there is missing 'bit' wrt that in my patch nly: has anybody written about moving from a different non-lispy static site generator to haunt? heisenberg-25: anyone has experience with using valgrind with guile? hackyhacker: Hello how can I read a line from stdin with guile? hackyhacker: Is there a port that is stdin? I don't understand nly: if you use the procedure (read-line) nly: then type "something" and hit Return nly: it's available in (ice-9 rdelim) module i think nly: and you can get the stdout and stdin with (current-input-port) (current-output-port) hackyhacker: Ah thanks that works :) Tirifto: Hello all! Tirifto: I'm reading about keywords in the Guile manual, where it says that ‘Guile’s keyword support conforms to R5RS’. However, the only keywords R5RS seems to talk about are syntactic keywords, which is not the same thing, is it? Tirifto: (Guile's keywords seem to name arguments, as in (procedure #:name1 argument1 #:name3 argument3).) mwette: Tirifto: keywords and keyword arguments to procedures are different things mwette: keywords are syntax: (keyword? #:hello) => #t mwette: (symbol? #:hello) => #f Tirifto: mwette: I see—and chapter 6.6.7 of the Guile Reference Manual documents both of them? Tirifto: (For Guile 2.2, if you want to refer to it.) jcowan: Tirifto: The syntax #:keyword is not a valid R[4567]RS identifier, unlike :keyword (CL) and keyword: (DSSSL). So there is no collision. jcowan: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/KeywordSyntax.md shows which Schemes do what keyword syntax(es). rlb: Tirifto: perhaps also related: https://www.gnu.org/software/guile/manual/html_node/SRFI_002d88.html I *think* that may be the only somewhat-agreed-cross-scheme syntax? Tirifto: Aha! So it conforms to R5(+)RS by not colliding, right? spk121: . rlb: Tirifto: I just meant that srfi-88 is (as far as I know) the only "standardized" keyword syntax, and hence might be more likely to be supported now or eventually by any given scheme. rlb: And even that srfi doesn't specify that the keywords have to be self-evaluating. rlb: (though I'd imagine that they probably would be in any given implementation of srfi-88) rlb: ...I've switched to using srfi-88 in some new code so that there's a better chance it might be portable. Tirifto: Ah, alright. Thanks for pointing me to that! rlb: certainly daviid: str1ngs: sure, g-golf still misses important bits, like signals and gclosures daviid: bbl ruffni: i have a question regarding my emacs/geiser setup... anybody here using that? str1ngs: ruffni: many people use emacs/geiser. It's best to just ask your question. ruffni: i can start guile through emacs/geiser and the REPL works as intended. but trying to (geiser-eval-buffer) returns "ERROR: In procedure scm-error: no such language objcode" bandali: hey guilers, anyone using guile-commonmark around? bandali: OrangeShark, oh you’re actually here :D bandali: any plans for supporting commonmark’s “smart” markup? nly: in GOOPS is there any way to get slot-accessor-name? janneke: configure: error: building Guile 2.2.4 but `/gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/bin/guile' has version 2.2.4" janneke: hmm heisenberg-25: Hi, does gdb still work for guile? weinholt: gdb guile scripts don't work with guile 2.2 afaik heisenberg-25: so what are the alternatives for debugging guile code? str1ngs: janneke that's releate to GUILE_PROGS macro in configure.ac IIRC str1ngs: related* str1ngs: janneke: if there is a version used with GUILE_PROGS eg. GUILE_PROGS([2.2.4]) try with just GUILE_PROGS and no arguments. then run autoreconf see if that resolves it manumanumanu: Ahoy hoy! janneke: str1ngs: thanks...but this is the guile cross build ... note that the error message is off janneke: the comparison uses different values than the message str1ngs: ah cross building complicates things. are you using --build ? janneke: str1ngs: yes, i'm using guix. i solved it now i realised that the message was b0rken, someone lied about their version: 2.2.3 vs 2.2.4 str1ngs: I think my suggestion is unrelated though? janneke: str1ngs: about GUILE_PROGS? There is no GUILE_PROGS in guile :) str1ngs: right, I misunderstood the context, apologies :) janneke: str1ngs: np, thanks for helping ! OrangeShark: bandali: what do you mean by "smart" markup? bandali: OrangeShark, converting "straight quotes" to “curly quotes”, -- and --- to – and — (en-dash and em-dash), ... to … (ellipses) bandali: it’s part of the commonmark spec, i believe OrangeShark: I don't recall seeing that in the spec bandali: https://talk.commonmark.org/t/spec-0-18-release/1084 OrangeShark: hmm, seems it was removed in the latest spec bandali: or, oh, is it only in the impl? i’ll dig further. regardless, it’d be nice if guile-commonmark supported this as well bandali: can you point me to where it was removed? bandali: fwiw, i find it a very useful feature bandali: ah, it seems it’s an optional extension: https://github.com/commonmark/commonmark-spec/issues/593 OrangeShark: ah bandali: can guile-commonmark get though, pretty please? :) OrangeShark: sure, I don't think it is that difficult to implement those OrangeShark: can you open a issue for the suggestion? OrangeShark: I still need to update to the latest version of the spec as well bandali: sure will do. i’d have loved to send a patch myself, but alas i don’t know enough guile and/or guile-commonmark to figure out how OrangeShark: looking at cmark, seems it is enabled when you pass in --smart. OrangeShark: bandali: being able to suggest new features, especially something I wasn't aware about in cmark does help :) OrangeShark: thanks for using guile-commonmark bandali: OrangeShark, :) thanks for the awesome library daviid: heya sneek: Welcome back daviid, you have 1 message. sneek: daviid, str1ngs says: I develop using autotool's but we try to keep a guix definition as a snapshot. so g-golf.scm is just there to be helpful for anyone using guix. I asked nly to seperate it encase at one point you wanted to snarf it for guix.scm. daviid: str1ngs: great! daviid: feel free to add a (gnu package g-golf) to guix, please don't name guile-g-golf nly: is there proc to tell if something is an atom/literal? mns: to use guile for scripting, is it possible to use #!/usr/bin/env guile -s and not have it complain about the missing !# ? peeterr: exit nly: janneke: there are some patches on new-mru nly: I started with fixing the mru bug, where the mru index would be out of sync with the buffer queue. nly: Soon, i was converting mru to functional style and then saw what broke and changed the broken piece as well. nly: these are very rough strokes. nly: i don't know when this ends lol nly: will guile accept a list->hook procedure? civodul: Guile is a nice program, we'd need to ask it :-) civodul: what would list->hook do? civodul: a hook is more like a procedure civodul: or a list thereof, that's what you mean? nly: it would compliment hook->list :) civodul: oh yes, that makes sense :-) civodul: i'd say why not! nly: i am decorating the local list->hook atm :) nly: http://nly.info.tm:9001/guile/list-to-hook.scm nly: proc: (list->hook ) nly: well, it needs more work but i'll do it :) and then let's see nly: https://paste.debian.net/1097843/ jcowan: There's now a draft SRFI for (unordered) hooks. I have just suggested list->hook and list->hook! on the SRFI 173 mailing list. nly: ah, nice nly: don't tell me you made it just now :) lloda: wingo: shouldn't disassemble-file take an optional port like disassemble-image and disassemble-program do wingo: sure, why not nly: thanks jcowan, srfi 173 will be nice lloda: wingo: patch is trivial, ok to push? wingo: plz do lloda: done civodul: wingo: in a declarative module compiled with -O2, can a global variable (not a procedure) "disappear"? civodul: i guess there several scenarios: if it's not set! at all in the module, and if it's set! wingo: civodul: in a declarative module compiled at -O2, no global "disappears" wingo: i.e. module-ref, @@, etc are able to access the same set of bindings wingo: at -O3 with the patch from yesterday, definitions that are not exported are not present in the module obarray wingo: in both cases if a variable is set! or otherwise multiply defined, it is not considered a declarative binding, so it still gets the box civodul: wingo: ok, that makes sense civodul: i'm usually quite disciplined, but maybe not always sufficiently for -O3 ;-) wingo: :) wingo: i think -O2 matches pretty well with current guile practice, and -O3 does not wingo: but contrary opinions v welcome daviid: 1+ for autocompilation daviid: str1ngs: nice, more g-golf code in nomad ... str1ngs: daviid slowly but surely. I'm still reasoning how best to port somethings. ruffni: anyone using emacs/geiser for guile? nly: ruffni yes nly: ah, already disconnected nly: str1ngs daviid g-golf is in a seperate file now (easy to snarf), maybe it can help idk :) http://git.savannah.nongnu.org/cgit/nomad.git/tree/guix/gnu/packages/g-golf.scm?h=feature-g-golf daviid: nly: cool - though for now, it really needs a rebuild every now and then ... does this at least grabs the devel branch? also, the test suite needs guile-lib, i didn'tsee it in the list of packages it depends on ... unless i msunderstood something maybe, i don't use guix daviid: nly: because of the former arg above, even if just to sort 'passively' use g-golf, i's recommend to install from the source tree, checkout the devl branch and use the autotool, so yu can pull and make every now and then ... daviid: nly: of xourse it is nice to have this 'pre-package' definition for guix, thanks again, it will become very usefull as soon as g-golf itself is a bit more stable daviid: nly: by 'every now and then ...' i mean several time a day ... nly: daviid it should be a two line change to update ggolf to a new commit version daviid: nly: as you wish of course, you'll have to that several times a day for the next few months nly: daviid in guix there is no concept of pulling from a branch, you need to use the commit nly: example of an update http://git.savannah.nongnu.org/cgit/nomad.git/commit/guix/gnu/packages?h=feature-g-golf&id=147d7d6ed2d9f0f6b4d2fa3efd86e4e1b3711f11 daviid: i know, which is why in active devel mode, i'd rather stick to the autotool chain version nly: there is this little idiom for working without the hash business http://git.savannah.nongnu.org/cgit/nomad.git/tree/guix-local.scm?h=feature-g-golf#n42 nly: nomad-local pkg builds what you have checked out atm daviid: ok, i'm happy if it works fine this way for you nly: :) nly: daviid for tests, guile-lib is in there :) daviid: ah ok, perfect daviid: str1ngs, nly, I'm now going to work on intance initialization, so that passing 'construct-only property values works, which currently fails ... in the mean time, please report any other problem ... daviid: *g-instance initialization str1ngs: sneek: later tell daviid. I develop using autotool's but we try to keep a guix definition as a snapshot. so g-golf.scm is just there to be helpful for anyone using guix. I asked nly to seperate it encase at one point you wanted to snarf it for guix.scm. sneek: Okay. str1ngs: nly: I forget to mention the g-golf definition leaves orphaned files IIRC. might need to remove recursively the copied paths nly: hi wingo: o/ wingo: i have an -O3 patch :-) wingo: allows for contification of private bindings wingo: pushed lloda: wingo: how do you set -O actually wingo: lloda: well, -O3 with guild-compile wingo: otherwise, optimizations-for-level from (system base optimize) wingo: ecraven: sent you some pr's ecraven: wingo: thanks! very sorry I'm a (very much) slow in reacting atm wingo: np :) wingo: i am hoping guile can jump into the top 4 or so lloda: wingo: I was looking for a setting in .guile or maybe a flag. Something that works with autocompilation. It doesn't look like I can set (optimizations-for-level) wingo: you can set %auto-compilation-options wingo: unfortunately no shorthand for -Wall -O3 ecraven: the problem with raising the cpu time limit to 10 minutes is that it takes forever to run the benchmarks :-/ ecraven: some benchmarks on some implementations run into infinite loops, so they take the full 10 minutes for those wingo: ecraven: how many threads do you allow to the benchmarks? wingo: guile will happily use e.g. 8 threads, for marking ecraven: I haven't knowingly limited anything wingo: so in practice the wall-clock time limit might be 2 minutes for guile (e.g.) ecraven: about safe vs. unsafe I'm a bit torn... on the one hand, it's a benchmark, so stuff should run as fast as it can run wingo: or less, considering that the current limit is 5 ecraven: is there a way to set a time limit without impact on the number of threads? wingo: good question! wingo: the thing with the unsafe optimizations is that it's not comparing like to like ecraven: well, in some ways, it is.... how fast does code from this implementation run at *best* ecraven: if an implementation doesn't support unsafe constructs, that's ok.. ecraven: maybe I need to specify more clearly that speed is *not* the most relevant thing in choosing an implementation ecraven: people should definitely *not* just pick the winner of the benchmarks... there are a lot of other metrics to look at when deciding on the best implementation for a given problem wingo: regarding time limits, https://stackoverflow.com/a/3223441 seems like an interesting answer :) wingo: i have found the benchmarks to be useful but that definitely limits utility for me wingo: ecraven: given that the implementations that can do unsafe optimizations generally run fast, perhaps it would be reasonable to run both safe and unsafe variants of chez/gerbil/gambit ecraven: wingo: I'm working on that, I've been trying to move everything into containers, so that I can more easily just run different versions ecraven: but real life is interfering hard at the moment :D wingo: ecraven: fwiw i don't think you necessarily need containers for two different options to a single scheme :) jonsger: ecraven: to run different versions you could use guix :) wingo: but, ack wingo: that doalarm perl hack is really cute ecraven: jonsger: indeed, but I don't run guix on my main machine, so I need some sort of container/vm anyway wingo: it's quite possible to run guix as a user fwiw wingo: without using it as a full os wingo: but, it's probably not the shortest path to victory :) ecraven: the master plan is to move everything into containers, so that I can even run stalin or other systems that are not supported on my current setup ecraven: then I'll add Open Genera to the benchmarks :P wingo: :) wingo: it's probably way past time that guile had its own benchmark suite... lloda: wingo: looks like there should be a way to just say -Ox instead of having to list all the options wingo: probably :) lloda: I have a question about vm assembly and unboxing, but I don't know how to ask it without abusing your time lloda: so let me know if you're ever bored lloda: ;p wingo: lloda: shoot :) lloda: wingo: ok :) lloda: clone https://notabug.org/lloda/guile-newra lloda: then $GUILE -L mod lloda: then (import (newra newra)) lloda: then (define x (ra-copy 'f64 (ra-iota #e1e3))) lloda: then look at ,disassemble (lambda () (ra-fold + 0 x)) lloda: it looks way worse than lloda: eg lloda: (define y (let ((y (make-typed-array 'f64 0 #e1e7))) lloda: (array-index-map! y (lambda (i) i)) lloda: y)) lloda: and then lloda: (let loop ((a 0) (i 0)) (if (= i #e1e7) a (loop (+ a (f64vector-ref y i)) (+ 1 i)))) lloda: which is vanilla guile lloda: but in that, you can see all the unboxed stuff, fadd, etc lloda: I just don't understand the disassembly of (lambda () (ra-fold + 0 x)) wingo: how does (ra-fold + 0 x) know that x is an f64vector? wingo: or an array of f64 values anyway lloda: the f64vector-ref call is inlined lloda: ra-fold calls ra-for-each which looks at the type of ra and inlines the appropriate -ref call lloda: I checked by quoting the macro output lloda: this is in mod/newra/map.scm lloda: %dispatch macro lloda: It's an horror I know wingo: incidentally... i think unboxed arrays are a classic case for run-time compilation, to specialize on element type and array shape wingo: for me if i ,disassembly the lambda, it's just a trampoline call to ra-fold wingo: so nothing is inlined lloda: so the loop isn't there then wingo: right lloda: how can you look at the disassembly of that then wingo: you would need to define ra-fold as (define-inlinable ...) wingo: well first of all there's no backwards branch, right? lloda: I saw there wasn't, yeah lloda: but I couldn't define-inlinable b/c ra-fold uses case-lambda lloda: which I need, because it takes var args lloda: and if I don't fix the arity, I cannot use macros beyond that lloda: I had a look whether define-inlinable could handle case-lambda, but didn't get far wingo: that's what's needed tho. probably would have to be a "custom" version of define-inlinable lloda: I could write 1-arg 2-arg versions etc and look at the disassembly of those lloda: wingo: yes lloda: I'll dig there then lloda: re: run-time compilation, what's the difference with writing a macro? do you have an example maybe lloda: I see that you could compile each case on demand and keep a cache or something lloda: instead of precompiling a big table that takes so long civodul: "ra" reminds me of Guile's old array API :-) lloda: civodul: that's where it comes from :D civodul: heheh civodul: good ol'time ;-) wingo: lloda: yes you could compile on demand only the set of types that you are interested in. also at that point you have access to the value of e.g. the procedure being folded, so you might be able to do more transformative optimizations lloda: wingo: I'll look into it :O lloda: I put this in my .guile lloda: https://paste.debian.net/1097701/ lloda: re: autocompilation wingo: playing with fire :) wingo: it's not a configuration that i regularly test wingo: considering that guile itself is only compiled with -O2 wingo: (and -O1 during bootstrap) civodul: speaking of which, how do you folks like auto-compilation? civodul: poll time :-) ecraven: yay! wingo: :) *: wingo witholds opinion for the time being :) civodul: heheh :-) civodul: (1) love it! (0) no opinion (-1) hate it lloda: 1 lloda: I never compile by hand lloda: I rm cache maybe civodul: ok lloda: wingo: I'll go back to -O2 for regular work wingo: survey results are currently n=1 :) wingo: civodul: you should go ahead and say what you don't like about it :) nly: is there a manual on writing manuals (maybe using guile) ? civodul: wingo: wait, i didn't say i didn't like it! :-) civodul: alright, i don't like it civodul: i feel like i never need it civodul: in a project i write a makefile that runs "guild compile" civodul: and for code snippets, auto-compilation isn't useful to me, and it gets in the way civodul: i have to put GUILE_AUTO_COMPILE=0 here and there, just so i don't see those messages wingo: civodul: otoh i really like that warnings run by default with auto-compilation wingo: very helpful to know ahead-of-time that i forgot to rename something civodul: true civodul: yeah civodul: i think i've occasionally relied on auto-compilation, notably for warnings civodul: but the costs outweigh these occasional benefits for me civodul: because then there are also cache invalidation issues civodul: like when you have an ABI break, you have to know that you "just" need to rm -rf ~/.cache civodul: that's often confusing wingo: nly: there's the texinfo manual, and the stuff matthew butterick does in racket is pretty cool https://practicaltypography.com/ wingo: civodul: yeah i guess I don't have ABI concerns much, the cases in which i find autocompilation helpful don't have a lot of records etc wingo: and the abi concerns are there for most distribution platforms that aren't guix :) wingo: the abi concern is basically record layout, right? wingo: i would be unhappy i think if guile's performance weren't predictable. if you have to fall back to an interpreter that's a definite hazard wingo: with auto-compilation, at least you know users are running things compiled more or less well wingo: without, i think performance problems can be a little hard to troubleshoot wingo: we could do away with the cache but that would be terrible for startup time i think? wingo: guile's compiler isn't optimized for low latencies as you know... nly: thanks wingo chrislck: GUILE_AUTO_COMPILE has caused at least 1 problem with GnuCash on flatpak: https://lists.gnucash.org/pipermail/gnucash-user/2019-August/086589.html chrislck: tagging gjanssens gjanssens: :) gjanssens: We've seen cache invalidation issues in the past with gnucash as well gjanssens: But those were mostly in the transition period where gnucash decided to precompile its scheme sources and users had more recent caches of a previously installed (and autocompiled) gnucash gjanssens: There are still occasional hiccups with autocompiled caches as users can have their own scheme sources loaded in gnucash which we obviously can't precompile chrislck: meanwhile chris exploring #guix occasionally but thinks it's more difficult than syntax-case :) rain1: gnucash invalidation lol *: civodul is back civodul: wingo: yes the abi concern is mostly for records civodul: perhaps we shouldn't have inlined those accessors in the first place, who knows civodul: if auto-compilation didn't exist, we could simply emit a one-line warning, like "no compiled code for x.scm; using the interpreter" civodul: then you know you should run "guild compile x.scm" wingo: that doesn't necessarily solve the abi probs tho, right? wingo: it's certainly possible to have an out-of-date manually-compiled file civodul: no, that doesn't solve the abi problem in the general case civodul: but it sort of draws a line civodul: if you compile, you have to be aware of what an abi is civodul: if you don't, it just works jcowan: Chicken requires you to use the compiler to visit all libraries, but not necessarily to compile them: "csc -J -P" generates *.import.scm files for each library defined in the input, plus syntax checking on the input. These import files must exist to import anything; they can be compiled or not, though it's not really expensive to use source unless your library uses heavy macros. Tirifto: Hello! str1ngs: daviid: the make-instance-argument fix looks good. Also now some tests that previously failed are passing from returning functions. Looks like I can do some more porting to g-golf now. codesections: Hi. I have a quick question about the `guile --listen` command. I am attempting to control the Guile repl externally; according to the docs (https://www.gnu.org/software/guile/manual/html_node/Command_002dline-Options.html) I should be able to start the Guile repl with `guile --listen` and then get a guile prompt through netcat (`nc localhost 371 codesections: 46`) codesections: This works. *However*, if I suspend the Guile repl with ^z, and run it in the background with `bg`, it stays "stopped" and no longer accepts commands through `nc` codesections: So, my question is: is there any way to run Guile as a background process but still accepts commands from the port on which it's listening? codesections: (I assume I must be missing something simple, since that would seem to be the main point of the `--listen` option and seems necessary for, e.g, Emacs integration) nly: append a '&' to the guile command jcowan: If you stop a process, it's not going to be able to respond to the socket or anything else. The trick is to start it in the background. jcowan: ...as nly says, sorry nly: ^ and the explanation, sry i am having dinner nly: jcowan, since you're here, i meant to ask you are you the person who wrote the lojban manual? jcowan: That's me. jcowan: "I am large, I contain multitudes." nly: woah. nice codesections: @nly @jcowan thanks, but that doesn't seem to work. When I run `guile --listen &`, I am given a guile prompt but then immediately told that guile is stopped (the text `[1] stopped guile --listen` is printed to the console) nly: ah yes, i didn't read your question properly, you had already tried that sorry nly: i would just leave a shell open with guile in it? is that an option? codesections: I guess? I was hoping to use a guile server to control my window manger and would kind of hate to leave an extra shell open. Though I guess I could codesections: I still feel like I must be missing something simple, though. Clearly things like Geiser have a way to solve the issue nly: i searched and see commands like 'nohup' 'disown' nly: sorry, i am just guessing atm str1ngs: codesections is your window manager written in guile? codesections: No. I'm really just experimenting at the moment, but I'm using bspwm which is controlled through shell scripts. Since I'd rather code in a scheme, I thought I'd control it through some sort of scheme scripts instead codesections: And I played around with a few options, but then I thought that the start-up time for various scheme interpreters is a bit long for that sort of thing and it would be nice if I could leave one running and listening codesections: and `guile --listen` _seems_ like it'd be perfect for that str1ngs: I guess even if it's not written in guile. it's pretty trivial to create a REPL socket. personally I would use a unix socket for this with coop server. if you snarf this function with poll-server function into a guile script. this should create a unix repl socket. http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/repl.scm#n45 str1ngs: note these functions don't block so you will need to bock at the end of your script. also this is connectable via geiser with geiser-local-connect str1ngs: you could loop with a call to poll-sever and a sleep to handle blocking. and forgo using a thread for poll-server codesections: Interesting, thanks. I guess I was confused about that sort of functionality being built in with `--listen`? str1ngs: actually just using poll-server will block and loop for you str1ngs: I'm not sure what server --listen uses. I would use a coop server personally. guile --listen is really just there to provide a REPL from a command line it's not as flexible as the REPL I linked. codesections: thanks str1ngs: http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/repl.scm#n45 will do what you want. but instead of making a thread at the end just call poll-server as the continuation. and that should do what you need str1ngs: but then you would need to demonize this as well. in which case I advise just starting it in a tmux or screen session. which you can then attach detach from. that's the trivial approach str1ngs: daemonize * str1ngs: also this function deletes the socket file. with no sanity checking which might not be good for you use case. manumanumanu: Ahoy friends! Reading the NEWS section for 2.9.4. Wow! 3.0 is going to be an amazing release wingo: :-) civodul: +1! manumanumanu: civodul: regarding transients: They don't even have to be exported. They would still speed up procedures like vlist-map, where building a new vlist would become a lot faster, because we wouldn't have any intermediate results where we say we don't need it. civodul: manumanumanu: yes, true civodul: although vlist-map is probably not a good example, is it? civodul: i mean in the end you have to allocate all these vectors jcowan: you could say "setsid guile --listen /dev/null &" to disconnect Guile completely from the terminal. manumanumanu: civodul: well this is embarrassing. I have misunderstood VLists. I thought they were in a similar vein to fectors/pvectors. Transients won't do much good at all! And now I understand why they are hard to get thread safe :D manumanumanu: I don't know where I got that idea from. Sorry for bothering you. manumanumanu: That is my good night call! manumanumanu: Good night everyone. str1ngs: sneek: later tell nly. the new mru seems to fix the buffer kill race condition. but now sometimes buffer-enter-hook is not called, after killing a buffer and it switch's to another buffer. sneek: Okay. daviid: str1ngs: i just pushed a patch that fixes the GI typelib bug: incorrect *-new returned value class names, so for example (webkit-web-view-new) -| #< 5648cf58ec20> (and not a instance prior to the patch daviid: and just pushed another patch that enhance the above, in that return-value->scm will now verify a function type-spec only once str1ngs: daviid: a that's a good fix will test this out. lispmacs: hi, what is procedure for starting a new process and connecting to its stdio/stdout? lispmacs: i think I found what I was looking for in Pipes section of the manual g_bor: Hello gentle people! g_bor: Just to answer my question regarding repost handling in guile web server: g_bor: I found out that this is a firefox bug, not a guile bug :) g_bor: It is fixed in firefox62. civodul: g_bor: interesting that it turned out to be a Firefox bug! civodul: usually, you're debugging your own stuff, and you blame everything from gcc to the kernel... civodul: ... just to find out that the bug is obviously in your own code :-) g_bor: civodul: yes, it is. g_bor: When resending post data firefox calculated the wrong content-lenght value. g_bor: I believe that creating this minimal reproducer helped a lot, as it became nearly impossible that the error is in my own code :) g_bor: I just wasn't sure if it is in guile, or in the browser. civodul: heh civodul: were you the first one to report that bug? g_bor: Finally I did a tcpdump to see what's going on, and noticed the wrong content-length. g_bor: No, it was already fixed. It's just both icecat and debian firefox is still too old. g_bor: Here is a link for the report: https://bugzilla.mozilla.org/show_bug.cgi?id=1434553 g_bor: it's been reported two years ago. nly: is there anything in scheme like 'partial' and 'rpartial' from emacs dash library? jlicht: nly: I was wondering the same thing recently, but I just used `Curried Definitions' from (ice-9 curried-definitions) to solve my issue. It might not help you though, sorry! nly: partial is this one, here: https://github.com/magnars/dash.el/blob/master/README.md#-partial-fn-rest-args nly: thanks jlicht nly: it'd be nice if these worked for anonymous functions too g_bor: nly: srfi-26 can also be of iterest... nly: ah, i keep disconnecting nly: g_bor: i use srfi 26 all the time :) nly: jlicht: this partial seems to suffice for now http://nly.info.tm:9001/guile/partial.scm wingo: o/ jlicht: nly: nice! It even works for for nullary functions nly: jlicht: i just updated it, with rpartial :) nly: 0/ civodul: heya wingo! wingo: hi :) jlicht: Using guile-fibers, is there a safe way to do start other processes, while still having some control using e.g. chdir, setgid, setuid? wingo: jlicht: i think maybe? make a dedicated fiber that processes process spawn requests over a channel. then all spawns are serialized through it wingo: so it can set the global state as appropriate before spawning processes wingo: does that work? jlicht: wingo: it does! Combined with some `with- 5614f49614e0> 94648005204544 #t))'. sneek: Got it. str1ngs: sneek: later tell daviid. this happens with other functions as well not just enum. I used this the above example since I hope it covers once like object as well sneek: Will do. daviid: hi guilers! sneek: Welcome back daviid, you have 2 messages. sneek: daviid, str1ngs says: the more accurate return values looks good. though this creates an issue when matching with arguments. here is my test case http://paste.debian.net/1097610. which fails with g-golf/hl-api/function.scm:548:13: In procedure prepare-gi-args-in: Throw to key `match-error' with args `("match" "no matching pattern" (enum webkit-network-proxy-mode #< 5614f49614e0> 94648005204544 #t))'. sneek: daviid, str1ngs says: this happens with other functions as well not just enum. I used this the above example since I hope it covers once like object as well daviid: rekado: tx for the logs again! don't you think it would be better to present the front log page with dates sorted in a lifo mode? daviid: str1ngs: sorry about this, i'll fix this right now, give me a sec daviid: *a few mins :) str1ngs: daviid: no rush. it's just a FYI daviid: str1ngs: i pushed a fix androclus: hey, all.. silly question.. what channel would you recommend less for the guile devs and more for those programming in (and learning to) guile? or does #scheme sort of serve that purpose? androclus: (just getting started here..) bandali: hey androclus, not silly at all :) fwiw, this channel is often kind of quiet bandali: regardless, a number of guile devs/experts hang around here bandali: perhaps like you said you could try other lisp/scheme related channels for general lisp/scheme questions bandali: too bandali: also, you could try asking your questions on the guile-user@ or guile-devel@ lists androclus: okay, thx :-) bandali: no problem :) daviid: though thinking a bit more about this, for praticle purposes, maybe I should provide an unref optional #:recur kw, that would, if #f, performed a 'deep unref' ... daviid: at users own risks - instances that have been unreferenced are unusable, and meant to be gc'ed - any attempt to run any gobject method on thse will raise an exception, as expected daviid: *an unref optional #:recur kw, that would, if #t, performed a 'deep unref' ... apteryx_: isn't the 't' bound variable useless in this example? https://paste.debian.net/1097377/ apteryx_: one could simply write (if e1 e1 (or e2 e3 ...) it seems apteryx_: (the example (and explanation) comes from this book: https://scheme.com/tspl4/further.html#./further:h0) apteryx_: ah, I understand now malaclyps: is Guildhall not an active project any more? Do people tend to build guix packages instead these days? apteryx: actually, nope, still don't understand daviid: malaclyps: for pure scheme code, look at https://akkuscm.org/ daviid: otherwise, yes, guix - from which one of our guiler maintainer suggested, a while ago, to derive a guile package manager, called potluck, based on guix daviid: malaclyps: here is a potluck status related email - https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00649.html apteryx: can let* be implemented with just syntax-rules instead of syntax-case/ apteryx: ? apteryx: I'm struggling to find the solution rain1: apteryx: it can be rain1: what are you trying? nly: janneke: str1ngs: new-mru should work with Nomad, and kill-buffer should be fixed. wingo: o/ rain1: o/ *: civodul builds an upgraded guile-next lloda: \o lloda: wingo: got it, thx for all the work lloda: iiuc there's no need to do anything to take advantage of declarative-modules? lloda: default -O being -O2 wingo: lloda: right lloda: greay lloda: y/t lloda: re: the f64 unboxed ops, I have to say that it looks strange to have all that for f64 alone and not f32 wingo: lloda: guile has always used f64 internally for inexact reals wingo: i.e. flonum has a double wingo: so, this is really just about avoiding the flonum box lloda: oh wingo: the result of an f32vector-ref gets expanded to a double lloda: I see wingo: my understanding is that this is acceptable numerically wingo: do you agree? wingo: obviously there are perf/space considerations, but just from a correctness POV lloda: I am unsure whether you'd get the same exact results as if you didn't extend, bitwise wingo: right lloda: for any reasonable program, I don't see a problem wingo: cool lloda: probably mark_weaver is the person to ask wingo: yeah lloda: I just rebuilt in debian and I had the test for srfi-18 hang lloda: it passed on retry wingo: irritating :P wingo: same thing tho wingo: i think there's one more optimization knob before we do great on the standalone benchmarks like ecraven's wingo: which is to allow letrectification to avoid boxes for functions that aren't exported by their module, and just bind via letrec. it would have to be an optional optimization wingo: because it's just too much against what people expect :) wingo: but as a first thing to add to -O3, it could make sense wingo: otherwise the compiler can't see that it can unbox things in e.g. the mbrot test, and it takes 50x what it should lloda: that sounds excellent lloda: not having to go down to C lloda: which honestly doesn't require C perf, just good enough lloda: declarative modules didn't do anything for my current benchmark :-/ wingo: aw bummer lloda: yeah ;p wingo: i guess you already manually inlined a bunch of stuff lloda: all I could lloda: it takes minutes to compile wingo: yeah. declarative modules mostly allows people to write things more "normall" wingo: *"normally" lloda: maybe I should undo some of the macro mountain lloda: or labyrinth wingo: well, manual inlining is often more effective at this point wingo: given that declarative modules don't allow for contification yet lloda: ok wingo: i think there's more juice to squeeze in f64 stuff. e.g. the compiler doesn't know how to go directly from u64 to f64 and vice versa, whereas sometimes you want that wingo: u64/i64 wingo: welp, back to the work i should be doing :) lloda: cy :-) and thx again for everything *: chrislck happy about (define) being allowed in (let)... don't understand why it's not considered 'correct'... got caught out many times in my early days jcowan: ATM only Racket and Kawa have internal support for float32, and it's going away in Racket. kdtsh: Hi all! Can I ask a simple question about using guile here? lloda: kdtsh: yes, just ask the question g_bor: Hello gentle people! lloda: if no one replies you can try mailing guile-user g_bor: I have a bit of a problem with guile web server. apteryx: rain1: i'm just practicing my syntax-foo with the exercises here: https://scheme.com/tspl4/further.html#./further:h0 g_bor: I am trying to do a multipart/form-data submission. g_bor: All is working well, until I repost the data. apteryx: and one of the examples is implementing let* in terms of let, using syntax-rules (syntax-case hasn't been introduced yet in this book). g_bor: On the repoest I got a backtrace, saying Bad Request-Line: > g_bor: any ide what is going on here? g_bor: s/ide/idea g_bor: I did the repost by refreshing the site in a browser, and clicking yes to resend post data. g_bor: this is on guile 2.2.4 kdtsh: Thanks a lot lloda. I'm trying to use the (web client) module, and have been having trouble figuring out how to use the #:header key when making an HTTP POST. I've tried various combinations of pairs, e.g. "('content-type "application/json")" and "'('content-type ((header-parser 'content-type) "application/json"))", but have gotten errors like "Bad kdtsh: value for header quote: (content-type)", or "Header name not a symbol (quote content-type)". If I want to use a "Content-Type: application/json" header, what should I use for this argument? wingo: apteryx: hint: (define-syntax let* (syntax-rules () ((let* () body ...) (let () body ...)) ((let* ((x y) bindings ...) ))) wingo: er wingo: apteryx: hint: (define-syntax let* (syntax-rules () ((let* () body ...) (let () body ...)) ((let* ((x y) bindings ...) body ...) ))) g_bor: kdtsh: I believe you need something like '((content-type . (application/json))) apteryx: wingo: thanks! I'm looking at your hints :-) wingo: we can tell you more of course but it's nice to figure it out :) apteryx: indeed! I'll be back with the solution... hopefully ;-) apteryx: you need body1 body2 ... though right? because let requires a non-empty body wingo: well, there are two approaches wingo: one is, do the minimal amount of checking and rely on your expansion to "let" to catch any errors wingo: i.e. in that case you could do: wingo: (define-syntax let* (syntax-rules () ((let* () . body) (let () . body)) ((let* (binding . bindings) . body) ))) dsmith-work: Morning Greetings, Guilers wingo: or, you try to make the pattern complete, so that the user gets an error like "bad let*" (which they presumably had in their source) and not "bad let" (which is the result of the macro expansion, having maybe propagated bad code from the input to the output) wingo: sometimes it's actually important to do less checking that you would otherwise do, to prevent n^2 expansion times! wingo: usually not a consideration tho apteryx: I see! thanks again for the detailed explanation :-) g_bor: I have posted some details about this repost failure to this stackoverflow question: https://stackoverflow.com/questions/57658043/how-to-fix-guile-web-server-failure-when-data-is-reposted wingo: g_bor: pretty sure the current output port is overridden during "handler", dunno tho wingo: maybe not g_bor: wingo: do you think this is a guile bug, or is it something else? g_bor: I will also test later if this is still afiling on more recent versions. wingo: g_bor: i don't know tbh. i think nalaginrut would know more wingo: i would check the source code to artanis to see what they do g_bor: ok, I will have a look at that later. g_bor: Thanks anyway. apteryx: wingo: I could figure out one solution, thanks to your hint! (define-syntax my-let* (syntax-rules () ((_ () b1 b2 ...) (let () b1 b2 ...)) ((_ ((x1 v1) (x2 v2) ...) b1 b2 ...) (let ((x1 v1)) (my-let* ((x2 v2) ...) b1 b2 ...))))) apteryx: it recurses down until there's no more bindings to process (base case) wingo: yep :) wingo: guile's version uses syntax-case and explicit recursion, in theory in order to give better errors: https://git.savannah.gnu.org/cgit/guile.git/tree/module/ice-9/psyntax.scm#n3117 wingo: but it doesn't make a huge difference wingo: it also prevents some n^2 expansion time kdtsh: @g_bor that does it - thanks heaps :) g_bor: kdtsh: yw! apteryx: Why do we need to introduce a temporary variable in the definition of 'or'? apteryx: wouldn't the template be just as good with (if e1 e1 (or e2 e3 ...)) vs (let ((t e1)) (if t t (or e2 e3 ...)))? wingo: apteryx: consider, (or (pk 1) (pk 2)) wingo: it should evaluate (pk 1) exactly once wingo: this sort of thing comes up all the time in macros wingo: ie. (if (pk 1) (pk 1) (pk 2)) is not a correct transformation davexunit: wingo: thanks for the 2.9.4 release. apteryx: ah, that makes sense! apteryx: wingo: thanks again davexunit: been extremely offline this weekend so I haven't taken it for a spin yet but I'm excited to try it davexunit: and I can see that ludo beat me to updating the guix package wingo: :) civodul: i'd really like to have the whole stack 3.0-ready when 3.0 comes out davexunit: that would be neat. civodul: we're not far from that, but there's some "administrative" burden civodul: essentially adding "3.0" in all the GUILE_PKG Autoconf macros :-) davexunit: civodul: I'm curious how much of performance boost guix could expect civodul: i can't tell yet, but i'm curious too! civodul: we should define a "guile3.0-guix" package... davexunit: jit has completely changed my life on the graphics rendering side of things civodul: i can imagine davexunit: the things that are possible now... civodul: Guix is a very different workload, there's lots of i/o for instance, so maybe it's less sensitive davexunit: yeah, that's what I'm wondering about davexunit: but there's also a lot of graph traversal davexunit: and I'm curious if the jit can just help with throughput davexunit: and make that stuff a lot faster civodul: yeah civodul: also i wonder how vlists/vhashes perform in 3.0 compared to 2.2 civodul: Guix uses a lot of that, but that's also stressing the GC quite a bit davexunit: if the GC is stressed than jit will have limited benefit davexunit: it will help generate the garbage faster, I guess :) davexunit: I have to make sure all my core number crunching code generates nearly 0 garbage in order to get acceptable results. davexunit: and to allow room for the user program to generate some garbage. davexunit: but with all these flonum optimizations I have unboxed ops in every critical path, I think. manumanumanu: civodul: Do you think implementing transients for vlists would be a good idea? I mean, they are quite a bit simpler than fectors (I have a "packaged" implementation of andy's fectors if you are interested: https://hg.sr.ht/~bjoli/guile-fector), but are slower to build than transient fectors (which are amortized o(1) with pretty low constant factors). That shouldn't really be the case if I read the source manumanumanu: correctly... wingo: davexunit: were the recent sin/cos things any help? wingo: regarding guix it is tricky. a lot of the guix user experience is guile compilation time wingo: and the output of 3.0 bytecode is more voluminous, which could cancel out any speed gains and maybe more wingo: so i too am interested to see. it may need some tweaking before we get it right dsmith-work: sneek: botsnack sneek: :) davexunit: wingo: I haven't yet tried it out. to benchmark it I guess I will use a sprite batch in which every sprite is rotated. that will cause thousands of sin/cos calls per frame and I can test against 2.9.3 and 2.9.4 and see what the max sprites at 60fps are for both. *: wingo found a nice optimizer bug wingo: (office is too hot, can't think about the problems i should be thinking about :P) civodul: manumanumanu: re transients for vlists, i don't know! civodul: i'm not a big fan of that approach civodul: i feel like i could use hash tables for instance in cases where vhashes are too slow civodul: but i'd rather have faster vhashes :-) daviid: wingo: lloda: so, guile 3.0 won't offer unboxed f32 ops then? jcowan: In general, random float32s running around doesn't help anyone and makes type dispatch that much more complicated. What would be a Good Thing is to provide a version of @vector-map (where @ = u8, s8, ..., f32, f64) that notices when its operand is +, say, and substitutes a version that adds the corresponding elements unboxed and puts them into the output vector. daviid: jcowan: not sure what you are talking about when yu say random float32s running around - but i was asking because in the image processing world, most lib works on f32 vectors, like vigra, which guile-cv uses - mainly for perfs/result quality ratio reasons, so they say - and vector-map will get you absoluyely nowhere, we a re talking about hundreds, actually thousands of math algo, based on but not only, linear algebra daviid: in a typical research lab, doing img proc, the average image size is 20 million pixels, and we manipulate stack (3d) of thoushands of those ... daviid: so, until scheme offers C perfs, i am sure it could and hope it will, if we can declare, 'à la CL', (declare (img f32vector) ...) there is no way we can 'fight' other libs 'out there' davexunit: I use f32vectors all the time and do unboxed arithmetic with values from them davexunit: if you look at the bytecode you'll see that it's making f64s out of them, but everything is unboxed and fast. daviid: davexunit: last time i tried, lloda explained these are converted to a scheme float before 'anything' on them ... daviid: so, a typical op in guile-cv is between 50x to 100x faster in C davexunit: I don't really follow, sorry davexunit: all I know is that I use f32vectors all the time and I can do nearly everything without boxing the float values daviid: davexunit: i'm not a compiler expert, what i can say, is that the exact same algo, for example sum of two matrix (represented by f32vectors) is betwen 50x to 100x faster in C then in guile scheme davexunit: that doesn't surprise me davexunit: bytecode vm vs. native compiler davexunit: among other things daviid: sure, so i hope we'll get there ... davexunit: but the original point was about unboxing davexunit: and my point was that values from f32vectors can absolutely be unboxed davexunit: so your code should be a lot faster than it otherwise would have been if you've written it in such a way to take advantage of unboxing daviid: davexunit: last time i spoke to lloda about this, that was a relatively long time ago, 2y or so, he explained to me that f32 were converted to scheme - and maybe i'm wrong, but by unboxed i meant no transformation and ready 'as is' for cpu/gpu processing davexunit: 2y is a long time ago in guile terms davexunit: but I'm not sure what "converted to scheme" means daviid: neither do i davexunit: unboxing means that the value is not wrapped in a new, dynamically allocated scheme object. davexunit: so you can call f32vector-ref and the vm may just stash the float in a register and skip the part where it allocates a scheme object to store the float daviid: iiuc, lloda explained that guile was not doing this, back then, it was indeed allocating a scheme object ... (which is what i meant by 'trnsformation') daviid: davexunit: i kept all algo in scheme, those i wrote in scheme in the first place, so i can try again and see ... but as you said, it is only part of problem daviid: and i have no option but be as fast as imagj and/or opencv daviid: *imagej davexunit: unboxing + jit should close the gap quite a bit. davexunit: but you'll need to inspect bytecode to make sure it's generating the good stuff daviid: i'll try again if i can find some time, then will ask for your/lloda/wingo/mark help, but now, i'm on another huge yak, and wrt guile-cv another part of the yak :) daviid: davexunit: thanks! i'm not very good at 'low level' stuff, so when time comes, i'll always appreciate others help to get to the very details that needs to be worked on ... daviid: on a diff but related subject, i once did think about looking at and possibly partially bind GSL jcowan: The point of treating @vector-map specially is that you can avoid the f32->f64->f32 conversions. daviid: i heard numpy is written in C, if that is correct and if it has a clean, stable, well maintained api, it might be worth a binding as well daviid: *a clean, stable, well maintained C api, numpy is clean ... jcowan: Note that numpy's UFuncs are precisely the sort of polymorphic array operations I've been talking about. jcowan: And yes, numpy has a C API, but it's meant for use in a CPython context; it needs definitions of things like PyObject. lloda: isn't numpy mostly glue? I don't see the point of wrapping the glue when you can wrap the underlying library directly daviid: jcowan: ok. worth mentioning that lloda is working on newra, which you might be interested to look at, if you haven't already, maybe you know this but ... jcowan: I don't know. I just asked on #nmpy, we'll see. lloda: I still haven't looked at jcowan array srfi :-/ jcowan: I don't have one personally. There are a few out there, SRFI 122 and 164. lloda: oh lloda: still lloda: newra is just a replacement of Guile's C by Scheme lloda: well it does more, but not a lot lloda: I think if we wanted to have a cool-modern-powerful array system for Guile and not just something to bind C libraries I'd look at remora or whatever is in racket jcowan: they aren't hugely different from Guile arrays except in detail lloda: yes, the objects to move things around are basically the same everywhere jcowan: The only thing I have personally (in very early draft) is some higher-level procedures like inner and outer product. jcowan: they should be easy to layer over any array package lloda: I had a library called guile-ploy that did outer product by using the rank conjunction lloda: from J lloda: but then I realized that was the same as broadcasting lloda: in a way lloda: so newra has broadcasting lloda: it makes things like outer product trivial lloda: and it's essentially free lloda: in fact argument rank etc. from J translates directly to broadcasting and costs nothing lloda: I think the J doc don't make the point well enough, because they abstract the implementation jcowan: Not sure I follow that (I am not an array maven in any language) lloda: oh lloda: broadcasting is just having some axes where the step is 0 lloda: so they repeat lloda: you use the same loop functions, but on some arguments the indices don't move malaclyps: has anyone looked at Coalton? Is this something that would map easily to Scheme/Guile, or does it depend on deep Common Lisp magic, do you think? https://github.com/stylewarning/coalton *: daviid thought broadcasting, i the array field, was about casting from one type to another lloda: there's an example in newra's readme lloda: daviid: not really daviid: lloda: tx lloda: for example in numpy you can do an outer product of 1-arrays like a(newaxis, :) * b(:, newaxis) jcowan: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/ArraysCowan.md is actually an old proposal of mine that I am not following up on jcowan: written a loooong time ago lloda: I read something of yours on a trac page, in case it's the same lloda: there are somethings I didn't like that other libraries do e.g. in srfi-43 where the indices are passed to vector-map lloda: that isn't free lloda: anyway, I didn't get any feedback on newra, and there are a couple things I'm not sure about lloda: like, I have infinite axes :p lloda: I don't know lloda: the one thing that worries me the most now is the basic temporary-array optimization lloda: like if you do (+ C (+ A B)), don't compute the whole of (+ A B) before adding C lloda: I'm not sure how to do that in Scheme in a way that's clean lloda: still with native compilation in Guile the basic array-map! is now faster in Scheme than it was in C, because you save all the transitions C-Scheme that happened every element lloda: so just for that, it's worth doing it daviid: lloda: but scherme wousl always call (+ a b c) no? so i mean it is a user responsibility, not a compiler (even though it could be) daviid: *schemers would lloda: daviid: well yes + was a bad example lloda: take (f C (g (A B))) daviid: ok, sorry :) lloda: you want that to be (loop (lambda (c a b) (f c (g a b))) C A B) lloda: no no lloda: I mean don't be lloda: where c a b are scalars, so you loop over the arays only once lloda: and don't need the space to store (g A B) daviid: right lloda: that's an obvious optimization, many C++ libraries do it for example lloda: and there's a lot of literature about it lloda: also some in lisp lloda: but with lists ofc lloda: but I don't know now to do it as a library in Scheme lloda: haven't really thought about it really *: civodul can build quite a few things on Guile 3: "guix build guile-gcrypt guile-git guile-json guile-sqlite3 --with-input=guile@2.2.4=guile-next --with-branch=guile-gcrypt=master --with-branch=guile-git=master --with-branch=guile-sqlite3=master" lloda: daviid: reading above I think davexunit is correct, floats aren't converted to scm and back anymore. Still f32s will be converted to f64s because Guile's floats are f64s lloda: even still the compiler needs to know that something is a float lloda: which happens if you use f32vector-ref or f64vector-ref for example lloda: that's what I understand anyway. davexunit: yes, it's a pretty safe bet that you're going to get a float when you use either of those daviid: lloda: right, and that conversion makes it difficult, if not ipossible, to reach similar perfs then i have using C, very unfortunately daviid: it seems that guile will never 'get rid' of those conversion? for f32 i mean lloda: daviid: I don't know about never, but maybe it isn't worth it until the compiler gets even better daviid: ok, i asked because i'm stuck in the f32 world because of vigra lloda: I think most of the time even C isn't good enough because something like BLAS or the gpu would be faster than you can code in C lloda: daviid: I also use f32, that isn't going to change daviid: lloda: yes, though blas and friends will only offer a very short portion of the algorithm we use in the img-proc domain, and it 'never stops', up to the point that it is difficult to follow lloda: daviid: agreed, yes daviid: lloda: it seems, but i didn't look at yet, just did read, that gsl offer a cblas 'interface' lloda: I wrote an ffi interface for cblas lloda: I think the ffi is cleaner, you don't need to install anything daviid: ok lloda: but I sunk in the macro swamp and I didn't complete all the bindings lloda: its https://notabug.org/lloda/guile-ffi-cblas if someone would like to help lloda: I mean if you use the gsl bindings from Guile, you'd need to wrap them lloda: wrap the wrapper lloda: so why not go directly to the library you want daviid: lloda: i did look at your ffi-cblas, but didn't feel i could make guile-cv epend on it, with all due respect, then 'soon later' you switch to other projects and it feels unmaintained daviid: also civodul: it'd be interesting to implement some of the BLAS routines in Guile 3 just to see daviid: as said above, it would only 'give me' a few of the many more algo i need civodul: no i mean just to see what performance we get daviid: civodul: yes, i was answering lloda daviid: :) civodul: ah :-) lloda: daviid: it is maintained, just barely ;p lloda: I wanted to automate more stuff instead of cp'ing code lloda: and my macro game is limited, so I got stuck there lloda: still I'd like to complete them eventually lloda: thing is, I don't really like cblas as a library lloda: it's a poor interface lloda: but it's so standard, there's no way around lloda: what can we do daviid: lloda: don't worry, i took another route and will stick to it for now lloda: ok, np lloda: civodul: I think you'd need to write very dirty scheme to compete lloda: I mean try to compete civodul: probably :-) jcowan: One thing I have on the deep back burner is a simple-minded translator from minimal Fortran to Scheme, along the lines of the various Fortran to CL translators. jcowan: For libraries, it wouldn't have to do the whole Fortran I/O thing. jcowan: and f77 would probably suffice. lloda: f77 is very raw compared to modern fortran lloda: it's true there's a lot of software written in f77 lloda: still lloda: I had the chance to use modern fortran recently and it's actually nice lloda: still low level, like you make a mistake and it segfaults :p lloda: but acceptable looking jcowan: oh yes, I realize that. But these libraries that everyone uses are often f77 or even f66. lloda: true jcowan: netlib, I think, is almost all f66. lloda: yeah lloda: modern fortran has a nice C interface, you can use it almost the same way if you mean to write glue lloda: wish some of that stuff got updated :-/ lloda: I had to wrap pieces of SLATEC a while ago and it was a nasty thing lloda: like it took a complex array by separate real & imag, and they had to be compact arrays lloda: and it was all static and global stuff inside, no thread safe at all lloda: but if you want this or that function, that's where they are mwette: lispmacs: look into guardians daviid: str1ngs: I pushed a series of patch, I suggest you pull and carefully read the one before the last (the last fixes a tiny mistake on the one before the last ...), New interface - (g-golf hl-api gtype) - unref daviid: str1ngs: I meant to say carefully read the doc of the 'New interface - (g-golf hl-api gtype) - unref' patch daviid: str1ngs: or pull, locally build the doc and read the 'unref' entry i the procedure index daviid: str1ngs: with these patches, g-golf is gc friendly, upon users responsibility - note that the C memory is freed to *: wingo has a patch to allow (lambda (x) (unless (number? x) (error "not a number")) (define (square x) (* x x)) (square (square x))) wingo: i.e. mixed definitions and expressions manumanumanu: wingo: beat me to it, then :D wingo: manumanumanu: :) wingo: did you start? manumanumanu: pushed? Can I have a look? wingo: not pushed yet, still testing wingo: shortly tho manumanumanu: I was only navigating psyntax.scm to get a grip manumanumanu: hooray then! manumanumanu: It won't have been in vain manumanumanu: anyway, the macro I wrote to shadow define, lambda, begin and all different forms of let is portable to other schemes if anyone wants to use them :D wingo: :) manumanumanu: wingo: now, what is counted as a body apart from lambda? All "implicit" (begin ...)? manumanumanu: together with the new letrectify that is fantastic news! I know a fair bit of code that could be un-nested a couple of steps by this and not be slower for it mwette: wingo: Is mixing definitions and executable expressions Scheme? If not, why do that? manumanumanu: mwette: many schemes do, even though it is not standard manumanumanu: even chibi, but it prints a warning iirc. mwette: manumanumanu: thanks -- I'm sure I've run into situations where I wanted to use that but can't remember any one. wingo: mwette: it is a superset of scheme, fwiw, like many guile features. racket takes this approach to definitions and expressions in body contexts also. the algorithm is also the algorithm for top-level expansion in r6rs. i do not know why r6rs did not do this for local definitions wingo: that would be good to know! wingo: it's a pretty straightforward transformation from internal definitions to letrec*. letrec* only came along for r6rs but was also adopted in r7rs for internal definitions iirc wingo: so i think it's an evolution in the direction of scheme manumanumanu: mwette: I have a macro implementation of it here https://hg.sr.ht/~bjoli/guile-define manumanumanu: but I seem to be using letrec and not letrec* manumanumanu: and I seem to have forgotten to update new-cond to actually work. manumanumanu: mwette: fixed that bug if you want to try it. mwette: OK, I'm convinced now. str1ngs: daviid: will read and test thank you wingo: manumanumanu: https://git.savannah.gnu.org/cgit/guile.git/diff/module/ice-9/psyntax.scm?id=20535922147cd5992330962aaa5c4986563fc905 str1ngs: daviid just to clarify. users need to call unref explicitly to GC single instance objects only correct? jcowan: wingo: That's correct. However, it is also true that many R5RS-and-older implementations had letrec* under the name of letrec. manumanumanu: jcowan: I feel completely out of my depth here, but isn't the only difference that order of evaluation is unspecified? If an implementation chose LTR evaluation, their letrec is, by chance, a letrec* manumanumanu: ? jcowan: Not so much by chance as because it occurred to nobody to do it otherwise. In addition, most programmers tended to use letrec for procedures only. jcowan: But when some implementations started to reorder letrec definitions, then things like (letrec ((a 32) (b a)) ...) silently did the Wrong Thing if the binding of b was reordered before the binding of a. jcowan: Most instances that broke were more complex and subtle than this, of course. jcowan: But the letrec* rule has always been the rule for internal defines. manumanumanu: wingo: thanks. That will be my evening reading :D davidl_: are there any libraries for IP address related calculations for guile? *: wingo preps a release wingo: good evening civodul ! civodul: hey wingo! wingo: civodul: wdyt about a 2.9.4 release, are you ok with it? wingo: fwiw only missing thing from 3.0 is mark's fixed-rationals work and i think i'm the blocker there wingo: ============================================= wingo: guile-2.9.4 archives ready for distribution: wingo: guile-2.9.4.tar.gz wingo: guile-2.9.4.tar.lz wingo: guile-2.9.4.tar.xz wingo: ============================================= wingo: woo wingo: i am going to go ahead and do it, if there is any problem (i think the declarative modules thing could be an interesting discussion, or internal definitions+expressions) we can change our minds in 2.9.5 wingo: lloda: interestingly the out-of-memory test failure was due to the inliner inlining the test harness, and thus seeing that the large allocations that were supposed to trigger the out-of-memory mechanism were removed by the optimizer because they were never used :) civodul: wingo: sounds good to me! civodul: wingo: BTW, the out-of-memory test failures occasionally show up on 2.2 wingo: civodul: i think the errors that show up on 2.2 are different wingo: and 2.9 probably also has them wingo: but after the toplevel-inlining thing there was a new error that happened all the time wingo: https://alpha.gnu.org/gnu/guile/ wingo: the .lz is still uploading but the release is out civodul: yay! civodul: congrats, wingo wingo: tx! civodul: moving very fast as always! civodul: declarative modules are really nice, i'm happy we can get past that civodul: that'll certainly help performance in many cases wingo: https://lists.gnu.org/archive/html/guile-devel/2019-08/msg00016.html civodul: "Interleaved internal definitions and expressions allowed" uh! civodul: i like the aesthetic appeal of this change... but that's not very RnRS, is it? :-) civodul: (not that i value RnRS that much these days...) bandali: hey civodul, i found out about skribilo recently. i think it’s very cool! wingo: civodul: it's an interesting point of discussion :) wingo: so, it is what racket does. wingo: and it has a well-defined expansion in terms of letrec* bandali: civodul, i was wondering if you’d be able to share the sources of some larger examples of using it; e.g. your personal site and/or thesis wingo: and it mirrors the top-level wingo: and it compiles efficiently wingo: and it's a superset of rnrs wingo: so, i think it's a good idea :) wingo: but reasonable minds can disagree and i would be happy to have the discussion! wingo: https://www.gnu.org/software/guile/docs/master/guile.html/Declarative-Modules.html#Declarative-Modules is updated now wingo: (unrelated to the mixed definitions/expressions thing) civodul: wingo: put this way, it sounds like a good idea yes civodul: i guess i internalized that somewhat silly constraint civodul: so it comes as a shock that the contraint is gone ;-) civodul: but yeah, prolly a good idea, and it's a good sign if others are doing it civodul: bandali: there's its user manual, which is quite big wingo: civodul: i went through that same process too, fwiw :) civodul: :-) bandali: civodul, ah true, will check it out, thanks :) btw, out of curiosity, do you use still use skribilo? *: wingo zzz, release all done, yay civodul: bandali: occasionally, yes civodul: oh you'll find 2 more examples here: https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/doc/ civodul: 3, even civodul: 3 even? civodul: odd bandali: haha, neat, thanks! civodul: yw! *: civodul -> zZz civodul: happy hacking! daviid: str1ngs: is the question is 'does unref, in g-golf, recursively unref other instances it would hold a ref to ...', the answer is it doesn't - because as 'things are', I have no way to know if those 'inner' instances are or not still having references else where daviid: str1ngs: does that make sence, or did i miss-understand your question? nly: janneke: i redid mru from scratch. It's pushed to 'new-mru' branch. I hope the API has not changed. nly: how can i use #:optional or similar thing for define-method in (oop goops) wingo: sneek: later tell civodul tx! regarding #1, there is -Ono-letrectify sneek: Got it. wingo: sneek: later tell civodul regarding #2, good question! i think letrectification should be on for -O2 at least and maybe -O1. currently it is on at -O1 sneek: Got it. wingo: sneek: later tell civodul the only breakage can come from people mutating modules' internal bindings from outside the compilation unit. i am thinking that is rare enough that letrectification can be on by default, but dunno sneek: Okay. janneke: nly: sadly, goops does not have #:optional or #:key yet, you must use a plain function or manually write all define-method's with different signatures janneke: nly: i'll have a look at new-mru nly: thanks daviid: janneke: nly:, grip has a define-method*, based on a version originally written by mark h. weaver, feel free to use or snarf it here http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/goops.scm wingo: davexunit: i have a trig unboxing patch :) wingo: pushed nly: thanks daviid lloda: wingo: f32? lloda: got this error building last master on osx ERROR: asyncs.test: preemption via sigprof - arguments: ((wrong-type-arg #f "Wrong type (expecting ~A): ~S" ("resumable continuation" #) (#))) lloda: it was a fluke, got through on retry lloda: it's weird that error substs are printed that way lloda: fairly sure that's not how it's supposed to be lloda: or it's just not the normal report channel lispmacs: hi, I was just wondering: how does an SCM object know whether or not some C data structure has a reference to it? Or does it? I was storing references to SCM objects in g_hash_tables and am wondering about this civodul: hey wingo civodul: wingo: -Oletrectify sounds good civodul: i guess you perfectly answered my concerns :-) civodul: there have been cases in the past where we monkey-patched internal bindings civodul: this will no longer be possible, but that's probably an acceptable tradeoff lispmacs: hi, I was just wondering: how does an SCM object know whether or not some C data structure has a reference to it? Or does it? I was storing references to SCM objects in g_hash_tables and am wondering about this manumanumanu: janneke: I have two different versions of that for goops, one which is almost identical to the one posted by daviid. https://hg.sr.ht/~bjoli/misc/browse janneke: manumanumanu: thanks! dsmith-work: sneek: botsnack sneek: :) dsmith-work: GoodBot daviid: str1ngs: I just pushed a 'Code review and new interfaces - The g-inst(ance) cache' patch to g-golf daviid: str1ngs: so, untill i find a solution to 'g-golf %g-inst-cache to be(come) gc friendly, you may g-inst-cache-remove! entries 'yourself' if/when you know that a specific instance is not referenced anymore anywhere in your scheme code - this said, it might not even be necessary you do anythng 'for now' unless you plan to have a few millions insances ... civodul: Hello Guilers! *: civodul wonders whether/how guile-simple-zmq could be used with Fibers lloda: civodul: thx for the explanation lloda: tbh I wish I understood my tools better lloda: my gdb skills are pathetic civodul: lloda: heh, np :-) rekado: Hey Guilers, historic #guile logs are now available here as well: http://logs.guix.gnu.org/guile rekado: unfortunately, about one year of logs is missing. rekado: they were not included in the SQL dump I received. lloda: I will post a followup to https://lists.gnu.org/archive/html/guile-devel/2019-08/msg00007.html over the weekend lloda: on guile-user lloda: as I'm done with the basic stuff lloda: and it's already a lot better than what comes with Guile, so I'd like to be able to use it myself lloda: only need some help with optimization lloda: also I think a couple of functions are needed in Guile lloda: rank-1 copy and fill for all vector types lloda: e.g. bytevector-copy! doesn't take a stride, and there's no equivalent vector-copy! lloda: and I don't think an external lib should be needed for this lloda: I tried to follow some of the vm assembly and I really don't understand it :-/ lloda: maybe the rank-1 ops can be taken from gfortran, there must be something like that in there lloda: I mean just a plain C loop would be a lot faster than what Guile does atm manumanumanu: daviid: Sorry about the late reply. What I'm trying to do is to have a list of valid forms (in-list, in-range etc) that you can add to if you add another supported form. The problem is I that I only want the added forms to be visible to the ones that has imported the module. Since this is a macro (albeit a 600 LOC one) I figured I can just use syntax objects and let macro hygiene handle the rest. #'in-stream manumanumanu: is not the correct #'in-stream unless you have imported (loops seq streams). dsmith-work: Happy Friday, Guilers!! dsmith-work: sneek: botsnack sneek: :) manumanumanu: dsmith-work: Ahoy hoy! OrangeShark: Happy Friday! nly: i was reading 2013 logs(thanks rekado), what's the problem with ice-9 qs? civodul: nly: you'll have to be more specific because not everyone is done reading the 2013 logs yet ;-) nly: there was not much, but this nly: 15,9999,99ijp: regarding queues: yes, please, let's have a sane queue module. nly: http://logs.guix.gnu.org/guile/2013-03-29.log nly: it's fun to see how guile was built in those days, but i know that guile has even older/richer history :) nly: at least the little that can be gleamed from logs civodul: heh civodul: i suppose this was about (ice-9 q) being imperative and overall not great nly: we caught a bug in emacsy mru-stack which uses q nly: maybe not related tho dsmith-work: sneek: seen mark_weaver sneek: I last saw mark_weaver on Jan 13 at 04:29 am UTC, saying: :). wingo: wb civodul :) wingo: you might be interested by http://git.savannah.gnu.org/cgit/guile.git/commit/?id=356ea0971996c81997481f7e1f9cf27cdd594a34 wingo: feedback welcome civodul: hi wingo! civodul: wingo: i like it! at last cross-procedure inlining! \o/ civodul: a couple of ideas: civodul: 1. perhaps "guild compile" should have a flag to change the default? str1ngs: daviid: will check it out thanks. civodul: 2. should the default be #f, to reduce unwanted breakage? str1ngs: nly: did that bug every get fixed? or are you thinking of another solution? nly: str1ngs hi nly: i haven't done anything about the mru issue, but i'll probably make an attempt tommorrow manumanumanu: nly: I just published some old r6rs code that has both a mutable heap and a functional pairing-heap (which is probably better for most use cases than leftist heaps): https://hg.sr.ht/~bjoli/misc/browse manumanumanu: under both mutable heap and pairing-heap manumanumanu: which can be used as priority queues nly: manumanumanu cool, thanks manumanumanu: nly: I just had an idea for a functional fifo. If that is what you are looking for, i can ping you in a couple of days when I put it online. manumanumanu: O(1) enqueue and amortized O(1) for dequeue. nly: sure manumanumanu: will do. Good night everyone! nly: mru -> most recently used, first in last out daviid: manumanumanu: fwiw, methods are only visible to those module that imported the module(s) that define and export them ... manumanumanu: exactly. I wanted to know how this is done. Since I am only working with syntax objects, I found an easy solution :D manumanumanu: nly: for that you should just use a list. Perfect use case :D manumanumanu: oh. my idea was actually nothing new. Googled it. Nice to know that it works though :D :D nly: just a little bit more is needed tho, setting something as first after it's been used daviid: manumanumanu: 'how this is done' is a guile module 'thing', no a goops 'thing' - this is explained i the emal i wrote to help those who want to understand 'what's going on' and how to mimic clos, if that is what they want of course ... manumanumanu: daviid: I will RTFM! Thanks for taking the time to reply to me! daviid: wc! nly: g'night and thanks daviid: manumanumanu: i was going to answer, that goops can handle 'defining a new iterator' on the fly like pinuts, but i now see that you want to be protable ... daviid: being portable is not a consideratin, afaic, unless the other scheme has goops daviid: i mean a strong clos like implementation, without it, many things are just impossible daviid: unless you rewrite, porrly, a order of mag inferior 'joke' that mimics it ... that is always posible of course ... daviid: I've had terrible internet connection problems today, not a single place I sit did work fine, and I see the last 4 or 5 msg I wrote, to str1ngs, re not in the log, where as those just before, to manumanumanu are ... maybe I shold resent those? daviid: str1ngs: did you see those last or not, commenting on your oan comment on guile 3.0, class redefinition ... str1ngs: daviid: I got your message about pushing goops instance cache daviid: hum, no i wrote more after what i wrote to manumanumanu str1ngs: but no I didn't get your commnets on redefinition daviid: ok i'll post these again str1ngs: thank you daviid: str1ngs: yes, the g-instance cache I added solves absolutely every occurrence of any 'situation' that comes to identifying and returning the correposnding goop instance, given a known g-instance pointer daviid: str1ngs: if it fails to fulfill the above, let me know daviid: str1ngs: wrt your goops realted 'change class' comment, I have a few comments to make : (a) consider guile 3.0 will be out tomorrow, it will, so prepare your s/w to be guile 3.0 compatible now; (b) there is no 'breackage' in using a class redefinition, just do the right thing, which is to give those a diffierent metaclass, provied by guile 3.0 already (and use eval-when/cond-expand if necessary daviid: this being said, I've always considered that class redefintion on the fly, although a wonderfull 'theoretical' thing, is, imo, suspicious of a dad design (no pun intended, just sharing my opinion) daviid: voilà :) str1ngs: so far it looks good to me in terms of goops cache daviid: good daviid: I need to add a remove! proc, from the cache I mean, which you (any user) would use to 'help' the gc, and 'relieve' unused instances, for example, if you know you delete/destroy a clutter actor or what ever ... till i find a solution, but it's not going to be 'tomorrow' str1ngs: The place I'm using redefinition is with emacsy text-buffer class. I could just add generic methods that do what I need to do. but by changing the class it makes it easier to assert the type and if it needs conversion. one thing with emacsy is it has a buffer protection an will create a buffer that might need assertion dynamically daviid: the above is far 'vague' so i could possibly help, but if you post a snipset, not using anything but goops, that mimic what you think is impossible without class redefinition, then at least i could try .. str1ngs: I'm just checking if my code is self explanatory. basically I use it to convert a plain text-buffer to a widget-buffer. the widget-buffer class handles displaying the text-buffer as a GTK widget daviid: thenuse a widget-buffer from the start daviid: anyway, don't use instance class changes 'on the fly' unless (1) you really really know what you are doing, and (2) not a single hacker on earth came up with anoter solution you could possibly use instead ... is my recommendation str1ngs: I don't have controls over the classes they are part of emacsy and *scratch* *messages* are special text-buffers that can be added dynamically to the emacsy/guile runtime daviid: emacsy have classes? is this goops already? str1ngs: http://git.savannah.nongnu.org/cgit/nomad.git/tree/scheme/nomad/buffer.scm#n118 is a simulated emacs like redisplay to handle updating text-buffers to widget-buffers and re displaying content str1ngs: yes, emacsy uses GOOPS to define buffer classes. daviid: so you have control daviid: and can enhance the class hierarchy as in source code, not on the fly daviid: str1ngs: anyway, i don't have much time for this now, janneke may help you with this i guesss str1ngs: I'm okay with the redefinition as of now so it's all good daviid: ok, but then prepare for 3.0, and don't asy there is 'breakage', it is unfair to andy, who works hard to make goops faster and better ... 3.0 explains what to do to allow class redefinition/class change, unless i mssunderstood something daviid: having class redefinition as a feature makes it very hard for the compiler to produce fast goops code daviid: hence andy thought about a solution and explain what you have to do, in 3.0, if that is what you want daviid: then be aware that that code will be quite a lot slower then in you didn't use that feature, and sepaking og text-buffers, i beeive speed is a majorfactor of decision in design ... daviid: now i'm gona hack, do as you wish of course str1ngs: I will think more on how to avoid redefinition though str1ngs: daviid: the API breakage was not intended as criticism, the breakage is on my end to be clear rekado_: str1ngs: just read the README and noticed that you’re refering to ci.guix.info. Could you please change that to ci.guix.gnu.org? lloda: how does one read a dissassembly such as this https://paste.debian.net/1096941/ lloda: I mean the branch numbers, for example lloda: is the 8 in (jne 8) counted how? lloda: I'm looking at https://www.gnu.org/software/guile/manual/html_node/VM-Programs.html#VM-Programs wingo: lloda: in terms of 4-byte words wingo: could be we should use byte offsets instead when displaying these things wingo: lloda: but the label target is printed in the comment on the right lloda: oh I'm stupid lloda: and I'm looking at the web manual which is only for 2.2.6 dsmith-work: Hey Hi Howdy, Guilers lloda: hi lloda: who knows anything about gdb & guile lloda: debian buster gdb comes without guile support and when I tried to build it myself it only supports 2.0 lloda: https://sourceware.org/bugzilla/show_bug.cgi?id=21104 lloda: I wasn't planning to use it for anything, just checking it out lloda: I hoped I could step through vm code (??) civodul: lloda: indeed, we never updated GDB to the Guile 2.2 port API civodul: also, it does not support stepping through VM code civodul: that said, even though it uses Guile 2.0, GDB can pretty-print Guile 2.2 objects civodul: re port API: https://lists.gnu.org/archive/html/guile-user/2017-03/msg00115.html str1ngs: rekado_: the README is completely out of sync. thanks for reporting this rekado_: FYI: I could restore the old logs for #guile, but there’s a large range that’s missing from the legacy logs. I’m trying to get those first. rekado_: oh, got an answer. Some logs are indeed missing from the archive. Oh well. str1ngs: rekado_: I have a version bump to resolve the README and some other small fix's do I need to mail the whole series? or can I just mail 0006 in the series? nly: janneke what do you think about `guile-emacsy` pkg without examples, closure size 150 MiB? https://lists.gnu.org/archive/html/guix-patches/2019-08/msg00308.html nly: nomad also needs some changes from emacsy wip branch. janneke: nly: having a smaller emacsy package makes much sense, i'm not happy with the guile-emacsy name; it suggests a pure guile package, which it's not daviid: janneke: is that so? i named guile-cv such, not because it is a pure guile module, which is not, but to 'invite' users to do cv in/using guile ... daviid: janneke: in guile-cv, a user exclusively use guile scheme, does not even know some of the core procs are i C ... it seems to me that thatis te important bit in naming? janneke: daviid: i cannot find a guile-cv package in Guix? janneke: daviid: and also, emacsy is intended mostly as a C library to make any program behave like Emacs, Guile is in a way (a very nice) implementation detail daviid: janneke: guile-cv is not in guix yet, i hope it will be i soon, it is 'in progress' - it needs a few texlive packages, and those were reworked, one named xkeyval, that guie-cv does not need but may indirectly depends upon, it seems, is not 'working', and 'blocking' guile-cv ... daviid: janneke: ah, a C library , then i understand your comment nly: ah i see nly: > a very nice implementation detail :) str1ngs: janneke: I'm pretty confident lib emacsy is simply for reentry from C. you can use emacsy purely from scheme. it's not even a guile extension. just to help with clarification str1ngs: I'm also more partial to the emacsy name vs guile-emacsy nly: janneke: wip merge into master will help daviid: str1ngs: I now have a working 'primitive' g-instance/goops instance cache in g-golf - a wip but it works pretty well daviid: the big problem is that it's not gc friendly - it keeps those, i will need help fro advanced guilers to correct this daviid: i'll push in a few min str1ngs: daviid: okay thank you I will look at it asap. you are protecting the objects I'm assuming? daviid: str1ngs: it's not pushed yet, will let you know str1ngs: sounds good apteryx: is it possible to access the source definition of a Guile object daviid: str1ngs: pushed daviid: str1ngs: successive calls to (webkit-web-context-get-default), for example, there are many other examples ... will return the goops instance of the first call str1ngs: apteryx: maybe with source-properties str1ngs: apteryx: https://www.gnu.org/software/guile/docs/master/guile.html/Source-Properties.html str1ngs: daviid great thanks will test this. I don't think this will have a huge impact on GC just yet. since single instances are not the norm. but I'll keep the GC aspect in mind str1ngs: daviid: looks good so far str1ngs: daviid this even works when I call (webkit-web-view-get-context view) str1ngs: generally new views use the default context apteryx: str1ngs: from the REPL, I try (source-properties some-defined-procedure) and it always seem to return () apteryx: the procedure was imported from some module in Guile's load path. str1ngs: apteryx: I get the same thing. but reading the docs if reading option position is #t which is default. supported expressions should have 'filename set str1ngs: though I guess the question is what is considered a supported expression str1ngs: I'm not sure why it's returning '() but it seems this is the way to get filename, line and column apteryx: str1ngs: weird. Thanks anyway! str1ngs: hopefully someone more knowledgeable can help apteryx manumanumanu: daviid: The thing is, I have written a for-loop implementation for guile, and if you provide a new iterator you need to add it to the list of valid iterators. If my program loads module a with (in-stream ...), (in-stream ...) should not suddenly become a valid iterator in modules that haven't loaded module a. Just keeping/mutating a list of valid iterators isn't enough. manumanumanu: If I could have a "module-local" list of valid iterators that would be fantastic, but I don't know how to achieve that. janneke: str1ngs: yes, emacsy can be used from guile, that's what guimax does; for now that's the exception though, we do not have many pure-guile gui programs yet jcowan: manumanumanu: URL of your for-loop implementation? advTHANKSance Wojciech_K: Hi! When I use macro inside a macro, how do I eval arguments of the outer macro before passing it to inner macro? Here's what I'm trying to do: Wojciech_K: https://pst.klgrth.io/paste/crjqrcb7ff7xpw3pan87j8zc Wojciech_K: The problem is that i wan to pass `` to inner macro instead of `(symbol-append '< my-name '>)` manumanumanu: jcowan: https://bitbucket.org/bjoli/guile-for-loops/src/default/ manumanumanu: It is mostly compatible with racket's loops manumanumanu: and produces just-as-fast-as-handrolled code after guile's optimizer has had it's way. manumanumanu: Right now it works using macros that expands to functions that are inlined. (in-list lst) expands to 5 values: car (get element), cdr (next), null? (stop check) lst (starting value) and (lambda (x) #f). The last is a pre-check that checks the value returned by car if the iteration should stop. For lists it does nothing (and is eleminated by the optimizer), but for generators thats the only way to actually know manumanumanu: when to stop jcowan: Nice. It looks quite decently portable as well. jcowan: I strongly urge to to write a SRFI for it. manumanumanu: jcowan: I'm migrating to sourcehut though, so the new url is: hg.sr.ht/~bjoli/guile-for-loops manumanumanu: As long as your scheme supports keywords it should be portable without much fuss. manumanumanu: Guile allows me to match the keyword #:when using (syntax-rules (when) ...) as a literal, which I am not really sure how it relates to any standards manumanumanu: and of course, syntax-case :D manumanumanu: jcowan: I might! It is probably the thing I have written that I am proudest of. I'll finish the transducers srfi first and then get going. jcowan: Yes, the keywords would have to become auxiliary keywords, but I don't see that as a big issue. jcowan: Have you tried it on 2.9? manumanumanu: yes. manumanumanu: Works like a charm. I am just trying whether #:incr and #:decr are needed with the jit manumanumanu: As I suspected: the jit solves the problem. manumanumanu: oh, but it is weird. manumanumanu: The jit makes the difference a lot smaller, but the code generated is probably sufficiently different for the JIT to not be able to sprinkle extra magic. wingo: manumanumanu: probably you should use include-from-path rather than load-from-path fwiw manumanumanu: good catch! manumanumanu: doing that solved a small bug as well :D manumanumanu: I had 2 (in-something ...) to dispatch on things that could not be identified at compile-time. manumanumanu: my son just woke up. We need to go take care of our tomato plants. see ya. dsmith-work: {appropriate time} Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) dsmith-work: Cool. The bot seems to be behaving itself. dsmith-work: jcowan: Hah! (advTHANKSance) manumanumanu: dsmith-work: damn. I thought that was some kind of pasting error. jcowan: Nope, it's a classic Usenet pun, when you might wait as much as a week for the answer to propagate back to you, and sending an extra "thanks" just didn't make sense. chrislck: also https://www.turners-retreat.co.uk/a-round-tuit-tile/p316 str1ngs: janneke: more then likely guimax and nomad are the only programs using emacsy either way lol nly: hello str1ngs: hello nly nly: is there any way to use node js modules in nomad nly: there is a perfectly usable implementation of dat, it's in node js tho str1ngs: let me think on that. I think it might be a good idea to look at gnunet first mind you. in terms of adding a new protocol nly: makes sense str1ngs: this is why I question the use of node for a reference implementation :P nly: i also read some blog about speech ui: https://rangermauve.hashbase.io/posts/speech-os str1ngs: that "sounds" interesting :) nly: haha, just no idea if that can be done, but it should be done 'sometime' janneke: str1ngs: yeah... str1ngs: janneke: do you mind if I cherry pick hash 3ea7043975abd028de3bf0e1ed82c17535e83822 into master. it's the buffer-kill-hook commit janneke: str1ngs: that's fine str1ngs: great thanks janneke: str1ngs: now that nomad is/nears 0.1, iwbn to create a new emacsy release janneke: if possible using all of wip and wip-doc but i think wip-doc may need some cleanups/fixups str1ngs: janneke: wip-doc looks good. the biggest issue is the race condition when killing buffers str1ngs: that's the biggest issue I've found so far. I think including wip-doc is more beneficial then not including it. str1ngs: also for nomad there is an API breakage with guile 3.0 when using change-class. it would help if text-buffer derived from metaclass . but unlikely guile 3.0 will be a factor for sometime just a FYI str1ngs: mainly I'm changing text-buffer's like *scratch* and *minibuffer* to a widget-buffer. not sure how guimax handles those. but I found it easier to change them. str1ngs: also as a side note, I'm not sure how useful local variables are. I think using slots is much easier. but that detracts from the emacs feel I guess. str1ngs: janneke: if you are planning to merge wip-doc let me know. since I'll need to patch nomad to use with-current-buffer. it's a trivial fix on my end Wojciech_K: I bump my question, how to implement: https://pst.klgrth.io/paste/crjqrcb7ff7xpw3pan87j8zc Wojciech_K: I'm slowly coming to a conclusion that it's impossible with scheme-style macros Wojciech_K: and you need defmacro jcowan: Wojciech_K: You need to use a syntax-case macro that strips hygiene. You are trying to construct an identifier to appear in the output of a macro, and syntax-rules does not allow that. manumanumanu: Wojciech_K: with guile you use, as jcowan says, syntax-case. There you can do (with-syntax ((my-identifier (datum->syntax stx-object 'my-identifier))) ...) *: jcowan hopes that R7RS-large can standardize on something while avoiding the wars of religion (10 million deaths, even scaled down to the size of the Scheme community, is Pretty Bad). manumanumanu: jcowan: What do you mean? There is the macro hygiene way, and there is the wrong way. :D manumanumanu: or do you mean low level macros? jcowan: Syntax-rules are well accepted. Beyond that there is: jcowan: (a) syntax-parameters (hygiene can be bent but not broken) jcowan: (b) four different potentially-unhygienic systems: syntax-case, syntactic-closures, explicit-renaming, implicit-renaming jcowan: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/SyntaxDefinitions.md documents which Schemes support what. jcowan: I like (a) but not a fan of (b) for myself, but I know lots of people like the ability to introduce identifiers in the macro output that weren't in the input. janneke: str1ngs: ok, sure jcowan: And although syntax-rules are Turing-complete, they are pretty hard to write code in, unless you use a package like SRFI 148, which helps a lot and is fully portable (except for the necessary hook into define/let/let*-syntax) jcowan: (the hook's available in SRFI 147, which redefines these) Wojciech_K: Thanks jcowan and thanks manumanumanu ! manumanumanu: jcowan: I always thought about rewriting the for loops in syntax-rules, but I never got to it. My cut-like threading macros were actually quite simple to write, and I needed something fun/painful. *: jcowan nods. manumanumanu: but (generate-temporaries ...) got the best of me :D manumanumanu: good night everyone! str1ngs: good night manumanumanu Wojciech_K: jcowan: manumanumanu: For completeness: Here's working wersion https://pst.klgrth.io/paste/ye7y94d5swqahhxg3p7h3xjx jcowan: Thanks daviid: I'm back :) daviid: lloda: yes, it is really great to have logs again, thanks again rekado_! daviid: though no luck this time wrt my guile-gnome g_hash_* function usage instead of scheme hash tables... hope andt will find a min or so to answer daviid: *andy daviid: davexunit: for info, the guile-gnome (C code), that performs the hashing, so to speak, is very short, and here: http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gc.c daviid: davexunit: it seems using eq? won't work https://paste.debian.net/1096649/ daviid: if i use pointers addresses, do i have to build my own hash function? daviid: davexunit: this sems the way to go (?) (eq? (pointer-address $11) (pointer-address $12)) -> #t daviid: *seems wingo: daviid: i think guile-gobject used glib hash tables because previously you couldn't call scm_gc_{protect,unprotect}_object within a finalizer wingo: and there were no foreign pointers obviously wingo: but now, finalizers run in a more-or-less normal environment, so you could change to use scm_gc_protect_object / scm_gc_unprotect_object, or some kind of hash table -- you need to be careful with synchronization though as finalizers run in threads daviid: wingo: thanks, I am working on a 'primitive' cache in sheme which will, indeed, have to be enhanced to be thread safe (as in glib thread safe), and then I also have to understand how 'all this' remains gc friensly ... a lot to learn about on my side ... wingo: :) daviid: wingo: guile-gnnome is such a master piece that I still feel, after all these years, 'ignorant', :) bahh we never stop to learn ... wingo: aw tx :) wingo: fwiw i am becoming more ignorant with time, i forget why things are they way they are :P daviid: yeah, I understand that, it is such a master piece that it is like a mozart composition, easy to read, impossible to compose again ... daviid: I need to understand what you did with these func-qdata* procedures, till now, these are still a bit of a mistery for me manumanumanu: Ahoy guilers! lloda: I get this trying to compile master from scratch https://paste.debian.net/1096687/ lloda: I think the makefile is missing some header jonsger: lloda: can you give some more input about your build system (compiler version and stuff like that) lloda: g++ (Debian 8.3.0-6) 8.3.0 lloda: I'm on buster lloda: pull & recompile on an old clone works just fine, so I think it's a file that's not being generated now lloda: sorry, should have said gcc not g++ lloda: same thing regardless lloda: I compile off tree though lloda: yeah in tree gets over that so it's an in tree / offtree thing dsmith: lloda: Also on up-to-date Buster. gcc (Debian 8.3.0-6) 8.3.0. dsmith: lloda: Fresh pull and git clean -dxf is building fine. Got through all the C code no prob. Working on eval.go at the moment. dsmith: Ahh. dsmith: lloda: Hmm. Seems to be working for me. lloda: dsmith: off tree? chrislck: really st*p*d question, I cannot see INSTALL in guile/* where do I find build instructions? chrislck: ah found it dsmith: lloda: as in (mkdir buildtest; cd buildtest; ../configure; make) ? roelj: How do I specify a "\r" in Guile's format function? dsmith: lloda: If you haven't, might want to do a git clean and autogen nalkri: ~newline? manumanumanu: Wow! The new #:declarative? and user-modules-declarative things in the git head is great! lloda: dsmith: yes. Actually (cd ..; mkdir buildtest; ...) starting from the source tree. Did it from scratch, new clone, everything empty. lloda: Anyway! the in-tree build finished and I still have the out-of-memory error apteryx: any builtin support for serializing objects in Guile? manumanumanu: I go to guile.git once in a while, and the last year it has been like christmas once a month apteryx: (or defining how a given object should be serialized?) chrislck: apteryx: object<->string? no lloda: roelj: I think you can just say \r inside a string, no? lloda: the char names are #\newline for 10 and #\cr for 13 apteryx: chrislck: object->string! thanks for pointing me to it. Seems I have something to chew on. roelj: lloda: Thanks. So I can either use \r, or its character name equivalent. lloda: yw lloda: there's (integer->char nn) which prints the char name roelj: oh nice! lloda: it's annoying that (guile) and (srfi :1) have different versions of (iota) manumanumanu: even worse, they are both compatible. manumanumanu: or better. The change would be trivial :D manumanumanu: I am actually diving into guile to maybe be able to make trivial changes in the future. manumanumanu: That is one pet peeve manumanumanu: along with match not being user-extensible manumanumanu: and not allowing definitions in expression context :D manumanumanu: Which are all things I suspect I could take a jab at lloda: there are several instances of - need some function in boot.scm - don't want to pull in module x - define own simpler version. Those simpler versions shouldn't be public imo wingo: manumanumanu: the definitions in expression context thing could get fixed soon i think wingo: it should be doable to fix wingo: a bit gnarly but not a lot of code manumanumanu: Lucky me! I don't really do C, which I suspect is needed manumanumanu: It is trivial to do as a macro, but looking at the source in the guile expander I suddenly feel a bit dizzi. wingo: i don't think c is needed wingo: it's a psyntax thing manumanumanu: oh! I already have some macros that do it in my prelude. I can have a look. wingo: the macro should expand (begin x ... tail) to (letrec* ((id rhs) ...) tail) manumanumanu: meh. Not too gnarly! It is a rather trivial fix manumanumanu: in expand-expr wingo: where if x is a definition, you have the id and rhs right there wingo: and if x is an expr, lhs is a temporary and the rhs is (begin x #f) wingo: i think though the fix should be in expand-body tho wingo: probably you don't want to allow (+ 1 (define x 10)) manumanumanu: Yes! manumanumanu: That looks worse :D manumanumanu: I have never been in those parts of the guile runtime. I'll have a poke around and see what I can do :D jonsger: wingo: I think I found another bug with guile and libgc 8.0 wingo: yeep wingo: test cases are welcome :) jonsger: https://paste.opensuse.org/view/raw/94495646 jonsger: I will check if it's really a problem of libgc8 manumanumanu: By the way, how does goops deal with compartmentalisation between modules? If I define a method for in a module, how is "contained" to the code that has has imported that module? I suspect there is some mutation going on wingo: jonsger: that may be a guile problem fwiw, master fails right now on that test manumanumanu: I just want to write some kind of library that allows me to keep things separated where some kind of shared state is mutated. jonsger: wingo: ah okay wingo: manumanumanu: mikael djurfeldt would always point to https://pdfs.semanticscholar.org/be63/cb65045c7396c61a63cdb64bfac2747646dd.pdf when this question was asked wingo: so from his POV each module needs to know where the methods added in define-method, which specific generic they're adding them to wingo: and then users compose those methods using the module duplicates handlers mechanism wingo: and though it seems like it could work i was never happy with it; i lost the feeling that i knew where my definitions were wingo: perhaps that's just subjective tho wingo: see https://lists.gnu.org/archive/html/guile-user/2006-05/msg00027.html also wingo: manumanumanu: also see https://docs.racket-lang.org/reference/syntax-model.html#%28part._intdef-body%29 regarding definitions and expressions manumanumanu: That would be the key to making match.scm user extensible. It would allow for adding a custom matcher, while also keeping it backwards-compatible manumanumanu: thanks wingo. wingo: honestly regarding matching, i think we should also be looking to just taking the one from racket. it's extensible. manumanumanu: I have found _where_ to make the changes, but I have to understand quite a bit more before hacking on it manumanumanu: the racket matcher looks nice. It also only uses syntax-case, which is comfortable for us. dsmith-work: Hey Hi Howdy, Guilers wingo: moo wingo: davexunit: do you use the 2-arg atan or the 1-arg atan davexunit: wingo: 2-arg davexunit: it's of lesser importance to sin/cos, fwiw *: wingo nod wingo: i just noticed that all of these are primitive-generics; joy... davexunit: wingo: I am picking up some sarcasm there wingo: :) daviid: manumanumanu: that kiczales article people point to to justify module protection for methods goes against the clos standard itself, like it suggest a complete opposite direction of what is at the heart of clos, a complete none sense imo daviid: fortunately, there are ways to circumvent this, and make things so that goops appears to work like clos, but it is not 'that easy', nor 'that complicated' either, but it needs bit of dedication to understand what th is all about, what guile/goops does and how to circumvent ... daviid: my personal position wrt this is that if you feel the need of module protection over your methds, then you have a design problem daviid: not a clos/goops problem daviid: manumanumanu: i wrote what i think one should do when using goops here https://lists.gnu.org/archive/html/guile-user/2017-10/msg00027.html wingo: woo that declarative bindings optimization is fire, a very nice speed bump for lots of code lloda: wingo: excited to try it lloda: I had been grumping about having to use define-inlinable everywhere lloda: some places I couldn't wingo: the optimization still doesn't work cross-module, and we could provide a knob to prevent making private variables for unexported vars wingo: so there are some possible next steps. still tho, pretty good wingo: similarly: i am not sure why internal definitions must precede expressions. the letrec* transformation for the top-level works really well wingo: and i think it could work lexically, i.e. we could allow mixed internal definitions and expressions wingo: anyway, i think we have enough for a 3.0 wingo: still need to look at mark's fixflo patches, gulp, dunno why i have been putting that off lloda: we have enough for a 4.0 :D wingo: :) lloda: master make check fails for me at test-out-of-memory lloda: Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert narrow string to output locale" 12 #f #f)'. lloda: hmm wingo: humm wingo: i also get an error there wingo: i was just running ./check-guile before wingo: interesting wingo: will have to look at that chrislck: letrectify sounds like electrify... an intentional pun? wingo: unintentional :) davexunit: wingo: this is cool! though I'm a little confused about what it means for hacking at the repl. seems like another thing that users will have to disable in order for their live coding session to work as expected? wingo: davexunit: unclear! i think there are some cases in which you'll want to disable it. davexunit: using the box module in the documentation as an example: if you wanted to redefine box-set!, that would be just fine, but since the original definition of box-set! was inlined in box-swap!, you'd have to re-evaluate it as well. wingo: if you build a program by entering expressions one by one at the repl, then you're mostly good -- your compilation unit never has more than one definition davexunit: and re-evaluating it this way would create a new box-swap! that does *not* inline box-set! you'd have to recompile the entire module for that. am I getting this right? wingo: mostly because a loop might tail-call itself directly instead of going through the module davexunit: okay, that makes sense. davexunit: I often load up entire programs and then tweak them via geiser and a repl server wingo: if you build a program by editing things in modules and then loading them from the repl, or reloading them, then there you're cool too davexunit: so this optimization has more of an impact there wingo: because you are usually ,reload'ing a module wingo: if you just want to reach into modules' unexported bindings -- there you are also good, all top-level definitions are in the module wingo: the problem comes in when you want to change a binding in a module that was compiled with the declarative flag on. wingo: if you just re-define things external (extra-module) uses are fine as they currently go through the module's variable wingo: but internal users won't see the new binding, probably. unless the binding wasn't declarative (it was the target of a set! or a redefinition within the compilation unit) davexunit: hmm, okay I'm still a tad unsure about something. thanks for explaining, though. davexunit: does my example using the box module make sense? am I misunderstanding something? davexunit: I guess I should add some additional context: you first load that module into a fresh repl, then do the edits I mentioned. wingo: so you are asking -- you load (boxes) from the repl. wingo: then you ,m boxes davexunit: yes wingo: then you (define (box-set! x y) (set-car! x (pk y))) davexunit: yes wingo: and then.. what exactly? dsmith-work: Monday Greetings, Guilers wingo: (at this point, box-swap! is unaffected) davexunit: wingo: okay, I'm clear on that part. now, if I call box-swap!, would that new definition of box-set! get used. the docs say that box-set! gets inlined in box-swap! so I would think that it wouldn't. davexunit: that second sentence was supposed to be a question. wingo: your intuition is correct: box-swap! inlined box-set! when it was compiled, so it does not reference the new box-set!. wingo: wdyt about the tradeoff? :) wingo: is it comprehensible, is (user-modules-declarative? #t) the right default? davexunit: wingo: okay, great. so at that point I have two choices: re-eval all call-sites of box-set! within the module, or just recompile the whole thing. wingo: davexunit: right. davexunit: thanks for walking through this with me. wingo: np, & likewise of course davexunit: I think it's a good tradeoff. I'm excited to see this top-level procedure problem chipped away at. wingo: strictly speaking i am not sure if it is standard scheme -- it corresponds with r6rs i think, haven't checked r7rs yet wingo: but the top-level remains a bit hopeless :) davexunit: for me, as long as it is fairly simple and clear to turn off some optimizations that interfere with live coding, I'm all for 'em. davexunit: so far I think the most difficult change has been non-redefinable goops classes, but I came up with a workable solution. davexunit: I use an env var to decide if the metaclass for my base classes should be or . that was the only way I could think of to provide input to the module being loaded. davexunit: makes me wonder if, with all these optimizations, guile could benefit from some sort of "live hacking mode" flag that does all the right stuff. davexunit: anyway, thanks for all the help and all the awesome compiler work. graphics programming with guile has never been better. bandali: hi all, i’m looking for a breadcrumb implementation for haunt bandali: something like what’s at the very bottom of this page: https://sny.no/2019/08/log bandali: (it needs JS) bandali: i could probably write one myself, but since my guile-foo isn’t that great, i was wondering if anyone else had done something similar for themselves that i could have a look at rekado: bandali: what do you think of the breadcrumb thing at https://guix.gnu.org/blog/ ? rekado: (near the top) jonsger: wingo: compiling 2.9.3 fails on ppc64 and ppc64le due to following error: https://build.opensuse.org/package/live_build_log/home:jbrielmaier:guile-3.0/guile3.0/openSUSE_Factory_PowerPC/ppc64le `--enable-jit=no` doesn't makes a difference. I would say af72d01de8 is the bad commit bandali: rekado, oh cool! how did i not notice that before :p my only nit would be that it skips the ‘year’ part as a separate link; but perhaps that wouldn’t be too hard to add in bandali: i’ll have a look at its source a little later wingo: jonsger: ah interesting. i will see what i can do wingo: davexunit: did you get to try out the sqrt / abs things btw? :) jonsger: thx. Let me know if you have a patch or so. Then I can test :) wingo: jonsger: pushed a little patch wingo: davexunit: yeah it's hard to straddle that line between wanting the compiler to reason statically and allowing run-time changes. the best solution is adaptive compilation but i don't think we can afford it, for better or for worse jonsger: wingo: still getting /usr/lib64/gcc/powerpc64le-suse-linux/9/../../../../powerpc64le-suse-linux/bin/ld: ./.libs/libguile-3.0.so: undefined reference to `scm_jit_return_to_interpreter_trampoline' with patch applied jonsger: the `scm_jit_clear_mcode_return_addresses` error is gone wingo: hum *: wingo looks jonsger: it's strange. All occurences seem to be inside of a ENABLE_JIT def... wingo: jonsger: pushed another small fix wingo: because i am an idiot :) jonsger: oh, didn't saw that error :P davexunit: wingo: whoa what sqrt/abs things? I must have missed this. davexunit: is this in the latest pre-release or will I need to build from master? wingo: master wingo: http://git.savannah.gnu.org/cgit/guile.git/commit/?id=382cc5c246ccbe8dc1f6fa589f4fcf7f076fab69 davexunit: wingo: thanks. do you think this same optimization could be applied to the trigonometric functions? wingo: davexunit: fyi i also pushed some commits to guile-opengl recently, to add the example from the old "compost" thing wingo: runs not quite as well as compost (no register allocation), but it's close, and general :) wingo: davexunit: yes certainly davexunit: I remember that old thing davexunit: neat davexunit: I do a lot of mainly sin, cos calls. rotation matrices and such. *: wingo nod wingo: we'd implement by calling out to the run-time. the goal would be to work with unboxed f64 wingo: it depends on your code, but if you can somehow manage to avoid boxing entirely in certain code paths, the perf boost can be dramatic wingo: 3x, 4x, more davexunit: yes, anywhere that I've been able to optimize like this has been a huge win. wingo: so, like, make a list davexunit: unboxed trig functions would enable me to render tons of dynamic sprites, for example. wingo: is it just sin and cos or is it other thigns too? etc davexunit: yeah I can take a look through my code. I think I also sometimes do floor/ceiling and those box IIRC wingo: yep wingo: those also can be optimized. i think it's a short list of things tbh wingo: maybe 5-10 primitives davexunit: yes I think so davexunit: I have considered writing my own sin/cos in the past but this would be much better. davexunit: for everyone. davexunit: wingo: sin, cos, tan, asin, acos, atan, floor, ceiling, min, max. *: wingo nod davexunit: min/max might be tricky because they allow arbitrary amounts of args? davexunit: I wrote my own inlined versions that operate on just 2 args wingo: min and max are macro-expressible wingo: i.e. (min a b c) = (min (min a b) c) davexunit: are they currently expressed this way? wingo: yes davexunit: okay great wingo: (i might punt on min/max fwiw) davexunit: ah okay wingo: but the other ones definitely need compiler support davexunit: I also seem to run into issues inexact->exact. it's pretty common to need to take a float and translate it to some index value davexunit: I don't know what can really be done there. *: davexunit afk for a bit, meeting wingo: that might be worth working on, yes jonsger: wingo: I have another build issue with 2.9.3. This time on armv7l https://build.opensuse.org/package/live_build_log/home:jbrielmaier:guile-3.0/guile3.0/openSUSE_Factory_ARM/armv7l I don't have a machine to investigate at the moment. But I think once could "emulate" armv7l on some armv8 aarch64 machines... wingo: illegal instruction! that's very exciting :) wingo: i wonder what instruction it is lloda: floor is stupid slow even in C for some reason lloda: ime jonsger: wingo: we built them on aarch64 machines and they "emulation" armv7l in some way. It could come from that wingo: lloda: why is that, i wonder? wingo: jonsger: apparently you can boot the machine into an armv7 mode somehow wingo: is that right? wingo: my understanding was that the emulation was a boot-time choice jonsger: could be. I have no idea about ARM davexunit: lloda: oh really? interesting. wonder why. lloda: wingo: davexunit: Not sure :-/ It was slower to floor a vector than to do a matrix vector product. Those are tuned to the hilt, but still the library functions were all really bad. I tried a couple of bit tricks and it was a small improvement. But I didn't go down to the assembly. It was for work. Maybe when we start shaving ms I can revisit. lloda: I saw many comments about IEEE conformance etc, but for our application I didn't really care lloda: the last bit was noise for us anyway wingo: davexunit: you really use asin?? wingo: it is somewhat difficult to prove that the result of asin is a flonum daviid: wingo: in guile-gnome, you use g_hash_* functions, why did you not use scheme hash tables, was it for speed? davexunit: wingo: atan is the main one. I was just including all the trig functions for good measure. if any inverse trig functions are difficult then no pressure from me to make it happen daviid: to keep track of the correspondance between foreign pointers and goops instances ... davexunit: sin/cos/tan are by far the most important. davexunit: I use atan to find the angles of 2D vectors, but less frequently that sin/cos daviid: what would be the best hash function for a foreign pointer by the way? anyone? davexunit: eq? davexunit: eqv? wouldn't make sense. I don't know what equal? would even do. davexunit: maybe you could use pointer-address values as the keys davexunit: I guess I don't really know. I'll stop talking now. :) jcowan: wingo: The arcsine of a real number is always a real number; indeed, the real part of the complex arcsine is the arcsine of the real part. jcowan: Real arcsine of +0.inf, -0.inf, and +0.nan is +0.nan. lloda: jcowan: that cannot be, arcsin 2 cannot be real, since sin(x) in [-1 1] for any real x lloda: maybe you're thinking of atan davexunit: it was a mistake to list asin and acos earlier. Andy need not waste his time on those. I completely forgot about the complexities of them. jcowan: lloda: Yes, you're right daviid: have to go, bbl, will read the log ... lloda: it's great to have logs. daviid: str1ngs: when you paste an example, please dont use srfi-64, just paste an example - I can't use it and wish I can jus copy/paste - then I don't use srfi-64 as a test suite anyway ... thanks! daviid: str1ngs: then, for your own code and tests, you may selectively import gtk-init, gtk-init-check .. like this daviid: https://paste.debian.net/1096313/ str1ngs: daviid: the selective import is nice thanks daviid: wc! daviid: str1ngs: back to your earlier claim, where it's true that these *-get-* *-set-* methods do not work yet, I will work on it of course, note that you should (lways) be able to get those values using their property accessor, and somehow, it becomes actually secondary to have those C like getters/setter, again, I will work on those of course, but utlimately, you might even choose not to use them, for example daviid: https://paste.debian.net/1096345/ daviid: the same reasoning applies for constructors that takes no arguments: in this case, we may even always prefer to use the scheme way (make ), instead of calling (webkit-web-context-new) - which currently is not (yet) working I'll work on those as well of course daviid: this said, I definetely need to work on this and provide those for opaque boxed type, like webkit-web-context, precisely provided to get/set opaque boxed type instances ... str1ngs: daviid: I had given that some thought myself, and I meant to ask which was the preferred way. I agree that goop constructors and slots are probably better approach. I will try to remember that going forward, I'm glad you brought this up. I don't think it helps I am more familiar with C and the corresponding functions. daviid: str1ngs: right now, I'll work to solve the problem related to methods that get- set- opaque boxed type, since there is no other option ayway, then on those that get- set- gobject subclass instances, which gnrally already work sing accessors ... daviid: str1ngs: do you know if ther is any diff between webkit-web-context-get-default and webkit-web-context-new? str1ngs: (webkit-web-context-set-network-proxy-settings (!web-context view) 'custom settings) still won't work because the web-context is a # and not a so it has no !g-inst. but I'll put a complete working example for this together that you can copy and paste. str1ngs: daviid: I believe they are different webkit-web-context-get-default returns a the global context. and webkit-web-context-new creates a new one that can be used with webkit-web-view-new-with-context str1ngs: daviid: i'll read the docs and verify that for sure though daviid: don't worry daviid: i'll make both work daviid: (!web-context view) returns a pointer to an opaque boxed type, webkit-web-context-set-network-proxy-settings should accept it, but i didn't try here str1ngs: daviid I'll retest the set-network-proxy-settings an if I still have a problem post a complete copy and paste example for you . daviid: ok str1ngs: daviid: also webkit_web_context_get_default () is more useful for me. since I plan on providing global proxy settings. find grain per view proxy adds extra complexity I'd rather avoid. daviid: ok, i should have that working well by tomorrow str1ngs: daviid webkit_web_context_get_default () essentially is the context used by default for all new web views unless context is specified with webkit_web_view_new_with_context daviid: str1ngs: ok, my question was more - does it return a new pointer every call, or not? daviid: i guess it does str1ngs: _new should yes, default should not daviid: correction, i guess it doesn't str1ngs: I can't check in scheme, but I'll try with C daviid: don't bother, i'll be able to check in scheme in a short time str1ngs: daviid: http://paste.debian.net/1096350 daviid: str1ngs: ok tx, that confirms what i thought daviid: str1ngs: I pushed a fix which solves the problem of functions and methods that return a GI object type, but it's a wip daviid: str1ngs: you may read the commit for a better understanding of what I refer to, then here is an exmaple for you to reproduce and understand what I am talking about ... https://paste.debian.net/1096372/ daviid: str1ngs: it works and what is being said won't block you to use it, but I need to find a better solution to what is (I hope clearly) explained in the commit message daviid: spk121: I wonder what you do in guile-gi, I'd be happy if you could read the commit http://git.savannah.gnu.org/cgit/g-golf.git/commit/?h=devel c1e32d2e7e4cc7d35fee53d8a0598d2c96774542 and let me know what you think about all this ... apteryx: how do I return the nth list in guile? 'nth' doesn't seem to be available apteryx: nth element of the list* apteryx: list-ref apteryx: I'll remember to search for 'kth' instead of 'nth' in the Guile Reference for the next time... ;-) str1ngs: daviid great , will test this out today. str1ngs: daviid: I can see problem b being a tough issue to solve. I guess the important thing is it returns a matching g-inst pointers. but I can see how this could cause a problem. namely in with say garbage collection. pkill9: does Guile have a function for moving a file? there is copy-file, but no move-file cehteh: hint: search for 'rename' pkill9: thanks *: wingo found interesting codegen + coverage issue wingo: just pushed a pretty neat top-level binding optimization pass; enables inlining / contification of top-level definitions within a compilation unit wingo: see comment in https://git.savannah.gnu.org/cgit/guile.git/commit/?id=d7bbf6d5db2f0eb2ee44557c5d3f65977f432ed3 for mechanism wingo: and documentation in https://git.savannah.gnu.org/cgit/guile.git/commit/?id=356ea0971996c81997481f7e1f9cf27cdd594a34 for what it means on a semantic level wingo: lol ntakl goes from 18s to 8s :) janneke: wingo: \o/ str1ngs: janneke: I'm just taking a look at wip-doc. do you plan on removing with-buffer going forward? Sheilong: Is it possible to create a hashtable wihtout pre defined size? Sheilong: Is it possible to use lists as keys for hash tables? str1ngs: janneke: nvm I see it's been renamed to with-current-buffer daviid: str1ngs: just pushed a fix so g-golf does not try to encode/decode opaque boxed type instances daviid: scheme@(guile-user)> (webkit-network-proxy-settings-new "127.0.0.1:80" '("*.gnu.org")) daviid: $3 = # daviid: str1ngs: so, when you can, pull, make and let me know how this fix goes ... daviid: have to leave, bbl or tomorrow ... str1ngs: sneek: later tell daviid . great news, will test these changes. thank you sneek: Okay. janneke: str1ngs: right, some changes towards making Emacsy more Emacs'y janneke: str1ngs: it's great that you look at wip-doc, i was wondering how to go forward with documentation/help buffers: what emacsy could provide generically and what client programs should provide janneke: esp. text with buttons and hyperlinks, can we do that in a nice way? str1ngs: janneke: the change to message and return documentation is nice. the text buffer is pretty generic that could be a good starting point. maybe the concept of a *Help* buffer . buttons and hyperlinks will be hard to present generically. but maybe the concept of font lock could be an idea to explore for that. nexgen: hello, please let me know to which target can compile guile? nexgen: according to: nexgen: https://www.gnu.org/software/guile/manual/html_node/Compilation.html nexgen: there are options like: --from=lang --to=lang nexgen: where are possible values? rekado: nexgen: all languages that are available. You can also write your own language, e.g. to compile some XML or JSON specification to Scheme and then from Scheme to bytecode, all in one go. nexgen: how can I see a list of available languages? already implemented rekado: the usual tower of languages is Scheme -> Tree Intermediate Language -> Continuation-Passing Style -> Bytecode rekado: but there’s also Elisp, Lua, Brainfuck, etc rekado: oh, and JavaScript nexgen: how can I see this list? nexgen: is there a doc for it nexgen: or an option in CLI ? daviid: and python, and prolog as well sneek: daviid, you have 1 message. sneek: daviid, str1ngs says: . great news, will test these changes. thank you nexgen: prolog is very good daviid: search for guile-log, i think chrislck: nexgen: http://git.savannah.gnu.org/cgit/guile.git/tree/module/language nexgen: chrislck, thanks, a lot nexgen: but there is no lua ? nexgen: what is the easiest way to compile into dotnet? nexgen: and what about python dsmith: Hey hey nly: can i use guile with c++ program? janneke: nly: sure, see guimax, or even lilypond str1ngs: nly: the qt directory in nomad has c++ str1ngs: nly: particularly keymap.cpp nly: thanks jcowan: nexgen: a list is available at http://git.savannah.gnu.org/cgit/guile.git/tree/module/language jcowan: currently just Scheme, Brainfuck, Elisp, and ECMAscript plus the intermediate forms. str1ngs: daviid: webkit-network-proxy-settings-new works well now though it's not possible to get a useful yet. I've updated my test case here http://paste.debian.net/1096292 daviid: str1ngs: let's separate things, these are not the same lack of feure or bug ... I will fix this yo of course str1ngs: sounds good daviid: so, I'd like to confirm that you can see it works, I mean it has the effect you wish and expect on the app itself? daviid: sneek: later tell nexgen here is the most complete list of guile related projects http://sph.mn/foreign/guile-software.html - and it has guile-log - https://gitlab.com/gule-log/guile-log - but lacks guile-python o whaever it's called sneek: Got it. daviid: sneek: later tell nexgen here it is - python on guile - https://gitlab.com/python-on-guile/python-on-guile sneek: Got it. pkill9: what's a guile python file? dsmith: hey hey dsmith: sneek: seen mweaver sneek: Sorry, no. dsmith: sneek: seen markw sneek: mark_wea` was here Jun 17 at 07:29 pm UTC, saying: okay, thanks. daviid: str1ngs: just pushed a fix, please pull and run the make danse, it should be ok now, but if not, let me know str1ngs: daviid: will try now, thanks str1ngs: daviid: looks good, thanks daviid: yw" daviid: *wc! str1ngs: daviid: I have a clean room for testing using docker. might useful for you as well. http://paste.debian.net/1095911 daviid: str1ngs: tx, i don't use docker may if someone is interested, i'll try to remeber you can offer a recipe daviid: *may/but str1ngs: daviid: no worries str1ngs: daviid: this did'nt even break my API. since my GObject class NomadWebView inhertis WebKitWebView str1ngs: so I'm using anyways daviid: str1ngs: I wanted to fix that anyway, done. You may even try it by naming your class NoMadWebView, and try with/without an exception entry in %g-studly-caps-expand-token-exceptions str1ngs: I will test out %g-studly-caps-expand-token-exceptions though. I don't think I'll use it myself. but I can see it have some use reepca: is there a way to open a regular file for writing but throw an error if it already exists? reepca: ah, looks like plain 'open' has the flags needed *: chrislck can't set up g-golf, feels missed out *: chrislck not using guix. vanilla ubuntu. configure. missing gobject-introspection. google. apt install libgirepository1.0-dev. configure. missing guile-lib. download guile-lib. build, install. rebuild g-golf. can't find guile-lib. table-flip. daviid: chrislck: yes, there are dependencies, and there are listed https://www.gnu.org/software/g-golf/install.html, so no 'surprise' i would say daviid: it doesn't make sence, if you installed guile-lib, that g-golf would not find it, you need to investigate the cause(s) daviid: chrislck: also, it is under active devel, it would only be partially usable if you clone the source repo and checkout the devel branch daviid: chrislck: what is 'there' works, but important bits are still missing, be aware ... chrislck: daviid: not really *complain* for now. sounds like important work. if only the setup curve was a bit less... brick chrislck: ok newbie qu: i'd rather not install guile-lib etc globally but rather like python's venv, does it mean biting the bullet and go all out into guix? chrislck: managed to build-and-install, thanks. rather bare for now. needs a .glade->screen example! dsmith-work: greet dsmith-work: sneek: botsnack sneek: :) dsmith-work: GoodBot dfeng: Hi! dfeng: I'm reading the Guile Reference Manual: dfeng: https://www.gnu.org/software/guile/manual/html_node/Symbol-Keys.html#Symbol-Keys dfeng: the code snippet does not work: dfeng: (assq-set! car1-properties 'seat-colour 'black) dfeng: In procedure set-cdr!: Wrong type argument in position 1 (expecting mutable pair): (seat-colour . red) rekado_: I think that’s not the only instance in the manual where it shows the use of a quoted list and then tries to mutate it. rekado_: you would need to use an alist that wasn’t constructed like that. dfeng: rekado_: do you know how to build this alist? dfeng: rekado_: is it a bug in the documentation? rekado_: (define car1-properties (list (cons 'colour 'red) (cons 'transmission 'manual) (cons 'fuel 'unleaded) (cons 'steering 'power-assisted) (cons 'seat-colour 'red) (cons 'locking 'manual))) rekado_: not pretty rekado_: but this one is mutable rekado_: I don’t know if there’s another way. dfeng: rekado_: ah, thanks! rekado_: generally, I think it’s better to use hash tables when you want mutation. Or to simply cons a new value onto an existing alist. lloda: Guile has acons fwiw dfeng: in Elisp (in Guile): (setq lst '(a b c)) dfeng: (setq lst (cons 0 lst)) dfeng: it works! dfeng: lst = (0 a b c) dfeng: or rather: (setf (cadr lst) 0) which gives lst = (a 0 c) using (setq lst '(a b c)) dfeng: although it "does not work" in Guile Elisp jcowan: It shouldn't work at all, because in no Lisp are you supposed to be allowed to modify a literal constant like that. jcowan: Try (setq lst (list a b c)) instead. lloda: Guile has procedures-with-setters for that sort of stuff Minall: Hello guile! Minall: Can guile be implemented in other languages? Minall: Python, for example pkill9: i think so, it can be used as an extension language for software written in C pkill9: so probably Python as well Minall: Hello guile!, Minall: Can guile be implemented into other languages? pkill9: Minall: i think so, it can be used as an extension language for software written in C Minall: Yes, I read about C, but can It be used in programs for example, written in python? dsmith-work: As in can Python call into Guile? Or maybe Python -> C -> Guile? dsmith-work: I would be very surprised if anyone has ever done that. Minall: Yep Minall: But I mean more like, a project written entirely in python is missing something... Can I build that 'something' in guile, and it would work? dsmith-work: Not without a *lot* of work. And it might not be possible. OrangeShark: You can probably write python that runs on guile OrangeShark: someone is working on a python language for guile dsmith-work: And you would probably need to write to the Guile C interface. OrangeShark: or have them communicate somehow Minall: wow, that's tought Minall: Thanks for the aclaration guys! Minall: I have to go now... later! jcowan: There are certainly Python libraries that allow such things, for example Lupa which allows you to run Lua code inside Python. Wherever there is a C API, Python can communicate with it. str1ngs: daviid: I filled this bug report. not sure if this is expected behavior though. https://lists.gnu.org/archive/html/bug-g-golf/2019-08/msg00000.html str1ngs: I left a trailing ; in my example use case. daviid: str1ngs: I add to approve the email, since youy didn't register to the bug list, please register str1ngs: daviid: ahh I signed up but I didnt click subscribe on the confirmation email. done now daviid: but it's the first time I do this, I still didn't receive the email 'per se', not sure I approved sing the correct procedure. let's wait a bit more it might take a few minutes ... or an hour or so, don't now. anyway,in the mean time, str1ngs: in regards to the bug, I'm not sure if that's working as intended. though I suspect it might be better to return something. since it's not easy to determine when a continuation could be used. just my thoughts on return void. daviid: I won't change that: by definition. a returned value that has a void signature will always return nothing: you can't expect to use these procedurs from callers that raise an exception if not value is returned, this is a bug on your side str1ngs: void is my C translation. I'm not sure what constitutes as nothing or what webkit-web-view-load-uri returns in the context of scheme daviid: nothing is not unspecified, which is not undefined ... if you want to call these from callers that expect a values, you have to wrap them yourself, but, imo, this is a very bad idea anyway daviid: str1ngs: nothing is nothind daviid: (values) daviid: generally, it is because those procs have side effects in the C world, such as filling a struct, an instance ... str1ngs: I see I will just add my own continuation, in this can I don't have control over the calling code it's a macro. and it expects the continuation to return a value. sorry for the noise str1ngs: s/can/case* daviid: str1ngs: no problem str1ngs: I was a little hesitant about that bug report. but at least I have a better understanding of expected behavior. and scheme :) daviid: I still did not receive a copy of the original email though. anyone here is mailman knowledgeable and could give me a little hint? i received a request for approval, which as suggested I responded to with the first line of the content of my answer to the approaval request email to the list owner, myself, using the header: Approved: password... daviid: it seems it has been approved, sinc it isnow in the archives, however, I didn't get a copy, then I can't respond, nor close it ... what am i doing wrong? quiliro: hello... i have been fidling in the guile command line.... but i still do not understand what lambda does...i know it is an anonymous function ... that means it does not have a name... but what is its use? quiliro: s/command\ line/interpreter/ quiliro: $ echo $GUILE_LOAD_PATH quiliro: /home/quiliro/.guix-profile/share/guile/site/2.2:/run/current-system/profile/share/guile/site/2.2 quiliro: SORRY kori: quiliro: you can use a lambda like this kori: scheme@(guile-user)> ((lambda (x) (* x x)) 2) kori: $1 = 4 kori: anywhere you can use a value you can use a lambda dsmith: Anyone here with ops? bandali: around right now? don’t think so. you can see the list using `/msg chanserv access #guile list' and msg them whenever they’re around dsmith: I just need someone to /kick the bot. daviid: sneek_: botsnak quiliro: kori:thank you ... quiliro: but a value can be used on a let and on a define also dsmith: The bot is "banned/quieted". Keeps trying to change it's nick back to "sneek" but is denied. daviid: dsmith: maybe i missundertood, do you really mean to use the kick command? don't have that priviledge i think dsmith: From the logs: dsmith: => NICK sneek dsmith: :livingstone.freenode.net 435 sneek_ sneek #guile :Cannot change nickname while banned/quieted on channel dsmith: bandali: rlb, wingo, ^ dsmith: Yes. I can restart it, but I'd like to see what happens when it's kicked daviid: str1ngs: I just pushed a patch so g-studly-caps-expand handles token exceptions daviid: please pull/make/make check/make install, and read the doc, or the patch, then update your web-kit* class name uage to webkit-* dsmith: sneek_: botsnack dsmith: !uptime daviid: str1ngs: scheme@(guile-user)> (g-name->class-name "WebKitWebContext") daviid: $5 = nalkri: Make the bot log in regardless of what nick it's on and then it should be able to change nick daviid: and not anymore daviid: if you still want that though, lok for %g-studly-caps-expand-token-exceptions in the manual daviid: have to go, bbl or tomorrow dsmith: nalkri: It's trying to change it's nick. But freenode is not letting it. nalkri: dsmith: Identify with nickserv, then log in nalkri: Sorry, identify with nickserv, then change nick dsmith: The message is ":livingstone.freenode.net 435 sneek_ sneek #guile :Cannot change nickname while banned/quieted on channel' dsmith: nalkri: This channel has “+q $~a” meaning connections not identified with nickserv are quited here dsmith: Yes, pretty sure the bot is Identifed with nickserv nalkri: Yes, if you get it to identify with nickserv (e.g. “/msg nickserv id name pass”) it will work nalkri: It's not, do /whois sneek_ dsmith: Hmm. dsmith: Hmm. "sneek" registers with nickserv. But "sneek_" is not. nalkri: Right, after you log in you can group the backup nick to the account nalkri: For now just get sneek_ to do the equivalent of “/msg nickserv id sneek ” nalkri: Then look at “/msg nickserv help group” *: dsmith assumes a new identity,,, nalkri: You don't need to be connected with one of your registered nicks to log in, as long as you specify the nick in the id command dsmith: nalkri: So. The bot does register with nickserv, but did not have "sneek_" in the group. Now it does. You think that will let it change it's nick back? dsmith: sneek: botsnack sneek: :) dsmith: !uptime sneek: 23:12:45 up 7 days, 9:47, 1 user, load average: 0.02, 0.03, 0.05 nalkri: dsmith: Well, it wasn't identified before, maybe it tried to but with an invalid nick(because not grouped)? dsmith: We will see. dsmith: Used to work. dsmith: When reconnecting an getting a "*_" nick, it would attempt to get it's normal nick back. And it would just work. Something changed on freenode to prevent that. Hopfully, this grouping thing will help. nalkri: Maybe the quiet on $~a wasn't set on this channel before nalkri: Because it's that that was preventing a nic change sneek: Hello *: sneek wags dsmith: sneek_: botsnack sneek_: :) dsmith: Hmm. rlb: dsmith-work: did you still need help? (Assuming it's something I can do.) str1ngs: sneek: later tell daviid, will check it out thanks. sneek: Got it. wingo: good news! i think i know of a simple transformation that will allow inlining and contification of top-level bindings, with maximum compatibility with existing guile code weinholt: wingo, sweet! weinholt: do you have any recommended reading on contification? wingo: weinholt: i do, let me dig it out wingo: ;;; See Kennedy's "Compiling with Continuations, Continued", and Fluet wingo: ;;; and Weeks's "Contification using Dominators". wingo: or http://wingolog.org/archives/2016/02/08/a-lambda-is-not-necessarily-a-closure for a brief mention wingo: or http://mlton.org/Contify also Minall: Hello guile!, I'm a little confused... sneek: Minall, you have 1 message. sneek: Minall, rekado_ says: You can just use “/home/Minall/Documentos/Guix-Packages” in the channel definition. Minall: What does (define*) do?, And without the "*"? iyzsong: Minall: 'define*' supports optional and keyworded arguments, where 'define' not. Also there is 'lambda*' and 'lambda', see more at 'lambda* and define*' of the guile manual.. lloda: we should run a docstring marathon or snarf the texis or something. There's a ton of stuff in Guile without any inline documentation. lloda: inline <= I mean in the repl Minall: iyzsong: Thanks, that was very aclaratory! dsmith: Minall: And if you meant literally (define*) as in no arguments, that's a syntax error. Minall: No, I mean as a whole jeje dsmith: lloda: Great idea! dsmith: sneek: help define Minall: And (define) without the "*" dsmith: sneek: help cons Minall: ? lloda: also some functions do have help but it's of the aarg! sort. For example I always forget the order of args in kons in fold and the help of fold omits precisely that. dsmith: Minall: the define* (with a star) is a guile specific Minall: That was a stupic question lol Minall: (define) is to define variables ok lol Minall: Thanks guile! dsmith: Minall: Just look at the index in the manual. As in https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html#Procedure-Index dsmith: Minall: And then to https://www.gnu.org/software/guile/manual/html_node/Top-Level.html#index-define Minall: Thanks dsmith, that's very helpful Minall: Thank you very much! dsmith: sneek: guile help define sneek: No documentation found for: sneek: (guile): define dsmith: sneek: guile help cons sneek: `cons' is a procedure in the (guile) module. sneek: - Scheme Procedure: cons x y sneek: Return a newly allocated pair whose car is X and whose cdr is Y. sneek: The pair is guaranteed to be different (in the sense of `eq?') from sneek: every previously existing object. weinholt: wingo, thanks! Minall: What does @@ mean starting a parenthesis? Minall: It means, refer to? wingo: Minall: it's to reference a private binding in a module Minall: wingo: Thanks!, it makes sense now! dsmith-work: Morning Greetings, Guilers amz3: hello all, I submitted an SRFI for hooks based on Guile, elisp and CL hooks. amz3: I would like to know if anybody it taking advantage of the ordered nature of hooks in Guile str1ngs: amz3: in nomad I used hooks, which are really useful especially for replicating emacs like features. though I can't say ordering has been a factor at this point. though I have thought of ordering. what is unique about guile hook order? just curious myself amz3: str1ngs: tx for the reply. amz3: well, the order is specified unlike the SRFI I wrote which does not specify the order of execution. amz3: It seems to me, specifying the order of execution can lead to difficult code to debug if the user rely on the order of execution to introduce coupling between a hook's procedures. amz3: str1ngs: btw, 10 years ago, I wrote a web browser called nomad too :) amz3: str1ngs: it was in Python and it was a bad idea. str1ngs: ha great minds think a like, I'm using guile I don't know if it's a good idea, but sure is fun. amz3: str1ngs: (I tried to code the rendering engine...) amz3: str1ngs: sure it is a good idea. str1ngs: I think there is one hook I've been meaning to look at were ordering is a factor. And I would say order is a good idea. I'm curious if elisp is order dependent. I would think so? str1ngs: oh rendering engine was most ambitious indeed :) amz3: guile hooks are inspired from elisp hooks with a similar interface. They recommend against taking into account the order and the documentation doesn't tell what order it is. str1ngs: I guess ordering is tricky, especially if they can be remove. which is one feature I have used in emacs before. janneke: str1ngs: did you get my /query about pierre yesterday? str1ngs: janneke: I'm just getting it now, but he was able to contact me via email janneke: str1ngs: very good, not sure where this goes but you never know str1ngs: I apologize for the inconvenience . I had forgot I was committing code under a email address I don't read often enough :( janneke: str1ngs: haha, oh well pierre choses not to use irc; i'm happy he wants to talk str1ngs: janneke: it is interesting. though somethings I'm pretty confident I wont move on. 1) guile 2) emacsy 3) GPL str1ngs: other then that I think I can remain open janneke: str1ngs: yeah, nomad might be able to steal ideas from next or the other way around (searching, annotating the html, bookmarks etc.) but code-wise i don't really see it tbh str1ngs: janneke: next some good things. it's client/server model using DBUS is very intresting str1ngs: has some* str1ngs: it's flex searching is quite nice as well heisenberg-25: Is there a gRPC implementation in scheme? str1ngs: janneke: I just noticed emacsy does avoid building hello-emacsy if freeglut is not found. so I think nly's changes have improved on this janneke: str1ngs: yes, it's an improvement even if it's a workaround. i think it could be automatic, but i haven't had time to look into it str1ngs: janneke: it seemed automatic. I did not need to pass --without-examples str1ngs: daviid: the new class mappings look good. though for some reason functions and methods names are now reversed. http://paste.debian.net/1095882 jcowan: I'd like to be interested in emacsy, if only I knew what it was for. str1ngs: jcowan: think of emacsy as a guile library for creating emacs like interfaces jcowan: So it's a framework (emacsy is in control and you plug your code into it)? OrangeShark: I want to try creating something that uses emacsy str1ngs: jcowan: you retain control. emacsy just provides things like buffers, key bindings, emacs like windows jcowan: But it has the event loop, correct? str1ngs: no you have control over the event loop. emacys uses a tick to denote the even loop. str1ngs: it's pretty flexible that ways. str1ngs: s/ways/way str1ngs: jcowan: though when you call emacsy-tick it will handle events that are queued for emacsy to handle jcowan: Sorry, what is a tick in this context? str1ngs: jcowan: an emacsy tick is basically an increment that you call from an event or within your event loopo jcowan: Ah. str1ngs: jcowan: emacsy is for the most part pretty UI program independent. the source has examples using gtk and also GL str1ngs: but you could just as easily use emacsy in a ncurses program as well jcowan: Okay, so the windows are not screen windows at all. *: jcowan looks up the Emacs definition of "window". jcowan: Ah, now I get it. str1ngs: no screen windows in emacs are called frames str1ngs: I think a emacs window might pre date say an X11 window str1ngs: don't quote me on that :P jcowan: yes, the first Emacs in 1976, the first X (not yet X11) in 1984. Of course, when Emacs ran on hardware terminals, there was barely any need of a name for the frame, since it was inherently the only frame. jcowan: s/ran on/ran only on dsmith-work: rlb: Thanks. Nope. No longer need to kick the bot. str1ngs: jcowan though terminal frames are now I thing. alt east if you use something like emacsclient str1ngs: now a* *: sneek stretches amz3: sneek: botsnack sneek: :) daviid: yeha! sneek: Welcome back daviid, you have 1 message. sneek: daviid, str1ngs says: will check it out thanks. daviid: sneek: tx daviid: str1ngs: oh, what a mess, let me fix this, sorry! dsmith: sneek: botsnack sneek: :) gabbiel: should I install guile 2.2.6 or guile 2.9 ? lispmacs: Hi, I'm using Guile on a Debian 9 system. What procedures are of interest if you want to make something happen at a certain time of day? schaeffer: o/ taking a look at the 8sync docs - the example at the top of the page seems broken: https://www.gnu.org/software/8sync/manual/html_node/Writing-our-own-actors.html schaeffer: it looks like i'm getting the same error as described in the bug report when using the #:class allocator, but for #:each-subclass as well lispmacs: does Guile has something like Racket's void? lispmacs: i.e., void data type, or a nil or something str1ngs: lispmacs: any empty list is nil '() lispmacs: str1ngs: okay, thx str1ngs: as far as I have seen anyways lispmacs: i mean, (cons okay (cons thanks '())) str1ngs: lispmacs: (null? '()) evaluates to #t so sound right str1ngs: daviid: maybe stepping away from the proxy settings for now. is that functions like this don't work. (unspecified? (gtk-window-new 'toplevel)) $1=#t daviid: str1ngs: wrt proxy settings, i god an answer on #introspection, these boxed type are opaque, which i (naively) thought didn't 'exist' when dealing with GI str1ngs: daviid: oh that's good news. so there is still potential then? daviid: i thought if it existed, i would receive the info is-opaque from either the callable info, ot ars, but what happens is when a boxed type returns its size as 0 (zero), thn it is opaque daviid: *or args introspection str1ngs: okay that might explain the size-of error then daviid: now i know what to 'look for', give me some time to solve this problem str1ngs: no rush, the unspecified return values are probably a bigger issue daviid: remeber me this (gtk-window-new 'toplevel)) later ok? one thing at a time ... :) daviid: yes there is hope, I will fix this asap and will let you know str1ngs: okay sounds good, (webkit-web-context-get-default) might be a better candidate since it ties in with the proxy settings daviid: that is another problem, because webkit-web-context-get-default returns a GObject ubclass instance, not a C struct pointer ... will solve this to str1ngs: ahh I was hoping they were related daviid: I'll work on opaque boxed type first daviid: I should have known that, I'm sorry I didn't str1ngs: you know just when I think I understand GObject classes. I realize I don't lol. I'm guessing you are farther down the rabbit hole then me in that regards. daviid: for a scheme user, everything should just work daviid: I thk you again to point me to these corner cases and for your patience str1ngs: no worries, I'm just glad to have found the issue. str1ngs: I guess for me I now how it translates or works on the C side. so it's easy for me to guess how it should probably look in scheme. daviid: i'll work on it and get back asap str1ngs: btw gtk-window-new cane be worked around with (make ) so that is not as pressing str1ngs: s/cane/can daviid: ok str1ngs: thanks for getting back to me on that. and no rush daviid: it is of a tremendous help that you are using g-golf while it is still in development str1ngs: I'm hoping it will be a good candidate for nomad. so far it's been very useful particularly the webkit classes daviid: great dsmith: sneek: botsnack sneek: :) dsmith-work: Wednesday Greetings, Guilers nly: janneke is this expected behaviour? http://nly.info.tm:9001/nomad/agenda.log janneke: nly: that seems pretty broken :) str1ngs: nly: can you test with version 0.3. I'm wondering if this is related to the scratch gaurd str1ngs: guard* nly: do you want me to checkout specific commit? str1ngs: if you check version-0.3 should put you on that version str1ngs: checout* str1ngs: b l in magit str1ngs: or it could be buffer-next! nly: http://nly.info.tm:9001/nomad/agenda-v0.3.log str1ngs: okay so this has not been introduced. seems to be an issue with mru? nly: yeah nly: note: since next-buffer is interactive i had to use mru-next copied from next-buffer str1ngs: trying to think if that would have an impact str1ngs: I mean you can maybe write this test interactively with hooks and high level functions. though I suspect the result would be the same. str1ngs: I think kill-buffer will call remove-buffer! eventually. and that looks like the issue here str1ngs: nly: maybe a good start is to write a proper test that catch's this error str1ngs: nly: test/buffers.scm str1ngs: err buffer.scm nly: that link's now offline, sorry nly: surprisingly calling buffer-previous and then remove-buffer works str1ngs: yes, it's definitely order dependent which is not surprising due to mru nly: i have a half assed immutable queues module for guile, srfi-124 and 131 nly: taken from jcowan nly: maybe use that instead of qs? str1ngs: that would be alot of work no? nly: yup str1ngs: but that something for janneke decide on. first we should address what's causing this bug. str1ngs: I think a test to replicate it is a good start. then we can go from there manumanumanu: wingo: great! I am trying to understand _when_ define becomes letrec and when it becomes as fast as let*, but sometimes getting a feeling for when optimizations get done is harder than I'd like to admit. With macros I can at least do ,opt :D manumanumanu: wingo: just read the commit message. I didn't realise it got _that_ good. Fantastic manumanumanu: wingo: btw, allowing defines in arbitrary places is harder than I thought. It can't only be done on a syntax level, since that will make (if something #f (define b "hej") (display "what the fudge")) valid. My usual macro approach is useless :D jcowan: manumanumanu: If you really want that, use a (let () ...) wrapper. manumanumanu: jcowan: I don't really want that, that's the thing :D I just wrote a macro that allowed for defines in expression context by wrapping every subsequent expression in either letrec, let or let*, but it has the shitty side-effect in the example manumanumanu: Which means a syntax->syntax transformation isn't good enough without hard-coding all the exceptions. manumanumanu: Which I don't want. manumanumanu: I don't know how the schemes that allow arbitrary placement of define do it, but I suspect that's not the way :D jcowan: I don't know of any that allow truly arbitrary placement. manumanumanu: but they don't do rewrites at macro expansion time jcowan: Some allow expressions and definitions to be intermingled with in lambda or let blocks, but that's not *arbitrary* jcowan: (+ 2 (define x 3) x), I don't think that works anywhere. jcowan: on any implementation manumanumanu: good idea... manumanumanu: of course! manumanumanu: jcowan: Thanks. I didn't think about doing it that way. That is of course the simple solution! I could just re-bind begin,let,let*,letrec,letrec* and lambda to use my own syntax-rewriting macros. manumanumanu: Whether it is a good idea, that doesn't matter to me. It is just fun to do :D *: jcowan nods. manumanumanu: It is a much better idea than what I am currently doing :D manumanumanu: And not only that, it is simple to do! daviid: I don't like that convention that rename packages guile-*, please don't do that for g-golf, thanks str1ngs: daviid: I updated my definition in nomad. I just have not push the changes yet str1ngs: daviid: here's a simple char** example using glib. http://paste.debian.net/1095535 str1ngs: but maybe const gchar * const *strv is not handled yet? or an edge case? str1ngs: actually proxy settings new takes const gchar * const *ignore_hosts so this should be a good test case I think. str1ngs: but proxy setting seems to have annotation for types etc daviid: str1ngs: we'll be with you int 10mi daviid: *in 10min daviid: str1ngs: the thing is that I should block the import of Glib, GObject, because, for bootstrap reasons, what is needed is binded 'manually', and automatic bindig of those conflict,obviously ... daviid: só, I would need to manually bind g-strv-contains, which I won't , now daviid: but tx daviid: it is fine to test using s selective imports from clutter, gtk, webkit ... at least for the time being daviid: wrt to webkit-network-proxy-settings-new, I'd like to know if you ever made use of it from C? did it work? dsmith: sneek_: botsnack dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen str1ngs sneek: str1ngs was here Aug 13 at 01:09 am UTC, saying: but proxy setting seems to have annotation for types etc. gorf`: Hey dsmith: sneek: seen gorf` sneek: gorf` was here Aug 13 at 02:40 am UTC, saying: Hey. str1ngs: daviid: I'll try to find a better example for ghar** I though I might be pushing my luck wit GLib :) str1ngs: err gchar** daviid: str1ngs: don't worryfor now str1ngs: I'll locally test proxy setting. but it's probably going to be an online test. which wont be good for a g-golf test. Maybe I'll find something in clutter that uses char** daviid: str1ngs: I need to check g-golf against namespace, wether oeone like it or not. people/distro may skip checks anyway, individually, or 'per distro', but I can't not check g-golf against 'ral' namespace daviid: wrt webkit-network-proxy-settings-new, I thought you 'severely' did need it, did use in in C .. but no problem either, just wanted to make sure how can possibly anyone make use of the result of that function, if it is, by definition, always an empty ist .... daviid: #instrospection did not answer either ... str1ngs: yes, we need it. right now it's in pure C. but I need to port it over. daviid: an web is not my domain, but i want nomad to be happy daviid: ok, if you need it, tell me what the C code returns daviid: my guess is it is an empty C struct, but ... daviid: a pointer to, to be more precise, but what is its content is the question of course ... str1ngs: should return WebKitNetworkProxySettings * webkit_network_proxy_settings_new () daviid: yes daviid: which is an empty structure str1ngs: which is a struct yes daviid: an empty struct, in C, daviid: str1ngs: here is how g-golf sees it https://paste.debian.net/1095497/ daviid: hence always an empty list when you call webkit-network-proxy-settings-new, no matter what ... str1ngs: mainly it gets passed to webkit_web_context_set_network_proxy_settings which sets the proxy setting given the context you pass str1ngs: normally you just find the global context and pass that. but you can also get the context from a current webview daviid: str1ngs: i don't now how to say it in a different way: the GIStructInfo that I receive from the "WebKit2" namespace is empty str1ngs: I was looking at structs abit, but I wasnt 100% sure how you would create a new one in g-golf daviid: it is empty, no definition, no fields ... daviid: besides, I can't see any definotion in their manual either str1ngs: the struct could have private fields though. but it' just a struct not GObject class which is add str1ngs: odd* str1ngs: let me see if I can find it in a header file str1ngs: my guess if it has fields its of char* proxy_host char** ignore_hosts. would make sense dsmith: sneek: botsnack sneek: :) nly: nomad now runs from 'guix build guix-loca.scm' sneek: nly, you have 2 messages. sneek: nly, str1ngs says: substitution looks good. Ironically I had a commit almost identical to yours. sneek: nly, str1ngs says: substitution looks good. Ironically I had a commit almost identical to yours. nly: hello str1ngs: nly: oh you picked up on my changes. there are some cough hacks to get it working lol str1ngs: I had to propagate and use some uneeded imports to get it working. but I think it can be refined str1ngs: err inputs I meant nly: v can clean it up as we go daviid: str1ngs: my battery is low, if I leave abruptly, bbl or tomorrow str1ngs: nly: for native-search-paths can you access inputs from there. might be better then wrapping if not we'll have to wrap GI_TYPELIB_PATH str1ngs: daviid: no worries str1ngs: nly: nvm you beat me to it lol str1ngs: nly: nice work, thanks for these additions str1ngs: nly: expect some breakage though. I'm still porting somethings nly: ok zhlyg: Could guile's boehm-gc usage somehow interfere with the clients boehm-gc? wingo: moo wingo: zhlyg: if guile and a client attempt to initialize boehm-gc in different incompatible ways, maybe wingo: it can work tho zhlyg: I get a sigsegv in GC_malloc_kind, not sure why, looking at it in gdb now. Next attempting to use GC-8.0.4 in client, but guile would still be at 7.6.4. wingo: does anyone here use arch linux, and if so, can you request an update of https://aur.archlinux.org/packages/guile-git/ plz wingo: to package guile 2.9.3 wingo: that way i can poke ecraven to run some benchmarks :) ecraven: ;) I keep running into problems with specific Schemes, I really have to turn everything into containers :-= *: wingo has a fixing-letrec-reloaded pass, woo zhlyg: ecraven: guile+rumpkernel ? :) wingo: manumanumanu: just landed "fixing letrec, reloaded" which improves codegen for local "define" wingo: and is a step on the path towards better top-level complication too jonsger: wingo: In theory I could now start with the ppc64le stuff, as my machine is up and running. But I need to fix some more important packages before (mesa, firefox, nextcloud, libreoffice...) lloda: is 'FAIL: version.test: version reporting works' something obvious? it happens all the time and I just ignore it wingo: lloda: i think it means you need to autoreconf -vif wingo: lloda: it's not important lloda: ok thx lloda: I think I've asked it before & forgotten it :-| wingo: np : wingo: ) wingo: jonsger: lmk when you want a video call regarding lightening wingo: probably when you have a couple weeks of good hacking time free ahead of you dsmith-work: Tuesday Greetings, Guilers wingo: heya dsmith dsmith-work: wingo: Very exciting all the happenings with the compiler. dsmith-work: wingo: And a tarball release build took only 6 minutes! wingo: :) str1ngs: daviid he's a basic proxy setting test case. I used serfi-64 http://paste.debian.net/1095618 str1ngs: srfi* sp1ff0: Hi: having trouble with guile & readline on MacOS: (use-modules (ice-9 readline)) => In procedure dynamic-link: file: "guile-readline", message: "file not found" sp1ff0: Has anyone seen this before? str1ngs: sp1ff0: how did you install guile with homebrew? rekado: this means that the binary library “guile-readline” wasn’t found. Try to locate it and add the location to LD_LIBRARY_PATH, for example. sp1ff0: str1ngs: yes, homebrew sp1ff0: rekado: trying that dsmith-work: sp1ff0: Not sure if it's still true, but MaxOS comes with a readline-like library that doesn't quite exactly match the gnu readline api. ./configure thinks it's available, but when guile actually tries to use it, it fails. sp1ff0: Ok. I'll horse around with dtruss to see if I can tell which .so it's trying to load. Thx all sp1ff0: DYLD_PRINT_LIBRARIES=YES did the trick daviid: str1ngs: well thanks, but that does not help, I know what g-golf see/does wrt webkit-network-proxy-settings-new, and no matter what, it will always return an empty list, as explained here yersterday. this is a WebKit2 problem, not a g-golf problem daviid: str1ngs: afaict, no GI language binding to WebKit2, on earth, will be abble to use that function str1ngs: daviid okay, is (webkit-web-context-get-default) returning unspecified expected behavior as well? daviid: str1ngs: let's be very precise - the result of calling webkit-network-proxy-settings-new from g-golf, or any other GI language binding is not undefined, it si very well defined, it is the empty list, always daviid: now, webkit-web-context-get-default is supposed to return an instance of the sublass, I see although the signature is good in g-golf, it does not return an instance, that could be a 'still missing' feature in g-golf, let me check daviid: * GObject sublass daviid: str1ngs: do you happen to know if there is a webkit2 irc channel, if yes, on what server? dsmith: sneek: botsnack sneek: :) daviid: str1ngs: #webkitgtk on freenode schaeffer: nyello artup: Hello all. I'm a Guile newb following a Scheme tutorial video on pairs and lists. I have (define mylist (cons 1 (cons 2 (cons 3 #nil)))), but why does (equal? (list 1 2 3) mylist) return #f? The only thing I'm doing differently is using #nil instead of null, which Guile doesn't seem to have. davexunit: artup: the empty list is '() not #nil davexunit: (cons 1 (cons 2 (cons 3 '()))) artup: davexunit: Ah, gotcha. It returns #t now. Thanks! davexunit: artup: yw! janneke: sneek_: later tell nly: the idea was to do that automagically to not build hello-emacsy when there is noo freeglut. let's find out what goes wrong there. --without-examples is an ok workaround, i hope we can remove that and else learn why we can't str1ngs: janneke: we can have examples not build if PKG_CHECK_MODULES fails. but there are quite a few dependencies there janneke: hi nly, just tried to say that configure.ac uses the HELLO_EMACSY conditional to not build hello-emacsy when there is no freeglut, possibly there's a bug there janneke: str1ngs: yes, configure only checks for freeglut and gl -- but it was about missing freeglut right? janneke: oh, have you talked to piere yet, he contacted me about `next' and nomad str1ngs: janneke nope, I have not heard from piere str1ngs: janneke: the issue was debian does not have freeglut 3.0. And the debian user didn't want to install the examples . So as long as we make it optional I think that works. however that maybe nly: hi str1ngs: janneke: I also added guile 3 support to configure.ac I did'nt see any issue with my limited testing under 2.9.3. But I had a small API breakage due to change-class. And I was wonder if we could make a metaclass of . since it's really hard to deal with scratch and *Messages* otherwise str1ngs: or maybe there is away I can modify metaclass in which case we can leave it nly: HELLO_EMACSY conditional is kind of 'automagic'. Someone else had problems with freeglut versions in debian. For now, a '--without-examples' configure flag will workaround that(on branch wip). And it builds apparently. nly: emacsy/examples were using freeglut 3.0 but debian had an older version or something like that nly: well, what str1ngs said now that i read it^. str1ngs: only hello-emacsy uses freeglut the rest are more reliant on webkit str1ngs: and gtk of course nly: hello nly: yup str1ngs: maybe we can just remove AC_ARG_WITH and AS_IF ? str1ngs: the AM_CONDITIONAL work okay right? str1ngs: though manual turning them off is a good thing too nly: idk nly: rant had the problem even with am conditional nly: i didn't, because of guix maybe janneke: ah, so configure's pkg_check_modules and am_conditional are not working as expected? it should check for freeglut >= 3.0 str1ngs: nly: that reminds me I have an issue both with g-golf and nomad and dynamic-link not working str1ngs: nly: nomad works at build time atleast but I use libtool that might we why it works str1ngs: nly: but not g-golf won't build. does it build on guix system? nly: nah str1ngs: nly: okay good to know *: nly guix build g-golf str1ngs: if you get a dynamic-link libgirepository file not found let me know nly: yeah that's it daviid: str1ngs: that is guix issue, not a g-golf issue nly: libgi 1.0 str1ngs: daviid: yes I just need to make sure it happens on guix system daviid: guix does use libtool, so you ned a phse that change the dynamic-link args to their full pthname location on your guix daviid: *guix does not use libtool str1ngs: what I mean is I use libtool in pre-inst-env but I'm dynamic linking within my project daviid: libtool does not work on guix, afaict str1ngs: so yes, libgirepository need to be added maybe as a LD_LIBARY_PATH? daviid: you need to talk to guix people janneke would know, to choose the best approach to build g-golf on guix str1ngs: nly: we could substitute dynamic-link is only used in 4 places str1ngs: nly: it would be more foolproof as well str1ngs: daviid: yeah this is easy to resolve . I'm only using this internally for nomad for context daviid: str1ngs: to build from the source tree, select the devel branch, and a phase to change the feww dynamic-link calls should be enough, on guix i mean - any othr distro that use libtool would just be fine running the autogen/configur/make/make check/makeinstall danse daviid: have to go, bb tomorow nly: thanks str1ngs: daviid: sounds good, I'll just substitute those libs ttyl nly: i get beyond libgi 1.0 after setting ld lib path str1ngs: LD_LIBRARY_PATH is kinda not good of foriegn distro's str1ngs: I don't know if it's encouraged even on guix str1ngs: I think just substituting the lib paths in the dynamic-link call is much safer str1ngs: also it based on inputs inputs so functional str1ngs: nly http://paste.debian.net/1095420 for libg-golf output can be used str1ngs: and I think when the absolute path is used . you must have .so extension IIRC str1ngs: libg-golf might need substituting at a different phase or check might fail daviid: yes, jsut befone install str1ngs: that might not work due to byte compilation. for now you can not substitute it . should still build daviid: str1ngs: oh, could paste here a 'real' test call for webkit-network-proxy-settings-new - and the expected result to, if possble, so i can check and add a test to the test-suite ... whenever you can of course, now we have logs ... str1ngs: daviid: yes, I'll put a test together. you want this in scheme or C? daviid: here i did this, scheme@(guile-user)> (webkit-network-proxy-settings-new "altosw.be" '("example.com" ".example.com")) daviid: $3 = () daviid: in scheme str1ngs: oh you added char** support/ daviid: the test does not fail, but it does ot seem to do anything , the result is an empty list, i'd expect 'something else, may my test is 'stupid' daviid: yes, but i didn't push yet, hence i ask for a typicall call str1ngs: ahh gotch will put something togeter str1ngs: wont be till tomorrow morning though. it's late now daviid: no problem daviid: it's ver very late here to .. nly: currently that will return a pointer str1ngs: nly: this is in g-golf so it will return a class nly: nice str1ngs: yes, we wont need websettings.c :P nly: it's return will be used by proxy-set or equivalent str1ngs: right, like the C functions but just in scheme daviid: nly, yes in C, in scheme the C struct is converted to a list of its element ... str1ngs: also we can use this for proxy as well nly: nice str1ngs: nly: if you see the webview.scm you see it in herits which is a GObject class str1ngs: nly: we we can treat a buffer as a directly str1ngs: nly: so if you need to pass a view to a setting or vise versa. you just pass the buffer as is str1ngs: nly: no boxed pointers anymore nly: cool nly: sounds like java lol nly: jk, idk what i am talking about nly: janneke: this freeglut thing was reported by rant on #nomad-browser, they can test it and give more info maybe str1ngs: nly: actually it's almost identically to websettings.c but without C str1ngs: nly: so in the future if we need additional webkit features. there available via g-golf nly: superb nly: how about bindings to other things? lol thinking about mpv for playing videos etc str1ngs: and we can offload more things. but I'm just piece mealing for now str1ngs: in terms of bindings I'm keeping NomadWebView which is a basically a GObject inherited from WebKitWebview str1ngs: so we can still add things from C. and it will be seen by scheme. we just won't need to snarf anywmore str1ngs: that's my rough plan anways str1ngs: nly: the big things is when we add new protocol support like gnunet str1ngs: or dat etc nly: exciting :) lloda: in Guile apparently applicable structs are procedure? lloda: wasn't sure but it makes sense nly: str1ngs there is one more way to resolve dynamic-link issues nly: maybe init.in file with @libgirepository@ and pkg-config? nly: g-golf builds now with test off nly: some error along the lines "clutter typelib not found" daviid: nly: you need to install the gir file/package for clutter nly: do we need it? daviid: for the tests only nly: ok thanks dsmith-work: Morning Greetings, Guilers dsmith-work: sneek_: botsnack dsmith-work: Bah! str1ngs: daviid. does (webkit-network-proxy-settings-new "127.0.0.1:80" '("*.gnu.org")) return a list for you? in terms of char** support? str1ngs: eg. (class-of (webkit-network-proxy-settings-new "foo" #f)) for me returns a null list. I'm wondering if passing a lists of ignore_hosts returns the the ignore list hosts. in which case we can just assert-equal the returned list. str1ngs: sneek_: later tell nly. substitution looks good. Ironically I had a commit almost identical to yours. dsmith-work: str1ngs: Unfortunatly, when the bot appears as " dsmith-work: str1ngs: Unfortunatly, when the bot appears as "sneek_" it seems to ignore commands. dsmith-work: I think some response from freenode changed, becuse it used to attempt to change it's nick back. str1ngs: ah good to know thanks str1ngs: sneek: later tell nly. substitution looks good. Ironically I had a commit almost identical to yours. str1ngs: :( daviid: str1ngs: it returns an empty list. but i now see that its C struct def is empty https://paste.debian.net/1095497/, so no matter what, the result will always be an empty list daviid: str1ngs: scheme@(guile-user)> (webkit-network-proxy-settings-new "127.0.0.1:80" '("*.gnu.org")) daviid: $4 = () daviid: I've asked on#introspection to see if an empty boxed type is 'normal' str1ngs: I'm still trying to find a better char** test. since proxy settings is hard to test without setting a context and a view. then doing a online test. g_application_run is another example but it blocks so not a good example either daviid: i can push what i have, as a wip, would that help? str1ngs: that would be great, I can atleast test with nomad, since i can't avoid online tests anyways daviid: ok str1ngs: and I'll find a better char** test for g-golf that does not involve blocking or online testing str1ngs: oh one issue I found. when using g-irepository-find-by-name if the calling module does not import g-golf then type int32 is not found str1ngs: well int32 is ubunbound I mean daviid: let me push first, but please paste an example here str1ngs: here is my use case now. http://paste.debian.net/1095498 str1ngs: this is not a big deal. but it could be a potential problem with g-golf daviid: everything that is not 100% expected and realiable is a big deal, thanks to point and still point all these bugs here, it is of a tremendous help str1ngs: I can distill this further if you need me to daviid: let me look at itfrst str1ngs: also I think (g-irepository-require namespace) should only be called once per process? str1ngs: the latter question if for my on understanding not a bug str1ngs: s/on/own daviid: pushed daviid: str1ngs: the paste, but what is the namespace and the content of lst? str1ngs: example call would be (gi-import-objects "Gtk" '("Widget")) str1ngs: I guess the issue is I'm calling g-irepository-find-by-name from another module. so the current module may not have g-golf imported. maybe I should not get fancy and just use g-irepository-find-by-name from the calling module daviid: you should put the use-module outside your define, as a top-level expression f the module, then you should check that info is not #f before you call gi-import-object daviid: but let me try here str1ngs: daviid: ahh that's the thing g-golf is used at the top of this util module. daviid: str1ngs: this works fie here http://paste.debian.net/1095501/ str1ngs: when you call gi-import-objects from another module? daviid: you mport your module, (gtk) which you could rename of course ... daviid: that's what i ddid in the repl str1ngs: okay, it must be related to my imports then daviid: here http://paste.debian.net/1095502/ str1ngs: okay I'll figure out why my imports are not working right str1ngs: well use-modules . forget I'm not writing golang :( daviid: it still imports to much, I need to fix that, but it shouldn't affect you str1ngs: g-irepository-find-by-name works well but Gtk functions I have not figured out how to selectively import str1ngs: when using g-import-funcion it's not much faster then (gi-import "Gtk") is what I mean daviid: that's fine daviid: when you selectively import GtkWidget, it imports all it needs to work str1ngs: I don't use many gtk functions so I can work around that. g-irepository-find-by-name and import Widget is the main one daviid: that's what I want str1ngs: yeah that works great str1ngs: the only gtk function I use is gtk-init and even then it's for tests str1ngs: I just stubbed it out in my typelib so it's no bigg str1ngs: daviid: also g-golf package for guix if you need it http://git.savannah.nongnu.org/cgit/nomad.git/tree/guix/gnu/packages/nomad.scm?h=feature-g-golf#n89 str1ngs: it needs a bit more tweeking. daviid: str1ngs: I won't change the way selective import works, it would be a terrible mistake not to import what an imported GObject subclass need to work, perfectly work and as expected .. daviid: wrt guix, tx, i wish a separate package, but i'll look at you def, tx daviid: as it isthough, it would need a rebuild every day or so ... so those who wnt to participate/use may as well just clone the repo,checkout the devel branch and make sure guix sees it ... str1ngs: if you want to snarf guile-g-golf I'll switch to using your upstream version for less redundancy str1ngs: also the recursive copy needs for the orgin to be deleted. I think that's mainly for the inclusion in the proile str1ngs: err profile str1ngs: also guile invocation is LD_LIBRARY_PATH=/gnu/store/jc8911bn7zys2kimp4bh0s2ibv8bksia-guile-g-golf-1-1.722b6d6/lib guile str1ngs: until I figure out a better way to handle libg-golf's dynamic-link the inputs are good now though str1ngs: just a FYI daviid: str1ngs: yeah, in the long run, i want a separate (gnu packages g-golf) daviid: but, i still don't have guix here daviid: so i'll let that to guixers ... str1ngs: yes, this was not intended for inclusion into guix, since you are the maintainer. was just for local builds only daviid: i have far to much to do already str1ngs: no worries daviid: you should name it g-golf, not guile-g-golf daviid: anyway, one day i'll use it, thanks str1ngs: will change the name :) daviid: str1ngs: why this? (setenv "GUILE_AUTO_COMPILE" "0") daviid: are you not compiling g-golf? rekado_: all Guile packages in Guix have the “guile-” prefix daviid: you should respect the original name , those which have guile- have that guile- intheir ame, i think str1ngs: daviid: when compiling it guix it will try to auto compile for some reason daviid: guile is already in the name ... str1ngs: daviid: normally for this I set GUILE_AUTO_COMPILE in pre-inst-env.in . str1ngs: or maybe guile.mk for g-golf I was'nt 100% if this was guix specific issue only rekado_: daviid: it’s just convention. We do the same for all Python packages. daviid: rekado_: i don't even understand why you do this, but fine daviid: str1ngs: i won't change any ofthe g-golf upstream file, except those 'linked to' the 'no libtool on guix' daviid: *I wuoldn't any of the g-golf upstream file, except ... daviid: that would be the root for heisenbugs str1ngs: no worries that's why I used GUILE_AUTO_COMPILE. though I'll look into it more see if something else is the cause daviid: you should not set GUILE_AUTO_COMPILE to 0 either, this does not make sence at all str1ngs: as far as I can see it's warning. it can't actaully write to HOME anyways str1ngs: I mean I can not set it. but then it warns about not being able to auto compile daviid: that makes zero ence to me to daviid: you should not set it and have zero warning of those daviid: though using autotool, the danse compiles everything in order, so auto compile is ot triggered anyway str1ngs: ah this is guix specific WARNING: compilation of /gnu/store/9alic3caqhay3h8mx4iihpmyj6ymqpcx-guile-2.2.4/bin/guild failed: maybe str1ngs: $HOME is not writable when building some it can not compile guild str1ngs: so it* daviid: ok, i'll leave that to you , rekado_ and guixers str1ngs: I think because guild is a script it will try to compile it. but this is outside the scope of g-golf's autotools. so should be okay to set it for that i think? daviid: I beleive rekado_ knows what he's talking about :), but keep it setting in the guix pakg def, notin any g-golf upstream fileforget daviid: and let's forget about my quiz, and hack str1ngs: no worries, that's why I didnt mention it I figured it was specific to guix. since when building locally I don't run into that issue. I mainly work locally myself. but I maintain guix files for nly mostly str1ngs: an maybe one day for inclusion to guix when I'm closer to an alpha release daviid: ok, I should soon merge the g-golf devel branch in master daviid: that would be a good time to add a guix.scm file in g-golf itself str1ngs: the guix package is self contained the s-expression can be snarfed as is. it needs some tweak still to removed orphaned files artup: Hello all, Guile newb here. I'm stuck on a Scheme tutorial. It has a code generation example where generated code is stored in mycode as ((define a 0) (define b 0) (define c 0)), then evaluated in (for-each eval mycode), which doesn't work for me. I tried using (interaction-environment) to satisfy eval to no avail. Any ideas? nly: you may be able to use (eval mycode (interaction-environment)) nly: (for-each proc list), where 'proc' should take 1 argument but eval takes 2 nly: you could define a new eval to your spec (define (myeval lst) (eval lst (interaction-environment))), this myeval should take only one argument and thus work with for-each artup: (eval mycode (interaction-environment)) didn't work, however defining a new eval did the trick. Thank you! lispmacs: hi, I am using guile-2.2.3, which doesn't seems to have the pointer->bytevector proc advertised in 2.2.6. What was previously used for this need? lispmacs: weird, it is listed in the documentation under rnrs bytevectors module. Why can't i see it as a binding? daviid: lispmacs: don't you need to import the module lispmacs: I've been trying. Maybe I'm doing something wrong lispmacs: ,m (rnrs bytevectors) gets me access to many bytevector functions, but the pointer-> ones aren't showing up lispmacs: also (import (rnrs bytevectors)) and (use-modules (rnrs bytevectors)) lispmacs: I can see like bytevector->unit-list, but no pointer->bytevector lispmacs: daviid: do you know correct command? are you able to call the pointer->bytevector procedure? lispmacs: maybe it isn't in that module lispmacs: but then which is it, I can't figure it out lispmacs: ah ha, (system foreign) lispmacs: had to grep the source code to figure that one out chrislck: dynamic-wind: what an odd name. is this a scheme-terminology? chrislck: or this has anything to do with civil engineering? rekado_: chrislck: I think it’s related to unwinding the stack. jcowan: chrislck: When you call a procedure, you do some things like pushing the return address and registers on the stack, which is called "winding up the stack", when you return from the procedure, you "unwind the stack" to undo those things. Dynamic-wind gives the programmer control of winding and unwinding in a dynamic extent of the program's execution. jcowan: Conventional programming languages with try-finally statements let you get a grip on unwinding, but those languages don't allow "rewinding" as Scheme does with call/cc. chrislck: jcowan: thank you :) not obvious from manual jcowan: Sure. What are elders for, especially elders who know how to persuade Google to cough up the history? :-) spk121: jcowan: mostly, as an old coder, I just yell "you kids, get off my lawn" or "back in my day" jcowan: That gets, er, old. Anyway, having an 11-year-old living with you does wonders for your emotional flexibility. chrislck: https://www.gnu.org/software/guile/manual/html_node/Control-Mechanisms.html#Control-Mechanisms sounds partly like Engineering lol... Computational Fluid Dynamics lispmacs: hi lispmacs: I embedded guile into a C application that uses pthreads lispmacs: if I run scm_call_2 on an scm procedure from within the main thread, it works fine lispmacs: but if I try to pass to call that procedure from another thread it segfaults lispmacs: like, I store the scm procedure in a global variable during the main thread, and then try to scm_call_2 it from another thread lispmacs: is there something I've got to do prep the call for running safely in another thread? lispmacs: hmm, found the Multi-Threading section in the documentation, maybe Ill find the answer there notnotdan: lispmacs: you need to call scm_with_guile in the thread before doing anything notnotdan: dunno if that's the problem you are having but i got bitten by that at some point notnotdan: aahh i should pick up my Guile bindings to TIC-80 lispmacs: notnotdan: with the API I'm working with, the API creates the thread, and then just runs a procedure I pass it a few thousands times a second. does it hurt anything to call scm_with_guile more than once in a thread? lispmacs: reference manual seems to indicate that is not a problem zhlyg: wouldn't it be enough to prime the stack during thread creation? lispmacs: zhlyg: well, I'm working with an SDR API which creates the thread, so I can't do that at thread creation, only when my procedure is called lispmacs: but it seems that just scm_init_guile from my procedure is working fine. according to the reference manual, if I call the function repeatedly it does nothing after the first time it is called lispmacs: hopefully there is no significant hidden performance penalty lispmacs: WHA HA HA, it's ALIVE!!! zhlyg: lispmacs: it should be cheap because it just pushes a GC marker on the stack and calls your function. Though I could be wrong. nly: hi janneke nly: emacsy documentation requires one to build hello-emacsy.c.x ... which further down the line requires "freeglut". guix has freeglut 3.0 where this is a non issue, but debian has a diff version as told by someone who tried to build emacsy there. workaround: Configure has a new flag "--without-examples" nly: and commented '@verbatim emacsy/hello-emacsy.c.x' something part in doc/emacsy.texi nly: is this okay? dftxbs3e: hi, I'm bootstrapping guile and it's taking forever and wont be multithreaded dftxbs3e: any idea what I can do? dftxbs3e: it's on these steps: BOOTSTRAP GUILEC ice-9/eval.go dftxbs3e: in guile-2.2.6/bootstrap wingo: karlosz: cps soup is effectively ssa, yes. just a couple of differences -- wingo: one, no basic blocks. you never know whether a binding in a $kargs is a phi or not. so it pushes you do to more flow analysis rather than traversing predecessor/successor chains wingo: for better or for worse. wingo: for better, as the optimizations are more robust; for worse, as it's a bit of a pain wingo: so in most formulations of ssa usually when you have a term, it defines a value or some values wingo: in cps soup the name is associated not with the term but with the continuation wingo: so multiple definitions for a phi don't have distinct names. a problem? i don't know. wingo: the second thing is that cps soup is formulated in such a way that makes it a persistent functional data structure wingo: that has the advantage that it's easier to be a bit more algebraic when you formulate compiler optimizations -- you don't have to worry about mutating the input to an optimization pass, because you always logically construct a new value wingo: it has the disadvantage of being slower to run wingo: but, it lets me do optimizations that i wouldn't have been able to do wingo: and that's basically it. seems to work for guile. OrangeShark: good day everyone dsmith-work: Happy Friday, Guilers!! OrangeShark: Happy Friday dsmith-work wingo: o/ str1ngs: daviid : changing is not that great of an issue. since the method's remain as (webkit-web-view-reload). just some feed back. I don't think it's worth too much effort to change the class names. Alos it my be better suited for Gtk class names to goops class names this way. str1ngs: daviid the only issue I've really had so far is (gi-import "Gtk") produces a noticeable pause for gtk. I understanding it's importing alot. but is there a way to improve on this you think? chrislck: Gtk? someone creating gui from guile? would be nice to see str1ngs: chrislck: actually this does more then just Gtk. it does gobject introspection. for context I'm talking about g-golf chrislck: cool chrislck: lots of this out of my comfort zone; all i'm doing myself is really cleaning up gnucash spk121: hi OrangeShark: chrislck: what sort of clean up are you doing in gnucash? chrislck: OrangeShark: functions, one by one :-o https://github.com/Gnucash/gnucash/commits/maint OrangeShark: oh nice chrislck: beautify, use srfi-1 (finally), tests, refactoring, dedupe, tabs->space, documentation chrislck: ... and use tail calls daviid: str1ngs: importing "Gtk" takes +/- 2s - I won't work on this now, as mentioned earlier, however, since you mostly work with WEbKit2, you selectively import only what you need daviid: *you may selectively import things you need from Gtk, not the all namespace str1ngs: ah how do I selectively import? str1ngs: I guess I can do (g-import "GtkWidget") daviid: no str1ngs: right that won't work daviid: see in the test-suite, search for g-irepository-require str1ngs: thank you, that gives me a place to look daviid: then g-irepository-find-by-name daviid: and then gi-import-object, or enum, struct ... see (g-golf hl-api import) to see those who are currently 'covered' str1ngs: also quick clarification should slot setters like this work. (!uri view "http:/gnu.org") or only getters? str1ngs: and other wise I would use (!set ($uri view) "http://gnu.org") str1ngs: err (!uri view) daviid: the latter str1ngs: I thought so, thanks for the info desttinghim: is it possible to load a lib*.a file using dynamic-link? str1ngs: desttinghim: not that's not how static libraries desttinghim: str1ngs, ? str1ngs: dynamic-link uses dlopen so it needs to be a dynamic library str1ngs: lib*.a files are archives that a used at compile time to statically include the library as part of the compiled program. daviid: str1ngs: I am working on the array type, **gchar for the time being daviid: str1ngs: it is (set! (!uri view) "http://gnu.org") str1ngs: that's a great addition daviid: should land today daviid: later today str1ngs: I am using (set! (!uri view) "http://gnu.org") str1ngs: also what version of guile are you using? str1ngs: I have a compile issue with util.scm and I want to make sure I'm on the same page str1ngs: the compile issue is not important. just might be a good FYI for you str1ngs: also I hope you got my feed back about class names. I think it's less of an issue then I originally thought. since the GObject method names translate nicely daviid: str1ngs: i don't push anything that doe not compile str1ngs: I assumed it was an issue with my guile stack. so no worries daviid: please pull, clean, compile and report ... tx str1ngs: will do karlosz: wingo: thanks for the detailed response! i think the immutable part of it is really interesting, though i think MLTon also does that. since my main issue with ssa is representing the phi nodes robustly/elegantly, i may give associating names to continuations (ie the cfg arrow into the merged basic block) a shot instead str1ngs: dsmith-work: tell is useful when the source information is the bot, but you need to direct the response to someone in the channel apteryx: how can I set backtraces width to a bigger value, everywhere? I tried: (debug-set! width 180) in my ~/.guile but that doesn't do it. nly: hi janneke nly: in nomad if i use (message ..) imported from (emacsy emacsy) inside the browser it works. but if i call it from a repl connected to the browser it returns an error "abort to unknown prompt". nly: is this related? https://git.savannah.nongnu.org/cgit/emacsy.git/tree/emacsy/c-tokenize.lex?h=wip-doc#n187 nly: maybe the command 'abort' cannot find the default prompt when called from a repl context? idk. Maybe someone else knows better nly: it'd be great if all procedures/values inside nomad behave just the same even if called remotely. manumanumanu: Ahoy hoy! manumanumanu: What would be a good name for a binding construct? I am writing a (def ...) macro that behaves like define, but with support for definitions in expression context, and apart from subsequent (def ...) I also want a binding construct that gets converted to let* for some extra speed. (bind name expr) would be nice, but bind is already a guile procedure manumanumanu: (let! name expr)? manumanumanu: (def ...) gets converted to letrec, same as (define ...). lloda: wow logs!!! much props rekado_ / rekado wingo: manumanumanu: define is the right name! wingo: we should change to be like racket and support mixed definitions and expressions manumanumanu: Well, I could do that, but I want a binding construct that expands to let* manumanumanu: or let manumanumanu: that doesn't "nest" manumanumanu: so I can do (let! a 5) (let! b 6) rest ... and it converts it to (let ((a 5) (b 6)) rest ...) manumanumanu: right now I have (def ...) let! and let*! manumanumanu: And I suspect that guile proper wants a real implementation instead of a macro one. manumanumanu: that is bolted on as a module manumanumanu: anyway, I agree with you manumanumanu: it is not a hard transformation to do (even I can do it, apparently) manumanumanu: but doing it on the macro level means I might not play nice with other macros. manumanumanu: but looking at the code for working with tree-il I... might... be able to do something manumanumanu: but it terrifies me wingo: :) eiro: hello people brutelumpen: eiro, hi rekado_: logs are now at logs.guix.gnu.org/guile pkill9: does `guix deploy` handle running `guix pull` on the remote machine? ng0: you might want to filter out the IPs for #guile and #bootstrappable, ie the join/part/leave/quit events ng0: it's not as if irc would be the best protocol to do this, but for stored logs it would be nice.. at least that was a request grothoff had for all channels at some point before the really long discussion became too tiring for me ng0: of course what you do is up to you, i just see that it's done this way already in #guix ZombieChicken: hmm pkill9: oops, wrong channel OrangeShark: yay logs :) rekado_: ng0: yeah, not sure why it doesn’t do it for #guile and #bootstrappable; it’s the same application. Will fix this later. rekado_: ah, it’s an old shell script… ng0: ok :) rekado_: it’s now handled by the log viewer rekado_: thanks for reporting it OrangeShark: rekado_: it works, great :) rekado_: (the link back to all the logs leads back to the *guix* logs; I’ll do something about this later) dsmith-work: str1ngs: Exactly! dsmith-work: Thursday Greetings, Guilers str1ngs: greetings dsmith-work :) apteryx: my color often gets lost at the Geiser REPL. any way to get it back without restarting the REPL? str1ngs: apteryx: can you define what you mean by color? apteryx: the different colors of the prompt, comments, REPL messages, etc. apteryx: sometime some output seems to confuse Geiser and everything turn into the same color str1ngs: apteryx: sounds like either an issue with gieser, or maybe the output? OrangeShark: the output gets truncated OrangeShark: for example in output that is really long, you might get a start " for a string, but no closing " ZombieChicken: Any of the nomad devs here atm? str1ngs: ZombieChicken: yep, whats up? str1ngs: also there is #nomad-browser ZombieChicken: Ah. I'll just go there then and ask my question daviid: sneek: logs? sneek: I could be wrong, but logs is http://bayfront.guixsd.org:3334/ daviid: sneek: forget logs sneek: Okay. daviid: logs is http://logs.guix.gnu.org/guile/ daviid: sneek: logs is http://logs.guix.gnu.org/guile/ sneek: Understood. daviid: sneek: logs? sneek: Someone once said logs is http://logs.guix.gnu.org/guile/ daviid: happy logged friday guilers! daviid: who has admin right here may change the subject line to inform of this new log adddress karlosz: is anyone here familiar with the guile intermediate ir, or can direct me to someone who is? karlosz: or IRs, i should say mwette: guile ir: https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/A-Virtual-Machine-for-Guile.html#A-Virtual-Machine-for-Guile mwette: and: https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Compiling-to-the-Virtual-Machine.html#Compiling-to-the-Virtual-Machine karlosz: yes, i saw those karlosz: as well as a lot of andy wingo 's posts karlosz: im more wondering how cps soup has worked out karlosz: i'm a common lisp implementer and the question of ssa or not has really knawed at me and other implementors davexunit: not to speak for andy, but my impression from reading his blog posts is that cps soup has been good overall. karlosz: one thing i never understood from reading the blog posts was - why cps soup and not ssa? it's not because of continuation support in guile, right? karlosz: one big problem we have is the representation of phi nodes - they seem yucky because they are special in the flow graph and require coupling between predecessors and arguments, as well as some invariants related with keeping them all in a cluster as the first instructions of a BB karlosz: so it's mostly notational stuff, but from what i gathered, cps soup really just is a different notation for ssa davexunit: that's a question andy could answer when he's around. davexunit: which he is often enough. or you could mail the list. dsmith-work: daviid: wingo, civodul, and mweaver (and maybe rlb) mwette: I believe the guile cps design is inspired by https://www.microsoft.com/en-us/research/publication/compiling-with-continuations-continued/ mwette: The first chapter of the book compiling with continuations by appel explains pros/cons of SSA vs CPS karlosz: i've read it mwette: CPS and SSA have been shown to be equivalent. I don't have the reference karlosz: but CPS soup is different karlosz: because there are no scope trees, as wingo writes about karlosz: the appel texts all predate MLTon's CPS -> SSA switch, and they're a little more biased to CPS, being older karlosz: Appel actually shows equivalence in his textbooks, but it comes down to the notation actually mattering when it comes to ease of transformation and keeping the notation valid mwette: it's been a while since I dug in. here is another that you may have alredy read: http://wingolog.org/archives/2011/07/12/static-single-assignment-for-functional-programmers karlosz: yep. another interesting thing is that in guile and cl we *don't* have whole program optimization karlosz: so its really not clear when ssa should be introduced karlosz: there's sort of a phase ordering problem there too, because using ssa would make certain closure optimizations easier, but without whole program optimization, its harder to closure convert/maybe impossible after ssa transformation, especially when you have mutable closure variables mwette: you are way ahead of me -- I think you need to address the comments to wingo; I'm guessing he would be interested in a discussion dsmith-work: Off Topic: Anyone ever use Hy? I do lots of Python in $DAYJOB (hey, at least it's not Java or C# !), and a lispy face to the code sounds really attractive. mwette: dsmith-work: thanks for the Hy comment -- I'll be checking it out dsmith-work: mwette: What would be cool, is a py2hy to convert some existing code.. manumanumanu: wingo: https://pastebin.com/bADTC6XM manumanumanu: Really simple example... manumanumanu: mapping test1 and test2 over (iota 10000000) yields a 2s difference in favor of test1 manumanumanu: but i don't really get the disassembly wingo: don't they look the same? wingo: the iota difference could be gc-related manumanumanu: but they iota over the same variable wingo: pretty sure that benchmark is gc-dominated wingo: iota makes a list tho, so does map wingo: and it's a bit of a pathological case for gc (a 1e8 serial data structure) manumanumanu: running it a couple of times changed it.. Sorry for wasting your time. manumanumanu: I need to deep dive into learning assembly! manumanumanu: Next vacation project. No gardening, only guile ,x wingo: np :) daviid: wingo: I was asking you because it needs, all it needs, is a channel admin to invite a bot - /invite globbot - that's all it takes, then we have good logs again rekado: daviid: we now have bayfront-log. rekado: I’ll also get the past logs from the gnunet folks. rekado: I’ll update logs.guix.gnu.org in a few days to also display the #guile logs daviid: rekado: it seems to me, with all due respect, and to save all of us some time, that this https://freenode.logbot.info/ is a better solution, immediat, a single command, and offers better display to daviid: i was gona suggest you do that for #guix actually, so should #scheme, #kawa ... karlosz: im curious on whether anyone has a retrospective on how well cps soup has worked as the guile ir so far karlosz: seems like everyone just reaches for ssa nowadays, so it would be cool to see what kind of concrete advantages over ssa have shown up rekado: daviid: I see no need to switch to something else for logging on #guix. It’s also just fine for us to have the logs on our own servers and to have a viewer that we can hack. daviid: rekado: sure, but we haven't done anything to solve this problem, #guile i mean, for about almost two years now, and an admin can type '/invite globbot', and that's it, solved. then, when we have solced our own servers, logs, i won't, but if someone wants to, fine, we can kick globbot, ans tah's it ... rekado: ? rekado: that’s not going to make the old logs available. rekado: I’m getting those from the people who ran the old logger. daviid: rekado: but it will start to log now, in one command, then we can work on ... and later kick the bot out ... daviid: anyway, that's what i would do, right now rekado: daviid: bayfront-log is already logging right now. daviid: where can i display it rekado: I don’t have a nice domain name yet, but it’s right here: http://bayfront.guixsd.org:3334/2019-08-07.log rekado: as soon as I get the old logs I’ll add them. *: rekado —> zzzZ daviid: ah, thanks! why on earth didn't we know about this? very cool daviid: we should make this available in our channel message, please ... rekado: it only exists since … 3 minutes daviid: oh!! thanks rekado super cool rekado: when the issue of logs was brought up above I thought it shouldn’t be hard to fix it … finally. rekado: later this week I might move this to logs.guix.gnu.org; we’ll see rekado: anyway, zzzZ for real :) daviid: good night tx again dsmith-work: sneek: logs? sneek: Someone once said logs is https://gnunet.org/bot/log/guile/ dsmith-work: sneek: oldlogs is https://gnunet.org/bot/log/guile/ sneek: So noted. dsmith-work: sneek: forget logs sneek: Consider it forgotten. dsmith-work: sneek: logs is http://bayfront.guixsd.org:3334/ sneek: Okay. dsmith-work: sneek: logs? sneek: logs is http://bayfront.guixsd.org:3334/ dsmith-work: goodbot daviid: dsmith-work: perfect, thanks! *: sneek wags daviid: dsmith-work: is it 'bot: one-word is ...' or can it be several words? *: daviid is a complete bot ignorant dsmith-work: daviid: it's actually many words dsmith-work: daviid: And unfortuatnely, sometimes the bot see a word and thinks it's being addressed. dsmith-work: And you get "some really really long description of something" is "done" dsmith-work: daviid: I need to fix it so it only recognizes it's exact nick. daviid: ah ok, i'll try to remeber that, and use it ... let's see :) dsmith-work: daviid: ask the bot for help. (notice how I'm always avoiding using it's nick...) daviid: dsmith-work: will do, yes i was also avoinding its nick when i did ask you ... :) dsmith-work: "tell" is just plain plain wrong. dsmith-work: I guess it's useful when someone is /ignore'ing you. You can have the bot deliver you message for you? dsmith-work: Or maybe it should be for looking up stuff. daviid: have to go, bbl, and read our new logs aha!! nobody will be able to write in my back anymore :):) just joking of course dsmith-work: sneek: logs sneek: logs is http://bayfront.guixsd.org:3334/ dsmith-work: sneek: tell daviid logs sneek: daviid, dsmith-work says: logs daviid: lloda: hello! did you solve the guile-cairo make distcheck problem? sneek: Welcome back daviid, you have 3 messages. sneek: daviid, lloda says: I mailed guile-user with the problems I have. If you have a separate branch that works please post a link and I'll try to merge myself sneek: daviid, lloda says: Also please request commit access again sneek: daviid, lloda says: please give a link to the working patches you have for guile-cairo and I'll try to merge them daviid: ah ok, will look into thsi and come back asap daviid: its unfortunate our 'real' logs are stiil not working daviid: ng0: any news on that front? daviid: text logs are next to unreadable and always very late (last time, 1 or 2 days ago, the delay was more thn 5 days ...) janneke: hmm, procedure-sources in (system xref) calls program? on every procedure janneke: a method is not a `program?', apparently janneke: so, that's why no breakpoints in methods/generics wingo: you could probably break in a method's procedure wingo: the program associated with a generic gets changed all the time tho, not a great place to break fwiw janneke: yes, i found method-source...i think i found it janneke: for a simple method: (define-method (test (o )) #t) janneke: this works: (program-sources (slot-ref (car (generic-function-methods test)) 'procedure)) janneke: now to find how to get this into (system xref) ... janneke: not sure if we can use such goopsy things like slot-ref there janneke: i want to fix ,break-at-source for methods ... so i hope we're fine janneke: yay, some progress janneke: ;;; WARNING (no instructions found for gaiag/m.scm : 12) janneke: Trap 2: Breakpoint at gaiag/m.scm:13. janneke: sources get added, but someone cannot find any instructions...grr ng0: daviid: in short: it's complicated. Worst case it'll happen in october, but I'm optimistic that I can do at least the current view this month. The logs are coming back, but the work wasn't very linear. ng0: for the old logs (prior to Drupal Bot handing in its resignation) the logs will appear much later *: janneke found program-sources-by-line ... must also learn about *: janneke sends WIP patch for GOOPS debugging support to guile-devel stis: hej guilers! lloda: the 9x times slower thing is gone in lightning now fwiw wingo: good morning guile wingo: lloda: that's good news! could have been jit latency; the old code allocator took quadratic time in the length of the compiled function *: janneke tries to debug ,break-at-source again janneke: hmm, i thought i had a not-so-nice patch, but the problem is more interesting janneke: the source-procedures uses strictly 'relative lookup, but in my case *sources-db* contains a mix of relative and absolute file names janneke: hmm, so that may be a guile compile bug? ... it seems relative names are preferred/expected wingo: janneke: it depends on how you invoke "guild compile" janneke: wingo: yes, let's fix our make\file :-) janneke: also it seems define-method's are not found janneke: i'm wondering if we should support/look up absolute file names in *sources-db* too wingo: methods might be special because of how they work fwiw, they might need some special support wingo: greetings rotty :) janneke: hmm, we compile with compile-file #:canonicalization 'absolute janneke: that helps with usable stack traces...let's use 'relative and fix stack traces later stis: hej guilers! hugo: Hejsan! wingo: good morning civodul: hello wingo! manumanumanu: good morning! amz3`: +1 *: wingo didn't get to jit over the weekend wingo: on this machine i see GUILE_JIT_COUNTER_THRESHOLD=50000 as about right, as a value that increases performance when JIT time is taken into account. if we can speed up the JIT we can lower it manumanumanu: wingo: I am going to try getting it up and running this week. Is there anything you want to have tested? wingo: fixed the optargs JIT issue. now all tests pass except those requiring hooks wingo: civodul: i think maybe for debugging purposes (code coverage, tracing, precise call counts in statprof, breakpoints, stepping) maybe we should just always fall back to the interpreter (i.e. fall back from jit to vm, never re-enter jit until debugging is done) wingo: wdyt? wingo: maybe in 3.0 then the interpreter can always run hooks, dunno, maybe that's too much overhead wingo: would be nice to remove the --debug / --no-debug distinction! civodul: wingo: sounds good; i suppose it would be very hard to do all that when there's jitted code civodul: though it'd be nice to keep the "regular" engine by default civodul: (without hooks) wingo: it's certainly possible to do in jit code fwiw civodul: by regenerated JIT code with calls to the hooks? civodul: i'm just guessing it's more difficult civodul: also more difficult to inspect local variables, etc. civodul: dunno *: civodul has to go civodul: ttyl! galex-713: ./.libs/libguile-3.0.so: undefined reference to `scm_to_off_t' galex-713: can’t compile git version :/ mwette: . amz3: ! chrislck: sneek:botsnack chrislck: sneek_ botsnack chrislck: :-( taylan: sneek_: botsnack taylan: oi, seems broken mwette: /quit rlb: Is there a way to detect a guile 2.2 ELF file? Looks like at least libmagic knows about 2.0: rlb: $ file /usr/lib/x86_64-linux-gnu/guile/2.0/ccache/ice-9/futures.go rlb: /usr/lib/x86_64-linux-gnu/guile/2.0/ccache/ice-9/futures.go: Guile Object, little endian, 64bit, bytecode v2.0 rlb: rlb: $ file /usr/lib/x86_64-linux-gnu/guile/2.2/ccache/ice-9/futures.go rlb: /usr/lib/x86_64-linux-gnu/guile/2.2/ccache/ice-9/futures.go: ELF 64-bit LSB shared object, no machine, version 1 (embedded), dynamically linked, not stripped rlb: rlb: I ask because the dh_strip author was wondering about a way to detect that it shouldn't try to strip them. mwette: rlb: the place to start digging seems to be (system vm linker) janneke: mwette: 0.86.0 is now in guix janneke: also, i updated the mes bootstrap to use that (with the binary literal patch) mwette: use from savannah? janneke: yes, now building from savannah! mwette: Thanks! janneke: http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/mes.scm#n38 mwette: fyi I changed the gpl3+ parts to lgpl3+ janneke: mwette: ok! janneke: i'll update, thanks mwette: and can you soften "The syntax and nomenclature should be considered not stable." janneke: nice janneke: i'll just remove that caveat mwette: I think things are much more stable then v0.50.0 when that text was originally written. mwette: s/then/than for/ mwette: Great! janneke: sure :-) ArneBab_: The ipv6 example for (web server) does not work for me: https://www.gnu.org/software/guile/manual/html_node/Web-Server.html ArneBab_: (import (web server)(run-server (λ(req body) #f) 'http '(#:family AF_INET6 #:port 8081)) ArneBab_: for ipv4 I can get it to work by modifying it as ArneBab_: (import (web server)(run-server (λ(req body) #f) 'http `(#:family ,AF_INET #:port 8081)) ArneBab_: mind the quasiquote (`) and unquote (,) ArneBab_: what did I miss? amz3: hello #guile janneke: hi amz3! mwette: I'm working on a test script for a patch to guile-2.2.4. It works if I manyally start up meta/guile and load, but "make check fails". What gives? Here is evidence: http://paste.debian.net/1041331/ mwette: s/mayally/manually/ janneke: mwette: i found a really small/silly bug with 0.86.0 while trying to create GuixSD packages janneke: mail sent mwette: janneke: thanks -- I am not surprised. I made a number of changes. janneke: :-) janneke: mwette: i'm amazed how easy the upgrade was for me -- i tried quite some intermediate c99dev commits, tried to patch janneke: so...*almost* there for me mwette: janneke: c99dev is behind the times. I've working on ffidev and nxdev, but merging with master often. janneke: OK janneke: anywai, 0.86.0 is great! mwette: janneke: Thanks so much. And happy to see your progress. Sounds like you have something fairly robust now? mwette: janneke: see if this works: http://paste.debian.net/1041381/ janneke: mwette: that fixes it! mwette: janneke: sweet - adding it to the test-suite janneke: yay! *: janneke creates packages with patch for GuixSD and wip-bootstrap janneke: mwette: robust...indeed -- my target for Mes is being compatible with Guile, while aiming for a small footprint and have enough to support Nyacc janneke: as we experienced, there is a playing field between Mes supporting Nyacc, and Nyacc staying minimal (not using regexp in lex.scm) to make it easier for Mes janneke: and indeed, i'm so happy that Nyacc 0.86.0 is a drop-in replacement, when using Guile and Mes alike! janneke: ...packages not built yet; let me be just a little bit careful while cheering :-) mwette: wingo: Q on foldts*-values: If, in the DOWN procedure, I replace a tree '(ident "x") with '(lexical x x-123) do you think I should return (values '() '(lexical x x-123) ...) and handle '() in the UP procedure or return something like (values '(REPLACED) '(lexical x x-123) ...) and handle REPLACED in the UP procedure? The former seems more natural but it's then not SXML. mwette: janneke: The fact that the (nyacc parse) code is running for you is good news to me. I had to rework that module a lot to get it work in interactive mode. civodul: Hello Guilers! janneke: found it, (debug-enable 'debug) now is: wrap call in `call-with-error-handling' :-) civodul: janneke: oh right! civodul: it's very handy, more than the old 'debug-enable' :-) janneke: civodul: yes, i'ts very nice...just could only remember the old meme :) civodul: heheh :-) lloda: The manual really needs a 'hands-on' or 'howto' section I think. You cannot figure out how to do a number of things without googling the mailing list or irc. lloda: for example I've hit the debugger countless times and I still don't know how to do anything there beyond ,bt lloda: I'd want to do things like set variables, continue from this point, go step by step lloda: none of these things seem to work lloda: it's probably my ignorance lloda: anyway civodul: lloda: https://www.gnu.org/software/guile/manual/html_node/Interactive-Debugging.html is rather nice IMO civodul: but note that there are things you can't do at all in the debugging, such as step-by-step execution :-) wingo: civodul: is that because it's broken? source-line stepping should work wingo: but expression-by-expression stepping doesn't of course civodul: wingo: oh! i guess that's just because i never do source-line stepping civodul: so it's even better :-) wingo: :) wingo: confession: i never use breakpoints or stepping wingo: maybe i don't code enough in an environment in which i can rely on my tools, because i broke them all civodul: ah ah, that may be the reason :-) civodul: you end up being the one who writes the tools and rarely takes advantage of them ;-) janneke: i just started looking at the debugger again *: janneke still has an old, non-finished patch to have backtraces use gnu style locations and fix break-at-source, i think janneke: will see if i can give that some love amz3`: https://julesh.com/2017/04/22/on-compositionality/ lloda: civodul: right, so it's there. Was exaggerating earlier, I already do ,frame ,up etc lloda: but ,locals is useless most of the time lloda: and it's all about inspecting; there's no relationship to the source and you cannot *do* anything in the frame lloda: the example doesn't show stepping, continuing... lloda: I'm sorry to not be more positive! lloda: but in the end I just pk & reload 99% of the time :-/ amz3`: +1 civodul: lloda: i pk most of the time as well :-), but when i do get a backtrace, the debugger is helpful for me civodul: my guess is that when writing in a functional style and doing "REPL-driven dev", step-by-step etc. are not so useful civodul: what would you add to the manual? wingo: for me ,locals is often helpful fwiw wingo: dunno wingo: just had a successful ./check-guile run with jit threshold of 1000 :) now going for 0, it caught a few more things civodul: \o/ lloda: civodul: the manual looks ok now that I've read it! if one can actually do source-line stepping, then showing that would be nice lloda: wingo: for me ,locals shows mostly renamed variables and a lot of them missing altogether lloda: I may be doing something dumb wingo: i haven't checked that these things work, not recently anyway wingo: they have a way of bitrotting wingo: but it's like stepping gcc-compiled code at -O2 or something, not that bad but it's still not totally obvious wingo: you can step instructions of course wingo: ok there are just 10 failing tests now, 9 related to lack of hooks in jit code, one a bug in case-lambda* compilation wingo: pretty good! wingo: with GUILE_JIT_COUNTER_THRESHOLD=0 wingo: also i think jit compilation is faster because we're using a custom code allocator instead of the one in lightning wingo: basically i think lightning is open for business, speed golfing to continue after i figure out what to do with hooks lloda: wingo: I have a benchmark where lightning w/ jit is ~9 times slower than lightning w/o jit or stable-2.2, but I haven't been able to make it standalone lloda: it's a weird one davexunit: wingo: planning any pre-release thing that makes it easy to test out the new jit? davexunit: I'm interested in seeing how programs with lots of floating point math perform. Combinatorialist: What's the difference between string-concatenate/shared and string-append/shared ? chrislck: I believe string-concatenate is much more efficient than string-append chrislck: ha found from the archives https://gnunet.org/bot/log/guile/2014-03-25 chrislck: I might be wrong tho Combinatorialist: Is there a version of set! that returns the new value instead of # ? Combinatorialist: and is there a way to test if # is an element of a list? lloda: sneek: later tell daviid please give a link to the working patches you have for guile-cairo and I'll try to merge them sneek: Okay. lloda: after many many years of using Unix terminals, I've finally started to use screen. Never too late... hugo: Combinatorialist: For the set question you could just write a macro: hugo: (define-syntax-rule (set*! var val) hugo: (begin (set! var val) hugo: val)) ; => # hugo: And for the secound one (using srfi-1): hugo: (find unspecified? lst) hugo: Where lst is your list janneke: iirc, guile-1.8 had (debug-enable 'debug) to drop into the repl/debugger upon error; how does that work with guile-2.2? lloda: ot the renamed-as-xxx` is damn irritating, is there a way to avoid it? wingo: lloda: what do you mean? lloda: oh like I login as lloda and after a few hours it seems to connect & reconnect and then I'm lloda` and then it will happen again and I'll be lloda`` lloda: and /nick doesn't even work because I am 'banned in channel' lloda: so I have to /leave to get my nick back... wingo: ah weird :/ wingo: i was thinking you were referring to deprecation warnings or something :) lloda: ah, no worries lloda: I've noticed the 'redefinition' warning the most now on master lloda: I guess this happens to others? lloda: you start with a script lloda: everything is (define x) lloda: (define y) lloda: etc lloda: now you need to make a function out of it lloda: put everything in lets lloda: and now it's suddenly a lot harder to debug lloda: I think I read an essay about it once lloda: scripts-to-programs or slt wingo: lloda it's just a warning fwiw wingo: a recent one added by civodul :) wingo: if you think it's not the right thing, that feedback is welcome wingo: it hasn't hit me yet so i have no opinions lloda: it can be disabled, so it's ok afaic lloda: it flags a kind of 'program' that I think is fairly common lloda: at least I do it a lot :p civodul: lloda: you get the warning when you redefine something at the REPL/Geiser you mean? civodul: it would make sense to disable it by default at the REPL lloda: not at the repl, or I haven't noticed. It happens on scripts, which I makes sense really lloda: I compile them on my builds to check that I haven lloda: I haven't broken something with a rename etc lloda: I agree that this shouldn't be a warning at the REPL lloda: and it doesn't seem to be, at any rate (?) wingo: for me the warning isn't so useful, but i could see it being useful in e.g. guix wingo: where you have long files of things that look repetitive (but aren't), and users typically just focus on a small part of the file to modify lloda: is it possible to disable specific warnings from inside a file? lloda: sort of like a pragma civodul: no, but it would be nice wingo: http://infocenter.arm.com/help/topic/com.arm.doc.genc007826/Barrier_Litmus_Tests_and_Cookbook_A08.pdf is a very nice document on when barriers are needed on ARM wingo: though old it's apparently still valid dustyweb: btw davexunit dustyweb: maybe some ideas to snipe for starling here https://www.youtube.com/watch?v=_x0Ob2HY8C4 wingo: oh good, i have golfed down the no-jit times in lightning to meet the 2.2 times, at least on fib civodul: yay! really cool civodul: what was the trick? wingo: in 3.0 conditional branches are more like a cpu, it's "compare" then "conditional branch" wingo: but the conditional branch always follows the compare wingo: before the result of the compare was stored in a vm-local variable wingo: after, the two opcodes are fused together, so the result is never stored anywhere wingo: so each compare instruction advances the ip beyond the following comparison. wingo: er wingo: following conditional branch wingo: also added a couple of obvious fast paths there, e.g. less_p has a nice fast path for inums, etc wingo: so it could be that too wingo: haven't pushed yet tho janneke: oh, that's amazing! wingo: hah, i create a mess and later clean it up, amazing :P :) janneke: that's how it goes, right :) wingo: hum actually that didn't help :( i was comparing numbers between two machines wingo: dammit :( ecraven: new run up: https://ecraven.github.io/r7rs-benchmarks/index.html rain1: thank you for making these :D wingo: fun :) stis: sneek buggs stis: sneek: where is bugs massma: hi guile, I have another pattern matching question. I'm really not sure if I'm not understanding pattern matching (I'm new to it), or if the manual doesn't match the implementation massma: I expected: massma: (match (list 0 1 2 3 "foo" "bar" "baz") massma: ((number ...) number) massma: ((number ... string ooo) string)) massma: to return: ("foo" "bar" baz") massma: but it returns (0 1 2 3 "foo" "bar" "baz") rekado: the cases are processed in order. massma: but shouldn't case 1 only succeed if every element is a number? massma: (or case 0, rather) rekado: no, because “number” is just a variable rekado: you would need to use (? number? number) instead rekado: the “?” introduces a predicate, “number?” is a predicate that returns #t when the argument is a number. massma: I see, thanks for the clarification rekado: np! massma: do you think the manual is worth editing in match this better, or did I just really misintepret the text (very very poossible!)? massma: specifically where it says pattern: number // matches: a number rekado: yes, I do think that’s highly misleading massma: if so, I'm happy to make the changes, or maybe just add a note saying that the predicate patterns should be prefered rekado: “string”, “number”, and “character” really should be “identifier” (matches anything) rekado: oh, wait rekado: I understand now rekado: it does not mean “number”, but an actual number rekado: e.g. 42 massma: ahhhh, yes that makes sense, and it's important and useful info to contain in the manual rekado: a valid match clause would be (a b 42 "hello" #\c) rekado: where a and b match anything, but the other three match only the exact values they represent. massma: got it, yeah I thought it might be my interpretation massma: thanks a lot for the help, appreciate it rekado: glad we could sort this out :) massma: sorry, follow up question (but if too busy feel free to ignore - I think I'm just missing something) massma: this returns a match error , but expected it to return ("foo" "bar" "baz"): massma: (match (list 0 1 2 3 "foo" "bar" "baz") massma: (((? number? numbers) ...) numbers) massma: (((? number? numbers) ... (? string? strings) ooo) strings)) ArneBab: ecraven: thank you for the benchmarks! rekado: massma: “ooo” in the manual is a placeholder for “...”, “..1”, “___” (see lower in the manual) rekado: unfortunately, you cannot use more than one instance of “...”. rekado: but you could use this expression: rekado: (match (list 0 1 2 "foo" "bar" "baz") rekado: (((? number? numbers) ... (? string? a) (? string? b) (? string? c)) (list a b c))) massma: rekado: ahh, thanks. Does using one instance of "..." also extend to "___" "..1"? massma: e.g.: massma: (match (list 0 1 2 3 'a "foo" "bar" "baz") massma: (((? number? numbers) ...) numbers) massma: (((? number? numbers) ... massma: (? string? strings) ..1) strings)) massma: does also not match massma: ignore 'a above - type massma: *typo massma: to clarify, the above example is probably simpler as: massma: (match (list 0 1 2 3 "foo" "bar" "baz") massma: (((? number? numbers) ... massma: (? string? strings) ..1) strings)) janneke: mwette: mes+mescc runs fine with 2378e6c! janneke: i only needed to add char-set-copy to mes, and support for loading nyac lang sx-util mwette: janneke: thanks for checking -- I will make a new release in next day or two janneke: mwette: great! if you could add something roughly equivalent to: http://paste.debian.net/1040865/ janneke: that would be nice; mes+mescc is very slow, some progress is nice (for now) janneke: this may be a temporay thing, so i'm happy to apply this patch myself... wingo: yeah i was wrong about reaching 2.2 perf for 3.0 interpreter (no jit), too bad janneke: wingo: oh well, i announced x86 guix bootstrap was done -- still hammering to build gcc-4.9 :-( janneke: sometimes it's easy to fool yourself, we'll get there eventually mwette: janneke: I may have a hack to apply from your code ; I assume that is for every reduction janneke: i just hacked to try and show every function definition, which with current performance strikes a sweet spot janneke: so anything roughly equivalent is great janneke: it's also nice for debugging, to have an idea where a problem occurred janneke: if you mean by `reduction' anything at top level, that would be nice -- every statement would be too much, of course janneke: for progress, it could work for debugging... massma: rekado: thanks for the help earlier, I get it now. In the patterns in the manual "..." correspondes to real world elipses (e.g. (pat_1 ... pat_n) => (pat_1 pat_2 etc. pat_n)), while "ooo" correspond to the match elipsi ("..." "..1" "___"), so we can only use one of "..." "..1" "__". So in the manual massma: " | (pat_1 ... pat_n pat_n+1 ooo) list of n or more, each element massma: of remainder must match pat_n+1 massma: " massma: makes sense to me... as always, it was my misintepretation! massma: thanks! mwette: janneke: see if the following works (outside of patching nyacc): http://paste.debian.net/1040868/ mwette: janneke: It puts a wrapper around the actions that are listed in need-progress mwette: janneke: at the end of the when I forgot to put in (loop (1+ ix)) janneke: OK *: janneke goes to test wingo: janneke: hehe :) commiserations and i am sure you will get it in the end :) ArneBab: ES6 javascript allows apply via fun(...args) — is there a way to make (fun . args) equivalent to (apply fun args) — or an argument why this is a really bad idea? It strikes me as oddly symmetric: (define (foo . args) args) (foo . args) ⇒ args janneke: mwette: c99-act-v and c99-len-v aren't exported...using (@@ (nyacc lang c99 parser) ...) works great for Guile -- let me try Mes (but that should work too) mwette: janneke: I can clean up the access. janneke: mwette: it works wih Mes too -- thanks! janneke: cleaning up access is nice, but not required mwette: janneke: maybe I hold off for now, I though I had it in for the other lang's janneke: OK -- i'm very happy that i can now drop the delta with upstream (you), and that i can update to your latest release, without patches janneke: and very happy with your support, removing regex because i need it for bootstrapping; thank you mwette: good. Still have the cond-expand for the 1.8 support. When you get a chance could you go over those and let me know if that's up to date? janneke: OK, will do! massma: (match (list 1) massma: oops, ignore that. thought I was at my repl :) apteryx: amz3: I didn't know much about Smalltalk; reading on it, it is pretty impressive! apteryx: is there no function provided by guile out-of-the-box to rename a directory? lloda: wingo: morning lloda: the segfault is gone lloda: otoh it takes a very long time to compile an empty file lloda: it's rather strange lloda: with THRESHOLD=0 lloda: any other number is way faster wingo: moin wingo: doing a simple GUILE_JIT_COUNTER_THRESHOLD=1000 GUILE_JIT_LOG_LEVEL=1 meta/guile wingo: i see 89 functions compiled wingo: 84% of which are compiled at their entry point wingo: and the rest tier up from loops civodul: hey wingo wingo: greets civodul: so it's possible that a loop within a function is compiled, but not the whole function, right? wingo: no wingo: a function has a single optimization counter wingo: that counter is incremented on function entry and on loop iterations wingo: so either could trigger compilation civodul: ok wingo: when a function is jit-compiled, the whole thing is compiled, even if it was a loop iteration that triggered the compilation wingo: if it was a loop iteration, the function will tier up into the middle of the compiled code, instead of the beginning civodul: so the whole function is compiled, but the trigger might be a loop entry civodul: i should really give it a try wingo: indeed! the default in the lightning branch is no jit compilation wingo: so you can just kick off a compile to have it around wingo: make sure to remove all .go files in that dir tho wingo: the binary format was changing without .go abi bumps wingo: then when you want to jit-compile, you can do it via the temporarily-available %jit-compile function wingo: or you can set GUILE_JIT_COUNTER_THRESHOLD=NNNN civodul: ok wingo: where NNNN is the counter threshold above which a function gets compiled wingo: set GUILE_JIT_LOG_LEVEL=N to see debug output wingo: for N in {1,2,3} civodul: i see civodul: what fraction of bytecode instructions can be compiled? wingo: civodul: all of them! wingo: even aborts, continuations, reinstating, etc civodul: woow! wingo: neat, right? :) civodul: crazy even! :-) wingo: :) civodul: so it's where we can start playing with it and see what happens? wingo: it's starting to get there, yes. for small examples :) wingo: if you set GUILE_JIT_COUNTER_THRESHOLD=0 then *everything* gets compiled wingo: takes a while of course wingo: as compiling a function takes longer than running it civodul: heh civodul: at least you can see if it crashes ;-) wingo: yes :) wingo: i meant to say, i haven't yet gotten the whole test suite to run through. there were some stalls, and i just fixed an important crasher yesterday wingo: but it's definitely at the point where if you have a test case, you can see what will happen wingo: not time to try it out on whole apps tho wingo: also, there seem to be a couple of places where the interpreter is noticeably slower than 2.2 -- like more than 20 or 30% slower. it's related to changes in the bytecode and such, most of them are fixable i think, but if you find a case like that, please lmk so i can have a poke wingo: it's somewhat expected to have some cases in the interpreter be slower than 2.2, as 3.0 has generally more instructions than 2.2, because the instructions do less work wingo: but it shouldn't be significant, and the JIT should always more than make up the difference wingo: fwiw i am seeing startup time slightly less with 3.0 than 2.2 so that's good anyway wingo: keeping startup time fast is something i'm keeping an eye on civodul: ok civodul: slower interpreter could mean longer bootstrap times tho ;-) wingo: mmm, not sure wingo: by interpreter i mean vm-engine.c wingo: i haven't tested the relative speed of eval.scm wingo: but i would imagine that JIT-compiled eval.scm should handily beat 2.2's eval.scm wingo: haven't tested yet tho :) civodul: oh, i was thinking of eval.scm wingo: right, i think we're going to have to start calling that the evaluator! wingo: dunno wingo: more parts, more names, more confusion :) civodul: heheh civodul: gcc 8 shows interesting warnings: civodul: srfi-14.c:2061:42: warning: '%06x' directive writing between 6 and 8 bytes into a region of size 7 [-Wformat-overflow=] wingo: neat civodul: a bit worrying civodul: anyway it's building :-) wingo: :) civodul: wingo: messages like "jit: vcode: start=0xe30e60,+6 entry=+0" mean that we jumped to jitted code? wingo: civodul: no that means that jit code was emitted wingo: usually the code will be entered also right after the message wingo: but to see all entries and exits, set log level to 3 civodul: ok civodul: that's more verbose indeed :-) wingo: :) wingo: functions that are called a lot are called a lot :) civodul: at the REPL we just see too many of them wingo: yeah, better to run at log level 1 generally, if you are interested in when jit happens wingo: otherwise pipe stderr somewhere wingo: "entry=+0" indicates that it was a function call that triggered JIT wingo: nonzero indicates that it was a loop civodul: ok, nice civodul: if i do: GUILE_JIT_LOG_LEVEL=1 GUILE_JIT_COUNTER_THRESHOLD=1000 ./meta/guile -c '(define (fib i)(if (<= i 1) 1 (+ i (fib (- i 1))))) (fib 42)' civodul: presumably only the last few lines correspond to my procedure, right? wingo: civodul: probably, check the vcode compared to the addresses from ,x fib wingo: civodul: i think in that case actually `fib` is interpreted wingo: right? wingo: also that's not fib :) wingo: civodul: for fib, on lightning, without jit: using the evaluator, (fib 35) takes 10.9s. Using the compiler, 1.05s. wingo: with jit, using the evaluator, (fib 35) takes 6.47s, and with the compiler, 0.61s. wingo: by way of comparison, with 2.2 and the evaluator, 9.2s, and with the compiler, 0.88s. wingo: still some headroom in lightning i think tho wingo: if "fib" itself is letrec-bound instead of bound at the top level, 2.2's compiler is 0.78s, lightning's compiler is 0.92s, lightning compiler+jit is 0.51s wingo: so, broadly similar results wingo: incidentally i don't how how ecraven's benchmark got 40s for this test wingo: he did (fib 40) but that result is 8s for me with 2.2, or 10s lightning, or 5.2s lightning+jit ecraven: I should rerun everything sometime soon ecraven: it's a fast machine, maybe? wingo: not really ecraven: ah, 40, not 4.. not sure wingo: ah sorry didn't mean to neg your machine, i was thinking you were talking about mine :) wingo: anyway for 2.2 i would expect something a bit better, but who knows wingo: hopefully we can get a 3.0 prerel out soon that will be on par with racket :) wingo: ecraven: i was wrong! your tests run fib 40 5 times wingo: so the numbers were right wingo: irritatingly :) ecraven: ok, that's good ecraven: I'll do a new run over the next few days, there were some new releases civodul: wingo: re fib, interesting! though i guess fib conses a lot (bignums) so it may not be a great benchmark civodul: in case someone had a doubt ;-) civodul: it's interesting to see to letrec binding helps this much already in 2.2 wingo: the letrec binding means it can use call-label instead of call wingo: and no closure needed either wingo: (fib 40) isn't a bignum fwiw wingo: so it's "just" call overhead civodul: oh right wingo: chez's results on those benchmarks are offensive cmaloney: offensive in a good way? wingo: disgustingly good wingo: there is no way we can win those benchmarks unless we get some sort of top-level inlining story wingo: maybe civodul will let me do https://lists.gnu.org/archive/html/guile-devel/2016-03/msg00027.html one day wingo: it's clear that the mbrot results are only possible having proved that many variables are inexact reals wingo: and you can't do that without inlining civodul: wingo: IMO we should definitely work towards intra-module inlining civodul: that needs a transition path: could be issuing warnings for occurrences of "@@" in user code, adding 'declare' statements to explicitly turn inlining on and off, etc. *: wingo nod wingo: we'd need more of an idea about what a module is of course :P wingo: i.e. when do you know that you've seen all of a module civodul: oh yes, that's terrible civodul: i've come to love R6' 'library' form wingo: :) wingo: the good news from taking a look at the r7rs benchmarks is that the jit reduces run-time on those benchmarks by 40-60% generally, relative to 2.2 wingo: the bad news is that there's still a way to go before we eat chez's lunch :) wingo: e.g. the peval benchmark for me goes from 20s -> 11.5s wingo: that's with GUILE_JIT_COUNTER_THRESHOLD=1000 wingo: if i could golf that reduction down to the 60-80% range that would make me happy wingo: to run on your own, clone https://github.com/ecraven/r7rs-benchmarks wingo: and run via wingo: GUILE_JIT_COUNTER_THRESHOLD=1000 GUILD=/opt/guile/bin/guild GUILE=/opt/guile/bin/guile ./bench guile peval wingo: with jit we are still generally 3x slower than racket. probably a lot related to inlining, some related to code generation wingo: civodul: intra-module contification would also be nice civodul: wingo: 40%-60% is good news, indeed! civodul: how does Guile 3 compare to 2.2 without JIT? wingo: civodul: see my notes from 13:07 *: wingo pastes to not have to scroll up wingo: civodul: for fib, on lightning, without jit: using the evaluator, (fib 35) takes 10.9s. Using the compiler, 1.05s. wingo: with jit, using the evaluator, (fib 35) takes 6.47s, and with the compiler, 0.61s. wingo: by way of comparison, with 2.2 and the evaluator, 9.2s, and with the compiler, 0.88s. wingo: that's fairly representative. will see if i can golf the interpreted perf a bit wingo: i.e. compiler without jit civodul: oh right civodul: i wasn't sure if this was representative wingo: there are some bits of low-hanging fruit to investigate wingo: will need to profile lloda: wingo: the assert with GUILE_JIT_COUNTER_THRESHOLD=0 guile is fixed lloda: although startup is a lot longer than with GJCT=-1 lloda: the segfault is still there lloda: > touch empty.scm lloda: > GUILE_JIT_COUNTER_THRESHOLD=0 $GUILE -s empty.scm lloda: ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 lloda: ;;; or pass the --no-auto-compile argument to disable. lloda: ;;; compiling /home/danielo/Prog/test/empty.scm lloda: Segmentation fault lloda: lloda: I'll rebuild with -O2 -g to see if gdb can show anything wingo: moin lloda: morning wingo wingo: moin lloda: one of my array benchmarks is 10 times slower in lightning lloda: I'll try to isolate it wingo: vs 2.2 you mean? probably worth profiling the interpreted version to see what's going wrong wingo: i definitely want to fix those things but am focusing on fixing the crashers for now lloda: absolutely lloda: -O2 -g doesn't help alas lloda: backtrace: lloda: https://paste.debian.net/1040504/ lloda: I get it with -O1 too, same backtrace dustyweb: hello #guile civodul: hey hey! wingo: greets :) mwette: has anyone worked monads in Scheme besides Oleg? (http://okmij.org/ftp/Scheme/monad-in-Scheme.html) wingo: lloda: fixed the crasher, i think :) wingo: mwette: it's a big thing in guix! mwette: wingo: thanks -- I will look wingo: search for "store monad" wingo: (the idea being that you build up a graph of operations on the "store", managed by the guix daemon, then run that program; the monad builds the graph) mwette: see it: (guix store), based on racket better-monads, which is based on Oleg's work. I have some reading ahead ... mwette: oops - (guix monads) apteryx: hello, what's the recommended way to modify a program at run-time? I want to patch some function definition. Nomenclatura: I'm going to learn programing using guile. I never liked python syntax. Perl made more sense to me. Nomenclatura: Tell me I'm making a mistake. apteryx: Nomenclatura: Coming from Python I got tired of feeling constrained to use a more imperative style; Guile is funnier to me! amz3: apteryx: you want to monkeypatch a procedure? outtabwz: Nomenclatura: Perl gave me brain cancer. Scheme is at lest easier to understand. amz3: apteryx: look at the documentation about the module system in the manual, there is something like 'module-set' or search for 'mock' inside guix codebase, IIRC there is a procedure that allows to mock another procedure which IIRC use monkyepatching like you described (except the mock revert the change after..) mwette: In the index there is a reference to @@. Check that if you want to modify internals of a module. Nomenclatura: outtabwz: maybe I get it because that's what I got in school outtabwz: Nomenclatura: College profs are sadists. They want you to suffer. That's why they teach Perl. Nomenclatura: outtabwz: then I had C++ >.> amz3: I learned elisp at school amz3: I mean to day, they were teaching elisp amz3: I should have learned elisp, but was busy doing 'somthing else' anyway, I have much regrets about those times outtabwz: Nomenclatura: I'm so sorry. I had Java. Nomenclatura: :p stis: hello guilers! apteryx: amz3: actually, I want to reuse a function definition but I need to modify it slightly. apteryx: I thought the code being data, it should be doable using the usual list manipulations procedures. amz3: that is not monkey patching amz3: apteryx: then, you can use @@ to import the private procedure that you want to change slightly apteryx: amz3: thanks, but how would I alter the procedure definition? I'm looking at the (guix build gnu-build-system)'s configure procedure (a build phase). apteryx: I want take out the ,@(if docdir ...) expression. apteryx: is there a way to edit the source representation of the procedure object? amz3: no, you can't alter the procedure definitio like that amz3: apteryx: better ask on guix what you want to do, but my recommendation for the time being is to copy/paste the definition and edit it (using @@ to import the private stuff that the procedure you want to change use) amz3: code is data... well, I let other comment on your understanding of that expression. apteryx: in lisp, the structure of code is the same as the structure of data; that is my understanding. Please correct me if it's wrong :) amz3: apteryx: you could for instance, retrieve the source of the procedure dynamically, parse that string, search and replace with code stuff etc... amz3: code is data sound much like a 'marketing slang' there is some thruth in it, but there is also some mistake amz3: for instance, you can take a list with a bunch of symbols in it amz3: like done with quote ' apteryx: amz3: I wonder then why they keep repeating this (they don't flat out say that, but they make the students reflect on the question a many times) in the SICP classes. amz3: if you pass that to eval procedure, it's interpreted (maybe even compiled) and that will lead the previously called data to behave like code. amz3: it depends what the actual vm expose, but you can not easily in Guile take a procedure and rework except if it was meant to be apteryx: do you mean that after data/code is evaluated, its internal structure is no longer list based (i.e. no longer easily manipulated as data?) I supposed I should experiment at the REPL some. amz3: not sure amz3: like I said, I am not sure what I am saying is ok apteryx: amz3: it'd be nice if guile provided some facility to expose the source level representation of a procedure, to allow alterating it a run-time, as data :) apteryx: amz3: it's OK, I am thankful you entertained this conversation, it helped me to see a bit farther and gave me ideas to try. Thank you! amz3: yes, that's what smalltlak was advocating and implemented amz3: look into 'hot reloading', I am not sure how it related to smalltalk way of doing it, but it ends up achiving a similar purpose amz3: apteryx: look also at live coding technics amz3: apteryx: like guile chicadee apteryx: OK! thanks. amz3: chickadee amz3: yw amz3: you would get a definitive answer on the mailling list about the guix build system thing amz3: apteryx: also there is low volume #scheme channel on freenode, with a lot of more experience and knowledgeable people about all things scheme AND programming languages in general especially lisp and functional wingo: moo manumanumanu: moo! jcowan: apteryx, amz3: the hard part of hot reloading is being able to alter a procedure while it is executing: in the general case, it can't be done, you can make some changes but not any arbitrary change outtabwz: moo? mwette: from http://web.archive.org/web/20130403133623/bigzaphod.org/cow/, moo: This command is connected to the MOO command. When encountered during normal execution, it searches the program code in reverse looking for a matching MOO command and begins executing again starting from the found MOO command. When searching, it skips the instruction that is immediately before it (see MOO). outtabwz: mwette: It seems to be turing complete. Moo indeed mwette: yes, so simple! mwette: and yet so powerful! jcowan: For whatever reason, I can't get Guile to see the R6RS module I have written. It compiles successfully, but when I import it, I get "no code for (foo bar)". The file foo/bar.sls exists and there is a corresponding .go file in the cache. daviid: jcowan: from a repl, cld you see what %load-path gives you? jcowan: $1 = ("/usr/local/Cellar/guile/2.2.4/share/guile/2.2" "/usr/local/Cellar/guile/2.2.4/share/guile/site/2.2" "/usr/local/Cellar/guile/2.2.4/share/guile/site" "/usr/local/Cellar/guile/2.2.4/share/guile") jcowan: so I need to add . to this path? Can that be done in a persistent way? daviid: jcowan: is you module in one of thoe? jcowan: no, it's in ./foo/bar.sls daviid: ok, then in your .guile, add daviid: (add-to-lod-path ".") daviid: no sure guile handles different extension name then ".scm" though, never tried, maybe someone else knows ... daviid: *add-to-load-path jcowan: I assume that's add-to-load-path jcowan: yes jcowan: assuming that's $HOME/.guile also jcowan: doesn't work daviid: probbly because of the exension nam daviid: try rename it daviid: foo/bar.scm daviid: you cn try at the repl daviid: then once happy put the solutun in .gule and restart guile ... jcowan: yes that was it, thanks jcowan: didn't have to change .guile daviid: np! maybe ther is an option somewhere to allow diff extension jcowan: now I can see if my tests work jcowan: no, works at the repl, fails from the test program daviid: what works in a repl that does not work running a program? tha's probably a different issue daviid: yoyr test prg starts guile using a shebang? (it loads your $HOME/.guile anyway) daviid: jcowan: but 'just in case, if your "tests" is a guile script, try adding (add-to-load-path ".") before the import module sexp jcowan: no shebang, no, run it as "guile foo/bar-tests.scm" jcowan: part of a general script that tries various Schemes daviid: try guile -L "." foo//bar-tests.scm daviid: *foo/bar-tests.scm jcowan: 'll have it do add-to-load-path with a cond-expand jcowan: oh, actually I can live with that, yes jcowan: arrgh daviid: maybe you'll need to specify the ull path thpugh jcowan: that works, and the tests are passing, but I'm not sure if my code is running! daviid: test tht using pk jcowan: this is a portable replacement for (rnrs bytevectors) called (r6rs bytevectors) daviid: put a (pk "hi there") somwhere in tests jcowan: and apparently (rnrs bytevectors) is being implicitly imported jcowan: because all the identifiers are reported as being doubly defined, and this is just a warning, so I don't know which ones are running. jcowan: the tests are running, but they may be testing the native module rather than mine daviid: jcowan: they way to know and specify that in at module def time daviid: look in the manual for #:duplicates jcowan: the point is, R6RS-compliant programs shouldn't implicitly import stuff daviid: are you importing srfi-4? jcowan: No. jcowan: I'll see if an #!r6rs makes the problem go away jcowan: Guile apparently isn't separating R6RS programs from (non-R6RS) scripts. jcowan: nope, doesn't help daviid: jcowan: but anyway, you are redefining exiting functionality daviid: so you need to inform the module system how you want this t be handled daviid: let me find the manual section for you jcowan: Existing functionality, but in a different name. That's the point. I want to make sure that the same tests run against both the native and the portable module daviid: and use (pk "what ever") to double check daviid: diff name? daviid: you would nt have warnings at import time if names were different daviid: *should not jcowan: different module, I meant jcowan: I do not want (rnrs bytevectors) to be imported daviid: but same procedure names ... jcowan: yes, it's implementing the same interface jcowan: I'll wrap the tests in a library and import the library, see if that works daviid: could you paste one warning daviid: jcowan: it won't work jcowan: WARNING: (guile-user): `u8-list->bytevector' imported from both (r6rs bytevectors) and (rnrs bytevectors) jcowan: there is no (rnrs bytevectors) in the import statement daviid: does guile import (rnrs bytevectors) 'as core functonality' maybe daviid: no daviid: so, somewhere/somehow you import (rnrs bytevectors) daviid: jcowan: to convince yourself, start a new repl and enter u8-list->bytevector, you'll get an error jcowan: I agree that it's not working from the REPL, but wrapping it in a library (that exports nothing) provokes all kinds of not-defined errors from the tests daviid: tests can see and therefore not use anything defined in a module of your that does not export its names (public interface) daviid: *can not jcowan: And yet daviid: test can not see ... anything not exported jcowan: Maybe things really are working and these are just unwanted warnings jcowan: I'll modify the library to jabber at me daviid: jcowan: the first thing is that you have imported, somewhere, (rnrs bytevectors), otherwise you would not have any warnings of those jcowan: And yet I have not. jcowan: Here's the import:' daviid: jcowan: and you should export the publc iterface of your rewrite of this bytvectors things jcowan: WARNING: (guile-user): `u8-list->bytevector' imported from both (r6rs bytevectors) and (rnrs bytevectors) jcowan: oopd jcowan: (import (rnrs base) jcowan: (r6rs bytevectors) jcowan: (rnrs io simple)) jcowan: (import (rnrs base) jcowan: (r6rs bytevectors) jcowan: (rnrs io simple)) jcowan: (import (rnrs base) jcowan: (r6rs bytevectors) jcowan: (rnrs io simple)) jcowan: (import (rnrs base) jcowan: (r6rs bytevectors) jcowan: (rnrs io simple)) jcowan: oops again' jcowan: @#$ chat client daviid: something as imported it, as the repl test shows daviid: which is not a problem anyway jcowan , just tell the module system how to deal with that daviid: one of tose port bytevectors I guess daviid: *those import jcowan: I imported both of those at the REPL but that does not cause the rnrs bytevectors identifiers to be exposed jcowan: and I was able to prove that my code is being suppressed by the warning daviid: jcowan: what does this say daviid: (default-duplicate-binding-handler) jcowan: (replace warn-override-core warn last) daviid: jcowan: your code s not supressed, you are not exporting your functionality ... jcowan: no, the export statement does the right thing jcowan: anyhow, I think I found the problem; I cleared the cache and it went away jcowan: "The two hardest problems in computer science are naming things, cache invalidation, and off-by-one errors" daviid: yes PuercoPop: Does anyone know why does guile-xcb Make script depends on aclocal-1.14? I've been trying to make it work with 1.15 (the one available on Ubuntu 16.04) to no avail daviid: though from what you said, foo/bar.scm does not export, and tests tries to use its functionality ... maybe I mssunderstood, but that's ok, I'm glad you solved this problem the way you want ... daviid: PuercoPop: I don't think guile-xcb is properly maintained, but in any case, you can locally edit its configure.ac file and safely change that< I think PuercoPop: daviid: I just want to be able to run it to understand how the codebase to see if I can pilfer something. Don't see any direct reference to aclocal, guess I'll have to learn the basics of autotools. Thanks! mwette: is xcb same as libx11-xcb (on apt)? mwette: this ffi compiles with https://savannah.nongnu.org/projects/nyacc/ mwette: (define-ffi-module (ffi x11-xcb) mwette: #:pkg-config "x11-xcb" mwette: #:include '("xcb/xcb.h") mwette: #:inc-filter (lambda (file-spec path-spec) mwette: (string-contains path-spec "/xcb/" 0))) mwette: daviid: lloda: lloda2, how are things wrt guile-cairo make distcheck? (I haven't had the time to look at it yet) daviid: by the way, my advice to remove INSTALL from the tree was not a good advice, sorry: though it is regenerated at ./configure time, it better in the tarball imo daviid: which is what I do for all my projects (also because I do change the content f this file compared to the traditional one ... as I said, I was not exactly 'up-and-running' when I suggested this... not a big deal either ... fwiw, I copy (in org mode) the content of the install web pages of my projects, so users who did download the tarball but are with no internet at install time can proceed .... voilà! :) daviid: PuercoPop: did you succeed? (I had to change 'space', so when off a little...) PuercoPop: daviid: yeah, I just had to change PuercoPop: AM_AUTOMAKE_VERSION from aclocal.m4 from 1.14.1 to 1.5 PuercoPop: Btw any pro tips how to 'trace the execution' of the custom reader provided by guile-xcb? daviid: PuercoPop: maybe yu should consider installing Guix, on 'top off' Ubunto, it will help you a lot not loosing all this time ... daviid: *Ubuntu daviid: PuercoPop: yes, guile-xcb is in Guix daviid: PuercoPop: https://www.gnu.org/software/guix/packages/G/page/9/ daviid: then search for guile-xcb daviid: PuercoPop: I highly recommend yu that root, but as you wish of course daviid: *that route PuercoPop: daviid: I've actually been thinking of giving Guix a go when I buy a new PC. Earlier this year at work I looked into Nix, read through tons of documentation, the design seemed solid but I wasn't able to build a script on my own so we end up passing on it. Having scheme as the language to write/describe the recipes should be more straight forward to me. How is the documentation story? Better than Nix? daviid: lloda: one of the problem is that to unofficially release guile-cairo 1.10, I worked on master (here locally), and now I have 11 unmerged patches to origin master (and off course unpulled the ones you and andy wrote ..) daviid: lloda: however, (I was sure of that, but wanted to locally try first), my local master branch runs 'make distcheck' perfectly daviid: ... ==================================================== daviid: guile-cairo-1.10.0 archives ready for distribution: daviid: daviid: lloda: I wanted to merge, at the time, of course, and asked commit right (which still is there), but neger got it :(, so I decided to release unofficially (guile-clutter needs that version...) now, no blame, no anger, I'd be happy to help, but my git-fu is pathetically low daviid: PuercoPop: I don't know daviid: PuercoPop: no need to 'wait' for a new PC though, just install guix as a host distro... I suggest you tlk to #guix, I know a few guiers how uses ubuntu and guix ... daviid: PuercoPop: the #guix channel is extremely friendly and helpfull daviid: jcowan: for info "6.20.3 Creating Guile Modules" is worth a quick read, it explains possible options for the #:duplicates entry, among other things ... jcowan: thanks, I no longer have that problem amz3: hello #guile wingo: automatic JIT compilation working :-)) amz3: :D lloda: sneek: later tell daviid I mailed guile-user with the problems I have. If you have a separate branch that works please post a link and I'll try to merge myself sneek: Will do. lloda: sneek: later tell daviid Also please request commit access again sneek: Got it. wingo: moo lloda: hi wingo, I'm building your last commit lloda: so I don't need %jit-compile any longer? lloda: ah I see GUILE_JIT_COUNTER_THRESHOLD lloda: woah lloda: ok, it's still slower than stable-2.2 *sometimes* lloda: 2x faster some other times :D wingo: tiering up from within loops still isn't implemented fwiw lloda: wingo: an array benchmark I have https://github.com/lloda/guile-newra/blob/master/bench.scm lloda: stable-2.2 lloda: https://paste.debian.net/1040396/ lloda: lightning w threshold -1 lloda: https://paste.debian.net/1040397/ lloda: lightning w threshold 100 lloda: https://paste.debian.net/1040398/ *: wingo just pushed a couple changes, note that the equivalent of the old "threshold 100" is now 200 wingo: now setting threshold to 0 will compile *everything* wingo: it's slower for various reasons of course lloda: GUILE_JIT_COUNTER_THRESHOLD=0 ~/sys/guile3/bin/guile -q -L mod -s test.scm lloda: %%%% Starting test newra lloda: jit.c:685: fatal: assertion failed lloda: lloda: backtrace @ https://paste.debian.net/1040403/ lloda: this is -O2, it doesn't happen with -O1 :-\ lloda: test.scm is https://github.com/lloda/guile-newra/blob/master/test.scm wingo: hum :) lloda: I never remember how to run Guile's own benchmarks wingo: lol me neither wingo: i mostly run the compiler when i need a benchmark wingo: or program startup lloda: what does something like lloda: ;;; (what! #) lloda: mean wingo: not sure, i think it's in statprof when it doesn't understand why it's getting what it's getting wingo: statprof needs a couple fixes wingo: lloda: added ability to tier up from within loops wingo: next up, fix the code allocator to not allocate whole pages for each function lloda: wingo: in fact just starting up with GUILE_JIT_COUNTER_THRESHOLD=0 guile gives me lloda: jit.c:685: fatal: assertion failed lloda: Aborted lloda: lloda: if I compile guile with -O2 lloda: plus if I clear the cache lloda: and then I do: lloda: > touch empty.scm lloda: > GUILE_JIT_COUNTER_THRESHOLD=0 guile -s empty.scm lloda: ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 lloda: ;;; or pass the --no-auto-compile argument to disable. lloda: ;;; compiling /home/danielo/Prog/test/empty.scm lloda: Segmentation fault lloda: lloda: if I do the same with GUILE_JIT_COUNTER_THRESHOLD!=0 it does work and if I try again with GUILE_JIT_COUNTER_THRESHOLD=0 w/o clearing the cache it works too lloda: all this with -O2, -O1 seems to work whatever I try lloda: so the backtraces don't look helpful mwette: di asterope: hi amz3: ! asterope: How would I go about separating a guile script into modules? `use-modules` doesn't want to load modules that are in the main script's folder... lloda: you can call $GUILE with -L . lloda: or add (add-to-load-path (getcwd)) before use-modules lloda: eventually you have to define some kind of directory structure for your modules and set %load-path lloda: @ asterope asterope: I tried with the `(add-load-path (getcw))`, but it won't load the second script asterope: idk why, but (use-modules (other)) can't find my second script asterope: I changed the module name, and it works now... so nvmd amz3: getcwd amz3: +D amz3: +d amz3: they are gone amz3: anyway outtabwz: does guile have something similar to racket's check-expect? wingo: lloda: around? wingo: the aborts/segfaults you found, were they assertion failures? wingo: i do get some assertion failures in GUILE_JIT_THRESHOLD=0 guile -c '(compile-file "/tmp/empty.scm")' wingo: er wingo: i do get some assertion failures in GUILE_JIT_COUNTER_THRESHOLD=0 guile -c '(compile-file "/tmp/empty.scm")' wingo: lloda: just pushed a fix for that fwiw wingo: still working on making the test suite pass tho :P massma: hi guile, I'm trying to use pattern matching more, but I'm a little confused about matching vectors and I'm hoping someone might be able to tell me where I went wrong. massma: the manual says: massma: #(pat_1 ... pat_n) matches vector of n elements massma: but, when i evaluate: massma: (match (list->vector (iota 10)) massma: (#(first second ... last) massma: (display first))) massma: I get a match error: massma: Throw to key `match-error' with args `("match" "no matching pattern" #(0 1 2 3 4 5 6 7 8 9))'. massma: am I misinterpretting the manual? amz3: massma: maybe ... doesn't work in vectors amz3: ellipsis amz3: remove the ellipsi and retry massma: amz3: thanks, yeah massma: (match (list->vector (iota 3)) massma: (#(first second last) massma: (display first))) massma: works fine. amz3: ok amz3: IIRC you can do that wiht a list amz3: IDK how match works, so I don't know why it doesn't work on vector and worse failure ever I can not guess.. amz3: ;] massma: what's weird is: massma: (match (list->vector (iota 10)) massma: (#(first second last ...) massma: (display last))) massma: works fine massma: it's only when the ... is in middle that it fails, but that syntax works find one lists massma: *works fine on lists massma: which is too bad, b/c grabbing the last element of a vector or handling it differently seems useful massma: looks match is provided by upstream massma: at first glance I gotta brush up on macros to follow the code. but, if I can pin down where the problem is I'll report back amz3: massma: unlikely your bug report will be sucessful amz3: massma: it's adapted to guile, it's not considered upstream amz3: amz3: or maybe you are right... amz3: sorry amz3: massma: maybe you are right and ellipsis should be supported in vector syntax mwette: syntax-rules does support the pattern #(P1 .. Pi Pj .. Pn) so it seems it should be doable mwette: ellipsis massma: amz3: mwette: thanks; I got this deadline I'm stuck behind right now but hopefully next week I can dig in and try and figure out what's going on. Nice to know should be/could be fixable massma: I'm new to guile and scheme, so it might just take me a bit to figure out how! *: wingo just ran into another lightning register allocation weirdness :/ wingo: i want a calling convention in which, around calls (which are really jumps), R0 and R1 are set. however lightning sometimes needs temporary registers, and computes liveness info to determine which registers are free. sometimes that means that our R0 or R1 get clobbered :( myonmyon: Hi there. myonmyon: I`ve been using the string->pointer function for a while only to get a memory leak. In the reference manual, they say that the C string is freed when the returned foreign pointer becomes unreachable. myonmyon: How does Guile judge the pointer reachability? I did use the string->pointer function to supply an argument to a foreign function. dustyweb: yay davexunit https://toot.cat/@dthompson/100650476852216318 jlicht: dustyweb: Is there some ongoing game-jam? dustyweb: jlicht: there's one at the end of the month I think dustyweb: https://events.tymoon.eu/4 dustyweb: oh dustyweb: end of next month :) jlicht: cool :-) amz3: myonmyon: oh amz3: myonmyon: that is a complex question. can you reproduce the leak on a small set of expressions? amz3: friendly reminder that we are trying to get a room at fosdem 2019 amz3: http://community.schemewiki.org/?FOSDEM2019 dustyweb: hm rain1: >How does Guile judge the pointer reachability rain1: it uses the boehm gc right? rain1: so it scans through the stack for objects that "look like" pointers amz3: yes something like that dustyweb: civodul: have you tried (use-modules (chop)) in guile within guix dustyweb: doesn't seem to work for me myonmyon: (import (system foreign)) myonmyon: (define puts* (pointer->procedure void (dynamic-pointer "puts" (dynamic-link)) '(*))) myonmyon: (define (puts s) (puts* (string->pointer s "utf-8"))) myonmyon: (puts (string-join (map (lambda (_) "a") (iota (* 1024 100))) "")) myonmyon: seems like memory consumption goes up while evaluating the last line repeatedly amz3: myonmyon: rewrite that and use named loop instead of iota amz3: myonmyon: (iota 1024) will create a list of 1024 elements that's somewhat big amz3: myonmyon: that might be the source of the 'memory' consumption, IIRC, the GC (garbage collector) doesn't free data as soon as they are not useful anymore, I think there is a small delay before it's free'd amz3: so you might need to keep the program running a while, after that last line, before GC kicks in amz3: myonmyon: do you work at the REPL? because i think in that case the GC can not reclaim some of the memory because there is reference to it in the REPL myonmyon: i work at the repl, there are no (and should be no references to repl $x variables) myonmyon: no repl references since everything goes to the void myonmyon: (gc) does not lower memory consumption myonmyon: and a 1024 * 100 element list is not the primary cause mwette: check sec 4.4.3 of manual and (ice-9 history); you can disable $-saves myonmyon: Also at the very moment when I did try that string->pointer thing, there were no big lists, just a huge string. myonmyon: and of course there was no REPL interfering. myonmyon: >running a while myonmyon: The first program I did write was a daemon. myonmyon: Days passed by and no frees. amz3: oh amz3: in the REPL again? myonmyon: It was not a REPL. amz3: can you paste the program somewhere so I can have a look at it amz3: also how to you measure meomry consumption? myonmyon: I just look at the memory percentage in top mwette: (gc-stats) mwette: sec 6.19 of manual myonmyon: These are enabled on debug builds, as I recall. myonmyon: I`ve lost all references to string->pointer in the old program back then. I decided to make myonmyon: C subroutines which free all the memory instead of ffi-calling them amz3: TIL rekado: I would like to rewind a port to a previous state when I unexpectedly read . Will ports play nicely with delimited continuations? rekado: or should I just record the port seek position before and then seek back on error? amz3: that's what i do amz3: that being said, i wrap the "port" in a custom stream amz3: I think if performance is not an issue you can use guile stream library amz3: instead of read + seek civodul: rekado: you could "unread" things back to the port, would that help? rekado: no, because then I’d need to keep track of all things I’ve read. rekado: the idea was to read until I find a boundary string. rekado: if no boundary string is found something’s obviously wrong and I’d rather reset to the previous state. rekado: I ended up avoiding this problem completely, but I was wondering about ports in the context of delimited continuations anyway. civodul: the state of port is independent from the control flow of the program, if that's what you mean civodul: so if you resume a continuation, the port's state is not rewound rekado: I see. rlb: daviid: let's say that I end up with some time -- do you already know what the root of the dep tree is there, i.e. maybe I'd need to start with trying to migrate g-wrap unless it has other rdepends? rlb: And more generally -- are any of these projects no longer active upstream such that they really probably should be dropped from buster (for now)? rlb: (if you know) daviid: rlb: guile-cairo does not depend on anything else but guile (any version, including the very latest stable) and cairo 1.10 daviid: g-wrap does not depend on anything but guile as well, and works with the vey latest guile stable mwette: just joined: What's the discussion? rlb: mwette: just discussing what might be involved in removing guile-2.0 from debian buster. mwette: ah. Thanks. daviid: guile-gnome depends on g-wrap, guile-cairo, and a few gnome libs all available in buster (I use guile-gnome here, mainly for GNU Foliot and guile-clutter (which depends on guile-gnome, only glib and gobject though (and clutter 1.15) daviid: (they all need texinfo though) rlb: (I'm sometimes hesitant to just "throw over the wall" an NMU, i.e. just keeping something in buster if it still doesn't have an active maintainer, may not be doing anyone any favors.) daviid: rlb: I understad daviid: rlb: I have no idea who is using guile-gnome using the deb package, I always use every lib I need from the source, which is (partially) why I don't even use guix myself (yet ...) daviid: I'm an 'upstreamer', what matters for me is that what I write (or co-maintain) is autotool chained and passes 'make distcheck' daviid: rlb: and that is the case for all these three and guile-clutter (which is as important, if not more, for me, then guile-gnome, and it is not even in guix yet) daviid: (no blaming to anyonw here, just saying that guile-clutter is not in guix yet, and gule-clutter is very difficult to install, impossible for a newbie almst, so it would be wonderfull if it was ... but I won't do it, at least not in the near future) rlb: I wonder how g-wrap has handled transitions in debian, i.e. if I rebuild libgwrap-runtime2 against guile 2.2 instead of guile-2.0, I don't think the library name can stay the same, and maybe not the package name (unless we have a flag day transition). rlb: (exactly the kind of thing that makes me hesitant to mess with (library producing) packages "casually" -- might well make a big mess that I'm then somewhat obligated to clean up) rlb: yeah, that's not going to work -- it produces the exact same library, but of course completely incompatible. daviid: rlb: g-wrap s compatible with both 2.0 and 2.2, it does not need to change ts nae, nor installation ... rlb: the binary ABI's not likely the "same" for clients. rlb: ? daviid: rlb: I don't think so, the source code is unchanged, and copiled file ar comiled on the fly and nstalled in use cache, depending on the guile version ... rlb: i.e. if an app had g-wrap linked against libguile 2.0 and some other lib linked against libguile 2.0. I'm guessing that'd be trouble. daviid: hum rlb: last time I looked in to this, my conclusion was that all guile libs need to have the guile X.Y version in the name. daviid: that lib should be installed in a different dir, no? daviid: I have both here rlb: e.g. /usr/lib/libgwrap-core-runtime-guile-2.0.so.2 etc. daviid: that is ot where upsteam install things rlb: but last time I looked at it I wandered off after understanding the complexity/mess. rlb: Yeah, I'm going to leave this alone -- at most, I'll probably file for removal of these packages from debian, until/unless there's a maintainer. daviid: rlb: yes, I understand, I see here that I decided for diff dir, but the name remain the same ... *: rlb has too much else that's already pending. daviid: rlb: my pont is, you withdraw guile 2.0 from buster, then these packages can remain rlb: Not unless we do something about the libs -- and/or have a very clear transition policy that everything that matters implements, etc. daviid: the problem is if you keep both, but you said in the beginning of the duiscusin you want to withdraw 2.0 from buster rlb: You just can't have two libs with the same name (and SONAME) but incompatible ABIs -- leads to segfaults, or worse. daviid: but you would not withdraw guile 2.0 and keep g-wrap lib build for guile 2.0 right? rlb: In order for g-wrap to be upgraded to 2.2 I suspect it has to change its library names, or sonames, or both. daviid: rlb: only if you keep guile 2.0 as well, iiuc rlb: daviid: people already have that stuff installed. rlb: It won't automatically disappear. rlb: ... i.e. it's non-trivial to get that right, including possibly all the relevant Breaks/Conflicts/Whatever to force out the incompatible ABI, and that's definitely frowned upon. rlb: Not even sure the ftpmasters would allow it. rlb: i.e. hypothetically, I suspect the new g-wrap would have to list every package version in debian that's already linked against it going back through at least stretch as a Breaks/Conflicts/etc. And even then, people who'd linked their own stuff against the lib would just be out of luck -- and that's not allowed. rlb: (at least not in debian) rlb: if the lib name and/or soname doesn't change, then the abi can't change. daviid: rlb: I have no 'hard feeling' here, feel free to drop all these packages from debian, there are not really maintained upstream either anyway, just kept 'alive' rlb: Oh no worries, didn't think you did -- just explaining the restrictions. daviid: rlb: yes, tx, I understand nonw of us s the time, and not even the wish ... so it's ok daviid: the only one package that is complicated to manually istall is guile-clutter, all thee can be sintalled manually with no pain in few minutes ... Combinatorialist: How can I filter # elements from a list? mange: I assume (filter (negate unspecified?) your-list)? lloda: if anyone can clone http://git.savannah.nongnu.org/cgit/guile-cairo.git and try to ./autogen.sh && make distcheck it, I'd appreciate it lloda: I think I'll try to release without the doc fixes lloda: kick the can down the road :-/ daviid: lloda: what branch? lloda: master daviid: fatal: repository 'http://git.savannah.nongnu.org/cgit/guile-cairo.git/' not found lloda: sorry, the git is git://git.savannah.gnu.org/guile-cairo.git lloda: the one earlier is just the browser lloda: I cannot make distcheck because one of the tests tries to do ../../env guile -s /bin/bash ../../../../build-aux/test-driver ... which doesn't make sense lloda: all this make-fu is over my head sadly daviid: it fails here too daviid: make distcheck daviid: make: *** No rule to make target 'distcheck'. Stop. daviid: daviid: i did ./autogen.sh;./configure;make distcheck daviid: lloda: i'm not in my best concentration mood but i've nver seen this error ever :) daviid: make clean fails, make distclean fails as well ... must be something 'basic' somehow ... don't know lloda: you have to pass --prefix=... to ./autogen.sh daviid: ok, but then you sould specify that , will tyr lloda: usually you only need to pass it to ./configure, but cairo does the same lloda: I don't think it should work that way, but what do I know daviid: you should print a message in tht case lloda: autogen.sh does print a message lloda: but you have to run it on its own to see it, ofc if you do autogen.sh && .. && .. you don't see it daviid: ok, evenwith --prefix=/opt2, make distcheck fails here daviid: let me paste daviid: https://paste.debian.net/1040070/ daviid: lloda: I really thing it's a bad idea t 'have to' pass --prefix to autogen.sh daviid: lloda: autogen should just do 'autoreconf -vif daviid: and it cn print a message daviid: I do that lloda: re: paste, it's the same error I get lloda: It happens because tests/unit-tests/Makefile.am runs ../env guile -s SHELL for some reason, and the arg of -s should be a Guile script lloda: I don't understand how SHELL ends up there though lloda: so I don't know how to fix that lloda: re: autogen.sh fix, could you send a patch? daviid: lloda: lets fix autogen first daviid: could you look at (for example) http://git.savannah.gnu.org/cgit/guile-cv.git/tree/autogen.sh?h=devel lloda: what's the build-aux/config.rpath thing? I don't have that in guile-cairo daviid: you cn skip it, but its becaue of guile.m4 macro (that I add to all my prjects ... see the commebt in that sema file) daviid: lloda: I don't remember, does gule-cairo uses guile-lib unit-test? daviid: if that is the case, please look at http://git.savannah.gnu.org/cgit/guile-cv.git/tree/test-suite/Makefile.am?h=devel lloda: I've pushed the autogen.sh fix daviid: lloda: I'm not 100% of my capacity here :), sorry lloda: I don't think it uses guile-lib (it does use guile-lib for building the doc) but I'm not 100% sure lloda: daviid: no worries, this is async anyway daviid: lloda: now, git pull says daviid: error: Your local changes to the following files would be overwritten by merge: daviid: INSTALL daviid: daviid: you need to remove INSTALL from the tree daviid: but then it leads to the same error 'make distcheck' daviid: lloda: not sure, but I see I use daviid: TESTS_ENVIRONMENT = \ daviid: $(abs_top_builddir)/pre-inst-env\ daviid: $(GUILE) -L $(abs_top_builddir)/test-suite\ daviid: --no-auto-compile daviid: that is very different from what is there daviid: TESTS_ENVIRONMENT=\ daviid: API_FILE=$(srcdir)/cairo.api $(top_builddir)/env guile -s daviid: lloda: I've removed INSTALL, thx daviid: np! daviid: hoestly, at tis moment, I fail to see the problem, but make distcheck still fils here daviid: *fails lloda: yeah lloda: one thing at a time lloda: I'll write tonight to guile-user to get more eyes on this lloda: but if you think of something, please let me know daviid: yes, I'll look into this after I get some rest ... daviid: did you change anything in the test-suite Makefile(s)? lloda: I didn't not lloda: sorry lloda: I did not daviid: ok daviid: it's the first time I see this error (rnning make distcheck) rekado: daviid: do you know who upstream is for rekado: oops rekado: for the Guile packages that would be dropped from Debian? daviid: rekado: not sure I uderstand daviid: guile won't be droped from debian, but maybe g-wrap, guile-cairo and guile-gnome daviid: *dropped daviid: rekado https://tracker.debian.org/pkg/guile-gnome-platform rekado: I meant “Guile* packages”, not Guile itself. daviid: "The current maintainer of guile-gnome-platform, Andreas Rottmann , has orphaned this package." rekado: you wrote earlier that they “are not really maintained upstream either anyway, just kept 'alive'” daviid: rekado: yes, that is my understanding rekado: I assumed you are the upstream of these packages. daviid: yes, but I keep them alive, I didn't really maintained these daviid: rekado: guile-gnome, for example, binds gtk 2.10 daviid: it's about 10y old rekado: oh daviid: but I amke sure it compiles and works with the latest stable ... rekado: do you think it would make sense for someone to try to upgrade the bindings to GTK3 or would it make more sense to start basically from scratch? daviid: gnome withdraw a couple of old bindings, I ust emove them daviid: rekado: no daviid: the future is with g-golf rekado: ah, gobject introspection daviid: but I have had no time (and no money to be honest) daviid: but I wish I can work on it ... daviid: rekado: guile-cairo is receiving some love though, lloda is working on it daviid: guile-cairo doesn no depend on g-wrap daviid: rekado: guile-clutter depends on guile-gnome (only glib and gobject) and guile-cairo (but not the version in guix, it depends on the source tree version), and guile-clutter, together with grip clutter examples, is pretty cool, but for some reason, never 'grapped' guix attention daviid: grip clutter examples are among the things most advanced and fun I ever wrote daviid: it has objects that 'fall' and 'resist' gravity, fr exaple ... daviid: anyway, guile-clutter binds clutter 1.15, and needs 'git cherry pick' (I found a bug in clutter, that has been fixed in 1.25 or so ...) daviid: clutter is now 1.26.2 daviid: rekado: 'all in all' guile-gnome and what depends on it is about 10y behind daviid: everybody is working on the snake ... rekado: the snake? daviid: python rekado: oh… *: rekado feels stupid daviid: for one guiler, ther are 1 million pythonist,and theyhave money daviid: numpy daviid: gets funding daviid: we neve eve get funding from nowhere ... daviid: thinking that lisp and its dialects have 'the best numerical tower' on this planet, it' kind of pretty ironic ... daviid: and now, all libs are in C++, which we can't even bind ... daviid: oh well, i'll ge a wisky :) civodul: Julia is much younger than Guile and quite successful civodul: so it's not just Python's fault :-) daviid: :) daviid: one would have to pay me quite a lot to give up guile for julia daviid: when I see young s/w engineer saying that java is 'a must' (and beter then clos ?!?), then julia has a future ... too jlicht: daviid: at the end of the day, programming languages are tools to get things done. And isn't being able to use your tool of choice for a job a good thing for everyone? daviid: jlicht: there is no doubt, to me, that lisp and any dialects, id a couple of order of magnitude superior to any other, any, (sub)programminglanguage(s), the rest is marketing and 'young s/w engineer' to go in the trap becaue they need to pay the bill (which i true for almost any other job) s/w enginneer is the only job on this (stupid) planet for which who shooses the tools i not the s/w engineer, but fashion, and (stupid) compamies cmaloney: TO be fair, it's usually the software folks that pick the tools initially, then it just becomes oral tradition handed down from generation to generation at a company daviid: cmaloney: that is not my experience, but I respect yours of course daviid: up to reasearch lab got 'afraid' because if 'they' let me do things using lisp (or guile), then they would be f....p if I 'disapear' ... cmaloney: I'm thinking in areas where there aren't many technical folks making the decisions daviid: cmaloney: I've had that enormous luck till now too, but that is an extraordinary exceptin cmaloney: where someone initially decides based on their personal preference, and then it becomes law daviid: I don't know, not even one company tat uses guile jlicht: daviid: I did not mean to contradict you, I just mean that understanding many tools is never a bad thing. cmaloney: Honestly I'm still surprised when I hear about places that use scheme daviid: jlicht: I hve still to see any tother language to provide me with ore power the lisp nd/or guile cmaloney: but that's partly because I didn't pay attention until recently daviid: cmaloney: I don't know, apart from the guix project, any company using scheme daviid: and aprt from frnaz/lispworks cmaloney: I'm just happy that folks are learning Racket. I think it's lovely cmaloney: means more folks in the scheme-pool daviid: cmaloney: yes, racket is 'more or less' a lisp dialect daviid: withut gops/clos, there bigest mistake cmaloney: OO is overrated anyway. ;) daviid: cmaloney: oop, used appriopriately, is good (see gnome if you have any doubt, but there are may other example out there ...) daviid: as I said recently on #scheme to someone 'against' oop ingeneral, and goops in particular: coll, then offer me a good gnome binding using srfi-9 daviid: good luck! cmaloney: heh cmaloney: My tongue was firmy in cheek daviid: anyway, I have to go for now, see U all later rekado: Does anyone know of Scheme libraries for parsing emails (e.g. multipart messages)? rekado: I’m at the beginning of writing what I need myself, but I’d much rather just use something existing. rekado: (I already ported a parser for rfc822 messages from a Chicken port of a module for Gauche) rekado: (but it only parses message headers) mwette: just posted this to the ML: mwette: scheme@(guile-user)> ,use (nyacc lang nx-lib) mwette: scheme@(guile-user)> (install-inline-language-evaluator) mwette: scheme@(guile-user)> ## mwette: scheme@(guile-user)> (define b (vector-ref a 2)) mwette: scheme@(guile-user)> ## mwette: scheme@(guile-user)> c mwette: $1 = 5 mwette: scheme@(guile-user)> (define d 1) mwette: scheme@(guile-user)> (set! d ##) mwette: scheme@(guile-user)> (set! d ##) mwette: scheme@(guile-user)> d mwette: $2 = 3 mwette: mwette: maybe I should change the name "matlab" to "octave" rekado: wow, nice! rekado: +1 for changing the name to “nx-octave” dustyweb: hi hi sneek: Welcome back dustyweb, you have 1 message. sneek: dustyweb, civodul says: the browser example might not be a good one: if there's a "good enough" firefox or chromium in a channel elsewhere, why would people bother getting it into Guix proper? dustyweb: hm civodul: hi dustyweb :-) dustyweb: hey civodul :) dustyweb: in fact I was just looking at your slides about libchop civodul: mwette: i think Octave people call it "the M language" dustyweb: probably because I am procrastinating civodul: heh dustyweb: but also because there's a general need for a uri scheme for content-addressed encrypted data dustyweb: and an associated protocol dustyweb: tahoe-lafs also has an applicable design but a lot of layers to it civodul: yeah, Tahoe-LAFS is very nice, but maybe more sophisticated than what you describe mwette: civodul: ha ha. OK, so I've changed the name to nx-octave. civodul: ever nicer IMO :-) civodul: dustyweb: i looked at casync, which seems quite nice, but unfortunately it doesn't do "convergent encryption" dustyweb: what's "convergent encryption"? dustyweb: oh dustyweb: wikipedia answers ;) dustyweb: ah, simple and brilliant! dustyweb: use the hash as the key :) civodul: yup! rekado: issues.guix.info is now also available via HTTPS. rekado: oh, wrong channel *: dustyweb also reads https://tahoe-lafs.org/hacktahoelafs/drew_perttula.html :) amz3: I hope we will have a devroom at FOSDEM jcowan: Simple and brilliant but totally insecure: it's not nice to fool Father Kerckhoff! amz3: what does it mean? amz3: ah it's about the previous convo amz3: see https://en.wikipedia.org/wiki/Kerckhoffs%27s_principle amz3: Is Joshua B. around? *: janneke reads the tragic discussions ... dustyweb: don't be discouraged! rain1: I want to read the discussion too rekado: rain1: be careful what you wish for. It’s really not pleasant. rain1: nobody invite me to this ML yet dustyweb: well I just unsubscribed from that list dustyweb: and sent a pretty strong statement about it too janneke: rain1: i probably really shouldn't have mentioned it here; the only reason i did it was because i care for dustyweb dustyweb: thanks janneke dustyweb: I appreciate that janneke: ow...how sad dustyweb: janneke: it was 800+ emails without real progress IMO rain1: well i PM'd dustyweb about it ealrier rain1: a lot of people are talking about it dustyweb: rain1: oh, I got a PM saying "hey" from you but nothing else btw :) janneke: dustyweb: i'm glad that you take care of yourself...but i feel we "need" you -- maybe in friendlier times rekado: janneke: sadly I don’t see anything good coming out of the main thread. rekado: a glimmer of hope is the work on howto-volunteer.html janneke: in fact, you all here, and at #guix and #bootstrappable have given me so much hope! janneke: ah, yes -- that too dustyweb: #guix and #guile continue to be great projects within GNU dustyweb: I like to think #mediagoblin has been too even though I have been inactive lately :) janneke: yes, same for me, for #lilypond dustyweb: I'm going to contribute to GNU projects that I think are doing good, but I won't be starting any new GNU projects until I see some changes for GNU as a whole. rain1: I got left out from it rain1: maybe becausei don't have a GNU project janneke: maybe i hoped too much that we could spread our openness and friendliness into gnu -- fast; i start to realise that you cannot force tolerance onto people rekado: there’s a lot of resistance against this; I didn’t expect this to be *this* fierce, though. janneke: dustyweb: i just started one, i may be writing a code of conduct :-D janneke: rekado: i really wondered about this -- but with hindsight it was to be expected rain1: is there no way to read this discussion? I guess there is no archive dustyweb: rain1: sadly gnu-prog-discuss is a private list... sometimes I understand the need to take conversations into private, but tbh this is something I've never liked about g-p-d dustyweb: the list that must not be named rain1: it seems a bit dissonant that GNU is so open and about free software but this sounds like some important decisions are being made in private dustyweb: yes... imo it's not the only governance problem in GNU either janneke: the only thing we can do is, practice patience, hold our ground, be inspirational janneke: some changes take one or two generations rain1: i want to know what changes you all wish for in GNU rlb: nb. it looks like g-wrap, guile-cairo, and guile-gnome-platform are orphaned in debian, and still depend on guile-2.0. We're going to want to remove guile-2.0 from debian, and so unless I either manage to find the time to try to upgrade all of those packages (I very likely won't become the maintainer), or someone else takes them over, they're likely to be removed from debian "at some point". rlb: And if I *do* manage to upload guile-2.2 versions, that may just delay the removal unless someone adopts them. (I also don't know anything about their current state upstream -- just wanted to mention the situation.) daviid: rlb: they all work with guile-2.2, fwiw. however, (a) upstream guile-gnome requires guile-cairo 1.10, which has never officially been release; (b) guile-gnome 2.16.5 'only' will work with guile-2.2 daviid: the unofficial guile-cairo releae is here http://download.savannah.nongnu.org/releases/grip/guile-cairo/, though since (a few years) it has been patched (not by me), and I never uploaded a new unofficial releae ... so, the situaton is a bit trange, to say the least rlb: daviid: thanks -- I suppose one outcome is that they end up leaving debian until there's enough demand for someone to bring them back. I also haven't checked on an other possible reverse dependencies (or build dependencies), i.e. would we just need updates to those, or is it going to require a substantial coordinated decisions (partially why I suspect I won't have time to handle it myself). daviid: the debian guile-cairo package is 1.4 iirc rlb: s/decisions/transition/ daviid: unless one of the two guile-cairo maintainers make a release, I do't see what I can do to make it o guile-gnom is kept in debian daviid: though i already prepared guile-gnome, 2.16.5, which works fine here (buster, which droped 2 gnome libs), so technically, guile-gnome upstream is fine to be and remain in buster daviid: I received a debian bug report recently though, but that is for 2.16.4, with guile-cairo 1.4 ... saying that automatic build fails, and tha is becuse it can't find makeinfo, iiuc, and sunded very strange to me (as the reason it would be dropped from stretch) daviid: it seems g-wrap is the latest in buster, so on that side we wuld be fine daviid: rlb: here is the report https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/guile-gnome-platform.html rlb: but I think g-wrap is built against guile-2.0, so it'd need to be rebuilt? And so I was wondering what else might have to be rebuilt along with g-wrap (as a transition). rlb: i.e. what depends on g-wrap that would be affected by its rebuild against 2.2. daviid: only guile-gnome rlb: ahh, ok. daviid: note that gule-gnome 2.16.5 depends on guile-lib 0.2.5, and buster only has 0.2.2 rlb: If I understand that bug, maybe it just needs to build-depend on makeinfo? rlb: sorry, texinfo daviid: that is my understnding as well daviid: but why would this 'trigger' now, that I don't understand rlb: Oh, might be that dpkg or something had a wrapper that's now deprecated/gone or something. rlb: dunno, or something else it does build-depend on no longer build-depends indirectly on texinfo. rlb: dpkg used to have it's own isntall-info? I forget. rlb: "install-info" daviid: yes, but the debian maintainer could easily add texinfo right? rlb: Sure, but there isn't one. rlb: (maintainer that is)? daviid: ah, I see daviid: we're i a sort of a dead end then rlb: https://tracker.debian.org/pkg/guile-gnome-platform rlb: it's orphaned as is g-wrap and guile-cairo rlb: that's the main thing I was bringing up daviid: indeed, I just forgot daviid: is guile-lib orfan as well? rlb: And we really don't want to ship guile-2.0 in buster, so we may end up having some hard decisions. daviid: you mean when buster becoes the next stable? I agree rlb: yes, and we'll need to have things mostly settled in the next few months. rlb: (roughly) daviid: anyway, even if we can ask for a guile-cairo release, then eveythig would be ok upstream, the fact that there is no debian maintainer is a blocker rlb: I think we've finally gotten the guile-2.2 tests passing more reliably on the release architectures, but that may still leave a lot of transition work. Haven't checked again yet -- mostly involves badgering maintainers, etc. daviid: id guile-lib orfan too? daviid: i am looking at the page, but i don't know where to look about this daviid: ah yes, isee it now daviid: it's orphan too daviid: and the latest is 0.2.6.1 (not 0.2.5.1) sorry daviid: it's unfortunate they became orphan, I see g-wrap is not orphan daviid: the solution would be: (a) to (ask for) release guile-cairo; (b) I release gule-gnome to depend on it; (c) debian finds a maintainer for gule-cairo and guile-gnome but I fear (c) is not going to happen wingo: good morning lloda: daviid: you're here lloda: I lost your question the other day lloda: the reason I haven't tried to release the guile-cairo bugfixes is that I cannot get the doc to build :-/ daviid: lloda: ah, ok lloda: I get some parsing error in guile-gnome somewhere that stumps me daviid: yes I know (though I don't know how to fix it either) daviid: here is the quiz daviid: in guile-cv, I have im-multiply, the matrix multiplication proc name,then working on iage textures, I realized I needed im-times (elts per elts multiplication), and im-divide (elts per elts div, but that name is used for matrix mult. of the inverse ...) hence I thought I should rename ... as octave does things daviid: octave uses times, mtimes, divide and mdivide daviid: now, I think I should rename im-multiply -> im-mtimes, im-divide im-mdivide, and then create im-divide, im-times ... WDYT? lloda: those look regular but easily confused tbh lloda: I'd just call im-times = im* and im-divide im/ lloda: maybe I'm not the best judge of this lloda: paralleling octave seems like a good idea daviid: im- is the prefix of all procedures and methods in guile-cv, whchis fine, then the thng is to have mtimes, times, mdivide and divide, I guess it's ok daviid: yeah, I'll do that daviid: tx lloda: yw daviid: i was about to leave actually, so see you ... lloda: same! lloda: is there anyone I can bug about (gnome gw support gtk-doc) ? lloda: or anywhere? wingo: lloda: it's unmaintained afaiu wingo: i wrote it, can answer anything superficial, but i don't want to get into anything deep lloda: my problem is that when I run make generate-defuns ... lloda: ../env guile -c "(apply (@ (gnome gw support gtk-doc) gtk-doc->texi-defuns) (cadr (program-arguments)) 'heuristics '((cairo)) (cddr (program-arguments)))" ./overrides.texi somewhere/somewhere/cairo-svg.xml ... lloda: it bombs on the first definition lloda: is it ok if I post details in guile-user, you think? lloda: maybe someone else will want to try and dig lloda: honestly I don't have the time for it either lloda: but I wrote something on top of guile-cairo and I think it's the best way to draw stuff in Guile, and fairly simple too lloda: so it should be available wingo: i am guessing that gtk-doc simply changed its output format wingo: sure, guile-user is fine for that lloda: ok jcowan: Is there a good reason why u8vectors and bytevectors aren't the same type in Guile? civodul: jcowan: they are disjoint types but they're "compatible" civodul: that is, you can use the bytevector API on a u8vector *: jcowan nods jcowan: but why are they disjoint in the first place? civodul: because SRFI-4 and R6RS are disjoint :-) civodul: i think we wanted to have a way to distinguish between these two types civodul: i don't recall the details though rlb: daviid: at least according to this, g-wrap is orphaned too: https://tracker.debian.org/pkg/guile-gnome-platform jcowan: I can't find any other R6 or R7RS Scheme that has SRFI 4 and makes the two types disjoint, and it doesn't make much sense to me jcowan: I suppose an argument in favor is that you know whether to write them as #u8 or #vu8 jcowan: Larceny accepts both but writes #u8 by default; you can configure the output port to do #vu8 instead lloda: jcowan: I agree with you lloda: it seems to be a historical artifact of implementing SRFI & bytevectors separately or something lloda: from what I've seen of the code *: jcowan nods lloda: vu8 and u8 should be one and the same jcowan: I'm writing a SRFI 4 implementation on top of rnrs bytevectors; the hard part is getting a working set of rnrs bytevectors tests daviid: rlb: I trust you :), but I visitied the debian g-wrap page yester., and it does not mentioned it's orphan (but I may have miss read), and I see it's been updated in july 2017 ... daviid: lloda: did you actually changed anything wrt the doc in gule-cairo? daviid: I released guile-gnome several time without being able to (re)build the doc as well (but its unchanged doc is available online), and I think it wuld be better to release guile-cairo (which also has its doc online...) daviid: I wonder what guile-cairo version is in guix? daviid: hum, it has guile-cairo 1.4.1 ???? daviid: even guile-cairo 1.9.x would not be good enough (to run guile-clutter) lloda: wingo: morning lloda: I've tried a couple of libraries of mine that are public and a repo of private code but I don't have anything very useful to report :-( lloda: lightning seems about 2x or 3x slower compared to stable-2.2 in some cases, without jit lloda: when I tried jit on large functions, the speed was about the same lloda: I haven't had time to try & isolate a good small benchmark lloda: no more crashes though lloda: but a ton of what I do relies on array-ref or goes directly to C, so it makes sense that the jit wouldn't be able to help wingo: lloda: morning :) wingo: that's interesting! counterintuitive as well... wingo: you compiled lightning with -O2 I guess? wingo: when you tested the jit version, did you also jit-compile all the (most-called) subrs that your functions called? maybe your functions also had inner loops that guile compiled as other functions wingo: regarding the slowdown vs stable-2.2, i would expect some due to master/lightning having more bytecodes in general wingo: but not 2x or 3x! wingo: for me array-sum is slower without jit (1.6s vs 1.4s) but when jitted (and importantly, when array-length and array-ref are jitted) it's a little faster (1.2s) lloda: wingo: my results on that test are stable-2.2 ~ 0.19 to 0.26, lightning no jit 0.66 to 0.73, lightning jit 0.66 to 0.72 :-/ wingo: lloda: for your array-sum test you mean? lloda: yes wingo: how big of an f32vector are you using? lloda: #e1e7 lloda: I'm using f32vector-ref in the loop instead of array-ref actually wingo: ah :) lloda: have meetings :-/ but I'll be around wingo: for guile 2.2.3 i still get like 1.2s here wingo: could be that CSE patch that mark weaver found, applied in 2.2.4 but i thought it wasn't needed on master wingo: certainly if 2.2 manages to unbox but master doesn't, that's a bug wingo: that would certainly account for the difference wingo: indeed, that seems to be what's happening wingo: yay wingo: hum, that's not it, i think i was testing with the wrong version wingo: lloda: my results on that test are stable-2.2 0.44s, lightning no jit .77-.88s, lightning jit .54s wingo: in stable-2.2, the body of the loop is 15 instructions wingo: in lightning, it's 25 instructions, and has two callouts to intrinsics (add/immediate and lsh/immediate), which in 2.2 are dedicated opcodes wingo: the lightning branch also has 3 side exits for error conditions that are explicit control flow, which stable-2.2 doesn't have wingo: inter-instruction state is kept on the stack. i guess the additional instructions cause more stack traffic. probably the icache footprint is a little higher too, though who knows; array-sum compiles to a little more than 2k of code, which probably should be slimmed a little wingo: still, icache misses probably aren't the thing. lloda: those numbers are similar to what I get lloda: I did compile both lightning & stable-2.2 with -O2. I used gcc 8.2 for lightning and 8.1 for stable lloda: in the larger test I did I only jit-compiled a big function that defined small functions inside (in a let). I'll try to jit-compile the small functions instead outtabwz: What do i put in my ~/.guile to make the auto-compiler silent except for errors? Alternatively, how to completely disable ac in ~/.guile? lloda: outtabwz: to disable ac look here https://www.gnu.org/software/guile/manual/html_node/Compilation.html lloda: I don't know how to disable the ac messages. One way is to make sure everything is compiled first lloda: ,a compile or ,a load also reveal some variables that you can try outtabwz: lloda: Thanks. I'm reading up now. amz3: o/ outtabwz: I thought maybe ,option interp #t but it seems that only applies to the REPL, and not scripts invoked from the shell :( outtabwz: Putting (setenv "GUILE_AUTO_COMPILE" "0") into ~/.guile doesn't prevent auto-compile of scripts invoked from the shell either :( wingo: outtabwz: (set! %load-should-auto-compile #f) wingo: but better if possible to simply compile the files ahead of time stis: wingo: procedure-properties is awfully slow in 2.2! stis: why's that? wingo: stis: probably because all the data is stored statically in the elf in a side table; it has to grovel through the DWARF for that data wingo: lloda: we should be able to really speed up array-length btw wingo: i just stepped through it, it does a bunch of useless crap stis: ok, if it's not improving I will move over to hash tables. wingo: stis: i think that's a reasonable thing to do stis: wingo: what's your thought on optimizing the familly of the kind (call-with-values expr (case-lambda ((x) x) (x x))) stis: e.g. have a speed version for 1 value return stis: I use this to simulate python asignment semantics regarding multiple value returns stis: but it really is slow 1 million operations per second which is an overhead for me because asignments is everywhere stis: it should be able to optimize (call-with-values (lambda () (+ number number)) ...) to (+ number number) wingo: how would you distinguish returning '(1 2) from returning (values 1 2) ? wingo: stis: do you need to support 0-valued returns? stis: well get better speed for 1 value return, multiple values is turned into a tuple, and I gues that this construct can be don quite effectively, especially for the common one value return. Of cause zero becomes the empty list stis: which I did not think of, so to avoid that perhaps use (case-lambda ((x) x) ((x . l) (cons x . l))) stis: in python x=... return 1,2 => x=(1,2), in guile I would expect x=1 OrangeShark: stis: a multi value return in python is just a tuple, isn't it? wingo: lloda: embarrassingly, returns from interpreter -> jit weren't actually working wingo: it was staying in the interpreter stis: OrangeShark: yep but scheme uses multiple value return and I want to interoperate wingo: lloda: hence the 0 speedup until all leaf functions are compiled! stis: it's possible now, but a bit too inneficient in my taste, especially since it's an optimization away to get good bytecode stis: maybe i bite the bullet and just implement it as tupples amz3: stis: yes, that's what I was going to say. amz3: stis: you want to implement a fast python on top of guile vm? amz3: fast/faster stis: first of all, I want good interoperability and a nice scheme interface. Then speed. stis: now it's 50x slower then cython and I could perhaps improve that with a factor of 10 if I could get this device working smoothely amz3: device? amz3: what device? stis: (set! x (wrap expr)), wrap is the device and is (lambda (x) (call-with-values (lambda () x) (case-lambda ((x) x) (x x))))) stis: Currently it will make a closure and a lambda and then call a primitive with those values . Would be nice with some better rules of oprmisation for this case amz3: why do you compare with cython in particular? do you have python library in mind that you would like to be able to use? stis: I compiled the random module from cython and run one of the tests there just to see how it performs amz3: hmm ok stis: note the random.py module wingo: i still don't know how you plan to distinguish returning '(1 2) from (values 1 2) stis: you don't, it' a projection of the two concepts, either as a multiple return values you return (values 1 2) or (list 1 2) both are identical in pythonbyt not in scheme so the expectation of the pythonist would not be broken stis: still if you in python return values they would in scheme land be destinguished as not a tuple wingo: lloda: interestingly, inlining the fast path of " im-mtimes, im-divide im-mdivide, and then create im-divide, im-times ... WDYT? daviid: *working on image texture (measures) daviid: lloda: our channel is not properly logged anymore (how sad), so don't answer if I'm not here (the text log somtimes comes with a few days delay, and are almost unreadable :( amz3: interesting discussion on the value of nothing, I am wondering what does the existing msgpack libary do daviid: amz3: I don't know, but I agree with civodul, that one should use (value) amz3: (value) can not be stored in a variable, ludo changed his mind, and wrote its prefered solution is to use a singleton record instance daviid: anything would be 'something' amz3: which I tend to agree daviid: then it s not 'nothing' that one once amz3: yes amz3: the problem i see while using a symbol, is that symbols are part of javascript spec so they might one day end up in JSON amz3: and other serialization formats daviid: maybe we should have nothing remaned and have it in guile core ... (I haven't red my emal yet ... need to catch) daviid: 'almost-nothing, and this empty record instance ... daviid: we should call it tinn (this is not nothing - ceci n'et pas une pipe) daviid: *n'est pas... amz3: first joke I read from you amz3: ^^ amz3: next billion is the slogan used by google to explain that's its going to capture development countries in its sillos amz3: the expressions stayed amz3: https://qz.com/on/the-next-billion/ amz3: exemple of that slogan displaying various attemps to from GAFAM to bite them amz3: my xp with people from deveplement countries is that, they will be very hard to convince that 'free' even gratis is something of interest amz3: seems like a lost cause amz3: at first! amz3: basically, they want to the western shit amz3: for instance In algeria, we had numerous limonades. People were unhappy because it was no Coco Cola per se. amz3: I mean in the past you had choice about which limonade to drink, now there is only Pepsi and Coke and its derivates amz3: so much brain drain amz3: my last hope, is that free software is way to transfer technology and knowledge and that might talk to them as way to bring more work to those countries, a slim chance. amz3: I even plan to create a translator for scheme experession. I take as input dictionary, produce the same code with translated identifiers. rekado: these are the worst kind of error messages: Wrong number of arguments to # rekado: In ice-9/eval.scm rekado: I wonder if this can be avoided. janneke: yeah, drop in a repl and inspect it would be nice... rekado: turns out this was because of “receive” rekado: I had the thing that returned multiple values wrapped in a simple thunk, so the result was just a single value instead of the two that I expected to receive. rekado: does anyone happen to know the right format for passing headers to an HTTP request? rekado: e.g. (content-type . (text/html)) rekado: I’ve tried all variants of (cache-control . (max-age 60))), but I always get “bad header”. janneke: i pulled this snippet from an older application, not sure if it helps... janneke: (values '((content-type . (text/html))) (web-file '(index.html))) jlicht: I had the following in some code calling out to some api, rekado: (define (headers) '((content-type . (application/json (charset . "utf-8")))(cache-control . (no-cache)))) rekado: thanks. Unfortunately, I still don’t understand how to specify cache-control with max-age rekado: looks like this is correct: (cache-control . ((max-age . 60))) rekado: oh well amz3: https://github.com/a-guile-mind/guile-web/blob/master/src/web/helpers.scm#L46 civodul: rekado: what you show seems to be correct civodul: there are examples in 'guix publish' if you want to double-check amz3: hello #guile wingo: moo lloda: hi wingo lloda: I've tried your fixes lloda: haven't crashed it yet :p wingo: heya wingo: oh that's good :) wingo: not crashing is a good start wingo: lmk how perf goes lloda: will do jlicht: Is doc-snarf in guile-tools no longer supported, or am I doing something silly? I seem to always get no output + exit status 0 amz3: what is doc-snarf? jlicht: it was (/used to be?) a magical tool to extract Guile's docstrings to, among other things, texi @deffn{}-like things jlicht: I have now hacked together some abomination using geiser + texi-docstring-magic.el which "works", but I'd much rather use something a bit better supported if possible ArneBab: wingo: can I already try benchmarking your first steps? rekado: looks like I’ve been looking at the wrong problem wrt http-post (bug#32528) rekado: the debbugs SOAP service really does include a bad header. rekado: it’s nothing to do with the email headers in the response body. rekado: “wget --server-response …” shows me the odd-looking Content-Type header. rekado: Content-Type: multipart/related; type="text/xml"; start=""; boundary="=-=-=" rekado: For now I’ll just replace the content-type handler. civodul: rekado: what's the faulty URL? rekado: civodul: it’s a little long. Here’s a command to fetch it: https://elephly.net/wget.txt civodul: indeed, a little long :-) civodul: Content-Type: multipart/related; type="text/xml"; start=""; boundary="=-=-=" civodul: i think it's valid, isn't it? rekado: yes, but Guile doesn’t like it. rekado: I wrote “bad header” because it really is a header, not an email header from the response that’s misinterpreted as an HTTP header. Labu: Hello civodul: hello Labu Labu: I try to understand how works goops civodul: rekado: this seems to be "MHTML", say the intertubes; see https://tools.ietf.org/html/rfc2557#section-9.2 Labu: HI civodul Labu: I made a metaclass which redefine compute-get-n-set. But I didn't get what I expect. I don't find how I can set the value of a slot Labu: Have you some examples ? civodul: Labu: perhaps you can paste what you have, explaining what you get and what you'd expect? Labu: ok civodul https://pastebin.com/VxsUGsFN Labu: when I try it I get this https://pastebin.com/QHy3dysG Labu: Is like counter Labu: It is* Labu: but I dont want this :-) rekado: I replaced the content-type handler in guile-debbugs. Seems fine now. Labu: ah ok Labu: I got it Sheilong: I am trying to access the elements of a bytevector, but did't find anything at the documentation, I want to perform some operation under its elements mwette: Sheilong: check the guile ref man, Section 6.6.12, (or better yet, the the procedure index). for example, (bytevector-ieee-double-ref bv 1) Sheilong: I am on it, but haven't seem this procedure amz3: hello #guile mwette: hi! janneke: hi! wingo: jit seems to speed up map on a 1e7-element list by 1x (mapping 1+ takes 320-440ms instead of 610-730ms) mwette: wingo: cool -- Hey, have you every looked at the VEX in valgrind to see how CPUs are characterized there? VEX may be more aggressive about covering instruction sets. wingo: mwette: you mean as a jit library? no i never thought about that wingo: it's an interesting idea :) wingo: ime lightning is ok provided that what you want to do is part of its instruction set. however everything having to do with procedure calls is a bit weird mwette: Does V8 do more? wingo: https://archive.fosdem.org/2017/schedule/event/valgrind_vex_future/attachments/slides/1842/export/events/attachments/valgrind_vex_future/slides/1842/valgrind_vex_future.pdf is a recent presentation wingo: mwette: v8 etc all just have a c++ library embedded in them that's an assembler that directly supports the instructions they want to emit, for each architecture. sometimes they layer a macroassembler above it. for optimized compilation, the compiler IR eventually gets lowered to something corresponding to some abstract IR corresponding to assembly; instruction selection actally produces the assembly via calls to the assembler library wingo: basically the assembler is dumb and the compiler is smart wingo: lightning used to be dumb but it got smarter it seems (e.g. register allocation etc); dunno if that is good or not :) wingo: it used to be v8 and friends just duplicated a bunch of code for each architecutre wingo: you'd have jit-ia32.c, jit-x64.c, etc wingo: in that case, obviously there's no need for an assembly abstraction. but it was hard to maintain :P mwette: in valgrind the file to look at is VEX/pub/libvex_ir.h wingo: will have a look wingo: switching jit libraries won't be that bad if we end up doing it mwette: well valgrind is the opposite: it converts machine code to IR mwette: but there is the IR model none-the-less wingo: of course but it does the jit too mwette: didn't mnow that mwette: I know of JIT mach-code to IR. I created a tool w/ valgrind to count CPU cycles in a chosen segment of user code (https://github.com/mwette/cputil). mwette: brb wingo: lloda: have you been able to make more experiments? *: wingo afk for a while hugo: wingo: A Guile Notebook would be cool. Currently I'm kinda using emacs with geiser as one, but it's for from perfect. hugo: manumanumanu: Yeah, I'm studying CS. So hopefully I know at least some things. qtoni: Aye aye, I can get documentation of functions and symbols via ",d " in the REPL, but how can I write this documentation for my own functions? sneek: Welcome back qtoni, you have 1 message. sneek: qtoni, amz3 says: here is talk you might be interested https://fosdem.org/2018/schedule/event/code_graph_based_analysis_of_javascript_repositories/ mwette: test weinholt: you will not believe it, but the test failed mwette: damn hugo: qtoni: If the first expression of a function (directly after the parameter list) is a string then that is used as the documentation. ArneBab: amz3: ok ArneBab: Is there a practical Scheme tutorial which explains how to work with records and where to use them (convenience-wise and performance-wise)? amz3: ArneBab: records like srfi-9 records? amz3: I am not aware of any tutorials regarding records per se amz3: what I know is that a) last time I asked which record library to use on #scheme, I started somekind of flamewar over hygenic and unhygenic macros b) I like srfi-9 c) there was lot of debate about records in the past, it's a sensible subject but I have not sources about it d) I think srfi-9 are based on vectors, they are basically "tagged" vectors except they appear not as such in ice-9 'match' which is handy amz3: e) another debated subject regarding records is whether they should support some sort of inheritance amz3: f) last but not least guix defines a define-record-type* macro https://github.com/lfam/guix/blob/master/guix/records.scm#L178 amz3: g) there is also a gnu extensions to srfi-9 lookup for 'gnu' in srfi-9 guile manual page amz3: like you can define a specific printer for a record type (the equivalent of overriding __repr__ in Python) amz3: BTW, records are coming to python stdlib they are called data classes, same for fluids which are called context vars. amz3: regarding d) guile srfi-9 records are a _disjoint type_ amz3: hence for ice-9 match srfi-9 records and vectors like vu8(42 3.14 1337) are disjoint amz3: aka. you can not match a record by mistake using some vector pattern amz3: regarding performance I am not sure, IIRC mark wrote that srfi-9 gnu immutable records are faster but I am not sure. amz3: Also there is some helpers to instrospect records, but I never made use of those procedures. jlicht: `coverage-data->lcov' from (system vm coverage) does not support the `modules' keyword in guile 2.2. Was support for this removed, or is the info-documentation simply incorrect? amz3: jlicht: it must re-implemented, look at the module file there is note about it and it's commented amz3: in the source file i mean to say amz3: I got confirmation from civodul that it a task that remains to be done jlicht: amz3: thanks! I did not realize the comment was also referring to the same thing manumanumanu: weinholt: We should start a swedish schemer group :D wingo: moo amz3: moo stis: muu as the swedish cows says stis: and don't let me write here what I learned my children about pig sound (close to a snooring sound) ArneBab: amz3: the different kinds of records civodul: howdy Guilers! manumanumanu: muu! mwette: hi rain1: good morning all stis: manumanumanu: would be fun to hava a hackaton here about something, like testing and helping jit, guile-emacs or such a ganeral interesting topic amz3: ArneBab: IDK if there is a comprehensive study of records amz3: hello all wingo: would be cool if someone made a notebook with guile wingo: http://willcrichton.net/notes/lessons-from-jupytercon/ civodul: wingo: guix package -i jupyter-guile-kernel :-) civodul: more to come in this area in Guix land... amz3: notebooks are the future wingo: nice :-) *: wingo implemented fused compare-and-test in the jit, to better work with lightning api mwette: re records, check amazon for books on "functional data structures" manumanumanu: stis: the thing we are doing in Linköping is more to show off cool stuff, but for a future thing that is a wonderful idea! manumanumanu: i guess hugo is doing something CSy, so he might actually be useful compared to me stis: manumanumanu: ok ArneBab: mwette: a full book on datastructures would be a bit much, since I just search for a 3-4 page tutorial which shows where they are useful. Essentially "best practices and why" amz3: AFAICT, records are used in place of where you would use a dictionary in python or a namedtuple. The difference with a python dictionary which is more like an alist. The difference with the alist is that it's O(1) instead of O(n) to lookup an item, the advantage of the alist is that you can no stuff keys on the fly you must know them in advance amz3: on my side, I use records also instead of classes. amz3: on you can even mimick 'abstract class' kind of class by stuffing procedure in record fields amz3: I have no example of that tho amz3: here is an exemple use of records in guile-haunt https://github.com/guildhall/guile-haunt/blob/master/haunt/builder/blog.scm#L46 amz3: here is another example: https://github.com/guildhall/guile-haunt/blob/master/haunt/post.scm#L45 ArneBab: amz3: from what i saw, the namedtuple is closest, but it seems that I’ll need to check by myself how fast they are and how much memory they need. ArneBab: amz3: thank you for the examples! Once my children stop complaining that their video is in a small window, I’ll check them :-) amz3: in wiredtiger, used to use srfi-9 records to provide a handle over the C structs, for instance: https://framagit.org/a-guile-mind/guile-wiredtiger/blob/master/wiredtiger/wiredtiger.scm#L108 amz3: here is more recent example: https://github.com/amirouche/zehefyu93/blob/master/guile/neon/engine.scm#L63 amz3: ArneBab: btw the C struct as record as a bad example, look into guile-git / guile-libigit2, the best way to define disjoint type for pointer is something else that is guile specific, I don't remember correctly amz3: ArneBab: regarding performance, you can compare to vectors, but I think the performance gain in using vectors instead of struct will be very slim amz3: instead of records i mean mwette: Aren't scheme records (usually) implemented with vectors anyhow? civodul: mwette: conceptually, records are vectors with labeled entries civodul: in Guile though, "structs" are disjoint from vectors civodul: the thing is that you need a way to create disjoint type, so you can't really implement records in terms of vectors civodul: (or you have to override 'vector?', but then it might still be possible to forge invalid record instances, among other issues) mwette: civodul: gotcha. It can be done on vectors: I assumed this was typical, as shown in TPLS. I implemented years ago. See http://paste.debian.net/1039315/ mwette: civodul: one uses slot 0 for the struct name mwette: usage: (define-mstruct foo a b c) (define x (make-foo 'a 1 'b 2 'c 3)) (foo-a x) ;; => 1 stis: yay my socket implemented for guile python compiles and loads mwette: stis: you want to be able to run (pure) python code in Guile? jlicht: Does guile support something like srfi-97 (https://srfi.schemers.org/srfi-97/srfi-97.html), with which we can import srfi libraries using something that is a bit easier to recall than some random integer N? stis: as much as possible stis: not all things is supprted like the self inspections code stis: also I don't supprt assynks as wingos: fibers is the way to go amz3: jlicht: you get used to it :) amz3: jlicht: I got used to at least jlicht: amz3: I was afraid this was the case :(. I could just print out the srfi-97 list and hang it next to my bathroom mirror... mwette: lol mwette: (lol was to the bathroom mirror ref) weinholt: jlicht, r6rs code in guile can use srfi 97 names and import (srfi :1 lists) etc, it is translated to srfi-1 and so on jlicht: weinholt: hah, that is cool! thanks. civodul: the bathroom mirror trick is a good one :-) wingo: lloda: figured out what was going wrong; lightning had a bug where it wasn't preserving the value of callee-save register r12 wingo: still working on the fix tho stis: good catch, a tough one! wingo: a bit irritating stis: yep wingo: lightning includes a little register allocator used when making calls, and it can use unexpected registers... registers even unexpected to itself wingo: i would rather have a somewhat less generic library :) stis: :) stis: I guess this uglifies our codebase, are the lightening folks responsive for bug reports? civodul: wingo: it used to have no register allocator, but then it was probably more burden on the user (i haven't tried the new one though) wingo: stis: until now it has been manageable. i'm sure this is just a bug somehow wingo: lookig for the fix wingo: civodul: honestly i wouldn't mind being resposible for register allocation, dunno wingo: i would prefer a simpler library without an optimization phase, without a graph of nodes, etc wingo: just emitting assembly into a buffer civodul: yeah, dunno civodul: lighting 1.x was exactly that civodul: *lightning *: wingo nod wingo: i think the problem here is just that for x86-64, r12 was missing the flag to indicate that it's actually callee-save wingo: weird wingo: found some other weird bugs in lightning git, like the fact that the default allocator for code pages just doesn't work at all civodul: that sounds quite bad :-) wingo: well, maybe mmap used to return something that wasn't MAP_FAILED when asked to allocate 0-byte pages... wingo: dunno, the stock allocator isn't very good (it puts every jit_emit() on its own page), i guess everyone uses their own allocator wingo: we will need to do so i think civodul: ok wingo: lloda: ok pushed a fix, your array-sum example works now wingo: no speedup though as the bottleneck is in array-length/array-ref, and in making heap numbers wingo: takes around 1.6s on my machine either way wingo: whereas the original f32v-sum takes 180ms before jit compilation, and 50ms after wingo: jit-compiling array-length works, jit-compiling array-ref doesn't yet wingo: and jit->jit calls aren't working it seems :) need to fix amz3: hello #guile wingo: sneek: later tell lloda with current git i can jit-compile array-sum. as i said, no change. when running without hooks (as the jit does not currently emit hook calls) it's around 1.42s on this laptop regardless of whether array-sum is compiled or not sneek: Got it. wingo: sneek: later tell lloda similarly if array-sum is not compiled and array-ref and array-length are compiled, same thing, no speedup sneek: Got it. wingo: sneek: later tell lloda but if all three are compiled, elapsed time goes down to 1.2s. all the rest of the time is in gc sneek: Okay. amz3: sneek: botsnack sneek: :) amz3: I hope more guile / scheme hackers join the guile room rain1: what guile room? jcowan: the one we are in, presumably amz3: http://community.schemewiki.org/?FOSDEM2019 rekado: I’m trying to use “mu-message-from-port” from the Guile bindings of the latest unreleased Mailutils. rekado: It is supposed to read a mail from a port, but it looks like it does not take a regular Guile port as an argument. rekado: It says “Wrong type (expecting exact integer): #” rekado: does anyone happen to know why that is? weinholt: rekado, the implementation asserts that the argument must be a port, maybe the error is from somewhere else? stis: the port is closed? manumanumanu: Hey ho wingo: heyoo manumanumanu: What are y'all up to? stis: python sockret standard lib stis: er socket manumanumanu: sockret. Nice name for a socket lib janneke: 64bit port of mescc *: wingo poking jit.c manumanumanu: stis: hugo and I are going to have a scheme meet-up in Linköping some day. It is quite a long way from West Aros, but I don't know how you travel... stis: I can take a day off and join, would be nice. PLease choose a week where I don't have the kids at home then manumanumanu: Even or odd? rekado: weinholt: turns out that it’s a problem *printing* the message object, not in parsing it. rekado: I’ve sent a bug report to bug-mailutils. stis: I can not v35 v37 v39 v40 v42 v44 v46 v48 stis: for what I know, work travel comes also from time to time with short notice manumanumanu: I don't know if there are any other schemers in Östergötland that might be interested, but if you know any please spread the word stis: stockholm? mikael djurfeldt? hugo: manumanumanu: Is West Aros Västerås? rekado: amz3: is your Scheme day for FOSDEM separate from what we try to organize as a Guile + other {small languages,Scheme implementations} devroom? stis: Yep aros is stream opening in a lake, East Aros is Uppsala and West Aros is Västarås ArneBab: amz3: I am only somewhat familiar with cross-site-forgery prevention, but enough to know that it’s a mudhole with more traps than I can see. At the company we have a ~10 page summary of the essentials, but I’ll need to ask our dev lead whether I would be allowed to share that with you (as individual). ArneBab: (I wish secure employment (sufficiently secure to get bank loans with good conditions) and working in the open with free software in a great team would already be easier. ArneBab: rekado: sounds like guile is wrong, yes … as far as I read, it MUST split the bytes by the boundary, though the boundary =-=-= is awfully short. rekado: I found this same boundary also in an email made with gnus. ArneBab: that’s strange … what happens if the body includes that boundary? rekado: I’d think that this would not be good. rekado: but maybe gnus has some way of picking a different boundary then. rekado: don’t know. ArneBab: typically the boundary seems to be something like a UUID, much longer and very unlikely to be in the content, even for large files. ArneBab: amz3: I’d like to be around for FOSDEM, but I don’t yet know whether I can be. It would be cool to share my experience with using wisp for various smaller projects. weinholt: manumanumanu, anything happening around göteborg? rekado: Can I monkey-patch the procedure that parses the Content-type header? civodul: rekado: probably, but do you really need to do that? :-) rekado: the current implementation in (web http) leads to an error when receiving messages from Debbugs, so I think I do…? civodul: oh? civodul: like a bad content-type header? rekado: yes. The header value looks like this: multipart/related; type="text/xml"; start=""; boundary="=-=-=" rekado: the problem is with the boundary. rekado: it contains equal signs, but (web http) aborts when the last “=” is not also the first “=”. rekado: FWIW your message about the mailutils bug also contains this boundary rekado: Content-Type: multipart/mixed; boundary="=-=-=" rekado: I wonder if that’s a gnus thing. civodul: "when the last = is not also the first ="? civodul: re monkey patching, i think you could copy the (declare-header! ...) expression with your own code, and that'll override the content-type handler that (web http) provides rekado: it does this: (unless (and eq (= eq (string-rindex x #\=))) (bad-header 'content-type str)) rekado: “eq” is (string-index x #\=) rekado: that’s where it bails out because the right index of #\= is the last character of the boundary string, not the equal sign separating the “boundary” key from the value. rekado: can I do this inside of (web http) so that I don’t have to replace all references to module-internal variables with (@@ (web http) the-thing)? civodul: if you do this inside (web http), then it's "patching", not "monkey patching" :-) civodul: it looks like a parsing bug, though civodul: the parser should ignore the quoted equal signs i guess rekado: yes rekado: I don’t know if that assertion is relied upon later; haven’t looked more closely. rekado: (e.g. in eating up tokens up to the equal sign, etc) civodul: something i don't understand: the Content-Type example above is that of an email; it's not an HTTP header, right? rekado: correct rekado: … rekado: I’m talking to the Debbugs SOAP service. civodul: right, but is it expected that this is getting parsed as HTTP? civodul: i guess i'm missing something *: rekado looks at the code rekado: i’m sending a request to the SOAP service via http-post and expect to receive a response from it. rekado: that response is some XML. rekado: and I guess it should not try to parse the payload as HTTP civodul: the email is within that XML? rekado: yes rekado: I’ll investigate tomorrow. rekado: maybe I’m doing something silly. civodul: it's also very possible that i don't get it, dunno rekado: I’m using http-post with #:decode-body? #t to get a string instead of a bytevector as a response. rekado: I wonder if that’s the cause of the problem. civodul: could be civodul: well well, no civodul: though you should probably #:stream? #t and then read from the returned port civodul: (normally #:decode-body? is just about decoding the body as a string in the right encoding, so it should be safe) rekado: okay. rekado: well, I need to try to reproduce this tomorrow with a clear head. rekado: thanks for listening! civodul: yw! amz3: ArneBab: don't bother with trying to share with me the documents about CSF amz3: rekado: I don't know if it's separate, I wish it's not. amz3: ArneBab: I mean CSRF amz3: rekado: AFA communication has gone so far, it's more like 'guix event' maybe 'guix+guile' maybe 'guix+guile+lua'. I never read anywhere that there was a plan for a 'scheme' or 'small language' devroom. nowhere in the mailling I read, it might be a mistake of my own amz3: and as far as I am concerned, I don't think it wise to call it 'small language' devroom. amz3: lua alone is not a small language civodul: dustyweb: i've pushed a .texi file (mostly a stub) and a couple of other things to guile-gcrypt dustyweb: \o/ civodul: i can make that a 0.1.0 release if that's fine with you dustyweb: civodul: thanks for keeping things rolling :) dustyweb: yes please! civodul: cool :-) civodul: dustyweb: done! rekado_: I get an error in (web http) when trying to fetch certain bugs from debbugs. rekado: I get an error in (web http) when trying to fetch certain bugs from debbugs. rekado: Bad Content-Type header: multipart/related; type="text/xml"; start=""; boundary="=-=-=" lloda: wingo: https://paste.debian.net/1038963/ segfaults lightning just from jit & running (define (array-f1 a) (array-ref a 0)) wingo: nice wingo: must be we have something wrong in the call/receive sequence wingo: ... or the toplevel-ref code? humm amz3: hello #guile rain1: hi ArneBab: rekado: you might have to implement multipart parsing. I recently did that for a server, though in a bit of a hurry: https://bitbucket.org/ArneBab/wisp/src/tip/examples/upload-server.scm amz3: hi ArneBab I keep you hack around I will need it amz3: ArneBab: btw, are you familiar with cross site forgery counter measures? rekado: ArneBab: I built that too, also in a hurry :) rekado: ArneBab: the problem here is actually sillier: the boundary string contains a bunch of “=”. rekado: apparently that’s not okay. rekado: Guile looks for the first equal sign and checks that it is the same as the last equal sign. rekado: the content type header looks like this: rekado: multipart/related; type="text/xml"; start=""; boundary="=-=-=" rekado: so in the case of “boundary” it sees the first “=” and then notices that the last “=” is not at the same position rekado: (unless (and eq (= eq (string-rindex x #\=))) (bad-header 'content-type str)) rekado: I think Guile is wrong here. massma: Hi guile, new user with a silly question I can't find the answer for: how does guile determine/set search paths for dynamic c libraries? massma: the manual says it searches in /usr/lib and /usr/local/lib, but I'm on GuixSD with my libraries in ~/.guix-profile/lib amz3: massma: use absolute path amz3: massma: but not to ~/.guix-profile amz3: massma: use /gnu/foobar/thing amz3: massma: install guile-wiredtiger and see the config.scm file amz3: to see how it's done amz3: massma: ok? massma: amz3: gotcha, thanks a bunch. massma: amz3: Yes, (dynamic-link "/gnu/store/g234d3mja3s49d77nrwkf7sgfgh4xr3g-netcdf-4.4.1.1/lib/libnetcdf") does work rekado: massma: there are two ways: either the programme uses just the simple library name – in that case you can force it to load it from elsewhere by setting LD_LIBRARY_PATH; or the programme detects the library location at configure time and embeds the absolute file name of the library. rekado: massma: when packaging things for Guix in the former case we usually patch the code so that it refers to the exact path of the library. rekado: in user code you should not use /gnu/store manually. rekado: either add a configuration step or set an environment variable. amz3: what rekad said massma: rekado: thanks for the help, setting LD_LIBRARY_PATH seems like the easy thing for now, then add configure infrastructure later massma: appreciate the help amz3: ! amz3: massma: subscribe to the mailling list https://lists.gnu.org/mailman/listinfo/guile-user ;] amz3: I got a comment on my guile youtube video, at last, world famous (tm) jcowan: Why does Guile support cyclic dependencies between modules? Does it even make sense to do so? wingo: moo civodul: rekado: yep! just a few little changes, but i haven't yet tried to check out from your repo civodul: lemme see civodul: looks like i was using a version that predates the first commit of https://git.elephly.net/?p=software/guile-picture-language.git civodul: rekado: i think whatever it is that i changed has become irrelevant (i don't even see from the diff with commit 0 what it was :-)), but i'll let you know if i have anything! rekado: heh, okay civodul: rekado: it may have been this: https://paste.debian.net/1038926/ civodul: plus transparency-related procedures, but that's what 'cellophane' does now civodul: i was doing simple red/blue 3D images rekado: oh, that sounds cool ft: Note that every other C developer will look at you funny, though, if you do. ;) ft: I mean, in K&R you can also do int foo(a,b,c,d) { ... }, because the parameters will be implicitly int. I think everything that was changed from K&R to ANSI has been an improvement. ;) daviid: ft: tx daviid: Combinatorialist: tx too manumanumanu: What exactly does goops do to macro expansion? defining a generic procedure is ruining an unrelated macro expansion... manumanumanu: oh no. I know what happened. manumanumanu: phasing issues. roelj: Using the FFI, how do I create a pointer to a pointer? manumanumanu: roelj: (make-pointer (pointer-address pointer)) ? roelj: manumanumanu: I think that just makes a pointer with the same address as "pointer". manumanumanu: roelj: i usually use malloc directly for those things. 2 secs and I'll paste you my implementation (that also free's allocated memory using the GC) manumanumanu: roelj: https://pastebin.com/knYh0AJD manumanumanu: that will allow you to allocate (sizeof size_t) roelj: manumanumanu: That's very smart. Thanks! manumanumanu: When the allocated memory pointer becomes unavailable to the guile program, it will be freed manumanumanu: BIG FAT WARNING roelj: That's what the '(dynamic-pointer "free" (dynamic-link))' does, right? manumanumanu: exactly manumanumanu: that las argument is a guard, and you can leave it out to manually manage the memory manumanumanu: to fill the memory you have to access it as a bytevector and write whatever pointer address you have to it. roelj: Why is size_t the return type for malloc in your definition? roelj: Shouldn't that be '*? manumanumanu: no, because I am passing the return-value to make-pointer and explicitly adding a guard function roelj: So, glibc's malloc returns a pointer, which you pass to make-pointer. How does size_t affect the return value of c_malloc? roelj: It's still the address of the memory location? manumanumanu: size_t is the size of a pointer manumanumanu: on that platform manumanumanu: so most often 32 or 64 bit manumanumanu: Why I am asking is because I am implementing racket-styled for loops for guile, and I have been looking at cl LOOP-witchery for ideas to extend it manumanumanu: oops manumanumanu: wrong channel roelj: If I may ask, could you give me an example of a pointer to a pointer using your 'malloc' function? I think I'm lost at the return value of glibc's malloc, and how that is interpreted by make-pointer. manumanumanu: first I do (malloc (sizeof size_t)) manumanumanu: that is a pointer object to size_t bytes in memory roelj: Right, and then how do you fill that pointer with an addres? manumanumanu: next I do (pointer->bytevector xxxx (sizeof size_t)) manumanumanu: Then I just write the pointer address to that bytevector manumanumanu: probably using (bytevector-u64-native-set! ...) or whatever i is called roelj: Isn't that size_t-specific then? manumanumanu: yes. you should use different bytevector procedures depending on the size of size_t roelj: Right, thanks! I was hoping to avoid having to know the details of the underlying platform. manumanumanu: I know. it is rather painful :( roelj: Do you use (sizeof size_t) to determine wether it's 32-bit or 64-bit? manumanumanu: I do, but there are better ways iirc manumanumanu: some (system compile xxx) voodoo roelj: Ahh okay roelj: Is it correct to state that (= (sizeof size_t) 8) means 64-bit, (= (sizeof size_t) 4) means 32-bit, and (= (sizeof size_t) 2) means 16-bit? manumanumanu: yes manumanumanu: but I don't know C :P manumanumanu: I figure all this out by pulling out almost all my hair over a weekend :D roelj: manumanumanu: Alright, I think I got around it. roelj: So, the function takes a pointer to a pointer to NULL, and will allocate memory itself. So I just gave it a (malloc (sizeof size_t)), and later on when I need the allocated memory by that function, I used (dereference-pointer xxxx). roelj: This way, I don't need to know about whether something is NN-bit. roelj: As long as 'dereference-pointer' does its job correctly. roelj: And instead of (malloc (sizeof size_t)) I used (bytevector->pointer (make-bytevector (sizeof size_t))). wingo: guile's jit is going to be pretty simple, but happily it will be able to inline subr and foreign calls roelj: wingo: is it webscale? ;) cmaloney: It's web 4.0 because it's A+ roelj: hehe rain2: that's awesome wingo ! wingo: i think we have to compile to wasm to be webscale ;) cmaloney: Do eeeet. :) cmaloney: Then we can have a proper scheme in the browser mechanicalfrogs: hey guys - trying to get Chickadee working and I'm pretty sure I have all the necessary stuff installed - but when I run the provided example code I get this error: https://pastebin.com/BNW3qz1v mechanicalfrogs: running (symbol->string #:sdl2) gives me the same error daviid: mechanicalfrogs: that is a keyword daviid: mechanicalfrogs: keyword->symbol ... then symbol->string, or use srfi-88 which has keyword->string mechanicalfrogs: yeah - i'm not sure what's wrong because I'm using example code with latest releases of chickadee and guile-sdl2 daviid: this has been discussed here recently mechanicalfrogs: it's not my code that's causing the error, just the example daviid: mechanicalfrogs: yes, we know :) daviid: Chickadee probably uses srfi-88 and did not tll you ... daviid: mechanicalfrogs: anyway, the best is to define your own keyword->string daviid: iirc, srfi-88 has a problem, in the way that it changes the reader ... i don't have ti me to check now, try to search the log about this, r someone may shim in mechanicalfrogs: daviid: okay, I'll look through the log - thank you! daviid: np! amz31: yay! amz31: ACTION got a (great of course) idea amz31: I will rename culturia.next to asylum amz31: I prefer much more that name, 'asylum' seems timeless whereas AI / IA thing can fade away amz31: timeless name amz31: also, maybe more of interesting, I will drop the biwascheme dependency, I found a ((very) creative) way to avoid javascript altogether, I let you guess how... amz31: and last but not least I am ready (at last) to use zehefyu93 because I am now sure this verioned git-like database can be useful in production amz31: which means I need to read the 2nd edition of reasoned schemer amz31: to add support for it in zehefyu in turn change the database backend in the main project amz31: here is the repository to watch / git clone https://framagit.org/a-guile-mind/culturia.next amz31: also, I will adopt a chatbot-like user interface and interop maybe with gnunet... dreams. amz31: https://github.com/TheReasonedSchemer2ndEd/CodeFromTheReasonedSchemer2ndEd amz31: wdyt? amz31: please people, let me know what design / graphics do you prefer amz31: https://screenshots.firefox.com/MDbwtBy4Tj1iVXrQ/localhost amz31: or amz31: that design with a video http://hyperdev.fr/ ? amz31: well it's prolly not very important nilg: Any idea how to list all symbols in a module? nilg: via the guile interactive shell... ft: nilg: Something like this maybe? (map car (hash-map->list cons (module-obarray (resolve-interface '(srfi srfi-1))))) nilg: oh, that's complicated I imagined something simpler like `,s module-name`, but it works, thanks. amz31: massive number of commits incoming from wingo chrislck: ft: this function needs a shortcut! manumanumanu: ArneBab: My for loops can finally do non-tco recursion! I have got some refactoring and tests to do, but other than that I am on my way to a stable release :D manumanumanu: I have started writing the guest blog btw. the one on complex macros. amz32: guest blog? manumanumanu: amz32: he asked me to write for hi's scheme series manumanumanu: sorry, should have addressed that directly to arnebab manumanumanu: amz32: what have you been up to lately manumanumanu: ? amz32: manumanumanu: not much guile coding actually :/ I am working on https://sensimark.com amz32: I see the database I've written could be useful in my day job; I will try to port it to python. amz32: because it will be easier to adopt than change the world for a better guile place amz32: #lazy manumanumanu: So: I have this problem: I have a list of symbols. I have a list of "valid symbols" in module 1. I want to make module 2 that will add symbols to that list, but in a way that module 3 can't see unless it imports module 2. daviid: manumanumanu: so, how about module 2 imports module 1, re-export module 1 public interface, then export new valid symbols ... then module 3 will only see the newly added symbls if it imports modle 2 ... manumanumanu: I have painted myself in a corner though... module1 defines macros that act on the valid-symbols manumanumanu: Or rather, it has a procedure that checks whether a symbol used in a macro is valid manumanumanu: (macro 'symbol) will check whether symbol is valid manumanumanu: using a procedure defined _in_ module1 daviid: manumanumanu: it sounds like a can full of worms to me :), could you produce a snipset we could play with maybe (not that I'll be able to help, but ... manumanumanu: I'll have to try to find something out... manumanumanu: figure* daviid: tbh, I don't understand what yu are trying to do :), sorry manumanumanu: I have written a looping construct. In that module I have a list of "valid sequences" (like in-list, in-range, in-vector). Sequences are validated during macro expansion. I want modules to be able to define their own sequence types. manumanumanu: In a way that doesn't add them globally. Currently I am using (add-sequence-type! 'symbol) that uses set! on a list daviid: I don't see any other possibilities then effectively holding a list of (or what ever structure is adequate), that grows or shrinks ... what's wrong with that? manumanumanu: Well: if module2 defines (in-bananas ...) and adds in-bananas to the valid sequences, it also becomes valid in module3 that hasn't imported module2 manumanumanu: Not a huge deal, but still. I want to provide good error messages daviid: but it adds to the valid module 2 lists, not the module 1 list, then module 3 will only see module 1 list manumanumanu: oh, but the list is defined in module1 and the macros using that list is also in there, so module1 is not "importing" any valid-sequences list manumanumanu: there is currently only one list daviid: manumanumanu: i don't see any other way then splitting that in two, and module 3 to check if it imported (or not) module 2, and 'adapt' its valid proc/macro depending on ... daviid: or a hacky hack where module 1 would export its valid symbol lists length, module 2 would add at the end, module 23 would only be allowed a portion of that list ... fun games daviid: fun and dangerous games :), but feasible I guess manumanumanu: but I don't really see how to do that without re-exporting the macros. manumanumanu: and that sort of defeats the purpose of a simple (define-sequence ...) macro. manumanumanu: The whole thing is huge, with a gazillion helper functions and almost 1000 lines of code. daviid: but the macro could be 'augmented' so it checks what I exposed above, no? daviid: you mean tha macro that checks f a symbol is valid daviid: would check what modules it is supposed to check against ... the macro would be the same for all manumanumanu: daviid: I could create something like (export! valid-seqs) and somehow have the macros check the local environment manumanumanu: hmmm. manumanumanu: This are the fun parts of the module system. manumanumanu: But then we have the problem of conflicting valid-seq lists :( :( manumanumanu: So, I will add (current-module) whenever someone adds a valid sequence, and then check the imported modules during macro expansion manumanumanu: If I can in any way find out what modules are currently imported... manumanumanu: (module-uses (current-module)) manumanumanu: haha. This is brilliant daviid: well, you could check for a name, like daviid: if that variable is defined, then module 2 has been imported too daviid: even use *feature* manumanumanu: I think actually checking the current modules is the way to go daviid: ah yu found a better solution indeed manumanumanu: daviid: thanks for the input. You made me go to places in the docs I never knew existed :D :D daviid: np! daviid: in C, can't we do 'int foo (int a, b, c)' daviid: i mean do we have to specify the type for arg individually ft: yes daviid: ok tx ft Combinatorialist: daviid: You might be able to use K&R style: int foo(a, b, c) int a, b, c; { return 0; } daviid: heya! daviid: dsmith-work: yes, developing apps for the librem5 phone, using guile, since they use debian as their os and gnome as the phone desktop (one will be able to use plasma as well) daviid: dsmith-work: postgres servers would run on ... servers. one can write an app, for the librem5 that uses libpq, or sqlite3 ... my concerns wrt postgres is platform independent: what we have is not good enough, imo daviid: amz31: what's the problem wrt latex? daviid: it would be nice to also improve our sqlite3 bindings, the bindings themselves, adding a manual ... but at least we can trust what we have (there are used by guix, and daniel did a good job to improve things recently, however it could have a web site, a good tutorial, releases ... daviid: lloda: are there? I have a question for you :) lloda: sneek: later tell daviid what time are you on? I can try to login tonight sneek: Got it. wingo: ACTION starts implementing jit for the various opcodes OrangeShark: There is a new little book! https://mitpress.mit.edu/books/little-typer roelj: Is there a convenient way to merge pairs with the same key in an alist? So, transforming: ((a . b) (c . d) (a . e)), into: ((a . (b e)) (c . d))? rekado: roelj: does it *have* to be an alist? roelj: rekado: No.. rekado: roelj: I don’t know if that’s convenient but you can fold over the alist item by item and accumulate the new alist. roelj: Right. Thanks! rekado: roelj: while you’re here: should we open an IRC channel for the gwl? roelj: rekado: Possibly. The mailing list is pretty quiet, so I wonder whether the same would happen to a gwl channel.. ng0: we have more bots in libmicrohttpd than people.. but it exists if people need it.. same for gwl maybe? roelj: It probably can't hurt amz31: daviid: no problem with latex it's just that what I am working on is so niche, that almost no conference is suitable for it amz31: daviid: also lloda is looking for you daviid: hello! sneek: Welcome back daviid, you have 1 message. sneek: daviid, lloda says: what time are you on? I can try to login tonight daviid: amz31: tx daviid: lloda: 'll write the quiz here (later, I'm on something else now) then yu can answer whenever you're happy/free to do so, no worries, and tx amz31: OrangeShark: I started PhD on my free time https://fr.wikiversity.org/wiki/Recherche:Pens%C3%A9es_Profondes_et_Dialogues_Pertinents amz31: I am not sure about the french. mwette: /quit wingo: i am an idiot. wrote a custom allocator, didn't test edge cases -> bugs weinholt: happens to everyone weinholt: i'm debugging after-gc-hook and have a pretty good test setup where i can reproduce the test failure weinholt: the failure correlates pretty well with the test scm_is_false (SCM_CDR (after_gc_async_cell)) being false in queue_after_gc_hook() weinholt: (strange sentence) weinholt: wingo, is there a debug printer that's usable if scm_display() is not working? wingo: weinholt: there are things you can do from gdb that directly try to interpret the memory wingo: civodul is the expert tho... wingo: (system base types) is the module, i think there is some support from gdb-guile to use it weinholt: well, it turned out to be null anyway wingo: heh wingo: weinholt: just for reference -- does your guile have threads wingo: ? weinholt: yes, half a dozen wingo: k wingo: i guess you have verified that the libgc test suite is passing fine for you weinholt: will do so now wingo: i don't see a test failure there but that doesn't mean there isn't a guile bug! weinholt: libgc's "make check" passes amz32: weinholt: what are you doing? weinholt: amz32, trying to pin down where this is coming from "FAIL: gc.test: gc: after-gc-hook gets called": https://tests.reproducible-builds.org/debian/rbuild/unstable/amd64/guile-2.2_2.2.4+1-1.rbuild.log.gz roelj: When I have a function like this: (define* (test param #:optional '(a #f) #:key (b #t))), and I'd like to define a macro: (define-syntax-rule (t param) ...) Can I pass the #:b somehow via the macro? amz32: roelj: I think you don't need ' in '(a #f) check the manual to be sure; idk the core of the question tho chrislck: a kinda-noob question - when we do "(use-modules (srfi srfi-1))", why exactly is the expression (srfi srfi-1) acceptable as the parameter to use-modules? it looks like we're calling the function called (srfi) with argument srfi-1, and passing its result to (use-modules)... shouldn't it be (use-modules '(srfi srfi-1)) ?? weinholt: use-modules is special syntax, like a macro roelj: chrislck: There's a file srfi/srfi-1.scm in the GUILE_LOAD_PATH, which gets read/loaded. roelj: chrislck: (srfi srfi-1) simply refers to that file. chrislck: ok. bit weird though. un-lispy! weinholt: sure, but (srfi srfi-1) when evaluated would normally try to look up srfi and srfi-1 in the environment. since use-modules is syntax, it doesn't evaluate its arguments chrislck: what other special syntaxes exist? weinholt: there's quite a bit. search the manual for "syntax:" chrislck: this part of scheme is something I'd rather leave as the 'internal magic' :) OrangeShark: You can look at some common ones that you might use like lambda, define, if, case, let, and many more chrislck: ok - lambda/define/if/let don't use any syntax-words, but (case x (...) (else ...)) does use the 'else' syntax-word... got it roelj: Uhh, how would you transform '(((hello)) ((scheme)) ((world))))) into '(hello scheme world)? chrislck: find a flatten function? spk121: roelj: (map caar '(((hello)) ((scheme)) ((world)))) roelj: Woah, caar is cool :) Maybe we should consider calling it limousine roelj: See if that makes the code more understandable spk121: ;-) roelj: Thanks! chrislck: my surprise to learn that .scm can accept emoji code in strings, and outside strings :-o roelj: Unfortunately my IRC client doesn't ;) rain1: you coudl recursively flatten any tree into a list if you like daviid: http://www.nongnu.org/grip/manual/grip.html#index-flatten dsmith: Hey Hi Howdy, Guilers daviid: hi dsmith! (not at work :)) dsmith: Oi! dsmith-work: Whew. That' dsmith-work: s better daviid: oh! I thought you were on vacation :( sorry I to remind that's not thatcase :) daviid: dsmith-work: you're the only one I know who changes his nick depending on location (or activity) :) dsmith-work: daviid: Years ago, I would stay logged in from home and also from work. dsmith-work: The home machine is now a laptop and goes away with the lid closed, and I'm not on much there anyway. daviid: amz31: (for info, you have two active nicks, which makes completion fail ...) wrt to your quiz, yesterday about mapping values from one range to another ... these are very common and sometimes even mandatory procedures in image processing ... guile-cv has im-normalize and im-clip, and I should provide im-scale (not to confuse with im-resize, which guile-cv has, scale in img processing is precisely what you described, a map from a range daviid: of values to another ...) daviid: amz31: voilà, not sure I answer your quiz though ... xen1: amz31: daviid: tx, I know about autocompletion failure, I will fix later this week. amz31: daviid: thank you so much for the feedback on and explanation about my issue daviid: np! wrt irc, you can logout from one and regain the nick of your choice, if you resgistered daviid: the last cmmit for guile-pg is from 2015, that worries me bit, any active guile-pg user out there? daviid: postgres has eveloved so much, that big tech companies claimed that they will abandonn nosql to use it instead ... (I did read about htis recently but i lost the link) daviid: *evolved amz31: well, they are alternatives that are easier to setup than posgresql, less fluff more productivity daviid: I think a proper (and modern) binding to postres is something we can't offer not to have, so to speak, so I wish I had 3 lives ..., but I don't: I hope one of us will pick up guile-squee and turn it the best guile-bindings of all times :) amz31: daviid: nosql is not a thing anymore... i mean it was just a marketing buzz crack anyway... amz31: I looking for building foundationdb bindings, not sure when daviid: amz31: not to be pretentious, but Ive always quitely thought so, and neve investd in any ... but I'm glad postgres did full fill gaps, so 'they' can use it ... amz31: it's... wait forit... Apple's software.. . Apple bougth foundation db a few years back and made it free amz31: I agree postgresql bindings will be greqt amz31: I agree postgresql bindings will be great daviid: amz31: ok, if you are looking for jobs, and wish to offer to script and develop using guile instead of the snake :), then you'll see that the vast majority of the companies and research labs use postgres ... amz31: I fully agree, I dream of not being stubborn and less creative, I would have created guile bindings for postgres and would prolly be coding day and night in guile amz31: instead I code ads for the snake daviid: amz31: it's not we can't have other bindings, but not having a postgres top notch bindings, super tested, super documented, super maintained ... makes it difficult to offer to use guile ... daviid: what is ads? amz31: advertisments daviid: oh amz31: you don't want to know how bad it is.. daviid: amz31: good binding wll challenge your creativity as well amz31: yes sure amz31: In september, I will try, I promise. amz31: in the mean time i must show my collegue once again that I am not a dummy coder and that I am tired of that monkey tasks amz31: s/that/their/ amz31: I mean, is profesionnal coding always boring?! daviid: we need, imo at least, good postgres and gnome introspection (g-golf, I plan to start to work on it again - I wish I could find some external funding to work on this) weinholt: amz31, no, doesn't have to be boring amz31: weinholt: you are in over of the top company, that has decades of experience in CS... that should be much different, i guess daviid: what company, if not indescrete (top companies are not the most interesting imo) weinholt: me? ericsson currently, but i've resigned and have literally days left daviid: ah ok amz31: erirsson is like one of the biggest if not the biggest CS contributor amz31: in europe amz31: I don't know any other company like that, maybe Spotify looks alike but much smaller daviid: I thought it was seemens daviid: seimens, in europe amz31: ericsson has erlang afaik amz31: seimens might be big, but they did not free their language... i mean free computer science / engineering. Of course they other big computer companies in europe amz31: s/they other/they are other/ amz31: actual skills that inherited by future generations, not magic. amz31: s/inherited/shared with/ daviid: I'd like to transfrom my free s/w micro consultancy into an ngo, or close it and opening a new one, don't know yet, then invite all of you to help, participate, as shareholders, coders ... and (1) raise funding to write and maintain proper bindings to 'essential libs' and (2) start to offer consultancy using guile ... and I'm dead serious daviid: enough snakes in this stupid world daviid: :) daviid: I'll make a coffe, brb daviid: we could follow the igalia model amz31: what do you mean by igalia model? a team of remote dev dedicated to guile software? amz31: daviid: that's what guix foundation europe is for I guess amz31: for guix amz31: the thing is that we need a software to sell, IIRC igalia was selling GNOME consultancy amz31: I mean sotware or library to seel consultancy amz31: s/seel/sell/ dsmith-work: amz31: I've almost always really enjoyed the work I was doing. But I mostly to embedded stuff. dsmith-work: s/to/do/ dsmith-work: Not much chance of Scheme though. amz31: It's been 5 years of sadness then amz31: that I am lucky that at least i do the snake and some proprietary stuff amz31: that I am lucky that at least i do the snake and _not_ some proprietary stuff amz31: I mean i work with free software that makes me happy weinholt: nice amz31: maybe it's just that I always want more of something, in french we say "the garden of the neighboor is always greener" dsmith-work: There are many things worse than Python. amz31: yes OrangeShark: now I have plenty of time to work on free software projects :) daviid: OrangeShark: really? let's talk! OrangeShark: sure daviid: amz31: i was refering to their social model, the way the employes and consultant are part of the board ... and retributed on benefice ... amz31: daviid: big dream amz31: OrangeShark: plans? amz31: OrangeShark: daviid is trying to find some who will work on postgres sql bindings OrangeShark: amz31: I plan on trying to go back to school for a PhD. That will take awhile though dsmith-work: amz31: Yeah. I've heard it as "The grass is always greener on the other side." (US English) daviid: I don't think that sentence stands for someone looking for a better job though dsmith-work: Nope daviid: OrangeShark: what will be the subject of your thesis? or at leat the main domain, do you know ? or not yet dsmith-work: It's about how other peoples stuff or situation always seems to look better than yours. weinholt: that's quite the thesis daviid: amz31: I worked with lisp and guile for my entire carer, so is not only a dream, it is dead possible :) amz31: dsmith-work: exactly daviid: and igalia is very well alive, the social model is prety cool amz31: like are you a recruiter for igalia or something? OrangeShark: that is where wingo works at, isn't it? daviid: OrangeShark: yes daviid: amz31: haha, no amz31: well, anyway my ventures are too much 'weird' for companies amz31: I have to type latex to explain what i do, I am like going back to college amz31: or something not sure what the term is in english for master/phd stuff daviid: have to go, bbl amz31: ciao daviid: before I leave, i want to add that thanks to purism, and the librem5 phone, we have a unique opportunity to develop app for mobiles sing guile, but we need bindings to postgres and gnome introspection (and make sure guile compiles on their arquitecture, actually Id like to know if it is already possible, anyone know?) dsmith-work: daviid: The guile app will run on the phone? amz31: that's apparantly the plan amz31: OrangeShark: so, what is the subject of your phd? OrangeShark: computer science amz31: :] amz31: what field in computer science? dsmith-work: I wonder if postgres will also be on the phone.. OrangeShark: I am thinking of researching compilers and programming languages amz31: dsmith-work: I read people use sqlite on mobile amz31: even foundationdb use sqlite dsmith-work: Yes, Seems more appropriate amz31: OrangeShark: :D amz31: OrangeShark: well, I have a future feature request to do then, please rewrite the garbage collector in scheme ;] OrangeShark: well the app might communicate to a server (which should be written in guile) that has to access postgres OrangeShark: amz31: hehe amz31: yes, but afaik daviid is not willing to use a server dsmith-work: The local channel bot uses sqlite amz31: this is too https://www.sqlite.org/src/timeline amz31: I talk about foundationdb, it's out of the scope of my guile project to create bindings of foundationdb amz31: I will continue to work on wiredtiger because the scale of what i build it's good enough amz31: I mean scale, I mean for the number of people using my software daviid: heya guilers! as you'll see if you browse https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29669, in a repl, a user can: ,use (ice-9 pretty-print), then ,o print (lambda (repl obj) (truncated-print obj) (newline)) daviid: I'm trying to acheive this from withi a module (for guile-cv), but I fail to undertand how is that possible, since, unless I missunderstood something, I'd have to know the repl (the value of the arg) before the repl is actually launched daviid: the code to list and define repl option values is in (system repl common) daviid: I can't use repl-option-set! because it expects 3 args, the first is the repl daviid: I was hoping to be able to use repl-default-option-set! daviid: but so far I failed to acheive my goal daviid: bb soon, if anyne has an idea, ping me ... tx spk121: I wonder if I could make and push a LAMG (Linux/Apache/MySQL/Guile) Docker container to the cloud... dadinn: hi all dadinn: trying to use `with-output-to-file` but it doesn't seem to work https://www.gnu.org/software/guile/manual/html_node/File-Ports.html dadinn: (with-output-to-file "/dev/null" dadinn: sorry for multi-line past :( dadinn: paste dadinn: ah, also sorry... it seems I found the issue :D hugo: dadinn: What was the problem? And the solution? amz31: +1 chrislck: I'm guessing either "/dev/null" is a port-sink, or forgot to sudo for apt? amz31: /dev/null is blackhole or something spk121: does anyone have an opinion on the utility of mod_lisp? hugo: /dev/null is a dummy file which takes anything written to it and discards it, and looks like an empty file when reading it hugo: See null(4) amz31: spk121: no need for that you can use sockets amz31: via proxy pass directive or something amz31: we use that with both apache2 and nginx amz31: you can switch reverse proxy using that amz31: I only spawn several guile process in screen amz31: and point apache2 to every localhost:808x spk121: amz31: cool amz31: ? daviid: anyone knows if guile-pg is still maintained? does it work with the latest guile and latest postgres? daviid: any guilers using it 'daily'? and for 'real work'? rlb: The last upload (guile-2.2 2.2.4+1-1) appears to build "everywhere" again, so I think the risk of removal from debian buster may be gone: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid amz31: #win spk121: test spk121: woohoo, I am not a bot! mwette: . amz32: hi all amz32: wingo: did you release your spam filtering algorithm somewhere? Can it be used to filter spam on irc? OrangeShark: Happy Friday amz32: friday ftw§ rain1: o/ dsmith: Happy Friday, Guilers!! cmaloney: Happy Friday! mwette: Happy Friday to you. I hope I'm logged in now. mwette: Yes! OrangeShark: mwette: welcome to the party OrangeShark: I wonder if the spam bots are still at it cmaloney: Yes cmaloney: #linuxjournal if you'd like to see them in action cmaloney: though there is a spam-killing bot in there cmaloney: but they still have to surface in order to be swatted mwette: OrangeShark: Thanks. amz31: anyone is familiar with sparql or minikanren? amz31: my question is it possible to implement recursive queries in sparql mwette: ACTION is digging into language/cps to see if there are possible hacks to make debugging better (using alternate compile path) blu3r4d0n: Hey all :0 blu3r4d0n: :) blu3r4d0n: I am having a bit of a problem blu3r4d0n: I'm trying to use the chickadee engine blu3r4d0n: I built guile-opengl from source and installed it blu3r4d0n: and guile isn't seeing that I installed it marusich: blu3r4d0n, the first question I'd ask is: is it on your GUILE_LOAD_PATH? blu3r4d0n: Probably not blu3r4d0n: I honestly don't know where the ./configure; make; make install; installed the modules. I'm assuming somewhere in /usr blu3r4d0n: I think I'll try installing with guix instead of building it myself ng0: sneek: later tell civodul: you might want to check the channel settings for #guix, I am registered and logged in to services, but I'm still locked out of the channel. that's taking spam protection a bit too far sneek: Okay. wingo: sneek: later tell ng0 i think the only change we made was /mode +r sneek: Will do. wingo: anyway we'll see with -r if spam comes back eldritch14: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ eldritch14: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ eldritch14: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate eldritch14: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ wingo: ffs weinholt: wingo, "mode +q $~a" seems to work rather well for #chez and #scheme wingo: weinholt: what does that do ? :) wingo: after all these years, my irc-fu is minimal weinholt: it means that only registered users can talk, but everyone can join weinholt: at least that's what they say it means :) wingo: ok let's give that a go :) wingo: tx for the tip weinholt: sure thing snape: wingo: I can't join #guix snape: "Cannot join channel (+i) - you must be invited" wingo: hum ng0: you probably wanted +r yesterday sneek: Welcome back ng0, you have 1 message. sneek: ng0, wingo says: i think the only change we made was /mode +r ng0: no, you'Ve definitely set a different mode. wingo: ng0: since then things changed, plz read the logs ng0: I've set +r to #gnunet yesterday, and I can still join it. ng0: ok ng0: okay, but I still get the same message (wrt "invite only") wingo: the only thing i did was +r and then later -r then +q $~a wingo: i can't speak for any other op (civodul, mark weaver i think are the others) ng0: ok ng0: just take it as a feedback for #guix. I get the same message as snape, and I'm logged in to the services wingo: ACTION nod. i am not an op in guix i don't think rekado: hmm, I can’t join #guix any more. Says “you must be invited”. mbuf: rekado, me too OrangeShark: blu3r4d0n: I believe the default would install to /usr/local You would need to add that to your GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH OrangeShark: Happy day before Friday cryptocat1094: :/ #guix now requires invites? snape: cryptocat1094: it's a configuration error it seems snape: due to a tentative to avoid spammers cryptocat1094: I figured that was why it'd been done. cryptocat1094: snape: Who should I notify about it? snape: cryptocat1094: https://lists.gnu.org/archive/html/guix-devel/2018-08/msg00006.html snape: it's done rekado: cryptocat1094: I already notified Mark about this. rekado: I notified Mark before to get ops permissions on #guix, and it seems that while he setting this up for me he accidentally borked #guix. wingo: rekado: i think you have op permissions, according to /msg ChanServ access #guix list wingo: so, do "/msg ChanServ invite #guix" perhaps wingo: to get yourself into guix wingo: then /msg ChanServ op #guix wingo: then /mode -r wingo: then /mode +q $~a cryptocat1094: rekado: Oh, thanks. daviid: hello! it appears I can't join #guix either, same as snape here daviid: *** karatkievich.freenode.net 473 daviid #guix Cannot join channel (+i) - you daviid: must be invited rain1: I think civodil will be around soon, and can fix it daviid: fwiw, my nick is registered, I'm on #scheme now too (which did set chan to +q $~a as well I think ... don't know why this happens, irc-fu is zero+ here :) rain1: rekado: you could fix it, even if you cannot join the channel. I think you can set the modes from outside daviid: what is the command to ask what the channel mode(s) is(are)? cryptocat1094: I think it's client-dependent. rain1: the mode is +Fir rain1: we need -Fi they stop people joining cryptocat1094: On weechat I can do /mode #guile rekado: I cannot seem to change anything on #guix. Can’t op. rain1: rekado: maybe i can help you do it rekado: I’d be happy if you could. rain1: msg chanserv invite #guix rain1: if you do this, I think chanserv will invite you into the room rekado: indeed! rain1: then you could /join it rekado: well, now I can snape: \\o/ cryptocat1094: I'm not authorized. :/ daviid: yes, only those that are in access list can rekado: rain1: thank you very much! cryptocat1094: Sucks to be me. rain1: glad to help! daviid: I think it would be just removing the +i, so maybe /mode -i rain1: it is just +r now: so you need to be registered to joi rain1: n cryptocat1094: \\o/ daviid: i'm on #guix as well now, tx daviid: fwiw, I think civodul is on holiday daviid: blu3r4d0n: did you solve your problem (guile-opengl)? rekado: wingo: thank you, too, for the instructions. I did not see them before. rekado: neat trick to invite yourself to a channel that you cannot join directly. daviid: my fear is that these bots could register (?) rain1: it's possible... rain1: hopefully that wont happen any time soon daviid: hopefully cryptocat1094: I'm honestly surprised it didn't happen two decades ago. ng0: spam? daviid: we need a good machine learning lib accessible from guile, FANN is a possibility, most others are written in langs we can't bind ... (at least nt easily) daviid: ACTION thinking loudly rekado: is tensorflow not usable from Guile? daviid: rekado: it's in C++ right? rekado: (I’m still trying to build it for Guix without Bazel, which depends on dozens of Java libraries.) daviid: rekado: also, 'end-users' use keras, not tensorflow daviid: not directly I mean daviid: caffee is in C++ as well daviid: right now the only one we could 'immediately' bind is FANN rekado: it’s mostly C++ but it has Python bindings. I don’t know if they use the C++ stuff directly or if they bind to something else. daviid: rekado: good bindings to C++ lib is dam hard daviid: otherwise I'd use OpenCV for Guile-CV (and Vigra, but not 'only' Vigra) daviid: rekado: one need to wrap in C first, and that means you know pretty well C++ (I don't, anything below clos isn't worth it imo :)) and it's only easy if the C++ code is super star clean ... daviid: rekado: and for one guilers, they have a couple of thousands pythonists ... to serve clean and feed the snake :):) daviid: *one guiler daviid: anyway, I'm thinking about this ... I'll see what I can do cryptocat1094: Guile went the way of using Guix as its package-manager correct? daviid: cryptocat1094: no, we all (almost all) use the autotool chain for our projects, then distro make their packages ... obviously guix makes theirs using guile ... _but_ we have potluck, which needs love ... (if I had several life :):) I'd work on it daviid: cryptocat1094: what are you working on? cryptocat1094: Autotool for Guile? daviid: cryptocat1094: autotool is not for any language, but guile is autotool chained yes daviid: so to speak cryptocat1094: I essentially haven't used autotool so I don't quite know how it'd work. Is there any blog post or anything about the current state of Guile? daviid: cryptocat1094: the current state of guile is its reference manual and its NEWS files rekado: cryptocat1094: autotools is … special. rekado: cryptocat1094: it’s pretty verbose and is notoriously difficult to learn for newcomers. cryptocat1094: That's unfortunate. rekado: cryptocat1094: many people (myself included) copy the autotools files of existing similar projects to get started. rekado: cryptocat1094: the idea is simple, though: you have a configure.ac file, which is a template for a generated “configure” shell script. rekado: that script is run by the user (or the package manager) to make sure the build environment is sane. rekado: when automake is used, a Makefile is generated from a simple template “Makefile.am”. rekado: the syntax is a bit odd as it relies on certain naming conventions to be followed. rekado: the result is a portable configure script that generates a portable Makefile, which supports all common targets. rekado: a user / packager would only have to do the usual “./configure && make && make install” to configure, build, and install the package. rekado: autotools is NOT a package manager; it just provides a flexible interface to package managers that follows age-old conventions. rekado: there should be an easier way for Guile developers to autotoolify their project, but I don’t know of any such efforts. daviid: but that would make it difficult for other distro to pick and package your project cryptocat1094: And there's some sort of dependency resolution? rekado: cryptocat1094: no, nothing. OrangeShark: cryptocat1094: I wrote this https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html rekado: cryptocat1094: the configure script only performs checks and aborts if a check fails. cryptocat1094: I see... so how do you get your libraries? weinholt: cryptocat1094, https://akkuscm.org/ here's a package manager that works with guile to some extent daviid: rekado: the effort started, it is potluck, but for some reason, none of the gulers/guiers took the flag after andy ... it's the package manager we all want for guile based projects though ... cryptocat1094: weinholt: Huh, neat. OrangeShark: cryptocat1094: also helpful list of guile libraries and related guile software http://sph.mn/c/view/g2 daviid: that is one of our problem as well, is that 4 guilers worked on 4 diffs package manager for guile, instead of all working on 1 ... no flamewar, neither critique, just saying we should sometmes coordinate our efforts daviid: guldhall, potluck, akku and there is another one that I forgot daviid: my choice is for potluck daviid: my vote goes to potluck (I meant) rekado: daviid: can it be used already? cryptocat1094: So build system is GNU standard. Dependency is "you're on your own" and we have four wip package/dependency managers. daviid: rekado: there is thread describing its status, let me check daviid: cryptocat1094: what are you working on, or trying to acheive? I don'tunderstand what you are trying to do ... it would help (me at least) to understand what you are trying to do cryptocat1094: daviid: I'm trying to get started making more than toy scripts. cryptocat1094: daviid: I typically work with more mainstream languages that have a fairly different ecosystem. jlicht: cryptocat1094: I shamelessly copied a autotools-based setup from a different project (similar to what OrangeShark describes), and use GNU Guix as a package manager on top of this. The nice thing is that I can replace either the build system or the package manager parts separately, at some point in the future daviid: rekado: here https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00649.html cryptocat1094: jlicht: The modularity is good indeed. daviid: cryptocat1094: ok, but any particular lib/objective in mind? cryptocat1094: daviid: Currently not any in particular, but I do want to get involved with Guix at some point. cryptocat1094: Does autotool for Guile have the ability to detect you're missing dependencies? daviid: cryptocat1094: anyway, to hack in guile you don't need any packager, nor to autotool chain :), just fire emacs (install geiser) and M-x run-guile ... cryptocat1094: I'd messed a bit while stdlib-only scripts for some things. I then put that on the backburner when I found that Debian failed to package guile-gnutls. cryptocat1094: I think that was fixed since? cryptocat1094: nvm, stable seems to still have the issue. rekado: cryptocat1094: the configure script that is generated from configure.ac aborts when a dependency is not satisfied. But it is up to you to specify the checks in configure.ac first. daviid: cryptocat1094: guile is in most distro, what's yours? cryptocat1094: daviid: Mostly Debian. Use of Guix though makes the whole gnutls issue no longer a significant block. cryptocat1094: Which is why I'm thinking of getting back into it cryptocat1094: rekado: Ah I see. Is there a commonly approved/used way of checking for them? rekado: cryptocat1094: in many cases you can use pkg-config macros to check for libraries. rekado: cryptocat1094: for Guile modules there are also macros to check. daviid: cryptocat1094: ok, because you don't want to loose your time checking for guile dependencies, that's all done by distros ... don't you have a working guile? cryptocat1094: daviid: I do have a working guile. daviid: so why are you asking about guile dependencies then? I don't get it rekado: cryptocat1094: here’s an example for such a macro: GUILE_MODULE_REQUIRED([sdl2]) rekado: cryptocat1094: this will check at configuration time whether the “sdl2” Guile module is available; if not it will abort. rekado: cryptocat1094: if you want to let your project use a conventional build system I recommend picking an existing project that uses autotools, such as Chickadee. cryptocat1094: rekado: Thanks. cryptocat1094: daviid: I meant dependencies such as, for example, Chickadee if I were making a game in Guile. daviid: cryptocat1094: I second rekado, pick an already autotool chained project, also, there is a template written bu OrangeShark, good to read for beginners daviid: cryptocat1094: are you going to use C or only guile? daviid: OrangeShark: where is you template again? daviid: *your rekado: this? https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html daviid: rekado: yes, thanks! cryptocat1094 ^^^that's a good start, then even though, pick an existing project daviid: I'd pick up some that conforms to the gnu coding standard for instllation locations, guile-lib, or guile-cv (if you need/use C) OrangeShark: daviid: cryptocat1094: the code for the template is https://gitlab.com/OrangeShark/guile-skeleton daviid: OrangeShark: tx OrangeShark: the blog post, I try my best to explain the various things in the template OrangeShark: cryptocat1094: for dependency on a guile library, you can use what rekado suggest, a macro called GUILE_MODULE_REQUIRED. There is some others described in https://www.gnu.org/software/guile/manual/html_node/Autoconf-Macros.html#Autoconf-Macros daviid: OrangeShark: I would only do that if the lib is tiny and very stable (couple of scheme files almost immutable ...) otherwise, I definitely would check the version, and that means using autotool chain macro instead ... daviid: anyway, I ed to focus on something else, cryptocat1094 good luck, and ask here, we'are always happy to (try to) help ... OrangeShark: daviid: oh true, versions can have interface changes. What macro would be able to check the version? daviid: OrangeShark: I'd use pkg-config, not guile OrangeShark: daviid: does that mean we should be creating .pc files as well? daviid: or call pkg-config from guile I mean ... daviid: OrangeShark: imo, good projects already provide a .pc file daviid: imo they 'have to', which is why I added it for guile-lib when I started to co-maintain, even though it is pure scheme ... daviid: and now we can depend on a specific version of guile-lib, not just check that guile-lib is there ... daviid: imo, it is essential in the long run ... daviid: have to concentrate on other things now ... bbl amz31: Hi all amz31: I would love something like that in guile https://github.com/kitao/pyxel/blob/master/README.md amz31: it's pixel game engine or somehting like that daviid: amz31, hi, what do you thing about gdbm? just curious, we have an unmaintained binding somewhere amz31: daviid: gdbm doesn't support ACID transactions otherwise, if the architecture support is enough and that a _persistent to disk hash table_ is enough then it's ok daviid: ok, tx amz31: if you compare to wiredtiger, wiredtiger support only x86 and maybe arm. It support ACID transactions. And it can do range/slice queries like give me everything that has ABC as prefix daviid: I wish one of us pick guile-squee and turns t a top notch postgres'modern' binding and ultra well maintained lib ... amz31: I had that in my todo list, but I changed my mind daviid: too bad :(, you'd be the one guiler to do this very well ... :) amz31: IIRC there is a guile project that use bsddb, maybe it can help amz31: daviid: tx :) amz31: I mean I know there is guile project that use bsddb, but I don't remeber the name of the guile project. It's the project that implements a distributed game engine for MUD/RPG games OrangeShark: daviid: ah true, when I think about other languages, version checking is typically part of the package manager. In C and C++ world, they use pkg-config so you don't have to depend on one. hmmm cryptocat1094: OrangeShark: Thanks for the skeleton OrangeShark: cryptocat1094: no problem, there is more you can add to it like documentation and testing. I need to get around to adding it cryptocat1094: http://git.savannah.nongnu.org/gitweb/?p=guile-lib.git;a=blob;f=meta/guile-lib-1.0.pc.in;h=918593289ee81ad0f2c2b4b8f2516b79308854d8;hb=HEAD cryptocat1094: So should one rely on GUILE_MODULE_REQUIRED or pkg-config? cryptocat1094: Oh. PKG_CHECK_MODULES is a thing. OrangeShark: cryptocat1094: I think more projects need to provide .pc files to be able to work with pkg-config. I don't think many of them currently provide this cryptocat1094: OrangeShark: I see. Still, it's good to know. (I have a feeling I'll have to learn autotools sooner than later anyway) OrangeShark: cryptocat1094: my blog post should provide enough information, plus links to learn more, about the template I provided cryptocat1094: OrangeShark: So that erikedrosa.com is yours? cryptocat1094: -_- nvm, it's written right at the top. amz31: daviid: what's up regarding gnome introspection? amz31: cryptocat1094: what are you working on? daviid: amz31: I haven't found the time, but I hope I will this year OrangeShark: amz31: pyxel seems pretty neat cryptocat1094: amz31: Getting up to speed with Guix so I can start using it more and, hopefully, contributing to its ecosystem. Also probably rewriting some of my personal utils in Guile at some point. amz31: cryptocat1094: I have been doing guile and scheme in my free time for 4 or 5 years or so cryptocat1094: amz31: I'm a fair bit newer to any serious attempts to use it. amz31: it will come amz31: well, I think you already use it? you said you rewrote personal tools in guile amz31: also you use guix amz31: iirc cryptocat1094: Some, I stopped when I rammed into difficulties due to Debian and its packaging. My recent "discovery" of Guix has removed that restriction. cryptocat1094: Basically anything that required network capacities was held back by Debian failing to package guile-gnutls cryptocat1094: (Which was instead written in Python and similar) amz31: hmm amz31: I came to guile first, before knowing about guix because of the parenthesis amz31: guix is nice, but right now it doesn't work for me cryptocat1094: I first started playing with Guile because I wanted to play around and learn basics of "Functional Programming". amz31: I want to have a file copied from the build directory to the build closure using the right paths amz31: cryptocat1094: me too amz31: cryptocat1094: it was made obvious by functional javascript amz31: at least I came from this backgroud amz31: then I discovered guix and immutability cryptocat1094: I never liked JavaScript much. I always saw it used mainly as a suspicious way to run untrusted (and untrustworthy) code on my machine. amz31: I think it's a powerful concept that when applied solve problem that otherwise would require many ad-hoc algorithms cryptocat1094: (My own code is, naturally, not malicious so that's fine.) amz31: that's also about sharing the cost of producing the content amz31: seems to me the economy wants to share the cost of running the Internet cryptocat1094: Oh yes. But there's a nuance between what NoScript tells me eff.org wants me to run and what say... amazon.com wants to run. amz31: that's without the code you don't know what runs amz31: even with the code of browser is so complicated that you don't know if there is tricks even in code you can read weinholt: cryptocat1094, there is no open request to package guile-gnutls in debian, did you send one? cryptocat1094: weinholt: I did not. Though my use of stable would have hindered results anyway unless they were also backported. weinholt: quite true cryptocat1094: I also looked at Nix and iirc they ran into some problems. I'm unable to find back the mailing list thread as it seems to have been moved to Google Groups? cryptocat1094: Ah the old site is still up, though for some weird reason the github repository links to google. cryptocat1094: Still, I'll have some free time soonish where I can possibly mess around with Guix. amz31: daviid: contact sempria.de amz31: ! daviid: amz31: thanks, will do! amz31: I am out! OrangeShark: would be nice to see more scheme jobs daviid: OrangeShark: yes, it really would be nice, and I think we'll get there, maybe not tomorrow, but we'll get there OrangeShark: It is kind of interesting that in my area of work, the competition use languages like common lisp and prolog daviid: OrangeShark: I recommend savannah for guile-git, a better choice for such an essential binding, imo daviid: OrangeShark: what is your area of work? OrangeShark: daviid: yeah, the whole mailing list workflow is interesting to me, but for some reason it does pose a challenge for some. OrangeShark: daviid: airfare search and pricing daviid: interesting (airfare search...) OrangeShark: so competitors include like Google and HP daviid: so google and hp uses common lisp then OrangeShark: google uses common lisp OrangeShark: HP uses I believe prolog daviid: OrangeShark: for guile-git, I think to be on savannah is a lot more important (and it could become a gnu package) then the work flow ... and it's not like it was guix, your are two to take care of it right now ... and, if you use a email workflow, we can follow it (I'll never evercreate a github account, and will never ever use a web based workflow (and it has nothing to do with my age :):)) daviid: if i didn't think google shold just disapear from the planet, i'd apply :) daviid: but it is such a bad company, no way, i'd rather die daviid: OrangeShark: are you working reote as well? (just curious) daviid: *remote OrangeShark: daviid: no, but we do have some remote devs OrangeShark: daviid: I will be sure to evaluate savannah as an option, I have nothing against email based workflow, I think it does have some nice pros for a workflow daviid: imo, free s/w should (first) be o savannah, for these, savannah is the place to be, imo noteabug is cool for personal projects, such as our own file configs ... but guile-git, essential to guix itself, really it should be on savannah, but then it's only my opinion ... daviid: your company uses CL or prolog? OrangeShark: daviid: neither unfortunately :( daviid: ah, I missundertood, too bad :( OrangeShark: but I can see why someone would pick common lisp or prolog to solve this problem, sort of a natural fit daviid: OrangeShark: I hope yu can convince your boss then :) OrangeShark: daviid: it will actually be my last day friday :P daviid: oh! let's get together to guile scheme this world then :) OrangeShark: daviid: definitely :) daviid: to many snakes, that can't be good right? haha cmaloney: daviid: United Shore Financial Service was the company that was using Scheme cmaloney: he says they might be moving to C# OrangeShark: cmaloney: lame :( daviid: cmaloney: thanks! oh too bad, but maybe if they hire me that can chang (just joking of course) cmaloney: I just report 'em. :) cmaloney: Heh bananas19: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ bananas19: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ bananas19: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate bananas19: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ robotroll: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ robotroll: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ robotroll: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate robotroll: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ thurin16: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ thurin16: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ thurin16: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate SWAT10: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ SWAT10: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ SWAT10: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate SWAT10: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ Steinsplitter24: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Steinsplitter24: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Steinsplitter24: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate Steinsplitter24: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ spk121: Hmm. Chat spam. daviid: yep, non human, not being ... another planetarian disaster ... Sabotender12: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Sabotender12: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Sabotender12: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate Sabotender12: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ Lumpi10: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Lumpi10: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Lumpi10: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate rikai: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ rikai: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ rikai: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate rikai: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ daviid: spk121: do you have channel priviledge? to set it to r+ or +r I don't remember ... daviid: *channel admin priviledges Turandot16: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Turandot16: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Turandot16: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate Turandot16: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ fkz: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ fkz: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ fkz: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate fkz: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ okdas14: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ okdas14: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ okdas14: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate okdas14: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ planigan13: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ planigan13: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ planigan13: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate planigan13: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ aphex`: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ aphex`: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ aphex`: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate aphex`: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ idn: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ idn: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ idn: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate idn: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ RoyK29: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ RoyK29: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ RoyK29: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate RoyK29: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ Whooa21: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Whooa21: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Whooa21: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate Whooa21: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ kek9181: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ kek9181: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ kek9181: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate kek9181: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ pOe[: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ pOe[: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ pOe[: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate pOe[: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ PrettyKittie19: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ PrettyKittie19: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ PrettyKittie19: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate PrettyKittie19: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ SKYWARN: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ SKYWARN: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ SKYWARN: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate SKYWARN: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ Sebastien6: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Sebastien6: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Sebastien6: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate Sebastien6: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ atomicthumbs19: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ atomicthumbs19: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ atomicthumbs19: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate atomicthumbs19: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ kl42001: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ kl42001: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Vlad18: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Vlad18: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Vlad18: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate Vlad18: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ Kronuz6: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Kronuz6: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Kronuz6: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate Kronuz6: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ sam11: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ sam11: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ sam11: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate sam11: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ ski_: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ ski_: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ ski_: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate ski_: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ mbuf: Need to use +r mode in this channel. Any ops around? Nevolution215: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ Nevolution215: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ Nevolution215: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate Nevolution215: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ wingo: i can op wingo: if i remember how :P was: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ was: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ wingo: mbuf: what would setting the channel to +r do? megane: only registered users can join mbuf: wingo, allow only registered users to freenode wingo: ok let's give it a try for a few hours then mbuf: wingo, might want to send an e-mail to the list asking people to register on freenode? mbuf: wingo, /msg NickServ REGISTER password e-mail mbuf: wingo, https://freenode.net/kb/answer/registration wingo: mbuf: good idea :) want to send that mail? :) mbuf: wingo, please do evil: With our IRC ad service you can reach a global audience of entrepreneurs and fentanyl addicts with extraordinary engagement rates! https://williampitcock.com/ evil: I thought you guys might be interested in this blog by freenode staff member Bryan 'kloeri' Ostergaard https://bryanostergaard.com/ evil: Read what IRC investigative journalists have uncovered on the freenode pedophilia scandal https://encyclopediadramatica.rs/Freenodegate evil: A fascinating blog by freenode staff member Matthew 'mst' Trout https://MattSTrout.com/ amz31: wingo: mbuf I send the mail amz31: ok? wingo: great, tx! mbuf: amz31, okay amz31: done via my gmail account because I lost access to the @hypermove.net account amz31: wingo: did you submit something for scheme 2018? wingo: no, i knew i wouldn't have time to travel this year amz31: do you use parinfer? wingo: i use paredit amz31: I have an C API that as a concept of future struct, you can attach the continuation to it when it resolves to something amz31: aka. a callback amz31: the callback is called at somepoint in a thread called the network thread amz31: how can I schedule a fiber from the other thread? amz31: with channel? wingo: use spawn-fiber with #:sched, passing the thread's scheduler as arg; wingo: or send a thunk over a channel wingo: either one megane: < wasamasa> marja: "+q $~a" will mute unidentified users dsmith: hey OrangeShark: hello everyone amz32: hello dsmith-work: Hey Hi Howdy, Guilers OrangeShark: hello dsmith-work dsmith-work: OrangeShark: Greets dsmith-work: Forgot that wingo added channels to guile. daviid: hello guilers! daviid: happy (no spam :)) wednesday! cmaloney: heh cmaloney: That's the hope ng0: hope dies first ng0: spam everywhere else already for hours.. ng0: did you read about where it comes from? insecure home routers apparently. daviid: re these bots? ng0: yes daviid: *are ng0: https://github.com/kaniini/antissh daviid: network is relly not my strengh ng0: "In 2018, there was a resurgence of IRC spam attacks that were undetected by traditional proxy scanning methods. This is because the attackers were using vulnerable SSH daemons running on routers, IPMI devices and other embedded devices to proxy the connections, using the direct-tcpip subsystem." daviid: pip3 install ... scnakes again! :) let's write all this in guile folks! daviid: :) ng0: freenode says: https://freenode.net/news/spambot-attack ng0: but no technical information. sorry OrangeShark: the computing field really needs to get better at security... rain1: https://github.com/rain-1/racket-peg/issues/32#issuecomment-409026299 I made a git issues discussing the change in syntaxfrom my peg lib vs guile peg rain1: I'm trying to make the syntaxes close as possible amz31: this software try to replicate guix https://github.com/mitsuhiko/pipsi amz31: follow up https://jacobian.org/writing/python-environment-2018/ amz32: hello #guile OrangeShark: hello amz32 amz32: OrangeShark: what's the plan for guile-git? savannah or notabug? OrangeShark: amz32: still need to think about it. I want to try both out and see how the interface is dsmith-work: Hey Hi Howdy, Guilers OrangeShark: hello dsmith-work, how are you? dsmith-work: OrangeShark: Pythoned out OrangeShark: dsmith-work: need more guile :) dsmith-work: Yes indeed. Haven't been able to play there in quite a while. amz32: I got php'ed OrangeShark: amz32: I thought you worked in python OrangeShark: you work in both? amz32: well; I was working in python until I landed in a project that needs to port an existing code base to python; I choosed my faith actually; but still it's a difficult time amz32: so I do php until a date that remains to be defined amz31: a collegue of mine compared scheme vs python discussion to tab vs space troll manumanumanu: Ahoy hoy! OrangeShark: ahoy manumanumanu: What are you all up to this tuesday? manumanumanu: I myself am reading up on reagents. They seem like a really friggin cool concept. manumanumanu: wingo: a paper I read earlier today claims that reagents generalize concurrent ML, but I don't really understand how. Do you have any ideas how? amz31: ahoy! amz31: no :/ amz31: but good to see you around daviid: amz31: not sure i understand what your collegue means? daviid: ACTION wishes all python jobs would be guile jobs, and honestly does not understand why it's not that so ... why on erth people did pick up python instead of scheme? that is the question haha amz31: daviid: I don't know amz31: neither do i amz31: they may not not CLOS amz31: I don't know clos myself, I learn little by little amz31: they are not against your ideas amz31: they may not KNOW CLOS daviid: i guess industry back then was afraid of scheme, students too, and then the snow ball effect ... now getting rid of python (and actually no pythoners thinks it is a good idea anyway) would be as difficult as geting rid of php amz31: some people thing scheme is worthwhile amz31: some people think scheme is worthwhile in the Python community, like the original coder of awesome tiling window manager amz31: I will be giving a talk about the async web framework aiohttp in october in priciple amz31: it's at Lille, the 4th October in France amz31: it amz31: it's free amz31: like fosdem daviid: amz31: yes there are exception, but pythoners in general don't even know scheme exists (so to speak) ... anyway, useless discussion :), back to hack ... amz31: go back to coffee ;/ daviid: of course we (guilers) need to better maintain our bindings, and work to have more ... otherwise no way ... ng0: and then there's the "parens" meme you will meet, where people don't think we have people working on making that easier to work with.. dsmith-work: daviid: For me, I've been surrounded by people who know Python, and none who know Scheme. ng0: I think my C prof is seriously convinced C will become obsolete in his lifetime.. everyone can dream. daviid: dsmith-work: same here daviid: ng0: though I don't like it (sorry) you can tell those we have wisp daviid: the key is to get better and more bindings ng0: parinfer is nice daviid: imo ng0: https://www.youtube.com/watch?v=K0Tsa3smr1w <- I suggest this to people new to "general lisp".. so far it's okay. ng0: wisp is mentioned there as well amz31: there wisp, it's even an srfi iirc amz31: I use neither of those daviid: good! we can rewrite wisp code in scheme 'proper' anyway, so fine (I can't read wisp code (more then a few lines I mean)) amz31: ng0: +1 ng0: parinfer is one of the hundreds of packages I still need to sent to guix at some point. I use it for a couple of months now, and it's really nice. I did not need it before, but it automates a decent amount of repetive work. daviid: though imo, people should use kawa (I'm dead serious here), order of mag better then clojure daviid: another 'impossible to understand' thing ... marketing si, therefore, almost always wrong, why do humans don't understand this? haha daviid: *is daviid: anyone aware of scheme jobs by the way? (and side quiz, i never saw a racket job for example, is there any racket jobs out there?) cmaloney: I know one of my friends worked at a place that used scheme cmaloney: I can ask where he worked if there's interest ng0: I think those who get them stick with them.. daviid: cmaloney: yes please do, thanks cmaloney: np ng0: it's more likely to find Elixir jobs than Scheme jobs I think. ng0: although.. when you count Clojure, then there's a number of jobs daviid: ACTION is hard looking for some contract(s), his position came to an end at university ... ) daviid: ng0: yes, but from experience, (1) wh not kawa, and (2) t means you know (dead well) java: to me, java is a diaster daviid: noone should ever use java :) daviid: but if yu have to, the use kawa ng0: tell that companies working with java.. I'd see scheme as an option but would not limit myself to it in job search daviid: I would if they use kawa (let me use kawa I mean), not clojure ng0: I share your view, I'm grumpy about Java in university as well.. brb, router update daviid: ng0: can you use kawa? (would they let you use kawa instead I mean) ng0: no they wouldn't ng0: at least where I am now. I'm taking the next semester to think about transfering, but it's the same everywhere with a heavy focus on java 8, fx, and so on daviid: that's weird (to me): kawa compiles to java, exactly as java itself, so one can use a kawa 'class' (from another java code) exactly as if it was written in java i the first place ... all this sounds like unreasonable restriction(s) imo ng0: yeah well university of applied science is not exactly freedom.. amz31: https://hastebin.com/alikafegov.bash ng0: maybe back then with diploma it was different amz31: sorry wrong chennal ng0: but you still need to write in the language, let go off all your previous knowledge, bla.. it's really terrible. ng0: in retrospective I should've picked FH Dortmund in the first place and not HS Bochum.. ng0: no idea where you are located or wanting to relocate to, but msg systems ag in Germany has some jobs listing at least lisp and prolog. daviid: ng0: so far, I've almst always worked remote, as a consultant (research or appied research consultant), and part time ( I don't beleive you can research 'effectively' 8h a day,that is a teriible lye imo ...) daviid: but I could relocate ... but i'd rather work remote if possible daviid: ng0: could you send me a link? david at altosw dot be (thanks a lot) ng0: I see.. ok ng0: I could, but somehow the job searchpage now thinks I'm a bot, after restarting the browser ng0: okay, I'll send an email.. I'm off soon daviid: ng0: thanks, good night! lloda: xml->sxml produces "\\n" garbage when reading files with DOS newlines, is this intended? why isn't this whitespace skipped? wingo: whitespace is significant in xml, you have to pass #:trim-whitespace? #t to filter it out lloda: wingo: thanks, I'm a total xml noob OrangeShark: happy monday rain1: hey mwette: howdy rain1: i want to port my parser library to guile... rain1: my problem is different macro systems rain1: I use define-for-syntax and syntax-case and with-syntax mwette: guile has syntax-case and with-syntax; where isi define-for-syntax from? rain1: it lets me define a function which the macro can use during expansion OrangeShark: rain1: is that from racket? rain1: yeah OrangeShark: that sounds neat rain1: yeah it's useful, one of the most involved macros i've written rain1: so it's kinda hard to port OrangeShark: rain1: a link to your parser library? mwette: you can do that: (eval-when (expand load eval) (define (gen-id xxx) ...)) rain1: https://github.com/rain-1/racket-peg/ the guile branch is really old, because i tried a while back and got stuck weinholt: rain1, you can probably place those definitions in another library and import it with (import (for (helper-library) expand run)) stis: hej guilers! rain1: yo dsmith-work: Morning Greetings, Guilers stis: Greetings dsmith-work: amz31: heya amz31: seems like erlang arbiters are coming to python https://speakerdeck.com/1st1/asyncio-today-and-tomorrow amz31: dave is gone ? :/ dustyweb: amz31: davexunit you mean? amz31: yes amz31: I am reading cuirass code at git clone git://git.savannah.gnu.org/guix/guix-cuirass.git amz31: o/ atw: amz31: I had wondered if you had heard of datomic sneek: Welcome back atw, you have 1 message. sneek: atw, g_bor_ says: I would like you to have a look at my clojure patch. mbakke said that you are familiar with clojure stuff. It would be nice if you could confirm that this does not interfere with typical clojure usecases. It is here. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32295 rlb: 2.2.4+1-1 uploaded to debian unstable -- let's hope the buildds like it better than 2.2.3... rlb: (the ppc64el and arm64 buildds in particular) rlb: Those interested can wait with bated breath: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid spk121: . sneek: spk121, you have 1 message. sneek: spk121, jralls says: Thanks, but it's a clean build in a freshly-created build directory from a freshly-cloned guile branch tracking wip-mingw-guile-2.2. thomassgn: Um, I get 'ERROR: Wrong type to apply: 0' from geiser(guile) from the following: '(define pc (system "upower -i /org/freedesktop/UPower/devices/line_power_ADP1"))' But if I remove define and just run the system procedure it's all fine. what am I missing here? thomassgn: oh, to clarify, I get the error from running (pc), not from the define... ft: you're evaluating (system ...) and define pc to be the result of that. ft: An integer. Then you try to apply that integer to an empty list. And since the integer is not a function, that fails. thomassgn: oh, is this a matter of (define (pc) ...) versus (define pc ...)? ft: No it's a matter of (pc) which is the same as (0) ft: I guess you want: (define pc (lambda () (system ...))) thomassgn: but, huh. maybe. Is that necessary for making dynamic procedures? ft: What is it, that you're trying to do? Maybe this will lead us to a resolution quicker. :) thomassgn: hehe, I figured it out. ft: It looks like you're trying to define something that you can later call, that asks the OS to run that command from you. ft: So, what was it? thomassgn: so you're tip about using lambda reminded me of something from some guile book I've read a while ago. Basicly, (define (name) ...) is a shorthand for (define name (lambda () ...)) or what it is. Not sure why I started using (define name ...) instead of (define (name) ...). thomassgn: tried to find the reference I'm making... I thought it was from the guile info pages introduction or something. thomassgn: Thanks ft! thomassgn: that's such a relief, last time I was hacking on this project a different strange error was just ruining everything, turns out I was making it happen on my own by not checking the nagging in the back of my head about how defines (shortcut) syntax works... :P thomassgn: from an input pipe from '(open-inpu-pipe "upower -i ...")' I do readline on the pipe and get <#eof>. But I know the command sends something to stdout... Here is the code so far: https://paste.pound-python.org/show/nWapvEdiPrRF154QiYU3/ thomassgn: My goal is to first check if the computer is connected to electricity by matching on 'online: [yes|no]' (output from the upower command) and then check the percentage of the battary if computer is not connected - also by matching against output from upower. Then I'm going to react by throwing a notification if power percentage of battery is low-ish. dddddd: thomassgn, space after -i? thomassgn: dddddd: hahaha, wow. Thanks - today is the day of silly mistakes. :-P dddddd: my pleasure! megane: guile -c '(let ((f 1)) f (define (f) 2) 1)' megane: unknown file:1:15: definition in expression context, where definitions are not allowed, in form (define (f) 2) megane: bug? megane: 2.2.3 here daviid: megane: the inner define is not allowed, see the manual for inner define position daviid: megane: ... not allowed in that context, there are strict rules about where you can use define within define(s) megane: define is not allowed inside let? daviid: megane, see the manual about where in a defintion you are allowed to use define megane: shii... toplevel means at the top of the begin expression? daviid: megane 6.12.3 Internal definitions daviid: "... Internal definitions are only allowed at the beginning of the body of an enclosing expression. They may not be mixed with other expressions..." megane: daviid: thanks daviid: megane: you're welcome mwette: guile -c '(let ((f 1)) (define (f) 2) 1)' will work mwette: the defines must appear before non-defines in the body daviid: mwette: indeed, but i prefer to point users to the relevant part of the manual ... imo, it brings a lot more to them, and generally they will read other part of the manual, clicking links ... hence my suggestion to megane ... mwette: daviid: good point -- I concur weinholt: rlb, most builds seem fine but sparc64 still fails on "after-gc-hook gets called", so the bug is probably still lurking weinholt: rlb, i had a look at the hurd-i386 failure. the (pause) call in test-guild-compile somehow doesn't let through SIGINT. after removing that line, the tests pass. i didn't verify it, but the kfreebsd builds have the same problem according to the logs. rlb: weinholt: thanks -- for now, I've mostly just been focusing on the release architectures, but I'm happy to fix the others too if we can. Regarding after-gc-hook, that one's "easy", if we just do what I did for mips(el) and ignore it. I'll try to remember to do that for sparc64 in the next release. rlb: (as far as release architectures go, just waiting on mips(el) -- guessing probably take ~6hr once it starts) weinholt: ah, nice. rlb: ok, I've added sparc64 to the "mark unresolved on failure" list for that test. rlb: (should be in the next upload) atw: ArneBab: I've enjoyed our discussions on teaching! I am scheduled to do a first lecture at work on Monday. I'll let you know how it goes ☺ amz31: what's up #guile? OrangeShark: hey amz31, not much. What about you? amz31: well, I've been busy doing nothing :) amz31: but I investigated 2 things OrangeShark: 2 things? amz31: first, I figured that versioned data bases like datomic can be very useful in production amz31: to debug things in production, basically answering 'what happened' amz31: and sometime to implement domain logic OrangeShark: being able to somehow replay what happen helps :) amz31: like to record when a "workflow" happened amz31: how it changes values etc... amz31: yes amz31: the second thing, is something i've been thinking a lot, but I could not translate it into words amz31: it's a smart task queue that is driven by priority and how much time it takes to process task for each priority amz31: here is the relevant thread https://github.com/celery/celery/issues/4901 amz31: with specification by one of the maintainer of the de-facto standard in Python amz31: at $WORK we use multiple task queue each of which must be scaled separatly amz31: the advantage of that approach is that if one task queue is overhelmed only that one is impacted amz31: not much guile tho OrangeShark: I will be quitting my job soon, so I plan on spending more time on guile amz31: why quit? OrangeShark: just tired and feel overwhelmed by it OrangeShark: I am also thinking about going back to school amz31: oh amz31: are you in the US? I don't remember OrangeShark: yes I am amz31: isn't it difficult to go back to uni in the US? OrangeShark: well I guess it depends on where I go and how hard it is to get accepted OrangeShark: I want to go to grad school amz31: to do a master or phd? OrangeShark: yes amz31: hm which field? OrangeShark: computer science amz31: you don't have a cs degree? OrangeShark: I do daviid: hello guiler! daviid: guilers daviid: OrangeShark: a phd can be(come) quite overwherling too :) OrangeShark: daviid: I understand :) chrislck: https://screenshots.firefox.com/XvfOQWqz5CKiEBiL/null chrislck: oops dsmith-work: Happy Friday, Guilers!! OrangeShark: Happy Friday! daviid: happy friday! manumanumanu: Happy friday jlicht: I am struggling with what I think might be a deadlock jlicht: If I strace the execution of pasting http://paste.debian.net/1035179/ in a `guile -q' repl, it seems that all spawned threads or either stuck in a read call, write call, or waiting on a futex call to complete, with nothing happening whatsoever snape: is there a way to get to expand '…' in Guile backtraces? snape: (I'm in the train, please reply even if I'm offline) OrangeShark: Happy day before Friday! jlicht: Happy day before Friday to you too! dsmith: sneek: botsnack sneek: :) dsmith-work: Thursday Greetings, Guilers daviid: hap thurs dsmith-work, all guilers... androclus: hey, all. this might be a faq.. but.. is anyone using guile to program anything GUI (or even text/ncurses)? if so, what do you use to do so? dsmith-work: androclus: I've not used, but there is https://www.gnu.org/software/guile-ncurses/ and https://www.gnu.org/software/guile-gnome/ daviid: and guile-clutter as well daviid: androclus: fwiw, i wrote and maintain gnu foliot [http://www.gnu.org/software/foliot/] daviid: androclus: I also wrote a series of examples using guile-clutter, here: http://www.nongnu.org/grip/learn.html [see Grip Clutter Examples on that page] jlicht: hey guile hackers! Among the Emacs+Geiser using folks, how do you configure geiser to find the modules you are currently working on? Guix' manual suggests setting apending to geiser-guile-load-path, but if possible, I would like to not modify this global setting OrangeShark: jlicht: you can use the command `geiser-add-to-load-path` when you first open the project and add the load path jlicht: OrangeShark: Is it somehow possible to automate this? OrangeShark: jlicht: not sure, there should be a way, I haven't gotten around to figuring out how jlicht: Thanks anyways :-) dsmith-work: Wednesday Greetings, Guilers jlicht: OrangeShark: I got some hack working with dir-locals, thanks for your tip! mwette: . stis: hey guilers! amz3: hej amz3: ijp-znc: woot! dsmith-work: hej! janneke: for mes, i am using a copy of system/base/pmatch.scm but it appears i have a license problem: mes is gplv3+ and pmatch is MIT, re-licensed as LGPLv3+ with Guile-changes under LGPLv3+ markx: hi! Is there a telnet lib for guile? amz3: why would you use a library for telnet? amz3: ok gone jlicht: amz3: assuming you want to use the actual telnet protocol and not just a simple raw pipe to a tcp socket, it makes sense to use a library for telnet ;) dsmith-work: Hmm. telnet. ssh would be better. But maybe he wants to connect to some device that only has telnet. amz3: jlicht: there is a telnet protocol? I was under the impression that telnet is text based with /r/n line ending markx_: I'm just looking for a telnet client lib. markx_: @amz3 Yes, I need a telnet client to connect to a server. dsmith-work: markx_: And you need *telnet*, not just a socket? dsmith-work: markx_: And no, I've never seen a guile telnet library. markx_: dsmith-work: Yes I want *telnet*, meaning a client that can encode/decode telnet commands. markx_: dsmith-work: I'm looking to build a mud client, which uses telnet. markx_: And what do you guys mostly use Guile for? dsmith-work: sneek: version sneek: Sneeky bot running on Guile version 2.0.11 using bobot++ 2.3.0-darcs dsmith-work: There is a guile ssh library. Does ssh fall back to telnet? dsmith-work: markx_: Can you use ssh instead of telnet? cmaloney: I think it's pretty clear that markx_ is looking for telnet cmaloney: not ssh cmaloney: probably for a historic mud of some sort that doesn't need security amz3: markx_: I build a database cmaloney: markx_: Sadly I'm not seeing anything for a client, but this might help in that direction: https://github.com/stutonk/lambdachat amz3: markx_: and webdev cmaloney: There's also a Node telnet client that might be adaptable: https://www.npmjs.com/package/telnet-client markx_: cmaloney: I can use node libs in guile? dsmith-work: No cmaloney: No, I'm saying the code might give some hints on how to make one dsmith-work: What about piping though netcat? It has a -t option for telnet. Or maybe even piping though telnet? markx_: dsmith-work: how does that work? dsmith-work: markx_: Not saying that would work. Just trying to kick out some ideas. dsmith-work: Hmm. dsmith-work: markx_: Is your server open to anyone? Like for testing something? markx_: dsmith-work: well, any mud server would work I guess. But in my case, I mostly play batmud. bat.org:23 jralls: sneek: later tell spk21 Thanks, I pulled that and tried. It doesn't experience the DT_GUILE_ENTRY problem and manages to compile modules/bootstrap with no errors, so progress. But the first compilatoin in ice-9, and-let-star.scm, crashes and ends up with throwing (I guess in analyze.scm) while printing the backtrace: Value out of range 0 to 4294967295: 1854266240. sneek: Got it. jralls: sneek: later tell spk21 Of course 1854266240 (aka 0x6e85db80) *isn't* too big for a uint32, so it's a bit mystifying. Something must be getting clipped. FWIW I'm building i686, not x86_64. sneek: Will do. jralls: sneek: later tell spk21 Full output is at https://gist.github.com/jralls/39105f5c258e3be89362d97d7c68feae. sneek: Will do. spk121: hi spk121: jralls: I believe your and-let-star error comes from needing a complete clean sneek: Welcome back spk121, you have 3 messages. sneek: spk121, jralls says: Thanks, I pulled that and tried. It doesn't experience the DT_GUILE_ENTRY problem and manages to compile modules/bootstrap with no errors, so progress. But the first compilatoin in ice-9, and-let-star.scm, crashes and ends up with throwing (I guess in analyze.scm) while printing the backtrace: Value out of range 0 to 4294967295: 1854266240. sneek: spk121, jralls says: Of course 1854266240 (aka 0x6e85db80) *isn't* too big for a uint32, so it's a bit mystifying. Something must be getting clipped. FWIW I'm building i686, not x86_64. sneek: spk121, jralls says: Full output is at https://gist.github.com/jralls/39105f5c258e3be89362d97d7c68feae. spk121: jralls: you may be picking up an and-let-star from the bootstrap directory or something spk121: I don't recall exactly, but, in my notes I wrote that system-file-name-convention has different logic in the compile-time case with regards to window vs linux files, and I worked around it by cleaning out all the .go files and doing the whole painful 2 hour build. spk121: also, some of the out of range errors when reading compiled files come from CR vs CRLF errors in mkstemp! spk121: which was one of the patches, so another reason why everything has to be rebuilt from scratch rekado_: Hello Guilers! rekado_: making a game with chickadee is great fun rekado_: I’m a little uncomfortable with GOOPS. It’s great, don’t get me wrong, but it makes me write code that I don’t find pretty. rekado_: there are way more instances of “set!” than in any other Scheme project I ever worked on. manumanumanu: rekado_: it is drafted after CLOS, which I suppose means that is what you get rekado_: I was also surprised that there is no define-method* that would allow me to use keyword arguments or optional arguments. civodul: hello rekado_! civodul: chickadee looks fun rekado_: it’s missing a couple of convenience features, but it’s easy to hack around that. wingo: rekado_: yeah goops needs a bit of love i think. it's had maintenance but not much in the way of new development in the last 15 years wingo: in a way it's remarkable that it still makes sense, as much as it does wingo: i also feel strangely attracted to and repulsed by it :) wingo: some parts are really beautiful, some are not so much civodul: i went from being a big fan to avoiding it, in part due to the programming style it encourages civodul: but every time i C-M-x a record type, i dream of the class redefinition protocol :-) wingo: ACTION makes vm operations to tier up to jit brendyn: wingo: I don't understand it but I think you're doing great work! brendyn: wingo: Did you end up looking at my code that makes ,trace crash? I was wondering why that happens. wingo: brendyn: heh tx :) no, haven't had time to look into that brendyn: ok no worries wingo: all the trace code is in scheme tho so you might find poking around those modules to be interesting brendyn: i'll try but it's probably too advanced for me. I could try tracing trace civodul: ijp-znc: pfds is in Guix \\o/ civodul: i may use it for a few things in Guix at some point civodul: using vhashes and alists for everything is not great... dsmith-work: Morning Greetings, Guilers dsmith-work: rlb: Did you ever get your Debian Guile issues resolved? rlb: dsmith-work: nope - https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid Clicking on the "Build-Attempted" links will show the logs. I deferred the after-gc-hook failure on mips(el) by marking it as unresolved if it fails, but there's a new failure on arm64, and one we *may* have seen before on ppc64el. rlb: FAIL: SMOB mark function called for each SMOB rlb: and rlb: ERROR: asyncs.test: preemption via sigprof - arguments: ((vm-error vm-run "Unrewindable partial continuation" (#))) rlb: (those are ppc64el and arm64 respectively) rlb: When I have time, I'll probably go ahead and incorporate 2.2.4 and try again. If that doesn't help, then I'll either need upstream help of some sort, or to wait until I have time to delve myself (which may be a while). dsmith-work: rlb: Thanks for the info. Wish I could help. I'd hate to see Debian drop Guile. rlb: Well, I think we're quite a way from that -- the key deadline will be the buster freeze, but I sure hope we can get things sorted out much sooner. dsmith-work: Ah! Whew! rlb: This is just guile-2.2 being dropped from testing (buster) for now -- once we can get a version into sid (unstable) that passes all the tests, it'll automatically propagate back into buster after a while. jralls: sneek: later tell spk21 Thanks, but it's a clean build in a freshly-created build directory from a freshly-cloned guile branch tracking wip-mingw-guile-2.2. sneek: Got it. privacynewbie: hello! rain1: hi! privacynewbie: I just found out about Guile while digging into what GNU was about privacynewbie: So I'm just going to chill here while I try to convert all my digital presense (OS, applications, subscriptions) to free software manumanumanu: rekado_: I have two different versions of define-method*, one that uses the method dispatch to define all the methods with optional args, and one that uses lambda* manumanumanu: I liked the first version when the define-metod* has to play nice with other methods, but for most part the define-metod* using lambda* is probably what you want most of the time daviid: fwiw, define-methods* is part of grip too ... daviid: manumanumanu: you are not implementeing a real dispatch, you only dispatch on arity, is that correct? fwiw (again :)), I would not do that, which is why I prefer the impeentation offered bu grip (and actually written by Mark H. Weaver himself :)) daviid: those who want diffent methods based on arg list should write the methods manually, imo. optional kw are other beats, that should not be treated (not even be seen) by goops, againm imo, but of course one does what they want ... it's a free world daviid: *beasts manumanumanu: daviid: I have both versions. I don't remember how the grip version is, but I dispatch rest arguments to lambda* manumanumanu: and one that uses the goops dispatch daviid: manumanumanu: but your 'dispatch' version does not dispatch on arg type, only because of the method arity, iiuc manumanumanu: the goops version uses goops dispatch ("typed"), and the lambda* one passes rest arguments to define-method to lambda* manumanumanu: I have used both, and for most cases the grip-style ones are what you want daviid: manumanumanu: the macro you wrote and that I did read does not dispatch on the argument type, since it is not passed in the first place ... manumanumanu: I allow (define-method* (blah (hej ) #:optional (hopp 3) (snopp )))" https://buildd.debian.org/status/fetch.php?pkg=guile-2.2&arch=arm64&ver=2.2.3%2B1-6&stamp=1532286385&raw=0 rlb: ACTION will have to pursue this later -- guile-2.2's just going to have to be out of testing/buster for a while. snape: wingo: would a sleep() operation operated by the underlying C code of a Guile library block the Fibers scheduler? snape: I guess it would wingo: sneek: later tell snape yep it would sneek: Okay. mwette: proposed guileline for Guile extension languages: #! ... !# is comment mwette: What about `(load file)' ? Could language deduced from extension, or perhaps a in-file `pragma' (e.g., file starts with `#L mylang') be workable? wingo: i would love for us to do the racket #lang thing wingo: and fall back to default languages based on the file extension (e.g. .el should default to elisp) mwette: http://paste.debian.net/1034651/ has a mod to compile-file that is along those lines I think rlb: As sent to the bug tracker a while back, and guile-devel, guile-2.2's going to be removed from debian testing this weekend unless the bug below is resolved (and maybe anyway). And while I can just mark that test as unresolved and hope that's all right, I don't have the time to pursue it further myself right now, and it'd certainly be preferable to hear something from upstream -- so I thought I'd try here too: rlb: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31776 daviid: rlb: hello! I can't help but I'd like to thank you for all this work you are doing to maintain guile on debian, I just hope someone knowledgeable and with some free time will shim in and help, fingers crossed ... mwette: updated compile-file using extensions: http://paste.debian.net/1034658/ rlb: daviid: thanks - I'm not sure what I'll do yet otherwise. If I have the time to implement it, perhaps a compromise, i.e. mark the test as unresolved just on those architectures, and hope that's ok. daviid: rlb: yes, I did read you might try that... ArneBab: manumanumanu: doing well — awoke in the night after falling asleep directly after I read aloud for my children :-) civodul: hey Guilers! civodul: i just realized that (system foreign) has make-c-struct civodul: but there's no way to create an array of structs lloda: vectors are guaranteed contiguous, aren't they? at least in practice they are OrangeShark: Happy Friday! daviid: yeah, happy friday! bavier1: anyone looking at the failing "gc.test" failure in guile-2.2 on deian testing? spk121: jralls: saw your mention a few days ago about 32-bit MinGW guile. I did hack a version that worked for me. spk121: I checked it in here http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-mingw-guile-2.2 spk121: I built it using --without-threads spk121: I mailed in the first patch to the maintainers a few months ago, but, no one looked at it, so I lost momentum at getting it into mainline spk121: . OrangeShark: happy day before Friday! amz31: happy day before Friday! rain1: hello OrangeShark: amz31: what do you think about moving guile-git to a different service? amz31: OrangeShark: it will be ok, I am not used to the mail workflow, I vote 0+ amz31: for another service of you choice that is not gitlab or github OrangeShark: amz31: notabug would be similar to gitlab/github workflow amz31: I don't have feedback about notabug, if dustyweb is ok with that I am ok with that dustyweb: hi dustyweb: hm? dustyweb: for what purpose? manumanumanu: ahoy hoy leute! What are you all doing? ison[m]: I'm just trying to create save/load functions for some project and all data types are working fine except classes. They get read in as symbols. The obvious solution would be to just create a big condition block with all available classes and return the right one, but that will look messy so I'm just wondering if there's another way. jralls: I'm trying to build guile-2.2.4 for Mingw-w64, 32-bit. The C part compiled OK once I disabled networking, but compiling the Scheme fails. It purports to compile eval.scm, but then: jralls: WARNING: loading compiled file C:/gcdev64/gnucash/maint/build/guile-2.2.4/bootstrap/ice-9/eval.go failed: jralls: Throw to key misc-error with args ("load-thunk-from-memory" "missing DT_GUILE_ENTRY" () #f) jralls: I get a long chain of warnings like that as it churns through the list of files until: jralls: WARNING: loading compiled file /bin/sh: line 6: 8532 Segmentation fault jralls: And the build stopped. jralls: I looked up DT_GUILE_ENTRY (it's in libguile/loader.c) but can't figure out where it comes from. Does anyone know? dsmith: ison[m]: What are you using to save? write ? ison[m]: dsmith: I just made my own simple plain text format, but it's basically writing instructions to recreate the class instances. So for instance it writes the class name that it's an instance of, then all the keywords and values. So basically it's able to fully recreate the (make class #:keyword1 val1 ...) form except that "class" is a symbol. ison[m]: Right now I just have a big condition table to take in the class name and return the right one, but it seems silly to have that for such a little thing. ison[m]: Reading is just done with (with-input-from-string filedata read) so most data types are already correct but the class types are read in as symbols. mbowcutt: I'm building haunt, and when I run ./configure i get this: mbowcutt: ./configure: line 2367: syntax error near unexpected token `2.2' mbowcutt: ./configure: line 2367: `GUILE_PKG(2.2 2.0)' dsmith-work: Morning Greetings, Guilers sneek: dsmith-work, you have 1 message. sneek: dsmith-work, wingo says: i fixed that segfault on master i think dsmith-work: Yep dsmith-work: Took 4 hours and 7 minutes to build, btw. OrangeShark: happy Wednesday! yilin: Hello, I wanted to hook up flycheck to the guile linter but I'm getting an error message while linting. Does anyone use the linter? yilin: yilin: ice-9/boot-9.scm:2497:45: In procedure nested-ref-module: yilin: ice-9/boot-9.scm:2497:45: In procedure car: Wrong type argument in position 1 (expecting pair): #f yilin: Is the error message yilin: nvm yilin: Found the issue OrangeShark: yilin: what was the issue? So if someone else has the same problem they can also have an answer yilin: It doesn't seem to be working correctly yet, but the first error was caused by the fact that it tried to load the module #f since it couldn't find the module in the file. The actual linting doesn't seem to be working yet though; need to grok the code. ArneBab: wingo: do you already expect big speed gains in Guile 3? ArneBab: (I ask because in minimal benchmarking I did not see any) wingo: i expect until there is a jit there will be general slowdown though some cases will be faster manumanumanu: wingo: will guile3 be released befor the JIT will be added? wingo: no manumanumanu: Good :D wingo: but, jit is close! i think it is about 200h more of work or so cmaloney: If only there was a JIT for JITs rain1: I wonder how unboxing integers work ArneBab: 200h is a strange measure of being close — thank you, THANK YOU for doing this! ArneBab: (200h of hobby time would be about four months for me, though it’s just 5 weeks in work-time … ) manumanumanu: wingo: remember, if we ever meet I owe you a nice meal. I can only offer some small things that might make the ecosystem nicer, but other than that, I am way too dumb to actually add anything to guile manumanumanu: ArneBab: speaking of which: I am doing a rewrite of the for loops. I realized that I can't support streams unless I add support for non-tail-recursive forms (like what racket did with for/list). I am making it a lot nicer to add user-made for loops as well :) brettgilio: Which emacs package do you all use for sending code to a pastebin? civodul: "GitLab: You (@civodul) must accept the Terms of Service in order to perform this action." civodul: ouch civodul: while pulling from guile-git :-/ rain1: hum.. is that new because of GDPR? civodul: i don't think it relates to that civodul: problem is their terms have very broad wording, like #15: https://about.gitlab.com/terms/ civodul: and really, all i want is to work with fellow hackers on guile-git civodul: these are the persons i have a "moral contract" with civodul: i don't care about GitLab daviid: civodul: terrible! daviid: could we move it to savannah or noteabug daviid: those who install guix will have to sign their agreement? amz31: ping OrangeShark ^ civodul: daviid: no no, if you just pull from the anonymous URL, that's fine civodul: the problem is when you have an account there, which you need if you want write access to the repo daviid: savannah (non gnu to start with) would be a lot better imo daviid: civodul: ah ok daviid: but we should move it (if the authors agree) to savannah or noteabug OrangeShark: civodul: that sounds pretty terrible civodul: yeah that's not great civodul: notabug.org is "better" in that it's operated by a non-profit in the first place civodul: as such it's also more likely to disappear civodul: but i think that's the kind of tradeoff we have to make these days civodul: and we there's Software Heritage, so the situation is hopefully better than it used to be :-) civodul: -we dsmith: sneek: later tell wingo Your latest commit fixed the segfault for me. Yey! sneek: Will do. wingo: excellent! sneek: wingo, you have 1 message. sneek: wingo, dsmith says: Your latest commit fixed the segfault for me. Yey! janneke: nice! wingo: (of course i caused it too :P) janneke: of course :) ison[m]: Sorry for the simple question, but is there a quick way to "convert" from a string or symbol into a class definition? So for example is there a function that will allow me to feed it 'myClass and get back ? (assuming has already been defined) ison[m]: Or similarly is it possible to convert a symbol into a procedure of the same name? dsmith: ison[m]: Heya. That kind of assumes that "things" have names that are attached dsmith: OR that name have "things" attached to them. dsmith: That's often true, but not always the case. dsmith: scheme@(guile-user)> (define foo +) dsmith: scheme@(guile-user)> (define + "hello\\n") dsmith: scheme@(guile-user)> (foo 2 3) dsmith: $1 = 5 dsmith: scheme@(guile-user)> (display +) dsmith: hello dsmith: stis: hej guilers! wleslie: hey stis! daviid: happy monday guilers! civodul: hey! OrangeShark: happy monday grumbel: How do I convert a real to integer? grumbel: (floor 5.5) seems to work civodul: grumbel: note that 'foor' gives you an "inexact integer" civodul: whereas sometimes you want an "exact integer"--i.e., 0 and not 0.0 civodul: to that end there's inexact->exact grumbel: (inexact->exact 5.5) will result in a rational: 11/2 grumbel: So (inexact->exact (floor 5.5))? grumbel: seems a little verbose for such a common operation civodul: i agree daviid: grumbel: you can write your own, float->int ... jlicht: does guile have something like Clojure's EDN to facilitate storing/sending/reading data? brendyn: Is it normal that an expression that runs fine in the repl will crash when run with ,strace ? wingo: brendyn: ,trace i guess? crashes there sound like a bug in guile's debugging foo to me wingo: jlicht: only s-expressions wingo: sneek: later tell dsmith-work i fixed that segfault on master i think sneek: Will do. brendyn: I made it crash when I was generating long lists wingo: weird brendyn: 1 sec ill try reproduce it brendyn: wingo: https://paste.debian.net/1033924/ brendyn: ,trace (queens 1) and ,trace (queens 2) work brendyn: ,trace (queens 3) ends with In procedure =: Wrong type: # brendyn: ,trace (queens 4) => In procedure map: Not a list: # brendyn: ,trace (queens 7) => In procedure list-ref: Wrong type argument in position 1: # brendyn: It's a little different depending on the number brendyn: but they all produce answers without ,trace jlicht: wingo: thanks! civodul: jlicht: what's EDN? jlicht: civodul: https://github.com/edn-format/edn, basically an application of s-expressions with some things a bit more specified to use it as a data-exchange format (among other things) civodul: jlicht: i see, thanks civodul: not very schemey, but interesting ;-) jralls: Had no response on this yesterday so I'll ask again: GnuCash has a localization problem on MSWindows in the Vietnamese locale: scm_c_eval_string("(any-form-at-all)"); asserts in utf8_to_codepoint(). A representative stack trace may be found at https://bugs.gnucash.org/show_bug.cgi?id=796728#c19. Converting the string to an SCM beforehand and using scm_eval_string() doesn't help. Is there a work-around? daviid: jralls: you should try to produce a snipet, that does not depend on gnucash, a tiny C program that reproduce what you are trying to solve, then email it to guile ML. now, why aren't you tryingt port to 2.2.4 instead of 2.0.14, they handle encoding in a diff way, and all this work you are doing wil have to be done agina ... not to mention that you'll have a hard time to receive support for 2.0.14 ... daviid: jralls: in 2.0.14, you must set port encoding 'manually', all ports daviid: jralls: you might want to look at how lilypond does this, and they ae working on a port as well (2.0.14 as well), nd they have japanese, chinese ... it might help you jralls: daviid: AFAICT there's no way to control the port generated by scm_eval_string. daviid: not really my domain, so I can't really help more then these two suggestion, sorry and good luck! jralls: daviid: As for 2.2.x, we've recently gotten that working in Linux but haven't yet tried to build it in MSYS2. jralls: daviid: Thanks for trying. daviid: jralls: it really is a loss of time to work on 2.0.14, imo. I think there are succeffull attempt of 2.2.x on win, hope someone here can confirm ... daviid: without thread though daviid: if i understood correctly, but i never ever used win in my life :), lucky me daviid: jralls: 2.2.x has been overhalled wrt port, it really is a lot better daviid: jralls: look at the NEWS, and port, soft port, textual ports in 2.2.x, you'd be convinced to use it istead of 2.0.14 ... :) daviid: jralls: not to mention that it is an order of mag faster ... and 2.0.14 will desapear from distro real soon ... jralls: daviid: For now we need to support both because not all distros provide 2.2 yet. Believe it or not, not everyone uses Debian Unstable in production. As for disappearing, I used to preach that about Gtk2. 10 years later it's still everywhere. daviid: 2.2 is in buster as well, fwiw jralls: Yeah, so? Normal users aren't, they're on stretch. And Ubuntu LTS 14 and 16. daviid: jralls: yes, in buster i can confirm, ubunto i don't know jralls: None of which applies to Windows, where we have to build for distribution. So I'll try that and see if it fixes the UTF8 string problems. jralls: daviid: Thanks agains. daviid: jralls: np stencilv: Hi-- I'm having trouble installing haunt (https://dthompson.us/projects/haunt.html) - e.g. haunt-0.2.2. My system is debian stretch, but for guile I have installed: guile-2.2, guile-2.2-dev, guile-2.2-doc, guile-2.2-libs:amd64 -- all 2.2.3+1-3. When I “./configure” to try to build haunt, it reports: “...checking for guile-2.2... /usr/bin/guile-2.2; checking for Guile version >= 2.2... 2.2.3; checking for guild-2.2... no...” while stencilv: e.g. from a command line “guild -v” reports “guild (GNU Guile) 2.2.3”. (Doing "make" after "./configure" results in errors). I'm assuming I need to tweak something in configure.ac, maybe?? Thanks in advance for any advice... OrangeShark: stencilv: I think that has to do with how debian installs guile, it probably has a symlink of guile-2.2 to guile, but not for guild OrangeShark: stencilv: I believe if you do "./configure GUILE=/usr/bin/guile" it should find guild stencilv: OrangeShark: ah; will give that a try. Thanks! stencilv: OrangeShark: indeed, that seems to have worked! OrangeShark: stencilv: great :) amz3: nice! brendyn: Is it possible to do the picture language stuff from SICP in guile? brettgilio: brendyn: I do not see why not. brettgilio: If any standard is going to be compliant to SICP, it is going to be Racket, Guile, or MIT Scheme brendyn: brettgilio: it requires being able to print images to the screen brettgilio: It's been awhile since I touched SICP, but I have it on my computer. Can you give me a page number for reference? brettgilio: brendyn: brendyn: 176 or so brendyn: It seems to just assume that I already have this picture language and functions like beside brettgilio: brendyn: Page 176, Chapter 2, page top reads "takes a tag and contents..." brettgilio: Right? brendyn: That's page 273 for me. I've got a revamped PDF version of SICP brendyn: 2.2.4 brettgilio: here, give me a phrase from the page brettgilio: or that works too brettgilio: 2.2.4 brendyn: A picture language brettgilio: brendyn: Got it. brettgilio: let me refresh myself on it really fast brendyn: I wouldn't mind doing it in racket but I installed racket in Guix and sicp language doesn't exist in it brettgilio: Dr. Racket should have a scheme standard under "older languages" or something brettgilio: But, I don't think you'd need to brettgilio: Yeah, I don't see any reason why you couldn't be able to do such manipulation in Guile. You should be able to define the picture directly from its file path. brettgilio: I'd give it a try brendyn: Don't know how to do that brettgilio: brendyn: What environment are you working in for Scheme? brendyn: Emacs, geiser with guile mwette: Hi all! rain1: hey stis: hello guilers! rain1: hi :) rain1: whats happening? EuAndreh[m]: Hi there! EuAndreh[m]: What's the go-to/recommended static site builder in Guile? EuAndreh[m]: Haunt? stis: rain1: not much slacking today resting after some heavy codeing of a python port ty guile mwette: stis: nice. So I'm practicing lang ports using javascript. How do you handle strings for your nearly-Python? Python interns strings so do you have some internning method, just use Guile strings, or something else? stis: i'm sloppy and use guile strings stis: modelling it using symbols could be done but i fear that you will get pollution when e.g. string analysing mwette: What about associative arrays? Do you index by string also? rain1: so guile can run python scripts? mwette: where associative arrays == Python dictionary objects == Guile hash-tables, I assume mwette: rain1: stis is working on it. Guile has ecmascript (aka javascript) in the distribution, and elisp also. The reference manual describes how to generate your own extension language to host in Guile. rain1: how did you write the parser? stis: mwette: yes you can idex by strings. faster to index by interned stuff though stis: rain1: ideomatic python works fine now, if you want the batteries you need to wait. stis: rain1: using stis-parser: https://gitlab.com/tampe/stis-parser stis: re module os sys pickle string is implemented though, more to come rain1: amazing, well done ArneBab: stis: won, I did not see that — need to play with it and maybe get some of my python tools compatible! ArneBab: s/won/wow/ mwette: I'm having issue with guile running my javascript. If I type, essentially, `var a = 1', then `print(a)' in the interactive interpreter, I get expected result. But, if I put those statements in a file and run `guile --language=javascript' file.js, I get failure: the compiler can't find the top-level symbol "a". daviid: mwette: can you load the script, run (main ...) and then ,bt ? daviid: I guess not mwette: I will try something ... that's weird. mwette: in scheme mode "load" is a procedure, but after I ",L javascript", "load" is a syntax-transformer. mwette: You can duplicate with ",L ecmascript". daviid: yeah, I as suspecting this, maybe gdb or strace gives more info ... I don't know mwette: I tried primitive-load from javascript but then i have unresolved symbols from the file. daviid: how about turning the file into a script, then after #!/bin/bash you'd do exec guile --lang ... ? daviid: anyway, you know ths javascript 'module' needs love daviid: i don't think it is maintained (or maybe just 'stalled') mwette: This is my own javascript implentation. It lives in the example/ subdir of my nyacc distribution. daviid: ah, ok mwette: The ecmascript one is 2k lines of code w/ zero comments. But it does give me a place to look for hints. Hence, my javascript is a learning tool. daviid: i thought it was ijp implentation ... mwette: To work interactively one needs to generate a parser (or reader) that will parse one top-level construct and return. Many parsers will parse to EOF, which does not work. Also, I found that the Guile language system expects readers to return the eof-object on EOF. mwette: My reader outputs SXML. I then use Andy's foldts*-values to convert to tree-il. ArneBab: mwette: you can cheat parsing more than one construct by caching the parse result as i do it in wisp: https://bitbucket.org/ArneBab/wisp/src/7501dc0db3f8cebf49b48634719ab82b4a509a79/wisp-reader.w?#wisp-reader.w-36 mwette: ArneBab: Thanks. I don't see a need to do that. I fixed my parser so that once the top-level production is reduced it returns. Here is the new interactive parser: http://paste.debian.net/1033820/ ArneBab: mwette: nice! ArneBab: (though I must admit that I don’t understand directly from reading what it does) mwette: ArneBab: It implements a pushdown automata. The parser genenator generates a state machine. Either a lookahead token is absorbed and generates a state transition (shift), or the lookahead token signals a completion of a production rule (a reduction). mwette: ArneBab: That's how Bison parses. See https://en.wikipedia.org/wiki/Pushdown_automaton jralls: GnuCash has a localization problem on MSWindows in the Vietnamese locale: scm_c_eval_string("(any-form-at-all)"); asserts in utf8_to_codepoint(). A represntative stack trace may be found at https://bugs.gnucash.org/show_bug.cgi?id=796728#c19. jralls: Converting the string to an SCM beforehand and using scm_eval_string() doesn't help. mwette: . thomassgn: in a guile script, I would like to react to a grep'ed part of several lines of output from a program. Currently I'm using system* and readline to loop over the pipe. Is this an allright way forward? I also find it a bit weird that if I run my procedure twice it continues grep'ing through the output of the previous call, not a new 'system*' invocation... Do I need to flush the pipe in addition to close it? thomassgn: (or maybe the new system* output is appended to the pipe?) markx: Hello! markx: Is there a telnet client for guile? brendyn: Don't really understand it but it looks interesting. guile on WebAssembly one day? http://words.steveklabnik.com/webassembly-is-more-than-just-the-web chrislck: Hi may I ask simple question? Perused manual but still unsure if my task is doable. chrislck: I am successfully using (define* (func a b c #:key (d 'd) (e 'e)) ...) chrislck: afterwards I can do (func 1 2 3) or (func 2 3 4 #:d 5 #:e 6) to call (func), and specify customized d and e arguments chrislck: but I wonder if there is a way to do it one level higher chrislck: i.e. after (define* func) as above, I wish to do (define* (func2-with-d-5 a b c) (func a b c #:d 5)), i.e. func2 calls func with d=5 chrislck: sorry I wish to do something like (define* (func3 a #:rest) (func a 'b 'c #:rest)) chrislck: i.e. func3 is similar to func, but will set b='b and c='c, but func3's #:rest is also passed on to func #:rest chrislck: a better snippet is https://pastebin.com/b5tyVj8y - basically I wish to define (add-to-table) which will expand to (add-multicolumn-acct-table) with some default arguments, but can also pass its keyword arguments through to add-multicolumn-acct-table thomassgn: chrislck: I'd try, I'm quite a guile beginner, but this looks like it should work as you've written it... thomassgn: (I'm just assuming you have not tried from the wording in the question) chrislck: well no it doesn't work janneke: bah, getopt-long does not handle (one-per-line (single-char #\\1)) manumanumanu: brendyn: I would really like to convert wasm to one of guile's intermediate languages. manumanumanu: how hard can it be? manumanumanu: :D brendyn: manumanumanu: Does guile's C parts need to be rewritten in guile to accomodate that? manumanumanu: well, no... WASM is pretty simple, but it might be hard to make it run fast brendyn: Does that mean having guile in the browser somehow? manumanumanu: no, but it means we can have things compiled for wasm running in guile janneke: ACTION sent bug report with patch daviid: I wonder why we don't have keyword? and keyword->string in core guile? manumanumanu: daviid: I have keyword? janneke: there is keyword->symbol manumanumanu: (define keyword->string (compose symbol->string keyword->symbol)) daviid: manumanumanu: ah, thought keyword was in srfi-88 'only', and the latter should be in guile, I mean why not, that was the question :) daviid: *keyword? stis_: evening folks! manumanumanu: evening stis_ stis_: I manage to implement python's re module recently. That's good because a lot of python code depends on that specific module manumanumanu: alright! manumanumanu: what kind of problems did you encounter? mwette: where is your python-in-guile homed? stis_: manumanumanu: the re module is not translatable to scheme regexp mainly manumanumanu: oh :( stis_: mwette: https://gitlab.com/python-on-guile/python-on-guile stis_: to be able to pickle and unpickle you need to have guile-log installed as well stis_: manumanumanu: later I will check for scheme compatability of the regexp and use that in cases where those apply mwette: stis_: Thanks. mwette: . thesage: hi thesage: if given proper guidance, on how to contribute to guile, i would try to be an valuable resource and asset thesage: can someone explain the basics of guile internal architecture thesage: my email is rkchilaka378@gmail.com thesage: i want to be a volunteer at gnu thesage: is someone online? amz31: yes thesage: hi amz31 amz31: thesage: read the source and manual, send a mail to guile-devel mailling list about what you want to help with thesage: ok amz31: thesage: read the bugtracker, you will find the url in the manual thesage: is everything written in the manual updated and correct? amz31: thesage: for instance, I have a 'html' module that I would like to include in guile proper but never come around writing tests for it thesage: oh amz31: thesage: best effort :) thesage: thanks amz31 thesage: i would like to write tests for the html module you have thesage: where can i get that html module? :) amz31: thesage: https://github.com/a-guile-mind/guile-web/blob/master/src/web/html.scm thesage: thanks amz31 amz31: thesage: send a message on the mailling list saying what you plan to do amz31: thesage: not all guile core dev are on IRC amz31: I am not a core dev thesage: ok amz31 thesage: but first i will try to write tests for the module you wrote thesage: when they are done, we can submit that module together :) thesage: or you can add me as a minor contributer amz31: thesage: use srfi 64 unit tests module amz31: thesage: have a look at this repository to learn how to setup test coverage https://github.com/a-guile-mind/coverage amz31: if you plan to code the tests out of the guile git repository thesage: ok amz31 thesage: how do i contact you amz31? thesage: do you have whatsapp or telegram? thesage: i have whatsapp and telegram thesage: my number is +919113512050 thesage: if you are interesting in guiding me through the project, it would be lot of help. amz31: thesage: please use the mailling list it's better for everybody amz31: also I don't have whatsapp and telegram thesage: ok thesage: ok amz31 thesage: i have signed up for the mailing list thesage: i will try to propose that i am writing tests for your module there. thesage: thanks for helping me out. thesage: i hope you have my number, if you want to contact me using whatsapp or telegram thesage: email: rkchilaka378@gmail.com thesage: number: +919113512050 thesage: https://github.com/thesageinpilani thesage: is my github page, i am just starting ;) amz31: you have one more follower :) thesage: ha, ha thanks thesage: you also have one more ;) dsmith-work: Happy Friday, Guilers!! OrangeShark: happy Friday! amz31: ! civodul: yay, happy Friday all! daviid: yeah, happy Friday! manumanumanu: Wahoo! I finally get to use fibers! manumanumanu: happy happy friday! brendyn: manumanumanu: one of these days I'll get to use them too! manumanumanu: stis, my fellow countryman, how's it hanging? manumanumanu: what have you been up to? manumanumanu: I have been using your syntax-parse to great success stis_: manumanumanu: great I think that is a cool lib, but it is a port and I'm just a translator stis_: I just went into the fog today and reproduced python regular expression lib manumanumanu: stis_: it is pretty damn great though. manumanumanu: it is so much simpler to use than syntax-case stis_: the go files are huge though, I would really like to trim the sizes of the go files but don't know how stis_: for a fun application of syntax parse consider look at my implementation of CL's loop macro manumanumanu: stis_: wtf, you impemented the loop macro? that's what I'm using it for :( stis_: https://gitlab.com/guile-cl/guile-cl manumanumanu: stis_: show me the source :D manumanumanu: stis_: what kind of code does it generate? is it efficient? manumanumanu: seems like there is a lot of mutation going on manumanumanu: (like the regular loop macro) stis_: yes it's mutating manumanumanu: isn't it possible to implement most of the loop macro as a folding construct? That would remove a bit of the mutation stis_: could be but I think that I decided for code simplicity do the mutation. You can explore if there is a better way and get better speed and continuation properties stis_: the loop macro is disliked, so I did not want to put too much effort in it. there is iterate that is better and you have foof loop as I think it is named that is prefered amongst guilers I think manumanumanu: CLers will never stop complaining about how nothing compares to loop, so I want to try implementing it in a way that adds little overhead so that they can be happy manumanumanu: I never really understood what it has over rackets for-loops apart from early exits stis_: well it's quite used in the cl community and I suspect that they want to use something they know rather than something that is technically better stis_: the loop macro is in the standard stis_: also mutation is cheaper and better optimized ontop of e.g. SBCL than guile stis_: technically this is because CL does not do re installable continuations I think. manumanumanu: hmmm. racket does not support the by clause manumanumanu: or something like (loop repeat 5 for x = 0 then y y = 1 then (+ x y) collect y)) manumanumanu: but that can be added easily. chrislck: running n-tuple combinatorial tests on gnucash reports :-o https://lists.gnucash.org/pipermail/gnucash-devel/2018-July/042330.html - output at https://gist.github.com/christopherlam/c04d43398ecac486d662c4e74eb293ca see daily-reports.scm being torture-tested... lloda: how do I get emacs to indent #:export like, #:export (a b\\n***align below a not below b***) civodul: good question, i don't have a good answer to that civodul: it's one of these warts you get used to ;-) amz31: o/ lloda: thx anyway civodul :-) siraben: Hi #guile, I wrote a fibonacci function "fib" and I want to see how long it takes for an input n, how do I do something like (map (lambda (x) ( (fib x))) '(30 31 32))? siraben: I want to collect data on the time taken for fib to run on an input N siraben: I want that map to return a list of timings in seconds, e.g. (1.2 1.3 1.4) dsmith-work: Hey Hi Howdy, Guilers lloda: siraben: you can use the functions get-internal-run-time get-internal-real-time and the variable internal-time-units-per-second lloda: https://www.gnu.org/software/guile/manual/html_node/Time.html amz31: heya dsmith OrangeShark: Happy day before Friday! dsmith-work: Wheee! ArneBab: sneek: later tell siraben: here’s an example of timing functions: https://bitbucket.org/ArneBab/wisp/src/7501dc0db3f8cebf49b48634719ab82b4a509a79/examples/benchmark.scm?#benchmark.scm-48 sneek: Got it. ArneBab: sneek: botsnack sneek: :) daviid: brendyn: please send a bug report at bug-guile at gnu dot org brendyn: ok daviid: brendyn: you can grab it from http://groups.csail.mit.edu/mac/ftpdir/scm/ daviid: or entering wget http://groups.csail.mit.edu/mac/ftpdir/scm/slib-3b5.zip daviid: brendyn: if yu are using guix, there is an slib guix package brendyn: I installed the package via guix but guile doesnt seem to find it. brendyn: In procedure primitive-load-path: Unable to find file "slib/guile.init" in load path daviid: brendyn: is the guile you are using to use slib the one in guix as well? brendyn: yes brendyn: I'm on GuixSD daviid: hum, that is surprising, I sugget you ask in #guix civodul: brendyn: besides note that SLIB is old and "clunky" on the edges civodul: for one it's always been difficult to use it in a Scheme that has a module system brendyn: In general, if I'm looking for a procedure that I expect exists in a guile module somewhere, how can I go about finding it. I just wanted to find a prime? test civodul: oh, maybe you can extract it from SLIB instead of trying to get the whole SLIB to work :-) daviid: brendyn: guile-lib is your friend :) daviid: http://www.nongnu.org/guile-lib/doc/ref/math.primes/ brendyn: As I learn to program, I find it unintuitive which procedures exist in modules and which ones I need to make my self or copy-paste in daviid: brendyn: guile's reference manual procedure index (among other indexes) is your friend brendyn: thanks brendyn: I'm about 25% of the way through SICP daviid: brendyn: guile-lib is in guix of course, and just do (use-modules (math primes)) brendyn: It worked brendyn: Interesting that it takes 0.6 seconds to load daviid: brendyn: it's running some 'expensive' code at load time dsmith-work: {appropriate time} Greetings, Guilers OrangeShark: greetings dsmith-work amz31: greetings OrangeShark: how are you doing amz31? guile-guest4: Hey folks guile-guest4: Was wondering if there is anything like slime for use with guile+emacs. Any type of melpa package for this? snape: guile-guest4: there is Geiser guile-guest4: oh that's great. Thanks snape amz3: OrangeShark: I get things going as smoothly as I can amz3: guile-guest4: what are you up to? amz3: OrangeShark: and you? OrangeShark: I am doing alright. Need to do more Guile hacking though. amz3: you released guile-git afterall, time for some rest amz3: I promised myself to write something for scheme2018 amz3: I already have 3 pages out of 14 which is the max amz3: seems like I don't have a lot to say amz3: OrangeShark: I have a better idea of what I want to do amz3: I plan to create three version of the database that I wrote called now zehefyu93 amz3: sneek: zehefyu93 is a quad store written in guile on top of wiredtiger database library sneek: I'll keep that in mind. amz3: one version of zehefyu93 will be simple with microkanren querying OrangeShark: ohh, a paper for a conference. That is cool amz3: the second version will be versioned in a single branch like datomic amz3: and the third will be more like git amz3: actually the third version of the database is what is in the repository right now except it doesn't have microkanren querying amz3: OrangeShark: that is a lot of work amz3: I don't think all three will be ready for the conference tho OrangeShark: three versions for the same paper? amz3: three versions of the quad store amz3: the paper will deal with all three versions OrangeShark: ah okay OrangeShark: thought you were going to write one paper for each amz3: that's an idea amz3: maybe I will do that amz3: anyway, I just wrote the introduction and the 'road to zehefyu93' section of the paper OrangeShark: the deadline is soon, right? amz3: remains the second section which shall describe how those work amz3: 2 weeks vivien_: Hello guile! I'm using the foreign function interface on my custom C code, and I have 2 questions. 1. I have a function that fills an output parameter of enum type ; should I use the "int" ffi type? 2. I'm paranoid of the garbage collector; is there a way to tell guile (when running my unit tests) to run the GC before each allocation? vivien_: (sorry for my bad english) vivien_: And yet another question: 3. Does the garbage collector scan my bytevector for pointers or not? civodul: hello vivien_! civodul: the GC does not scan bytevectors (they are bytevectors, not "pointervectors" ;-)) civodul: re #2, at each allocation libgc determines whether it needs to run a full, stop-the-world mark & sweep phase or not civodul: usually it does not civodul: what you could do in your unit tests is too explicitly call the 'gc' procedure, if you want to stress-test that aspect of your bindings civodul: re #1, an "enum" is an "int", indeed vivien_: OK thank you. For #1: OK, for #2: it is a little annoying since I would rather run the GC inside the scheme library function, not in the test, but this reduces my paranoia. For #1: I must keep a bytevector A alive for at least as long as another bytevector B, but I will never use bytevector A in the scheme code. Will the compiler optimize it away? If so, how do I tell it not to? civodul: it's a run-time issue, not a compile-time issue civodul: a common way to work around it is using a weak hash table civodul: so you would do (hashq-set! table b a) in your weak hash table civodul: and that guarantees that A will disappear only once B has become unreachable vivien_: So table should be a global define of the module right? civodul: yes civodul: (it should be a weak-key hash table in the example above) ison[m]: Why is it that I can't compare classes in a "case" statement such as (case (class-of obj) (() ...)) and it always falls through to the "else" block? Even though "case" is said to use eqv? as its comparison and (eqv? (class-of obj) ) returns true? ison[m]: Oh it looks like the class names were cut out due to the greater-than less-than signs. If I use square brackets instead then it should be (case (class-of obj) (([my_class]) ...)) which fails, and yet (eqv? (class-of obj) [my_class]) succeeds rekado_: I found some odd differences in behaviour between compiled and interpreted Scheme code. rekado_: I have a module that uses the SDL2 bindings. rekado_: when it is compiled everything works fine. rekado_: when it is not compiled, however, Guile crashes. amz3: the Scheme 2018 CfP is prolonged to 23 July https://brinckerhoff.org/scheme2018/ rekado_: the error is not very helpful: In procedure symbol->string: Wrong type argument in position 1 (expecting symbol): #:sdl2 rekado_: “sdl2” is the prefix that I use for the (sdl2 mixer) import. amz3: that looks like a keyword rekado_: the backtrace shows (resolve-interface (sdl2 mixer) …), and then “for-each” over all exported symbols, then “(symbol-append #:sdl2 %default-chunk-size)”, where “%default-chunk-size” is the first exported value. rekado_: I don’t know why it wants to prepend a keyword instead of the plain symbol that I asked it to use as a prefix. amz3: that's the question I was going to ask rekado_: I don’t have this problem when compiling the module. amz3: because the REPL says: amz3: scheme@(guile-user)> (symbol? #:sdl2) amz3: $2 = #f rekado_: this is with Guile 2.2.4 (but I had the same problem with 2.2.3) amz3: and there is the difference between compiled and non-compiled amz3: rekado_: are you sure the use-modules expression doesn't have invisible characters in the prefix argument? amz3: sometime it happens when typing stuff like alt-gr + space amz3: by mistake amz3: anyway, good luck rekado_: I’m sure there are no invisible characters. daviid: rekado_: I would write a snipset that reproduce this 'false/unexpected' keyword, but using a guile core module instead, say (ice-9 popen) for example, then report a bug rekado_: I wonder if maybe this is due to some reader shenanigans in one of the modules I use. rekado_: maybe in guile-sdl2 or in chickadee. rekado_: because it seems fine when using a prefix that does not end on a colon. rekado_: hmm, (chickadee render) includes this line “#:use-module (srfi srfi-88)”. This is intended to cause (keyword? foo:) to be #t. rekado_: is it a bug that this affects the interpreter globally? daviid: rekado_: from what you wrote so far, I think the bug is in the compiler, which should also trigger the error, since #:sdl2 is a kw? but to go ahead, may be you can enhance your code to use keyword? (srfi-88) and symbol?, then either use keyword->string or symbol->string ... maybe rekado_: my module does not use srfi-88. rekado_: it’s just a module I use that happens to use srfi-88. daviid: rekado_: but once it has been imported, the reader has been affected rekado_: my expectation is that the effects of srfi-88 are local to the module using it. daviid: rekado_: I don't think reader options are local, not sure though rekado_: this caught me by surprise, because as a user I cannot know what modules are used in other libraries. daviid: rekado_: reader options are terrible beasts!! usually highly discouraged, afaict, but again, 'just' to go ahead (you may analyse and report a bug later), you could import srfi-88 and do as I suggested above daviid: rekado_: in oder to confirm (or not) that reader options are not local, you may print (read-options) from your module, and see, maybe I'm wrong civodul: oh yes, srfi-88 should avoided daviid: or (read-options 'help) civodul: rekado_: if you use reader extensions, you have to enable them both at macro-expansion time and at eval/load time civodul: so you need an eval-when civodul: though i suppose if you #:use-module (srfi srfi-88) it does the right thing? rekado_: I don’t but davexunit does in chickadee :) civodul: what happened to davexunit? :-) rekado_: the use of srfi-88 in chickadee appears to affect the prefix argument “baz:” in “#:use-module ((foo bar) #:prefix baz:)” in my own code. rekado_: this is “#:prefix baz:” for those of you who see a smiley face instead daviid: haha rekado_: I have another problem involving chickadee, guile-sdl2, and Guix. rekado_: I’m trying to build a Guix package for the latest development version of chickadee, but the compilation of one module (chickadee input keyboard) fails with “no code for module (sdl2 input keyboard)”, even though it exists. civodul: rekado_: because reader macros are global, "baz:" is transformed into keyword #:baz civodul: bad bad bad! rekado_: the (chickadee input keyboard) module is trivial and other modules that use sdl2 modules can be compiled just fine. daviid: rekado_: I would display (pk ...) %load-path from your guix attempt to build ... surely it misses a path rekado_: oops, the load path is fine, but guile-sdl2 did not install the (sdl2 input keyboard) module… rekado_: maybe a problem in the Makefile.am rekado_: yup, the file is not listed. rekado_: sorry for the noise: it’s because latest chickadee depends on latest (unreleased) guile-sdl2. daviid: rekado_: that was not noise, but fun and insteresting (it reminded me about these reader options side effects ...) and it is so much more fun when #guile is lively ... please make more 'noise' like this :) dsmith-work: Morning Greetings, Guilers dsmith-work: ison[m]: Notice that for case "Each is an external representation of some object." dsmith-work: ison[m]: I think that basicly means the things are quoted. davexunit: rekado: I didn't realize that srfi-88 introduced weird reader macros davexunit: I hadn't noticed any issues from it davexunit: I included it for one small thing so I can get rid of it and get the job done another way davexunit: yeah, keyword->string is all I use it for civodul: heya davexunit :-) davexunit: hey civodul davexunit: I'll just use (compose symbol->string keyword->symbol) instead civodul: sounds reasonable davexunit: two hops is no big deal because the code is evald at macro expansion time anyway davexunit: I had no idea that srfi 88 introduced global reader macros davexunit: civodul: what is the definitive right place to install .go files? davexunit: I feel like I've used 3 different places over the years and I always get some mail about how I'm doing the wrong thing civodul: davexunit: the Definitively Right Place is $libdir/guile/2.2/site-ccache davexunit: the latest being rekado saying he had to patch guile-sdl2 and chickadee for guix. but I've been using them with guix without an issue :( davexunit: civodul: okay thanks, that is what I have now. davexunit: I'm not sure why rekado needed to patch my makefiles to use $moddir davexunit: I just checked and the official guix package recipe for guile-sdl2 includes such a patch davexunit: I want to make new releases of guile-sdl2 and chickadee but don't want to have this problem anymore rekado: … I added that when adding guile-chickadee, because it would not find the sdl2 modules at build time :-/ rekado: so you shouldn’t take that patch as confirmation that I’m right. rekado: I could also be wrong in two places. davexunit: heh, so I'm reading through my own sources to refresh my memory a bit and I can see that I do this, too davexunit: something is not right here, and I suspect it's a Guix bug. davexunit: my profile manifest clearly lists 2 search paths for GUILE_LOAD_COMPILED_PATH: lib/guile/2.2/site-ccache and share/guile/site/2.2 davexunit: however only share/guile/site/2.2 ends up in my shell environment davexunit: 'guix package' seems to do the right thing, 'guix environment' does not davexunit: well, nevermind. seems to be an issue with my shell configuration. ignore me. civodul: :-) davexunit: ... well... now I'm back to suspecting a guix bug. davexunit: I'll just shut up until I have something nailed down rekado: :D OrangeShark: I have this for my go files godir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache davexunit: OrangeShark: that is correct, from what I understand OrangeShark: daviid has argued that this doesn't really follow the GNU Coding Standards though. It seems what we currently do is similar to how GNU Emacs packages are installed. davexunit: rekado: found it! small typo that I just couldn't see for a long time davexunit: "ccache" instead of "site-ccache" in the Makefile. I probably have this issue in most of my projects. sigh... OrangeShark: I separated the guile bits from my automake files so they can be easily copied and pasted to my projects davexunit: OrangeShark: good idea brendyn: https://www.gnu.org/software/guile/manual/html_node/SLIB-installation.html#SLIB-installation brendyn: This pages links to a page that doesn't exist https://www.gnu.org/software/guile/manual/slib/Installation.html#Installation ArneBab: daviid: I repeatedly find myself re-using (string-replace-substring s substr replacement) which replaces every instacne of substring in s by the replacement. ArneBab: daviid: would that be viable for guile-lib? https://bitbucket.org/ArneBab/wisp/src/7501dc0db3f8cebf49b48634719ab82b4a509a79/wisp-guile.w?at=default&fileviewer=file-view-default#wisp-guile.w-760 daviid: ArneBab: that one is in grip (snarfed from guix), which I renamed string-replace-all, here: http://git.savannah.gnu.org/cgit/grip.git/tree/grip/string.scm?h=master ArneBab: daviid: wow, nice! I didn’t know it had made it there. We golfed that down a lot to be fast (factor 20 or so compared to the initial version). The match-parts are new, though (they look surprisingly obvious, nice!) ArneBab: (I think the one in wisp is the initial implementation, from Fri Sep 13 22:06:18 2013 +0200) ArneBab: (it was golfed down by 2 orders with a lot of help from Mark Weaver) daviid: great! i just renamed t, so who wrote it gets your applauds :) daviid: hello guilers, happy monday all! civodul: hey, hello daviid! civodul: daviid: the other day i had to work around a small issue in the build system of guile-lib 0.2.6: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=bf5e9bfcf9f6b204139953e7d955545a524ca340 daviid: hi civodul, oh, my bad, thanks! I'll fix that: I thought I just renamed dev-environ -> pre-inst-env, but it seems from your fix that I may have copy/pasted it from another projects maybe... how come make distcheck passed here, I wonder? daviid: yep, it surprises me make distcheck passsed, I wonder civodul: daviid: most likely you had guile-lib installed in one of your GUILE_LOAD_PATH directories civodul: so you were actually testing a different version of guile-lib daviid: civodul: probably! I should uninstall before running make distcheck I guess (valid for other projects too ...) civodul: or try "guix build guile-lib --with-source=guile-lib-1.2.3rc.tar.gz" :-) daviid: civodul: yes, in the best world, I would also use guix daviid: ACTION is hiding daviid: I should release it again after fixing this ... should I use 0.2.6.1 or 0.2.7? daviid: right, with uninstalled guile-lib make distcheck fails here too of course, oh man, brown bag for a weelk at least :) daviid: I guess 0.2.6.1 is a better next releae version number daviid: civodul: in guix you don't use the new option --with-guile-site I suppose? I mean in guix users don't choose where things are installed? (curious) jlicht: daviid: I would humbly propose following SemVer (https://semver.org/) :) daviid: jlicht: tx! they don't use 4 digits daviid: jlicht: I was just commenting ... so far, when I have to make a change to fix a release bug - that does not affect any code, nor doc - I was re-releasing using a four digit, but appart from that, I also follow this semver guidelines daviid: so, I think I'm going to be connsistent with myself here, and release 0.2.6.1 OrangeShark: daviid: in Guix, users don't choose where things are installed. OrangeShark: they get installed in /gnu/store/ daviid: OrangeShark: ok thaks! I did ask because the install location changed (for the 'rest of the world', and one must uninstall before to install this new release ... OrangeShark: daviid: looking at the package for guile-lib, guix modifies the makefile to put it in the location guix expects it to be daviid: to be complete, the above ... unless they use the newly added --with-guile-site option (as well explained dsmith-work: Monday Greetings, Guilers janneke: hi dsmith-work! daviid: ACTION released guile-lib 0.2.6.1 jlicht: daviid: nice! daviid: jlicht: tx Labu: Hello all ! Labu: I am looking for an unti test lib for guile Labu: *unit Labu: I find ggspec and test-manager, do you know some other lib for this purpose ? weinholt: Labu, srfi-64, srfi-78 and also (unit-test) in guile-lib Labu: hi weinholt I know srfi-64 but I didn't know srfi-78 Labu: I am looking thx Labu: srfi-78 is not available in guile 2.0.14 weinholt: ah, right. i forgot about that. Labu: no problem you didn't know I was on 2.0 weinholt: i think it's missing from 2.2 as well actually weinholt: however, guile-lib should work on 2.0? Labu: I didn't know this lib Labu: I am on NetBSD I don't know how I cant obtain this lib. I am on the project page right now daviid: weinholt: yes, sfri-64 too Labu: I think I stay with srfi-64 for this project daviid: Labu: I just released it :), are you a member of guile-user ML? Labu: Hi daviid no. daviid: Labu: ok, here https://savannah.nongnu.org/projects/guile-lib/ Labu: yes I am on it Labu: I think I can install it from source I am gonna try daviid: definitely, here are some info on how to proceed: daviid: http://lists.gnu.org/archive/html/guile-user/2018-07/msg00033.html Labu: Ok thx I am looking thiss daviid: Labu: I use its unit-test module for all my projects, so you can also look at some if you wish, and see how to integrate it with the autotool chain Labu: I am not very skilled with autotools. I must learn this daviid: Labu: you don't need the autotools to use guile-lib's unit-test, I just mentioned this in case you would be interested, but don't worry Labu: daviid: yes I know but I would like learn to use autotools, I meant Labu: Is it possible to iterate over a #:key arguments without name it explicitely Labu: ? Labu: I would use keyword argument as an association-list daviid: it is possible yes, you may look at this as an example http://git.savannah.gnu.org/cgit/grip.git/tree/grip/optargs.scm Labu: thx daviid daviid: Labu and here you'll find examples using unit-test, from guile-lib: http://git.savannah.gnu.org/cgit/grip.git/tree/test-suite Labu: thx too daviid: np! thomassgn: Hey guile! thomassgn: how come execlp (and probably execl) shuts down the guile interpreter/REPL when I run it? rain1: it replaces the current program (guile interpreter) with a new program rain1: what you may need to instead is fork then exec in the child thomassgn: ah, I see. I wrongly assumed 'Executes the file named by FILENAME as a new process image.' meant it would create a child, but it does ofc. say _new_... :-) thomassgn: looked up system and then found I need pipes to read the output of the program, it seems I can use open-pipe directly, reading info now... :-) thanks daviid: thomassgn: have a look at guile-lib's (os process) as well, you may find it usefull daviid: thomassgn: here http://www.nongnu.org/guile-lib/doc/ref/os.process/ thomassgn: hey, awesome! thanks daviid !! amirouche: since I removed the debug print statment from my program that does a dump of hn it's running amirouche: for 2 days already amirouche: I mean that it did not crash, but I don't what's it is doing amirouche: let's wait 1 week and see what happens amirouche: ^^' daviid: manumanumanu: did you know about guile-lib (os process)? I did no look at your code carefuly, neither do I know (os proces) 'in details', but always nice to avoid 'rewriting the wheel' ... brettgilio: Hi, all. chrislckaway: manumanumanu and taylan - thx for pointers, these look complicated daviid: chrislckaway: may be you wna to also have a look at guile-lib (os process)? daviid: chrislckaway: here: http://www.nongnu.org/guile-lib/doc/ref/os.process/ chrislck: thx daviid i was hoping for something inhouse; i'll check chrislck: my use-case is to (system "jenny 2 2 2 3") from http://burtleburtle.net/bob/math/jenny.html to generate unit-test cases and run comprehensive n-tuple tests daviid: chrislck: guile-lib is the 'ante quarto' of guile, it is 'almost' in house :) daviid: chrislck: I higly recommend you to use the guile-lib test-suite instead daviid: which integrates well/esily with the autotool chain, should that metter to you daviid: http://www.nongnu.org/guile-lib/doc/ref/unit-test/ chrislck: ah i'm using srfi-64 successfully chrislck: here's my sweat and tears: https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/standard-reports/test/test-transaction.scm daviid: chrislck: ah, this (system "jenny 2 2 2 3") scared me daviid: :) chrislck: nah jenny is public-domain and completely harmless; it creates useful short combinatorial permutations of options daviid: cool chrislck: Ok I think taylan's method with popen and textual-ports is the simplest daviid: chrislck: i think guile-lib (run "cmd" "parameters") is easier, and maintained ... but of course as you wish chrislck: the issue is I can install guile-lib locally but don't wish to force a scheme dependency onto travis-CI or other users. thx for pointing me towards this useful library chrislck: i guess it'd be (run-with-pipe "r" "jenny" "2 3 4") daviid: chrislck: i respect, though I don't understand why you can't have (force isn't the right word in this case imo) a dependency toward guile-lib for gnucash daviid: or any other guile lib(s) for that matter chrislck: there hasn't been a gnucash scheme maintainer for years... they're aiming to reduce nloc in scheme chrislck: it's too difficult for most hackers chrislck: the scheme code was written 15-20 years ago before srfi-1, slib and r6rs chrislck: imagine ... daviid: chrislck: sure, but you are now working it, and you should be able do the right thing, which is to use guile and well developed supported guile-libs, imo daviid: *working on it chrislck: :-o will see ! daviid: chrislck: so now you can use all these, and guile-lib, it will be better for all, not just for you, imo, anyone asking you to rewrite a wel written, well supported code 'is wrong', not helping you to clean the code and making it far easer to maintain, precisely what those complains about i the first place, ... to me, this is none sense daviid: but hey, do as you wish, again, and thanks for working on this as well by the way! chrislck: np manumanumanu: daviid: (or process) seems a bit lower level, but generally does the same. It is just convenience things built on open-process and port->list or port-fold. manumanumanu: (os process)* manumanumanu: I really think guile should deprecate most of (ice-9 popen) and just make open-process available as an import. manumanumanu: and provide some nice port operations instead, like port-fold or port->list daviid: manumanumanu: it seems to me that (os process) from guile-lib does what your paste does, and more ... if that is correct, theh I'd rather encourage users to use and rely upon guile-lib, which is (very) well written, documented, has a complete test-suite ... if that is not correct, we should enhance guile-lib ... manumanumanu: daviid: you are correct manumanumanu: I didn't say anyone shoud use my library, that was ArneBab's idea :D I just pasted it to show how I interface with open-process manumanumanu: which I think should be exposed by guile by default, since it covers most uses for executing external programs Thra11: Does the guile repl have any sort of config file so I can for example load readline support automatically every time I launch the repl? mwette: you can put something in your ~/.guile file [e.g., (use-modules (ice-9 readline)) (acivate-readline)] sneek: mwette, you have 3 messages. sneek: mwette, ArneBab says: for me wisp is a usecase for additional languages in Guile. It allows me to have the features of Scheme with better readability for newcomers. Essentially a thin shell over Scheme, were the basic syntax of Scheme cannot accomodate to something. sneek: mwette, ArneBab says: another use case for additional languages in Guile is to be able to reuse domain specific work people did in other languages. For example being able to parse org-mode documents with real org-mode and get them as data into Guile programs. sneek: mwette, ArneBab says: I’m using org-mode as example, because it is essentially specified by its source — and so complex that you can’t just go and re-implement it. At the same time it is already being used as data-interchange format in Emacs. Thra11: mwette: Thanks! daviid: anyone in ML? what do eople think of FANN? ArneBab: janneke: you have a client moving to Guile? Nice! ArneBab: sneek: later tell mwette: for me wisp is a usecase for additional languages in Guile. It allows me to have the features of Scheme with better readability for newcomers. Essentially a thin shell over Scheme, were the basic syntax of Scheme cannot accomodate to something. sneek: Got it. ArneBab: sneek: later tell mwette: another use case for additional languages in Guile is to be able to reuse domain specific work people did in other languages. For example being able to parse org-mode documents with real org-mode and get them as data into Guile programs. sneek: Got it. ArneBab: sneek: later tell mwette: I’m using org-mode as example, because it is essentially specified by its source — and so complex that you can’t just go and re-implement it. At the same time it is already being used as data-interchange format in Emacs. sneek: Will do. ngz: ArneBab: Its syntax is described in a separate document, though. ArneBab: ngz: oh, I did not know that. Thanks! Did anyone succeed in creating a full parser yet (that is not org-mode)? ngz: No, but it may be related to the fact that most people think it is only specified by its source :) ArneBab: :-) jeko: Hi Guilers ! jeko: Does someone know how to activate readline in my REPL (guile 2.2.4) ? With (use-modules (ice-9 readline)) I got no code for module (ice-9 readline) jeko: (guile installed with Guix) janneke: jeko: guix package -i guile-readline janneke: or somesuch, it's been split-out from the guile package in guix jeko: janneke: alright ! thank you brettgilio: That feeling when you've been lisping so hard lately, that you accidentally start replacing periods at the ends of sentences with closing parentheses. atw: brettgilio ☺ have you tried structural editing? sneek: Welcome back atw, you have 1 message. sneek: atw, ArneBab says: you’re right. I hope we can tackle that better and better with time. It feels like there are barriers to entry which prevent reaching the documentation which works pretty well — even offline. brettgilio: atw, Paredit ;) atw: I use it and love it! I don't type a lot of close-parens because I usually do C-M-n or some other navigation brettgilio: atw, I don't need to type them, they are automatically placed by my autosyntax, but for whatever reason I still end up typing them. brettgilio: lol brettgilio: unless there are several in a row hiphish: Hello everyone hiphish: I have a string with an escaped colon, e.g. "foo\\:bar", where the "\\" is the actual character. hiphish: What it the best way to replace the sequence "\\:" in a string with "\\"? It would be find if the string was mutated. hiphish: Sorry, meant to replace "\\:" with ":", i.e. "foo\\:bar" becomes "foo:bar" manumanumanu: hiphish: if you can stand it being slowish, combining string-tokenize and string-join manumanumanu: or wait... string-tokenize will also split :\\ manumanumanu: hiphish: or if you just want to remove all backslashes in the string, you can use string filter manumanumanu: (string-filter #\\\\ "hej\\:hopp") manumanumanu: jesus christ, I can't end being wrong today: you want string-delete manumanumanu: (string-delete #\\\\ "hej\\\\:hopp") => "hej:hopp" hiphish: manumanumanu: But that will delete *all* backslashes, even those that are intentionally in the string. hiphish: Perhaps I should be more specific: I want to parse Unix path envrinment variables, like the format $PATH uses. hiphish: I have a PEG grammar which can split the string on unescaped colons: "asdf:qw\\:er" becomes "asdf" and "qw\\:er". hiphish: What I kneed is to also be able to unescape the escaped characters in the individual paths. hiphish: hiphish: I got it, the pattern is (and (ignore "\\\\") ":"), this matches escaped colons, but only returns the colon itself. hiphish: quite mwette: ACTION is looking into nyacc/javascript interpreter 2.0 => 2.2 issues: begin is now seq ; apply is now call ; apply+primitive is now prim-call chrislck: apologies can't reply back, please ping me - (define x (system "ls")) will make x=0 (the exit-code). anyone knows of way to intercept the "ls" output into a string? I can do (system "ls > /tmp/ls.txt") (call-with-input-file "/tmp/ls.txt") which is ugly... chrislck: ACTION chrislckaway manumanumanu: chrislckaway: I do this: https://pastebin.com/gJWwYRU7 manumanumanu: this uses the internal open-process from ice-9 popen. It returns three ports, in out and err. That way you can close input and output ports one at a time manumanumanu: chrislckaway: look at run/str, not run/lines (which requires my port->list) taylan: simplest way to get stdout as a string: taylan: (use-modules (ice-9 popen) (ice-9 textual-ports)) taylan: (get-string-all (open-input-pipe "ls")) manumanumanu: taylan: that is however limited, since there is no way for you to close the output port without closing the output port, which is sometimes required when dealing with shell utilities manumanumanu: I don't know why open-process isn't exposed, since it strictly more powerful than popen ArneBab: manumanumanu: your tools look like they would be great additions to ice-9 popen. manumanumanu: port->list is useful, but I have thought about that. You can make it even more general: port-fold manumanumanu: oh, you mean run/str and those... manumanumanu: I think general procedures for ports should be available at least manumanumanu: port-fold, port->list manumanumanu: Good night! brettgilio: Hi, all. mwette: greetings zv: sneek: what is inject zv: sneek: what is python lavaflow: I made a thing in guile: https://gitlab.com/jgreco/zipweb/blob/master/zipweb.scm lavaflow: webserver that serves straight out of a zip file, in under 100 loc mwette: lavaflow: clean -- that's nice lavaflow: thanks, I'm pretty pleased with how straight forward it was amz3: OrangeShark: hi amz3: OrangeShark: congrats for the release of guile-git amz3: OrangeShark: why a release? amz3: I will make a mail to the mailling list amz3: let's try to put together a paper for scheme 2018 amz3: actually, the experience report _limit_ is 14 pages but there is no minimum apparently OrangeShark: hello amz3. I was asked by civodul to make a release. We have enough working that it makes sense to at least to an initial release. civodul: "asked" is a bit of a strong word civodul: i'd say i merely suggested it ;-) OrangeShark: sorry :P civodul: heh :-) civodul: hey there!   civodul: https://www.gnu.org/software/guix/blog/2018/gnu-guix-and-guixsd-0.15.0-released/ manumanumanu: Wohoo! manumanumanu: civodul: congrats OrangeShark: ooo, faster guix pull and it has rollbacks dsmith-work: Happy Friday, Guilers!! mwette: dsmith-work: same to you manumanumanu: mwette: you should have a look at when Rich Hickey introduced transducers to the clojure crowd. I think it is probably the best overview manumanumanu: How efficien is keyword argument handling in guile? manumanumanu: optional arguments should be fast (at least if case-lambda is fast), but... keyword args... I'm curious! rekado: Sometimes I daydream about extending Guile to support the R language. civodul: is "dream" the right term though? rekado: a nightmare is also a kind of dream civodul: true :-) rekado: another common approach that appears to be popular is to embed R and tape over the differences and to shuffle data back and forth. rekado: this seems to be what rpy2 does. rekado: it allows people to use R features from within Python. civodul: yes and Jupyter's Xeus does that with R, Julia, and Python civodul: so you can pass matrices around those 3 mwette: nyacc has a partial parser for MATLAB OrangeShark: happy friday civodul: happy Friday! civodul: mwette: that sounds fun! civodul: we could "dream" of an M language front-end for the compiler OrangeShark: I've been wanting to try to write a language for guile mwette: manumanumanu: look at ,compile (lambda* (a #:key (b 2) (c 3)) (+ a b c)) vs (lambda* (a #:optional (b 2) (c 3)) (+ a b c)) mwette: check nyacc/examples/nyacc/lang/matlab,javascript,... the javascript has a compiler using tree-il. some simple examples should work rekado: people have many complaints about R as a language and about the implementation. What keeps many people from moving to other languages is CRAN and Bioconductor. mwette: gotta go for appt ... rekado: I was wondering if it would be feasible to use this opportunity to introduce the long prophesied Lispy language for bioinformatics and statistics. dsmith-work: Speaking of javascript, how broken is the current ecmascript support in guile? civodul: rekado: that'd be a decade-long effort i suppose hugo: Is there a way to set the current module from a file sourced? hugo: I have tried (set-current-module (resolve-module '(gamesh))) hugo: But nothing happens from the file, in the repl it works mwette: hugo: can you be more explicit? This works: http://paste.debian.net/1032616/ mwette: What is the use-case for supporting other languages in Guile? integration w/ scheme, fast interpreter, new language development? OrangeShark: mwette: I think the original idea was by rms, some people prefer an imperative language for things mwette: OrangeShark: But why use JS in Guile when node.js is freely available? And so for R, Octave, Lua, etc. OrangeShark: you can embed Guile into a program and then extend it with various languages janneke: mwette: not sure, but node.js almost implicitly means npm, which means: unmaintainable bootstrapping nightmare davexunit: mwette: have you seen how Racket allows a bunch of languages? it's a really powerful thing. davexunit: Typed Racket, etc. janneke: my client jumped on the nmp/node bandwagon and has a pretty difficult road to move away from that, towards Guile mwette: OrangeShark: Got it. Have seen some programs use scheme for extension and then python gets added eventually janneke: so the biggest reason may be in culture/philosophy rather than technical davexunit: I don't think we'll have a really capable javascript implementation. world moves too fast. OrangeShark: mwette: what davexunit says about racket is also a good point davexunit: I think the multi-language feature is interesting for other reasons than implementing more mainstream languages. davexunit: I always point to guile-xcb as an example of this. davexunit: it provides an interface to the X server by compiling an XML spec into Scheme code which is then compiled into Guile bytecode. dsmith-work: Ah that's cool. OrangeShark: mwette: davexunit: here is an article they wrote about racket recently https://cacm.acm.org/magazines/2018/3/225475-a-programmable-programming-language/fulltext hugo: mwette: I want the repl I boot into to be in a different module that guile-user hugo: the current-module gets set in my file, but it goes back to guile-user once I get into the repl mwette: hugo: Are you using load? If so, did you try using include? mwette: OrangeShark: thanks for the reference : reading it mwette: By the way, nyacc provides parser generator, lex builder. I started working on javascript but my skills with tree-il generation need honing. hugo: mwette: use-module hugo: https://github.com/HugoNikanor/GuileGamesh/blob/camera/scheme/main.scm hugo: Here is my main, which is "load"-ed from a C file. mwette: Using `(include "/path/to/main.scm")' will work I think. Another option to try is to provide a procedure that calls set-current-module. mwette: scheme@(guile-user)> (load "yyy.scm") mwette: $2 = # mwette: scheme@(guile-user)> (include "/tmp/yyy.scm") mwette: $3 = # mwette: scheme@(htmlprag)> mwette: back to making guile multi-lingual ... mwette: I get providing support for embedded domain specific languages (eDSL). But these are typically "small, simple" and not things like javascript, lua mwette: maybe a contribution is to provide tools for users to generate domain specific languages. That is, for users who don't want to use scheme macros. mwette: I create a lot of domain-specific languages in Guile. The language spec starts with `define-syntax'. mwette: So maybe a mini-MATLAB would be good candidate for this. I think Guile still needs a method to associate files with languages, like `#lang' used by Racket. daviid: mwette: octave? OrangeShark: mwette: why not extensions like .scm? OrangeShark: .wisp OrangeShark: .js mwette: OrangeShark: extensions are fine by me, but Guile does not yet support them; I believe there is a debbugs on that mwette: davidd: octave is GNU MATLAB https://www.gnu.org/software/octave ; very popular mwette: many, if not most, engineers coming from universities have learned only MATLAB daviid: mwette: t's been decades I'm fighting universities teaching student to ue non free s/w, in particular matlab daviid: teaching a student to use non free s/w is, imo, a crime daviid: it's like you give them drugs, then they become dependent, and can't live witout it anymore ... I've seen this all my carrer ... then they reproduce this lack of responsability in other domain, sart to use fb, insta, twitter .. and participate to the ttal destrution of the fundamental principles of our deocracy daviid: and then the world cries, democracies are under threat, because of non free s/w and banks ... terrible daviid: someone wrote a book (or a skeleton for a book I d'ont remember) about Guile Scheme is btter then R (or something like that...) but I can't find the link anymore, anyone has it? OrangeShark: daviid: oh I recall seeing that book. daviid: OrangeShark: I was trying to find the link to paste for rekado OrangeShark: I can't seem to find it either daviid: I'm not very good at ducduckgoing, so far I can't find it either (I thought I bookmarked it, but ...) OrangeShark: found it https://panicz.github.io/pamphlet/ daviid: OrangeShark: oh, super! rekado ^^ OrangeShark: think I will gather a list of the various books I have seen of Guile dsmith-work: ISTR that the octave maintainer/developer was asking about embedded guile in octave. Did that ever happen? OrangeShark: ACTION found a mailing list thread talking about guile's history OrangeShark: down I go daviid: dsmith-work: in the early days, rms asked for octave be written in guile proper dsmith-work: https://lists.gnu.org/archive/html/guile-user/2000-09/msg00071.html daviid: it has been a terrible mistake that they choose C++ instead daviid: but ... voilà! mwette: dsmith-work: Thanks. Interesting read from Sep 2000. Python now has scipy and numpy which provide a lot of numerical hooks. STSCI used that stuff primarily (for processing Hubble images) mwette: Octave might still gain something from Guile, because Guile has an optimizing compiler. Core Octave is written primarily in C++ so I don't know how well an integration would work, depending on how much C++ exception handling is used. daviid: mwette: one has to write a C wrapper, a la vigra_c, or open-cv-c (2.x only, it's unfortunately been abandonned, no open-cv-c for 3.x), which is ... boring and time consuming daviid: so many libs are written in C++, that it might be interesting one of us work on a general approach, I wonder if it is pssible though OrangeShark: someone wrote guile bindings in C++ OrangeShark: daviid: https://github.com/arximboldi/schmutz mwette: I have written FFI generator for C; but C++ is so much harder. daviid: OrangeShark: tx, but i think it requires to write C++ code before to FFI it ... then I prefer the vigra_c approach daviid: mwette: that's what I keep hearing ... I guess otherwise we'd habe a C++ ffi already dsmith-work: The exception handling of C++ and the continuations of Guile would be very tricky to integrate. daviid: what do you think about schmutz? daviid: OrangeShark mwette dsmith-work ... ^^ dsmith-work: Never heard of it. rekado: ACTION likes the name dsmith-work: Ah! dsmith-work: ACTION sees the link above mwette: schmutz still required hand coding all the interface code, and not sure how it handles weird stuff like references. Some how you need to manage the boxing in Scheme. dsmith-work: Interesting! daviid: mwette: ok, do you think it's s tep in the right direction though? or would you use a totally diff approach? mwette: I don't know C++ and schmutz well enough to know how well it will work. I think in the long run a C++ header parser and auto-coder is the best chance, because hand writing the API code is labor intensive. dsmith-work: Looks kind of like the Guile snarf interface. ison[m]: stis: Oh thanks, that'll actually work nicely amz3: haha amz3: my program works amz3: everything seems easy in guile compared to chez amz3: https://github.com/a-guile-mind/Culturia/commit/949960ff2b11b28851fb1197df9024c6304bb69c amz3: I still need 17 444 000 stories to download, good continuation all, I may be back If I can't sleep amz3: I am working on https://amirouche.github.io/zombie/ amz3: the bad news is that my program crashed after 1h amz3: here is the program https://github.com/a-guile-mind/Culturia/blob/master/src/hn-step00-dump-hn-api.scm amz3: I succeed in the past to make it work but going through 'curl' command amz3: I sent a mail to devel with info about the crash amz3: bummer amz3: ison[m]: fwiw; I use (write value port) to serialize stuff amz3: ison[m]: mind the fact that it's not safe to `read' untrusted code amz3: ison[m]: like pickle amz3: sneek: what is culturia? sneek: Someone once said culturia is a re-search project amz3: sneek: what is culturia? sneek: Its been said that culturia is re-search project amz3: ison[m]: here is safe read procedure https://github.com/amirouche/zehefyu93/blob/master/guile/neon/read.scm amz3: ison[m]: but it doens't support everything builtin 'read' support amz3: IIRC it doesn't support exact numbers amz3: ison[m]: I mean to say 'safer' read procedure chrislck: sneek: what is guile sneek: Last time I checked Guile is a friendly, quiet, and somewhat despised Scheme implementation. chrislck: sneek: what is java sneek: Its been said that Java is unintuitive, inflexible, slow, useless, commercial and successful chrislck: lol dsmith-work: sneek: botsnack sneek: :) dsmith-work: Good bot dsmith-work: Thursday Greetings, Guilers OrangeShark: thursday greetings OrangeShark: happy day before friday civodul: heheh, howdy dsmith-work, OrangeShark, and all! wingo: greets :) dsmith-work: wingo: What compiler are you using for master? wingo: dsmith-work: gcc 7.2 wingo: you? wingo: i haven't looked into your crash yet wingo: is it a crash or an abort() ? i guess you cleared out your .go files dsmith-work: It's a segfault. dsmith-work: gcc 6.3.0 and also 4.8.4 and 4.9.2 amz3: manumanumanu: what did you complete? manumanumanu: amz3: my for loops. I lack one feature compared to racket's for loops (post guards), but I haven't understood what they can be used for except for a little more elegant in-value. The macro expansion has gotten a lot faster as well, so now they add very little overhead. manumanumanu: next project is to clean up my transducers for guile and make a r7rs library for it and write a draft srfi. manumanumanu: the transducers aren't faster for guile than chaining map,filter etc, but is a lot more memory efficient. This will probably become faster as guile becomes faster. In chez they are a lot faster than regular map/filter/take-while etc chaining manumanumanu: amz3: and the code they generate is as fast as hand-rolled loops. manumanumanu: so now I'll try to roll a guile package. manumanumanu: guix* rekado_: manumanumanu: let us know on #guix if you need any help to write a package definition rekado_: civodul: you may want to change the topic of this channel, which still mentions the release announcement of Guile 2.2.3. lloda: I like srfi-71 +1 civodul: rekado_: right civodul: lloda: me too! wingo: i guess srfi-71 would prevent excess value truncation wingo: for better or for worse civodul: that's already the case with srfi-11 or anything that explicitly uses call-with-values with a fixed-arity procedure, no? wingo: correct -- truncating continuations are those continuations not established by call-with-values lloda: is the compiler able to truncate anyway if you do (values a b . _) and don't use _ afterwards? civodul: lloda: i truncates on the receiving side civodul: *it wingo: lloda: but it does truncate without allocating a list for _ civodul: i'm looking at https://bugs.gnu.org/31925 civodul: wingo: upon fork, it seems the child can end up in a state where the alloc lock is taken civodul: so it looks like we should call fork() with the alloc lock taken civodul: thoughts? amz3: manumanumanu: \\o/ nice to see more projects advancing manumanumanu: amz3: I'm very happy about the for loops and about that arthur asked me to turn the transducers into a srfi :D amz3: arthur? what's his nickname on freenode? manumanumanu: no idea. Arthur Gleckler, the current srfi guy amz3: manumanumanu: sound good to me amz3: manumanumanu: well, the issue I have with scheme, say compared to javascript noosphere, is that scheme builds up like cathedral whereas javascript is full bazaar going in every direction amz3: s/scheme/srfi/ amz3: I had in mind to make srfi for a database abstraction I am working on based on latest microkanren manumanumanu: I think both things are happening. the srfi process is just a collection of good ideas in one place that become replaceable standards amz3: I don't say it's not a good thing at all :) amz3: compared to the mess that javascript is, srfi are a very good entreprise amz3: btw latest microkanren is available at https://github.com/TheReasonedSchemer2ndEd/CodeFromTheReasonedSchemer2ndEd manumanumanu: The ideas are mostly well-chosen primitives that can be used to build higher abstractions amz3: like transducers :) manumanumanu: well, yes. They are, in a way, a generalisation of parts of srfi-1 manumanumanu: (but also not at all because they don't build the same way and have other limitations) manumanumanu: which is why they are a good idea. The compose, which srfi-1-things don't, which is why it has append-map and filter-map manumanumanu: they* amz3: well, it seems to me one feature that is helpful in the situation of filter + map code is srfi 26 'cut' amz3: even if, I kind of lazy and avoid it because it requires another import manumanumanu: that still does't solve the composability issue, of course. map and filter each builds intermediate collections amz3: transducers don't? manumanumanu: no :D amz3: sorry I am clue less about transducers amz3: oh interesting manumanumanu: they are really cool amz3: please send a mail to mailing list, you already did? I never noticed one manumanumanu: amz3: I am remaking them a bit first amz3: never midn, release early release often ;) manumanumanu: but the idea is that: (transduce (compose (map 1+) (filter odd?) (take 10000)) conj list) does't build intermediate collections, it adds one filters od numbers and takes the first 10000, without building any intermediate lists amz3: I am interested because of my project obviously which rely on hand rolled stream implementation + composition amz3: exactly what does traversi stuff manumanumanu: only the last step is actually aware of what it is building. You can use the same transducer on vectors/streams or in just about any kind of sequential process manumanumanu: in guile using transducers is only slightly faster than doing it the regular way, but much more memory efficient. If guile3.0 actually has a jit, it will definitely be faster, since it benefits from inline caches (i believe) amz3: the thing is that I build up the input 'stream' of things directly from database cursor prev/next manumanumanu: as I said, any computation where you have a bunch of seps manumanumanu: in clojure you can use them in their channels. You create a chan (chan [transducer]) where the transducer is applied to every thing passing through amz3: here is the implementation of cursor->stream amz3: https://github.com/amirouche/zehefyu93/blob/master/guile/neon/wiredtiger.scm#L437 amz3: where is your code? amz3: does it memoize the value given by a single step "automagically"? amz3: if I do '(transduce (take 10) some-transducer)' amz3: and redo amz3: and redo later '(transduce (take 10) some-transducer)' amz3: it will it give me the same results all the time or not? manumanumanu: no. take is stateful amz3: oh amz3: traversi is the same, that why I work around it with cursor-return and cursor-move from the above link amz3: which slow down a bit the traversal of the table prefix manumanumanu: the thing is, it is only stateful for each started transduction; say you have transducer a (compose (map 1+) (take 10)). every time you invoke the transducer, the state of take is reset, so it takes new 10s every time. If the collection it transduces _from_ is at the same place as before, it will start from the same place manumanumanu: this is the no-updated branch: https://bitbucket.org/bjoli/scheme-transducers/src/default/ manumanumanu: I have decided to make some non-compatible changes manumanumanu: there is no documentation yet, but look at the linked videos. amz3: the thing is that avoid things like (iota 1000000) in my code amz3: my seed is a generator or some sort amz3: to avoid to load things fully in memory manumanumanu: it was just an example. it doesn't matter what the source for the transducer is. transducers are oblivious of their source collectio manumanumanu: n manumanumanu: it can just as well be a generator manumanumanu: or a port or whatever amz3: cool mwette: amz3: I though ReasonedSchemer was miniKanran, and microKanran is smaller. Look for a paper by Hemann and Friedman on uKanran. mwette: amz3: sorry, Kanren, not Kanran amz3: not sure, i did not read the latest source code amz3: I read minikanren amz3: and what's is packaged in guile-wiredtiger as microkanren is smaller that what is called minikanren mwette: So you are using microKanren. Neat. Is that working out OK? I did copy the source from the paper. and pasted here: http://paste.debian.net/1032105/. I didn't know it was available anywhere else. mwette: ah, here it is: https://github.com/jasonhemann/microKanren mwette: I have been reading The Reasoned Schemer. amz3: mwette: yes, but the reasoned schemer first edition use minikanren amz3: mwette: the second edition use apparantly, the one I posted earlier, but I did not read the second edition yet amz3: mwette: I know almost the whole implementation by hearth of ukanren, except bind and mplus which I don't understand what they do, it seems to me they allow the interleaving of the search of the solution space but I'am not sure amz3: mwette: yes microkanren works, FWIW, I looked hard to find a better way to query my relational data, i did not find something as neat amz3: I did no benchmark yet, so that's the next step benchmark the two solutions I have amz3: but from readability point of view, if you know minikanren / microkanren, it's easier to query recursive structure using microkanren amz3: and for querying flat structure the overhead (in terms of syntax) is very minimal amz3: I may find an example of querying a flat structure somewhere amz3: here is an example query https://github.com/a-guile-mind/presence/blob/887e5bf6df511ad719ee93ee5da2368ebd343131/src/web.scm#L891-L894 amz3: the whole file has microkanren queries, look for fs:queryo amz3: mind the fact that Dan Friedman use another syntax for 'out' parameters, he use ^ as a suffix of the variable name that is the output value amz3: I use ? instead amz3: and I use ?? for intermediate aka. fresh variables amz3: ie. variables that don't escape the microkanren computation mwette: mplus is defined in the paper: "The mplus operator is responsible for merging streams. In a goal constructed from disj , the resulting stream contains the states that result from success of either of the two goals. mplus simply appends the list returned as the result of the rst call to that returned as the result of the second. In this form it is simply an implementation of append" amz3: mwette: where do you read that paper? I looked up the web, I did not find anything, is it available on the openweb? mwette: amz3: http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf amz3: tx amz3: something interesting the microkanren enthusiate might be the implementation of the fs:queryo procedure, it's done here https://github.com/a-guile-mind/presence/blob/master/src/wiredtiger/feature-space.scm#L107 amz3: in zehefyu93 (formely neon) I will remove the problem that 'a' can not be a variable amz3: basically i zehefyu93 everything can be a variable stis: there is also: https://gitlab.com/tampe/attributed-minikanren , swip prologs attributes in minikanren stis: sorry microkanren stis: project name is missleading manumanumanu: good evening stis! stis: heya guilers! amz3: heya stis amz3: well, I had an hard wrapping my around minikanren/microkanren now I don't remember how I achieved that amz3: getting into attributed is way out of my league amz3: getting into attributed _mk_ is way out of my league stis: everything that is needed is time and a bottle of bear and good company and you'll manage attributed variables like your own pocket :-) amz3: :) amz3: maybe manumanumanu: I never really grokked the kanren parts. I think I would be more successful trying some other logic programming thing first, and then try to understand kanre through that stis: actually to really understand how the search is done in microkanren is quite difficult ison[m]: Sorry for the really basic question, but is there any way to sort of save a list containing arbitrary types to a file and the reload it later? Sort of like "pickle" in python stis: serilizing lambdas are tricky and not suported without using c code. continuations is really really hard to serialize and I never mangaed to do that for guile 2.2 stis: so no pickle support for guile. For a list of atoms you may try e.g stis: (with-input-from-string (format #f "~S" '(1 (1 2) #(1 a 2 "c"))) read) stis: $10 = (1 (1 2) #(1 a 2 "c")) stis: note read is unsafe, so commonly a direct reader writer is custom made using for example json as a serializing format stis: structs are tricky and does not work with the reader method. But you have conses and vectors as possible containers mwette: manumanumanu: your transformers sound useful; seems to have the flavor of (sxml xpath) rekado: fold applies a function of two arguments (the current value and an accumulator) and applies it to a list, starting with a seed. apteryx`: rekado: sounds excactly like what I need. Thanks! apteryx`: not really sure where to insert my fold when using it with call-with-input-file though. apteryx`: cons seems simpler here apteryx`: if someone sees otherwise please let me know :) apteryx`: what is wrong with this regex (ice-9 regex): (make-regexp "ISO 8879.*(\\"iso-.*\\.gml\\")") apteryx`: oh, the literal dot needs a double escape like \\\\. it seems apteryx`: not sure why apteryx`: to use fold with call-with-input-file, I find I'd like my file lines to appear as a stream that I can feed to fold... is there already something I can use for this? lavaflow: I'm not sure if I'm doing something wrong, but it seems like (web server) doesn't work with handlers that return a procedure for the body that write bytes (not text) to the output port. lavaflow: if I write text to the output port, then it works. otherwise I get locale stuff: Throw to key `decoding-error' with args `("scm_from_stringn" "input locale conversion error" 92 #vu8(137 lavaflow: maybe I'm doing something wrong, maybe it's because I don't have content-type set correctly? but if I set it to image/png (which is correct in this case) it still doesn't work. lavaflow: it looks like sanitize-response calls call-with-encoded-output-string... maybe I should set the charset to ISO-8859-1? lavaflow: yeah this seems to work. manumanumanu: So, regarding pattern matching again: is there any way to match the car and cdr of a list that is as fast as just using car and cdr? (a as ...) is pretty slow wingo: match should be just as fast fwiw wingo: either ice-9 match or pmatch manumanumanu: wingo: nah... x xs ... is slow, x . xs is fast manumanumanu: I RTFM and tried it manumanumanu: where (x xs ...) on a big list is slow and x . xs is fast and produces the same result for my use case manumanumanu: (x . xs) manumanumanu: (x . xs) is just as fast as my old cond-based approach using car and cdr civodul: right, ellipses mean 'list?', which is O(n) civodul: but (x . xs) is just as fast as car/cdr manumanumanu: i guessed as much :) civodul: when in doubt you can try ",optimize" at the REPL manumanumanu: I am planning on doing a deep dive into ice-9 match and maybe try to add =? which is a mix of ? and = so that one can bind the result of a predicate manumanumanu: and maybe even try to add a regexp matcher manumanumanu: and pray that my patch is accepted :) manumanumanu: civodul: I was pretty flabbergasted when I looked at the ,opt output of match. it really produces fast code! civodul: esp. if you try: ,opt (match '(x . y) ((x . _) x)) civodul: :-) manumanumanu: doing (= pred? (and (not #f) identifier)) isn't really optimal... manumanumanu: wait... is list? O(n)???? rekado_: manumanumanu: I’d think it must be because the last item determines if it is a real list. rekado_: manumanumanu: it’s not a list if it’s just a bunch of conses or a circular list. manumanumanu: jesus I didn't know that wingo: hehe on the bright side, you could see a lot of speedups now in your code :) manumanumanu: I thougt it was just like pair but with #t for '() manumanumanu: oh man wingo: no a list is either '() or a pair with a list in the cdr manumanumanu: which is a recursive definition manumanumanu: I see that now manumanumanu: I have been blind lavaflow: wait, is list? actually O(n) in practice in guile? I think racket optimizes that to constant time somehow so I assumed guile did too lavaflow: mutable cons cells prevent that maybe? wingo: mutable cons cells prevent (list? x) from implying (list? x) at some point in the future wingo: because intervening mutations can invalidate the predicate wingo: but, afaiu racket does not optimize list? to constant time. wingo: corrections are welcome of course :) lavaflow: I could be wrong about that, somebody told me racket does a while ago and I never really questioned it. lavaflow: ah here we go, racket documentation claims about list? "This procedure effectively takes constant time due to internal caching (so that any necessary traversals of pairs can in principle count as an extra cost of allocating the pairs)." wingo: neat wingo: so i guess when they do an immutable cons, they propagate a list? bit from the cdr wingo: neat hack wingo: tx for the tip :) civodul: wingo: sounds nice, we should do something like this :-) OrangeShark: hello everyone dsmith-work: Hey Hi Howdy, Guilers rain1: generous with the greetings today civodul: hey hey! dsmith-work: civodul: Contrats on the new release! civodul: thanks :-) janneke: Congrats on the release, and thanks! roelj: Is there an equivalent to canonicalize-path that returns the absolute path for a possibly non-existent directory? janneke: roelj: what if the possibly-non-exintent directory would be a symlink? janneke: you probably have to remove elements until you hit upon an existing prefix and add from there roelj: Well, being a symlink is OK. I just need the absolute path. roelj: So, maybe I can combine it with 'dirname'. roelj: Hmm, is there something to write a path separator (so that it works portably)? janneke: use parse-path? roelj: Oh, I see: file-name-separator-string. Labu: Hello all manumanumanu: are symbols always eq? even 'symbol (from compile time) and 'symbol (from runtime) manumanumanu: yes manumanumanu: Labu: hello Labu: Hi manumanumanu I don't know but I expect that are eq? manumanumanu: wingo: racket's way of doing it is nice until you want circular lists, for which you then need to either do some lazy mumbo jumbo or rely on in-cycle for their for-loops stis: yes, but I guess that object-address is different from runtime to runtime so e.g. eq vhashes of symbols can't be serialized directly stis: manumanumanu: nonmutable cons means no circular lists if all elements is of such type manumanumanu: I was just afraid there might be som differences between interned and uninterned symbols manumanumanu: or that there might become a mismatched manumanumanu: -ed manumanumanu: stis: btw! I looked into ice-9 match. It should be trivial to extend it with user-specified matches manumanumanu: the magic is in match-two, which currently matched against syntax-rules literals stis: yes the nontrivial part is to get it included in upstream. manumanumanu: :D stis: you should discuss this with foof in #scheme, his the maintainer of upstream match manumanumanu: I don't believe ashinn is human. He is a code-producing alien that writes libraries made for just me stis: :) manumanumanu: It won't be included upstream, because that change would be intrusive to the portable syntax-rules only approach stis: yes that's why I like the racket matcher, although practically ice-9 match is good enough manumanumanu: but a =? might be ok stis: probably not it can brake existing code stis: where a car is match with a var called =? stis: In the reacket matcher you define a matcher like a sexp (matcher-name args ...) stis: where you can define your own matcher-name and export those symbols e.g. you would be safe is somone else defined a different matcher =? stis: so (list (list 1 2) 3 4) matches '((1 2) 3 4) manumanumanu: i should fork then stis: it's a bit more verbose but allows arbritrary extensions manumanumanu: and become upstream manumanumanu: :D stis: heh yes I do that for a living and have I think 2 differnent version of the matcher stis: I use that to match prolog constructs with the same semantics som ice-9 match manumanumanu: stis: oh another btw: my for loops are done :) Apart from post-guards, they are feature complete. I am just going to write a lot of tests and then make a serious release manumanumanu: and package for guix and stuff :) manumanumanu: If I manage to speed up the macro expansion I'm going to give post guards another jab, but as it is right now, I doubt I can add them and still stay below 0.2s for complex loop expansion manumanumanu: (which was my goal for this 6 year old computer) stis: manumanumanu: coolio!! stis: night folks!! manumanumanu: nighty manumanumanu: So: profilig macro expansion... any tricks? rain1: you are finding macro expansion slow? how have you implemented the macro? manumanumanu: rain1: oh... I just tested agaist what the macro expands to. The expansion overhead is almost none. manumanumanu: sorry about that. manumanumanu: I just thought that the macros were complex, but apparently that was just a minuscle part of it. most of the time is spent o other things ArneBab: amz3: webdev is crufty nowadays, that’s my feeling, too. But it has this "just send someone a link to try" going for it … ArneBab: manumanumanu: nice! congrats on feature completion! amz3: ArneBab: hi! amz3: ArneBab: how are you doing? amz3: ArneBab: tx for the reply, I will _maybe_ look at it, not sure because I pondering the idea of abandonning webdev brettgilio: Will somebody seeing this ping me? Checking my elisp code for notifications. thx amz3: brettgilio: pong brettgilio: amz3: Thx, unfortunately it works but not as intended. brettgilio: (defun call-libnotify (matched-type nick msg) brettgilio: (let* ( brettgilio: (cmsg (split-string (clear-string msg))) brettgilio: (nick (first (split-string nick "!"))) brettgilio: (msg (mapconcat 'identity (rest cmsg) " "))) brettgilio: (shell-command-to-string brettgilio: (format "notify-send -u critical '%s says:' '%s'" nick msg)))) brettgilio: Oh shoot, my bad. I did't think it'd send as 10 messages. amz3: brettgilio: it looks like scheme code brettgilio: amz3: will you ping me again? brettgilio: I fixed my buggy code. brettgilio: Hey all, who here regularly embeds scheme with guile into their C/C++ projects? civodul: hey! civodul: brettgilio: i suppose many people extend Guile, rather than embedding it into C app civodul: to volatile or not to volatile, thoughts wingo? civodul: i was thinking maybe this: civodul: * (union scm_vm_stack_element *volatile) vp->fp = new_fp; brettgilio: civodul: Indeed, my reason for asking is that I'm planning on rewriting a C++ application of mine's logic into Guile Scheme, but keep the front-end in C++/Qt, a clean and distinct separation of logic from the "MVC". That way to not complicate my work by having to wrap too much C++ into Guile. brettgilio: And was wondering if anybody had any experience with such embedding. brettgilio: Because i've never used Guile as an embedded lisp, but I've read that it is really good for such. civodul: brettgilio: yes, overall it makes embedding quite easy civodul: with C++ it may be slightly more complicated civodul: in particular with exceptions civodul: IIRC OpenCog is in C++ and embeds Guile civodul: LilyPond is in C++ too, but they had troubles switching to Guile 2 wingo: civodul: what precisely does accessing via a volatile pointer mean? wingo: my understanding is that C leaves volatile somewhat underdefined wingo: but that most compilers force that volatile to be a memory access wingo: but, we mostly just want the barrier effects, right? specifically the compiler barriers civodul: yes civodul: i think i'll just leave it out for 2.2.4 wingo: sgtm wingo: yeah i don't know what kinds of barriers a volatile access implies civodul: it does not imply a memory barrier like the 'lock' instruction prefix on x86_64 wingo: there are many kinds of memory barriers :) wingo: https://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html civodul: yeah civodul: what i mean is that it's really a compiler barrier wingo: between other volatile accesses or also other accesses? wingo: b/c there are other non-volatile assignments to the stack that probably shouldn't be reordered either, by the compiler, in code that also assigns ->sp and ->fp civodul: yeah civodul: AIUI, it's just that loads and stores to volatile references cannot be reordered by the compiler brettgilio: Goodnight, friends. brettgilio: Thanks for your help civodul . wingo: night brettgilio :) wingo: civodul: i think we would want a stronger compiler barrier -- between sp/fp writes and any other write to the stack civodul: how stronger? :-) wingo: specifically that the barrier should also prevent a compiler from moving a non-volatile write to the stack across an assignment to sp or fp wingo: your inline assembly barrier did the job nicely i think civodul: i think so, but it has the disadvantage of being GCC-specific (or almost GCC-specific) wingo: civodul: i think we can do what bdw-gc does wingo: #if defined(__GNUC__) && !defined(__INTEL_COMPILER) wingo: # define GC_reachable_here(ptr) \\ wingo: __asm__ __volatile__(" " : : "X"(ptr) : "memory") wingo: #else wingo: GC_API void GC_CALL GC_noop1(GC_word); wingo: # define GC_reachable_here(ptr) GC_noop1((GC_word)(ptr)) wingo: #endif wingo: i.e. the fall-back case can be to call out to a function whose memory effects are unknown civodul: wingo: oh right, sounds like a good plan civodul: Guile 2.2.4 is out! civodul: https://www.gnu.org/software/guile/news/gnu-guile-224-released.html wingo: woo hoo!!!!!! civodul: pretty cool to get that done :-) wingo: congrats :) wingo: lightning seems to increase libguile size by 1 MB (to 6.17 MB from 5.17 MB) wingo: on x86-64 anyway civodul: it's statically-linked? wingo: yes, built into libguile wingo: actually let me push a branch civodul: that's with debugging symbols no? civodul: sounds really exciting :-) wingo: see "lightning" branch in git wingo: yes with debugging symbols etc wingo: heh it is mostly autotoolery at this point :P wingo: https://git.savannah.gnu.org/cgit/guile.git/log/?h=lightning wingo: note, i haven't actually implemented the jit yet :P wingo: just integrated lightning into the build, with an --enable-jit option that defaults to --enable-jit=auto wingo: which enables the jit if it's supported civodul: neat! crazy stuff civodul: we've been discussing this for so long civodul: really exciting wingo: :-) dsmith-work: Hey Hi Howdy, Guilers rekado: congratulations on releasing Guile 2.2.4! I’m very happy about the bug fixes. civodul: it's not the end of the story, though atw: ArneBab: I've figured out the answers to those questions now, but it's the type of question that seems likely to come up when starting with any language: "what libraries are there? How do I get and use them?" manumanumanu: wingo: yeah! Is there any info on the JIT process? manumanumanu: oops. sorry, didn't see the guile-devel post manumanumanu: awesome! dsmith-work: wingo: Anything else I can do to help with that segfault? lavaflow: is there a guile package for dealing with zip files (extraction particularly) ? weinholt: lavaflow, if you're willing to swallow a whole package manager (or get the dependencies by hand): https://akkuscm.org/packages/compression/ janneke: lavaflow: there's http://www.lonelycactus.com/guile100/html/Problem-3.html#Problem-3 lavaflow: weinholt: janneke: thanks, one of these should work stis: Hej guilers! manumanumanu: stis: long time no see! manumanumanu: Ahoy hoy! manumanumanu: stis: what are you up to? manumanumanu: Anyone here good with (ice-9 match) ? manumanumanu: Say I want to check whether a procedure returns true using (? predicate) but I also want to bind the result of that predicate to use in the match body... Is that possible or will it get ugly? manumanumanu: What I really want is to check whether regexp "rxp" matches against the object I'm matching against and bind the match object manumanumanu: I know I know, it's a code smell, but it is also exactly what i want to do lavaflow: weinholt: do I need to do anything special to use a akku installed library? I did `akku install compression` and `source .akku/bin/activate` in my project directory lavaflow: GUILE_LOAD_PATH is set, but when I try to use (compression zip) it tells me "no code for module" manumanumanu: ah yes, found it out weinholt: lavaflow, guile -x .guile.sls -x .sls, possibly also reader options... i should do some work on this :) weinholt: going to bed now, good luck! lavaflow: thanks! manumanumanu: ah, no, didn't make it work stis: manumanumanu: not much scheming atm, mainly mathematics in my hobby time stis: manumanumanu: doesn't (? pred? (set var)) work manumanumanu: (and symbol (= symbol->string s)) does stis: manumanumanu: doesn't (? pred? var) work manumanumanu: nope manumanumanu: that binds var to the original match manumanumanu: so (and symbol (? symbol->string s)) binds s to a symbol stis: yeah that's true manumanumanu: so there is no way to bind the result of a predicate stis: (= pred? (? truep x)) ? stis: ouch bonuspoints for mixing cl and scheme nomeclature for predicates manumanumanu: skamvrån! stis: lol manumanumanu: I don't even know how that is supposed to work. = binds the result of pred? to (? true? x), which seems wonky stis: now = outputs the result of pred to the matcher (? true? x) which will check for it to be true and then bind it to x stis: I would prefere the racket macther here, one can construct custom matchers and gte quite nice end result stis: Then you could have written (=? pred? x), with a suitable defined =? stis: There is a racket matcher in guile-syntax-parse manumanumanu: stis: you are a genious manumanumanu: thank you ArneBab: amz3: why do yo want to abandon webdev? ArneBab: wingo: so … I can … actually try this now? … still feels unreal … I want to test it … ArneBab: sneek: later tell atw: you’re right. I hope we can tackle that better and better with time. It feels like there are barriers to entry which prevent reaching the documentation which works pretty well — even offline. sneek: Got it. amz3: ArneBab: too much cruft, it seems to me gtk / clutter or something like that will be more lightweight apteryx`: how do I accumulate stuff in a loop in Guile? I could use cons, and reverse, but isn't this imperative rather than functional? apteryx`: I'm reading a file and upon a regexp match on a line, I want to accumulate the matched group text in a list. rekado: apteryx`: you can use “fold” from srfi-1. brettgilio: Hey all, I started Guile and Scheme about three weeks ago. I am wanting to rewrite an application of mine which is in C++/Qt5 to Guile, but want to keep the application front-end in Qt5. I know that Guile is rather portable and can be embedded in C/C++, and I am planning on keeping the logic quite separated, like an MVC. Do you have any advice for this process? Thanks! brettgilio: Also, for some reason the Guile mailing list isn't letting me register. daviid: brettgilio: excellent news and welcome! we don't have (at least that I'm aware of) qt5 bindings. As usual, the best is to keep proper separation between the app core functionality and the UI, no mistery here. now, we generally recommend the opposite: write the app in scheme, and import what ever lib you need either using an existing binding, or write your own when not available ... this said Iunderstand t probably represent too much daviid: work in your case (qt5 bindings ...) daviid: wrt mailing list, I don't knw, did you try to subscribe using the ML web page dedicated to this? brettgilio: daviid: Thanks for your help, and I pretty much figured it will simply have to be a clean separation between the logic and the gui. I simply find the scheme implementation and the hackability of it to be such a beautiful feature, especially given that I am not by profession a programmer nor even closely related. brettgilio: daviid: As far as the mailing list goes, I used the gnu mailing list page at https://lists.gnu.org/mailman/listinfo/guile-user brettgilio: Otherwise, I am happy to be here. I moved to having emacs as my window manager about two weeks ago, and the integration of irc is such a beautiful thing. daviid: brettgilio: that is the right ML page yes, so you subscribe, then you should receive a subscription confirmation email, that you need to respond to to effectively activate your membership, did you do that? daviid: brettgilio: most of us use eamcs, are you aware of geiser? that is our 'ide' so to speak brettgilio: daviid: I have attempted to register a few times, but it is not relaying to my email address. I will try a different address and see if it works, but I have a preferred address I'd like to use. brettgilio: daviid: Yes, Geiser is integrated directly into my emacs workflow, it is a terrific tool and runs perfectly with so many scheme implementations. daviid: i think it ight be your email provider or something brettgilio: daviid: You're correct, it is. brettgilio: daviid: What do non-emacs users use? DrRacket? daviid: brettgilio: I don't know :) daviid: brettgilio: what is your app about, any link (just curious here) daviid: is it free s/w? brettgilio: daviid: Always free s/w, gpl.. It's mostly a self-starter project that I've been using to learn the reddit api and apply my Qt5 and C++ skills. But when I got close to a working prototype was when I discovered scheme and the embeddability of guile in C/C++. It's not in a public repo atm, but I can make it so in a few days after I look into this Guile and C++ combination scenario. brettgilio: daviid: I run parabola gnu/linux-libre. /Always/ free software. daviid: brettgilio: ok, I was just curius, good luck! kepp us informed ... daviid: *curious atw: ArneBab: I had another beginner question: where does match-lambda come from? I found out it comes from ice-9. What functionality is provided by ice-9 versus SRFIs versus SLIB versus something else? brettgilio: atw: What resource did you use to figure out ice-9? daviid`: brettgilio: the manual '7 Guile Modules' daviid`: atw: (ice-9 match) atw: That's a good manual section :) I used Geiser brettgilio: atw: you mean the geiser helm info section? brettgilio: atw: I've been reading SICP and The Scheme Programming Language and using the helm info section off and on atw: brettgilio: I started Geiser, eval'ed the buffer, and put the point on match-lambda brettgilio: atw: Did it take you to the buffer with 7.7 Pattern Matching? atw: brettgilio: when I just put the point on match-lambda, a message in the echo area indicates that it is from (ice-9 match), which gives me enough information to search further :) I see that Geiser has C-c C-d TAB for manual lookup. That seems to work for e.g. define but not match-lambda. i suspect that's a Geiser misconfiguration on my part daviid`: atw: no, it's because match-lambda comes from an include, and geiser can't know that daviid`: atw: if you visit (ice-9 match) you'll understand ... brettgilio: atw: M-x helm-info-guile (ice-9 match) brettgilio: That is how I found it. brettgilio: Section 7.7 if youre on the GNU page. atw: thanks! reading now... amz3: I will submit a proposal for my guile database to scheme2018 amz3: maybe amz3: also I will move to the newest microkanren amz3: what's up ijp-znc ? wingo: moo mwette: programming in COW now? https://esolangs.org/wiki/COW amz3: ^^ amz3: that's the next big thing civodul: guile-hall looks like a step in the right direction weinholt: civodul, https://akkuscm.org/ here's my step in some similar direction (minus the guix parts) civodul: hey weinholt weinholt: hello there civodul: weinholt: to me Akku is a different beast: more at the package manager level, whereas Hall is more at the level of 'make' civodul: well, in between maybe, but definitely lower level weinholt: okay civodul: Akku does look very nice though civodul: prolly nicer than previous attempts in this space (Snow, guildhall, etc.) :-) weinholt: :) weinholt: the latest release gained support for running from guile, although it doesn't recognize guile's modules yet weinholt: unlike guildhall/dorodango it parses the code to understand where everything should be installed, makes things a lot easier for the user ArneBab: sneek later tell atw: ice-9 are core tools provided by Guile "as a crystal seed" for programs. sneek: Got it. ArneBab: sneek: later tell atw: SRFIs cross-implementation features. They are collected at https://srfi.schemers.org/ and are likely to work on multiple scheme implementations, not only in Guile. sneek: Okay. ArneBab: sneek: botsnack sneek: :) atw: ArneBab: for contrast, I searched https://duckduckgo.com/html?q=racket+tutorial&t=gnu. I think it might help to consider the audience -- how "beginner" should a tutorial/intro to Guile be? WDYT? ArneBab: I think having a tutorial similar to the racket one would be great. ArneBab: but we lack polished tools shipped with guile which would make that simple ArneBab: and I only have so much time :-) ArneBab: I recently wrote a tutorial for using Guile via wisp which is more geared towards beginners: http://www.draketo.de/proj/with-guise-and-guile/wisp-tutorial.html ArneBab: atw: I actually wrote that one into my paper-notebook and then typed it down … ArneBab: I don’t think it’s perfect, and I’m sure people can do better, but it’s the first I could for example show my son to allow him to hack stuff ArneBab: though turtle graphics win by far against it ArneBab: (I showed him how to do turtle graphics in Python and he liked it a lot) atw: ArneBab: re code on paper: I've done the same to avoid the tyrrany of having to write code that actually evaluates ☺ ArneBab: in my case I write code which typically evaluates without changes :-) — I love having code which looks like pseudo-code but actually runs. atw: there's also the possibility of recommending books, but that does incur the cost of finding and getting the book ArneBab: yes, and I think doing that loses at least 90% of people ArneBab: especially the ones who can already program and just wont to try whether they might like Guile atw: Would Guile be their first Scheme? ArneBab: that’s … actually a good question ArneBab: clojure users might come to Guile for system-scripting. For them it would be the first Scheme, but not the first Lisp. atw: Funny you should mention, my day-job is clojure. Guix brought me in ☺ ArneBab: I have a co-worker who uses clojure and is interested in Scheme :-) ArneBab: what Guix shows nicely: Every great tool needs killer applications. ArneBab: that’s why people come ArneBab: not because of the great tool itself, though the tool enables them to create more great applications which might allow them to pull in more people atw: I asked the first-Scheme question because I think that if Guile is someone's second Scheme, then the interesting thing for them to learn might be what's more unique to Guile. Someone coming from another Lisp might wonder how much metaprogramming happens in practice, and someone with an ML-like background might just be looking for SRFI-1 ArneBab: that sounds true ArneBab: could you write up what you’d have liked to read about Guile when you first came here? ArneBab: I actually came from Python and moved towards Guile thanks to The Adventures of a Pythonista in Schemeland: http://www.phyast.pitt.edu/~micheles/scheme/index.html atw: hmm, pretty much all of the above! I'm not sure I should be taken as a representative example, but here are some questions I've had: is there a library/builtin function for powerset? What's a record? Is SRFI-9 the only "object" system? How do I map/reduce/etc.? What is call/cc? atw: ArneBab: I found https://ds26gte.github.io/tyscheme/index-Z-H-1.html#node_toc_start recently, which seems really good! ArneBab: records where also something it took me a long time to find ArneBab: sadly all rights reserved :-( ArneBab: but this looks pretty nice: https://ds26gte.github.io/tyscheme/index-Z-H-3.html#node_chap_1 atw: Ah, you're right, I didn't even think about thatt ArneBab: otherwise we could have turned it into "Teach yourself Guile Scheme in fixnum days" ArneBab: though distribution and usage is allowed: https://github.com/ds26gte/tyscheme/blob/master/COPYING — but I don’t see anything about changing atw: Could people looking to learn be directed to it? ArneBab: looks like the book is free: http://ds26gte.github.io/index.html "Here are some Scheme- and Common-Lisp-related code and documentation. Everything presented here is freely distributable and freely usable, and comes with no warranty of any kind. FS (as in GPL, LGPL) bundlers who require a standard license may use the LGPL to bundle any of these items. Others should find my COPYING file adequate." ArneBab: bbad atw: ? reepca-laptop: what's a nifty way to get the name of the file currently being evaluated? reepca-laptop: ah, lucky me, my next guess was "current-filename", and it turns out that's it. ArneBab: sneek: later tell atw: bbad = be back another day sneek: Will do. wingo: ACTION merges in gnu lightning chrislck: \\o/ janneke: wingo: exciting! (a bit ugly, but i understand there's no better choice right now) wingo: janneke: jit will enable more c code to move to scheme wingo: so, better for portability i think (e.g. when targetting graal or rpython or wasm) janneke: wingo: i didn't catch that implication/dependency, that's so great! wingo: janneke: there will still be the interpreter of course and the jit can be disabled wingo: the reason some things haven't moved to scheme is partly because no one has done it yet and in some cases because scheme is slower wingo: but with jit the latter reason will go away wingo: if you have an interpreter-only build then things won't be as fast as they could be, but the amount of C code will be less wingo: after things move from c to scheme i mean wingo: speed enables the move janneke: ah, right! ArneBab: wingo: yay! janneke: hmm, thinking about the speed issue, i remember how moving equal2? from scheme to C (in Mes) had a significant performance improvement amz3: so guile on chez is not something out of the mind amz3: janneke: what is the channel of boostrapable effort? amz3: got it it's #bootstrappable amz3: davexunit: what do you think about immediate mode gui? wingo: good morning civodul: hey Guilers! civodul: it's Friday! :-) wingo: indeed :) wingo: ACTION sent JIT update civodul: woohoo! civodul: wingo: why do we emit 'reset-frame' after each 'call'? wingo: civodul: we don't do it after every call i think. anyway after a call, it's as if the callee "called" the return address; we don't know how many arguments it passed to the call wingo: reset-frame is used when we know that we're resetting the sp to less than what it currently is and to truncate any extra values the callee might have returned civodul: ok civodul: i'm asking because on a disassembly i see lots of call/reset-frame sequences, where reset-frame is passed the same number of slots as already available on the frame civodul: thinks like: (alloc-frame 10) ... (call x y) (reset-frame 10) civodul: it can't hurt, but it's surprising wingo: civodul: yes, after a call you don't know where the sp is wingo: civodul: because the callee can return as many values as it likes wingo: so the reset-frame is necessary. it will usually reset to the value that was initially allocated civodul: ah alright, makes sense civodul: sometimes on the stack we have SCMs like 0x2000002 (tagged integers), which also happen to be pointers to the heap civodul: well, nothing new civodul: but it's interesting to see happen for real wingo: civodul: interesting indeed :) OrangeShark: civodul: sure, I will try and do that this weekend civodul: OrangeShark: excellent, thank you lloda: wish confirmation dialog to exit the repl. Or have another key (not C-d) to exit w/o confirmation. Or have another key (not C-d) to go up an error frame. wingo: aw bummer, sounds like you lost some work :/ lloda: yeah ;D lloda: I went for a walk, so it's all good wingo: i kinda want a fibers-based repl using read written in scheme, with readline implemented in scheme :) civodul: wingo: fiiiiiiiixed! civodul: \\o/ wingo: how??? civodul: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28211#46 civodul: crazy stuff wingo: wow! wingo: that's wild civodul: it is! wingo: dude congratulations :) wingo: that's an amazing friday feeling :) snape: civodul: concrats :-) civodul: thank you :-) snape: *congrats civodul: damnit, that's such a relief OrangeShark: civodul: good job :) civodul: i think it's one of the most terrible bugs i've had to deal with civodul: in part because i was not so familiar with the 2.2 code base civodul: now to see if it solves other "weird crashes" we've been seeing wingo: it's a pretty rough way to learn! civodul: yeah :-) wingo: the patch LGTM civodul: awwwwesome, thanks wingo: thank you!!!! civodul: :-) wingo: we'll think about barriers later, i think at least some compiler barriers are needed here wingo: probably atomics on other arches civodul: yeah, could be civodul: BTW, we could use libatomic_ops in atomics.h civodul: but that's a topic for another day wingo: yeah civodul: going to school see my daughters civodul: later! atw: what if https://www.gnu.org/software/guile/manual/html_node/Stack-Layout.html had a picture of what a procedure call looked like? atw: that might be something I could do sripathroy: Hi SahithiYarlagadd: Hi I am working on implementing a spinner for replacing the build messages SahithiYarlagadd: Need a small help in calling the procedure ArneBab: SahithiYarlagadd: what kind of help do you need? daviid: civodul: wooh! congrat wrt 28211, have a nice party all night long! :) before 2.2.4, I wish and hope one of you (maintainers) could find the time to look at bug#29669 and bug#29684, which (once fixed) would turn guile-cv 'usable' (without users to have to patch guile themselves ...), that would really be awesome civodul: daviid: no promises, but hopefully i can take a look by then! rekado_: civodul: I hope you are still celebrating instead of going back to hack! daviid: civodul: understood, thanks rekado_: I admire your persistence and determination in squashing this bug. civodul: rekado_: i don't admire my productivity though ;-) davexunit: civodul: that patch... wow davexunit: good work civodul: heh thanks rekado_: productivity is overrated ;) civodul: :-) davexunit: guile 2.2.4 will be extra nice because mark reverted a commit that broken floating point optimization davexunit: broke* atw: and it prompted me to look into the VM :) ArneBab: the first hit on duck-duck-go for "guile tutorial" is about embedding Guile in a C application. Is that what we want? Should we link from that to a Guile Scheme introduction? https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html chrislck: Just a question about LISPy programming in general... chrislck: In contrast to C/python, scheme allows objects to contain anything... numbers/symbols/lists/lists-of-lists chrislck: So these objects being passed as argument to functions get passed around until they're actually used chrislck: which means a deep unknown function will actually do e.g. (define x (+ a b)) assuming a and b are numbers chrislck: but if the originating top-level function doesn't insist that a and b are numbers, it becomes difficult to debug chrislck: I guess this is about typed-scheme programming - what do guilers actually do to assist? enforce 'contracts'? e.g. (define (func a b c) (if (not (number? a)) (throw "a must be a number") ...) ? terpri: chrislck, i usually don't do explicit type-checking, and just rely on lower-level operators and macros (record accessors, pattern matchers, etc.) to signal an error if the types are wrong. imho that style works well enough in mostly-functional programs, where delaying type checks won't cause side effects terpri: or sometimes i use goops, and types are checked during method dispatch chrislck: thanks... it does require a lot of discipline and documentation of these deep functions... this can be a problem when the module is not well documented, and the variable names keep getting changed pierpa: do not use modules which are not well documented wingo: good day civodul: hello wingo! civodul: i added a printf in scm_error_scm and we see interesting things while building: https://paste.debian.net/1031128/ civodul: some of this must be (false-if-exception (module-ref ...)) i guess wingo: civodul: that does look weird! civodul: the out-of-range bv-u8-ref seems to come from: (false-if-exception (string-table-ref bv name)) civodul: wingo: if i mark the whole stack conservatively, from stack_bottom to stack_top, the crashes seem to disappear civodul: (i wonder why i didn't start with this test...) wingo: that's good at least :) wingo: so you think that we should set vp->sp atomically in some way? at least compiler barriers civodul: the brute-force SEQ_CST things that i used didn't help civodul: so it might be something else wingo: civodul: another thing to test: what if you mark from stack_bottom to sp conservatively, and precisely between vp->sp and stack_top civodul: good idea civodul: i got a crash (out-of-range vector-ref) when marking conseveratively from stack_bottom to sp, and precisely upwards wingo: civodul: btw dunno if you had a diff patch from https://paste.debian.net/1030656/ but that patch didn't cover all the sp manipulations civodul: i added a couple more atomics, notably in scm_i_vm_mark_stack wingo: that's not needed either wingo: scm_i_vm_mark_stack is run when the world is stopped civodul: right wingo: there are other markers but nobody's writing stack pointers wingo: i'm thinking mainly when vp->sp is pushed and popped wingo: i guess though by setting in alloc_frame and reset_frame you covered that case... humm civodul: yeah wingo: there are a few cases in vm.c of course... wingo: e.g. the scm_call_n things civodul: i vaguely suspected subrs at some point, but couldn't find any evidence wingo: civodul: ah your patch missed a set of ->sp in alloc_frame, on the path where the stack had to be extended civodul: ACTION checks civodul: hmm yes wingo: ACTION a bit irritated that threads aren't marked from their own stacks :P rain1: what do you think of my idea for named args rain1: (create-file name contents :temporary=#t) rain1: new syntax is := wingo: rain1: what does it do? :) wingo: is it like #:temporary #t ? rain1: someone said dont use boolean parametrs, they make code hard to read rain1: "This is mostly solved in languages with named parameter calling (if you use it). Example: createFile(name, contents, temporary=True)" civodul: OrangeShark: would you be willing to tag a release of Guile-Git? civodul: i think the current state of master would be perfect for 0.1.0 or something civodul: return-values does: if (nlocals) RESET_FRAME (nlocals); civodul: but the rest doesn't check if NLOCALS is zero civodul: we never emit (return-values 0) though, do we? civodul: wingo: ↑ manumanumanu: rain1: well, what does it bring over using lambda* ? Copenhagen_Bram: hello, I'd like to learn how to write guix packages so I thought this might be a good place to be lol Copenhagen_Bram: for instance what does lamda mean? rekado: Copenhagen_Bram: a “lambda” expression returns an anonymous procedure. rekado: Copenhagen_Bram: (lambda _ #t) returns a procedure that takes any arguments and returns #t when executed. Copenhagen_Bram: what's an anonymous procedure? rekado: it’s a procedure without a name. rekado: you can bind a procedure to a name, for example: (define square (lambda (x) (* x x))) rekado: this means: define the name “square” to be a procedure that takes exactly one argument and returns the square of that argument. rekado: we use lambda whenever there’s no point in giving the procedure a name. rekado: a Guix package definition is a “package” value that’s bound to a name. rekado: in the Guix sources you’ll often see something like (define-public foo (package …)) rekado: “define-public” is like “define”, but it also makes the value visible to other modules (other than the current file). jlicht: do comparators (anything that you can pass to the sort functions) only give a binary less-than relation? Or are they expected to give the trinary {<,=,> jlicht: *{<,=,>} result as in some other languages weinholt: jlicht, srfi 67 has trinary comparators, outside of that they tend to be binary jlicht: thanks weinholt, that was exactly like what I was looking for snape: janneke: there seem to be 'warn' alread, that does what your 'pke' does snape: *seems janneke: snape: ah, beautifu janneke: *beautiful snape: *already :) janneke: hihi wingo: good evening OrangeShark: good day jlicht: is there something like +inf.0 for integers guile? civodul: jlicht: there's +inf.0 :-) jlicht: civodul: which is sadly not an integer :/ janneke: ACTION is writing texinfo docs for mes civodul: ah, oh! jlicht: at least not according to `integer?' and srfi-67's `compare-integer' civodul: janneke: neat! civodul: hmm janneke: wishing i did that before applying to be a GNU package and saying: theres no docs, only these READMEs janneke: oh well civodul: heh jlicht: civodul: as I am writing the comparator myself, I can just define a constant and expose it though :-) civodul: jlicht: for "all practical cases" as we say, it doesn't really matter that it's not an integer civodul: because you can always use > and < jlicht: civodul: I wanted to have a total ordering for Semantic Versions, so in this specific case, I do need some value that can be defined to be bigger than anything else civodul: well +inf.0 is not an integer, but it is greater than any other number per > civodul: but srfi-67 insists on integers, right? jlicht: I'll probably be able to get by with numbers instead of integers indeed jlicht: thanks for the tip civodul ArneBab: daviid: thank you! daviid: ArneBab: wc! ArneBab: A first tutorial for writing programs with wisp: http://www.draketo.de/proj/with-guise-and-guile/wisp-tutorial.html — basic introduction to programming manumanumanu: ArneBab: now the pre-checks are merged (which means support for in-generator). There wont be any post-checks any time soon, but I managed to simplify in-value so that it isn't needed anyway. In the long term I will make a re-write to have the loops be composed of more manageable parts (now I am doing everything at the same time, which gets pretty hairy if you look at the for/emit macro). However, now they do manumanumanu: everything I set out to do, and they produce very good code (almost always as fast as hand-rolled loops). manumanumanu: BTW: what do you want me to write in the blog? Just about the macros, or about writing complex macros in general? snape: Is there a way to identify a fiber? I'd like to log its name or id, for debugging purposes. wingo: snape: not really. i had that at one point but removed it. if you want to make something like that, i think you need to wrap the fiber primitives snape: wingo: okay, thanks, I'll do that maybe civodul: "Transient intmap owned by another thread ((2008))" oh oh! civodul: i had never seen this one wingo: really?? wingo: intmaps were designed to be threadsafe in the clojure sense but implemented before atomic references landed civodul: isn't there a TOCTTOU race with assert-readable! there? wingo: so their "atomics" aren't fully implemented; they need to use atomic references wingo: however there are never multiple threads accessing an intmap at the same time wingo: in current guile wingo: so i dunno how you got there! wingo: ACTION has to run, biab civodul: indeed civodul: see ya! wingo: good evening OrangeShark: hello everyone ArneBab: manumanumanu: either would be a great topic! ArneBab: manumanumanu: a discussion why you like this style of for-loops and how people can use them would also be great. OrangeShark: hmm, the change daviid did for installation location of Guile-Lib is interesting janneke: i'm thinking of making Mes a GNU package, wdyt? civodul: janneke: why not! sneek: Welcome back civodul, you have 1 message. sneek: civodul, lfam says: I pushed the security reporting changes we discussed to guix-artwork.git. Can you deploy the changes? civodul: janneke: you could explain how it differs from Guile, MIT, and SCM civodul: just so they understand that it's a different beast ;-) civodul: but then i think it definitely has its place, in terms of user freedom preservation janneke: civodul: thanks! yes, i'll do that. daviid: janneke: 1+ for GNU Mes civodul: speaking of which, does Mes have '1+'? :-) daviid: haha janneke: hmm janneke: ACTION goes to check janneke: mes> (1+ 3) janneke: [sexp=(1+ 3)] janneke: $0 = 4 civodul: it passes the test, pheww ;-) janneke: here i was going: let's hope it fails janneke: ACTION would have loved to say: I take patches :-D civodul: heheh :-) snape: I'm trying to debug (with pk) in a test suite (srfi-64 I believe), but I can't see any output. Any idea about how it should be done? janneke: snape: i've been adding and using a `pke' variant that writes to stderr janneke: maybe i should present a patch to Guile snape: I'll try that janneke, thank you janneke: snape: my usage was /not/ in the context in srfi-64, but i imagine & hope it will work for you snape: well, the thing is: I can't even redirect the output to a file janneke: hmm snape: janneke: oops yes I can, of course it was my mistake snape: so you trick should work snape: Actually even stdout worked, it was another mistake. Sorry for the noise :p janneke: good for you! wingo: moo janneke: o/ wingo: good morning civodul :) wingo: hum, it seems gnu lightning doesn't know about atomic memory access civodul: hello! civodul: oh wingo: we can call out to intrinsics written in c of course wingo: probably a reasonable strategy in the beginning anyway civodul: yes, that makes sense civodul: so you're already playing with lightning? :-) wingo: civodul: in my mind :) seeing what needs to be intrinsics and what not wingo: about 20 more intrinsics to go civodul: heh, that's exciting anyway! manumanumanu: Good morning everyone! Such a beautiful day. I finally finished my big garden project (building a 25m long brick wall for our flowerbeds). Now I want to do some coding manumanumanu: What are you all up to? manumanumanu: I also ordered plants for almost 15000SEK :| manumanumanu: I am building a watering system with guile controlling the pumps rekado_: manumanumanu: oh, that’s interesting! rekado_: I’m still working to get rid of the old lawn to replace it with growing beds. rekado_: really tough soil under dry grass roots. manumanumanu: I am more interested in the whole constructing a garden and letting my wife tend to it, but I am starting to get really into it. Apart from the hard labour of digging out 15 metric tonnes of dirt rekado_: I really enjoy gardening, though I’d love to automate irrigation. rekado_: I have been finding a rather large number of may bug larvae under the grass. I expect lots of may bugs next spring :-/ snape: and if you automate irrigation you may have guile bugs as well as may bugs rekado_: :) rekado_: our garden is a little too far away from where we live, so I’d also like to set up some other kinds of monitoring. manumanumanu: I have 1.1k m2 of garden for our house. Too much is covered by a _huge_ patio that was here when we built the house. That is the one we now framed with flower beds. The next ting is to buy about 40 pallet collars. Those are pretty neat to grow things in manumanumanu: is there any way to start guile without .guile? manumanumanu: ArneBab: Sorry, there wont be any post-checks in a while. That is a pretty darn huge change that I'm not really sure I'm able to crowbar in without harming performance manumanumanu: pre-checks: easy. Post-checks: hard. manumanumanu: Pre-checks befor the body is executed are simple, since they can just be placed befor any inner loop, but post-checks have to be passed to the innermost loop, which I requires me to refactor a pretty hairy macro. civodul: wingo: code that tail calls does: (reset-frame x) ... (tail-call n) civodul: but "tail-call" itset also does RESET_FRAME civodul: *itself civodul: is it necessary? wingo: probably not! civodul: ok civodul: also, when doing reset-frame, isn't there a window during which sp may point above the "actual" sp, meaning that scm_i_vm_mark_stack could leave a few items unmarked? wingo: when reset-frame happens, that indicates that everything beyond the sp to which it resets is trash civodul: ok wingo: does that answer the question? civodul: yes wingo: generally, guile should mark everything inside sp and nothing outside sp civodul: sure civodul: it's not entirely clear to me that reset-frame is only used in those cases, but that's mostly because i don't fully understand this civodul: like i'm looking at the assembly of call-with-output-string wingo: ACTION updates his guile 2.2 civodul: clearly the 'port' variable must be kept after the 'reset-frame' instruction so it can be passed to 'get-output-string' wingo: yes the disassembly is terribly confusing wingo: i have been meaning to annotate values with e.g. "f0" or "s0" to indicate whether they are relative to fp or sp, or rewrite them all in terms of slots-from-fp wingo: anyway the port is stored in fp[-1] which is fp slot 0 civodul: right civodul: so even after RESET_FRAME(2), it's still markable wingo: i never see (reset-frame 2) before the tail call? civodul: i mean "tail-call" itself does RESET_FRAME(2) wingo: or are you referring to the RESET_FRAME inside the tail call inst wingo: yes wingo: yes, no problem there. at a point of a call, the closure/callee arg and the other args are all "inside" SP wingo: so, no problem there. civodul: right civodul: i have a case where this 'port' is zeroed out wingo: rly civodul: which suggests its references weren't added to the mark stack civodul: so i'm trying to enumrate the possibilities wingo: that could happen if the mark stack was moved and somewhere forgot to CACHE_SP() after a call that could have moved the stack... wingo: s/mark stack was moved/stack was moved/ civodul: if the stack was moved? what do you mean? civodul: stack expansion? wingo: yes wingo: i guess that's unlikely though civodul: yeah, that's doesn't seem to be the case (i have a printf in expand_stack :-)) wingo: :) wingo: i assume also we don't have any weird off-by-one in the MADV_UNUSED code that returns stack frames to the OS wingo: i just mention this for completeness of course civodul: MADV_DONTNEED isn't called in this case wingo: right, that :) wingo: ok civodul: another option is a race condition where the world would somehow not be fully stopped when we start marking wingo: i thought you were able to repro this problem even with disabling the precise stack marker wingo: is that not the case? civodul: yes, i disabled the slot_map thing civodul: but i left marking from sp to stack_top wingo: right wingo: so it's not the slot_map thing deciding to NULL out that slot (and even then, it nulls out with SCM_UNDEFINED i think) civodul: yes civodul: note that sometimes it's the stack slot itself that's zeroed, and sometimes it's a heap object (like this string port) that's zeroed, although it's referenced from the VM stack wingo: it's interesting because it's a reference from the stack; it's not prone to out-of-bounds writes from other adjacent objects stompling it civodul: right civodul: and i have "reasons to believe" that the zeroed scm_t_port was added back to a freelist because its first word looks like a pointer to the next item in the freelist wingo: is this on x86-64 ? civodul: yes wingo: you could try putting a memory barrier (before and?) after every write to vp->sp, if that's a concern...... wingo: difficult to tell! wingo: you've never caught the marker in the act making an odd mark, have you? civodul: making an odd mark, like? civodul: in this case i would need to catch him *not* marking something it should mark civodul: *it wingo: civodul: hum! i guess i was thinking something was zeroing out that slot. but perhaps you were thinking that maybe the value was already zero wingo: the SCM value was zero and then was written to the slot wingo: is this particular form of the bug reproducible? civodul: wingo: it's reproducible to some extent: you let the code run for a couple of minutes, and you get a crash of one form or another wingo: and this form is a usual form? wingo: are threads being created all the time or are they constantly being created? civodul: it's the code at https://bugs.gnu.org/28211 civodul: threads are created once for all wingo: it would be interesting if you could get backtraces when threads are stopped by libgc; i.e. where is the mutator when it is stopped by the collector wingo: if the mutator isn't making its changes visible to the collector, then obviously an error would occur, but later, in a seemingly unconnected way civodul: the problem is that most of the time we won't see anything interesting since it's non-deterministic civodul: wingo: it appears to crash much less frequently with brute-force memory barriers: https://paste.debian.net/1030656/ civodul: like it took 30+ minutes before it would crash civodul: but i'm missing an __atomic_load in scm_i_vm_mark_stack, for instance civodul: so maybe it's just that wingo: that is a huge hammer to use SEQ_CST there... civodul: of course, but it's a simple way to test the hypothesis :-) wingo: :) civodul: now, what do we do with this, idk wingo: i think it's only a test if you can prevent the crashes civodul: it's expensive, so do we want to do this at each SYNC_IP/CACHE_SP? maybe not wingo: it could be the barriers just alter the timings without solving the problem civodul: could be civodul: really hard to tell :-/ civodul: it could also be that all we need is a compiler barrier, so that vp->sp happens really where we write it wingo: right civodul: dunno if that instructions can end up being moved elsewhere wingo: of course walking through the disassembly of vm_regular_engine is an option ;) wingo: not one i would want to do tho in 2.2 :/ wingo: i suppose you could look for every ALLOC_FRAME tho ArneBab_work: manumanumanu: would you like to write a short article about your for-loops for with-guise-and-guile? http://www.draketo.de/proj/with-guise-and-guile/ — to get started you can simply copy one of the org-files from https://bitbucket.org/ArneBab/with-guise-and-guile/src/default/ civodul: wingo: fun fact: i've disabled ASLR and it's always the exact same VM (pointer) that's bogus civodul: it crashes in different ways, but it's always the same one civodul: it's the first thread in the 'all_threads' list (but not the main thread) wingo: that's promising! wingo: civodul: i ran into something interesting... it's possible for a thread to exit but the thread object is still marked wingo: while investigating something unrelated wingo: what happens if you add a /* Prevent this thread from being marked in the future. */ wingo: t->handle = SCM_PACK (0); wingo: in on_thread_exit, right after removing the thread from the all_threads list civodul: ACTION looks wingo: i think there can be a case then that an exited thread might be marked civodul: though, it'd be a leak, but the problem here is the converse :-) wingo: and then in mark_stack(), there's that call to return_unused_stack_to_os, which from my reading might call MADV_DONTNEED on a mmap region that it doesn't control wingo: no, because when a thread exits, its stack is unmapped directly civodul: and i typically don't see MADV_DONTNEED in my tests civodul: i thought i'd share a backtrace: https://paste.debian.net/1030684/ civodul: so here the port's 'read_buf' and 'write_buf' vectors are both corrupt civodul: they look like a freelist with the next-item pointers at regular intervals wingo: do you use soft ports at all? wingo: (could this be related to weak sets, in any horrible way? there is the port weak set) wingo: that would be sad :P civodul: i don't use soft ports here civodul: the port weak set, hmm, dunno civodul: it's a string port, so i think it's not added to the port weak set civodul: only file ports do, AIUI wingo: will it get a finalizer? i think that will happen only if it gets iconv descriptors civodul: string_port_type->flags is 0, so it doesn't have SCM_PORT_TYPE_NEEDS_CLOSE_ON_GC, so no finalizer wingo: yes but see prepare_iconv_descriptors wingo: incidentally i think the refcounting in release_port appears to be bogus; if the refcount is higher than 1, i don't think it ever gets properly decremented civodul: heh, 2nd bug that you find already :-) daviid: hello guilers! daviid: ArneBab: I just anwered your email manumanumanu: ArneBab: Sure thing. Not before this weekend though :) mwette: /quit rekado: davexunit: I’ve been playing with collision layers in tiled 1.1.5 and it seems that chickadee misinterprets the object coordinates. rekado: when rendering the collision rectangles they all appear to be flipped vertically. rekado: maybe that’s because of the “renderorder” property. rekado: mine is “right-down” and in your example game it’s “right-up”. I’ll change this in my map, but I guess I should contribute some tests for the parser. rekado: I take that back. It seems wrong also in the map that you use in your lisp game jam experiment. rekado: it looks fine in the tiled editor, but in the game (when highlighting collisions) they are all flipped vertically. ArneBab: manumanumanu: cool! Thank you! brendyn: How can I make sxml->xml just return a string instead of writing to the default output port? daviid: brendyn: with-output-to-string ? manumanumanu: ArneBab: I am updating them in a couple of days. I will add pre-check and post-checks, which will give them almost feature parity to racket's manumanumanu: this has two uses: support for iterating over srfi-12x's generators and a proper in-value manumanumanu: The thing you can do with racket's for loops are that you much more easily implement some kind of loops by doing syntax transformations using lambdas. That means that they can add non-tail-recursive for/list without any special case for for/list. Pretty neat stuff, but I have no idea how they do it manumanumanu: That makes for/list multi-shot continuation safe at the cost of making it potentially very expensive to re-instate a continuation manumanumanu: For that I have for/list/pure (which uses a non-linear reverse at the end) wingo: just recurse! guile's map uses recursion, without reverse manumanumanu: wingo: that was the plan, but re-instating a long stack takes a lot of time manumanumanu: iirc manumanumanu: racket had to make for/list do a reverse at the end, because it ended up making for/list and continuations very slow manumanumanu: jumping in and out of a (map ...) takes a lot more time than jumping in and out of a (loop ...) that reverses at the end manumanumanu: maybe I tested it wrong, but I made a generator using map and a generator using a let loop with an accumulator (just testing, not really any real world code) and the map one was a lot slower manumanumanu: using a generator based on delimited continuations manumanumanu: so I do a reverse! for for/list, which means about the same base-case performance as a recurse-based one, but with better performance for one-shot continuations at the cost of multi-shot-continuation safety manumanumanu: anyway. if someone has any better idea, I am happy to try it out. I want my macros to be as fast as possible manumanumanu: i doubt they will become much faster, as I still haven't found a loop where it isn't as fast as a hand-rolled one (peval ftw!) manumanumanu: wingo: I have been meaning to ask you about that. I don't really trust my (make-coroutine-generator) enough, so I thought I would go right to the source: from my tests re-instating a big call stack delimited continuation is slower than re-instating a small one . Is this the case? wingo: yep wingo: o(n) in size of stack, also any dynamic-winds, captured fluid bindings, captured prompts jlicht: hi guile! Is there anything other than r6rs-protobuf that will allow me to easily deal with protocol buffers using Guile? manumanumanu: wingo: thanks. then i'll stay with the current implementation. if anyone needs multi-shot continuations, they will hopefully notice the bad behaviour and check the docs. ft: huh. I wonder why my emacs keeps clearing the echo area a fraction of a second after geiser puts some autodoc stuff in there. ...doesn't do that with eldoc in elisp files... civodul: wingo: looks like you frame filters API for GDB was never applied, was it? https://sourceware.org/ml/gdb-patches/2015-02/msg00362.html civodul: still haven't found what's causing stacks to not be fully marked(?), but at least i fixed a couple of things in gdb support \\o/ civodul: not very productive chrislck: is it just me who finds it rather difficult to read other people's scheme code, and end up refactoring by recreating the same thing? manumanumanu: ArneBab: that seems to be quite a fuss. I'll just try to be productive using brew manumanumanu: chrislck: well, sometimes. It took me a while to be able to read scheme since it is a lot more dense than what I was used to manumanumanu: I find that I have a problem understanding lots of comprehensions, and that racket's for loops were easier. manumanumanu: so I made my own version of it for guile, but so far it only has one user :( amz3: what's up guile world! amz3: ? amz3: on my side, I just figured that guile-wiredtiger doesn't work wiredtiger 3.0.0; which means all my projects are broken! amz3: bummer amz3: major version bump ftw ;) amz3: maintenceship is an endeaver amz3: maintenceship is an endeavor amz3: luckily guix has not bump'ed to 3.0.0 yet janneke: amz3: ouch...yes, bits often rot very easily janneke: i'm still pounding on the guix bootstrap, binutils-2.20/glibc-2.2.5/gcc-2.95.3 are built, but these 3 still cannot build a gcc using glibc -- been on that for about a week now. slyfox: those are very old versions :) janneke: slyfox: i've been looking for the most "bootstrappable" versions, with a big preference for newer versions and this is the first set I managed to (aaaalmost) fully bootstrap from source janneke: gcc-3.4 introduces a dependency on dirent.h, i still shy away from implementing that slyfox: do you target only i386? janneke: slyfox: currently, yes slyfox: i had to poke at gcc-3.3.6 recently and was amazed how little time it takes to build it :) janneke: slyfox: yes, gcc-2.95.3 builds a bit faster than binutils, and much, much faster than glibc-2.2.5 -- really weird janneke: i really wonder why we don't have a glibc-bootstrap, that just defines enough to build gcc ArneBab: manumanumanu: your for/loops have at least one further user-to-be (I’ve been planning to give them a try for long) sahithi-ihtihas: 0. civodul: Hello Guilers! nilg: How to write the output of some call in a file? (I tried to redirect the output of guile into a file but that doesn't work) wingo: call-with-output-file wingo: or with-output-to-file wingo: see the manual :) nilg: hmm, I read the manual but I was confused since the argument of the call should be the port number. Anyway, thanks! civodul: wingo: we seem to be using direct calls to pthread_create & co. instead of using GC_pthread_create & co. civodul: contrary to what the comment in bdw-gc.h suggests civodul: /* Don't #define pthread routines to their GC_pthread counterparts. civodul: Instead we will be careful inside Guile to use the GC_pthread civodul: routines. */ civodul: # define GC_NO_THREAD_REDIRECTS 1 civodul: am i missing something? wingo: certainly the comment seems to not match what we are doing. i don't know that what we are doing is wrong though wingo: we have to support threads made by raw pthread_create wingo: because new threads can show up at any time wingo: e.g. not created by us wingo: afair we use the same mechanism in both cases wingo: and we avoid storing gc roots in pthread keys (i.e. if one is in a pthread key, it also exists elsewhere) wingo: iirc. civodul: hmm civodul: there's scm_i_current_thread in TLS, and there's a redundant pthread key civodul: TLS is supposed to be scanned by libgc anyway wingo: civodul: can you reproduce the problem with GC_MARKERS=1 ? wingo: it only happens in multi-threaded situations, right? civodul: wingo: only in multi-threaded situations (as in several Guile threads) wingo: ACTION nod civodul: i added printfs in thread_mark civodul: on runs where my code crashes, only the last two threads of the 'all_threads' lists were ever marked civodul: there are 8 threads on that list civodul: we use GC_register_my_thread, so we're fine civodul: (except maybe for TLS) manumanumanu: so, now I'm up and running on osx (got a new imac for free. Not my own choice. My wife won't let me install linux on it). I miss guix already. OrangeShark: happy friday! ArneBab: manumanumanu: install Guix on OSX? taylan: ArneBab: does that work? ^^ ArneBab: I did not try it yet, but it’s a unix. I can install Guix on top of a Linux, why not on top of OSX? ArneBab: (the last time I ran OSX was in 2007, then I installed Linux on the box) taylan: hmm. OS X doesn't use ELF I think. for that and probably other reasons, you probably won't be able to use substitutes or the default package tree at all. would need to create a whole new package tree at least. vivien_: Hello ! I have a question about compilation in guile. If I have a module "loader" that loads an extension, guild is able to compile it. If I have a module "user" which uses "loader", then guild fails because it cannot load the extension (it should not try to load the extension, since it will only be available at run-time). How do I tell guild not to load the extension ? vivien_: For instance, in loader.scm I have : (define-module (loader)) (load-extension "this-does-not-exist" "init"), and in user.scm I have : (define-module (user)) (use-modules (loader)) vivien_: I can : guild compile loader.scm, but not guild compile -L . user.scm taylan: vivien_: I don't really have experience with this but I think you want to put (load-extension ...) inside a procedure that can be called to load the module, like (define (load-foo) (load-extension ...)) taylan: then of course call that in the appropriate place in user.scm vivien_: Thank you taylan, I've just checked and it works. snape: does anyone know a way to autoformat one-line Scheme code? The minimum so that it's readable. snape: (with Emacs) cehteh: replace every ( with (\\n, then select the while block and M-x indent-region cehteh: whole snape: sounds good, I'll do that. Thank you! cehteh: certainly not perfect :D cehteh: and \\n( rather than (\\n .. well i am scheme noob and dont get the favored indenting either snape: it'll be surely better than one line :-) ecraven: or just use your Scheme's pretty-print function snape: ecraven: cool! thank you ecraven: also, in Emacs, auto-fill-mode seems to work ok for me ecraven: just set your fill column, and type a space after your line snape: a combination of both solutions, plus indent-region, seems to more or less do the job :-) civodul: wingo: scm_i_vm_mark_stack can be called from a thread other than the one whose stack is being scanned, right? civodul: so what happens if thread A is running, while thread B is scanning A's VM stack? wingo: civodul: mark procedures run when the world is stopped wingo: civodul: the vp->sp and vp->fp will always be current wingo: vp->ip might be out of date though. for that reason the innermost (most recently pushed) stack frame is scanned conservatively wingo: but for the rest, the saved return address in each frame indicates the suspended ip, so those frames are scanned precisely wingo: if instead of using signals, we used safepoints, we could scan innermost frames precisely as well; not currently the case tho wingo: additionally, things that munge the stack like vm_expand_stack, continuation hacks, etc happen within the alloc lock, so no race condition there wingo: i.e. a mark from a remote thread will see the stack before or after expansion, not during wingo: speaking about the ideal world that we don't yet have: ideally threads would mark their own stacks, when they notice that there's a pending gc safepoint. improves locality. wingo: but, we are where we are :) wingo: incidentally the whole c file refactoring was driven by a desire to inline struct scm_vm into struct scm_thread; they exist in a 1-to-1 relationship civodul: wingo: thanks for the explanations! civodul: i'm trying to find out how we can end up with cells being reclaimed too early wingo: have you been able to come up with a reproducible test case? civodul: i have a bunch of them :-) wingo: :) civodul: some take a while to reproduce it, others are faster but require bits of Guix civodul: no perfectly reduced test case unfortunately civodul: wingo: i don't see the special treatment of the innermost frame in scm_i_vm_mark_stack wingo: civodul: slot_map will be NULL on first iteration wingo: if you suspect slot maps are to blame, you can make slot_map NULL on every iteration, to test civodul: oh i see civodul: yes wingo: i see that gnutls has mark and free functions for its smobs. can you get rid of the mark functions? wingo: is gnutls loaded in the test cases you have? civodul: hmm i don't think so civodul: what's the gdb incantation to leads the loaded .so files again? civodul: ah, "info sharedlibrary" civodul: well it is loaded civodul: however in GnuTLS the mark free functions are for 1.8 only civodul: hmm civodul: or maybe not wingo: maybe you can remove support for 1.8 at this point, dunno wingo: might not fix the issues, of course! civodul: yeah wingo: ACTION brb civodul: with 'desc' set to SLOT_DESC_LIVE_SCM unconditionally, it still crashes, though perhaps slightly less frequently (hard to say) civodul: so find_slot_map for 'subr_stub_code' returns NULL, right? wingo: sneek: later tell civodul yes, find_slot_map for subr_stub_code returns null sneek: Got it. sahithi-ihtihas: ERROR: In procedure iota: Wrong type argument: #("phase foo failed after 100 seconds" (0 . 34) (0 . 5) (5 . 10) (10 . 22) (22 . 27) (27 . 34)) sahithi-ihtihas: what might be the reason for this error OrangeShark: sahithi-ihtihas: iota expects a number while the argument was not a number sahithi-ihtihas: understood...Thank you sahithi-ihtihas: how do i get range using iota?? sahithi-ihtihas: (define (range from to) (map (lambda (x) (+ from x)) (iota (- to from)))) sahithi-ihtihas: (range 5 10) sahithi-ihtihas: without a seprate definition like this OrangeShark: so you want a list (5 6 7 8 9)? sahithi-ihtihas: yeah daviid: sahithi-ihtihas: iota accepts a start daviid: and a step daviid: sahithi-ihtihas: look for the definitin in the manual tehere ar a few examples as well OrangeShark: (define (range from to) (iota (- to from) from)) OrangeShark: (iota count start) daviid: ,use (srfi srfi-1) daviid: (iota 5 5) daviid: $3 = (5 6 7 8 9) OrangeShark: oh hmm, there is a stream-range procedure OrangeShark: that basically does this, would be nice to have a normal list range version OrangeShark: in srfi-41 is the stream version rekado_: sahithi-ihtihas: note that there are *two* implementations of iota. rekado_: sahithi-ihtihas: srfi-1 provides the more advanced implementation that accepts a start and step value sahithi-ihtihas: Thank you OrangeShark and daviid sahithi-ihtihas: rekado_: Ohh OrangeShark: rekado_: I can only find the srfi-1 version OrangeShark: where is the other? daviid: OrangeShark: the guile core, if you do not import srfi-1, it will raise an exception if you pas ore then one arg ... OrangeShark: oh hmm, it not documented at all in the manual sahithi-ihtihas: but when i give this kind (iota 1 5) ??why dont i gt same result? sahithi-ihtihas: i expect (1 2 3 4) as output daviid: sahithi-ihtihas: becaue unlike yout range procedure, iota expect the count as its first arg, not from daviid: (iota 4 1) sahithi-ihtihas: but that includes 5 daviid: it works like this: give that 'count' many numbers, starting with ... and using step to compute the next values ... daviid: scheme@(guile-user)> (iota 4 1) daviid: $4 = (1 2 3 4) OrangeShark: oh, totally forgot I had guile installed on this computer :) sahithi-ihtihas: I am somewhere looking around for range kind implementation.....anyways thank you so much daviid: sahithi-ihtihas: np! but iota is fine, yu'll get use to it :) rekado: I’m trying to make a Guix package for chickadee, but it fails to build chickadee/render/shapes.go rekado: In procedure dispatch-exception rekado: In procedure symbol->string: Wrong type argument in position 1 (expecting symbol): #:ffi lfish: Hello, quick question: when I start guile in emacs with geiser I'm greeted with a `guile: warning: failed to install locale', things seem to be fine though, should I worry about it? zxq9: lfish: iirc, it should default to the "C" locale, which equates (generally) to us_en lfish: so, it's only about the language? zxq9: Mostly language, but also bytewise sort order (not all alphabets sort the same way), default currency marker, etc. zxq9: Check Stephanie's answer here: https://unix.stackexchange.com/questions/87745/what-does-lc-all-c-do zxq9: Your env might be missing a locale variable or something, or it is asking for one the system doesn't have installed. zxq9: Assuming your on a unix type system, you could experiment with exporting environment variables before running emacs. zxq9: (You can do that on Windows, too, I just don't remember which command does what in Windows. Does anyone even use Windows anymore?) lfish: zxq9 okay, thanks a lot zxq9: lfish: Anyway, nothing to be concerned about. wingo: sneek: later tell civodul i used to! sneek: Okay. wingo: i should take another look there nilg: How to get documentation for ice-9 in general (what it is, etc)? Thanks. nilg: http://www.draketo.de/proj/guile-basics/#sec-2-7 nilg: How to know all modules under the ice-9 namespace? nilg: Specifically in which version of guile has ice-9 atomic been introduced? wingo: nilg: see NEWS nilg: Thanks wingo, so if I'm reading that correctly ice-9 atomic has been introduced in 2.2.0 wingo: correct :) rekado: davexunit: git clone https://git.dthompson.us/chickadee.git returns 403 rekado: git clone git://dthompson.us/chickadee.git does work, though. rekado: davexunit: is Sly still under development? civodul: rekado: i think davexunit moved on to https://dthompson.us/projects/chickadee.html civodul: i like the functional reactive gimmicks in Sly, though rekado: can’t build chickadee :( civodul: building is overrated, you should do live programming civodul: :-) rekado: okay, I could build it after adding an extra build phase to guile-sdl2 wingo: :0 wingo: :) rather rekado: now I have problems with creating a window rekado: I try the example on the website, but get “Couldn't find matching GLX visual”. rekado: after exporting SDL_VIDEO_X11_VISUALID= I get “Could not create GL context” instead. rekado: do I need to preload some libraries? civodul: rekado: i think that's because it dlopens libGL.so civodul: see libepoxy, guile-opengl, etc. in Guix rekado: chickadee does not do this directly; it uses guile-opengl, which is already patched. rekado: it also uses guile-sdl2 which takes the absolute path of the SDL libraries at configure time. rekado: when I patch the “open-window” procedure to use OpenGL 2.1 instead of 3.3 it works fine until the shader should be compiled. rekado: my graphics chip should support OpenGL 3.3, though. rekado: it would be nice if Chickadee would support slightly older versions. (For shaders it requires v3.30, but my chip on a Librem 13 only supports 3.20.) rekado: bah, guess I’ll have to use Love instead. civodul: rekado: hopefully davexunit will read this later and come up with a solution :-) civodul: BTW, do you have a repo for the picture language? civodul: i modified it a bit and it'd be nice to have that somewhere rekado: civodul: it’s here: https://git.elephly.net/?p=software/guile-picture-language.git;a=summary civodul: thanks rekado! civodul: wingo: how would you suggest dealing with accesses to the "submodules" hash table? civodul: we could do like the call-with-module-autoload-lock trick maybe, unless we don't mind adding a mutex in the module record chrislck: this invalid code- error says "Wrong number of arguments to #f" - shouldn't it be "wrong number of arguments to loop"? caught me a couple times wondering what was my mistake chrislck: (let loop ((n 0)) chrislck: (display n) chrislck: (loop n n)) rain1: yes loop just takes 1 arg rain1: strange that it calls it #f chrislck: I've been afflicted by addiction to named let :-( wingo: civodul: i don't know :) what about wrapping `resolve-module' in call-with-module-autoload-lock ? wingo: that is a heavy hammer tho rain1: I love named let rain1: extremely rare that i want a full powered loop construct civodul: wingo: heavy hammer, indeed, but i suppose that would work civodul: we can't modify the module record type in 2.2, can we? wingo: not really. anyway adding per-module mutexes runs the risk of deadlock civodul: oh right janneke: mes has named let! janneke: Mes also wants real Guile-style modules wingo: ppls wingo: i have been programming c for many years and i don't know when to use #include "foo" or #include rain1: I use "" for files in my project and <> for system headers wingo: weird when you're making a library tho, do you use <> in your public headers and "" locally? wingo: is there a difference between what you do in your headers and what you do in your c files? rain1: i don't think ive ever made a library wingo: (i know that in guile, both work fine.) civodul: wingo: i think is relative to the search path, whereas "foo" is possibly relative to the source file location civodul: in practice they're interchangeable though, AFAIK wingo: i think "foo" also searches the search path wingo: just, after the current directory. wingo: that's the only difference afaiu civodul: yes, that must be the only difference wingo: i will change libguile to include "smob.h" instead of "libguile/smob.h" or then. of course libguile.h continues to include "libguile/smob.h" wingo: i think rain1 is right in practice that "" means "mine" and <> means "not mine" wingo: civodul: does that sound about right to you? hugo: Yeah, both "" and <> searches both your headers, and system headers hugo: Just that "" gives priority to your headers hugo: And <> to system headers wingo: afaiu the only priority that you get with "" is that it adds the directory of the file doing the #include onto the search path, at the front wingo: i think this is not the case with <> wingo: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html civodul: wingo: i find to be "nicer" and clearer, but "smob.h" would work as well wingo: yes i am not quite sure what to do :) i think first i will convert all .c files inside libguile to include the libguile headers like "smob.h". later if we decide to change we can do it automatically wingo: right now there is some inconsistency, so i will first make things consistent wingo: i.e. config.h first, then system includes, then libguile includes (alphabetically ordered), then foo.h for foo.c civodul: ok didi: Can Guile's Web module handle HTTPS? sneek: Welcome back didi, you have 1 message. sneek: didi, taylan says: I can be better accessed through email, via taylanbayirli at google mail rain1: didi I do not know the answer to this but one thing you may be able to do is put nginx configured with HTTPs in front of your guile web app didi: Long time, no see, Taylanub. didi: rain1: Thanks, but I didn't explain myself properly. I mean using it as a client. rain1: oh ok, I am not sure didi: Hence, (http-get "https://www.google.com"), for example. wingo: didi`: i believe it "just works" if your guile can import (gnutls) wingo: over the last week i have deleted code in guile for atari, vms, and cray wingo: i have kept code for obsolete sun and ia64 cmaloney: Now I'll never have Guile on my mon-existent ATari ST cmaloney: booo cmaloney: What about Amiga? :) weinholt: vms is being ported to amd64, it might make some kind of a comeback cmaloney: It's overdue didi`: wingo: I'm on Debian Stable, with libgnutls30 installed, but (http-get "https://www.google.com") is failing here. didi`: https://paste.debian.net/hidden/0ee24897 rekado: didi`: this is fixed in newer versions of Guile. What version do you have? rekado: I think this was fixed in 2.2.3. didi`: rekado: Stable's. Let me see... didi`: GNU Guile 2.0.13 didi`: rekado: I see. Thank you. civodul: wingo: atari, vms, and cray, woohoo :-) civodul: everytime i saw those ifdefs i wondered when they had been useful civodul: esp. the thing with weird pointers on cray ArneBab: I built a simple file upload server with multifile support and no design at all: https://bitbucket.org/ArneBab/wisp/src/7501dc0db3f8cebf49b48634719ab82b4a509a79/examples/upload-server.w ArneBab: I built a simple upload server with multifile support and no design at all: https://bitbucket.org/ArneBab/wisp/src/7501dc0db3f8cebf49b48634719ab82b4a509a79/examples/upload-server.w ArneBab: I built a simple upload server with multifile support and no design at all: https://bitbucket.org/ArneBab/wisp/src/7501dc0db3f8cebf49b48634719ab82b4a509a79/examples/upload-server.w hugo: ArneBab: Cool to see someone actually use Wisp! hugo: Code looks rather good also hugo: But I would recommend using an XML library (such as sxml-simple) since sexp's and xml matches so nicely to each other civodul: scm_to_stringn goes through iconv to convert latin1 strings to utf8 :-/ civodul: that's the most common case (latin1/ascii file names and utf8 locale) wingo: probably it should bottom out to scm_to_utf8_stringn if in a utf-8 locale wingo: probably just needs a change to scm_to_locale_string i would guess wingo: civodul: i think scm_to_port_stringn does the right thing wingo: all other callers of scm_to_stringn look good to me fwiw civodul: indeed, i didn't know that one wingo: civodul: probably most callers of scm_to_locale_stringn should use scm_to_port_stringn anyway civodul: yes but often there's no 'port' wingo: maybe you're right :) civodul: here's what i see: https://paste.debian.net/1029878/ wingo: yuck :) civodul: it's not easy actually because you can never know whether a narrow string is also valid UTF-8 civodul: well, no easily civodul: *not wingo: well, we have dedicated latin1->utf8 converters civodul: yes so we should special-case this in scm_to_stringn i guess wingo: yep nieper: What is the current state of Guile's R7RS support? Is full conformance actively worked on? rain1: nieper: no one is workingon it nieper: rain1: Do you know whether the missing parts (to R7RS compatibility) are documented somewhere? rain1: i don't think there is any documentation about it lloda: nieper: search guile-devel. mark_weaver has been working on that on and off civodul: wingo: this should be an improvement already: https://paste.debian.net/1029892/ nieper: lloda: Thanks for pointing out the guile-devel mailing list. There are a number of helpful R7RS references. wingo: civodul: indeed, though i think we should avoid duplicating that code and instead call through scm_to_utf8_stringn; given that latin_to_u8 has only one caller it will get nicely inlined wingo: but that is just a nit! :) civodul: wingo: scm_to_utf8_stringn does a little bit more than we need, but i guess that's fine? wingo: well it handles the wide case too wingo: which is probably fine :) civodul: it's true that we can make it 2 lines: https://paste.debian.net/1029895/ civodul: see how rusty i am? :-) galex-713: wow galex-713: I juste compiled chickadee for the first time galex-713: always failed with sly galex-713: it features sound, SDF for fonts, and opengl shaders (yet I don’t know what is a shader exactely) galex-713: (but I know curv and libfive use them to display SDF) galex-713: “buffers”, “hook”, recalls me so much of emacs… galex-713: if only there were a standard accross scheme and normal lisp (like el and cl) about these, so interface would be more stable civodul: galex-713: Emacs Lisp and Common Lisp are very different though :-) galex-713: civodul: not as much as them and scheme galex-713: and they have some common points galex-713: but their incompatbilities are narrowing galex-713: right? galex-713: I think I recall cl has grown over time civodul: so, i'm at loss with these crashes civodul: like https://paste.debian.net/1029911/ suggests a missing SYNC_SP or something along these lines civodul: wingo: do you have tricks to display VM frames in gdb? civodul: it seems that the support we have no longer works civodul: can 'struct-set!' be considered atomic? rekado: davexunit: I see you’ve made some commits to chickadee in the past months; will there be a new release soon? rekado: I want to write a little game as a gift for a friend, so I’m looking at my options. OrangeShark: hello everyone galex-713: I wonder if there’s a mail header for saying if a message is really important or not galex-713: ah yeah, Importance lloda: looks like the kind of thing that would be done to check an interface, but it's funny to have it documented. I mean (car) isn't documented (in the repl) :p civodul: hi there! wingo: heya civodul :) civodul: i'm looking at the multi-threading bugs we have in Guix civodul: one issue we have presumably is the non-thread-safe manipulation of the 'autoloads-done' alist civodul: in boot09 civodul: *boot-9 civodul: in theory we could add a "with-mutex" in try-module-autoload civodul: or we could use an atomic box, but OTOH we're on the slow path already wingo: humm... wingo: the solutions there are easy, the problem is just getting things right in terms of boot order :) civodul: right, that's what i was afraid of :-) civodul: so 'make-mutex' is not available at early boot, is it? wingo: i see three options. serializing all module loads with a big fat mutex, or preventing multiple threads from loading the same module at the same time with a mutex and a cond in the module loader code, or adding an "initialized?" flag, a mutex and a cond to each module object wingo: civodul: i think it is available, yes. wingo: er wingo: humm. it's defined in c but only loaded in the (ice-9 threads) extension. civodul: yeah wingo: maybe we can make it so that loading (ice-9 threads) mutates the module loader, replacing some part of it civodul: adding a mutex in each module would be useful longer term (to allow concurrent mutations of the module's bindings), but that's another story (API breakage, etc.) wingo: that might be the right thing; before (ice-9 threads) is loaded, there aren't multiple threads civodul: yes civodul: we could wrap the body of try-module-autoload in 'call-with-big-fat-mutex' civodul: call-with-big-fat-mutex would just call its argument initially civodul: and then, once (ice-9 threads) is loaded, it would take a mutex civodul: something like that civodul: WDYT? civodul: ACTION emails bug-guile for posterity wingo: yes that is probably the simplest thing that can work. if we could avoid adding another name to the default namespace, that would be the best; dunno if that's possible though civodul: currently make-mutex & co. are in the default namespace but they're deprecated wingo: ah, i was looking at 3.0 :) wingo: i think they are not present there wingo: ACTION accidentally did a "make clean"; guess that means it's lunchtime :P civodul: wingo: here's a simple patch that does the job: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31878#10 wingo: civodul: lgtm, but wdyt about making (ice-9 threads) just do a set! on call-with-module-autoload-lock ? wingo: then you could use with-mutex etc wingo: it's more like normal programming at that point wingo: of course a recursive mutex is not great. i.e. generally they reflect a bad design. and in this case it will mean we are serializing a lot of code in the guix context wingo: but, i think it can work here. wingo: civodul: that way, if we managed to make the (ice-9 threads) load be lazy at some point, then we would put off the mutex until ice-9 threads is indeed loaded wingo: dunno wingo: i think it's not bad how you have done it tho :) civodul: wingo: oh sure, we can move set! to (ice-9 threads) civodul: regarding the recursive mutex, i kinda agree civodul: though here i don't have a better idea :-) wingo: :) civodul: wingo: the updated version: https://paste.debian.net/1029697/ wingo: lgtm civodul: cool, thank you! wingo: btw by way of status -- i have been massaging libguile on master so that the vm calls out to the runtime only through a structure containing some function pointers and such wingo: of course it can call anything via gsubrs or foreign functions or whatever, but this refers to the functioning of the vm itself wingo: e.g. "allocate some words", that sort of thign wingo: that will make it so that this structure can live in a register, and jit code can call out to the runtime through that structure, calling functions at known offsets with known ABI wingo: it has taken a bit of time :) i am getting there tho civodul: oh that sounds fun, i need to get up to date with 3.0 civodul: you're living in the future! ;-) wingo: also some scheme primitives compile to calls to functions at known offsets, e.g scm_add and such. when jitted, we'll get to replace that with direct calls civodul: so which functions would be called this way? wingo: known offsets in the "intrinsics" structure wingo: ACTION looks for link wingo: https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/intrinsics.h wingo: basically any runtime facility that compiled code will need, but which you don't want to inline wingo: initialized here: https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/intrinsics.c#n265 civodul: i see, things that in 2.2 are typically instructions or primitives wingo: right, in 3.0 you will end up compiling to e.g. call-scm<-scm-scm with the offset of the "add" instrinsic, https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/vm-engine.c#n1444 wingo: the idea being that it will be less work for a JIT to just implement compilers for the different function types wingo: instead of implementing compilers for all the instructions we might want wingo: also this way there are fewer callouts from the C VM, so fewer opportunities to forget to SYNC_IP() etc... wingo: maybe more precisely: things that in 2.2 are instructions but which are too big to inline civodul: yes, there are a few big instructions civodul: and in 2.2 you'd have to implement them entirely in lightning or whatever JIT library you're using civodul: which could be a pain civodul: intrinsics should definitely make that easier, that's nice wingo: i think probably lightning will be the thing civodul: cool civodul: ACTION pushes a few old patches to stable-2.2 \\o/ civodul: eb90831ce * Add SRFI 71: Extended LET-syntax for multiple values. civodul: woohoo! rekado_: civodul: should we apply your patch to fix the “autoloads-done” problem to the Guile package in Guix? civodul: rekado_: i was thinking we could monkey-patch this civodul: i'll give it a try civodul: i was also thinking we could release 2.2.4 soonish wingo: sgtm :) civodul: wingo: next comes the import obarray: https://bugs.gnu.org/31879 :-) wingo: civodul: what about adding a global low-level pthread mutex to module.c and use it when accessing the import obarray? if it's not accessed from scheme that will be sufficient wingo: since scheme code caches lookups it won't be a long-term cost, and low-level pthread mutexen are relatively free... we could acquire the mutex only if guile is initialized, if that's a win wingo: we could of course just make hash tables thread-safe :) civodul: wingo: you mean a global mutex, not a module-specific mutex, right? wingo: yes i was suggesting a global mutex for access to any import obarray civodul: ok wingo: dunno, just an idea civodul: what about making the import obarray a weak-key hash table? civodul: which is thread-safe civodul: :-) wingo: yes but that has more long-term gc overhead civodul: right, good point civodul: i wonder if the global mutex could lead to contention civodul: OTOH, like you write, there's scheme-level caching as well civodul: wingo: i think i'll go with the simple-yet-efficient approach that you proposed: https://paste.debian.net/1029730/ civodul: how does that sound? wingo: civodul: lgtm! civodul: thanks wingo: thank you :) wingo: ACTION goes home sahithi-ihtihas: Can someone Explain how match:count works with an example rekado_: sahithi-ihtihas: “match:count” needs to be applied to a match structure, i.e. the result of applying “string-match”. rekado_: sahithi-ihtihas: it returns the number of sub-expressions that have matched the target string. rekado_: /me needs to leave now sahithi-ihtihas: Thanks Ricardo sahithi-ihtihas: In procedure vector-length: Wrong type argument in position 1 (expecting vector): #f sahithi-ihtihas: what does this error specify?? wingo: good evening rain1: hi OrangeShark: hello everyone daviid: afternoon greatings here :) wingo: :) daviid: our beloved maintainers seems to be in bug tracking mood! pretty cool to read the emails, fixed, fiex, fixed ... wingo: :) daviid: though i haven't been drinking any wine today, I keep reading 'subtropical experience' (instead of 'suboptimal experience') haha wingo: i think i can remove support for ia64 / itanium in guile wingo: red hat has stopped supporting it entirely i think wingo: also fedora wingo: debian still has a port, though it seems a bit tenuous wingo: hum, there was an ia64 patch last year :P wingo: maybe i can just remove all the ifdefs and rely on bdw-gc to do things right chris_: I never thought there was a difference between '(1 2) and (list 1 2)......... the latter creates *mutable* list... argh wingo: yeah indeed chris_: I never thought there was a difference between '(1 2) and (list 1 2)......... the latter creates *mutable* list... argh chris_: ,leave chris_: Would be grateful for a review of https://gist.github.com/christopherlam/eccab30d3d6a5ebfab3899d6afbc5d5e chris_: 1) it seems to work when run, however is not acceptable to REPL chris_: 2) when run, it seems to mishandle (list-set-safe! #f 1 9) --> expected output = (list #f 9), obtained output = #f mwette: /quit janneke: chris_: from the manual: ‘append’ doesn’t modify the given lists, but the return may share janneke: structure with the final OBJ. ‘append!’ is permitted, but not janneke: required, to modify the given lists to form its return. chris_: janneke: thx i found that i needed to (set! l newlist) or something chris_: so much fun... to me scheme is assembly language, not bound by pointer arithmetic nor malloc troubles chris_: msg for wingo - sorry won't be here to reply it's late here - just wondering about your old code in daily-reports.scm - https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/standard-reports/daily-reports.scm#L187 chris_: I guess the (gnc:make-stats-collector) was used to process numbers only once, and interrogate later on for max/min/average... chris_: Today with modern guile are these accumulators still needed? chris_: I'll be aiming to eradicate use of similar collectors because they're confusing and add values as required chris_: (apply + (map split->value splitlist)) so much better than (for-each (lambda (v) (collector 'add (split->value v)) splitlist) chris_: anyway i'm a bit confusing wingo: chris-afk: that was literally the first scheme code i ever wrote; we should probably assume it doesn't make sense :) wingo: that said, i think that was just copypasta. if accumulators aren't needed for someother reason then sure, you can take the functional tack wingo: jesus wingo: a real thing that's in libguile: wingo: SCM_DEFINE (scm_noop, "noop", 0, 0, 1, wingo: #define FUNC_NAME s_scm_noop wingo: { wingo: SCM_VALIDATE_REST_ARGUMENT (args); wingo: return (SCM_NULL_OR_NIL_P (args) ? SCM_BOOL_F : SCM_CAR (args)); wingo: } wingo: #undef FUNC_NAME wingo: wat janneke: haha chris_: janneke thank you... i thought i was battling emacs in vain louishaemmerle: I am looking at the PEG parsing module at the moment. louishaemmerle: are the declarations dependent on the order of definition? rain1: no louishaemmerle: hmm, I guess I found it (I did tinker with this problem for an hour before asking, then I ask and all of the sudden I find the error) louishaemmerle: I used | instead of / in one of the PEG rules hiphish: Hello Schemers; quick question: what module is ‘open-bytevector-input-port’ in? hiphish: The manual doesn't say it and it's not in the standard module (or whatever it is called when you start up Guile). hiphish: I'm running Guile version 2.2.3, and not even the apropos command seems able to find it. mwette: (io ports) mwette: (rnrs io ports) hiphish: mwette: Thank you! Why did ",a open-byte" not show this before I imported the module? mwette: I don't know. hiphish: It seems that ,apropos shows only the contents of some modules. Maybe the module has to first be loaded before it can be searched. chris_: I wonder if anyone can make any recommendation for an IDE for Guile - I'm considering creating a template-processing program and wish to run it line by line... I used debug back in the day, 't' and 'p' for trace chris_: Is gdb capable of this? jlicht: (ice-9 peg) is simply wonderful :D jlicht: I started looking into it this morning, and I already have things working the way I want them to. hugo: chris_ emacs with geiser is a start for a guile IDE. hugo: It works per sexp, and not line. But that shouldn't be a problem hugo: jlicht: It is great. My I felt a bit let down when using it, since Haskell's parsec is stronger and more flexible jlicht: hugo: fair point, but the nice thing is that the `define-peg-string-patterns' works almost as-is on Backus-Naur grammars. jlicht: although parsec is also great fun rain1: I am a fan of PEG parsers, I made a PEG parser system in racket rain1: half way through I found out guile had one already... so I tried to make mine closer to guiles one as possible hugo: That is a nice feature. But when using it I drifted towards using the sexp based rules instead. Something with everything being expressed in similar ways rain1: it would be cool to get the same code working in both, then people can share parsing code and stuff but quite difficult wingo: if someone wants to maintain and extend (ice-9 peg) as needed, it currently has no maintainer :) hugo: Full compatibility between the two would be preferable wingo: not a bad situation, more of an opportunity i think.. rain1: i attempted to make my racket code work in guile but they have different macro systems and I got stuck but I'll try again hugo: wingo: What do you actually do as a maintainer? chris_: hugo: is there geiser tool to trace sexps one by one? pausing the runtime after each one? hugo: chris_: not that I'm aware of, but it should be possible to implement hugo: Regular sexp can be handled by elisp, but some of the more advanced forms might pose a problem hugo: Elisp doesn't support reader macros hugo: There is always Guile Emacs, but that isn't really ready yet chris_: hugo: shame... I'm looking for the equivalent of DEBUG.COM's t and p... or TurboPascal F7 and F8 from back then :) chris_: the ,trace tool is rather nice but digs into undesired territory eg I don't really wish to dig into (format) loops... janneke: chris_: i've put some effort into an emacs GUD mode for Guile, but that needs some more love and integration on the Guile side chrislck: from comment a couple days ago - I peeked into SRFI-48. omg. chrislck: sneek: botsnack sneek: :) chrislck: further to a comment couple days ago I peeked at srfi-48... omg. wingo: good day guilers rain1: hello janneke: hey wingo wingo: heya janneke wingo: congrats on all that awesome mes work :) janneke: ow, thanks! janneke: i'm very pleased it's starting to land, phew :) wingo: i can understand the relief :-) janneke: you have some experience building compilers and interpreters... wingo: it's horrible when everything is in the air and you can't trust anything! wingo: only way to learn tho :/ janneke: hehe, yeah -- apparently janneke: at one moment, i managed to break less_p (written in C of course) janneke: it took me quite some time to find that, though -- imagine the results you get on anything numeric :) janneke: and this was a pretty harmless, small thing when most was already working wingo: ACTION gets mad at srfi-1.c, a file that should not exist janneke: ACTION cheers! janneke: i've been wondering about some .c files that Mes "just" has in scheme janneke: one thing that has bothered me is to write a new (and rather crappy) Scheme implementation in Mes, just because the aim is easy bootstrapping janneke: wouldn't it be wiser and just about as much work to find a way to make Guile bootstrappable janneke: eg, starting by using lots of #if !BOOSTRAP or something, and indeed, moving other .c bits to scheme wingo: janneke: yeah working on moving more c to scheme. a continual though slow process :) wingo: it's essential to be able to rebase on top of any other target, e.g. webassembly... janneke: wingo: i'm still hoping in a way that Mes will have been an important, but temporary thing, and we'll be able to create a `bootstrappable-Guile'...but that may take some time...years? wingo: yes i think so. i think the things i am doing, moving more to scheme, go in that direction -- but it is taking time :) wingo: i am not directly focused on the minimal bootstrap thing tho, could be there's a more direct path; but i guess mes is a fairly direct path there, so, cool :) janneke: yeah, thanks. it seemed too big a stretch just now, but maybe some time later... janneke: also it may help if mes shows this bootstrap route is working, that might support an effort to make Guile more bootstrappable -- it could well be that we manage to remove Mes/Scheme from the bootstrap path though -- we'll see rekado_: I would expect to see Mes being used to be the bootstrap interpreter in a C-less Guile. rekado_: *being used as civodul: though it's good to keep libguile/eval.c IMO janneke: rekado_: yeah, you put some effort into that when i visited Berlin, right? janneke: at that time, Mes didn't have recursive macro expansion, I added that in 0.14 rekado_: yes, I remember that we got stuck because of macro expansion. rekado_: ACTION gets distracted too quickly :( rain1: isn't guile already bootstrappable rekado_: rain1: yes, via C. janneke: rekado_: hehe, so that path may be worth exploring again, some time rekado_: rain1: an alternative route to get to Guile might be to use Mes as the bootstrap interpreter, not the Scheme interpreter that’s written in C. wingo: libguile 3.0 is about 6% smaller than 2.2, but will get smaller still i think wingo: incrementally :) wingo: anyway, sleepytime wingo: night folks :) janneke: night wingo cmaloney: night wingo. megane: hugo: interesting. when i compile it (guile (GNU Guile) 2.0.11) i get an error megane: ERROR: Throw to key `vm-error' with args `(vm-run "Unrewindable partial continuation" (#))'. megane: sorry. not compile, just by running 'guile test.scm' megane: i tried it with 2.2.3 and it works megane: i thought i was misunderstanding something megane: hugo: thanks megane: (reset (λ () (shift k (list (k 1))))) <- shouldn't this return (list (lambda () 1))? i get a procedure returning '(1) on 2.2.3 rain1: megane: no it's giving the correct result rain1: evaluation doesn't happen under a binder megane: rain1: what's a binder? is reset or prompt a binder? rain1: lambda megane: ok rain1: (reset (lambda () ...)) will necessarily return a procedure, no matter whats inside megane: is this normal shift/reset semantics or a guile thing? rain1: that's standard rain1: (define x (reset (λ () (cons 'x (shift k (list (k 1))))))) rain1: here's an example that might help rain1: (x) will produce ((x . 1)) rain1: so there is like an implicit reset under the binder rain1: (define x (reset (λ () (reset (cons 'x (shift k (list (k 1)))))))) rain1: gives the same result megane: ok. i see. now the results i'm seeing start to make sense rain1: sorry that was wrong megane: i wonder why it works this way and not the way i thought.. rain1: lambda doesn't have an implicit reset megane: hmm! rain1: it's the REPL itself doing that rain1: you can distinguish those 2 expressions by trying (list 'a 'b (x) 'c) rain1: there are a couple different sets of delimited continuation operators, maybe you're used to a different pair megane: rain1: i only "know" shift/reset rain1: yeah they're the only ones I use too megane: btw i get no difference between those two x definitions megane: just running 'guile file.scm' here megane: oh sorry. i copied the same thing twice :P megane: yeah, now there's a difference megane: i think i got led astray by the example (reset (lambda () (shift k (k 1)))), where it seems like the continuation is (lambda () []), but actually is something else megane: rain1: thanks for the help! rain1: youre welcome rain1: yeah the interaction with binders is quite subtle rain1: it takes a while toget a good intuition for the evaluation contexts at play ArneBab: hugo: I’m here with my non-work account. When I post from work, I cannot do long discussions. hugo: ArneBab: ok. What is your other account? ArneBab: hugo: my other account is whatever freenode.net assigns me ArneBab: typically I call myself ArneBab_work hugo: Ok. Where we discussing somuthing? I don't find anything with a quick look in the log ison111: I'm not sure how I should be including files in guile. The way I'm currently doing it seems to give results as if some files were not re-compiled after being changed. ison111: My specific use case is for example File1.scm defines a function "func1". Then say File2.scm calls (func1). If I run it it works just fine but if I change func1 then the code in File2.scm behaves as before the change was made ison111: I have to deleve ~/.cache/guile to make it work ison111: s/deleve/delete/ ison111: Forgot to mention that both File1.scm and File2.scm are being included inside a parent program. janneke: ison111: make File1.scm a module: (define-module (File1) #:export (func1)) janneke: File2 uses that module janneke: ison111: see node "6.20 Modules" in the manual ison111: janneke: I tried that earlier and I think I was getting the same problem. Could it maybe have something to do with the path to File2 being built dynamically? ison111: janneke: Basically there are several directories each with their own "File2" and the user passes in which directory they want on the command line, then the file is loaded like (load (string-append dir "/File2")) ison111: I tried using (include) at first but it was complaining about the string-append. I wonder if load also has some trouble with it as far as detecting whether a file needs to be recompiled or not janneke: ison111: i would advise using modules, and call resolve-modulee in this case janneke: *resolve-module ison111: Ok I'll give that a try, thanks. hugo: Also, 'add-to-load-path' allows you to add directories where modules can be placed ArneBab_work: it would be interesting to see the Guile FFI in this FFI overhead benchmark: https://github.com/dyu/ffi-overhead (also the existing results are pretty interesting — explained here: https://nullprogram.com/blog/2018/05/27/ ) hugo: Interesting tactic. Joining, posting, and leaving hugo: Anyhow, should be easy enough to add guile to that list, if anyone feels so inclined. lloda: format ~NNy doesn't work very well. If you pass it a long list of numbers it will print a single column of numbers, regardless of NN. E.g. (format #t "~20y" (iota 10)) lloda: I would have expected some attempt at line wrapping manumanumanu: lloda: I know what you should not do. Don't read the format source code. manumanumanu: Oh no. Now I did it :( hugo: manumanumanu: I haven't read it. But it kinda has to be complicated since it implements its own DSL for string formatting manumanumanu: hugo: let me just say, it is worse than you think. I read it and decided I would forever use ashinn's fmt lloda: manumanumanu: haha lloda: but I think in this case it's the fault of pretty-print, format just forwards to that lloda: the hairier format parts is things like ~{, ~[, etc rain1: i think format should have an equivalent s-exp format.. which the strings are just a shorthand for hugo: manumanumanu: Is that a alternative library? lloda: is that what fmt does? but, it's hard not to use what's built in :-/ manumanumanu: hugo: yup. it will probably be the format of r7rs-large hugo: rain1: I agree. I'm thinking of something similar to how the PEG library works rain1: you could even implement it with peg :D hugo: manumanumanu: srfi-159? manumanumanu: hugo: yes, something like that hugo: https://srfi.schemers.org/srfi-159/srfi-159.html if anyone else want to read it hugo: Looks really good. Will play a bit with it once I have time manumanumanu: clojuresque lambda shorthand for those who want it: https://bitbucket.org/bjoli/megacut/src/default/megacut.scm manumanumanu: the source is a mess, but I just hammered it out. manumanumanu: (megacut (apply + % %&)) => (lambda (%1 . %&) (apply + %1 %&)) manumanumanu: with a read-hash-extend shorthand #%(+ % %) => (megacut (+ % %)) manumanumanu: I might switch the syntax to a more cut-like syntax, like #%(+ <1> <2>) hugo: manumanumanu: Does it also support nested expressions? Something like #%(+ 2 (* %1 2)) manumanumanu: hugo: yes manumanumanu: arbitrarily deep manumanumanu: Maybe it is not a good idea to call it something with cut, since it has different semantics hugo: Good work then! hugo: cut is so much weaker than I would like. Maybe something like clj-lambda could work hugo: I do however like the syntax manumanumanu: hugo: yeah. it feels consistent with cut, which is similar in a way. The whole %n looks weird once you have gotten used to the also pretty weird <> hugo: But you are kinda forced to have weird syntax to not clash with other bindings hugo: Guile even warns against using defmacro for that reason manumanumanu: well, for this it doesn't really matter since the point of %n would be to break hygiene. In fact, I wrote it using define-macro first jlicht: civodul: thanks for your advice from yesterday! I'm now wondering on how to pass in an 'out-param' size_t, (so size_t*) and read it out afterwards. The FFI system keeps thinking I'm talking about a pointer to a pointer, instead of a pointer to a size_t though civodul: jlicht: to pass a size_t*, you need to pass: (bytevector->pointer (make-bytevector (sizeof size_t))) civodul: after the call you need to dereference that with bytevector-uint-ref civodul: this is pretty verbose and tedious, but doable :-) civodul: you can look at guile-gdbm-ffi or guile-git for examples jlicht: That is why I'm doing this: I'm trying to extend guile-git atm, so I will look further for inspiration there :-) jlicht: thanks! civodul: excellent civodul: guile-git needs love civodul: and releases too :-) jlicht: `define-libgit2-type' in (git types) has either pulled my guile-fu to the next level, or crushed my sanity. Not sure yet which jlicht: it works. The bytevector-uint-ref stuff is tedious though megane: hello megane: why doesn't this work: ((reset (λ () (shift k (k 42))))) megane: but it does if i wrap it into an extra reset hugo: megane: when I evaluate your expression I get 42 supreme8327: hi dadinn: hi all dadinn: couple of days ago I was asking about to showstopper issues, and I still haven't been able to figure out the solution: 1) how to pipe an input port into an output port, a'la > 2) how to be able to call a shell process where I am able to reply to prompts (system/system* seems to finish with errors, e.g. calling cryptsetup to set up LUKS devices) dadinn: to -> two jlicht: using the guile ffi, how do I create multiple levels of pointers? E.g. I have "Foo **r; &r" in C, how would I represent this in guile? jlicht: I already have a `make-foo' and `foo->pointer' function, it's just the fact that there are so many levels of indirection that confuse me a bit civodul: jlicht: (bytevector->pointer (make-bytevector (sizeof '*))) civodul: that creates a "box" to store a pointer wingo: good evening guile daviid: hello wingo! hello everyone... wingo: hi :) rain1: hello daviid: wingo: would you, by any chance, have a few minutes to look at the 2 emails that tommi sent (1 to g-wrap-dev, 1 to guile-gtk-general) about callee owned WCT, I'd be happy to know what you think - I have had zero time to look at it myself actually, so right now I'm like blind on this matter, so to speak ... :) wingo: yeeps, unfortunately i don't really :/ daviid: ok, I'll try ... but i can not garantee ... like mark said in a previous releated email in his answer, i find it strange we'd have to change g-wrap ... after so many years, for something that i beleive you must have addressed in other circumstances maybe ... don't know daviid: it's been so lng I did not look a this code ... scary :) but in the back of my mind, i kind of remember that callee-owned args means we don't pass the argumet from scheme (?), and the function must by overwritten (manually defined ...) shymega: ArneBab: Same error as before, with regards to guild. shymega: Really at a loss of how to proceed here.. not keen on reinstalling the whole Gentoo setup, but its one weird error. ArneBab: do you get the same error when you run this by hand? ArneBab: cd /var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/gnucash/import-export && /usr/bin/x86_64-pc-linux-gnu-gcc -DG_LOG_DOMAIN=\\"gnc.import\\" -DHAVE_CONFIG_H -DHAVE_GUILE22 -Dgncmod_generic_import_EXPORTS -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/gnucash/import-export -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/ ArneBab: gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/gnucash/gnome-utils -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/ ArneBab: libgnucash/app-utils -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/libgnucash/engine -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/common -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/common -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/borrowed/libc -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/libgnucash/core-utils -I/var/tmp/portage/app-office/gnucash-3.1/work/ ArneBab: gnucash-3.1/libgnucash/core-utils -I/usr/include/guile/2.2 -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/libgnucash/gnc-module -I/usr/include/libxml2 -I/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/libgnucash/backend/xml -DNDEBUG -Wno-deprecated-declarations -std=gnu11 -Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-unused -fPIC -o CMakeFiles/gncmod- ArneBab: generic-import.dir/import-pending-matches.c.o -c /var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/gnucash/import-export/import-pending-matches.c ArneBab: (that’s the last line before the error) ArneBab: or this one (which uses guild): cd /var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/gnucash/gnome-utils && /usr/bin/cmake -E env LD_LIBRARY_PATH=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64:/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64/gnucash: GNC_UNINSTALLED=YES GNC_BUILDDIR=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build GUILE_LOAD_PATH=/var/tmp/portage/app-office/ ArneBab: gnucash-3.1/work/gnucash-3.1/gnucash/gnome-utils GUILE_LOAD_COMPILED_PATH=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64/gnucash/scm/ccache/2.2 GNC_MODULE_PATH=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64:/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64/gnucash: /usr/bin/guile -e '(@@ (guild) main)' -s /usr/bin/guild compile -o /var/tmp/portage/app-office/gnucash-3.1/work/gnucash- ArneBab: 3.1_build/lib64/gnucash/scm/ccache/2.2/gnucash/gnome-utils.go /var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/gnucash/gnome-utils/gnome-utils.scm shymega: bit hard to read over IRC, if I'm honest. shymega: but i'll give it a go.. ArneBab: ah, no, it seems like the guild error is a false lead: portage likely cannot write into the auto-compile cache files shymega: right ArneBab: so the first line I wrote, not the second ArneBab: s/line/command/ shymega: yeah, that line is acting a bit funny. could you put it in a pastebin instead? shymega: not to mention it floods this channel :P shymega: it fails anyway when i copy it from pastebin shymega: no such file or directory etc etc ArneBab: you can just get it from line 2694 of your paste — simply search for Error 1 and get the command before shymega: ah. shymega: well, that compiles fine. ArneBab: https://paste.pound-python.org/show/n68c29BChkt6RmgyApqg/ shymega: how odd. ArneBab: then that’s not the error — can you check the other commands just around it? ArneBab: it ran 3 jobs concurrently, so i’m not sure which one errored shymega: the one before it, on line 2692 fails. shymega: i'll gen a new log using -j1, that will help debugging. ArneBab: yes — thank you! ArneBab: does it still write ArneBab: wrote `/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64/gnucash/scm/ccache/2.2/gnucash/gnome-utils.go' shymega: So far? no. shymega: Its nowhere near completion.. its still on 27%. shymega: ArneBab: Failed again. Latest output (with -j1): https://paste.pound-python.org/show/6NmC4rnpeSy5NbNGX5p5/ shymega: And on the same file - qif-import shymega: When running the last command on the problematic file I get this output: shymega: > Illegal instruction shymega: Output from compiling qif-import.scm manually: https://paste.shymega.org.uk/C7YE.log shymega: That is, with "guild compile qif-import.scm" shymega: Not sure if I've done that right. ArneBab: sorry for being silent for a while, got lost in debugging something on my own end shymega: no worries :) ArneBab: I think for the manual compile paths are likely missing shymega: ignore that compiling manually thing shymega: yeah shymega: i didn't include the stuff it needed shymega: not sure i need to, either shymega: it still crashes on other files as well shymega: which is a pain. shymega: although this time, that was with Ninja. shymega: no idea how to proceed, nor am I sure if its a Guile or a GNUCash bug. shymega: But its *definitively* related to the hardware instruction set differences. ArneBab: I think I’m at the limit of where I can help, but there are others here who might be able to. Illegal instruction sounds like wingo could be interested. shymega: Thanks :) ArneBab: thank you for coming here with the error! shymega: no probs. ArneBab: maybe you could get some additional information by replacing adding debug output in the command shymega: what do you mean? ArneBab: or rather add -O0 (no optimization) ArneBab: cd /var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/gnucash/import-export/qif-imp && /usr/bin/cmake -E env LD_LIBRARY_PATH=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64:/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64/gnucash: GNC_UNINSTALLED=YES GNC_BUILDDIR=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build GUILE_LOAD_PATH=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash- ArneBab: 3.1/gnucash/import-export/qif-imp GUILE_LOAD_COMPILED_PATH=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64/gnucash/scm/ccache/2.2 GNC_MODULE_PATH=/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64:/var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64/gnucash: /usr/bin/guile -e '(@@ (guild) main)' -s /usr/bin/guild compile -o /var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1_build/lib64 ArneBab: /gnucash/scm/ccache/2.2/gnucash/import-export/qif-import.go -O0 /var/tmp/portage/app-office/gnucash-3.1/work/gnucash-3.1/gnucash/import-export/qif-imp/qif-import.scm shymega: same result, no other output other than the usual. shymega: rather infuriating! :| ArneBab: -T, --target=TRIPLET produce bytecode for host TRIPLET ArneBab: this is a guild option shymega: right ArneBab: but I don’t see what it could bring shymega: no difference, unfortunately. shymega: sorry. ArneBab: damn ArneBab: does a simple call to guild work? ArneBab: guild compile --help shymega: yeah. ArneBab: I think you’ll sadly have to wait for someone with more experience in the interior of Guile and guild ArneBab: sorry for not being able to help better shymega: OK, thank you for your help though! I'll check in tomorrow. wingo: ACTION goes to see if bind-kwargs can be simplified in any way rain1: why don't we rename "filter" in sxml xpath? shymega: wingo, as per what ArneBab said yesterday, do you have any idea as to the reason & solution with my problem of compiling GNUCash? shymega: I am going to be trying to reinstall Gentoo on this machine later today as well :) mwette: compilers janneke: compilers? janneke: mwette: Caught the last end of broken "/join #compilers". I've been reading Offner's notes on graph-theroy, recommended by Wingo in his flow-analysis blog post. chris3: I've checked manual and don't think I've seen it - anyone knows if it's possible to retrieve the full path+filename for an imported module source code? chris3: e.g (use-modules (srfi srfi-1)) - wish to retrieve path to srfi-1.scm chris3: alternatively how to find the exact filename containing code for an exported definition chris3: because I'm doing coverage analysis and need to (add-to-load-path "/my/home/computer/modules") which is not elegant chris3: so ideally something like (set! filepath (and (defined? 'my-function) (source-location 'my-function))) would store "/home/mycomputer/guilecode/module.scm" in filepath mwette: maybe dig into the Guile module tree and chase down the implementation of `reload-module' mwette: it's in boot-9.scm mwette: haha: (module-filename (resolve-module '(srfi srfi-1))) => "srfi/srfi-1.scm" mwette: "haha" meaning "not super useful" mwette: I meant "ice-9.scm" mwette: er ice-9/boot-9.scm mwette: it looks like you may need to search %load-path in order chris3: mwette thank you, looks like need to hard-code unfortunately daviid: chris3: (dirname (search-path %load-path "srfi/srfi-1.cm")) dadinn: hi all dadinn: question: how do I call a subprocess with system/system* interactively so I can respond to prompts? it seems by default it just ignores any prompts, therefore the calls fail dadinn: another problem I have encountered is that `use-modules` doesn't work according to docs. https://www.gnu.org/software/guile/manual/html_node/Using-Guile-Modules.html#Using-Guile-Modules dadinn: I cannot use keys #:prefix and #:select consecutively. E.g. (use-modules ((local utils) #:select (println) #:prefix utils:)) would be invalid. I have to use (use-modules ((local utils) #:select (println)) ((local utils) #:prefix utils:)) dadinn: Honestly, quite shocking to see such bugs in such core infrastructure :/ mwette: dadinn: I can't duplicate your behavior. What version of guile are you using? mwette: for example, `(use-modules ((ice-9 pretty-print) #:select (pretty-print) #:prefix pp:))' seems to work fine mwette: It provides `pp:pretty-print' as expected. dadinn: mwette: the version is 2.0.13+1-4 dadinn: mwette: also, I thought #:select imports the symbol without applying the prefix, while everything else is through using the prefix... no? dadinn: mwette: otherwise #:select doesn't make sense mwette: dadinn: no: select chooses what you import; prefix sets a prefix for all those imported identifiers mwette: dadinn: if you want to selectively add a prefix use #:renamer ArneBab: dadinn: select limits the symbols you get to just the ones you select. Think of it as "select only". mwette: daddinn: I always do (use-modules ((sxml xpath) #:renamer (lambda (s) (if (eq? s 'filter) 'node-filter s)))) ArneBab: I nowadays mostly use (import (only (ice-9 pretty-print) pretty-print)), but without renaming or prefixing. ArneBab: (so this is not quite the same) manumanumanu: dadinn: I also can't duplicate that, neither on guile 2.0 nor 2.2. How does your module look? dadinn: manumanumanu: (use-modules dadinn: ((local utils) #:prefix utils:) dadinn: ((local utils) #:select (println process->string)) dadinn: (ice-9 hash-table) dadinn: (ice-9 readline) dadinn: (ice-9 regex) dadinn: (ice-9 popen)) manumanumanu: no, I meant the local utils manumanumanu: how is the module defined? dadinn: manumanumanu: shit, you are right, println is not in the exports :P manumanumanu: haha! :D I have done that kind of error sooooo many times dadinn: yeah, it seems to be working fine :) dadinn: manumanumanu: testing it more, it seems I won't get any relevant error message in case utils fails to compile for some reason manumanumanu: for the repl or for scripts? dadinn: manumanumanu: is there a way to separately compile a single file? manumanumanu: I have had some problems with modules that (load ...) other files manumanumanu: but for modules, i do a ,reload (local utils) dadinn: `guile -l utils.scm` jumps to repl, so it is not good for just compiling a module to see if it has errors manumanumanu: import the module from the repl instea manumanumanu: d mwette: To compile a module you can run "guile -c '(use-modules (local utils))' to get errors. mwette: guild compile local/utils.scm also works but does not catch all errors shymega: Hi, I've been having trouble compiling GNUCash on my Gentoo system. The issue seems to be Guile misreading the target instruction set, which causes the build to fail. The log from Portage is here: https://paste.pound-python.org/show/n68c29BChkt6RmgyApqg/ shymega: I'm not sure how to proceed, Guile works fine on my AMD processor, but on my laptop, which uses an Ivy Bridge processor (Intel), it fails. ArneBab: shymega: is this a new Gentoo install? ArneBab: shymega: how did you install Guile? ArneBab: what is guile --version shymega: ArneBab: Its a fairly new install, not that old, and I can't remember if I installed Guile myself, or if it got pulled in as a dep. shymega: Version is: guile (GNU Guile) 2.2.3 ArneBab: so it’s fairly up to date shymega: yeah. shymega: it doesn't have the issue, with the same Guile version on my AMD machine though. shymega: which makes it particularly weird, but it does tie in with the machine instruction set error. ArneBab: yes ArneBab: can you try to run it with MAKEOPTS="-j1" emerge … to ensure that we can be sure of the real first error? shymega: sure :) that is, to compile GNUcash right? shymega: just trying that now with GNUCash. ArneBab: yes ArneBab: I’m on Gentoo myself, but my setup has been more or less broken for the past year, so I can’t give you up to date info shymega: Same result, crashed with "illegal instruction". ArneBab: that was when trying t create guild, right? shymega: with MAKEOPTS="-j1" ArneBab: (guild is the Guile module compiler) shymega: hmm. shymega: can't see it in the logs.. shymega: oh, derp ArneBab: ;;; compiling /usr/bin/guild ArneBab: ;;; WARNING: compilation of /usr/bin/guild failed: ArneBab: ;;; failed to create path for auto-compiled file "/usr/bin/guild" shymega: i did it with my Git checkout shymega: no, i don't get that error shymega: i get a warning about GUILE_AUTO_COMPILE ArneBab: it’s in the log you linked to shymega: oh! ArneBab: directly before the illegal instruction shymega: sorry, i'm a bit tired today and not with it :P ArneBab: no probs … I know that feeling all too well shymega: i did my compilation with the git checkout, and not through portage... .. >_<, so gimme a few minutes, i'll just wait for Portage to do its thing shymega: sorry! :P shymega: again, not with it ArneBab: ok, thanks for checking again! manumanumanu: Good morning everyone! manumanumanu: What are you all up to today? OrangeShark: happy friday manumanumanu: has anyone seen daviid lately? OrangeShark: manumanumanu: daviid said hello yesterday manumanumanu: Damn this timezone bullshit, I am never online when he is manumanumanu: :( manumanumanu: For those interested, I have written a define-method* macro that adds optional arguments to goops define-method using the regular goops dispatch: https://bitbucket.org/bjoli/goops-optional/src/default/optional.scm mwette: My posts to winolog are not working anymore. Anyone else experienced the same issue? Anyhow, I wanted to thank Andy W for the Offner reference. I'm loving that one. (ref: http://wingolog.org/archives/2014/07/01/flow-analysis-in-guile) daviid: hello! manumanumanu just got in ... :) manumanumanu: daviid: ah! manumanumanu: daviid: https://bitbucket.org/bjoli/goops-optional/src/default/optional.scm manumanumanu: optional arguments for goops define method, relying on the proper goops method dispatch manumanumanu: no keyword arguments, because that does't really play well with the dispatch and will slow things down manumanumanu: there is a bug in it currently though. The optional bindings don't evaluate in order (like lambda*), but that is an easy fix daviid: manumanumanu: ok, tx. as you know, use the versio implemented by mark, which I added to grip ... can't remember if it was you who recently did ask and I pastd the link .... daviid: that version allows keyword arguments manumanumanu: but it was an ugly hack that doesn't play well with goops manumanumanu: if all you need is optional arguments, my version is nicer :D daviid: ok manumanumanu: this way does type dispatch for the optional arguments, meaning you can have overloaded define-method based on optional arguments daviid: why do yu say makr's version does not play well with goops, I onlu used it once actually, did you find a bug or somehting? manumanumanu: marks version doesn't rely on goops type dispatch, but on a hack using lambda*. My version can distinguish from overloaded methods with differently typed optional arguments manumanumanu: the difference is probably not of much practical use daviid: manumanumanu: I see, but I think I have a different opionion here :), and would not expect a dispatch for these optional arguments: you see, if that was the case, I would simply write another method (or other methods if more then one arguments ...) manumanumanu: to be honest manumanumanu: well, this macro defines all the different methods (define-method* (hej #:optional a b c) (display (or a b c)) defines (hej a), (hej a b) and (hej a b c) daviid: and I generally prefer keyword args to optional args - optional args, imo, only works well when you are certain that the proc or the method will only take 1, and that 'API' will never change ... in my experience, that is a very rare case ... so I generally use keyword args ... manumanumanu: I use some methods on the repl for fast conversions to strings and such. for that my implementation makes sense, with a lot of overloaded methods manumanumanu: anyway, it was a fun exercise manumanumanu: i like writing macros daviid: manumanumanu: good to have fun :) what do you mean ' with a lot of overloaded methods'? do you have an example I can look at (jut being curious here) manumanumanu: daviid: not now. going to bed. It is getting late, and I have a flight to catch in 5 hours :D daviid: manumanumanu: oh, good night then, never mind dadinn: hi all dadinn: I would like to ask question regarding pipes, how do I convert the following shell command into guile code using I/O pipes: pv -Ss $(blockdev --getsize64 $DEV) < /dev/zero > $DEV dadinn: i have a let* with (in (open-input-pipe (string-append "pv -Ss " dev-size))) ... and (out (open-output-file dev #:binary)) dadinn: i would somehow need to pipe `in` to the `out` i suppose, not sure what command to use :/ lloda: dadinn: you can try looking here if you find what you need lloda: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=test-suite/tests/popen.test;h=2c08774846a1d8c088f68b7ed333eefeaca27856;hb=HEAD lloda: paste.lisp.org is gone :-( :-( lloda: dadinn: I use this myself, with example lloda: http://paste.debian.net/1028323/ lloda: however it waits for the input to end, if it doesn't it will hang lloda: this question comes up often in the mailing list, you can try to search there lloda: I think we should have a few examples in the manual dsmith-work: {appropriate time} Greetings, Guilers OrangeShark: hello everyone OrangeShark: happy day before friday! dsmith-work: heh dadinn: lloda: exactly, in the pipes page in the manual is definitely lacking in using pipes. Unfortunately it means I am stuck with bash for scripting, because Guile manual is inadaquate for scripting everyday tasks. daviid: heelo guilers! djcb: Was looking for something like `(with-mutex )' but couldn't find it... is there something like that in guile? rekado_: djcb: I searched for “with-mutex” in the index of the Guile info manual and found it. rekado_: -- macro: with-mutex mutex body1 body2 ... rekado_: Lock MUTEX, evaluate the body BODY1 BODY2 ..., then unlock MUTEX. rekado_: The return value is that returned by the last body form. rekado_: djcb: rekado_: oh! i feel stupid now :). thanks! dsmith: sneek: botsnack sneek: :) dsmith: yey lloda: I miss being able to pass a value to a kwarg or optional that means 'use the default'. I usually do (define* (f #:key a) (let ((a (or a a-default))) ...)) which looks kind of ugly :-/ wingo: you don't like (define (f #:key (a default)) ...) ? wingo: i guess you can't pass a value there to say 'use the default' lloda: yes, that's it lloda: most often when it's a nested call rain1: that seems like a limited approach because of #f lloda: well yes, it wasn't a proposal. Please read (let ((a (match a (I-want-default-object a-default) (a a)))) ...) or so rain1: hmm i see, whats the question/problem ? lloda: have (define* (f0 #:key (a a-default)) ...) somewhere lloda: then (define* (f1 #:key (a a-default)) (f0 #:a a)) somewhere else lloda: I guess having to put a-default twice? lloda: nvm really dsmith-work: {appropriate time} Greetings, Guilers axd-v: Owncloud-client package is failing to compile on guix commit d53e5b366d03ce29a16d96fbf91075a2de5bbd55 axd-v: I filed a bug yesterday about a similar issue with keepassxc package and it was fixed in a few hours. This might be a similar issue with qt5 or whatever. axd-v: oh damn I'm crazy. I thought this was #guix channel and not #guile. My apologies. axd-v: Btw what has caused a regression in guile speed in guile 2.2? Will it be rectified in 2.3 and beyond? daviid: axd-v: you must have been be mistaken 'somewhere', because guile 2.2 is an order of magnitude faster then guile 2.0 axd-v: daviid: maybe. On the guix channel I overheard someone mentioning something about this. Maybe they were referring to the compilation times and not runtime. Has there been a regression for compilation times? dsmith-work: Monday Greetings, Guilers dsmith-work: Yeah, guile build time is getting slower and slower while the actual generated code is getting faster and faster. dsmith-work: wingo figured out this cool time-shifting trick that transfers wasted runtime cpu cycles to the guile buildtime timestream. dsmith-work: And neatest trick is that you only need to build it once and then save cycles for all! wingo: turrible wingo: going to get better with jit though soon! civodul: :-) dsmith-work: ACTION holds breath in anticipation dsmith-work: ACTION releases it just in time Labu: Hello rain1: hey OrangeShark: hello axd-v: hey, which module or library do I have to load in gulie in order to get access to the functions `first, butfirst, bf, etc` in guile? axd-v: I'm trying to follow berkeley's SICP lectures from 2010 but they're using STK scheme so idk if those functions are specific to that. axd-v: but it seems like those should be packaged in the standard library or something mwette: axd-v: try (srfi srfi-1); I know that has `first' axd-v: mwette: yeah that has first, but not other ones. How can I find out where to look to find these "standard library" functions? axd-v: like, I wouldn't have known to import srfi-1 to get the `first` function. Where do I find this info? daviid: axd-v: by looking in the procedure index of the manual, you can check if it exists, and you also can see if it is in guile core or if you ned to import a specific module ... thee indexes, procedures, variables, concept ... are your friends daviid: axd-v: also check this https://github.com/zv/SICP-guile axd-v: daviid: are you referring to the guile manual? daviid: axd-v: yes axd-v: daviid: well the lectures also use functions like butfirst, butlast to split apart different collections. In the procedure index on the guile manual those functions are absent. Are they just part of STK scheme libraries or what's up about that? daviid: yes, try to see if the link I just pasted helps ... it says it has all the exercises solved ... axd-v: daviid: thanks I'll check it out. Just trying to understand the standard library organization for now. Those indexes are pretty nice. daviid: axd-v: check this as well https://mitpress.mit.edu/sites/default/files/sicp/code/index.html daviid: you may build your own guile modules using all this ... then try solve the exercise on your own ... axd-v: daviid: thank you very much, gonna try to incorporate it all together. A lot of supplemental material. I'm trying to get emacs to work with an textinfo version of the book. daviid: welcome daviid: good luck lispmacs: hi, can I catch the error where I try to call a method but the method is not defined for that type? lispmacs: basically, I had part of my code where I wanted to check if a method could be called on an object, or try it and catch the error, either way daviid: lispmacs: 8.6.6 Handling Invocation Errors mwette: greetings ... mwette: \\me is working on use of (language cps) mwette: ACTION is working on use of (language cps) spauldo: I'm attempting to compile Guile on FreeBSD and it's not liking it at all. spauldo: autoconf won't find any of the required libraries that have a --with-blah-prefix= option unless I specifically add that. Everything it's looking for is in /usr/local. spauldo: I did manage to get 2.2.3 to compile, but not install due to some kind of shell script issue (trying to read from "", IIRC). So now I'm trying to compile from HEAD. spauldo: It appears to be working - no errors, at least - but it's been sitting at bootstrapping ice-9/psyntax-pp.go for a couple hours now. spauldo: what I assume is the output file from whatever it's doing is 0 bytes. It's running a guild compile, apparently. spauldo: Anyway, I'm just wondering if anyone on here has gotten it to work on FreeBSD and if so, what am I missing? I'm using gmake and bash, I've set the location for all the libraries and specified the threaded garbage collection, and all the prerequisites are there. At this point I'm not sure what else I can check. mwette: hmm .. I was able to get one of the older versions to build. Did you read the FreeBSD stuff in the README? mwette: you need pkgconf, gmake and boehm-gc-threaded spauldo: Oh, sorry, was on another desktop spauldo: Yeah, I read that. They're all there. spauldo: If you managed to get an older version to work, I might give 2.2.0 a try. The exact version doesn't really matter for what I do, but I do want 2.2. mwette: I nuked that distriution, but let me see if I have any more notes around. spauldo: Oh, wow. I just checked back on it, and it finally finished that file. I feel kinda silly now. mwette: The version I got working was 2.2.2 on FreeBSD 11.0. "make check" worked. I don't remember if I ever ran "make install" spauldo: After it hit the two hour mark I was sure it was stuck in a loop or something. spauldo: OK. I did get 2.2.3 to compile just fine, but it was the install that wasn't working. mwette: prebuilt/ does not have freebsd, so yea, that long time is normal spauldo: I've still got the built source tree for it, so I can try to reproduce the error again. mwette: good news -- happy hacking ... spauldo: I'd like to be able to submit a bug report or something if I can pinpoint exactly what the problem is. mwette: send to bug-guile at gnu.org if you find it spauldo: it's really weird. It's happening in /libguile with make install-data-hook. The command that gets printed is this: spauldo: /usr/bin/install -c -m 644 /opt/guile/lib/libguile-2.2.so.1.3.0-gdb.scm spauldo: which gives the error: spauldo: install: : No such file or directory spauldo: You'd think it'd give an error saying there's not enough arguments or something mwette: use gmake -d mwette: ? spauldo: ye gods, that's a lot of stuff spauldo: up, there it is. It's a sed error. I remember something about that on the mailing list, but since it didn't seem like that was the error I was getting I thought I was OK. I'll have to look again and see, but I think someone said there was a patch for it. spauldo: I never knew the -d flag, thanks. That'll come in handy. mwette: YW spauldo: Well, that fixed it. spauldo: OK, so, if you want to compile guile 2.3.3 on FreeBSD 11.2, do the stuff in the guide, specify --with-blah-prefix=/usr/local for all the configure options that have that, be sure to use gmake and bash (not sure if bash is required), and follow the directions in bug #30011 for editing the Makefile.in in the libguile directory. OrangeShark: hello everyone OrangeShark: happy friday! daviid: hello! happy friday yes civodul: hey hey! civodul: Happy Friday Guilers! dsmith-work: Happy Friday, Guilers!! NingaLeaf: how do you run a '.go' file? daviid: NingaLeaf: we don't "run go files", we write script(s) that import and use modules ... look for 4.3 Guile Scripting in the manual ... NingaLeaf: oh i thought i read that .go files was a complied version of a script and could be executed on the guile vm NingaLeaf: similar to java bytecode execution NingaLeaf: what is the .go file used for if you can't run it? NingaLeaf: is it used as a type of intermediate representation for the guile vm? NingaLeaf: I inherited a guile project and now i'm working my way thought the language and ecosystem daviid: NingaLeaf: what project? NingaLeaf: oh a work project NingaLeaf: the project is like a microservice implementing a directed acyclic graph for a ML application and the original author chose guile rekado: NingaLeaf: the .go file contains byte code. If it exists it is preferred over the readable Scheme code, which would otherwise have to be interpreted. NingaLeaf: rekado: thanks! this what i assumed, but wasn't sure. dsmith-work: Greetings, Guilers daviid: NingaLeaf: to complete rekado's explanation, if the go file does not exists, unless you would have set GUILE_AUTO_COMPILE to 0 (zero), guile will create one ... but we don't "run these go files', we import their corresponding module (see use-modules in the manual) and use their exported procedures, syntax, methods .. daviid: NingaLeaf: I don't know ML, and so I don't know how one does call guile from ML, get access to the results ... is the existing code you 'inherited' pure scheme code or C code using libguile? dreamer_: hello ! I'm trying to use chickadee (https://dthompson.us/projects/chickadee.html) and I first installed all the dependencies, but when I run ./configure I get "required guile module not found: (gl)" dreamer_: yet when I run info gl, It works. What gives ? amz3: dreamer_: you must install guile-opengl lloda: guile doesn't print some unicode, is there a reason for this? lloda: scheme@(guile-user)> '❌ lloda: $2 = #{\\x274c;}# lloda: civodul: weird indeed civodul: did you check libguile/print.c? lloda: I did not lloda: I see print_extended_symbol etc. lloda: other stars print fine, is this in another UC category somehow? civodul: symbol_has_extended_read_syntax may be what we're looking for civodul: yeah, dunno civodul: CROSS MARK has category ".:Base" says Emacs civodul: not sure what that means lloda: the only meaningful difference I see in fileformat.info is that CROSS MARK is from 2010 and e.g. MULTIPLICATION X is from 1993 lloda: (if that is meaningful) civodul: yeah, ✕ and ❌ appear to be in the same categories and everything dreamer_: amz3 : I have installed guiled-opengl dreamer_: that's why I don't understand dreamer_: guile* dreamer_: as well as guile-sdl2 dreamer_: in /usr/local/lib/guile/2.2/ccache, I can see gl glu glut and sdl2 folder and the make && make installs went without a hithc djcb: Hmm, odd problem "In procedure module-lookup: Unbound variable: for-each" djcb: For some reason, in my module it can't find this when I have (use-modules (srfi srfi-1)) dreamer_: It's my first time using a scheme , so I don't know whether I should explicitely point to the modules or something.. I'll go to sleep and investigate tomorrow djcb: dreamer_: might need to set GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH djcb: see the guile manpage dreamer_: YES dreamer_: SWEET JESUS MONAD dreamer_: THANKS cmaloney: Jesus Monad saves OrangeShark: amz3: I see. How hard do you think it would be to port to Chez? civodul: OrangeShark: i suppose you're talking about porting *from* Chez? ;-) OrangeShark: civodul: no, amz3 was mentioning porting stuff to chez civodul: heheh civodul: heya dustyweb! civodul: dustyweb: would you feel like making a guile-gcrypt release? :-) dustyweb: hi civodul dustyweb: unfortunately the next month is insanity mode so I don't think I can... but, I think you have commit access, and I'd be happy if you did a release...? civodul: dustyweb: heheh :-) civodul: do i have commit access? civodul: i mean there's no rush, but at some point we should consider taking that route dustyweb: civodul: I thought you did... dustyweb: civodul: I agree it should be done though dustyweb: and if you want to ping me in July dustyweb: I can do it then dustyweb: we are moving within a month dustyweb: and I also have strong deadlines dustyweb: so that's making my life topsy turvy dustyweb: it's a large move too civodul: dustyweb: oh sure, i understand civodul: guile-gcrypt can wait after your move, of course civodul: moving is always a drain OrangeShark: hello everyone rain1: hi OrangeShark: amz3: so the reboot will be about sharing datasets? Will the scheme company you want to create be related to neon? amz3: OrangeShark: actually, I think the scheme company will not happen as of yet, because I don't want to leave my $WORK amz3: OrangeShark: yes it's related to neon and sharing datasets amz3: OrangeShark: that said, I need to focus on my day job for the time being, so don't expect update until the end of the summer I think amz3: also I am considering using chez scheme, I did not settle yet, but If I can port the webserver and fiber to chez I will use chez i think... djcb: Hmm, GUILE_PKG resolves to guile-2.0, even when I have guile-2.2 as well (Fedora 28) djcb: if I explicitly use GUILE_PKG([2.2 2.0]) I get an error that the /bin/guile is not 2.2 djcb: related, who do I get the correct guile-snarf (or guile-snarf2.2) ? civodul: hey djcb civodul: djcb: GUILE_PKG first checks for guile-2.2.pc, and then for a 'guile' command civodul: if they don't match, i think it barfs civodul: so roughly, you have to make sure PKG_CONFIG_PATH and PATH agree with each other djcb: hmm, so on Fedora 28, with both 2.0 and 2.2 installed, /usr/bin/guile is guile 2.0.14 djcb: guile 2.2 has a binary /usr/bin/guile2.2 djcb: now, guile-2.2.pc actually has a variable 'guile' which refers to the correct binary djcb: so, it seems GUILE_PKG should use that, or? civodul: hey Guilers! civodul: we need a volunteer to take care of guile-sqlite3! civodul: it's a nice little project, and those who step up to maintain it will be glorified :-) civodul: it's here: https://notabug.org/civodul/guile-sqlite3 civodul: if glory isn't your thing i'm happy to offer a beverage or a cookie or something civodul: think about it :-) rekado: in addition to a cookie from civodul you could get a home-made pizza from me. And a hazlenut cup cake. daviid: :):) civodul: ice cream anyone? civodul: with this much we'll probably end up with a whole steering committee rekado: hah :) daviid: how about dannym? civodul: yep that could work very well if he's not too busy daviid: I see there is a (2 months) pending merge request for sqlite-busy-timeout, what is the blocker? civodul: daviid: i think it was actually integrated but i just didn't go through the web ui civodul: another reason why we need someone to take care of it :-) daviid: ah cool! I don't like this pr workflow actually, and hate to have to browse to deal or participate to (any projects) ... but it seems you solved it now :) daviid: civodul: do you have any particular 'urgent' need? civodul: daviid: not really, just commitment to the maintenance work: releases, bug fixes, etc. civodul: which is really not that much daviid: ah no you did not merged it yet (in the interface) I was browsing danny's fork (I'm such a pathetic borwser :)) lloda: just wasted 10 minutes looking at this error: possibly unbound variable `function–name' lloda: What about a "did you mean 'function-name'?" hint? Even gcc does it nowadays ;p civodul: lloda: definitely! civodul: Guix has hints along these lines nowadays janneke: do we have a function to replace a string in a string? janneke: it seems i'm always struggling with this janneke: thank you for listening janneke: ACTION writes a string-substitute using string-contains and string-replace rain1: we dont have it, guix does and I was thinking about moving it into guile stdlib rain1: and possibly renaming it janneke: that is so weird? janneke: i just wrote janneke: (define (string-substitute string find replace) janneke: (let ((index (string-contains string find))) janneke: (if (not index) string janneke: (string-append janneke: (string-take string index) janneke: replace janneke: (string-substitute janneke: (string-drop string (+ index (string-length find))) janneke: find replace))))) chrislck: janneke: someone will come along and rewrite it using named let chrislck: I have in mind, an inkling that repeated string-append isn't terribly memory efficient, but this may come from python.... a named let could iterate a result starting from '() accumulating substrings, and a final (string-append result) to create 1 long string. chrislck: otherwise it looks good janneke: chrislck: thanks, named let is also fine janneke: it would be nice to have something like that in srfi-1 janneke: eh srfi-13 rain1: yeah its a shame it isn't in there chrislck: srfi-13? chrislck: yeah everyone writes it... but it's excellent fodder for newbies rain1: http://git.savannah.gnu.org/cgit/guix.git/tree/guix/utils.scm#n570 janneke: isn't that the string library? janneke: rain1: yes, we really need some of those in guile or another library rain1: i agree janneke: i was hoping gash would catalize that dfroger_home: Hi, trying to compile guile-2.2.3 from sources, when running 'make', I get the error: Throw to key misc-error with args ("primitive-load-path" "Unable to find file ~S in load path" ("ice-9/boot-9") #f) dfroger_home: on debian stretch mwette: dfroger_home: hmm ... that tells me the environment is not getting set up somehow. I assume you did not move anything after `configure ...' mwette: does the file meta/guile have the right top_builddir in it? janneke: hey mwette, would you be interested to join us on #bootstrappable now and then? janneke: mescc can now (for a big part thanks to nyacc) build tcc mwette: janneke: I will make attempt ... dfroger_home: mwette: thanks for the reply, yes top_builddir is correct janneke: mwette: great, thanks dfroger_home: Building guile-2.2.3 in directory "/home/david/Téléchargements" fails, but in "/home/david/tmp" works. Problem with non-ascii character in paths? manumanumanu: anyone here good with goops? Say, if I were to write display as a generic procedure, how do I handle optional arguments like the port argument of display manumanumanu: ? daviid: manumanumanu: you would define 2 methods, one with a single argument, the other with two args manumanumanu: haha. I'm stupid daviid: manumanumanu: not at all, these 'things' become obvious only after you've played a bit with all this ... manumanumanu: I could probably abstract that away with a macro daviid: manumanumanu: in this case I don't think it's worth it, but if you really wan't to only have one method with an optional arg, then mark weaver wrote a define-method* that I included in Grip recently, that I should release soon, but in the mean time, you may grab it, here: daviid: http://git.savannah.gnu.org/cgit/grip.git/tree/grip/goops.scm?h=devel manumanumanu: daviid: thanks daviid: np! lloda: how can I tell emacs that #2() or generally #...() is a single s-expr for C-M-SPC purposes civodul: hi there! civodul: dustyweb: you've seen https://www.michaelburge.us/2018/05/15/ethereum-chess-engine.html ? wleslie: also https://agoric.com/2018/05/21/introduction.html dustyweb: civodul: I did see it... in fact I had started writing up a similar plan to Pyramid before it was announced called "Smarm" dustyweb: https://github.com/WebOfTrustInfo/rebooting-the-web-of-trust-fall2017/blob/master/draft-documents/smarm.md dustyweb: but it was never finished dustyweb: civodul: basically the idea was to take Rees' w7 scheme and restrict it in space/time deterministically dustyweb: civodul: I dunno if you've read up on the attacks on Etherium contracts dustyweb: poor language hygeine! dustyweb: they never would have happened in an ocap environment dustyweb: https://medium.freecodecamp.org/a-hacker-stole-31m-of-ether-how-it-happened-and-what-it-means-for-ethereum-9e5dc29e33ce cmaloney: Please let me know: which Earth am I on? I thought I was on M1 but I'm starting to wonder civodul: dustyweb: yeah i remember you were looking into smart contracts in Scheme cmaloney: dustyweb: I just read through that article and now I'm even more afraid of our future. cmaloney: I mean, JavaScript-based global virtual machine currency? cmaloney: It's like someone said "name three things that keep security folks up at night" and they rattled off "JavaScript, trusted computing on other folks machines, and monetary-incentivised attacks". cmaloney: and then made an ICO rain1: haha i love the way tyou described thaht cmaloney dustyweb: heh :) dustyweb: cmaloney: well, depending on how javascript is done dustyweb: it could be reasonably safe dustyweb: there's a branch of javascript that *is* ocap-safe dustyweb: and Mark Miller's new startup is going to do smart contracts with a restricted, ocap-secure version of js dustyweb: if there's anyone I trust to do things secure dustyweb: it's Mark Miller OrangeShark: hello everyone rain1: hey cmaloney: dustyweb: Right. But is that version of JavaScript going to be merged back into ECMAScript cmaloney: or is everyone else going to have to learn that lesson the hard way? :) cmaloney: ACTION add https://www.youtube.com/watch?v=w9hHHvhZ_HY to his watchlist amz3: hi OrangeShark amz3: OrangeShark: I got an idea what do with my neon project amz3: OrangeShark: Actually, I will reboot the idea that get me started amz3: That is sharing datasets amz3: and talked of the idea to un ex-colleague and he is excited by the idea, he did not reply about my idea to build Scheme company tho daviid: fibration: (reading the log ...) what did you want to ask wrt guile-cv? manumanumanu: So, I ported the common lisp once-only macro to scheme for use with define-macro. manumanumanu: I like using pattern matching macros manumanumanu: the once-only is a 3 levels deep looping construct, whereas it can be implemented as a single define-syntax-rules macro ays: https://paste.debian.net/1026281/ this function is supposed to normalize a list. It's not doing that for some reason. I have been working on this for hours. Any suggestion would be helpful. wleslie: (flatten) should never appear in the first argument position in a (cons) ays: wleslie: there are two lines with cons. Which one do you mean? wleslie: only one has (flatten ...) in the first argument ays: If I remove that, both cons would be the same. How would that work? daviid: ays: https://stackoverflow.com/questions/19229444/flattening-a-list-of-lists ays: daviid: thanks. I am reading the answers amz31: at the bottom of the page https://www.gnu.org/software/guile/download/ the «2.2 stable series» in snapshots section is a dead link duper: doesn't guile have a list flatten procedure? fibration: any guile-cv hackers here? fibration: never mind... i'm stupid... ;-) manumanumanu: Anyone have an idea why this won't work for guile2.2.3? https://pastebin.com/HSagiNpD manumanumanu: I suspect it has something to do with syntax->datum not being properly recursive leaving (fun car) as raw syntax manumanumanu: I get "unhandled constant " ays: is there a package manager for guile? perhaps in development? I would like to contribute to something like that. galex-713: ays: there was guildhall I guess, and guix also can be used for that OrangeShark: guildhall, guix has a bunch of guile packages, and there is also something else that wingo worked on a bit that uses guix. I think it was called potluck galex-713: ah yeah potluck, forgot this one OrangeShark: not really sure what is the best direction for guile to go in for package management. ays: I think a standard package manager would really help guile's adoption. I am thinking of working on something like bundle in vim, but for guile. ays: *vundle in vim OrangeShark: ays: what is special about vundle? galex-713: I think something standard and specific but based on guix would be cool, especially if guix became better ays: OrangeShark: vundle uses github or other git-hosting sites as repositories for plugins. Perhaps something simple like that to pull down modules and update them using a vcs would be helpful. OrangeShark: ays: you can look into guix, it does have have the ability to pull from git hosting sites OrangeShark: and I think that might have been what potluck was aiming to do as well OrangeShark: ays: https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00250.html ays: OrangeShark: I am looking into potluck. Seems like something I can build on top of. duper: doesn't guile have a list flatten procedure somewhere? duper: thought it would be defined in the REPL by default but it's not OrangeShark: duper: I don't think there is one. A lot of list procedures were added in srfi-1 galex-713: why not flatten? :o jcowan: galex-713: Olin didn't think of it, that's all galex-713: Olin? galex-713: jcowan: ^ jcowan: Olin Shivers, Scheme maven, author of scsh and SRFI 1 as well as other SRFIs galex-713: ah galex-713: srfi are definitives and unexpendable right? :/ jcowan: I'm not sure what that means. They are not standards. Some have a high degree of acceptance in the community, some have effectively zero acceptance beyond the author. ecraven: ACTION secretly thinks it would be great to have minor "updates" of some srfis, to add things like `flatten' to srfi-1 jcowan: SRFI 1 is extremely well accepted, partly because its sample implementation is portable and efficient, partly because it's a comprehensive (though of course not all-inclusive) standard. galex-713: jcowan: I mean, if he wanted to add flatten to srfi-1, that wouldn’t work right? it’s like rfc: you publish them and if something went wrong, either you go with it for the rest of time or you make a totally new one right? galex-713: ecraven: agree jcowan: Mmm, somewhere between. Adding new functionality is beyond the scope. Errors can be corrected. jcowan: The only reason not to write a new SRFI is basically numerology amz3: what does that mean? amz3: jcowan: ^ jcowan: People like the number 1 and it has cred. If you rewrote it today it would be 161 and everyone would say "161? WTF is that?" amz3: I am thinking about writing a srfi for a subset of rdf amz3: based on microkanren jcowan: Similarly, ASCII is ISO 646 and Unicode is ISO 10646. The resemblance helped to sell Unicode in its early days amz3: but that would be rather "big" compared to current srfi amz3: also I need to figure how datomic does recursive queries it seems like arcana knowledge or somethign, there is no doc about it amz3: or little jcowan: srfi 160 has 559 procedures in the API amz3: to be interesting it should implement a pluggable backend amz3: ok jcowan: granted only 43 unique procs * 13 subtypes jcowan: If it winds up being too big to review, srfi-editors@ (aka Art Gleckler) will let you know amz3: well, it's not big in terms of procedure, but in terms of knowledge, that's how at least I perceive it. jcowan: it's fine to break up something large into multiple pieces, as long as each is implementable (they can depend on others) amz3: yes I was thinking about that too jcowan: You can incorporate RDF documents by reference amz3: yes amz3: to submit the srfi for review I need to have the code + the writing? amz3: I need the code first, I did not even read the new microkanren book amz3: btw, fwiw, the ditital edition is readable amz3: btw, fwiw, the digital edition is readable galex-713: amz3: what is rdf exactely? I only understood from far away it was about semantics and AI and interesting but I never understood more galex-713: I barely understood XML Schemas beyond being an XML version of DTD having less or more stuff in some ways I guessed… amz3: those are different stuff XML and RDF amz3: both edited by W3C like HTML amz3: galex-713: rdf is a set of 4 tuples amz3: I mean a rdf database is a set of 4 tuples amz3: a set means that all tuples must be different galex-713: yes I know, that’s where I learnt about them galex-713: different like of different types? galex-713: why 4? galex-713: so it’s even a database thing? amz3: the canonical naming for the 4 tuples is (graph subject predicate object) but I prefer (collection uid key value) amz3: different like they have different equal? amz3: different in the sens of equal? galex-713: what’s the difference between uid and key then? galex-713: ah ok amz3: the original rdf is a 3 tuple called triple store, but 4 tuple is convenient to create the equivalent of sql tables galex-713: Damn I recently discovered Curv, through libfive, it’s astounishing :o galex-713: amz3: why? amz3: galex-713: to be able to put different things in different namespaces galex-713: ah amz3: I use to use 'namespace' instead of 'collection' amz3: I am not sure about the naming still working on it galex-713: why not doing hierarchizable rdf databases then? amz3: it's more general that a hiearchy galex-713: how can it be more general? amz3: uid unique name of a document, where as key is an attribute, like a dictionary key, if you fetch all tuples that starts with ("posts" 42 _ _) then you have an assoc of keys and values galex-713: a graph? amz3: galex-713: yes galex-713: what would be 42 then here? galex-713: it’s like the 42th post? amz3: it can be used to build graphs amz3: galex-713: yes galex-713: then what is the key, if not the post number? amz3: that's exactly like 42th post amz3: key is the third component of the tuple galex-713: yeah okay, but what would it be used for, for instance? galex-713: I have difficulty understanding stuff without examples galex-713: without knowing its usage, I easily forget stuff and wipe it out my mind amz3: it can be for instance (('title . "RDF the easy way") (date . "2018/05/23)) galex-713: oh wait amz3: galex-713: like everybody else ! galex-713: me more I guess :P otherwise I wouldn’t say that amz3: coding helps to remember galex-713: you mean like there would be ("posts" 42 'title "RDF the easy way") ("posts" 42 'date "2018/05/23") ("posts" 43 'title "RDF the hard way") ("posts" 43 'date "2018/05/24")? amz3: galex-713: well, rdf is database it just that it looks fancy, because it's not oracle amz3: galex-713: yes galex-713: it seems to also have a more minimal base on which you build referential-like stuff like the rest amz3: galex-713: yes galex-713: except it seems like it could as well reimplement SQL or noSQL, and if you want performance you would likely implement it such as something not that RDF-y (more like SQL) actually, right? amz3: galex-713: it's minimal schema (the 4-tuple thing) is all you need to build more complicated structure amz3: galex-713: it's minimal schema (a set of 4-tuple thing) is all you need to build more complicated structure amz3: like scheme simple powerful primites ;) galex-713: why not 3? and how do you build graphs with the first element? amz3: galex-713: how would you name the 3 tuple then? amz3: (uid key value)? amz3: or something else galex-713: why 3-4? it seems a little bit arbitrary to me still… why not 5 or 2? amz3: (uid attribute value) amz3: galex-713: I already explained amz3: you need at least 2 to create assocs galex-713: or, (key value), and it would be an assoc list and we already use (and could use) that for a wide range of things galex-713: yes amz3: but without a third element you can't name a particular set of assoc amz3: yes amz3: exactly amz3: it's like (module variable key value) galex-713: amz3: what if you have another assoc which points to the other assocs? amz3: an assoc has a pointer/variable associated to it amz3: that's uid amz3: galex-713: it can only reference another assoc by identifying it using 'uid' or both 'namespace' and 'uid' if it's 4 tuple amz3: all that is explained nowhere i had to figure out amz3: so maybe it's not the best way to explain, but I am certain amz3: that 4 tuple is the best amz3: 5 tuple becomes hairy amz3: just try to add another element to the following tuple ("post" 42 'title "RDF's future") amz3: it could be amz3: ("http://w3c.org" "post" 42 'title "RDF's future") amz3: or something like that amz3: but like I said, it's complicated galex-713: couldn’t you have something like ("posts" (42 (title . "RDF the easy way") (date . "2018/05/23")) (43 (title . "RDF the hard way") (date . "2018/05/24")))? amz3: what you can do with a 3-tuple you can do with a 4-tuple, it's just that 4 tuples are more handy amz3: you mean, nest the tuples one inside the other amz3: build a hiearchy? amz3: building a hiearchy? galex-713: so you have a cons ("posts" . ) in this assoc, conses of (uid . 42 title "RDF the easy way") amz3: in a 3 tuple yes galex-713: no way it would be a true uid galex-713: like galex-713: (1234 title "RDF the easy way") amz3: well, it depends how you build uids galex-713: ande somewhere there would be (1234 . ) galex-713: really, nor sql tables, nor rdf… are really intuitives to me, it’s just like you have so many ways of doing everything and there are too few constraints to help you choose galex-713: so is rdf the ideal minimal way of storing it? galex-713: or what would it be? amz3: galex-713: there is various constraint that leads to those choices amz3: galex-713: once you know the constraints you understand better the final result galex-713: I’d need to see implementation of sql tables (using multiple files and server, like mariadb, not sqlite) and rdf to understand I guess amz3: I think galex-713: Also I always wondered why sql is implemented upon filesystems instead of the other way around galex-713: like ZFS really got db-like features amz3: different constraint and needed features galex-713: why reinventing the wheel then? why not bringing these features to all files? amz3: yes, but you have limited transactions for instance amz3: to have better performance amz3: in some limited cases galex-713: also db are more generic and configurable, why not a generic system that could be casted/configured/compiled into something as specific and efficient as a filesystem but maybe more extensible or easy to grasp? galex-713: amz3: compared to what? amz3: "one program to rule them all" doesn't exist, it's like the universal physict theory of things galex-713: are you arguing for or against modularity here? not sure of understanding your quote amz3: not at all amz3: you say that you want a single software for both database and filesystem, is that correct? galex-713: no amz3: what is it then? galex-713: I said it would be cool to consider a filesystem as a specific occurence of a database, and build a filesystem-less database, and upon the database a filesystem amz3: hmm amz3: you mean to write directly to the device? galex-713: or better layering: physical layer, adapting to used technology (network, hard drive, ssd, ram, etc.), then building database, and then a particular specialization of it that would be POSIX/ACL/SELinux/etc. filesystem galex-713: yes galex-713: and then the filesystem would just be an occurence of it galex-713: because also you wouldn’t treat storage to ssd and hard drive the same galex-713: network is even more different galex-713: and ram too, but can have some things in common galex-713: but maybe I’m going too far amz3: one might say, filesystems are already an occurence of databases, the difference is that fs talks to device, whereas db talks to fs/kernel ... at the ned of the day they use the same algorithms amz3: I mean they share some algorithms galex-713: yes but filesystem works without database, whereas database is more general galex-713: this seems like a nonsense amz3: why do you think a database is more general? galex-713: because I can really easily imagine making a table of file with inode/type (directory, hard/sym link, file, device), content, and POSIX/ACL attributes and that would give a fs, maybe even an usable one amz3: of course, but it will not be efficient amz3: at least not as efficient as database galex-713: while for building a generic database for a fs, since the fs is clearly hierarchical, while the database may be a graph or just a mess of tables (then it would be 3D data: multiple tables, each table multiple rows, each row multiples values, but that’d be it) so I’d need to organize a standard to organize that in otherwise meaningly, hierarchical files with mostly leaf nodes… amz3: a database is just an optmized version of what you have in mind i think galex-713: amz3: no, because you added a layer amz3: galex-713: fwiw, I wrote a graph database on top the file systems , to bad I deleted the code this seemed too much like NIH amz3: galex-713: fwiw, I wrote a graph database on top the file systems , to bad I deleted the code this seemed too much like NIH syndrom galex-713: but when we build tons and tons of databases above filesystem, because for instance they would be the better way to archive emails, blog articles, caching stuff… having this directly above disk might be more efficient as well galex-713: and removing these from easy and intuitive access to the shell is sad amz3: there is reason softwares are not monolith but separated by layers of software that solvea particular task galex-713: amz3: NIH might be good if not too bad and tied to some community or langugae amz3: galex-713: yes, NIH is not that bad galex-713: amz3: but what is the particular task that filesystems do solve that databases don’t, that isn’t compatibility and easy access from the shell/file manager? amz3: galex-713: filesystems talks directly to hardware in the kernel amz3: that's kernel space software galex-713: excluded FUSE and hurd galex-713: and these are pretty neat amz3: this doesn't change the problem that each software solve a particular problem, delivring a particular API, that is possible to understand to solve other problems amz3: yes, if you ask why the fs is not a graph database, I would say, I don't know! amz3: maybe because hiearchy is easier to the mind galex-713: no amz3: no? galex-713: because graph has to cycle-collect galex-713: filesystem is not a graph because otherwise its reference-counting system would not work, you’d need a traversal garbage collector, it would be more resources consumed galex-713: it would be trivial to let the ability in any filesystem to let a directory be at the same time in several directories including a subdirectory of itself galex-713: including making a directory part of itself galex-713: probably somewhere there’s just a link(file) { if (directoryp(file)) error() […] } galex-713: to keep it from being done amz3: you have lot of imagination, too bad i did not read your code, yet! galex-713: yet, filesystem only is a giant database with only one table making an acyclic oriented graph (a tree) galex-713: because I don’t write much, especially, I don’t write much interesting stuff galex-713: not as interesting stuff as I think too amz3: how do you know? galex-713: these times, since a way too long time, each time I’d want to implement some subject of interest, I end up finding a reasonable and very relevant amount of documentation that might help knowing some features and shortcomings of the current stateoftheart, then distract, then forget and abandon and fail galex-713: because I mostly write nothing amz3: coding is hard let's go shopping galex-713: I tried to achieve a first year of CS this year, so the most “interesting” I might have done is writing tiny simple self-contained functions to do simple stuff but with bitfields/bitwise operations, branchless stuff and finding tail-recursive ways of doing stuff to get a decent excuse of doing stuff recursivly while it is advised not to amz3: and? amz3: did you pass the year? galex-713: and that’s not really that useful galex-713: ah galex-713: dunno, I didn’t get the results yet amz3: well, you have to start somewhere galex-713: I still don’t know if I should study for the recovery exams or not… amz3: first year of programming i programmed a infix calculator amz3: not rocket science either amz3: today, I would build a forth to do the infix operation for me :D galex-713: and the larger stuff I wrote weren’t truely computing, only API, an almost finished translation from one (proprietary and high-level) API to a (free and low-level) other, for robotics, for having an excuse not to use the proprietary software asked to use in classroom, and some opengl exercises and project I didn’t almost abandon after not understanding some errors that the teacher weren’t able to understand either anyway amz3: even if I don't now what is forth vm amz3: prolog? amz3: python? amz3: c? galex-713: amz3: oh we got that too, I ended frustrated by the fact I could get difference performance depending on how I do error-checking, and wrote 163 cpp directives to make my code cover all the possibilities amz3: API is the new computing kiddo! galex-713: amz3: probably C, or even forth itself galex-713: no really it might be forth itself, there are plenty of decent forth compilers out there amz3: I mean what languages did you study? galex-713: oh galex-713: C amz3: is it DUT or License that you do? galex-713: there was Visual Basic in the first semester, what a shame, don’t know if I want to talk about it amz3: VB? wtf?! galex-713: except I ended using Mono so not to use proprietary software like others, and did all my GUI using code instead of WYSIWYG editor galex-713: CS license amz3: ^^ amz3: oh ok amz3: still in Paris amz3: near Paris galex-713: no, Brest amz3: ok galex-713: Paris was too expensive amz3: I can understand that galex-713: now here you can get 30m² with 50€ per month amz3: 500€ you mean galex-713: no amz3: lol amz3: that's nice galex-713: well, 250 actually, but I’m removing 200 of State allocations amz3: ok amz3: that's cool galex-713: yes amz3: but you will have to move here amz3: in Paris one day galex-713: also everything is near, you almost never need the bus/tram/etc. amz3: to work at La Defence... galex-713: you can walk to everythere without taking more time, if you have to wait for the bus galex-713: why so? amz3: because that the righteous path of the french engineer :o) galex-713: I’m going to do either research, or nothing or some totally unrelated (to CS) eat-providing job amz3: I wish I did research, now it's too late amz3: I started a research project on wikipedia! amz3: on wikipedia university actually amz3: galex-713: do you want the link? galex-713: re galex-713: 3G failed for some time galex-713: amz3: ^ galex-713: [21:57:47] because that the righteous path of the french engineer :o) galex-713: [21:57:58] I’m going to do either research, or nothing or some totally unrelated (to CS) eat-providing job galex-713: [21:58:10] engineering is a bad path for CS amz3: I started a research project on wikipedia! amz3: galex-713: do you want the link? galex-713: what? galex-713: yes amz3: galex-713: obv I was joking about La Defence thing amz3: https://fr.wikiversity.org/wiki/Recherche:Pens%C3%A9es_Profondes_et_Dialogues_Pertinents galex-713: ? galex-713: ah galex-713: ok amz3: yes it's in french amz3: I have read a few article and summarized them amz3: right now I am still working on building my own database for some reason :D amz3: NIH strikes back amz3: ;) galex-713: x) galex-713: guile-sql ? :p galex-713: amz3: seems loosely related to what you’re did before when you worked on a guile web search engine/scrapper? galex-713: with more real AI (that is less stats, but still) galex-713: I recall, talking of ingineering stuff, that the first time people told me about ocaml/coq/automatic proof, really they gave me the worst ever argument/selling argument galex-713: “It can’t be used to secure planes” galex-713: I really didn’t care galex-713: Then I realized automatic proof may harden private security, stabilize APIs, lessen the need of “maintenance”, break the dependency of program users on program maintainers, allow better entrusting of distributed calculation systems, etc. galex-713: like instead of having linux with an api changing any 2 months, you’d get something such as sel4 or something changing very not much such as TeX instead of the really instable and giant Firefox galex-713: maybe their funds came from Boeing marusich: Suppose I have two strings a and b, and I want to know if they are equivalent, where equivalent means they're the same length, and they contain the same characters in the same order. In this situation, do string=? and equal? always behave the same? marusich: Apart from perhaps revealing the expectation that two variables are strings, I am not sure why I would ever want to use string=? instead of equal? in that case. galex-713: compiling from git, how do you install headers? galex-713: I did install libguile.h /usr/local/lib and mkdir /usr/local/lib/libguile and install libguile/* /usr/local/lib/guile but is this enough? should make install do that? daviid: galex-713: make install does all that galex-713: daviid: then why didn’t I have libguile.h and its directory in /usr/local/include? galex-713: oh wait no, it’s in the guile directory galex-713: why isn’t it found by libfive? daviid: galex-713: it is installed in $prefix/include/guile/2.x/ daviid: so 2.2 for the latest galex-713: yes know i have to find why cpp can’t find it daviid: when you compile something using guile, you need to pass the flags daviid: there in pkg-config, try to find an example in the manual daviid: or a repo that use libguile (I don't) galex-713: what, we’re at guile 3.0? daviid: galex-713: oh no! you need to checkut stable-2.2, not to use master galex-713: daviid: why wouldn’t 3.0 work? daviid: master is indeed for 3.0, but not reommended unless you want to help galex-713: oh galex-713: so I passed all my night compiling for nothing :( daviid: galex-713: I'm afraid so daviid: the tarball compiles a lot faster daviid: try that insted galex-713: ah galex-713: okay daviid: grab the latest tarball daviid: then you'd need to pass these flags to compile: daviid: pkg-config guile-2.2 --cflags daviid: here I have '-pthread -I/opt2/include/guile/2.2' daviid: generally we do that using autoconf ... but that may be to much for you for nao daviid: now galex-713: will let it in /usr/local daviid: yes, but yout project needs to be compiled telling the compiler where to libguile includ an libs ... daviid: to do that you query using pkg-config guile-2.2 --cflags and pkg-config guile-2.2 --libs galex-713: it’s not my project galex-713: it’s mkeeter’s project galex-713: ancient libao that evolved in ao then in libfive daviid: and the answer, you copy on the line to compile yur project ... galex-713: yeah I know pkg-config galex-713: usually I just see CFLAGS += $(pkg-config direct-dependency --cflags) and LDLIBS += $(pkg-config direct-dependency --libs) daviid: galex-713: so, you know you need to pass these otherwise the compiler won't find them ... i was trying to answer your first quiz above ... why does cpp does not find libguile.h ... galex-713: no but I didn’t call cpp myself in fact, cpp was called by gcc called by the make configured by cmake daviid: ok, let's see how it goes once you have 2.2 installed galex-713: cmake that wasn’t even able to recognize where was guile 2.2 galex-713: maybe that’s that galex-713: too recent guile galex-713: still no guile-2.2 according pkg-config galex-713: oh, wrong directoly daviid: i recommend to unintall the one you installed from the source first galex-713: yeah just did that galex-713: actually I was reinstalling this one galex-713: ahhhh galex-713: really one day configure scripts should be parallelized galex-713: like they should autoconfigure themselves to check if shell does support parallelism and if so build multiple queues with a dependency system daviid: talk to #autotools galex-713: and also configure automake to use make parallelism if enabled galex-713: oh, that channel really exists? :o galex-713: is it recent? galex-713: are autoconf/make devs on it? daviid: galex-713: let's keep talking about huile relted thing i don't have time for ther talks (neither am I competent anyway) galex-713: huile relted? galex-713: oh galex-713: *guile related daviid: *guile :) daviid: the #autotools have been very nice to me everytime I needed help ... galex-713: for using or deploying them? daviid: to talk to them on #autotools channel :) galex-713: until then I only were an user with increasing interest in using them to deploy software in the future daviid: so talk to them (but be nice with them to) galex-713: no I was talking about your case daviid: galex-713: most of us use autoconf/automake to deploy our projects yes galex-713: ok galex-713: never really made yet a large scale project daviid: galex-713: there is a template galex-713: and still happens only rarely to do stuff requiring makefiles longer than a screen galex-713: in fact the tarball goes quicker galex-713: I guesse there is already some binaries or bytecode already bootstrapped for this? daviid: yes galex-713: ok galex-713: I think I already heard that somewhere galex-713: sad it can’t use the system-wide guile already installed to bootstrap, the same way any C compiler usually does galex-713: that may be quicker, as it wouldn’t have to bootstrap from C galex-713_: did anyone succeeded to compile libfive? dsmith-work: Morning Greetings, Guilers longshi: dsmith-work: greetings! :) rlb: I'm guessing glibc has changed to use a non-breaking space, but haven't confirmed yet: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896582 rlb: https://github.com/llvm-mirror/libcxx/commit/b21b3175b8536fa10a03eca22e0d94a354a0afe9 rlb: https://sourceware.org/git/?p=glibc.git;a=commit;h=70a6707fa15e63591d991761be025e26e8d02bb6 jcowan: Is there anything resembling a roadmap for Guile 3.0 yet, other than R7RS, native AOT compilation, and languages other than Scheme and Elisp? daviid: jcowan: search the guile ML archives for 'Guile 3 update' (about 10 msg totl, so ok ...) jcowan: ta daviid: guile-devel ML that is daviid: they are quite long emails though daviid: jcowan: one of the last one says it will target a JIT instead, due to complication with ... I don't remember exactly the details rain1: wow R7RS for guile? I like that! daviid: I don't think that will happen anytime soon, not sure where jcowan got that info jcowan: guile status page in the manual jcowan: https://www.gnu.org/software/guile/manual/html_node/Status.html OrangeShark: jcowan: well as the end of the paragraph, they ask for help to implement R7RS OrangeShark: there is a R7RS branch, but I am not sure how much progress has been made daviid: jcowan: I don't think it will be in 3.0, I don't thing there is even one guiler working on this daviid: not that I have anything against it, but not to raise false hopes ... jcowan: ACTION nods jcowan: It would be nice to have a working r6/r7rs implementation jcowan: current versions of sagittarius won't build, and larceny is limited to 32 bits only dsmith-work: Hmm. I got the impression that R7 support will be spotty at best. dsmith-work: Something like you can't be both R6 *and* R7 at the same time. jcowan: There are only a few flat-out incompatibilities, especially with relaxed R6RS support (not necessarily signaling the precise condition that R6RS calls for). jcowan: bytevector-copy! is one I remember, the order of arguments is incompatible (arguably a bug in R6RS) jcowan: there are papers by Kato and Clinger on how their implementations were done jcowan: also when to write out bytevectors with #u8 and when with #vu8 jcowan: BTW, I found a documentation bug, should I send it to bug-guile or somewhere else? daviid: jcowan: bug-guile jcowan: okay daviid: if possible, with a patch rlb: FWIW, to demonstrate that locale test issue, you need to make sure your system has the fr_FR.iso88591 locale, i.e. on debian via "dpkg-reconfigure locales" or similar. rlb: Then "check-guile i18n.test" should do it. rlb: ./check-guile, rather. daviid: rlb: if you found a bug, I suggest you report it at bug-guile, our maintainers rarely answer here recently (unless it would be an 'immediate' answer, whch does not seem to be the case here...) dustyweb: whoa, guile-sparql rlb: daviid: right - it'll be sent to bug-guile, and should be fixed in debian shortly. jcowan: I'm trying to write an R6RS-style library for Guile. How do I get access to the Guile core identifiers like "include"? jcowan: okay, apparently importing (guile) does the trick jcowan: nice wingo: moin janneke: hey wingo rain1: good morning janneke: hey rain1 janneke: rain1: great news: mes+mescc-compiled tcc is now self-hosting rain1: omg :D rain1: you've done such an amazing work on this! janneke: yeah, omg janneke: i'll be preparing a 0.14 release and packaging everything for Guix janneke: it looks like we'll finally be hitting `your' "what about glibc" problem amz3: wow! amz3: that impressive work, I wish to be able to advance the reality of engineering that much one day rain1: yes im very interested to explore that problem.. i hpoe i can help with it amz3: janneke[cm]: what is the plan regarding glibc? janneke[cm]: gcc-core can be compiled without glibc janneke[cm]: so the plan is to compile gcc-4.7 core and use that to compile glibc amz3: o/ rain1: hllo wingo: dsmith-work: there is a failure in the foreign objects test but ./check-guile passes afaiu dsmith-work: Happy Friday, Guilers!! dsmith-work: wingo: Ahh. Ok. "make check" isn't running those tests for me. dsmith-work: prob becuse of the other test that is failing ZelphirKaltstahl: Hi : ) amz3: https://news.ycombinator.com/item?id=17104356 daviid: janneke: would srfi-60 be of any help? daviid: janneke: you probably know this much better then me :), but there is rns arithmetic bitwise as well wingo: civodul: tx for kind words :) it was interesting, yes! i got to port over some of the buffered i/o stuff from suspendable ports as well wingo: btw on guile jit side of things, i just have the call instructions to look at before writing a jit; i think in a first iteration i will just import lightning or something like that, if it's not too much code. fallback strategy remains bytecode vm. wingo: the guile 3 vm is 30% smaller or so civodul: hey wingo! civodul: wingo: oh you're looking at JIT, sounds cool! civodul: did you look at the JIT from that person who presented at the Scheme workshop last year? wingo: yeah that's been the goal of simplifying the instruction set civodul: right wingo: i did, it was really cool! i think that strategy will work even better with the simplified instruction set civodul: yes i can imagine wingo: first tho i want to implement a dead-simple method jit before going on to try tracing etc civodul: yes, i suppose even a simple strategy can already be beneficial wingo: yeah, and should be a good baseline when evaluating other strategies civodul: right wingo: and a method jit should be tunable to never regress performance civodul: fun stuff ahead :-) wingo: yeah! chrislck: 1 daviid: in the manual, 7.6.2.22 rnrs arithmetic flonums, wrt fl=? ..., I think there is an inversion of the respective entries? daviid: I mean in the sentence documentiing these procedures, it says: equal monotonically increasing, monotonically decreasing, monotonically nondecreasing ... daviid: but should it not be monotonically increasing, monotonically nondecreasing, monotonically decreasing, ... chrislck: quick n00b question please? I've parallel installed both guile-2.0 and guile-2.2 in ubuntu bionic - however pkg-config can't find guile-2.2.pc - where's that at? rain1: dpkg-query -L guile-2.2 rain1: should list all the files in the guile-2.2 package rain1: you could check if there is a .pc file in it, with: dpkg-query -L guile-2.2 | grep \\.pc rain1: maybe you'd need a -dev package to get the .pc file rain1: try guile-2.2-dev chrislck: rain1 thanks - funnily both 2.0 and 2.2 don't have .pc however i found guile-2.0.pc in /usr/lib/x86_64..../pkgconfig chrislck: wowiie guile-2.2-dev did the trick chrislck: so much thanks chrislck: micro benchmark - guile-2.0 ran prog in 6s... guile-2.2 ran prog in 12s first then 1.5s thereafter \\o/ dsmith-work: wingo: Have you tried a "make check" in master lately? amz3: o/ dadinn: hugo: thanks, it works! amz3`: héllo #guile dsmith-work: Morning Greetings, Guilers janneke: does guile/scheme have a bitwise left shift that introduces 1 bits? rain1: i don't think so, you may need to negate then shift then negate dsmith-work: janneke: Never heard of a left shift that does that. janneke: thanks janneke: hmm, it seems that either logxor or ash has or triggers a compiler bug janneke: hopefully i'm just missing something janneke: ACTION sent mail to bug-guile civodul: wingo: nice article on Fibers for Lua! civodul: must have been interesting to implement it a second time in a different context rain1: wingo, i was wondering about GNU readline? whyy its separate from the rest of guile . could we merge it in completely? lloda: rain1: iiuc readline is GPL while Guile is LGPL and that's the reason rain1: ohh i thought they were both GPL rain1: what about integrating a different readline library, that is LGPL or MIT/BSD? hugo: About module loading: I can recommend everyone to put (add-to-load-path (dirname (current-filename))) to your main file hugo: This adds the directory of the file to the load path dadinn: hi all dadinn: quick question, what is the recommended way to break up scripts into multiple source files? dadinn: 1) it seems that using -l flag in the #! \\ !# area doesn't work; 2) i also tried using modules, but as the curent dir (.) is not on the loadpath, this wouldn't work; 3 )and finally using the `-L .` option in the #! \\ !# area doesn't seem to set the current dir to be on the load path either... dadinn: any other options? hugo: dadinn: Modules is the right way hugo: I usually have a main file with a shebang (#!), and then have hugo: (add-to-load-path (dirname (current-filename))) hugo: Which makes it possible to import modules from the path of the main file dadinn: hey guys, regarding my previous problem with getopt-long, I think I have a workaround dadinn: i.e. the issue was that options-spec is not extensible, additional, unsupported propetries cause the `getopt-long` function to throw errors dadinn: the code is here: https://pastebin.com/jyst1yHU dadinn: hack, but it works nicely, now i can add additional props to my spec, like `discription`, and `default`... needed for generating usage help mwette: (use-modules ((ice-9 getopt-long) #:select ((getopt-long . old-getopt-long)))) is an option over the (@ ...) syntax. See the manual section on modules. dadinn: mwette: fair enough, otoh maybe it is preferrable to have such an ugly sign of that something non-standard is going on there fibration: Maybe someone is interested in this: guile-snarf doesn't seem to work with the latest dash-0.5.10_3 package from voidlinux. Not sure if this is a dash or guile-snarf bug. everything's fine after changing the shell in the shebang directive from sh to bash dadinn: so finally, using my previously shared extension for specs in (ice-9 getopts-long), here is a kind of usage help generator I wanted: https://pastebin.com/JiJeCzMG dadinn: my options-specs have extra 'description 'value-desc 'default properties, and they are used in the usage help generator ;) dadinn: for reference this was code for the getopts-long option-specs extension: https://pastebin.com/jyst1yHU dadinn: Not sure, does anyone think this could be useful in the ice-9 codebase? At least fixing that anoying anti-feature of not allowing additional "non-standard" properties in the option-spec would be nice to see back... nalaginrut: afternoon guilers~ nalaginrut: wingo: could you take a look at this issue? https://sourceware.org/bugzilla/show_bug.cgi?id=21104 nalaginrut: wingo: It seems guile-2.2 changed something to break the guile plugin in GDB nalaginrut: wingo: and I'm trying to write a debug tool with it, just like gef: https://github.com/hugsy/gef nalaginrut: wingo: If any necessary, I could send a mail to bug-guile@gnu.org nalaginrut: anyway, gdb guile plugin works fine with guile-2.0, I'm using it right now. It's better if we can fix it for 2.2 amz3`: \\o/ dadinn: hi all dadinn: experimenting with modules currently. created a module, and tried to reference it from another script, and it fails "no code for module" I placed it under a directory as described. It seems that the current dir is not part of the load-path? dadinn: how do i tell guile to add the current dir to the load-path? amz3`: dadinn: guile -L `pwd` amz3`: dadinn: guile -L $(pwd) dadinn: amz3`: what is the reason it doesn't do it automatically? when i am running a script. shouldn't it be first on the list to check for other modules next to the script itself? dadinn: essentlially i have a script which uses module (my mod), and have this module next to the script, in a folder my, named mod.scm amz3`: I am not sure why 'current working directory' is not part of the guile path, I assume it's a security reason dsmith-work: amz3`: Yes dsmith-work: For the same reasons you don't want "." on your $PATH dsmith-work: Monday Greetings, Guilers dadinn: dsmith-work: is there a way i can configure the load-path? like $PATH dsmith-work: dadinn: https://www.gnu.org/software/guile/manual/html_node/Load-Paths.html#Load-Paths dsmith-work: https://www.gnu.org/software/guile/manual/html_node/Environment-Variables.html#Environment-Variables dsmith-work: https://www.gnu.org/software/guile/manual/html_node/Command_002dline-Options.html#Command_002dline-Options dadinn: dsmith-work: I think if i remember correctly I can specify for scripts to load another file relative to them. I think that wouldn't apply to module boundaries? dsmith-work: dadinn: Are you aware of how module names work with the load path? dsmith-work: So for a module named (foo bar baz), the dir "foo" must be on the load path, and the module file is foo/bar/baz.scm dsmith-work: The "bar" dir is not on the load path. dsmith-work: Hmm. Maybe I've said that wrong. dsmith-work: Been a while since i've been a guile'ing. dadinn: dsmith-work: i was expecting it to be so dadinn: so (my mod) should be like my/mod.scm relative from a dir-root on the load path dadinn: so if my load-path is ("/usr/lib/guile" "/var/lib/guile") then (my mod) should be either /usr/lib/guile/my/mod.scm or /var/lib/guile/my/mod.scm dsmith-work: dadinn: Yes vivien_: Hello guile! I'm trying to have org-babel evaluate a call to load-extension. It does not work when I org-babel-execute it (the module is not initialized) but it does work when I copy/paste the content of the src block into the geiser buffer. As I understand it, org-mode does some extra lambdaing around the code to handle variable substitution and results extraction, and thus (load-extension) is called in a lambda. Did I miss something? How do vivien_: I have load-extension actually load the so when inside a lambda? vivien_: Or is there a better way to use guile with org-babel ? vivien_: OK I did a quick hack with an elisp source block that goes to the geiser buffer and types "(load-extension ...)" jorgesumle: How can I install guile-commonmark in Debian? rain1: hi jorgesumle: hi mwette: greetings mwette: I'm reading throught the manual section on CPS today. dadinn: hi all dadinn: quick question about getopt-long. Is there a way to print usage help from the grammar/spec? dadinn: I mean some builtin function which generates it easily dadinn: and maybe given some optional defaults map... dadinn: ... yeah, saying this, I would actually rather expect the defaults given at the grammar/spec, instead as an extra arg to option-ref :/ mwette: getopt-long is deprecated in favor of srfi-37 mwette: but that does not provide help spec like python argparse does :( mwette: if that is what you are looking for dadinn: argh, getopts-long is more declarative, and I prefer that... dadinn: but why does it have to throw an error for extra properties! :( dadinn: i could have easily added 'description' and 'default' properties, then use it to generate the usage help... this insanity! dadinn: I am sure getopt-long was written by a C or ML/Haskell developer :P dadinn: sunday evening flame war, start! :D dadinn: but really, why would someone write a library, in a language aimed for extensibility, and make it imposible to extend :'( rain1: dadinn, it sounds like you have a really good idea for how to improve this library rain1: I see no reason why guile would not accept this change (making it extensible) dadinn: rain1: is it the github ice9 repo i should submit a pr to? rain1: im not really sure, guile contains a copy of ice9 too rain1: maybe just building a proof of concept and bringing it up on the ML for discussion could be a good start mwette: I submitted changes for getopt-long and got the idea it may be frozen. I wanted it to accept some arguments repeatdly. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21698 dadinn: what is this srfi-37 btw? mwette: dadinn: https://srfi.schemers.org/srfi-37/srfi-37.html mwette: or look at .../share/guile/2.2/scripts/compile.scm for example dadinn: mwette: couldn't find examples how srfi-37 works. how come it doesn't use spec/grammar? dadinn: this args-fold thing is not for my taste. dadinn: so i suppose the final conclusion is ice9 won't accept changes, and i can take it as is or leave it. manumanumanu: My libsodium wrapper (still a wip) is finally online: https://bitbucket.org/bjoli/guile-libsodium/ manumanumanu: good night! louishaemmerle: can I access the stack manually when an error is thrown? louishaemmerle: I am writing a unit testing framework, so I would like to have that kind of access louishaemmerle: I discovered https://www.gnu.org/software/guile/manual/html_node/Throw-Handlers.html but it doesn't tell me how to access the stack louishaemmerle: never mind, I found the docs dadinn: how do i enable srfi features? use-modules don't seem to work dadinn: `fold` is only available in srfi-1 and it is not built-in, but use-modules not work either :( hugo: dadin: (use-modules (srfi srfi-1)) hugo: dadinn ^ dadinn: hugo: thx hugo: no problem lyr3: - manumanumanu: ahoy hoy lispmacs: does goops have some trick or mechanism to override a method for a single specific instance of a class lispmacs: like, if I had instance `monster` of class , and (move monster) normally had a certain effect, but somebody put a spell on monster causing (move monster) to have a different effect (e.g., moves randomly or can't move, etc.) lispmacs: i could see how I could accomplish that with having all methods check first for a slot with an override procedure, maybe that is the way, but maybe there is something cleaner? amz3`: lispmacs: isn't the mutated by the ? amz3`: then the move method can take into account the effects amz3`: lispmacs: seemms like you want is to monkeypatch the object? isn'nt it? lispmacs: amz3`: so, I was hoping for some way that I could have effects that I didn't have to code into the base class amz3`: hmm lispmacs: like, currently, to put a spell on orc that slows him down for x period of time amz3`: what do the effect do? amz3`: hmm lispmacs: I have to have code slots in orc amz3`: ok lispmacs: that keep track of how long the spell is in effect amz3`: hmm... amz3`: well, first monkeypatching is not the way to go... amz3`: I think... it's rarely does lispmacs: by the time you get a dozen effects, then you have this monstrously large class amz3`: I get it amz3`: especially since, each effect can have different consequences on different methods amz3`: well, I am thinking about combinators somehow, but not sure how to apply it in the current context amz3`: lispmacs: can you list a few spells and their effect, maybe it will be of inspiration? lispmacs: i made that up as an example. In my actual game, I have multiple enemy types (soldier, tank, boat, etc) which all can be hit by a "slow down" bullet which causes them to move at half speed lispmacs: however, effect is only temporary, a certain number of seconds, depending on exact level of slow bullet tower lispmacs: (tower defense game) lispmacs: to make it happen, I had to code slots into class that keep track of whether or not a enemy has been hit by such a bullet lispmacs: and how much longer the effect is supposed to last gour: morning gour: i'm trying to make some custom gnucash reports working in 3.0. i've been able to adjust my config-user.scm by using add-to-load-path and now i'm not getting " ERROR: no code for module (gnucash gnctimeperiod-utilities)" error in console any longer, but now the problem is that "gnucash --debug --log gnc.scm=debug" does not produce any error, while report is still not available, so wonder how to troubleshoot it further? amz3`: o/ str1ngs: o/ str1ngs: gour: did you get the resolved? str1ngs: that* gour: str1ngs: nope. i was even considering to downgrade to 2.6.x, but it's time consuming since fc28 does provide only 3.0 atm, so i'm forced to fix reports gour: (somehow) str1ngs: fc28 as in fedora 28? gour: yep str1ngs: normally I fun fedora but I switched to unbuntu for some work related stuff. str1ngs: I should upgrade 27 to 28 str1ngs: does your reports work for 2.6? gour: fedora is, for me, the best distro i've ever encountered and i'm on linux since '99 gour: yes, those reports do work with 2.6 str1ngs: run guile then do (use-modules (gnucash gnctimeperiod-utilities)) gour: but, gnucash does change things a bit... gour: ERROR: no code for module (gnucash gnctimeperiod-utilities) str1ngs: I started with linux around redhat colgate str1ngs: how about (use-modules (gnucash)) gour: same. othwerwise, my report is current-vs-average and requires gnctimeperiod-utilities gour: ERROR: no code for module (gnucash) str1ngs: %load-path has the modules for gnucash? gour: i put: (add-to-load-path "~/.local/share/gnucash/gnctimeperiod-utilities.scm") in my ~/.config/gnucash/config-user.scm str1ngs: ahh gour: so, gnucash does load the report, but does not install and it and debug does not produce any error now str1ngs: should be (add-to-load-path "/full/home/path/.local/share") gour: ahh, let me try it str1ngs: or (add-to-load-path (string-append (getenv "HOME") "/.local/share")) str1ngs: guile does not expand ~ str1ngs: and your adding the file path no the directory path gour: i changed into 1st option: (add-to-load-path "/home/gour/.local/share") gour: but still don't get anything from gnucash debug's output, shall i try again by invoking guile? str1ngs: and (use-modules (gnucash gnctimeperiod-utilities) in guile str1ngs: err dont forget closing ) gour: ERROR: no code for module (gnucash gnctimeperiod-utilities) str1ngs: find ~/.local/share/gnucash str1ngs: don't paste output str1ngs: how many files are they just the one? gour: no, many files, few folders gour: https://pastebin.com/pzcsWpwL str1ngs: k one sec let me build gnucash 3.0 right? gour: str1ngs: thanks a lot! gour: ACTION would like to learn some scheme/guile in order to be able to customize gC reports str1ngs: what pkg-config is missing with this error CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message): str1ngs: A required package was not found str1ngs: nvm libxsssslt str1ngs: sorry keyboard lag str1ngs: wow I just get libdb-sqlite3 provided a libdi backend haha str1ngs: guessed* gour: you can --disable dbi str1ngs: this is using cmake for some reason. which I though was odd str1ngs: are you using guile-2.2.3? gour: no, 2.0.14 str1ngs: oh on fedora. dont use that str1ngs: use 2.23 str1ngs: err 2.2.3 . what does 28 ship with ? str1ngs: guile 2.0.14 is just there in /bin for some shebangs gour: it has 2.2, but deps for gnucash is 2.0...let me check the exact version str1ngs: leave it for now gour: ok, otherwise there is 2.2.2 str1ngs: 2.2.2 is not bad str1ngs: gour: I dont have gnctimeperiod-utilitie gour: str1ngs: that's part of custom report...let me paste it gour: main report:https://pastebin.com/p8QWy3LB str1ngs: where is gnucashed installed rpm? gour: utilities: https://pastebin.com/LC93bZjc str1ngs: err gnucash str1ngs: also is .gcm intentional or is that guile 2.0 related gour: libs are under /usr/lib64/gnucash str1ngs: I'm trying to understand this paste that has .gcm exntention is that byte compiled? gour: where is .gcm? str1ngs: https://pastebin.com/pzcsWpwL gour: ahhm those are ust book-related settings, you can ignore them related to report gour: *just str1ngs: ahh this makes more sense now.. one sec gour: will have to go to lunch soon, but bbs str1ngs: gour: before you go try this gour: ? str1ngs: in guile (load "/home/gour/.local/share/gnucash/gnctimeperiod-utilities.scm") str1ngs: it might complain no code gnucash gettext gour: right str1ngs: this just looks like an module path issue so far gour: pk gour: ok gour: bbs str1ngs: gour: add $PREFIX/share/gnucash/scm to %load-path move gnctimeperiod-utilities.scm to $PREFIX/share/gnucash/scm/gnucash str1ngs: then (use-modules (gnucash gnctimeperiod-utilities)) should work str1ngs: $PREFIX is not a real variable str1ngs: gour: you don't have to move gnctimeperiod-utilities.scm but it makes trouble shooting easier. alternatively you need to add gnctimeperiod-utilities.scm parent directory to %load-path as well gour: pwd str1ngs: pwd: command not found gour: :-) gour: str1ngs: i've added: (add-to-load-path "/usr/share/gnucash/scm") and put scm file into: /usr/share/gnucash/scm/gnucash, but still get the same error str1ngs: is gnucash installed into $HOME/local ? str1ngs: err .local str1ngs: ironically I use $HOME/local not .local gour: no gnucacsh is installed under /usr str1ngs: check /usr/share/gnucash/scm str1ngs: if it exists and is populated. add that to %load-path gour: ok gour: i mean, that's the folder i've added to the load-path str1ngs: oh wait I read that wrong. that looks good str1ngs: one sec str1ngs: (use-modules (gnucash gnctimeperiod-utilities)) gives no code? gour: no, it gives: ERROR: no code for module (gnucash gnctimeperiod-utilities) str1ngs: yes that's the error I meant str1ngs: output of %load-path gour: $1 = ("/usr/share/guile/2.0" "/usr/share/guile/site/2.0" "/usr/share/guile/site" "/usr/share/guile") gour: ahh, i was adding to load-path within gnucash and not guile itself :-( str1ngs: yes. alternatively you can add it in ~/.guile IIRC gour: some progress: https://pastebin.com/yvWsZd2E str1ngs: ok that's another issue gour: now i put it into ~/.guile to make it more convenient str1ngs: seems the module paths are right now str1ngs: so that a dynamic linker thing. it might have trouble find so files str1ngs: dynamic-link is like C's dlopen gour: str1ngs: btw, i watched some video where wingo mentioned that 3.0 is supposed to have native code-generation. is there any rough estimate when it might happen? str1ngs: guile 3.0? gour: yes str1ngs: ah I think you mean compiling scm to elf instead of bytcode? gour: correct wingo: this year str1ngs: speak of the devil :P wingo: :) str1ngs: I think that what we are talking about compiling to elf ? gour: i was considering to fiddle with the racket, but probably due to lack of time will focus just on guile since i have real need for it for gnucash... str1ngs: personally I only every use guile str1ngs: and then I get confused when I need to use elisp again haha str1ngs: gour: I'm stilling checking why dynamic-link can not find so files gour: str1ngs: i'm told by some gnucash hacker that: " well you are trying to load gncitmeperiod-utilities into a blank guile environment. this module relies on a lot of gnucash modules which rely on C and SWIG and etc. ergo you will never be able to load a gnucash guile module directly into guile." str1ngs: I don't think that's how repl works :P str1ngs: but gnucash may have C bits str1ngs: I suspect that is what he means str1ngs: gour: can you make sure gnucash has the right %load-path and try then str1ngs: either way this problem is dynamic-link which is run time loading so not related to gnucash C bit str1ngs: gour: either way I think it's resolved once you get gnucash's %load-path fix. atleast this issue gour: str1ngs: progress - https://pastebin.com/k1v50U71 gour: str1ngs: btw, is it possible to hack guile using vim? str1ngs: yes, but not worth it str1ngs: geiser with emacs is amazing str1ngs: emacs with evil and geiser is a good setup chrislck: emacs+magit is da bomb chrislck: can anyone with guile-2.2 help me - is the /usr/bin/guild script still (c) 2014 or is there a newer one? str1ngs: gour: how do I use timeperiod module from gnucash gour: thanks...now have to do something else, will resume later str1ngs: gour: ya I think we are past your orginal issue now str1ngs: the rest is gnucash related gour: str1ngs: i'm told that " you now need to modify gnctimepair stuff to gnctime64" - see e.g. https://github.com/Gnucash/gnucash/pull/256 gour: ACTION nods str1ngs: gour: I'm currently hacking a web browser in scheme and C str1ngs: I'm calling it nomad! gour: it sounds similar to monad :D chrislck: thank you gour for putting my pull request - it incorporates an update onto daily-reports.scm which was created be the one and only wingo :) wingo: hah! that was the first scheme i ever wrote :) gour: chrislck: what about your fix for ytd-budget reports? is it going to be applied? chrislck: gour: it's still available and fixed at https://github.com/christopherlam/gnucash/commits/master-ytd - up to the devs when they can be ready to accept additions rather than fixes gour: chrislck: ok, i do mind as long as it does its job...but in order to prepare budget, i need current-vs-average as well chrislck: gour perhaps try compare quality of code between current-vs-average.scm and https://raw.githubusercontent.com/christopherlam/gnucash/scheme-progress/gnucash/report/standard-reports/transaction.scm -- the former is so much hack chrislck: wingo not sure if you were involved at the same time as rgmerk but I met him in Melbourne in January :-P chrislck: just wanted to wave o/ str1ngs: gour: actually there is not relation with monad wingo: o/ str1ngs: gour: I wanted something that explored on safari and killed foxs. I came up with a nomad haha str1ngs: gour: screenshot https://imgur.com/hhKGfb1 amz3`: look familiar dsmith-work: Happy Friday, Guilers!! amz3`: ! mwette: howdy! OrangeShark: happy friday mwette: Any of you use git on git.sv.gnu.org? I'm having problems connecting today. mwette: this: `ssh: connect to host git.gv.gnu.org port 22: Connection timed out' janneke: Hapyy Friday janneke: mwette: just a silly question: what do the `d' and `i' stand for in i-sel, d-sel? janneke: after many months of working on Mes' scheme implementation, i'm again working on the MesCC C compiler mwette: IIRC i-sel is indirect selection "a->b"; and d-del is direct selection "a.b" janneke: mwette: ah, thanks mwette: git on git.sv.gnu.org is working now; it was overloaded this morning mwette: (or several hours ago) rain1: hello wingo are you there? davexunit: is it possible to lookup an object by its address in guile? davexunit: I'm staring at some statprof output that reports the most time consuming procedure as "anon #x122a648" davexunit: and I'm not sure how to go about finding where in the source code that anonymous procedure is defined daviid: davexunit: could it be C code accessd using the ffi ...? I don't know how to help, I'm nterested as well, I face the same situation when statproofing guile-cv ... davexunit: no I don't think so, it's just some lambda davexunit: but there is no source information for it davexunit: if I could inspect the object space a bit more maybe I could figure it out daviid: sure, I don't know how daviid: but if you succeed let us know ... davexunit: will do davexunit: thus far no luck daviid: davexunit: I would post a mail to guile-devel asking if/how ... (there are top notch guilers that are not here, like mark for example ... davexunit: yeah davexunit: I might if I can't figure it out daviid: ok amz3`: heya dsmith-work: {appropriate time} Greetings, Guilers pera: Hi! I was wondering if any schemer could review this code here (35 lines): https://gist.github.com/pera/fea285e298075c6f8ab9f16dd4eb660f rain1: at a glance this code looks very good, why dont you tell us about it though? pera: rain1: I ported that code from this https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/binarytrees-racket-2.html rain1: ah pera: I was curious if there was something obviously inefficient on my version, because it takes almost 10 times more than the racket version rain1: hmmm not sure how we could figure out why there is such a big difference in speed pera: I also made a r6rs version that runs on racket which takes almost the same time than the racket version pera: I tried to profile it but I am not sure how to read the results :) pera: 36% of the execution time is being spent inside the check function, and 24 on make rain1: so i guess it would be good to know the %'s for racket too rain1: then we can see if guile is slower overall, or one particualr part is being slow pera: uhm thats a good idea daviid: pera: did not look at the paste, but is this compiled (module) code your are running? pera: daviid: to be honest I am not sure, but I believe it is: when one runs guile file, isn't guile compiling and then running from a temp directory? daviid: yes, but you better be sure to compare benchmark using compiled code ... pera: do you mean to not count the compile time? daviid: i suggest you make a module, compile it, guild compile .. then start a repl and ,use (the-module), then profiling the run pera: thanks I will try that daviid: it could be that the code you translated used tricks tha makes it fatser on racket as well, i really don't know pera: Sure, although I actually choose this program because of its simplicity (it doesn't look like there is any optimization trick on it) daviid: ok daviid: 10x times slower does not sound 'normal' pera: Sorry, it's actually ~9 times more time than chez-scheme, and ~7 times more than racket (both using plain racket and r6rs) pera: It takes about 12 seconds to finish on chez, and almost 2 minutes on guile pera: wow I think I found something pera: those three defines at the beginning (e.g. (define node cons)) make things pretty slow rain1: oh thats funny rain1: you'd expect that to have 0voverhead pera: right! pera: so by using cons car cdr instead of nodes it takes half of the time to complete lispmacs`: Hi, when I compile module with a class definition, I get strange error: lispmacs`: ./td/enemy.scm:45:0: source expression failed to match any pattern in form (define-class-pre-definition (#{:accessor}# .prev-x #{:init-keyword}# #{:prev-x}#)) daviid: define-class-pre-definition does not exists daviid: or you defined it, but then it has a bug .. lispmacs`: it just looks like a normal class definition to me lispmacs`: I don't know what define-class-pre-definition is daviid: it does not exists daviid: i don't know where you pick-up that code daviid: what guile has is define-class daviid: look in the manual ... lispmacs`: just searched the whole info manual for it, not there daviid: yep, as i said... use define-class lispmacs`: that is what I used lispmacs`: define-class daviid: ah daviid: did you ,use (oop goops) firt daviid: try in a repl daviid: ,use (oop goops) daviid: define-class lispmacs`: I have a :use-module (oop goops) option in the module def daviid: then tou have a syntax bug in your define-class form daviid: double check and compare with some basic example ... lispmacs`: is there a paste channel or something? daviid: debian-paste lispmacs`: to show you class definition? daviid: or a tor (no js) prefered lispmacs`: https://paste.debian.net/1023919/ daviid: try this i a repl (define-class () (a #:accessor a)) daviid: lispmacs`: it is #:accessor, not :accessor daviid: true for other keywords as well daviid: #:init-keyword ... daviid: also, I (personally) don't recommend the java notation, rather, I use !prev-x, !prev-y ... at your discretion, but goops is not java ... lispmacs`: Isn't there some command I can use to allow : to be read as #:? lispmacs`: I'm sure I read that in manual, but am having trouble finding it daviid: and prefixing using ! captures the attention of users, imo, that this is possibly mutable, thought also clearly not buit-in procedure, like set! ... daviid: there is, but I don't recommend it pera: wtf by just using let instead of define I get a 2x speed improvement daviid: i don't remember how to set read-keyword or something ... you'd have to look in the manual daviid: the biggest problem is the code becomes not portable (I won't even look at it) daviid: i won't run it ... daviid: since i would have to set this paramemter and I dont wan't ... lispmacs`: daviid: haha, I'll remember that in case I ever actually have paying client and it turns out to be you lispmacs`: daviid: portable isn't an issue is it if I set the prefix option inside my module, right? lispmacs`: when you import, you don't have to use :, right? daviid: i think the setting becomes global daviid: you'll get used to #: ... if you wish, it also makes the code clearly scheme (as opposed to CL) lispmacs`: oh daviid: which nice daviid: but hey, do as yu wish lispmacs`: It says here :name is an R5RS violation, so that probably isn't good daviid: by the way, did you read my recommendation, the email lk I pasted a few days ago? curious lispmacs`: yeah but it didn't seem to apply to my problem or make much sense to me daviid: oh, that means you still don't understand much about what's going on :), and how to properly handle it (the interaction between goops and the module system), and it also means I didn't write this well enough then: becaue I answered exactly because of your complain of 'how to export classes' ... I suggest you keep it in your links and re read it as your work progress lispmacs`: daviid: yeah, am still kind of a guile noob. I did read through most of the info manual on goops but of course it is hard to integrate everything in one reading lispmacs`: i am working an arcade game in Guile Scheme. I'd send you the link but I wouldn't want you to get sick or anything looking at the code ;) lispmacs`: or send the lisp ninja squad after me daviid: lispmacs`: till you understand, if you use more then one guile module for yur game, I strongly recommend you blindly apply these recommendations daviid: more then one guile module using goops I mean... daviid: lispmacs`: keep the game work! and welcome, we, guilers, are always extremely happy to try to help, have to run bbl. ping me wrt goops quiz,, if i can, i'd behappy to try to help ... dsmith-work: Wednesday Greetings, Guilers OrangeShark: happy wednesday! foojin: Does anybody use (texinfo)? It fails on every .texi file that I've tried feeding to it. Its tests seem to invoke its functions with only small snippets, so maybe it's not supposed to work like that yet? civodul: foojin: Guix uses it for small snippets (package descriptions) civodul: but it's definitely not featureful enough to process whole manuals civodul: any help in that direction would be welcome, though :-) roelj: Is there a limit to how many backslashes Guile can handle in a string-append? :P foojin: civodul: I see. I don't think I know enough about texinfo to help out. civodul: roelj: you mean backslashes in string literals? civodul: as many as you want i suppose :-) janneke: there's probably a memory limit civodul: the GNU Coding Standards insist that There Shall Not Be Arbitrary Limits roelj: Hehe civodul: physical memory limit is a different thing ;-) roelj: Well, all I need is 6 backslashes. roelj: But I am probably just confused then. janneke: civodul: yeah, no arbitrary limits. amz3`: What would be the solution to share "work" in a cluster of machines. I am thinking about using a priority queue. I identified three priorities: urgent, realtime, normal and best effort. I am looking for a way to schedule the "tasks" based on their priority. amz3`: Let's consider that the database is reliable and that you can acquire exclusive locks and do atomic 'add', 'xor', 'or', 'and' operartions amz3`: it's like wiredtiger but distributed amz3`: also you can build linked list amz3`: wiredtiger doesn't support binary atomic operations amz3`: at least it's not a primitive amz3`: I am thinking about dedicating a thread to keep the priority queue (modeled as linked list) sorted using an aging algorithm that looks like f(time) = priority + time^n that is the older the task get the higher the priority amz3`: basically, I'd like to build something like fibers but distributed to multiple machines amz3`: but fiber doesn't use priorities davexunit: this is driving me crazy: I'm looking at statprof output for a rather large program and the top 2 time-consuming procedures are anonymous davexunit: no source location to view, nothing foojin: I seem to have found another bug. Can someone test it on a new version? It's basically 4 lines at the REPL. foojin: Anyways, the commands are as follows: (",module (language tree-il analyze)" "#f" ",reload" "#f"). The last one produces an error, even though it shouldn't. chrislck: ACTION wonders how hard it is to convert a CL/Racket module to guile rain1: its very hard chrislck: no joke? chrislck: ACTION loves idea of mustache.github.com which has modules in every language except guile rekado_: porting from CL is probably harder than porting from Racket. dustyweb: chrislck: I did the reverse recently (one of my own libraries from guile -> racket)... in general, it depends on how much is standard scheme, how much is scheme-implementation extensions dsmith-work: Morning Greetings, Guilers dustyweb: anyway IME it's feasible, but of course if something is an rnrs that both languages support, that's easier dustyweb: but you tend to miss out on nice things that way chrislck: dustyweb thank you... <1yr guile so too noob to comprehend nuances between lisps amz3`: héllo all rain1: hi OrangeShark: hello amz3` civodul: how can live values on the VM stack be zeroed out? civodul: that is the question mwette: iff daviid: mwette: tx! roelj: Is there a standard “throw” key for missing arguments? foojin: roelj: 'wrong-number-of-args seems to serve this purpose. roelj: foojin: Thanks. Is this documented in the manual somewhere? (I couldn't find it..) foojin: roelj: Yep, 6.13.13 How to Handle Errors roelj: foojin: Oh snap. Thanks! foojin: You can use '/' in standalone info or 's' in Emacs to search these with a regular expression. foojin: Emacs info mode that is. foojin: You're welcome. BTW I wonder if the Emacs one can be made not to ascend above the node where you started it. roelj: Is it also possible to not have to go into the Guile manual first? roelj: Or to start info for the Guile manual specifically? foojin: M-x 6.13.13 How to Handle Errors foojin: Sorry. foojin: You can either invoke info like this: "info guile" or do M-x info-display-manual and type guile there. roelj: info-display-manual is nice. Thanks once again! dsmith-work: {appropriate time} Greetings, Guilers foojin: Does Geiser consider everything evaluated in Scheme buffers in the context of the manually specified module (,m module) or does it sometimes switch/guess automatically? jao: foojin, it uses the file's module, not the repl's jao: only when no module can be assignd to the buffer's file does it fallback to the current namespace in the repl foojin: So if I evaluate something in the buffer without having used ,m in the REPL and then switch using ,m module, everything would be in scope? foojin: Everything that I've evaluated, that is. OrangeShark: hello everyone rain1: hi dsmith-work: jao! jao: foojin, yes, it should. everything you evaluate in the buffer will be evaluated in its module. jao: dsmith-work, dale! :) dsmith-work: jao: Did you see that paper by Didir Verna on Lisp, Jazz, and Aikido? jao: dsmith-work, i did, but i'm afraid it's still on my TO-READ list dsmith-work: jao: Cool. jao: dsmith-work, i take it you liked it dsmith-work: Yeah, very interesting. jao: i have to read it. i even took aikido classes back in the day. dsmith-work: Heh. And my old co-worker, Gary Bernhardt, is mentiond! dsmith-work: (his famous "Wat?" lightning talk) jao: ah, yes foojin: jao: I see. By the way, these contexts have to pile up somewhere if one evaluates code in different modules. Is there a way to "clear" one of them? jao: foojin, they're not "context" on the emacs side, just the definitions associated to each guile module jao: it's actually guile who's keeping track of them jao: so "clearing" would mean removing all bidings from a guile module jao: i woudn't be surprised there's an easy way to do that, but geiser does not provide any shortcut for it foojin: jao: I thought as much. I'll look into it, along with the way to make the current namespace fallback the default. It just seems _too smart_ for me to be comfortable with it. davexunit: use geiser for long enough and the other way will seem too dumb davexunit: if I had to set the current module in the repl each time it would get really frustrating davexunit: the programs I work on consist of many modules that I switch between frequently. it's really nice that geiser knows the module I'm editing when I eval stuff foojin: If I'm not misunderstanding something, you'd have to switch manually each time you want to type a one-liner at the REPL anyways. foojin: Maybe it would become useful if I do everything in buffers. davexunit: if you're in a source buffer and want to switch to the repl buffer to type a one liner, you can do C-c C-a foojin: Ah, so there's a shortcut for that! davexunit: yeah daviid: ot; reading an article, I don't undertand this: the maverick company run by ... (talking avout spacex in this case, but i don't think it matter) what is a maverick company? amz3`: http://okmij.org/ftp/continuations/against-callcc.html#illusion lispmacs: Is there something special I need to know about exporting class definitions? I'm getting a strange error when trying to package some classes up in modules amz3`: lispmacs: paste? daviid: lispmacs: not that I wrote it :), but I higlhy recommand you to read this email: https://lists.gnu.org/archive/html/guile-user/2017-10/msg00027.html daviid: any java guru could tell me if one can call java from C? I'm reading this: http://www.hildstrom.com/projects/jni/index.html the idea i I have a jar (which I know out to access using kawa), so i'd write a C code, the use the ffi to bind it in guile ... dadinn: hi all foojin: Hi. dadinn: I would like to ask for some help regarding getopts option-specs, more specifically the predicate attribute. It seems that when I specify a lambda, and it gets quoted, but when later called, it will not get evaluated beforehand therefore results in "Wrong type to apply" error dadinn: I tried quasy quoting the opt-spec list and evaling the predicate lambda... this seems to work except I am now getting an error: Throw to key `match-error` with args `("match" "no matching pattern" (predicate ~ (lambda (s) (string-match "^[0-9]+[A-Z]?$" s)))))'. dadinn: aah, it seems unquote is not ~ ? dadinn: ok, how do I unquote in a ` quote? rain1: , dadinn: rain1: ah, cool. let me try it ;) foojin: parse-option-spec uses it as a function, so unquoting should work. dadinn: yeah it works :) dadinn: though, the error message is not too descriptive dadinn: it says that the option predicate failed dadinn: possibly i have to enhance the usage help a bit then :/ foojin: I've found a bug in format-related analysis code and fixed it. How do I provide a patch for inclusion in guile? rain1: I think that you can send it to the guile dev mailing list foojin: Are anonymous contributions accepted? If not, I can just describe the bug itself so that someone would come up with a (really simple) fix without having to include my code. rain1: good question, im not sure foojin: I tried contributing to a free software project once, but I got the impression that telling people about this upfront tends to make them freak out. Almost as if they made up an excuse not accept my submission. foojin: Linux kernel folks also tend to make a bug deal out of it. foojin: s/bug/big/ mwette: foojin: I don't think that happens here. You can also send to bug-guile@gnu.org mwette: foojin: check also https://debbugs.gnu.org/cgi/pkgreport.cgi?which=pkg&data=guile foojin: mwette: The tracker you mentioned isn't a distro-specific one, right? That is, will the patches be applied upstream if accepted? ft: That bugtracker just uses debian's debbugs. It's the bug tracker of the gnu project. foojin: ft: Thanks for clarifying that, the "deb" part tripped me up somewhat. mwette: foojin: I believe upstream bugs get reported upstream. mwette: foojin: ... if the bug happens to be upstream of guile. foojin: By the way, is there a web interface to that tracker? That is, can a bug report be filed in a web browser without needing to use a mail client? dxtr: Hi! So I compiled guile 2.2.3 from source and I was reading through the manual and got to https://www.gnu.org/software/guile/manual/guile.html#Readline - but (use-modules (ice-9 readline)) isn't working for me and then I realized I don't have the readline module. Why could that be? dxtr: I do have libreadline installed daviid: dxtr: you need to install guile-readline as well dxtr: Oh.. oops daviid: is it iif or iff (if and only if) amz3`: I am doing an AMA in /r/scheme https://www.reddit.com/r/scheme/comments/8h198t/ama_i_am_amirouche_boubekki_the_developer_of/ spk121: Hey. I came in 10th in the Lisp Game Jam. Given how it came out, I'm pretty pleased with that result. daviid: spk121: congrats! amz3`: foundationdb is so much a revolution manumanumanu: amz3`: how come= amz3`: manumanumanu: foundationdb is like wiredtiger but distributed amz3`: manumanumanu: which is very important in my grand plan to shake google manumanumanu: :D amz3`: it's has a similar API than wiredtiger, which means I will be up to speed quickly amz3`: and you can span the database over multiple boxes amz3`: and there is C client library OrangeShark: hello amz3` OrangeShark: amz3`: looking at FoundationDB's website, it seems interesting. So the core is a key-value store and you build layers ontop of it to provide different data models amz3`: yes OrangeShark: that is something that always bothers me, you might have data that are best stored in different data models, but most databases force a single data model dsmith-work: Happy Friday, Guilers!! OrangeShark: Happy Friday dsmith-work! amz3`: OrangeShark: that one is multimodel amz3`: you can implement sql, rdf, graph whatever, timeseries etc... amz3`: for some value of etc... OrangeShark: amz3`: yes, that is what I find interesting about it. Apparently there are other databases like it too https://en.wikipedia.org/wiki/Multi-model_database amz3`: ACTION hugs #guile amz3`: crazy stuff https://github.com/spullara/nbd amz3`: via https://forums.foundationdb.org/t/block-storage-full-fault-tolerance-for-legacy-applications/182 davexunit: I'm sure this has been brought up before, but is it possible to implement conditions/restarts a la common lisp in guile? amz3`: idk amz3`: good luck davexunit: ;) davexunit: thanks davexunit: does anyone know if, given a stack, you can run the program from that point? davexunit: like, if an error were to occur, and you captured the stack, could you recover and continue from that point? manumanumanu: davexunit: there is an implementation by riastradh for r7rs-large manumanumanu: which seems to be plain scheme amz3`: wow that would be neat amz3`: an alterenative to call/cc amz3`: I did not have time to work on culturia or guile stuff amz3`: I will work on day job stuff TMA: davexunit: I think it should be possible. call/cc is basically "capture the stack" operation davexunit: manumanumanu: thanks manumanumanu: davexunit: did you manage to find it? It is somewhere in the r7rs-large repo. jcowan probably knows where :) OrangeShark: is guile going to support r7rs? ArneBab: OrangeShark: AFAIK there is even already a mode which supports most of r7rs ArneBab: OrangeShark: searching through the info pages, you’ll find lots of points about r7rs janneke: sneek: later tell rain1: have you seen that (sxml xpath) overrides core filter? i renamed it to xpath:filter sneek: Welcome back janneke, you have 1 message. sneek: janneke, OriansJ says: I have a surprise for you sneek: Will do. janneke: sneek: botsnack sneek: :) janneke: ACTION goes to pull M2-Planet manumanumanu: ahoy hoy roelj: Is there a module to work with tables or matrices for Guile? (Other than working with lists in lists..) OrangeShark: roelj: there is multidimensional arrays in Guile OrangeShark: they are called "Arrays" in the manual roelj: Thanks. I think I didn't really phrase my question correctly though. Is there something equivalent to “data frames” in R for Scheme? manumanumanu: roelj: you can easily implement something similar on top of vectors, or even as just some convenience wrappers around hashes of hashes depending on what you want dsmith-work: {appropriate time} Greetings, Guilers janneke: good afternoon, dsmith-work ;-) ArneBab_work: there are 4 guile packages which fail the reproducibility test of debian: https://tests.reproducible-builds.org/debian/stretch/amd64/index_FTBR.html — background: https://media.libreplanet.org/u/libreplanet/m/you-think-you-re-not-a-target-a-tale-of-three-developers/ janneke: ArneBab_work: i see guile-2.0 -- no effort is made to make that reproducible, right? OrangeShark: so guile-lib, guile-json, guile-2.0, and guile-gnome-platform OrangeShark: there was an issue with the .go files which was fixed in 2.0.14 OrangeShark: janneke: ^ OrangeShark: and their guile-2.0 seems to still be 2.0.11 janneke: OrangeShark: ah, my bad -- that's very good news OrangeShark: janneke: if you click guile-2.0, it mentions issues with autotools ArneBab: janneke: they have a note about guile-2.0 that they want to fix some of the issues in GCC (though not all) janneke: ArneBab: yes, the reproducible project is doing great thing on gcc reepca: Hm, I'm sure I've asked this before, but forgot the answer... but I've tried using (debug-set! width 100) to get a better look at a long string argument, but it's not appearing any wider. None of the lines ever gets longer than 72 characters. Could geiser be interfering there? roelj: When using #:use-module, can I set a prefix per imported symbol? civodul: hey! civodul: you can do: #:use-module ((ice-9 q) #:prefix foo:) civodul: is that what you meant? civodul: if you need more flexibility, you can use #:renamer instead of #:prefix roelj: Hm, so #:prefix sets a prefix for all imported symbols. How does #:renamer work? roelj: It takes a function that can conditionally rename functions? roelj: (I found that in Guix's (test-packages) module) lloda: roelj: you can also repeat #:use-module with the same module and give a different #:prefix for different #:select lists roelj: Right. Thanks for the options! roelj: I like #:renamer. rain1: how do I define functions for use with macros? rain1: in racket its got 'define-for-syntax' is there an equivalent? rain1: https://www.gnu.org/software/guile/manual/html_node/Eval-When.html#Eval-When maybe this rain1: if i use eval when it seems that the next form after it gives a syntax error amz3: use-modules is so much easier to work with amz3: like: (use-modules ((guix packages licenses) #:prefix license)) amz3: otherwise, did any work with serverless architectures? so called aws lambda amz3: they are other implementation but it's the most popular amz3: I am wondering if it's possible to represent a sexp in NEON amz3: what i mean is save scheme code in the database on a per atom basis amz3: actually, that's what it does, but it doesn't execute the code, it must interpret it amz3: it's optimized for discovering data by orgnizing in (graph namespace key value tx) where tx builds a direct acyclic graph since the beginning amz3: we could further optimize the querying by adding the constraint atom are uint64 or similar fixed size numbers amz3: damn, I wrote that code at the very beginning of guile-wiredtiger amz3: I will need to dig into archeology amz3: to find it :/ amz3: linas: tell me about about the database you need amz3: sneek: later tell linas what database do you need? sneek: Will do. amz3: my TODO.org-mode http://termbin.com/48u5 amz3: ark, I got an idea but i am too lazy to write it down right now #LiveCoding mwette: /quit reepca: hm, strange, I'm getting "no code for module (ice-9 readline)" when I try loading it as per the manual daviid: reepca: you need to install guile-readline first reepca: huh, so I do. Wonder when that package was added. Thanks! rain1: why is readline separate from the rest of guile? daviid: rain1: I don't remember exactly, but think it because of a license problem, not sure .. but if you dig in our ML back between 1 and 2 decades, you find out :) daviid: reepca: np! note that most of us use emacs and geiser rain1: maybe we could get it merged in, it's GNU GPL daviid: rain1: though I don't remember, I think there is a reason, would have to ask our mantainers reepca: daviid: speaking of geiser - know any easy way to change the command it runs to start guile? I'm wanting to run ./test-env guile to interactively mess around with some stuff daviid: reepca: i guess it is possible, but can't answer for sure, look into the manual, it's short and well written ... daviid: http://www.nongnu.org/geiser/ daviid: reepca: you can join #geiser as well, and ask for help there, very friendly too OrangeShark: hello everyone amz3: hi OrangeShark rain1: good m orning guilers janneke: still wondering if working on Mes is more helpful than trying to create a minimalistic, bootstrappable version of Guile janneke: also, should i be developing MesCC running on Mes and Guile alike and trying to compile tinycc, or better bootstrap Guile's compiler first and write a GuileCC... amz3: what would guilecc do? sorry for the noob question janneke: amz3: thanks for your question ;-) janneke: MesCC is what I call the C compiler written in Scheme and intended to be run on Mes (my simple sort of Guile-compatible scheme interpreter) janneke: MesCC uses mwette's Nyacc C parser and compiles C into x86 assembly in the form of M1 janneke: of course Guile can already also run this MesCC C compiler, but as a proper Guile project it could use all kinds of constructs that Mes does not support, or that are very hard to bootstrap (syntax-case) janneke: so, GuileCC would be a C compiler written in Guile ArneBab: janneke: isn’t compiling tinycc the step towards compiling gcc 4.7 which is the step towards compiling gcc 4.7+ which is the step towards compiling guile? rain1: hi ArneBab ! ArneBab: hi rain1 rain1: wht you outlined there is the plan, I think rain1: but there is a gap in it kind of - we also need to build binutils and glibc OrangeShark: janneke: what would be required for a minimalistic, bootstrappable version of Guile? amz3: I think guile will not use gcc in the future OrangeShark: amz3: what would it use? janneke: ArneBab: yes, that's right -- mes+mescc->tcc->gcc-4.7 is a very promising path ArneBab: rain1: can’t we do that with gcc-4.7? janneke: OrangeShark: if i can put it a bit (too) black and white: make it so that libguile/eval.c can be built without the other 99% of libguile/*.c rain1: ArneBab, I would like to see it done for real, the exact process and how it is performed, what ./configure flags janneke: OrangeShark: using #if BOOTSTRAP and moving libguile/*.c parts to module/ice-9 or module/bootstrap/ even OrangeShark: so just the interpreter from guile is needed to run GuileCC which can then you go from there? janneke: OrangeShark: yes or to put it differently: everything beyond the interpreter/eval.c that we add to the bootstrap path, makes bootstrapping more heavyweight, more difficult janneke: OrangeShark: libguile is ~100,000 LOC and depends on libgc (~40,000LOC) janneke: mes is ~3000LOC janneke: libguile possibly depends on gnulib too, glibc ... enough to discourage me :-) janneke: otoh, creating a new GNU Scheme is an equally silly effort :-/ OrangeShark: yeah, hmm, sounds like a challenge. Also awesome work on mes :) janneke: OrangeShark: yeah, choices...thanks! rain1: it's ok to haave multiple schemes rain1: it just needs to be easily to build each next one janneke: rain1: yeah, why not build tarot first and have tarot+MesCC build tcc? janneke: how many LOC is tarot? rain1: its an option, but last time we checked I thin tarot was same size as mes - let me see janneke: rain1: but...that's great! janneke: mes+mescc build mes.c in ~3min (~3000LOC) rain1: It is a scheme compiler written in 1907 lines of scheme. rain1: It (when compiled) runs on top of a virtual machine implemented in 2033 lines of C. janneke: building tcc (~25,000LOC) takes ~1h20 rain1: https://github.com/rain-1/scheme_interpreter/blob/master/src/sch3.c i also have been working on this, 1300 lines atm rain1: but it doesnt really do anything yet janneke: even if tarot is "only" 10x faster than mes, that would be an amazing speed-up rain1: oh true! janneke: rain1: this is exciting! rain1: tarot can be bootstrapped off tinescheme but in future maybe off sch3 janneke: what does tarot need that mes doesn't have yet? rain1: i've never tried to build tarot using mescc, but I guess the main thing would be my use of computed goto for the fast interpter loop rain1: it could be replaced with a switch/case rain1: but also I never got around to trying to run nyacc or syntax- rain1: case in tarot rain1: I guess they are both possible but will take a lot of work rain1: so tarot might not be the best option janneke: rain1: we don't need syntax-case janneke: if mes can run nyacc, tarot surly can janneke: the most exotic things nyacc needs are fluids and call/cc janneke: ...what's a `computed goto?' rain1: lbl is a variable, and we can do goto *lbl in GCC rain1: it's a good trick to make a fast interpter loop rain1: https://github.com/rain-1/tarot-vm/blob/master/interpreter.c rain1: is call/cc used in nyacc for errors (which we could just replace with exit) or is it used for backtracking? rain1: and i'll look into the fluids, i'll need to learn them janneke: rain1: about call/cc: wow, that's a good question! -- let's ask mwette when they're around! janneke: i just assumed it was essential, but dropping call/cc would allow an amazing simplification of mes rain1: anotheng thing we can possibly do is simply make a copy of whole the tarot-compiler scheme repo and add features to it janneke: i imagine that goto *var would be a very simple feature to add rain1: really! that's good news janneke: can you supply me with a minimal example in C that exits 1 if goto fails and exit 0 if it passes? janneke: i'll try to add it to mescc rain1: https://bpaste.net/show/0961ac9d6396 janneke: rain1: that compiles with gcc? rain1: yes janneke: OK, great! rain1: https://bpaste.net/show/c48cf5d8f5be rain1: heres an example using it just like an interpreter loop janneke: nice...new for me rain1: it's supposed to be really good to the branch predictor, which makes it run faster janneke: guess that should be fairly easy to implement rain1: i haven't compared speeds against swich/case though rain1: ok and I will try to run nyacc on tarot rain1: at least I'll find out why it doesn't (I don't expect it to work) dadinn: hi all dadinn: i am quite new to guile, would need some help. dadinn: how can I create an imperative code block? I see that function bodies implicitly work like that, but for now what I am doing is (let () (dothis) (dothat) (andthat)) dadinn: I suppose this is not how it should be ngz: (begin (dothis) (dothat) (andthat)) OrangeShark: dadinn: ^ begin dadinn: OrangeShark: cool, thx! OrangeShark: dadinn: ngz was the one who responded first, you should thank them :) OrangeShark: it returns the last expression just like lambdas and let dadinn: ngz: thanks! dadinn: also another one I can't find, how to apply a function to a list, using the list as varargs dadinn: I was looking for something like `apply` dadinn: e.g. (apply add (list 1 2 3 4 5)) ngz: This should work. ngz: (apply + (list 1 2 3 4 5)) => 15 dadinn: ah, ok... couldn't find it in the docs by googling, so wasn't sure :) dadinn: i ran into an issue with getopts-long, using a predicate to validate the option value. The docs say it should be a procedure taking a single argument, yet I get the error saying: dadinn: ERROR: Wrong type to apply: (lambda (v) (not (file-exists? keyfile))) dadinn: ERROR: Wrong type to apply: (lambda (v) (not (file-exists? v))) dadinn: the docs say something about quasiquoting, but I am not sure what it means dadinn: https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong-Reference.html dadinn: "you may need to use quasiquotes to get it into grammar" amz3: héllo guilers OrangeShark: hello amz3 davexunit: amz3: I'm not sure. I wrote that before fibers was a thing, but perhaps it uses a Guile IO function that is written in C and therefore cannot be suspended. amz3: tx for the feedback, I will seriously give it some more time amz3: btw, I am wondering how to run a parser combinator over a scheme port, any ideas? davexunit: there's no good way to do it because you need to be able to backtrack davexunit: so you need some abstraction in front of the port that lets you do it davexunit: IIRC I used streams, but I know it's inefficient, so making something custom with performance in mind would be the way to go, I think. davexunit: for guile-syntax-highlight I took a different approach: just use strings. davexunit: read the entire source file, then parse it amz3: I was thinking about that in the context of websocket, I did not read the specification yet. Are messages prefixed with length or something like that in order to be able to load the whole message in memory and simply use vanilla parser combinators? davexunit: what are "vanilla parser combinators"? davexunit: my websocket abstraction handles reading all the messages. from the user's perspective they get one of two things: a string or a bytevector, depending upon what type of websocket message was sent (text or binary) amz3: vanilla, like your guile-parser-combinators, that doesn't support port per IIRC gour: evening, what are options to build desktop gui apps using guile? amz3`: guile-gnome amz3`: there is an example app called gnu foliot gour: amz3`: is that gtk2 or gtk3? gour: it seems that guile-gnome is gtk2 OrangeShark: gour: yes it is only gtk2 gour: ok, thanks daviid: when I snarf or rewrite something highly inspired by a procedure (or methods...) from guix, guile-gnome ... I write a note in the source file. so far I don't mention this in the manual, what is common practice here? amz3`: héllo guile amz3`: rs amz3`: héllo guilers amz3`: Apple liberated the code of the distributed database they bought amz3`: it's a distributed key-value store with ACID semantic amz3`: somewhat like tikv rain1: o/ amz3`: but written in C++ with something they call "flow" paradigm, that compiles to c++ amz3`: and somewhat like wiredtiger amz3`: I wondering what flow is actually amz3`: too bad, there is not guile binding for that, but the good news is that the library is C amz3: o/ spk121: amz3: neat amz3: I just discovered a fatal flow in my database design while reading this essay amz3: https://ac1235.github.io/apofsmp.html spk121: my silly Lisp Game Jam game is done. I have a few hours to build and upload the binary packages before the deadline. Ran out of time to make the audio work, sadly. https://github.com/spk121/burro amz3: spk121: hé, I did not even bother uploading mine last year amz3: spk121: I was disapointed by the user xp even if it was meant only to be a clicker game amz3: and many expressed interest in saying the game live spk121: amz3: cool. I've never done anything like this before. It was fun. The toughest part has been making Windows binaries, but, I've got that figured out now. amz3: davexunit: do you have an idea why guile-websocket doesn't work with fiber? lispmacs: hi, using GOOPS, can I have the initial value of one slot be calculated from the initial value of another slot in the same class? lispmacs: hi, using GOOPS, can I have the initial value of one slot be calculated from the initial value of another slot in the same class? daviid: lispmacs: if not i the class definition, yu can definitely add an initialize method lispmacs: daviid: can you clarify? daviid: lispmacs: in the manual, look for (define-method (initialize (object ) initargs) ...) [and 'play' with it till you're happy ... you'll need to call (next-method) inside your specialized intilize methods ... daviid: lispmacs: I'm a bit curious about why you wan't/need to do this though, saying this so you think twice about design ... lispmacs: daviid: so, i have game object that needs to store a "health" value and then a "maximum" health value lispmacs: currently, I set both values at instance creation daviid: these seems independent to me, are they not? lispmacs: daviid: during the game they are daviid: which one depends on the other? lispmacs: at instance creation, I just want to be able to specify maximum-health, and then health is set to that lispmacs: of course, it can be damaged, resulting in lowering of health, but not maximum health daviid: and then along the game, which one gets altered? lispmacs: only health gets altered during the game, maximum health stays the same lispmacs: (though of course I might change my mind on that at some point) lispmacs: the point is when I create an instance, I only want to have to specify init value for maximum health lispmacs: because health will always start off at maximum daviid: I see, then you would write an intialize method indeed daviid: if the maximum for all gamers? daviid: *is daviid: or a per instance? lispmacs: per instance daviid: ok daviid: here is an example of such initialize method: daviid: http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/clutter/apple.scm?h=devel line 232 and ... lispmacs: Hi, I want to be able to implement a GOOPS class with dependent slots, i.e., one slot initializing to a value based on what another one is set at lispmacs: do, I'm trying to figure out how to write `initialize`, but to be honest having a little trouble digesting the info manual on GOOPS MOP. lispmacs: is there perhaps a tutorial or something that might be helpful? djcb: I'm defining some global config variables for my API; is there a recommended way to name them>? I.e., *my-variable* or %my-variable seem to be the popular choices. lloda: *parameter* and %global-variable I think lloda: I only use *parameter* myself OrangeShark: djcb: http://mumble.net/~campbell/scheme/style.txt is what is recommended to follow in guix OrangeShark: so it recommends *my-variable* for globally mutable variables. thomasd: repeating my question from yesterday (how many tries do I get? :-) ): is there a way to compile a guile script and run it, apart from the auto-compilation? OrangeShark: thomasd: so you compile the guile script and it still auto-compiles when you run it? thomasd: no, I compile the guile script with guild compile script.scm -o script.go, but then I don't know how to run the script .go thomasd: I know it's possible by creating a module and an entry procedure and calling 'guile -c "((@ my-module) my-procedure))"', but that seems overkill thomasd: Oh, it's just the file-name. The compiled file should be "script.scm.go", and then guile does find it :-D thomasd: instead of "script.go", that is djcb: OrangeShark: lloda: great, thanks! bavier`: thomasd: you can put guile in the shebang. there's a section in the guile manual discussing it amz3`: o/ amz3`: héllo all rain1: hi amz3`: rain1: what's up? rain1: nothing much, thinking about what to work on next amz3`: that's the hardest amz3`: ;) amz3`: everything is difficult amz3`: rain1: what did you do previously? amz3`: On my side, I am trying to create a user interface that looks like a REPL in a browser amz3`: my initial thought was to create a Natural Language to RDF query but I will stick to simple commands for the time being amz3`: also, I resurected the documentation https://github.com/amirouche/neon/blob/feb2f221b7a9dc0a89477618dec2d2917ca85612/doc/MOCHA2018/preview/neon-mocha-2018-preview.pdf amz3`: I had prepared a paper for participating to mocha challenge amz3`: but did not submit it amz3`: it's the most interesting documentation amz3`: also I've been adding unit tests amz3`: I am thinking about how to implement full text search inside the versioned triple store amz3`: quad store acutally amz3`: My current thought is to simply implement a blog app with a REPL-like user interface amz3`: even if it's sound silly and is not very good for search engines, it could be fun amz3`: I will store REPL session in the database with private links, so that people can come back later and continue there session amz3`: what I would like to know is how people interact with the REPL amz3`: and increase coverage of commands little by little amz3`: actually, I already wrote somekind of REPL in a web browser in the past, https://imgur.com/a/uYBUPTA amz3`: I would love to use guile-gnome, but the setup is daunting amz3`: Also, I am trying to get hang of the code base at my new job amz3`: very difficult, a lot of moving pieces, and many many repositories, which makes it hard to reason about the code properly amz3`: thankfully emacs support go-to-definition via elpy amz3`: what I would like to know is how people interact with the REPL, and increase coverage of commands little, maybe along the way I can do some AI that is more interesting that regular expressions spk121: Hello everybody. Is guile-enabled gdb still broken because of the guile 2.2 ports change? Or does guile-enabled gdb build now? mejnour: Hello, guys. I asked in other channel where I could discuss lambda-calculus and computational theory. They pointed me here. Am I in the wrong place? rain1: what is your question about lambda-calculus/ mejnour: Well, not about lambda-calculus in particular. I'm a grad cs student and just started looking into this stuff. I was hoping someone could suggest litterature about concepts such as Turing-completeness and Turing-equivalence mejnour: btw, just read about guile. Is it Lisp? I'm studying a lisp right now. I'll look into it for shure mejnour: sure* rekado: mejnour: Guile is an implementation of Scheme, which is a lispy language. rekado: mejnour: compared to other lispy languages (e.g. Common Lisp) Scheme is rather “minimalist”, but I’m using the term lightly. rekado: One difference between lisps is whether they use one namespace for procedures and other variables or split them in two. rekado: Scheme has a single namespace for procedures and other variables; a variable is thus just a name and a place for any value, including procedures. rekado: What lisp are you studying? spk121: hi rain1: hi OrangeShark: hello everyone mwette: greetings rain1: hey thomasd: hi #guile thomasd: (how) can I compile a guile script and run the compiled file, avoiding autocompilation? bavier`: just read the recent guile 3 update from wingo OrangeShark: bavier`: is that on the guile-devel mailing list? bavier`: OrangeShark: yes OrangeShark: bavier`: I see it now, thanks. I keep forgetting to check guile-devel mailing list every once in awhile spk121: If there are any French persons about.. Which is correct "EUR 1 234,56" or "1 234,56 EUR" or "1 234,56 +EUR" spk121: (This is a Guile question, honest. I'm checking i18n.test) niebie: hi #guile - i've been playing around with calling guile from c and have a question about it. niebie: i've got some records defined using srfi-9, and want to call the getters from c niebie: when i try and call them directly, i get 'Wrong type to apply: #' niebie: but if i wrap them with some guile, and call the new function it works fine niebie: A working example is at https://gitlab.com/niebie/guile-c-sdl-sandbox/blob/master/guile_load_test.c#L55, https://gitlab.com/niebie/guile-c-sdl-sandbox/blob/master/scm/modules/niebie/game/c-interface.scm#L19, https://gitlab.com/niebie/guile-c-sdl-sandbox/blob/master/scm/modules/niebie/game/states.scm#L82, https://gitlab.com/niebie/guile-c-sdl-sandbox/blob/master/scm/modules/niebie/game/types.scm#L48 niebie: but if i change https://gitlab.com/niebie/guile-c-sdl-sandbox/blob/master/guile_load_test.c#L54 to scm_c_public_ref("niebie game types", "state-name"); niebie: then it give that error niebie: i'm trying to give as much detail as i can - let me know if i need to clarify further niebie: note that it can be tested in guix using the ./env.sh script, and calling 'make run-test' amz3`: héllo #guile rain1: hi! OrangeShark: hello everyone jlicht: o/ cmaloney: morning turlando: I'm building a list with (list x1 x2 x3). I want the output elements of a map inside that list. (list x1 x2 (map f l)) will of course produce (list x1 x2 (x3 x4 ...)). Is there a way to "unpack" the list so that it will result in (list x1 x2 x3 x4)? OrangeShark: turlando: is the map applied to x1 and x2 as well? turlando: OrangeShark no, it isn't OrangeShark: only applied to the last element of the list? rain1: I think the thing you need is (list* x1 x2 (map f l)) rain1: sorry cons* turlando: OrangeShark, rain1 this is an example of what I want to achieve in python: [1, 2, *[x+2 for x in [1, 2]]] #=> [1, 2, 3, 4] turlando: I'm using a comprehension instead of a map, the concept is the same OrangeShark: turlando: okay then you can use what rain1 suggested and use cons* turlando: Thanks to both, I'll try that :) OrangeShark: (cons* x1 x2 (map f l)) turlando: OrangeShark doesn't seem to work as expected https://pastebin.mozilla.org/9083801 OrangeShark: turlando: remove the '() at the end OrangeShark: the last argument will be the tail of the list rain1: https://pastebin.mozilla.org/9083803 OrangeShark: oh, did not notice there was something after the list chris-l: guilers - is the best practice for macros nowadays syntax-case? amz3`: civodul: did you try my patch against skribilio? civodul: amz3`: not yet! civodul: hopefully soonish amz3`: no problem OrangeShark: amz3: I feel work drains most of my motivation to work on free software project amz3: well, I remember some time when I was productive and working and smoking weed amz3: I don't think weed qualify as doping ^^' amz3: no it's not that amz3: Right now, each type I type a line of code, I discover new numerous other lines of code that must be coded amz3: Right now, each +time I type a line of code, I discover new numerous other lines of code that must be coded1;5C amz3: it's like never ending story amz3: so I stop i despair of never fininshing anything good enough daviid: amz3: don't be too rude with yourself ... amz3: like work is eye opening, you can do crap and make money amz3: but free software has more excepectation amz3: daviid: sorry, but it's true, i can't fight the sentiment that what I do will never be perfect or good enough amz3: that's what is helping me to be lazy in the bad sens OrangeShark: amz3: it is a common problem, I always see people asking for advice on how to deal with it. amz3: oh amz3: it's the blank page issue, but it looks like amz3: it's +not the blank page issue, but it looks like amz3: Ok, I will look the web for that amz3: tx OrangeShark: I feel like starting another project too rain1: you must work on finishing things rain1: if you don't finish anything then working on anything seems pointless, because you know you wont finish it longshi: amz3: you gotta power through man jralls: spk121: Thanks for the heads up. I'll leave it to you then. We (GnuCash) are using Mingw-w64. We don't need thread support but need a Cygwin-free build so the one in the MSYS2-packages repo doesn't work for us. daviid: amz3: we all thin that, not a single human being beleives he/she is perfect daviid: *think daviid: so, kepp cool! we are discussing here t ask for help, and this channel is very friendly, that is how we progress, and it is never good enough, for all of us, beleive me :) daviid: I agree with rain1 though, it is important to finish .. daviid: amz3: I did and sometimes read your code, I can see it is a lot better know then a few years before, you see, you made terrific progress daviid: and it never ends ... daviid: bbl, have to go afk a bit nalaginrut: morning guilers~ OrangeShark: hello everyone spk121: So 6 days left in lisp game jam. I figure it will take 2 days to debug, build and package everything, so 4 days left for writing. https://itch.io/jam/lisp-game-jam-2018 spk121: I'm building off of an interactive fiction engine I had already. spk121: http://spikycactus.dnsalias.com/photo/burro_progress.png (I can't test this link from this side of the firewall, so hopefully it works) OrangeShark: spk121: it works spk121: thanks! OrangeShark: wow 133 people joined the lisp game jam? ecraven: nice ;) amz3: tx all for the feedback yesterday ArneBab: spk121: lisp game jam — damn, I missed that. Do I have to sign up or can I simply submit? OrangeShark: ArneBab: there is a join button on the website ArneBab: OrangeShark: I found it — thank you! daviid: funny, reading the log and I see everthing I wrote yeserday appears twice in the log, I wonder why daviid: amz3: for info, we don't have gtk3 bindings (yet), and guile-clutter does not use gtk at all, it has its own scene, precisely not to depend on gtk ... so foliot uses guile-gnome, which binds a very old version of gtk still ... I'm saying this not to spread 'false hope' to new comers asking for gtk3 bindings ... daviid: those who wants to have clutter and gtk need clutter-gtk, but we don't have bindigs either daviid: and I do not recommand someone to embark on ffi bindings for gtk3, whithout glib and gobject it won't allow much ... and the path is introspection, anything else will ask for far too much work, imo daviid: I need to find the time to work on G-Golf, but in the mean time one of us could try to make sbank work for guile (it is meant to work with guile (to), but iirc it just need a tiny bit of love :) ... sbank uses message passing (invoke) G-Golf uses (will use) goops, which is exactly why I strated G-Golf (among other reasons) daviid: sbank is here: https://github.com/rotty/sbank.git jralls: wingo: What's Guile's policy about Windows? Is Cygwin a hard requirement? spk121: jralls: I'm the last one to patch up Cygwin, and for the past couple of weeks, I've been working on the MinGW. I'm close to making the 32-bit, non-threaded MinGW work in a private branch. spk121: I think Cygwin is in pretty good shape except for fork and some minor locale problems. guile-guest4: hello all guile-guest4: newbie curious about LISP considering to dip my toe in, any suggestions where to get a first taste? guile-guest4: anyone listening? guile-guest4: hello guile-guest4: testing a little, seems nobody's on line at the moment slondr: uile slondr: hello amz3: héllo slondr: this is a basic question but how do I call reduce/fold in guile ngz: You have to load srfi-1 slondr: How do I do that? I am very new to this language ngz: For example, from the REPL, you use (use-modules (srfi srfi-1)) ngz: Then `fold' is available. ngz: You may want to read (info "(guile) SRFI Support") slondr: Thank you! turlando: Hello folks turlando: I know it sounds silly, but I couldn't find in the documentation the C function to convert an SCM string to a char pointer. Is there any? Will it produce an ASCII string? turlando: Also: is there a function to convert a keyword to a char pointer? Currently I'm doing keyword->string->charp turlando: Ok, just found scm_to_*_stringn faraco: Hi..where could I find GTK3 (not gtk2) for Guile binding? amz3: faraco: there is amz3: faraco: look at guile-clutter and an example app called gnu foliot amz3: faraco: I mean guile-clutter and guile-gtk2 or 3 I don't remember amz3: I will find the link for yoiu amz3: it's called guile-gnome → https://www.gnu.org/software/guile-gnome/ amz3: faraco: ^ amz3: spoiler I made a patch for skribilio :] amz3: +small mwette: looks like guile-gnome uses gkt2+ , check configure.ac in dist root faraco: amz3: Thanks for the link but it is not Gtk+3 as far as I know.. mwette: There are raw ffi "pre-bindings" for gtk2+ in the ffi-helper part of nyacc. It might be possible to generate a gtk3+.ffi from the gtk2+.ffi. Are there extra libraries gtk3+ needs that gtk2+ does not have? mwette: gtk2+.ffi: http://paste.debian.net/1021463/ mwette: but the generated scm code is a raw guile API to the underlying C code faraco: So I can just use the ffi to connect through gtk3? mwette: The command "guild compile-ffi" (not "guile compile-ffi") generated a .scm file from the .ffi file. Then, if that works, you use-modules the .scm file and go with that. I have been able to get very simple gtk2 demos to work. This is experimental code. mwette: Here is a working gtk2 demo: http://paste.debian.net/1021467/ mwette: You would need to "cp gtk2+.ffi gtk3+.ffi" and go from there. I don't have gtk3 to try. amz3: let's start another project.. mwette: faraco: I'm looking at gtk3. The package seems to depend on subclassing objects with help from lots of C macros. I'd guess generating apps from the raw interface provided by the FFI Helper is likely to be hard work. kristofer: davexunit: hey! can you possibly share an idea of your workflow when using haunt to build a site? daviid: is there an emacs command to switch between editng adn viewing lnks? daviid: is there an emacs command to switch between editng adn viewing lnks? daviid: in org-mode daviid: in org-mode ngz: C-c C-l maybe ngz: C-c C-l maybe ngz: But I think this is the wrong channel ngz: But I think this is the wrong channel daviid: ngz: :), most of us use org mode, so its fine to ask a few tips, not as if I started a political conversation or so ... relax daviid: ngz: :), most of us use org mode, so its fine to ask a few tips, not as if I started a political conversation or so ... relax ngz: I'm totally relaxed. I was merely suggesting you might have more luck on #emacs or #org-mode. ngz: I'm totally relaxed. I was merely suggesting you might have more luck on #emacs or #org-mode. daviid: yep, we all know this too, but thanks daviid: yep, we all know this too, but thanks ngz: ... amz3: I have the feeling i was more proeductive a few years back, it's unrelated to the actual programming language amz3: I don't to what to attribute, my lazyness amz3: some flame of programming was exctinct in me amz3: I must revive it mwette: jobs daviid: sneek: later tell spk121 you could use guile-clutter, and look at (and run) the bouncer, drag, drag and drop examples I wrote ... you'll be able to make a square move on the screen in a few minutes :) https://www.gnu.org/software/guile-gnome/clutter and http://www.nongnu.org/grip/examples.html sneek: Okay. amz3: héllo! spk121: hi sneek: Welcome back spk121, you have 1 message. sneek: spk121, daviid says: you could use guile-clutter, and look at (and run) the bouncer, drag, drag and drop examples I wrote ... you'll be able to make a square move on the screen in a few minutes :) https://www.gnu.org/software/guile-gnome/clutter and http://www.nongnu.org/grip/examples.html amz3: Any idea what this error means: ;;; In procedure car: Wrong type argument in position 1 (expecting pair): #\\nul amz3: nvm, the error is gone somehow lispmacs: hi, can I convert a real to a integer? spk121: (inexact->exact (round "1.0")) lispmacs: spk121: thanks! chris-l: i've just discovered emacs-quack: whoaaaa daviid: chris-l: for info, it's old (its own words) and unmaintained, even its sucessor is unmainained ... any reason why you would prefer these to geiser? curious chris-l: erm it's the colour coding that was attractive amz3: I am so lazy. mwette: Welcome to the club! amz3: ^^' amz3: I keep re-coding what I already coded, with small improvements amz3: that being said, neon is two step forward I think amz3: I already know that I will recode my current work on top of g-golf Labu: Hello ! rain1: hi tavoris: use the module (srfi srfi-1) got it rain1: https://itch.io/jam/lisp-game-jam-2018 spk121: rain1: lisp game jam sounds like fun. I signed up. This is going to be a disaster. haha spk121: On a related note, I'm really close to getting Guile 2.2.3 working on MinGW (null-threads, 32-bit only). The last remaining functional problem is an implementation of alarm signals to make ice-9 sandbox work. spk121: Actually, threads almost work, too. But there are occassional deadlocks during GC, which seems a thorny problem. spk121: Uncharted territory for me, if I do this game jam, would be making self-contained downloadable binary packages. Oh, and learning how to draw. cmaloney: Should there be a game in there somewhere ? :) spk121: cmaloney: in 9 days, if I can make a square move about on teh screen, that'll be more than I've ever accomplished before. cmaloney: <3 cmaloney: Good luck! :) fibration: is there a way to re-export a whole module? longshi: Hello fellow schemers! So, frustrated with the experience of using skyscanner (and similar) to look for very-cheap flight tickets, i thought about making my own little program to use provided by skyscanner api to query their database and send email when the query is ready. My first instinct was to do this in guile, because that is what i know best (i'm a amateur coder and learned lisp by a happy accident)--but longshi: I also dabbled with chez, chicken and tried learning some golang. I would love some tips regarding technology choice. I imagine i'm going to need some json libraries, maybe sql and net capabilities to fetch data from the api endpoint. longshi: Thank you in advance! lloda: fibration: look here https://github.com/aconchillo/guile-json/blob/a1c323d77ee60f9008e654b02cfe1ed3232d90e1/json.scm#L33 fibration: lloda: thanks lloda: amz3: that doesn't work :D chris-l: guile-json is so nice... it should be part of guile OrangeShark: hello everyone dustyweb: hello everyone, including but not limited to OrangeShark :) rain1: hey :) OrangeShark: what have you been up to dustyweb? janneke: hey dustyweb dustyweb: OrangeShark: janneke: hey there :) dustyweb: I've been porting 8sync to racket, but simplifying some things so actors "look" more like regular procedures... I'll probably come back and change 8sync to look likewise soon :) dustyweb: with class-based actors as an optional but well supported component daviid: dustyweb: heya! so, wrt guile-squee, yu still did not merge devel into master, it's been 3 years now :), what is the blocker? daviid: didn't know we had a guile-redis binding, which received a few patches recently, cool stuff! if the author is here, I suggest they had an entry, to the wikipedia redis page - the languages binding list... dustyweb: daviid: didn't I give you commit access? ;) dustyweb: daviid: tbh you should take over guile-squee dustyweb: or someone else dustyweb: I am unlikely to maintain it amz3: longshi: so, what's your plan? amz3: longshi: what is skyscanner? #lazyweb blurgh: Has the Nash T blurgh: TJIT been mainlined yet? terpri: blurgh, i don't think it has. the changes from https://github.com/8c6794b6/guile-tjit aren't in guile master afaict daviid: dustyweb: sorry, I went away from the kb ... yes have commit acces, but at the time, we decided to talk to each other before to merge, and I thought you would merge ... that is a lng time ago of course ... so, ok, I'll take it over, as time allows, it's too bad you won't further work on it, but I understand, you're 8sync and racket tranfuge now, :) dustyweb: sorry :) dustyweb: I am awful daviid: I really enjoyed the time you were here everyday, pushing ideas and sharing your hacks, goops, squee, 8sync ... jokes, articles, blogs, ... longshi: amz3: Well, first to get an API key from skyscanner, which is a flight search engine provider, send some json queries to endpoint try to receive it and process somehow longshi: I haven't still gotten to the part of the API documentation saying how big sql queries i can send longshi: Because their web interace is simple and limited, doesn't allow you to, for example, ask for the cheapest flight from any place in a given country to any airport another given country. longshi: Over one month, for example longshi: I think this is because the "heavy" SQL queries take long time, and flight scanners generally get paid by airlines, not the customers. dustyweb: daviid: I appreciate the kind words... I'm sorry I've been more absent lately! longshi: Yeah, so that's the plan dustyweb: I'm still every day a guix, and thus guile, user though :) tavoris: So what gods might I have offend to end up with the error 'Unbound variable: fold'? the file read like test.scm:'(fold + 0 '(1 2 3 4))\\n' and is called with 'guile test.scm' blurgh: I tried installing Guile on Void Linux from source because the package in the repo is outdated (2.0.14). When I ran ./configure, it ran until it told me that libltld wasn't found. I reinstalled libltld and got the same error. What do? rain1: you may need libltld -dev packages or something rain1: libltld-devel daviid: blurgh: what is your distro? I recommend you install the distro version first, then remove it (but without purging), so dependencies are satisfied (great chances that it will also satisfy 2.2), then install 2.2 blurgh: rain1: Thanks, I'll check if that's in the Void repos. daviid: blurgh: note that you should checkout stable-2.2, after clning, master is for 3.0, not ready yet ... blurgh: daviid: The folder I have is for 2.2.3. Is that incorrect? daviid: blurgh: ah ok yes you grabbed the tarball, good daviid: I thought you did clne the repo ... blurgh: It went through libltdl checks correctly this time, but now says that my GMP package is outdated (needs 4.1 or greater). Ah, the joys of an experimental distro. I would libreboot my T400 and install Guix, but the Libreboot community has been incredibly unhelpful. rain1: I assume you have got gmp-devel rain1: what you might want to do is set up xbps-source and modify the gmp,mpfr,mpc packages to point to newer versions blurgh: rain1: I figured it out and got it to work! rain1: nice blurgh: Thanks. blurgh: I'm running make right now and it's show a bunch of .go files. I didn't know that Guile was partially written in Go. rain1: go is guile-object file :P rain1: its not actually written in go blurgh: Oh. So these might actually be ~20 years older than Golang? blurgh: Seeing as Guile is from 1993 and Go is from 2009. rain1: well I think the .go idea is relativily recent in guiles history.. but i ddon't know the full details lloda: what is a (match) pattern for a list which is zero or more integers, then #t, then zero or more integers rain1: I don't think match can recognize such complex patterns lloda: rain1: ah, pity amz3`: lloda: did you try something like (a . (#t) . b) OrangeShark: hello everyone rain1: hi amz3: o/ ftknox: \\o amz3: https://ac1235.github.io/godek.html OrangeShark: amz3: thanks for the interesting read Apteryx: Hello, could someone explain to me how match-let is supposed to be used? I see it's like a match, but where does the value to be match against come from? rain1: where are you getting match-let from? rain1: oh im sorry rain1: this would obviously be from ice-9 match rain1: I thought this was #chez Apteryx: I think that's where it was imported from (chez) rain1: so match-let is not documented, not even in the source code rain1: you basically have to reverse engineer its use from the implementation Apteryx: but it now exist (undocumented) in ice-9, specifically in a file called: match.upstream.scm rain1: (match-let ((`(,x ,y) (list 1 2))) (list x y)) rain1: $4 = (1 2) rain1: you can use it like this rain1: so i think the basic way it works is (match-let (( ) ...) ...) rain1: and there is a named let variant rain1: and a let* variant Apteryx: I see. So the last expression found in the inner list of match-let(...) is what feed the match pattern which makes the first expression of that inner list. Apteryx: rain1: your explanation is more complete. Thanks, I will try it out :) rain1: glad to hlelp Apteryx: your example could also be written as: (match-let (((x y) (list 1 2))) (list x y)) lispmacs: hi, I want to add a scheme package to libreCMC (and openwrt fork). Could guile be reduce to <8MB, or should I be looking at something like tinyscheme? djcb: with the guile 2.2.2 repl, when the first (load-extension ...) fails (file not found), a second attempt locks the repl, apparently in a mutex (from scm_dynwind_pthread_mutex_lock) djcb: ie. the second `(load-extension "foo" "bar")' locks the repl amz3: héllo all! amz3: I published the video at https://youtu.be/YMYh6f_jODg OrangeShark: amz3: is this a new video on neon? amz3: OrangeShark: yes amz3: The one I posted yesterday, as mp4 amz3: but i don't know how to encode it properly in ogv amz3: It still missing a lot of things, like filters amz3: and push/pull things ison111: Is there any way to sort of convert a procedure into a list? OrangeShark: hello everyone zxq9: OrangeShark: hi spk121_: Now I understand why Guile on 64-bit MinGW never worked. Guile has the strong assumption that sizeof(void *) == sizeof (long). Disambiguating them is quite annoying. slyfox: amd64 x32 ABI has the same assumption slyfox: (i mean it does not hold as well) slyfox: and mips n32 ABI spk121_: slyfox: interesting daviid: would you prefer string-prepare-for-sql or string-escape-for-sql? daviid: or another even better name I'm not thinking ... daviid: maybe string-escape-sql (so I can have string-escape-filename ... amz3: morning at GMT+2 amz3: it seems my last mail, did not reach the mailling list amz3: I will just make it in my blog instead for once amz3: It's quiet some time i did not blog about guile actually amz3: it's been at two weeks I've no touched that code base, I am not ever certain to know if that would still make sens to me amz3: I have been watching this, and the API is not terse enough: https://asciinema.org/a/jSgdN3qlHBclRh0kDj1t5QtFX Labu: Hello All ! janneke: hi Labu Labu: Hi janneke ! amz3: Héllo Labu amz3: I did not publish the video I did, that's why I can't find it amz3: http://www.hyperdev.fr/static/gnu-guile-hacking-15.mp4 djcb: Hmmm, seeing 'Thread 1 "guile2.2" received signal SIGPWR, Power fail/restart.' djcb: What would that mean? amz3: djcb: are you seing this in gdb? djcb: amz3: I am, yes amz3: djcb: I was said, it's the GC, it's harmless apparantly amz3: https://www.mail-archive.com/guile-devel@gnu.org/msg14438.html djcb: amz3: ah, thanks! I'll ask gdb to ignore it. random_auroras: So, how would I get access to the port exposed by http-get? random_auroras: I do get a <>-typed object. mwette: random_auroras: not sure what you want. Use call-with-values on http-get; the first value is a the second is the body. I have just run demos with it but that is how I used it. random_auroras: Yeah, I'm trying to get the body with 'car'. Ain't working. random_auroras: erh, cdr mwette: you need (call-with-values (lambda () (http-get ..)) (lambda (resp body) ...) random_auroras: :/ Why is that not mentioned anywhere in the info manual? random_auroras: Though by all means, thanks for pointing me the right way. daviid: random_auroras: the manual says "Returns two values: the response read ... and the body ..." which means you have to either use receive - in (ice-9 receive) or call-with-values as mwette showed you above ... random_auroras: daviid: I see. Thanks. random_auroras: daviid: Thank you. A lot. daviid: np! random_auroras: I can get the value into a variable. Oddly-enough though, (with-output-to-file filename (receive (header data) (http-get my-url) (lambda () data))) seems to be having a hard-time. random_auroras: (It's writing blank files) random_auroras: nvm random_auroras: https support was only added in v2.2 right? mwette: ls turlando: Hello turlando: I have created some foreign object types and I have gsubrs returning those types. Is there a way at run time to determine if an SCM value returned from one of those functions is one of the types I defined? mwette: turlando: (display ) mwette: turlando: scm_make_foreign_object_type(scm_from_utf8_symbol("mdes"),..) will then set up the printer for that type to show the name mwette: turlando: for my "mdes" object type , (display (make-mdes-1 'G1)) returns `#' mwette: turlando: Ah. You want a predicate? let me check ... mwette: turlando: it looks like you need to use goops (yuck imo) mwette: I tried to generrate a predicate in C but does not work. This is it: static SCM mwette: scm_cdes_p(SCM _des) mwette: { mwette: return SCM_IS_A_P(cdes_type, _des)? SCM_BOOL_T: SCM_BOOL_F; mwette: } mwette: mwette: turlando: works now `return SCM_IS_A_P(_des, cdes_type): SCM_BOOL_T: SCM_BOOL_F;' turlando: Thanks a lot mwette! I'll try that. mwette: turlando: I have submitted bug report to add something to the manual. OrangeShark: hello everyone Labu: Hello! rain1: hi! ArneBab: sneek: later tell catonano: autotools is pretty nice, but it is hard to find clear documentation because lots of half-truths are floating around the net and it misses clear guides "how to do X nicely with autotools". sneek: Okay. ArneBab: sneek: botsnack sneek: :) amz3: sneek: botsnack sneek: :) amz3: ArneBab: how are you doing? Is there new job neat? amz3: ArneBab: how are you doing? Is yout new job neat? amz3: ArneBab: how are you doing? Is your new job neat? amz3: ACTION tired cmaloney: Bean Tune Joy Row? ArneBab: amz3: yes, the new job is pretty cool -- it’s java, and an old codebase, but challenging and fun nontheless. ArneBab: amz3: I spent the past week battering SSL into some not-yet-secured connections, and that felt great, because it is the right thing to do. And I’m working on a presentation of Emacs for time management, along with a prepared environment people can simply run. ArneBab: amz3: this was my first larger task: http://blog.disy.net/i18n-migration/ ArneBab: amz3: and our team leader knows his stuff: I feel like the right technical decisions are taken. He somehow manage to combine experience with willingness to experiment for getting things really right. ArneBab: amz3: and I could write that blog entry on work time amz3: very neat indeed amz3: I like my new job too amz3: I am not confident the write about it yet amz3: tho amz3: on a related, not I stopped working on neon database, for the time being the time to catch up with work related stuff amz3: it seems very odd to support full RDF spec for getting things done amz3: and some people told me they are framework to test performances of non RDF pure implementations amz3: so I did not fill in the competition of HOBBIT contest amz3: #fail amz3: :) ArneBab: that happens — don’t fret about it, a new job fills part of the mind, and that’s ok. amz3: I am diving into Ansible nowdays as part of work amz3: I am curious about thing they call devops ArneBab: ah, wow daviid: ArneBab: 'Emacs for time management', you mean timekeeping? amz3: right now, after reading the whole documentation, I have the feeling they created a new language that embeds a few procedures to to do remote calls on a host ArneBab: daviid: partly that, but also planning, todos, tracking my weekly work time, and naturally taking notes in the clocked entries :-) amz3: ArneBab: org-mode? ArneBab: amz3: sounds like ansibles language have been created more elegantly (*cough* guile *cough* :-) ), but I’m pretty sure they had their reasons (things are rarely easy) ArneBab: amz3: yepp, org-mode and org-agenda with clocktable and org-capture, combined with org-jira (and since today excorporate), all polished and integrated that things just work daviid: ArneBab: asking because, as you know, I wrote gnu foliot ... amz3: ArneBab: it sounds like they wanted some kind of non programmers to code or somethig to me maybe it's wrong thinking daviid: ArneBab: I personally think that apps that do timekeeping (precisely like foliot) should not also offer todo's ... then I kept foliot ultra tiny: it just does that (timekeeping). I don't beleive in time tracking ArneBab: daviid: I know, but since it wasn’t in Guix for a few months, I decided to go for org-mode, and it’s working pretty well now. daviid: I think it still isn't in guix, or is it now? amz3: I use org-mode too, ArneBab: I don’t think it is in Guix amz3: but it might be a good idea to test gnu foliot, since i use gnome daviid: me too, all the time, but not for time keeping it just does fir for the job, afaic ArneBab: daviid: I actually don’t need anything complicated, it just has to be as low-overhead as possible amz3: there is no package yet for guix :( ArneBab: low overhead not in CPU but in "Arne has to remember to do X" amz3: erf I think I started one... but don't know where it is daviid: ArneBab: sure, exactly the spirit of foliot: a non s/w eng. user could use it without any lesson, in 5 min ... amz3: that said, my use is very simple ArneBab: daviid: that sounds good — it has but one drawback: it is not already in Emacs, and I am in Emacs in the morning when I check what I am working on ArneBab: daviid: my workflow in the morning: click F12 to see org-agenda on the right and the emacs kanban table on the left. Choose a task and hit shift-F12. daviid: non it's not, it's a tiny gtk2/sqlite2 app ArneBab: when I switch to another task, I hit 8G–. ArneBab: shift-F12 ArneBab: (not 8G-) ArneBab: when I leave for lunch, I hit Alt-Shift-F12 anywhere to stop the clock daviid: yep, but where do you write how much time you spent on what projects ...? ArneBab: and when I mis-clock anything, I just edit the text file :-) ArneBab: that’s what org-mode does, since the tasks are organized in projects ArneBab: the clocktable aggregates everything automatically, shown below the agenda ArneBab: (that’s the part about shift-F12 when switching the task: It tells org-mode to clock on that other task) daviid: ah i see. i don't work like that, because if my brain stop being fully concentrate on the task, I don't charge my customer, so generally, out of 4h, I will only charge 2 or so ... ArneBab: and Alt-F12 creates a new task via org-capture daviid: i see, just don't like any clock based timekeeping approach OrangeShark: ArneBab: there is an emacs kanban board? ArneBab: daviid: I work a standard 40h week in regular employment ArneBab: OrangeShark: yes, but fake modesty forbids me to say who wrote it :-) daviid: sure, but you probably only concentrate half of the time ... ArneBab: I might, yes, but since this is true for everyone and we get paid a fixed monthly pay, that’s not a problem daviid: i understand ArneBab: I only clock out if I happen to space out on something for more than 5 minutes (like writing comments on a website) ArneBab: daviid: essentially that’s just a matter of scaling the pay for the work time. ArneBab: daviid: if you clock half as much time as me, you have to take twice as high rates to earn the same on a healthy work week OrangeShark: ArneBab: ah I see :P ArneBab: OrangeShark: fake modesty be damned :-) https://bitbucket.org/ArneBab/kanban.el/src/default/kanban.el OrangeShark: I found it, was thinking that name seemed familiar ;P ArneBab: I’ve been using that every day for the past 6 years daviid: ArneBab: yes, but I like to know eactly what I did, as in being concentrate ... and as a freelance I have to charge per hour (and te'ns of the hour...) and i would still use foliot if i was emplyed by ... ArneBab: the only time I need really *exact exact* is my weekly time ArneBab: for everything else ±15 minutes don’t hurt ArneBab: I have a plasma-timekeeper open so I can check from time to time whether I got a new time sink: https://github.com/ArneBab/plasma-timekeeper ArneBab: the important part in that is that I don’t actually clock in or out: It simply tracks which program is in focus daviid: like i can tell you to develop and maintain gnu foliot, till today, it took me so far 612.7 hours :), and for guile-cv 428.9 hours :):) ArneBab: so I can click it from now and then and see the dominant time sink ArneBab: :-) ArneBab: I can only tell you that I still have around one hour of the 8 hours per month we get for stuff no customer pays for ArneBab: (part of that is creating the presentation on Emacs) ArneBab: but the past two weeks were hard because I got into 8h undertime due to having to be home to take care of craftsmen, and getting back on track was exhausting. ArneBab: actually took me three weeks to get back into slight overtime ArneBab: daviid: if I were to track my Freenet-maintenance-time, that would hurt a lot ArneBab: what I’d really need is something which can track where I spend my time without me declaring anything (guessing it automatically by activity), but the closest I am to that is Emacs org-mode daviid: :) but still worth keeping imo, I timekeep (not track) absolutely everything I do amz3: I've been arguing about timekeeping at the workplace but did not use for myself for a long time daviid: using foliot amz3: I will start doing pomodoro amz3: ah yes ArneBab: amz3: does that work? amz3: I could do that in foliot ? daviid ? daviid: what is pomodoro? ArneBab: daviid: do you also graph from foliot, i.e. finding out where your timesinks are? ArneBab: daviid: AFAIK working only 15min on a task and then switching amz3: ArneBab: to keep track of what I did during a day amz3: ArneBab: do you do that? ArneBab: no ArneBab: not pomodoro amz3: ArneBab: I always forget how I did think ArneBab: I keep track of what I did in org-mode, and throw in lots of notes amz3: oh ok ArneBab: but I miss ways to chart that amz3: that's a good idea amz3: true ArneBab: I’m pretty sure they exist, but not working out of the box amz3: the difficult thing, is that you need to keep track of wording or use tags amz3: like keywords over time thing? ArneBab: sacha chua did a lot of things on quantisized life: http://sachachua.com/blog/category/geek/quantified/ amz3: oh tx for the url ArneBab: quantified life amz3: yes, I try to do that amz3: for instance, it's a small step I guess, but I always use the same pockt for the same things amz3: like my mobile phone is always on the left side daviid: ArneBab: no, but you can filter (on the main tine window) on any criteria (except the duration) and you may use 'tags' amz3: it's a binary quantified life on or off =) daviid: that way I can tell my prof. exatcly how much time I spent with a phd student, for example daviid: in 8y, I spent 311.2 with karen (one of our phd student, she's doing postdoc know) daviid: 311,2 hours daviid: all in foliot daviid: anyway, have to work now ... still here but will concentrate a bit :) ArneBab: wow, you track back for 8 years … I more or less ignore any timing data which was more than 3 weeks ago (because I’ll have put an aggregate number into some other system, either my overall time budget or the issue tracker) ArneBab: happy hacking! daviid: I keep I don't track :), and it i just in the database, everything I work on (I don't keep anything wrt private life) is in the db, tagged, so i can filter and use it t invoice, or justify some argument ... all this is very light in fact, it may sounds 'heavy', but i jst make entries in fliot, it takes a few min per day, and that's it ... Labu: Hello all, does someone know why 8sync is not listed on the guile project's librairies page ? what is the project status ? daviid: Labu: prob because the author did not send a patch for guile's pages daviid: it reminds me i should do that for foliot and guile-cv Labu: Ok daviid is it author which must patch the guile's page ? daviid: Labu: yes, guile's web pages are 'our' pages and we are all responsible to improve them ... Labu: ok Labu: what are foliot and guile-cv ? Labu: ok guile-cv is for image processing I found it daviid: Labu: duckduckkgo 'gnu foliot' and 'gnu guile-cv' daviid: ah ok daviid: i have a problem to copy/paste from epiphany to emacs, anyone has that ptoblem to? I'm on debian buster daviid: if i copy a url and paste it here, the hD starts to spin, it totally locks my laptop for a few minutes, as if it was sending the entire HD content to the nsa or so :), Labu: weird daviid I have emacs but not epiphany daviid: that was OT, sorry daviid: ACTION reading wingo's email on guile-3 progress... daviid: always extremelly inspiring... Labu: I have this expression I don't understand: (let lp ((i 0)) ... Labu: what is mean ? Labu: I know (let (var ini) ...) Labu: but I don't understand what lp mean in my example daviid: Labu: in the manual, look for 'named loop' daviid: or named let Labu: thx daviid Labu: ok ArneBab: Labu: that’s the most elegant structure for recursion that I know of to date Labu: I didn't know this ArneBab rain1: its very useful! Labu: yes it allows to declare a recursive function and launch it with one atatement as I understand jralls: wingo: I've got a problem with guile-2.0.14 built on Mingw-w64. The problem is that scm_to_utf8_string is returning UTF16--except when I call it from the gdb command line. https://gist.github.com/jralls/124311cdc8d44134c90a5d666f4854dd shows the transcript. jralls: wingo: I found the reason on disassembly. The generated code is actually calling scm_to_locale_string. Any idea how that might be happening? jralls: wingo: Sorry, Latin1, not UTF16. spk121: jrails: did you call (setlocale LC_ALL "") at the top of the program? spk121: *jralls jralls: wingo: As one would expect from scm_to_locale_string, as linas points out in https://lists.gnu.org/archive/html/bug-guile/2017-01/msg00020.html. jralls: spk121: We do indeed. jralls: But as I said, the dissassembly shows the reason, it's calling the wrong function. Setlocale can't affect that. spk121: sorry, don't know mwette: jralls: Did you try to use (compile ...) to bytecode etc to see where the conversion is occurring? jralls: mwette: I don't understand the question. This is all C... mwette: jralls: sorry, didn't look at the code; I assumed scheme when you said "generated code" jralls: OK. jralls: Curiously simply changing the call from scm_to_utf8_string(scm_string) to scm_to_utf8_stringn(scm_string, NULL) prevents the compile error. amz3: I was looking for this piece of code, I hope it's useful to someone else. It's command line interface helper https://framagit.org/snippets/1598 amz3: I am not working on xote but neon (fwiw) random_auroras: So, does Guile have a package manager or is Guix de-facto what's used? OrangeShark: random_auroras: there is guildhall, but it never gained any popularity. Guix is just a general package manager, because there is so many Guile users and it is easy to create packages, there is a lot of guile packages on it. random_auroras: OrangeShark: I see. I was somewhat disappointed when I found that guildhall never succeeded. random_auroras: I was wondering if perhaps some alternative had beaten it to the punch. daviid: random_auroras: our beloved maintainer wingo started to work on guildhall successor, it's called potluck OrangeShark: random_auroras: some people want to push Guix to be that package manager, but Guix covers more than just Guile packages. So people might not be too interested in installing Guix for that reason. random_auroras: daviid: Hm, I wonder if perhaps it'll have better luck. OrangeShark: daviid: yes, forgot about potluck, but haven't heard about any updates from it. It uses parts of Guix daviid: random_auroras: potluck is a wip, fairlay advanced, but still not 'production' there an email let me check for you (it needs guix though, but that is easy to install, daviid: OrangeShark: right, but potluck is the package manager we want for guile third party lib, guildhall has a major 'problem' that it won't let you install anything that is not pure guile random_auroras: Oh. That kind of kills C wrappers. OrangeShark: daviid: yes, that is always a problem with language package managers daviid: random_auroras: that is why andy started to work on potluck random_auroras: Python's seems to have gotten around that. random_auroras: Though it's a pretty hacky workaround. daviid: random_auroras: potluck needs a maintainer, but it _is_ the solution, let me find the email fr you daviid: random_auroras: here https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00649.html daviid: actually there is another should read before this one :) daviid: this one: https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00250.html daviid: and wrt both, worth reading the rest of the thread as well ... random_auroras: ooh, supports Rust daviid: potluck is based on guix (uses guix) so it support any programing language random_auroras: Makes sense. random_auroras: It's a bit like PyPI, if I understand its purpose correctly? daviid: random_auroras: i don't use python, can't answer that random_auroras: daviid: Clojure? daviid: very little, kawa random_auroras: It's a bit like Clojars random_auroras: Both of those are centralized though, which potluck aims not to be. daviid: random_auroras: exactly random_auroras: So if my sleepy mind isn't messing with me, potluck allows you to relatively-simply host your own channel server? daviid: i think so yes, but i never diiged into, i wish i had time ... random_auroras: I'm probably going to look more into it now that I know it's a thing. Some other day though. thomasd: Hello #guie thomasd: #guile, that is thomasd: Can anyone here help me with a question about dynamic wind and guile exceptions? chrislck: 1) is there a simple answer to why ubuntu is not shipping guile-2.2? chrislck: 2) does anyone know anyone who worked on http://mustache.github.io/ for guile ? OrangeShark: hello everyone thomasd: hi thomasd: Now a few more people have arrived, maybe I can repeat my question from this morning :) thomasd: Am I right that a dynamic-wind "out-guard" also absorbs error output somehow? thomasd: I'm trying to figure out the best way to make sure a clean-up routine is run in case of exceptions (in this case: guile-ncurses' (endwin) to restore the terminal state) thomasd: (with-throw-handler) works nicely, but then it seems I have to write (endwin) in two places: once in the handler, and once in the regular execution path. daviid: catonano: g-golf development status is '1 - Planning', don't even try to use it, use gule-gnome instead OrangeShark: hello daviid you are going to get a librem 5? daviid: catonano: but yet you decided to picj it up to - try to demonstrate (in your blog post) that the autotool chain 'does not work' ... ?!? daviid: sneek: later catonano but yet you decided to picj it up to - try to demonstrate (in your blog post) that the autotool chain 'does not work' ... ?!? daviid: sneek later tell catonano and then you publicly state that it is not well autotool chained ?!? you never got in touch with me and here up to make dist check pass ... so, what is your problem? please report it here or on the mailing list so I can help you ... and don't write bd things about projects that are by definition experimental and for which you did not even try to get in touch with their author ... tha is terribly bad daviid: OrangeShark: yes daviid: sneek is sleeping? OrangeShark: daviid: a guile powered phone will be awesome :) daviid: OrangeShark: yes, and it is a gnome phone, so we can write apps ... OrangeShark: I backed the project for a phone as well. daviid: ... it is debian/gnome (it has kde and qt too) OrangeShark: yes, I think they are also writing their own DE using gnome technology and wayland daviid: OrangeShark: i din't bye yet: the prob is i live in a country where mport tax on electronics is 100%, so 600 turn our 12900 here ... plus it is bloked at boundaries for ages ... OrangeShark: ouch daviid: sneek is not working? or am i using it in a wrong way? OrangeShark: sneek: botsnack sneek: :) OrangeShark: sneek: later tell daviid hello, world sneek: Okay. daviid: sneek: later tell catonano but yet you decided to picj it up to - try to demonstrate (in your blog post) that the autotool chain 'does not work' ... ?!? sneek: Welcome back daviid, you have 1 message. sneek: daviid, OrangeShark says: hello, world sneek: Will do. OrangeShark: there we go OrangeShark: daviid: have you seen the work in progress docs for the librem 5? daviid: OrangeShark: looked at it yesterday, have to dig more ... daviid: sneek later tell catonano and then you publicly state that it is not well autotool chained ?!? you never got in touch with me and here up to make dist check pass ... so, what is your problem? please report it here or on the mailing list so I can help you ... daviid: sneek: later tell catonano and then you publicly state that it is not well autotool chained ?!? you never got in touch with me and here up to make dist check pass ... so, what is your problem? please report it here or on the mailing list so I can help you ... daviid: don't know why the above did not work?? daviid: sneek: daviid: wish dsmith would be here, he would know I guess daviid: OrangeShark: have to find someone who travel, and brings me a phone back ... I'll see OrangeShark: yes, hopefully it sparks more interest in GNU/Linux phones OrangeShark: we definitely need a guide on making an app using guile for this :) OrangeShark: plus guile-gnome daviid: i hope it will take the entire world :) daviid: OrangeShark: yes, I need to find the time to work on g-golf ... daviid: OrangeShark: do you know the prcessor spec? I wanted to compare, usig passmark or something but could never find the spec daviid: catonano: and then you publicly state that g-golf is not well autotool chained ?!? you never got in touch with me and here up to make distcheck pass ... so, what is your problem? please report it here or on the mailing list so I can help you ... OrangeShark: daviid: I think they were still looking at the specific hardware to use. https://puri.sm/posts/librem-5-roadmap-to-imx8/ is the blog post explaining some of it daviid: catonano: unlike you claim, the autotool chain is full of nmacros that let someone check if a package, a lib, a module, a function ... is installedavailable, in what version ... this libpq exampe you are talking about just demonstrate you actually don't know autoconf automake ... terrible catonano: daviid: I was expressing some troubles I hahve with the Autotools, not with g-golf specifically. I mentioned also Skribilo. But I was not specifically discussing Sribilo either. I was trying to argument about a general issue sneek: catonano, you have 1 message. sneek: catonano, daviid says: but yet you decided to picj it up to - try to demonstrate (in your blog post) that the autotool chain 'does not work' ... ?!? catonano: daviid: of course I don't kknwo Automake. Taht was exactly one of my points daviid: catonano: so why do you write it is bad? and how come you write it does not have ways to check if libpd is installed ? catonano: And anyway I don't think that not knowing Automake is a fault daviid: catonano: let1s forget the blog content, totally wrong imo, but i'm interested in what was th problem you had trying g-golf daviid: no, writing it is bad if you don't know is a terrible fault daviid: and writing g-golf is not well autool chained is also terrible catonano: Wat it´s bad about Automake is the experience it provides. I mentioned Leiningen as a counterexample daviid: but i'm here, all hear, what is the problem? catonano: daviid: The problem is that Automae and the Autotools in general are frustrating. They are a mess, a nasty hack. Extremely difficult to use. To me catonano: I argued extensively about that and I provided context and examples daviid: catonano: forget about it, i totally disagree with the simple fact someone writes about sonething they don't know, and conclude for the rest of the world that tool is bad ... but i'm interested to know what is the problem wrt g-golg you pretend you had? here and master afaict pass make distcheck catonano: This is not about g-golf or about you daviid: your arguments are full of istakes, like there is no way to check for the presence of libpq !?! catonano: and I also undertsand the strenght points about the Autotools, I ust wanted to argue about a facet that involves me catonano: davviid I never argued there si no way catonano: daviid: I argued that it's too difficult forr me daviid: catonano: your blog is full of mistake and false information lke the above, but that's it, i'm only interested to g-golf and you dont say what the problem is/was catonano: daviid: and that I don't want to struggle so much or something that I found being way easier with, say, Leiningen daviid: leiningen is a disaster :) daviid: catonano: what is the g-golf problem when you tried to make it? please daviid: let's concentrate on the psitive things here daviid: if there was a problem, i want to solve it catonano: daviid: Leiningen empowered me. The autotools did the opposite daviid: catonano: fine daviid: what is the g-golf problem when you tried to make it? daviid: what is the error message, can you paste itplease catonano: daviid:as I extensively wrote in my blog post, the problem with G-golf was that I was not happy with having to manually substitute the complete path to the Gnome libraries in a scheme file. Later I found the way to do that with Automake. But I still find it ugly and clumsy. Maybe it's a matter of habit daviid: catonano: no one should have to do that that does not make sence catonano: daviid: what doesn't make sense ? daviid: catonano: no one has to change any file in g-golf, the project has been tested by gnu hackers by the way, to be approved, so i have no idea what makes you think you had to manually change any g-golf file daviid: and your blog does not report anything in detail, i still have no idea why yu had a 'problem' catonano: daviid: the suggestion to edit a scheme file was give to my on the guix-hhelp mailing list by Ludo. I consider Ludo quite competent daviid: what file did you manually change? catonano: so in come way it has to make sense daviid: catonano: sorry does not make any sence daviid: I'm the author, not ludo (which i greatly respect of curse, that is not the point) catonano: My grievances with thhe Autotools were also comforrted by Potr, who works porffessionally as a system administrator in an academic isntitution. I consider Pjotr quite competent too daviid: that still does not tell me why you updated manually a file OrangeShark: daviid: I think it probably to add the full path for dynamic libs for guix daviid: so the problem is with guix daviid: not the autotool chain daviid: neither with g-golf catonano: daviid: that maybe catonano: but the clumsy expereince offfered by thhe Autotools is related daviid: no it is not daviid: the very few testers on all distro, all of them, installed g-golf in less then a few minutes with no problem catonano: daviid: it is inmy opinion. And I'd appreciate if you were less dismissive catonano: daviid: I am not a common distro tester. I offered my experience. catonano: daviid: here's Ludo suggestion https://lists.gnu.org/archive/html/guix-devel/2018-01/msg00225.html daviid: you wrote bad things about a project i author and maintain, in a experimental state, without talking to me first, and after a couple of lines here, it appears it is guix, not the autotool chain nor the project itself ... every one on earth can open a ermnal and write: ./autogen.sh;./configure [--prefix=];make daviid: it is in the readme, install ... on the web page ... daviid: no need to know nothing about the autotool chain itself catonano: I wrote bad things about the Autotools, not about G-golf catonano: yes, it is Guix, this doesn't make any difference. OrangeShark: catonano: yeah, that is just something you need to do with guix or daviid needs to add a way, using autotools to override the dynamic library name. catonano: the line you are suggesting DOESN`T wor on Guix. catonano: it's guix, yes. So what ? daviid: the suggestion by ludo demonstrate it has nothing to do with the autotool chain, but with guix (the way guix expect thing, I'm not criticing guix itself) catonano: I ust reported an experience of mine, politely, i think catonano: daviid: about Ludo's suggestion: I beg to differ. Guix works with many Autotools based packages. To me if a package doesn't wor in Guix, it's the package, not Guix catonano: daviid: I understand if you don't want or can't support Guix too catonano: it's legitimate of course daviid: catonano: you are wring again catonano: daviid: look. I mighht be wrong but your wor in trying to convince me is terrible catonano: the Guile community is extremely small. The G-golf project is a tiny dot in the universe. You should be grateful that someone choses that to play with catonano: instead you ave the lese majesty attitude catonano: you should learn to be nicer catonano: repeating that I'm wrong will only leave a bad vibe catonano: The guix community fared way better, in thhis regard catonano: The free software related conferences are full of speeces about this issue in thhe Free Software commnities. You should listen to some off them daviid: the autotool chain uses pkg-config, and all distro do find libraries ... OrangeShark: catonano: daviid: guix changes things a bit that is not expected by many packages. If you want a projects like G-golf to make it easier, you need to report the issue to the maintainer daviid: catonano: the autotool chin does not jhave to support ay distro, you see this is wrong agian daviid: you were trying to build a guix package, and because of guix, something know among guixers by the way, you need to make some changes in a file that non other distro require, then you say all distro anf the tool chain are wrong ?"? catonano: daviid: yes. i don't want to rely on thhe mantainer for such a small issue. This didn't hapen with Leiningen and with Boot, as I extensively wrote. This makes the experrience offered by the Autotools TERRIBLE. Your attitude here adds to that. catonano: daviid: I just hold this opinion. YOu'll have to live with that daviid: sorry, it is a guix problem, that has absoluytely nothing to do with the autotool chain catonano: daviid: you're wrong again OrangeShark: catonano: but that is unrelated to autotools catonano: OrangeShark: yes, it's about the Autotools daviid: totally unrelated to autotool, i'm of the conversation, you just don't have the appropirate knowledge and apparently not willng to learn either catonano: I repeat this for the nth time. AS I WROTE IN TE POST I HAD NO SUCHH PROBLEM WITH LEININGEN, WIT BOOT and now that you make me think about this I had no sich problem with the Python toolchain neither catonano: so this is not about me catonano: and the ffafct that you are so defensive says so much about why some communities languishh catonano: you should grow up catonano: it's ust an opinion OrangeShark: catonano: were you using leiningen on guix? OrangeShark: you will likely face the same issues when packaging a clojure project that is similar to G-golf catonano: daviid: if there's someone who doesn't want to listen, thatś you catonano: daviid: now, please, I'd appreciate if you refrain to address me anymore daviid: catonano: don't write about something you don't know catonano: daviid: I will do as I please daviid: g-golf is perfectly autotool chained, and the problem you faced were related to guix daviid: i even did answer your thread, re read it daviid: and read ludo's answer catonano: daviid: I asked to refrain to address me anymore daviid: i'm off you just don't know don't learn don't listen neither to OrangeShark daviid: this is the worst blg ost i did read in a long time daviid: terible catonano: daviid: that motivates me to write some more. I obviosly touched a point daviid: the point that you dno't know yes catonano: daviid: you are making a disservice to this community catonano: being nicer is more important than knowing all the points catonano: and you are completely missing MY point, the one I made in the post catonano: because you're so ful of yourself catonano: you are the toxic person the free software commnity manuals talk about amz3: o/ OrangeShark: hello manumanumanu: Hello everyone! rain1: hi :) manumanumanu: Is (read port) considered a safe operation? rain1: dont think so manumanumanu: even if there is no hash-extend thingies defined? rain1: http://lists.gnu.org/archive/html/guile-user/2018-03/msg00000.html manumanumanu: oh. okay. thanks rain1: maybe this could be considered a bug though rain1: a safe reader would be a very reasonable thing to have manumanumanu: but is there any reason for that other than "it might not be correct and may allow for remote code execution" or is it inherently unsafe? manumanumanu: exactly manumanumanu: parsing scheme should be pretty simple manumanumanu: if you don't consider the edge cases :D manumanumanu: there was a json parser on reddit that used read and it looked very simple :) manumanumanu: even though it used lots and lots of substring and string-append rain1: hmmm rain1: i guess the folklore is 'anything involving parsing in C is insecure' rain1: Seems like 'read' is unsafe against arbitrary code execution rain1: via srfi-10 and segfault or consume the whole memory on invalid rain1: input. rain1: http://lists.gnu.org/archive/html/guile-user/2018-02/msg00021.html im looking over this discussion rain1: : but #e10e10000, srfi-10, and #. are all worrying possible attacks rain1: : against using vanilla read for much data heading over the wire rain1: : that you don't control [17:15] rain1: : i think there is another attack, which is (((((((((((((((((((((((((( rain1: so.. rain1: to have an actually safe read it would need to have limits on various things rain1: like size of integers read, (-depth rain1: probably more limits too manumanumanu: ah. ok. I have to write my own it seems :D rain1: and no extensions that involve evaluating input jlicht: I am getting some messages from guile about "failed to create path for auto-compiled file", both when running my scripts via `guile' awa in a geiser repl :/ jlicht: is the only "solution" to disable auto-compilation? amz3: jlicht: did you check the permissions on the directory that the error occur on? amz3: maybe sudo has messed things up spk121: I'm back, trying to make Guile MinGW work. I've passed from the "Yeah! guile.exe compiles" to the "Oh. Oh no." stage. amz3: ^^ janneke: spk121: what's that stage, exactly? spk121: .go file compilation failure spk121: daviid: spk121: iirc, there has been effort on this, eli I think, ..., and iirc again, there is a guile.exec somewhere ... not sure ... but if, it does not work with threads daviid: my dream is we would have guile and guile-gnome on replicant daviid: but with librem coming, this won't be a problem anymore ... I can't wait to have a librem phoe, and strat to work on app for it ... daviid: as davexunit said, after him and christopher met with sussmman, nothing that does no run on mobile will survive ... we need guile on mobile, a lot more then on win imo ... daviid: and on android/replicant it would have threads no? daviid: anyway, just a few thoughts .. spk121: daviid: I am old. I will leave the problems of the future to those willing to fight for it. For now, I just want to show off my Guile-based game to my buddies by getting a windows exe on a usb stick. ;-) daviid: spk121: and your game does not use multi threads? daviid: someone did try to compile 2.0.14 on android, I think, is it janneke ? daviid: i think it was on a reolicant phone, there were about to have a presentation in fosdem (2 or 3y ago i think, then the rpes was canceled, the person couldn ont make it to fosdem iirc daviid: but some one tried ... janneke: spk121: it's a long time ago i worked on it, seem to remember that worked spk121: daviid: no. GTK3 has a main loop. In the main loop, in a GTK idle callback, I run Guile function callbacks. janneke: but it needed some (tricky?) path/directory setups spk121: Guile 2.0 is on MinGW, and 2.2 is on MSYS2 and compiles on Cygwin. janneke: ah, you're not on guix, i misread daviid: spk121: i see. on linux you might be interested to read guile-a-sync2, which has a multi-threaded loop in guile, intergrated with the gtk one ... very interresting daviid: I've used it to inotify while doing things in clutter spk121: daviid: will do daviid: janneke: did you loose interest in having gule on andrdoid/replicant? janneke: daviid: that's putting a bit harsh, i changed my priorities janneke: i have been working very hard to have have guile (and lilypond) available on non-free platforms janneke: my attention shifted to making fully free platforms better daviid: janneke: didn't meean to be harsh :) daviid: janneke: yep! i thought you worked on replicant janneke: daviid: sure, :) janneke: it's all a balance, i'm sure bringing free software to nonfree platforms helps the free software cause daviid: janneke: but i was very interested at the time, almost been to fosdem just to hear your talk :) janneke: tnx :) jlicht: amz3: It turned out to be that my `/home/jelle/.cache/guile' was owned by root, probably due to some ill-conceived attempt at running something as a different user at some point in the past. Thanks for the pointer :-) civodul: hey hey! rain1: hello :) Labu: hello guile rain1: hi Labu: I'am looking for a function which allows to replace arbitrary substring by another Labu: example: (string-replace "zzxxaaxx" "xx" "aa") -> "zzaaaaaa" Labu: I have looked in the documentation and I found nothing which fit with my needs Labu: so I made my function Labu: but I don't be really satisfied Labu: https://pastebin.com/deBjUYL0 Labu: like this daviid: Labu: fwiw, I would use regexp-substitute/global (ice-9 regex) daviid: like this Labu: hi daviid indeed regex Labu: it's better Labu: thx daviid: (define (string-replace-all str search-for replace-by) daviid: (regexp-substitute/global #f search-for str 'pre replace-by 'post)) Labu: thx daviid daviid: wc! rain1: that seems wrong rain1: what if 'search-for' contains any characters that regex interprets daviid: string-replace-all expects strings, not regexp, but you could write another procedure, picking another name, that would ... feel free rain1: for example (string-replace-all "zz.*aa.*" ".**" "aa") should return "zzaaaaaa" but it returns "aa" daviid: as i said, it hasn't been written to solve the above, it expects strings rain1: those are string rain1: (string? ".*") = #t daviid: ah, i wrote this 2 decades ago, patch welcome ... daviid: probably guix has a good tested str replace [all] procedure rain1: ah, i was checking srfi 13 and it doesn't seem to have it daviid: guix has string-replace-substring daviid: with a test suite ... rain1: that seems like a good function to move into guile itself daviid: in guix/utils.scm daviid: Labu: here - http://git.savannah.gnu.org/cgit/guix.git/tree/guix/utils.scm - starts line 548 ... voilà! daviid: I would call it string-replace-all though but ... rain1: yeah I prefer the name string-replace-all Labu: thx daviid Labu: right now I fight against encoding problems Labu: I don't know yet If it comes from curl with I test my API or the lib I am using to parse input amz3: héllo all Labu: hi amz3 ! spk121: OK. Let's make the Guile 2.2.x work on MinGW. amz3: ^^ OrangeShark: hello manumanumanu: hello Labu: I get strange behaviour I can't explain. I am usin a web-server in a program wich I launch with run-server. If I get (port-encoding (current-output-port)) before launch the server I have UTF-8 encoding but in a handler pass to this server I have ASCII. Have I miss something to specify in run-server to get the correct encoding for stdout ? amz3: Labu: did you call (setlocale LC_ALL "") ? Labu: no amz3 Labu: but amz3: maybe it will help Labu: (display (setlocale LC_ALL))(newline) Labu: give me C Labu: it's strange because my locale are UTF-8 on my terminal Labu: I try this Labu: thx Labu: amz3 It works Labu: but why ? amz3: i don't remember read the doc about setlocale Labu: ok thx Labu: ok thx amz3 Labu: I have just reading the documentation about this Labu: (setlocale LC_ALL "") initialize all categories based on standard environment Labu: thx amz3: tx cmhobbs: what am i see here as the output of receive? is this response body a bytevector? https://hastebin.com/awixidiyuy.php cmhobbs: how can i determine its type? cmhobbs: yes, i know my api key is visible there cmhobbs: not a problem cmhobbs: and if that is a byte vector, how can i translate that to something guile-json can understand? cmhobbs: none of my old code really deals with bvs cmhobbs: other than doing crap with sxml daviid: cmhobbs: have to leave that for others to answer ... not competent here ... jiby: hi all jiby: For my first project (a bdd framework for guile) I need to parse files for overall structure jiby: Looking through docs I found two things: the LALR SCM parser, or guile-reader library daviid: i try to avoid any web related dev cmhobbs: i'd like to but i don't have much of a choice jiby: Anyone who tried parsing things in Guile can tell me if I'd be wrong to use either? cmhobbs: i mean, i guess i could download these files externally, load them into guile from there, and try to parse them cmhobbs: whatever daviid: cmhobbs: i think you got an encrypted response, as exécted? not sure, but guile's manual simple http-get example returns fully readable text ... daviid: anyway, #guile is full of web related expert ... just be patient, someone will shimein ... cmhobbs: maybe i did cmhobbs: it's using gnutls daviid: try a simple requwst first ... then gnutls ... cmhobbs: all the other web related code i've written in guile is just http cmhobbs: yeah, i'm able to fetch guile's website with http-get cmhobbs: no problem daviid: cmhobbs: you may find examples in guix (guix is full of inspiration for almost everything we can think of :)) cmhobbs: i still feel like that thing is a bytevector, though cmhobbs: i just don't know how to figure out the type of a thing in guile daviid: it is cmhobbs: and i'm pretty sure it's just the expected json response cmhobbs: however (scm->json (raw-prediction-body)) gets grumpy about "json-invalid" cmhobbs: because it's not json... cmhobbs: it's a bytevector cmhobbs: heh daviid: yes, see 6.6.12 Bytevectors in the manual cmhobbs: i'll jump back into it later. going to play a game with my son for now daviid: english help "In addition to the above list the @code{im-nl-means-channel} accepts one additional optional keyword argument:" in that sentence, how could I avoid to use twice additin additional? daviid: maybe getting rid of the initial part of the sentence might be better, keeping only "The @code{im-nl-means-channel} procedure accepts one additional optional keyword argument:" gour: morning gour: i'm on fedora fc27 and wonder how to configure geiser to use guile2.2 since guile2 is required for bunch of other stuff? spk121: gour: geiser does have some emacs variables you can tweak. If you want a quick answer, just start the guile you want to use with a --listen flag, and then, in emacs, launch geiser using M-x geiser-connect. spk121: but otherwise, I know someplace in the geiser manual it describes how to pick a version, but, I don't recall the details. gour: spk121: thanks. --listen method works, will check manual as well fibration: what are applicable structs actually good for? is there a way to automatically pass the struct itself as the first argument to the proc so that i have some kind of fake closure in c? lloda: fibration: not sure what you mean with automatically, but if the struct is in context when you define the proc, you can do whatever you want with it lloda: I used them to let me do (A i j ...) instead of (array-ref A i j ...) when A is a sort-of-array lloda: https://github.com/lloda/guile-newra/blob/4eccc987115c8736d8804d54edad0924a16a2c38/mod/newra/newra.scm#L150 lloda: I'm hardly an expert though and I haven't used them from c fibration: OK, but if already have scheme closures it seems to be applicable structs are just for aesthetic reasons lloda: applicable structs are their own type. Otherwise I'd say yes, but that's true of most of Scheme gour: hello gour: i'd like to learn some guile/scheme in order to be able to tweak/customize/write Gnucash reports. someone suggested me to go through the first chapters of SICP, HTDP and TLS books. do you have any other recommendation. i have a copy of Realm of Racket, but that's probably too different...and didn't have much time to play with it gour: ACTION is reading 2.2-manual fibration: gour: http://ds26gte.github.io/tyscheme/index-Z-H-1.html#node_toc_start gour: fibration: thanks a lot, it looks great! fibration: scheme implementation vary a bit but this should be a good start. the time you stumble upon something that's different in Guile you are probably advanced enough to solve that problem yourself. gour: good fibration: And if you are an Emacs user install the geiser package. gour: yes, i use emacs cmhobbs: ACTION installs guile for the first time in ~6 months daviid: cmhobbs: greta! daviid: great! cmhobbs: daviid: it's your fault, you know... daviid: yep! I assume ... :) cmhobbs: no idea what i'm going to hack on at the moment daviid: welcome back cmhobbs! cmhobbs: but i'll find some sort of little pet project to write to get my toes back in the water daviid: as spk121 said recently, pick some that pleases you ... cmhobbs: resubscription to guile-users was the finalnail in the coffin cmhobbs: gotta get oriented again cmhobbs: i'm sure it'll be like riding a bike once i get geiser set up daviid: cmhobbs: yes cmhobbs: since that ssh library is a thing, i might see about whipping up a script to update my mdns record on a remote system with some regularity daviid: cool cmhobbs: just something small in scope to get it back in my brain daviid: trying some using guile-ssh is an excellent idea cmhobbs: i like how package-install geiser tells me it can't find geiser but package-list-packages shows (and installs) geiser... cmhobbs: thanks, emacs cmhobbs: i may need to update my packages, emacs tells me it's an available obsolete package daviid: cmhobbs: not sure, I install geiser from the source cmhobbs: yeah, i'm having all sorts of trouble with melpa right now cmhobbs: man, my .emacs is a total mess. one of these days i need to clean i tou cmhobbs: it out* cmhobbs: i also don't understand why people love paredit so much cmhobbs: it drives me nuts cmhobbs: the emacs wiki has a line on par edit just for me, though: " Its behavior can be jarring for those who may want transient periods of unbalanced parentheses, such as when typing parentheses directly or commenting out code line by line." cmhobbs: well, i'm going to have some work to do... cmhobbs: $ guile cmhobbs: guile: error while loading shared libraries: libguile-2.2.so.1: cannot open shared object file: No such file or directory cmhobbs: y cmhobbs: that's after installing guile 2.2.3 from source daviid: hum, not sure, is the lib path in ldconfig? worth verify, add if necessary and re run ldconfig as root cmhobbs: oh boy cmhobbs: $ sudo ldconfig cmhobbs: ldconfig: /usr/local/lib/libguile-2.2.so.1.3.0-gdb.scm is not an ELF file - it has the wrong magic bytes at the start. daviid: cmhobbs: you can ignore that daviid: try guile again cmhobbs: seems to be working cmhobbs: scheme@(guile-user)> daviid: perfect! cmhobbs: i've got a repl in emacs now, as well daviid: cmhobbs: geiser rocks! cmhobbs: yeah, i just gotta quick copying and pasting like a caveman and get the keybindings in muscle memory daviid: cmhobbs: and if you grow your pet project, use git, try magit as well daviid: cmhobbs: i almost never copy/paste, C-x C-e ... cmhobbs: i use magit heavily daviid: but anyway, everyone has its habbits cmhobbs: at work cmhobbs: the only issue i have with it is doing interactive rebasing cmhobbs: it's much easier to do that via the shell cmhobbs: than it is to do in emacs proper daviid: I'm a pathetic emacs user :), and do not use any paredit tool, never got use to those ... :) cmhobbs: yeah, emacs is my editor of choice these days cmhobbs: i used vi(m) for about 15+ years cmhobbs: had a project with sbcl and found vim-slime to be lacking cmhobbs: so i just jumped into emacs cold turkey cmhobbs: org-mode kept me there cmhobbs: guile-ssh's INSTALL and README files speak of a configure script but it doesn't come with one cmhobbs: i'll probably tinker with a different project for now instead cmhobbs: what libraries are available for making http requests and parsing html? daviid: cmhobbs: run autogen.sh or bootstrap daviid: keep trying guile-ssh, it is super wel developed and maintined cmhobbs: daviid: ah right. big oversight on my part daviid: source tree never come with configure (keep tht in mind...) cmhobbs: no autogen or bootstrap supplied. that comes with build-essential in apt, no? daviid: let me check cmhobbs: no, doesn't appear to daviid: ok, then run autoreconf -vif daviid: cmhobbs: that willd o daviid: did it? cmhobbs: seems to have worked, yes cmhobbs: thanks cmhobbs: i knew source trees didn't come with configure, it just slipped my mind cmhobbs: anyhow, do you know what libraries are available for making http requests and for parsing html? cmhobbs: i think i'm going to scrape a table daviid: cmhobbs: guile core has http request, parsing html is done using html->sxml ... and we have htmlprag in guile-lib as well cmhobbs: rather, json parsing might be best daviid: ah, then guile-json cmhobbs: thanks mwette``: cmhobbs: guile-lib (on savannah) has `htmlprag.scm' which will parse html daviid: cmhobbs: http://github.com/aconchillo/guile-json cmhobbs: i'll have to update it but it appears as if i have guile-json installed already cmhobbs: will web http handle https? rekado: cmhobbs: Guile 2.2.2 had a bug with HTTPS, but it’s fine with 2.2.3. You need Gnutls for this. cmhobbs: hm, ok cmhobbs: i guess i'll sift the documentation cmhobbs: querying a restful api and doing useful stuff with its output may be a decent project for now cmhobbs: well, this is lame cmhobbs: Throw to key `gnutls-not-available' with args `("(gnutls) module not available")'. cmhobbs: i've installed gnutls via apt, rebuilt guile 2.2.3, and ran ldconfig cmhobbs: no luck cmhobbs: looking at building gnutls from scratch for this cmhobbs: s/scratch/source daviid: cmhobbs: installing guile-gnutls on debian is ... next to impossible, for those of us using guile from source. the only way I succeeded is by grabbing thelatset gnutls stable and manually recompile install in /opt (not to conflict with the debian package ...) cmhobbs: i just built gnutls from source cmhobbs: alright, i appear to be getting data back from (http-get (string->uri "https://mysupersecretapi.example")) cmhobbs: now to figure out how to parse it cmhobbs: and return useful info from it daviid: i think you have to pass an option so it builds guile-gnutls as well, not sure cmhobbs: nah, that was not necessary apparently daviid: ok cmhobbs: i'm not entirely sure what data type http-get returns, nor how send the response body to guile-json cmhobbs: i've got a great deal of reading to do i think cmhobbs: i think i've done this with ice-9 receive before cmhobbs: and indentation is way off in my scheme mode, wtf daviid: cmhobbs: guile's procedure index is your friend cmhobbs: yeah, i've already got it open cmhobbs: pardon the spam, i'm mostly rubber ducking here cmhobbs: scheme@(guile-user)> (use-modules (ice9 receive)) cmhobbs: While compiling expression: cmhobbs: no code for module (ice9 receive) cmhobbs: is ice-9 not included with guile? cmhobbs: or do i need to download that separately cmhobbs: i'm pretty sure i've used receive in the past daviid: ice-9 cmhobbs: wow, i'm dumb daviid: relax, you'll get it all back in a short ... cmhobbs: yeah, i keep having moments where code is flowing freely and then i hit a brick wall because i can't remember how to do some arbitrary thing guile-guest2: ? djcb: How can I get the equivalent of `merge-generics` with `use-modules' rather than `define-module'? mwette: . janneke: mwette: hi! mwette: janneke: hi - working on debugging dbug+epoll w/ ffi-helper today janneke: mwette: you prolly saw my mail...sadly reverted to an older nyacc for now janneke: i'll be working on my tracing patch though janneke: and very good news: mes+nyacc succeeded in building tinycc for the first time janneke: Guile+Nyacc+MesCC could compile tcc since october last year janneke: but now also Mes+Nyacc+MesCC can do so...which means we almost have full source bootstrapping for tcc ArneBab_: janneke: wow — nice! janneke: ArneBab_: thanks...many kudos go to mwette, OriansJ and rain1 janneke: (see #bootstrapping/#guix) mwette: writing C code in Scheme can sometimes be a challenge, but I am starting to gt epoll+dbus mainloop running. all APIs autocoded with the ffi-helper mwette: janneke: So it looks like the cond-expand updates just disable all the (guile) options: Can I remove the (guile) condition and the compat18 module? janneke: mwette: not sure what you mean... janneke: the cond-expands have guile-2 and guile (for guile-1.8) janneke: guile-1.8 does not fully work (yet) janneke: but i'm Nyacc on guile-2.2 and mes...so cond-expand needs either an (else on a (mes clause janneke: if we decide to drop guile-1.8 for now, all cond-expands can be removed mwette: janneke: I will just add the cond patches as you proposed. mwette: janneke: I want to look more at the debugging hooks. janneke: mwette: thanks! mwette: janneke: OK if I use `(else)' instead of '(mes)' ? janneke: mwette: sure! janneke: i'll let you know if/when mes needs something special janneke: but i'm striving for next to 100% guile compatibility janneke: that won't work for cond-expand though, as i need to distinguish between guile and mes mwette: so I changed to `(cond-expand (mes) (guile-2 ...) (guile ...) (else))' mwette: jobs daviid: amz3: it would be nice to see guile-git here: https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools ArneBab_: I added some colors to with-guise-and-guile: http://www.draketo.de/proj/with-guise-and-guile/index.html daviid: ArneBab_: nice daviid: ArneBab_: I would use more width though ArneBab_: wouldn’t that make it harder to read? daviid: ArneBab_: I think it is always better to let users decide, for example when I wan't to read your site, I open a new page (epiphany) and set it height and width to what I like, and expect the content to follow ... daviid: but hey, not important really ArneBab_: daviid: I used to think that, but at some point I changed to thinking that providing the best defaults I can helps users more. daviid: ArneBab_: sorry, that can never be true :) ArneBab_: (at some point ~ some time in the past 15 years ) ArneBab_: ☺ daviid: ArneBab_: in philosophy, that would be called 'the omni potent syndrome', you are thinking you know better then individuals, upon what individuals want ... that is heresy :):) ArneBab_: I think I know well enough that my default values are better than forcing everyone to choose — for the thing I built. Always depends on who knows how much. galex-713: daviid: ArneBab_: my thinking is to provide minimal decent default, yet to be sure to have a website browsable without CSS at all, or with a decent default CSS ArneBab_: sounds goood galex-713: that is, just providing as CSS what you would expect from a decent default css, and let it be minimal galex-713: like, only centering text and doing max-width: 66em galex-713: or stuff like that galex-713: have a correct contrast level (usually I take the colors from bootstrap) ArneBab_: I *want* it to be beautiful, and I wish text in browsers were beautiful by default. ArneBab_: the user knows his or her peculiarities, you know the peculiarities of what you created. Ideal would be something which can merge both. galex-713: daviid: it’s not fully denued of sense galex-713: it’s real that it is sometimes difficult to know what yourself want, if you’re not educated into what the different options are, which does what, why you would be inclined to prefer something to something else, etc. galex-713: also the paralysis of choice can be a problem sometimes, and make more problem than to solve galex-713: and having a default, at least as a standard, helps a lot, normally galex-713: a lot of software would be considered unusable, or not “user-friendly” if some default weren’t choosen upon users galex-713: because it’s still a work and even sometimes a pain to have to redescribe each time for each software the default optimal behavior you’d like to expect spk121: nah. In all things you do for free in your spare time, please yourself above all. But, if writing some that is user friendly or conforms to other's expectations entertains *you*, then do it. galex-713: what entertain me is doing useful stuff, if it’s not used it’s less useful, then bugs are not reported, comments are not done, things are not improved, etc. galex-713: but yes, self-entertainment and self-pleasure should be at the center you’re right galex-713: but standards and diversity should be kept in mind galex-713: that’s why layers of abstractions exist ArneBab_: manumanumanu: nice! SRFIs are great, and this could help them spread. Also it’s already multi-implementation amz3: Labu: hey amz3: Labu: what's up? Did yoiu go with sqlite or wiredtiger? lambda-lifter: I'm computing the root of a function (using newtow's method) and running up against lambda-lifter: guile's numeric tower. At a certain point, I get a flonum that is represented like this: 1.4287832697850099e-63 lambda-lifter: If I compare this value agains the 1.00 flonum using (fl>? 1.00 1.4287832697850099e-63) I get lambda-lifter: #t which is incorrect. I also get the wrong resuts with other flonum procedures. What am I missing? OrangeShark: lambda-lifter: what version of guile? lambda-lifter: guile 2.0 Efendi: Turk Yokmu Hec :D Labu: Hi amz3 Labu: I realized that I didn't have the requird verison on my system Labu: so I returned on sqlite Labu: but I think try to compile guile 2.2 on my system later Labu: On debian (my another machine) guile is on 2.0.13 less than netbsd (2.0.14) version spk121: My Guile-based interactive fiction (aka choose your own adventure) game engine runs now. This has been a fun month's hack. spk121: Here's a video. spk121: https://github.com/spk121/burro/blob/master/game/screencast01.webm?raw=true OrangeShark: spk121: that is pretty cool :) rekado_: spk121: heh, I *am* impressed :) spk121: thanks! daviid: sneek: later tell cantonano please note that g-golf is experimemental still, has never ever been released ... use guile-gnome instead, which works perfectly still sneek: Got it. daviid: sneek later tell cantonano then please tell me and/or report the g-golf autotool related problem you claim you had - here or use the maling list - and claim you had to solve 'manually' (in your blog post), that doe not make sence to me sneek: Okay. daviid: sneek: later tell cantonano rt postgress, we guile-pg, very advanced binding but which does use the dynamic ffi, then guile-squee, which is also 'experimentl', checkout the devel branch, I autotool chained it ... sneek: Got it. daviid: sneek: later tell cantonano the autotool chain is a must, at the heart of the success of the entire GNU Porject sneek: Okay. daviid: sneek: later tell cantonano if you wan to check you have libpq, just do PKG_CHECK_MODULES([LIBPQ],[libpq >= 9.4.4]) - this is the guile-squee entry sneek: Will do. daviid: sneek: later tell cantonano OrangeShark wrote a template, which is awsome! here https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html and there are quite a few tutorials ... the thing is, one has to study a bit, and practice ... then ask here and on #autotools, they are very nice and very helpfull sneek: Okay. daviid: OrangeShark: as time allows, it would be nice to grow your awsome template with a tests (either guile-lib, which I prefer, or srfi-64 based) and a doc (texinfo based, I can help) subdirs and make the few appropriate changes to the existing template so it works (Makefile.am ...) - I know it's work, but for a beginner, having a working 'make check' example is extremely useful, as well as a doc template, with the verion automatically daviid: updated from the configure, a tiny pre structure and the doc license ... OrangeShark: daviid: I've been meaning to get on that, I was going to include it in the first blog post but it would have been too long. I already have tests using srfi-64 and texinfo docs implemented on my own project, but I wanted to do more research (like looking at guile-lib for tests). rekado_: I wonder what sxml-match brings us over plain match. rekado_: I found match to be much more flexible and usable than sxml-match. TMA: when compiling 2.2.3 --without-threads, I have run into reference to scm_pthread_mutex_lock remaining. here's patch: http://lpaste.net/4452868908189220864 TMA: when compiling 2.2.3 on mingw64, there is a problem with missing header. creating blank (or logically blank) file in guile-2.2.3/lib/netinet/tcp.h fixed that problem. however the approach used with netinet-in.in.h shall be probably used; my autotools magic is too weak to fix it, though TMA: the return value of start_child is incompatible in the .h (int) and .c (pid_t, presumably short); patch: http://lpaste.net/7868539382314041344 TMA: when there is GUILE_AUTO_COMPILE=0 ../meta/build-env guild snarf-check-and-output-texi > guile-procedures.texi run during the build, it fails with: TMA: In procedure primitive-load-path: Unable to find file "C:/projects/foss/MINGW-packages/mingw-w64-guile/src/build-x86_64-w64-mingw32/libguile/C:/projects/foss/MINGW-packages/mingw-w64-guile/src/build-x86_64-w64-mingw32/meta/guild" in load path TMA: it looks like it pastes the full, absolute, file name to the search path. however the is_absolute_file_name in load.c seems to detect C:/... as absolute, I did not find why it is appended to the search path TMA: if anyone of you think these reports are worth anything, post them to the bug tracking system. Patches are trivial enough that there should not be any copyright concern, in any case I release them to CC0/public domain. daviid: sneek: later tell cantonano wrt g-golf, here even 'make distcheck' pass sneek: Okay. daviid: lloda: I wrote '... I order to 'save distro ...' I meant '... In order to 'save distro' ...' :) I hope nobody got me wrong here sneek: daviid, you have 1 message. sneek: daviid, civodul says: it's share/guile/site/@GUILE_EFFECTIVE_VERSION@ daviid: sneek: later tell civodul right, thanks. sneek: Got it. daviid: lloda: you need to update doc/Makefile.am (guile-cairo) in order to give a proper path to the XML files that gtk-doc produces daviid: lloda: though guile-gnome depends on g-wrap, and guile-cairo does not, I beleive the way these projects build (at least when the did build) their doc is very similar daviid: lloda: I see it is explained in doc/README in guile-cairo, did you read it? daviid: lloda: texinfo is now guile core, so you don't need guile-lib anymore, I think, but to regenerate the doc, you need guile-gnome ... the thing is you generate the .texi files that are distributed with the lib, so users can build the doc locally ... daviid: once you have guile-gnome, updated the path to cairo gtk-doc xml files, you try by typing 'make generate-defuns' in the doc/ subdir of course ... HTH good luck daviid: lloda: there is a release file in doc/ as well: it lists all the steps that one should do to actually do a release, very cool. of course I can still help but it's all there manumanumanu: Good morning everyone! manumanumanu: ArneBab_: apparently arthur gleckler liked the transducers so much he wants me to make it a SRFI. manumanumanu: Hey btw everyone: I have library that includes a file. ,reload seems to only work if I change the library, but it doesn't seem to reload the module if the included file changes manumanumanu: can I force that somehow= manumanumanu: ? Sleep_Walker: I'm sorry for so elementary question, but I am a bit lost Sleep_Walker: I have (define (kernel-versions key) (cdr (assq key '(("doom" . "sw2") ("vulture" . "sw1"))))) Sleep_Walker: calling `(kernel-versions "doom")` leads to `In procedure cdr: Wrong type argument in position 1 (expecting pair): #f` manumanumanu: assq returns false when the key does not exist Sleep_Walker: but `(cdr (assq "doom" '(("doom" . "sw2") ("vulture" . "sw1"))))` works as expected manumanumanu: you are using strings manumanumanu: as keys, which assq can't compare Sleep_Walker: aha Sleep_Walker: so the equality is the problem here manumanumanu: I think assq uses eq? djcb`: I have some procedures that can take options as lists of flags, say '(foo bar cuux). sneek: djcb`, you have 1 message. sneek: djcb`, daviid says: here is another msg I wrote, easier for you to read and understand ( I think) then the previous link I posted: http://lists.gnu.org/archive/html/guile-user/2017-10/msg00027.html djcb`: Each of those is a symbol, with some value (through scm_c_define) djcb`: now, I'd like to fold that list using logior to the flags for my c-code djcb`: Can I do that without `eval`? djcb`: sneek: thanks! Sleep_Walker: can I `define` from procedure? manumanumanu: you can set! a global binding manumanumanu: what do you want to do? manumanumanu: you might want to dive into macros :D manumanumanu: hooray! Sleep_Walker: I wanted something like `(define (generate name) (define-public (string->symbol name) (write "name")))` so I could later in the module call (generate something) Sleep_Walker: my use case is generating some similar packages for guix manumanumanu: that seems like macro territory manumanumanu: but you can't introduce global bindings witout doing voodoo manumanumanu: unless you are already at the top level of the module rekado: Sleep_Walker: for generating similar packages in Guix it’s better to use a procedure that returns package values. Sleep_Walker: rekado: thanks, I figured it out with your help :) roelj: Has anyone ever been able to write to a file faster than ~5MB/s with Guile? It seems in my scripts Guile can't go faster than that.. cmaloney: even to /dev/null? roelj: Let's see.. roelj: How can I measure that? cmaloney: write your files to /dev/null? :) cmaloney: and measure it however you're measuring the speed now. :) roelj: I used iotop.. cmaloney: You might also check doing something like cat /dev/zero to a file on your disk and see how fast that is cmaloney: though you'll fill up disk rather quickly so be cafeful cmaloney: careful roelj: Using dd if=/dev/zero of=~/test.bin: 1048576000 bytes (1.0 GB, 1000 MiB) copied, 3.23998 s, 324 MB/s cmaloney: Is that corroborated by iotop? roelj: I could use a counter in Guile, but that would affect its speed. roelj: Pretty much, it peaked at 309MB/s actual disk write. cmaloney: how big is the file that you're writing in guile? roelj: It's two lines: (define (write-recursively port) (write "...." port) (write-recursively port)) roelj: (call-with-output-file "/dev/null" write-recursively) roelj: Then replace /dev/null with an actual file. So it just keeps going until I kill it. cmaloney: and that's topping out at 5MB/s? roelj: Yes. roelj: I also tried compiling it first :) cmaloney: Hm. I'm not familiar enough with Guile to know if what you're doing is intrisically slow roelj: Oh oh! Adding dots actually makes it faster. cmaloney: ??? cmaloney: You're actually writing dots to the file? cmaloney: I thought those were elided code. :) roelj: Yes.. Just dots.. Just making things as simple as possible.. :) cmaloney: So what you're doing is essentially print statements to the file roelj: Ok.. I now reached a peak of ~18 MB/s. roelj: Yes cmaloney: that is going to be a little slower than just writing a bunch of zeroes. :) cmaloney: specifically I believe a print statement is going to wait for the buffer to clear before printing the next statement cmaloney: though I'm not sure. You'll want to test that cmaloney: but yeah, you're not I/O bound, you're statement bound. :) roelj: I'd expect to be able to get up to at least ~100MB/s, but ~18 MB/s is the max.. cmaloney: You might want to look into some other file I/O statements in guile, like streams rekado: roelj: you can improve I/O performance by playing with setvbuf and by using bytevectors. civodul: wouldn't it be great to have a Guile and/or Guix MOOC? like https://mooc.pharo.org/ rain1: certainly would be fun.. wait didn't one get made for testing the async librayr rain1: oh my bad I mixed up MOOC and MUC :p civodul: different beasts :-) rain1: is there software to build a mooc? i.e. we would only have to produce the teaching material rain1: or would you have to build a whole web app system to make users, track progress, .. OrangeShark: rain1: hmm good question, haven't heard of any mooc free software systems OrangeShark: rain1: https://open.edx.org/ apparently this is one roelj: rain1: What about Moodle? roelj: rain1: https://moodle.org/ rain1: wow! thats wonderful rekado: moodle isn’t quite the same as a MOOC, though, is it? rekado: It’s a platform for posting articles, fora, tests, and course materials, whereas the MOOCs I’ve seen are much more video-centric. stis: Hi guilers! manumanumanu: stis: ahoy hoy! manumanumanu: what is cooking? stis: I'm compiling python modules in guile stis: stress testing the compiler stis: manumanumanu: ^^ manumanumanu: :D Fun things! stis: hard work mainly, but I love the debugging phase, strange me manumanumanu: stis: I was thinking about how to compile scheme to python. That seems rather unpretty manumanumanu: id much rather do it the other way around stis: yeah and you cane use schemish constructs versions of python ideoms rain1: maybe you could compile shceme to python bytecode stis: nah python bytecode does not supprort delimited continuations, tail calls etc daviid: wingo, I'm editng the guile-gnome page on fsf dir, your email is apwingo at eos ncsu dot edu, should I change that? if yes, let me know which one lloda-home: sirkmatija1: (ice-9 arrays) wasn't an installed module before 2.2.3. If you need (array-copy) you can define it yourself like in here (search) https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=module/ice-9/arrays.scm daviid: sneek: daviid: sneek: later tell djcb here is another msg I wrote, easier for you to read and understand ( I think) then the previous link I posted: http://lists.gnu.org/archive/html/guile-user/2017-10/msg00027.html sneek: Got it. buenouanq: what is the benefit in using something like #\\" vs "\\"" ? rain1: well they are not the same rain1: char vs string buenouanq: oh ok, duh buenouanq: silly me lloda: daviid: I did pull your patch but the problem was rather my path, so I cannot tell you if the patch solved anything on my side. It did no harm at least. Re: guile-cairo sorry that address is for the unsolved bugs. Re: doc thanks, I'll keep poking now and then. Re: release I don't know how to make a release but I'll look into that. lloda: wingo: ah I see doc/release lloda: wingo: did you see my question about the doc system? lloda: doc generation system wingo: i did but i don't have anything paged into my memory :) lloda: sorry wingo: heh, no prob lloda: so there are hardcoded paths in the Makefile.am lloda: just can't run it, not very specific lloda: like this one in doc/Makefile.am lloda: cairo_docbook_xml_wildcard = ~/src/gnome2/cairo/doc/public/xml/cairo*.xml lloda: but daviid says it's the same system in guile-gnome, so I'll look there roelj: Is there a way to set breakpoints and run code until that breakpoint for Guile? I'm using Emacs.. turlando: roelj apparently geiser can't do that wingo: breakpoints were broken early in 2.2 fwiw; fixed now i think wingo: the repl interface is https://www.gnu.org/software/guile/manual/html_node/Debug-Commands.html roelj: Thanks. I don't know what a recursive REPL is, but I guess I can find that in the manual as well. daviid: lloda: I can 'guide' you make your first guile-cairo release, nothing difficult, just a matter of time really (and doing the first, you'll build your own 'release todo/steps list ...'; I order to 'save' distro and guile-gnome[clutter] users, I uploaded a prerelease, in 2016, here http://download.savannah.nongnu.org/releases/grip/guile-cairo/ (just for info, there is no usefull info there for you) daviid: lloda: I think that guile-cairo binds 1.10, as it is, not sure what your plans are, but it would be nice to try to catch and reach the latest, 1.15, which does not sounds like too much work daviid: guilers, any has an example of an autotooled projects which has a default install location (other then /usr/local) and/but properly handles the --prefix arg? civodul maybe? OrangeShark: daviid: so to be able to have `./configure --prefix=/usr/` and it installs everything in in /usr/? OrangeShark: oh, you don't want the default to be /usr/local? but still obey the prefix arg OrangeShark: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Default-Prefix.html#Default-Prefix this can change the default prefix location spk121: daviid: re autotools. I've tried various ways of installing. guile-ncurses installs things in SITE_DIR etc by default and requires a flag spk121: to install in --prefix directories. spk121: That was rather unpopular spk121: guile-curl installs its files in the --prefix directories, but, gives advice at the end of configure of what flags would actually make it install in SITE_DIR spk121: That seems to be uncontroversial, but, anyone that tries ./configure && make && make install gets a non-working system spk121: until they set a lot of environment variables daviid: spk121: what you do for guile-ncurses is what I need: if no --prefix, source code goes in GUILE_GLOBAL_SITE_DIR (I wrote a macro extension to get that instead of having to run guile -c ...) and compiled modules in GUILE_SITE_CCACHE_DIR, if the user pass --prefix, then it goes in $prefix/share/guile/site and $prefix/lib/guile/@VERSION@/site-ccache daviid: OrangeShark: ^^ daviid: actually the source code goes in $prefix/share/guile/site if compatible with all guile version >= 2.0.14, othrwise (it's per project to decide oof course) it goes in $prefix/share/guile/site/@VERSION@ daviid: doc goes in $prefix/share/doc/ daviid: lloda: civodul could you confirm that this is the right thing to do for guile-lib, thanks Labu: Hello all Labu: Hi daviid daviid: spk121: I wonder why it was unpopular? it is exactly what I would want as a user afaic daviid: hi Labu daviid: have to go afk for a few hours now, bbl daviid: local hospital called me to give blood, a apatient needs my type ... daviid: need to run OrangeShark: hmmmm stis: heya guilers! amz3: hej stis taylan: what's the best way in guile to determine what CPU architecture one is running on? civodul: sneek: later tell daviid it's share/guile/site/@GUILE_EFFECTIVE_VERSION@ sneek: Okay. civodul: heya taylan taylan: hidy :) civodul: taylan: there's %host-type, and there's (system base target) civodul: but are you sure you want to use that? :-) taylan: what should I be using to decide which ABI the platform is using? taylan: civodul: this is for bytestructures in case it wasn't obvious ;-) taylan: working on ARM now. can't believe I just forgot ARM. civodul: there's usually a "processor supplement" of the SysV ABI for each CPU civodul: so i suppose there's one for ARM civodul: well actually the one we use is called "gnueabihf" civodul: lemme see taylan: the "ARM Procedure Call Standard" (APCS) seem to define the type alignments on 32 and 64-bit ARM: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.swdev.abi/index.html not sure if they're supposed to be same on all 32-bit and 64-bit ARMs... civodul: i ended up on the same URL civodul: :-) civodul: there's an ARMv7 ABI and an ARMv8 (aarch64) ABI i suppose taylan: v7 is 32-bit? civodul: yes taylan: it seems that I need to check whether (target-cpu) begins with "arm" or with "aarch64", based on which I'll use the alignments specified in the 32-bit or 64-bit ABIs linked to in the page above... taylan: does that sound about right? civodul: yes, but i'm not sure you need that information civodul: for instance, the bit about aggreates assuming the alignment of their most strictly aligned component may be in the general SysV ABI document civodul: were you able to compare the offsets and alignments with those produced by gcc? civodul: i think that'd be a good starting point, finding out where they differ taylan: civodul: I need to know the alignment of scalar types, which differ across i386, amd64, arm and aarch64. the offset and size calculation of structs is indeed always the same. civodul: ah, right ArneBab: manumanumanu: :-) Digit: hi. i just daydreamed of an any-webkit guile-configurable web-browser. tis an enjoyable day-dream. turlando: Hello people manumanumanu: hello turlando ! what are you doing today? turlando: manumanumanu I have to work turlando: ACTION sighs lloda: sneek: later tell daviid g-wrap it's ok now, guile-config is not on my PATH, my complaint is that it shouldn't be required when pkg-config does the same sneek: Okay. lloda: sneek: later tell daviid wrt guile-lib install location, I don't have a preference on the *default* install location, but when I override it with --prefix, that should be respected. I have several installs of Guile and it makes no sense to have to install libraries on each of them sneek: Okay. lloda: sneek: later tell daviid my questions where about guile-cairo doc (not guile-gnome), where there are a couple of bugs that I can't fix b/c I cannot make the doc generation system work sneek: Got it. lloda: sneek: later tell daviid I'm now in the guile-cairo group in savannah, so I pushed my patches here http://git.savannah.nongnu.org/cgit/guile-cairo.git/ sneek: Got it. lloda: sneek: later tell daviid bugs are in freedesktop.org here: https://bugs.freedesktop.org/buglist.cgi?quicksearch=guile-cairo sneek: Will do. lloda: sneek: botsnack sneek: :) turlando: I need to pass an unix pipe to the guile runtime so that functions defined with scm_c_define_gsubr can access it. Any suggestion? turlando: (it is to handle side effects, I have to access an OpenGL event loop) amz3: pmikkelsen: you want to write a new language on top of guile compiler or write a new backend? pmikkelsen: amz3: Not on top of guile, i just wanted to try and write a very simple stand-alone compiler amz3: ah amz3: then maybe brainfuck is a good start amz3: there is also work done on a javascript backend amz3: that might interest you amz3: does it? amz3: anyway, here is it https://gitlab.com/ijp/guile/tree/compile-to-js-2017 amz3: myself, I don't understand how it works, but I am not into compilers pmikkelsen: Javascript is not of interest no, but I also think brainfuck is a good choice :) If i can get something to work, I may write a blogpost about it for anyone interested. amz3: I said, it could be interesting because it's a custom backend of guile compiler vm amz3: pmikkelsen: yes, make a blogpost and post it on the mailling list please amz3: ACTION always happy to read about new things in guile lab amz3: s/lab/land/ pmikkelsen: amz3: Sure I will do, but it is maybe going to take some time as I have alot of work atm. amz3: no problem civodul: grrr delete-duplicates is in C so non-interruptible in Fibers manumanumanu: civodul: you can have this: https://pastebin.com/f8DRfRif civodul: sorry pastebin.com blocks Tor users, could you try paste.debian.net for instance? manumanumanu: civodul: http://paste.debian.net/1018299/ civodul: thanks! civodul: oh yes, thank you :-) manumanumanu: oh... delete is probably c as well manumanumanu: I have delete somewhere here as well. to learn list processing I re-implemented parts of srfi-1. https://bitbucket.org/bjoli/nietzsche/src/1769998a800955d5831aa7c0c8b3c31ba00f7050/data/list.scm?at=default&fileviewer=file-view-default manumanumanu: pick and chose. don't mind the license. manumanumanu: (this channel is logged i suspect. you have my permission to do whatever you want with that source code). OrangeShark: hello everyone manumanumanu: ahoy roelj: Is it possible to get the symbol name from within a function? Like so: (define (test a b) (get-name-of-function)) => test spk121: roelj: maybe like this? spk121: (use-modules (system vm frame)) spk121: (define (func x) (write (frame-procedure-name (stack-ref (make-stack #t) 1)))) roelj: spk121: That is cool. Thanks! spk121: but it probably would be better to define your test func as some sort of syntax instead roelj: I solved it another way: (define (prefix uri) (lambda (suffix) (format #f "<~a~a>" uri suffix))) roelj: Then: (define hello (prefix "http://localhost/")) roelj: Which results in: (hello "world") => "" roelj: So it doesn't actually look up the symbol name it's part of.. spk121: That's much more practical. civodul: roelj: i'd suggest writing your own macro, like: (define-with-name the-name (proc a b) (pk the-name) (+ a b)) buenouanq: ERROR: In procedure dynamic-link: file: "libpq", message: "file not found" buenouanq: does this look like a guixsd thing or something in guile-squee I need to change? spk121: buenouanq: make sure that the shared libraries you are using and *all their dependencies* are in expected places spk121: maybe set LD_LIBRARY_PATH spk121: If you can't figure it out, try running your command or whatever preceded by LD_DEBUG=all. And then somewhere near the bottom of all the spew it will tell you what the problem is. sirkmatija1: Hello, I am having some trouble with Guile 2.2.2 (ice-9 arrays) module. When trying to use it I get "ERROR: no code for module (ice-9 arrays)" error message. Can anyone help me? Thanks in advance Labu: Hello! djcb: WARNING: (guile-user): `' imported from both (oop goops) and (bar) djcb: ^^^ Is that something I should worry about? rcm: Hi All. Once I've designe rcm: Oops. I meant to say: Hi all, I've been reading through the "guile fibers" documentation and playing around with the API. I remember the manual saying that fibers was inspired by CSP and concurrent ML. I'm not quite sure about how to convert a CSP design into fibers code rcm: does anyone have any experience with this? Labu: Hello I need to store some datas into database. I thought about sqlite. the only lib I found is guile-dbd-sqlite3. But repo doesn't be updated since 2014. Labu: Have you any advice about store data with guile in sql db or else ? amz3: Labu: they are other bindings for sqlite amz3: Labu: https://notabug.org/civodul/guile-sqlite3/ Labu: thx amz3 amz3: Labu: also I am the maintainer of guile wiredtiger if you feel like willing to adventure yourself outside the strict realm of SQL amz3: http://www.hyperdev.fr/projects/wiredtiger/ Labu: thx I am looking amz3: Labu: do you use guix or guixsd? Labu: no I am on netbsd amz3: Labu: both guile-wiredtiger and wiredtiger are on guix amz3: ok Labu: I am going give a try to wiredtiger amz3: Labu: let me know what you think Labu: ok seems to be cool amz3: Labu: :) amz3: Labu: the code is @ https://framagit.org/a-guile-mind/guile-wiredtiger amz3: you can git clone https://framagit.org/a-guile-mind/guile-wiredtiger.git Labu: thx amz3: like it's explained it the "manual" from above Labu: the project page give a link to github did you migrate from to framagit . Labu: ? amz3: there is three layers: 0) the raw wiredtiger bindings 1) a thin layer to make it bit more useable 2) some database abstrations like graph and "feature space" with microkanren querying amz3: Labu: that is a mistake Labu: ok amz3: Labu: the recent version is at framagit Labu: I didn't read until the end amz3: Labu: the documentation is not very good TBH Labu: no problem Labu: you have worked on berkeley db ? amz3: Labu: don't hesitate to ask question, right now I need to go, happy hacking Labu: ok thx for the share stis: hello guilers! OrangeShark: hello stis daviid: djcb: yes you should, definitely sneek: daviid, you have 5 messages. sneek: daviid, lloda says: g-wrap it's ok now, guile-config is not on my PATH, my complaint is that it shouldn't be required when pkg-config does the same sneek: daviid, lloda says: wrt guile-lib install location, I don't have a preference on the *default* install location, but when I override it with --prefix, that should be respected. I have several installs of Guile and it makes no sense to have to install libraries on each of them sneek: daviid, lloda says: my questions where about guile-cairo doc (not guile-gnome), where there are a couple of bugs that I can't fix b/c I cannot make the doc generation system work sneek: daviid, lloda says: I'm now in the guile-cairo group in savannah, so I pushed my patches here http://git.savannah.nongnu.org/cgit/guile-cairo.git/ sneek: daviid, lloda says: bugs are in freedesktop.org here: https://bugs.freedesktop.org/buglist.cgi?quicksearch=guile-cairo daviid: lloda: g-wrap, not sure i agree with you: to me, it does make sence to make/compile/install g-wrap if g-wrap does not find guile-config, because it means it would not find guild, neither guile itself ... and not finding it is a recurrent ACLOCAL local config related problem ... that having guile.nm4 distributed with the lib/app concerned solves (and it deliver a better msg when guile is in fact not installed ...). what I can't figure daviid: out with your answer, is if you did pull and tried again, since I patched after you reported this in the first place ... I just want to confirm it does in fact solve the problem, for other uers, in the future ... daviid: lloda: guile-lib, I totally agree with you, it was a mistake on my side not to take that into account in the first place. Iwill try to fix this asap, but don't hold your breath ... :) daviid: lloda: guile-cairo doc: I thnk guile-cairo doc builder uses guile-gnome doc builder (it's a copy, it does not depend on guile-gnome), and guile-gnime doc builder also does not work either, this is what I meant to say ... so, if you fix it, please let me know, I could back-copy and try on guile-gnome ... daviid: lloda: very pleased you are in the guile-cairo savannah group, I have a 5 to 6y pending request :) ... you should release asap, the last tarball is 5 to 6y old and misses important patches for guile-clutter (among other thingd): this provides any distro to propose guile-clutter (except guix, because guixers are top notch hackers that can build from source ... and patch the autotoolchain, guix is a must ... but not everyone has guix ... daviid: I actually still don't have guix installed) daviid: ACTION hides buenouanq: DO IT buenouanq: it's the best Digit: last time i did, the process was fairly quick and painless, afaicr. been a while. daviid: lloda: when brwosing this exact address, https://bugs.freedesktop.org/buglist.cgi?quicksearch=guile-cairo I don't see your bug report, only the very old ones ... what am I doing wrong :)? (I'm such a pathetic web user ...) daviid: lloda: no big deal, I see the patch in savannah of course ... just curious daviid: lloda: in the first sentence I posted today, g-wrap ... I meant to write '... it does not make sence to make/install ...' (as you prob understood by yourself ...) daviid: djcb: I suggest you read this (and the rest of the thread) http://lists.gnu.org/archive/html/guile-user/2016-07/msg00089.html Labu: Hello amz3: Héllo all amz3: Héllo Labu OrangeShark: hello guile weirdlispalien: what should I read after SICP to learn more about scheme/guile? Like if I would want to create practical applications with scheme. OrangeShark: weirdlispalien: I don't think there is much to read if you are interested in learning more about creating practical applications. Labu: weirdlispalien: if you have some science background : Functional differential geometry. depends what kind of application Labu: weirdlispalien: start coding and read guile book chrislck: +1 OrangeShark: would probably be nice to document the tools we use and how to use them weirdlispalien: are there really any other resources for guile other than the GNU guile manual? chrislck: if you understand guile is an implementation of scheme, there's incredible amounts of scheme resources available -htdp/sicp/tls are the core classics OrangeShark: weirdlispalien: there is some blogs here and there, but I am not aware of anything extensive. OrangeShark: chrislck: there is more than just the language void_pointer: there is also reading the R6RS standard and the SRFIs as well, or skimming for specific features you want to use void_pointer: http://www.r6rs.org/ and https://srfi.schemers.org/ Labu: weirdlispalien: What kind of application do you want to make ? weirdlispalien: Labu: games, text editors, web servers, just general scripts for example chrislck: wow void_pointer: well, one good approach is to start with something small and reasonably self-contained, or can at least be reasonably self contained with a few core features and other stuff is just extra that can be added on void_pointer: small utility scripts or command line tools are always good candidates void_pointer: games, except at the very very small end (e.g. pong level), are not the best candidates for a first project in a language unless you essentially know a language and very closely related (e.g. if you already knew common lisp and some functional language well, doing a bit larger one as a first project in scheme could be approachable) void_pointer: would say that something similar applies to other sorts of project ideas void_pointer: to a lesser degree void_pointer: but not that much lesser Labu: weirdlispalien: web application (not server) is a easiest approch. Or general script. void_pointer: another one is to, if you have a larger project idea you want to eventually do that is missing a key small library, write said library with tests as a first project weirdlispalien: reading source code of software written in scheme would also be good practice, right? Labu: yes of course Labu: If you want make (little) games there is a SDL binding in guile weirdlispalien: if I would read some projects source code, where should I start reading? Labu: Try little lib there are a lot on github and savanah Labu: I don't know what is interesting you. spk121: As soon as I hook in Audio+Opus support, my ridiculous Guile-based Twine-like interactive fiction engine will be complete. spk121: I'm rather please how it is coming together. ArneBab: manumanumanu: wow, nice! manumanumanu: ArneBab: it was an ultimately pointless exercise though: it brings very little since the transducers are not integrated into the language. As it is now, they are only usable with lists, which means a named let is much faster and probably a much better choice (or better yet: use my racket-like for loops :D ) pmikkelsen: hi guilers, I want to try and write a simple compiler in guile scheme, do you know any reading material on this? spk121: pmikkelsen: there is this joke language called Brainfuck, that has only 8 instructions spk121: There's a wikipedia page for it. spk121: Anyway, there is an interpreter for it in the guile source tree under module/language/brainfuck spk121: you could start there ota: Spk121 +1 ota: If there was ever a good use for brainfuck this may be it. ota: Tho, it's been years and years since I looked at it. spk121: ota: :) pmikkelsen: thanks! buenouanq: What's the proper way to load a custom module? buenouanq: I'm getting weird errors. buenouanq: ;;; WARNING: compilation of .../test.scm failed: buenouanq: ;;; ERROR: no code for module (sxml html) buenouanq: yet I can still use what (sxml html) exported buenouanq: so I'm sort of confused. daviid`: buenouanq: there is no sxml hmtl module in guile daviid`: buenouanq: https://dthompson.us/rendering-html-with-sxml-and-gnu-guile.html daviid`: if you installed from the above, you need to tell guile where to find the module ... see %load-path and GUILE_LOAD_PATH in the manua ... buenouanq: daviid`: that's the file I'm trying to load buenouanq: I have saved it in the folder I'm working in. buenouanq: the above errors come from using (load "./sxml-html.scm") buenouanq: and even though it says there is no code, sxml->html still works as expected/desired. buenouanq: but if I do the recommended (add-to-load-path (dirname (current-filename))) it fails to run at all daviid`: buenouanq: first you should solve the (sxml html) module not found, by installing (see the link I pasted above) and telling guile - %load-path or GUILE_LOAD_PATH - where you did install ... fire a repl and ,use (sxml html) should work daviid`: then you can further work on your scheme file ... buenouanq: I'm trying to do exactly that and it's not working is the thing. daviid`: buenouanq: if the file exists, it is somewhere, like /your/path/sxml/html then you must add "/your/path" to the list of path in %load-path, then it will work buenouanq: I have dt"s library saved as a file in the same directory the script I'm working on is in. daviid`: /your/path/sxml/html.scm I ment buenouanq: but (add-to-load-path (dirname (current-filename))) dosen't work daviid`: buenouanq: that won' work indeed, read what I just wrote daviid`: you should read or re read about what are modules, hw to define and use them in the manual ... buenouanq: /your/path in this case is the value of (dirname (current-filename)) buenouanq: I've read it a bunch of times, there's obviously something that's not clicking. daviid`: buenouanq: try to add it manually, till it works buenouanq: t.. that's exactly what I'm talking about doing buenouanq: I can get it to load with (load daviid`: you should not load buenouanq: it throws the errors, but still works daviid`: that is not the way tu use modules, and load has nothing to do with %load-path ... buenouanq: with add-to-load-path it throws the errors and refuses to even run daviid`: do as I say: manually like (add-to-load-path "/your/path") daviid`: ,use (sxml html) daviid`: you may also check, by entering %load-path, and verify that "/your/path" is in the list buenouanq: ERROR: no code for module (sxml html) buenouanq: is the problem that it has to be named ./sxml/html.scm buenouanq: because right now it's ./sxml-html.scm daviid`: buenouanq: that won't work, you have to spel the fullpathname daviid`: buenouanq: again, do as I say daviid`: (add-to-load-path "/your/path") buenouanq: I need it to be relative though... daviid`: then %load-path, check it's i the list, then ,use (sxml html) daviid`: buenouanq: impossible daviid`: guile won't accept it, i told you already buenouanq: full explicity path, same error buenouanq: s/y// daviid`: then the file does not exists daviid`: buenouanq: we do that, guilers, million of times, there is something you don't understand and/or miss spell ... daviid`: if the file exists: /your/path/sxml/html.scm, then it wil work, if you do as i say ... as it is explained in the manual .... anything else will fail buenouanq: ok, relative paths do in fact work - the problem was what I said above buenouanq: it has to be ./sxml/html.scm buenouanq: which has something to do with module naming conventions I guess buenouanq: so if I wanted to have the file be ./sxml-html.scm I would have to change the name of the module and use (use-modules sxml-html) daviid`: yes, that is how module are defined (sxml html) means there is a file sxml/html.scm buenouanq: or (use-modules (sxml-html)) rather buenouanq: ok, this is just what I didn't understand daviid`: buenouanq: that is why I suggested you re read the manual about what modules are, how to define and use them .. you shoud really do that first buenouanq: I figured adding something to the load path would read anything in it and being defin-module calls it (sxml html) it would be found buenouanq: I have it all open and have gone through it many times - There are things that just don't make sense until I talk through them like this. Hope the room doesn't mind the activity ( ._.) buenouanq: and thank you for responding daviid`: np, welcome daviid`: buenouanq: re read this section 6.20.4 Modules and the File System daviid`: and 6.18.7 Load Paths ... Labu: Hello All manumanumanu: Labu: Hello! mwette: buenouanq: This is what I use: `(add-to-load-path (getcwd)) (use-modules (sxml html))' manumanumanu: ArneBab: so, I made the transducers portable, added som stuff, and the address is now https://bitbucket.org/bjoli/scheme-transducers manumanumanu: the speed benefit of them isn't too big in guile, but in chez...whoosh! They are flying! manumanumanu: I suspect the function calling overhead in guile is quite a bit larger, and the GC benefits aren't as noticeable. chrislck: if A and B are both either numbers or #f (denoting absence of numbers), there's a beautiful symmetry to coding their addition chrislck: (define (myadd A B) (if A (if B (+ A B) A) B)) chrislck: ^_^ chrislck: this works on any combination of A B being numbers or #f mwette: chrislck: check out "The Maybe monad" lispsps: is the guile manual the best place to learn guile? cmaloney: depends on what you're looking to learn cmaloney: but it is a good manual manumanumanu: lispsps: what programming have you done before? lispsps: hello worlds and fizz buzzes in C lispsps: now I'm reading SICP mwette: lispsps: SICP should be a great start manumanumanu: yeah manumanumanu: and guile's manual is a complement. Have guile's procedure index as a bookmark in your browser: https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html lispsps: ok thanks lispsps: if I would want to create for an example a game or a chat in guile, is the manual or that procedure table right place to start looking for libraries and stuff? manumanumanu: lispsps: the manual can be a little sparse on examples, but yes. There isn't a good way to find external libraries, but googling generally works if you don't mind ignoring some results from the playstation game Tekken. daviid: there is a good way :), here http://sph.mn/c/view/g2 daviid: I see that the list is missing https://dthompson.us/projects/chickadee.html - Chickadee is a game development toolkit for Guile Scheme built on top of SDL2 and OpenGL. amz3: héllo all Labu: hello amz3 Franciman: do guile regex support sre syntax? Franciman: does* civodul: Franciman: nope! civodul: (ice-9 regex) provides POSIX regexps civodul: but SRFI-115, which provides SRE, should work fine with Guile Franciman: thanks Franciman: I didn't see srfi-115 in the list of srfis civodul: it's not (yet) in Guile proper civodul: but you can take the reference implementation from srfi.schemers.org Franciman: perfect, thanks Franciman: I think it's very useful Franciman: especially because I just wrote: \\\\\\\\\\\\\\\\ Franciman: lol Franciman: to say \\\\ daviid: lloda: i lost the link where you patched guile-cairo, please post it again here, thank! dadinn: amz3: sorry for the delay, the example output would be an all uppercase partition GUID of the $2th partition of the $2 device dadinn: amz3: but the main point is the piping between the output of one shell command, and some grep and sed and uppercasing transformations (the later steps could potentially be done inside the guile proccess, but nevertheless for testing of the pipes) xelkarin: I'm trying to read a file with scm_c_primitive_load that uses some custom functions defined with scm_c_define_gsubr. xelkarin: If I pass an invalid data type to one of these functions, I get an exception, but the line number of the file where they occur is not included in the stack trace. xelkarin: I tried following the directions in the manual under '6.25.3.2 Capturing the full error stack' but it still doesn't seem to include the line number. xelkarin: Using guile 2.0.14 amz3: o/ amz3: what's up? mwette: ACTION mwette: ACTION is working on ffi-helper, dealing with vector data passed to c functions as an address. I have added a `define-fh-unsized-vector-type' macro, providing definitions via `(define data (make-foo_t-vec 10))' and pass to c library functions via `(bar (pointer-to data) 10)' amz3: ACTION is working on unit tests for neon database civodul: mwette: the dbus bindings you posted are quite impressive, BTW! Franciman: Hi Franciman: how can I create a temporary directory in guile scheme? mwette: civodul: thanks much for the recognition . I think the ffi-helper is really useful now amz3: Franciman: look up mkstemp in the procedure index https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html niebie`: has anybody used guile-gl/chickadee before? niebie`: i'm having a bit of fun getting gl working on guixsd and was wondering if anybody else had civodul: Exception thrown while printing backtrace: civodul: In procedure private-lookup: Module named (guile) does not exist civodul: how can the impossible happen? :-) mwette: b chrislck: how odd - (exact->inexact 2/3) --> 0.6666666 but (exact->inexact 5/6) --> 0.833333333334 amz3: anyone had issues with locale and guile with Guix/Ubuntu ? amz3: Ubuntu 17.10 amz3: I can't setlocale anymore amz3: I think I found something amz3: host glibc and guix glibc don't match civodul: heya amz3 civodul: amz3: did you check https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html#Locales ? amz3: civodul: yes, I did check. Updating my guix fixed the issue dadinn: hi all dadinn: quick question regarding pipes/regexp dadinn: how would you write the following: sgdisk -i $2 $1 | grep -E '^Partition unique GUID:' | sed -e 's;^[^:]*: \\([[:alnum:]-]*\\)$;\\1;' | tr '[:upper:]' '[:lower:]' dadinn: trying to look through the docks, but none of the pipe pages give any example of how these input/output pipe supposed to work amz3: dadinn: look at this https://lists.gnu.org/archive/html/bug-guile/2016-09/msg00008.html amz3: I should be working on fixing this! amz3: this question keeps coming back at us :/ dadinn: amz3: hmm, I see there is this private open-process... what I would be looking for is an open-process which takes a sequence of lists (each args to open-pipe/system*) and returns an inpupt pipe :/ dadinn: input/output pipe I am not too sure with the terminology, as I don't really grasp what they intend to do without any examples dadinn: is an input pipe something to "read" from, and the output pipe something to "write" to? I suppose dadinn: but the regexp functions for some reason mostly don't take input ports, only output amz3: I may be mistaken, I don't fully understand what your problem is amz3: maybe if you paste some code, it will help dadinn: and any examples you can find on the internets about guile with pipes, the most complex goes to the point of "echo bla bla | wc"... dadinn: while the example I was looking is much more complex gen -> transform -> transform ->transform -> do something ... without example, I have to assume it is not something supported, and learn bloody python instead :( dadinn: amz3: how would you translate the shell command I sent before to Guile code? dadinn: amz3: sgdisk -i $2 $1 | grep -E '^Partition unique GUID:' | sed -e 's;^[^:]*: \\([[:alnum:]-]*\\)$;\\1;' | tr '[:upper:]' amz3: dadinn: tell what it does in plain english and what $2 $1 and an example output amz3: +me spk121: """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" spk121: *lol. Left a book on the keyboard. civodul: :-) daviid: haha, you were reading and fall asleep ... dadinn: amz3: sorry I forgot to explain those: $1 is a block device path, $2 is an integer number amz3: o/ manumanumanu: hey ho! rekado: Text size is now computed with guile-sdl; unfortunately, this only works for TTF fonts, so I’ll still have to look at creating minimal bindings for pango. spk121: Hmmm. The foldts in (sxml fold) behaves differently than the one in (sxml transform). Grrr. daviid: lloda: i have to go afk for a bit, bbl, but wrt g-wrap, as I wrote already: (a) not finding guild/guile-config is an ACLOCAL local config problem on your side, not a g-wrap bug; (b) but, I patched g-wrap, both devel and master branch so it has guile.m4 in its tree, and does not depend on user ACLOCAL config anymore (as I also said, one of the most recurrent user problem, and not doinf this, it would lamentaly fail if the user does not daviid: have guile (mind you a rare case, grated, but ...) so, please git pull g-wrap and try again, let me know ... daviid: lloda: civodul wrt guile-lib install location, let's talk, I can change that, but right now it uses $(GUILE_GLOBAL_SITE) as the source code modules install location, $(GUILE_SITE_CCACHE) for the compiled files (see c14a511b2d4d6f0271fef7dfe7c4904f00f23442): I thought it was the right thing to do daviid: lloda: guile-gnome does not build its doc anymore, there is a bug, long time bug now, that I never find time (and interest, because i browse the gnome doc when I work inguile-gnome) to fix it. not sure about guile-cairo, which does not depend on guile-gnome, never build its doc either daviid: I have a very weak knowledge of cairo itself, which I only used to build a few examples for guile-clutter daviid: rekado: yes, you won't be able to use (gnome pango) and (gnome pangicairo) unless you build guile-gnome, which you can do just for these modules by the way (and glib, gobject of course) spk121: For what it is worth, I'm pretty good with Cairo, but, I've never attempted to use its Guile binding. daviid: rekado: guile-cairo has text features, it's a tiny binding, maybe you could give it a go daviid: rekado: if yu do so, clone, because the tar is extremely old and misses bug fixed (notably for guile-clutter) daviid: spk121: good to know you're prety good at cairo, does it gives access to pango cairo, so using guile-cairo we'd have access to pangocairo too, not sure but kind of remember i ddid read about this a long time ago ... spk121: daviid: no. pango is above cairo. Cairo has a toy font API, though. daviid: spk121: ah ok daviid: bbl spk121: ok lloda: spk121: (rnrs) has exact & inexact which are better names imo manumanumanu: ArneBab: I'm updating the transducers a bit now. I managed to get take-while working manumanumanu: and drop while manumanumanu: but those are probably slow as darn hey ho, since they are stateful manumanumanu: (ie: they use set! manumanumanu: ) manumanumanu: uploading them soon manumanumanu: I'm too stupid to make partition work though. I don't want to look at the source of clojure, but if I don't manage to get that transducer to work, I might as well. manumanumanu: clojure is EPL, so no... No source look. chrislck: I never thought that set! in code makes things slow manumanumanu: chrislck: it does. using recursion makes the compiler be able to infer things about your code. set! makes that harder manumanumanu: that's why a while-loop using mutation is often slower than the corresponding tail-recursive named let chrislck: good to know... i'm not writing lowlevel code but will use it as a last resort from now on manumanumanu: ArneBab: but I am sorry to say that the transducers are not faster than actually building intermediate collections for most things. It uses a lot less GC time, but the overhead from all the procedure passing makes them roughly comparable (unless you start combining really long transducers). a (compose (tmap 1+) (filter odd?) (tmap 1-)) transducer over 10 million elements is only about 10% faster) amz3: manumanumanu: I like the way you drive things :) manumanumanu: amz3: thank you :) civodul: hey hey civodul: rekado: did you publish pict.scm somewhere? rekado: civodul: only on guile-devel. rekado: oh, wait: https://elephly.net/downies/pict.scm rekado: that’s the only place. civodul: rekado: ok, thanks! lfam: Recently, this stopped working for me in Guile 2.2.3: (use-modules (ice-9 readline)) lfam: Now I get "no code for module (ice-9 readline)" civodul: lfam: did you "guix package -i guile-readline"? civodul: in the previous core-updates, (ice-9 readline) was moved to that separate package lfam: Aha lfam: I'm sure that will do it :) civodul: heh civodul: it's confused a number of people already lfam: Thanks, now it works :) rekado: for properly sized text in the picture language I need Guile bindings for both freetype and harfbuzz. rekado: alternatively I could use pango, which already has Guile bindings. rekado: but it’s a bit heavier. civodul: but it's ready to use rekado: yeah. rekado: can I use it without having to depend on guile-gnome? Are there separate pango bindings? civodul: oh maybe not, i had forgotten it was part of guile-gnome civodul: yeah it's heavier :-) rekado: I suppose I could also use SDL2_ttf for which there are also Guile bindings, but that also seems to be rather heavy-weight. spk121: rekado: the actual number of Pango functions you will need in any project is quite small. An FFI for them would not be huge. (Although, I haven't tried it.) lloda: ok managed to install guile-gnome, problem was g-wrap had written @GUILE_CFLAGS@ literally in its pkg-config file b/c (I think) it didn't find guile-config. I thought this was outdated, is it a bug in g-wrap? civodul: in Guix there's a g-wrap package but it doesn't do anything special civodul: it seems to "just work" with Guile 2.2 lloda: hmm lloda: neither guile nor guile-config are on my PATH, b/c I use $GUILE. But pkg-config should be enough. Define a variable if one of the executables is actually required. But g-wrap was barfing on GUILE_CFLAGS and GUILE_LIBS, for those nothing more than pkg-config should be required :-| lloda: imo lloda: does anyone know what is MATCH-BIND and what package provides it? lloda: oh it's in guile-lib lloda: so guile-lib isn't installing the modules in --prefix. It installs them inside my Guile install directories. WTH :-/ civodul: uh, that's bad lloda: wingo: after installing all the dependences, I still can't regenerate the guile-cairo doc. make generate-defuns in doc/ doesn't seem to do anything. doc/Makefile.am has hardcoded paths like ~/src/gnome2/... turlando: Hello turlando: It's not clear to me the difference between the following two expressions: '(1 2 3) and (cons 1 (cons 2 (cons 3 '()))). Are they stored differently in memory? turlando: Kind of related: why should I prefer a vector over a list? OrangeShark: turlando: '(1 2 3) creates a constant, there only exist one instance of that list. The other creates a new list each time. (list 1 2 3) and (cons 1 (cons 2 (cons 3 '()))) are equivalent OrangeShark: turlando: you would use a vector over a list when you want to access any element randomly, especially for larger lists. turlando: OrangeShark thanks a lot. It's not clear why `eq?' returns me false when I compare the cons expression and the list expression. Is that because it's not a constant? OrangeShark: eq? returns true if they refer to the same object. turlando: What function shold I use to compare the value of two expressions then? OrangeShark: so when you use cons or list, you create a new object each time OrangeShark: equal? turlando: thanks a lot for the clarification OrangeShark OrangeShark: I believe there is a section in the manual that explains the different equality functions, but the gnu website seems to be really slow right now turlando: I'm using `info guile' for a reason OrangeShark: not on a computer with guile unfortunately :( turlando: no worries, I can find it by myself, I think it's few section after what I'm reading now OrangeShark: a section called equality turlando: I have another question: let's say I want to make a function that takes a varidic number of arguments and print all of them to the screen. I'm doing so: (define (printall . v) (if (pair? v) (if (null? (cdr v)) (printall (car v)) (printall (cdr v))) (display v))) turlando: But that seems to me extremely complicated and it doesn't work too (gets into an infinite loop) turlando: Which is the sane way of doing so? spk121: turlando: (define (printall . x) (for-each display x)) spk121: but there won't be spaces in between theme. turlando: spk121 thanks a lot :) It was a simplification of another case I'm trying to address (it involves calling a C function I wrote from scheme) manumanumanu: ahoy hoy amz3: o/ spk121: wingo: or civodul: would you mind if I pushed a patch to add inexact->exact to (ice-9 sandbox) ? civodul: spk121: that's definitely a question for wingo :-) civodul: at first sight it looks safe, but i'd rather let wingo weigh in manumanumanu: amz3: it is not a stream library. It is more general than that. You could for example just transduce a single value, which means you can re-use transducers. You could do a (compose (mapper 1+) (filterer odd?)) and not just use it to transduce a list, but also have it as a processing step just about anywhere, regardless of if it uses lists or vectors or anything like that mbakke: Noob question: how would I go about transforming a list like '("a" "b" "c") to '("a" "ab" "abc")? mange: Completely unhelpful, but in Clojure it could be (next (reductions str "" '("a" "b" "c"))). I can't see anything immediately that would help you do it in Guile. amz3: idk spk121: I came up with this, but it isn't pretty. You should be able to do something nicer with 'fold', maybe. spk121: https://paste.gnome.org/pvs6si4tv chrislck: https://pastebin.com/q4edB7zH works too mange: I played around with it briefly trying to use fold, and I struggled to come up with anything nice. mange: chrislck: Strictly that should probably use map-in-order (although in Guile they're the same thing, I believe). chrislck: well this is the first time I see map-in-order but, yes amz3: mbakke: that's 3, 2, 1-gram of "abc" amz3: but that said, on top of my head I don't know the algorithm chrislck: I can't believe it... 7 months after working through SICP+HtDP+TLS I'm now a graybeard :-o amz3: here is the answer to this question in python https://stackoverflow.com/q/17531684/140837 amz3: i prefer spk121 answer amz3: because it doesn't rely on set! spk121: hmm. paste.gnome.org messed up my indentation. mbakke: Thanks for the answers :) guile-guest9: Hi, all. How can I obtain the type information of scheme array from c? I want to get the value of scheme array and put it to a math library, but first I need to know the type of array values. spk121: well, you first need to make sure that you created a 'typed array'. Then you can use scm_array_type(). It returns a 'vectag' like 'u32 or 'f64 guile-guest9: Thanks, I read the doc about scm_array_type, but it didn't make it clear that what exactly is vectag and how can I read it from SCM type. spk121: if (scm_is_true (scm_eqv_p (scm_array_type (array), scm_from_latin1_symbol ('u32))) then /*use uint32_t */ spk121: or something like that guile-guest9: Thanks, I will try it now. :) miqlas: Hi guys, miqlas: just reporting back: guile landed in HaikuDepot: http://kitchen.haiku-os.org/master/x86_64/logviewer.html?buildruns/1117/builds/10188.log miqlas: One can now install it trough our "appstore" davexunit: interesting! miqlas: it is a log from one of our builder bot. they taking the fresh recipes and building and packaging the softwares accordingly. miqlas: kein hexenwerk. civodul: neat civodul: s/guys/people/ BTW :-) civodul: what's the value of '%host-type' on Haiku? miqlas: civodul: how can i check it? miqlas: #guile %host-type ? miqlas: civodul: $1 = "x86_64-unknown-haiku" miqlas: my uname -a is : Haiku shredder 1 hrev51856 Mar 17 2018 14:24:19 x86_64 x86_64 Haiku miqlas: shredder is the default, btw civodul: cool civodul: what libc is it? miqlas: a standard c library? miqlas: Haiku have it in libroot, linked automatically against everything. I know that for sure, but nothing else actually. civodul: ok civodul: i mean it's not based on an existing libc, is it? miqlas: civodul: can i ask where this question comes from? civodul: curiosity :-) miqlas: afaik i haven't told anything about libc. civodul: ok, np :-) miqlas: independently, i got actually a problem with our libc (actually glibc) in fish, but i don't think it is relevant here. miqlas: Still fighting with debugger miqlas: lemme know if somebody can help, btw. javyre: /leave amz3: o/ manumanumanu: Ahoy amz3 manumanumanu: What are you all up to? manumanumanu: I'll start! manumanumanu: I'm writing something like clojure's transducers for guile! I started by trying to combine map/filter/take-while in a lazy way to avoid iterating over lists many times, but the overhead was too large, even with something more light-weight than streams, so here I am manumanumanu: and now it works! haha! manumanumanu: and it's fast! :D ecraven: shouldn't a clever compiler do stream fusion on just normal nested map/filter/take etc. forms? manumanumanu: in a pure world, yes. manumanumanu: but detecting whether something is free of side effects is harder than we think ecraven: thought I don't know of any that actually does :-/ manumanumanu: haskell does ecraven: I mean scheme compilers manumanumanu: well, you can't have an guarrantees about side effects manumanumanu: what if your filter function depends on side effects of the mapping function manumanumanu: then stream fusion would ruin that manumanumanu: that would be up to r8rs to fix, i'd say manumanumanu: the sad thing about transducers is that some has to carry state manumanumanu: like take ArneBab: manumanumanu: wow! manumanumanu: ArneBab: pretty much finished with the basic ones. ArneBab: manumanumanu: where can we test that? manumanumanu: going to do take-while and drop-while later manumanumanu: I'll upload it to bitbucket chrislck: I'm myself helping bringing gnucash from the 1.8 dark ages to start to use some srfi-1 constructs... manumanumanu: how about transducing? :D :D chrislck: :-O imagine the old wizards were hacking code 20 years ago without github, unit testing, or map/filter ArneBab: manumanumanu: thank you! manumanumanu: ArneBab: https://bitbucket.org/bjoli/guile-transducers manumanumanu: I haven't implemented the transducers as arity versions of map/filter/take, but that will come next amz3: I am not sure what transducers are amz3: I read about them, still not sure what it is amz3: I think it's related to lazy streams operations, IDK much more amz3: I've been hacking together some machine learning project in python, it does output the similarity of the input url with wikipedia articles amz3: https://github.com/amirouche/wikimark/ amz3: and I am getting ready to move my website to haunt amz3: also I started a project regarding culturia, in french wikipedia university amz3: I will work on creating some free version of multinet https://en.wikipedia.org/wiki/MultiNet amz3: there is link at the bottom, to the full book introducing this formalism amz3: too bad the research project was shutdown (because of machine learning I guess), the last people working with MultiNet is sempria.de amz3: they use bigloo afaik amz3: I am trying to convince people behind sempria.de to free some of their software amz3: manumanumanu: did you write any documentation regrading transducers? manumanumanu: amz3: none yet. They are not lazy. They are a generalisation of reduce/fold, but without being dependant on a sequence type amz3: ok manumanumanu: they can be made eager, but that requires some voodoo (they are push, not pull like most lazy sequences) manumanumanu: the neat thing is that you can combine things like filter/map etc and only have one pass over a list amz3: sounds like the stream library I use in neon ArneBab: manumanumanu: with MPLv.2 you mean version two of MPL, right? manumanumanu: ArneBab: yes. Apteryx: emacs-guix always gives me: guix environment: error: execlp: No such file or directory when trying to use environments. Apteryx: oops, wrong channel. jeko: Hi guilers !!!! jeko: How are you? amz3: o/ OrangeShark: hi amz3 amz3: OrangeShark: hi! how is going the event? OrangeShark: pretty nice so far chrislck: rekado nice jeko: Hello guilers !!! jeko: Do you know how I can clear the report between test runs with SRFI-64 ? amz3: make clean ? jeko: what do you mean by "make clean" ? amz3: if you project has a Makefile with the 'clean' rule you can maybe use 'make clean' to remove the files generated by the test runner amz3: otherwie you can use 'git clean -fxd' with care amz3: the above will delete all files not tracked by git, including ignored files amz3: lookup the definition of -f -x and -d in the git man page amz3: jeko: ^ jeko: What if I don't have any file created ? I have a basic scheme file I can (load "main-test.scm") to see if all my tests are OK jeko: I load it each time I make a change in main.scm jeko: (I try to setup a TDD workflow haha) jeko: I load the test file into my geiser REPL jeko: It is like the REPL keep a variable which is used each time I run my tests amz3: then IDK, maybe some else will, otherwise send a mail on the mailing list amz3: good luck jeko: alright thank you for trying ! jeko: :) amz3: :) rekado: in order to determine the text width for the picture language: I guess I could use freetype directly. That would be much lighter than using Cairo. civodul: are you implementing the picture language in Guile? rekado: yes rekado: wanna see? civodul: yes! rekado: https://elephly.net/downies/pict.scm rekado: just ,use (pict) and then try something like (circle 10) in geiser. civodul: awesome! rekado: I haven’t implemented rotation or translation yet. rekado: This all sits on top of bare SVG, which is built with SXML expressions. rekado: all of the composition procedures already work fine. civodul: noooo civodul: and geiser already does the right thing civodul: crazy! rekado: (apply vc-append (map circle (iota 10))) rekado: very tall snow person. civodul: well i need: (apply vc-append (map (cut circle <> #:border-color "red") (iota 10))) civodul: because i have a black background :-) rekado: you could also use colorize: (apply vc-append (map (compose (cut colorize <> "red") circle) (iota 10))) civodul: neat civodul: FP and layout go together really well rekado: geiser image support is a dirty hack: geiser supports #, so in the record-type-printer I first save the SVG to a temp file and then print out # rekado: but it works. civodul: yeah, that's ok :-) OrangeShark: Not as cold as I thought it would be in boston miqlas: Hi Guys! miqlas: I'm on my way to get Guile working on Haiku. It is already compiled, but some test failing. Lemme grab the test output miqlas: Here is my recipe with al lthe dependencies listed and my patchset: https://github.com/haikuports/haikuports/pull/2367/files miqlas: Any help would be really appreciated. spk121: miqlas: porting Guile is not easy. I made it work 99.9% on Cygwin but I gave up on the last 0.1% miqlas: Here is the test output: http://chunk.io/miqlas/9723f3dd18c24d58868e7cc8622e62ee miqlas: have to say, we have an really new boemgc port, maybe there lurking also some problems... miqlas: spk121: still would be great to have it, as libfive requires Guile spk121: miqlas: the out of memory error is not very portable. For some OS's we just disable. miqlas: Hmmm.. I'm not sure where or what triggering it, have to examine a bit better spk121: miqlas: actually test causes out of memory errors on purpose to see if it can recover from them gracefully spk121: it relies on having a working 'setrlimits' procedure, which many OS's don't: hurd, darwin, cygwin, for example spk121: I'd just skip it for now miqlas: lemme check if we got 'setrlimits' or not miqlas: spk121: i got only setrlimit, but no setrlimits spk121: Sorry, i meant setrlimit miqlas: yep, config.h tells: #define HAVE_SETRLIMIT 1 miqlas: and the symbol is in our libroot (hyper-super-mega-lib with things like threading and stuff) miqlas: if something in libroot, then it is OS provided. miqlas: but if we got setrlimit, then the out of memory should not happen, right? miqlas: libffi test also broken. I checked, we got the current ffi port, and it is used on myy system. miqlas: other failed test is the posix regex: i'm not sure about it. We are more-or-less posix compilant. spk121: No, the out of memory stuff is happening on purpose. But the test should recover more gracefully. miqlas: spk121: more examination required then, i suppose. spk121: I wouldn't get hung up on it. The test is already disabled for many systems. miqlas: as i told, our bgc port is pretty new, made by one bgc maintainer, so technically it should be ok, but it haven't got enough testing yet, hard to say it is mission-ready. What do you think, could it be the culprint? miqlas: my main problem is: i built guile with ncurses, but if i try to run a helloworld program, it complains : there is no ncurses miqlas: see? http://chunk.io/miqlas/6acf81022acb42d98b0a79f4a39489bc miqlas: btw: i have absolutely no idea about guile, never used it before, so maybe i do something wrong. spk121: Haha. guile-ncurses. Now you have real problems. Its maintainer is an idiot. (lol. It is me) amz3: ^^ miqlas: here is my config.h (after sedding it): http://chunk.io/miqlas/1296bf7dc8db414aa1604191f4dd6aeb miqlas: spk121: can you please forward my message to the guile-ncurses maintainer? He is a great man, and i think he does an exceptionally good job, but somehow (I'm absolutely sure it is because my sillyness) i can't get it work. miqlas: spk121: i have to go now, i'll come back later miqlas: bye guys spk121: bye spk121: I'm out, too. miqlas: re miqlas: spk121: hi miqlas: spk121: any idea, why the ncurses module missing? miqlas: is there anything i can do? I already tried to define readline too in my recipe, and AFAIK readline and ncurses are "synonym" things, one should use one or the other but not booth. spk121: miqlas: I can walk you through it now, if you like. miqlas: i have time, but i got some beers already, so let's try t :) miqlas: *it :) miqlas: 'm prepared. spk121: first, let's see where Guile thinks files should be stored. Try "guile -c '(display %load-path)'" miqlas: (/packages/guile-2.2.3-1/.self/data/guile/2.2 /packages/guile-2.2.3-1/.self/data/guile/site/2.2 /packages/guile-2.2.3-1/.self/data/guile/site /packages/guile-2.2.3-1/.self/data/guile) miqlas: let me translate it for you: spk121: OK. guile-ncurses tries to install itself into the site/2.2 directory. Is there an ncurses subdirectory there, or in any of those places? miqlas: the path : /packages/PACKAGENAME-VERSION/.self/ = / miqlas: sorry, it is /system/ miqlas: so "/packages/guile-2.2.3-1/.self/data" == /system/data miqlas: it is because the package management, do not care about it. miqlas: so everything installed into /packages/guile-2.2.3-1/.self/bin is accesible in /system/bin, which is in the PATH miqlas: lemme check spk121: ok. but I think the question is if ncurses installed itself into the right directory, which would be one inyour %load-path miqlas: in the folder /boot/system/data/guile i have only a subdir called "2.2", but no site miqlas: Oh, i forgot : /boot == / miqlas: spk121: ncurses installed with the devel package. So it is complete. miqlas: It is 6.0.3 miqlas: but i got no sites folder miqlas: here is a list what the 2 package contains: http://chunk.io/miqlas/40e43afe7fa8489bbb70cd4f2deb850b spk121: did you build guile-ncures from source? miqlas: spk121: isnt it in the official guile tarball? spk121: Nah. It is a separate thing. miqlas: i just sed the official tar.gz miqlas: spk121: umm.. do you mean, i have to install extra modules to get an hello world working??? miqlas: if so, then i understand everything. spk121: Nah. I mean, the plain Guile version of hello world is just (display "hello world\\n") and you don't need guile-ncurses to run plain guile. But if you want to do text user interfaces the ncurses way, it is a separate tarball that you have to download and build miqlas: spk121: you know, i went to google with this keywords: "guile hello world" miqlas: found a source code, tried to run it: ERROR miqlas: what should i think in this case? miqlas: ok, now it makes sense, ncurses is a separate module, but as guile searched for it during the configure, i tought it will be automatically recognized and built miqlas: now i see, it is my mistake miqlas: leme test your hello program spk121: haha: google has mislead you. miqlas: YAY! http://chunk.io/miqlas/7ca6aca242e5480b8b209f194e35e0e9 spk121: http://chunk.io/miqlas/7ca6aca242e5480b8b209f194e35e0e9 spk121: victory miqlas: Let me give you my postal address to send me the nobel peace prise. miqlas: It is Karpatenstrasse 3. miqlas: ok, but guile can more than hello. And the tests shows it is broken. miqlas: somewhat miqlas: spk121: thanks for helping to debug this strange bug. :) amz3: \\o/ spk121: no problem. miqlas: amz3: are you from the nobel award team? spk121: it is a bug in Google. I'll call Mark Zukerburg and let him know. miqlas: spk121: and call JLG too, please. amz3: miqlas: yes miqlas: Jean Louis Gassée == owner of Be Inc. miqlas: went down in 2001.. miqlas: spk121: i have to say, you gave extraordinary help to debug this hello world problem. I would give you a star or like now. Thanks. miqlas: now we know, the basic IO is ok. miqlas: I know almost nothing about guile. is it possible to build an executable from a guile source? I mean can i build an elf binary from this guile script somehow? miqlas: guild made a hello.go file from my hello program. miqlas: But i cannot run it. It is an executable? Or smething else? miqlas: file says: ELF 64-bit LSB shared object, no machine, version 1 (embedded), dynamically linked, with debug_info, not stripped miqlas: but i can't run it spk121: miqlas: It won't compile down to elf, yet. That feature should land in 3.2. miqlas: then .go is something like .so? miqlas: and btw, why it is .go? why not .gu? spk121: .go is more like java bytecode. It is an intermediate representation between source and ELF. miqlas: Guile Object? civodul: yes civodul: it's actually ELF miqlas: what else.... miqlas: our runtime loader cannot handle it. so it can be elf, but not runnable. miqlas: at least not on haiku miqlas: so according my google fu, yet the hello world requires (sometimes) external modules. Can you tell me which are the most important modules? I have to port them too to make guile usable on Haiku. miqlas: checked the debian recipes, but it wasn't enough info. miqlas: i already got the little schemer as pdf, i pretty like the pictures but no idea about scheme. Is guile a complete scheme interpreter? miqlas: Sorry, i have abslutely no idea about it. miqlas: It is just a dependecy to one thing what i have to have civodul: miqlas: it's ELF containing Guile bytecode miqlas: btw: hello from the HaikuPorts team. spk121: miqlas: it is pretty complete standalone implementation. GUI stuff, database stuff, games stuff and some web framework stuff isn't included. miqlas: I'm responsible for the mathematical libs, like blas and some strange stuffs like blender, opencv, vim, emacs, r, fortran, and for some libs for haiku miqlas: spk121: what kind of gui toolkit does guile use? miqlas: we got nly Qt. spk121: Well, the GTK2 port is mostly complete, as far as I know. But it has some problems. miqlas: then the gui is irrelevant. miqlas: Haiku got no GTK port. yet. spk121: I'd say our GTK3 story is kind of stalled in pre-alpha. No QT work as far as I know. spk121: And I haven't tried it, but I think SDL works. miqlas: we got an almost complete Qt implementation, hovewer GL is still missing, but no GTK miqlas: we got SDL miqlas: is it also suported trough an external module like ncrses or is it in the main lib? spk121: Cool. I should do paid work now. Good luck! miqlas: we can't py you, sorry :) miqlas: but feel free to contribute ;D spk121: ;) miqlas: Umm, we got kittens, you know? http://chunk.io/miqlas/e0097dfb957241f7865a791c7751b416 miqlas: and it follows yor mouse cursor! miqlas: and you can install it onto your desktop as a replicant OrangeShark: I am at the FSF office now miqlas: OrangeShark, the 's/linux/haikug', thanks miqlas: 's/linux/haiku/g', ofc rekado: dustyweb: thanks for the link to the snowman tutorial. dustyweb: :) dustyweb: rekado: np! dustyweb: it's a bit silly but hopefully fun. rekado: dustyweb: I think doing this with SVG might really work. rekado: when I find some more time I’ll give it a try to write some procedures for that. rekado: needs lotsa match-sxml for things like “colorize”, but it shouldn’t be too hard. rekado: what’s nice is that the Racket REPL can display the images right there. rekado: I guess we could teach geiser in Emacs to render SVG strings as images. dustyweb: rekado: cool :) dustyweb: I hope it works out dijong: what's the best (or any) way to do web scraping with guile? working with horribly formed HTML, so i was looking for something like python's beautifulsoup library maybe? but i'd settle for anything one step above "regex on socket html output" janneke: dijong: the guile-lib package has a pragmatic html parser - https://www.nongnu.org/guile-lib/doc/ref/htmlprag/ rekado: I have a simple picture language based on SVG and it shows up correctly in Geiser. rekado: It’s still very early, but I’m pretty sure this will work out. ArneBab: rekado: nice! spk121: is there a MIME type for scheme code? civodul: spk121: text/x-scheme, though i don't know if it's standard amz3: tx spk121: civodul: thanks amz3: dijong: use the pragmatic parser works well, then you can snarff the html using (ice-9 sxpath) amz3: spk121: I was wondering the same question, I was too afraid to ask ^^' catonano: amz3: so catonano: what am I supposed to do with the # object I got ? I was expecting the "cloned" folder to be populated, but it's empty catonano: amz3: and I try again I get informed that thhe directory already exixsts and it's not empty amz3: It's a long time I did not look at guile-git amz3: IIRC there is a clone procedure to clone a repository amz3: how did you get the thing in the first place? miqlas: So guys i just got guile working on Haiku: http://chunk.io/miqlas/764d949a26e3498caabf01e327d76623 (screenshot) amz3: miqlas: awesome catonano: amz3: I got it with this: (clone "https://gitlab.com/humanitiesNerd/tributi.git" "~/cloned" $5) amz3: catonano: ok then, what are you trying to achieve? catonano: amz3: I'm trying to clone a repository on my disk, in the "cloned" folder amz3: idk amz3: sorry, I am busy, I can't look into that right now amz3: maybe someone else know catonano: amz3: no prob. Maybe someone else :-) catonano: amz3: Ok, I got it catonano: I thought that with "~/cloned" it would have used the "cloned" folder in my home folder catonano: instead catonano: it created a folder named "~" in my "~/blah/blah/" and within it, it created the repo folder rekado: The hardest part of the naive picture language for Guile is, surprisingly, text. rekado: There’s no easy way to determine the width of some text snippet, but I need that in order to allow composition. rekado: not without using an SVG rendering library, that is. catonano: pictre language ? daviid: rekado: yeah, it would probably be easier if you would choose to work with cairo (guile-cairo that is), maybe rekado: catonano: wget https://elephly.net/downies/pict.scm rekado: then start geiser and do (circle 10) rekado: I’m willing to ignore text for now. It’s called picture language after all. rekado: next up is support for “transform” catonano: rekado: georgous ! amz3: too bad, haunt doesn't support keywords rekado: dustyweb: about this workshop you’ve given using Racket’s picture language: do you think we can implement something like this simply with a thin layer around SVG? rekado: for that game I’m working on, I’ve been playing with SVG in Guile, and it’s pretty nice thanks to sxml. rekado: (especially SVG filters) rekado: amz3 davexunit Where can I get the latest version of guile-websocket? I found https://github.com/a-guile-mind/guile-websocket rekado: has there been a release? daviid: rekado: dustyweb where is the presentation link, if any? OrangeShark: amz3: do you mean post tags? amz3: OrangeShark: yes amz3: rekado: here is upstream https://git.dthompson.us/guile-websocket.git OrangeShark: amz3: it does have support for feeds by tags. I imagine something similar can be done to create pages amz3: oh amz3: then I will look into it amz3: tx OrangeShark: https://dthompson.us/manuals/haunt/Atom.html#Atom check out "atom-feeds-by-tag" dustyweb: rekado: I dunno... but here's the workshop stuff dustyweb: https://dustycloud.org/misc/digital-humanities/ dustyweb: https://dustycloud.org/misc/digital-humanities/Snowman.html the snowman tutorial OrangeShark: hey dustyweb, do you know if there is going to be any meet ups for guile or guix? cmaloney: Good morning dustyweb: OrangeShark: at libreplanet? OrangeShark: yup dustyweb: davexunit and I are probably going to hang out but we didn't plan anything official dustyweb: OrangeShark: are you going? dustyweb: moin moin cmaloney OrangeShark: dustyweb: yes, I am going dustyweb: OrangeShark: oh cool... I don't remember if we met IRL before dustyweb: maybe at FOSDEM? OrangeShark: this would be the first time. dustyweb: ah col dustyweb: cool dustyweb: look forward to seeing you there OrangeShark :) OrangeShark: thanks :) I will definitely go to your session on sunday dustyweb: :) dustyweb: davexunit has one too OrangeShark: yup on guix cmaloney: I'll be presenting Scheme, Guile, and Racket at Penguicon this year cmaloney: (Basically the cleaned up version of my MUG talk) amz3: cmaloney: great news cmaloney: THank you OrangeShark: we should have more guile talks at libreplanet amz3: yes davexunit: OrangeShark: I may try to have an informal gathering to discuss/hack on haunt or something OrangeShark: davexunit: oh, I have some changes for haunt that I need to send to you davexunit: cool :) dustyweb: wingo: since we've talked about racket's toplevel, and guile's toplevel dustyweb: you may be interested to see what happens on https://groups.google.com/forum/#!topic/racket-users/CxQ5o_OUQaw civodul: amz3, OrangeShark: in guile-git, we don't have a way to "close" a repository civodul: in C people are supposed to call git_repository_free civodul: but that also destroys the underlying object rekado: spk121: heh, I’m also writing a game in Guile now :) It’s an adaptation of a board game idea. OrangeShark: civodul: we use a finalizer to call git_repository_free, maybe this isn't the best way to close a repository. ArneBab-lunch: Going by the Stackoverflow developer survey, having a video course on Guile would be pretty useful, since half the devs already used one: https://insights.stackoverflow.com/survey/2018/?utm_source=Iterable&utm_medium=email&utm_campaign=dev-survey-2018-promotion#education spk121: rekado: cool OrangeShark: ArneBab: so we need a Guile MOOC? amz3: ^^ Labu: Do you use emacs for with guile ? I have a little issue, the script which mixe shell with guile a recognized by emacs like shell script so I have some problem with syntax highlighting and indentation. Labu: not sure you get first message rekado: Labu: you can switch with M-x scheme-mode. Labu: thx rekado Labu: I ask on #emacs too Labu: works fine thx ArneBab: OrangeShark: yes ArneBab: that would be useful, I think OrangeShark: oh ya, I took a MOOC which this other programming language advertised OrangeShark: ArneBab: http://mooc.pharo.org/ ArneBab: OrangeShark: did it make you try it out? OrangeShark: well I tried it out, but didn't really stick with it. Only used it for the course. miqlas: hi Guys. miqlas: Trying to build Guile 2.2.3 on Haiku, but i met with this error: http://chunk.io/miqlas/315660c77aaf4618a2c1f29f95ee95b6 miqlas: Have somebody idea, what's wrong here? amz3: c'est quoi l'état de l'art dans les blog statiques? amz3: :trollface: amz3: wrong chan :/ spk121: ArneBab: nice mwette: ArneBab: no -- I may be wrong. I have done this sort of thing in C many years ago, but not looking easy in guile. And the documentation is not clear on all items. ArneBab: it looks really easy but I don’t understand the bug — I don’t understand where it comes from and why it should even be possible ArneBab: but I firstoff need to go to bed now ArneBab: cu -- and happy hacking! mwette: sleep well Apteryx: how can I refer to another Guile module which is in the same directory? Apteryx: Without having the strict define-modules and load-path set right? spk121: Apteryx: you can include the file using (include ...). It is not a reference, but, more like #include <> in c Apteryx: spk121: I need to use the absolute path in this case? spk121: I think if file 1 includes file 2, it searches for it in file 1's directory Apteryx: cool! spk121: But I'm going from memory. I could be wrong. Apteryx: works! I've used load though :) Apteryx: thanks rekado_: I’ve hit some odd errors when modules mutually use record accessors from one another. rekado_: the error messages are not very helpful, for example: In procedure module-lookup: Unbound variable: rekado_: there is no use of “” anywhere; it’s a record name. I do use one of its accessors on an instance of that record, though. rekado_: Another variants of this error: “ERROR: Wrong type to apply: #” rekado_: “player-name” is an accessor for the record type. daviid: rekado_: I would try to reproduce on a tiny example, 2 modules, 2 records, each having 1 accessor, import both ... and paste rekado_: I already found the module(s) that I may not import, but this error and its message are disappointing. amz3: o/ OrangeShark: hi amz3 daviid: rekado_: what do you mean you may not import? rekado_: daviid: I mean: when I add a use-modules clause for that module the error appears. When I don’t import it, there is no such error. rekado_: There’s nothing wrong with the module itself; I suspect it’s because of mutually recursive dependencies. daviid: rekado_: afaict guile handles mutually recursive module dependencies, at least in the past I did have that 'situation'. I asked because maybe it is so that you have diff modules with diff record names (as expected if you export), but then same accessor names ... just curious rekado_: no, the accessor names are all prefixed with the name of the records. rekado_: I’ll continue to play with this later; maybe there’s a smaller test case I could present. daviid: rekado_: but you have accessors bearing the same names in the first place right? it would be interesting to post a tiny but complete self reproducible example yes: then maintainers could debug it ... I'm personnally asking, not that I will be able to debug and patch, but because I would be interested to reproduce 'your case' using goops ... spk121: Heya. I'm writing an terrible interactive fiction game in Guile, and the process is making me very happy. manumanumanu: so, I want to do the following: I have written a complete binding for libsodium 1.0.14, and I want to future-proof the library. If the library I find on the system is 1.0.15, I want to provide all the bindings from 1.0.14, and some additional ones. How would I best do that? Some sort of cond-expand trickery or using version numbers of libraries (and how would that work? Docs are sparse) daviid: manumanumanu: is your project autool chained? manumanumanu: daviid: preferrably I want it to be a directory you just copy to the site-dir or wherever you want to have it daviid: because that is where you would implement such diff daviid: your answer means that the user does not run any check then? he/she copy, but there is no garantee libsodium is installed ... manumanumanu: then it of course fails spectacularly, but yes: it should be a self-contained module that I can just copy without any configure, make and make-install thingies daviid: manumanumanu: if your are serious about your binding, I would autotool chain, but you can surely play games, like use (system "pkg-config --modversion libsodium"), grab the result and include or not a file if ... davexunit: +1 for autotools manumanumanu: the coolest thing would be if the person could du (use-modules (libsodium hashing (1 0 15))) and it exports everything from 1 0 14 plus any additions of 1.0.15 davexunit: I'd find that odd davexunit: no other guile bindings work that way daviid: but that 'tricky approach' will fail, one day or another, to 'fullfill the bill', imo davexunit: a cond-expand equivalent that worked on the version of the library detected by a configure script would be sufficient, I think daviid: manumanumanu: yeah, you should autotool chain, really worth it davexunit: though I've made many library bindings and have not needed such things daviid: manumanumanu: agree with davexunit here, we don't do that, rather we bind a lib version, then another version means a new release, users grab the release they need, but the latest binds a specific lib version ... and this copy will lead to problem, no doubt in the long run, like hw to uninstall, install a new version ... you are ready for hell path :) daviid: manumanumanu: that is exactly why autotool exists, so why not using it? davexunit: if I wanted to gracefully handle a function that may or may not exist, the 2 options would be 1) don't compile it at all (macro) or 2) catch the exception from the ffi when you try to bind it and use a stub procedure instead (runtime) daviid: manumanumanu: with autotool you will have good support fr doc build, test suite ... distro can rely on your work ... manumanumanu: where would I go to learn this magic autotool? manumanumanu: ah. found it daviid: manumanumanu: grab a simple projects of one of us, then read a tutorial ... I can paste a link if you wish davexunit: manumanumanu: I would recommend grabbing the configure.ac and Makefile.am files out of another Guile project davexunit: and then you have a good base to work from daviid: someone wrote a template somewhere, davexunit do you remember? daviid: I think it is OrangeShark , but i might be wrong davexunit: oh yeah! davexunit: manumanumanu: https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html daviid: right, thanks davexunit davexunit: this should be really helpful manumanumanu: Thanks. daviid: manumanumanu: the above template is a very good start, it lacks a doc and a test suite example, which you can complete your project with later on, looking at one example ... davexunit's projects use srfi-64 for tests, I use guile-lib test suite, for info amz3: much wikipedia readings nowdays amz3: also I discovered there is a thing called "fiber logic" in math amz3: which afaicu aims at making two logic model work together mwette: amz3: hmmm ... not finding references to fiber logic in mathematics; I have heard about that in nonlinear geometry, and see it references wrt set theory amz3: Ok, I was misreading the word from the beginning, it's fibring logic, not fiber logic amz3: https://global.oup.com/academic/product/fibring-logics-9780198503811?cc=fr&lang=en&# amz3: :/ mwette: amz3: thanks --- also found http://sqig.math.ist.utl.pt/pub/SernadasC/05-CSS-fiblog27.pdf amz3: I read that article amz3: I mostly interested in the subject from the point of view of the knowledge representation as explained in the introduction amz3: the article is after the introduction rather light on the applications of the fibring logic, i think mwette: /quit clavero: Hello clavero: Why commands like `filter` have documentation when typing `,d filter` but `lambda`, for example, just returns `#f`? chrislck: perhaps because no one really uses ,d as documentation; we usually refer to the pdf clavero: Oh, ok clavero: Thanks mwette: clavero: lambdas can have documentation. mwette: clavero: ,d (lambda () "hello" 1) clavero: No, my question was why the lambda keyword doesn't have documentation clavero: Or cons, car, cdr, first ... mwette: Ah, OK. mwette: I'm not sure syntax can have doc strings. chrislck: I learned from SICP HTDP TLS and never saw ,d until just now :-P clavero: I guess I'm used to it from other languages chrislck: there's lots to unlearn from other languages :-) clavero: I don't know, I find useful to just ,d everything when I'm in doubt instead of juggling with pdf's clavero: Also, that's not a Scheme thing per se, is more of an implementation thing chrislck: personally i found more useful to install racket, and use the bookmarked local html racket documentation clavero: That's a good one, I'll definitely try mwette: I usually keep a PDF version of the guile ref manual open. chrislck: installing racket will install a local copy of https://docs.racket-lang.org/ - it's really good ArneBab: sneek: later tell clavero: I think that’s an implementation artifact, which would be nice to have different sneek: Okay. ArneBab: sneek: later tell clavero: I typically have the guile ref info manual open, and that actually works sneek: Will do. dadinn: hi all dadinn: looking through the guile manual, trying to replace some bash scripts with guile, but I can't find manuals how to use posix pipes dadinn: answers like this are insufficient https://stackoverflow.com/questions/18436981/how-do-i-create-a-pipe-between-two-processes-in-guile dustyweb: hm dadinn: is there a macro where I can write lines of shell commands in sequence, and they will be piped to each other like if I put | inbetween them? dustyweb: I guess there isn't an sxml tool that in writing sxml can "compact" uris to compact namespaced uris dadinn: I would expect system* to do that, but it seems it does something else dadinn: or is this something which is not recommended? spk121: dadinn: it should be easy enough. Lemme think..... spk121: it is probably open-input-pipe you need spk121: but I don't have a proper example dadinn: spk121: looked into the ice-9 popen module but couldn't figure out how to translate the pipe commands to POSIX pipes... a pipe should be a channel to which you can both put and take, so this input/output-pipe analogy feels weird to me, a pipe should be both dadinn: one man's output is another's input :P dadinn: someone's piss is another's drink... dadinn: human centipede but for processes, might be a sequel for Tron dadinn: sorry, drank too much coffee... spk121: Yeah, I don't know to much about this, but, here's a thing. spk121: https://paste.gnome.org/prby4jsg2 dadinn: spk121: hmm, interesting ArneBab: sneek: botsnack sneek: :) ArneBab: spk121: it looks like you could use reduce to "map" this onto a list of program calls to have them piped together ArneBab: s/reduce/fold/ ArneBab: s/reduce/fold/ ArneBab: I have a funny issue with folding over piped processes: Sometimes this stops early. https://paste.pound-python.org/show/K3Tvasz2iAH4wJu76rUL/ ArneBab: it should always be equivalent to echo 1 | echo 2 | echo 3 | echo 4 ArneBab: but sometimes it only does echo 1 | echo 2 ArneBab: without change to the code rekado: “assoc-set!” doesn’t seem to work for me. It says that it is expecting a mutable pair. rekado: Are alists not mutable by default? rekado: The address-list example in “6.6.20.2 Adding or Setting Alist Entries” results in the same error. ArneBab: dadinn, spk121: my paste is a take on making a pipe command: https://paste.pound-python.org/show/K3Tvasz2iAH4wJu76rUL/ mwette: rekado: make sure your alist is mutable: (assoc-set! '(("a" . 1) ("b" . 2)) "a" -1) will not work; the example in 6.6.20.2 is broken I think mwette: rekado: replace '( with (list and maybe it works mwette: (define capitals (list (cons "New York" "Albany") ...)) mwette: probably need to use cons also or wrap a copy-tree around the whole thing mwette: (define capitals (copy-tree '(("New York" . "Albany") ...))) rekado: mwette: thanks. I’ll just use acons instead. mwette: ArneBab: I think you may want to use redirect-port. Checking ... ArneBab: mwette: did you already find a reason? (the port is always only used once for input and once for output) ArneBab: is seek gone? ArneBab: sneek ArneBab: for spk121: you can eval wisp-scheme-read-file, i.e. (primitive-eval (cons 'begin (wisp-scheme-read-file "examples/enter-three-witches.w"))) ArneBab: (import (language wisp)) ArneBab: ^ needs this beforehand rekado: I’m playing with goops and I wonder how I can ensure that a class instance only accepts certain values for its slots. rekado: The acceptable values are defined as an enumeration rekado: I tried adding a “setter” method, but whenever I invoke the enumeration predicate I cannot load the file. rekado: (the error message is unreadable macro expansion gibberish) rekado: (define-method ((setter diet) (instance ) new-val) rekado: (slot-set! instance 'diet ( new-val))) rekado: it looks like ( new-val) is evaluated at definition time, but I really want it to use the *value* of “new-val” instead of taking “new-val” to be a symbol that should be checked with the predicate. rekado: The problem is that it’s a “predicate macro”, not a regular function predicate. rekado: I now use “make-enumeration” and “enum-set-member?” directly. Labu: Hello Labu: I'am on NetBSD and I have some issue with procedure as described in guide to run a guile script https://www.gnu.org/software/guile/manual/html_node/The-Meta-Switch.html#The-Meta-Switch Labu: in NetBSD guile is in /usr/pkg/bin Labu: I could use /usr/bin/env guile but I get an error: "env: guile -e main -s No such file or directory" Labu: Do you know a workaround ? janneke: Labu: i think the manual in unfortunate in this respect janneke: you need to use the second insert/example with janneke: ... /guile \\ janneke: -e main -s ArneBab: Labu: you can use shell indirection: http://www.draketo.de/proj/py2guile/#sec-2-2-3-2-1 ArneBab: Labu: essentially write a shell script which calls ArneBab: exec guile -e main -s "$0" "$@" Labu: Hi ArneBab janneke ArneBab: Labu: the reason for your problem is that unix treats everything after the first space in the hashbang as one argument, and env cannot find guile -s ... ArneBab: bbl Labu: janneke: I tried this too Labu: ArneBab: thx I try this Labu: it works thx ArneBab: Labu: glad to :-) — it’s one of the really cool tricks with Guile. It works because #! starts an inline comment, and !# ends it. ArneBab: that merges hashbang and scheme into something which is bigger than its parts. ArneBab: I just found the example in the official documentation: https://www.gnu.org/software/guile/manual/html_node/Scripting-Examples.html#Scripting-Examples -- the last example Labu: indeed ArneBab, I was just reading it when you answer me spk121: hi spk121: ArneBab: thanks ArneBab: spk121: you still saw it? nice! spk121: yeah. checked the log this morning mwette: hi all; been working to learn glib dbus -- back later amz3: heya guilers spk121: ArneBab: is there some way to have a function like (load-file-as-wisp "filename.wisp") in a scheme script? amz3: o/ manumanumanu: Guten heute alle leute! How are we doing today? wingo: ACTION ported fibers to lua, woo civodul: woow :-) manumanumanu: now we only need to make guile-lua-rebirth run it! civodul: heheh, that'd be fun :-) manumanumanu: wingo: how did you do it? Curoutines i suspect? wingo: yeah coroutines wingo: https://github.com/snabbco/snabb/pull/1292 wingo: a WIP... civodul: so you started working directly with coroutines and then felt that this wasn't as nice as CSP? :-) wingo: coroutines are insufficient :) you need a scheduler, channels, synchronization, etc wingo: coroutines are a building block like delimited continuations civodul: yeah i know, but i assume Lua users typically use them "directly" no? manumanumanu: I suspect however that coroutines, although not as general as delimited continuations, is faster. manumanumanu: continuation-based generators have quite a bit of overhead, no? manumanumanu: oh... you even wrote a blog about it :D :D manumanumanu: haha. wingo: civodul: dunno :) the snabb use case is a bit special; up to now we haven't used them at all wingo: but i was porting a tcp implementation and it turned out that you really want tcp endpoints to be implemented as fibers or processes or whatever and not state machines, so it seemed like a natural thing to port fibers over; seems to work but i haven't done any benchmarking yet civodul: interesting amz3: o/ manumanumanu: ahoy hoy manumanumanu: so... about module versions... I am writing a pretty darn complete binding for libsodium, and I was wondering if I could use module versions to keep up with new specs. manumanumanu: I am currently pretty much feature complete for libsodium-1.0.16 manumanumanu: but when libsodium-1.0.17 adds a feature, can I support both with the same codebase in any way? manumanumanu: you have got to be kidding. libsodium has a crypto_box function utilizing xchacha20poly1305, but it isn't effin documented. manumanumanu: jesus christ that was a waste of time on my behalf. manumanumanu: sad day. spk121: does anyone have a Guile solution to convert audio files to PCM bytevectors daviid: spk121: I don't know, but if something ever existed, it might be listed here http://sph.mn/c/view/g2 spk121: daviid: cool library page daviid: spk121: yes, it's not mine, it's tantalum (that his/her name) spk121: berndj: you could turn off buffering on the ports complete, so you don't have to flush them. berndj: spk121, yeah, but that seems even more icky :-/ berndj: the problem goes away (apparently entirely) if i explicitly call scm_fluch_all_ports, i'm just surprised at the apparent necessity of doing so berndj: i find it really puzzling - i can think of no explanation more than "magic stuff happens". another atexit() handler still runs, so it isn't a total weird-out by the process berndj: is it possible that the program state during exit(3) is not compatible with the GC working correctly? spk121: as far as I know, there are many uncollected garbage objects at the end of execution. Guile doesn't promise to call the GC on everything at close. berndj: it's not that i want the GC to run, it's that the GC doing some stuff and the program flushing its output seem to be mutually exclusive berndj: both seem to happen inside an atexit handler spk121: oh, ok. berndj: and it did look to me like flush-all-ports would cons up some stuff, thereby triggering some GC stuff to happen daviid: I found and fixed the bug in gnu foliot, using guile-2.2, that was raising exceptions on certain entry callback amz3: héllo all amz3: spk121: interesting project, what's the plan? spk121: virtually all html links to SSAX tutorials are dead links spk121: amz3: it was an attempt at writing a simple 2D sprite game engine. spk121: the console is the debug console for the game daviid: I finally invested some time to make foliot compatible with guile-2.2, and just launched it using 2.2.3 now daviid: hum, some callback raised exceptions, that not very good news manumanumanu: who wrote sneek? bavier`: any way to fix an "encoding-error: cannot convert narrow string to output locale"? civodul: that means that you have an ISO-8859-1 string that cannot be represented in the output locale civodul: say you have "café" and you're running in the C locale, where "é" cannot be represented bavier`: I've set LANG=C before starting guile bavier`: so I suppose I maybe need to not do that? civodul: yes civodul: or you need to deal only with ASCII stuff civodul: or you can change the encoding of the relevant port(s) redjackson: Hello redjackson: Is there a standard way of substituting a element in a list? redjackson: Something like list-set but without mutation spk121: Making an old project run again. Here is Guile running in a GTK app that draws its own console using a bitmap font. http://lonelycactus.com/pics/burroconsole.png berndj: explicitly calling scm_flush_all_ports() before exit() seems icky. anyone want to convince me why i should accept it as ok? berndj: context: if i don't, a program produces no output once every few hundred runs. what seems to happen is that during all the atexit unwinding, in that once-in-100-runs scenario, some GC stuff runs (program reads /proc/self/statm), and then fails to flush the output FrankyCyborg: has someone experience with gnutls+guile and can identify, what goes wrong at the end of the compilation? is a script somewhere just missing the ".la" file suffix? log and info: https://hastebin.com/eraxizasez.bash i'm using the MacPorts package manager on Mac OSX 10.6.8 and try to build against guile 2.2.2 - the shell commands macports uses to build the software start with a "Executing:" mwette: FrankyCyborg: I have used macports w/ gnutls and guile. I think there is a bug in gnutls. Try this: install gnutls w/o +guile. Then reinstall w/ +guile. The issue, if I remember correctly, is that the gnutls build does not look in one of the build directories to link. mwette: "to link" means "for shared objects" FrankyCyborg: ah ok, I could try that, as the maintainer in the macports channel said, he usually doesn't build it with gnutls support, so I am doing that right now.. I can try your hint right after that! FrankyCyborg: mwette: ok, second pass is through and indeed, it's building and installing without any error. now it's time to check, why this is happening... but thanks a lot for this hint! don't know if I would have tried that. mwette: I belive, where guile support is built in gnutls/guile, the build does not look in gnutls/lib or something like that. I don't have the source handy mwette: gotta go -- good luck galex-713_: amz3: oh in fact yes chrislck: amz3 thank you, as it turns out, i think it's out of scope; vector cannot be converted to json in guile-json galex-713_: chrislck: yet… guile already implements javascript right? with all these datatypes implemented? so isn’t there a way to share these datatypes among languages? lloda: sneek: later tell daviid I got g-wrap to install by defining GUILE_CFLAGS and _LIBS by hand. When I tried your patch without those exports, g-wrap autogen.sh still failed to find Guile lloda: hmm lloda: anyway if someone has a solution for guile-gnome, please let me know lloda: guile-snarf -DHAVE_CONFIG_H -I. -I. -Wall -pthread -I/home/user/sys/guile4/include/guile/2.2 -std=gnu99 @GUILE_CFLAGS@ -I/opt/g-wrap/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include gc.c > gc.x \\ lloda: || { rm gc.x; false; } lloda: gcc: error: GUILE_CFLAGS@: No such file or directory lloda: Makefile:955: recipe for target 'gc.x' failed lloda: so lloda: I think it's ridiculous that you have to tell seven different tools where you've installed something lloda: it should be enough to just define PKG_CONFIG_PATH Guest45684: lloda: wrt to g-wrap, the fact that it did not find guile is because somehow, you have a 'bad' aclocal config. this is such a common 'bug' that that in all projects I have either contributed and/or maintain, not only do I add AC_CONFIG_MACRO_DIR([m4]) in the configure.ac file, but I copy guile.m4 in that m4 subdir as well: this fix the problem, and it will report when the user does not have gule install (instead of raising an obscure Guest45684: exception ...) Guest45684: lloda: in all projets I contributed/maintain, ..., but g-wrap :), I will add it now Guest45684: lloda: this (g-wrap guile.m4 related bug) is now fixed, both on devel and master, whenever you have an opportunity, pull and try again: you shouldn't have to set the flags by hand anymore ... daviid: hum, the above was me, daviid ... daviid: freenode did get my password in time I guess, had to regain ... fixed daviid: lloda: of course you still have to pass (or define and export) CFLAGS=-Wno-error=deprecated-declarations amz3: o/ janneke: o/ chrislck: o/ chrislck: anyone good at guile-json? I'm converting (scm->json '((1 2 3) (2 3 4) (3 4 5))) and it converts to {"1":[2,3], "2":[3,4], "3":[4,5]} -- what's the source format that will convert to [[1,2,3],[2,3,4],[3,4,5]] ??? chrislck: or perhaps the question is meaningless because the list-of-list-of-integers is not JSON galex-713: chrislck: have you tried using arrays? galex-713: like $(1 2 3)? galex-713: or even multidimensional arrays maybe (see doc), could be what you want chrislck: tried, I think this is out of scope, so, dead end for now. or create own tool :-o amz3: chrislck: list are represented as arrays in guile json amz3: chrislck: take some json convert use guile-json to read it and see what you've got amz3: galex-713: an array is written #(1 2 3) amz3: not $(1 2 3) amz3: o/ amz3: héllo stis: hey stis: if a C function returns a long long, or as an argument how do I then use that function with the FFI in guile? stis: 64bit int? manumanumanu: uint64 manumanumanu: no. int64 manumanumanu: long long is guarranteed to be no smaller than a 64 bit int. manumanumanu: stis: int64 is the answer manumanumanu: long long is guaranteed to be at least 64 bit, and most often it is 64 bit dsmith: sneek: botsnack sneek: :) stefano`: Hi! stefano`: if I write something like: (define a (bytevector->pointer (make-bytevector 10))) stefano`: what should I expect to be garbage collected? stefano`: The scheme object bytevector but not the memory? civodul: stefano`: the bytevector remains live as long as 'a' is live stefano`: Ok. Thank you! manumanumanu: stefano`: the problem arises when you do (pointer->bytevector a [...]) and a then gets garbage collected. manumanumanu: civodul: can a pointer keep another object alive? Say if I do (define a (make-bytevector 10)) (define b (bytevector->pointer a)) and I leave a to die, but keep b? civodul: manumanumanu: yes, that's roughly the same as the example above manumanumanu: neat. manumanumanu: thanks civodul: essentially the pointer there's a weak reference from the pointer object to the bytevector berndj: can someone help me understand when a guile program's output gets written(2) out? from my printf debugging + strace it looks like the output leaks out during exit(3) berndj: problem is: one in every few hundred runs, there is no output lloda: berndj: are you flushing? (force-output port) or ~! with format berndj: i'm almost certain this program isn't flushing berndj: lloda, i'm mostly curious why the program's intended output goes missing only *sometimes* berndj: and apparently never when i use setarch(8) to disable ASLR. also never when i run the program under valgrind berndj: well calling scm_flush_all_ports() before exit seems to make it work. 3000+ runs now and no failures. still curious about mechanism Sleep_Walker: is anywhere reported problem with guile-2.2.3 i18n tests when built against recent glibc? Sleep_Walker: wingo: could you please confirm that license of guile-charting is LGPL-2.1+? (I checked guix, but commit was added by Ludo) why you also put GPL-3.0 license there? OrangeShark: Sleep_Walker: it is recommended to include the GPL file even if you distribute it as LGPL as the LGPL just adds ontop of it Sleep_Walker: OrangeShark: thanks for explanation OrangeShark: it should be stated in the README usually Sleep_Walker: there is: Sleep_Walker: Distribution of Guile-Charting is under the LGPL. See the COPYING file for Sleep_Walker: more information. Sleep_Walker: COPYING contains GPL-3.0, COPYING.LESSER contains LGPL-2.1 OrangeShark: should probably say see COPYING.LESSER OrangeShark: the repo has LGPL-3.0 galex-713: Hi galex-713: At a time I recall having an info document with r5rs in it galex-713: since then I reinstalled debian, and I don’t have it anymore, would anyone know from which documentation it could come from? or in which package it would be? galex-713: also srfi ou r7rs would be appreciated galex-713: *or lloda: sneek: later tell daviid Thx, I kept getting an error in GUILE_PKG([2.2 2.0]), so I replaced that by GUILE_PKG, then it complained that Guile wasn't found anyway, so I had to define GUILE_CFLAGS and GUILE_LIBS by hand, then I got the deprecated-declaration errors and I used your flag, then it worked sneek: Got it. lloda: I don't get why it isn't enough with pkg-config, you always have to fix these little things lloda: it seems every Guile package uses a different version of the autoconf Guile macros :-| lloda: like why do they need guile-config if pkg-config already gives them the flags?? lloda: now guile-gnome fails with an unreplaced @GUILE_CFLAGS@ even though the logs say guile was found etc. lloda: like seriously lloda: sorry, rant over lloda: sneek: later tell daviid my guile-cairo patches are with the bug reports in https://bugs.freedesktop.org/buglist.cgi?quicksearch=guile-cairo - they are very obvious bugs - I've poked at wingo here and there without reply sneek: Will do. amz3: galex-713: hi, nice to see you, I don't know about the info files but you can find pdf of r6rs on the internet manumanumanu: Ahoy hoy! 12 days of fever later I am back! manumanumanu: wow. the guile optimizer actually makes simple matching code from ice-9 match pretty much optimal... MaliRemorker: i know i might be boring with these questions, but .. is anyone using guild for anything sensible these days? such as creating function reference of your code? sneek: MaliRemorker, you have 1 message. sneek: MaliRemorker, lloda says: (library (gimp) (export fun) (import (rnrs)) (define (fun x) x)) works, apparently you can't skip the import form (haven't used r6rs much myself) MaliRemorker: sneek: thanks! MaliRemorker: sneek: i find library syntax more elegant and readable, but i know define-module is more powerful MaliRemorker: oh MaliRemorker: that was supposed to be lloda dimpase: we're having trouble using GNU Make built with libGuile plugin. As we hack libgc, hell breaks loose and make doesn't start. dimpase: https://trac.sagemath.org/ticket/24575 dimpase: libGuile bug, or libGuile feature? dimpase: GNU Make people say it's not them... Does libGuile have a feature to be built in a way that makes it immune to stuff in LD_LIBRARY_PATH? galex-713: amz3: hi :) it’s been a while, nice to see you for me too :) amz3: OrangeShark: did you post your idea? nalaginrut: morning guilers (I'm going to bed now) nalaginrut: zzzZZZ... guile-guest3: Hi all. I'd like to learn understand how to use the networking api described in this section of the manual: https://www.gnu.org/software/guile/manual/html_node/Networking.html#Networking I've been reading through the documentation but have found my progress to be pretty slow. Does anyone have any recommended resources to learn this stuff? Guile specific tutorials would be great, but also resources to learn about sockets in gener guile-guest3: In the end I'd like to be able to use the fibers module together with the network sockets rcm: Hi all, when I run "guile" in the terminal, I get the following error: rcm: guile: warning: failed to install locale Backtrace: 12 (apply-smob/1 #) In ice-9/boot-9.scm: 705:2 11 (call-with-prompt ("prompt") # ?) In ice-9/eval.scm: 619:8 10 (_ #(#(#))) In unknown file: 9 (primitive-load "/home/reed/.guile") In ice-9/eval.scm: 721:20 8 (primitive-eval (use-modules (ice-9 readline))) In ice-9/psyntax.sc rcm: I accidentally left my lap top on last night and the battery died, so perhaps it didn't clean something up correctly. could this be caused by that? rcm: I'm on guixsd if that is relevant. rcm: my ".guile" file (which I didn't know I had) has (use-modules (ice-9 readline)) in it. Which seems to be related to the error that I'm getting. Is this part of the default .guile file? Labu: Hello daviid: rcm: no, the default .guile file is empty sneek: Welcome back daviid, you have 2 messages. sneek: daviid, lloda says: Thx, I kept getting an error in GUILE_PKG([2.2 2.0]), so I replaced that by GUILE_PKG, then it complained that Guile wasn't found anyway, so I had to define GUILE_CFLAGS and GUILE_LIBS by hand, then I got the deprecated-declaration errors and I used your flag, then it worked sneek: daviid, lloda says: my guile-cairo patches are with the bug reports in https://bugs.freedesktop.org/buglist.cgi?quicksearch=guile-cairo - they are very obvious bugs - I've poked at wingo here and there without reply rcm: If I "mv .guile .guile-cpy" I can run guile with no errors, but it still concerns me because I have never edited this file manually. i'm not sure if it was put there for a reason. rcm: Also, everything was working fine yesterday I believe. Labu: I have a module I would like to test with srfi-64. I have my tests in a separate file. Some functions must not be exported and stay private in the module. So I use load function. However I get warning when I run tests for the first time. Is there a way to avoid this warning ? Labu: the warnings are about possibly unbound variable. I can use-modules but some function are not exported rcm: I have a feeling that geiser created the .guile file; now when I run geiser without the .guile file there I getguile: warning: failed to install locale warning: failed to install locale: Invalid argument rcm: but then geiser runs fine after that civodul: rcm: perhaps you need to install the 'guile-readline' package? civodul: (ice-9 readline) is no longer part of the 'guile' package in Guix rcm: I will try that. Is that a recent thing? My guile was working fine until today rcm: after installing guile-readline I can run guile with the .guile file and it will start without complaining too much. It still says "guile: warning: failed to install locale; warning: failed to install locale: invalid argument" rcm: (I've added a semicolon where there is a new line) civodul: i suspect https://www.gnu.org/software/guix/manual/html_node/Locales.html#Locale-Data-Compatibility-Considerations will help civodul: probably you reconfigured GuixSD today from glibc 2.25 to 2.26? rcm: I did notice this error while "sudo guix pull" was running rcm: If I run "echo $GUIX_LOCPATH" I get /run/current-system/locale and then if I "ls /run/current-system/locale" there is only a 2.25 directory civodul: right, and presumably "guix gc -R $(type -P guile) | grep glibc" shows 2.26 rcm: That is correct. I'm not quite sure what the second is demonstrating. Is that a conflict? Should there be a 2.26 directory? rcm: Does this mean I should add a line (locale-libcs (list glibc-2.2X (canonical-package glibc))) in the operating-system declaration of my .config file? Should X=6 or X=5? civodul: with X=5, yes civodul: or just 'guix system reconfigure' with current master so that the rest of the system is at 2.26 as well civodul: basically if you upgrade everything to current master, that's ok, you don't need 'locale-libcs' rcm: Ahh, I'll try that first rcm: I'm still not sure when/how often i should be doing the system maintinence things. Like should I do "guix pull" followed by "guix package -u" followed by "sudo guix pull" followed by "sudo guix package -u" followed by "sudo guix system reconfigure" on a regular basis? or a different order? civodul: rcm: well i don't do "sudo guix package -u" because root's profile is typically empty on my systems civodul: but otherwise it's a good thing to upgrade "regularly" if you want to be safe civodul: BTW we could even have this discussion on #guix :-) berndj: are recent libguile's a little bit valgrind-cleaner? i'm trying to debug a heissenbug and libguile spews TONS of memory errors (2.0.11) civodul: berndj: you could generate a suppression file i guess daviid: berndj: you are a cuple of years behind, I would update to the latest stable before anything else berndj: daviid, i'd like to, but i'm not in the mood for either updating my entire distro, or linking against an ad hoc library version, also this heissenbug may drive me to the latter in desperation berndj: if more recent libguiles are no less valgrind-clean then upgrading wouldn't offer that particular benefit anyway civodul: i would try "valgrind --gen-suppressions=all guile -c 1" berndj: at what point does libguile output a programs (display ...) calls? berndj: because i have the output appearing after the scm_c_catch completes spk121: exit drmeister: Hi - does guile have a DWARF interpreter built into it for debugging? lloda: daviid: haven't managed to build g-wrap yet. Can't say I've looked into it much, I just tried it once, it failed, I gave up. MaliRemorker: is the support for R6RS libraries broken in guile? MaliRemorker: i'm trying to evaluate (library (gimp) (export fun) (define (fun x) x)) MaliRemorker: but this is not accepted by the interpreter MaliRemorker: i'm just looking at the code for the `library' macro in r6rs-libraries.scm. Whoever wrote that should get the Oscar for opaqueness. Syntax-case macros at their best! :D lloda: sneek: later tell MaliRemorker (library (gimp) (export fun) (import (rnrs)) (define (fun x) x)) works, apparently you can't skip the import form (haven't used r6rs much myself) sneek: Got it. OrangeShark: hello amz3, I saw your video on neon. Looks really cool. amz3: tx :) amz3: OrangeShark: the issue is that I have no long term plan amz3: OrangeShark: I could build a blog application on top of versioned database, but at the end of the day it looks overkill OrangeShark: amz3: is it because you need to find a useful application for it? amz3: OrangeShark: yes amz3: I need to find another use case amz3: I was thinking about a gitlab -like application for knowledge bases, but I have a difficult time to figure the ui OrangeShark: a sort of versioned knowledge base? amz3: yes amz3: like instead of code you have some kind of data .csv or something else amz3: like github or gitlab those are the same ideas amz3: I could show the data in tabular format or in a graph-like format that the two data viz i know about databases amz3: but graph is difficult amz3: let's go shopping! OrangeShark: visualizations can be pretty difficult OrangeShark: There is some ideas I wanted to pursue that might work with neon. I will post it later on the mailing list when I get the chance to. amz3: oh daviid: lloda: you need to pass CFLAGS=-Wno-error=deprecated-declarations daviid: from the source, you'd do ./autogen.sh [--prefix=...] CFLAGS=-Wno-error=deprecated-declarations; make; make check daviid: if you use the tarball, ./configure [--prefix=...] CFLAGS=-Wno-error=deprecated-declarations daviid: lloda: that should solve your problem, let me know ... daviid: lloda: then if you have guile-cairo, which I beleive yu do, you can build guile-gnome [and guile-clutter, which is fun to use ...] daviid: lloda: wrt guile-cairo, where is your code hosted? spk121: So, I've been thinking a bit about a minimal GUI toolkit. spk121: I think it would be simple enough to bind Guile to GtkWebkit. spk121: And then express a scheme API for webkit and DOM. spk121: So you could have a local desktop application via HTML widgets. spk121: Without having to finish gobject for guile or bind all of GTK3 civodul: spk121: there have been experiments in that direction civodul: like the Kawa person wrote a terminal emulator like this civodul: Hop also pretty much started around that idea civodul: somehow i remain skeptical about the idea of using "the browser" for everything spk121: civodul: Yeah. I'm not a huge fan of HTML DOM. But as the kids say, it would be a "minimum viable product" civodul: heh :-) spk121: 7ik654r76yer amz3: o/ civodul: hello! jeko: Hello guilers jeko: ! civodul: hello jeko! jeko: Happy hacking :) jeko: I would like to ask a question. I am writing todo list manager in guile jeko: tasks are stored in a file jeko: What is the right way to modify my tasks ? (set task as done for example) jeko: is it better to edit the file anytime I modify a task ? jeko: Or is it better to load the file in ram ? jeko: I mean, is there some practice "forbidden" here ? hugo: jeko: Is there any reason you don't have a "proper" database? jeko: hugo: I just thought it could be fun to have it that way in a readable text file and also thought it could be more portable if tomorrow I decide to have a smartphone application that synchronize and share the same todo-list content jeko: and moreover : I am not familiar with database haha hugo: Fair enough. hugo: My recomendation when working with text files: hugo: If it's a one shot application (start, do something, close) save directly hugo: If it's more of a text editor, save when the user requests it jeko: I agree with that, so I'll keep one shoting ;) jeko: hugo: Thank you ! hugo: no problem :) lloda: wingo: I have a couple patches for guile-cairo, they are in the freedesktop bug tracker. I'll push them myself if you give me commit rights amz3: I am trying to setup test coverage for my project amz3: and lcov genhtml output 0% coverage amz3: even the test file appears as not covered alezost: hm, I'm not sure what to use: "string=" or string=?". Is there any difference (if I want to compare 2 strings)? amz3: Here is the program I use to generate the coverage .info https://dpaste.de/K07e amz3: I do '(load "my-test-module.scm")' inside with-code-coverage amz3: just like guile does spk121: Hello Guilers. spk121: I'll be at the Southern California Linux Expo this week. chrislck: amz3: I think you'll need to run the tests within the with-code-coverage lambda https://dpaste.de/fVq3#L16 chrislck: amz3 you're currently coverage testing the (load) only :) chrislck: not much use :) chrislck: well my reply iwll not work but you get th idea amz3: chrislck: I am running the tests within with-code-coverage via 'load' amz3: that's how it's done in guile proper alezost: if anyone knows something about my question ("string=" vs string=?"), please answer, I will read the log, thanks spk121: alezost: string= can take additional parameters to match substrings Labu: Hello ! Labu: Is there a mean to deal with third parties dependencies in guile ? OrangeShark: Labu: do you mean like a C library? OrangeShark: or a library written in Guile? Labu: Hi OrangeShark Labu: library written in guile Labu: I make a lib which needs a library OrangeShark: some people have been using GNU Guix for that Labu: ok Labu: good Labu: I am looking Labu: thx OrangeShark: there isn't a language specific package manager Labu: yes Labu: I thought a thing like gem in ruby or pip in python Labu: but ok no problem Labu: in fact this kind of tools needs a centralized repository, standar ay to install package etc... Labu: I will makesome codes which do the thing Labu: guix is very interesting anyway OrangeShark: there is also Guildhall OrangeShark: https://github.com/guildhall/guildhall Labu: thx OrangeShark Labu: interesting Labu: I think I will create a lib which can install a lib from a public CVS Labu: with a system of recipes perhaps... spk121: Labu: many have tried to make a generic package manager. Guix is winning. Guildhall is functional but never gained popularity. wingo began a package manager based on guix tech, but, never finished it, I think. Labu: spk121: guix seems to be a complete distribution Labu: I don't see I can use it for deploy an app spk121: Labu: yes and no. It can be a distro, or run on a distro. spk121: but if you just want to distribute your own packages for you own app, then do what you like Labu: spk121: ok, but the packages are binaries or lib, like apt or yum do. it seems "system oriented" Labu: yes I will Labu: I thought perhaps there is a standard way to do it (I would not reinvent the wheel) spk121: Labu: yeah, no standard. spk121: In practice, you just need to get your packages copied into the user's /usr/share/guile/site/2.2 directory somehow. Labu: ok it's interesting in certain way. I can do everything I want Labu: yes that's right Labu: I could handle another location for lib too (for user install) Labu: the lib I use in my lib http://git.savannah.nongnu.org/cgit/guile-json.git/tree/README.org Labu: there is a Makefile and we could use autoconf with a prefix to change location spk121: This was my last attempt at doing autoconf on a pure Guile package. https://github.com/spk121/guile-aspell Labu: spk121: you do all of your libs like that ? Or is it just an attempt ? spk121: Labu: this was the only pure Guile module I ever made public spk121: previous versions had some C parts, so you can see some leftover junk Labu: ok Labu: I am not very expert with autoconf Labu: it seems very powerfull Labu: I will try it spk121: autoconf is difficult. No one understands it all. Labu: ok amz3: ^^' Labu: hi amz3 amz3: Labu: I tried myself, to write a package manager ^^' amz3: basically, there is no easy way to handle pure guile packages amz3: guix is the best tho amz3: they will gladly accept your contribution amz3: once you know guile, it's not hard to create a pacakge definition for a pure guile package also they are examples of that in the guix repository amz3: that is a pure guile package that has no autotools amz3: pure guile packages with autotools are trivial to package OrangeShark: mostly cause they follow the GNU Build System Labu: ok amz3 Labu: I saw there is guile-json in repository Labu: that's good amz3: what are you trying to do? if that's not too much curiousity.. Labu: amz3 at now a json serializer/deserailizer Labu: deserializer Labu: it's not easy amz3: there is one floating around amz3: that you might take as inspiration amz3: it's called ice-9 json but it's not included in guile proper Labu: ok I am looking thx amz3 Labu: what is guile version where ice9-json was implemented ? Labu: I am on 2.0.14 currently amz3: it's not in guile yet amz3: https://lists.gnu.org/archive/html/guile-devel/2015-08/msg00003.html Labu: oh ok OrangeShark: there is a couple of json implementations floating around Labu: yes in guix I found two Labu: but I done somethings with guile-json Labu: I want make possible to specify fields with attribute (required, type, name) and validate a json against this specifications Labu: like json-schema do by example Labu: but I want do this specifcation with scheme and not a json Labu: scheme is nice for that because we can oass function to validate a specific field Labu: *pass OrangeShark: Labu: oh, that sounds cool Labu: thx OrangeShark I show you some sample when I have some material serhart: I have guile-gnome installed from git on guile 2.3 and when I load the module (gnome gobject gvalue) I get "In procedure struct-set!: set! denied for field 0" serhart: from a quick investigation I think http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gvalue.scm#n82 is the culprit? serhart: s/guile 2.3/guile 2.2.3 MaliRemorker: is it possible to disable auto compilation from within REPL? MaliRemorker: alternatively, how to tell Geiser to start guile with --no-auto-compile? daviid: serhart: I can't reproduce the problem daviid: scheme@(guile-user)> ,use (gnome-2) daviid: scheme@(guile-user)> ,use (gnome gobject gvalue) daviid: scheme@(guile-user)> daviid: everything id fine here mange: MaliRemorker: It looks like (setq geiser-guile-binary '("guile" "--no-auto-compile")) might do it? MaliRemorker: mange: looks dirty, but you might be right ;) MaliRemorker: mange: yeah, that worked serhart: daviid: interesting serhart: if I do: serhart: ,use (gnome-2) serhart: ,m (gnome gobject gvalue) serhart: it works fine serhart: looks like gnome-2 needs to be run first? serhart: even more interesting is I can't seem to reproduce it anymore... MaliRemorker: ,q MaliRemorker: oh :) chrislck: sneek:botsnack chrislck: sneek: botsnack sneek: :) chrislck: :) guile-guest9: hi all, I'm using guile 2.2 on guixsd and I installed guile-fibers (with guix package --install guile-fibers) but when I open a guile REPL and execute "(use-modules (fibers))" it says "ERROR: no code for module (fibers)" guile-guest9: I'm sure I need to add something to some search path. I'm just not sure what exactly civodul: guile-guest9: if you run "guix package -i guile guile-fibers", it'll tell you what variables to set guile-guest9: civodul: Thank you! civodul: yw! amz3: what's up #guile? amz3: I will do a demo of my project OrangeShark: amz3: a video of it? amz3: OrangeShark: yes, but I need to fix a bug first amz3: no more bugs for the time being, I can restart the record amz3: #win amz3: I am upload the video right now amz3: +ing amz3: :) amz3: wget http://hyperdev.fr/static/gnu-guile-hacking-15.mp4 amz3: o/ janneke: hi amz3 ayys: what are some good resources to understand continuations in general? void_pointer: ayys: that depends on whether you mean really simple usage or more complicated usage void_pointer: ayys: I learned continuations from https://ds26gte.github.io/tyscheme/index-Z-H-15.html#node_chap_13 void_pointer: never had to use them for anything other than very simple usage void_pointer: so I can't speak about resources for advanced usage ayys: thanks! I'll give it a try. I don't really understand continuations, so a basic introduction would sufice void_pointer: I just used them for deep returns/breaks (e.g. like return in many languages and break but more than one loop deep) ayys: would they be useful for implementing python-like generators? void_pointer: possibly ayys: so for example, a list of infinite size? void_pointer: they can be used for many things void_pointer: a common usage is cooperative multi-threading void_pointer: infinite sequences, sometimes called streams, are usually implemented using promises in scheme if I understand it correctly void_pointer: not sure how promises are actually implemented void_pointer: one could probably implement them with continuations void_pointer: so, maybe ayys: ah I see. thanks for the pointers(pun intended). I am simply looking to learn scheme, so i am not focusing on implementations as such void_pointer: but I am a rather beginner scheme programmer and I am rusty since I haven't programmed in it for a bit as I have had other projects (currently have ones in C, Python + C++, and common lisp) void_pointer: ah void_pointer: by the way, I found https://ds26gte.github.io/tyscheme/index-Z-H-1.html#node_toc_start immensely useful for learning scheme void_pointer: the other chapters in addition to the one on continuations void_pointer: after that, some practice, and a few other sources; it is often possible to learn things from reading the scheme standard documents themselves since the language itself is fairly small void_pointer: the R7RS-small document is particularly easy to understand void_pointer: do note, Guile does not yet implement R7RS small, but most of the functions and types are there, just not the library mappings, some functions, and slightly different behavior of some functions void_pointer: Guile implements R5RS and R6RS void_pointer: speaking of which, when learning scheme, pay attention to what version the resources are using since you might have to change a few things depending on the implementation you use. Many resources out there are for R4RS or R5RS in which case you are in good shape in Guile void_pointer: but you need to be careful with recent resources if they are based on R7RS amz3: ayys: my advice would be to no spend too much time in call/cc amz3: it's a useful language construct, but you rarely need it amz3: it's like metaclass in python civodul: scm_i_misc_mutex grmbll amz3: what's the name of the number like 1/2 or 3/4 amz3: in english amz3: rational? amz3: fraction? evhan: amz3: Rational. evhan: (There's a bit more nuance involved, but basically, if you are saying x/y then that makes it rational number.) amz3: tx amz3: postgresql hacker mailling list is so busy manumanumanu: amz3: the worst fever is gone, but I spent 3 days over 40C. amz3: I made some benchmarks amz3: here are the results in seconds: amz3: guile read: 3 amz3: guile cx read: 63 amz3: chez read: 0 amz3: chez cx read: 7 amz3: cpython cx read: 247.4394781589508 amz3: pypy cx read: 22.92888855934143 amz3: there is also memory consumption numbers @ https://github.com/a-guile-mind/benchmarks amz3: cx means combinatorix aka. the parser combinators that is optimized amz3: ^^' amz3: the python version of the program use exceptions, so it might be the explanation of the difference in speed amz3: between pypy and the schemes amz3: Schism – A self-hosting Scheme to WebAssembly compiler amz3: https://news.ycombinator.com/item?id=16488605 amz3: cc wingo manumanumanu: Ahoy hoy! This year's flu is pretty bad hunzelstrunz: I'm thinking about doing something guile/emacs related as part of a future project at my university. I've heard guile now supports emacs lisp completely, wouldn't creating a full guile emacs just consist of creating the needed c primitives and making them available in the guile runtime? hunzelstrunz: Are there any projects under development and does anyone know their status? I regulary searched for guile-emacs in the past but everything i found seemed pretty dead/I couldn't get it to work. hunzelstrunz: Another idea: has anyone thought about implementing the primitives in Rust and the using Guile as the emacs lisp engine? rekado_: hunzelstrunz: AFAIK there hasn’t been any progress on GuileEmacs in recent months. rekado_: I tested GuileEmacs in the past and it did work, but crashed when desktop-save-mode was active (I think), and it was pretty slow to start (because it didn’t compile the elisp code). rekado_: There is a guile-emacs package in Guix. I’d encourage you take a look at that before continuing the work on GuileEmacs. hunzelstrunz: Do you know if the emacs lisp support of guile is complete? rekado_: I don’t know. I think in general it was fine. rekado_: but the guile-emacs package in Guix specifies a variant of Guile, so I don’t think you can just use the latest Guile release for that. rekado_: the guile variant was taken from git://git.hcoop.net/git/bpt/guile.git at commit d8d9a8da05ec876acba81a559798eb5eeceb5a17 hunzelstrunz: OK thanks :) do you have any idea why the modified it? rekado_: at the time the latest version of Guile lacked certain features. I don’t know if that’s still the case or if all of these modifications have already found their way into Guile upstream. rekado_: cwebber would probably know that. rekado_: they worked on upstreaming some changes some months ago. hunzelstrunz: I'll try guile-emacs from guix for now and have a look at the code rekado_: awesome rekado_: let us know if anything is unclear; hunzelstrunz: sure, also if anyone else knows something feel free to write rekado_: I don’t know much about how GuileEmacs works, but I’m very interested in seeing it improved. hunzelstrunz: me too, i think emacs lisp is definitely the right choice (mostly because there's already that much editor-code written in it) but unifying the interpreter for all gnu projects sounds like a good idea OrangeShark: I wonder how easy it would be to run emacs lisp libraries in guile amz3: scheme@(guile-user)> (define (foo a b c) a) amz3: scheme@(guile-user)> (procedure-arguments foo) amz3: $1 = ((required a b c) (optional) (keyword) (allow-other-keys? . #f) (rest . #f)) amz3: \\o/ amz3: TIL procedure-arguments dustyweb: btw, this is cool dustyweb: https://github.com/google/schism dustyweb: self-hosted wasm scheme dustyweb: wingo: ^^^ amz3: manumanumanu: good luck with the flu :) spk121: More work on moving SMOBs to foreign objects. Rather disappointed to lose the ability to define what 'equal?' means. spk121: I also lose my C-defined SMOB print functions, too. spk121: But the multiple slots functionality is cool. cmaloney: dustyweb: Interesting that it is a Google (not Google) project amz3: it's a pet project OrangeShark: I think google allows you to work on your own projects at work, but they have the ownership OrangeShark: just look at how many repos google has on their github group dustyweb: cmaloney: I think I know who did it dustyweb: because I think I sat next to them at TPAC :) dustyweb: while they were working on it dustyweb: I was sitting in the webassembly room and *someone* there was working on a Guile that was written in WASM dustyweb: and I'm guessing it was probably the same person :) cmaloney: <3 cmaloney: Maybe if we could get a proper scheme on the browser then people would stop saying that JavaScript is a Scheme cmaloney: ACTION gives himself the side-eye. davexunit: "javascript is a scheme!" davexunit: *runs out of stack space* davexunit: *curly braces fall out of my pockets* amz3: ^^ amz3: I have been thinking about webdev amz3: I am wondering if I will continue to do webdev on my freetime OrangeShark: amz3: are you going to now web dev with scheme written in WASM? :) OrangeShark: compiled to WASM amz3: I am wondering ^^' amz3: the thing is that it doesn't solve the issue of the web stack amz3: issues* OrangeShark: true amz3: by issues, I mainly think about complicated stack OrangeShark: what do you mean by that? OrangeShark: too complex to manage or understand? justin_smith: mainstream web dev uses fragile stacks of halfway-working tool built on top of halfway working tool all the way down - as soon as something breaks you have to learn every layer to figure out which one broke justin_smith: last I checked at least amz3: it's complicated because it re-invent the wheel for doing all the things with the promise that it will be safe for the user to user the applications built on that platform amz3: but the promise that it will be safe is not respected, i think. amz3: the main advantage of the web platform is that it very easy to "distribute" the application amz3: with an easy path for software upgrades amz3: one doesn't need a web browser to create netwoked applications cmaloney: Right, but it's a nice cross-platform environment when it works amz3: yes the cross platform thing is nice too amz3: but at the end of the day, do you want to promote platforms that do not support free softwares? amz3: the worst in this story, is that IF as much engineering was put into free software distributions, there would be more options to build cross platform applications without resorting into the "unsafe" web platform cmaloney: I'm not sure where the free software argument comes into play amz3: at the end of the day, the only benefit I see in the web platform, is allow people to run applications without distributing the source code cmaloney: Ah, right. amz3: one of the premise of the web was that code was distributed and readable and people would learn from that amz3: this is not true anymore for most frontends and anyway you don't have access to the server part so the problem of 'learning' is stil here cmaloney: I blame efficiency optimization for a lot of that cmaloney: That it also can allow folks to not share the code is a side-effect of that thinking amz3: the web platform is also slow in terms of speed but also in terms of innovations amz3: because of the sandbox thing I guess, webgl is very slow, so it porhibits innovation in the space as down to earth as user experience cmaloney: Well, it takes time to rebuild client / server mainframes and terminals. :) amz3: what do you mean? cmaloney: I'm being cheeky amz3: I think I get it amz3: if people had access to good cross platforms toolkit, there would be much more experiments in the frontend side of applications, instead we are stuck with div as boxes everywhere cmaloney: Thing is we keep realizing that folks don't want applications; they want services amz3: I believe other frontend paradigms are possible, but the web platform being slow, slows down the progress. A prime example of that is Virtual Reality or things that mix both camera and opengl cmaloney: You can throw whatever tech you want at a problem but if it doesn't scratch the itch then it won't get adopted. amz3: you think people don't want to think about "it" and just consume some thing? spk121: the web platform has big advantage over GTK/QT. The prototype is quickly made. The boilerplate in the simplest GTK/QT app is still lengthy amz3: yes, that's true, but that falls into the part where i say, that less engineering was poored into gtk/qt amz3: the app store paradigm inspired from distribution is good enough and much safer than the web does it to distribute things amz3: I hope I will have time to work on a react-like rendering library for guile-gnome cmaloney: ++ amz3: daviid: hey, why not make that into a GSoC project under GNU umbrella? amz3: daviid: that is a react-like rendering library for guile-gnome? daviid: i want app, i don't want services daviid: the webplatform, is, imo, all wrong, it is just wrong, so, i understand most 'web' folks like it of course but i don't. and i see app copying interface model from the web app/ervices, leading to, imo, gui design desaster (linphone desktop is a good all wrong example of that tendency, again, imo daviid: i wish humanity would never invented smart phgones, and humans never give any right nor any advantages to any prorpitary company to use our data, location ... daviid: why a react model in guile-gnome, why not use guile-gnome 'as is',and write app using the gtk/gnome qt paradignm ... way better imo cmaloney: So is that a no then? :) daviid: amz3: I have zero time to lead any gsoc projects anyway, but feel free of course, just my opinoins ... if you think it is the way to go, then go ... daviid: cmaloney: you may go for it, and/or help amz3 :) OrangeShark: amz3: so you want a declarative way to create UI? OrangeShark: ACTION still hasn't had a chance to look into react daviid: you may declare a ui in guile-gnome, and even for small app,I use glade, which is a must OrangeShark: maybe not just declarative but something else react does daviid: ekiga is just perfect, or pidgin, in terms of design (unfortunately, ekiga seems unmaintained), compared to linphone (the desktop app, not the hone app) as a good example of what i was trying to say ... daviid: anyway, have to run, bbl daviid: i also we all (all humans on earth), stop using google, github, fb, twiter .... so these companies just die daviid: and even being a 'good thing', gsoc is google, so for me it is very bad, a very bad education model for young people, who then syart to thnk they have to 'thank' google, which just destoyes the world daviid: not a single compny on earth should have the right to take and analyse any private data without a justice mandat, full stop. anything else is a complete destruction of the fundamental contruction of democracy. these companies must die, and for ever daviid: they are destroying simply destroying the world amz3: OrangeShark: yes, react and elm allow for a unidirectional data flow, where events trigger the 'rendering' function that will return a declaration of the new gui. Scene graphs updates are done automatically based on the declarative gui returned by the view. amz3: it's very easy spk121: amz3: you could normalize to the machine's Dhrystone's benchmark amz3: spk121: tx rlb: guile-2.2 is back in Debian testing amz3: o/ amz3: \\o/ hugo: ヽ༼ຈل͜ຈ༽ノ roelj: Is it possible to merge two hash tables (that are produces using the same hash function)? hugo: You have to do it manually hugo: It hugo: It's actually not possible to merge two hash tables, except for inserting everything from one manually into the other hugo: (define (merge-hash-table! to from) hugo: (hash-for-each-handle hugo: (lambda (handle) hugo: (let ((key (car handle)) hugo: (value (cdr handle))) hugo: (hash-set! to key value))) hugo: from)) hugo: roelj: this procedure does the trick roelj: hugo: Alright! Thanks for showing the way. justin_smith: alternatively you can create a third table and merge the other two in - there's something to be said for not mutating inputs amz3: mutation is not a crime amz3: apparantly reverse! is faster that reverse amz3: if there's something to be said for performance amz3: ^^ OrangeShark: reverse actually uses reverse! internally :) justin_smith: of coures, it makes sense to make the mutating call the implementation level if you aren't using optimized immutable data structures (my head is stuck in that paradigm currently) amz3: and I am stuck in performance trick lately justin_smith: depending on use case, the immutable version can be a bonus because it means you don't need to make defensive copies, and merges / key adds can reuse internal structure justin_smith: but that's probably not your use case OrangeShark: need to evaluate your case and choose the best paradigm amz3: when I create a list (or something similar) inside a procedure, I always use mutable version of sort and reverse, from the outside world, the procedure appears pure amz3: like (define (proc) (sort! (map cons (iota 5) (iota 5)) (lambda (a b) (< (car a) (car b)))) OrangeShark: amz3: yes, in the end, nothing is ever truly pure, you can only hide it amz3: yep amz3: longer modules makes it for longer compilation times amz3: I am experimenting with long modules amz3: but it's handy otherwise amz3: I joined my first pattern using my query engine OrangeShark: amz3: here is another https://qlfiles.net/guile-aa-tree/ amz3: OrangeShark: tx a lot! amz3: I am conding since three days and could not compile yet amz3: coding* amz3: or consing* amz3: :) catonano: amz3: I though of so many cond forms with so many condition clauses ;-) OrangeShark: amz3: no problem amz3: almost... I am right coding a match, a dozen of clauses amz3: :) amz3: I think it will have 24 clauses or something amz3: this sound scary amz3: but I don't know how to do otheriwse amz3: they are 15 clauses amz3: much room for bugs OrangeShark: For people interested in AI, Peter Norvig got back the copyright of his AI programming book in Common Lisp. https://github.com/norvig/paip-lisp amz3: it's time to compie... amz3: meh, the MOCHA challenge requires to write some adapter in Java to be able to run the tests OrangeShark: amz3: what is the MOCHA challenge? amz3: https://project-hobbit.eu/challenges/mighty-storage-challenge/ amz3: it's a competition to compare triple stores amz3: ... and they extended the deadline to 30th March which means I have full month to implement the sparql query engine amz3: which is on its way amz3: OrangeShark: ^ amz3: and since I am left without job, I will work full time on this OrangeShark: amz3: oh good luck :) amz3: tx :) amz3: actually the code must be finished the 7th may amz3: 30th march is only the 5 page paper submission deadline amz3: that's very great news dieggsy: what's the easiest way to copy an entire directory recursively? dieggsy: short of (system* "cp ...") i suppose spk121: dieggsy: probably some application of 'ftw' dieggsy: ah, ok. seems i was on the right track i guess amz3: how can I create benchmark that are portable to different machines? amz3: Can I compute some value, to benchmark the machine and then use that value to compute the score amz3: making it possible to compare benchmarks done on different machine or even use that in the tests to be able to say whatever the machine the tests are running, that some patch is an improvement? amz3: yet another layer of lasagna... amz3: ahem I mean another layer of lambda Apteryx: what's the scheme way to filter out a list of items from another way? Apteryx: from another list justin_smith: Apteryx: you can use filter which takes a lambda and a list, and inside the lambda use find to see if an element is in your other list justin_smith: or perhaps remove is simpler here (same as filter, except meaning of predicate is reversed) amz3: isn't it a list set operation from srfi-1? if the lists are sorted it can be fast amz3: I think Apteryx: oh, maybe filter-map is even more concise Apteryx: hm, or it's late justin_smith: filter-map? Apteryx: nah, the only use case for filter-map is getting rid of #f in the resultant list. Apteryx: justin_smith: I'll check out 'find', I didn't know about it. amz3: nice, I did not know about filter-map,, I always do (filter values (map proc lst)) amz3: or something like that amz3: I never remeber which boolean value must return filter's predicate to retain the value amz3: I think, that #t means retains the value Apteryx: yep justin_smith: sounds right -in clojure it would be anything but false/nil Apteryx: is there any readily availabel predicate factories? justin_smith: remove is the opposite - return #f to keep the item Apteryx: like (any-of '(some list)) Apteryx: so that I could concisely do: (remove (any-of my-subset) the-superset) amz3: Apteryx: maybe srfi-26 might come handy in those cases amz3: see cut in the procedure index amz3: 'cut' justin_smith: Apteryx: you don't need to - any non #f value suffices (just verified in my guile repl) justin_smith: Apteryx: and I was wrong about find, the thing you want is member justin_smith: (filter (lambda (x) (member x '(0 2 4))) '(0 1 2 3 4 5 6)) => (0 2 4) Apteryx: I see. Apteryx: :) Apteryx: thank you justin_smith: and you want remove not filter of course - easy swap out amz3: o/ MaliRemorker: Emacs users, I've noticed that `define*' doesn't follow the standard identation for `define'-like constructs with the scheme major mode. Does anyone have an idea how to fix this behaviour? MaliRemorker: ... short of not using `define*' :) MaliRemorker: Turns out, (put 'define* 'scheme-ident-function 1) this command will make define* ident like define, which is nicer. chrislck: guile users, anyone has any experience in running code-coverage-reports? amz3: I will be glad to know how it code coverage works in guile amz3: I will be glad to know how code coverage works in guile chrislck: amz3 I made it work \\o/ chrislck: not sure who to report to, but the guile manual for code coverage example code has a typo (call-with-values (lambda () chrislck: (with-code-coverage *(make-vm)* chrislck: (lambda () chrislck: (do-something-tricky)))) chrislck: the (make-vm) is missing chrislck: https://www.gnu.org/software/guile/manual/html_node/Code-Coverage.html civodul: chrislck: it's not a typo: you're using Guile 2.0 but this manual is about 2.2, which introduced this change chrislck: ah thank you i've been running the 2.2 manual on my guile-2.0 OrangeShark: hello everyone muto: Hello, hello! Is there any way to disable the copyright notice on the Guile REPL startup? cmaloney: curious why you would want to? muto: It's a trivial reason, nothing important. I just find it a minor annoyance as it takes up a fair amount of screen space. bavier`: muto: yes bavier`: muto: If you use 'run-repl from (system repl repl), you can first override 'repl-welcome in (system repl common) bavier`: muto: I think you can also do the same from ~/.guile bavier`: (module-set! (resolve-module '(system repl common)) 'repl-welcome (const #t)) muto: bavier: Ah, thank you! amz3: const is another form I'd like to use some day amz3: is there some self balancing tree datastructure that is available in guile? amz3: I mostly need to compute min / max values justin_smith: amz3: one classic trick is to use a hash table with the item as its own key to make a set justin_smith: with the right key function, you should be able to to find min and max items quickly justin_smith: s/key/key hashing/ justin_smith: amz3: specifically this would mean using alist->hashx-table which allows you to supply your own hashing function - maybe this is too complicated amz3: I am not sure how it works amz3: what would be the hashing function? amz3: I never used custom hasing function justin_smith: amz3: something that takes a value and returns a number, you could look at what the built in "hash" function uses - but the essential bit would be to ensure the value you consider "minimum" would have the lowest returned value from the hash etc. justin_smith: it could be that the built in hash does works for your data amz3: hmm justin_smith: amz3: for example in my repl (hash 1 1024) => 900 and (hash 100 1024) => 640 justin_smith: so it wouldn't be a good hash for numbers if keeping things ordered is your goal justin_smith: this is all speculation, but it's what would work in clojure :P amz3: ^^ OrangeShark: amz3: I remember seeing a balanced tree implementation, but can't seem to find it amz3: https://github.com/ijp/pfds/blob/master/bbtrees.sls daviid: Javyre`: try to find examples, there are some in guile-gnome Javyre`: daviid: thanks Ill look around... Apteryx: how do I touch a file in Guile? mknod? Apteryx: which module defines lambda-match in Guile? Apteryx: (ice-9 match) amz3: hello all! amz3: today, I will work on the query engine for nqql, a sparql-like language adapted to s-expr amz3: what is the meta command at the REPL to see the IR? amz3: that is nql not nqql amz3: it meas neon query langage amz3: I will try to forget about the optimization for the time being? amz3: too difficult. amz3: The optimization is anyway an improvement because the code is more readable, and I want to have a standard solution that will be _readable_ code. amz3: the only problem with the traversi vs srfi-41, is that srfi-41 are more easy to construct. In traversi, there is no stream-cons and stream-null, you have to understand the inner working of the abstraction to build a new stream. That said, one layer above, you have a subset of usecases where your library provides an abstraction where the end-user will not need to construct new streams out of nothing. The amz3: abstraction expose procedures that create streams, the end-user use that to build new streams out of existing stream with stream-map or traversi-map Apteryx: Q: How can a "touch" a file in Guile? Something nicer than (system "touch some-file") ? mwette: Did you try `(close (open-file "some-file" "a"))' mwette: Though I use (system "touch ..."). The above open-file approach may be risky. amz3: I meet exactly what I was in fear with a few month ago: lazy sequence all the things. amz3: and the stream is stateful :/ amz3: that is if you 'force stream' you can't 'force stream' again, because the underlying database cursor already moved to something else amz3: I should maybe buffer the cursor stream someone to be able t easly navigate in stream in a functional way amz3: but buffering creates a memory constraint stream amz3: but buffering creates a memory constraint amz3: it makes thinking about the whole control flow much more difficult amz3: what is a good name for a procedure that returns a KEY value that is comparable with eq? and that is used as group-by condition amz3: I think about predicate, but I am under the impression that predicates always return boolean values amz3: that is all values that return the same KEY will be grouped amz3: I will call it PROC that is all. justin_smith: amz3: my experiene from clojure (where most operations on sequences are lazy) is that laziness and side effects don't often mix well, especially when working with anything that is time-sensitive or relying on contextual bindings that might notbe in place where the sequence is realized amz3: you understood very well my issue amz3: I really want to stream all the way down justin_smith: amz3: laziness is excellent as a function abstraction, but database cursors etc. don't really play along - and I have seen way too many times that pretending something is pure that isn't is a lot worse than just doing some impure stuff amz3: justin_smith: I am trying to implement a database cursor on top of another database cursor that is stateful amz3: if possible the stream should be pure / stateless amz3: I know! amz3: what i need is not a stream but a cursor! amz3: the only cursors I know rely on call/cc amz3: the other thing I can do is convert the initial stateful cursor into stateless stream going through a list, that way I have easily my stateless stream amz3: I already done that previously in guile-wiredtiger's grf3 library for implementing gremlin DSL amz3: it was not right. Apteryx: any idea how to make the following snippet fully create the captured directory hierarchy? So far it descends to the first branch and stops there: http://paste.debian.net/1011959/ Apteryx: oh, there might be some guixish things in there such as mkdir-p. justin_smith: Apteryx: on line 17 you don't use subdir2 or ... justin_smith: so you'll never recurse more than one level down justin_smith: I'd also expect subdir1 but not inside a listtobe handled oddly Apteryx: is there a way to generalize the make-test-dir-hierarchy call to include subdir2 ... Apteryx: what do you mean by "I'd also expect subdir1 but not inside a listtobe handled oddly". Do you mean a list such as ("top" "subdir1" ("subdir2" (...)) ...) ? Apteryx: I haven't considered this use case yet (and probably won't as this is just going to be use for unit testing). mwette: (begin (make-test-dir-hier subdir1 (...)) (make-test-dir-hier subdir2 ...)) Apteryx: will try, thanks! Apteryx: hmm. not sure I understand how you use the (...) and ... Apteryx: Any pointer for a good read? mwette: maybe something liek http://paste.debian.net/1011962/ Apteryx: Oh. I first tried for-each and found it was giving me problems because of its 'unboxing' effect on my lists. Will try your example to see if it can work. mwette: and maybe replace match with (if (pair? ... mwette: yeah, seeing that may not work Apteryx: Is the reason this is so tricky decause my data is oddly defined? Should I adopt another format for my directory hierarchy representation? mwette: I would just do ("dir1" ("dir2" "file1" "file2")) amz3: justin_smith: what do you think about this https://dpaste.de/DsmE mwette: my procedure was assumeing this format justin_smith: amz3: I'm not primarily a guile or scheme programmer, so I don't fully understand what I'm seeing there. amz3: it doesn't work anyway, I have the famous lexical scoping issue related to the use of delay alone amz3: sorry, that is not the issue, amz3: basically, I can't capture the value of 'key' in the promise amz3: by the use of delay Apteryx: mwette: makes sense amz3: seems like i got it amz3: https://dpaste.de/J60Y amz3: which means I can convert my cursor to purely functional stream... or something like that amz3: I am not sure what difference there is between (delay foo) and (lambda () foo) Apteryx: final version: http://paste.debian.net/1011972/ thanks everyone for your help! mbakke: amz3: gash is a Guile implementation of bash. mbakke: Searching the web for the link was surprisingly difficult (and NSFW), but here it is: https://gitlab.com/rutger.van.beusekom/gash mbakke: There has been some discussion about it on the Guix lists. amz3: interesting amz3: ACTION night gtoast: Does anyone have instructions for installing guile on ubuntu? I don't know how to translate the root user commands to Ubuntu where there is no root directory and barely a root user. gtoast: Particularly the command that makes the root profile visible in their home directory. gtoast: Err, not guile. instruction on how to install Guix on ubuntu. Sorry. amz3: well, what is the issue amz3: you can 'sudo su' amz3: it is as if you were logged in as root amz3: gtoast: amz3: ^ jsutatool: is there any programms (except ones in front page of guile site) that use Guile as their language for extensions? justin_smith: there's quite a few, lilypond and guix off the top of my head, I don't know if there's a comprehensive list though jsutatool: /disconnect atw: Guix recommends putting one's guix source checkout on %load-path via geiser-guile-load-path (https://www.gnu.org/software/guix/manual/html_node/The-Perfect-Setup.html#The-Perfect-Setup). If I have many guile projects in ~/src, how can I set geiser-guile-load-path to include all of them? One way would be to use directory local variables in every project, e.g. in project-a add "~/src/project-a" to geiser-guile-load-path, do the same in atw: project b, etc. ym: I know it's not the way Guile meant to be, but SBCL for example has very good VM with two layers of code abstraction (internal representation), which beside other benefits makes it easy to port the compiler to another architectures. So what if in this particular case a more sane solution (how to join Guile and Common Lisp) would be not to implement CL compiler on top of Guile VM from scratch, but port SBCL's VM (on top of one of IRs) to Guile's "architecture"? atw: Another way would be to find the directories in ~/src, then add all of those to geiser-guile-load-path globally. What approach do people here take? atw: I've decided to take the second approach, via something like (setq geiser-guile-load-path (f-entries "~/src")). Now any geiser REPL can switch to the module of any project I'm working on. amz3: sneek: later say, for your load path problem, you can setup guile load path in .guile I think amz3: sneek: later tell atw, for your load path problem, you can setup guile load path in .guile I think sneek: Will do. Javyre`: Hi, what does the "rst" argument do in `scm_c_define_gsubr` ? Im guessing its some sort of variadic argument flag? justin_smith: > The arguments req, opt and rst specify the number of required, optional and “rest” arguments respectively. justin_smith: > The number of rest arguments should be 0 or 1 justin_smith: so yeah, sounds like 1 means "it takes variable number of args" Javyre`: yeah but how does that work? does it set a list of given args as the last argument to the C func or something? justin_smith: I can only speculate but that's how every system I've ever seen does it - implicitly put all rest args into a collection and pass a pointer to that justin_smith: but someone here probably has a more specific answer Javyre`: alright, thanks anyways ym: As I understand, Guile differs from Common Lisp mainly in Lisp-1 vs Lisp-2 namespaces (and better way of writing higher order functions consequently) and macro system. Seems like it's quite simple to add CL support to Guiles VM, isn't it? I'm not sure I'm qualified enough to support such complicated project, but I'm highly interested in the subject, so is Common Lisp support planned at least? OrangeShark: ym: not that I know of. You might want to check out Guile's emacs lisp support chrislck: another question about sxpath - (xml->sxml "") only produces (*TOP (a)) - how do I make it produce (*TOP* (a) (b)) chrislck: the other way (sxml->xml '(*TOP* (a) (b))) does produce "" as I expect chrislck: in other words xml->sxml seems to only parse the first root element amz3: chrislck: I think all xml parsers work like that amz3: chrislck: it's not possible AFAIK to do what you want chrislck: amz3: thank you as it turns out the XML generator was broken and was lacking the overarching root element. amz3: ok amz3: yw amz3: I am trying to implement the query optimizer for sparql, reading through the literature is hard, I guess I will take a shot at my own optimization startegy first and then go through the literature again amz3: also, being standard compliant is hard amz3: I am at the very start of my journey OrangeShark: hello amz3: héllo OrangeShark amz3: scheme makes the news via the opencog project that use guile https://www.cbronline.com/list/top-5-open-source-projects-2018 amz3: they do not cite GNU Guile but scheme terpri: ym, i'd like to see cl support in guile someday. it would be a tremendous task to implement it fully, though terpri: the elisp compiler shows that lisp-2 support is possible, but guile elisp defines around 100 symbols, vs around 1000 in cl stis: The question is if one can define a core language and then use that + already made cl code to create the rest of the 1000 symbols stis: How big is the core language? and where can we steel the cl implementations of the rest of the symbols stis: FYi I have a full tagbody implementation in guile stis: slow but featrure complete stis: I also have an implementation of CL's loop macro terpri: i know of http://home.pipeline.com/~hbaker1/MetaCircular.html which discusses special forms... also some of https://github.com/robert-strandh/SICL may be usable terpri: kent pitman wrote a prototype for a lisp dialect where lisp-1 and lisp-2 environments could coexist: http://www.nhplace.com/kent/Half-Baked/index-spiel.html janneke: how do i display binary data to current-output-port? janneke: this works: (display binary-data (open-output-file "/dev/stdout" #:binary #t)) amz3: sorry, idk, keep it steady nonetheless ;) spk121: janneke: did you figure out the binary output? it is 'put-bytevector' janneke: spk121: thanks...but oh wow; now it looks like janneke: ((compose (cut put-bytevector (current-output-port) <>) (cut string->bytevector <> "ISO-8859-1")) "binary-data") janneke: i was hoping for something simpler than my hack: janneke: (display binary-data (open-output-file "/dev/stdout" #:binary #t)) spk121: janneke: if all you really want to do is put binary output over stdout, you can set the output encoding to iso-8859-1 spk121: (set-port-encoding! (current-output-port) "ISO-8859-1") janneke: spk121: yeah...that does not seem to work somehow janneke: i seemed to remember that, so i need to find what's wrong on my side/create a bug report janneke: spk121: thanks! spk121: but then, of course, if your terminal emulator is utf8, the terminal emulator will not be happy janneke: spk121: :-) it's for pipeline code in gash, and tools that pipe binary data amz3: what is gash? janneke: amz3: https://gitlab.com/rutger.van.beusekom/gash amz3: sure it's not a simple matter amz3: `_o< amz3: manumanumanu: at last, I use and-let* amz3: srfi-2 ftw! wingo: amz3: intmap should generally be better than fash unless your integers are spread quite far apart amz3: oh then I think I will use fash because I spread revisions over random unsigned 64 bits integers and most likely there is much less than (expt 2 64) revision in my history (otherwise said revision numbers are far apart) amz3: tx! amz3: I have a procedure that is 79 lines of code, that is a "delayed continuation" aka. some kind of lazy stream and I am not sure right now how to make it shorter amz3: 79 lines in one hour that are not tested... not bad ;) manumanumanu: amz3: and-let* is my favourite srfi together with cut, fmt and irregex manumanumanu: especially together with false-if-exception for smaller scripts (or (and-let* blah blah) (error "blah")) manumanumanu: which is more the CL way of doing stuff, but it is nice anyway stis: darn, a deepcopy of a continuations is impossible in guile 2.2, int guile 2.0 it is possible stis: the reason is that the contination has a copy of the stack and it is impossible to know which stack element is immediate or not manumanumanu: stis: what are you doing? stis: That is in 2.0. manumanumanu: and why aren't you using delimited continuations? stis: I'm looking at a python clone in guile that I made stis: in python you have deepcopy which is different from continuations stis: in continuations you copy the stack but in a deep copy you should continue dig into variables on the stack so not only copy the references but the whole object stis: This is needed if you would be able to completely regenerate a calulation for which you can't in a delimeted continuation which is a shallow copy stis: If your program is functional this is a non issue. The thing is that python programs mutate en masse by design stis: but the issue in 2.2 is that you don't know if an object on the stack is a SCM value or a unpacked intermediate. stis: The compiler knows, but not the continuation stis: as an example, take the tee function in python itertools. It takes and iterater and makes multiple equals copies, would be swell to just do deepcopies of those manumanumanu: ah stis: but then you have iterators via the yield statement meaning that you use delimeted continuations. For guile code that is ok. But these continuations usually ivolves stis: involves a for loop, for which you typically must mutate variables, meaning that you are sold when copying the stack manumanumanu: are you sure this is doable from guile? manumanumanu: without C mumbo jumbo? stis: no you need to do some C magic. I do have deep copy of closurs wotking for 2.2 stis: It uses some compiled C code to dig into the guile internals. Would be great to haw scheme support but we don't have it stis: I took this from my prolog implementation stis: Also in my guile prolog I use closurse in stead of delimeted continuations and have a special version of delimeted continuation implemented in my c engine which supports deepcopy by the way. stis: This means that I can serialize an entire state which is cool. stis: whould be great if a python program could be serialized like that as well, but no it can't. To be honest cpython can't do that as well stis: cpython can't picle lambdas and for iterators I don't know. stis: (sure classes but what about generators) manumanumanu: seems like fun stuff though :) stis: well I'm quite finished with the core python, now I need to code the batteries, a lot of things to learn manumanumanu: I myself am trying to write a simpler ffi for guile that allows for passing bytevectors without bytevector->pointer and allow for defining your own external types, but without any performance penalties stis: I will implement tee differently like in cpython manumanumanu: it is harder than I thought stis: the ffi is cool and fun as well daviid: lloda: are you there? did you solve your problem compiling gwrap? daviid: and guile-gnome... all work with the latest here ... fi manumanumanu: stis: the problem is that my old approach was a hash with symbols as keys, which is all fine and dandy, until someone redefines an already defined type manumanumanu: which makes all parts of the program behave badly manumanumanu: so I made types regular records of syntax objects of the lambdas want to use, but that has a performance pnalty manumanumanu: and I have to have a special case for '* manumanumanu: but hmm.... maybe I can work around it stis: okey manumanumanu: That way, extending the ffi with new types will be easy manumanumanu: and you could specify the bytevector argument, and it implicitly wraps in in bytevector->pointer, or even nullable-bytevector which converts #f to %null-pointer manumanumanu: The thing is, if it isn't zero overhead after the optimizer is done with it, I am not interested. manumanumanu: but that was harder than I thought. I keep bumping into corner cases manumanumanu: and I keep thinking that the first option of storing all new types in a hash is the best way stis: (define mytype (cons 'mytype (current-modeul))) stis: and an eq hash on those keys? stis: so if you keep the types local to the module unique you won't get too much trouble stis: perhasp you should use an equal hash donough manumanumanu: the thing is, I already have a hash of the already existing types manumanumanu: because I overwrite the default ones. That is simpler than detecting whether they are renamed from (system foreign) manumanumanu: and makes it clear that mixing the two modules isn't a good idea stis: you may wrap the standard types and make them non symbol as you use them, but represents themselves as the foreign types manumanumanu: you may explain that in swedish to me in a private conversation :D manumanumanu: Because I don't understand anything stis: it depends on how you use the types, stis: (define double (list 'double (current-module) (lambda () 'double)) stis: And then the constructor would be ((list-ref double 2)) -> 'double stis: but it all depends on how you are working, hard to see it from my distance. stis: there are multiple options, but you link a type to som construction function like my simple one stis: anyway got to go see ya! manumanumanu: thanks! manumanumanu: that is _exactly_ what I am looking for bavier`: daviid: could you "fix" guile-cv's repl print issue in guile by using srfi-9 records with an appropriate custom record printer, instead of lists, to represent images? bavier`: forgive me if this has been discussed before daviid: bavier`: that would mean a complete rewrite of gule-cv, and i did think very carefully before to choose the date structure ... and decided to use lists, otherwise i would have used goops, not records, but that won't happen I'm afraid, so we have to wait for guile maintainers to address this (very annoying) limitation, that by the way, I am far from being the only one expressing a wish for a repl and raised exception system capable of daviid: truncated large strucutres ... we just have to be patient, they will fix this, one day or another bavier`: sure, just thought I'd ask; didn't know what avenues have been explored already :) daviid: bavier`: patching guile is really easy, and I wrote a very good entry in the manual for this, but it is just that malbda users ar scared to patch, which is uunderstandable daviid: *lambda users bavier`: yeah, I was thinking about how to incorporate those patches into guix's guile; whether or not the change would upset other usecases daviid: bavier`: I've asked both rikardo and civodul, who's also a guile maintainer, and they said they dont want to do that, they wan't to patch guile ... bavier`: daviid: don't want to patch guile? daviid: they don't want to patch the guile version in guix, they wan't to wait guile upstream being patched ... daviid: which I understand bavier`: daviid: ok, I see; that makes sense daviid: and agree, it's just that I dod not expect to have to wait so long ... training patience here :) .. I'm unemployed, may months now, otherwise I'd pay one of the maintainer to fix this ... I can't daviid: bavier`: so xcolor is the monster then? daviid: I guess it triggers lot's of otherdepencies ... bavier`: daviid: heh, yeah, there is some subtle setup involved in building it and some dependencies. daviid: too bad, sorry about that, and thanks again, take your time .. I think your approach is the right one bavier`: np, thanks for your patience daviid: I should make another release of guile-cv in March, mid March probably, el'ts see amz3: stis: hej! OrangeShark: hello OrangeShark: looks like davexunit and dustyweb will be speakers at libre planet :) dustyweb: OrangeShark: hi! dustyweb: yes and I think davexunit's topic is actually guix related? OrangeShark: yup dustyweb: mine is federation related OrangeShark: basically what you have been working on with ActivityPub, right? stis: hej amz3 wingo: good evening :) amz3: I promise I won't spam the mailling list everyday :-) cmaloney: amz3: promises promises. :) amz3: wingo: hi, do you recommend the use of (language cps intmap) to store hashmap of ints or do you recommend the use of fash. My usecase is that I have an list of integers (that represent revisions) ordered using some graph topo algorithm. What I need to do, is given set of revisions, decide what is the max revision. Right now I use a hashtable, but I need a functional hashmap to make it possible for writer to amz3: not block readers. spk121: ACTION looks at porting the ncurses binding to foreign objects manumanumanu: Ahoy hoy! What a lovely evening! manumanumanu: helping schemers optimize simple code on reddit is my favourite thing to do. chrislck: maybe someone here knows, is there any reason travis-ubuntu would fail when guile 2.0 complains that "no code for module" (srfi srfi-64) ? Is srfi-64 an optional compile for guile2.0? amz3: chrislck: are you running the tests in parallel? amz3: that might be the issue amz3: I think there is a race condition upon compilation of module, but you are right, the module should already be compiled OrangeShark: chrislck: do you mean travis CI? OrangeShark: chrislck: srfi-64 was introduced in Guile 2.0.10. Travis CI with Ubuntu trusty has version 2.0.9 chrislck: Orange: oh, what a pain manumanumanu: Good morning guilers! ayys: when using the random function from the interpreter, I get a random number every time. But when I use it in a script, I get the same result every time. Here is a snippet of the code I am using in the script. https://paste.debian.net/1011111/ ayys: Is the function being compiled before runtime? chrislck: Been checking macros and - there seems to be a way to access the (current-source-location) - but it tells me the location of the (current-source-location) rather than the macro-caller. What am I doing wrong? chrislck: (define-macro (something stx) chrislck: (format #t "~a" (current-source-location))) chrislck: ok this needs quoting OrangeShark: ayys: have you looked at the manual? https://www.gnu.org/software/guile/manual/html_node/Random.html OrangeShark: specifically "Note that the initial value of *random-state* is the same every time Guile starts up." OrangeShark: it also mentions how to change *random-state* dsmith-work: Hey Hi Howdy, Guilers amz3: o/ manumanumanu: ahoy hoy! OrangeShark: hello manumanumanu: Morning! amz3: o/ lloda: can't build g-wrap lloda: ./configure: line 14794: syntax error near unexpected token `2.2' lloda: ./configure: line 14794: `GUILE_PKG(2.2 2.0)' lloda: lloda: ring a bell? Sleep_Walker: well, sounds like configure was generated from some older guile library? I'd try autoreconf Sleep_Walker: (but I know very little about this stuff) lloda: thx. just did git clone & ./autogen.sh though lloda: I'm fairly clueless myself tbh lloda: just trying to regen the guile-cairo doc (you there wingo?) wingo: ohai :) wingo: guile-cairo doesn't require g-wrap does it? lloda: through guile-gnome it seems lloda: just the doc wingo: guile-gnome needs g-wrap wingo: guile-cairo doesn't need guile-gnome or g-wrap lloda: yes yes, guile-cairo works fine, but I'm trying to regen the doc. That requires guile-gnome wingo: rly wingo: no idea :) lloda: ok :D lloda: else, I've filed a couple bugs for guile-cairo lloda: I've asked for commit access on savannah, I'll fix them if you approve chrislck: sorry for basic question -- if I try (define (get-xy x y) ((sxpath '(// (tr x) // (td y) *text)) sxml) -- how exactly do I unquote x? is it possible or do I need to make a macro? ft: (let ((x 23)) `(foo bar ,x baz)) => (foo bar 23 baz) amz3: +1 amz3: replace the ' by ` and x by ,x amz3: and y by ,y ft: The term to look for is quasiquote chrislck: ... I succeeded with define-macro... didn't know quote/quasiquote/unquote also works in normal defines chrislck: so much fun amz3: :) civodul: Outreachy & GSoC participation for Guix: https://www.gnu.org/software/guix/blog/2018/join-gnu-guix-outreachy-gsoc/ civodul: spread the word! :-) rlb: civodul: hey - with respect to 2.0.14 -- it's not in unstable/testing because before this latest problem with the tests (sandbox.test hanging sometimes and test-out-of-memory failing sometimes), I was planning to try very hard to remove guile-2.0 before the freeze. And it's not in stretch because I haven't had time to look at it, and then consult the release managers about the possibility of allowing it. rlb: Once I resolve the test issues (and get 2.2 back into testing), I can try to take a look wrt stretch. rlb: Current plan is to skip (or ignore failures) wrt test-out-of-memory for now, and possibly to skip part or all of sandbox.test (if y'all thank that's reasonable upstream) -- part, if I can figure out which part is causing the hang. rlb: From the log, looks to be getting stuck on "1e6 alloc loop". rlb: I an easily reproduce it with a "while true; make -j4 test; do" loop here now (after it runs for a while). rlb: And test-out-of-memory can be coaxed to fail by just running it alone in a loop. rlb: ACTION will file bugs soon. civodul: rlb: isn't test-out-of-memory a 2.2 test? manumanumanu: that would be a sad ending to this manumanumanu: Has anyone implemented brainfuck for the guile VM? manumanumanu: Like a complete tunable brainfuck experience where one can tweak the behaviour of memory over/underflows to actually be able to run most bf stuff. That would be nice manumanumanu: I have an old bf program that factors arbitrary sized integers in an even larger arbitrary amount of time, but the interpreter I used is long since abandoned. manumanumanu: it was nice to write :D rlb: civodul: yes, and getting guile-2.2 back in testing is higher priority for me right now. amz3: did someone here tried swish, chez scheme take on erlang paradigm https://github.com/becls/swish amz3: there is a big 100 pages manual but I did not have time to read it yet hugo: Does foreign objects work? I get segmentation faults on `scm_make_foreign_object_1'. hugo: Running Guile 2.2.3 bandrami: Is there an equivalent to PEG that uses local scope rather than defining top-level variables? chrislck: just throwing question out there -- (sxml sxpath) seems to be an underdeveloped (ie incomplete xpath spec) and underdocumented module, no? rekado_: underdocumented: yes. rekado_: chrislck: what version of Guile do you use? chrislck: 2.0 rekado_: recent versions have more comprehensive sxpath documentation. chrislck: https://www.gnu.org/software/guile/manual/html_node/SXPath.html#SXPath ? chrislck: i've been trawling the nets for good example codes and it's a shame they're all from sxpath-old.scm :-) rekado_: heh, yes. rekado_: what would you like to know about sxpath that’s not in the manual? chrislck: basically a 1-to-1 mapping of w3 xpath and sxpath would be good... as well as limitations eg /books/book[last()] seems fine '(books (book -1)), however /books/book[position()<3] is probably out of scope chrislck: if i understood correctly chrislck: racket has txpath which acceps string directly as well, unlike guile amz3: chrislck: yes, string->sxpath would nice to have, but there none yet amz3: chrislck: if you have an example xml and an xpath, I can make the sxpath amz3: chrislck: ah you already know how to use it amz3: nvm mwette: the original sxpath allowed strings (read Oleg's papers); and racket has it mwette: https://docs.racket-lang.org/sxml/sxpath.html?q=sxpath amz3: the reasoned schemer for microkanren is coming: https://groups.google.com/d/msg/minikanren/IX1GWv9DPug/N59dC2zqCgAJ dustyweb: amz3: oh cool amz3: :) manumanumanu: Ahoy hoy! manumanumanu: What's cooking in guile-land? ennoausberlin: Hello. ennoausberlin: I need some advice to figure out scope in guile manumanumanu: ennoausberlin: sure thing. what is your question ennoausberlin: There is a function called (job ... ...) which takes two lambdas as arguments. In the first lambda I just read some values from a config file and store them via let. In the second lambda I need some of the values from the first lambda but they are not visible. I have to reread the values from the config file to use them. I guess there is a better approach ennoausberlin: This is related to https://www.gnu.org/software/mcron/manual/mcron.html#Every-second-Sunday manumanumanu: Why aren't you reading them before you run job? Or create the lambdas in a closure where both have access to the config content? ennoausberlin: job is the only function that runs in an mcron file, I think ennoausberlin: mcron is a guile based cron scheduler. It expects a file named foo.guile in his working dir and there should be a (job ... ...) specifier which describes when and what to run. ennoausberlin: I compute the when-interval from values of my config file manumanumanu: is there an error to have any other code? ennoausberlin: I did not try it yet ennoausberlin: It might work, but I was curious how to deal with such cases manumanumanu: Sort of a special thing. I would probably use a closure or maybe set! for small scripts, but that isn't appliccable here since I don't know how guile evaluates arguments ennoausberlin: For now I will try to insert the extra code outside the job specifier. Thank you manumanumanu: mcron is nice ennoausberlin: Code before (job ... ...) is executed so I dont need to read the config values twice. Great. I am still a guile newbie manumanumanu: Kein problem! Just ask. we might be slow to respond, so give us some time :) manumanumanu: ennoausberlin: the question is: is the code re-evaluated each time, or only once? So, if you change the config file, it is reloaded by mcron, or if it is read once and then static until you restart ennoausberlin: config is only read at startup I guess. If you change the foo.guile cron file while mcron is already running it will not change anything manumanumanu: Then you should probably read the config file every time you execut the cron job :) ennoausberlin: config file does not change often. I can just kill and restart mcron. Another problem I ran into was time out. I can not specify a job with a given timeout. manumanumanu: like what? manumanumanu: Do you want a file to be run until a certain date, or do you want to kill a job if it takes too much time? ennoausberlin: I want to kill the job if it takes to long manumanumanu: there must be some code for that written for guixSD manumanumanu: i'll look into it ennoausberlin: Well, I discovered mcrom while using GuixSD :) manumanumanu: ennoausberlin: I have the solution for you :D manumanumanu: You can manually run the process using (@@ (ice-9 popen) open-process) and then wait the amount of time manumanumanu: and kill if it hasn't finished manumanumanu: It is non-trivial though manumanumanu: and will include threads and shit manumanumanu: or would it? no manumanumanu: yeah, it is trivial. You need to (define open-process (@@ (ice-9 popen) open-process)) manumanumanu: run the process using (open-process OPEN_BOTH "name" "args") That will return pid, read-pipe and write-pipe manumanumanu: wait the desired length, and then check if the program is still running manumanumanu: (when the program closes, the output port will be closed) manumanumanu: otherwise use kill on the pid manumanumanu: The downside is that the command will always take TIMEOUT manumanumanu: seconds manumanumanu: but since it's cron, that might be ok ennoausberlin: I have to check the manual for @@ syntax. Dont know what it is yet, but I will try it out manumanumanu: @@ means accessing un-exported library definitions manumanumanu: popen for some reason doesn't export open-process (which is the most sensible way to talk to linux processes) manumanumanu: (@@ (ice-9 popen) open-process) means the open-process function in (ice-9 popen) regardless of whether it is expported by the module or not ennoausberlin: I use (status:exit-val (system (... at the moment but I read a little about popen before ennoausberlin: Thank you for the pointer. There is even a linux timeout command but somehow it does not work inside mcron. I tried that before. manumanumanu: but open-process has nothing to do with open-pipe. it simply returns 3 arguments: an output port, an input port and a PID manumanumanu: ennoausberlin: remember open-process. That is the best way to do things ennoausberlin: I'll do. You are of great help rlb: wingo: looks like I may have found the build hang too -- I just ran "make -j 5 check" here in a loop, and it eventually blocked on sandbox.test with the cpu pegged. Think it's ok to mark that one as unresolved too for now? (I may investigate both issues later, but in the short term, if it's not a significant risk, that might allow us to get 2.2 back in to debian testing.) rlb: wingo: and I'll plan to file bugs for both cases (the test-out-of-memory and sandbox.test sporadic failures). rlb: ...also, if the log was completely flushed, looks like sandbox.test hung on the "1e6 alloc loop" test. chrislck: wingo thank you for sxml xpath tutorial from 2012 ... https://lists.gnu.org/archive/html/guile-user/2012-01/msg00049.html -- what a lifesaver1 chrislck: sneek: botsnack sneek: :) chrislck: lol manumanumanu: Good evening guilers! peepsalot: hello, i just git cloned stable-2.2 branch and the readme says "Generic instructions for configuring and compiling Guile can be found peepsalot: in the INSTALL file." peepsalot: my question is, what INSTALL file? it doesn't seem to exist? daviid: peepsalot: you need to run /autogen.sh first, this file is created daviid: what distro are you running? peepsalot: linux mint 18.3 (based on ubuntu 16.04) daviid: is gle not available there? daviid: *guile peepsalot: guile 2.2 is not available through package manager until ubuntu 18.04 comes out daviid: peepsalot: ok, it's easy anyway: ./autogen.sh; ./configure [--prefix=...]; make daviid: you're on your own for dependencies though, carefully read the output of the configure step ... peepsalot: looks like dependecies are ok as far as I can tell. waiting for make to complete... peepsalot: thanks daviid daviid: peepsalot: be prepared to be patient as well, compiling from the source can take quite some time, depending on the power you have of course, but on a medium laptop, ut to few hours ... daviid: wc! peepsalot: well, my laptop is pretty hardcore :D rlb: peepsalot: and "make -j 4" or whatever will help some, but there are a few files that are a bottleneck. And if you get the upstream .tar.gz it'll be *much* faster than building from a git checkout. rlb: (because the tar file includes prebuilt bootstrap files) peepsalot: looks like make failed on makeinfo which is not on my system. don't know what package it would be in peepsalot: ok, its called texinfo peepsalot: and yeah, rlb i ran make -j10 peepsalot: looks like it succeeded peepsalot: it would be nice to also list that dependency in the README peepsalot: i'm trying the tar.gz now. i didn't know it is partly prebuilt peepsalot: hey, done in about 4.5 minutes, much better peepsalot: i guess texinfo also isn't needed if you build it from the tar.gz? daviid: peepsalot: it's texinfo yes, it won't cost anything you install it, goahead ... daviid: it's needed to build the doc locally anyway, and it is really recommended you do that (make install-html (or info, pdf ...) daviid: peepsalot: you'll spend quite a good amount of time in the doc anyway, so better have it locally, so when you are in the woods ... you still can guile :) lispmacs`: hi, if I have, e.g., a (vec2 10.0 20.0) in a body of a procedure, is there something I can do to prevent that from being reallocated every time procedure is called? I could use global var, yes, but that looks a little messy I'm thinking rlb: lispmacs`: depending on what you need, you could also use a closure (let [x (vec ...)] (define (foo ...) ...use x here...)) lloda: lispmacs`: if the vector is constant you can write #(10.0 20.0) and the compiler will make it static dsmith-work: Happy Friday, Guilers!! dsmith-work: sneek: botsnack sneek: :) dsmith-work: good bot CherryMan: what's the point of slots for foreign objects? ijp: CherryMan: slots are the fields in foreign objects Javyre`: ijp: are the names attributed to the slots ever used? codefree: hi, I was wanting to calculate framerate in a game. I see (tms:clock (times)), but am confused about the units it returns. Is that like nanoseconds...? and is that going to be the same base across platforms? rlb: wingo: ok, thanks - I'll at least do that, i.e. mark it as unresolved, and upload to unstable, might get us closer to propagating back to testing, and if I get a chance, I might poke at the test myself. codefree: does anybody know what is "current real time" as returned by (tms:clock (times))? codefree: it seems to be trillionths of a second count, but I was wondering if it was the same across platforms...? amz3: maybe check the source? civodul: codefree: in general i find the SRFI-19 API to be more convenient and clearer civodul: i'd recommend taking a look at that one civodul: uh, looks like Debian has 2.0.13, not .14: https://packages.debian.org/search?keywords=guile-2.0 civodul: hey rlb, any idea why? ↑ Sleep_Walker: hi! Sleep_Walker: I'm a bit fighting with guile module packaging and I was wondering, if dynamic-link could be somehow forced to use /usr/lib64/libgit2.so.0.26.0 instead of /usr/lib64/libgit2.so symlink pointing to that file Sleep_Walker: /usr/lib64/libgit2.so file is usually part of -devel subpackage containing files required for build, but not runtime Sleep_Walker: so it is unhandy to require build time dependencies for runtime of a package Sleep_Walker: TIA for answer amz3: Sleep_Walker: did you try LD_PRELOAD? Sleep_Walker: amz3: could you please say more what you mean? amz3: Sleep_Walker: it's trick to force the loading of a library without going through shared library name resolution amz3: see https://stackoverflow.com/questions/426230/what-is-the-ld-preload-trick#426260 amz3: in your exemple, you can do LD_PRELOAD=/usr/lib64/libgit2.so.0.26.0 guile foo.scm amz3: but I think it's doesn't anwer your question amz3: you are asking about how to make autotools choose the correct .so amz3: ? Sleep_Walker: amz3: and that does influence dynamic-link? https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Low-level-dynamic-linking.html amz3: yes, dynamic link will see the library is already loaded and won't load it again Sleep_Walker: amz3: you can express my question as that as well, right - how to tell autotools to use some other file amz3: that's different, I don't know how to do that amz3: autotools, get it's information from pkg-config if that helps Sleep_Walker: I was more concerned with the interface of the function Sleep_Walker: that it doesn't accept file (because it adds `.so' by itself Sleep_Walker: I could patch the code to use file I want Sleep_Walker: but not with this interface Sleep_Walker: using LD_PRELOAD is probably not the right way how to use guile modules everywhere in the system Sleep_Walker: I'm asking from package manager perspective... Sleep_Walker: s/manager/maintainer/ ehiggs: are there benchmark results for the language shootout for guile? dustyweb: so an interesting workaround to the "gah emacs is destroyed by this long line I printed at the REPL" problem dustyweb: Racket just pretty-prints their structures by default dustyweb: problem solved! dustyweb: ~solved ;) dustyweb: it might not be a bad idea to make that an option in Guile cmaloney: Also a nice debugger would be cool in Guile. cmaloney: and a tasty sandwich while we're at it daviid: dustyweb: yep, i sent two requests for improvement, see bug#29669 and bug#29684 dustyweb: davidl: ah thanks for the pointer to those bugs :) rlb: From a built 2.2.3 tree, could someone double-check that this works "for a while" for them? For me it crashes on amd64 quite regularly now (working on the Debian buildd failures): rlb: (set -e; while true; do test-suite/standalone/test-out-of-memory; done) rlb: The difference when it crashes may be: rlb: Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler. rlb: lloda: rlb: https://lists.gnu.org/archive/html/guile-user/2017-11/msg00062.html lloda: there was also something more recent I think about packaging Guile 2.2 for Debian (I can't recall) chrislck: amz3 un francophone! wingo: amz3: regarding database question :) i don't know! i think guile is great, future and capacity of a database sol'n limited in mid-term by gc pause time and throughput wingo: especially multi-core throughput wingo: maybe we will be able to solve those within 5 years, who knows rlb: lloda: thanks for the other pointer (and I suspect the debian one was me). rlb: wingo: assuming I don't get time to track it down soon, I wondered if it might be plausible for me to just mark test-out-of-memory as unresolved in debian, since it seems to be failing reasonably often these days on various architectures? rlb: i.e. running it in a loop will cause it to fail fairly readily. wingo: rlb: yes it is reasonable wingo: i would like to fix it but am not directly working on it manumanumanu: Good evening guilers! manumanumanu: I have so many things that I want to do I have a hard time focusing :) manumanumanu: First this whole libsodium thing (which is almost done), but that led me to writing an easy ffi, which led me to deciding to use format, which led me to reading the format source code, which led me to starting to port srfi-159 to guile manumanumanu: so now I'm just idly browsing the web wingo: :-) wingo: looking at format.scm a step on the path to perdition manumanumanu: that is one crazy function manumanumanu: I'd argue that it is probably easier to get started with format than with srfi-159, but I doubt it is a very efficient use of one's processor time manumanumanu: I am still not really comfy with irregex, but I can't shake the feeling that I am going to like it a lot manumanumanu: reading format.scm made me sad. I just never ended. wingo: haha wingo: it needs some help :) it is code from the late 80s :P manumanumanu: wingo: I don't know if you have looked at ashinn's fmt, but it is pretty neat once you have gotten over the outlandish syntax (compared to format) manumanumanu: and the code is pretty :) ijp: fmt always feels like overkill ijp: -- 2-time format bug patcher amz3: wingo: ok, anyway, I am trying chez scheme and come back to gnu guile later. I have the feeling that I have something interesting with this functional database thing with a viable usecase, I got to try, but everyone and else seems to mock my choice of language amz3: ijp: o/ amz3: ijp: still no TCO in browser :( ijp: yeah, alas Javyre`: are the names associated to slots in foreign objects ever even used? manumanumanu: Guten morgen! manumanumanu: How are you all guiling today? manumanumanu: Wowza. ice-9 match is one hell of a syntax-rules macro manumanumanu: Jeeez. Who is the code-producing super intelligent alien that kidnapped ashinn and is now using his body to write scheme code? manumanumanu: and format is 1500 lines long O_o manumanumanu: That does it, I will port srfi-159 to guile. amz3: o/ roelj: I'm trying to do a http-get on a HTTPS URL. Unfortunately, the return is this: (# read_from_session_record_port). roelj: I wonder what could be wrong? Does the remote host just shut down the connection? amz3: roelj: what version of guile are you using? roelj: amz3: 2.2.2 amz3: it should work with 2.2.3 but not 2.2.2 rekado_: roelj: it’s fixed in 2.2.3. roelj: Ah roelj: ACTION Upgrading right away roelj: Hmm. Do I need to upgrade gnutls as well? amz3: I don't think so roelj: I get the same error in 2.2.3 amz3: can you share the url you use? I will try on my side roelj: Yes: https://ega.ebi.ac.uk/ega/rest/access/v2/users/login roelj: I can also share a code snippet amz3: it doesn't work on my side, but it doesn't error either, it just hangs amz3: also curl doesn't like that url amz3: $ curl https://ega.ebi.ac.uk/ega/rest/access/v2/users/login amz3: curl: (56) GnuTLS recv error (-110): La connexion TLS n’a pas été terminée correctement amz3: same error as you pasted amz3: i will try with python's requests amz3: roelj: both firefox and requests return an empty json object, is that expected? amz3: as body roelj: amz3: Yes. roelj: Could it be a problem with verifying the certificate? The error doesn't indicate it though. amz3: $ gnutls-cli $ curl https://ega.ebi.ac.uk/ega/rest/access/v2/users/login amz3: |<1>| There was a non-CA certificate in the trusted list: CN=ubuntu. amz3: roelj: indeed amz3: oops sorry faulty copy/paste amz3: roelj: here is what gnutls-cli gives https://dpaste.de/Y4G1 amz3: roelj: I am not sure what it means, at that point I would check if the CA is there or check with gnutls people roelj: Right. So, I am not going to be able to pursuade them to fix this. Can I deal with it in Scheme? amz3: ahah! c'est la premiere conference sur le truc que je voulais faire http://usc-isi-i2.github.io/DL4KGS/ amz3: sorry! amz3: wrong chan rlb: Is there any current plan with respect to handling binary paths, usernames, groups, xattrs, acls? i.e. guile treats them as strings right now, but they're not necessarily, and in the general case, there's no way to know the encoding. rlb: (...important for any tool trying to preserve the original bytes from readdir(), getpwent() etc. -- like, say a backup/restore tool) rlb: Offhand, I'd imagine that guile either needs new apis that return the unmodified data, or (less desirably) some hack like python's surrogateescape. lloda: guile-cairo users here? I need an example of using cairo-image-surface-get-data lloda: ok, found a bug :-/ lloda: the vu8/u8 split is irritating spk121: rlb: if you need binary paths, you can set the locale to an iso88591, which will not throw an encoding exception. Since there is inherently no way to visualize binary paths as strings, using a latin 1 visualization is as good as anything. rlb: spk121: however it happens, I need the exact bytes returned by the underlying system calls, i.e. guaranteed not to have been altered by say unicode normalization, etc. And preferably without any extra allocation/overhead. spk121: rlb: then iso88591 is the way to go. binary bytes 0 to 255 map to iso-8859-1 values 0 to 255 map to unicode codepoints 0 to 255. The guile string representation, since it has codepoints guaranteed to be less that 256, will always be "narrow" strings. spk121: rlb: I realize that is isn't what you really want, which is some sort of flag on string-like data that declares it truly binary, but, it might suffice spk121: as far as I know, guile strings' unicode normalization never changes except when explicitly requested rlb: Thanks - I'd be fine with a different type too (u8vec), etc., just something that presents the real api/data. And of course if I decide to pursue this, I could just write my own wrappers if that ended up seeming preferable, but if were to do that, I'd probably want to see if I could do something more generally useful. rlb: In the long run, I think guile should probably provide direct access -- fwiw, after a bit of poking around it looks like python attempted to address this issue via surrogateescape, and rust provides a separate OsString type. rlb: (the latter of course isn't necessarily compatible with unicode or anything else) rlb: (just bytes) amz3: haha amz3: I am super excited about this functional database project amz3: now i need to find a good name for it amz3: I found a good name I think, what do you think of 'neon' as the name of the git-like functional database I am working on? amz3: ^^ amz3: I just copy pasted half of wiredtiger/extra.scm to a single field to a record :/ amz3: I think I will drop extra.scm before 1.0 release of guile-wiredtiger amz3: maybe amz3: maybe it will a failure, but based on the paper I posted yesterday / tonight, everything seems very simple amz3: I am wondering why nobody did it already amz3: probably it's a bad idea :evil: amz3: 300 lines of code and I did not run guile on it yet. amz3: the code of based on the paper is available http://rawbase.github.io/ ft: There's nothing like add-to-load-path to add to the compiled-files search path, is there? So, I'd cons to %load-compiled-path directly? ft: ACTION tries to get his compiled files picked up in geiser instead of compiling them again in the fallback path. ft: Hm. There's a thread about this on geiser-users... Seems like geiser already does this (add to %load-compiled-path). ft: Yet, the REPL compiles to the fallback path in ~/.cache. Bummer. ft: (upon ",reload" that is) amz3: sneek: later tell wingo what kind of future is possible for a database system written in guile? sneek: Got it. amz3: is there any database system written in dynamic languages anyway?! neckb: hi amz3: neckb: o/ amz3: neckb: are you new around here? neckb: newish .. I had a long pause amz3: neckb: welcome back then :) amz3: neckb: what is favorite programming topics? amz3: neckb: what is your favorite programming topics? neckb: I'm looking for the author of wisp, I think I met him here, the last time neckb: wisp: https://bitbucket.org/ArneBab/wisp amz3: nowdays he is busy, and don't come often neckb: ah thanks for that info. are you by any chance a bit familiar with wisp? amz3: not really, but you can ask your question out loud, maybe someone will be able to answer neckb: my question touches the subject of the readability of s-exprs. I don't want to begin an argument here. kuhn: whitespace? what kind of mockery is this kuhn: :P amz3: fwiw, I never read flamewars (not started by me) in guile community... neckb: Me, almost always amz3: in guile community? amz3: I mean to say, guile community doesn't seems like "flammable" neckb: I will not repeat the whole word that got me in trouble every time, but the word begins with 'auto' and ends with 'tools' amz3: I hate autotools, it's on my todo list to get rid of them neckb: please please dont be next line a ':P' amz3: also, i am not alone amz3: I have proofs neckb: still not sure if \\s amz3: https://libreplanet.org/wiki/Group:Guix/GSoC-2018#Guile_based_build-tool amz3: what do you mean by \\s neckb: I was not sure if you're in a some kind of (mean) sarcasm mode amz3: I am not in scarcasm mode at all neckb: The very reason I got started with IRC was because I wanted to discuss autotools problems with guile. amz3: a lot of people think autotools is a thing of the past, even in gnu / guile community amz3: the thing is that there is no good replacement yet, that people agree upon neckb: I was telling the truth when I said, that I install a lot of packagen on a lot of different machines. neckb: and Guile is one of the most difficult packages to install. amz3: don't use autotools, use guix pack amz3: and guix binary install mwette: I hate automake; eons ago I wrote a tool that used M4 to define macros for use in makefiles. It provided functions, whereas automake relies on patterns. neckb: In my limited opinion the problem with Guile/Autotools is that I thing Guile follows the Gnu way of building things from the very ground to religously. mwette: sorry -- gotta go amz3: ah neckb: There are a lot of project that use Autotools, but not to the full extend and the might leave some generated files in the source tree. amz3: the maintainers do what they want with their project afaiu amz3: 'religiously' is not a fair argument tbh amz3: I saw several patches for autotools issues going inside guile amz3: maybe your particular issue is solved neckb: thats right, but I cannot think of better word, especially when I think back on my previous discussions here. amz3: like myself, I used to think that log message formating the gnu way, was a religious thing, right now I understand it's useful even I still don't like it amz3: sometime old stuff are good stuff neckb: but since you are open to some of my opinions. The other thing that bothers me a bit in Guile, that the source tree is (was?) litered with a lot of autotools files. In comparison , Git source tree is much cleaner. amz3: when my IRL manager (15 years of exp as 'dev') tells he doesn't know what unit testing, I am happy GNU project provides some guidelines about what makes a good software project amz3: neckb: make a patch :) neckb: My main programming language is Perl, but in many discussions I would not mention that. amz3: I don't understand why you concerned about autotools files neckb: People judge your for using Perl, on the one hand they are wrong, Perl is an old and very proven tool. neckb: but Perl is also crufty, and I understand people rejecting it when there are alternatives neckb: All these file don't bother me , but when the problems with autotools began, I had this impression of bloat. neckb: Ok, I try to insert some code neckb: 1 (letrec neckb: 2 (((add_rec i) neckb: 3 (if (== i s) len (add_rec i)))) neckb: 4 (add_rec len 0)) neckb: uuuhh, sorry ... neckb: So my question is can you build this form with wisp? I was not able to. amz3: idk amz3: maybe someone else will amz3: I gotta go do a nap amz3: see you later janneke: neckb: that doesn't parse for me justin_smith: I assume that you don't want add_rec to loop for all i that do not equal s justin_smith: in that case you want to call len, rather than making it a branch of the if justin_smith: s/loop/loop infinitely/ neckb: Sorry for the confusion. The code is not the problem, its just an example for a result that I like to achive with the Wisp tool from Arne. neckb: ok I have to take a little break e^x: what did you try? janneke: neckb: well, your code doesn't parse, so it may well be why you can't convert it to wisp neckb: sorry there is something wrong with the code I've posted, do you mind if I take another shot? mwette: /quit Javyre: are the foreign object slot names ever used anywhere? Javyre`: (testmsg plz ignore) Javyre: Hi, I'm working on porting guile to rust. It's in early stages and I'm porting foreign objects but I have a couple of questions cmaloney: Go ahead and ask your questions Javyre: Since im making safe bindings, I want to make slot types type-safe at compile-time, this turned out to be extremely complicated to do in rust and im considering just using one slot and having it point to a rust tuple type to have the same behaviour as having multiple slots Javyre: does using individual slots have any benefit in this case? amz3: Javyre: welcome, response time can be slow, I recommend you to stay around or come back later and say hi. We have sneek, a bot, that store messages for later retrieval amz3: Javyre: I have a few questions for you related to you work, may I ask them? amz3: sneek: botsnack sneek: :) CherryMan: amz3: I'm working with him, what do you need to know? amz3: the first question is: is there a public repository? Javyre: (here too) CherryMan: yes CherryMan: wait Javyre: github.com/tim-editor/guile-rs Javyre: low level bindings are auto generated with rust bindgen in /guile-rs-sys/ amz3: ok, I saw that repo around, I was not sure if it has real or serious, I am glad it is actually amz3: second question: does it allow to rust from guile or guile from rust? amz3: or both amz3: second question: does it allow to call rust from guile or call guile from rust? Javyre: well the goal is to bring the guile c api to rust with all of its functionality amz3: it seems to me, that what you are trying to achieve is allow guile to script and editor. Somewhat like elisp does with emacs amz3: ah ok Javyre: exactly like elisp yeah Javyre: but with a tiny core in rust Javyre: heavily inspired by emacs and vim of course amz3: very cool amz3: I wish you good fortune Javyre: thank you amz3: I am fiddling with databases, myself, using wiredtiger, I might need at somepoint to translate my code to rust and use guile as query language amz3: so our interest interect quite nicely CherryMan: feel free to contribute :) Javyre: well contributions would be very welcome :D amz3: also, I will gladly use a emacs-like editor Javyre: the goal is to be 'background agnostic' Javyre: so there would be an 'emacs-emulation' configuration module as well as a vim one amz3: :D Javyre: i love both editors and we wanted to bring the positive elements of both together Javyre: checkout our open issues on the guile-rs repo if you ever feel like contibuting c: amz3: I would like right now to contribute but 1) I don't know rust well enough yet 2) I don't know guile C api for embedding, that is I will contribute some day in the future... amz3: out of curiosity, why did you choose guile? CherryMan: there aren't many other projects we found like guile CherryMan: Guile is really well suited for our needs CherryMan: Javyre did try another rust-only lisp interpreter CherryMan: however there were some limitations Javyre: guile was truly perfect for our use-case yeah amz3: ACTION glad to hear that amz3: ACTION need to go back to my hacking now amz3: feel free to send a mail on the mailling list https://lists.gnu.org/mailman/listinfo/guile-user/ amz3: with your question(s) amz3: maybe guile-devel is better suited to your question CherryMan: didnt know that was a thing! thank you djcb: in ancient times, there was (ice-9 base64)... what do people use these days? amz3: industria amz3: sneek: what is industria amz3: sneek: what is industria? amz3: sneek: industria is a set of cryptographic libraries for r6rs, see https://github.com/weinholt/industria/ sneek: Okay. amz3: they are also libgcrypt bindings floating around, but I don't know if they support base64 djcb: thanks! but that requires external libs it seems; hmmm. amz3: seems like I need to know more about git internals to achieve what I want amz3: I have something that works like svn where every users have a exact copy of the remote server amz3: so, imagine there two users Alice and Bob amz3: we will assume they share a common repository, with same history, without branches amz3: Both alice and bob have access to three procedures, (add assoc1) -> uid amz3: ___ amz3: Both alice and bob have access to three procedures: amz3: a) (add assoc1) -> uid amz3: b) (ref uid) -> assoc amz3: c) (rm uid) amz3: d) (set uid assoc2) amz3: 4 procedures actually amz3: 'set' procedure is only valid if there is already an assoc with the given UID amz3: that must be returned previously by 'add' procedure, which returns a randomly generated identifier amz3: so, imagine alice and bob 'add' assocs to their database each on their own copy, the issue is it's not possible to avoid conflicts between parallel calls to 'add' amz3: since parallel calls to 'add' can return the same identifier amz3: it's even more obvious when 'add' instead of returning random identifiers, was returning autoincrementing integers amz3: so say bob, runs 'neon pull alice master' where neon is the name of the program I trying to come up with amz3: wow amz3: so, pull-ing will require to build a mapping of remote assoc ids with local assoc ids amz3: that's a good moment for someone to chime and say "use monadic crdts" amz3: also I will need a way to distinguish Foreign Key values, and change FK coming from alice with their equivalent locally amz3: afaiu there is no way to come up with a hash function, that will make thing easier aka. like git amz3: aka. content-adressable amz3: I am not sure where to look for more information amz3: this is a distributed peer-to-peer database issue amz3: I will try #gnunet amz3: O< amz3: _o< amz3: I think i have a solution rlb: guile-2.2 has been removed from debian testing (buster). rlb: I'll probably continue to poke at the crashes myself off and on, but if anyone upstream would like to help, I'll be happy to assist. Of course another option would be to skip the offending tests for the moment if they're deemed not critical. jlicht: hi guile! How can I deal with a pointer-to-a-pointer (**) in C using the dynamic FFI module of guile? Javyre: is the guile-devel list for devs of guile or ppl using the guile c api? ft: I think all usage related discussions are supposed to go to guile-users@. But I don't think I've seen that enforced too heavily. Some people also just cross post to both. amz3: jlicht what do you want to do with the double pointer? amz3: jlicht: can you provide the C code that you need to bind? jlicht: amz3: I got it to work in a way that is way simpler, so no need anymore jlicht: context: I was playing around with signalfd in guile programs jlicht: hmm, I am running into something silly though; my signal handlers are properly ignored according to my sigprocmask if I call e.g. `(raise SIGCHLD)', but if do `(kill SIGCHLD)', they are triggered regardless of my sigprocmask. Does guile do some weird things with its threads and signal handling perhaps? mwette: try sec 6.22.3 async interrrupts: it implies Guile uses levels of masking jlicht: thanks mwette, I'll have a look justin_smith: the docs mention a value _IOFBF which is used as a port mode, and this is used by a library I am trying to use, but guile built from master git complains it is not bound - is this a known thing? justin_smith: if I run 2.0.9 _IOFBF is bound to 0 daviid: justin_smith: you should not use master, unless you are willing to help to work on the compiler... checkout stable-2.2 instead, then see in the NEWS for diffs between 2.0 and 2.0 ... justin_smith: daviid: oh, that makes sense - I was trying to make sure scsh works with up to date guile which is why I built from master, but I'll check out the stable 2.2 branch instead amz3: master is Guile 3.0 manumanumanu: Can I have arbitrary precision floating point (not ratnums) in guile? not lloda: manumanumanu: that would be great. MPFR? racket has https://docs.racket-lang.org/math/bigfloat.html lloda: but it doesn't do generic ops lloda: (+ 1 (bf 1.0)) -> contract violation lloda: hm manumanumanu: for when you need bigfloats, that is something I could live with manumanumanu: I could probably write a decent interface to that. lloda: I'd use it amz3: o/ OrangeShark: hello everyone amz3: streaming (or streamable?) immutable databases ftw! Apteryx: what's the equivalent to 'ls' in a guile REPL? Apteryx: or, just in Guile ecraven: does guile have apropos functionality? ecraven: also, is there a way to get the function lambda list of any function? ecraven: more specifically, is the ,apropos functionality from the repl exposed as a function? and ,describe too? janneke: ecraven: have you tried something like: (apropos "list") ecraven: janneke: that just prints the info, I need it as a list janneke: also, see module/system/repl/command.scm ecraven: but I've just copied the command from command.scm, that works fine ;) janneke: you already answered your own question, good :-) ecraven: just for your info, https://github.com/ecraven/r7rs-swank contains a mostly working swank backend for guile (and other schemes). run ./guile.sh, and you should be able to M-x slime-connect RET localhost RET 4005 RET and have a working repl with auto-completion and an inspector ecraven: is there a way to get only the lambda list of a procedure? janneke: ecraven: what is swank? ecraven: ah, sorry, a slime backend (the emacs lisp interface thing) janneke: ecraven: slime is something like geiser, right? ecraven: yes jlicht: hi guile! Using the amazing bytestructures module, how can I 'get' my pointer out again? I would like to use my bytestructures-created structs as arguments to some wrapped glibc functions via `(system foreign)' :-) jlicht: nvm, I found out about `(bytestructures guile ffi)'. lloda: e^x: It seems so. Please send a message to bug-guile@gnu.org. Labu: Hello ! roelj: Is it possible to get a FILE* from a Guile port, so that it can be passed to a foreign function? amz3: roelj: if you are looking for the file descriptor associated with a port, there is 'fileno' procedure amz3: or 'port->fdes' roelj: And that returns a number, not a pointer. How do I go from file descriptor to a FILE*? amz3: I think FILE is a number actually amz3: I need to check roelj: So (scm->pointer ...) should do the trick? amz3: oops sorry amz3: loooking at 'man fdopen' it seems like fd and FILE are different things roelj: Yeah, I just realized this too. So, I can pass the file descriptor, and then I'll have to do fdopen on it to get a FILE* amz3: maybe you can 'fdopen' the fd returned by guile, idk, maybe some else knows better amz3: yes maybe roelj: Well, thanks. I'm going to give this a try. amz3: roelj: btw, you don't need 'scm->pointer' an integer, if the C function expect an int, you can pass the scheme number directly to ffi procedure it will be handled correctly roelj: Well, it expects a FILE*, not an int :-) roelj: Uhh.. how do I use the 'fdopen' C-function? Can I just dynamic-link glibc? amz3: yes civodul: roelj: there's an 'fdopen' procedure in Guile roelj: civodul: But it returns a port, not a FILE*, right? civodul: right, FILE* are libc-only things civodul: yeah i guess i misunderstood what you were looking for :-) roelj: That's alright :). So I wrote a C function that takes a file descriptor, then does: FILE* file = fdopen (fd, "rw"); return file; roelj: Then I loaded it with dynamic-func, but when calling it, it doesn't actually write to the file. roelj: And the C function calling fprintf (file, ...) returns -1 --> So something went wrong. roelj: Any ideas what might go wrong? roelj: Because I am out of clues amz3: strace might give more clues roelj: Ha! good idea civodul: roelj: do you really need FILE*? civodul: because then you have to use exclusively FILE* functions civodul: and FILE* does caching, so writing to a FILE* doesn't take effect immediately roelj: civodul: Yes, I'm trying to write an interface to a C library. And there's this one function that takes a FILE* to do all of the printing.. roelj: Too bad. Even when using fopen from glibc, the fprintf eventually fails. :( roelj: Well, it was a fun experiment. bavier`: amz3, OrangeShark: is it possible to do a shallow clone with guile-git? bavier`: amz3, OrangeShark: nvm, I couldn't find anything in the texi documentation, but found the procedures in the modules OrangeShark: bavier`: I don't believe libgit2 supports shallow clones bavier`: OrangeShark: ah, indeed. there are a few open bugs/issues/feature requests bavier`: hmm, this makes things more difficult jeko: yooooo wingo: moin :) jeko: hi! civodul: hey hey! civodul: wingo: re Fibers, another "would-be-nice" thing that came to mind: making it possible to compose i/o operations like "normal" operations in a choice-operation civodul: which i think isn't possible currently because i/o operations are not actual "operations" civodul: just a thought for later :-) wingo: civodul: yes, basically i think that means making a read-available-operation and a write-available-operation or something wingo: hard to know tho wingo: i mean usually you want to read more than one byte, right? so you want to read a whole term of some grammar wingo: in that case you would do well to just spawn off a fiber and do a normal read wingo: and if the read completes, send the parsed datum or chunk or whatever via a channel civodul: you can always do that, indeed civodul: yeah maybe that makes more sense after all wingo: linux is tricky too, it could be that select/poll/whatever returns "this fd is readable" but then you try to read and it blocks civodul: really? wingo: yeah, let me find the reference. civodul: i'm interested, because the offload bug i'm hunting looks like this wingo: "Under Linux, select() may report a socket file descriptor as "ready for reading", while nevertheless a subsequent read blocks. This could for example happen when data has arrived but upon examination has wrong checksum and is discarded. wingo: There may be other circumstances in which a file descriptor is spuriously reported as ready. Thus it may be safer to use O_NONBLOCK on sockets that should not block. wingo: " wingo: that from select's man page under the "bugs" section wingo: if the fd is nonblocking, that doesn't block fibers wingo: but it does mean that the system "commits" to one operation among a choice operation, if that's how you structure things civodul: uh civodul: interesting wingo: when reading from multiple fds, to my mind it's better to spawn a thread per fd to parse that data and proxy to a channel; just my instinct tho wingo: er wingo: s/thread/fiber/ civodul: yeah, probably civodul: i don't remember where it was that i wanted that feature, i'll see if that comes up again :-) civodul: the libc manual doesn't mention that shortcoming civodul: that's terrible wingo: that's what samth's opinion was too :) wingo: anyway, doesn't matter. the kernel has already buffered data per-operation. having to read or parse it into a buffer on the fibers side doesn't fundamentally change anything afaics civodul: sure, i was just considering the consequences in a more general context wingo: so select-over-ports as a select-over-channels-that-parse-the-data seems a fine enough abstraction civodul: yes wingo: in a more general context it just means you need O_NONBLOCK, which you need for reliability anyway :) wingo: and which should be OK if you are using select in the first place civodul: yes, though you would expect this simple piece of code to just DTRT: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/ssh.scm#n102 civodul: now i have to throw some O_NONBLOCK and catches and all in there, for something that should really be trivial :-/ wingo: in theory, though perhaps with AF_UNIX there's no problem wingo: but are you sure that's what's going on? wingo: like you have determined that the problem is in that code? wingo: just wondering of course civodul: not entirely sure, but that looked plausible wingo: civodul: is it deadlocking? wingo: you could be running into that i/o pipe bug. can be the case where e.g. you have the pipe creator which is waiting for a write to complete, but on the subprocess side of things it's producing output as it reads from the input, and it fills up the return side of the pipe and is ultimately blocking on the pipe creator, waiting for it to read off some of the return buffer wingo: the solution would be to expose both sides of the pipe as separate ports and operate on them concurrently via fibers wingo: or, use threads civodul: wingo: the process running the select loop above is stuck in read(0, ...) civodul: i thought that this "couldn't happen" because it reads only if select says the FD is ready wingo: exciting wingo: i wonder what the deal is civodul: found a bug of Scheme-level 'select' vs EINTR, though it may not be the one that's hurting me in guix offload civodul: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30368 cmaloney: tzag jlicht: hi guile! OrangeShark: hello jeko: hi guys amz3: o/ jlicht: o/ jlicht: I just started playing around with the guile FFI (which is loads of fun btw), and am currently playing around with marshalling my types around. Am I correct in understanding that any custom structs are express as void* as far as `pointer->procedure' is concerned? jlicht: and how do I express the `const'-ness of certain argument types wrt `pointer->procedure'? catonano`: jlicht: hhave you cecked that Bytestructures covers your case ? I'm not sure I understand your question but when I had to deal with a custom struct in C Bytestructures was extremely useful catonano`: jlicht: https://github.com/TaylanUB/scheme-bytestructures/releases/ jlicht: catonano`: Thanks. I was already making use of it a bit, but am new to trying FFI's of any kind. I _think_ that I just can deal with my specific case as an opaque structure, so void* works out okay enough. Maybe I can use bytestructures if I need more control over what is happening :-) jlicht: If I wanted to play around with signalfd in guile, what would be the easiest way to do this? Like calling the right functions dynamically, building a part-c-with-libguile wrapper or even directly making changes to a local copy of guile? civodul: jlicht: i would create bindings to libc's 'signalfd' using the FFI civodul: in shepherd you can stick that in (shepherd system), if that's what you're looking at :-) jlicht: civodul: guilty as charged ;-) jlicht: thanks civodul: heheh jeko: I am looking for a way print a file line by line with all lines prefixed with the line number. actually i have a list containing all the lines as string from the file. dsmith-work: Morning Greetings, Guilers jeko: dsmith-work: Hi ! rain1: you can use for-each to go through each line rain1: e.g. (for-each (lambda (line) (display line) (newline)) lines) rain1: then you get a counter for the line number rain1: (let ((counter 1)) (for-each (lambda (line) (display counter) (display line) (newline) (set! counter (+ 1 counter))) lines)) dsmith-work: I keep forgetting that guile has channels now. jeko: rain1: I have to test it. thank you very much rekado: jeko: you can also use named let instead of mutating the counter: rekado: https://paste.debian.net/plain/1009068 stis: haya guilers! rain1: hi dsmith-work: stis: Hej! amz3: \\o/ amz3: time for some guile hacking! manumanumanu: stis: keps ohoj! manumanumanu: What is going down? manumanumanu: is there anything like case but with equal? cmaloney: ? manumanumanu: case uses eqv? manumanumanu: but I need it to use equal? amz3: manumanumanu: ice-9 match can emulate that using (? string? value) IIRC manumanumanu: amz3: sweet, thanks amz3: isn't plain match what you are looking for? jeko: plop e^x: hi, the online manual lists the procedure peg-string-compile. it is not exported by module (ice-9 peg string-peg). is this in error? e^x: online manual (under Compile Functions): https://www.gnu.org/software/guile/manual/html_node/PEG-API-Reference.html Chaos`Eternal: hi all amz3: hi civodul: hey amz3 :-) cmaloney: tzag dsmith-work: Hey Hi Howdy, Guilers manumanumanu: Good evening! amz3: o/ Labu: hello amz3 jeko: Hello guys !! rain1: hey :) janneke: hi rain1 rain1: hiya! how goes :) amz3: héllo all rain1: yo amz! amz3: yo rain1, are you still fiddling with minikanren? rain1: not at the moment, i will like to do more with it but at the moment im making a PEG parser amz3: oh amz3: I was at guix event at fosdem rain1: awesome! amz3: yeah rain1: I am looking forward to seeing the fosdem talks online amz3: too short tho rain1: how did it go? amz3: very well jeko: haha I missed the guix event jeko: I came one day too late lol jeko: I was at work anyway jeko: too sad :( jeko: I left FOSDEM in saturday afternoon, went to the ICAB and then realized it was the wrong day jeko: <-- dummy Javyre: CherryMan: test plz ignore manumanumanu: Good evening amz3: and=> is very awesome manumanumanu: who's macros? manumanumanu: I wrote an and~> a long time ago with cut-like syntax extensions manumanumanu: so (and~> 5 (- 3) (< 1 <>)) would be #t manumanumanu: implicit insertion to the left, but it also supported <>-substitution, and even <...> amz3: interesting amz3: manumanumanu: what do you mean by "who's macros?" manumanumanu: Who wrote the macro? manumanumanu: I originally wrote mine for chez: https://bitbucket.org/bjoli/nietzsche/src/1769998a800955d5831aa7c0c8b3c31ba00f7050/syntax/threading.scm?at=default&fileviewer=file-view-default amz3: manumanumanu: it's a guile macro manumanumanu: the extended receive mentioned in the comments are just an extra clause for receive that expands (receive _values-producer_) into (call-with-values (lambda () _values-producer_) list) manumanumanu: built in?? amz3: manumanumanu: builtin manumanumanu: oh, I thought it was a threading macro :D :D manumanumanu: sorry amz3: manumanumanu: you have _some_ experience writting macros :D manumanumanu: I am getting quite proficient actually :) amz3: I can see that :) amz3: I never wrote a macro that use another macro on purpose manumanumanu: the thing is, if you want to serious work with syntax-rules, that is what you have to do manumanumanu: and for some things, it is the easiest thing to do wint syntax-case as well manumanumanu: amz3: btw, have you ever used srfi-2= manumanumanu: ? manumanumanu: and-let* amz3: no manumanumanu: my god, you are in for a treat amz3: it seems like the generalized and=> that was proposed in guile manumanumanu: it works like let*, but if any of the subsequent forms return #f, it stops evaluation and returns #f amz3: nice amz3: https://srfi.schemers.org/srfi-2/ amz3: I am just getting used to and/or/and=> to handle errors manumanumanu: for short scripts I use it with false-if-exception amz3: I don't like let* very much for some reason amz3: it reminds me of python code ^^ manumanumanu: let* is my best friend. amz3: why is that? manumanumanu: because subsequent bindings are common, and using nested lets suck. manumanumanu: and it is more concise than using define manumanumanu: and-let* however is my bestest of friends. amz3: :) amz3: I will study and-let* manumanumanu: the implementation in srfi-2 is hard to understand. look at the one in the guile source tree if you want to see the soource amz3: I don't read much code :/ amz3: I will think about it mwette: /quit amz3: ACTION fought procrastiation, fear of failure & rejection to implement complete sign up & sign in workflow amz3: at last amz3: https://framagit.org/a-guile-mind/culturia.next/commit/a2599b0170826736eafb6a1cde35b2243bc7531f cmaloney: amz3: Congrats! amz3: tx! amz3: btw security, is not an after-thought... I did not implement csrf protection yet, after reading django code and csrf wikipedia article I understand better why people recommend no-script Labu1: So big that I'm lost in, thx your help I find all what I want to find tcolgate: hi, don't suppose I could ask some non-guile specific scheme questions? (inspired by the little schemer) tcolgate: I'll take my Qs to #scheme I think amz3: the gnunet bot will for some go based logger, maybe it's time to write our own bot... amz3: will be replaced amz3: Labu: FWIW, I almost never use optional arguments for some reason Labu: hello amz3 Labu: I don't understand. optional argument ? amz3: Labu: sorry, I mixed conversation amz3: Labu: what are you trying to do using guile? Labu: I love guile Labu: amz3 Labu: at now I try to make a restfull ws with Labu: I began with the router MaliRemorker: i tried to submit a bug report to guile-bug@gnu.org and didn't get any automated feedback. Is this expected behaviour? Labu: MaliRemorker: with email ? MaliRemorker: Labu: yeah, with email MaliRemorker: as a patch MaliRemorker: bug-guile@gnu.org, pardon MaliRemorker: not guile-bug MaliRemorker: (but i did send to a correct email address) Labu: it's take a while wait some hours MaliRemorker: good to know amz3: Labu: I do webdev too, don't hesitate to ask question Labu: ok thx amz3 did you made a lib or framework to dev with guile ? amz3: Labu: I am putting something together, but it's missing some stuff like csrf protection, documentation and a nice theme amz3: I will try to publish something tonight amz3: Labu: are you subscribed to the mailling list? Labu: ok nice amz3 ! Labu: I am not subscribed to mailling list, sadly amz3: well, I will ping you via IRC then Labu: ok thx amz3 Labu: I stay around amz3: Labu: you know what I am too lazy to do a release right now, look at this project https://framagit.org/a-guile-mind/culturia.nexthttps://framagit.org/a-guile-mind/culturia.nexthttps://framagit.org/a-guile-mind/culturia.next amz3: oops amz3: https://framagit.org/a-guile-mind/culturia.next amz3: Labu: it's mostly snarfed from 'guix web' I added a few helpers, see src/web/ directory amz3: Labu: you can run the app using: cd src && sh web.scm amz3: Labu: see at the bottom of web.scm how the router is done, it's a 'match' over spitted uri path components Labu: thx amz3 I am looking Labu: oh! framasoft has a gitlab Labu: nice amz3 Labu: what I try to do it's a router factory wich take an associative list of paths with handler associated and return a router like yours Labu: what is guix web amz3 ? mwette: jobs mwette: oops -- sorry Labu: ah ok guix the package manager amz3: Labu: How do you plan to implement parametric urls? Labu: amz3 it's a good question. I don't know yet. I began yesterday amz3: well, be aware that I tried that way and it's difficult Labu: amz3: ok Labu: my first idea would be to delegate this two function associated with the path amz3 Labu: to a* Labu: to the* Labu: and parsing path to search specific token Labu: "/example/ amz3: Labu: it's not worth the trouble, match based router can achieve a similar purpose Labu: amz3 the problem is indeed the router which must handle dynamic url Labu: amz3 another thing if I want to be resource oriented I must define method (GET, POST, PUT...) in the resource itself Labu: I don't know I do that yet Labu: how I'll do that yet amz3: in the resource itself? amz3: I am not sure what do you want Javyre: Javyre: Hi, the manual strongly recommends *not* using finalizers, but I need to have destructors for the foreign object's slots... is there a cleaner way of doing this? spk121: Javyre: in my humble opinion, finalizers are the way to go if you need finalization. They are no problem if they can be called at any time from any thread after you're done with your foreign object. spk121: But, your finalization should be a dead simple thing: a 'free' or a 'close' or whatever. And it should only touch the specific foreign object in question. Labu: amz3 in a rest point of vue Javyre: what about the allocations? guile won't be able to properly judge how much memory im using Javyre: right? spk121: Javyre: if you alloc outside of guile and don't use bdw-gc for allocation, you need a finalizer Apteryx: Is it good practice to raise an exception in a match clause that unexpectedly doesn't match anything? What's the idiomatic way to raise an error in Guile? Apteryx: (error ...?) :) amz3: good question spk121: (error ...) is easiest. It throws a misc-error. amz3: well, the problem with error is that it always throw misc-error spk121: scm-error if you want a specific type of error: wrong-type etc, Apteryx: spk121: OK, thanks! Apteryx: I see many places in Guix where we use match clause without acting on the 'unexpected' case. This seems equivalent to writing IFs considering only one branch, which is not very robust. It might break farther with cryptic errors or it might run with undefined behavior ;) Apteryx: Oh! I'm wrong. If you only include one match clause, the error throwing mechanism is already built-in :) Apteryx: From the doc: If no clause matches, throw an exception with key Apteryx: ‘match-error’. Apteryx: that explains it. Sweet! OrangeShark: dustyweb: we would need to get an immutable hash table implementation in guile rain1: isn't hash table log(n)? OrangeShark: rain1: immutable hash tables are log(n) rain1: what about a mutable one? OrangeShark: they are normally o(1) rain1: wow! OrangeShark: immutable ones are generally stored as a tree data structure OrangeShark: https://github.com/ijp/pfds is a library of immutable data structures in scheme. There is hamts, which are popular to use for immutable hash tables rain1: im not sure why you would want an immutable one, what if someone wanted to edited the parsed json OrangeShark: you can edit them, but it creates a new hash table OrangeShark: it might seem inefficient because you think it is copying the entire hash table, but you can actually share parts of the hash table which don't change daviid: for those who would not know, and spoke about immutable hash today, might be nterested to look at ijp's pdfs - https://github.com/ijp/pfds daviid: i'm under the impression wingo also wrote some, but if that is correct, then I lost the link (was it fash and fectors...?) OrangeShark: daviid: I already posted it :) There is some good papers linked in the readme if you want to learn more. ijp: daviid: wingo's are in guile already ijp: e.g. (language cps intmap) daviid: ijp: oh, cool! ijp: hidden away where no-one else will use them daviid: ijp: if he uses these in guile, likely they will be there for good and proper maintained .. maybe one day they are part of the API and documented ... don't know ijp: probably, but intmap and intset are kinda specialised ijp: I don't see much code that doesn't deal with (language cps) using it ijp: that is meant to be not in the present tense but the future one daviid: maybe dustyweb and davexunit could merge their (json) work and use your hamt implementation ... then we can make it part of guile-lib ... daviid: dreaming loudly... :) davexunit: guile would need a primitive immutable hash map with read syntax davexunit: I'm still partial to alists, because once you have the json parsed you almost always convert it into another data type anyway dustyweb: davexunit: the one advantage to alists IMO is dustyweb: sometimes it's nice to preserve the ordering as you got it dustyweb: well, one advantage in my use cases :) davexunit: :) pmikkelsen: Hi, are there any good online resources you can recommend for learning guile (or scheme in general)? I already have a strong knowladge of functional programming MaliRemorker: pmikkelsen: i would recommend reading Guile Reference in info format MaliRemorker: pmikkelsen: The Scheme, Programming Language by Kent Dybvig is a pretty good Scheme reference/learning book MaliRemorker: pmikkelsen: available online, i think MaliRemorker: pmikkelsen: and, lastly, if you have loads of time on your hands Structure and Interpretation of Computer Programs by Abelson, Sussman and Sussman MaliRemorker: (also available online MaliRemorker: ) MaliRemorker: pmikkelsen: if you're already a seasoned coder, i'd recommend mixing Guile Reference (texinfo) with Dybvig's book pmikkelsen: MaliRemorker: thank you very much! MaliRemorker: you're welcome MaliRemorker: How do i extract information about the current source i'm currently reading with `read'. In subsection 'Reading Scheme Code' there is list of read-options of the Scheme reader. One of them is about recording the source expressions. How do I extract this position information? MaliRemorker: Also, what does the `copy' read-option actually do? Perhaps read an expression from the file without moving the pointer? MaliRemorker: subsection above refers to the subsection of Guile Reference MaliRemorker: (2.2.3) dsmith-work: Happy Friday, Guilers!! dsmith-work: MaliRemorker: https://www.gnu.org/software/guile/manual/guile.html#Source-Properties MaliRemorker: thanks dsmith-work jeko_: Hi Guilers ! dsmith-work: jeko_: Hey hey jeko_: dsmith-work: Hey :) jeko_: Do you know if I can watch FOSDEM conf in live tomorrow? dsmith-work: No idea, sorry jeko_: Arf OK thank you ^^ bavier: guile potluck soon? Labu1: hello, how can I get client addess from an ? dsmith-work: Labu1: This perhaps? https://www.gnu.org/software/guile/manual/guile.html#index-getsockname Labu1: hello dsmith-work in fact I try to get this information from request object in an handler given to run-server https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Web-Server.html#Web-Server Labu1: I have nothing in (request-meta request) Labu1: if I get (request-port request) I get an so I thought perhaps I could get addr from ths Labu1: oh ok I got it Labu1: thx dsmith-work dsmith-work: Labu1: np. Tha manual is actually pretty good. davexunit: dustyweb: soooo remember that I time I wrote a json module but it never got merged so everyone just uses some hacked version of it or guile-json? I have some thoughts... davexunit: 1) we should probably just do what racket does and use vectors to represent json arrays and alists for objects davexunit: 2) we should do what sxml does and use symbols for object keys davexunit: 3) I can't remember what you chose, but I think the symbol 'null' is as good a value for the json null value as anything else dustyweb: davexunit: I don't think racket does that dustyweb: davexunit: not from where I've been using it dustyweb: davexunit: racket uses immutable hasheq tables for the dictionaries dustyweb: davexunit: and lists for the lists dustyweb: davexunit: because racket has builtin reader/writer support for immutable hashtables... a good idea! we should follow their lead :) dustyweb: imo that's what we should actually do: dustyweb: get real immutable hashmaps that we're reasonably happy with dustyweb: and use *those* for the object maps dustyweb: way better than O(n) access :) MaliRemorker: The first bit of my code, a guile module that facilitates writing modern Fortran code with a help of Scheme, is now online https://gitlab.com/codetk/schemetran MaliRemorker: The rest, however .. MaliRemorker: a much bigger program used for generating Fortran programs that specialise in solving certain kinds of partial differential equations in two dimensions has still some way to go MaliRemorker: until its publishable MaliRemorker: i'm trying to generate documentation from the code itself - i've used documentation strings inside define regions -- and i've seen that guild supports something like that via doc-snarf MaliRemorker: but it doesn't capture the doc string, unless comments like `;;' are also included with the definition MaliRemorker: So, short of writing doc-snarf myself, is there any way around this? MaliRemorker: i'm talking Guile 2.0/2.2 MaliRemorker: By the way, is there a place where can register new-born baby Guile projects? cmaloney: tzag cmaloney: tzag cmaloney: feh OrangeShark: hello everyone ecraven: why does (exit 0) not actually exit guile? ecraven: hm.. strange, on the repl it works, just not in my program davexunit: dustyweb: O(n) access is faster in nearly all cases davexunit: but last I checked the Racket docs they used vectors for arrays, that's what I was talking about for copying Racket. davexunit: but since everyone has their own preference for how json should be represented I think I'm just going to keep stashing my own preferred implementation in my projects for now Apteryx: Has anyone tried comparing compilation times between Guile & G++? Given that C++ is statically typed, it can probably be faster, but I'm curious. It could be our ideal benchmark (be as fast as G++) ;) OrangeShark: davexunit: what about allowing users to pass their preference? MaliRemorker: Apteryx how would we compare that? MaliRemorker: raw text as a measure? :) MaliRemorker: i'd rather like more optimised (byte)code versus quicker compile times MaliRemorker: heck, even the interpreter is amazingly fast Apteryx: yes, something like that. 10000 lines of a "similarly" complex program or something. MaliRemorker: at least on my i7 Apteryx: or 1000 lines, it doesn't really matter dsmith-work: {appropriate time} Greetings, Guilers MaliRemorker: greets rain1: hiya MaliRemorker: okay, i come here once, or twice per year so maybe i shouldn't return the greetings MaliRemorker: ACTION feels like a proper guiler though Apteryx: MaliRemorker: Guile faster compilation speeds (as well as lower memory footprint) would benefit Guix enormously! It's using more than 1GB and needs like 30 minutes on my i3 class hardware. Guile 2.0 used to take maybe 250 MB ram and was maybe twice as fast to compile. MaliRemorker: i wouldn't know. still not using guix frequently Apteryx: So, if we had some benchmark to see how we compare with other serious and complex compilers such as g++, I think it'd be interesting! It'd gives us an (vague) idea of how much faster we could be. davexunit: OrangeShark: I don't really like that idea. nothing else really does this. davexunit: like, sxml is sxml davexunit: it's consistent and it works well davexunit: IMO parsing JSON to primitive guile types (cons, numbers, vectors, strings, symbols) is the best move MaliRemorker: Apteryx but g++ complies to machine code from a more primitive language; rather some other bytecode compiler ... javac+clojure? davexunit: Apteryx: turning off compiler optimizations will help reduce that time davexunit: guile 2.0 did roughly no optimization so it compiled things a lot faster OrangeShark: davexunit: but then everyone has their own forks because they prefer some different data types davexunit: OrangeShark: that can all be put to bed by including one implementation in guile OrangeShark: but now which one? :P davexunit: every language has a basic json module in their standard library. davexunit: the one that can be implemented *today* without changing other parts of guile cmaloney: BASIC doesn't. ;) MaliRemorker: from reddit: For school I have been tasked with the creation of a text based game in QBASIC. However its eccentric features have left me confused and I would like to ask how would one go about doing this? Particularly the creation of something like a json parser for a more dynamic level creation experience. Thank you in advance! MaliRemorker: that feature is requested cmaloney Apteryx: MaliRemorker: agreed it's an imperfect comparison but an interesting one non the less. Apteryx: davexunit: I think some optimizations are already turned of for Guix. cmaloney: I'm more worried about Atari BASIC. MaliRemorker: :) davexunit: MaliRemorker: qbasic was my first language davexunit: and I spent a lot of time writing 2d games in it davexunit: which was fun because to render efficiently you got to write your own subroutines to poke the right buffer in memory MaliRemorker: davexunit: qbasic was my first language, too. bit i was only writing textual games MaliRemorker: since i discovered turbo pascal (5.0) MaliRemorker: soon afterwards davexunit: I went from qbasic to c++ davexunit: how times have changed :) MaliRemorker: oh, yeah MaliRemorker: well, i didn't have a pirated copy of c++ compiler anywhere near in my country which was under economic sanctions at the time MaliRemorker: also, no acces to internet MaliRemorker: just few computing journals :) Labu: Hello Labu: I didn't find where usage of optional key word argumen is documented in the documentation. I find documentation about how I can build function which take these but nothing about use it. Labu: ok I found it manumanumanu: Labu: Did you manage to solve everything? manumanumanu: Labu: I always find the procedure index very helpful: https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html#Procedure-Index Labu: hello manumanumanu I found it when just I have written my message manumanumanu: great! if you ask a question, be sure to stick around! some of us are slow to reply :D dsmith-work: Indeed dsmith-work: Snappier now, but it used to be days. Labu: indeed procedure index is very helpful but I was looking for a general usage so I had pain to find what I want to known Labu: by chance guile documentation is very good Labu: It's me again... Labu: I have this little test code whch throw an error from web lib Labu: https://pastebin.com/v4Buybbj Labu: the error is "unexpected body type" but it's a string Labu: If I try with simple string I don't get this error amz3: Labu: what is the backtrace? Labu: In web/server.scm: Labu: 283:29 1 (#) Labu: In unknown file: Labu: 0 (scm-error misc-error #f "~A" ("unexpected body type") #f) Labu: ERROR: unexpected body type Labu: sorry Labu: https://pastebin.com/0n97LdfC Labu: my version is a BSD port and is pretty old (2.0.14) Labu: same error on debian with 2.0.13 spk121: I made a printf in guile. haha. spk121: (sprintf "%10.2f %10.2f %c %10s\\n" 3.14159 1.414 #\\x "hello") spk121: $18 = " 3.14 1.41 x hello\\n" Labu: when I try in REPL templatize itworks fine Labu: *templatize works fine Labu: spk121: great do you prefer C string formating style ? the common lisp style is good too there are surely some implementation for guile daviid: spk121: nice! but why? format does all that (and much more...?), curious, what motivated you Labu: daviid: I don't know guile hasa built in format features. it's great Labu: other scheme implementations don't implement it spk121: labu: Guile's format it better. But when porting C to scheme, I want the output to be exactly the same. spk121: daviid: to help me port a program from C to scheme and get the output exactly the same. Labu: ok spk121 daviid: spk121: and that is not possible using format? daviid: spk121: nerver mind, i was just curious daviid: bbl spk121: daviid: very possible, but, annoying in practice to get the format exactly right daviid: spk121: i think alex shinn wrote a sophisticated printing 'lib', can't remember where it is daviid: but you probably know that of course... daviid: spk121: i see that sprintf could be nice for newbies, format is a bit intimating at first... spk121: daviid: for example the guile format string for "%f" in C is "~,6,2,,,,'ee" which is a bit unwieldy spk121: erm "%e" I mean. 6 digits of precision, two digits of exponent, lowercase e exponent. daviid: yes, I use a few of these unwieldy expr in guile-cv :) dustyweb: davexunit: https://docs.racket-lang.org/json/index.html#%28part._.J.S-.Expressions%29 dustyweb: (string->jsexpr "{\\"hi\\": \\"friend\\", \\"pets\\": [\\"cat\\", \\"puppy\\", \\"rat\\"]}") dustyweb: '#hasheq((hi . "friend") (pets . ("cat" "puppy" "rat"))) dustyweb: so see, immutable hash tables and lists dustyweb: #hasheq(...alisty lookin thing...) dustyweb: is reader syntax for immutable hasheq tables dustyweb: strings are symbols dustyweb: IMO this is The Right Way To Do It dustyweb: O(n) is faster except when it isn't, and when it isn't is a much more severe scenario than the case where it's an operation I think dustyweb: ACTION works with some truly large json documents dustyweb: s/an operation/an optimization/ drduck: Is guile written mostly in Go? taoqy: drduck: C wingo: guile is mostly written in schema actually :) wingo: *scheme djcb`````: drduck: the '.go' file extension is a coincidence, preceding golang dsmith-work: Wednesday Greetings, Guilers ArneBab: I’ll be offline for some days, our current ISP left the area and the new one takes a while to re-establish our connection. rain1: im super impressed by the guile PEG implementation rain1: the way it makes up an AST is very cool rain1: with practically 0 work rain1: https://www.gnu.org/software/guile/manual/html_node/PEG-Tutorial.html#PEG-Tutorial the passwd example here shows what I mean rain1: just <-- vs <- vs < very powerful! manumanumanu: rain1: that is pretty neat! I have long thought about porting PEG-markdown to guile just to see how well it fares :D manumanumanu: hopefully it would be worth the effort, but I frankly don't know whether (ice-9 peg) is any fast rain1: yeah I don't think PEG is a good choice for efficiently processing a large file rain1: but it is really nice and quick like regex amz3: whohoo, I made a single input text, in a single form of a single page (with an error message) amz3: html is boring amz3: well, the styles can be re-used but still... amz3: I have a very brillan idea, this time it's real, I picked up a very simple project and I will try to make it useable by other people amz3: simply said, I will try to finish a project \\o/ amz3: the good news is that I will be able to re-use what I've done so far on the culturia project amz3: I don't need to throw away 3 years of work... OrangeShark: amz3: ohh, how will you reuse it for this new project? spk121: So in today's nonsense hack, I've been trying to implement a C-like printf in scheme, which is harder than I thought. spk121: C printf does hex floating point, which in my many years, I've never seen used. Who knew? amz3: OrangeShark: I trying to implement a blog, so culturia will be used to search for blog posts amz3: I know there is a static web blog called haunt, it's just that I need to make something dsmith-work: Wow. hex floating point. civodul: spk121: you seem to be looking for trouble :-) civodul: i didn't know that either spk121: wingo: the procedure module-remove! is undocumented. OK to use it? ijp: spk121: I would expect so, although maybe the best thing would be to document it :) ijp: I don't think the module api is going to change much ijp: or rather I hope not, because it'll be a pain if it does spk121: ijp: I guess that it would be pretty stable. On the other hand, removing things from modules isn't common. ijp: yeah, I think I've done it maybe once markx: Hi guys. markx: What's the recommended way to install guile libs on mac os? amz3: héllo all :) guile-guest1: Hello there. guile-guest1: I'm new to Guile and I need some help on a problem dsmith-work: {appropriate time} Greetings, Guilers wigust: dsmith-work: \\o/ cmaloney: Greetings programs rain1: :) dsmith-work: cmaloney: Bring in the Logic Probe! amz3: Logic Probe! dsmith-work: amz3: (a quote from the original TRON movie) dsmith-work: Which I assumed "Greetings Programs" was also amz3: ah ok amz3: that's funny anyway cmaloney: :) OrangeShark: hello everyone amz3: o/ amz3: so using threads with gnunet is not "legal", I need to embedded gnunet loop inside guile-fibers ArneBab_: amz3: could you use single-threaded fibers instead - and just not use threads? amz3: Single thread fibers won't help because the issue is that gnunet takes the control of the thread amz3: right now, I run gnunet in another thread amz3: but it doesn't have somekind of "inbox" so that I can push to the gnunet event loop, new tasks amz3: the other solution, is to avoid the gnunet event loop amz3: or to wake up the gnunet event loop every 1 sec for instance, to read its inbox amz3: well, I think I will just avoid the gnunet event loop amz3: it will be better in terms of performance i think manumanumanu: Hej hopp stis, what is happening? daviid: amz3: another possibility would be to read guile-async2 code (the part that integrate with glib loop), then write a guile-async2 branch that would do the same but using the gnunet loop (or emulate what guile-async2 does using fibers...) not trivial of course but ... amz3: daviid: yes, I should look guile-async2, tx. stis: maxwells equations ... cmaloney: and hammer Apteryx: hello! Does http-get support https (TLS) in Guile 2.0? Apteryx: So far I'm getting this: 400 The plain HTTP request was sent to HTTPS port when using 'http-get' inside a mcron job which uses Guile 2.0. Apteryx: comparing the info manuals of 2.0 vs 2.2, it seems HTTPS came later than 2.0. ecraven: should (exit 0) actually exit the guile process? it seems to hang until I enter C-d ecraven: guile 2.2.3 OrangeShark: manumanumanu: in C, 0 is false while 1 is true, check out stdbool.h. You are thinking of unix, where 0 means success and anything else an error. jlicht: is there a general guideline on when to use hash-tables vs alists? lloda: jlicht: alists cost O(n) to look up. If that's not fast enough (likely for a big list), use a hash table dsmith-work: {appropriate time} Greetings, Guilers jlicht: thanks lloda. That makes sense then :-). wingod: hey guys wingod: i'm going to start learning scheme wingod: and i wanted to know if you can tell me what edge guile gives over other implementations cmaloney: wingo: Did you just fork a daemon process? :) dsmith-work: One that doesn't know scheme? cmaloney: Apparently it knew of IRC but not scheme ArneBab: sneek: later tell wingod: there’s a great post about the different schemes in the wingolog: https://wingolog.org/archives/2013/01/07/an-opinionated-guide-to-scheme-implementations sneek: Got it. ArneBab: sneek: botsnack sneek: :) dustyweb: hehe dustyweb: wingod ft: :) dsmith-work: Maybe wingo spawned a sub-process? (had a baby) dsmith-work: wingo: You got kid(s) yet? OrangeShark: ArneBab: I opened up a pull request for with-guise-and-guile. Fixed a typo I had in my article spk121: Hi. Are local-eval environments and module environments the same thing underneath? Is one implemented in terms of the other? civodul: wingo: it seems my code occasionally gets stuck in schedule-task-when-fd-readable: https://paste.debian.net/1007891/ ArneBab: OrangeShark: thank you! ArneBab: OrangeShark: it’s updated: http://www.draketo.de/proj/with-guise-and-guile/guile-projects-with-autotools.html Apteryx: Hello! Can I replace a curl basic https get with a Guile function? Apteryx: cool, it looks like http-get does that, with support for https through GnuTLS amz3: yep amz3: it's sad to see my patch is left without comment for several months even after multiple requests for comment amz3: especially since other people patches get reviewed even if they take much more time amz3: and that my patch is a request of the maintainer solving a problem raised several times over the past few months... amz3: What I am left to understand is mainly that I am not a good enough contributor... I should have done PhD dammit Apteryx: what patch are you talking about? Apteryx: could there be a way to log system messages (syslog) from Guile? Apteryx: any hack I could do to load a scheme file based on the current directory? Apteryx: oh. (include file-name). manumanumanu: Good morning guilers! ArneBab_: amz3: which patch? (I’m missing so much, I likely missed it, too) manumanumanu: Isn't C return value 0 a success?? The chez scheme ffi converts 0 to #f for scheme, which seems odd manumanumanu: (for a made up return type "boolean") amz3: ArneBab_: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15228 amz3: ArneBab_: it makes open-process procedure from ice-9 popen public since everybody ask for it now and then ArneBab_: amz3: why do you need letrec there? isn’t let enough? ArneBab_: amz3: ah, you mean the last mail in the bug report? ArneBab_: amz3: with full documentation - nice! ArneBab_: amz3: I think the main reason why it got lost is that it is not its own bug. Can you just send this as patch queue to guile-devel@gnu.org? ArneBab_: amz3: do you need commandline commands to create that patch queue? (I would ☺) jeko: hello !!! rain1: hi sneek: Welcome back rain1, you have 1 message. sneek: rain1, OriansJ says: that I really appreciate their help with finding bugs in M2-Planet and writing tests rain1: I just found guile PEG - do you know where i can find some more example uses of it than the docs? rekado: rain1: Rutger’s gash uses PEG: https://gitlab.com/rutger.van.beusekom/gash/blob/master/gash/peg.scm rain1: thanks very much rekado! amz3: next week is fosdem! amz3: be ready! jeko: Yeah, I have to find a place to host my little family haha jeko: then I will be ready !!! amz3: jeko: you come to guile/guix event? jeko: I would love to ! amz3: too bad, there is not much guile talks amz3: at the end of the day, it's mostly guile event.. :( amz3: I meant to say it's mostly a guix event jeko: amz3: there might have some other interesting talks anyway amz3: what's the status of l10n / i18 in guile-haunt? amz3: again someone complaining that there is no alternative to github / gitlab :( void_pointer: amz3: to be fair, not a lot of people know about nongnu.org among others void_pointer: especially if they are starting out. Now, if they have been using repositories for a while, then they should know about some of the others that exist amz3: in particular nongnu is broken amz3: but people don't know about savannah because it's unlike github, it's ain't modern look et al. amz3: I am not complaining btw amz3: using mailling list and IRC isn't strange to me amz3: maybe I am getting old or something, but people love to hate what is old void_pointer: that is fairly common in the computer world amz3: even if there is no technical or rational for that hate void_pointer: sometimes the old does need to be thrown out, but sometimes it is still good amz3: I agree void_pointer: curious. What about nongnu.org is broken right now? void_pointer: haven't checked any repos on it in a while amz3: http://www.nongnu.org: Not Found amz3: The requested URL / was not found on this server. void_pointer: hmm. http://nongnu.org is found and routes to https://savannah.nongnu.org void_pointer: seems like they have a major problem with domain name right now OrangeShark: amz3: void_pointer: looks like there was some configuration issues for dns last week https://lists.gnu.org/archive/html/savannah-users/2018-01/msg00001.html void_pointer: hope they get it fixed soon void_pointer: been keeping nongnu.org in mind for future repository hosting void_pointer: at least for new stuff void_pointer: meant for others to use, not just myself void_pointer: might move the personal projects to gitlab from github sometime except for my two established projects which need to stay where they are I think CherryMan: what about bitbucket? void_pointer: I've thought about that one as well void_pointer: will end up looking again when decision time comes CherryMan: personally, I try to use Gitlab since it's the most "free" option there is, there is some non-free server side stuff CherryMan: I think that's in EE only void_pointer: CherryMan: you are right that that is EE only void_pointer: CE is all free software void_pointer: have run it myself and it isn't that hard daviid: nongnu is your best friend, then comes notabug.org, imo. nongnu will evaluate yur project, principally license wise, so you have to be ready to be evaluated, which is an excellent thing imo, then a bit patient as well... if you don't wan't that, then notabug comes first imo... daviid: all the rest is pure crap CherryMan: daviid: crap in what sense? civodul: wingo: how would you go about debugging fibers that go missing? civodul: in cuirass i sometimes have fibers that are apparently never rescheduled civodul: like one that does (while #t ... (sleep n)) civodul: it doesn't die from an uncaught exception AFAICS, yet eventually, sometimes it doesn't wake up wingo: moin civodul: hello! wingo: civodul: very neat that you are using fibers in cuirass :) you'll have to let me know your thoughts civodul: i'm find it pleasant! civodul: i'm still debugging a few things though :-) civodul: it's not always easy to find out what your fibers are doing civodul: s/i'm find/i find/ wingo: yeah wingo: initially i had a system where the fibers would all have ids and you could backtrace them wingo: but that was too much for a lightweight system, and you can build it just as well on top, so i took it out wingo: anyway it could be useful to make a wrapper for spawn-fiber that adds this kind of functionality wingo: so you can get global backtraces, figure out who is waiting on what, etc civodul: yes, it could be useful civodul: also it seems to create a number of pipes proportional to the number of kernel threads, is that correct? civodul: i saw a lot of open FDs, prolly related to the epoll code wingo: civodul: yes there are two fds per thread, one for the epoll and one is to wake up the epoll when it's sleeping civodul: ok, i wonder if this could be an issue on machines with many cores wingo: it certainly could be wingo: ah you mean the fd creation wingo: no i don't think that should be a huge issue. stock fd limit is around 1024 i think on most distros wingo: so up to about 64 cores you would have 128 fd's of overhead; not so bad; and if you went higher you'd have to know about the fd limit anyway wingo: e.g. if you aim to serve 100K concurrent clients, you already have to manually tune a core limit wingo: the limit when you get to that many cores is guile's gc wingo: i guess in the cuirass case you might be thinking more about worker jobs, perhaps... dunno civodul: i don't think FDs are a big concern in practice civodul: it's just the feeling that the "runtime" in general is using quite a bunch of FDs and threads (GC threads notably) wingo: yeah we could do better if we instead did gc via safepoints -- i.e. one thread determines that it needs to gc -> set flag indicating all threads should come to a safepoint and help gc; as soon as a thread comes to a safepoint (a handle-interrupts instruction for example) then it should mark itself as in safepoint, mark the values on its stack, wait until all other threads are sleeping, then participate in marking as a mark worker wingo: dunno wingo: an open question would be how to get mark parallelism when your app has only one thread. dunno wingo: maybe the sleeping gc threads are cheap enough :) wingo: at least with dedicated mark threads, you can control affinity of those threads wingo: switching to safepoints would be very good from a complexity-of-gc-implementation point of view, if we switch to having our own gc wingo: but perhaps a bit of a pain for users who would have to be more assiduous about scm_leave_guile etc civodul: yeah, embedding in libguile C may become harder i guess civodul: looks like scheduler-work-pending? doesn't account for fibers that are suspended waiting on an FD event, no? wingo: correct wingo: if you want run-fibers to go forever you should arrange for that to happen otherwise wingo: see what (fibers web server) does manumanumanu: amz3: How do you mean? My problem is that I want to abstract away the user having to handle the pointer to the C struct. One neat way would be using ports, but that way I can't return any data (since close-port returns #t or #f). Using closures is a bit clunky imho, since I have two different operations (update and close) manumanumanu: I have thought a bit of a functional interface, which works a bit like a curried function, where the C state is copied on each operation. That way, I get continuation safety, at the cost of ~300 bytes per operation. I don't really see the use case for it though, since using multi-shot continuations in software doing encryption/validation seems like a bad idea (TM) wingo: i have never used multi-shot continuations :P wingo: never for any real use. i don't think they have one. wingo: not for me anyway :) manumanumanu: exactly. I use them only to confuse people. manumanumanu: and to impress java programmers. manumanumanu: I do 0-100 in about 2 seconds. First I show them call/cc and explain undelimited continuations, and when people ask "what use does this have", I show them some code using fibers :D :D manumanumanu: "Yes, lowly c++ programmer, this is how we do multi-threading now." manumanumanu: "Even my five year old can do it" manumanumanu: I am only half joking. I showed a friend of mine recently, and he was blown away by guile. Especially the macros (i showed him my racket-loop macros), the ability to alter a program while running and by fibers. wingo: neat :) wingo: once-resumable continuations are useful of course manumanumanu: wingo: Yeah, and iirc they are easier to make fast than regular call/cc. Chez has one-shot continuations, that are considerably faster than regular call/cc. Not that it matters to guile, since we got the cool stuff :D wingo: i think what chez considers to be one-shot are escape-only continuations wingo: no? not suspend/resume things wingo: guile has that optimization too, but chez can resume faster because it has chained stack segments manumanumanu: exactly. manumanumanu: So... I have a macro that automatically converts bytevectors to pointers and #f to %null-pointer for the FFI. I going to polish it a bit, but in my opinion, it greatly simplifies using the FFI. How would I go about maybe having it included in guile? It is a thin wrapper around pointer->procedure that adds the type bytevector and wraps all pointers in a lambda that converts #f to %null-pointers. All inlined by manumanumanu: the optimizer manumanumanu: if there is any interest, of course manumanumanu: How portable is the bytecode that guile compiles to? wingo: send it to the list and see what people say :) manumanumanu: devel list or users list? wingo: bytecode depends on word size (32 or 64 bit) and endianness wingo: manumanumanu: both! manumanumanu: wingo: so that means code compiled on my 64bit machine won't work on my 32 bit one? wingo: correct, but you can cross-compile the .go files wingo: use --target=blablabla wingo: see the makefiles in prebuilt/ manumanumanu: okay. Then I have an issue to take care of :) manumanumanu: wingo: Have I understood this correctly?:I have a foreign-ref procedure that works on non-platform-dependent types, and size_t. For size_t it decides the (sizeof size_t) at compile time, and returns the correct bytevector-ref procedure to read that memory location. In a .go-file that macro would have already been expanded and compiled, and I could potentially send a bytevector-u64-native-ref to a 32bit manumanumanu: platform, thus trying to read memory I don't want to? manumanumanu: wingo: Oh wait. I can work around it while making the code better :D manumanumanu: sorry to bother you wingo: if you want the size_t to apply to the target size_t then you need to (define target-size_t (match (target-word-size) (4 uint32_t) (8 uint64_t))) wingo: see (system base target) manumanumanu: even better! manumanumanu: thans amz3: manumanumanu: if you want to do the good thing, you must use disjoint types and not expose the pointer type to the user define-wrapped-pointer-type amz3: https://www.gnu.org/software/guile/manual/html_node/Void-Pointers-and-Byte-Access.html#index-define_002dwrapped_002dpointer_002dtype amz3: manumanumanu: I don't about the API you must, I am just saying that industria use a (make-hash) procedure that returns a handle over the final hash, and then does a bunch of (hash-update! hash "foo") and then (hash-finish! hash) will return the final bytevector dsmith-work: Happy Friday, Guilers!! jlicht: you too dsmith-work! cmaloney: Happy Friday! amz3: houhhouuu jeko: Hello ! roelj: Ehm, is there a way to let sxml->xml not escape a character? Like so: (sxml->xml `(div "15 " < " 20")) roelj: Unfortunately, that doesn't work. roelj: Ha! It seems that this works in Javascript `("'5' + String.fromCharCode(60) + '10'"). So that's a work-around for my use-case. jeko: With SRFI-64, the cleanup form is the last expression of the test-group-with-cleanup. Is the set-up form the first expression of the test-group-with-set-up ? ? jeko: oh I just saw there is no test-group-with-set-up haha x_x ArneBab-work: Hi, I implemented skynet with Guile Scheme Fibers, but I’m surprised that they are much slower than I expected (factor 100 slower than a serial solution). Do you see what I did wrong? wingo? Here’s my implementation: https://github.com/atemerev/skynet/commit/05d7cb65d70aca95338576fe93f3580a01ec9405 - to test: git clone git@github.com:ArneBab/skynet.git; cd skynet/guile-fibers/; ./skynet.scm wingo: ArneBab-work: afaiu you are measuring only overhead, not work; dunno wingo: a message send/receive is more expensive than a procedure call :) ArneBab-work: wingo: Yes, this is an overhead test, but via Skynet I can compare it to other systems. And I wonder whether we can get the overhead down. I profiled it and it spends most of its time in current-dynamic-state, run-fiber, hashv-set!, and the lambda in create-fiber. ArneBab-work: wingo: if you want to profile it youself: git clone git@github.com:ArneBab/skynet.git; cd skynet/guile-fibers/; guile -L . # (import (skynet)) \\n ,profile (main #t) wingo: ACTION doesn't really have time, sorry :/ ArneBab-work: wingo: no probs - just wanted to ask and pass it to you so you can look if you’d like to. Thank you for your answers so far! (I now have hope that I did not do an obvious mistake in implementation) ArneBab-work: short summary of the result: The runtime with Guile fibers is around 6000 ms on this system, with Go or Java Quasar Fibers its around 300ms, in Haskell it seems to vary by factor 100 depending on the hardware (between awesomely fast and two times the speed of Guile fibers - on my machine it has 2x the speed of Guile fibers). wingo: 20x slower than systems with native code generation and one-shot delimited continuations rather than multi-shot and also better gc is not so bad imo wingo: dunno wingo: i am sure there are improvements to fibers that can make it faster, then native codegen will get faster still, then we'll still be a bit slower than go i think for this particular workload ArneBab-work: wingo: on the upside: Guile fibers do run 1 million fibers which communicate via 6 level deep hierarchy via channels and combine all their results with an overhead of 6 seconds. Experimentally I see that if each of your 1 million fibers does as little as (apply + (iota 1000)), you get 50% speedup over the serial code. wingo: neat wingo: did you try your skynet example while restricting guile to a single thread? wingo: just out of curiosity ArneBab-work: wingo: do you mean via #:parallelism 1 or via taskset? wingo: either wingo: perf with taskset will be slightly less because the gc can't run in parallel, but both constrain fibers to a single core wingo: which is what i was curious about ArneBab-work: as a sidenote: for spawn-fiber I use #:parallel? {level < 2} in there, so all the "subfibers" below level 2 should stay on their CPU (if I got that right) manumanumanu: Good morning! ArneBab-work: wingo: results: https://pastebin.com/viiZtVnk wingo: neat wingo: ArneBab-work: what about the less-workload case ? i.e. without the apply and iota wingo: ArneBab-work: regarding #:parallel?, that just controls initial thread placement. a fiber may be stolen by another thread fwiw civodul: wingo: i'm confused about the two web servers in Fibers: one does its own 'run-fibers', and the other one creates threads civodul: i don't see which one is best for use in an already-fiberized program civodul: what are your thoughts? wingo: civodul: depends :) see https://github.com/wingo/fibers/wiki/Manual#Web-Server-Backend wingo: one of them threads states through all handlers -- the handler calls themselves are serialized wingo: like with the m-word wingo: :) wingo: the other one runs handlers in parallel civodul: heh :-) civodul: the concurrent web server looks like what i want, but it does run-fibers civodul: and i'm already doing that civodul: so i'm unsure if this is the right thing to do civodul: ideally i'd write (spawn-fiber (lambda () (run-server-that-creates-fibers))) civodul: or at least that's what i expected :-) wingo: yes i see what you mean wingo: probably need to provide an interface that does not include the run-fibers civodul: ok ArneBab-work: wingo: without parallelism, pure overhead: https://pastebin.com/6ZSNi5d3 ArneBab-work: #:parallelism 1 wingo: neat civodul: bah, now my code gets stuck in a loop closing clock_nanosleep civodul: i wonder where that comes from manumanumanu: ArneBab-work: what are you working on? ArneBab-work: manumanumanu: I read up on Fibers for Java (for work) and ported a benchmark to Guile fibers to get a feeling for the performance: https://github.com/atemerev/skynet/compare/master...ArneBab:master civodul: wingo: re barriers, i suppose bad things happen if a fiber gets preempted while it's in a custom-binary-port method, right? civodul: hopefully #:hz 0 should prevent that wingo: civodul: i can't think what problem would happen wingo: even if they were preemptible i don't know what would go wrong -- note tho that custom binary ports aren't preemptible afaiu wingo: i could be wrong of course civodul: continuations captured while you're in a custom port method cannot be resumed civodul: but you could still get the preemption signal while you're there, leading to an abort-to-prompt that cannot be resumed, no? dsmith-work: Hey Hi Howdy, Guilers amz3: o/ amz3: someone a few years back, sent me a logo for a project that we were discussing caled GNU prime (an rss aggregator, that never came to be) amz3: called* amz3: does that person already is around? amz3: I am looking for a logo for gnunet... amz3: at least make a proposition for a new GNUnet logo based on that work wingo: civodul: if the continuation can't be resumed then no abort is made wingo: civodul: the interrupt handler checks suspendable-continuation? from (ice-9 control) wingo: and if the continuation is not suspendable then it does nothing civodul: wingo: ah, good civodul: thanks for checking manumanumanu: So, people: how would you write a high-level wrapper for the crypto_generichash_init/update/final in https://download.libsodium.org/doc/hashing/generic_hashing.html ? manumanumanu: I thought about using a custom port, but close-port returns only #t or #f manumanumanu: the next option is a closure with a procedure that hashes as long as you provie it with bytevectors, but that is a strange solution manumanumanu: at least, I think it is... icky manumanumanu: maybe the best way is to simply let the user keep track of the state amz3: manumanumanu: it's similar to industria API, here's an example use https://github.com/a-guile-mind/presence/blob/master/src/web.scm#L824 amz3: o/ manumanumanu: hey ho amz3: manumanumanu: what do you plan to do with libsodium? manumanumanu: I just wanted to learn guile's FFI, and at the same time produce something usable :) manumanumanu: It is also good practice in how to make a proper api. I am thinking a bit of how I can leverage libsodium's streaming api together with guile's port system manumanumanu: Not only that, it has already taught me quite a bit about how guile works. I still have som GC questions regarding bytevectors and foreign pointers, but I am learning. it will be fine manumanumanu: amz3: and if the GC isn't smart enough, I will have to learn how to use guardians :D manumanumanu: amz3: and if I ever finish my editor (which is kind of stalled), it would be nice to have built-in file encryption with the nice primitives that libsodium has without having to necessarily implement it in C. manumanumanu: After trying to implement Galois counter mode, i don't trust it anymore (which is only half joke) I only tried as an exercise, and found it very hard to get right. OrangeShark: hello everyone amz3: o/ manumanumanu: Hello OrangeShark! dsmith-work: {appropriate time} Greetings, Guilers stis: o/ amz3: o/ androclus: hey, all.. does anyone know of anywhere i can go (web site, book, pdf, etc.) for clear explanations of a) continuations and b) closures? androclus: I have tried wikipedia and some other Google-provided links, but even though i've been a programmer for many eyars getting along without them, I find the explanations make too many 'jumps' for me, skipping steps. I need something really step-by-step.. (?) androclus: Any suggestions ("Continuations for DUmmies" etc. :P )? androclus: I understand a *little* that continuations basically are a way to jump around program state androclus: (wihtout keeping the data) androclus: but why that is so important, i can't tell (although in web programming, it apparently helps with providing state to an otherwise stateless architecture) androclus: but i don't understand the deeper meaning of it, and/or when i would use continuations androclus: same for closures androclus: and anyway (with continuations) i was taught (old-school) that GOTO's (i.e. from BASIC) were a "Bad Thing"(tm) amz3: androclus: I think a closure is the environment where a given function enclosed amz3: androclus: do you understand lexical scoping? amz3: androclus: continuation is the dynamic equivalent of goto I think. amz3: androclus: for instance, you can implement GOTO, coroutines, lazy streams (also called generators), exceptions, amb and prolly other stuff like zippers amz3: androclus: also GOTO, is a bad thing, if you can not do otherwise. I saw lot of code using goto for handling errors in C code amz3: androclus: I think the best way to understand call/cc is to use it... obv... amz3: androclus: ?? amz3: androclus: also, something I did not understand when I started, call/cc is not a way to backtrack to previous state, but to go back to some place with the current data cmaloney: androclus: I have a video where I explain a bit about Scheme and closures: https://www.youtube.com/watch?v=Kq-4nhIktes cmaloney: (around the 28 minute marh) catonano: cmaloney: interesting ! May I ask where were you speaking ? androclus: amz3 - thank you androclus: cmaloney - thank you amz3: androclus: you don't have other questions? dsmith-work: androclus: Are familiar with C setjmp/longjmp ? dsmith-work: androclus: call/cc is kind of like that, except call/cc is "both ways" OrangeShark: ArneBab_: I sent you a pull request on bitbucket for with-guise-and-guile to a fix a typo I made dsmith-work: androclus: And in fact, guile used to (does it still?) implement call/cc by using C setjmp/longjmp dsmith-work: androclus: Closusres are more or less a pair of a function and some data. amz3: cmaloney: nice talk, i think it's important to say, that only #f is false in scheme amz3: cmaloney: compared to javascript and python.. amz3: nice artwork too amz3: maybe the thing about false is a detail amz3: but it's misleading comming from javascript and python androclus: dsmith-work: sorry, not familiar with C setjmp/longjmp amz3: androclus: async/await can be implemented in terms of call/cc androclus: thanks, amz3, but i don't know what async/await is/are dsmith-work: androclus: Are you familar with stacks and call frames? cmaloney: androclus: It was at my local Linux / UNIX users group dsmith-work: androclus: In a language without continuations, when you make a function call, the current instruction pointer and other stuff is pushed onto a stack. cmaloney: amz3: Thank you. :) dsmith-work: It allows you to make recursive function calls. Often, variables local to the function are also located on the stack. dsmith-work: androclus: The way setjmp works, is it records the depth of the stack. Later on, a deeply nested function can call longjmp to return the stack to the way it was when setjmp was called. dsmith-work: setjmp can return more than once! Once set recording the stack state and again when "reloading" the stack. dsmith-work: androclus: So it only goes "one way". From deeply nested out to the saved place. dsmith-work: androclus: Call/cc is kind of like that, but "both ways". You can save the current state (the "continuation") within some deeply nested call. dsmith-work: Later on, you can jump back into that again. And as many times as you want. dsmith-work: With that, you can implement exception handlers, co-routines, all kinds of stuff. dsmith-work: androclus: Well, that's my attempt at explaining call/cc. Hope it helps some. dsmith-work: androclus: This might also help: http://community.schemewiki.org/?call-with-current-continuation androclus: dsmith-work: yes, i am familiar with stacks. (not so sure about call-frames) but your explanation is good enough using the stack that i could see it. never thought about the ability to move up and down a stack, wow. androclus: and thank you for the link, too androclus: i also liked cmaloney's quick/simple example (at 30:19) of closures. androclus: each of these provides a piece of the puzzle (for each: continuations and closures). i think i will get it more completely, as i go. but this is a good start. thank you everyone! i think i will work through the relevant chapters in the PLAI book androclus: but at least for now, i get a basic idea of each of the two.. grazie, grazie enderby: is there a better way to lookup srfi's (than looking in the guile manual) while in a scheme buffer with geiser running amz3: enderby: no wingo: moo manumanumanu: God Morgon everyone manumanumanu: I am pretty satisfied today. My low-level (ffi) bindings for libsodium is nearing completeness, and some high level stuff is written already. manumanumanu: Then I'm going to write some extra fluff on top that lets you use crypto_box and secretbox with xchacha20 so you can use random nonces wingo: nice! manumanumanu: No releases in any time soon. Will have to compare it to some test vectors first :) Anyway, I am pretty happy with how it is rolling along. Whenever my kid sleeps, I manage to write another couple of scheme wrappers :D manumanumanu: wingo: when you are apparently here: am I right in assuming that call-with-values is slower than manumanumanu: regular calling? manumanumanu: Guile seems to have pretty big overhead working with multiple return values manumanumanu: Of course it is slower in one aspect (an extra layer), but I wonder if the penalty for multiple values is bigger than that amz3: manumanumanu: what do you plan to do with libsodium bindings? amz3: make it work the make it fast ™ jeko: Hello Guilers ! dsmith-work: Morning Greetings, Guilers wingo: manumanumanu: call-with-values is not necessarily slower wingo: if the caller and callee are well-known, e.g. (call-with-values (lambda () (if x (values 1 2) (values 3 4))) (lambda (x y) (+ x y))), then it is free wingo: er wingo: producer and consumer wingo: rather than caller and callee wingo: anyway wingo: if the producer is unknown, there are two cases wingo: e.g. (call-with-values f (lambda (x y) (+ x y))) wingo: one, the producer is scheme, e.g. (lambda () (values 1 2)) wingo: in that case it is less efficient relative to being inlined but still fast -- about the cost of an out-of-line call instead of inline control flow wingo: if the producer is a primitive written in C, then it is more expensive. has to allocate a values object then destructure it. wingo: finally if the consumer arity effectively has a rest argument, as in (call-with-values f +), then the consumer continuation conses up the values into a list wingo: which is more expensive obviously wingo: anyway i would say that multiple values in guile are as close to free as they can be. only bad case is if there is allocation, and that is not common civodul: i'm unclear whether to use fiber's concurrent web server or its web server backend civodul: given that my top-level is already within 'run-fibers' manumanumanu: wingo: thanks! Then I have to look for performance issues elsewhere :D I't might be that the optimizer doesn't fare as well with my code where let-values can't be optimized away. I just blamed call-with-values, but maybe I can do something to make the optimizer more happy. amz3: o/ taoqy: Hi. I want to learn guile more. I try to use gdb to step it, but guile was linked with shared lib. Could someone give me some tips. janneke: taoqy: we can give tips if you tell us what you see. janneke: afaik, for single stepping it does not matter to gdb if libraries are shared or not wingo: moin amz3: o/ wingo: fresh guile master build on 5-year-old 4-core, 2 thread-per-core system took 54 minutes wingo: if we are lucky with native code generation we can lower that to maybe 25/30 minutes. we'll see tho :P wingo: would be nice to get those 10x speedups but for the bootstrap workload i think memory management is probably the bottleneck taoqy: yesterday I compile guile (2.2-stable) that took about two hours in a `Dell XPS13` taoqy: janneke: in fact I write a simple C program that linked with libguile. But it may link to my system libguile that has no debug info. see http://lists.gnu.org/archive/html/guile-devel/2018-01/msg00023.html janneke: taoqy: have a look at /meta/guile or even /meta/gdb-uninstalled-guile taoqy: Do you mean using LD_LIBRARY_PATH? taoqy: taoqy: ld(1) says: -L Directories specified on the command line are searched before the default directories. dsmith-work: Hey Hi Howdy, Guilers jackhill: howdy! OrangeShark: happy monday civodul: wingo: i often write (let ((x (open-foo))) (dynamic-wind (const #t) ... (lambda () (close-foo x)))) civodul: but i realized this doesn't play well with delimited continuations and thus with fibers civodul: i guess i should just use (catch #t ...) in this case? civodul: also, we'd need a (fibers popen) :-) civodul: because (ice-9 popen) blocks davexunit: civodul: as a workaround you could do the open-pipe in a new fiber and write to a channel when it's done? davexunit: or write to a channel for each bit of input you are reading, etc. civodul: davexunit: indeed, smart hack! civodul: hmm civodul: or is it? civodul: it would still be blocking, right? civodul: unless the fiber runs on a separate core wingo: you can spawn a thread to run the pipe and use channels to communicate with the world of fibers wingo: dunno if threads work in your system tho wingo: channels can work between non-fibers and fibers davexunit: civodul: oh does that module use some primitive thing that we can't suspend? davexunit: something that suspendable ports doesn't cover? davexunit: in that case you can ignore everything I suggested :( civodul: the thing opens the pipe and then calls 'read', and 'read' is a problem civodul: so i changed that to 'read-string', and then i call read once i have all the string civodul: that's ok civodul: though i have a bug where that process does exit(0) without a word o_O davexunit: ohhhh yeah read is not suspendable davexunit: sorry to have lead you astray civodul: np! amz3: \\o/ cmaloney: ACTION goes \\o/ amz3: I just had a brillant idea! amz3: but now... I have an even better idea... amz3: I make simple program to share guile modules on gnunet! amz3: well, it's will be just a wrapper around existing gnunet features and could be written in bash (mostly) but I need a new toy ;) ArneBab_: amz3: if you can abstract out the interface and key-type, I’d love to adapt it to also work over Freenet ArneBab_: amz3: also you can write everything in bash, the main question is whether that would be as much fun as with Guile amz3: ArneBab_: what is key-type? amz3: anyway, this is just diversion, I must be focused ArneBab_: amz3: key type is the identifier you use to reference something online ArneBab_: in Freenet you have something like USK@///path/to/file daviid: and what about ipfs instead? ArneBab_: s/instead/in addition/ daviid: ACTION thinks IPFS is the future amz3: ipfs is not gnu daviid: so what? it's free right? amz3: I am not sure what's the difference between gnunet and ipfs daviid: free s/w I mean ArneBab_: daviid: ipfs does not provide a friend-to-friend connection mode ArneBab_: and ipfs is pretty much non-anonymous ArneBab_: (which doesn’t make it bad, it just does not hit my usecase: I want to be able to communicate with anonymous people) daviid: that surprises me, but i confess I did not study much about it, I did read a bit though daviid: anyway, i have to focus too :), sorry for the noise ArneBab_: ipfs has the support tooling (cli tools, PR, talks, videos and such), but not the anonymizing and censorship resistant tech. daviid: ArneBab_: really, so no tor connection then? ArneBab_: daviid: connecting over Tor is not the same as being anonymous. There are a wealth of timing attacks available against anyone using tor. daviid: have to go, bbl hugo: With GOOPS, is it possible to call next-method for all super classes? Or can I only access the method from the first element in the class-precedence-list ? daviid`: hugo, the later, but then, if that method itself calls (next-method) ... hugo: daviid`: but wouldn't that class's method then call it's direct supers? My base class in this instance have multiple direct supers. daviid`: hugo: and each supers have a method for that name? hugo: daviid` Actually you were right the first time hugo: next-method actually called it's neighbour daviid`: hugo: I was gon'a say you can try ... on a very limited super short example ... hugo: I guess I was to set in the way of "normal" OOP to realise that next-method worked in more directions than upwards hugo: I have some test code now, and I can see it working hugo: I just failed to realise that I needed next-method in the first super before hugo: Thanks for the help! :) daviid`: yw! guile-guest9: Hi. I am compiling guile from source, it has been taken 30min in 'BOOTSTRAP GUILEC' and not yet completed. Is this normal? daviid`: guile-guest9: yes, perfectly normal, just be patient daviid`: it wold be a lot faster using the tarbll, but I guess you have your reason to do it from the source (latet comit ...) daviid`: guile-guest9: so you cloned, but did you check 'stable-2.2'? you don't want to use master for the time being, it is where the 3.0 prep work happens ... guile-guest9: Thank you for reminding. I use the master branch. But how long the compling will taken? daviid`: guile-guest9: unless you want to help wingo wrt to the new AOT compiler, or any items he lists somewhere about how to help him ... you _really_ don't want to use the master branch daviid`: guile-guest9: it obviously depends on the computer yu are building... daviid`: but from 45' on quite fast machines to a couple of hours on 2 to 3y old laptop ... just shooting really guile-guest9: Ok, I will checkout to 2.2. I used to compile python, it pretty fast. My CPU is `Intel(R) Core(TM) i5-7200U CPU @ 2.50GH` daviid`: this is a good machine, it prob will compile under 2h (maybe faster, don't know) daviid`: just be patient ... I have to go now, bbl guile-guest9: thank you :) daviid`: yw! daviid`: guile-guest9: make -j Apteryx: Hello! Do we already have srfi-115 implemented in Guile? guile-guest9: Hi. How could I bypass the GUILEC process when compile guile. I just want a guile binary. Is there a `make target` to do this? Apteryx: I think you need to provide bootstrap binaries. It's detailed in the manual somewhere, I believe. qingyunha: Hi amz3: o/ amz3: I am blocked in my gnunet project because of a bug in gnunet, I need to find something else to do... amz3: does someone needs help with something? qingyunha: Hi. I want explore the function `scm_read(port)`. But how could I use the stdin port in C or make a stdin port? qingyunha: I find `scm_current_input_port()` works. amz3: I think someone in the past asked if there was a dynamic blog engine in Guile amz3: my question is what do you miss in haunt? amz3: what do you miss in static weblog generators in general? janneke: hi guile! amz3: o/ janneke: i got past my recursive macro expansion problem i had yesterday amz3: neat janneke: recursive macro expansion is still not done janneke: eg not up to par with mes' just-in-time macro expansion janneke: inching forward, but i suspect i'm almost done ArneBab: dustyweb: the syncbot README links 8sync at notabug, but the link is dead. Where’s the new repo? https://notabug.org/cwebber/syncbot dustyweb: ArneBab: oh, at: dustyweb: https://savannah.gnu.org/projects/8sync ArneBab: dustyweb: https://notabug.org/cwebber/syncbot/pulls/1 ← fixes the link to 8sync daviid: didn't know 8sync was part of Gnu, great1 but then, ArneBab the source code is at savannah, the notabug should be retired i guess, no? just curious ArneBab: daviid: is the source of syncbot also on savannah? daviid: yes daviid: syncbot? ah sorry, my istake daviid: :), must be very tired ArneBab: no probs - this is just updating for the cost of change :) dtornabene: hey all, may be in the wrong place but my search fu is failing at the moment, I'm looking for a networking project thats fairly recent, written in what I thought was guile scheme dtornabene: I remember reading about it early last year, it was a framework for networking applications written in Guile (I think it was guile, I *know it was scheme) dtornabene: i found it, finally, it was 8sync galex-713: I didn’t know chez that was fast compared to others O.o galex-713: https://ecraven.github.io/r7rs-benchmarks/ dustyweb: hi ArneBab, thanks void_pointer: Chez is the one to beat performance-wise. A few implementations can beat it on a few benchmarks. A few can beat it on one benchmark only. Last I checked, Guile beat it on one or two galex-713: void_pointer: why a such advance? is their implementation structurally different of others? or are they just more at the cutting-edge of some published (or not?) techniques others didn’t dare to implement? void_pointer: not exactly sure void_pointer: other than one reason it does well is it does in the end compile scheme to machine code before running it galex-713: you mean like a JIT? void_pointer: scheme implementations that are purely interpreted or compile to a virtual machine lose to it pretty much around the board void_pointer: not sure if it is JIT or AOT or both galex-713: ah then if guile used a JIT it wouldn’t be beated by it galex-713: what is AOT? void_pointer: out of those that doe compile to machine code, it isn't as ahead as it looks compared to all the rest void_pointer: stalin, for example, does go to machine code and beats chez at a number of benchmarks galex-713: oh there’s stalin in the benchmark? let me look again galex-713: damn racket is fast galex-713: compared to guile galex-713: and yet racket doesn’t jit afaik spk121: dsmith-work: the smallest system we still use in new production systems is the ATMEGA128. 4k ram, 128k flash. 16Mhz. dsmith-work: spk121: What's it used for? spk121: dsmith-work: controlling a cooler spk121: They work fine down at -40C. spk121: And only $6 US. dsmith-work: Yeah, use the right tool for the job dsmith-work: Amazing how hard it is for stuff to work in the cold. dsmith-work: We needed to make a thing that needed to start at -50C. We were allowed to turn on a heater and warm up internally. dsmith-work: So we didn't really start until -40 spk121: Nice dsmith-work: Heh. Had a problem in that when it was really really close to 0C dsmith-work: One of the temp sensors was effectivly floating point. dsmith-work: Needed to divide by the value shifted by the exponent or something. dsmith-work: But right aorund zero, the exponent was enough to shift all my bits away. dsmith-work: And so divide by zero. Bam. Reboot! (This on a microchip pic) dsmith-work: Heh. dsmith-work: We had it in our kitchen freeezer trying to find the problem. dsmith-work: Was very embarrasing. spk121: Yeah! Engineering. amz3: I made a new episode of gnu guile hacking related to gnunet https://youtu.be/21iuE8Udq08 amz3: in that video I create a small social app on top of gnunet amz3: almost 4h long janneke: i am changing macro expansion in mes from just in time during eval to a separate initial recursive macro expansion phase janneke: this should fix performance janneke: doing just in time macro expansion was pretty easy spk121: janneke: how are you feeling about mes these days? Is there a direct path to the end? janneke: i cannot seem to get past this: http://paste.debian.net/1006141 janneke: spk121: i'm feeling excited...we're getting so close janneke: guile+mescc compiles tcc that can compile gcc-4.7 janneke: mes+mescc compiles tcc (but that takes >4 days) janneke: OriansJ's M2-Planet is inching towards compiling mes and is getting very close spk121: Amazing. At last FOSDEM, it sounded theoretically possible but practically impossible. amz3: help! amz3: I got an error the internet doesn't know about amz3: [LWP 7532 exited] amz3: [New LWP 7533] amz3: Thread 1 "guile" received signal SIGPWR, Power fail/restart. amz3: 0x00007ffff762eaed in read () amz3: from /gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/lib/libpthread.so.0 janneke: spk121: yeah, after a year of very hard work and co-ordination, we're getting real close spk121: amz3: that is not uncommon. BDWGC uses SIGPWR internally to trigger events. spk121: amz3: you can ignore it amz3: spk121: expect it kills my process spk121: amz3: then yes, you need help. Sorry I don't have an answer. ;-) spk121: janneke: good luck. I'm cheering for you. janneke: spk121: thanks! spk121: amz3: SIGPWR is associated with bdwgc "stopping the world"/ spk121: maybe it is a thread thing amz3: the funny (sort of) is that I have another crash with gnunet that doesn't crash the same way amz3: using the same program amz3: the good thing, is that I reproduce both crash all the time amz3: I think I am in big troubles ArneBab_: dsmith-work: nice that you found it! manumanumanu: Can I make the GC automatically free memory I malloc'd by doing something like this, using make-pointer finalizers: ??? manumanumanu: https://pastebin.com/tm3JHCan manumanumanu: I have a feeling casting such a malloc pointer to a bytevector could potentially be risky if the pointer becomes garbage collected... manumanumanu: or does pointer->bytevector somehow "save" the pointer? manumanumanu: maybe I should just be using a bytevector in the first place instead of mallocing :D civodul: manumanumanu: pointer objects can have an associated "finalizer", which can call 'free' civodul: see set-pointer-finalizer! & co. amz3: o/ catonano: amz3: o/ catonano: :-) manumanumanu: so... anyone familiar with the ffi here? manumanumanu: I want to allocate a size_t and then read it back, but I can't reeally find how. manumanumanu: chez has foreign-ref, which supports accessing any type, but the closest I can come is passing it a bytevector (sizeof size_t) manumanumanu: and then accessing it as a 64bit unsigned int manumanumanu: which is ok on my 64bit system manumanumanu: I can of course do a ref depending on sizeof size_t, but that seems somewhat like a hack manumanumanu: Oh well, I'll just implement them myself ecraven: are you asking about chez or guile? manumanumanu: guile manumanumanu: chez has a really nice interface for that imho. ecraven: I don't know about guile :-/ but either you want to allocate a size_t and pass a *pointer* to it, or just pass the size_t directly ecraven: well, size_t is just a typedef for some integer type manumanumanu: The problem is reading it back ecraven: chez's ffi is one of the nicer ones. I've never used guile's, so I can't comment on that ecraven: well, guile must have a way of returning integers from foreign functions manumanumanu: in chez, I can do (foreign-ref pointer type), but in guile I have to do some bytevector magic ecraven: from looking at https://www.gnu.org/software/guile/manual/html_node/Dynamic-FFI.html for 3 seconds, maybe (pointer->procedure 'size_t (dynamic-func ...) (list ...)) works? ecraven: why is the size_t in a bytevector? manumanumanu: ecraven: I can read raw bytes from a bytevector. So, if the size_t is 8 bytes, i can do bytevector-u64-ref BYTEVECTOR_POINTING_TO_RAW_MEMORY manumanumanu: and get a 64bit unsigned integer out ecraven: but why is the size_t in a bytevector to begin with? can you show the function signature you wish to write the ffi function for? manumanumanu: nono, returning integers or size_t's isn't the problem. Reading memory containing size_t is the problem manumanumanu: I did a foreign allocation (using C alloc) ecraven: as I said, what exactly do you want to read? a struct that contains a size_t? manumanumanu: I have allocated (sizeof size_t), and I want to read it back. manumanumanu: All I have is a pointer to it ecraven: maybe you can use make-c-struct / parse-c-struct ecraven: you can use pointer->bytevector, but you need to know the endianness and the size of size_t to parse it manually ecraven: https://www.gnu.org/software/guile/manual/html_node/Foreign-Structs.html#Foreign-Structs says "See the code for (system foreign) for details." manumanumanu: There are the native versions of bytevector-ref that should work ecraven: you still need to know the exact type and size on the current architecture manumanumanu: for that I have sizeof, so that isn't a huge problem manumanumanu: Anyway, I seem to have been on the correct path. manumanumanu: Maybe i'll write a macro that does all this with zero overhead. ecraven: usually size_t will be unsigned int ecraven: hehe, old unixen defined size_t to be a *signed* type :P manumanumanu: not over here. unsigned-int is 4 bytes in guile, whereas this is a 64bit system, so size_t is 8 manumanumanu: anyway, I am going with the bytevector version ecraven: gcc before 2.4, so actually old ;) ecraven: from my (totally limited) understanding of the guile ffi, that is the way to go manumanumanu: ecraven: I don't know much C, so it feels good to have someone second my opinion ecraven: you might want to look into (system foreign), maybe there's relevant code there manumanumanu: ecraven: nah... It is easier just modelling it after how chez does it. I can even do it as a procedure, since I suspect peval will inline everything it can manumanumanu: ecraven: but without pointer support, since guile can already dereference pointers and has a special representation for them. manumanumanu: does guile do cross-module inlining? manumanumanu: nope. not yet :) I'll work around it with a macro. dsmith-work: Happy Friday, Guilers!! spk121: heya wingo: good evening guilefolk cmaloney: Good evening cmaloney: ACTION got Guile working on a PocketBeagle a few weeks back and it tickles me that Ihave scheme in my pocket cmaloney: (though right now it still needs a computer to power it / interface) cmaloney: though compiling all of the scheme files about desoldered the processor from the board from how hot it was getting. :) wingo: nice! wingo: yeah the compiler thing is a little irritating :P amz3: I wonder how people do to hack on guile with that compilation phase, it's very slow cycle of dev wingo: on guile itself or things on top of guile? wingo: did things improve with 2.0.3? wingo: er wingo: 2.2.3 amz3: on guile itself amz3: it's ok on top of guile wingo: ACTION nod amz3: I don't know if things improved with guile 2.2.3 wingo: in guile itself, it's knowing what needs a full rebuild and what can work with a partial rebuild wingo: anyway i spend a lot more time editing, compared to compiling amz3: that said I use guile 2.2.3. cmaloney: Yeah, the compilation is a one-time pain cmaloney: and with packaging I don't notice it cmaloney: I mean, how many folks compile gcc from scratch or just rely on packaged versions? cmaloney: (probably not the right channel to show how lazy one is with compiling gcc from scratch but w/e. I got nothing to lose) bavier: I've been having some fun lately poking around with guile's assembler and linker daviid: fiw, i never find working with guile was slow, it compiles my scheme apps files pretty fast. then, I extensively use geiser we developing, so C-x C-e over the procedure (or procedures) I'm working on, which is instantaneous... the develpoment cycle with static languages, rru over static languages (kawa, clojure) is a ton heavier and really boring actually... working on heavy projects using guile is a charm, for me dsmith-work: cmaloney: I used to build gcc. Part of using buildroot for embedded. dsmith-work: Of course you need to tune your makfiles so a simple make clean doesn't wipe it out. dsmith-work: But out jenkins build machine would start from a clean checkout, and so build gcc. dsmith-work: Along with the clib and everything else. cmaloney: Yeah, in that case it makes sense dsmith-work: But even with all that, it only took about 45 minutes. dsmith-work: To go from a checkout to an installation image. dsmith-work: YEah, building guile from git source is slow. Building from a release tarball is better. dsmith-work: cmaloney: I greatly enjoyed your description of that small machine the other day! dsmith-work: I've never been on anything *that* small. But I have worked with only 127 bytes of ram. And part of that was stack. cmaloney: dsmith-work: Heh cmaloney: Yeah, I remember the Atari 2600 had a ridiculously small amount of memory cmaloney: on the order of a few hundred bytes cmaloney: https://en.wikipedia.org/wiki/Atari_2600#Design cmaloney: 128 bytes of run-time data dsmith-work: https://en.wikipedia.org/wiki/Motorola_68HC05 dsmith-work: 1468705 dsmith-work: Had a windowed eprom cmaloney: wow dsmith-work: 2K bytes of code space. Fun! cmaloney: with some older programmer yelling that it was a luxury to have 2K dsmith-work: Heh manumanumanu: Good morning! amz3: \\o/ dsmith-work: Thursday Greetings, Guilers davexunit: ACTION thinks about using a lookup table for sin/cos to reduce boxing davexunit: send help amz3: nalaginrut: what's up? amz3: ;à amz3: :) manumanumanu: My low level bindings for libsodium are soon completed :) manumanumanu: guile-only bindings, so no compiling required manumanumanu: I will have to spend some time verifying test vectors, but I am really looking forward to writing a higher level interface wingo: https://wingolog.org/archives/2018/01/17/instruction-explosion-in-guile manumanumanu: wingo: Sweet! I am sorry I am too stupid to contribute anything else than a bit of ecosystem to guile :-P dsmith-work: Hey Hi Howdy, Guilers amz3: o/ OrangeShark: hello everyone catonano: OrangeShark: hello ArneBab: cmaloney: ☺ ArneBab: wingo: new reading material - describing how Guile got much better; win! + win! THANK YOU! vivien_: Hello, I am trying to build a list in a piece of C code. I know I can iteratively call scm_cons, but what should I use for the default empty list value? Is there a constant like SCM_BOOL_F? I thought the best place to find this information was here: https://www.gnu.org/software/guile/manual/html_node/List-Constructors.html#List-Constructors vivien_: Should I use NULL? scm_list_n (SCM_UNDEFINED)? vivien_: Well, that was in fact easy: https://www.gnu.org/software/guile/manual/html_node/Immediate-objects.html => SCM_EOL manumanumanu: jesus christ in a chicken basket. I love macros. manumanumanu: A friend of mine created bindings for libsodium for perl, and the amount of boilerplate is astounding daviid: hello guilers! manumanumanu: good evening OrangeShark: Happy Tuesday! dsmith-work: Tuesday Greetings, Guilers roelj: Is there a convenient function in Guile to find a file matching a regexp? Like (find-file "/home/user/some-dir/*/*-tag.txt") davexunit: no davexunit: you could use the file tree walking procedure plus a regexp to write it, though davexunit: see the docs for 'ftw' in the manual roelj: Alright, thanks :) daviid: roelj: I wrote one, not as beautifull as i wish, but it might help ... daviid: http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/fs-ops.scm?h=devel daviid: see get-filenames (it's based on Aubrey Jaffer's SLIB, see the commentary in (grip support slib) ... daviid: roelj: I believe guix has a 'find file' in its utils too, maybe ask in #guix roelj: daviid: Oh, that is very useful, thanks! daviid: roelj: yw Wojciech_K: Hello! How to make Guile `eval` in local scope? Example: (let ((x 3)) (eval '(+ x 1) ??) Wojciech_K: ) bavier: does anyone know how to suppress output from ldconfig like: "/sbin/ldconfig: /usr/local/lib/libguile-2.0.so.22.8.1-gdb.scm is not an ELF file - it has the wrong magic bytes at the start."? dsmith-work: Wojciech_K: Hows this: https://www.gnu.org/software/guile/manual/html_node/Local-Evaluation.html bavier: I think the gdb debugging support for libguile is great, but I've heard too many complaints about that output from ldconfig Wojciech_K: Thanks, dsmith-work. (local-eval sexpr (the-environment)) does the trick dustyweb: davexunit: https://www.npmjs.com/package/commander look at this stringly typed madness ArneBab_: dustyweb: where is that stringly typed? is the typing not rather in the type-parsing functions? dustyweb: .option('-p, --peppers', 'Add peppers') dustyweb: ArneBab_: so right there dustyweb: it's extracting the options based on what's in that string dustyweb: rather than taking them as some sort of proper arguments dustyweb: but it gets a bit goofier dustyweb: .command('install [name]', 'install one or more packages') dustyweb: you can also do that stuff dustyweb: I dunno, parsing the structure out of strings passed in seems really gross to me dustyweb: davexunit introduced me to the term "stringly typed", I may be misusing it though ;) ArneBab_: isn’t --peppers just giving the variable name? dustyweb: yes, the option name is parsed out of that string dustyweb: but why parse it from a string? better to have the structure actually passed in via... structure dustyweb: I'm doing more javascript for work so I'm just complaining ;) ArneBab_: Given that these come from the command line, they actually come as strings, I think ArneBab_: you may be in a better position to judge whether the parsing functions actually provide any type security in Javascript, though ArneBab_: You could still add an integer argument to a string argument and get it appended to the string OrangeShark: I believe stringly typed is more like where you pass strings to represent types to change the behavior of something ArneBab_: so that just checks the structure of the arguments (that they can be interpreted as the given type) but does not give you runtime guarantees. ArneBab_: Technopedia claims that stringly typing means to store things in strings: https://www.techopedia.com/definition/31876/stringly-typed OrangeShark: okay, the example they give is storing the date as a string ArneBab_: I don’t know whether they are right in their description, though davexunit: dustyweb: Ruby's OptionParser class is similarly stringly typed and terrible davexunit: I use it pretty frequently at work to make cli utilities dustyweb: ArneBab_: sounds like stringly typed to me :) ArneBab_: dustyweb: ok - thanks :) cmaloney: dustyweb: javaScript is just a frustrated Scheme. ;) Apteryx: Hello! What should I use to check if a string contains NUL characters (#\\nul) ? Apteryx: can a single character be expressed as string ("#\\nul") to be used with string-contains? ft: You could use (make-string 1 #\\nul) Apteryx: oh, so it is "\\x00" as a string. That's a neat trick, thanks! ft: Or maybe use string-any ft: (string-any (lambda (x) (char=? x #\\nul)) the-string) Apteryx: OK. I'll use the first trick since it is easier to comprehend. Thanks! Apteryx: ah, now I see #2 does the whole contains-nul-byte? predicate. Neat also. ft: With the second one you can also use Guile's character-set API. ft: If you want to test for multiple different characters. Apteryx: cool hugo: jeko: The SRFI's seems to be in the debian package guile-2.0-libs hugo: So try downloading that amz3: héllo all rekado_: guile-debbugs is now part of GNU :) civodul: rekado_: woohoo! civodul: congrats! amz3: congrats! rekado_: thanks :) rekado_: now I only need to find time to continue work on mumi, the frontend to debbugs that I was working on some months ago. civodul: maybe you can offload it, just advertise it and see civodul: people are sufficiently unhappy with the debbugs interface to be willing to help ;-) amz3: +1 amz3: rekado_: a frontend using guile-gnome :D amz3: rekado_: what do you have in mind? rekado_: amz3: a *web* frontend. dsmith: Howdy Guileers dsmith: sneek: botsnack sneek: :) dsmith: sneek: seen rlb? sneek: I last saw rlb on Jan 03 at 01:00 am UTC, saying: (nb. we may need to figure out the guile-2.2 arch build issues in the next couple of weeks to avoid removal from debian testing.). rlb: ? dsmith: rlb: Just checking on the bot. Your nick is often the one I use to see if "seen" is working. dsmith: rlb: btw, what's up with guile in Debian? Will it potentially be removed for all archs? Or just the failing ones? rlb: I believe all. dsmith: Ouch rlb: But I should double-check. ZombieChicken: Why would Debian remove Guile? amz3: build issues amz3: daviid: hello cmaloney: is it just that someone hasn't picked up the maintenance? amz3: daviid: did you see my reply to the mail? manumanumanu: Good evening guilers amz3: o/ daviid: amz3: i have no prediction on when g-golf will really exists, you should use, as I said may times recently, guile-gnome and/or guile-clutter... jeko: Hello ! daviid: and wrt to your glib loop related quiz, you should look at guile-async2 (it is the only concurrent programming toolbox I'm aware of that intract with glib loop, and it is well written, well maintained, well documented...) dsmith: cmaloney: rlb has been the faithful packager of Guile for Debian for decades. Well, over 10 years at least. dsmith: cmaloney: Looks like there are bugs that prevent it from building on some archs. ArneBab: amz3: I think another reason for the meanness against web developers is that web developers get all the glory (of being visible to users). Nowadays if you want to do anything which directly benefits people, you need web developers, since what they build works everywhere, from desktop to smartphone, and only requires clicking a link to execute. A third reason is that many of current web applications don’t run on the beloved old platforms anymore ArneBab: (since they require more than 256 MiB of memory). But so do many modern desktop programs and games. rlb: Right, the issue is FTBS (failure to build from source) because a couple of tests are failing sometimes. ArneBab: amz3: but given the complexity of getting a web application right (lean, fast, beautiful, scaling), the thought of web dev being easy isn’t fair rlb: ArneBab: and *secure* rlb: ...I've quite enjoyed writing a couple of "apps" in clojure (backend) and clojurescript (front end), but they're not industrial strength. rlb: (enjoyed, except for attempting to navigate the security minefield) daviid: rlb: why not kawa for the backend? rlb: I got interested in clojure a while back and built some bits I needed using it (and then clojurescript on fxos) to learn it. ArneBab: amz3: you could implement the spam defense via web of trust from freenet on top of gnunet. See https://github.com/freenet/plugin-WebOfTrust/blob/cc62a06eb541a147d88ffae84ab43cd48c18adc5/developer-documentation/core-developers-manual/OadSFfF-version1.2-non-print-edition.pdf rlb: https://gitlab.com/noservice/noservice rlb: As one (sketchy) example. ArneBab: that provides scaling, decentralized spam resistant communication ArneBab: rlb: getting the web apps secure is wizard level :) ArneBab: daviid: I’m thinking of learning kawa, because (at new work) I’ll mostly be working with java rlb: (and don't get me wrong, I've found the css/js/... world to be difficult, but it's quite nice to be able to use my bits from both my phone and my normal browser, and my experiences with gui tookits haven't been a walk in the park either) ArneBab: amz3: a direct download link is https://github.com/freenet/plugin-WebOfTrust/raw/cc62a06eb541a147d88ffae84ab43cd48c18adc5/developer-documentation/core-developers-manual/OadSFfF-version1.2-non-print-edition.pdf ArneBab: rlb: yes - and nothing in GUI land ever got close to the ease of chaining command on the command line ArneBab: at the same time nothing on the web reaches Emacs daviid: ArneBab: kawa is a lot better then clojure. it really is unfortunate it's not known and did not get the publicity clojure did ... ArneBab: and it’s all crazy to see the well working expert tools disappear behind simplified online tools … ArneBab: daviid: when I looked it up in some detail last week, kawa sounded great - I don’t understand why it’s not much more of a killer in ecraven’s benchmarks ecraven: ArneBab: I haven't run them in some time, and I still have to change the graphs to a better representation ecraven: I hope to get to do this tomorrow ;) ArneBab: ecraven: I created a small program to aggegrate the data daviid: i really don't like web app, i don't think i will ever like web app: imo an app must run locally, without iternet connection, all the rest is crap :) ecraven: daviid: you can always just open the html file locally, it doesn't need anything external, I think ArneBab: ecraven: https://bitbucket.org/ArneBab/wisp/src/d04938232934871bbb69f1beff53752ff4df85d8/examples/evaluate-r7rs-benchmark.scm ecraven: ArneBab: thanks! ArneBab: ecraven: if the app is written that way - it’s hard to tell till you try ArneBab: ecraven: maybe you can use that to add a summary plot daviid: amz3: of course if you wan't to contribute to g-golf, welcome, we can talk ... i'd have to think about how, and as you know, the learning curve is steep daviid: ecraven: i guess my idea of apps is the gnome 'stack' of libs, not html css js (I just hate js :)) ecraven: daviid: yea, but this is more of a document than an app daviid: if we had more rsources, we would write CLIM in/for Guile ArneBab: ecraven: if you follow the instructions in the header (comments), you get a plot like this: http://www.draketo.de/bilder/guile-ecraven-benchmarks-result-2017-08-13.png rlb: (That's one thing I liked about cljs; I was able to just use clojure in the browser (still don't know much js).) amz3: I like FTBS, I think it's a good reason to hate JS ecraven: ArneBab: nice, thanks again! I'll look into this tomorrow ArneBab: daviid: we’d need a way to generate more hacking time for Guile - money and getting zealots daviid: rlb: yes, I hope we will have guile-javascript one day ArneBab: but it’s hard to get the latter without locking the system into a given state rlb: sounds good to me daviid: rlb: it's too bad there is no kawa-javascript ArneBab: guile compiled to JS with full tail recursion would be great ArneBab: kawa did add that on the JVM, but I learned over the years how hard it is to just transfer a feature from one system to another … rlb: One trick cljs uses is to pass relatively simpler js output through the closure compiler to make it much more efficient. No reason the same couldn't be done with guile's output. rlb: (if it helped) ArneBab: and from the tests in the kawa blog, kawa is really fast, outside some edge cases it’s even very fast with full tail recursion rlb: https://packages.debian.org/sid/closure-compiler daviid: and with kawa you don't need any ecosystem, just kawa and emacs... (but no slime/geiser, java does not let you a new compiled version of a function... ArneBab: ecraven: besides: a big thank you again for your benchmarks! daviid: going afk, bbl ecraven: I didn't do much, all the benchmark code is from larceny ;) ArneBab: you did the hard work of integrating that with everything else amz3: there is reason the learning curve is steep amz3: I don't need a PhD in language theory and MOP to use GOOPS amz3: simply said, https://learnxinyminutes.com/ is of tremendous help, rosetta code is of tremendous help amz3: guile mind book is helpful amz3: not everything should be in the academical wording, spelling and style to be useful and good amz3: since nobody, want to help me, I will learn GOOPS the hard way and make it simpler for future guilers amz3: whether they milleniums or not is irrevelant amz3: it's always the same, young generation are lazy and stuff amz3: wrong! amz3: it's not because older generation suffered reading book without the help of handy C-s or whatever to look up the book that is easier than an index that everybody must feel the same pain cmaloney: Everyone should start with two registers, 8 opcodes, and 12 bytes of memory cmaloney: 6 of which are taken up by the boot loader amz3: not everybody can know everything, we have to help each other step by step and learn from mistakes to avoid future generation do the same cmaloney: (three of those opcodes are poorly documented and will crash the machine) cmaloney: I agree: We should all help others become better cmaloney: and learn from our mistakes jeko: I agree :) cmaloney: The only caution I have is for folks who eschew best practices that are hard-fought and won (packaging tends to get re-invented every 3 years or so and everyone discovers the same cyclic dependencies issues) cmaloney: and for experienced folks to step back and realize that the only way for folks to progress is to make mistakes and break free of traditions cmaloney: Also in scheme I think there's a tendency for folks to think of it as their D&D (Dungeons and Dragons) cmaloney: wherein the one true way to do Scheme is pretty much the way they do it cmaloney: I think Scheme is more prone to this than most languages because of its flexibility cmaloney: But when I said "D&D" you immediately thought of the the D&D that you most identify with cmaloney: But there's been many iterations over the years cmaloney: yet there's always someone who says "you're not playing D&D unless it comes from the original Chainmail rules!" cmaloney: and one that says "Moldvay Basic Rules were the best!" cmaloney: and another: "3.5 is the best becaause blargh hargle narglefop" amz3: ^^ cmaloney: And yet others who say that their OSR ruleset of choice is the best cmaloney: but they all scratch different itches for folks, even though they have the same root cmaloney: so understanding that Scheme is a giant tree and there are many places to sit amongst its branches, and many different views from those branches is key amz3: I agree daviid: knowledge is experience, you can't teach someone experience, so one has to practice, and practice gain, others may review (it takes time, and not everybody likes to teach (I really don't like to teach for example, though I did teach helicopter flying for years) amz3: ok Apteryx: what's the best way to check if a directory exist? Apteryx: file-exists? looks like it Apteryx: why are packages being built /gnu/store/some-hash-mypackage found themselves amongst their 'inputs'? Apteryx: sorry, that's not true. something else is at play. catonano: amz3: your reply about Culturia and Wiredtiger is a bit longer, I'll rread it later ;-) amz3: since yesterday discussion with dustyweb about racket's scribble, I've been thinking about making an alternative to it in guile amz3: I can't take that idea out of my mind, it's painful amz3: "Another important GNU standard is that GNU programs should come with documentation in Texinfo format." https://www.gnu.org/help/evaluation.en.html amz3: Looking up the documentation of scribble again, I am not sure it's the best we can do, the syntax is rather complicated amz3: I prefer skribe actually daviid: than skribilo already works with Guile amz3: skribilo doesn't work with guile 2.2.3 and doesn't generate texinfo IIRC daviid: amz3: you might prefer to contribute to skribilo... I wonder what scribble has that skribilo doesn't? daviid: amz3: but it works with guile ... it is a much better route ... amz3: that's the thing, scribble only has beautiful html output with a search engine and ... awesome font selection daviid: I's patch skribilo rather then start ' guile-scribble' from scratch amz3: you are right daviid: at least i would ask on skribilo wha they think (and they, is civodul, so you'll have dead beautifull code to play with, support, opinionated opinion ...) amz3: I am not good at discussing actually... daviid: just grabb and study skribilo on your own then ... patch and send patches... daviid: i'm almost certain it can do what scribble does, it is just a matter of resource daviid: amz3: porting it to 2.2.3 would be an excellent start ... imo dustyweb: amz3: IMO Skribe's syntax (the string quasiquote) is nicer from a programmer's perspective, but Scribble's syntax (of strings-by-default, escaped into code) is a bit nicer dustyweb: but yes! please contribute to skribilo :D dustyweb: that is a great project amz3: I am not good at contributing amz3: I like to do my own things amz3: maybe I shoud change that in _2019_ but not yet amz3: Changing of topic, I am looking for an application idea to write on top of gnunet amz3: any idea? amz3: it must be slow kind of application, not something like cooperative editing like hackpad amz3: I was thinking about a wiki but i prefer the bulletin board thing catonano: amz3: I'd love a social network to publish photos catonano: anohthher one fforr storring and sharing bookmars, like Pocket catonano: the photos could be georeferenced, like thhey were in Panoramio catonano: thhat is, being placeable on thhe openstreetmaps map amz3: yep catonano: o enough :-) amz3: a bulletin board or forum in nowdays parlance is a social network catonano: yes catonano: well, I don't know anymore catonano: I knew what the web was before the web 2.0" wave catonano: A forums seems to be a concept coming from an age before the web 2.0 wave, but thhat's ok :-) amz3: well it's true that forums are rather old school but they are still current amz3: see HackerNews, reddit, somewhat quora, somewhat stackoverflow, discuss amz3: actually all those forums I cited have flaws, outside the non-free aspect (and closed garden in the case of quora) catonano: ah yes catonano: those are a bit more of a form to me, but as I said, it's ok. ANY app on top of GNUNet is an extremely good thhing right now amz3: like for instance, unlike a wiki, there is no one-stop place where you can learn everything to know about a given subject amz3: catonano: yes, you are right, I am asking, because I don't want to build something and then nobody will try to try it catonano: I will ;-) amz3: I plan to use command line interface to avoid because a lot of people around don't like much web tools amz3: I wondering if people don't like html + css + js because it's crap or because a lot of it is closed source or because it's hype catonano: I dont understand: do you want to _avoid_ command line ? amz3: catonano: I will code a command line not web ui catonano: ah I see catonano: I don't know. Thhat would cut out a lot of potential users catonano: people hhate web stuffff, not GUIs spk121: amz3: I do reject the premise that people avoid html+css+js. In practice, most of my computing life is spent in other people's websites. spk121: amz3: I just don't like coding in it, because it is so many weird technologies stuck together catonano: I would consider a Gnome based GUI :-) amz3: catonano: I don't know guile-gnome, yet. catonano: eh amz3: spk121: I agree, but videos, blink, gifs and stuff... maybe it's possible to do all that stuff in guile-gnome catonano: you're right amz3: if there was an equivalent of snabbdom for gnome it would be nice amz3: too bad daviid just logged out jeko: Hello guilers !! jeko: I have installed Guile on my Trisquel and I miss some SRFIs in the distribution :-( jeko: I have downloaded and installed manually the SRFI64 for example jeko: Is it the nominal case for Guile 2.0.9 jeko: ? hugo: That doesn't sound right hugo: Where did you get it from. The git://git.sv.gnu.org/guile.git repo contains all the SRFI code for guile jeko: Hi hugo ! I just sudo apt-get install guile-2.0 amz3: ACTION questioning himself about gtk vs web stack louishaemmerle: does guile cache .go files somewhere potentially? civodul: louishaemmerle: yes, under ~/.cache/guile/ccache/ louishaemmerle: ah louishaemmerle: that explains a lot louishaemmerle: I integrated my test files with automake, along the lines of how https://github.com/wingo/fibers/blob/master/Makefile.am organizes it louishaemmerle: and then it seems it prefers to use .go files in that cache civodul: the remedy usually is to set GUILE_AUTO_COMPILE=0 in your makefile civodul: so that your tests don't end up auto-compiled apteryx: hi! what's a good way to retrieve all the values from name/value pairs in a an alist? Should I use match or simply cdr? happy_gnu[m]: apteryx: how big is the list? apteryx: small happy_gnu[m]: but if it is small I don't think cdr will make much of a difference happy_gnu[m]: that is my opinion of course :/ maybe someone else will correct me :) apteryx: thanks, happy_gnu[m]! apteryx: anyway to get the subdirectory name of some dir? Without having to pipe the output of ls? amz3: apteryx: to retrieve all values from an alist you can do (map cdr alist) amz3: apteryx: I don't understand the second question amz3: ... amz3: btw, GSOC is getting started, if you have ideas about guile project reach the maitainers amz3: I am lost... amz3: I don't know what to do... apteryx: amz3: thanks. I think I've found a workaround for my second question, using something already in Guix. apteryx: amz3: You mean you need GSoC ideas for Guile? amz3: not for me, but for Guile amz3: not for me, but for Guile project mwette: amz3: the debugging infrastructure needs some love amz3: Why people have to be mean to web developers? I am wondering? this is a old/exp person vs the newbie or high-level lang vs low level lang amz3: that's painful OrangeShark: amz3: I think one part of it has to do with the perceived difficulty of web development, they consider it "easy" compared to other development mwette: so I may be moving off Guile dev on the mac: my Dell XPS13 w/ Ubuntu just arrived apteryx: mwette: cool! amz3: OrangeShark: sadly amz3: Does any plan to publish something for http://www.european-lisp-symposium.org/ amz3: o/ dsmith-work: Happy Friday, Guilers!! cmaloney: Happy Friday ijp: merry fridaymass amz3: some gnunet hacking ftw OrangeShark: happy friday amz3: I need a nap first amz3: hello OrangeShark OrangeShark: hey amz3 how are you doing? amz3: fine and you? amz3: I got into gnunet :D amz3: I mean, I understand enough gnunet to work on the bindings OrangeShark: I think I can use a nap as well :P amz3: ^^ OrangeShark: amz3: also nice about gnunet, I never really had a chance to look into that project. amz3: they made a massive update of the documentation, https://d.n0.is/d/manual/ amz3: this is not the official new documentation but a pre-release ^ amz3: https://dpaste.de/0R9T/raw amz3: :D ArneBab_: daviid: if you do find something you like, please tell me :-) ArneBab_: amz3: is gnunet working well nowadays? ArneBab_: it’s been years since I last looked into it daviid: ArneBab_: sure amz3: ArneBab_: I only tested locally, but it seems like there is some activity in the network apteryx: Hello. Is it wasteful to have a dockerfile used for CI (building software on each commit) that starts with: apt ugrade -y ? It seems like this would waste bandwith resources... or is there some fancy caching that will prevent that from happening? amz3: ? amz3: apteryx: wrong channel? amz3: apteryx: I don't think you can avoid the apt upgrade -y amz3: apteryx: you would need a fresh image everytime CI kicks in amz3: apteryx: you can have "local" apt cache via aptly amz3: apteryx: this will speed things up amz3: o/ ZombieChicken: Trying to get termbox.scm working and I'm getting an error "no code for module (bytestructures guile)". Where might I find that module? ZombieChicken: First time trying to handle this kind of thing, so I'm a bit lost overall ZombieChicken: nvm. Think I found it. Now to just get it working... ZombieChicken: Okay, so I'm lost. Seems termbox.scm isn't loading, and I'm not sure why: http://dpaste.com/1WP53CK.txt <- source http://dpaste.com/140711A.txt <- error ZombieChicken: termbox.scm is sitting in the same dir as term-test.scm and i'm starting it with "guile -L ~/path/to/bytestructures term-test.scm" manumanumanu: Good morning everyone amz3: ZombieChicken: you need to install termbox library too amz3: https://github.com/nsf/termbox amz3: sorry the README is very poor ZombieChicken: It is installed ZombieChicken: Hrm. Ran "LD_PRELOAD=/usr/local/lib64/libtermbox.so guile ..." and now I'm getting this error http://dpaste.com/0GNVEM1.txt ZombieChicken: Not sure why it didn't automatically look there, but oh well amz3: ZombieChicken: are you using guix's guile? ZombieChicken: No ZombieChicken: Gentoo's. version 2.2.3 amz3: ZombieChicken: run you script with, guile -L path/to/where/is/termbox.scm term-test.scm amz3: -L will add the path to GUILE_LOAD_PATH ZombieChicken: Same error amz3: what command do you use to execute your term-test.scm ? ZombieChicken: okay, I had changed something in term-text.scm (s/load/module-load/ or something) and swapped it back. Now I'm getting "ERROR: In prodecure primative-load: In procedure fport_read: Is a directory" amz3: -L value must be directory amz3: if you create term-test.scm inside azul.scm repository, you need to do something like: guile -L . term-text.scm amz3: with LD_PRELOAD amz3: in front if it's required ZombieChicken: okay, so I'm calling the script with "LD_PRELOAD=path/to/lib guile -L ~/path/to/scheme-bytestructures/ -L . term-test.scm", and am now getting "/path/to/term-test.scm:1:0: In prodecure module-lookup: Unbound variable: tb-init ZombieChicken: the (load ...) is (load "termbox.scm"), but otherwise it's the same as previously posted amz3: it's not (load ...) but (use-modules ((termbox)) ZombieChicken: Well, now it's garbling my screen, which I think is a Good Thing right now ZombieChicken: Thanks amz3: ;) amz3: :) dsmith-work: {appropriate time} Greetings, Guilers amz3: o/ amz3: ZombieChicken: does it work? ZombieChicken: amz3: Yeah, I got it to work ZombieChicken: Once I got a garbled screen, I knew it was working ZombieChicken: Now I'm just messing with it amz3: :) amz3: ZombieChicken: I did not tell you previously but there is a fork of termbox with true color support ie. 24 bits colors ie. good colors let me know if you need it ArneBab_: daviid: there are now scheme versions of all examples, you’ll need to test them, though (I only did the automatic conversion, didn’t have the time to check whether they actually work): http://bitbucket.org/ArneBab/wisp/src/tip/examples ? ArneBab_: daviid: but they should work - each which doesn’t exposes a corner case I missed. OrangeShark: hello everyone ArneBab_: Hi OrangeShark daviid: ArneBab_: nice, thanks, I'll look at them again ArneBab_: daviid: have fun! ☺ ZombieChicken: amz3: Go ahead and link me, though I don't think I'll need it amz3: ZombieChicken: it's in the PR of nsf's repository: https://github.com/nsf/termbox/pull/104 ZombieChicken: amz3: ty wingo: moo manumanumanu: amz3: chez's ffi lets you use bytevectors directly in C functions. Even strings, which it automatically converts to bytevectors (using utf8). That is quite nice :D manumanumanu: ZombieChicken: I have used guile-ncurses with guile-2.2 rekado: I’m playing with wisp now. rekado: can I mix wips and regular scheme modules and have Guile do the right thing for files written in wisp? rekado: e.g. by using a “language cookie” comment somewhere? rekado: for now I’ll just compile the wisp code to bytecode. civodul: hmm, looks like we don't have a way to read as much as possible from a port without blocking civodul: like read(2) would do wingo: i think we do wingo: ACTION looks rekado: wisp is great wingo: civodul: doesn't get-bytevector-n! do that? civodul: wingo: for an unbuffered port it always returns at most... 1 byte civodul: wait, sorry civodul: get-bytevector-some returns at most 1 byte civodul: get-bytevector-n! blocks until it has everything you asked for or EOF is reached rekado: I’m playing around with the Guix workflow language and using the wisp with some extra syntactic sugar makes the language look very … “modern”, i.e. very close to what users of other workflow languages might expect. civodul: internally, only scm_i_read_bytes does like read(2) civodul: rekado: modernity! :-) wingo: humm, there should be something that's closer to read... humm wingo: i would look to r6rs binary ports specification, see which function looks like it should do what you want, and then see if guile's implementation is correct wingo: get-bytevector-some is probably doing the right thing fwiw civodul: i think get-bytevector-some should be like read(2) civodul: but for unbuffered ports it's not civodul: let me see why that happens wingo: i think it's probably just because an unbuffered port really is a single-byte-buffered port wingo: and so it is taking 1 byte to be the default buffer size, the default read size wingo: and so it fills that buffer and gives it to you civodul: oh right, it calls scm_fill_input, so it fills its 1-byte buffer civodul: what we'd need is a get-bytevector-some! procedure, so the user can provide a buffer of the size they want wingo: or maybe if the port buffer is 1 byte, then get-bytevector-some! could default to e.g. 2048 bytes or something wingo: calling the port's read functions directly in that case if the port buffer is empty wingo: that way all users of get-bytevector-some would get more bytes at a time, which is probably the right thing wingo: wdyt? civodul: sounds reasonable, yes civodul: i've emailed the details to bug-guile wingo: ArneBab: rekado is enjoying wisp :) rekado: civodul: appearing “modern” is somewhat important to attract bioinfo people. When something looks like yaml (is this all it takes to be “modern”?) it’s more likely to get a chance. civodul: yeah civodul: rekado: actually i wanted to put a wisp package definition on the guix-hpc web site for instance rekado: we can’t do that when it takes too much extra effort to get wisp to work with Guix rekado: for example, (guix discovery) looks only for .scm files, and would ignore .wisp files. rekado: is there a “safe” way of registering a reader extension? rekado: I have a file in which I do (eval-when (compile eval) (define the-reader …) (read-hash-extend #\\` the-reader)) rekado: when I compile modules that use this module, however, I get a crash because for some reason this reader is used on my own code. rekado: and that’s even though that module does not contain “#`” at all. civodul: wingo: i've posted a tentative patch civodul: rekado: re .wisp, good point; we could fix it though civodul: rekado: note that #` is already taken (quasisyntax) civodul: so it's a bad idea to register it rekado: oh, you’re right :-/ rekado: I was going for R markdown style code blocks, and the separator there is ``` rekado: I guess #- is still free… civodul: i think so :-) wingo: civodul: some nits :) wingo: probably we should allow guile to map extensions to reader options or something wingo: or default languages (.el for example) dsmith-work: Wednesday Greetings, Guilers davexunit: wingo: did you see my bug report about float unboxing in 2.2.3 by any chance? trying to understand if it was an intentional change or not. wingo: davexunit: no i did not davexunit: okay, no worries. just checking :) davexunit: maybe just to clarify: is "instruction explosion" a phenomenon happening in the 2.2 stable series? wingo: davexunit: no that's in 3.0 wingo: in master wingo: it might make things slower until we add a jit, because although the total amount of work will be lower, it will be done by more instructions, and in the interpreter we have a significant per-instruction cost davexunit: wingo: okay thanks for the clarification. I thought this was the case but wanted to make sure. davexunit: in that case, I believe that the performance regression I found in 2.2.3 is a legitimate bug. davexunit: lists.gnu.org/archive/html/bug-guile/2018-01/msg00005.html rekado: ArneBab: in wisp I’d like to break a line and continue it in column 0 of the next line. Is this possible? civodul: rekado: i'll need your examples for the FOSDEM talk :-) rekado: civodul: the GWL with wisp examples? civodul: yes rekado: will send them to you once Roel is willing to accept my changes. davexunit: civodul: oh you're talking at fosdem? I thought all the guix talks got rejected this time around? civodul: davexunit: i'm giving a talk in the HPC devroom, and cbaines is giving one in the container devroom i think civodul: two rejected, two accepted davexunit: oh cool davexunit: that's better than I thought civodul: yeah not too bad! :-) ArneBab: rekado: that's not possible because it would break the core concept of representing parentheses by indentation ArneBab: rekado: to simulate it, you'd have to create a macro which assembles the line step by step rekado: ArneBab: hmm, that seems too messy. I guess I can live with keeping things on one line. ArneBab: rekado: or wrap it into parentheses ArneBab: rekado: what do you need? ArneBab: the continuation in wisp needs higher indentation in the continuation line ArneBab: proc arg1 arg2 ArneBab: . arg3 arg4 rekado: ArneBab: here’s what I’m currently working on: http://paste.debian.net/1004533/ rekado: line 18 is where I’d like to support a line break rekado: #---{python} is a reader macro that ends with “---” civodul: inline python, woo :-) rekado: civodul: and inline R! rekado: it’s a mess, but it’s also convenient ArneBab: rekado: if it adjusts the reader, wisp shouldn't even see it, just like it does not see linebreaks in parens ArneBab: the example looks really cool, by the way! rekado: ArneBab: this already works, but I would like to be able to break *before* the reader macro. rekado: i.e. start the line with #--- rekado: thanks :) civodul: ArneBab: does wisp have special syntax for (list a b c) ? ArneBab: ah, so you want #--- on the beginning of the line? civodul: that would be handy rekado: ArneBab: exactly. ArneBab: civodul: you can use ' a b c ArneBab: (start the line with ') ArneBab: that’s like '(a b c) then civodul: ah yes, but i meant specifically for building lists civodul: [ a b c ] would be nice, for example civodul: as in Python (?) ArneBab: rekado: the only thing I se would be to use something like an identity function and put a ( on the indented line rekado: civodul: I was thinking of letting the “process:” and “workflow” macros abstract away the list building. ArneBab: rekado: procedure (identity \\n #--- .... ) rekado: I see. ArneBab: civodul: wisp doesn't add anything there which isn’t in scheme civodul: yeah, sure ArneBab: civodul: that’s to keep the scope small civodul: it could have a wispy "read syntax" thing to add this civodul: yes, that makes sense ArneBab: yepp - but that syntax would also be useful for non-wisp scheme civodul: but adding sugar is very tempting in this setting :-) ArneBab: yes ArneBab: I consider that as a trap the readable folks fell into civodul: i don't feel the need for syntactic in Scheme, but in wisp it seems to be an expectation ;-) civodul: readable has extra syntax? ArneBab: not for lists, but for other structures, like << >> for double parens daviid: ArneBab: when someone writes a module in wisp, can we rewrite it in scheme? so it would produce a module, perfectly indented in scheme? ArneBab: daviid: yes daviid: I mean is there an automatic way to do it? ArneBab: daviid: guile wisp.scm MODULE.w > MODULE.scm daviid: ArneBab: cool! then I suggest you add all the scheme modules next t the wisp modules you wrote I can't reember where :) ArneBab: wisp.scm acts on the pure text, so it even keeps the comments ArneBab: daviid: I’d like to publish the cool stuff of that as scheme daviid: ArneBab: so I do wisp -> scheme, opens in emacs and it'd all indented as if I firt wrote it usng emacs ArneBab: daviid: if you indent like that in wisp (which you should), then yes ArneBab: daviid: and if not, scheme is very easy to automatically reindent daviid: ArneBab: I have difficulties to read wisp, but i was interested by some of the odules you worte, then I disisted because it was not in scheme (so to speak) ArneBab: the tarballs ship a wisp.scm which allows you to do that automalically ArneBab: so you can even skip the bootstrapping for that daviid: ArneBab: ok, but on that site of yours, it would be nice to have both afiles, imo daviid: going afk, bbl ArneBab: I can do that, yes ArneBab: daviid: do you mean bitbucket? daviid: let me know then , I'll re read the site daviid: ArneBab: where you have lot's of examples (wisp modules...) ArneBab: http://bitbucket.org/ArneBab/wisp/src/tip/examples ? rekado: note that if you use reader macros you have to load them first or wisp.scm won’t do the conversion correctly (as in my example) daviid: ArneBab: yes there, it would be nice to have both the wip and the scheme versions, imo daviid: bbl ArneBab: rekado: reader macros could be a problem for wisp.scm, since that does not use the reader … it’s either keeping comments or using the reader ArneBab: rekado: argl, that’s a complication - will need manual tweaking on that one ArneBab: (except if you go for the (identity route - then it will be seen as inside a paren ) rekado: while the identity trick is nice I feel that it pushes the amount of syntax over the threshold. rekado: admittedly “#---{python}” is already a lot of syntax ArneBab: why not the #---{\\npython}? ArneBab: python does not mind starting with an empty line rekado: I’m mimicking Rmarkdown syntax rekado: for embedded code blocks it uses this syntax: ```{language}\\ncode…\\n``` rekado: but I guess I could ignore whitespace before “{”, which wouldn’t look too bad. ArneBab: ah, now I understand (took a while) ArneBab: yes, I think having {python} at the same indentation as the code would be useful to make it clearer where the code starts and ends amz3: so gnunet-guile works as expected with taylan patch amz3: to guile-bytestructures amz3: ACTION sent a new package to guix amz3: now, I just need to manually go through hundreds of definitions in gnunet headers and bind what is missing ie. most of it amz3: louishaemmerle: I debug with 'pk' louishaemmerle: amz3, what is 'pk'? amz3: logicmoo: amz3: sorry cehteh: :D amz3: héllo all manumanumanu: Hallå all! ZombieChicken: Is there a logic programming module for Guile out there? Something like Prolog? civodul: ZombieChicken: minikanren! ft: Does minikanren run on Guile maybe? civodul: there's a Guix package, even ZombieChicken: I don't run Guix manumanumanu: Hmmm. I am having some problems using pointer->procedure. I am writing a scheme FFI binding for libsodium, which sadly has me dabbling a bit with memory allocation. I am trying to make a binding to sodium_malloc, which is a memory-protected version of malloc that instantly kills any application trying to read too far (or before the memory region). manumanumanu: making a correct binding to sodium_malloc is easy (the same as malloc), however, running it from guile immediately kills guile manumanumanu: so guile must be doing something wonky with with the memory manumanumanu: if any of you have libsodium installed, you can try this: https://pastebin.com/8Np72eFj manumanumanu: I don't know how guile handles external memory pointers, but that behaviour seems a bit weird manumanumanu: I have tried passing it sodium-free as a finalizer using make-pointer, but it still coredumps dsmith-work: Tuesday Greetings, Guilers amz3: o/ amz3: ZombieChicken: I use this fork of microkanren that runs on guile https://framagit.org/a-guile-mind/guile-wiredtiger/blob/master/microkanren.scm wingo: moo ZombieChicken: amz3: Someone on #prolog pointed me to something else that I think will do the job, but thanks for the link. ZombieChicken: though I do like one file solutions to problems. Hmm ft: ZombieChicken: what did they point you to? ZombieChicken: guile-log, I think ZombieChicken: I'm not sure I'll be using it tbh ZombieChicken: it was mostly a 'just in case' kind of thing amz3: ZombieChicken: well, if you do something useful with minikaren, microkanren or guile-log don't forget to post it to the mailling list please amz3: I am very interested amz3: myself I use microkanren to do recursive queries of a feature space ZombieChicken: I'm just trying to start piecing together a design for a chat client ZombieChicken: because I'm sick of the options out there right now amz3: chat client? how is that related to logic? ZombieChicken: That's part of the reason I was looking for options. Once I figure out about how I want to try something, I want to know if I have the tools to do it amz3: ZombieChicken: I build a database is scheme that you can query in microkanren amz3: I mean it rely on a C library amz3: but the interface is guile stis: heya guilers! manumanumanu: stis: ahoy! manumanumanu: What is going down in GoT-town? stis: slow times, slow times, not much, som physics play with math and theory manumanumanu: What weather we have in Sweden these days. It lends itself well to programming ijp: I dunno, I'm not much further south, and I'm just sick fed up of looking at computer screens manumanumanu: I am rained in ijp: although I'm writing maths not code manumanumanu: what options for the built in FFI are there? ArneBab_: amz3: is there a simple tutorial for microkanren in Guile? amz3: ArneBab_: no :/ amz3: manumanumanu: "for the built" ? what is that? manumanumanu: amz3: : for the built-in ffi dsmith-work: amz3: "built in" as in "the one included with guile" manumanumanu: the whole thing bytevector->pointer gets annoying. manumanumanu: I'm used to how chez does it, which can do implicit string and bytevector -> pointer conversions spk121: manumanumanu: I did use the vanilla Guile FFI once, in this thing https://github.com/spk121/guile-aspell/blob/master/aspell.scm spk121: I approached it as is a two-layer problem. A binding that is close to the C API, and then scheme functions that abstract them spk121: But I haven't touched the FFI since that one attempt. civodul: heya spk121 :-) amz3: manumanumanu: I don't get it, you have to convert scheme types to types understood by guile ffi explicitly if that what you find annoying spk121: hi civodul civodul: spk121: are you coming to FOSDEM this year? spk121: civodul: It seems likely, but, I haven't bought a ticket yet. But, I don't have anything to demo or brag about. ;-) civodul: heheh, chatting and all is fine though :-) spk121_: civodul: My New Year's Resolution for 2018 is to only finish projects in my back catalog, and to not start new projects. civodul: yeah that's what we always say ;-) civodul: the number of stashes and branches in my guix checkout keeps growing spk121: civodul: haha. There are about four unfinished Guile applications, plus about four C++ and 1 in PHP, so if I finish one per month... dsmith: sneek: botsnack sneek: :) amz3: I made another video of GNU Guile Hacking @ https://www.youtube.com/watch?v=wq4HN2u6344& amz3: ... amz3: hey people, if you have reddit account, don't forget to tell the web what you are hacking on https://www.reddit.com/r/lisp/comments/7n90l4/what_do_you_plan_to_work_on_in_2018/ amz3: and make some guile publicity... manumanumanu: amz3: btw: you can just put a (setenv "LD_LIBRARY_PATH" "whatever") to make guile load libraries properly. Then you don't need to use absolute paths, and your code becomes more portable manumanumanu: I have put it in my .guile file manumanumanu: and in .guile_geiser dsmith-work: Monday Greetings, Guilers OrangeShark: monday greetings amz3: manumanumanu: I didn't knew about .guile_geiser, tx dustyweb: moin moin daviid: hey dustyweb! hi guilers... hny all! manumanumanu: amz3: btw, have you managed to get geiser to not surpress errors? manumanumanu: If I evaluate a buffer with an error twice,nothing happens the second time manumanumanu: and IIRC it is a setting manumanumanu: apart from if I press newline i go from scheme@(guile user [1]> to scheme@(guile user) [2]> manumanumanu: really frustrating manumanumanu: or anyone for that matter? catonano`: manumanumanu: you could write on the mailing list about this, so a trace remains manumanumanu: catonano`: will do amz3: manumanumanu: I have many issues with geiser, I seldom use it amz3: like recently I tried to compile a buffer with geiser running, it compiled the file but did not send the result to geiser amz3: maybe I missing a command or something amz3: eval'ing each exp works tho catonano`: I wonder how much work would it be to have Guile scheme workking with Slime catonano`: I saw a scrreenshot of MIT scheme working under Slime and it was beautiful rekado_: catonano`: what features do you want from Slime that are not offered by Geiser? catonano`: rekado_: I'm not sure. But I ofuld Geiser very difficult to use. And it seems I'm not the only one. I never tried Slime but the screenshhots were georgous catonano`: Also the Cloure Emacs layer is very cool. That one I did try ! davexunit: I've always found geiser to be really really really good catonano`: I don't know, it may be a matter of habit catonano`: but between compiling, loading, I always seem to miss something, so I can rarely have ump to definitions and autocompletiosn, whic I'd really love to have :-/ catonano`: I also have a *very* ahrd time in using qemu louishaemmerle: in guile 1.8 there was the trace procedure louishaemmerle: is there something similar in 2.2? nbjoerg: https://www.netbsd.org/~joerg/patch-libguile_loader.c nbjoerg: anyone able to apply that? nbjoerg: fixes the bootstrap on platforms where mmap permissions are enforced, since the area will be mprotected as PROT_WRITE later nbjoerg: the whole logic should likely be inverted... francorcr: help francorcr_: list francorcr_: list/ francorcr_: ?; francorcr: #help amz3: I hit a bug because of struct with unions wingo: moin wingo: 4 minutes to spare ;) amz3: hey ft: 212343211234321234321432134321234 ft: whoops amz3: this struct with union is painful and settings up gnunet from git is painful too amz3: nevertheless I will try to describe how to reproduce the issue maybe someone will have the answer on the mailling list mwette: ACTION was repairing a bookshelf today and ran across a printed copy of the Guile Reference Manual for version 1.2a. I guess it's time to throw that out. amz3: mwette! amz3: stop disconnecting I have a question for you, does FFI helpers works with multiple shared libraries? basically programs that have several shared library and share header files between them amz3: btw I tried to compile FH and it failed amz3: I know I am jumping from one project to another but I make progress nonetheless manumanumanu: Could someone check something for me? If you have libGL installed (which you probably have, check it using "ldconfig -p |grep libGL"), try running (dynamic-link "libGL") and see what happens daviid: manumanumanu: works fine here daviid: scheme@(guile-user)> (dynamic-link "libGL") daviid: $1 = # manumanumanu: WTF is wrong at my end then? mwette: works for me on Centos 7.4 manumanumanu: it searches some guix locations, but not .guix-profile/lib manumanumanu: oh. it searches the wrong dir on ubuntu... amz3: it doesn't work on my side, ubuntu too manumanumanu: amz3: guix guile? amz3: yes manumanumanu: amz3: does it work for libraries in your guix profile? manumanumanu: say, libsodium if you have it installed manumanumanu: all my libs are in /usr/lib/x86_64-linux-gnu manumanumanu: which guile (on guix) doesn't search amz3: I have the same pb with gnunet amz3: I use the full path to the shared lib, to load the correct lib amz3: scheme@(guile-user)> (dynamic-link "libsodium") amz3: ERROR: In procedure dynamic-link: amz3: I just installed it using guix package -i amz3: scheme@(guile-user)> (dynamic-link "/gnu/store/f6g3ypvsd4dmzgprqfmka9kiz5lp54nc-libsodium-1.0.16/lib/libsodium.so") amz3: $1 = # manumanumanu: amz3: you could just sed ld_library_path manumanumanu: but it is a friggin pain anyway amz3: maybe... but autotools for guile bindings do the necessary in a guile module, to load the sharelib using the full path manumanumanu: I'll just add guix-profile/lib to LD_LIBRARY_PATH and ignore any risks amz3: I just made a small autools for gnunet-guile with documentation amz3: https://gnunet.org/git/gnunet-guile2.git/ amz3: I just copy pasted stuff amz3: but it works :D amz3: except there is not html output yet amz3: a lot of people using matrix.org... amz3: all the [m] people are matrix.org people amz3: not much people use it here, but on #guix, it's a lot of them amz3: guix is mainstream anyway amz3: ;) manumanumanu: amz3: if you ever find a workaround that does not include setting $LD_LIBRARY_PATH or anything special at all to make guile behave well, please tell me manumanumanu: how does guile decide which dirs to search for libGL.so? amz3: manumanumanu: yes, the solution, is to use the full path to the .so file see above example for libsodium amz3: it's not guile that does the lookup, it's dlopen or something else manumanumanu: amz3: that stinks :( Then setting ld library path is better daviid: manumanumanu: /etc/ld.so.conf and /etc/ld.so.conf.d manumanumanu: but then why doesn't it find the standard ubuntu directories? daviid: w manumanumanu: daviid: thx! daviid: manumanumanu: it's not guix, it's all systems amz3: I used to LD_PRELOAD the so file amz3: to work around that behavior amz3: Now I live happy with hardcoded paths amz3: (set by autotools) manumanumanu: daviid: the thing is, the correct directories are in etc/ld.so.conf... guile (guix version) doesn't seem to honour them daviid: not sure guix configure guile to use the distro /etc/ld.so.conf ... yo should ask on #guix, I don't use guix :) (or shoud I say :( daviid: I mean not sure guix uses /etc/ld.so.conf, (it does not depends on guile for this) daviid: guile will see what the system shows ... manumanumanu: which makes this a weird bug, because ldconfig shows all the libraries I want it to (except the ones I installed in guix), but guile cannot load any shared library manumanumanu: not even sure it is a bug. I probably effed up my install, or ubuntu doesn't play well with guix davexunit: do any of the "instruction explosion" things apply to the 2.2 series? davexunit: I've got some hella bad bytecode and I'm not sure what percentage is my fault davexunit: why on earth would I see an f64->scm instruction followed by an scm->f64 instruction using the same register when that register was not used for an instructions in-between? davexunit: any instructions* davexunit: this is happening all over the place. 1) read unboxed float from bytevector 2) box float 3) unbox float 4) do unboxed op like bv-f32-set! amz3: I have the following C definition https://dpaste.de/4wxP amz3: I am trying to create bindings for that function amz3: when i declare that absolute-time-get return an uint64 everything seems fine amz3: but when I declare that it returns a raw pointer, and pass the pointer to (pointer->bytevector pointer 8) it fails with a segfault amz3: any ideas? amz3: maybe the 'struct { abs_value_us uint64 }' is optimized into the eqv of 'typedef uint64' amz3: or something amz3: https://stackoverflow.com/questions/19887384/do-c-compilers-optimize-structs-with-a-single-member amz3: seems like single int member struct is the same as int amz3: in most cases... amz3: oh it's possible to use a custom event loop in gnunet client programs amz3: at last I wrapped my head around how gnunet works and started an alternative set of bindings amz3: this was not my week end plan... but anyway... it's more useful :) amz3: I think the new code is less confusing manumanumanu: Where does guile look for libraries when I do dynamic-link? manumanumanu: I am trying to link to libsodium which is installed using both apt (an older version) and guix manumanumanu: and for some wonky reason it doesn't work manumanumanu: It might also be my system which is old and tired manumanumanu: but ldconfig shows it (the apt version) rlb: manumanumanu: not sure about current guile, but I think I used to set the LD_LIBRARY_PATH to pick up various libs. rlb: manumanumanu: might also try strace to see where it's looking. manumanumanu: rlb: but it should be properly in my load path :( rlb: Well, strace will tell you where it's actually looking, and what it's looking for (i.e. what specific filenames), and you could also try what looks like a redundant LD_LIBRARY_PATH setting to see if it has an effect, then try to figure out why if it does. rlb: ...perhaps something like "strace -f ... 2>&1 | grep foo" if the lib has foo in the name. Can also be more discriminating via -e open, -e stat, etc. rlb: (or just save the output to a file via -o trace.log and use less, emacs, whatever to poke around) manumanumanu: rlb: thanks. It is very weird. It is looking in my some guix directories, but not in my profile lib dir. Ḯ'll ask in #guix mwette: manumanumanu: I believe DYLD_LIBRARY_PATH and (assq-ref %guile-build-info 'extensiondir) and (assq-ref %guile-build-info 'libdir) will work louishaemmerle: suppose I were to implement a guile-based extension language louishaemmerle: is there a repo layout I can copy for that? louishaemmerle: I know there are example implementations in the guile repo, but they are not separate repos, so I wonder if you could point me to a properly structured extension module louishaemmerle: I guess I am rolling with the fibers repository as a template amz3: what do you mean by guile-based extension language? catonano: amz3: my wild guess: you can implement different langages on top pf te guile runtime, not only scheme. And you can integrate the guuuile runtime with C based applications catonano: so, you can have a langage, based on guile, extending your application catonano: thaht's how I understand it amz3: they left anyway catonano: please forgime my typos. My keyboard is dead :-/ amz3: no worries wingo: just landed the first instruction explosion patches, woo wingo: still a lot more to do tho dsmith-work: Happy Friday, Guilers!! dsmith-work: However, have some networking issues at home. dsmith-work: Sneek is offline until I get a new switch. mwette: Howdy all. I have been working another personal project. Today I'm back on my FFI Helper working to clean up documentation and make a release soon. janneke: welcome back mwette mwette: janneke: :) amz3: héllo mwette amz3: et al. amz3: :) amz3: wow https://github.com/aconchillo/guile-oauth amz3: it's 3 years old, I forgot about it davexunit: has anyone used the new unboxed struct fields in 2.2.3? davexunit: it seems that you can only put integers in them, which is odd. davexunit: was hoping I could stuff in floats rlb: amz3: if nothing else, you might need to create C wrapper functions. rlb: Don't know if swig and/or g-wrap are still a thing -- been a long time since I was inclined to automate that sort of thing. daviid: amz3: yes, one write a C wrapper, then use the dynamic ffi ... see vigra_c (used by guilecv) as a good and relatively simple example on how they do this daviid: amz3: https://github.com/bseppke/vigra_c the README even explain how (and a bit of why) to do it ... daviid: rlb: g-wrap works fine with all version ofguile, including 2.2.3, and is used by guile-gnome, guile-clutter, both working fine with the latest guile as welll. but we do not recommend new bindings to use it, but rather to use the dynamic ffi instead ... rlb: I've always been wary of dynamic ffis -- though haven't looked at guile's. i.e. how does it know how big a foo_t is? daviid: rlb: you write a C function that return that info, and binds it using the ffi rlb: Ahh, ok, the api has to be designed for that. Fair enough. rlb: But a lot of them aren't. daviid: if not, you just add these bits... here is a simple example daviid: https://git.savannah.gnu.org/cgit/guile-cv.git/tree/libguile-cv/libguile-cv.c line 38 rlb: sure - just can't be used for wrapping an api without (some) compilation. daviid: I actually need to add one, because size_t itself my return 32 or 64 (4 or 8) ... rlb: yep, I've noticed ffis have started to add more of the types you might want like size_t, ssize_t, etc., which is handy, and was always a pain in the past. daviid: rlb: true, but fair enough - and by all means, a couple of order of mag simple and cleaner then g-wrap (not a critique, but g-wrap is obscur and quite 'heavy'), the dynamic ffi is the way to go now ... rlb: bbl daviid: and g-wrap generate C code anyway, so you won't escape compiinge ... 'obscur' and difficult to maintain code: just the gtk binding generate 30 to 40 thousands lines of C code, and then you need a lot of work still, scheme and C for all the exceptions g-wrap could not handle ... in the lng run, 10x more work (at least) totally lost time imo ... daviid: it is so difficult that, as an example, beside myself and wingo, nobody knows how to maintain guile-gnome amz3: I need to rewrite part of culturia again, because my model is wrong, using column storage to have autoincrementing primary keys is not a good idea amz3: also, I need to figure whether using directly a graph database makes sens janneke: TIL: (with-input-from-string "" (lambda () (char? (read-char)))) => #f janneke: mes said: #t, that makes nyacc 0.80.40 fail on parsing tcc, in tricksy ways manumanumanu: janneke: what? Why is that? janneke: eof-object is not a character, apparently manumanumanu: ah, of course manumanumanu: i didn't look at the string :D manumanumanu: amz3: well... it is not unlike how you would do it in C. rlb: (nb. we may need to figure out the guile-2.2 arch build issues in the next couple of weeks to avoid removal from debian testing.) amz3: héllo all wingo: happy new year's, guilefolk :) amz3: happy new year amz3: manumanumanu: how do you bind C++ code in Guile? kristofer: hello! kristofer: I'm on page 60 of the little schemer. my definition of o+ is causing a stack overflow kristofer: I thought adjusting (add1 (o+ n (sub1 m))) to (o+ (add1 n) (sub1 m)) in the recursive line might not blow the stack. no luck though. kristofer: http://paste.freshbakedyams.com/paste/HO0F0J1M kristofer: (o+ n m) where m is 1 or 0 will work. m > 1 will not work though kristofer: same is true for (oplus n m) ijp: the *definition* is causing an overflow. that's kind of weird ijp: ACTION looks ijp: or did you mean that it overflows when you call it ijp: ah, your sub1 is wrong ijp: (- 1 x) = 1 - x, which is an involution, so it's just going to bounce back and forth between x and 1-x ijp: (hence why it will terminate for 1 or 0) ijp: it's easily done kristofer: aha kristofer: I knew it had to be user error. 'twas a late night ha amz3: ACTION happy joshuaBPMan: ijp: thanks for the tip. chris__: nick chris-gnc chris__: mainly for wingo et al - probably of minor concern to guile developers, but the Gnucash project has finally upgraded from guile 1.8 to minimum 2.0! manumanumanu: sweet. manumanumanu: no more macro expansion at runtime :D amz3: #win amz3: it's a pleasure to see more adoption of our favorite language :) manumanumanu: amz3: gnucash has always used guile. manumanumanu: amz3: I am writing an editor where everything is in guile except for the editor parts. It is based on arximboldis ewig, and let's you hook into every event from guile manumanumanu: as of right now it is nearing a compilable state :) jeko: hi! ijp: chris__: that's quite something ijp: Do you know if they have a blog post or long mailing list post discussing their transition (difficulties etc)? joshuaBPMan: morning guilers dsmith-work: Tuesday Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) chris__: ijp: https://code.gnucash.org/logs/2017/12/19.html chris__: ijp: or whereabouts janneke: ERC> /join #bootstrappable amz3: how can I avoid guile to truncate output of stacktrace? I found nothing in the manual amz3: backtrace I mean reepca: see 6.26.3.5 debug options reepca: specifically (debug-set! width some-big-number) amz3: tx amz3: happy new year from utc+2 sLN696: 13,04▄10,09▄05,13▄08,09▄13,12▄07,11▄08,02▄02,13▄13,03▄12,11▄11,02▄04,08▄08,09▄08 A DISCUSSION IS GOING ON ABOUT TO TO RE-ENSLAVE NIGGERS IN #/JOIN IF THIS GETS YOUR DICK HARD JOIN IN (MESSAGE VAP0R FOR HELP) qgdtemk: thomassgn jpf SHODAN 08,13▄08,05▄06,09▄04,13▄06,03▄07,09▄11,02▄09,02▄11,12▄03,10▄03,06▄06,06▄ ijp: new year, same old shit :/ Gattix_120: 09,05▄05,04▄04,03▄12,13▄04,03▄08,10▄09,05▄04,06▄13,02▄02,13▄10,09▄13,04▄08,10▄03,06▄11,07▄10,08▄04,03▄10,03▄04,11▄10 we have got more than 200% of the monthly donations today, thank you all so much!(weechat devs)mtcaspch: reepca babyflakes ragge_ 04,07▄08,11▄12,09▄08,03▄02,07▄05,08▄09,09▄12,08▄10,11▄11,04▄07,04▄03,13▄ manumanumanu: Mornign YottaByte: hi all, I heard about some guile javascript backend? anyone know about this? you write guile and it outputs js? like clojurescript or something? mwette: YottaByte: I think this is it: https://gitlab.com/ijp/guile YottaByte: hmm mwette: look at the compile-to-js-2017 branch, in module/language/js-il mistnim: how do I run a system command so that later I am able to kill it gently? rlb: mistnim: depends - if you ran it via open-pipe or similar, close-pipe may do it if the process responds to the close as you'd like. Otherwise, you can always do a primitive-fork, etc., but that requires notably more care. mistnim: rlb: I tried with an input pipe, but close-pipe just hangs rlb: Is the subprocess reading, writing, or neither? mistnim: rlb: it doesn't write anything, it can optionally read from stdin but I don't use it that way mistnim: maybe I can run the command in a thread and then use cancel-thread? rlb: OK, well if closing its stdin doesn't cause it to quit, and if there's not some other function/lib/srfi available (haven't been watching scheme closely for a while), then you could try to use primitive-fork: https://www.gnu.org/software/guile/manual/html_node/Processes.html rlb: To do what you want (assuming I understand), you need the subprocess pid so you can kill it. rlb: i.e. sigint or similar (assuming that's "gentle" enough). mistnim: rlb: so I would use primite-fork to get the pid? Isn't there another way? rlb: Hmm -- guess you could also use a hack, i.e. write a helper script that launches the subprocess and kills everything when stdin closes. Then run that via open-input-pipe... mistnim: rlb: I see rlb: Seems like guile (and/or the srfis) should add something "better"... rlb: Did you say you were using open-input-port, or open-output-port? May not matter if the program just ignores stdin the way you're invoking it. In any case, given that both already involve the shell, you might not need a helper, i.e. something like (open-output-pipe "cat | your-command") or whatever. rlb: Or whatever -- something that'll cause the pipeline to die when stdin closes. mistnim: rlb, I tried both now, it hangs in both cases mistnim: even with open-output-pipe "cat | my-command" rlb: how about something like this (untested -- you may need to adjust it to do what I meant): rlb: "my-command & pid=$!; trap \\"kill $pid\\" EXIT; cat" rlb: ACTION thinks there's almost certainly a more succinct way to do that... rlb: And if it does appear to work, I'd double check via ps aux or similar that it really did kill your process. mistnim: rlb: that worked! :D rlb: great joshuaBPMan: hello guilers, is anyone here a functional programmer? joshuaBPMan: or like the idea behind functional programming? mwette: joshuaBPMan: yes, but I'm not very hard core amz3: joshuaBPMan: sort of joshuaBPMan: mwette: recursion is super tough. hahah. I'm trying to solve dailyprogrammer #341 ijp: it's weird at first, but it quickly becomes natural ijp: it doesn't help that all the examples of recursion people see are terrible (factorial & fib) ijp: first examples* joshuaBPMan: ijp: My problem right now, is I'm trying to recursively build a list... joshuaBPMan: but sometimes each call of the function doesn't give a useful value... joshuaBPMan: ie: recursing 1-100 is pretty easy. joshuaBPMan: each time you call the function you producet a new value. joshuaBPMan: produce* ijp: I have no idea what you are trying to do joshuaBPMan: ijp: I'm trying to solve #341 in dailyprogrammer on reddit. joshuaBPMan: I'm so used to doing things using loops, but I guess functional programs don't do that. ijp: which one, I'm seeing gradations joshuaBPMan: https://www.reddit.com/r/dailyprogrammer/comments/7eh6k8/20171121_challenge_341_easy_repeating_numbers/ ijp: but you can always write a loop as a recursion (and vice versa) ijp: the latter is probably less widely recognised for some reason joshuaBPMan: ijp: yeah. It's just I'm used to programming via loops. I just need to wrap my head around it. joshuaBPMan: I'm under the impression that recursion is usually the better way to program. joshuaBPMan: it makes for short code...usually. ijp: it depends joshuaBPMan: Fun fact of the day, there are actually some types of number sequences that can only be defined recursively. ijp: for lists, it sort of depends on the direction you are accumulating joshuaBPMan: hmmm ijp: left to right = iteration, right to left = recursion (very roughly) joshuaBPMan: (let ((x (+ 1 2))) x) joshuaBPMan: (let ((x (+ 1 2))) (display x) (display "\\n")) joshuaBPMan: (+ 1 2) joshuaBPMan: sorry I thought I was in the guile repl.... my bad ijp: there are really two problems in this challenge. 1. split the input up into all contiguous segments and 2. check for duplicates ijp: well, more accurately for 2. grouping the equal segments together spk121: daviid: you still around amz3: nckx: where? spk121: daviid: to quell BDW-GC large alloc warnings via environment variables, you can set GC_LARGE_ALLOC_WARN_INTERVAL to something much larger than its default of 5 amz3: nckx: yep daviid: spk121: will try (now)? do you happen to know why what yo suggested by email did not work? spk121: daviid: I don't really know. I just did a quick read of the GC headers. I didn't actually test it. spk121: daviid: Now that Fedora is mostly up to date and now that I don't hack on Guile itself any more, I haven't built it in a long time. daviid: I did not find that env var you just listed in their manual either spk121: daviid: I found it in the GC code in misc.c daviid: ah, didn't look at their code, just the README adn the manual couldn't find anything, except what made me try to patch... daviid: GC_LARGE_ALLOC_WARN_INTERVAL does the trick, finally (lost quite a few hours in few dayson this :(, but thanks a lot! spk121: glad to help daviid: it was very kind of you to look into this daviid: perfect, now I can patch my manual, and with both the raised exception and repl patch, guile-cv is now usable for regurlar users amz3: someone knows the name of the srfi for parsing command line arguments please? daviid: it is a bit annoying that they have to patch guile themselves though, I hope amz3 I use (ice-9 getopt-long) amz3: I had a look at it, it looks nice, but i want to compare with th srfi amz3: https://srfi.schemers.org/srfi-37/srfi-37.html daviid: i mixed answers above :), I mean to say: ... I hope guile will be patched (the repl and the raised exception system would use truncated-print), so users won't have to do it themselves spk121: Sure. Seems like a logical fix to the REPL to me. I still have commit privilege, but, it probably would be rude to jump in hack stuff after years of being idle. spk121: Anyway, good luck. daviid: spk121: yes, let's wait for an 'active' maintainer to do it, I send to patches, and the repl patch only does not solve the problem (for guile-cv users I mean), because sonner or later, error ... which blows the repl and kills emacsit only takes minutes for som daviid: *two patches daviid: spk121: what are you working on these days? spk121: daviid: I've declared 2018 to be the year I just finish things, and not start new things. Right now I'm revisiting a alternate method for blog comments for a static blog site, where you just telnet or ssh to a tiny BBS that has just enough smarts to let you edit a message. daviid: spk121: cool mistnim: how do I match a bracket with a regex? mistnim: \\[ gives an error mistnim: got it amz3: welcome to the very last day of 2017 amz3: friendly reminder to update your copyright line on your next commit ijp: I wonder if someone has written a commit hook to remind you of this amz3: in javascript, the answer is yes :) mistnim: how do you avoid lost updates with the atomic box? amz3: mistnim: sorry, I am not even sure what you are talking aobut mistnim: amz3: if you want to update the box, you read the value and then swap it with a new one. During that period another thread might swap too. And that update will be lost. ijp: mistnim: you should probably be looking at atomic-box-swap! and atomic-box-compare-and-swap! mistnim: ijp: thanks amz3: ACTION trying to understand Cheney MTA... again... amz3: my question was closed on SO again ijp: what do you want to know? ijp: there are a few bits to it ijp: are you familiar with the trampolining strategy for implementing proper tail recursion? amz3: yes amz3: there is while loop, functions returns a pointer to the continuation and the while loop exec that. this way the callstack is always one ijp: one rough analogy it uses is that instead of doing lots of little jumps, you should instead do less much bigger jumps ijp: your scheme data structures & stack frames are allocated on the C stack ijp: scheme calls are C function calls amz3: ok ijp: this will lead to a stack overflow eventually, at which point you "bounce" to the top of the stack and garbage collect the unused data ijp: very roughly speaking amz3: I understand amz3: ijp: can you compile a factorial.scm program using guile js backend and paste it somewhere please? amz3: I started compiling guile with js backend but it will take time... amz3: nvm i found something amz3: actually if you have (factorial 1000000) compiled to js I would like a copy of it ijp: amz3: http://shift-reset.com/tmp/fact-amz3.js ijp: hmm, that 1e6 isn't wrong, but you can blame uglify-js for that amz3: tx a lot mistnim: what would you use for config of an app? Is it ok my idea to use a sexp in file and (read) it? mistnim: which is the format used by artanis for example? ijp: 1. although it would be usually not recommended, you could consider an executable configuration file ijp: 2. otherwise I'd just use a sexp, or a sequence of sexps to avoid wrapping it in the outer layer of parens mistnim: ijp: how can I read a sequence of sexp without getting only the first? ijp: just read in a loop mistnim: thanks daviid: actually, wrt GC Warning I was refering to, repeated allocation of large memory blocks, the situation is a lot worst then I thought: GC_malloc_ignore_off_page(bytes) is not a flag, it is a procedure, to be used instead of GC_malloc(nbytes) (and friends) ... - "Identical to GC_malloc, but ... This is the recommended way to allocate anything that is likely to be larger than 100 Kbytes or so. (GC_malloc may result in failure to reclaim daviid: such objects.)" daviid: which means guile core needs to be patched, unless, maybe, we already have a flag to compile guile asking it uses GC_malloc_ignore_off_page(bytes), when bytes>100Kb ? daviid: lloda: I guess you also have these GC warnings, don't you? daviid: rlb: i did run the full test you were suggesting, buster amd64, using the script you pasted above, and it is all fine here too daviid: here is a question for C, Guile internal and BDW-GC experts: https://paste.debian.net/1002893/ ijp: 0.5/3 isn't bad, I suppose daviid: actually, I'd say 0/20, it did not solve the problem :( C Warning: Repeated allocation of very large block (appr. size 775237632): May lead to memory leak and poor performance. ijp: daviid: I was scoring myself out of your 3 criteria daviid: ijp: ah! just scoring myself out of 20 points daviid: ijp: i tried this naive patch because greping 'GC_malloc' actully only returned one file, one lcation, but that inline function (patched as in my paste above) has multiple return, so I guess in my case (using guile-cv, manipulating big (to huge) images, it allocates big (huge) huge blocks of memory 'all the time') the allocation occurs 'else where' ... oh well, at least I do not fear to appear as an idiot :) daviid: i'll send a mail to guile-devel daviid: sent rlb: i386 fails in a different way: https://buildd.debian.org/status/fetch.php?pkg=guile-2.2&arch=i386&ver=2.2.3%2B1-1&stamp=1514584230&raw=0 rlb: alpha the same. rlb: sorry, alpha and hppa are the same test-out-of-memory failure daviid: hum, lost: (srfi srfi-4) calls make-srfi-4-vector ... which is undefined in that module, it is defined in (srfi srfi-4 gnu gnu), which srfi srfi-4 does not import (it imports (rnrs bytevectors, which does not import gnu either (and neither re-export...))) ijp: davidl: is it imported through C ijp: daviid* ijp: libguile/srfi-4.c:SCM_DEFINE (scm_make_srfi_4_vector, "make-srfi-4-vector" daviid: ijp: thanks ijp: that gets defined through a function that is initted at startup daviid: ijp: I'm trying to see if the patch I wrote effectively calls GC_malloc_ignore_off_page daviid: I mean if (make-f32vector a_large_value) get to call GC_malloc_ignore_off_page daviid: probably not: srfi-4.c calls scm_i_make_typed_bytevector, which calls make_bytevector, which calls scm_gc_malloc_pointerless, which is defined as daviid: #define SCM_GC_MALLOC_POINTERLESS(size) GC_MALLOC_ATOMIC (size) daviid: which I beleive calls the BDW-GC GC_malloc_atomic(nbytes) amz3: hello amz3: no guilers at guilecon in bruxelle in feb? amz3: sneek: later tell catonao here is talk you might be interested https://fosdem.org/2018/schedule/event/code_graph_based_analysis_of_javascript_repositories/ sneek: Got it. nckx: amz3: typo? rlb: daviid: yep, so this crashes 2.2.3 (wondering if it does for anyone else): rlb: (CFLAGS='-fstack-protector-strong' ./configure) && make -j 3 && make check rlb: crashes the out-of-memory test daviid: rlb: great you find out. why did you have this flag in the first place? rlb: Have to go see what that option does, i.e. I wonder if that's expected given whatever the test is trying to do, and if so, is it better to drop the option, or disable the test... rlb: It's one of the default debian flags. rlb: We can override, but if we do nothing, we get it. daviid: rlb: hum, how is it that it did not crash earlier version of guile? just curious rlb: (see the earlier paste: https://paste.debian.net/1002741/ ) rlb: Not sure - could be that it's new, though I don't think it is. More likely it's related to gcc-7 in sid (vs 6 before), and that flag or something. daviid: i bet it's new, there is no way it would not crash 2.2.2 and all erlier version ... but anyway, really not my domain rlb: well I don't know how many people are testing with whatever's in sid yet, but yeah, not sure either. rlb: I know I haven't been building 2.2 with that flag much yet (for debian itself). daviid: what is important, imo, is to have to proper optimization flag, or set of flags, whch I can't even tell you what is best daviid: line 2 of your paste, you have ... -O2 and at the end -O0 that does not sounds good to me rlb: That's just how the override works, i.e. in debian/rules we have: rlb: export DEB_CFLAGS_MAINT_APPEND += -O0 rlb: rlb: which is conditioned on amd64, and is how you tell dpkg-buildflags to make an adjustment. It chooses to do so with the append. rlb: posted an update to the bug. rlb: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=+29464 daviid: i was looking for some info about optimization gcc best flag setting, but I can't find anything (in the manual) rlb: I see it in my info pages -- maybe the ones you're looking at are older? daviid: in my (manually built from source) guile-2.2.pc: Cflags: -I${pkgincludedir}/2.2 -pthread rlb: It's a gcc flag. daviid: ok, i was thinking there made an entry in our manual... daviid: *there was an entry daviid: 1.6 Obtaining and Installing Guile but nothing there daviid: I should recompile using -O2 maybe, what is the best setting? daviid: that might influence how guile-cv performs here (by far the most 'expensive' s/w I ever used with guile) daviid: maybe -)3 is even better daviid: -O3 I mean wwoood: Hi there. I have what I hope is a simple guile question. I'm looking to run a subcommand (e.g. with system*), but want to pass a string as STDIN. Thanks in advance.. daviid: how can I prevent, if possible, GC Warning messages like "GC Warning: Repeated allocation of very large block (appr. size 775237632): May lead to memory leak and poor performance."? guile-cv processing large images will print tens of these, which is annoying (and actually useless anyway, I need to allocate and either it works to the end, or it fails with an 'out of memory', so I'd rather suppress the warnings) rlb: wwoood: I suspect you may want open-pipe, not system*: https://www.gnu.org/software/guile/manual/html_node/Pipes.html rlb: ...and then you'll need to dump the string into the subproc's input pipe, and take the deadlock concerns seriously, i.e. if you're not certain you're not going to fall afoul of PIPE_BUF, you'll need to feed the data in (or get it out) via thread or something. Same thing comes up everywhere (perl, python, etc.). wwoood: rlb: Sounds perfect, thanks. In my case the input string is quite small <(<255 chars) so the buffer shouldn't fill. Obviously I just wasn't using the right search terms, but would it make sense to add a cross-reference from system to open-pipe in the docs? rlb: Might well - perhaps suggest it on guile-devel@gnu.org. I'm not actually involved in development at the moment. wwoood: alrighty, thanks again. rlb: ...debs built fine with -fno-stack-protector. I think I'll go with that for now, and we can revisit the question. rlb: nb. guile 2.2.3+1-1 has been accepted into debian unstable (now to see how the buidds fare). rlb: (I'm hoping to remove 2.0 from buster.) rlb: Assuming that's reasonable. cmaloney: rlb: Did you do the PPA for Ubuntu? rlb: No, I only do the debian work, though I think the author of that has been in contact (Dan?), and I'm planning to take a look at the differences later. cmaloney: Ok, cool cmaloney: I sent Dan a note via Launchpad to see if they might be able to do an Ubuntu 14.04 build. cmaloney: or send info on how to do it so I can contribute rlb: While I haven't messed with ubuntu too much, I'd guess that the debs might work there too, assuming there's not too much skew (don't know how 14.04 matches up to debian releases offhand). rlb: oh, wait, that's older? cmaloney: yeah, it's older than 16.04 cmaloney: but it's still a LTS release rlb: Don't know that it would reach far enough back to help, but regardless, at the moment I don't have plans to make a 2.2 stretch backport. (Though it might not be too difficult.) rlb: ...looks like pp64el at least is still crashing in test-out-of-memory: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid rlb: Do the people on guile-devel generally watch the bugtracker too? i.e. the bug that's been filed sufficient, or should I also post a summary/notice to the list? ijp: tracker *should* be sufficient rlb: ACTION notes that ppc64el seemed to build fairly "fast", though it was still an hour or so (takes *much* longer here). rlb: (full bootstrap build) daviid: rlb: don't know the details, but I know the compiler speed has been improved a lot in 2.2.3, it shows here too of course (amd64) rlb: Heh, well the same bootstrap on my local machine takes ~377m. rlb: But my local machine only has 2 real cores, and the porterbox I'm logged in to (may not be quite the same as that buildd) has 16... rlb: (And I think it's really just a handful of bootstrap files that take forever.) daviid: on a Intel Core i7-7700 @ 3.60GHz and 32GB of ram, it takes less then half an hour (rough evaluation, I did mot 'measure' seriously) daviid: using make -j 8 rlb: From a checkout of v2.2.3, or from the release archive? daviid: this is not my personnal machine :), though I have no more contract at the moment, I stll have access to the lab I was working for ... and they use guile so I provide basic sysadmin and guile maintainance ... daviid: full boostrap from the git repo rlb: Nice - and yeah, an upgrade of my main machine wouldn't be unreasonable -- might not be too far off. daviid: by the way I tried -O3, but I don't think I did it the right way, didn't see any diff, which sounds suspicious: how do we pass this flag so gcc uses it, while running the configure make danse? and would that flag also be listed in the guile-2.2.pc? rlb: Hmm, wouldn't be surprised if you didn't see much difference with -O3, but I believe to build with that you just need "CFLAGS=-O3 ./configure ..." and then build normally. daviid: rlb: tx, I did export CFLAGS="-O3" ... i see CFLAGS_ENV in the config.log, so i guess gcc combines its own flags with 'mine' and it does not make almost any diff (visible anyway) mwette: I did `CFLAGS=-O3 ./configure --prefix=/opt/local' and the Makefiles seem to indicate use of -O3 rlb: Yeah, that's what I'd expect -- possibly little difference. rlb: (And what's "better" isn't always clear (generally speaking), i.e. there are cases where optimizing for size (-Os) might produce greater improvements than say -O2, depending on the hardware, cache sizes, weather, etc.) daviid: yes, and the age of the captain :) daviid: yesterday I did ask if it was possible to suppress GC Warning, any one knows? rlb: ACTION doesn't daviid: while using guile daviid: it scares the only guile-cv user I have :) daviid: maybe a BDW_GC_* var or something daviid: rlb: by the way, here, buster, amd64, I use gcc (Debian 7.2.0-16) 7.2.0, and the default gcc flags are: GCC_CFLAGS=' -Wall -Wmissing-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wswitch-enum -f no-strict-aliasing -fwrapv' daviid: no -fstack-protector-strong rlb: I wonder if buster vs unstable matters... rlb: Or the other dpkg-buildflags... rlb: Here's how the build flags can be tested: rlb: #!/bin/bash rlb: set -ex rlb: eval $(dpkg-buildflags --export=sh) rlb: ./configure rlb: make -j 3 rlb: make check rlb: rlb: (if dpkg-dev is installed) daviid: rlb: https://paste.debian.net/1002866/ daviid: debian has other flags then the default gcc (that is what I ment to say earlier) daviid: is there a bdw-gc freenode irc? daviid: I'm a pathetic web user, but so far I can't find not even the (complete) list of BDW_GC variables, a few in their slides, none in the manual, none in the FAQ, any hint? daviid: not that it matters much, but for info (maintainers) guile is not listed as a bdwgc user rlb: no idea, but I'll also often just clone the git repo if there is one (or make my own), and start looking around via "git grep", etc. daviid: rlb: haha, been there, I'll do that indeed daviid: couldn't find any irc either daviid: github, clicking 'dismiss' using tor, open the sign-up window, how is that? :) daviid: GC_malloc_ignore_off_page if you get collector warnings from allocations of very large objects daviid: but, it is a compiler flag mwette: > w1gz: #erlang w1gz: oups rlb: Is this a known issue? (Trying to fix 2.2 on Debian, and currently 2.2.3 on amd64): rlb: GC Warning: Failed to expand heap by 65536 bytes rlb: GC Warning: Out of Memory! Heap size: 1 MiB. Returning NULL! rlb: Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler. rlb: FAIL: test-out-of-memory rlb: rlb: (In current debian unstable.) daviid: rlb: on amd64? here, debian buster, amd64 as well, manually installed 2.2.3 compiled fine, make check as well... rlb: daviid: thanks -- this is within an sbuild chroot, so sometimes that has relevant differences, and there may be some cflags differences, etc. rlb: Suppose it could also be buster vs sid. In any case I'll try a "normal" build and make check from a checkout of the v2.2.3 tag in both the chroot, and outside. rlb: (if it matters, we build from the source tag, not the tar archive) rlb: ...and 2.2.2's not happy on all the architectures either. I was hoping 2.2.3 might fare better: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=sid daviid: rlb: I can't really help, just wanted to let you know that here (I compile from the source as well), it's all fine, debian buster and amd64 ... so, indeed something is getting in theway, either because of chroot and/or sid amz3: o/ manumanumanu: Morning amz3: let's code in guile again :) amz3: I plan to rework my blog application to not rely on biwascheme hence not rely on javascript amz3: too bad kristofer is away, I think I havea fix for his pastebin app amz3: wat! the performance of the pastebin are very poor :( amz3: even with fibers and my fix amz3: 10 RPS amz3: I feel guilty amz3: let's try some other webapp amz3: with two fixes I went from 10 RPS to 210 RPS #win amz3: which is according to boom program "pretty good" amz3: the issue is that the highlighter is slow amz3: or used at the wrong place depending on how you think about it amz3: fwiw firefox.fr does 390RPS amz3: it's an empty just nginx default page over the internet rlb: Looks like page needs updating for 2.2.*: https://www.gnu.org/software/guile/download/ amz3: there is a git for the website, I am just too lazy to look it up rlb: OK, I can reproduce the debian test crash using the 2.2.3 release archive and building via normal "configure && make && make check". I don't know whether or not gcc 7 is relevant, but it does look like the current debian build flags *are*, i.e. it's fine without them: https://paste.debian.net/1002741/ rlb: (Ignore the bup dir, that's just where I ran the buildflags command for the paste.) rlb: I'll try without the -O0 override next (which we need(ed?) on amd64 -- http://bugs.debian.org/809608 ) rlb: OK, so the test oom doesn't appear to be related to -O0; next up, hardening flags... amz3: at last i wrote some guiel :) amz3: wingo: tx for the reply on the mailing list amz3: wingo: so now, my understanding is that fluids follow fibers when they move around threads, is that correct? amz3: based on this, I made a fix in guile-pastebin and it seems to work. rlb: Looks like the test-out-of-memory oom failure may be caused by -f-stack-protector-strong mwette: > Chaos`Eternal: helo amz3: o/ wigust: amz3: \\o/ amz3: can you recommend some readings to start with guile-opengl? amz3: make distcheck works in guile wiredtiger, I now need to fix guix.scm OrangeShark: hello everyone amz3: héllo #guile norfumpit: could guile in the future replace gnome js implementation, allowing one to say write gnome shell extensions in guile through an interoperability layer? if so what would it take to get there? amz3: a lot? amz3: javascript was chosen because it's everywhere amz3: i guess amz3: not because it's good langage amz3: that said, we guile js backend it might be possible to write extension in guile but will require a bit of tooling to be workable amz3: s/we/with/ amz3: norfumpit: what JS VM does GNOME use? amz3: GNOME use Mozilla's SpiderMonkey https://wiki.gnome.org/JavaScript amz3: which means that AFAIU, it will take some time before guile js is usable in GNOME because it seems TCO is more difficult to implement in SpiderMonkey amz3: but I might be wrong daviid: hello guilers! sneek: Welcome back daviid, you have 1 message. sneek: daviid, ArneBab says: thank you! amz3: héllo daviid daviid: ArneBab: yw! a nice tip to keep in mind.. i still fail to understand why it is not the text that we surround using \\adjustbox{...} though daviid: amz3: octave has a series of tools dedicated to geographical functions, such as octave-mapping ... for info daviid: amz3: I'm pretty sure it has other GIS related packages, but didn't check :), worth a look at their site I think ... amz3: daviid: tx for the tip daviid: np! bbl ijp: merry jesusmas efraim: I suppose if I'm testing for an empty list I can't use '(if (not (null? ...' efraim: null-list? Looks good Chaos`Eternal: helo, can some one give me a macro example which is hard to define use syntax-rules but easy with syntax-case? Chaos`Eternal: helo amz3: héllo #guile AsLaNsta254: 08,13▄12,09▄06,07▄08,06▄13,13▄06,12▄03,02▄03,07▄09,04▄08,05▄05,11▄13,02▄02,06▄03,13▄13,12▄12,08▄06,09▄11,03▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! quguy: Intensity davexunit Sleep_Walker unknown_lamer cmaloney catonano holomorph cky xdje DerGuteM1ritz zacts cbaines nekomune rekado AsLaNsta254: 07,12▄08,13▄10,12▄07,07▄11,13▄11,07▄02,12▄11,03▄05,07▄12,13▄02,08▄04 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! rldgptxhq: bairui efraim wigust Intensity siel mwette evhan dograt catonano daviid dmiles akkad yosafbridge ecraven bgamari alezost zacts einarelen drmeister SHODAN artyom-poptsov babyflakes rekado unknown AsLaNsta254: 10,05▄03,09▄13,05▄08,13▄06,12▄13,09▄11,07▄09,05▄08,08▄04,03▄11,06▄10,02▄04,02▄07,11▄02,11▄10,02▄10,12▄08 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! hlyciyvu: daviid webshinra DerGuteM1ritz dmiles wigust str1ngs sneek akkad vicenteH ecraven einarelen SHODAN bairui zacts fasheng cbaines slyfox AsLaNsta254: 08,08▄08,06▄10,12▄05,03▄12,04▄12,03▄10,05▄12,04▄11,05▄13,02▄05,09▄04,09▄09,11▄13,11▄10,13▄04 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! otfqukdizk: whaleflower terpri sneek jralls neuromorphic daviid bgamari str1ngs nekomune ArneBab_ artyom-poptsov mwette ecraven cky efraim alezost nckx rekado slyfox AsLaNsta254: 06,08▄12,06▄07,09▄05,11▄05,07▄09,08▄05,12▄12,10▄12,11▄07,04▄07,13▄06,13▄09,11▄13,13▄13,04▄12,13▄09 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! dstvcyijk: jchmrt rekado str1ngs cmaloney whaleflower babyflakes rotty jao n8a neuromorphic dograt jralls efraim Intensity einarelen ft dmiles SHODAN akkad AsLaNsta254: 02,03▄08,10▄04,03▄10,13▄06,07▄13,11▄04,06▄04,09▄12,09▄02,12▄02,08▄07,12▄03,07▄06,12▄13,05▄02,07▄05,07▄07,05▄02,04▄11 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! pjhoqlw: heroux cbaines nckx siel drmeister vicenteH zv davexunit str1ngs Amynka holomorph whaleflower dograt einarelen manum AsLaNsta254: 03,02▄13,02▄02,08▄10,09▄12,03▄10,05▄04,13▄09,05▄11,08▄12,11▄10,05▄08,06▄06,12▄08,06▄03,02▄02,11▄02,13▄05,04▄02,07▄10,02▄06 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! urzlzf: alezost mwette wigust SHODAN jralls str1ngs efraim drmeister ecraven xdje davexunit slyfox vicenteH bgamari AsLaNsta254: 11,10▄02,04▄03,04▄07,11▄07,03▄04,10▄12,06▄08,04▄13,13▄10,11▄02,11▄02,12▄06,07▄06,03▄09,08▄03,13▄08,13▄02,13▄07,11▄05,06▄02 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! fusipor: terpri bgamari ArneBab_ str1ngs akkad heroux Amynka nckx siel drmeister Sleep_Walker ft mwette babyflakes AsLaNsta254: 05,13▄05,07▄13,13▄12,13▄12,09▄09,04▄10,11▄09,11▄02,04▄03,13▄04,03▄08,13▄13 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! qeygixws: ArneBab_ catonano nckx daviid neuromorphic rekado zacts dmiles terpri fasheng davexunit babyflakes akkad wigust manumanumanu drmeister unknown_lamer whaleflower evhan str1ngs cky jao ei AsLaNsta254: 04,09▄11,04▄04,13▄08,13▄07,11▄07,11▄10,08▄04,11▄03,13▄12,06▄12,07▄02,07▄03,08▄12,03▄07,03▄05,04▄12,09▄07,07▄03 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! mnakdcysn: wigust nckx einarelen drmeister mwette sneek Amynka n8a ArneBab_ davexunit unknown_lamer cmaloney evhan yosafbridge rotty ak AsLaNsta254: 03,06▄05,02▄04,02▄04,12▄08,05▄10,09▄09,07▄05,12▄03,08▄08,02▄06,02▄10,04▄04,11▄08,02▄05 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! veakdeh: alezost drmeister zv SHODAN artyom-poptsov cky yosafbridge cbaines catonano babyflakes n8a Intensity Amynka ecraven nckx bgamari bairui wigust evhan slyfox rekado ter AsLaNsta254: 04,13▄02,11▄09,04▄02,08▄04,03▄11,12▄04,02▄10,10▄02,03▄12,12▄04 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! nherpp: DerGuteM1ritz neuromorphic heroux sneek n8a Intensity bairui terpri einarelen davexunit vicenteH akkad babyflakes cky dograt whaleflower SHODAN yosafbridge str1ngs ArneBab_ Sleep_Walker unknown_lamer cbaines AsLaNsta254: 13,03▄11,07▄02,12▄10,04▄02,11▄04,07▄08,12▄07,03▄07,02▄02,08▄10,08▄07 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! rxrvld: daviid zacts neuromorphic sneek yosafbridge artyom-poptsov drmeister cmaloney nckx terpri holomorph whaleflower akkad bairui Intensity SHODAN jchmrt dmiles dograt rotty alezost nekomune jralls siel AsLaNsta254: 05,06▄06,02▄08,08▄10,07▄07,09▄02,12▄02,04▄05,10▄06,02▄03,07▄06,10▄03,04▄10,08▄09,09▄10,12▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! dddecxnp: str1ngs zacts Sleep_Walker manumanumanu drmeister dmiles holomorph vicenteH xdje jralls heroux nckx nekomune Intensity whaleflower jchmrt slyfox bgamari De AsLaNsta254: 09,08▄13,04▄04,09▄13,12▄06,02▄06,08▄12,13▄04,11▄12,11▄09,05▄05,05▄06,07▄09,11▄12,11▄12,09▄12,11▄05,07▄07,13▄05,02▄11 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! yagnezo: wigust ecraven holomorph nckx str1ngs Intensity rotty sneek babyflakes dograt cky xdje yosafbridge alezost evhan Der AsLaNsta254: 13,07▄02,11▄02,12▄07,13▄02,08▄11,07▄12,05▄05,11▄10,09▄06,11▄07,04▄02,11▄05,03▄07,06▄13,08▄11,13▄08,13▄04,09▄13,02▄03 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! oruim: jchmrt rotty drmeister neuromorphic artyom-poptsov zv cmaloney DerGuteM1ritz terpri vicenteH xdje cky wigust nekomune AsLaNsta254: 06,12▄05,13▄12,03▄06,05▄12,11▄06,05▄12,03▄03,13▄08,09▄05,11▄11,06▄05,08▄06,13▄11,07▄02,05▄07,04▄12,08▄11,08▄12 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! rczdvxde: yosafbridge zv ecraven jralls cky cbaines ArneBab_ evhan fasheng vicenteH nckx Sleep_Walker ft terpri davexunit slyfox Amynka AsLaNsta254: 11,10▄06,06▄07,06▄02,02▄09,08▄02,06▄10,11▄04,03▄05,03▄11,09▄02,10▄02,04▄03,12▄02,10▄11,06▄05,12▄04,10▄10,12▄11 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! htuxzvcm: manumanumanu dograt rekado str1ngs akkad daviid einarelen jchmrt Sleep_Walker babyflakes ft mwette DerGuteM1ritz holomorph we AsLaNsta254: 13,12▄08,08▄06,07▄05,10▄12,04▄04,08▄03,05▄06,12▄03,09▄05,06▄09,02▄11,02▄04,06▄11,13▄09,06▄10,07▄05,03▄06,13▄08,08▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! xevtwuu: babyflakes evhan heroux efraim siel zacts zv cky whaleflower alezost bairui manumanumanu mwette jao jchmrt DerGuteM1 AsLaNsta254: 13,11▄05,10▄06,12▄04,08▄03,12▄03,11▄10,13▄04,11▄03,03▄04,03▄13,07▄03,06▄12 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! rqahyw: rekado bairui SHODAN dmiles xdje nekomune jchmrt holomorph unknown_lamer wigust cmaloney jao zv str1ngs catonano einarelen webshinra jralls siel Amynka alezost Sleep_Walker n8a efraim cba AsLaNsta254: 07,05▄05,11▄03,02▄13,09▄06,03▄06,08▄02,07▄07,03▄07,02▄08,05▄09,07▄12,09▄03,13▄07 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! aebdoyjxva: terpri ArneBab_ cky davexunit n8a SHODAN str1ngs neuromorphic artyom-poptsov mwette unknown_lamer ecraven yosafbridge zv DerGuteM1ritz slyfox efraim Sleep_Walker dograt baby AsLaNsta254: 04,06▄11,05▄02,06▄07,03▄13,06▄10,12▄04,11▄09,04▄04,06▄08,12▄10,02▄03,05▄12,04▄09,08▄03,12▄02,05▄04 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! xxwvnlmt: sneek einarelen DerGuteM1ritz str1ngs daviid zv manumanumanu catonano Intensity xdje jralls alezost drmeister rekado fasheng bgamari dograt nckx AsLaNsta254: 11,08▄07,09▄12,05▄07,02▄03,10▄11,02▄09,04▄08,10▄07,11▄11,07▄11,13▄03,02▄12,07▄05,11▄09,03▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! lscmlr: rotty zacts sneek wigust manumanumanu ArneBab_ dograt whaleflower jao terpri rekado einarelen dmiles akkad cmaloney unknown_lamer cky holomorph Sleep_Walker AsLaNsta254: 03,03▄06,11▄09,03▄04,13▄06,11▄04,11▄11,02▄09,05▄13,11▄02,05▄06,03▄03,11▄02,12▄03,11▄09 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! ozbrvt: manumanumanu Amynka ft akkad mwette jralls sneek fasheng yosafbridge ecraven cky heroux daviid cbaines artyom-poptsov holomorph DerGuteM1ritz drmeister alezost bgamari AsLaNsta254: 13,10▄03,02▄02,12▄12,05▄06,04▄02,07▄03,12▄03,06▄12,07▄07,13▄12 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! weskgjrs: efraim heroux SHODAN cmaloney drmeister Intensity terpri cky siel bairui whaleflower mwette neuromorphic akkad sneek wigust daviid jchmrt ArneBab_ vicenteH rekado nckx unknown_lamer webshinra n8a einarelen AsLaNsta254: 05,12▄07,10▄08,08▄10,02▄09,13▄09,05▄03,07▄11,13▄06,02▄03,03▄10,04▄11,11▄09,02▄06,08▄04,02▄04,02▄09,07▄06,08▄02,09▄04 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! jqfwyjjbn: siel akkad zv xdje babyflakes cbaines holomorph zacts SHODAN efraim cmaloney ft whaleflower cky jao bgamari Intens AsLaNsta254: 13,02▄03,03▄07,12▄09,07▄05,11▄09,03▄03,05▄09,09▄11,05▄06,04▄07 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! efxjjuzji: bairui rekado str1ngs cky ecraven zv slyfox SHODAN mwette DerGuteM1ritz dograt whaleflower holomorph manumanumanu Intensity ArneBab_ Amynka babyflakes fasheng siel jao webshinra drmeister akkad nckx nekom AsLaNsta254: 04,10▄10,03▄04,10▄09,09▄02,09▄02,10▄11,11▄13,09▄12,02▄12,07▄07,07▄09,02▄10,09▄04,06▄09,03▄12,02▄07,13▄09,13▄05 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! pnamd: terpri n8a babyflakes catonano fasheng alezost rotty artyom-poptsov jao ArneBab_ DerGuteM1ritz einarelen bairui cbaines siel man AsLaNsta254: 13,10▄13,03▄08,04▄04,09▄09,02▄04,04▄07,09▄09,08▄05,13▄13,05▄05,09▄07,06▄08,06▄08,03▄07,02▄02,06▄12,08▄03,12▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! rsmqyf: manumanumanu ecraven evhan Intensity babyflakes rotty rekado drmeister ArneBab_ unknown_lamer bgamari webshinra sneek zv fashen AsLaNsta254: 09,08▄11,07▄07,07▄07,10▄09,08▄13,05▄13,06▄02,05▄03,05▄10,02▄06,05▄11 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! xznjuyn: akkad str1ngs siel cbaines Intensity efraim neuromorphic xdje ecraven dograt wigust drmeister jchmrt SHODAN zv heroux unknown_lamer nekomune einarelen davexunit manumanumanu Sleep_Walker bgamari y AsLaNsta254: 05,02▄10,12▄06,07▄04,02▄13,02▄04,09▄03,05▄07,04▄05,03▄08,03▄08,04▄03,07▄03,07▄03,09▄07 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! vqfynip: bairui einarelen nckx artyom-poptsov drmeister str1ngs slyfox cbaines vicenteH DerGuteM1ritz fasheng webshinra cmaloney sneek whaleflower babyflakes xdje efraim cky j AsLaNsta254: 07,07▄03,05▄13,12▄02,10▄04,11▄08,08▄13,08▄13,08▄06,07▄10,09▄06,11▄13,07▄05,06▄11,08▄09,07▄03,11▄09,13▄08,02▄03,09▄05,05▄12 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! zqpfrswzg: bairui xdje mwette rotty zacts evhan neuromorphic rekado Amynka jchmrt nekomune ft whaleflower str1ngs d AsLaNsta254: 09,04▄07,04▄05,08▄13,13▄11,06▄05,06▄08,13▄11,11▄07,03▄09,02▄08,12▄13,05▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! indacqslqr: Intensity jao daviid DerGuteM1ritz zacts SHODAN evhan zv xdje heroux cmaloney nekomune jralls ecraven yosafbridge cky siel mwette babyflakes fasheng bairui dograt Sleep_Walker catonan AsLaNsta254: 03,07▄03,09▄13,08▄13,11▄09,07▄05,03▄02,12▄05,11▄13,03▄11,05▄09,11▄10,06▄12,13▄13,02▄07,12▄05,05▄04,12▄09,07▄07,06▄02,07▄04 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! wbcfvsl: yosafbridge Amynka artyom-poptsov jchmrt wigust holomorph efraim jao babyflakes Intensity SHODAN daviid ei AsLaNsta254: 08,06▄12,06▄05,03▄10,13▄06,13▄09,03▄13,05▄08,04▄13,12▄07,03▄04,09▄02,07▄02,06▄05,11▄13,05▄13,07▄12,07▄07,07▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! qzmwx: mwette drmeister DerGuteM1ritz catonano Sleep_Walker bgamari nekomune fasheng whaleflower slyfox vicenteH webshinra dograt babyf AsLaNsta254: 13,05▄12,10▄06,06▄03,07▄06,04▄05,10▄08,12▄02,10▄10,05▄11,02▄04,02▄02,06▄02,07▄04,08▄11,13▄09,05▄13,02▄07,09▄12,03▄08 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! lsaxyfgjym: dmiles catonano jralls daviid rekado cmaloney nckx whaleflower slyfox rotty terpri davexunit bairui bgamari akkad ft: Any ops around? AsLaNsta254: 11,11▄13,03▄08,04▄11,13▄11,12▄12,13▄02,11▄13,11▄10,07▄05,03▄10,10▄11,10▄09,05▄07 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! cimydoq: cky n8a efraim cmaloney zacts davexunit drmeister SHODAN Amynka Sleep_Walker zv mwette DerGuteM1ritz jchmrt ecraven einarelen ArneBab_ webshinra whaleflower alezost Intensity a ft: I mean, /ignore is nice and all... AsLaNsta254: 06,07▄03,03▄02,03▄12,09▄12,04▄11,09▄03,13▄03,04▄09,12▄08,06▄06,08▄08,13▄07,05▄07,08▄11,08▄03 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! vsqtuo: webshinra holomorph daviid cky fasheng heroux bairui dmiles evhan slyfox Amynka whaleflower cbaines dograt alezost catonano drmeister davexunit Sleep_Walker AsLaNsta254: 03,11▄08,04▄03,03▄06,09▄05,09▄10,11▄13,07▄05,05▄02,07▄05,05▄06,02▄02,07▄08 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! fngib: catonano ft unknown_lamer bgamari zacts Amynka dmiles jralls yosafbridge holomorph drmeister DerGuteM1ritz Intensity sneek jao ecraven webshinra ArneBab_ SHODAN mwette terpri rotty heroux AsLaNsta254: 04,02▄05,08▄11,13▄02,06▄09,12▄03,02▄12,08▄04,10▄13,12▄08,04▄04,02▄12,07▄11,13▄09,07▄02,02▄02,10▄03,09▄02 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! iuwrlp: drmeister bgamari unknown_lamer efraim mwette daviid nckx webshinra zv bairui Intensity yosafbridge slyfox ArneBab_ terpri holomorph dmil AsLaNsta254: 09,12▄07,07▄09,06▄10,07▄11,10▄04,09▄11,12▄02,11▄08,13▄05,07▄10,11▄03,06▄09,07▄05 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! ilpnffth: zv nekomune siel akkad ecraven vicenteH Sleep_Walker n8a ArneBab_ neuromorphic alezost SHODAN holomorph efraim bairui jralls str1ngs ft artyom-poptsov catonano babyflakes xdje AsLaNsta254: 03,04▄12,03▄08,12▄12,07▄07,11▄08,05▄11,05▄04,04▄02,02▄12,03▄04,02▄06,12▄05,02▄06,13▄10,07▄09,03▄13 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! iraltxg: jchmrt webshinra cmaloney rotty evhan holomorph xdje siel slyfox daviid akkad rekado alezost sneek Sleep_Walker SHODAN fasheng ecraven jralls neko AsLaNsta254: 08,10▄03,06▄06,03▄04,11▄04,11▄11,12▄06,06▄10,12▄05,13▄05,08▄08,12▄07,06▄10,09▄02,04▄03,07▄08,11▄06,03▄11,10▄08,11▄10,11▄07 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! rnprhgqph: wigust alezost nekomune cbaines slyfox jralls mwette yosafbridge rekado SHODAN Sleep_Walker nckx jchmrt AsLaNsta254: 03,04▄06,05▄08,12▄05,04▄07,02▄10,08▄09,12▄13,09▄03,05▄09,06▄08,06▄03,02▄03,03▄02,12▄12,08▄06,02▄12,07▄07 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! orimybwed: ecraven zv cky davexunit dograt str1ngs DerGuteM1ritz artyom-poptsov daviid holomorph babyflakes wigust neuromorphic alezost dmiles Ar AsLaNsta254: 04,10▄05,09▄08,03▄05,02▄12,13▄12,09▄03,03▄09,04▄06,04▄06,02▄08,13▄08,06▄02,06▄02 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! yjapi: dmiles ecraven Amynka manumanumanu heroux cmaloney catonano akkad SHODAN vicenteH ft bairui mwette Sleep_Walker alezost nekomune jralls xdje unknown_lamer jchmrt davexunit sneek AsLaNsta254: 05,09▄12,03▄06,04▄08,08▄13,08▄12,04▄12,11▄11,12▄11,12▄04,09▄06,07▄02,12▄08,13▄06,09▄07,10▄10,09▄05,12▄03,13▄11,03▄06,05▄12 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! guzcjtwtm: webshinra drmeister zv cbaines daviid jchmrt whaleflower artyom-poptsov wigust efraim vicenteH str1ngs j AsLaNsta254: 08,12▄04,10▄06,08▄06,13▄07,09▄05,11▄13,13▄10,11▄11,02▄10,10▄06,05▄06,12▄10,05▄13,11▄03,13▄12,11▄09,13▄06,11▄02,06▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! jixscsjinf: sneek jralls catonano heroux holomorph fasheng rotty jao jchmrt unknown_lamer DerGuteM1ritz zacts evhan manumanum AsLaNsta254: 02,02▄09,13▄06,10▄06,05▄13,11▄04,04▄08,04▄09,12▄12,06▄05,13▄08,11▄05,07▄06,06▄07,03▄07,11▄06,06▄08 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! uspwre: vicenteH fasheng ArneBab_ ft jchmrt jralls davexunit unknown_lamer wigust Intensity SHODAN rotty sneek n8a jao webshinra efraim mwette dograt yosaf AsLaNsta254: 05,06▄05,04▄08,12▄04,09▄03,10▄04,03▄02,05▄12,13▄05,04▄08,03▄04,09▄13,03▄09,11▄07 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! nvicdlpb: wigust Intensity rekado dograt manumanumanu unknown_lamer heroux evhan SHODAN nckx xdje n8a holomorph zv jralls daviid Amynka rotty fasheng DerGuteM1ritz cbaines vicenteH Arne AsLaNsta254: 09,10▄08,03▄13,07▄08,10▄07,13▄04,08▄04,07▄04,07▄09,07▄08,08▄10,13▄05,11▄11,11▄10,12▄02,02▄03,02▄11,08▄07,07▄13 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! gfrmnfgssu: unknown_lamer babyflakes webshinra alezost bairui daviid Amynka wigust artyom-poptsov einarelen zv DerGuteM1ritz ecraven ja AsLaNsta254: 11,08▄08,06▄06,02▄09,04▄09,12▄10,02▄08,07▄08,06▄13,10▄10,06▄05,04▄05,10▄12,11▄09,10▄11 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! vxyzvun: davexunit daviid SHODAN artyom-poptsov cbaines zacts mwette slyfox ecraven dmiles alezost efraim siel wigust whaleflower fasheng babyflakes bairui sneek yosafbridge e AsLaNsta254: 06,10▄12,09▄04,13▄09,06▄08,04▄10,11▄06,13▄04,13▄02,09▄11,06▄02,12▄06 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! otrpdk: nckx holomorph ecraven whaleflower yosafbridge rekado catonano jchmrt zacts efraim manumanumanu fasheng jralls webshinra unknown_lamer SHODAN einarelen zv alezost drmeister bairui n8a cbaines herou AsLaNsta254: 08,11▄04,02▄04,04▄11,04▄06,02▄07,04▄10,11▄08,02▄09,11▄09,04▄03,12▄07,13▄04,11▄02,04▄13,13▄10,05▄06,02▄13,13▄03 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! jmrbqbgp: drmeister davexunit neuromorphic bgamari siel whaleflower Amynka zv bairui Sleep_Walker nekomune jralls manumanumanu vicenteH AsLaNsta254: 03,03▄12,09▄03,09▄10,07▄05,11▄06,03▄05,11▄06,07▄06,12▄06,07▄07,05▄12,06▄10,04▄03,12▄05,10▄12,12▄11 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! badbapgoub: fasheng wigust nekomune artyom-poptsov catonano yosafbridge SHODAN davexunit jralls webshinra babyflakes Amynka siel Sleep_Walker akkad einarel AsLaNsta254: 13,06▄04,05▄08,05▄04,10▄10,04▄13,04▄04,05▄07,11▄13,13▄04,08▄09,11▄02 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! itkws: ft Intensity daviid efraim manumanumanu zv artyom-poptsov webshinra ArneBab_ cky ecraven jchmrt jralls DerGuteM1ritz sneek unknown_lamer bgamari n8a mwette bairui evhan nekomune einarelen akkad Slee AsLaNsta254: 11,11▄02,04▄07,08▄08,12▄02,04▄10,03▄02,02▄08,07▄04,11▄07,03▄13,06▄08,13▄12,05▄06,09▄04,02▄02,10▄04,08▄09,09▄13 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! yeqlfrfid: ArneBab_ ft daviid alezost evhan Intensity bairui cbaines cmaloney zv n8a wigust rotty jchmrt efraim davexunit heroux einare AsLaNsta254: 04,10▄12,10▄04,13▄06,03▄07,06▄08,11▄03,12▄10,09▄10,12▄12,12▄03 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! ctcvk: artyom-poptsov cmaloney yosafbridge jralls dmiles alezost akkad vicenteH efraim SHODAN Amynka n8a catonano einarelen drmeister cbaines zacts cky siel jchmrt ft nekomune wigust dograt zv babyflakes unknown_lam AsLaNsta254: 07,09▄11,06▄08,13▄11,03▄04,11▄05,06▄10,10▄02,05▄02,04▄03,03▄13,10▄02,04▄02,03▄10,08▄13,12▄05,13▄13,11▄05,13▄10,07▄13 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! xotyridqyl: evhan wigust efraim jao vicenteH rekado Amynka ft manumanumanu SHODAN xdje webshinra fasheng DerGuteM1ritz cky he AsLaNsta254: 03,04▄05,08▄07,13▄11,13▄04,04▄02,12▄13,11▄10,10▄02,13▄13,11▄04,12▄08,07▄11,08▄06,08▄07,04▄04,06▄09,08▄08,05▄13,12▄09 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! pdjmtjgnx: dograt jao siel alezost vicenteH nckx fasheng Intensity evhan efraim daviid einarelen webshinra zv slyfox zacts Ar AsLaNsta254: 06,13▄13,13▄13,05▄06,03▄10,08▄13,09▄04,05▄08,09▄06,11▄09,02▄10,11▄09,11▄11,02▄06,09▄05,11▄10,03▄02 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! nhgfhwkyve: dograt drmeister ecraven davexunit cbaines cmaloney fasheng DerGuteM1ritz jchmrt catonano yosafbridge zv einarelen zacts Intensity Amynka sneek AsLaNsta254: 03,12▄08,08▄11,05▄07,12▄11,04▄08,07▄05,13▄07,02▄13,03▄11,09▄06,08▄07,11▄09,05▄04,09▄07,12▄12,07▄03,12▄12,06▄04,03▄05,06▄10 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! hyxxi: ArneBab_ xdje SHODAN DerGuteM1ritz mwette Amynka vicenteH str1ngs jralls efraim siel bairui zv Intensity rek AsLaNsta254: 05,04▄09,04▄09,05▄02,09▄04,02▄05,04▄04,13▄10,11▄03,05▄03,06▄08,09▄08,03▄04,11▄05,10▄13,12▄02,04▄10,08▄02,02▄06,08▄04 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! clsfkedgtk: rotty daviid neuromorphic babyflakes Amynka wigust manumanumanu slyfox mwette jralls terpri cmaloney Intensity ja einarelen: I AsLaNsta254: 08,11▄09,11▄03,05▄09,13▄03,04▄10,02▄08,02▄13,05▄09,11▄11,04▄06,04▄02,08▄05,06▄06,05▄06,10▄13 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! atdqcbc: SHODAN ArneBab_ bairui zv artyom-poptsov wigust drmeister neuromorphic n8a zacts babyflakes bgamari rotty jchmrt DerGuteM1ritz dmiles akkad jao dograt rekad amz3: :( AsLaNsta254: 13,04▄02,04▄08,04▄08,10▄10,05▄12,11▄08,06▄08,07▄04,07▄08,09▄04,11▄04,07▄08,09▄06 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! iceiadmflu: str1ngs rekado heroux dmiles nekomune ecraven davexunit cmaloney slyfox jao vicenteH manumanumanu Sleep_Walker yosafbridge fasheng babyflakes holomorph webshinra nckx siel S AsLaNsta254: 05,02▄09,09▄07,11▄13,12▄09,04▄04,05▄06,06▄04,13▄03,02▄10,07▄03,03▄03,05▄06,02▄11,08▄06,12▄07,09▄13,05▄11 HAPPY NIGGER MAS!! IF YOU WANT JOIN A CELEBRATION THAT IS NIGGER FREE PLEASE JOIN #/JOIN RIGHT HERE ON THIS NETWORK!! auepfw: Amynka DerGuteM1ritz bgamari holomorph babyflakes fasheng Intensity heroux sneek cky terpri drmeister efraim SHODAN catonano cbaines n8a amz3: /kcik AsLaNsta254 einarelen: I'm just getting started with guile and guix, is this IRC usualy like this? amz3: einarelen: no amz3: it's not like that in the sens there is no spammer usually amz3: but last few weeks, some spammer is attacking freenode amz3: I getting such messages in other channels too einarelen: Thats annoying but nice to know its not the standard amz3: :) artyom-poptsov: Hello Guilers! I released Guile-ICS 0.2.0, a Guile iCalendar (RFC5545) format parser: https://lists.gnu.org/archive/html/guile-user/2017-12/msg00080.html -- probably it'll be of some use for someone. amz3: tx! daviid: no solution I could find o internet actually addresses the exct problem: 1 column has text, all others have inages, so far, it is 'impossible' to vertically center the text of the first column daviid: going afk a little, bbl mwette: /quit daviid: ArneBab_: if yu are still interested, here is a (two actually) minimum complete example: https://paste.debian.net/1002193/ (drop this as test.tex, find a png image on your computer, any, drop it there as well, as img-1.png, and pdflatex test.tex) daviid: ArneBab_: the #latex floks answered and the soluton is t use \\usepackage{adjustbox} and souround the image \\adjustbox{valign=c}{img-1} (and _not_ sourounfd the text, don't ask me why :)) here is a complete example: \\adjustbox{valign=c} daviid: https://paste.debian.net/1002197/ ArneBab: sneek: later tell daviid: thank you! sneek: Got it. mwette: Q: Are the SCM_I_ macros in libguile/*.h for internal use only? ijp: seasons greetings strangers manumanumanu: wingo: yeah. seems like a nice optimization, and probably a lot faster than my macro. manumanumanu: Merry christmas from sweden everyone ArneBab: manumanumanu: happy holidays to you, too! mwette: daviid: you live well! manumanumanu: wingo: that case thing you were talking about, did you think about implementing it as a macro or in the compiler? I have a soon-to-be double-dispatch case (memv and binary search with extra support for strings). I don't know about addig hash tables yet though. Can they be pre-computed by peval? amz3: Off topic but a real question: how do keep your work at $WORK? ft: Don't configure your work email account on your phone. :) amz3: I just filled an issue on github about some bug I found at work amz3: things start badly amz3: I don't need email on my phone, I sync tabs in firefox already :( ft: With tabs you open at work?! amz3: yes ft: Okay, you're in deep then. wingo: manumanumanu: i would like to implement it in the compiler. recognizing chains of if statements there. wingo: and compiling to "case" as appropriate wingo: as the paper suggests ArneBab_: amz3: well, stop synching tabs. If you need to transmit info from work to home, have an analog (paper-) notebook ArneBab_: daviid: I think something similar hit me … #+attr_latex: :align r|L{\\dimexpr 0.32\\linewidth-1.5\\tabcolsep}L{\\dimexpr 0.32\\linewidth-1.5\\tabcolsep}L{\\dimexpr 0.32\\linewidth-1.5\\tabcolsep} -- using this definition for L: https://bitbucket.org/ArneBab/1w6/src/26274437f361ccde5881e94e8a9a45354470ec05/Hauptdokument/ews30/ews30setup.tex#ews30setup.tex-12 ArneBab_: daviid: usage example: https://bitbucket.org/ArneBab/1w6/src/26274437f361ccde5881e94e8a9a45354470ec05/Hauptdokument/ews30/ews30setup.tex?at=default&fileviewer=file-view-default#ews30setup.tex-12 daviid: ArneBab_: cool! let me look at it... tx daviid: ArneBab_: i think you did paste twice the same link daviid: ArneBab_: I use tabularx, and my L def is daviid: \\newcolumntype{L}{>{\\raggedright \\arraybackslash}X}, but that won't center vertically, as you know... daviid: ArneBab_: just tried this daviid: \\newcolumntype{L}[1]{>{\\raggedright\\let\\newline\\\\\\arraybackslash\\hspace{0pt}}m{#1}} daviid: which does not work either. there is a bug im the m operator, when all other colun neighbors are images, it fails to proper calculate the height of the cell where 'we ask' to vertically center the text, and always pushes the txt tothe bottom daviid: ArneBab_: my best attempt so fr is to have the text slighty below the top, using a 'multirow trick', and a false (writng in white) 2 rows for one image cell, here: https://paste.debian.net/1002037 {in this example, replace img-1 with one image on your computer of course...) daviid: this uses tabluar (not tabluarx), to make the #latex folks hapy to try to debug this with me... ArneBab_: daviid: ah, yes, you need to switch to m - I thought that should work ArneBab_: daviid: did you delete the paste? ArneBab_: daviid: does it work if you manually set the height of the image? ArneBab_: daviid: ang yes, it was the same link, unintentionally :( the correct one is https://bitbucket.org/ArneBab/1w6/src/26274437f361ccde5881e94e8a9a45354470ec05/Hauptdokument/ews30/ews.org#ews.org-710 ArneBab_: (usage example) ArneBab_: this is where I found the trick: https://tex.stackexchange.com/questions/12703/how-to-create-fixed-width-table-columns-with-text-raggedright-centered-raggedlef/12712#12712 daviid: ArneBab_: here is new paste (last 24h) https://paste.debian.net/1002182/ daviid: ArneBab_: I can't set manually the vertical size of the image anyway, all this is generated code, based on the width of images... daviid: I did switch to m in your example, as I reported, it does not work mwette: daviid: thanks. I read through some of the docs. They base it on the interface to the llvm compiler collection, so dependence on llvm. mwette: and it handles C++ for which I don't see much hope for now. It has whiteligsting and blacklisting which my ffi-helper can deal with in other ways (i.e., using the decl-filter option). daviid: mwette: I was just trying to help, no making any comparuson myself daviid: even if this other lib (rust based) just prove your approach is better, this, is already good :) daviid: it is terrible we don't have lisppaste anymore mwette: daviid: much thanks for the link. What is lisppaste? You can go to paste.debian.net and set lang to lisp I believe. daviid: mwette: http://paste.lisp.org/ Due to continued abuse, this service has been disabled daviid: yes debian paste, but I prefered lisppaste... daviid: any latex guru here? #latex is asleep, or nobody can help, don't know, but it'sbeen two days I can't find a solution to my problem, here is the problem: daviid: https://paste.debian.net/1001898/ daviid: in the above example, replace the image with any image you have on yur computer, then try to comile (pdflatex ...) and you see that the text aside the image is not vertically centered daviid: sorry for this OT quiz, just in case some one would have, like i regurlaly do, produce report in latex generted by gule of course ... daviid: how to verticallt center a text of a table column, when all neighbors are images is the quiz... mwette: daviid: did you try adding \\vfill above and/or below ? mwette: anyone know how to interpret this error message: mwette: ERROR: Wrong type (expecting md-edes-t): # mwette: mwette: static SCM mwette: scm_des_id(SCM _des) mwette: { mwette: md_edes_t *des; mwette: scm_assert_foreign_object_type(edes_type, _des); mwette: des = scm_foreign_object_ref(_des, 0); mwette: return cnvt_md_to_scm(des->id); mwette: } mwette: never mind -- somehow working now civodul: https://lwn.net/SubscriberLink/741176/a1fa9a530fd434ce/ <- on locale-dependent string decoding in Python 3 civodul: the same kind of issue that we have in Guile 2.x civodul: perhaps worth a look dsmith: sneek: botsnack sneek: :) dsmith: Yey dsmith: Howdy Guilers! jlicht: hey dsmith mwette: hi all davexunit: is there any way to turn auto compilation off when using guile in a script with a shebang like `#!/usr/bin/env guile`? jlicht: davexunit: Unless guile has some special provisions for this, no jlicht: at least not a flag in the shebang line davexunit: I thought guile did have some special provisions davexunit: but it seems they all fail in this case ft: Can't you use --no-auto-compile with the script-header approach from the manual? davexunit: no davexunit: it only works if you refer to a guile binary specifically davexunit: like #!/usr/bin/guile ft: Interesting. No idea then. davexunit: I was hoping guile had some other workaround to deal with this davexunit: yeah I think I'm screwed here. davexunit: oh wait davexunit: found something I overlooked in the manual ft: The -s switch? ft: It was -s wasn't it? davexunit: that was part of it davexunit: but you can't just do #!/usr/bin/env guile -s ft: That and the #! ... !# davexunit: you have to do #!/usr/bin/env sh ft: with additional lines? :) ft: oh ft: Ah, I see. Okay. davexunit: after the shebang line I have `exec guile --no-auto-compile -s "$0" "$@"` davexunit: ugly, but effective davexunit: the --no-auto-compile is actually redundant davexunit: just -s is fine davexunit: nvm it is necessary. :) davexunit: I'm all over the place today jlicht: btw, why is --no-auto-compile desirable? davexunit: so you don't get the auto compilation text every time you run it davexunit: and since it's a script it's really not something that needs compiling mwette: what about this: mwette: #!/bin/sh mwette: GUILE_AUTO_COMPILE=0 mwette: export GUILE_AUTO_COMPILE mwette: exec guile -s $0 $@ mwette: !# mwette: (simple-format #t "~S\\n" (program-arguments)) davexunit: accomplishes the same task davexunit: just more typing daviid: hello guilers! daviid: mwette: \\vfill is not allowed in tabular[x], afaict, it raises an exception, and \\vspace*{\\fill} is 'accepted' but does not produce any results, but tx mwette: daviid: i googled and found this: https://tex.stackexchange.com/questions/30551/centering-mutirow-text-in-a-table-whose-cells-contain-several-lines-of-text daviid: mwette: yes, but, the quiz is when all other column but the first contain images, none of these approach that work with text 'only' table work mwette: that sucks -- sorry daviid: mwette: yeah, so far I'm stuck! funny, as if no one as ever tried this before, which is a bit hard to believe :), give latex is an old lady mwette: daviid: but still awesome. MS Word is such a PoS. daviid: mwette: i've never used anything else then latex actually :) amz3: héllo amz3: I am reading the documentation of elastisearch amz3: so far, it's seems like a mess of exceptions without the guarantees of SQL like ACID amz3: I don't understand how this can be put in productio without headache amz3: that said it has a broad set of features amz3: that's part of my 'mess of exceptions' description above amz3: AFAIU so far, it's basically a some kind of store with multiple kinds of indices amz3: that can scale horizontally amz3: ie. the data can be stored on multiple machines amz3: Here is an extract of the the documentation explaning that a write can fail https://paste.freshbakedyams.com/paste/18L146PG amz3: an example of feature creep: you don't need to create the "table" that will store your document and instead directly ask to index a given document under an index name, field types will be automatically guessed based on the first document amz3: I understand how it's useful, but at the end of the day, it's a little extra effort to declare the index upfront and IMO will make the documentation easier to read amz3: similarly you can pass parameters as HTTP JSON body or query string amz3: ACTION lazy dev amz3: ACTION lazy dev™ amz3: (also elasticsearch invented a scripting language called ``painless'') daviid: hello guilers! daviid: mwette: yu might be intereste to read about this: https://jvns.ca/blog/2017/12/21/bindgen-is-awesome/ (if you haven't yet ...) jralls: Is scm_divide(scm_from_int(num), scm_from_int(den)) the best way to construct a Scheme rational from C int numerator and denominator? mwette: daviid: Thanks for the pointer. It looks similar to the helper I am working on. [One think I like about our helper as is that it can parse comments from the C headers and pretty-print c code; the original C code is generated as a comment along with the Scheme bindings. mwette: jralls: this is low level but I might work : scm_double_cell(scm_tc16_fraction, num, den, 0) jralls: mwette: Will that work with int64_t num & den? mwette: jralls: not sure. the arguments are scm_t_bits which seems to be uintptr_t. That should be 64 bits if you are running on a 64bit machine. jralls: Hmm. I need 64 bits regardless of machine architecture, so scm_divide is probably safer. mwette: i agree daviid: mwette: yes, I know you are working on ffi-helper, hence the link ... I thought you might be interested to read their approach, maybe snarf some ideas, maybe ... manumanumanu: Jesus christ. I have been fighting iptables for too long. In the end I just copypasted a thing from reddit, and bam: now everything works cmaloney: Welcome to 2017 manumanumanu: thank you manumanumanu: now, let us just say: this is the last time I get thrown off a network because my home automation stuff goes bonkers when I'm not at home amz3: daviid: héllo, do you do computer vision for geographic stuff? daviid: amz3: hello. I don't: guile-cv is first and above all, an image processing and analysis functional programming library for guile, images can be from any field really daviid: amz3: why? amz3: because of guile-cv indeed amz3: I hear that my new company does computer vision for guess stuff in images amz3: where images are taken by planes amz3: they try to guess various stufF... like how steep is the roof daviid: amz3: ok, they probably use opencv or imagj daviid: *imagej amz3: oh ok amz3: I have to get into all things related to GIS amz3: Geographic Information System daviid: or maybe deep learning, which is out of guile-cv scope amz3: neither do you amz3: I a am building a database of things that can be geolocated amz3: like root tops steep daviid: not my domain, GIS generaly refer to applications, which provides GUI to manipulate these images ... highly related to the coordinates (gps) ... amz3: oh amz3: they don't use gps for some reasons amz3: daviid: see you later, I go to sleep daviid: amz3: yeah, all this has nothing to do with guile-cv, unless they want to 'prepare' these images for better segmentation and measures... daviid: see you amz3: that's what they do... I mean it came to my mind, that guile-cv could be use to find out stuff on stallites images amz3: anyway amz3: bye amz3: guile-cv is highly relevant daviid: bye amz3: o/ manumanumanu: wingo: neat! thanks for that good read. I have a casequal macro that does triple dispatch, but not the other things. I might try to write one that is fast later on manumanumanu: but I don't think I have much computer time until sometime in march manumanumanu: I have no idea what I'm looking at with the intermediate code, but I could probably write something like that. OrangeShark: hello everyone wingo: manumanumanu: "case" is implemented as a chain of if/then instead of some kind of table dispatch wingo: basically guile needs to do http://scheme2006.cs.uchicago.edu/07-clinger.pdf amz3: o/ wigust_: Hello, Did somebody see "gdbscm_type_pointer: Wrong type argument in position 1" in GDB? https://paste.debian.net/plain/1001269 wigust_: compilation: https://paste.debian.net/plain/1001270 wigust_: GNU gdb (GDB) 8.0.1 wigust_: Interesting, now with Xterm get a different error than from GDB on Emacs https://paste.debian.net/plain/1001272 wigust_: Seems found a thing calling (system vm debug) https://paste.debian.net/plain/1001276 wigust_: OK, seems something with my local environment. Compiling inside guix container and running the same way doesn't reproduce this. civodul: perhaps something in ~/.gdbinit? wigust_: civodul: yes, "set auto-load safe-path /" is a reason wigust_: civodul: thank you for pointing! civodul: yw! OrangeShark: hello everyone amz3: héllo OrangeShark mwette: OpenGL is very version dependent. I'm afraid reading 2.6 will be a waste of time. mwette: the cover page of the following is what I meant by architecture: https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf mwette: unless what you are using uses v2.6, of course manumanumanu: Good morning wingo: one of these days i need to implement optimized "case" compilation :P amz3: o/ kristofer: davexunit: hey I'm trying to use (guix web sxml) and I'm running into issues with unknown characters at line 66. Basically all characters with "Ã" in them are unknown. What am I missing? manumanumanu: wingo: what is it that is not optimied now? amz3: davexunit: what do you recommend to get started with opengl? daviid: amz3: gule-opengl :) amz3: I mean to say, which tutorial is good to learn opengl using guile-opengl mwette: amz3: you need to about architecture before coding, and that is very version dependent amz3: mwette: I don't understand, what is architecutre in this context? the hardward spec of my laptop amz3: ? mwette: no: IIRC V4 uses a pipeline of transformations and uses triangles only; earlier versions uses rectangles etc and did not have a pipeline. Again, IIRC. mwette: I have OpenGL Programming Guide for V4.3 (and earlier version at work); it's like 800 pages amz3: oh amz3: I will read this https://www.khronos.org/registry/OpenGL/specs/gl/glspec21.pdf amz3: at least I will be able to say I read something useful in 2017 amz3: kristofer is gone amz3: I have bad news amz3: I will reply the post on the mailling list amz3: tomorrow amz3: basically, I want to narrow the scope of guile-wiredtiger, to only be wiredtiger bindings amz3: so I will remove the toy databases that I have made amz3: and instead improve the bindings AND the documentation amz3: right now the documentation is the documentation of wiredtiger amz3: This doesn't mean I will stop using guile wiredtiger, just that it's too difficult to maitain multiple toy databases, also it's seems to me it's misleading amz3: I was under the impression, that the toy databases would form like a ladder of code that people will be able to read to be able to increase their knowledge of wiredtiger amz3: but this doesn't really happen amz3: It will be easier for me to write a good documentation amz3: even if wiredtiger official documentation is good enough amz3: and since my project is autotools now, I can have a GNU compatible documentation wingo: moin :) civodul: heya wingo! lloda: how to destructure an alist? match only works with fixed order gjanssens: Hi, can anyone point me at a good example of using a function as the #:on-error unwind handler in the call-with-error-handling function ? gjanssens: Rather than simply using 'backtrace (still undocumented btw) I'd like to store the backtrace in a global variable to pass back into the C calling code gjanssens: I'm having some difficulty figuring out how that is done :( gjanssens: Ah found it (soon to appear in gnucash code :) ecraven: how complex is the implementation of syntax-parameters? ecraven: is this something that is rather easy to add to an implementation? civodul: ecraven: in psyntax, syntax parameters look quite easy ecraven: civodul: would you happen to know in which source file syntax-parameters are defined? civodul: in ice-9/psyntax.scm civodul: search for 'syntax-parameterize' civodul: the whole file is intimidating but that part less so ;-) rekado_: lloda: I’ve been wondering the same. I’d like for a more powerful match (and sxml-match) that doesn’t worry about order. jeko: if you are ;otivated enough to follow that thing... wingo: moin wingo: sneek: later tell civodul i think we need to release a 2.2.4 soon, i think the fresh-auto-compile that was committed does the wrong thing sneek: Will do. wingo: sneek: later tell civodul as the documentation notes, setting %fresh-auto-compile should only invalidate the auto-compilation cache (the one in ~/.cache), not all precompiled .go files sneek: Got it. wingo: ACTION grumble Chris-gnc: I'm trying to debug a script in gnucash - I've isolated the error to changes between guile 1.8 and 2.0 - can't find a changelog describing them, is there anything major between 1.8 and 2.0 wrt r5rs/r6rs / binding/scoping ? sorry for complicated qu wingo: Chris-gnc: see NEWS for differences between 1.8 and 2.0 Chris-gnc: wingo... thank you, as usual as soon as I've formulated my qu I managed to find an answer, https://abi-laboratory.pro/tracker/changelog/guile/2.0.0/log.html - must be somewhere there :) Chris-gnc: I'd been developing on guile2.0 successfully, and as soon as I apply on 1.8 it fails so I'll need to find something that 2.0 allows and 1.8 disallows :) civodul: wingo: re fresh-auto-compile, i see, though i didn't read it that way civodul: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29226 civodul: but yes, i see what you mean wingo: from what i can see it's just that one patch that needs a revert wingo: sound about right to you? daviid: hello guilers! amz3: o/ kristofer: amz3: can you help me understand how this (list-posts-query) on line 813 of https://framagit.org/a-guile-mind/azul/blob/master/web/web.scm kristofer: ? amz3: kristofer: yes, ping me later today kristofer: amz3: I'd like to make a similar query for https://github.com/kristoferbuffington/gnupaste/blob/master/gnupaste/paste.scm amz3: kristofer: tx for considering wiredtiger :) amz3: kristofer: first things, with-env must be called once per program amz3: it will setup a fluid and then you are good to go, you don't need to pass around anything around amz3: (except if you use threads) amz3: anyway amz3: kristofer: the query you want is similar to this https://www.paste.org/89217 amz3: mind the fact that I change reverse to reverse! and sort to sort!, because I think it's more performant and in this context doesn't introduce a side effect outside the procedure amz3: the run* procedure inside 'list-posts-query' is similar to 'run' form provided by minikanren/microkanren amz3: so basically it runs the declared logic problem and returns the variables that appear such as arguments amz3: (run* (post/body post/time) ...) will return a list of post/body and post/time amz3: the 'fresh' form introduce variables in the logic program, I see now that's it's a mistake amz3: I will paste a fixed code. you don't need to vote? variable in this problem amz3: BUT a empty 'toplevel' fresh form must always follow run* but I don't know why amz3: fresh is like 'let' for minikanren programs amz3: 'fs:queryo' is the magic procedure that allows to query the databae amz3: Here is the definition of fs:queryo https://framagit.org/a-guile-mind/guile-wiredtiger/blob/master/wiredtiger/feature-space.scm#L107 amz3: so in the feature space, the 'atoms' are tuples that look like (unique-idenfiier attribute-name value) amz3: several tuples of this form with the same unique identifier make a feature (or document in mongodb parlance (or row in RDBMS)) amz3: if a set of tuples have the same identifier you can 'factor' the identifier and build an alist that as attribute-names as key and values as value amz3: anywa amz3: what fs:queryo does, is try to pattern match the tuples that are found in the database amz3: the following query https://www.paste.org/89217 could be rewritten without fs:queryo like the following amz3: https://hastebin.com/uziwubuxus.lisp amz3: things that appear with ? at the end are return variables amz3: (microkanren use that char ^ instead) amz3: oops I changed convention in the mean time amz3: anyway amz3: what I mean, is that fs:queryo forms a declarative query of what the databae looks like amz3: and you can use variables in the place of the unique identifier or the value amz3: but not the attribute name amz3: (basically the attribute name must be known in advance) amz3: (you can't ask for all attributes in the database) amz3: so amz3: if you for instance want the unique identifier of 'paste you use (fs:queryo uid? 'kind 'paste) amz3: if you know the uid of a feature and you want to some of it attributes you can do amz3: (run* (user/name user/age) (fresh () (fs:queryo "P4X4324" 'user/name user/name) (fs:queryo "P4X432" 'user/age user/age))) amz3: so the use of microkanren is two side: 1) you can filter features by "pattern matching" attribute name with values, and return the matching features' unique identifiers amz3: 2) you can retrieve a subset of the attributes of given feature amz3: sorry kristofer this is not documented amz3: kristofer: also some experience of minikanren might be helpful... see Reasoned Schemer book amz3: kristofer: let me know what you understand or what I did not explain well amz3: kristofer: also, it's possible to avoid the use of fs:queryo by using fs:find directly https://framagit.org/a-guile-mind/guile-wiredtiger/blob/master/wiredtiger/feature-space.scm#L92 amz3: so now you know the database is made of tuples (U A V) amz3: and a feature is a set of UAV tuples where U is the same amz3: the index of the database will be built with all the (U A V) tuples by changing the order to the elements of the tuple amz3: (U A V) becomes (A V U) this way it's possible to quickly find out which U has (A V) as prefix amz3: kristofer: also, if you are experienced with SQL maybe avoiding feature-space might be easier, though there is not SQL layer yet amz3: kristofer: see http://hyperdev.fr/notes/somewhat-relational-database-library-using-wiredtiger.html atheia: hello! atheia: Is anyone else having issues with Guix Pull? atheia: "no code for module (guix profiling)" atheia: Oops, wrong channel :-D lloda: daviid: format ~y just calls truncated-print. Guile shouldn't crash anyway! :O kristofer: is there some emacs feature to put the copyright header in source files? holomorph: not in emacs, but there is legalese.el lloda: "Too many root sets" lloda: fun buenouanq: looking for more guile web server examples buenouanq: if anyone here knows of any beyond what's in the manual, please let me know kristofer: buenouanq: look at guix-publish, tekuti, guix-web michaelis: Hi. Is it possible to extend c with guile so that I from a c runtime can call guile functions that can manipulate variables in my c runtime? cmaloney: michaelis: Have you looked at https://www.gnu.org/software/guile/manual/guile.html#Programming-Overview ? michaelis: cmaloney, Thank you, I will look into it. I also found this short and concise information https://www.ibm.com/developerworks/library/l-guile/index.html. kristofer: amz3: can you show me how I might get a list of uids of kind paste from the feature-space? kuwze: could someone point me to a project that uses both guile and c? I am looking for something to emulate. jeko: kuwze, I don't know such thing jeko: maybe you can find some ref on Guile web-site kuwze: jeko: thank you jeko: kuwze: I wish I could have give you more insightful ideas jeko: in the ref you can find how to give Guile support to Dia daviid: rekado: are you a member of bug-guile? daviid: anyway, for info, I've sent a bug (request for improvement) report ... here: https://lists.gnu.org/archive/html/bug-guile/2017-12/msg00008.html daviid: lloda: I see, in wip-raised-exception, your've added (define exception-format siple-format) andcalls it 'everywhere' below. but that does not seem to change anything compared to the previous version, calling format, which also was redefined at top for simple-format, what am I missing? daviid: oh I see now, it so that users can redefined it in their .guile daviid: lloda: for info, I just tried your patch with 2.2.3 (stable-2.2) and it gets guile to quick after a few seconds, no matter what ... daviid: to quit daviid: lloda: that is whe I also redefine exception-format i .guile, following your suggestion daviid: lloda: if I don't redefine anything, it works fine (as expected I guess, since the patch does not change anything 'per se') daviid: lloda: I also tried to use your patch and truncated-print, like this: daviid: in .guile daviid: (use-modules (ice-9 pretty-print)) daviid: daviid: (when (defined? 'exception-format) daviid: (set! exception-format daviid: (lambda (port fmt . args) daviid: (apply truncated-print #:port port args)))) daviid: daviid: but that provoque the same behavior, guile starts, then quit after a second (sometimes not even a second) daviid: lloda: like this ( a mini session in geiser) daviid: scheme@(guile-user)> ,use (cv) daviid: scheme@(guile-user)> (im-load "gnu.png") daviid: $2 = (148 125 4 (#f32(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 # …) …)) daviid: scheme@(guile-user)> daviid: It's been nice interacting with you! daviid: Press C-c C-z to bring me back. daviid: daviid: I did quit, guile did quit on its own ... daviid: lloda: any hint? daviid: lloda: but this seems to work fine: daviid: (use-modules (ice-9 pretty-print)) daviid: daviid: (when (defined? 'exception-format) daviid: (set! exception-format daviid: (lambda (port fmt . args) daviid: (for-each (lambda (arg) daviid: (truncated-print arg #:port port)) daviid: args)))) daviid: daviid: lloda: so, pretty cool! the best would be to get truncated-print in boot-9, not sure how difficult tht would be daviid: lloda: if you have no objection, I will send a bug report with your patch (actually one built on top of the lates, there is a change in boot-9 since your branch), naming you as the author of course, then suggest a user (or global) config as above, and ask how difficult would it be (if possible) to get truncated-print in boot-9, so no user would have to do anything to get this default ... daviid: it is actually possible to globally configure guile, for those who share guile among several users: just put the content of relevant .guile content here in here: share/guile/site/init.scm dustyweb: o/ cmaloney: o/ lloda: sneek: later tell daviid I guess that could work. I explained how I use that patch here: https://lists.gnu.org/archive/html/guile-devel/2017-02/msg00083.html sneek: Okay. lloda: sneek: later tell daviid the first address@hidden is x~~~@y and the second is ~200@y, but ofc you can use truncated-print directly sneek: Will do. lloda: sneek: later tell daviid it isn't general b/c it depends on rewriting the error format strings and afaiu those can be anything sneek: Will do. lloda: sneek: later tell daviid the way you do it, fmt or the details of the error msg is lost. My patch is only a hack so that I could use Guile w/o killing myself. I think the right solution is to severely restrict what you can put in error format strings, and then provide a fluid to change the exception printer, but those are api changes. sneek: Got it. lloda: sneek: later tell daviid anyway please do file that bug sneek: Okay. wingo: moo civodul: hey! manumanumanu: Good day everyone dsmith-work: Tuesday Greetings, Guilers OrangeShark: Hello everyone jeko: Hi guys ! ftknox: Hello! notsoanonymous13: hi there ! daviid: heelo guilers! sneek: Welcome back daviid, you have 5 messages. sneek: daviid, lloda says: I guess that could work. I explained how I use that patch here: https://lists.gnu.org/archive/html/guile-devel/2017-02/msg00083.html sneek: daviid, lloda says: the first address@hidden is x~~~@y and the second is ~200@y, but ofc you can use truncated-print directly sneek: daviid, lloda says: it isn't general b/c it depends on rewriting the error format strings and afaiu those can be anything sneek: daviid, lloda says: the way you do it, fmt or the details of the error msg is lost. My patch is only a hack so that I could use Guile w/o killing myself. I think the right solution is to severely restrict what you can put in error format strings, and then provide a fluid to change the exception printer, but those are api changes. sneek: daviid, lloda says: anyway please do file that bug amz3: o/ daviid: hello lloda! I believe truncated-print should be used both by repl-print and the raised exception system, and for the later, either configure in share/guile/site/init.scm or individually in .guile, after your patch, is nearly perfect (perfect would be to rewrite truncated-print so it would work at boot-9 time...) OrangeShark: I think after I finish this online course on using the Seaside web framework for pharo, I want to try experimenting with the same ideas in guile daviid: lloda: the solution you propose, in .guile (in this email you link), gets guile crasy, it simply quits gule after a sec, sometime not even 1 sec ... the solution I proposed works perfectly, and fullfill the need that, imo again, we want truncated-print, not user specific fmt... (by the way, iirc, I tried and error does not support fmt in the msg string, and after some thought, i don't think we want that anyway). truncated print is daviid: sophisticated, and try its very best toprint val according to its type, I don't think we have anything as good anwhere else in guile daviid: lloda: I will send a bug (request for improvement) bug today, based on your very simple and totally 'inoffensive' patch daviid: lloda: truncated-print has been written by wingo in 2009, it really is well thought, well written, robust... in 2009, wingo already knew guile very very deeply, I don't believe anyonr of us could write a better procedure then this one, adn we have it so, let's use it! :) lloda: daviid: rekado: no need to patch Guile to fix printing of large structures at the repl. It's supported with repl-option-set!, which is of course undocumented. lloda: (repl-option-set! (car (fluid-ref *repl-stack*)) 'print (lambda (repl val) (format #t "~200@y" val))) lloda: will do the trick lloda: you do need to patch Guile to fix printing of exception messages though lloda: for .guile you don't need *repl-stack* but lloda: (repl-default-option-set! 'print (lambda (...) ...)) dsmith-work: Morning Greetings, Guilers OrangeShark: hello everyone dustyweb: wingo: http://stefan-marr.de/papers/pldi-marr-et-al-zero-overhead-metaprogramming/ hikikomori: hi there folks ! would it be complicated to setup guile web server like an nginx config? where I simply give the virtualhostname and the directory location of teh files. anonymous2139321: anyone tinkered with the (web server) module? looking to have a simple html text displayed with minimal config daviid: hello guilers! anonymous2139321: hey there daviid daviid: lloda: thanks, that will help, in the mean time ... I strongly believe that guile's repl should use truncated-print per default, and that users whould want the repl to use write instead of truncated-print are the ones who should have to configure, not the other way around ... hence the mini (inoffensive) patch I proposed (1 patch for all users, not all users to configure their .guile, in a 'multi guile users' entity, it saves time and daviid: user headakes to) daviid: this, and a raised exception that, per default, also uses truncated-print is really essential for those of us who daily manipulates large structures ... I hope guile maintainers will pay attention to your patch, and get it in asap... daviid: I don't expect to have not even a single guile-cv user till this is guile's default dsmith-work: daviid: Makes sense to me daviid: no way to expect users comming form python or java to 'resist' a repl which blows every seconds... daviid: rekado: despite lloda (very usefull) suggestion, I still think guix should patch guile as I proposed: this way, all users benefit from it, and as I said, no one wants a repl to try to print a large structure, not just guile-cv users... see all the comments people made here, lloda, mwette, dsmith ... not a single one said it was not a good idea... daviid: rekado: it is an inoffensive patch, talk to civodul if you re 'afraid' of anything ... and let's get this in guile proper as well, please... rekado: daviid: for Guix we usually don’t patch upstream packages like that. Especially in this case I think it’s reasonable to discuss this change for Guile and wait for a patch release. daviid: rekado: yes, I did think that patch would be implemented, 2y ago ... civodul: i didn't follow the discussion but "patch guile in guix" doesn't sound like something we'd normally do :-) daviid: as I said, it is an 'emergency inoffenive patch, then we get it into guile proper, then we get guile to have proper raised exception mmechanism when playing with large structures ... daviid: civodul: the thing is to get (system repl common) to import (ice-9 pretty-print) and the repl procedure to call truncated-print insted of write. that would fix guile, using guile, for all users ... could you please look at this and get it into guile, thanks! then we should do something about raised-excption, but it seems a bit more complicated civodul: is there a bug report for it? civodul: BTW "could you do think thx" is unnecessarily aggressive to me daviid: civodul: I did not send a bug report, because the way we discussed this here, at least in the very beginning, sounded that it was going to be fixed immediately, but if that is what misses, I can send a bug. one question about the proposed (really tiny patch) is should the manual being updated somewhere maybe? I could not find the answer to that question civodul: i'm just coming to the discussion so i can't tell "if that is what misses" civodul: what i know though is that bug reports are better when they're filed :-) daviid: civodul: :), ok then I'll send one today then, though it is not a bug perse, rather a 'wish' civodul: ok, sounds good! daviid: civodul: another thing is to patch the raised exception system, lloda has worked on this in the branch 'wip-raised-exception' civodul: did lloda send a message or something somewhere? civodul: i could try to comment later, and then lloda has commit rights daviid: civodul: I don't know how far lloda did discuss his work with 'you' (maintainers) I remember he was still 'thinking' about his patch (ice-9 boot) daviid: civodul: my opinion is, the defauly raised excpetion should use truncated-print as well, because users ca always call write as part of thir debug 'work' ... but in the repl, wether repl-print or raied exception, guile should never try to print large structures (lsts, array, sfri-4 bytestrcutures ... ) daviid: going afk a little, bbl... kristofer: anonymous2139321: I have been tinkering with (web ...) for a few days now :) kristofer: anonymous2139321: what you describe should be pretty easy. check out tekuti and guix-web. there are other examples, but both of those are complete programs to give you an idea of a workflow anonymous2139321: kristofer: nice , I copy pasted the code from the official website like a monkey and it does work when I use wget on localhost:8080 but the information does not appear if I used eww, lynx or icecat. Would you happen to know anything about that? anonymous2139321: kristofer: thanks I will look into it kristofer: anonymous2139321: I'd have to see your code. I have been using write-shtml-as-html from (htmlprag) in guile-lib to format responses anonymous2139321: ;;; Hello HTTP server anonymous2139321: (use-modules (web server)) anonymous2139321: anonymous2139321: (define (my-handler request request-body) anonymous2139321: (values '((content-type . (text/plain))) anonymous2139321: "Hello World!")) anonymous2139321: anonymous2139321: (run-server my-handler) anonymous2139321: kristofer: this is the code i am referring to, you have you any equivalent i do not mind as long as it is in guile anonymous2139321: ls -la anonymous2139321: 000ps daviid: hum. on debian buster after today's libunistring-dev:amd64 (0.9.8-1) update, guile refuses to work: guile: error while loading shared libraries: libunistring.so.0: cannot open shared object file: No such file or directory daviid: there is one .so file, in that libunistring-dev, but no .so.0 I wonder why guile is trying to load the .so.0 daviid: david@capac:~ 2 $ dpkg -L libunistring-dev daviid: ... daviid: /usr/lib/x86_64-linux-gnu/libunistring.so ft: The suffixed file is part of the non-dev packacke. ft: package daviid: ft, ah let me check daviid: /usr/lib/x86_64-linux-gnu/libunistring.so.2.1.0 daviid: i guess i have to recompile guile ft: I bet it's an ABI change in the new version. ft: Relink should be enough, I think. daviid: maybe yes daviid: yes, that worked fine, thanks ft rekado_: I don’t want to patch Guile just for guile-cv. Could this be avoided? rekado_: https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile_0027s-repl_002dprint-procedure.html#Configuring-Guile_0027s-repl_002dprint-procedure spk121: rekado_ FWIW, I had to write a custom printer when I implemented SRFI-14 back in the day to avoid blowing up the REPL. You can do that on the C side. But if you want to do it clean and modern, I think you've got to patch upstream Guile. daviid: rekado_: not that I am aware of. note that the patch is the most inoffensive patch ever, it import another guile module (so it is written and maintained by our maintainers), and change one line, calling a procedure that is als developed and maintained ... this was suggested by andy himself ... the only thing we could do to make it better is to define a variable, or a parameter, so users could still choose between the 2 way of repling daviid: ... right now, anyone of us (I am not the only, by far) working on large lists, arrays, srfi-4 bytevectors are bitten by this problem rekado_: daviid: wouldn’t it be better to get this into Guile itself instead of expecting users to patch it themselves? Is there a bug report for Guile? daviid: rekado_: yes of course the 'patch' should land in GUile itself, I've no idea why it didn't yet daviid: no bug report, we've been talking about this here a couple of times in moreless 2 years, and there is a branch by lloda for raised exception (right now we can not 'patch' that aspect, ice-9 boot needs to be 'prepared' to allow raised exceptions that would not try to print large structures ... daviid: rekado_: if you have guile-cv packaged, just 'cd doc/images', fire a repl, and ',use (cv)' 'im-load "gnu.png") and bang ... see what happens in your terminal (don't try this in emacs, it will kill your emacs daviid: Immenat (im-load "gnu.png") daviid: rekado_: this an emergency measure, inoffensive, then we can talk and submit a bug or jst convince one of our maintainers to 'do something' about this and the raised exception 'system' daviid: all guix guile users will thank you for this :), daviid: rekado_: a user who needs a full write can always call (write val) him/herself in the repl ... but nobody ever wants this on large lists, arrays and bytevectors, in this case, the user will prefer to write a custom procedure (that write n a file or 'filter' what they need ... daviid`: is this correct english: "... each channel holds on specific information." or should it be "... each channel holds on to specific information." amz3: hi janneke: hey amz3 janneke: hmm... janneke: ice-9/psyntax.scm:1558:32: In procedure expand-macro: janneke: ice-9/psyntax.scm:1558:32: Syntax error: janneke: unknown location: segment matching not implemented pattern janneke: never really know what to do best with `unknown location' errors ArneBab: sneek: later tell daviid: I think the second sneek: Will do. laggy_wifi_: would "optdepend = guile: for use with Guile bindings" be where i aquire the dependancy for /usr/lib/guile/2.2/guile-gnutls-v-2.so.0.0.0>libguile-2.2.so.1 janneke: any syntax-rules gurus here who want to help debug: http://paste.debian.net/999958/ mwette: one way to debug syntax-rules is to quote the replacement (i.e., '(ppat ...) instead of (ppat ...)) janneke: mwette: thanks, that's a nice hint kristofer: happy saturday! mwette: same to you kristofer: I'm still trying to figure out how to read the body of a POST request to the web server. My form has two fields. I can process the request, and there is a body, but it appears to be an empty bv amz3: kristofer: can you push your code somewhere? kristofer: amz3: I have been using (tekuti request) for guidance. request-form-data fails because body is # in the (string-null? body) predicate kristofer: it should contain post data from the form I believe kristofer: https://www.paste.org/89094 amz3: kristofer: looking at your code, I see nothing wrong amz3: but I am too tired to try yet now amz3: maybe later tomorrow manumanumanu: Good evening daviid: hello guilers! sneek: daviid, you have 1 message. sneek: daviid, ArneBab says: I think the second daviid: ok daviid: ArneBab: tx daviid: rekado_: hello! one last but not least thing to do as part of packaging guile-cv for guix is we have to patch guile itself, as described here https://www.gnu.org/software/guile-cv/manual/html_node/Configuring-Guile_0027s-repl_002dprint-procedure.html#Configuring-Guile_0027s-repl_002dprint-procedure daviid: rekado_: otherwise, guile-cv is simply unusable. after that, there still is a problem when guile raises an exception that 'involve' a guile-cv image, not much you can do but killing your repl, start and ebug using a 'fake' tiny image (even made by hand), then when things are ok, try on 'real' images again ... daviid: till guile has a way to configure both the repl and the raise exception system so it does try to print long list, vectors, srfi-4 bytevectors ... daviid: anyone has experiece with IPFS? being curious ... daviid: christopher74837: don't know, but you can check and answer these quiz yourself opening the guix/configure.ac (or any project/configure,ac for that matter) daviid: dustyweb: where is guile-gcrypt hosted? dustyweb: daviid: https://notabug.org/cwebber/guile-gcrypt daviid: ah thanks, man, duckduckgo does not find it ... (afaicsee) daviid: christopher74837: so, guix depends on guile-gcrypt, and you can check there what libgcrypt depends on, afaict, it does not require a specific version, it search if one is installed and uses it ... christopher74837: daviid: oh, so I need to install guile-gcrypt... seem to have missed that somehow. Will give that a try\\ daviid: christopher74837: no sure, but that would surely be reported by guix ./configure no? ask in #guix i suggest christopher74837: well, it just says can't use libgcrypt, doesn't say anything about a guile module christopher74837: oh, yeah, sorry, I think I meant to put this question in #guix, too many emacs windows open :) daviid: christopher, better ask on #guix... daviid: ah, xtalk :) dustyweb: oh whoa dustyweb: guix depends on guile-gcrypt now? dustyweb: I didn't realize it :) christopher74837: that is what I needed to know daviid: dustyweb: i spoke too fast it seams, sory! I sincerely did think so, but then you would know ... dustyweb: sneek later tell daviid you're kind of right in the sense that civodul and I *want* that to happen.... it just hasn't happened yet :) sneek: Will do. dustyweb: hi hi OrangeShark: hi dustyweb: davexunit: vague thought: frequently I might prefer that my slugs be based off the filename rather than the title of the blogpost. I guess there is always the :slug field though! dustyweb: I guess that requires slight surgery though to infer the right slug (ie, remove the extension, not too big of surgery) dustyweb: (in Haunt, of course) ArneBab_: dustyweb: I consider the slug to be distinct from the title. It is more concise and conveys hierarchy. ArneBab_: and the link provides something no other part of the website provides: it is information I get before I enter the site, a verification of what the linking page tells me davexunit: dustyweb: I guess it could be customizable davexunit: I personally prefer the title and I'm just copying convention seen elsewhere davexunit: would be good to make it a user-configurable function if it isn't already OrangeShark: dustyweb: davexunit I actually build the slug from the file name for my blog dustyweb: OrangeShark: oh yeah? using Haunt? dustyweb: if so, got some code you can share? :) OrangeShark: dustyweb: https://github.com/OrangeShark/blog/blob/master/haunt.scm#L110 OrangeShark: for the slug, you are passed a post so you can easily get the file name and do whatever you want OrangeShark: the one I did takes a date from the front of the file name to create a path like 2017/12/8/post-name OrangeShark: that from a file name like 2017-12-8-post-name.md daviid: Hi guilers! sneek: Welcome back daviid, you have 1 message. sneek: daviid, dustyweb says: you're kind of right in the sense that civodul and I *want* that to happen.... it just hasn't happened yet :) daviid: dustyweb: cool, what is missing for that to happen? asking because I know it also was mentioned in the guix libification thread (which I wanted to participate and .. failed because of time...) dustyweb: daviid: uhm... making releases... dustyweb: and uhhhh dustyweb: well porting guix code? ArneBab_: dustyweb: here' sthe short form of information content for websites - google-translated: https://translate.google.com/translate?hl=de&sl=de&tl=en&u=http%3A%2F%2Fwww.draketo.de%2Flicht%2Fpolitik%2Fgedanken%2Fgehalt-von-links%23besser daviid: dustyweb: porting guix code? is it not complete yet? I thought you were using it for another project ... daviid: dustyweb: not that i complain :):) of anything, just curious... and I wish we guix libify what can/should be... dustyweb: libify'ing does have some downsides in the initial install part of guix though... but I suppose it is not so severe if you start with the binary release ArneBab_: I wish we had a guix package for foliot ArneBab_: (tried to use that at new-work for time tracking) daviid: the guix folks started that conversation, expressing a strong wish that some of the guix functionality land in guile-lib, I did not have time at thatmoment but I also think it would be awesome! so many pearl functionality that could benefit to guilers... I'm going to write an email, suggesting a (free)talk (not 'official talk' on fosdem , and I promisse I will maintain and release as often as required daviid: dustyweb: will you go to fosdem? ArneBab_: damn, when's the deadline to apply for talks? daviid: ArneBab_: I have to work on it! are you using it? I wish someone build a package for guile-cv! I won't have time to do that (not having the knowledge yet) so ... anyone ... daviid: ArneBab_: no, i meant during the special day the guix folks organized, not fosdem 'per se' .. that is open still , they just built a website for that ... ArneBab_: I want to use foliot, I got guix going at work and I will have to do time tracking in two different contexts: Limit my daily work time and track how much time I spend on which task dustyweb: daviid: unfortunately not tthis year, but I will almost certainly be there next year dustyweb: I wish I could! ArneBab_: I now have a good reason to use Guix, because I'm working on a Kubuntu machine at work daviid: I use foliot daily ever since I wrote it, it really is nice. I need to port it to 2.2 (goops way of dong things i 2.0 won't work in 2.2 daviid: ArneBab_: I will work on it and let you know when ready for 2.2 ArneBab_: I used to use org-mode for time-tracking, but only for my total time (to stick to my 40h). But now I need something to book time on projects, exactly ArneBab_: and doing both with the same program runs into problems ArneBab_: and Guix works on that Kubuntu box ArneBab_: (it's already installed and updated) daviid: ArneBab_: I'd love to have you as a foliot users. It's going to take a few days though, there are thousands of changes to be done for that 2.2 to happen ... dustyweb: daviid: it may be interesting to take note of what GOOPS incompatibilities you bump into daviid: good to have a motivation, I mneat to do that for months ... dustyweb: between the versions ArneBab_: if you want to do it, please tell me when you got it! I can only see the chat here in the evening now, but when I know it's there, I'll install it daviid: dustyweb: there is only one problem causing all this, which is that in 2.2, the mdule system does not call (default-duplicate-binding-handler) if no #:duplicates in the module definition, instead, it will apply a 'hardcoded' default. daviid: I've tried to convince andy this was not 'correct' (I really think it is a bug) but I failed, no big deal either, but I need to change That mean I have to rewrite all modules daviid: I immediately did that for guile-cv, and left foliot (and grip) behind, because I have a dual guile install, and till now, no users (that I am waware of) daviid: ArneBab_: will work on this immediately and will let you know daviid: that is an excellent motivation, thanks! daviid: OrangeShark: are you still living in Florida? OrangeShark: daviid: yes I am daviid: memories ... (just read your blog) I worked there 3y, as a helicopter FFI, Fort Lauderdale ... daviid: CFI daviid: OrangeShark: where in Florida (if I may ask :)) OrangeShark: daviid: oh cool :) I am in the Miami area daviid: the best part :) imo at least OrangeShark: yeah haha daviid: I flew the entire Florida and the entire US by helicopter, west to east south to Canada (Miami-Quebec, 4d to fly and fly back, 7d from Los angesl to Dominican Republic ...) dsmith-work: Happy Friday, Guilers!! daviid: what 'slug' means? dustyweb: daviid: so say you have https://yourblog.example/news/my-favorite-cookie-recipe/ dustyweb: my-favorite-cookie-recipe is the "slug" dustyweb: it's the friendly human-readable version of the title dustyweb: or, a hint on what it's about daviid: dustyweb: i can't open that url daviid: oh stupid me daviid: :), i see, thanks daviid: is slug slang? daviid: a slang word i mean dustyweb: daviid: https://en.wikipedia.org/wiki/Semantic_URL#Slug it's common enough to have a section of a wikipedia page ;) daviid: :) tx kristofer: hello! is the #vu8() indicating a bytevector with no data in the struct? rekado: daviid: I’ll give packaging guile-cv a try. daviid: rekado: that would be fantastic! of course I can help. the only 'difficulty' is vigra_c has no release, it has to be built from the source daviid: rekado, what is the vigra version in guix? rekado: 1.11.1 rekado: where can I find vigra_c? rekado: oh, never mind rekado: there’s a link daviid: rekado: I dd think about making vigra_c a sub project, but for all sort of reasons, I don't want that, hence we need to make a vigra_c guix package first, im daviid: then all other dependencies are in guix I beleive rekado: that’s fine daviid: rekado: ping me if you need help of course ... I shold release 0.1.8 soon, which is 20 to 100x faster - for the first time, guile-cv is equally or fatser then imagej rekado: that’s great! rekado: people in the office next to mine use imagej a lot — but I’m not really sure what exactly they do :) daviid: yes, I'm happy with the progress. yes I 'know them' (not personally), I'm a member of the imagej list. one of your collegue is the boss of the next imagej release, imegej2 daviid: imagej2. rekado: hah, I didn’t know that. daviid: rekado: he's one of the bosses, they are a team ... I actually will get in touch with them, but java people are generally very 'close minded' (language wise of course, no personal attack here), so I'm waiting guile-cv to be a bit more 'furnished': it is already fat and robust, in needs more functionality. I've just added the binary image reconstruction (nor in vigra), which is an essental step daviid: already fast :), not fat haha rekado: yeah, they are deeply invested in Java with Fiji and such. daviid: in the team, there is Alber Cardona: he wrote a tutorial for jython (java using python) and 'using imagj with clojure', he is a lot more open minded then the average java user ... at that time (a few year ago) I started to work on kawa, and got very good results (kawa is an order of mag better then clojure, for many reasons I can't explain here), then I hit a wall because, imegej (version1) has the worst design you can possibly think daviid: of: (a) no core GUI speraration, and (b) a string based API. that leaded to a dead end for batch processing daviid: then I ask if they could write some of the modules I needed, and they refused to do it, telling me I should learn and use java, that would make me a better programmer ... :) that htread leaded to a 'war' with professor in the world coplaining about their lack of respect for my request and myself ... :)) rekado: wow daviid: that is where I decided to start GNU Guile-CV, i realized that ven using kawa will not work (not because of kawa, which fantastic) but because of 'them' rekado: the vigra-c package is finished, moving on to guile-cv. daviid: rekado: this is fantstic! daviid: when the receipe is ready, I can added to the tree if you think it is a good idea ... daviid: rekado: you are very fast! rekado: well, when it’s part of Guix upstream then I think there’s little reason to have a recipe out of tree. rekado: I’m only fast because the software is rather sane. rekado: I’m dealing with terrible software with no discernable build system every day. daviid: ok, i did ask because i did see other developer doing this , can't remember which project though ... perfect! daviid: rekado: is vigra guix package from a tarball or from the source? daviid: vigra_c needs the very latest so I guess you have the very latest rekado: the vigra package is built from the latest git tarball rekado: vigra-c built fine, but it doesn’t seem to have tests rekado: if it is absolutely necessary we could add a vigra-for-vigra-c package variant using the latest source code. daviid: rekado: just to make sure, did you pass ‑DCMAKE_BUILD_TYPE=RELEASE for vigra_c ? rekado: -DCMAKE_BUILD_TYPE=RelWithDebInfo rekado: (that’s the default of the cmake-build-system in Guix) daviid: perfect, it was not the default on debian, which I discovered because loading huge images (100GB would take ages, where as it now takes 4s ... with the appropriate optimize flag daviid: maybe it would be faster just RELEASE daviid: the debug prob adds a full of unecessary things ...? we need full speed here ... rekado: okay, I’ll keep that in mind. rekado: I’ll build guile-cv first to see how far I get and then we can test performance and tweak the definitions. daviid: rekado: ok. I can give you tips and 'snipset code' to try and see daviid: so guix has vigra 1.11.1 from may? that will work fine rekado: okay rekado: I’ll have to go now, but I’ll continue this tomorrow. daviid: rekado: ok, many thanks! one last unusual dependency is the iwona font, does guix has that? daviid: that is to make histogram (it's a free font of course rekado: haven’t seen it before, but I’m sure it won’t be hard to package it. daviid: rekado: the corresponding debian package is listed on guile-cv install page daviid: rekado: see you tomorrow then , thanks again rekado: okay, will check this out tomorrow rekado: sure, no problem! rekado: ACTION –> zzZ daviid: good night! roelj: If I have a script, say, "test-guile-prog", can I then get the absolute path to this script within the script? Kind of like (getcwd), but then for the location of the script. roelj: I now use a function that either returns the path when (car (command-line)) is absolute-file-name?, and otherwise concatenates (getcwd) and (car (command-line)). The only downside is that a ./ and a ../ are not processed. civodul: roelj: overall there's no portable way to do this civodul: however, if you're on GNU/Linux, you can readlink /proc/self/exe civodul: well actually that'd give you the file name of guile, not that of the script civodul: maybe (canonicalize-path (car (command-line))) would be a good approximation? roelj: civodul: Yes, canonicalize-path is what I'm looking for. Thanks! civodul: yw! numerobis: Hi #guile! Is it possible to know in which directory/path a module is defined? On my machine, 'ssh me@localhost 'echo $GUILE_LOAD_[COMPILED_]PATH' and 'echo $GUILE_LOAD_[COMPILED_]PATH' produce exactly the same result, but 'guile -c '(use-modules (guix config))'' works while 'ssh me@localhost guile -c "'(use-modules (guix config)'"' fails with 'ERROR: no code for module (guix config)'. Any idea why this numerobis: happens? (My goal is to offload 'guix build' to another machine) roelj: How would I "fire and forget" a thread in Guile? roelj: I just want to do a (system ...) without waiting for its completion from the main thread. roelj: Oh, nevermind. call-with-new-thread does exactly this. dsmith-work: Thursday Greetings, Guilers webshinra: https://framapic.org/CiPYzf5MeD9N/5uY00hFSHgVz.jpg I speak about it some time ago, here is the quasi-final version christopher74837: hi, I'm trying to compile guile git, but i receive configure error message "required guile module not found: (bytestructures guile) christopher74837: i have bytestructures installed at /usr/local/lib/guile/2.2/site-ccache christopher74837: but if I tried GUILE_LOAD_PATH=/usr/local/lib/guile/2.2/site-ccache ./configure, the error still appears christopher74837: hmm, trying from guile interpreter, I get message "no code for module (bytestructures r6 bytevectors) christopher74837: must need an earlier version of bytestructures christopher74837: no, seems there is missing .scm file for r6 directory bavier: christopher74837: could you open an issue for that? kristofer: hello! kristofer: I need some help trying to read POST data from a request kristofer: nevermind, I didn't do enough research christopher74837: is guix-0.14 dependent on a certain version of libgcrypt? wingo: oh that's a bummer (uri abi breakage...) wingo: actually is it? wingo: i guess if you reference uri? as a value in 2.2 that will break in 2.3 wingo: er wingo: 2.2.2 / 2.2.3 civodul: heya wingo civodul: the problem is when you compile with 2.2.3 and run with 2.2.2 wingo: ah that's not supported ever wingo: right? civodul: i think we've never really thought about it :-) civodul: that would make sense in a way civodul: though bytecode should remain compatible both ways, right? wingo: not necessarily wingo: 2.2.3 can add instructions that 2.2.2 doesn't have wingo: in that case it should increment the micro bytecode version and we didn't do that, but oh well wingo: 2.2.2-compiled bytecode should still run on 2.2.3 though civodul: wingo: right civodul: back to (web uri), i wonder what happens with a 2.2.2-compiled user on 2.2.3 civodul: essentially it would use the old 'uri?' definition, inline civodul: which i think "works", except that it doesn't get the uri-reference/uri distinction wingo: the one thing that might not work would be if a 2.2.2 user used uri? as a value (instead of being applied directly) wingo: i.e. (or-map uri? ls) wingo: there i think we might have a breakage, as uri? would reference the residualized procedure that define-inline made civodul: oh right wingo: maybe we can make a quick fix though by defining "% uri?-procedure" in uri.scm civodul: yes, that'd work wingo: we can release a 2.2.4 soonish wingo: no prob there civodul: hi artyom-poptsov1! civodul: artyom-poptsov1: i think it would be nice if the remote guile in guile-ssh would listen on a Unix-domain socket under $HOME civodul: instead of listening to a TCP port civodul: it'd be less error-prone and safer civodul: thoughts? dsmith-work: Wednesday Greetings, Guilers daviid: hello guilers! OrangeShark: hello christopher74837: hi, i was wondering: coroutines are super cool, but it seems that there is a huge performance problem with those in guile. I was wondering if that is something that is inherent, or if there is a hope for an improvement some day dsmith-work: jeko: Just to be sure you understand. cybo should NOT be in the load path. The directory cybo is in must be in the load path. dsmith-work: So /usr/foo not /usr/foo/cybo jeko: Ok, so my cybo dir is in ~/Workspace jeko: I did export GUILE_LOAD_PATH=".:...:~/Workspace" daviid: jeko, this won't work guile does not exapnd filenames daviid: jelo you must pass the full dirname jeko: hmm I am too confused right know lol I think I will manage dependancies using (load) in my .scm files daviid: jeko: it is not that difficult, keep trying :) pena terminal and cd ~/Worspace, the pwd jeko: and just (define-module (todo-txt)) daviid: that is the path you must add to GUILE_LOAD_PATH .. jeko: Oh when you said guile doesn't expand filenames, you where talking about the ~ replacing the /home/jeko ? daviid: jeko, if you are serious about guile, you really want to pend some time right at the begining to understand this daviid: jeko, yes, you have to pass full directory name, no ~ jeko: Okkkk daviid: jeko did you reaad the manual abut this? I recommend you read that part of the manual very carefully jeko: I read the Load Path chapter, the Environment Variables, but I surely have issues with technical english... need more time to write it in my brain. daviid: ok, good did it work now? daviid: jeko, you can use add-to-load-path as well and you can check asking the value of the variable %load-path dsmith-work: jeko: https://www.gnu.org/software/guile/manual/guile.html#Modules-and-the-File-System jeko: god it worked daviid: jeko perfect! dsmith-work: yey! jeko: thank you both of you str1ngs: daviid: off topic % in %load-path what meaning does that have? daviid: str1ngs: it is generally a convention for internal vars and procedures, but there is no strict semantic jeko: I can know go to bed ^^" jeko: ++ daviid: good dreams then :) str1ngs: daviid: I took it as global variable. but I could not find documentation on it dsmith-work: The %foo convention predates modules I think. str1ngs: ah that makes sense daviid: str1ngs: global vars are generally named *, like *foo* str1ngs: as long as I know it's convention, vs syntax dsmith-work: Yep. Just a convention str1ngs: #' confused me for sometime aswell str1ngs: wait guile scheme has #' right? str1ngs: function qoute OrangeShark: str1ngs: no, guile doesn't have that str1ngs: I'm confusing elisp sorry dsmith-work: http://community.schemewiki.org/?variable-naming-convention str1ngs: its #: I was thinking of for guile scheme str1ngs: #: is named argument? daviid: OrangeShark: it has yes daviid: #'identity daviid: $2 = # daviid: scheme@(guile-user)> OrangeShark: daviid: oh I was not aware of that str1ngs: daviid: it's related to byte completion? str1ngs: compilation* daviid: afaict it's unused in scheme because you can 'type' the procedure ame directly, unlike in lis iirc dsmith-work: https://www.gnu.org/software/guile/manual/guile.html#index-with_002dsyntax OrangeShark: so it not the same as the function quote found in elisp and common lisp OrangeShark: but (syntax identity) dsmith-work: Also https://www.gnu.org/software/guile/manual/guile.html#index-syntax daviid: it is not thesame thing no dsmith-work: The ` , ,@ reader macros have similar #` #, #,@ for use in macros. str1ngs: oh #' is a reader macro dsmith-work: Man. Been a while since I thought about this stuff. Hope I'm getting it right! dsmith-work: Too much C and Python lately for me str1ngs: in elisp #' does function name lookup during byte compilation essentially it quotes the function though. I got the two confused str1ngs: nope I have it wrong. str1ngs: I'm confused haha str1ngs: #' = (syntax foo) right? str1ngs: err #'foo = (syntax foo) dsmith-work: Yeah. str1ngs: ok thanks str1ngs: sorry I got things side tracked there. dsmith-work: Yeah, emacs lisp like CL have different name spaces for functions and variables. str1ngs: I personally like guile modules dsmith-work: So you need two different quotes. str1ngs: so in guile scheme variables and functions exist in the same name space. I guess as types? dsmith-work: str1ngs: So ((if x + *) 3 4) is 7 or 12 depending on x str1ngs: ah that interesting. took me while to grok what was going on there dsmith-work: str1ngs: I think that's probably something like ((if x #'+ #'*) 3 4) in elisp/CL, but I'm not sure. dsmith-work: Nah. Ah well. str1ngs: syntax macros I still do not understand yet. I need research them more dsmith-work: str1ngs: syntax-rules macros are simple and beautifuly elegant. dsmith-work: ACTION heads out .. dsmith-work: Morning Greetings, Guilers ftknox: dsmith-work: Good morning amz3: hi dsmith dhamidi: what is the recommended way to set up a new scheme-only project with guix as a package manager and without having to use autotools? OrangeShark: dhamidi: using autotools makes it easier when using guix as you can just use the gnu build system dhamidi: wingo mentioned a "guile-build-system" herer https://lists.gnu.org/archive/html/guile-user/2017-03/msg00168.html dhamidi: has somebody written that build system already? dhamidi: didn't find anything in the guix source tree, but maybe that was the wrong place to go looking for it amz3: dhamidi: they are examples of guix recipes for pure guile project, have a look at guile-bytestructures for instance dhamidi: sorry, I couldn't find a link after some googling mistnim: daviid: I read your answer, I'm actually in the right directory sneek: Welcome back mistnim, you have 2 messages. sneek: mistnim, daviid` says: actually, I recommend you to keep guix and remove the guile version you have on you debian, then try again ... be sure to purge guile, not just uninstall it: 'aptitude purge guile' sneek: mistnim, daviid` says: the guix approach is alot safer i the long run, and worth spend some time to make it work now ... also becuse the team is working on a new release, and that will hold the latest guile stable-2.2, which will boost your guile-cv experience by a couple of order of magnitudes mistnim: I had made sure of that civodul: the ABI of (web uri) in 2.2.3 is incompatible with that in 2.2.2: https://bugs.gnu.org/29570 civodul: not sure how to work around that dsmith-work: civodul: Maybe the same way wingo turned (load) into a macro? civodul: i think 'load' has been a macro since 2.0.0 no? civodul: or thereabouts dsmith-work: yes. But he contrived it so you can pass it as a function. civodul: yeah daviid: sneek: later tell mistmim it is impossible :), you think you are in the right directory, but most likely you are not. run (getcwd) and compare, then run (system "ls") .. till you are convinced this is the source of your problem (or proved me wrong, then I'll pay a pacj ok beers :) sneek: Okay. daviid: sneek: later tell mistmim did you run make check? did all check pass? because it checks if im-load works fine ... sneek: Okay. dustyweb: beep daviid: hello dustyweb! dustyweb: hi daviid amz3: sneek: later tell dhamidi use 'guix edit guile-bytestructures' sneek: Will do. amz3: o/ spk121: " dsmith-work: {appropriate time} Greetings, Guilers str1ngs: hello cmaloney: \\o OrangeShark: hello daviid: hello guilers! jeko: Hi Guilers ! dsmith-work: daviid: Greetings dsmith-work: daviid: Sorry I couldn't respond the other day. Day job keeps be busy and focused. daviid: dsmith-work: no problem daviid: I found that it was the usual lib depending on a lib not available problem ... dsmith-work: Heh. Or in the wrong place. Or finding the wrong version first. dsmith-work: ldd and strace to the rescue! daviid: but the user had both guix and debian guile, and wrong path, so libvigra_c was compiled using the guix tools, and for some reason the guile from debian was running, so it cold not find libjpeg ... jeko: Dears, I have trouble to set a project with multiple modules (written by myself) jeko: I have a gtd-txt module, which needs todo-txt module jeko: they are in the same directory jeko: (my project directory root) jeko: when I want to compile gtd-txt, I get : "ERROR: no code for module (cybo todo-txt)" rekado: ko: what does your GUILE_LOAD_PATH environment variable look like? rekado: jeko: ^ jeko: Is it right if I do an "echo $GUILE_LOAD_PATH" in cli ? rekado: yes jeko: Well....it is empty. rekado: okay. rekado: Guile looks for modules in directories that are listed in GUILE_LOAD_PATH jeko: Alright. I thought I had to put (use-module (cybo todo-txt)) and the magic should happen ^^" rekado: if you have a gtd-txt module and the name is “(gtd-txt)” then you need to add the directory containing the file “gtd-txt.scm” to GUILE_LOAD_PATH rekado: the same goes for “(cybo todo-txt)” – this should be a file cybo/todo-txt.scm jeko: exactly rekado: and the cybo directory should be in a directory that’s listed on GUILE_LOAD_PATH jeko: There are cybo/todo-txt.scm and cybo/gtd-txt.scm jeko: Ok cybo has to be set in guile load path jeko: Do I have to do it in the hard way like with env variables ? Or can I do it in a file (say the entry file of my software) ? daviid: jeko: look for that va name in the manual ... you'll find all possible ways to solve this daviid: *variable name jeko: daviid: Alright, will try some str1ngs: mwette: did you say you had a ffi gtk example? mwette: str1ngs: yes mwette: str1ngs: http://paste.debian.net/998814/ mwette: strings: git clone -b c99dev git://git.savannah.nongnu.org/nyacc.git mwette: str1ngs: work in progress str1ngs: wonder how hard it would be to use this with webkit str1ngs: ffi gtk2+ did you have to create gtk2+ module? mwette: I can't promise anything. You make it easier if you generate a got-h with only the calls and data structures you want to deal with. mwette: I write a dot-ffi file and use the ffi-helper to convert to dot-scm. mwette: The gtk2+.ffi file is 17 lines, the gtk2+.scm file is 92111 lines. str1ngs: ahh machine generated .. not bad then str1ngs: I'm just checking the pointers stuff str1ngs: also can you use glade templates with this offhand? mwette: Are those CPP macros? No then, I am wondering if is worth trying to deal with that. Converting CPP macros to SCM could get ugly. str1ngs: umm let str1ngs: let me check str1ngs: its use C macros to some extent yes str1ngs: normal gtk macros though str1ngs: https://bitbucket.org/strings/wemacs/src/7ec4a8f020966e62f81e45006d1b6c8ef8d41819/src/window.c?at=vanilla&fileviewer=file-view-default#window.c-318 str1ngs: just keep in mind this not even alpha code yet mb[m]1: manumanumanu: https://www.gnu.org/software/guile/news/gnu-guile-223-released.html mb[m]1: Though it links to the mailing list which still isn't scraped by mailman (I tried to link directly first). daviid: manumanumanu: you may also read the NEWS file online ... kristofer: hello! I'm currently trying to build guile 2.2.3 on guix. it is taking an extremely long time to run make check-TESTS amz3: héllo str1ngs: hello amz3: o/ str1ngs: amz3: were you working a guile web app thing? daviid: civodul: (or wingo ) would be nice to update the welcome messages on this channel so it says the latest version Guile 2.2.3 is out! and points to https://www.gnu.org/software/guile/news/gnu-guile-223-released.html wingo: daviid: tx for poke :) str1ngs: hmm how do I get autotools to find guile-config2.2 ? daviid: wingo: most welcome! thanks for the relase! str1ngs: autotools seems to look for guile-snarf and guile-config most of the time str1ngs: which does not play nicely with Parallel Installations amz3: str1ngs: I work on guile web stuff yes daviid: wingo: I hope you can find some time to patch guile so users would have a very easy way to ask/parameterize guile so both the repl and raising exceptions use truncated-print (lloda started to work on this, wip-truncated-print branch) amz3: str1ngs: why? str1ngs: amz3: are you aware of any guile libraries for html user interfaces? str1ngs: I'm trying to avoid as str1ngs: as much GTK as I can with my guile web browser str1ngs: I'm researching, what I can use for UX. the more guile scheme I can use the better IMHO mwette: Why not just make a guile api for webkitgtk? :) str1ngs: I thought of that. since I could use gnome guile. but frankly it seems like alot of work. for no real benefit str1ngs: I would have to create and support a gnome guile widget for gtk webkit. and frankly I would probably still need to resort to C str1ngs: right now I'm happy just providing scheme API's to the C bits where needed. mwette: I was kidding. I would have tried the FFI helper but webkit is in C++. str1ngs: gtk webkit is C daviid: str1ngs: why a web app anyway? daviid: ACTION is against webapp daviid: ACTION does not hide :) str1ngs: I dont want to make a webapp . I want to use html for some UI str1ngs: since this is essentially a web browser written in C and scheme. it's not a big deal daviid: str1ngs: use glade, then guile-gnome oads it mwette: I just downloaded https://webkitgtk.org/releases/webkitgtk-2.19.2 and that has tons of C++ code in it. mwette: ah str1ngs: I'm using glade, but I would need to make glade manifests for webkit str1ngs: gtk webkit is C mwette: You want to render HTML in a window? daviid: str1ngs: oh your are writing a web browser str1ngs: right, for some user feed back daviid: nerver mind then, I thought you were writing a 'traditional' app str1ngs: like I have a mini buffer. but I need to provide history completion stuff like that str1ngs: also the REPL is taken care off. I just use a VTE widget with emacs that connects to via geiser. str1ngs: it not ideal but works well str1ngs: anyways I was toying with the idea, of use webviews with html for UI when needed. but I'd like to possible use scheme if I can. I'm trying to avoid javascript and C as much as possible. amz3: str1ngs: you are looking for a backend framework for rendering html widgets? something like pyjamas or GWT? str1ngs: ya something like that amz3: str1ngs: well, if you don't need javascript, anyway, the html in guile is written using sxml amz3: str1ngs: but for doing autocompletion you will need javascript amz3: str1ngs: and guile-js is not ready amz3: I mean to say the browsers are not ready for guile-js amz3: to use guile-js you need a specific version of chromium with some flags, it's documented somewhere in the ML str1ngs: I'm using gtksourceview for input fields so it does not need to be javascript for completion str1ngs: but for user output I need uses something amz3: you can write scheme sxml and translate it to html with guile str1ngs: ah that sounds intresting str1ngs: https://www.gnu.org/software/guile/manual/html_node/SXML.html ? str1ngs: how do I convert from sxml to html with guile though? amz3: str1ngs: I use this helper https://github.com/a-guile-mind/culturia.one/blob/master/src/web/html.scm mwette: I see now. webkit-gtk has C api to webkit. Worth a shot w/ the ffi helper. daviid: amz3: how does that differ from davexunit sxml->html code? which is part of haunt I guess amz3: daviid: it adds support for script tag at least :) str1ngs: mwette: it's not worth using ffi for this amz3: which I needed for working with guile-js str1ngs: it's been easier to just write the gtk aspects in C daviid: amz3: it wold be nice to talk to davexunit then , and have one place we can recomend to users for this ... actually it could even become part of guile-lib amz3: yes mwette: str1ngs: I agree. Too much baggage getting pulled in. daviid: ACTION always tries to contribute rather then duplicate, we are such a small community... str1ngs: that and you need ffi for glib and gtk aspects str1ngs: I suspect later I will move to guile gnome if I can though daviid: amz3: please talk to him then :) mwette: I have ffi for glib, gobject, pango, gdk, gtk2 already. I got the hello world demo to work. str1ngs: yes but type conversions with ffi can be pita amz3: daviid: I already asked to add it to guile itself, I need to create some unit tests str1ngs: here I just use scm C primitives. and use SCM macros to provide the scheme API I want to expose to end users daviid: amz3: maintainers said they will add it? str1ngs: amz3: can I get away with sxml->xml for now? str1ngs: like the template example here. https://www.gnu.org/software/guile/manual/html_node/Web-Examples.html str1ngs: I might have to use GTK after all. since I'm not sure I can handle events without use JS str1ngs: ACTION curses javascript :P daviid: wingo: as expected, but for info anyway, guile-lib make; make check all fine using 2.2.3 daviid: wingo: guile-cairo make pass, but make check fails: https://paste.debian.net/998809/ daviid: g-wrap make; make check pass fine as well daviid: guile-gnome make; make check pass fine as well daviid: guile-clutter make; make check pass fine as well daviid: all in the green! I think guile-cairo make check error is not related to 2.2.3 specifically, I kind of remember having reported it in the past daviid: 2.2.3 compiler is a lot faster! str1ngs: I guess, guix is what most people use to install 3rd party guile libraries? catonano: str1ngs: as far as I understand the long term project is to make guix the package manager for guile based packages daviid: which name is potluck str1ngs: the problem I find with guix. seems a bit much for just guile packages str1ngs: and even though it runs in user space, you need root privileges to install and set it up. efraim: debian has guile2.0 packaged for armel (ARMv4t) but not guile2.2, did guile2.2 drop support for it? daviid: efraim: guile-2.2 is in buster (testing) efraim: daviid: right, but debian doesn't list armel as a supported architecture for guile-2.2 https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=guile-2 daviid: efraim: ah, that i don't know efraim: alright, thanks str1ngs: efraim: does it build manually? str1ngs: or does guile2.2 just not support armv4t I find that odd if it doesnt efraim: now that'd be something to test, i'm working on an RPi 1 with 256 MB of ram str1ngs: hmm might be slow to compile I guess efraim: https://buildd.debian.org/status/package.php?p=guile-2.2&suite=unstable str1ngs: I guess you could crossbuild but that's no walk in the park efraim: ah, change sid to buster and it appears efraim: so it looks like it does build daviid: is the guile-dsv authoor around? daviid: going afk, bbl mwette: compile times for (ffi glib), 32k lines: 2.2.2=>6m10s 2.2.3=>2m23s daviid`: sneek: later tell mistnim actually, I recommend you to keep guix and remove the guile version you have on you debian, then try again ... be sure to purge guile, not just uninstall it: 'aptitude purge guile' sneek: Okay. daviid`: sneek: later tell mistnim the guix approach is alot safer i the long run, and worth spend some time to make it work now ... also becuse the team is working on a new release, and that will hold the latest guile stable-2.2, which will boost your guile-cv experience by a couple of order of magnitudes sneek: Will do. daviid`: wingo: it would really be cool if you could look at and update/integrate lloda patch so raised exceptions do not try to print very long (to huge) lists, arrays, and srfi srfi-4 bytevectors... daviid`: wingo: and then to have a parameter, %use-truncated-print or something like that, so users can ask guile to use it, for both the repl and raised exacpetions, wether together or separately... if these too could be in the next release, that would be awesome! daviid`: till this happen, guile-cv is literally unusable (refering to users, not myself, lloda and other advanced users and/or developers ...) daviid`: wingo: here is lloda patch I'm talking about: http://git.savannah.gnu.org/cgit/guile.git/commit/?h=wip-exception-truncate&id=aa731e0c36650ddd8acb193b1dd23cd9a0fc15e4 mwette: wingo: +1 to not printing long bytevectors dustyweb: hi dustyweb: is there any way to define an object type that is not itself a procedure, but which can be called as a procedure? dustyweb: either in GOOPS or srfi-9 or really anything dustyweb: I thought there was but now I can't recall it dustyweb: something like python's __call__ special method davexunit: dustyweb: yes there is something davexunit: I haven't used it though... davexunit: the manual has something to say about it somewhere dustyweb: davexunit: there's kind of the inverse I know of, with procedure properties dustyweb: where a procedure can have properties... and I guess I could construct it from there, but I'd rather do the reverse dustyweb: have a structure which itself can be a procedure davexunit: goops uses this feature somehow dustyweb: oh really? davexunit: yeah davexunit: accessors dustyweb: davexunit: for which thing... generics? dustyweb: oh dustyweb: accessors davexunit: also that dustyweb: time to look at goops.scm dustyweb: oh yeah dustyweb: ok there's an applicable objects thing in here... dustyweb: ACTION looks more davexunit: yeah dustyweb: oh dustyweb: vtable-flag-applicable-vtable dustyweb: weird! davexunit: I feel like there is something else davexunit: some easier interface to this davexunit: but I'm having a hard time hunting it down dustyweb: maybe I should email the list dustyweb: seems like that's on the right track though davexunit: yeah on the right track dustyweb: oh huh dustyweb: I figured out how to do it in GOOPS dustyweb: it's mildly gnarly dustyweb: http://dpaste.com/10J3TPM davexunit: I was about to mention davexunit: that's what I was thinking of davexunit: looks like there just isn't a nice high-level interface fo rit davexunit: for it* dustyweb: hm ok! At least it's something :) ftknox: Anybody have a simple example of how to use gnutls-guile to make HTTPS requests? I read at https://www.gnu.org/software/guile/manual/html_node/Web-Client.html#Web-Client that this was the proper way to do HTTPS requests, but the link is broken. dustyweb: davexunit: thanks for the help :) dustyweb: I'm glad GOOPS could give me something to work with str1ngs: ftknox: http-get should be a goods starting point. is that link still broken for you? ftknox: str1ngs: So I can make non TLS/SSL requests just fine, but the API I want to interact with is only available over an HTTPS connection ftknox: the link that is broken is https://www.gnu.org/software/guile/manual/gnutls-guile/Guile-Preparations.html#Guile-Preparations str1ngs: it should inherently use gnu tls if https is requested. If I'm reading this right ftknox: hmm. Let me try again, maybe I'm just doing something dumb str1ngs: I think guile-tls is only needed if guile is not built with tls support. I could be reading that wrong though str1ngs: hmmm or maybe not, I guess it might use ffi str1ngs: ftknox: does your distro or OS provide a gnutls-guile package? ftknox: str1ngs: I'm using Debian Jessie. I'll check the repos str1ngs: debian generally has good guile package support IIRC ftknox: str1ngs: Yeah, there is a guile-gnutls package that I have already installed davexunit: dustyweb: np :) str1ngs: ftknox: do you get a tls exception? ftknox: str1ngs: no, I get a 400 response from the server of "You're speaking plain HTTP to an SSL-enabled server port.
\\n Instead use the HTTPS scheme to access this URL, please." str1ngs: and url is "https://foo.bar" ? ftknox: str1ngs: yep - three line POC at http://dpaste.com/2CHFCSV str1ngs: it should try to use guile tls if you pass https scheme ftknox: str1ngs: okay, I'll do some more digging. Maybe I've got something misconfigured somewhere str1ngs: what version of guile? str1ngs: I'm getting similar results as you with guile 2.0 str1ngs: my distro does not provide 2.2 guile tls package. so hard to test for 2.2 ftknox: str1ngs: I'm using guile 2.0.11 str1ngs: that could be why. IIRC the docs you linked would be for 2.2 ftknox: oh geez. Okay, I'll work on getting a newer guile on my machine ftknox: thanks for all your help strings! str1ngs: but guile 2.2 might have tls support built in str1ngs: does this link work for you https://gnutls.org/manual/gnutls-guile.html#Guile-Preparations ftknox: str1ngs: yes. I can see that link, and I get meaningful output from running (gnutls-version) str1ngs: https://www.gnu.org/software/guile/docs/docs-2.0/guile-ref/Web-Client.html#Web-Client str1ngs: does not have the same documentation str1ngs: I suspect, you'll want to use guile 2.2 for https scheme support ftknox: str1ngs: correct. Thanks for that! Happy hacking! ftknox: now I really need my kids to go to bed so I can monkey with this :) str1ngs: I'm not 100% sure though. I may need to build guile tls manually to test this. ftknox: str1ngs: let me try out guile 2.2 and see if that works, and I'll let you know what I find str1ngs: where are the source package for gnutls-guile str1ngs: or is it part of gnutls str1ngs: yes this is confusing. str1ngs: I think gnutls guile is configured through gnutls str1ngs: hmmpf gnutls seems to only look for guile-snarf and guile-config. does not find guile-snarf2.2 wingo: moin wingo: ACTION going to try to make a guile release today civodul: hello wingo! civodul: \\o/ wingo: morning civodul :) wingo: did you get a chance to see if the recent changes to guile improved guix pull time? civodul: no, not yet civodul: i'll give it a try wingo: i measure a 100% speedup at -O1 for that generated test file civodul: BTW note that python.scm has been shrunk significantly recently wingo: that's probably a good thing regardless. i am testing tho on that generated allocate-struct / struct-set! case you had tho civodul: ah, good wingo: civodul: i am thinking of punting on the gnulib update, wdyt civodul: yeah it's safer to leave it for later i guess civodul: and we haven't seen any issue with the current snapshot civodul: on my emit-bytecode bench (which compiles the big CPS), i get 22s instead of 54s wingo: that's better wingo: is that with -O1 or default options? civodul: and 1.0G of heap instead of 1.4G civodul: that's with %lightweight-optimizations as in (guix build compile), which corresponds to -O1 AIUI wingo: ACTION nod civodul: that is, only peval is enabled civodul: which doesn't matter anyway because i'm just looking at emit-bytecode :-) wingo: ah, heh right wingo: hmm, that means you miss out on the cps conversion improvments, no? wingo: or does your test do cps conversion inside the benchmark civodul: probably, so i guess i'm only seeing the slot allocation improvements? wingo: jsut wondering if you were reading in cps from disk, something you transformed before civodul: the test only times emit-bytecode civodul: lemme try wingo: if the cps is newly transformed then you are also seeing the benefits there; there should be fewer conts, fewer terms, etc wingo: that's the real benefit of the cps conversion improvements: the result is a smaller term than before. civodul: oh, ok civodul: so yeah, this is not a representative bench wingo: you are reading in some pre-transformed cps from disk? civodul: yes wingo: ah wingo: good wingo: curious to see improvements with a newly transformed file :) civodul: i'm trying "guild compile -O1 python.scm" wingo: now that python.scm is not as long as it was, it's a less good benchmark, but yeah wingo: anyway closer to the result we want :) wingo: note that i just pushed one more incremental improvement an hour ago or so wingo: should shave off another 5-10% depending on the file civodul: that goes from 43s to 17s, which is nice :-) wingo: it is a good improvement, even if not yet nice :) civodul: hehe civodul: i pulled minutes ago so i should have the latest and greatest wingo: great wingo: well, maybe this will stave off angry guix users for a while wingo: and developers ;) civodul: :-) wingo: any idea about memory for the python.scm compilation? i guess those numbers are harder to get civodul: yes, that's what i was trying to get civodul: maxresident reported by time(1) goes from 700M to 326M, and that seems to match what i see in 'top' civodul: (again "guild compile -O1 python.scm") wingo: that's good too civodul: yep civodul: presumably that's largely because the CPS graph has fewer nodes, right? wingo: yes civodul: nice wingo: also because of not computing SCCs in slot allocation for the big wrapper function wingo: but mostly because of reduced graph size civodul: yes civodul: that's the "Avoid generating arity-adapting continuations if not needed" commit, right? civodul: which reduces the graph size wingo: civodul: that one and the following one, yes civodul: oh i was missing the following one civodul: ok, i'll see after lunch :-) wingo: :-) wingo: ACTION builds tarball wingo: distcheck is a lot less painful given prebuilt :P wingo: yarrrrrr wingo: guile-2.2.3/build-aux/ltmain.sh:#!/gnu/store/58nhnjff2yahyxa1yjh2m8k93fb955z5-bash-4.4.12/bin/sh wingo: error: store file names embedded in the distribution wingo: happened again, wtf wingo: how is still a thing in guix??? wingo: ============================================= wingo: guile-2.2.3 archives ready for distribution: wingo: guile-2.2.3.tar.gz wingo: guile-2.2.3.tar.lz wingo: guile-2.2.3.tar.xz wingo: ============================================= wingo: what i don't know is if savannah has my new gpg key stis: sneek where is buggs stis: neek botsnack stis: sneek botsnack sneek: :) stis: sneek: where is bugs stis: hey wingo: I found a compiler bug I think for 2.2. How do I report it? stis: GNU Guile 2.2.2.5-96c9 stis: neek: buggs stis: sneek: buggs stis: sneek: where is bugs stis: found it :) wingo: stis: mail to bug-guile@gnu.org stis: done, a bug that might interest you as it is for 2.2 and is a seams to be a compiler bug if not already fixed civodul: wingo: woohoo! wingo: civodul: just updated my gpg key on savannah, am trying to upload again wingo: otherwise the web site is updated, i just need to send a mail to the list once the files are there civodul: wingo: the FTP upload procedure is disconnected from Savannah civodul: info "(maintain) Automated Upload Registration" wingo: i thought the gpg keys on savannah were used to verify the uploads? civodul: it seems not civodul: "Should you later have to update your GPG key, you'll have to re-submit it to both Savannah and , as these systems are not connected." civodul: wingo: ah civodul: hopefully that'll be quick as it's daytime now in Boston wingo: humm, no response yet :P civodul: bah, that's frustrating wingo: i can put the tarball somewhere if you need to get guix builds going wingo: https://wingolog.org/priv/guile-2.2.3.tar.xz and https://wingolog.org/priv/guile-2.2.3.tar.xz.sig wingo: i could of course upload using a signature from the revoked key but that would not be good :) civodul: indeed :-) civodul: we can at least upgrade in core-updates civodul: for master we have to check civodul: well we can at least provide the new version in addition to 2.2.2, and update entirely later civodul: ACTION builds on master wingo: i am in the process of uploading .gz and .lz files to that same place, but i guess guix will just take the .xz civodul: yes wingo: bah still no response civodul: it's built! \\o/ civodul: phase `build' succeeded after 3640.8 seconds civodul: that's ~1 hours, whereas it used to be ~3 hours on the same laptop i think civodul: at least according to a comment i left in (gnu packages guile) :-) wingo: civodul: that sounds promising :) civodul: yup civodul: ACTION feels good today :-) wingo: hahaha :) wingo: oh good the sysadmins are taking care of the key issue civodul: neat jamesrichardson: Hello, I would like to use sqlite from guile. I see there is a guile-sqlite3 and a guile-dbd-sqlite. Is one or the other considered more stable/feature complete? jamesrichardson: Both are in guix, neither are in Debian. civodul: jamesrichardson: i'd suggest guile-sqlite3, which has received more attention i think jamesrichardson: Thanks. I'll start with that one. wingo: uploading tarball, woo wingo: woo it's happening civodul: yay! wingo: release all done! civodul: wingo: thanks & congrats! :-) wingo: it is a relief :) civodul: https://www.gnu.org/software/guile/news/gnu-guile-223-released.html \\o/ dsmith-work: Happy Friday, Guilers!! wigust_: \\o/ https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob_plain;f=NEWS;hb=edd97279350cf0da7f2cf662a4c1dc50cbe079a1 civodul: there are two uses of %fresh-auto-compile in Guix, and both were lucky that fresh-auto-compilation didn't happen bavier: how about that patch to update guile's "download" page? ftknox: str1ngs: So I moved to Debian Sid and guile 2.2, then rebuilt gnutls and now I get a new error from the POC that I shared last night ftknox: str1ngs: nevermind, I had a dumb typo. tl;dr: moving to guile 2.2 fixed my TLS issue!! cmaloney: https://www.gnu.org/software/guile/download/ <- May the site be updated? :) str1ngs: ftknox: that's good to know. I had an issue manually building gnutls with guile 2.2 str1ngs: autotool find /bin/guile which is 2.0 it won't find guile-snarf2.2 for w/e reason. ftknox: str1ngs: odd. ftknox: now I just need to figure out how to add an Authorization header to my request and I'll be all set str1ngs: I'll need to revisit this guile-snarf issue at some point. Since I have a personal project that has similar issues discovering what guile-snarf to use. janneke: yay, guile-2.2.3 \\o/ ftknox: got it working!! woo hoo!! str1ngs: nice manumanumanu: Neat! Any release notes? C wingo: i have another little compiler speedup; cse on big files was taking quadratic time ArneBab: that's a *little* speedup? Did you already check the impact? wingo: yes, it can be large, depends on the file size ArneBab: Nice! I assume that this might strongly reduce the long compilation times some people reported here when using lots of macros with large inline code. mistnim: I set the LD_LIBRARY_PATH to the dir where I have the .so file but I still can't dynamic-link to it. Why could it be? mistnim: I get #f get-env civodul: wingo: ooh, nice wingo: ok just measured. with 2.2.2, -O1 compile time on the file generated in https://lists.gnu.org/archive/html/guile-devel/2017-05/msg00033.html is 26.5s. with stable-2.2, it's 18.6 wingo: with 2.2.2, -O2 compile time on that file is 147.2s (!!!). with stable-2.2, it's 32.1s wingo: naturally the cse changes don't affect -O1 compile time; i assume a bit of the difference is the change to slot-allocation yesterday, and a bit is the weak table stuff from earlier this month civodul: nice! wingo: i think we could improve -O1 time further by somehow disabling the lazy vars optimization for -O1 compiles. if i simply replace compute-lazy-vars by a shortcut that returns empty-intset, that goes down to 14.9s civodul: so -O1 enables CSE? wingo: no, -O2 enables CSE civodul: ok wingo: i guess we need to make a 2.2.3 nowish :) civodul: cool, right in time for core-updates! civodul: IIUC, disabling lazy vars means that some variables would be live longer than necessary civodul: pretty much like in 2.0 civodul: is that correct? wingo: no -- the issue is that there would be more shuffling around calls civodul: oh, i see wingo: the lazy vars optimization attempts to make it so that a variable gets allocated right into the place where a call will need it as an argument wingo: it's a form of pre-coloring civodul: ok wingo: without the optimization, the var will have to be copied up or possibly shuffled into place for a call wingo: not so bad in the end of course :P civodul: yeah civodul: well i suppose this could always be turned off at -O0 civodul: or is it already the case? wingo: no, optimization levels don't affect slot allocation strategy currently wingo: so the optimization is always on. currently the only diff between -O0 and -O1 is that O1 runs peval civodul: ok wingo: i think anyway civodul: so the question is whether to remove lazy vars in the "dumb" allocator that you added wingo: i didn't really add a new allocator wingo: just a different implementation of one piece of it for functions without back-edges (loops) wingo: no need to compute SCCs in that case civodul: ah ok civodul: i just did a 'git pull' so i can understand better now :-) wingo: numbers on master for compiling that file are slightly higher (19.2s at -O1 / 34.9s at -O2) but otherwise in line; i think i am ok with that right now civodul: in an ideal world it could take a couple of seconds at -O0, but i understand that's easier said than done civodul: did you check whether this affects heap usage? wingo: mmm, the cse change should not affect heap usage. wingo: the scc change may improve things but i don't have solid numbers civodul: ok OrangeShark: hello everyone dsmith-work: Morning Greetings, Guilers cmaloney: morniing wingo: civodul: pushed something to 2.2 and master to allow the lazy vars optimization to be disabled under -O1 / -O0 wingo: compile time for that test file down to 14.4s fwiw wingo: rekado: when you ran your compressability tests on .go files, were those files compiled with optimizations or no? ArneBab: wingo: sounds great! rekado: wingo: they were built with something equivalent to -O0, but with partial evaluation, according to guix/build/compile.scm wingo: sneek: later tell rekado: sounds like equiv of -O1. anyway yes there is a lot of duplication there, am working on avoiding producing some of the more egregious bits sneek: Got it. civodul: wingo: awesome, thanks a lot! civodul: rekado: compressability tests? civodul: maybe we need a THUMB mode for the Guile VM ;-) wingo: ah, got it down to 11.7s... getting somewhere daviid: hello guilers! sneek: daviid, you have 1 message. sneek: daviid, lloda says: the code I pasted doesn't allocate anything on the C side. It's also shorter overall. Still, your choice! daviid: mistnim: if all thesesteps you reported in the email about dynamic-link "libvigra_c" are correct, it is highly probably that the cause is another unavailable lib upon which libvigra_c depends ... this, by the way, is a 'guile' related problem (in this case it probably is a lack of otherlib problem), not a guile-cv problem daviid: then to track that you should try 'ldd libvigra_c.so' and look if everything is 'found' daviid: you can also use strace ftknox: does anybody know of a good simple example on how to make a HTTPS request using guile? I know that I have to use GnuTLS-guile to bridge between a TLS socket and a Scheme I/O socket, but I cannot seem to figure out how to piece the parts all together mistnim: daviid, you are right, it says it doesn't libjpeg although libjpeg-dev is installed on my debian mistnim: it doesn't find* daviid: mistnim: try 'aptitude purge libjpeg-dev', the 'apt-get install libjpeg-dev ' again (just to eliminate the low propabiblity that something went wrong in the preceding install) mistnim: daviid, done, still not found daviid: hum, weird, anyone has an idea what could cause this? daviid: mistnim: could you try to make clean and make libvigra_c again daviid: and carefully read the output, you probably missed some in the first place mistnim: daviid, I can say that ldd says it is looking for a libjpeg.so.9, but I don't have that file named exactly that way in /usr/lib mistnim: just libjpeg.so, not sure if it matters mistnim: ok daviid: try to recompile libvigra_c daviid: after the above reinstall steps on debian daviid: here ldd report it found libjpeg.so.62 => /usr/lib/x86_64-linux-gnu/libjpeg.so.62 (0x00007f0eeb0e5000) daviid: I am surprised yur lok for libjpeg.so.9, since you are on strech and I am on buster mistnim: recompiling didn't help, make install says this though, not sure if it matters: Set runtime path of "/usr/local/lib/libvigra_c.so" to "" mistnim: I have libjpeg.so.62 too in /usr/lib daviid: in /usr/lib ? that does not sound a proper location mistnim: sorry, I mean somewhere in /usr/lib not precisely there daviid: don't know about th runtime path question you asked, maybe someoneo ere knows ... help welcome daviid: mistnim: ah ok, let's be precise :), the it should find it, daviid: run ldd on the newly installed to check mistnim: it doesn't mistnim: yes I also have it in /usr/lib/x86_64-linux-gnu/libjpeg.so.62 daviid: could you paste the line daviid: you see, it tries to look for another libjpeg lib daviid: that is the problem daviid: and I don't know why, anyone here has an idea? dsmith-work maybe? mistnim: could having guix installed be an issue? daviid: mistnim: could you try to ask on #debian daviid: irc.debian.org, channel #debian mistnim: ok daviid: mistnim: also, try 'dpkg -l | grep libjpeg' and see if there are any suspicious libjpeg there, how come you have a .9 version is a mistery ... mistnim: daviid, https://paste.debian.net/998412/ daviid: mistnim: I'm on #debian thanks (just connected to see if someone aswers ..) daviid: mistnim: hum, would it be you miss one daviid: here, in addition to the one you list, I also have daviid: libjpeg8:amd64 8d1-2 daviid: see the #debian answer as well... mistnim: dynamic linking is quite arcane daviid: mistnim: try 'apt-get install libjpeg8', clean and make libvigra_c again (see the option you need to pass in guile-cv INSTALL recommendations and let's see if that slves the problem daviid: your cmake does not report any error, right? mistnim: only the lack of doxygen daviid: error/warnings, it fins Vigra and all other things it needs daviid: that is ok mistnim: there is no libjpeg8 here mistnim: nor it could be found daviid: ah, run aptitude and search for libjpeg ... daviid: yur version is prob ineriror to the buster one mistnim: there isn't mistnim: there is a libjpeg-dev package daviid: that you installed already, ok daviid: try strace mistnim: daviid, I don't know how to use strace mistnim: what should I do? mistnim: strace libvigra_c.so reports permission denied of something daviid: mistnim: no, let me find an example mistnim: otherwise I'll just try to upgrade to buster daviid: strace -o strace.out guile -c "(dynamic-link \\"libvigra_c\\")" daviid: i don't think you should upgrade to buster because of that daviid: you have a weird installation, no package should try to refer to ibjpeg9, that version does not exists... mistnim: https://paste.debian.net/998418/ daviid: paste it on #debian daviid: oh no mistnim: format and install buster from zero then daviid: the error you just paste is a guile error mistnim: it's quite an old installation anyway, I installed it when stretch was still testing daviid: also, guile fails to install your locale daviid: mistnim: you should try to solve this first mistnim: daviid, the locale doesn't matter daviid: your strace report reports another error, mistnim: that is given when I run guile from guix, but even if I run the original guile2.0 from debian I get the file missing of libvigra_c mistnim: I installed guix today too daviid: ok, not sure what causes the system to look for .9 libjpeg version, which is worth trying to solve daviid: it could be the guix version does not have libjpeg? don't know daviid: no forget about that, the problem is ldd reports it looks for a lib that does not exists daviid: you should insist on #debian maybe? daviid: if you have guix installed, could you find the guix libjpeg and run ldd there mistnim: what should I run ldd with? mistnim: mmh interesting mistnim: the libjpeg version inside guix is .9 mistnim: we have a suspect daviid: i was almost sure of something like that daviid: you should talk on #guix and ask how to maintain compile lib on debian when guix is installed ... now you have 2 guile as well ... and your PATH are incorrect (all related PATH var...) I think daviid: yu could 'purge' guix and try again, to save time ... mistnim: I shouldn't have messed with guix mistnim: I'll try something else tomorrow, now I have to go, bye daviid: lloda: I kept a copy of your example locally, for later use if I need... the thing is that I don't know (next to nothing) libguile, hence I can read it but I could not write any, without studying ... where as pure C code, for these snipsets, are so 'clean', and I can ask for help on ##c ... sincerely, I really don't see any advanytages of using libguile here, but again, many thanks for your help and this example. happy_gnu[m]: hello happy_gnu[m]: when I do happy_gnu[m]: (http-get some-url) happy_gnu[m]: if I call it in the REPL I get headers and body happy_gnu[m]: (I am trying to do an IRC bot with 8sync, that will look up at a wikipedia page, when you tell the bot to, with something like "irc-bot: wikipedia gnu" and the bot will look at that wikipedia page using wikimedia API, get the xml and give me the first paragraph or something) happy_gnu[m]: So I am trying to use http-get to get the xml as indicated by wikimedia API, (http-get some-url) works from RELP and gives me all the xml and headers, but if I try to define it, I only get headers happy_gnu[m]: I was suggested to use (call-with values (http-get ....)) but is not good either happy_gnu[m]: if I do (define text (http-get some-url)) I get headers and then it says port was closed happy_gnu[m]: port: #> happy_gnu[m]: how can I get the xml or json outside the REPL and put it in a definiton or a file or something else ? happy_gnu[m]: here is an example webpage I am trying to get happy_gnu[m]: https://en.wikipedia.org/w/api.php?action=query&titles=Linux&prop=revisions&rvprop=content&format=xml sirgazil: happy_gnu[m]: Maybe try receive: https://paste.gnome.org/ppwdp6kvr sirgazil: happy_gnu[m]: See section 6.13.7 Returning and Accepting Multiple Values in the manual for more info. str1ngs: /msg nicserv help str1ngs: opps amz3: héllo #guile OrangeShark: hello amz3 dsmith-work: Wednesday Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) bavier: hi dsmith-work amz3: hi OrangeShark: I want to get better at using emacs OrangeShark: was reading some of the emacs source code, it actually looks pretty similar to libguile ArneBab_: OrangeShark: do you know emacs rocks and mastering emacs? http://emacsrocks.com/ https://www.masteringemacs.org/ OrangeShark: ArneBab_: I bought mastering emacs on Monday and started reading it :) ArneBab_: nice! happy hacking then :) OrangeShark: ArneBab_: thanks :) happy_gnu[m]: sirgazil: hi!! happy_gnu[m]: thank you so much :) happy_gnu[m]: bot is working now!! sirgazil: Yay! :) happy_gnu[m]: it needs to be polished though, but it answers now :D happy_gnu[m]: you can talk with puppy-bot on #lgn happy_gnu[m]: if you want to try it :D sirgazil: Let's see... sirgazil: happy_gnu[m]: The puppy just pee on my shoes :) happy_gnu[m]: sirgazil: si es mala nvidia :/ happy_gnu[m]: sirgazil: sorry I had a little problem at home :) happy_gnu[m]: we are playing warzone 2010 happy_gnu[m]: 2100* happy_gnu[m]: sirgazil: muchas gracias de verdad :D sirgazil: happy_gnu[m]: con mucho susto :D rekado: OrangeShark: mastering emacs is very good. I wished I had it on my first two attempts to get started with Emacs. wingo: good morning everyone:) lloda: morning civodul: heya wingo! wingo: ACTION will work on the slot-allocation issue later this week civodul: wingo: great! bavier: I'm not so familiar with port and file encodings; does anyone know what might cause test-suite-standalone/test-command-line-encoding2 to fail with 'ERROR: In procedure open_iconv_descriptors: invalid or unknown character encoding "I"' janneke: wingo: like to have a chat/email exchange about bootstrapping some time janneke: specifically what scheme to use in the early bootstrap process, the [im]possibilities [dis]advantages of making a minimal-bootstrap-Guile lloda: sneek: later tell daviid the code I pasted doesn't allocate anything on the C side. It's also shorter overall. Still, your choice! sneek: Will do. thomassgn: in emacs w/ geiser what is the easiest way of adding a breakpoint to some source location? Looked at 'add-trap-at-...' but there has to be a simpler way. (also, I can't get the trap functions to work, errors out) mwette: convention in unix/c is to return 0 on success (and often -1 on error) daviid: mwette: thank you daviid: lloda: thanks. I see, but quite honestly, I actually (much) prefer the approach I came up with, since the code is a lot shorter, cleaner imo, with no alloc at all on the C side ... but again, thanks for your ideas and example. The only convcern I had was to grab the pointer address size at run time, which I beleive I solved with this snipset daviid: size_t pointer_address_size_c () daviid: { daviid: size_t n = sizeof(float *) * CHAR_BIT; daviid: daviid: return n; daviid: } daviid: daviid: mwette: is size_t any diff from int in C? mwette: daviid: can be daviid: ok, I'll stick to it then mwette: on my mac/x86_64, sizeof(int)=4, sizeof(size_t)=8 daviid: thanks for this clarification happy_gnu[m]: hello happy_gnu[m]: I don't understand how to use http-get happy_gnu[m]: https://www.gnu.org/software/guile/manual/html_node/Web-Client.html#Web-Client happy_gnu[m]: if i do (http-get "http://en.wikipeda.org") happy_gnu[m]: I get happy_gnu[m]: ERROR: ERROR: Wrong type to apply: "en.wikipedia.org" daviid: it seams this is not a valid http address happy_gnu[m]: but what is a valid address? :/ daviid: i get an error trying to open the site in a browser ... I get http-get ) with no error ... daviid: scheme@(guile-user)> (http-get "http://en.wikipeda.org") daviid: ERROR: In procedure getaddrinfo: daviid: ERROR: In procedure getaddrinfo: Name or service not known daviid: daviid: try another site ... daviid: I'm not (by no ean) an http guy by the way, just trying to help ... happy_gnu[m]: I know daviid :) daviid: so, try another site happy_gnu[m]: I did with gnu.org happy_gnu[m]: I get the same error :/ happy_gnu[m]: (http-get "http://gnu.org")ERROR: ERROR: Wrong type to apply: "gnu.org" daviid: scheme@(guile-user)> (http-get "http://www.altosw.be") daviid: $8 = #< version: (1 . 1) code: 200 reason-phrase: "OK" headers: ((date .…> daviid: $9 = " cbaines: Is there a way to get some more specific information about where the error occured? mwette: try "guild compile -O0" on the file then run amz3`: fwiw the code of culturia is @ https://github.com/a-guile-mind/culturia.one/commits/master amz3`: sneek: what is culturia sneek: Its been said that culturia is a search engine cbaines: mwette, thanks, I ended up running the code directly from the REPL, which seemed to give a better backtrace janneke: do we have a guile-2.2 specific cond-expand? janneke: ACTION is having troubles with disabling an ellipsis macro for 2.0 only janneke: b janneke: hmm, it seems i cannot disable with-ellipsis test for guile-2.0 :-( janneke: no guile-2-2 cond-expand civodul: janneke: is "guile-2.2" civodul: *it's janneke: a string, where guile-2 is a symbol? janneke: ah, the dot janneke: civodul: perfect! civodul: :-) janneke: removed ugly sh scripting again and better psyntax with/without ellipsis test for mes :-) manumanumanu: ArneBab: Maybe. I'd have to port it to use srfi-style keywords and make sure it is rather portable, but the other schemes I is chicken and chez. Chicken doesn't hate syntax-case and chez lacks keywords. manumanumanu: and it is written with a close eye to the output of guile's optimizer. manumanumanu: that was the hardest work manumanumanu: and implementing the for-loops is non-trivial, so I would like to provide a portable version before doing that. Which I don't have much time for ArneBab: manumanumanu: portability is no requirement, the requirement is a clear specification. ArneBab: manumanumanu: and *one* implementation manumanumanu: Well, if I made a srfi, I would like for people to use it. Since it is finkly to get right, I'd like to provide a portable implementation manumanumanu: and I don't really trust my speccing skills :) ArneBab: I think that’s a good thing, but if you don’t have time for it, creating a SRFI with a non-portable implementation makes it viable for others to implement their own specialized version ArneBab: (good thing: like to provide portable, want use) ArneBab: I’d love to be able to say speccing is not that hard, but that wouldn’t be correct ☺ manumanumanu: It builds heavily on the ideas of srfi-42 though, so I could borrow a bit from there ArneBab: yepp ArneBab: and it provides a usage-pattern which is well-known from other languages ArneBab: highly optimized (which is cool!) manumanumanu: The thing is, it is kind of borked as a framework compared to the racket ones. The racket macros handle wrapping and stuff, making definitions of new looping constructs and sequence types a lot more flexible. Like it is now, I can't make an (in-generator g) because in-generator cannot know when the generator is finished. manumanumanu: in racket you could make [i (in-generator g)] expand to [i (in-generator g)] #:break (eof-object? i) manumanumanu: not having it reduces complexity and makes macro expansion a bit faster, but it is still something I would like to provide before actually labeling it 1.0 manumanumanu: unless the generator srfi (125?) is extended with optional arguments to know whether a generator is finished or not ArneBab: that sounds like something which could be useful manumanumanu: yeah. defining a new looping construct in racket is simple, and you can do it without having to fiddle around with matching. You just specify an argument wrap procedure, and a return value wrap procedure and something else I don't understand manumanumanu: and it works. manumanumanu: but I haven't figured out how to do it without incurring a huge cost. the racket way depeds on the jit to remove a lot of overhead manumanumanu: hmmm... maybe I could let the inliner do most of it... manumanumanu: ArneBab: The sad thing is that I can't do much without making it a lot more complicated. manumanumanu: The racket for loops source is 4 times the size of mine, with less comments. The thing it provides is mostly convenience, but it also makes for some elegant things like post-guards (where I only have #:final). My in-value is borked because of that, whereas they just provide a post-guard (lambda _ #f). ArneBab: manumanumanu: than yours might just be better manumanumanu: ArneBab: Well. I like mine a lot, but having post-guards would let me do all kinds of funny things, like a proper in-value manumanumanu: and for post-guards I can have wrapping, which would let me clean up how I define for variants manumanumanu: which would make it fit for a srfi :) manumanumanu: and wrapping would make in-generator simple, and would let me support generator-based lazy lists (whichever srfi number that has) manumanumanu: and the best part is, I think I can get the inliner to handle some of the wrapping for me amz3: hello all! str1ngs: hello! catonano: ehy amz3 I wanted to thank you for adopting te autotools in guile-wiredtiger and so allowing it to be packaged in Guix amz3: catonano: yw catonano: I don't use it anymore but I lie to see guile libs stabilizing in guix str1ngs: oh god don't mention autotools right now str1ngs: I just spent 2 1/2 days making my project autotools complaint. and I still don't think it's done right catonano: str1ngs: what's your project ? str1ngs: web browser, written in C and guile catonano: wow catonano: has it a name ? str1ngs: it's no finished yet. str1ngs: right now I'm calling wemacs str1ngs: but that might change. here's a screenshot https://str1ngs.imgur.com/all/ str1ngs: the screenshot is one window the REPL is built in str1ngs: sorry https://imgur.com/bGQoUy1 is a better link amz3: here is a screenshot of mine https://screenshots.firefox.com/oNTRUhN0tzf7huii/localhost amz3: same theme as usual :) str1ngs: guile-web is web framework? amz3: sort of str1ngs: or web portal maybe? amz3: no no, it's more like a template to start new web projects in guile str1ngs: ah gotcha str1ngs: sounds intresting amz3: it missing a way to handle uploads amz3: and documentation amz3: basically you git clone the repo change the remote and your are good to start a project catonano: str1ngs: neat !! catonano: I now that the autotools can be frustrating. But having a project in Guix is a plus, in my view ! Happy hacking ! catonano: i Know, sorry my keyboard... catonano: what is a VTE widget ? str1ngs: vte is terminal widget. str1ngs: it's what things like gnome-terminal use str1ngs: in my screenshot I'm using vte to host emacs, which connects to the browser repl using geiser catonano: str1ngs: I see. Cool ! Good luc with the autotools ! str1ngs: catonano: I think I have it roughly sorted out. just worried about support many versions of guile catonano: str1ngs: I see. But you're in the right place to askk or guile support ;-) amz3: re OrangeShark: hello everyome OrangeShark: everyone dustyweb: hm dustyweb: finalizers are only available to C code I guess? dustyweb: it would be nice if I could add finalizers to guile objects for the sake of writing a distributed garbage collection system for 8sync mwette: guardians? dustyweb: I thought guardians were to stop something from being gc'ed? dustyweb: do they also let you run something when they would have been gc'ed? dustyweb: oh dustyweb: they are for cleanup dustyweb: thanks mwette mwette: from the manual: "A guardian protects a set of objects from garbage collection, allowing a program to apply cleanup or other actions." dustyweb: yeah dustyweb: mwette: cool, thanks.. turns out this is what I wanted :) artyom-poptsov1: Guilers, to my amusement I just discovered in Guile 2.0.14 that overloading 'equals?' method in GOOPS allows to compare custom objects in the same manner as existing ones. artyom-poptsov1: I think this feature does not mentioned in the GOOPS part of the manual, or I just failed to find it. artyom-poptsov1: s/does not mentioned/is not mentioned/ artyom-poptsov1: But overloading 'equal?' seems to be more convenient than rolling out a custom predicate for sure. str1ngs: hmm I thought guile added /usr/local/ etc to load-path as well str1ngs: eg /usr/local/share/guile/site/2.2 daviid: what is the convention, among C programmers, for int returned value when the function runs fine? I used 1, but it seems many use 0? sneek: daviid, you have 3 messages. sneek: daviid, lloda says: something like this, not tested https://paste.debian.net/996997/ sneek: daviid, lloda says: might need to declare channels as void* and cast it sneek: daviid, lloda says: it's kind of weird to mix the ffi and oldschool libguile like this, if you're writing the C I'd declare all the C args as SCM and do the conversions on that side amz3: héllo artyom-poptsov1: Hello, amz3! manumanumanu: Morning guilers! str1ngs: god these autoconf macro's are driving me bonkers str1ngs: GUILE_PROGS gets all confused if I use GUILE_PKG str1ngs: actually GUILE_PROGS get confused . if I have /bin/guile and /bin/guile2.2 it will find guile 2.2 headers but then complain that /bin/guile is not version 2.2 str1ngs: actually GUILE_PROGS seems potentially broken. since the documentation state is should check for preffix -X.Y first anyways. str1ngs: atleast that's how I'm reading https://www.gnu.org/software/guile/manual/html_node/Autoconf-Macros.html str1ngs: or... aclocal is using the wrong guile.m4 str1ngs: well manually adding guile2.2.m4 seems to fix it str1ngs: so I think the issue is I don't understand autotools enough :( mistnim: Hi, is the guile-gnome library used? The documentation doesn't look very welcoming str1ngs: mistnim: the git repo looks like it's still active mistnim: what would you use to make a gui? str1ngs: I'm in the middle of writing a guile guile program but I opted for GTK. but in C str1ngs: err guile gui program* str1ngs: but the reason I used C is I'm using webkit and some other widgets str1ngs: I think guile gnome is worth checking out if you don't need anything fancy under the hood. amz3: mistnim: what do you want to do? amz3: mistnim: don't be shy :) amz3: str1ngs: sorry, I can't help with autotools, I am more than newbie in this regard amz3: I finished re-coding the indexing part of my search engine amz3: which is almost fully tested now amz3: Now I need to adapt the querying part amz3: also I started to scrape wikipedia and it's verrrrrrry long mistnim: amz3, I was thinking of a an app to track the diet. The other open source alternatives don't look that good to me amz3: mistnim: why not create a web app then? amz3: mistnim: also I have plenty of free time, I could help with your project mistnim: amz3, there are many options already, the idea is to make an app for people who don't want to send their data to the cloud amz3: mistnim: it's not a problem you can create a web app that runs locally mistnim: amz3, that nice of you mistnim: amz3, I understand what you mean, that's an option amz3: nowdays everything is done as a web app amz3: that said, I don't think about a thing like electron mistnim: yes, you mean just a server you need to start and then connection to localhost mistnim: with the browser, right? amz3: which does embed a browser in the app, it's more like the user start an app which will both spawn a browser at the correct url and server on localhost amz3: yes amz3: mistnim: that said is an example of guile gnome powered app https://www.gnu.org/software/foliot/screenshots.html amz3: the proof is there is an example gtk application amz3: but there is no GNU project that use guile as web app mistnim: I was also intrigued by the idea of a tool for making the docs from docstrings amz3: that said I made several, just they are not GNU amz3: mistnim: you are the person asking for project ideas on the ML? mistnim: amz3, yes amz3: ok mistnim: I haven't decided yet :/ amz3: because I was going to send another batch of ideas amz3: mistnim: do you know lucene/solr/elasticsearch java software? mistnim: amz3, nope amz3: oh amz3: those are libraries/http server that embedded a search engine amz3: basically it's a stack lucene is the library and elastic search is the http server which use lucene-solr to implement a search engine amz3: sneek: what is culturia? sneek: I could be wrong, but culturia is a re-search project amz3: sneek: what is culturia? sneek: From what I understand, culturia is a re-search project amz3: well mistnim: amz3, a search engine for what? mistnim: something like google and ddg? amz3: mistnim: well, my end far fetched goal is to implement a concept search engine amz3: sneek: a concept search engine is a search engine that takes into account concepts https://en.wikipedia.org/wiki/Concept_search sneek: Okay. amz3: mistnim: somewhat yes amz3: I want to make it a GNU project, but it much too early str1ngs: I'm writing a web browser in guile mistnim: amz3, have you already started? amz3: I used to have a demo but it's down because I changed my server and I am too lazy to setup back the app... mistnim: str1ngs, from scratch? str1ngs: yes amz3: str1ngs: fun! mistnim: str1ngs, with a gui or console? str1ngs: gui mistnim: woah amz3: (you never implement something from scratch nowdays...) str1ngs: has a repl and everthing str1ngs: well the html rendering is done by webkit amz3: str1ngs: do you implement layout algorithm like grid layout or flexbox? do you handle line continuation for text in justify text-align? amz3: str1ngs: oh amz3: ok amz3: str1ngs: so it's a browser with an repl amz3: str1ngs: that will be fun amz3: str1ngs: you know what I miss from browsers, is deep integration with platforms amz3: web platforms that is amz3: like GNU Social, mastodon, QA platforms like Quora or StackOverflow amz3: you basically can't decide how true is some profil on those platforms without diving into hundreds of messages and their bio is short phrasing that wanna be catchy amz3: my plain was to create some summarizers for web pages amz3: text summarizer amz3: did you know that AI assistant can't summarize a text for you? amz3: it's a missing feature from AI. str1ngs: here's a screenshot of the browser https://imgur.com/a/Zsazr mistnim: there are reddit bots that summarize pages amz3: mistnim: oh really? let me know what username it is mistnim: amz3, I have no idea, I just see its posts from time to time, the get very upvoted amz3: never saw them str1ngs: amz3: with this extensible browser you could do alot of intergration amz3: str1ngs: can you interact with the page like change css on mouse over an element? str1ngs: eventually yes, just not quite yet amz3: or capture the text that is selected? amz3: display the title also str1ngs: right now I'm focused on C to scheme API mistnim: amz3, what do you think of an app like readlang.com? str1ngs: amz3 yes all that is possible mistnim: there is no open source alternative as far as I know amz3: mistnim: I trying it amz3: mistnim: I did not know about that app mistnim: in short to learn a language without bothering to go to a dictionary, you just click on the word and the translation appears above it amz3: that's like http://genius.com annotation but as bookmarklet or extension for browsers amz3: you can do that in guile and with mistnim browser i guess at some point amz3: mistnim: you are right there is no opensource alternative amz3: I will think about it, but it could be added as separate route in my web app amz3: that said, it will require a javascript bookmarklet amz3: it's possible to do amz3: it's kind of separate from what I am doing now amz3: patch welcome ;) mistnim: well, it's not strictly necessary, the user could just copy/paste the the text to the app and than study it there amz3: search://guile+dictionary+github points to a project of mine amz3: mistnim: true amz3: mistnim: there is a library in guile that does retrieve grammatical information about words, I don't find it right now amz3: mistnim: give me a word amz3: let's imagine you highlight 'search' amz3: you get http://conceptnet.io/c/en/search amz3: this program will load the database from the above website amz3: and store in a database that you can access in guile amz3: https://framagit.org/a-guile-mind/culturia/blob/wsh-inverted-index/src/conceptnet.scm amz3: then you can query the data using minikanren (see http://minikanren.org/) amz3: I don't have a web app that reproduce the web ui of conceptnet.io amz3: patch welcome ! amz3: neither can i reproduce the dataset... amz3: I started something somewhere but it's very difficult to parse wikitionary amz3: I can't even tell an adjective from a noun in most cases mistnim: that is cool amz3: I have a program somewhere that links every word of a sentence to it's conceptnet link and there you can get the wikipedia or wikidata node amz3: then display the article... amz3: not yet amz3: actually amz3: but it could be possible amz3: the only issue is that it's BIG DATA, you have vast amount of data :/ amz3: loading the data of conceptnet takes 20 min on my machine, wikidata takes around 1 day amz3: but you do that only once amz3: in a while ;) amz3: I have a screenshot of the app amz3: somewhere amz3: ACTION firing GNOME amz3: also there is the opencog project that is looking for brillant computer scientists amz3: see https://wiki.opencog.org/w/Early_2017_Ideas_Page amz3: I love this website https://amirouche.github.io/link-grammar-website/ amz3: disclaimer: it's mine ;) amz3: but for a opencog project, it's not official yet, and likely will never be amz3: I should mention it somewhere amz3: Oh; I found this: https://imgur.com/gallery/W7PGZ7Q/comment/1124380759 amz3: OrangeShark: what does the comment mean in the above image, my english is laking str1ngs: far out is slang for. it's cool amz3: I think they think I am lost in space amz3: oh str1ngs: far out man! amz3: tx! amz3: so I don't find the correct screenshot amz3: anyway, it's exactly the same thing as the left pane of https://i.imgur.com/W7PGZ7Q.png amz3: I wondering again about whether culturia is a good name str1ngs: well my autotool woes have improved... for now mistnim: so many ideas amz3, the thing is, since there isn't much time to graduation date, and I've already just started learning scheme/functional programming, I probably shouldn't do something that would require me to study a new domain. Like AI, which I know very little about. The risk is that I will overshoot the graduation date amz3: mistnim: they are subjects that are not about doing AI, myself I am learning the way of AI, I don't do much of AI actually amz3: I know scheme for 3 years of free time only... amz3: that to be taken into consideration str1ngs: I barely know scheme. I came to scheme only due to elisp. but now I'm hooked amz3: mistnim: I will reply again with you mail with hopefully more details mistnim: yes, I should focus on those subjects, the professors said the will already praise my efforts to learn functional programming, which is not taught at my uni. And doing a relatively simple project would suffice. amz3: mistnim: ask daviid about guile gnome when he comes amz3: mistnim: if you want to go the gtk route, there is GNU Foliot as example working app amz3: or ask dustyweb about anything else! mistnim: ok mistnim: it's crazy that I have to access the gnu website with a proxy because it doesn't load on my connection dustyweb: hi amz3: mistnim: maybe your school blocks gnu.org? amz3: I am not sure why they would do that tho OrangeShark: hello everyone amz3: hi both of you amz3: guile-wiredtiger was accepted in guix, now you can guix package -i guile-wiredtiger apprently amz3: did not try amz3: because I embed the source of it in my project but that should not mater amz3: for you mistnim: is there a library with the for/X constructs like in racket? amz3: manumanumanu: ^ mistnim: ok, I found something similar, SRFI 42 manumanumanu: mistnim: I hae one manumanumanu: that is faster than the included srfi-42 manumanumanu: it generates very pretty code manumanumanu: 2 sec manumanumanu: the only limitation so far is that you can't add your own sequence types yet manumanumanu: https://bitbucket.org/bjoli/guile-for-loops manumanumanu: but I have the most common ones (in-list, in-vector, in-string, in-hash, in-hash-pairs, in-port, in-lines, in-range, in-naturals manumanumanu: oh, and the body-or-break clause doesn't work. in racket you can write (for ([a 2]) #:break (= a 1) (display a)) but I don't support that manumanumanu: The upside compared to srfi-42 is that I use no mutation (apart from a destructive reverse! in for/list) which makes everything (apart from for/list) continuation safe. There is a safe for/list for those who want continuation safety. manumanumanu: it is also quite a bit faster manumanumanu: the downside is that there is no safety-checks. Racket can rely on it's jit to make efficient code that removes redundant safety checks. guile cannot. mistnim: nice manumanumanu manumanumanu: mistnim: docs are here: https://koketteriet.se/software/guile-for-loops/docs.html manumanumanu: it is all in decently portable scheme. I use guile/racket-style keywords, but it should be easy to port to any other scheme that supports syntax-case and keywords manumanumanu: oh, and another upside: the macros expand faster than srfi-42 :) manumanumanu: at least on my computer manumanumanu: I'm pretty proud :D manumanumanu: there are some other small things that I had to change to make efficient code in the absence of a JIT, but it is documented in the docs. manumanumanu: stis: God kväll! How are things going? stis: manumanumanu: I'm following the aftermath of an event in Stockholm today. stis: It's about an invention of a very controversial figure Andrea Rossi which many is skeptical, others belive and they spend eons of electrons debating. Fun! stis: I'm skeptical, but if it will freeze down there I would like to see it from the beginning. stis: err see it -> follow it manumanumanu: stis: I remember that guy from a couple of years ago. stis: yeah he still tries to get attention. We'll see but from the peanut gallery frontline there is not much of proofs to show off, don't hold your breath for it getting below zero down there :-) manumanumanu: Well then, that is enough scheme for today. Have a good night! stis: night! ArneBab_: manumanumanu: did you already consider making a SRFI from your for-loops? pokes_: i'm trying to wrap my mind around delimited continuations and there's a point where my understanding breaks down: if i do pokes_: (set! dcont (% (begin (display (abort)) (newline)) list)) pokes_: ((car dcont) "hello world") pokes_: everything's dandy; but if i do: pokes_: (set! dcont (% (begin (display (abort)) (newline) (display (abort)) (newline)) list)) pokes_: i naively expect the continuation i get back to display what i pass to it, and then give me back a second continuation at the second abort catonano: pokes_: the seasoned schemer has a nice discussion of delimited conts for multithreading pokes_: catonano: i'll check it out. i'd vaguely heard of it but i would have assumed due to its age it wouldn't have much on delimited continuations catonano: pokes_: it might be that it discusse vanilla continuations, not delimited. I read the chapter and it seemed well written amz3: héllo all ArneBab: hello amz3 ☺ fraya: hi all ArneBab: this is strange … ArneBab: (define a (iota 10000000)) (define a (reverse a)) ;; needs 347 MiB memory ArneBab: (define a (iota 10000000)) (define a (reverse! a)) ;; needs 180 MiB memory ArneBab: shouldn’t the memory of the first a be freed in both cases, maybe with a memory spike while processing? lloda: ArneBab: you expect the memory to be freed at once? I wish sometimes that memory were freed as soon as the handle goes out of scope (I allocate big arrays often), but afaiu that's not how it works. str1ngs: hello, The autoconf macro will set GUILE and GUILD variables however this is nothing that handles guile-snarf str1ngs: for a parallel installation this kinda breaks for me. I need to figure out what guile-snarf to use when snarfing mwette: can you use sed to convert? str1ngs: I'm thinking I'll have to create a autoconf test. but this is my first autotools project :( str1ngs: for example my host system is fedora 27. and it has guile-snarf which is 2.0 and also guile-snarf2.2 mwette: but then it should have guile2.2 ? so if GUILE is guile2.2 then test for guile-snarf2.2 str1ngs: that might work for my system. but when I distribute my software, configure needs to use the right snarf for the possible parallel install. actually the snarf tool my be the same across versions even. but I'd rather future proof it. mwette: bug if you configure guile w/ --program-suffix=2.2 then guile guild and guile-snarf get installed as guile2.2, guild2.2 and guile-snarf2.2, respectively str1ngs: right in which case I can then use. guile-snarf$(GUILE_EFFECTIVE_VERSION) str1ngs: but that breaks if guile is not build with --program-suffix str1ngs: I guess I could have a test, if GUILD equals guild then check if guile-snarf exists and use that. mwette: here it is in a makefile: mwette: GUILE=guile20 mwette: mwette: GUILD=$(shell echo $(GUILE) | sed -e s/guile/guile-snarf/) mwette: mwette: all: mwette: echo GUILE=$(GUILE) mwette: echo GUILD=$(GUILD) mwette: GUILE=guile20 mwette: mwette: SNARF=$(shell echo $(GUILE) | sed -e s/guile/guile-snarf/) mwette: mwette: all: str1ngs: ya, I'll have to create a GUILE_SNARF AM varible I guess. and use configure.ac for setting and testing. str1ngs: for now I think I can just assume if GUILD is guild then snarf is guile-snarf str1ngs: autotools gives me grey hair :P mwette: IMO, you should assume if GUILD is guild$_guile_suffix then GUILE_SNARF is guile-snarf$_guile_suffix str1ngs: I did at first but that breaks with no suffix mwette: then two tests: one for guild and one for guild$_guile_suffix str1ngs: I agree, I just need to figure out how to do this withing configure.ac now str1ngs: within* str1ngs: I have another issue where I can't have guile-devel and guild22-devel installed but that could be distro specific. str1ngs: it there both installed it will find guile 2.2 headers. then then complain /bin/guile is not version 2.2 str1ngs: mwette I think I can just use AC_PATH_PROG(GUILE_SNARF,guile-snarf2.2 str1ngs: and then enforce AC_PROGS([2.2]) str1ngs: this only allow for guile 2.2 though and installed with suffix though. str1ngs: but at least it's stable and works. I'll fine tune it before I release it though. which probably wont be for awhile wingo: zow wingo: so range inference on logand was busted. but somehow this didn't cause a problem because the rest of the type/range inference wasn't precise enough. i added precision in an unrelated area, triggering the bad logand inference bug wingo: ultimately causing negative fixnum constants to miscompile wingo: but there are so few of those in the compiler that it would take a compiled and optimized compiler to exhibit the bug wingo: f.m.l. str1ngs: inc point release fix? :P ArneBab: lloda: even triggering ,gc did not free the memory ArneBab: lloda: I had expected that I have to run ,gc, but that didn’t suffice mwette: ACTION is thrashing nyacc git repo, c99dev branch, to test OS ports janneke: mwette: about an hour ago i hit a major milestone with c99dev branch :-) janneke: here's a bootstrap dependency diagram in svg: http://paste.debian.net/997274/ lloda: sneek: later tell daviid something like this, not tested https://paste.debian.net/996997/ sneek: Got it. lloda: sneek: later tell daviid might need to declare channels as void* and cast it sneek: Okay. lloda: sneek: later tell daviid it's kind of weird to mix the ffi and oldschool libguile like this, if you're writing the C I'd declare all the C args as SCM and do the conversions on that side sneek: Got it. lloda: by the way in all the scm_kind_of_vector_elements calls, the incp parameter is always 1, it's compatibility cruft. For general array there's scm_array_handle_f32_elements and scm_array_handle_dims instead lloda: there's no reason for the scm_kind_of_vector_elements functions to write an array handle, either lloda: some rename-and-deprecation is needed there :-\\ brendyn: how can i write the output of ,trace ... to a file? Walakea: does guile scheme have multiple dispatch? civodul: Wla civodul: argh rekado: on the topic of bug #29258: is there someone who cannot reproduce this with Guile 2.2.2? thomassgn: what's the difference between the #:use-module (module) that follows (define-module and calling (use-modules (module)) ? It doesn't look like it matters which I use from reading the manual. thomassgn: additionally, how can I make emacs/geiser understand where my guile modules are installed? thomassgn: (I should probably search for the last before asking) civodul: rekado: i saw something similar while playing with guile-debbugs the other day civodul: on 2.2.2 civodul: i suspect a TLS parameter issue civodul: (guix build download) has many tweaks thomassgn: it seems putting (add-to-load-path "...") in the file and evaluating it in geiser does the trick. It would be nice to not need this to be evaluated, but it's a simple solution for now... :) atheia: Hello atheia: I'm using (www client) to make a request to a https server. atheia: Unfortunately it does not close the TLS socket properly. atheia: The make-request procedure throws to GNUTLS error of that type atheia: Does anyone here know of a way to ignore the error and still get the contents of the response? janneke: hey mwette...i just tried to inject the textual-ports bit from d33dc6a2 onto nyacc master... janneke: but i failed; it looks OK for simple .c files but breaks with tcc.c janneke: [scm-error misc-error #f "~A" ("bad escape sequence") #f] janneke: i see lots of guile1.8 work which is great! :-) mwette: I had bug adding \\b for 1.8. Let me push, but other changes coming: I am trying to eliminate sxml-match; replacing with my own sx-match OrangeShark: thomassgn: geiser has a command `geiser-add-to-load-path` which you can do to add a path. There is also a variable `geiser-guile-load-path`. janneke: mwette: amazing! janneke: i am prototyping the full source bootstrap in Guix packages and just switched from depending on guile-2.2 to guile-2.0 ... and nyacc broke for me ;-) thomassgn: OrangeShark: Nice, thanks. mwette: OrangeShark: thanks OrangeShark: thomassgn: you can probably use a directory level variable in emacs so it loads up when you are in that project's directory. Look up .dir-locals.el mwette: janneke: I have pushed my c99dev stuff. and i'm running the tests against guile20 mwette: I get: pprint.scm:106:28: warning: possibly unbound variable `#{\\\\#space}#' mwette: so hang on janneke: mwette: thanks for the headsup mwette: all tests pass now; and pushed upstream janneke: ACTION is creating necessary binary seed for tinycc to be able to attempt compiling gcc janneke: mwette: amazing, thanks! amz3: héllo all OrangeShark: hello amz3 amz3: I restarted my work on the search engine, I have new ideas OrangeShark: amz3: what new ideas do you have for your search engine? amz3: it's mainly about the implementation of the scoring function which was wrong amz3: I use TF-IDF amz3: https://en.wikipedia.org/wiki/Tf%E2%80%93idf amz3: also the search/vm function was not scaling with the size of the index mwette: janneke: still finding some minor 18 incompatibilities -- fixing janneke: mwette: thanks again! amz3: basically, it required to load all uid of documents that match two keywords to do the intersection amz3: which is slow and not memory efficient amz3: now what I will do, is that I will compute the most discrimnent keyword in the search query based on term document frequency, fetch all the uids and then filter each documents based on the search query amz3: I should read how lucene does that actually, but I am lazy amz3: this takes the assumtion that looking in all text of the documents that match the discriminent is faster that doing intersection between massive list of non sorted integers amz3: it's just a guess amz3: well, I look at how lucene does keyword matching because I don't want to rewrite that a fourth time amz3: interesting article about code ux https://blog.keras.io/user-experience-design-for-apis.html amz3: interesting article about code ux https://blog.keras.io/user-experience-design-for-apis.html amz3: daviid: what are you doing with guile-cv? mwette: ACTION has cleaned up the c99dev branch of nyacc and pushed upstream delmarre: hello daviid: anyone kows where mwette ffi-helper source code is hosted? OrangeShark: happy_gnu[m]: use (setlocale LC_ALL "") daviid: if i go the variadic 'route', for example: int f32vector_add_vectors_c (int n_cell, float *to, int n_vectors, ...) how would I buid the call in scheme? daviid: anyone has a variadic example, from C to calling it from scheme? daviid: back, in case someone can help (many are sleeping i guess) daviid: i'm trying to build a vector of addresses to f32vectors so I can pass it to C ... and I don't know what a pointer address stype is in C. i can't find a good answer on stackoverflow either, some says they are unsigned int, others says they are system dependent plll[m]: Hey, reading through the Fibers manual. Noticing this example from 2.1 doesn't display anything in the REPL: (run-fibers (lambda () (spawn-fiber (lambda () (display "hey!\\n"))))) amz3: plll[m]: I am working on a search engine! numerobis: Hi! Is there an identity mapping in guile? I am trying to do something along the lines of ((if condition? transform identity) x), that would return (transform x) or x depending on condition. I thought begin would do, but that doesn't seem to work. Thanks! numerobis: (I know it's trivial to write one as (lambda (x) x), but I am just wondering if there exists a predefined function for this) ft: identity amz3``: numerobis: values numerobis: amz3``: Thanks! numerobis: ft: Oh thanks, should have tried that ;) OrangeShark: hello everyone numerobis: Hello! wingo: ACTION wrote a new compiler pass, whee daviid: great! daviid: yesterday I wrote a bunch of comments (after moving fom working place that do not appear in the log, funny! lloda: daviid: re f32vector_add_vectors_c, if you can write dedicated C for interfacing with Guile, then I would pass the list or vector as a Scheme object (SCM type) and pick it apart on the C side instead of messing with variadics lloda: if that C function doesn't already exist I mean daviid: lloda: I wrote it: so far, it uses a s64vector where I store the addresses of the f32vectors to add. Maybe this is not portable though? daviid: (s64vector-set! v-ptr i (pointer-address (bytevector->pointer chan))) daviid: (f32vector-add-vectors-c (bytevector->pointer to) n-cell (bytevector->pointer v-ptr) n-chan) daviid: this works very well, but i need to confirm with C expert that the code is portable (the size of a pointer address... daviid: lloda getting im-add and im-add-channel from pure scheme (good) code to C (just for the vectors addition, all mem alloc is in scheme), get things from 2.5sec to 0.06 seconds, for adding two image snipsets, 2718 x 1732 (4707576 access and addition of two f32vectors) lloda: passing SCM would keep the interface mess on the C side, but if you've already written it and it works... lloda: re: times, I'm not surprised :-\\ daviid: lloda: so far, my libguile-cv.c does not include libguile, but maybe i should daviid: let paste, I did not push this change yet, i'd be happy to be reviewed :), it is very short lloda: not including libguile in a Guile wrapper is strange ;-p lloda: if you want to try BLAS, the function you want is (saxpy! a X Y), which does a*X + Y -> Y, a is a real number and X and Y are f32 vectors (can be general f32 rank-1 arrays, but f32 vectors also work). You can keep accumulating on Y amz3: I found a new job, I will work with datascientist people building somekind of open data database amz3: I hope we will be able to free some software... prolly not in guile yet... daviid: lloda: so far, i wrote a few lines of pure C code, only using basic types and returing int ... no need yet to include libguile... lloda: daviid: no, of course, if you write C to be called from the FFI, then libguile isn't needed lloda: it's just that the purpose of the FFI (one of them anyway) is to avoid writing C lloda: more than there already is I mean daviid: lloda, here https://paste.debian.net/996886/ OrangeShark: amz3: congrats :) amz3: OrangeShark: tx :) OrangeShark: I give it a couple of months and everything will probably be written in guile there :P daviid: I think this code is not portable, because I assume a pointer address is uint64 ... daviid: which i think is system dependent amz3: OrangeShark: I would love too, but it will be hard to convince the only other developer... which wants to do nodejs daviid: wdyt? (any C expert can help me to get this snipset 'safe'...) amz3: maybe mwette knows about that or taylan but both are not here right now OrangeShark: amz3: yeah I understand. Wish I could add some lisp at my work too. lloda: using libguile would fix that. It's what I would do. You can use libguile only for the list argument and keep using the FFI for the rest daviid: lloda: could you tell me what to write? lloda: the list argument is a void * instead of an s64vector, and the C side declares that as SCM lloda: then you use scm_vector_ref or scm_car / scm_cdr to get at the elements amz3: OrangeShark: I figured, that what I am doing with my search engine stuff is useless in a professional context, I mostly do it because that what I want to do aka. I want to use wiredtiger. In a professional context, people would use C/C++ and wiredtiger or Python/JavaScript with elastic search to do the same thing I do amz3: even if there is many good sides to use guile and wiredtiger like ACID transactions accross data models (graph, document, keyvalue, invertex index, you-name-it) amz3: multiple threads with guile amz3: and most of all, I did not really benchmark enough wiredtiger, wiredtiger is still alpha, I see it more clearly, there is many issues with it OrangeShark: amz3: I use C++ at work, but I think there is always the potential to use guile or other lisps for tools. amz3: but what tools? I don't need any tools, anything I would write is re-inventing the wheel OrangeShark: Well at my work we have various data files that would be nice to have some tools to interact with them amz3: I have the feeling I did not do the best I can do in terms of engineering, I leave many good pratices behind when I code on my free time lloda: daviid: or rather scm_c_vector_ref. Then you would use [scm_array_get_handle / scm_array_handle_f32_writable_elements / scm_array_handle_release] on each element of the vector more or less like you use [bytevector->pointer / pointer-address] in your ffi code amz3: btw I stumbled upon intersting slides about conceptual search https://www.slideshare.net/lucidworks/implementing-conceptual-search-in-solr-using-lsa-and-word2vec-presented-by-simon-hughes-dicecom daviid: lloda: first it does not find my libguile.h, which here /opt2/include/guile/2.2 amz3: which is actually my goal amz3: s/is/was/ OrangeShark: amz3: I feel like I don't do my best at work :( amz3: now my goal is to have a good enough search algorithm with a pratical set of indexed websites amz3: basicaly I lowered my goals amz3: OrangeShark: for me work, feel like I could do much more if I had the libertity to do it, like if I was in control... OrangeShark: amz3: have you heard of hoogle? amz3: OrangeShark: no OrangeShark: it a search engine for haskell functions amz3: it seems fun OrangeShark: there is a lot of things I would like to improve at work but we are never given enough time amz3: that's it lloda: daviid: I think, for your example, the easiest thing is actually to use saxpy! although that won't work for other functions such as * and xor w/e daviid: lloda: I'd like to write all these myself, but my C 'ecosystem' knowledge is zero, i still don't know why it does not find my libguile.h, i though my Makefile.am was correct, but probably not ... daviid: there only a few, it will be a good exercise for me to lloda: you use pkg-config? what does pkg-config guile-2.2 --cflags say daviid: lloda that works fine, but i think there is a bit mising or a tipo in either my guile.am or Makefile.am of the libguile-cv subdir daviid: yes, it does not seems ok :) daviid: https://git.savannah.gnu.org/cgit/guile-cv.git/tree/am/guile.mk daviid: lloda: I added these two lines in my guile.mk (which is included in the Makefile.m of libguile-cv) daviid: GUILE_FLAGS = `pkg-config guile-2.2 --cflags` daviid: GUILE_LIBS = `pkg-config guile-2.2 --libs` daviid: daviid: then libguile_cv_CFLAGS = \\ daviid: daviid: libguile_cv_LIBS = $(GUILE_LIBS) daviid: daviid: in the libguile-cv Makefile.am, autogen, configure, make still fails lloda: I think I just put PKG_CHECK_MODULES([GUILE], [guile-2.2]) in configure.ac ! lloda: I'm not comfortable with the autotools, though daviid: lloda: I use the guile macros for that, in this case, daviid: GUILE_PKG([2.2 2.0]) daviid: GUILE_PROGS([2.0.13]) daviid: GUILE_SITE_DIR daviid: GUILE_GLOBAL_SITE_DIR daviid: GUILE_SITE_CCACHE_DIR daviid: GUILE_FLAGS daviid: daviid: there a re all there daviid: there must be a stupid thing in my Makefile.am daviid: https://git.savannah.gnu.org/cgit/guile-cv.git/tree/libguile-cv/Makefile.am daviid: I've changed line 41 -> libguile_cv_LIBS = $(GUILE_LIBS) [ not libguile_cv_LIBADD = $(GUILE_LIBS) ] daviid: line 43 seems incomplete as well daviid: hum, what a newbie I am :) daviid: i don't understand why this does not work: https://paste.debian.net/996902/ daviid: anyone has an idea? daviid: I actually don't know how to debug this kind of bugs daviid: I added a target to print the content of both libguile_cv_CFLAGS and libguile_cv_LIBS, they look prety ok to me: daviid: david@capac:~/gnu/guile-cv/git/libguile-cv 10 $ make printe daviid: printf ' -pthread -I/opt2/include/guile/2.2\\n' \\ daviid: printf '-L/opt2/lib -lguile-2.2 -lgc -L/opt2/lib -lguile-2.2 -lgc\\n' daviid: -pthread -I/opt2/include/guile/2.2 daviid: daviid: very frustrating daviid: weird: daviid: pkg-config --cflags guile-2.2 daviid: -pthread -I/opt2/include/guile/2.2 daviid: daviid: david@capac:~/gnu/guile-cv/git/libguile-cv 12 $ gcc `pkg-config --cflags guile-2.2` \\ daviid: > -shared -o libguile-cv.o -fPIC libguile-cv.c daviid: libguile-cv.c:27:10: fatal error: libguile: No such file or directory daviid: #include daviid: daviid: ah daviid: #include , not #include daviid: then gcc pass, but not when I use my autotool config ... daviid: david@capac:~/gnu/guile-cv/git 101 $ make daviid: Making all in libguile-cv daviid: make[1]: Entering directory '/usr/alto/projects/gnu/guile-cv/git/libguile-cv' daviid: CC libguile-cv.lo daviid: libguile-cv.c:27:10: fatal error: libguile.h: No such file or directory daviid: #include daviid: daviid: how can I trace how the autotool chain compiles my tiny libguile-cv.c daviid: file? amz3: ACTION doing git bisect to find out what commit introduced the http-get bug that forbids fetch https pages daviid: have to go afk for a bit, bbl, if anyone knows how to link libguile in a tiny project using autotool, ping me, thanks amz3: Ok, I think the bug is fixed in stable-2.2 but that version is not released yet amz3: ACTION still compiling amz3: but the git log says a bug was fixed about https amz3: rekado: fwiw http-get works correctly with the branch stable-2.2 daviid: i'm back :) any autotool, libguile and C debug news? amz3: nop sorry daviid: too bad, since this works gcc `pkg-config --cflags guile-2.2` -shared -o libguile-cv.o -fPIC libguile-cv.c daviid: and since this target printe: daviid: daviid: propely displays the right content for these variables, I deduce that autotool does not either call gcc or does not passs these flags and libs as I expect amz3: can some close https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29258 is not useful sorry for the noise et al. daviid: i've asked on #autotools, but so far nobody answered (any of my quiz) either, generally they are very helpfull bavier: daviid: what does `make V=1` say? daviid: bavier: it reports a bug, but let me paste daviid: bavier: https://paste.debian.net/996936/ bavier: daviid: your primary is wrong daviid: what is a primary bavier: daviid: 'libguile_cv_CFLAGS' -> 'libguile_cv_la_CFLAGS' daviid: ah! bavier: and similarly for _LIBS and SOURCES daviid: and this applies for libguile_cv_LIB -> libguile_cv_la_LIB daviid: ? bavier: yeah daviid: and the other as well, so i'd have libguile_cv_la_CFLAGS, libguile_cv_la_LIBS, libguile_cv_la_LDFLAGS ? bavier: right bavier: because those definitions apply to the libtool archive target amz3: ! bavier: daviid: automake manual section 3.5 daviid: bacier, perfect! that solved the problem, man I would never found this by myself bavier: daviid: np daviid: bavier: yeas, though as usual, I would have to know what to look for to identify the section of the manual I should have red ... then to be honest, I read and forgot, because I do this once in ever years ... but now, that it is solved, I can work on making this libguile-cv.c 'safe', like lloda suggested daviid: bavier: i was reading our manual, which has a C example, I thought I was doing 'au pied de la lettre', but there was no la example ... daviid: maybe I should write one and send a patch ... I'm surely not the only casual, not very good C programmer that still needs to write a few thing in C ... and link it usig libguile ... bavier: daviid: yeah, it takes some skimming bavier: yeah, an autotools example in the guile manual would be nice, if it's not already there daviid: bavier it is there daviid: but it does not show how to build an 'la' ... so no _la_ example ... I did not know about that subtility ... bavier: ah, ok daviid: 5.2.4 Building the Example with Autoconf daviid: I was my nose in this the all tie :) daviid: time daviid: anyway, thank you so much! bavier: good luck daviid: now I need the help of lloda to improve my f32vectors_add_vectors snipset daviid: :) daviid: bavier: by the way, my target seems wrong as well daviid: printenv: daviid: daviid: it works but it reports an error daviid: after printing the values daviid: ah no, it works fine, sorry for the noise daviid: bavier what about this variable: libguile_cv_SOURCES daviid: you see I thought these names 'just' add to have the name of the directory they were in daviid: just had daviid: here is how my libguile-cv/Makefile.am looks now: https://paste.debian.net/996942/ daviid: I woner if I should update nodist_libguile_cv_SOURCES _ nodist_libguile_cv_la_SOURCES daviid: and libguile_cv_SOURCES -> libguile_cv_la_SOURCES bavier: daviid: the directory only comes into play with primaries like PROGRAMS or SCRIPTS, otherwise the variables use the canonicalized form of the target bavier: daviid: so yeah, it should be nodist_libguile_cv_la_SOURCES daviid: ok daviid: but the first line should stay unchanged right? lib_LTLIBRARIES = libguile-cv.la bavier: right daviid: ok, man your need a phd in autotool to know all these things ... :) kristofer: hello #guile daviid: hum, bavier, since I made the last 2 changes, I have a bug compiling daviid: make[1]: Entering directory '/usr/alto/projects/gnu/guile-cv/git/libguile-cv' daviid: CC libguile_cv_la-libguile-cv.lo daviid: CCLD libguile-cv.la daviid: .libs/libguile_cv_la-libguile-cv.o: In function `float_to_int_c': daviid: /home/david/gnu/guile-cv/git/libguile-cv/libguile-cv.c:34: multiple definition of `float_to_int_c' daviid: .libs/libguile_cv_la-libguile-cv.o:/home/david/gnu/guile-cv/git/libguile-cv/libguile-cv.c:34: first defined here ... daviid: yep, these two lines should just be nodist_libguile_cv_SOURCES and libguile_cv_SOURCES daviid: lloda: so, in my f32vector_add_vectors_c, the third argument, float *v_ptr[], needs to change wrt your proposal? daviid: lloda: I don't know what to do, my intention before you suggested to use libgule, was to write another C snipset to ask for the size of a pointer address, then call that in scheme to know what vector type to initialize, s32vector or s64vector daviid: trying to talk to #c but I can not paste, any knows a freenode C channel I could try? daviid: ah it is ##c, not #c daviid: what is the valid arg_types for a C function that takes 0 argument ? daviid: the empty list ... daviid: lloda: I went another route, I wrote a C function that returns the size of a pointer address, then I don't depend on libguile and the code is (to my opinion) cleaner daviid: lloda: here is what I have know https://paste.debian.net/996954/ which I beleive is portable daviid: bbl mwette: bms_: select mwette: bms_: in section 7.2.2 of guile 2.2 ref man bms_: Thanks mwette, that's about what I was thinking. plll[m]: amz3: Nothing yet, still figuring out the basics. Interesting, what are some of the various projects? lloda: sneek: later tell daviid it's notabug.org/lloda/guile-ffi-cblas sneek: Got it. lloda: sneek: later tell daviid not sure about the interface language, it should be English? no clue really. Looks fine here sneek: Will do. lloda: sneek: later tell daviid I've cloned the project to github if it helps... gitub.com/lloda/guile-ffi-cblas sneek: Got it. amz3``: héllo #guile rekado: Hi guilers rekado: I wonder why “.go” files are so large. Some of the files I have contain a lot of repetitive data and gzip shrinks them dramatically. wingo: rekado: 64 kB alignment of sections is part of it for small files; i don't know about large ones tho. upload the file to https://wingolog.org/elf-mapper/ ? ArneBab_: rekado: do they maybe use a lot of macros? roelj: Is there an easy way to read gzip'ed files in Scheme? amz3: wat! amz3: I found a bug in my search engine, this needs to be fixed amz3: also I abandonned the idea of having everything in the same process amz3: for the time being the main process will be used to process queries and to index html fragments amz3: ie. the crawler is a separate program dustyweb: o/ amz3: I have all the pieces here and there, it needs to be made together... rekado: wingo: ah, section alignment probably explains why gnu/packages/abduco.go is so “large” despite containing only a single variable definition. wingo: yeah glibc manages to keep 64kB alignment without shipping files full of zeroes, i will have to look into how they do that wingo: but maybe it doesn't matter? not sure dustyweb: beep beep OrangeShark: hello everyone dustyweb: heya wingo wingo: heya :) wingo: ACTION wifi fading in and out dustyweb: do you think it would be possible to tie together guile-gnome and guile-fibers? :) dustyweb: I'm trying to figure out if that would mean needing to run on fibers' event loop or gnome's dustyweb: iirc gnome has some way to hook into another event loop dustyweb: but I can't find it wingo: yes wingo: i think you would want to use gnome's event loop dustyweb: wingo: hm interesting wingo: instead of the one from (fibers epoll) dustyweb: wingo: ok! wingo: fibers doesn't have a pluggable event loop absraction yet wingo: but it's getting close i guess wingo: given that (fibers scheduler) doesn't know about fibers any more dustyweb: wingo: do you think you'll maybe eventually build the event loop abstraction with GOOPS style generics or would you have ye olde pass-in-functions-as-parameters route? wingo: i don't know precisely where to put that abstraction barrier tho wingo: heh good question, i don't know, i think i would go for something ad-hoc probably, dunno tho wingo: probably with guile-gnome you want to limit to the single main thread dustyweb: but I guess that main thread's event loop could then communicate safely with other threads on different schedulers? wingo: multithreading is possible but you want to start simple i think wingo: and certainly gui things only want to be run on the "main thread" wingo: i mean from a kernel thread POV dustyweb: wingo: btw I ask this because I'm thinking of building an activitypub client in guile that's able to reuse a lot of the other 8sync'y components I've built wingo: i think the eventual answer is yes but i would ask that question later on dustyweb: wingo: also also btw I've been working more with Mark S. Miller and I think I can make 8sync more ocap-like / similar to E wingo: the glib mainloop is threadsafe but gtk is not dustyweb: it turns out it is already very similar wingo: nice! dustyweb: obviously it wouldn't be "protected" within the same process unless you spawned some code in a sandbox dustyweb: but you could do the across multiple processes / machines and preserve some ocap safety dustyweb: well, preserve all ocap safety there dustyweb: the most interesting thing though of all this that I've been thinking about a lot dustyweb: is distributed GC :O dustyweb: wingo: have you read: https://marc.info/?l=e-lang&m=97564103120456&w=2 dustyweb: one of the more delightful things I've read recently dustyweb: I'm pretty sure I can get distributed acyclic garbage collection to work across hives/vats (by the different vats paying attention to who's still holding on to a reference) which would allow for a lot more one-off spawning of actors without needing to more manually manage their shutdown (effectively manual memory management, a true pain... CSP also has this pain!) dustyweb: but not cyclic dustyweb: http://www.crockford.com/ec/dgc.html distributed cyclic GC works and has been done in E and can be layered on top of an existing GC... but it requires that you know which objects are "rooted", and I don't think we can get that info from our GC in guile lloda-home: hi daviid daviid: hi lloda-home sneek: Welcome back daviid, you have 3 messages. sneek: daviid, lloda says: it's notabug.org/lloda/guile-ffi-cblas sneek: daviid, lloda says: not sure about the interface language, it should be English? no clue really. Looks fine here sneek: daviid, lloda says: I've cloned the project to github if it helps... gitub.com/lloda/guile-ffi-cblas daviid: lloda-home: ah! i don't like github, but do you maintain both? can I trust the notabug version or you're now only working on github? lloda-home: yes, I push to both lloda-home: use the one you prefer lloda-home: they should always have the same revision daviid: dustyweb: you should look/study guile-a-sync2, which has a (very good) integrated loop with the glib one... I've used it to grab info from the filesystem while playing with actors in clutter ... daviid: lloda-home: perfect, i'll stick to the notabug then, thanks. I haven't tried to really use it yet, but I'll like to... one of the things that 'scares me' :), to make guile-cv depending on it, is that it does not seems to be a real project (fully autotool chained, with realeses and doc ...), do you have any plan on this? daviid: wrt to the language, maybe it's because I use tor-browser... don't know daviid: but here the iteface is polish or another east country language ... :) dustyweb: daviid: ah right, I remember them mentioning that ArneBab_: daviid: if you use tor, then this is to be expected: the website thinks you’re from the country of the outproxy :) daviid: ArneBab_: ok, i thought so, too bad i can force english everywhere ArneBab_: if you do then you reduce your anonymity (I would guess by factor 5 or so) daviid: dustyweb: guile-a-sync2 is extremely well maintained and has doc ... daviid: dustyweb: and I'm pretty sure chris uses it for 'real projects', so it is very well tested to, not just a test suite ... daviid: dustyweb: then to confirm what wingo told you earlier, you'd have to build a loop (8sync loop) based on the glib loop, nothing else would ever work... lloda-home: daviid: it wasn't in my plans tbh (I had no plans). It was meant to be something you'd copy into your project. daviid: ok lloda-home: I can give it a shot over time, but it won't happen at once lloda-home: although seeing the field (everything is outdated...), it would really be good to have standard bindings to the important libraries :-/ daviid: lloda-home: fine, now I know ... the first step would be AND, OR, XOR, do you have those bindings? does cbals have these on f32, considering 'discrete' float values daviid: oh, it is outdated? i though cblas api very stable lloda-home: oh, not cblas, but the other Guile bindings you can find out there lloda-home: I mean cblas is outdated, but it's outdated forever, so to speak :-D daviid: lloda-home: ah, what library do you recommend? lloda-home: I don't think map-AND/OR/XOR exist in BLAS at all lloda-home: those are not linear-algebra ops daviid: ok, i'll rewrite those in C then lloda-home: I don't know the full function list by heart, so someone might correct me lloda-home: I like BLIS, it's more modern and easier to interface with, but the packaging story is not good unfortunately delmarre: speaking of linear algebra lloda-home: I think using BLAS is fine delmarre: can someone help me with something really simple lol daviid: the scheme version I have for these are 'beautifull', and ok with small images, but too slow for real projects ... till we have guile-3 ... daviid: I actually don't understand why processing a f32vector, f64 and s32 in scheme is so much slower then in C, I wish I understand, why a simple loop over multi million cells is about 4x to 10x slower then doing the same in C (my ultra simple benchmark), I wish I understand lloda-home: f32 etc are slower in Scheme than using #t, actually lloda-home: Guile just has to do a lot of translation back and forth between types daviid: lloda-home: but you write a loop, that does nothing but i++, it already is an order of mag slower daviid: let say you write a f32 mean, it does not have to convert anything does it? lloda-home: well the example I was going to give is with array-map! lloda-home: it's a C function so if you pass it a Scheme function daviid: lloda-home: I don't use array daviid: but f32vectors lloda-home: well, that should be better lloda-home: because the compiler could know that the operands to your function are f32s daviid: yes, but it still is much slower, and even before guile-3.0, i wish it be faster lloda-home: but I think it only uses that info for certain functions lloda-home: if you call anything else, then the f32 has to be converted to a Scheme number etc... daviid: I thought the f32vector cells did contain float that were scheme floats daviid: that explains a ot then daviid: so in the mean example, it will convert multi million float fro C to scheme? lloda-home: f32 contains raw floats, but Scheme doesn't use those (but there was this talk about nan boxing a while ago; I didn't follow that) lloda-home: daviid: I think so daviid: i think davexunit worked on this for f64 daviid: anyway, I'm happy to rewrite a few snipset in C, till we have those as fast as ... the memory allocation and management is on the scheme side, so I'm happy to do this way till we have a fast compiler for f32, f64 and s32 daviid: lloda-home: frim guile-ffi-cblas i'd need ADD SUBTRACT DOR product and matrix ops daviid: DOT, not dor daviid: :) lloda-home: daviid: dot is already there (in various forms) lloda-home: you can see the full function list here http://www.netlib.org/blas/ lloda-home: (look down for LEVEL 1) daviid: why did you use so many macros? as opposed to 'normal' bindings? it confuses me :) daviid: lloda-home: ok thanks lloda-home: to avoid repeating code lloda-home: not all of those functions are wrapped in guile-ffi-cblas, only those I needed at the time lloda-home: anyway completing the bindings should be easy, if there's interest, anyway daviid: level1 are the so called safe operation right? lloda-home: no daviid: ACTION has to read more about cblas lloda-home: I shouldn't have used the word level in the README lloda-home: in BLAS, level 1 2 3 mean 1: vector-vector, 2: matrix-vector and 3: matrix-matrix daviid: ah ok lloda-home: I'll make a note to use other words lloda-home: you can see there are no map-add or map-substract ops daviid: in guile-cv matrix are vectors lloda-home: and you carry the sizes on the side? daviid: yes lloda-home: well Guile has an array type, so I don't understand why no one uses it :-( daviid: lloda-home: because i use Vigra lloda-home: I'm not familiar, but it in the reference it lists multidimensional array types lloda-home: you could use those directly from Guile daviid: i mean guile-cv is based upon vigra (it already has a lot more then just vigra, but of course it shares the data representation with Vigra...) which als has linear algebra but not wrapped by vigra_c (and I nwanted to write these myself to get my basic math back :) daviid: there terminology is terrible lloda-home: it says it has a numpy interface, and numpy's arrays are basically the same as Guile's daviid: in vigra an image channel is always a f32vector, there is no other channel type daviid: in vigra the caller allocates, which is why I picked up vigra (among othe reasons) lloda-home: I was looking at http://ukoethe.github.io/vigra/doc-release/vigra/index.html daviid: this choice, f32vector for channels, is the best choice ever, and a perfect compromise between speed for computation and precision wrt 'vision' daviid: like any java doc, C++ doc is unreadable daviid: these guys call a vector array, and multidimensionsl array a list of vectors ... daviid: then the doc is for c++ devel only, unless you know what ou're lokkibg for, you don't find anything :), just terrible, there is not even a 'concept' index daviid: anyway, you can look at the guile-cv doc lloda-home: daviid: ok I'll have a look. daviid: a couple of order of magnitude better :), (always to be improved of course, but quite good already daviid: lloda-home: guile-cv depends on vigra_c (as you know, we dont have ways to bind c++ lib), that is were i know how things are done, what binding i can start with ... and i chat with its author aalmost everyday, he did change a lot of thigs for me already ... lloda-home: daviid: is that BSeppke? daviid: java doc does not even list its first aegument... it's like hmanity losts its mind :) daviid: the zeromemq author recently wrote he should never have choose C++, and rewrote the project i pure C code lloda-home: hehe, I do C++, so I dunno lloda-home: but I know you can do multidimensional arrays in C... FFTW is the best example, it's just perfect lloda-home: so this isn't really a C++ vs C thing lloda-home: anyway, I'll have a look and I'll also have a look at autotooling guile-ffi-cblas, if that'll help daviid: lloda-home: the documentation of C++ projects I had to read is terrible daviid: unlike C doc, with an API ... a list of functions ... daviid: because their authors think you know their class, subclass ... lloda-home: ah, I can see how that can happen daviid: so many times i look for somtheing in vigra, it is not in the list of class not in the list of functions ... no concept index .. then i ask benjamin (the vigra_c) aythor, and find out the name is not even standard image processing names ... ArneBab_: daviid: is aythor an experienced image processing professional/researcher? daviid: in vigra_c, (I already told him it was not a good idea but...) every variable that are f32vector in and out, are called arrays, arr_in, arr_out ... daviid: ArneBab_: yes, the vigra author is very knowledgeable and a respected pro in image processing daviid: just like they call vectors arrays, some young people think they have to 'rename' things ... the C++ Vigra manual is full of buz names, and 'false' complexity daviid: C++ code is generally unradable, full of false an totally unecessary complexity, in my not so humble opinion daviid: anyway, back to work daviid: lloda-home: will try as i find time, maybe i write these myself in C, I'm a bit scare to depend on a project your are nt actively following ... daviid: but then my not so humble opinion is backed up by the zeromemq author, who i do respect a lot daviid: i wish i had the url of the article i red aboyt htis daviid: is it nanomemq maybe? daviid: wingo: would know I guess wingo: ACTION dunno :) good evening tho :) daviid: good evening wingo lloda-home: daviid: it's just that I put in it what I needed for myself. If you don't see much movement in the project, it's because you're the first one to ask me about it (!) daviid: lloda-home: sure I understand daviid: ArneBab_: I would not have based guile-cv on vigra if I did not think its author was extremely knowledgeable in the field, and if I would not beleive it was there for good and for long ... though as I said earlier, guile-cv is (a lot) more then just vigra ... daviid: ah nanomsg daviid: http://nanomsg.org/documentation-zeromq.html daviid: the article i was refering to is this one: http://250bpm.com/blog:4 daviid: Why should I have written ZeroMQ in C, not C++ (part I) daviid: every C++ devloper on the planet should read this :) daviid: twice daviid: vigra should have been written in C, image processing does not need template :), it needs fast and GPU based linear algebra daviid: lloda-home: does cblas uses GPU? lloda-home: daviid: there are many implementations of cblas, all share the same interface lloda-home: there's cublas from nvidia, and clblas, and vienna-cl, etc. lloda-home: in guile-ffi-cblas you can pass in an env variable the one you one to link with lloda-home: actually this dependency handling is something that I had doubts about lloda-home: for a standalone package that needs some BLAS to be installed daviid: lloda-home: very nice, so i really should try hard to use your work, then install GPU blas... daviid: i reaaly have to study a bit more about this, thanks lloda-home lloda-home: daviid: yw, I'll be around :-) daviid: do you have min, max and range bindings for f32? daviid: lloda-home: guile-cv doc is here one of the quiz I had in mind also is: in guile-cv, these ops accept any number of images daviid: oh bad paste daviid: https://www.gnu.org/software/guile-cv/manual/html_node/index.html lloda-home: daviid: BLAS only has index of max of abs value daviid: lloda-home: no min? and why abs? lloda-home: because those are the things you need in linear algebra programs I suppose lloda-home: to compute norm-1, norm-inf, etc lloda-home: of vectors delmarre: do you guys have a preferred way to share code for help with debugging? daviid: lloda-home: image data structure is described here 3.2.1 Image Structure and Accessors (it will take you just a few minutes to read this, it is dead easy and dead simple) delmarre: because i am fucked delmarre: and need some help haha delmarre: trying to calculate winding numbers delmarre: and can't find what i'm doing wrong daviid: lloda-home: so, i can not find the min value of a f32 vector in cblas? lloda-home: daviid: cblas doesn't have a function for that daviid: ok daviid: lloda-home: another thing i wanted to ask is in guile-cv, like in scheme, all these linear algrbra proceures accept any number of images lloda-home: daviid: yeah it's nice to be able to use match like that (match image ((width height ...))) lloda-home: match comes from upstream without many changes so it doesn't support arrays which are a C-defined type lloda-home: that's a defect in match I think lloda-home: you can do (match (array-dimensions a) ((...) ...) ) etc of course daviid: so i implemented specific f32vector-ops-at-offset, like f32vector-sum-at-ofset ... but then using cblas i'd have to call recursively right? lloda-home: daviid: wdym any number of images? like do the same op on many images? daviid: yes, like this https://www.gnu.org/software/guile-cv/manual/html_node/Processing.html#im_002dadd lloda-home: daviid: if you used arrays you'd just make a view into that offset and pass the view lloda-home: I don't understand what you mean by recursively there daviid: all linear algebra, including multiplication daviid: lloda-home: I can build an array of f32 vectors, and call cblas then lloda-home: daviid: so from your link I understand that im-mutiply i1 i2 i3 ... does (i1 * i2 * i3 * ...)? daviid: yes lloda-home: you'd need to call multiple times into blas for that lloda-home: but for example im-add i1 i2 i3... you could do that with a single op if you package the arguements in a certain way daviid: yes, in the case of matrix multiply, i also have to compute intermediar results in scheme, but what about imadd daviid: im-add daviid: lloda-home: right so i have a list of f32vectors, how do i pack for cblas? daviid: (I beleive calling cblas multiple time for matrix mulitplcation will be faster the scheme anyway) lloda-home: you'd put them one after another in a big f32vector, then tell CBLAS that that's actually a matrix by giving it the right sizes and strides, and then make a vector-matrix product of #(1 1 1 ...) times your matrix lloda-home: that'll sum all the rows lloda-home: be faster anyway: likely daviid: lloda-home: cooking needs a lot of prep in cbals :) daviid: cblas lloda-home: daviid: I guess that can be true lloda-home: cblas is not a general array library, it only has linear algebra primitives, so if you want to do an outer product or something like that, it just isn't there daviid: lloda-home: at some point it can be a memory allocation problem too lloda-home: yes daviid: I think i will rewrite these i C myself lloda-home: I see gc warnings all the time myself :-/ daviid: I do too lloda-home: to be clear, blas doesn't allocate anything by itself, ever daviid: in real world, images are really big .. copy those channels won't work well lloda-home: but yeah, massaging the data into shape for calling can take memory daviid: and time too sepisoad_: is there a way to get information about a procedure inside repl sepisoad_: like to see what are the input parameter/types of a procedure? sepisoad_: for example something like this: (help cons) lloda-home: daviid: a funny thing is, in Guile you can make constant arrays for free, any size lloda-home: like (make-shared-array #0(1) (lambda i '()) 10000000) lloda-home: takes no space lloda-home: but some version of blas will just hang if you pass zero strides, it's pretty sad lloda-home: sepisoad_: just as you just did, it's just cons doesn't have docs lloda-home: which is bad... lloda-home: e.g. (help string=) will give you that info sepisoad_: it was an example daviid: lloda-home: have to go afk a bit, bbl, thanks lloda-home: daviid: see you around sepisoad_: (help open-socket) :-| lloda-home: sepisoad_: that function doesn't seem to be exported by any module sepisoad_: lloda-home, I was just trying to express what i want plll[m]: Hey, how would I find my guile prefix (eg. For installing fibers)? plll[m]: Tried with /opt/guile and i cant import it in my repl. Libraries like artanis work fine tho OrangeShark: plll[m]: you need to install it in guile's load path OrangeShark: or add to guile's load path to find it plll[m]: OrangeShark: thanks! OrangeShark: plll[m]: usually it the install location of guile like /usr, but you can always add any other directory to GUILE_LOAD_PATH and GUILE_COMPILED_LOAD_PATH plll[m]: OrangeShark: /usr works perfectly plll[m]: How do people usually go about isolating builds/environments w guile? amz3: plll[m]: they use guix janneke: yay, mes+nyacc is resurrected! amz3: ! amz3: plll[m]: btw, I found which project I will work on janneke: i didn't run nyacc on mes for about almost a year, and mwette has been very busy amz3: sure amz3: so now, you can run nyacc and compile C? amz3: nyacc is only the parser, is that correct? janneke: i wouldn't say "only", as the parser is currently *much* bigger than the compiler janneke: but yeah... amz3: oh plll[m]: amz3: nice! What is it? rekado: I’ve finished documenting the little there is of guile-debbugs. rekado: Now I’m just waiting to get it approved for hosting on savannah, so that I don’t need to host it on my unreliable server. civodul: rekado: what's that? Guile bindings to debbugs? rekado: yes civodul: woohoo! civodul: awesome rekado: for the SOAP service civodul: i see civodul: well civodul: you mean SOAP client? rekado: code is here: https://git.elephly.net/software/guile-debbugs.git rekado: I still want to add a monadic interface for talking to a SOAP service. rekado: currently, it’s a little clunky: (soap-invoke %debian newest-bugs 3) rekado: gives you a list of three bug numbers. rekado: (soap-invoke %debian get-status (list 1 2 3)) => a list of s civodul: awesome civodul: ok rekado: Unfortunately, it only works over HTTP because I can’t get the http-client in Guile to talk to HTTPS services. civodul: if that's the only problem, that's great :-) civodul: excellent work! rekado: I’ll see if that’s the only problem when I integrate this with mumi :) rekado: thanks happy_gnu[m]: hello happy_gnu[m]: how can I set guile to utf-8 happy_gnu[m]: I was writing a string in spanish happy_gnu[m]: but I get this happy_gnu[m]: "el car\\ufffd\\ufffdcter es 'B' y est\\ufffd\\ufffd en la posicion 2" happy_gnu[m]: instead of happy_gnu[m]: "el carácter es B y está en la posicion 2" mwette: xb amz3: héllo :) plll[m]: Hi plll[m]: What are you up to with Guile, amz3? amz3: plll[m]: not sure what project I will workon, I have various project at the pre-alpha stage amz3: plll[m]: I don't know which one is worth pursuing amz3: plll[m]: and you? dustyweb: o/ janneke: o/ daviid: o/ mwette: o/ stis: o/ mwette: do the wave mwette: \\o/ stis: \\o/ dustyweb: \\o\\ /o/ dustyweb: hm those kinda look like angry eyes janneke: \\o/ \\o/ \\o/ mwette: \\o/ mwette: \\o/ mwette: \\o/ mwette: mwette: Have you ever looked at the implementation of pmatch? It uses CPS for syntax. Pretty cool. e.g., (syntax-rules () ((_ v p kt kf) (if (eq? v p) kt kf))) dustyweb: mwette: cool... I haven't looked at it :) ArneBab_: \\o/ .o. ☺ ArneBab_: ^ dawning realization that something is still odd … ☺ daviid: lloda: for info, when I browse your account on notabug, the interface comes in a language I don't understand, is this on purpose? bms_: Okay, so I've written up most of Msg's client and server. It all functions as I've told it to, but I'm trying to figure out a way, in Guile, to execute the server accept loop at the same time as the server's prompt. And the same for the client read loop and the client prompt. I can't use threads or futures because both the loops and the prompts need access to the server's socket port to read from and write to. Is this possible, or is my bms_: design bad? bms_: I'm assuming that some reworking is necessary. delmarre: right lads help me get haunt working delmarre: or i am gonna go mad delmarre: got it working fine in the repl delmarre: but running haunt build gets me Error: no code for module delmarre: (haunt ui) but presumably all of it delmarre: what have i done wrong? ArneBab_: did you set the GUILE_LOAD_PATH to include the site directory or haunt directory? delmarre: lemme check quick delmarre: %load-path gives delmarre: ("/usr/local/share/guile/site/2.2" "/usr/share/guile/2.2" "/usr/share/guile/site/2.2" "/usr/share/guile/site" "/usr/share/guile") delmarre: incidentally it all works if i call the ./pre-inst-env first delmarre: so might just make aliases to do that as a complete hacky solution haha ArneBab: sneek: later tell delmarre: It needs to be /usr/local/share/guile/2.2/site — not ../guile/site/2.2 sneek: Okay. ArneBab: ah, damn, no ArneBab: sneek: later tell delmarre: sorry, I got that wrong … site/2.2 is correct sneek: Got it. ArneBab: sneek: later tell delmarre: where did make install install to? sneek: Okay. delmarre: hello? sneek: delmarre, you have 3 messages. sneek: delmarre, ArneBab says: It needs to be /usr/local/share/guile/2.2/site — not ../guile/site/2.2 sneek: delmarre, ArneBab says: sorry, I got that wrong … site/2.2 is correct sneek: delmarre, ArneBab says: where did make install install to? janneke: mwette: rain1 just found that recently (ice-9 textual-ports) from guile-2.2 were introduced in Nyacc janneke: i think this breaks guile-2.0 compatibility, are you aware of this? janneke: ACTION had some debugging patches for guile-1.8 and nyacc 0.7x so that nyacc runs on real simple guile (and hence mes scheme) mwette: janneke: no. I will look into it. janneke: mwette: thanks. i haven't kept up with Mes<->Nyacc's compatibility recently, working so hard on MesCC only mwette: janneke: you compiled nyacc to guile-1.8? I can install 1.8 but not confident that one is doable janneke: mwette: i have a patched guile (branch 1.8) here: https://gitlab.com/janneke/guile janneke: it adds r7rs ellipses (for Nyacc), define-syntax-rule, quasisyntax, when, unless, and PEG to guile-1.8 janneke: i am using (this patched) guile-1.8 to bootstrap Mes' psyntax.pp janneke: mwette: btw, guile-1.8 has no compiler, so setting load-path is enough ;-) janneke: mwette: https://gitlab.com/janneke/mes/commit/1072c7fba97490b495922aa73f9efd8514800da2#content-body mwette: janneke: thanks -- looks doable for 1.8; though I may try use-modules + effective-version to get optargs and syncase janneke: mwette: yes, this made me very happy last year! janneke: note that this is my enhanced guile-1.8 mwette: janneke: is the ellipses for the lalr-spec macro? I could eliminate that I think, now that a let is not needed to wrap everything. janneke: mwette: yes...that would nice for full source bootstrapping... janneke: ...although what would be *really* awesome if we can remove the dependency on syntax-case mwette: won't happen, as nyacc lalr syntax uses identifier? ; that is what makes the syntax for languages so clean: mwette: nyacc : ("[" ElementList "," Elision "]" mwette: mwette: lalr: (lbracket ElementList comma Elision rbracket) mwette: mwette: IMO janneke: yeah, that's beautiful janneke: we (from the full source bootstrapping madness) will just have to see janneke: it is rumoured that syntax-case can be bootstrapped rain1: maybe we could go over it like ((str "[") (rule ElementList) (str ",") (rule Elision) (str "]")) sneek: rain1, you have 1 message. sneek: rain1, oriansj says: to message me as I have some important news. rain1: and modify the macro a bit to do that janneke: mwette, rain1: maintaining a fork/delta on Nyacc -- just for bootstrapping purposes -- would be an option too janneke: not the best of options, but keeping Nyacc as clean as possible is also nice janneke: usually it's not so bad to have some yoghurt software janneke: managing to bootstrap syntax-case would be another great option rain1: we will need to think about self extension carefully to get a scheme with macro systems janneke: rain1: yeah janneke: lisp-style define-macros are trivial mwette: actually identifier? is need to distinguish identifiers from symbols, which are not used, usually janneke: syntax-rules are not trivial, but OK to bootstrap and mes has them mwette: one would have to declare symbol use (using %token like statement) janneke: syntax-rules is ~200 lines of lisp style macros rain1: wow thats awesome, just had a look at mes/syntax.scm janneke: rain1 :-) janneke: can you imagine how i felt when that worked? rain1: yeah must been have been exciting! janneke: ...standing on the shoulders of giants... rain1: i only have a trivial defmacro in my compiler, first define quasiquote then using it to define cond and similar - i should see if i can pull in that syntax-rules its nice and compact mwette: jobs mwette: ls janneke: rain1: your compiler, is that written in forth? rain1: no its self hosted on top of a VM implemented in C rain1: what i had thought before was the forth is very close to this sort of VM (the way it reads in 'words' from a file, load them into a dictionary, execute them with a threaded loop) mwette: I have simple fix for removing textual-ports. janneke: mwette: that's great news mwette: `get-string-all' replaced by new proc `read-rest' mwette: ACTION is working port of nyacc to guile 1.8 mwette: This 1.8 porting is turning out to be not clean. dustyweb: oh interesting, libtasn1 dustyweb: mwette: a backwards port of nyacc? why? :O mwette: dustyweb: janneke using 1.8 - I said I would look. dustyweb: civodul: have you looked at https://www.gnu.org/software/libtasn1/ ? dustyweb: I wonder if I should try to see if I can use it to parse things in guile-gnutls janneke: dustyweb, mwette: ouch, hope you didn't misunderstand me there... amz3: ijp: do you have plans on hacking on guile stuff before next year? maybe guile-js stuff? amz3: ijp: I would be glad if you give me feedback on my commits dustyweb: I'm having a hard time figuring out by using it what useful data I can get out tho janneke: i backported things needed for Nyacc to guile-1.8, to help boot Nyacc on Mes dustyweb: er dustyweb: guile-gcrypt dustyweb: damn! janneke: currently, I use Nyacc on guile-2.2, and on Mes janneke: when I have a problem with Nyacc on Mes, debugging with Guile-1.8 helps because Guile-1.8 and Mes are closer janneke: however, i *also* use this patched Guile-1.8 to bootstrap psyntax.pp for Mes mwette: janneke: OK then. I did remove dependence on ellipsis and srfi-43, but the parser is not working. janneke: this psyntax.pp I use in Mes to run Nyacc... janneke: mwette: still, it would be very helpful for bootstrapping if those were not needed janneke: not urgent, but for bootstrapping it's nice to have less macro-fu dependencies janneke: i spent quite some time on removing ellipsis from Nyacc and then opted to backport ellipsis to Guile-1.8 and then to Mes mwette: janneke: wow -- nice effort there janneke: mwette: eh, i spent time and failed -- then took the "let's add and use ellipsis route" janneke: so i spent time on "trying to remove" mwette: I have removed the use of ellipsis, but getting error for 1.8 on simple spec janneke: but getting ellipsis to work on guile-1.8 was kind of cool :-) amz3: dustyweb: héllo! What is the guile web tutorial you are talking about in the ML? amz3: dustyweb: direct link? :) janneke: mwette: hmm, i had silly things with port encodings but that was guile-2.0 i think janneke: mwette: i think that guile-1.8 does not have `when'? mwette: I ran into unless. I added compat18 module which provides unless via syntax-rules janneke: mwette: or does not support reading #\\b, does not have #\\alarm, #\\vtab janneke: ah, good mwette: guile18 also does not have srfi-43 janneke: indeed, i backported that for guile-1.8 too janneke: it also doesn't read #| |# comments mwette: but it does have #! and !# janneke: yes mwette: also, make-fluid does not take an argument. The value defaults to #f but I was using (make-fluid #f) anyhow so I changed from (make-fluid #f) to (make-fluid) mwette: also syntax case reader macros aren't there (i.e., can't use #' must use (syntax)) janneke: yeah, backported those too to guile18 ... dustyweb: amz3: it's in the manual dustyweb: https://www.gnu.org/software/guile/manual/guile.html#Web-Examples amz3: I see thx daviid: lloda: I don't remember the name and location of your CBLAS related project and repo? daviid: ah i got it daviid: guile-ffi-cblas on noteabug civodul: dustyweb: i haven't looked closely at libtasn1, but it's what gnutls uses civodul: though parsing ASN.1 in C is debatable :-) dustyweb: civodul: heh :) dustyweb: civodul: what's the name of the scheme library that did all the crypto stuff? I couldn't remember it today.. civodul: Industria? dustyweb: that's the one civodul: perhaps CHICKEN, Racket, or Bigloo have an ASN.1 parser too civodul: ACTION -> zZz janneke: ACTION -> zZzz ays: I am just messing around with guile and I was wondering, how can I import a bunch of functions from a file? davexunit: ays: use-modules davexunit: for example (use-modules (srfi srfi-1)) davexunit: you can include more than one module as well OrangeShark: Happy Friday! janneke: o/ delmarre: hello people OrangeShark: hello delmarre delmarre: just fucked my knee up delmarre: so gonna be bed bound for the next couple of days delmarre: what fun things can i do with guile? amz3: a CMS amz3: or whatever yoiu call it amz3: E.g. a newspaper engine amz3: delmarre: ^ OrangeShark: content management system? amz3: yes amz3: or a blog delmarre: that would actually be kinda fun i guess delmarre: been meaning to get a website for ages amz3: ^^ delmarre: what fun things can i do with guile? delmarre: woops lol delmarre: but yeah is there any specific package i should be looking at for making a blog via guile? delmarre: chicken has html-utils which looks super easy delmarre: for blocking out a template amz3: I can guess you can use artanis, or my guile boilerplate or maybe dustyweb 8sync dustyweb: delmarre: if it's just a blog and it's static, I recommend Haunt dustyweb: otherwise if dynamic yeah amz3's suggestions are some various routes delmarre: oooh yeah haunt looks good to me dustyweb: haunt is A+ dustyweb: used for 8sync's site and Guile's and activitypub.rocks and Guix's delmarre: ffs can't get haunt to install properly OrangeShark: delmarre: what issue are you having? delmarre: not actually sure delmarre: literally getting "Error: No code for module (haunt ...)" OrangeShark: did you just do ./configure? delmarre: nah ran make && make install after delmarre: with no errors OrangeShark: yeah, by that I mean you ran configure without any arguments delmarre: oh right delmarre: oh yeah, that's what the README said OrangeShark: so they are installed in /usr/local delmarre: and guile doesn't look there for modules OrangeShark: you need to add that to the GUILE_LOAD_PATH and GUILE_COMPILED_LOAD_PATH OrangeShark: correct delmarre: right, sweet haha delmarre: jesus wept still haven't got it going delmarre: moved the haunt stuff to /usr/share/guile/2.2/ OrangeShark: still couldn't find the haunt modules? delmarre: nope lol delmarre: then tried running (add-to-load-path "/usr/local/") after reinstalling it with no prefix delmarre: and then loading them delmarre: and it doesn't like that after OrangeShark: oh it not /usr/local but it /usr/local/share/guile/2.2 delmarre: either OrangeShark: hold on let me see the full path OrangeShark: $(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION) OrangeShark: $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/ccache OrangeShark: so that would be /usr/local/share/guile/site/2.2/ for load path and then /usr/local/lib/guile/2.2/ccache/ for compiled delmarre: right got there delmarre: now just need to edit the load paths permanently delmarre: (add-to-load-path) seems to be just for that session OrangeShark: you can put it in your .profile or .bash_profile or you can put it in a .guile OrangeShark: .guile would be written in scheme OrangeShark: oh, .guile is only for interactive delmarre: fuck me i'll deal with it tomorrow haha OrangeShark: export GUILE_LOAD_PATH="/usr/local/share/guile/site/2.2${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" OrangeShark: export GUILE_LOAD_COMPILED_PATH="/usr/local/lib/guile/2.2/site-cacche${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_COMPILED_LOAD_PATH" OrangeShark: replace site-cacche with ccache for haunt delmarre: hey people delmarre: i have a dumb question delmarre: does guile have any packages which allow you to send commands over a serial connection? ft: https://github.com/ft/guile-termios ft: ...unless I misunderstood your requirements. delmarre: hmmm, not sure this will do it delmarre: need to actually send stuff over a serial port delmarre: something like this delmarre: https://github.com/shamazmazum/cl-serial ft: delmarre: yeah, that package let's you do that. You open a port to the device file in question, manipulate the serial specific stuff using guile-termios and then just write to the port again. ft: delmarre: I wrote that thing because I wanted to use Guile to remote control a larger signal-processing system that had a small microcontroller that did system management. And that microcontroller had a serial link via usb into the host computer. delmarre: reading through the example delmarre: and looks like I need to look into termios and stuff delmarre: and actually have a clue what's happening haha ft: delmarre: Termios is the system interface that controls the serial stuff. On POSIX systems anyway. ft: I had this working in cygwin too, if windows is required. :) delmarre: i should probably learn more about serial stuff in general haha delmarre: trying to get a pen plotter on the go ft: Those serial links are usually 8N1 with some baudrate, like 115200bd. ft: "8" is eight bits per frame, "N" is no parity, and "1" is one stop bit. ft: bd is the symbol rate. In serial links like this, a symbol as two constellation points and thus carries one bit. So the baudrate is also the bitrate in this kind of scenario. ft: And that's most of what you need to know about simple uart and rs232 serial links. delmarre: yeah so mine is rs232 ft: uart and rs232 are basically the same; just the signal levels are different, and IIRC the logic in rs232 is inversed. ft: But that's the physical layer. You shouldn't have to worry about that. delmarre: so reading through your example you get it set into 8n1 mode or whatever delmarre: and then after this you could just call displays with the port as the output port to print strings through it delmarre: ? delmarre: or am I way off the mark? ft: You can just write to the port as if it was a file. ft: display works, or whatever. delmarre: okay sweet ft: Then you'll need to implement the plotter's protocol, of course. ft: stdout is often a serial link too, btw. When it's connected to a terminal emulator. Those have baudrates as well, because they emulate old serial hardware. ft: So yeah, there's not a lot special about this. delmarre: when your an art kid who knows v little about computers, there is haha ft: Well, you're using something that's not too much of a mainstream language, so it can't be that bad. :) ft: But more to the point, you just use termios to set up how the serial link should work, and if you're doing that correctly, the rest if pretty straight forward. ft: "Doing it correctly" can be a struggle. I'll admit that. :) ft: Especially if you don't know what setup the target uses. In that case: Oscilloscopes. :) delmarre: well I asked because I thought it might be easier to do than what I was going to do delmarre: which was get my scheme to output files for the plotter, and then actually send them using some python thing I have delmarre: would be nice to not have to worry about other languages again haha ft: :) delmarre: my plotter is 8n1 delmarre: so that makes life easier ft: Yeah, it's very common. ft: Now the the baudrate. :) ft: s/the the/to the/ delmarre: 9600 ;) ft: \\o/ ft: Good luck then! :) delmarre: so should be able to just use cf-make-raw! delmarre: set the speed delmarre: and be off delmarre: hopefully :p ft: Yes. delmarre: this is very good delmarre: will have to try it in the morning ft: delmarre: The first example in the manual is probably what you want. ft: https://github.com/ft/guile-termios/blob/master/doc/guile-termios.mdwn#examples ft: Although you may prefer the module that doesn't use exceptions. I guess that's a matter of taste. delmarre: yeah this looks perfect delmarre: when you close the port at the end of these examples delmarre: is that closing it from further modification delmarre: i.e. i would still go on to use tty as the output port even after? delmarre: or would I do everything up to that, then write a bunch of stuff to the port, and then close the port ft: you'd do the output before you close the port. ft: You can't write to a closed port. delmarre: sure, cheers ft: Neither can you read from one. delmarre: you'd think that would be obvious to me wouldn't you ft: Don't worry about it. ;) delmarre: Very lucky you were here when I asked about that delmarre: will actually be a boost for my life being able to do that ft: I'm sure someone else would know about serial ports as well. Maybe not about my module, though. :) ft: Don't think it has too many users. delmarre: how many people are still trying to get pen plotters to work delmarre: your audience is limited haha ft: I'll manage. :) daviid: guilers, playing with C snipset to boost some guile-cv critical f32vector procedures hover hude images, I wrote this https://paste.debian.net/995999 but to my surprise it returns wrong result for the min position: any C pro can help me? sneek: daviid, you have 2 messages. sneek: daviid, ArneBab says: do you mean you need to transform all three areas (IMAGE, SEEDS, shared) into coordinates relative to IMAGE? sneek: daviid, ArneBab says: or rather: each of the edges relative to the corresponding edge in IMAGE? daviid: ArneBab_: I was very tired :), the translation was as easy as minus left and top from the image particle ... solved, but thanks daviid: too bad my battery is getting low, I'll have to leave soon sneek: Okay. OrangeShark: daviid: r[0], r[2] = v[0]; are you trying to assign v[0] to both r[0] and r[2]? daviid: OrangeShark: no, both to v[0] daviid: OrqI mean yes daviid: is this allowed? OrangeShark: need to write it as r[0] = r[2] = v[0]; daviid: OrangeShark: thanks! OrangeShark: same for the next line daviid: of course, thanks OrangeShark: with that, you were just accessing r[0] and not doing anything with it, then assigning v[0] to r[2] daviid: OrangeShark: perfect, thank again, have to leave because of battery, bbl OrangeShark: daviid: no problem rekado_: I ported the rfc822 email header parser from Chicken to Guile. Is this something useful to have in Guile or should this be a separate package? rekado_: (The implementation in Chicken is itself a port of the implementation in Gauche) OrangeShark: hello everyone davexunit: hey OrangeShark OrangeShark: Are there any good examples of projects that are extendable using Guile or maybe like common designs for creating software that can be extended by Guile by users? ArneBab: OrangeShark: I don’t know which ones are *good* examples. Lilypond shows dangers of strong coupling — but also huge success — I don’t know how GNU Cash does it. ArneBab: OrangeShark: there is this: https://www.gnu.org/software/guile/#apps-using-guile OrangeShark: ArneBab: aren't Lilypond and GnuCash more like embedding Guile? ArneBab: OrangeShark: they use Guile to extend the program — embedding is a part of that OrangeShark: ArneBab: okay, I think I will look into these projects and probably emacs as well even though it not using Guile to see any common or useful designs (or bad designs to avoid??) ArneBab: OrangeShark: ah, you might want to look at emacsy: https://tech.slashdot.org/story/12/05/21/231217/emacsy-an-embeddable-toolkit-of-emacs-like-functionality https://github.com/shanecelis/minimal-emacsy-example OrangeShark: ArneBab: oh thanks, I will look into that too ArneBab: it was a proposed kickstarter, I’m not sure whether it got past the draft stage since only ~2k$ were raised (of 5 needed) ArneBab: here’s more: https://www.reddit.com/r/Emacsy/comments/1oxg9n/emacsy_talk_at_gnu_hacker_meeting_2013/ OrangeShark: ArneBab: thanks, I think I have a lot to look into now. ArneBab: here’s the (alpha-quality) code: https://github.com/shanecelis/emacsy wigust: OrangeShark: Here are some Guile mostly libraries than applications https://paste.pound-python.org/raw/SCkvNkqakfBFmFoHhm0F/ grabbed from https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile.scm OrangeShark: wigust: thanks, I am of aware of those. I am more interested in applications amz3: héllo all :) OrangeShark: hello amz3 delmarre: question for you guys delmarre: am thinking soon about building myself a framework for producing drawings on my pen plotter delmarre: and think i'm gonna be using guile (have been using chicken before) delmarre: what is the actual difference between vectors and arrays? delmarre: in guile delmarre: and considering most of my framework is gonna be about points on a plane and lists of points on a plane delmarre: can I just use vectors for lists of vectors delmarre: or would there be some advantage to making arrays of vectors? OrangeShark: delmarre: arrays are multidimensional delmarre: mhmm. reading through the reference and it says delmarre: (make-array 'ho 2 3) gives⇒ #2((ho ho ho) (ho ho ho)) delmarre: for example OrangeShark: a 2 dimensional array delmarre: seems to me like you could make a (vector (vector ho ho ho) (vector ho ho ho)) delmarre: and have the same thing really delmarre: and implement some way of building these with a given shape OrangeShark: delmarre: I think array uses a single vector underneath OrangeShark: delmarre: "In the current implementation, an array uses a vector of some kind for the actual storage of its elements" OrangeShark: delmarre: in the example, it would be like (vector 'ho 'ho 'ho 'ho 'ho 'ho) OrangeShark: that is how array stores it delmarre: okay delmarre: and you also can't have an array of vectors delmarre: oh wait delmarre: maybe you can OrangeShark: yeah, but why would you need an array of vectors? davexunit: OrangeShark: you're familiar with Haunt. that's extensible with guile. but I guess it's not exactly what you're looking for. delmarre: idk yet haha davexunit: Guile itself is extensible with Guile using the .guile file OrangeShark: davexunit: yes, I am just curious of other ways delmarre: no i guess i won't need arrays of them OrangeShark: delmarre: what values will you be storing in them? delmarre: i suppose i will just be working with positions, sets of points on a line... delmarre: and some velocity, acceleration vectors daviid: delmarre: I would look into other similar projects and see what data structures they selected, try to avoid a bad start design ... delmarre: yeah for sure delmarre: i know there's a guy doing something similar in lisp delmarre: will have to look over his stuff daviid: plotting is as old as computer 'science' daviid: the racket folks may have some, or chicken ... delmarre: for sure. unfortunately the people who did it early were much smarter than me haha amz3: =) wingo: moo amz3: héllo #guile nalaginrut: heya nalaginrut: ACTION is glad to see websocket works nalaginrut: in artanis nalaginrut: but still preliminary delmarre: anyone know about getting guildhall working? delmarre: having some issues with it delmarre: or do you guile guys use some other way to share modules? OrangeShark: hello everyone dsmith-work: Hey Hi Howdy, Guilers dsmith-work: sneek: botsnack sneek: :) delmarre: hello people manumanumanu: hello delmarre: i'm a chicken guy, had some questions for you guys since it looks like I'm moving over to guile for a bit delmarre: trying to get this guildhall thing going but having some trouble, was wondering whether this is actually what you lot use for sharing modules delmarre: or is there something else you all use? catonano: delmarre: guix ? davexunit: yeah guix davexunit: there's a new guildhall in the works that will use guix, but I don't think it's ready yet davexunit: so you can get what's available in guix or just clone people's git repos davexunit: guile doesn't encourage the "one package manager per language" trend delmarre: okay sweet, will look into it delmarre: cheers! mistnim_: one package manager to rule them all happy_gnu[m]: kristofer: thanks!! happy_gnu[m]: amz3`: thanks too!! daviid: anyone good at math can help me with this small coordinate translation problem: given two bounding boxes, one for an object in IMAGE and the other for another object in SEEDS, for example '(78 0 200 47) in IMAGE and '(62 29 79 35) in SEEDS, I know they share an area calculated as '(78 29 79 35) daviid: now, for some reason can not explain (to long), I actually need to convert these in terms of relative to the object of IMAGE, so given by '(78 0 200 47) daviid: these coordinate are (left top right bottom) in a coordinate system where the Y axis points down daviid: in this particular example, I can calculate that the coordinates of the 'shared' object in the 'sub image' object are 0 29 121 12 daviid: nope, wrong already! daviid: these would be 0 29 1 35 daviid: fine, but I failed to come up with a formula which work in all cases, a bit tired, decided to see if anyoe is more awake then myself :):) ArneBab: sneek: later tell daviid: do you mean you need to transform all three areas (IMAGE, SEEDS, shared) into coordinates relative to IMAGE? sneek: Will do. ArneBab: sneek: later tell daviid: or rather: each of the edges relative to the corresponding edge in IMAGE? sneek: Got it. ArneBab: sneek: botsnack sneek: :) amz3: hélll all! amz3: héllo all :) ArneBab: hi ☺ rekado_: like amz3 reported a few days ago, I cannot seem to get (web client) to work with gnutls. rekado_: ERROR: In procedure get-bytevector-n: rekado_: ERROR: Throw to key `gnutls-error' with args `(# read_from_session_record_port)'. rekado_: Do you know how I can debug this? amz3: I use the following as a workaround: https://github.com/a-guile-mind/culturia.one/blob/master/src/web/helpers.scm#L68 amz3: I don't know how to debug rekado_: Oh, wrapping curl is nasty :) rekado_: I think I’ll just snarf the working code from Guix’s (guix build download) civodul: rekado_: would be good to see why (web client) fails civodul: it is/used to be the same code as in (guix build download) rekado_: it looks rather simpler than what is in (guix build download) civodul: maybe it lacks the server authentication code, no? rekado_: (guix build download) catches 'gnutls-error whereas (web client) does not rekado_: but that’s probably not important here civodul: right, it's even a good thing that (web client) doesn't catch it rekado_: tls-wrap in (web client) uses a custom binary port rekado_: “make-custom-binary-input/output-port” lloda: looking for an Emacs spell to indent define-values properly and not as if it was a function definition amz3`: héllo #guile nilg: I'm pretty sure there is a function to a load a file without compiling, but I can't find (duckduckgo didn't find it) bavier: nilg: "load"? nilg: Apparently not, according to https://www.gnu.org/software/guile/manual/html_node/Loading.html#Loading this is equivalent to compiling, then loading nilg: I know one can call guile with option `--no-auto-compile` but that is not what I'm looking for, rather I'm looking for a way to disable compilation on some files rekado: that error in (web client) is the only thing that keeps me from making a proper release of guile-debbugs. amz3`: rekado: you made a http client library for debbugs? OrangeShark: hello everyone amz3`: héllo OrangeShark OrangeShark: how are you amz3`? OrangeShark: What are you working on now? rekado_: amz3`: it’s a SOAP client library, yes. OrangeShark: rekado_: debbugs uses SOAP? rekado_: OrangeShark: it provides a SOAP service, yes. The Emacs interface connects to the SOAP service as well. amz3`: OrangeShark: nothing, I am looking for a new job.. happy_gnu[m]: Hello \\o/ happy_gnu[m]: Where can I read more about this type of AI happy_gnu[m]: I have no idea how to design it davexunit: does anyone happen to know how to specialize how a goops accessor sets a value? davexunit: I want (set! (bar foo) 'frob) to do more than just (slot-set! foo 'bar 'frob) daviid: davexunit: there is an option for that daviid: in the slot definiti0n itself daviid: let me find an example for you daviid: #:slot-set! (lambda (self value) ) daviid: davexunit: another way is to define a setter or an accessor and writ a method for it daviid: that might be cleaner, becuse at some point you want to actually call (slot-set1 name value) ... the above example I use only for virtual allocation ... daviid: *slot-set! daviid: hth daviid: davexunit: not sure I was clear but you would would specify an accessor n the slot def, then write a setter method, within which you call slot-set! ... daviid: here is an example http://git.savannah.nongnu.org/cgit/grip.git/tree/grip/clutter/bouncer.scm - when a user sets the colour of a bouncer, more has to be done then 'just' slot-set! ... - (line 68: (define-method ((setter !colour) (self ) rgba) ... davexunit: daviid: the #:slot-set! slot option seems to only work for virtual slots davexunit: daviid: a-ha! (define-method ((setter ...) ...) ...) davexunit: that sheds some light on things davexunit: thanks! daviid: davexunit: yw! davexunit: that's some brilliant stuff daviid: thank you! laertus: i'm trying to compile guile-wm, and configure tells me: "error: required guile module not found: (xcb xml)" laertus: how do i install those modules? OrangeShark: laertus: install guile-xcb OrangeShark: https://github.com/mwitmer/guile-xcb laertus: guile doesn't have a package manager i could use laertus: ? OrangeShark: laertus: a lot of people are using GNU Guix as their package manager, but you can install the module yourself laertus: ah, guix, yeah... that's way too heavyweight for me, unfortunately OrangeShark: laertus: xcb doesn't have any dependency laertus: yeah, i'll do it manually OrangeShark: so you can install from a release amz3: héllo all :) OrangeShark: hello amz3 kristofer: hello! OrangeShark: hello kristofer kristofer: I've been coding up a web app with artanis.. it's doable but particularly frustrating that the art work command doesn't spawn a repl server for geiser to connect to. I have attempted to spawn one from the ENTRY file with (spawn-server ..) -- if I connect geiser to the socket, artanis crashes. kristofer: excitingly, using the guile server instead of ragnarok does the trick. happy_gnu[m]: kristofer: hi!! I can't help because I am too noob but can you share your code with me and an artanis link :) happy_gnu[m]: I want to learn ! kristofer: happy_gnu[m]: there is a pretty simple tutorial at http://web-artanis.com/ and the documentation is detailed amz3`: hélllo #guile :) amz3`: monday, a new beginning... amz3`: about the gentleman that added autotools to my project, he is working on graph stuff amz3`: something about mowing stuff a getting the shortest path to do it amz3`: but it's still no ready for production (tm) amz3`: incoming a guide about writing web apps in racket https://gumroad.com/l/serverracket# adfeno: What is a good tutorial for starting to program in Scheme, for non-programmers? mwette: http://download.plt-scheme.org/doc/205/pdf/t-y-scheme.pdf adfeno: Oh... thanks mwette :) happy_gnu[m]: adfeno: The Little Schemer! adfeno: :) happy_gnu[m]: adfeno: https://7chan.org/pr/src/The_Little_Schemer_4th_2.pdf happy_gnu[m]: Also How to Design Programs and SICP of MIT adfeno: SICP is a good one :) adfeno: ... also it is at-least-shareable :) happy_gnu[m]: How to Design programs is CC BY-NC-ND adfeno: +1 :) mwette: ACTION is out for the night noxdafox: greetings, do you know if there's any support for pathname matching in guile similar as for the fnmatch function? mwette: noxdafox: you could write it pretty quick using ffi interface, I think noxdafox: that's what I am doing, weird it's missing tho as it's pretty basic noxdafox: I found some e-mail on guile-devel dated back to 2001 but not much more mwette: noxdafox: http://paste.debian.net/995335/ noxdafox: mwette: thanks! I was half way through :D noxdafox: had some issue with dynamic-link which got me stuck noxdafox: so calling dynamic-link with no arguments leads to libc being linked? noxdafox: nice! it was not documented and didn't dare to try mwette: noxdafox: it depends. On my mac if I use dynamic-link a library I can later refer to routines using (dynamic-link). That does not work on Centos. mwette: but yea. If bound into guile I think yo ucan use just (dynamic-link) noxdafox: debian works as well ArneBab: OrangeShark: would you allow me to include your article in with-guise-and-guile? It would be a great match: http://www.draketo.de/proj/with-guise-and-guile/index.html ArneBab: OrangeShark: with-guise-and-guile is a project which I want to develop into something like an unregularly published collection of articles focussed on elegant and efficient Scheme. I’m working with org-mode because I want to be able to easily turn it into editions (i.e. yearly collection) as PDF, epub, … ArneBab: currently the design just provides the bare basics, but that can easily be changed by editing the theme :) (so I can do it while also working on the content) OrangeShark: ArneBab: sure, you can do it :) ArneBab: thank you! OrangeShark: that seems like an interesting project idea. daviid: who says python is beautiful? and who wants non-programmers to read and edit your code? :) (teasing time...) ArneBab: OrangeShark: let’s get the licensing done right away. Is cc by-sa ok? ArneBab: (cc by would make it even easier, but I’m not sure whether it wouldn’t have bigger drawbacks) ArneBab: daviid: obviously I do ☺ OrangeShark: ArneBab: that is what it is currently licensed as ArneBab: ah, great! ArneBab: (dang, I missed the footer. Sorry) OrangeShark: ArneBab: that is okay OrangeShark: I've been wondering if we should really all get together and try to reorganize all the projects and documentation together ArneBab: I think that’s a pretty large task OrangeShark: yeah, but I think it is something we need. ArneBab: OrangeShark: is it something you’d like to do? OrangeShark: ArneBab: yeah, I keep thinking about it. There is a bunch of things I want to do to try and help Guile. ArneBab: do you think you could finish it? ArneBab: (that’s the really hard part about this) ArneBab: OrangeShark: I added your article: http://www.draketo.de/proj/with-guise-and-guile/guile-projects-with-autotools.html OrangeShark: ArneBab: awesome :) ArneBab: and the articles now all have license footers OrangeShark: ArneBab: not sure, how would you ever know if you have finished? ArneBab: that’s the first question to ask before starting the task :) ArneBab: for with guise and guile: One task is done when one issue is released OrangeShark: it really seems like something that needs to be continually maintained as Guile evolves ArneBab: OrangeShark: then it should live in the texinfo files ArneBab: to help to keep it matching the source OrangeShark: books and articles should also play an important part ArneBab: yes, but fragmentation and stale projects have a cost OrangeShark: I was reading online what negative point that guile has is the libraries. When you compare it to something like racket, they are all use the same documentation format ArneBab: (especieally when stuff is highly coupled) ArneBab: ah, so you mean, going through libraries and making them more canonical? ArneBab: that sounds like something which would have a purely positive impact — but also like hard work OrangeShark: yeah, it a lot of work ArneBab: but then, it can easily be split up into tasks you can finish ArneBab: each library is one OrangeShark: yup OrangeShark: would be great if it was more consistent, so same build tools and documentation. davexunit: is a char-set an ordered data type? davexunit: as in, is it merely a coincidence that iterating over (char-set #\\a #\\b #\\c) starts at #\\a, then goes to #\\b, then #\\c? amz3`: héllo all manumanumanu: amz3``: héllo! amz3``: :) amz3``: manumanumanu: did you manage to write a scheme reader in guile? amz3``: or it wasn't you? manumanumanu: amz3``: nah, I installed guix and now have access to guile-reader manumanumanu: which is all I ever wanted amz3``: ok manumanumanu: but I have a work-in-progress manumanumanu: r6rs-compatible strings and comments and some char stuff manumanumanu: somewhere at least manumanumanu: I did a complete re-install amz3``: on my side, I completly lost manumanumanu: oh? how come? amz3``: I don't know which project I should focus on manumanumanu: haha. I know the feeling amz3``: ^^ amz3``: I had this idea of building a search engine amz3``: but now I don't know amz3: I just filled an issue against 2.2.2 about web client https amz3: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29258 rekado_: amz3: I also wish for built-in support for https. janneke: i also wish for websockets on the same port as http* mwette: https works if you install gnutls, I believe amz3: i have gnutls amz3: woot! it seems like there another user of wiredtiger, they just sent me a patch to add autotools to wiredtiger amz3: awesome amz3: and a guix package definition mwette: I installed gnutls using `./configure --enable-guile'. YOu should see gnutls.scm in /.../site/2.2/ happy_gnu[m]: Hi \\o/ manumanumanu: Hey ho! rekado_: I have gnutls and can load it in a REPL. mwette: then (http-get "https://...") should work, unless I missed something; it works for me mwette: di amz3: I am in the process of re-installing guix amz3: I will try that OrangeShark: hello everyone manumanumanu: Hello OrangeShark manumanumanu: What are you up to today OrangeShark: manumanumanu: not sure yet. I might continue working on this online class I am taking on Pharo smalltalk amz3: mwette: did you use guix? amz3: hi OrangeShark OrangeShark: hello amz3 ArneBab_: amz3: yay! amz3: ArneBab_: :) amz3: well, I re-installed guix from scratch and I still can't do (https-get "https://gnu.org") rekado_: (re-installing guix from scratch should not be necessary. It is stateless.) mwette: I did not install with guix janneke: mwette: wow, that was quick! janneke: ACTION goes off to test 0.82.2 janneke: mwette: make install fails for me janneke: make[1]: *** No rule to make target 'nyacc/lang/c99/util2.scm', needed by 'install-srcs'. Stop. mwette: ugh. util2.scm has been changed to munge.scm janneke: oh, it goes wrong before too janneke: ERROR: nyacc/util: input-stack/2 - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #f) (#f))) mwette: I have not been testing the install. I will add that to the release tests. janneke: mwette: here's what happened: http://paste.debian.net/995202/ mwette: janneke: checking ... mwette: I changed .../c99/util2.go to .../c99/munge.go in modules/Makefile.nyacc and it works for me mwette: I just uploaded 0.82.3 to savannah. janneke: ACTION is packaging... manumanumanu: OrangeShark: I have used SeaSide a bit. Really fun, and I hate webdev :) janneke: mwette: i have a package, grand! mwette: janneke: sweet OrangeShark: manumanumanu: this course uses SeaSide as well, the end result is to make a blog using it mwette: Here is code using http-get and gnutls. If you check www/client.scm you will see where gnutls gets pulled in. manumanumanu: OrangeShark: SeaSide is amazing. I really really really hate web development, but I could even enjoy seaside. mwette: (use-modules (web client) (web response)) mwette: (let ((resp (http-get "https://developer.gnome.org"))) mwette: (simple-format #t "code=~S\\n" (response-code resp))) janneke: mwette: thanks, the def-bwl.c bug is fixed...found another bug compiling tinycc though that's not present in 0.80.4 janneke: i need to create a small test for you mwette: janneke: OK. I hope I am not in a livelock situation w/ bugs :) mwette: janneke: I did add the def-bwl test case: test-suite/.../ex17.c janneke: mwette: :-) it may still be a problem on my side, i realise janneke: cannot reproduce in tiny example yet janneke: mwette: thanks! mwette: janneke: And I did notice the error from nyacc/lang/util.test. I will fix. janneke: mwette: i'm getting a parse error that puzzles me: janneke: ./tccpp.c:498: parse failed at state 203, on input "=" janneke: that line lists: tal_header_t *h = (tal_header_t*)toksym_alloc->p; mwette: If you go to test-suite/nyacc/lang/c99 and run `guile Tmach.scm' you will get a lang.txt file that lists the states. Where did you get tinycc? github? civodul: wingo: any thoughts on slot allocation for large functions? civodul: https://lists.gnu.org/archive/html/guile-devel/2017-10/msg00049.html wingo: civodul: i think we need to write a new slot allocator for use with -O0 wingo: or possibly for use also for large functions without loops wingo: something that doesn't do the lazy allocation optimization, and something that uses linear liveness ranges janneke: mwette: i heavily patched tinycc, here: https://gitlab.com/janneke/tinycc #wip-mescc branch civodul: wingo: ok janneke: mwette: but to be able to parse it in full, you'll need some .h headers (that are included with mescc) civodul: wingo: do you think of a "quick/easy" strategy we could use? mwette: janneke: I don't need that. I can put something together. janneke: :-) janneke: you may not need my patched tinycc at all, though, i got my upstream from: http://repo.or.cz/tinycc.git wingo: civodul: dunno how to describe one :) basic idea is to produce an $allocation, the same data structure, but using once-through passes instead of fixpoints that create intmaps of intsets civodul: hmm ok civodul: ACTION feels powerless :-/ wingo: :( wingo: because the internals are too opaque? civodul: because i know too little about what's going on, i think wingo: or because you have already a lot on your plate and this is just another thing :/ civodul: that too :-) wingo: :) wingo: i understand & sympathise happy_gnu[m]: I have no idea what is an allocator haha.. What do I have to learn to understand this conversation happy_gnu[m]: Learn C? wingo: this is all in scheme, about how guile decides where to store local variables mwette: janneke: I am puzzled. I made something with similar syntax and it works. wingo: slot-allocation.scm wingo: anyway happy_gnu[m]: So read Guile manual? happy_gnu[m]: I am reading it but is gigantic janneke: mwette: me too wingo: civodul: i can get to it within a week or so maybe; or do you prefer i help you to understand it? janneke: mwette: i tried to recreate an exact example and failed. i'm currently bisecting the actual source wingo: i think i have an idea in mind, *if* the memory use spike is essentially in slot-allocation.scm civodul: wingo: i think it'd be hard to get me up to speed over IRC ;-) wingo: i wasn't able to precisely pin that down in the past but maybe you have done more science on that recently civodul: the memory spike is in compute-sorted-strongly-connected-components, AFAICS mwette: janneke: I'm off to play . Let me know via email if you get somewhere. janneke: mwette: will do, thanks a lot! wingo: civodul: do you have a ml posting that proves that before slot-allocation, things are fine, and after, things are bad? mwette: wingo: I think I understand much of the PC-ML paper. It looks clearly synchronous to me. Is the term "asynchronous" in the Operations section of the Fibers manual a typo? civodul: wingo: there's https://lists.gnu.org/archive/html/guile-devel/2017-10/msg00035.html where i mention compute-live-variables civodul: i've looked more closely since, and most of it comes from compute-sorted-strongly-connected-components wingo: ACTION nod civodul: ACTION goes afk for a bit wingo: could be a nice little speedup on compute-sorted-strongly-connected components for graphs without loops wingo: anyway wingo: mwette: could be that word is confusing, should probably just remove it wingo: channel operations for example are synchronous relative to timelines of threads/fibers operating on channels mwette: wingo: thanks. I was thinking. mwette: wingo: ... that. Like Ada rendezvous. janneke: mwette: narrowed it down... mwette: janneke: Thanks. I'm on it. I decided to stay home and nerd out for now. janneke: mwette: what? no play! ... dude! janneke: ;-) mwette: janneke: I found an issue: (parse-cpp-expr "defined(USE_FOO)") => '(defined "UUSE_FOO") mwette: and I think I know where the problem is. The new code to parse U'x' as a character. janneke: oops... mwette: janneke: that was it. lex.scm:298 mwette: remove `(unread-char ch)' janneke: ACTION has a look mwette: janneke: I'm using erc in emacs. What is the command to do that: '* janneke has a look'? janneke: mwette: "/me blah blah" janneke: ACTION blah blah mwette: ACTION ha ha mwette: janneke: thanks! janneke: alright! janneke: np mwette: janneke: Let me know if everything works then I will push out another release janneke: mwette: that fixes parsing tcc, i hit yet another error ... in the pretty printer this time janneke: In nyacc/lang/c99/pprint.scm: janneke: 207:4 7 (_ ((p-expr (string "\\x7fELF")) (p-expr (fixed "4")))) janneke: nyacc/lang/c99/pprint.scm:84:22: In procedure string-ref: Value out of range: 15 janneke: let's see what i'm pretty printing there... mwette: janneke: Ah! The string is missing `F', just add mwette: pprint.scm, line 84 in itox janneke: ok; just found this fails: (pretty-print-c99 '(if (and (eq (p-expr (ident "size")) (sizeof-type (type-name (decl-spec-list (type-spec (typename "Elf32_Ehdr")))))) (eq (p-expr (fixed "0")) (fctn-call (p-expr (ident "memcmp")) (expr-list (p-expr (ident "h")) (p-expr (string "\\x7fELF")) (p-expr (fixed "4")))))) (ellipsis) (ellipsis))) janneke: i'll try that janneke: yes, i see janneke: ACTION goes for another test run janneke: mwette: just a bit more preprocessor ugliness mwette: janneke: bring it on! janneke: haven't tracked it down yet, in my .M1 output i see this diff (-bad, +good) janneke: the ELF32_ST_INFO macro doesn't get expanded to (0<<4) + (3 & 0xf) janneke: something like that, and it's probably a macro in a macro... mwette: doing a better job with the CPP would require recoding to have it push out a token stream instead of text, and then the C lexer would have to be reworked also. I should do it, but a big task, likely. janneke: mwette: this now breaks: http://paste.debian.net/995216/ janneke: it used to (should) produce: (trans-unit (fctn-defn (decl-spec-list (type-spec (fixed-type "int"))) (ftn-declr (ident "main") (param-list)) (compd-stmt (block-item-list (expr-stmt (add (lshift (p-expr (fixed "1")) (p-expr (fixed "4"))) (bitwise-and (p-expr (fixed "0")) (p-expr (fixed "0xf"))))))))) janneke: but it now gives: (trans-unit (fctn-defn (decl-spec-list (type-spec (fixed-type "int"))) (ftn-declr (ident "main") (param-list)) (compd-stmt (block-item-list (expr-stmt (fctn-call (p-expr (ident "ELF32_ST_INFO")) (expr-list (p-expr (fixed "1")) (p-expr (fixed "0"))))))))) mwette: janneke: I'll work it. mwette: janneke: got it fixed. I had to repeat the recheck for function macros also janneke: mwette: nice! mwette: janneke: http://paste.debian.net/995221/ mwette: that goes in nyacc/lang/c99/cpp.scm janneke: mwette: and with that, mescc can build tinycc again! woohoo mwette: janneke: I will wrap up and upload. Thanks for your patience. janneke: mwette: very happy with nyacc and esp. your support mwette: PASS: nyacc/c99-01, CPP: Jan's macro-name redef test mwette: PASS: nyacc/c99-01, CPP: Jan's ELF32_ST_INFO macro test mwette: janneke: ACTION builds guix package for 0.82.4 janneke: ACTION sent update nyacc patch to guix civodul: \\o/ civodul: janneke: if it works for you you can go ahead and push! janneke: civodul: thanks, tested will push ArneBab_: manumanumanu: it’s trivial to install, but that still means you don’t always have it at hand. ArneBab_: you can’t just tell new users in a tutorial to code like that happy_gnu[m]: What do I need to know for making a bot that requests Open Weather and outputs weather of requested city happy_gnu[m]: Besides Open Weather API of course happy_gnu[m]: Will it work just with Guile web client? happy_gnu[m]: Or should I use something more? affinespaces: kind of a dumb question -- sorry. it's not clear to me how to import the peg parsing module. how does one do that? affinesp1ces: i tried (use-modules (ice-9 peg)) to no avail ArneBab: did you check the info-pages? ArneBab: hm, I don’t find it there affinesp1ces: yeah I looked pretty thoroughly -- no luck. ArneBab: (use-modules (ice-9 peg)) should work ArneBab: which version of guile do you use? ArneBab: PEG was added in 2013, so you’ll need a 2.x guile affinesp1ces: 2.0.11 affinesp1ces: hmhm ArneBab: hm, then it should be included (that’s from 2014) affinesp1ces: [scm-error misc-error #f "~A ~S" ("no code for module" (ice-9 peg)) #f] affinesp1ces: that's the specific error i'm getting affinesp1ces: hm strange ArneBab: how did you build Guile? affinesp1ces: i installed using apt affinesp1ces: maybe i'll purge and try a fresh install ArneBab: find /usr/share -name peg.scm ArneBab: ^ this is empty for me … ArneBab: on my computer 2.2 has peg.scm, but 2.0 does not affinesp1ces: oh huh ArneBab: do you have a way to get Guile 2.2? affinesp1ces: building it now manumanumanu: affinesp1ces: hold on to your chair when using it the first time. The speed-ups might blow you out of your chair :) affinesp1ces: haha beautiful :) affinesp1ces: guile: error while loading shared libraries: libguile-2.2.so.1: cannot open shared object file: No such file or directory affinesp1ces: nooooooo affinesp1ces: oh all good affinesp1ces: and (use-modules (ice-9 peg)) works woo ArneBab: affinesp1ces: Happy Hacking with Guile! affinesp1ces: thanks for your help :] manumanumanu: I have thought about building a markdown parser for guile using PEG. It should be rather simple, since there are already PEG parsers for markdown out there affinesp1ces: oh neat manumanumanu: like porting jgm's peg-markdown manumanumanu: that would be a lo of work, but very doable manumanumanu: a lot less work than porting something like pandoc's markdown parser :) lloda`: wish Guile had raw strings civodul: lloda: raw strings? lloda: like R"xxx(I can freely use \\ and " and ' inside this raw string literal)xxx" in c++ manumanumanu: lloda: you could probably hack something together using hash reader extensions manumanumanu: or write an automatic escaper for emacs :) lloda: yes I should write the reader ext... manumanumanu: lloda: https://www.gnu.org/software/guile/manual/html_node/Reader-Extensions.html lloda: manumanumanu: thx. I have written extensions before, I'm just being lazy :-/ manumanumanu: I have two extensions in my prelude: #l(x (length x)) => (lambda x (length x)) and #c(char=? #\\a <>) => (cut char=? #\\a <>) manumanumanu: I had one where {blah <> 1} = manumanumanu: became (cut blah <> 1}, but that required hijacking curly-infix lloda: interesting lloda: I wrote one for reading arrays https://github.com/lloda/guile-newra/blob/master/mod/newra/read.scm manumanumanu: haha, mine were a lot easier :D you can ust read the whole expression using read and then just `(cut @,splice) it in. lloda: manumanumanu: I think I wouldn't a reader ext to save two characters compared to a macro... lloda: I see the value if you do something a lot, though manumanumanu: It is mostly a matter of principle. I think cut and lambda is line noise in a language that relies so much on higher ordered functions. manumanumanu: I understand what you mean though. I only use it at the repl lloda: manumanumanu: the famous toenail soup lloda: I use λ etc sometimes lloda: characters that stand out somehow. ArneBab: lloda: can’t you use (read-enable 'r7rs-symbols) and then (symbol->string |…|)? ArneBab: ah, no, there it escapes, too ArneBab: manumanumanu: I use wisp, and there lambda is just: λ() ... — for short expressions, saving the outer parens saves a lot of (relative) noise rekado: amz3`: here’s a little bit of feedback: “There is no package manager outside of guix which is still experimental”; Guix is not experimental. rekado: amz3`: also, as an intro to Guile it seems to try hard to convince people to use some other language instead rekado: like Python or even Rust. rekado: I think it’s not a good idea to crush the reader’s motivation so soon. rekado: you can always crush motivation later ;) rekado: amz3`: “A procedure is equivalent to what other languages call a function” – depends on what other languages you mean. “procedure” is used in C, for example. A function is a certain kind of procedure. manumanumanu: ArneBab: I don't have a neat way of writing the lambda char, but #l( is still rather convenient. at the repl i still have {} for cut, but sometimes it borks with readline, so I have started to avoid it manumanumanu: So, I am an emacs user, unlikely to change. However, friends of mine are interested in guile, but fiercly anti-emacs. What, preferrably nice gui colourful with flashy wobbly animations, editors are there that provide decent lisp/scheme editing jlicht: manumanumanu: spacemac ;-) jlicht: *spacemacs jlicht: but on a more serious note, I know of some people using vim for lisp-related coding. Not sure whether the editors support any shiny features though manumanumanu: jlicht: yeah, I have already tried, but they want "an editor that has entered the 21st century" to quote one of them manumanumanu: I don't condone that sentiment, but they are sincere manumanumanu: They will find the right path with time nee`: manumanumanu: I never used it myself, but maybe Atom? It's not proprietary and it seems to have a parinfer addon: https://atom.io/packages/parinfer manumanumanu: neat. manumanumanu: nee`: thanks. OrangeShark: manumanumanu: there is Light Table http://lighttable.com/ but I think it only has support for clojure. I don't see any plug ins for other lisps manumanumanu: there is apparently parinfer for vscode ArneBab: manumanumanu: for me the λ char is M3-Shift-l — you could add a shortcut in your emacs lloda: I use C-\\ tex and then \\lambda ArneBab: manumanumanu: I think Emacs has pretty much entered the 21st century, after all Blender and Atom are modelled after it, but Atom seems to be something they could use. Especially if by 21st century they mean "cool web app" ☺ manumanumanu: ArneBab: I have used emacs since 1999. You don't need to convince me :D OrangeShark: ArneBab: lloda: there is also prettify symbols mode that allows you to replace strings with symbols. So you can have lambda be replaced with the lambda symbol while that mode is turned on lloda: manumanumanu: ArneBab: wrote that reader extension https://github.com/lloda/guile-raw-strings ArneBab: lloda: wow, cool! lloda: OrangeShark: didn't know, thx ArneBab: "char-please" ☺ ArneBab: ^ nice OrangeShark: lloda: It a pretty cool feature and you can add your own symbols ArneBab: lloda: I think it could be cleaner to name loopa and loopb by their task — for example reader and raw-reader. ArneBab: or … no, I misunderstood them ArneBab: (loopa → char-reader) (loopb → delimiter-tester) lloda: ArneBab: thx :) I'll clean it up later ArneBab: thank you! ArneBab: lloda: next question: Can we get this into Guile? ☺ lloda: ArneBab: all I can do is take it to the list ArneBab: lloda: that sounds already good ArneBab: how can I set the sitedir to be in my home in a configure script ← autotools question ArneBab: want to get GUILE_SITE to be at ~/.local/share/guile/VERSION/site OrangeShark: ./configure GUILE_SITE=~/.local/share/guile/VERSION/site? OrangeShark: assuming the project uses GUILE_SITE as the variable ArneBab: OrangeShark: is there a way to only set something to ~/.local/share/ and have it finde guile/VERSION/site itself? ArneBab: hm, OrangeShark: you could OrangeShark: if you use datadir in automake OrangeShark: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html#Directory-Variables OrangeShark: datadir default to /usr/local/share OrangeShark: so if in your automake file, you use datadir, you can then do ./configure datadir=~/.local/share/ OrangeShark: moddir=$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION) OrangeShark: you can even just change prefix to change everything's install location OrangeShark: ./configure preifx=~/.local OrangeShark: ./configure prefix=~/.local OrangeShark: ArneBab: I wrote https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html for setting up a guile project, did my best to explain everything ArneBab: OrangeShark: cool! ArneBab: that tutorial is awesome! ArneBab: something I wished to have for a long time OrangeShark: ArneBab: I've wanted one too :) ArneBab: thank you for making it! happy_gnu[m]: Hello \\o/ ArneBab: hello happy_gnu[m] ☺ manumanumanu: Wahoo! manumanumanu: Guix is installed manumanumanu: sweet times davexunit: OrangeShark: nice post! much needed davexunit: nice choice of static site generator ;) OrangeShark: ArneBab: davexunit: thanks :) OrangeShark: davexunit: was better than the static site generator I wrote and also has some decent support for markdown ;) johrpan: Hi guys! How do I hide the copyright and help information shown at Guile's startup (if that's possible)? manumanumanu: johrpan: nothing in the man-file. maybe there is some voodoo you could do davexunit: OrangeShark: you've got yourself to thank for the markdown support :) johrpan: manumanumanu: Yes, I also searched before, but it's not that important. I just don't wanna see it every time. davexunit: AFAIK it's non-optional davexunit: yeah, just read the repl code to verify johrpan: Actually something I could have down, yes. davexunit: you may not have known where to look davexunit: this is a request I've heard several times, so perhaps a REPL option could be added which we could hook up to the CLI davexunit: doesn't seem too hard to accomplish lloda: johrpan: I remember answering this on IRC a couple years ago... all you have to do is define away *repl-welcome* in (system repl common). lloda: like, put this in .guile: lloda: (set! (@@ (system repl common) repl-welcome) (const #f)) lloda: that's it bavier: was just what I was going to suggest johrpan: Ok, I'll give it a try. johrpan: lloda: Oh yeah, this works perfectly well, thanks a lot! johrpan: May be I'll miss it soon... lloda: johrpan: yw happy_gnu[m]: ArneBab: hi :) mwette: thanks for that. davexunit: lloda: good hack! davexunit: should've thought of that davexunit: we have a fully hackable environment ArneBab: lloda: oh, wow, that shoould be in the manual… amz3`: rekado: tx ArneBab: can I create an array which is used as function properties without using the #((...)) syntax? ArneBab: (define (f) "docstring" #((test '(foo))) #f) ArneBab: (procedure-properties f) ArneBab: ((name . f) (documentation . "docstring") (test (quote (foo)))) ArneBab: (define (f) "docstring" #((test (foo))) #f) ArneBab: what does not work: ArneBab: (define (f) "docstring" (list->array 1 '((test (foo)))) #f) manumanumanu: So, anyone using guix? I have guile2.2 installed. I have installed guile-colorized, but it is not available anywhere OrangeShark: manumanumanu: is it on your load path? OrangeShark: you should see it in .guix-profile/usr/share/guile/site/2.2/ice-9 manumanumanu: OrangeShark: yup, and it is installed by guix, but I have no usr/share directory in my guix profile dir manumanumanu: this is all very weird manumanumanu: I might have messed up my config manumanumanu: I think I have, by using a sudo shell and not a proper root shell manumanumanu: because trying to install things as root gives me errors relating to incoherent packages OrangeShark: oh you are installing it on root? manumanumanu: no, but I probably was in a sudo -s shell sometime manumanumanu: and that has borked everything OrangeShark: actually it should be installed in .guix-profile/share/guile/site/2.2/ice-9 manumanumanu: OrangeShark: it isn't there :( I'm starting over OrangeShark: okay, be sure after you finish installing guix, you install stuff as a regular user manumanumanu: I know. and I will use a proper root shell for root work manumanumanu: this has bitten me so many times manumanumanu: OrangeShark: is there any way to force a package to a specific guile version? both guildhall and colorized is installed in the 2.0 site dir :( OrangeShark: manumanumanu: with guix? manumanumanu: yu manumanumanu: p OrangeShark: there needs to be a separate version for guile 2.2 manumanumanu: I'll just place them in the site dir in my home dir happy_gnu[m]: hi happy_gnu[m]: can anyone here help me with a Guix package for Chickadee, I have a recipe but I am having trouble to build it manumanumanu: is anyone running guildhall for 2.2? janneke: happy_gnu[m]: didn't chickadee have a guix.scm, ready to use? manumanumanu: that'll be my first try at writing a guix package daviid: manumanumanu: guildhall does not work with 2.2, but potluck does, which is our next guildhall (thou I don't use it myself yet, just saying this to help...) manumanumanu: ah happy_gnu[m]: janneke: guile-sly had one happy_gnu[m]: I am using that as a base daviid: manumanumanu: there is a long and very nice eamil written by andy about potluck daviid: manumanumanu: https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00250.html manumanumanu: ah! manumanumanu: neat! stis: whos nick is working on nyacc and the ffi helper ft: Is it mwette? bms_: Hello. ArneBab_: happy_gnu[m]: would you share that bot? numerobis: Hi! Does anyone know how to create an array of integers in guile using (make-array-typed ...)? I can't seem to find the how to write the "integer" type in the manual. Thanks! civodul: numerobis: you could use the SRFI-4 API for that civodul: like 'make-u8vector', etc. numerobis: civodul: thank you very much, I think that would work! civodul: yw! manumanumanu: Ahoy hoy! Ober: srfi's are soo nice manumanumanu: Ober: I'm not always so sure. I think they are a great way to receive feedback and standardise some primitives, but I am not sure about some of them Ober: oh sure. Ober: but... having had folks thump the clhs as the holy book for ages, it's a great thing to see something written in this millenia manumanumanu: hehe manumanumanu: I am a bit afraid that r7rs-large will include srfi-42. even after using it quite a bit, I am still confused about the syntax, and a bit disappointed that the code it generates is so slow Ober: "what does it mean 'thall shall not cons!'?" manumanumanu: But I can easily see how it inspired rackets loops Ober: yeah. great ideas persist manumanumanu: So then, people: favourite srfis? manumanumanu: Mine are 115 159 and 2. manumanumanu: even though nr. 2 is the only one I use as an srfi. The others I download directly from ashinn rekado: I cannot do without srfi 1 and 26. rekado: 115 is great and I wished it were part of Guile. It’s just so very useful. OrangeShark: wow, there has been a lot of new srfis ArneBab_: rekado: can’t you add 115 to Guile? civodul: so, on that big CPS compilation thing, it's compute-strongly-connected-components on the top-level thunk that's causing the biggest memory growth civodul: i wonder if this is a case where doing it the purely functional way doesn't cut it, at least not with the usual data structures amz3: hi everybody amz3: manumanumanu: who is ashinn? amz3: ah from chibe-scheme ok amz3: nvm amz3: looking up a new domain name tlds amz3: those are awefully expensive amz3: mind that the .space tld is available 40€ for 10 years amz3: which is not expensive, but it's difficult to come up with a short domain name that is also available amz3: on a related note amz3: there is this gnu taler thing, a cryptographic money that is also a gnu project that allows anonymous payment but also taxes amz3: youtube-dl https://media.ccc.de/v/SHA2017-241-gnu_taler bavier: amz3: gnu taler seems pretty cool to me amz3: bavier: indeed amz3: at least one of the maintainer is also a gnunet maintainer or contributor p4cman: how should i get started with guile p4cman: also hello amz3: grothoff is his name amz3: p4cman: do you mind giving me feedback in a tutorial I amde? amz3: acme amz3: made* amz3: p4cman: what's your programming knowledge? amz3: background in programming? amz3: grothoff is their name p4cman: amz3: a little bit C, that's all. amz3: p4cman: then you can start with my tutorial, but only if you plan on giving me feedback :D p4cman: i'll try :) amz3: cool amz3: p4cman: you can have it https://a-guile-mind.github.io/book/ amz3: also there are comics :D amz3: and it's space related somewhat bavier: p4cman: SICP is also a good intro to scheme/guile https://mitpress.mit.edu/sicp/full-text/book/book.html amz3: p4cman: you keep SICP around :) amz3: +shall p4cman: is elisp different then? or would i be able to write emacs extensions in guile itself amz3: p4cman: no bavier: elisp is different amz3: it doesn't have flying robots amz3: p4cman: don't hesitate to read the a-guile-mind book and ask questions on the fly, actually it's not a book there are less than 3,000 words OrangeShark: p4cman: elisp is a different language, but there is a lot of similarities. p4cman: one question: so is guile a general purpose language and not just an ectension language? considering dmd and guix are written in guile OrangeShark: p4cman: yes. OrangeShark: guilers are pretty much on the side where an extension language should be a general purpose language amz3: +1 amz3: p4cman: also they are various attempt at building a clone of emacs in guile amz3: there is also guile emacs, but... the ladder is ver high amz3: very* amz3: honestly, I never needed to use elisp amz3: I mostly copy paste, and know enough of it to tweak some variables amz3: I can read elisp but not write it happy_gnu[m]: I did 2 bots with guile \\o/ happy_gnu[m]: Thanks to 8sync of dustyweb happy_gnu[m]: https://notabug.org/happy_gnu/Bots happy_gnu[m]: One of them is, of course, and interjection bot :) bavier: happy_gnu[m]: cool amz3: nice! daviid: Romantic: https://github.com/ChaosEternal/guile-inotify2.git daviid: here is a list of guile related projects that is relatively well maintained http://sph.mn/c/view/g2 happy_gnu[m]: Thanks :) happy_gnu[m]: Code is messy happy_gnu[m]: But I had been having so much fun happy_gnu[m]: https://www.quora.com/What-did-Alan-Kay-mean-by-Lisp-is-the-greatest-single-programming-language-ever-designed/answer/Alan-Kay-11?share=1 manumanumanu: ArneBab_: irregex (the basis of srfi-115) is trivial to install in guile. manumanumanu: daviid: I just used guile-inotify2 to write a small script to automatically sort my download directory manumanumanu: it does not handle errors at all, so you need to do some housekeeping yourself (make sure the directory exists, etc). manumanumanu: and it has no licence info manumanumanu: probably something gpl-ish manumanumanu: daviid: is that your list? daviid: manumanumanu: I dod not write this project, you probably want to talk to the author about all this ... chaosethernal iirc daviid: no it is not my list, i posted it to help Romantic and possibly new comers I don't know to bookmark it, afaict, it i the 'best list' we have, it tracks a lot more then our own web pages ... some are old and there for history of course... daviid: the author is tantalum, his/her email is sph at posteo dot eu, i emailed a few times to help with some corrections and missing link, i just did it again to mention guile-cv which i just realized was still missing daviid: i've used inotify2, i did not face any error, for my use case it was fine daviid: it would be nice to have it as a 'good' binding, proper autotool, tests, doc, license of course .. don't know why the author did not make it so, something to think about i guess ... someone could pick it up (not me though, too busy) happy_gnu[m]: hi happy_gnu[m]: can somebody help me with this function happy_gnu[m]: I don't understand what am I supposed to pass happy_gnu[m]: https://www.gnu.org/software/guile/manual/html_node/Time.html#Time happy_gnu[m]: sbd-time [zone] happy_gnu[m]: sbd-time [zone] happy_gnu[m]: damn .. stupid riot happy_gnu[m]: Scheme Procedure: mktime sbd-time [zone] happy_gnu[m]: I am trying to call a function that will give me time on UTC happy_gnu[m]: never mind happy_gnu[m]: I needed to use localtime Ober: XB OrangeShark: happy Wednesday! wingo: :) happy_gnu[m]: Hi happy_gnu[m]: \\o/ bavier: hello happy_gnu[m] happy_gnu[m]: What would you use to create a countdown timer with guile happy_gnu[m]: Hi bavier :) happy_gnu[m]: Let's say I want a countdown till December 1st 2017 happy_gnu[m]: And every time I call this function it will tell me how much time left until December 1st ArneBab: I forgot to whom I need to talk about getting something into gnulib — can you help me? civodul: ArneBab: bug-gnulib@gnu.org would be the place cmaloney: happy_gnu[m]: Have you checked out SRFI-19? cmaloney: https://www.gnu.org/software/guile/manual/html_node/SRFI_002d19.html#SRFI_002d19 ? bavier: happy_gnu[m]: or the base (guile) module has some string functions bavier: happy_gnu[m]: a little janky, but e.g.: (define (countdown end) (let ((end-secs (car (mktime (car (strptime "%Y-%m-%d" end)))))) (lambda () (format #t "~d seconds left" (- end-secs (current-time)))))) bavier: (define counter (countdown "2017-12-01")) bavier: (counter) => "1949659 seconds left" happy_gnu[m]: cmaloney: I did bit I did not understand how to transform those objects into simple 'it is november 18, 2017' happy_gnu[m]: bavier: ohhh and then with amount of seconds I can define a function that transforms them into days and hours bavier: happy_gnu[m]: right happy_gnu[m]: It will divide the seconds by 86,400 and ithat will be days happy_gnu[m]: Then the remainder by 3600 and that will be hours happy_gnu[m]: And so on happy_gnu[m]: I don't really understand mktime bavier: happy_gnu[m]: it converts a "broken-down time object" like that returned by strptime and returns the corresponding integer seconds and a normalized time bavier: the example I gave used it only for the integer seconds conversion happy_gnu[m]: bavier: it converted everything to seconds right? happy_gnu[m]: OK I think that I understand better with your example happy_gnu[m]: Yesterday I was very confused happy_gnu[m]: OK let me try it in my IRC bot :) amz3: do you backup? amz3: online/offline or rsync? amz3: I think I lost some code again! amz3: wohaha grep has to go through all stackoverflow database dump again amz3: I remember that I already used in my codebase called culturia.one some kind of encode/decode to handle post submitted amz3: the app was anonymous and cool, but nobody used it outside mezbreeze amz3: I am looking for the morton code for indexing arbrirary number of spaces using a linear scheme (like forth (no I am kidking) amz3: to increase lookup speed in a ordered by key hash map amz3: the prefix of the has does narrow down the n dimentional space using a line that progress through the entire n dimensionnal space in a certain way amz3: what a time sink can be social networks... some time amz3: worse than linkedin, you can't figure amz3: but heck, they must be some no silly way to do webapp dev?! amz3: sorry! amz3: the prefix of the has does narrow down the n dimentional space using a line that progress through the entire n dimensionnal space in a certain way amz3: (was interupted by twitter) amz3: the prefix of the has does narrow down the n dimentional space using a line that progress through the entire n dimensionnal space in a certain way amz3: so it deals with a subscape that overlaps the search region, which means you have some space that the curve progress that is not part of the search space amz3: the 'future-next-valid-step' will narrow down further the search space to be more accurate amz3: and actually match the client intent amz3: this is explained with images in https://aws.amazon.com/blogs/database/z-order-indexing-for-multifaceted-queries-in-amazon-dynamodb-part-1/ amz3: this is not my article amz3: the wikipedia pages give a good introduction to the technique of space filling curves to linearize a multi-dimensional space amz3: but it's not really explained what the engineering application amz3: are amz3: but it's not really explained what the engineering application are amz3: the purpose is to speed up database queries that are collocated numerobis: Hi! I have a (beginner) question regarding scheme. I would like to implement a function whose purpose is to increment a variable and return its value before incrementation. Right now, the expressions in my function are (set! x (+ x 1)) (- x 1), which doesn't look very elegant. Is there a better way to achieve this? Thank you! numerobis: (other than by introducing an auxiliary variable with a 'let'...) amz3: numerobis: that is mutation it's not possible amz3: that is a mutation amz3: +a numerobis: amz3: sorry, I just started using guile. What do you mean by a mutation? There is no other way then? numerobis: amz3: And thank you for your response! amz3: numerobis: you don't have access to the underlying pointer adress to modify inplace the record of the first variable amz3: because doing so, you would also probably change the value of a sibling datastructure that still use that variable amz3: this allows to preserve unicity of memory representation of concurrent datastructure without them having to know whether there is someone else using my values or not amz3: it actually can save space amz3: because for instance, 1 you need only one instance of 1 in the end of the day not hundres of times you add one... numerobis: amz3: Thanks, but are you sure? Because my function does work... I should perhaps mention that the varibale x is defined in the function too? amz3: they share subspace of their datastructure. amz3: numerobis: you get a new value, not the old *value + 1 in C terms amz3: so saying your function is doing 'return ++i' is incorrect amz3: maybe the underlying compiler is optimizing that particular value because he knows that particular value 'x' won't be used anymore which he can guess statically for instance for symbol-fu procedures amz3: which would maybe translate to a realloc in C for the particular case of symbols amz3: for integers I don't know numerobis: amz3: Thank you! But I'm still not sure that I understand. Am I not doing something similar to what they're doing here https://www.gnu.org/software/guile/manual/html_node/Serial-Number.html#Serial-Number ? numerobis: and I think what I'm trying to return is "i++" instead of "++i", no? amz3: numerobis: can you http://hastebin.com/ what is your procedure and what you think it's doing, I think I don't understand what you wnat to do amz3: numerobis: that an early optimisation that hurst readability of the code, I don't remember what ++ amz3: numerobis: tl;dr: prolly :) amz3: I am reading the manual page numerobis: amz3: https://hastebin.com/icokopowek.lisp there you go :) (that website is great, btw!) Basically, I want to be able to (define a (counter 0 4 1)), and then be able to call (a) repeatedly until I reach the upper bound. Thanks! amz3: numerobis: this is a pattern to simulate to simulate states, it's called scheme man OOP or poor man's OOP amz3: tx, disclamer: that's not mine amz3: with fiber, you can inverse the last two lines (and add a let loop (and run in fiber event loop), it has the same effect amz3: it's an infinit sequence amz3: some sort lof lazyly compute its values amz3: it's what my library does for nodes and links database numerobis: amz3: Thanks, but what is fiber? (I can't find that word in the guile manual) amz3: https://github.com/wingo/fibers/ amz3: disclaimer: I can't put actually write the code that does that ^ but by reading the manual that's what I understood amz3: numerobis: wingo is the maintainer :) amz3: numerobis: that pattern you are talking about, using a closure to retain state and return a value is used in SICP amz3: But I have a very poor memory, so i can not say which where amz3: numerobis: what to you want to do with the procedure that you wrote that increments values? amz3: btw, morton code lost amz3: meh, I hope mark has a copy amz3: numerobis: you have SICP? numerobis: amz3: Thank you very much, I'll check it out. :) Eventually I want to use it as a kind of iterator, but at the moment I was just playing around and trying to understand how scheme works. amz3: numerobis: yeah, it can do what ever you want... amz3: like IIRC someone use it but, the procedure that returned by the outter lambda can take a symbol as argument and a rest argument, then based on the symbol it switches, and execute a particular subprocedure numerobis: amz3: haha yes, it seems to be a very nice language. Ultimately, I would like to use guix, but I'm warming myself up to guile with small projects first. amz3: like (database 'insert "amz3" "is a quiler") amz3: that's basically database.insert("amz3", "is a guiler) in javascript or python numerobis: amz3: oh sorry, I thought you were talking about Guile, but it was about Fiber. Seems pretty powerful indeed! amz3: Fiber is a guile module amz3: for guile 2.2 amz3: like package amz3: like +a package amz3: numerobis: but if you are getting started, maybe you read this chapter https://sarabander.github.io/sicp/html/3_002e1.xhtml#g_t3_002e1 numerobis: exactly the kind of resource I was looking for. Thank you! :) amz3: yw! amz3: numerobis: if you still don't understand comme back! amz3: i hope :) numerobis: amz3: I will, thanks! OrangeShark: numerobis: I don't really see ant other way except what you did or use a let binding. numerobis: OrangeShark: Thanks, it's good to have it confirmed. OrangeShark: numerobis: just know when you do something like return x++ in a language, it likely saving the x into a temporary variable or register happy_gnu[m]: I am a little confused happy_gnu[m]: I need some help happy_gnu[m]: if I do on REPL happy_gnu[m]: (round (/ 260861 86400)) happy_gnu[m]: it gives happy_gnu[m]: => 3 happy_gnu[m]: but if I do happy_gnu[m]: (define (days-left time) (round (/ time 86400))) happy_gnu[m]: and I call (days-left 260861) happy_gnu[m]: exactly the same thing with exactly the same code :/ happy_gnu[m]: I get happy_gnu[m]: 260861/86400 OrangeShark: happy_gnu[m]: which version of guile? stis: works for me on 2.2 and 2.0.13 happy_gnu[m]: mm I must have something wrong then happy_gnu[m]: let me check :/ happy_gnu[m]: ok I was wrong sorry for wasting your time :( amz3: what does the VM depends on the size of number amz3: +the number Romantic: Hello, is there guile support for inotify or other fs notification systems? happy_gnu[m]: why is chickadee not in #guix but sly is ? happy_gnu[m]: is chickadee not stable? civodul: Romantic: there might be inotify bindings floating around civodul: otherwise it's "not hard" to create bindings using the FFI Romantic: civodul, ok, thanks: I haven't found anything yet, figured I'd ask before putting something together. ArneBab: civodul: thank you! civodul: Romantic: yes, makes sense :-) davexunit: happy_gnu[m]: it's because I never wrote a package for it davexunit: sly is a pretty dead project at this time davexunit: anyone could add chickadee to guix. it's not hard. davexunit: speaking of inotify bindings, that would be nice. I've thought about making them before but never got around to it. rekado: davexunit: do you think sly should be removed from Guix? civodul: rekado: no no, i've used it with my kids, it's great :-) civodul: (is that a valid criterion for non-removal?) rekado: hah :) rekado: if that is not valid I don’t know what is. happy_gnu[m]: davexunit: OK! I will try ta write the package now then happy_gnu[m]: I want to make a game :) happy_gnu[m]: Yesterday I did an IRC bot with dustyweb's 8sync davexunit: rekado: it would be fine to remove it ArneBab: (define (? use-content . args) (if use-content args (list))) ArneBab: `(foo bar ,@(? #t 'baz)) ArneBab: $2 = (foo bar baz) ArneBab: `(foo bar ,@(? #t 'baz 'maz)) ArneBab: $3 = (foo bar baz maz) dustyweb: ArneBab: that's not the case sadly ArneBab: so you have additional requirements :) dustyweb: ArneBab: consider: you may not wish to run the "content" at all if the test does not pass dustyweb: no additional requirements! ArneBab: ah, yes ArneBab: you’re right … ArneBab: the content producer might be expensive dustyweb: for more on why, see SICP exercise 1.6 ArneBab: … but, as seen here, it is easy to move from a procedure to a macro without any changes to the using code dustyweb: or could have side effects, but hopefully not in mere sxml templating ;) dustyweb: yep dustyweb: ArneBab: you still need to wrap content in a list though ArneBab: (this is one of the aspects I see as really cool in Scheme) ArneBab: dustyweb: see my final implementation which uses (define (? test . args)) ArneBab: args always is a list :) ArneBab: (in short: I continue to be lazy ☺) ArneBab: dustyweb: as last line this night: Isn’t it cool how dramatically a one-line-definition like the ? can cut ceremony? dustyweb: :) dustyweb: ArneBab: yeah! OrangeShark: Happy Tuesday bms_: I don't have school because it's election day! bms_: And I didn't have school yesterday because a horrible storm knocked their power out. OrangeShark: bms_: glad you have power back :) OrangeShark: guess I said it too soon bms_: No, I've had power since the night of the storm. It was only out for like fifteen minutes. It was much worse closer to my school. I don't think they're supposed to have it back until late tomorrow. bms_: Hey! amz3: hey! amz3: TIL: there is two ways to POST form data to a server urlencoded or using form-data amz3: https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data amz3: the default is urlencoded which is rather easy to parse amz3: \\o/ amz3: which means that I will try to make a pastebin app amz3: if I find a good template ;) amz3: that does is not space themed amz3: or maybe that is space themed bms_: Hello. wingo: moo kmicu: woof woof wingo: :) civodul: see like 'load-absolute' in boot-9 does not honor %fresh-auto-compile, does it? dustyweb: ArneBab: I wonder what it would be like to combine skribe (eg as used in Haunt and Skribilo) and Wisp dustyweb: ArneBab: I guess the thing that skribe adds is the [] text-quasiquote dustyweb: I'm not sure how it would be possible with wisp but it *sounds* appealing... daviid: lispaste is dead daviid: what do you use ? OrangeShark: we need a guilepaste written in guile davexunit: +1 to that davexunit: I have a syntax highlighting library that could be used. davexunit: hmm, maybe I'll write this someday... OrangeShark: ya, we should have most of the parts needed to build one davexunit: we have everything OrangeShark: except someone to make it :) davexunit: heh bms_: Maybe it could make notifications to msg servers too. I'd be happy to write that functionality when I "finish" msg. OrangeShark: bms_: msg servers? bms_: A project of mine, written in Guile. Think federated, extensible IRC, designed for small servers and communities. Servers are easy to start and, if used on the scale expected, shouldn't require too much, if any, more computational power than clients. bms_: I'm still not sure federated is the right word. The idea is that there is no central server, just small communities. I'm uncertain whether or not I'll be able to link them together, but I think I may make functionality for server operators to do something of the sort. bms_: It's not quite designed to replace IRC, but it'll be a helpful self-hosted alternative. OrangeShark: bms_: oh nice :) I look forward to hearing more about it. bms_: Thanks. OrangeShark: is there a website or repo that I can bookmark to check out later? bms_: Not yet. I'm very low on money, being a high school student with no job, but I do plan to submit to GNUeval eventually. For now, I hang around here and #guix just about daily, at least that's the plan. It might do good to start an IRC channel myself, but I'm not very far into development yet. numerobis: Hi! I am wondering whether there is a way of calling system commands from guile, because having to code 'mkdir -p' and 'rm -rf' every time I need them seems like a lot of effort for not much. Thonk you! OrangeShark: bms_: okay, be sure to share updates on here and on the mailing list. OrangeShark: numerobis: there is a "system" procedure in the posix section of guile bms_: Okay. davexunit: numerobis: gnu guix has a guile implementation of 'mkdir -p', and I think 'rm -r' too davexunit: making subprocesses for these things instead of using the POSIX API is an easy, but brittle, solution numerobis: OrangeShark: Thanks! I had been looking for it but hadn't found it. And yes, I have seen the implementations in the Guix source code, but they looked quite difficult for a beginner in scheme. davexunit: okay, just be aware that spawning subprocesses has significant drawbacks numerobis: davexunit: Thanks for the information. What kind of drawback, if I may ask? davexunit: you open yourself to a wider range of bugs and incur overhead davexunit: you lose guile's exception system and instead have to parse error codes for error handling davexunit: the process may crash or the desired program may not be on $PATH davexunit: and it's slower than doing the equivalent system calls yourself davexunit: for a one-off script, I don't worry much about these things. for software I release for others to run, I do. numerobis: davexunit: Thank you very much, that makes good sense. In my case, I need these commands for a quick script, so I think I'll use the 'system' procedure, but I'll keep your comments in mind for if I work on a larger project at some point. davexunit: sounds good amz3`: in python, it's slower to call the equivalent of rm -r, but I agree with error handling ArneBab: dustyweb: I’ve been thinking about a wispy skribe, too, but I didn’t find the right way to do it yet. It might be similar to the shakespeare stuff. ArneBab: dustyweb: unquoting to add tags is already working pretty nicely ArneBab: the main issue is all the stuff around it: you need to keep the indentation of the outer tags. ArneBab: so I didn’t yet find something which feels really right dustyweb: ArneBab: hmmm yeah ArneBab: dustyweb: so why I think "yes, we should do this! it’s a perfect match!", I don’t have the perfect concrete vision for realization yet ☺ dustyweb: ArneBab: I agree that the indentation issue is a challenge! dustyweb: it almost feels like you would need to *strip out* indentation in this system! dustyweb: which almost sounds alarming dustyweb: as an example dustyweb: hm dustyweb: to write it is to see all the problems ArneBab: You could define content sections and then re-use them in deeper indentation, just like you refactor code to not be too deeply nested dustyweb: regardless, it's not as much a "simple fit" as I first thought ;) dustyweb: because whitespace is significant in wisp only to define structure ArneBab: yes — in wisp the line is the central element while in prose it is typically the paragraph dustyweb: but whitespace, in a quasiquote string situation, raises the challenge that strings do really care a lot about their whitespace dustyweb: so now you've mixed up structure and content dustyweb: hence the confusion ArneBab: in HTML strings don’t actually care about their whitespace dustyweb: but in xml they do :) ArneBab: except with
 and similar
ArneBab: argl …
dustyweb: in xml   
dustyweb: the spaces there are each individual objects!
dustyweb: " "
dustyweb: text nodes
dustyweb: which is of course one of the big complaints about xml ;)
dustyweb: ArneBab: thorny territory.... thanks for talking about it with me though :)
ArneBab: multiple spaces are still collapsed into one, right?
ArneBab: dustyweb: gladly ☺
dustyweb: ArneBab: the answer is no!
dustyweb: ArneBab: not in xml, and not even in html's DOM
dustyweb: it's only in the *rendering* that the nodes "disappear"
ArneBab: how far the web has come …
ArneBab: …but then, what the site cares about is the user.
ArneBab: though JS tools are a challenge
dustyweb: as an aside
dustyweb: speaking of quasiquote!
dustyweb: you know what I really wish we had in our quasiquoe?
dustyweb: quasiquote
ArneBab: what?
dustyweb: `(foo bar ,?((test?) 'baz))
dustyweb: in this case, if (test?) evaluates to true, we'd get '(foo bar baz)
dustyweb: but if not, we'd get '(foo bar)
dustyweb: now why do i want this?
dustyweb: because I need this kind of thing *all the time* in sxml templating
dustyweb: instead I do this terrible workaround
dustyweb: `(foo bar ,@(if (test?) '(baz) '()))
dustyweb: which is just exhausting
dustyweb: I'd also like ,@?
dustyweb: which does the same but inlines it like ,@
civodul: dustyweb: i've found myself doing that very often too!
dustyweb: civodul: whew!  glad I'm not alone :)
civodul: maybe we could add such a construct in gexps :-)
dustyweb: and in normal quasiquote
dustyweb: or at least provide a module that adds these to quasiquote
dustyweb: it would make my sxml templating life, which is normally beautiful until I hit this
dustyweb: extra beautiful :)
civodul: yep :-)
dustyweb: quasiquote is not extensible I think in guile right?  I guess I will need to extend the reader to prototype this?
dustyweb: maybe I should look at gexps to find out how :)
dustyweb: I have been doing soooo much sxml lately between getting https://test.activitypub.rocks/  and https://activitypub.rocks/  going lately :)
dustyweb: I feel like https://activitypub.rocks/implementation-report/  came out nicely :)
dustyweb: bbiab!
ArneBab: dustyweb: couldn’t you implement ,(?(test?) 'baz)
ArneBab: or rather ,@(?(test?) 'baz)
ArneBab: by defining the procedure ?
daviid: the terrible looks rather ok to me
daviid: ACTION hides
daviid: * terrible work around
daviid: but then I don't even use cut :), yet ...
daviid: ArneBab: while you write wisp, there are people writing hy, in't that funny?
daviid: nobody is ever happy :)
ArneBab: daviid: yes! ☺
ArneBab: we are forever trying to optimize our tools to be able to better tackle the next set of problems
daviid: have to run, bbl
dustyweb: ArneBab: hm I think it would have to be a macro!
dustyweb: but maybe it would be ok.
dustyweb: scheme@(guile-user)> (define-syntax-rule (? test body)
dustyweb:                        (if test
dustyweb:                            (list body)
dustyweb:                            (list)))
dustyweb: scheme@(guile-user)> `(foo bar ,@(? #t 'baz))
dustyweb: $8 = (foo bar baz)
dustyweb: I suppose that's not bad
ArneBab: dustyweb: (define (? use-content content) (if use-content content '()))
ArneBab: you don’t need a macro if it’s OK for you that the test is evaluated directly
amz3`: héllo #guile
slyfox: finally found out why guile crashed on ia64: use of uninitialized pointer! https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29151 
rekado_: I’m trying to use syntax-case to generate arbitrarily named procedures with arbitrarily named keyword arguments
rekado_: the input is a specification that I need to access at macro-expansion time
rekado_: when I use syntax->datum on the input, however, all I get is the symbol identifier, not the value of the expression.
rekado_: e.g. when I call the macro on $18, which is bound to an expression and I inspect the value of the argument at macro expansion time I get the value '$18
rekado_: how can I access the value bound to the identifier?
janneke: rekado_: something like module-ref, module-variable
janneke: ?
rekado_: I don’t know if I can use this at macro expansion time, though
janneke: ...aaand you're probably looking for the right way too.  also primitive-eval came to mind but ...
rekado_: maybe I shouldn’t try to use a macro at all
rekado_: maybe higher order functions would suffice in this case.
jeko: Hello guilers !
sneek: Welcome back jeko, you have 1 message.
sneek: jeko, OrangeShark says: the blog post is up https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html 
jeko: Does anybody has a way to design (methodo) a guile application ? I like to do some diagrams before coding...
jeko: And I am looking for an academic/systematic way
jeko: (like UML for OO)
amz3`: jeko: sequence diagrams works well
amz3`: OrangeShark: tx for the article it's helpful, but It's unlikely I will put it to good use, I am terrible autotools ninja
amz3`: jeko: what are you coding? maybe we can figure things together?
jeko: amz3`: It's for my toy-app in Guile, as I am not a Guile super-coder (first time functional) I mostly think about a way to do thing then I seek in the Guile reference if i can find all the components
amz3`: jeko: good thing, you are confident enough to put together proceudres to build abstractions
jeko: amz3`: It is a personal organizer using the GTD methodology and a todo.txt format for my tasks
amz3`: ok
jeko: I have think about some "layers"
amz3`: what's the input and output of your program? is it a cli or a gui?
jeko: Actually it is a cli
amz3`: ok
jeko: I will think about gui later ^^"
amz3`: good thing
jeko: And the input is a string
jeko: well not exactly
amz3`: so what it is the specifications of the options that takes your program?
jeko: I do ./cyborg collect Design the +cyborg architecture
amz3`: ok
jeko: then it add a line in my central.txt file
jeko: with a creation date etc...
amz3`: ok
amz3`: what does +cyboard means?
amz3`: +cyborg sorry
jeko: it means the task is related to my cyborg project
amz3`: oh
jeko: it is just a way to identify what is a project
amz3`: it's a tag
amz3`: ?
jeko: yes !
amz3`: what about architecture?
jeko: sorry was a french word which suite for "structure"
jeko: or "organisation"
jeko: in some cases
jeko: ^^"
jeko: at the beginning I thought, I have a cyborg module which get the command line
jeko: cyborg.scm
jeko: which call procedures from gtd.scm
jeko: which then call procedures from todo-txt.scm
jeko: I tried to summarize it in this README https://framagit.org/Jeko/cyborg 
amz3`: ok, I look it at it
amz3`: jeko: so what is your problem?
amz3`: it seems to me that the layering makes sens
amz3`: jeko: for parsing the todo.txt file lines I recommend you have a look at guile-combinators
jeko: I was not 100% confident so I was looking to visualize it on diagram... bu maybe I should focus on coding lol
amz3`:  http://hyperdev.fr/notes/getting-started-with-guile-parser-combinators.html 
jeko: amz3`: ok I will look at it
amz3`: yes, you can do a diagram if you feel like it
amz3`: or several diagrams
amz3`: the more documentation the better :)
jeko: sure
amz3`: jeko: if you don't find your way around guile-combinators, don't hesitate to ask here or on the mailinglist
amz3`:  https://lists.gnu.org/mailman/listinfo/guile-user/ 
jeko: even if it concerne my particular software?
amz3`: yes
jeko: ok i will do that. thank you amz3`
amz3`: yw
laertus: when trying to compile guile emacs from the wip branch of git://git.hcoop.net/git/bpt/emacs.git i get a bunch of undefined reference errors to scm_make_obarray, scm_find_symbol, scm_intern, scm_unintern, and scm_obarray_for_each
laertus: here's the full build log:  https://paste.pound-python.org/show/1FNUL2AqdgnVjFUSU8QW/ 
laertus: i think it may have to do with the fact that i'm using the newest guile from git instead of guile-2.2
laertus: i had to change the configure script of guile-emacs to change all references to guile 2.2 to guile 3.0
laertus: any advice on how to fix this (apart from going back to guile 2.2) ?
amz3`: maybe read all the commits from guile 2.2 until guile 3.0 and see where the missing symbols are gone
laertus: i was hoping someone here might know
daviid: laertus:  others would know better, but i don't think the git repo you are using is the latest guile-emacs, there is a branch on savannah, I think ...
laertus: ah
daviid: laertus: you should not try to ork with guile-3 at this moment
laertus: i was going by the instructions on the emacs wiki:  https://www.emacswiki.org/emacs/GuileEmacsBuild 
laertus: which referenced that git repo
laertus: ok, i'll go back to guile-2.2
laertus: thanks
daviid: laertus: beleive the branch is wip-elisp
laertus: i found this:  https://www.reddit.com/r/emacs/comments/4zttlt/guileemacs_status/ 
laertus: which asked which branch to use:
laertus:  http://git.hcoop.net/?p=bpt/guile.git  (last updated 2015)
laertus:  http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-elisp  (looks like the same branch rebased on newer guile)
daviid: yes, that is the latest, wip-elisp, with some patches by dustyweb ...
laertus: there's also:  http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-bpt-elisp  (has the newest commits, but seems to be on an older version of guile?)
daviid: that is the (very) old one
laertus: ah, ok
daviid: use wip-elisp and patches welcome ...
laertus: cool
laertus: thank you very much
daviid: laertus: wc! though dustyweb would know better, I don't use neither did I nerver worked on wip-elisp... but i know it would be fantastic if some good hacker take this on they shoulder :)
laertus: i'm definitely not a good hacker, and have very little time to spend on this, unfortunately... i'm just interested in trying it out and maybe filing some bug reports :]
laertus: i think my contributions will be more in the testing capacity
laertus: i might also write some docs on how i got guile emacs up and running, and my impressions of it vs regular emacs
laertus: if i get it running, that is..
manumanumanu: Ahoy hoy, fellow guilers!
stis: hej manumanumanu!
manumanumanu: Today's five million euro question: Why is geiser surpressing my guile errors?
manumanumanu: stis: What is boiling in that genious mind of yours this week?
slyfox: does 'make check' pass checks on current guile git for you?
stis: spent all time in Skåne with two of my brothers, and my children. It's vacation times for the school kids.
daviid: slyfox: you have to checkout the stable-2.2 branch
slyfox: daviid: i planned to upstream a fix into main tree and wanted to make sure i don't break anything
slyfox: and found quite silly bug in foreign object creation
stis: manumanumanu: did you cook something together this weekend or what's up.
stis: ACTION is too tired to do anything useful after 6 hours of driving - slacking and enjoying music
daviid: slyfox: so, you want to patch and check your patch using stable-2.2, then report a bug with your patch atached...
slyfox: ok
manumanumanu: stis: found guile-inode2, so I whipped together a self-sorting download-folder with the 20 most recent files symlinked
manumanumanu: got bitten by the fact that case is eqv and not equal?
manumanumanu: so I wrote a case-of macro that lets you pick the comparison procedure
stis: manumanumanu: great, sounds like you are having fun!
laertus: daviid: has the code in http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-elisp   been integrated in to https://ftp.gnu.org/gnu/guile/guile-2.2.0.tar.gz  ?
daviid: laertus: very probably not
daviid: but again, I'm not the right person to talk about this
laertus: who should i ask?
daviid: i just wanted to save you some time, and not study a very old repo ...
daviid: if noone answers here, post an email to guile-user
daviid: or guile-devel actually
daviid: wisp-elisp is devel ...
laertus: yeah, i appreciate your help... it's just that i just built guile from that tar file, not fully understanding that i should have built from that wip-elisp branch instead
laertus: so at this point, if i rebuild guile from wip-elisp it'll take more time
laertus: not a huge deal, but i was hoping i could just save that time
daviid: laertus: yes you have to build from wisp-elisp and be patient, it can take quite a long time
laertus: ok
laertus: thanks for your help.. i'll do that
daviid: playing with branch, you can't avoid a build from scratch, which depending on your computer power can take up to more then a day...
laertus: yeah, i've unfortunately built guile a whole bunch of times now
laertus: and i know it's super, super slow
laertus: what's really weird, though, is that when i last built guile, which was from that 2.2.0 tar file, it only took 3 hours
laertus: i don't know how that could have been possible... usually it does take me something like a day to build it
laertus: i'll see how long it takes me to build this wip-elisp branch...
daviid: laertus: when building from a tarball, which has boostrap binries included, it is a lot faster indeed, as expected ...
laertus: oh
laertus: that explains it!
laertus: ACTION sighs
laertus: oh well, i guess i'm in for a long ride this time :)
daviid: laertus: you can hack while it's compiling ...
laertus: that i will
laertus: so once i compile this wip-elisp branch, should i still get guile-emacs from the wip branch of git://git.hcoop.net/git/bpt/emacs.git ?
laertus: or is there a better/newer source?
rekado_:  https://git.elephly.net/software/guile-debbugs.git 
rekado_: it’s not much, but it’s a start
amz3`: héllo
xelxebar: amz3`: 'ello
amz3`: I am diving into distributed databases, because you know, my blog needs to scale (tm)
amz3`: xelxebar: what are you working on?
guile-guest7: Hello I want to use guile but I am unsuccesful on building on either FreeBSD or Fedora. Is there any OS that is recomended that we can build guile succesful?
ArneBab: guile-guest7: can’t you just use zipper install guile?
ArneBab: guile-guest7: it should work on Fedora
ArneBab: did you get a release?
ArneBab: (i.e. 2.2.2)
guile-guest7: I followed the instrunction on the aretanis page
guile-guest7: artanis
guile-guest7: wget -c ftp://ftp.gnu.org/gnu/guile/guile-2.2.2.tar.xz tar xvf guile-2.2.2.tar.xz cd guile-2.2.2 && ./configure && make #(NOTE: this may take very long time even looks like halting) sudo make install
guile-guest7: do you have a url form where I can download binaries?
guile-guest7: The packages provided by fedora and FreeBSD are in both cases old
guile-guest7: 2.0.14
xelxebar: guile-guest7: You could go for a really overpowered solution and start a guix store. Mine's got 2.2.2 in it
guile-guest7: I saw on the download instrunctions refernce to guixSD https://www.gnu.org/software/guix/  but in their site it says that its not production ready
xelxebar: guile-guest7: GuixSD is the full operating system. You can use the guix package manager on any system. It won't interfere with your normal stuff.
amz3`: sneek: later tell nalaginrut do you support multipart forms in artanis?
sneek: Will do.
amz3`: sneek: later tell nalaginrut I don't see it mentionned in the manual https://www.gnu.org/software/artanis/manual/manual.html 
sneek: Will do.
amz3`: guile-guest7: the easiest way to install guile is to install guix binary, it's just a matter of unpacking a tarball and moving files, it doesn't interfere with your host system and you have access to various guile projects
amz3`: guile-guest7: follow the middle path, "GNU Guix 0.13.0 Binary" https://www.gnu.org/software/guix/download/ 
guile-guest7: I will try that too, thank you for you  help
mwette: I am looking at the fibers code, specifically stack.scm.
amz3`: wow mwette always in the good stuff
amz3`: dustyweb: did you know about this https://en.wikipedia.org/wiki/Sussman_anomaly 
random-nick: huh, paste.lisp.org disabled submissions
dustyweb: amz3`: lol, I wasn't
OrangeShark: guile-guest7: Fedora has guile 2.2.1, it is named guile22
rlb:   From: Debian testing watch 
rlb:   Subject: guile-2.2 2.2.2+2-1 MIGRATED to testing
rlb: 
rlb: Finally made it through the NEW queue.
daviid: rlb: excellent news
nalaginrut: rlb: nice!
sneek: nalaginrut, you have 2 messages.
sneek: nalaginrut, amz3` says: do you support multipart forms in artanis?
sneek: nalaginrut, amz3` says: I don't see it mentionned in the manual https://www.gnu.org/software/artanis/manual/manual.html 
nalaginrut: amz3`: yes, see the upload part, and it's efficient
mwette: I have started reading the "Parallel Concurrent ML" paper, in order to get a handle on fibers.  To read that (and other papers referenced by Andy) I have had to dive into learning a little SML. Onward ...
bmansurov:   /znc *playback CLEAR #guile
xelxebar: Dumb question: Is it idiomatic to define procedures in local bindings? (let foo (lambda...) ...)
terpri: xelxebar, it is
xelxebar: terpri: Thanks :)
xelxebar: Wait. What differences are there between an internal define vs let-binding a lambda?
amz3: xelxebar: internal define is not idiomatic
amz3: xelxebar: this goes full circle but that's the only difference I see between the two
xelxebar: amz3: Thanks :)
amz3: xelxebar: there is something specific about the compilation of internal define
amz3: xelxebar: but I don't remember the name of the algorithm
amz3: xelxebar: also, after 4 years of doing scheme, I used only once let lambda, actually it was a letrec, I usually define helper function at the top level because this way they are testable
amz3: that instance of letrec lambda is very specific, because I want to take advantage of lexical scoping (the closure actually) but it leads to untestable code
amz3: xelxebar: if you are worired to define lambda inside a map procedure like (map (lambda (item) (proc lexical-var-1 lexical-var-2 item))) lst)
amz3: you can use srfi-26's 'cut' form
amz3: or you can use curried definition (see the manual)
amz3: or my prefered method, is to do things like (define (helper lexical-var-1 lexical-var-2) (lambda (item) ...) and then use it (map (helper lexical-var-1 lexical-var-2) lst)
amz3: that way there is no big untestable mess inside your function
amz3: s/function/procedure
nalaginrut: xelxebar: don't worry about inner define, they're equivalent to let binding in a body. Only toplevel define does an assignment
nalaginrut: xelxebar: see r7rs 5.3.2. Internal definitions
amz3: meh
OrangeShark: happy friday
OrangeShark: amz3: xelxebar: I think internal defines get inlined in Guile, I am not sure about let bindings
amz3: happy friday OrangeShark
OrangeShark: how are you doing amz3?
OrangeShark: working on anything interesting?
amz3: well... not really, I am trying to do reach out people about a project of mine that is similar to my work on wiredtiger
amz3:  https://news.ycombinator.com/item?id=15618374 
amz3: to try to understand if there is people who find the project useful
OrangeShark: oh a graph database
amz3: yes
OrangeShark: graph databases seem interesting but I have never had the chance to look into them. I remember going to a conference and watching one of the tracks where they had a bunch of presentations related to graphs or graph databases
amz3: the guile version is much more powerful, because it support multiple threads but here I try to find out whether people would like to use it for instance if it had a REST API
OrangeShark: right now it has to be interacted with through python?
amz3: Once I know what people need, I will do it in Guile
amz3: OrangeShark: yes, it's library
amz3: +a
amz3: At the very beginning, I wanted to use it to interact with conceptnet, but I don't know how to use conceptnet so I have no good usecase for it
OrangeShark: one thing I wanted to try using a graph database was for a knowledge graph
amz3: yes, that's what conceptnet, it's a Knowledge Base of some sort
amz3: but then the question remains, what do you do with the KB?
amz3: one possible use, is to answer questions
OrangeShark: yeah, you have to find out a use for that knowledge
OrangeShark: I was thinking a sort of personal assistant can use a knowledge graph that it builds itself
amz3: I sent at least a mail to 100 persons from github followings I hope my email don't get banned
erispre: Hi all! A quick noob question. While trying to construct a circular list, I stumbled upon the following. I tried (define myl '(1 2)) and then (set-cdr! (last-pair myl) myl). This gives me an error message, saying that the first argument of set-cdr! should be a mutable list. However, when I do (define myl2 (cons 1 (cons 2 '()))) and then (set-cdr! (last-pair myl2) myl2), everything works fine. Does this mean
erispre: that '(1 2) and (cons 1 (cons 2 '())) are actually different objects in guile?
amz3: AFAIU '(1 2) is literal list
erispre: amz3: Yeah, but that should give me the same thing as (cons 1 (cons 2 '())), right? I am picking up some things on the Google about mutability, but afaict from the manual, all cons cells are mutable in guile...
amz3: literals are all immutables
amz3: that's the difference
amz3: if you write (cons 1 (cons 2 '())) it's different from '(1 2)
amz3: also:
amz3: scheme@(guile-user)> (eq? (cons 1 (cons 2 '())) (cons 1 (cons 2 '())))
amz3: $1 = #f
amz3: erispre: ^
erispre: Ah, I see! cons always allocates a new (mutable) pair, whereas all literals are the same object. That's why they have to be immutable. Got it!
erispre: I hate mutability anyways, but it's nice to understand!
erispre: Thank you!
OrangeShark: erispre: if you want a mutable list, use (list 1 2)
OrangeShark: that creates a new list every time. The issue with using '(1 2), there is only one of these in memory. So if you modified it, every time you use '(1 2) it would be the modified value.
erispre: OrangeShark: Check! As a suggestion: perhaps there should be a remark about the inequivalency of '(1 . 2) and (cons 1 2) in the reference manual, in section 6.6.8. It does say that cons returns a different object each time, but it doesn't say anything about the need for mutability under set-car! or set-cdr!.
OrangeShark: erispre: yeah, I think this was only added in 2.2. You can actually modify them in 2.0 and it gave you some unexpected results...
erispre: Coming from pure functional languages, I assumed that set-cdr! would allocate a new pair, and update the bindings accordingly when operating on a literal, as mutability is not a thing there.
erispre: OrangeShark: Then this is definitely a better way! This is why I say: "Death to mutability." :P
OrangeShark: erispre: the problem with that, is that set-cdr! is expected to mutate it. Can you imagine how you would have to deal with (set-cdr! (last-pair '(1 2 3 4 6) 5)
erispre: OrangeShark: Yeah, that would be awful. :P However, in this case, as there is no binding and there is no definite return value for set-cdr!, this particular case would not be a problem, I guess. I see, however, how something like (define myl '(1 2 3 4 6)) (set-cdr! (last-pair myl) 5) would be a huge problem, as you would have to allocate a new pair for the last element, and backtrack any bindings to the same
erispre: literal (or even worse, all bindings that occurred within any subexpression of the call to set-cdr!). The computational cost in the runtime could be immense, not to mention the way you would have to modify the syntax tree to allow for this backtracking... I definitely get you!
dsmith-work: Happy Friday, Guilers!!
cmaloney: \\o
janneke: o/
sneek: janneke, you have 1 message.
sneek: janneke, OriansJ says: that I have a special surprise bubbling up at the moment. :D
janneke: ACTION wants to know more, tell me, where are you OriansJ ;-)
janneke: sneek: later tell OriansJ: a surprise bubbling...that sounds just great!
sneek: Will do.
janneke: sneek: botsnack
sneek: :)
manumanumanu: So... Moving a file? Should I just use rename-file and
manumanumanu: be explicit about the move-to name?
bavier: manumanumanu: yes
androclus: Hey, all. I am looking to access a firebird database via guile. i see that guile-dbi has several drivers, but not for firebird. Any recommendations, before I go off and contemplate writing a Firebird driver for guile-dbi?
rekado: ACTION has never heard of a firebird database
androclus: rekado: Yeah, it's a great db. An open-source fork of the old Interbase (Borland, later Embarcadero) db, but completely re-written. Small, light, SQL compatible, very high reliability (way better than mysql), etc.  They're going to include the 'embedded' version of FB in the next LibreOffice, I hear. https://firebirdsql.org/ 
androclus: BTW, I could also ask a broader question: If you want to access *any* db via guile, is guile-dbi the way to go? Or is there some newer/better API that folks are gravitating to?
androclus: sorry, i had to sign out. if anyone answered my previous question, could you answer it again please? :-)
rekado: androclus: I don’t know of any alternative to guile-dbi as an adapter for many different database engines, but I don’t do much with databases anyway.
sirgazil: Hi! Do you know of any way to detect death code in your programs (like procedures defined but never used)?
androclus: rekado: okay, thx :-)
rekado: sirgazil: maybe code coverage tools can be used to this end: https://www.gnu.org/software/guile/manual/html_node/Code-Coverage.html 
sirgazil: rekado: Oh, I'll take a look. Thanks!
dsmith-work: Heh.  The only time I've heard of "firebird" was when "firefox" wasn't allowed to use that name.
rekado: sirgazil: it’s for test coverage, but maybe it can be co-opted for checking for dead code
amz3: androclus: guile-dbi is still what is used by artanis
amz3: androclus: but it's recommended to move away from C ffi and use the new dynamic ffi
amz3: androclus: so if you are going to write bindings for firebird, you have to look dynamic ffi in the manual
androclus: amz3: thanks for that big heads-up.  i am new to guile, and my c is rusty, so writing this will involve making a lot of mistakes.
androclus: i see it here: https://www.gnu.org/software/guile/manual/html_node/Dynamic-FFI.html 
androclus: so i'll look into it
happy_gnu[m]: Hi \\o/
sirgazil: Howdy, happy_gnu[m] :)
amz3: héllo happy_gnu[m]
happy_gnu[m]: I have a question for you
happy_gnu[m]: How do you organize your ideas before coding?
happy_gnu[m]: I mean, you say OK I will write X program.. What do you do?
happy_gnu[m]: Start an org-mode buffer, or something?
amz3: I look up the internet for articles about the subject
amz3: I read code
happy_gnu[m]: Or you start coding right-awy
amz3: I sketch some data model on paper
sirgazil: happy_gnu[m]: I write prose and draw first (if it's GUI)
happy_gnu[m]: Ohh
happy_gnu[m]: sirgazil: so prose is a description of the program?
sirgazil: yes
happy_gnu[m]: amz3: what is a data model
amz3: basically the datastructure to comes into play in the app
OrangeShark: happy_gnu[m]: I just code away but that doesn't usually create good results...
happy_gnu[m]: OrangeShark: I know what you mean..
amz3: happy_gnu[m]: OrangeShark I do that too
OrangeShark: just being able to develop while testing ideas in the REPL
OrangeShark: you can play around with the code more
happy_gnu[m]: So coding is like writing?
happy_gnu[m]: Not like an architect
amz3: yes, in the end the code is the only "proof"
happy_gnu[m]: Architect usually designs whole house before building
OrangeShark: it probably depends on what kind of project you are working on
happy_gnu[m]: Writer writes a book, then edits a lot and a lot
happy_gnu[m]: Until is ok
amz3: happy_gnu[m]: writer and coder do the same thing actually
sirgazil: Yes, I think it depends on the project.
OrangeShark: there is a book called Code Complete that talks about metaphors like this
amz3: happy_gnu[m]: what do you want to code?
Ober: written by an MS dev
sirgazil: happy_gnu[m]: Yeah, did you come up with something to program? I read you were looking for ideas.
OrangeShark: like one for building software is when you build a dog house is different then building a real house
sirgazil: So it depends on the final user too :)
happy_gnu[m]: I don't know
happy_gnu[m]: I was just curios
happy_gnu[m]: I usually think I have an idea
happy_gnu[m]: I write a wish list
happy_gnu[m]: But the more I code the more functions helpers I create
happy_gnu[m]: Before I realize it I have a lot of spaghetti code all everywhere
amz3: it will be easier to discuss that point with real code under the nose
happy_gnu[m]: So I was curious on what the experts (you guys) do
amz3: one basic strategy is to regroup together procedures into some categories
sirgazil: happy_gnu[m]: Oh, you were asking the experts... Then I will just sit in the corner :)
amz3: like MVC for GUI application where MVC stands for Model View Controller
happy_gnu[m]: sirgazil: oh come on :p
OrangeShark: eventually that will happen to code as you continue to develop. That is why you eventually have to refactor your code to reorganize it.
sirgazil: Yeah, I'm actually cleaning some spaghetti right now, from a year ago.
happy_gnu[m]: I see..
amz3: happy_gnu[m]: maybe your code is not spaghetti
happy_gnu[m]: MVC looks very interesting
happy_gnu[m]: OK I will write a simple game
happy_gnu[m]: And I will show you my code
happy_gnu[m]: So you can tell me what I am doing wrong
ugoday: Hi, channel. Could you please help me with getopt-long.
ugoday: I want to specify args as a non negative integer.
ugoday:  http://paste.lisp.org/display/360208 
ugoday: like this
ugoday: My expectation: when a user starts progranm like "prog -n 7" it launches the predicate function check-num, that checks is it proper number.
ugoday: but when I tried it, I got:
ugoday: ERROR: ERROR: Wrong type to apply: check-num
ugoday: so, how to specify a predicate properly?
ugoday: and how about nameless positional argumens like "prog file1 file2 file3"?
lloda: bavier: what is the difference between vlists and varrays? Guile has (ice-9 vlist).
amz3: :)
amz3: webshinra: héllo :)
amz3: webshinra: how is going your game dev?
amz3: how does artanis handle forms?
dsmith-work: Hey Hi Howdy, Guilers
OrangeShark: hello everyone
webshinra: amz3, hi, well, I would say good, but that would be vague. Do you have a particular game in mind :p ?
amz3: webshinra: I was under the impression, that you were working on game using guile
webshinra: I am :D
webshinra: I'm working on a tabletop rpg, using guile
webshinra: and on a openspace simulator
amz3: oh
amz3: nice
webshinra: only the second is a video game, for the first I would say that i'm metaprogramming with the mind as a target.
amz3: ^^
webshinra: ( generating latex : https://framapic.org/OYokNvy3IYab/B0dDKeMdvPbn.png  )
webshinra: (a competence tree)
cmaloney: webshinra: That sounds interesting
guile-guest2: hello, I am trying to install latest guile but failing. I try to build but on freebsd it fails with /bin/sh: cannot open : No such file or directory *** Error code 2 and on fedora configure: error: GNU libltdl (Libtool) not found,
guile-guest2: anyone has any ideas on how to build guile?
bavier: guile-guest2: perhaps you need to install libtool via your system's package manager?
bavier: guile-guest2: I'm not very knowledgeable about freebsd, but I thought "/bin/sh" was a fairly standard shell interpreter.
bavier: I would be surprised if it were not available
guile-guest2: on linux I did install teh libtool but the configure still fails with the same meessage
guile-guest2: checking for libltdl... no configure: error: GNU libltdl (Libtool) not found
bavier: guile-guest2: libltdl might be a separate package
stratotanker: Hello, Im getting confused with guile compilation. Someone can help me?
stratotanker: I mean compilation of scheme files into bytecode
guile-guest4: hi
guile-guest4: Hello
guile-guest4: how to compile guile in macOS sierra?
guile-guest4: when execute make command, i got an error: "ld: symbol(s) not found for architecture x86_64"
amz3: héllo all!
sneek: Welcome back amz3, you have 1 message.
sneek: amz3, davexunit says: I don't have much built-in for 3D yet but there is no limitation to using only 2D.  it's OpenGL after all, where 2D is just a special case of 3D.
roelj: Because the compiled Guile objects are in the ELF format, does that mean we can link with it in other languages?
roelj: Ah.. not because Guile implements its own linker and loader.
roelj: Too bad :)
roelj: Would that change some time in the future?
OrangeShark: happy Wednesday
dsmith-work: Hey Hi Howdy, Guilers
dsmith-work: roelj: One can hope
dsmith-work: roelj: Eventually (and wingo seems to be working very hard on this) guile will be compiled to native machine code.
bavier: roelj: the procedure calling conventions are different.
roelj: bavier: So, would it be possible to access/call a function in a .go object from a foreign language?
bavier: I don't think so
roelj: You'd probably need libguile
bavier: why does the guile website still list 2.2.0 as the latest release in the 2.2.x series?
OrangeShark: bavier: looks like the download page was never updated, just the announcement was added.
cmaloney: A
cmaloney: sorry
daviid: bavier: the web site is generated from scheme code, anyone can clone it, patch and send an email with patch(es) attached
bavier: right, ok
bavier: does anyone know of an implementation of bagwell's VArray datastructure?
dustyweb: hm
roelj: When I use the http-post function from (web client), how can I catch the error of a closed port on the remote end: "ERROR: In procedure connect: Connection refused"?
roelj: Does open-socket-for-uri throw an exception when something's wrong?
roelj: The manual isn't very descriptive
roelj: So after looking into the source code, it seems that catching 'system-error is the only option.
wingo: good afternoon civodul :)
wingo: meow
lloda: hi wingo, ok to push the patches on http://git.savannah.gnu.org/gitweb/?p=guile.git;a=shortlog;h=refs/heads/wip-lloda  to stable-2.2? I've written to the list several times, but I can do it again if it's useful.
wingo: hi
wingo: ACTION looks
wingo: lloda: all lgtm except removing scm_generalized_vector_get_handle; that breaks abi/abi so we have to put it off to 3.0
wingo: sorry for being an inattentive maintainer
wingo: please do apply that "remove scm_generalized_vector_get_handle" to master tho
wingo: for me it would be sufficient to just test that libguile builds, you don't have to build all the .go files there
lloda: np :) will do both
lloda: thx
lloda: pushed to 2.2
wingo: super
lloda: push to master. Thx a lot!
wingo: thank you!
wingo: there will be some interesting array opportunities in master btw
wingo: as we start to do raw memory references and add a template jit
wingo: there will be ways to write fast loops, at least on the backing vectors; no simd tho in the short term at least
lloda: there's so much overhead in arrays now b/c a lot of it is in C
lloda: I tried to rewrite everything in Guile (github.com/lloda/guile-newra) and sometimes array-map! comes out faster, already in 2.2 (!)
lloda: I hope for big improvements there :D
wingo: :)
dsmith-work: Morning Greetings, Guilers
OrangeShark: good day Guilers
wingo: civodul: had a chance to try those other patches?
civodul: no i left keyboard until a few minutes ago :-)
civodul: lemme see
civodul: ACTION runs benchmarks
civodul: wingo: i've just replied
civodul: just the time for me to rebuild the whole thing and all that :-)
civodul: it looks perfect!
xelxebar: Has anyone played around with the support for other languages in guile?
xelxebar: I was surprised to read that it has a (partial) ecmascript/javascript implementation and stuff
davexunit: sneek: later tell amz3 I don't have much built-in for 3D yet but there is no limitation to using only 2D.  it's OpenGL after all, where 2D is just a special case of 3D.
sneek: Will do.
xelxebar: Is there a way to search for/list available modules from the repl?
brendyn: I had geiser repl running a process when I tried to run geiser-eval-definition in a buffer, which caused Emacs to freeze up. I canceled it with C-c C-k, but now Emacs is freezing up for several seconds whenever i so much as try to enter text into the repl and then tells me it is compiling my scheme file
happy_gnu[m]: brendyn: is it still giving you trouble
brendyn: I closed Emacs and started fresh and it's fine. I could try reproduce it but I wouldn't know how to debug such things
brendyn: Yay, I'm on to chapter two of SICP now.
happy_gnu[m]: brendyn: pretty cool!
happy_gnu[m]: Are you experienced in programming
brendyn: No I'm a beginner but I use the command line a lot and a have packaged a couple things for Guix
happy_gnu[m]: brendyn: oh cool!
happy_gnu[m]: Have you read how to design programs?
brendyn: It really hurts my brain trying to solve the problems in SICP and I often come up with overly complicated code when Bill's solutions are only 4 lines but I'm better
brendyn: Nope I just started with SICP
happy_gnu[m]:  http://www.ccs.neu.edu/home/matthias/HtDP2e/ 
happy_gnu[m]: brendyn: what problem are you solving right now?
happy_gnu[m]: I found how to design programs and the little schemer very helpful
happy_gnu[m]: Specially The Little Schemer
happy_gnu[m]:  https://7chan.org/pr/src/The_Little_Schemer_4th_2.pdf 
brendyn: Nothing yet. I'm reading the text at the start of chapter 2, but yesterday I came up with this for 1.43, compared with Bill's solution http://paste.lisp.org/display/359820 
happy_gnu[m]: I think you are using things you learned from guix
happy_gnu[m]: Why don't you give the little schemer a chance
brendyn: When I first thought about how to write `repeated', I thought it would end up repeating exponentionally, so I started writing all that which ended accidently being an iterative solution
happy_gnu[m]: You will advance a lot in a cfew days
brendyn: and then a looked and the answer and realised how simple it should have been
happy_gnu[m]: Is a very good book
brendyn: You think I should postpone studying SICP?
happy_gnu[m]: No
happy_gnu[m]: You will do The little schemer very quickly
happy_gnu[m]: It will take you a few days
happy_gnu[m]: Until you hit chapter 8
happy_gnu[m]: Then it becomes confusing but by then SICP is easier
happy_gnu[m]: It iwill be just a few days
brendyn: Hmm ok
happy_gnu[m]: You don't have too though
happy_gnu[m]: I just say because it helped me
happy_gnu[m]: I am not advanced
happy_gnu[m]: I started to learn in may
happy_gnu[m]: More or less
civodul: ACTION has a fix for the overly-weak hash tables \\o/
civodul: it's all a matter of finding the right level of weakness
wingo: ACTION landed instruction explosion for conditionals to master
civodul: rekado_: just sent the updated patch set
civodul: wingo: what's your take on going back to 2.0-style weak hash tables?
wingo: civodul: i am not sure.  the issue about the total count seems to be one you have solved so that is good.  but i would not want to reintroduce weak pairs in any way to the api
sneek: wingo, you have 2 messages.
sneek: wingo, amz3` says: we need to push forward this bug https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15228 
sneek: wingo, amz3` says: people keep asking that question
civodul: wingo: right, weak pairs are only used internally, not visible from the outside
civodul: or did you mean something else?
wingo: no, that is what i meant
wingo: have you been testing heavily with multi-threaded workloads?
civodul: not specifically, i'll give it a try
civodul: but it's essentially the same code as in 2.0
civodul: i'll try that, and if there are no red flags, i'd like to go ahead and push it
civodul: we can always go back to weak-tables if/when we have proper fixes for that
civodul: though i'm not confident this can happen
wingo: the 2.0 code did poorly in that case; that was the source of my attempts to refactor it
wingo: additionally there are many uses of weak hash tables now in guile that assume they can be accessed in a thread-safe manner
civodul: in which case, multi-threading?
wingo: i think that's the only sane way to use weak hash tables: with some kind of atomicity guarantee
civodul: sure
civodul: do you have specific problems in mind?
wingo: so if we switch back, we should make sure that two threads can add/remove to the weak hash table at the same time
civodul: wait, weak tables and hash tables are not thread-safe per se
wingo: something that's not the case for guile's core hash tables
wingo: no
wingo: weak tables and sets are thread-safe in that regard
wingo: there is a mutex when adding/removing/accessing
wingo: so you will find a number of areas in guile scheme that no longer take fat mutexes when accessing weak hash tables
wingo: because the weak table ensures that concurrent access is safe
wingo: i was sad that this didn't work out: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=10836#8 
civodul: riight
wingo: but oh well :/
wingo: finally i am not sure *why* the current weak table implementation doesn't provide the characteristics that you want
wingo: i totally get that it's not doing the right thing atm :)
civodul: it's weird to have thread-safe weak tables, and non-thread-safe hash tables, given they share the same Scheme-level API
wingo: honestly i think they shouldn't share the same api but that is another story
civodul: yes
civodul: did you see my messages, notably https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28590  ?
civodul: i think i've explored the problem at length by now :-)
civodul: reverting is really a last resort
wingo: yes i saw all that and was a bit disappointed ivan hasn't looked at it, but then i haven't looked seriously either :)
wingo: i have tried to follow your work but it takes a lot of time to be sure about anything in this area :/  i have been sure so many times in the past and been wrong :/
civodul: yeah
wingo: ah actually i hadn't seen https://github.com/ivmai/bdwgc/issues/183 
wingo: left for holiday about that time, back just recently
wingo: so if we revert in 2.2 what does that buy us?
wingo: just to know
civodul: it fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28590 
wingo: that's a bad one indeed :)
civodul: and reduces memory consumption noticeably on weak-table-heavy workloads, like compilation
wingo: is that the source of the guix issues?
jlicht: civodul: will this do something for the guix issues?
civodul: it's one of the sources
jlicht: oh, ninja'd
civodul: the other source is data structures in the compiler
wingo: that's the weird thing, compilation *shouldn't* be so weak-table-heavy...
civodul: symbols, procedure properties, etc.
civodul: there are lots of them when compiling
wingo: most time is after the front-end, and it's only the front-end that needs weak associations
wingo: the weak data gets into tree-il fairly directly and after that it's all strong references
civodul: right, but just when reading gnu/packages/python.scm, you create a huge source property table
civodul: then that big table has to be marked, etc.
civodul: right, but still
wingo: and that's really the issue?  i guess i am just really surprised in that regard
wingo: doesn't mean you are wrong of course :)
civodul: yeah i think i posted more details about all this
civodul: one profile i had was to just read the CPS-as-sexp representation, then look at the wall-clock time and heap size
civodul: of course that's not exactly what happens when compiling python.scm
civodul: but it does shed some light
wingo: but the size of the open-adressed table should be similar to that of the buckets-and-chains table
civodul: that's also unclear to me, as i wrote in a message some time ago
civodul: that doesn't matter much anyway, given the other issues
civodul: so if we go for the revert, how strong do you feel about adding locking to (weak) hash tables?
civodul: obviously i'd like to avoid doing more work ;-), but also i'm not sure what this buys us
wingo: so regarding 28590, from what i can see your fixes should fix that bug
wingo: but that bug mixes the memory leak and incremental mark issue
civodul: essentially the fixes there are not as good as reverting
wingo: i feel pretty strongly about the thread-safety of weak hash tables
wingo: civodul: you mean for memory leak or for the overall performance evaluation?
civodul: so the problem to me is that, at a hashq-ref call site, you don't know if you're manipulating a thread-safe or a non-thread-safe table
civodul: which to makes makes locking moot
civodul: wingo: both
wingo: weak hash tables are an implementation detail.  you rarely want to expose them in api
wingo: instead you want to expose some accessors
wingo: so you know at your hashq-ref call site when you are working on a weak table
civodul: well, sure
wingo: ime anyway, yours may differ
civodul: where does locking matters? do you have examples?
wingo: yes, 633f3a18b7c6804b75ecd8ae94cf6cf82c9bcbed for example; also note that entries will be removed concurrently by GC so there are thread-safety concerns there; or 203a92b67b6a6c64c9e9f33d99c48f4699ed30e2;
wingo: basically anywhere in guile there was a weak table, it needed to be protected by a mutex
wingo: civodul: is the essential problem with the new hash tables that they are too big for a mark function to handle?
wingo: besides the fixes you have in 28590 which are excellent fixes and important but not essential bugs with the data structure
wingo: if i understand correctly anyway...
wingo: so besides a revert (which is a real possibility)
wingo: other possibilities: replace weak-table/weak-set impl with a buckets-and-chains impl
wingo: behind same api, behind same struct weak_table with the same locking characteristics
wingo: we could shard the weak table / weak set internally, if that's useful...
wingo: i wish that there were some more standard weak hash table + libgc solution
wingo: it seems like we are really struggling to do something that libgc doesn't want to do
wingo: dunno tho
wingo: we could possibly implement a concurrent hash table
wingo: perhaps one that locks each bucket instead of the table as a whole
wingo: wdyt civodul
wingo: i can give a try to implementing that
wingo: i think in the future we should use the deprecation mechanism to move people away from using the normal hash table API on weak tables, to use a specific api
wingo: like weak-vector-ref vs vector-ref
wingo: they don't have to be all that different in form / structure but i think they should be separate
wingo: in that regard i think it makes sense to keep weak and strong hash table implementations separate, and i think we should tolerate a bit of difference between the two (e.g. threadsafety)
wingo: so for preference i would rather replace the existing weak table implementation but keep things in weak-table.c (out of hashtab.c)
wingo: civodul: you back?  just wanted to close this loop
civodul: ACTION is back to keyboard, sorry for the delay
civodul: yes, so, i explained the problem in the thread rooted at https://lists.gnu.org/archive/html/guile-devel/2017-09/msg00031.html 
civodul: and in the other bug report about unbounded growth
civodul: unbounded growth in itself is enough of a problem, esp. for long-running processes
civodul: so i think the status quo is bad
civodul: started with a new implementation again doesn't sound reasonable
civodul: so going back to the bucket approach, with code that's already well used, sounds reasonable to me
wingo: the unbounded growth is of course bad but just a bug afaiu (which you tracked down and fixed)
civodul: in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28590  i fixed the unbounded growth of the disappearing-link table
civodul: the unbounded growth of the table itself isn't really fixed: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28590#22 
civodul: and overall i'm less confident with the resulting code than with the good'ol buckets
civodul: notably because marking the whole thing remains a bottleneck
civodul: as discussed at https://lists.gnu.org/archive/html/guile-devel/2017-09/msg00031.html 
wingo: sure
wingo: what if we put the old implementation in weak-table.c ?
civodul: in what sense?
wingo: that's what i meant by "replace weak-table/weak-set impl with a buckets-and-chains impl"
civodul: the revert i sent preserve the subset of the weak-table C API that's used internally
civodul: so i think it's essentially equivalent
wingo: but it put the implementation back in hashtab.c, right?
civodul: right
wingo: it didn't preserve the threadsafety aspect
wingo: right?
civodul: indeed
civodul: i'm not convinced it matters though
wingo: i feel pretty strongly about it fwiw
civodul: i feel it's a property that cannot be relied upon, and that's not documented
civodul: so, the bottom line is i'm not going to spend more days on this
civodul: so we need a resolution
wingo: do you want my help?  i am getting negative signals here
wingo: it seems to me that what i was suggesting meets all your needs
wingo: i.e. old implementation in weak-table.c
wingo: and i offered to do it, but you didn't want that?  i am a bit confused there
civodul: oh if you offer to do it, that's fine with me!
civodul: sorry i didn't get that part
civodul: so yes, definitely
wingo: np :)
wingo: sure, let me give it a go directly
civodul: and i'll be happy to run my "benchmarks" with it
civodul: awesome
wingo: oh that would be great
dsmith-work: Morning Greetings, Guilers
civodul: talks from the SPLASH conference: https://www.youtube.com/channel/UCgNOrQWOr3rKR9XPB1Km66Q/videos?sort=dd&view=0&shelf_id=0 
civodul: there's little Scheme, but lots of excellent stuff
ays: hi everyone! I wanted to know if there was a way to configure guile with a startup script. Something like .guilerc?
daviid: ays: it is .guile actually
ays: daviid: Oh thanks!
ays: Where do I install guile-sdl2 from?
daviid:  https://dthompson.us/projects/guile-sdl2.html 
stis: hello guilers!
OrangeShark: hello stis
OrangeShark: hooverville: https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html 
OrangeShark: sneek: later tell jeko the blog post is up https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html 
sneek: Okay.
jlicht: OrangeShark: nice post, I wish I had had this half a year ago
OrangeShark: jlicht: thanks, I've been meaning to write this a year ago but kept putting it off.
jlicht: OrangeShark: Looking forward to more posts about tests and documentation indeed :-)
jlicht: OrangeShark: Incidentally, what is the license for your blogpost?
OrangeShark: jlicht: yes :) I want to also add guix into the mix as well.
OrangeShark: jlicht: I should probably put an appropriate license, shouldn't I?
jlicht: OrangeShark: You should do whatever you feel like, of course. But something which allows others in the community to adapt (translate, embed etc etc) your work could be worthwhile indeed :)
OrangeShark: jlicht: do you recommend any license for that?
jlicht: OrangeShark: IANAL, and not really a license buff myself, so I can't really help your there.
jlicht: You could try the GFDL (https://www.gnu.org/licenses/recommended-copylefts.html),  but I am not sure if there are any drawbacks to using that. Maybe some of the guile devs can help?
davexunit: use a creative commons license for blog posts
OrangeShark: jlicht: that seems more for documentation
davexunit: the code snippets can use a software license, say MIT Expat
davexunit: (copylefting code snippets seems counterproductive)
OrangeShark: davexunit: thanks, I will look into those licenses
jlicht: thanks for the tip davexunit. Incidentally, which license applies to the code snippets on your blog?
davexunit: jlicht: I don't think I ever explicitly state it anywhere, but let's just say MIT Expat :)
jlicht: the bigger pieces have their own GPL header, so that is somehow clear
jlicht: thanks for the clarification :-)
davexunit: yeah when I copy code from projects I use the original license
davexunit: but consider a freestanding example snippet with no license to use a lax free license
dustyweb:  https://lists.gnu.org/archive/html/guile-devel/2017-10/msg00045.html  was an exciting email to read today
bavier: any way to prevent ldconfig from printing this: "/sbin/ldconfig: /usr/local/lib/libguile-2.0.so.22.8.1-gdb.scm is not an ELF file - it has the wrong magic bytes at the start."?
dsmith-work: bavier: Nope.  It's a bogus message from ldconfig (IMHO)
dsmith-work: The various lib dirs were not just for shared object files.  Originally, all kinds of "support" files where in there.
bavier: makes sense
bavier: I wonder if the *.so prefix is throwing it off
dsmith-work: Maybe. But it should see it's a .scm file.
dsmith-work: My opinion
dsmith-work: I just sing "la la la" with fingers in ears when I see that.
janneke: o/
dsmith-work: bavier: Ya, they could fix it.
dsmith-work:       /* The file is neither ELF nor aout.  Check if it's a linker
dsmith-work:          script, like libc.so - otherwise complain.  Only search the
dsmith-work:          beginning of the file.  */
dsmith-work:       size_t len = MIN (statbuf.st_size, 512);
dsmith-work:       if (memmem (file_contents, len, "GROUP", 5) == NULL
dsmith-work:           && memmem (file_contents, len, "GNU ld script", 13) == NULL
dsmith-work:           && !is_gdb_python_file (file_name))
dsmith-work:         error (0, 0, _("%s is not an ELF file - it has the wrong magic bytes at the start.\\n"),
dsmith-work:                file_name);
dsmith-work: They have a special case for python!
dsmith-work: Why not for guile too?
dsmith-work: from glibc/elf/readlib.c
daviid: I got my im-rgb->gray-1 running a bit more then twice as fast as the previous version: http://paste.lisp.org/+7PA5/1 
daviid: 2.17 sec, not too bad to process, on my laptop, almost 18 million times 3 ops: rgb->gray then min and max
numerobis: Update regarding my question of yesterday. It turns out the exuberant-ctags has support for scheme, which is great! :)
manumanumanu: Does ChaosEternal hang around here?
amz3: héllo all
amz3: is it possible to do 3D stuff with chicadee? \\cc davexunit
xelxebar: I've been reading through sicp. It seems to be written at a really beginner-friendly level.
xelxebar: I'm kind of looking for something a bit denser, though. Anyone have recommendations? I'd like to quickly grok the essentials and then learn by hacking around on projects.
xelxebar: I did read through the guile docs
rekado: xelxebar: how far did you get with sicp?
xelxebar: rekado: I'm about halfway in. Been skimming and then working through examples.
dustyweb: xelxebar: if you find SICP is beginner-oriented you are on a whole other level than I am or at least was coming in :)
dustyweb: it's true that it was the introductory textbook at MIT though
dustyweb: Guile's reference manual is for getting things done
dustyweb: SICP is for learning CS concepts :)
xelxebar: dustyweb: Hrm. I didin't mean that as a humblebrag or something. Maybe I just haven't gotten to the juicy bits yet? Or I'm missing something. I do know that I'm learning though!
xelxebar: I *really* like the repl search and discovery commands (,apropos etc)
xelxebar: Is there a similar way to get the definition of a procedure? Assuming we have the source available.
jeko: I've to try it out, seems much simpler thant mine xD
jeko: thank you !
jeko: I need to sleep right now. See you guilers !
mwette: later everyone
numerobis: Hi! Does anyone know if there is there any way to generate tags file from a guile codebase? And, if not, is there an easy way to jump to a function definition from vim? Thank you!
daviid: hylang.org
daviid: #! /usr/bin/env hy
daviid: (print "I was going to code in Python syntax, but then I got Hy.")
amz3: :)
cmaloney: <3
mwette: Hello, all.  I have updated debbugs 27782, "scheme level mmap", with more code to implement mmap/munmap in Guile.  I think it needs review.  It does compile and not crash.  The minimal usage is `(define bvec (mmap 0 #x100000))' which allocates a 1M chunk of memory.
mwette: as a bytevector
Apteryx_: Is fibers included in Guile 2.2.2?
Apteryx_: I can't find a reference to it in the manual.
mwette: By the way, the printer for bytevector should change: if I type `bvec' at the guile prompt I get #vu8(0 ... [ one million 0's ] ... 0)'
mwette: no: check https://github.com/wingo/fibers 
amz3: here's an interesting project https://github.com/OpenGenus/cosmos 
mwette: amz3: thanks
daviid: we could improve guile-lib, slowly but surely :), and for info, some of the math stuff are in guile-cv, convolution, gaussian filters, soon I will have FFT and friends ...
OrangeShark: amz3: thanks for the link, that seems pretty nice
ArneBab_: is there an implementation of unshuffle sort for Guile? http://central.gutenberg.org/articles/unshuffle_sort 
ArneBab_: it looks like specializing sort for arrays of integers could yield a factor 8 performance improvement: http://stereopsis.com/radix.html 
ArneBab_: unshuffle sort provides efficient sorting for linked lists instead of for arrays: http://www.pharaohbloggers.com/algorithms/unshuffle-sort/ 
ArneBab_: how does that compare to what we do right now?
amz3: o/
lloda: wingo: ok to push / ack for http://git.savannah.gnu.org/gitweb/?p=guile.git;a=shortlog;h=refs/heads/wip-lloda  to stable-2.2? I've sent these patches to the list twice, first time before the release of 2.2. I can fish the mails if it helps, or send the patchset again
OrangeShark: happy friday
dsmith-work: Happy Friday, Guilers!!
sneek: dsmith-work, you have 1 message.
sneek: dsmith-work, jlicht says: thanks for telling me about htmlprag; it was exactly what I was looking for!
amz3: héllo guile!
amz3: I have an idea for yet another toy database
amz3: a geo temporal triple store :D
amz3: you can't use more buzz words in single software than that
dsmith-work: amz3: Add "functional"
OrangeShark: amz3: what is a "geo temporal triple store"? :P
amz3: tx for asking
amz3: OrangeShark: basically, it's a RDF database with latitude, longitude and time
OrangeShark: oh I see, what is why it is a triple since it stores latitude, longitude, and time
amz3: it's not triple, I was wrong
OrangeShark: I see the term "triple" usually used to refer graph databases where it like object a, relationship, object b
mwette: so it's really a triple tuple store
OrangeShark: what do you plan on using it for?
jeko: Hi guilers ! (Is it how Guile developers are called? )
OrangeShark: jeko: that is a common name people do use here
jeko: Alright !
OrangeShark: jeko: a physical copy?
jeko: Yup
OrangeShark: nice :D
jeko: 896 pages...I will never get to the end. x_x
dsmith-work: jeko: Yes Guilers. But sometimes I use Guiileers for fun.
amz3: I keep getting disconnected on this network
amz3: sorry
amz3: dsmith-work: you are right it should be functional too
jeko: I read my first line from a file in Guile !
jeko: Is there a procedure to get the last line of a file ??
bavier: jeko: not baked in
bavier: jeko: I think you'd loop calling readline, and once you've reached eof, return the last line read.
jeko: Yup I was thinking about something like that. I've to figure it out.
jeko: Friday night brain is...slow ^^"
bavier: same here ;)
mwette: (let loop ((last #f) (line (read-line port))) (if (eof-object? line) last (loop line (read-line port))))
bavier: mwette: concretely, yes :)
amz3: o/
dsmith: bgamari: Hey hey
dsmith: I can't find my cross-guile buildroot
dsmith: Looks like I only have the "official" one.
bgamari: dsmith, alright, fair enough
bgamari: I haven't yet tried the looking at the stable branch yet
rekado: civodul: hi!
rekado: civodul: not sure if you got my emails (many of my mails to gnu.org are delayed); I tried your patches but could not compile Guile.
civodul: rekado: i did! i should send updated patches
civodul: i made small modifications today
civodul: good morning i guess!
rekado: civodul: good morning! :)
civodul: rekado, dustyweb: i just sent you updated patches
rekado: will test them right away!
civodul: awesome, thanks!
civodul: good night/day! :-)
rekado: This fails with: make[2]: *** No rule to make target 'weak-table.c', needed by 'weak-table.x'.  Stop.
rekado: seems like there are still references to weak-table* files.
rekado: oh, don’t mind me.  I need to bootstrap first
jlicht: sneek: later tell dsmith-work: thanks for telling me about htmlprag; it was exactly what I was looking for!
sneek: Got it.
happy_gnu[m]:  https://www.gnu.org/fun/jokes/eternal-flame.ogg 
happy_gnu[m]:  https://www.gnu.org/fun/jokes/eternal-flame.html 
happy_gnu[m]: God wrote in Lisp code
ArneBab: that one is great! ☺
ArneBab: happy_gnu[m]: here’s something to go with it: https://d6.gnutella2.info/freenet/USK@sUm3oJISSEU4pl2Is9qa1eRoCLyz6r2LPkEqlXc3~oc,yBEbf-IJrcB8Pe~gAd53DEEHgbugUkFSHtzzLqnYlbs,AQACAAE/random_babcom/349/#EternalFlameLisp 
ArneBab: it’s called "earth is being swallowed by a fire daemon" but could just as well be called "god uses Lisp" ☺ → https://d6.gnutella2.info/freenet//CHK@eRsMchbYUHZGwDeiPUldAHRH7UdysyEz2XLys8n3YF0,-tMc1xikIWzotSnvYFt8bHRYvLe7L9qVQd6eX7RYykE,AAMC--8/god_uses_lisp_firedaemon-ben_brockert-cc_by_sa-flickr-10212337584_596cd66833.jpg 
happy_gnu[m]: ArneBab: good!!!
happy_gnu[m]: Yes
happy_gnu[m]: You need Domain Specific Languages for universe
happy_gnu[m]: You can't do it any other way
daviid: hello guilers!
amz3: héllo daviid
codemac: Is there any way to print all current environment bindings?
codemac: I'm reading a file of scheme data in, and there is a variable I'm defining in a lambda outside of the read that I want it to reference, but it's not working. I tried local-eval + (the-environment), I tried primitive-eval.. struggling to get a binding to be visible during a read of a file
codemac: is this a case for fluids?
codemac: see the error message here: https://gist.github.com/codemac/1b6af6a8f97d8e16cc33e5e336854559 
codemac: you can see the "page" variable not making it during the last read of an "unknown file" which is just the same template.pop file
dustyweb: rekado: did you try the patches?
dustyweb: they didn't apply for me...
codemac: Ah, it looks like the read-hash-extend I'm doing doesn't have the bindings.
dustyweb: wingo: I don't suppose there's a way to find out *which* frame on the stack is causing a continuation barrier?
dustyweb: well
dustyweb: I'm having errors with continuation barriers, but only probabalistically
dustyweb: and I need to have this thing up, sigh :(
dustyweb: ACTION feels defeated
codemac: Is there any way to print all bindings in an environment?
codemac: sorry if it seems like I'm asking random questions, thanks for any help
codemac: aha, (use-modules (ice-9 session)) (apropos "regex")
rekado_: dustyweb: they did apply for me, but it wouldn’t compile.
rekado_: dustyweb: I wrote an email in response, but recently all my mail to @gnu.org are delayed, so it may not have been received yet.
dsmith-work: Wednesday Greetings, Guilers
bgamari: does anyone understand the limitations of cross-compilation of guile?
m3tti: =6
cmaloney: greets dsmith-work
jeko: Hello guilers ! I am at the beginning of my journey with guile (and scheme) and I am looking for a ressource about how to structure my programs
jeko: do i need test directories? src? or do i have to put a module and its tests in the same dir...?
jeko: that kind of question
jeko: is there a kind of "standard almost always true" ?
dsmith-work: bgamari: Guile needs guile to build, so cross-compiling end up building guile twice.
dsmith-work: It does work.
bgamari: dsmith-work, hmm
dsmith-work: Need the proper deps.  Like libgc and whatnot
bgamari: dsmith-work, sure
bgamari: So I have a build environment guile
bgamari: dsmith-work, yet I see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28920 
dsmith-work: At one time, I had it building with buildroot
dsmith-work: Someone else has since added it to buildroot, but I haven't tried it.
bgamari: dsmith-work, any idea where that error might be coming from and what it means?
dsmith-work: ERROR: In procedure load-thunk-from-memory: ELF file does not have native word size
dsmith-work: Looks like the wrong guile is trying to load the wrong .go files.
manumanumanu: jeko: nope. Not what I have seen. Learn how the module system works (which is not obvious), and try the different things
dsmith-work: jeko: There used to be a template package somewhere. Not sure where it went.
dsmith-work: jeko: But I think it was for a package that wraps an external C lib.
dsmith-work: Marten Grabueller comes to mind.
bgamari: dsmith-work, hmm
dsmith-work: Well, typoed that name!
bgamari: dsmith-work, any debugging advice?
bgamari: I essentially just ./configure'd with the desired target and build toolchain and ran make
dsmith-work: Martin Grabmuller
ArneBab_: jeko: you can start with a simple script and later move it to a full package.
dsmith-work: bgamari: Hmm. Nope.  The only suggestion would be to let guile build itself locally instead of using GUILE_FOR_BUILD
bgamari: I see
ArneBab_: jeko: at some point you’ll want to work out how to do a nice autotools setup with installation, pre-compilation and access to data.
ArneBab_: jeko: but that’s likely some way off
ArneBab_: (in the distance)
dsmith-work: bgamari: You might want to use the mighty strace to try and see what is loading what.
bgamari: sure
bgamari: unfortunately it sounds like it's loading the object file from memory
dsmith-work: bgamari: Is your guile-for-build the same version as what you are cross-building?
bgamari: so it may be hard to determine where exactly it came from
bgamari: dsmith-work, yes
dsmith-work: That /should/ work.
dsmith-work: bgamari: It's been a while since I've tried to cross-build.
bgamari: dsmith-work, if I don't specify GUILE_FOR_BUILD configure tries to find a guile in PATH
bgamari: so I'm not sure I can let it build itself locally
dsmith-work: bgamari: Unfortuantely, I've changed jobs since then, and my notes/scripts/workingdir are there.
bgamari: ahh, unfortunate indeed
dsmith-work: bgamari: Also, I've never used guix.
bgamari: well, this is nix, but in principle it really shouldn't matter
bgamari: I just used nix to build the host guile
dsmith-work: Ahh.  Sorry about that. I misread.
dsmith-work: bgamari: Here is the buildroot package https://git.busybox.net/buildroot/tree/package/guile 
dsmith-work: There are some patches there.
dsmith-work: Not sure if that applies to your situation.
dsmith-work: Not even sure if that build configuration works.
bgamari: Yeah, I've been looking at that
dsmith-work: bgamari: But *maybe* there are some clues there that will help?
bgamari: I haven't tried it yet
dsmith-work: I know I had guile running using buildroot on an rpi or beaglebone.
bgamari: cool
bgamari: well that is a good datapoint
dsmith-work: bgamari: I'll see when I get home.  I think I might still have that around.
dsmith-work: Gonna be about 7 hours from now.
bgamari: cool, I'll be around
bgamari: dsmith-work, thanks!
jeko: (Thanks to people who answer my question, sorry for delay and short come back, I write on my phone...) cheers
OrangeShark: jeko: I am actually writing a blog post on how to structure a guile project. It based off of other projects I have looked at
jeko: OrangeShark: I would like to read it for sure !
hooverville: OrangeShark: me too (would like to read too)
OrangeShark: jeko: hooverville it is almost done. It will eventually add stuff including testing and other stuff
jeko: can you give us your blog address ? I will check regularily and maybe read some post as well :)
OrangeShark: jeko: https://erikedrosa.com/ 
jeko: OrangeShark: thank you
OrangeShark: no problem
hooverville: ACTION gives thumbs up
bavier: jeko: I have an autotooled guile project at https://notabug.org/bavier/joy-in-the-morning 
bavier: the organization is based roughly on some of what's done in Guix
bgamari: dsmith-work, I think guile 2.2.0 regressed with respect to cross compilation
bgamari: dsmith-work, I can cross-compile 2.0
bgamari: and indeed that's what buildroot uses
dsmith-work: Ahh
dsmith-work: ACTION points the Dread Finger of Accusation at..  wingo!
bgamari: heh
dsmith-work: Hmm..  I wonder if it's related to the newish bootstrapping .go files that come in the package tarball.
dsmith-work: bgamari: Would you consider building from the stable 2.2 git branch? (instead of a release tarball)
bgamari: dsmith-work, sure
bgamari: dsmith-work, is there a chance it would work?
dsmith-work: bgamari: Yes, I think so.
dsmith-work: bgamari: My understanding is the package contains all 4 types of go files.  It looks like when you are x-compiling, the wrong type is selected.
dsmith-work: (that's just a guess)
dsmith-work: If you build from git, you will only have the ones for your host. So that might make a difference.
dsmith-work: (the 4 combos are 32/64 bit and big/little endian)
dsmith-work: bgamari: But please be patient.  It could take hours.
jlicht: hello guile! I was wondering if there is already an existing module for parsing and/or querying html
OrangeShark: jlicht: I believe guile-lib has an html parser
dsmith-work:  http://www.nongnu.org/guile-lib/doc/ref/htmlprag/ 
dsmith-work: If the html is well formed, the sxml stuff built in might work?
dsmith-work: ACTION never tried
jlicht: thanks OrangeShark, dsmith-work: I will look into all of these options
kevinfish: getting a bunch of these kind of errors while compiling the latest guile.  Any ideas?
kevinfish: ake[2]: Entering directory '/home/kevin/0work/guile-2.2.0/bootstrap'
kevinfish:   BOOTSTRAP GUILEC language/cps/effects-analysis.go
kevinfish: ;;; WARNING: loading compiled file /home/kevin/0work/guile-2.2.0/bootstrap/language/cps/dce.go failed:
kevinfish: ;;; ERROR: In procedure load-thunk-from-file: Invalid argument
kevinfish: I did crash during the middle of it.  Make I should make clean and start again?
dsmith-work: kevinfish: Make sure you don't have another guile somewhere.
kevinfish: oh god, I gotta lot of guile :)
dustyweb: does anyone have an example of match-let I can look at?
dustyweb: oh nm
happy_gnu[m]: dustyweb: that's interesting please share what you found with me
manumanumanu: Ahoy ahoy!
manumanumanu: What a wonderful morning!
manumanumanu: I have been thinking about srfi-127. It is called light-weight laziness, but the most useful generator is the coroutine one, which I guess most schemes will implement using call/cc (apart from guile and scheme48). That it not light-weight at all
manumanumanu: For it to be, a scheme would have to implement an efficient generator
dsmith-work: {appropriate time} Greetings, Guilers
sirgazil: Let's say you copy some code with unconventional indentation from the Web and paste it in your Emacs. What do you use to reindent code?
sirgazil: How do you reindent a region or the whole file?
daviid: sirgazil: place the cursor at the beginning of the sexp and hit M q
sirgazil: daviid: Nice. I'll try it...
daviid: sorry. it is M C q, not M q
sirgazil: daviid: M q did some reindentation, though. Let me see the difference...
rekado: C-M is always for s-expressions.  C-a is beginning of line, C-M-a is beginning of sexpr; same for -e, -b, -f, etc.
dustyweb: wingo: I'm trying to figure out how to model the following in fibers:
dustyweb: I need to wait on read from a websocket *or* after a certain amount of inactive time, send a ping
cmaloney: Wouldn't that be a UNIX alarm?
cmaloney: or are you looking for something cross-platform?
dustyweb: wingo: it doesn't seem we have a good way to compose read/write suspension with the rest of the fibers CPS choice-operations
dustyweb: cmaloney: I know how to suspend for sleeping but
dustyweb: I don't have a good way to interrupt waiting on reading
dustyweb: I guess
dustyweb: the right way to do it would be to spawn the reading thing into its own fiber, maybe, as well as the timer
dustyweb: and have both of them send to a shared sink
cmaloney: Can't the fiber itself set a SIGALRM?
cmaloney: and whenever it gets data it resets the SIGALRM?
dustyweb: cmaloney: there's already a sleep mechanism
dustyweb: cmaloney: the issue is that the read/write/system event mechanisms we have don't compose with the CSP choice operations
cmaloney: Perhaps I'm solving the wrong problem then
dustyweb: wait I think I already know the answer
dustyweb: I'm a moron
cmaloney: I don't think that. :)
daviid: ACTION thinks dustyweb is a top notch hacker
dustyweb: well I'm certainly not at my optimal thinking ability right now
dustyweb: thanks cmaloney, daviid
dustyweb: I was up until 3am trying to get this thing working
dustyweb: well
dustyweb: the test suite working
dustyweb: and I did
dustyweb: but then it turned out deploying it was another matter X_X
dustyweb: so I'm working on one of my other TODO list items while I compile a new version of guile and a new guix system build
dustyweb: so many yaks deep
cmaloney: feel the skin of the freshly shaven yak
OrangeShark: good day everyone
ftknox: OrangeShark: hello!
reed_: Hi All, I have been browsing Dave Thompson's code for SDL2 bindings to try to understand the foreign function interface better. In the following file https://git.dthompson.us/guile-sdl2.git/blob/HEAD:/sdl2/config.scm.in   there is a piece of code (define %libsdl2 "@LIBSDL2@"). I believe there is some sort of pre-compiler that replaces `@LIBSDL2@` with something, does anyone know if that is the case?
reed_: Also if so, is it standard to name files that get pre-compiled "*.scm.in"?
OrangeShark: reed_: that basically involves autoconf, check configure.ac
OrangeShark: when you use autoconf to generate the configure script, it will configure that file when the user runs ./configure
reed_: OrangeShark: Thanks, that seems to be what is happening.
OrangeShark: ./configure with flags for the lib location
OrangeShark: reed_: there is also a way to use pkg-config to find the lib location so users don't have to specify it. You can see it used on guile-git for libgit2 https://gitlab.com/guile-git/guile-git/blob/master/configure.ac 
OrangeShark: it essentially uses pkg-config to read some variables in the library's .pc file
reed_: I guess I need to familiarize myself with this toolchain more. What is a .pc file?
dustyweb: hey civ
dustyweb: oops
dustyweb: not here
dustyweb: sneek: later tell civodul congrats on narrowing down the memory leak! \\o/
sneek: Will do.
dustyweb: sneek: later tell civodul and having a supposed fix :)
sneek: Will do.
quigonjinn: hello. there is an old guile 1.3 program with the following line:(lambda (sym) (@@ fmt sym)) . What kind of data type used to represent the module? With guile 2.0/2.2 i'm getting 'source expression failed to match any pattern in form'.
dsmith-work: Monday Greetings, Guilers
dustyweb: davexunit: a while ago I made a case for not using symbols for some things because I thought they weren't GC'ed.  Now I'm not so sure!
dustyweb: I see #include "libguile/weak-set.h" in symbols.c
dustyweb: I've asked on the list
dustyweb: I also no longer remember where I got that impression from...
davexunit: IIRC symbols that are literals in the code are around forever as static data
davexunit: symbols made via things like string->symbol can be GC'd
davexunit: dustyweb: one way to test is to make a guardian to protect (string->symbol "foo"), call (gc) a bunch, and then check the guardian
davexunit: I just tried that test and found that the symbol wasn't GC'd
davexunit: but
davexunit: (symbol-append 'foo 'bar) *did* get GC'd
davexunit: not sure why (string->symbol "foo") stays around forever
dustyweb: hm weird!
davexunit: hmm
davexunit: wrong again!
davexunit: it does get GC'd
davexunit: my first test just didn't catch it
dustyweb: oh nice!
dustyweb: i,i Guardians of the GC
dustyweb: davexunit: well that changes my feelings about using symbols as keys in several places :)
davexunit: :)
dustyweb: davexunit: thanks for the help investigating
davexunit: you're welcome :)
kevinfish: Hi, I'm trying to install guile-reader.  I've tried 0.[456].x so far and they all bomb at ./configure with "configure: error: You need Guile 1.8.x or higher." but originally I had guile 2.x.x and now I've downgraded to 1.8.8 and I'm STILL getting the error.  I'm not very familiar with autoconf.  Help!
kevinfish: I'm installing from the guile-reader tarballs.   I tried cloning the git repo but was getting all kinds MORE errors with autoconf, etc...
daviid: guilers, here http://paste.lisp.org/+7PA5,  a snipset I wrote out of guile-cv, so you can help me (maybe): I'd like to make im-rgb->gray-1 run faster, anyone has an idea and how, if possible? many thanks...
daviid: in the above snipset, it does not matter that the vectors are all '0.0', real channels of real images have values of course, but for the sake of trying to improve things, it does not matter ...
dsmith-work: kevinfish: It could be that guile-reader hasn't been updated for 2.x yet
daviid: for info, on the same image, the corresponding operation rgb->gray, in imagej (java) is almost instantaneous
dsmith-work: kevinfish: Hmm.  And yet it says it has been.
kevinfish: dsmith-work: well, the error says 1.8.x or NEWER
kevinfish: but I think its specifically looking for "1.8.x" IOW "1.8.8" is NOT a match so fails
kevinfish: so the configure.ac is bad or something
kevinfish: AC_CHECK_FUNC([scm_take_u8vector], [have_guile_1_8=yes], [have_guile_1_8=no])
kevinfish: if test "x$have_guile_1_8" != "xyes"; then
kevinfish:   AC_MSG_ERROR([You need Guile 1.8.x or higher.])
kevinfish: fi
daviid: kevinfish: we fixed a GUILE_PROGS bug along the line of 2.0 to 2.2, try to grab the latest guile.m4 from a recent release and use it with what ever guile you need
dsmith-work: kevinfish: How did you install your guile?
daviid: kevinfish: though I really recommend you to run the latest stable, and avoid at all cot 1.8.x
kevinfish: dsmith-work: I did it with apt-get
kevinfish: actually synaptic
kevinfish: daviid: so I should just install guile from source?
dsmith-work: Do you have the -dev packages installed?  It may be ./configure is only looking for things in the -dev package.
kevinfish: 2.0.x is the latest in the peppermint/ubuntu repos best I can tell
kevinfish: dmyeah, I got the guile-1.8-dev
daviid: kevinfish: yes, remove that and grab the latest tarball
kevinfish: daviid: okay
daviid: my suggestion, but you may have other constraints
dsmith-work: kevinfish: And yeah, best to avoid 1.8.
daviid: kevinfish: purge is better then remove, if there are no other packages depending on guile on your installation
dsmith-work: kevinfish: Be patient.  Installing guile from source does take a while.
daviid: kevinfish: though from what you said, guile-reader won't work with the latest stable? I don't use guile-reader, I don't even know what it does
kevinfish: well, I have some of the peppermint setup stuff depending on the guile 2.0.x libraries.  I just didn't remove those.  Think that won't interfere with my install of the latest guile?
kevinfish: daviid: it upgrades the reader to be more extensible.
kevinfish: I'm trying to install skriblio which adds a syntax [... ,(func x) ... ]
daviid: kevinfish: no it won't, just use --prefix=/your/prefix for the manually installed, don't forget to update your path for /your/prefix/bin and ldconfig for /your/prefix/lib ...
kevinfish: daviid: k, thx
daviid: kevinfish: but again, from what you said, guile-reader won't work: what does the skriblio guile version dependency says? you might as well ask in #guix, if there is a skriblio package, then you'd install guix and skriblio ... just another possibility
daviid: have to go afk for a little, guilers, wrt my above paste and quiz, if anyone has an idea ping me ... thanks
jeko: hi all! how can i test equal? on @ char?
numerobis: Hi! I just read the part of the Guile manual about the meta switch, to circumvent the limitations of the shebang. As I use Nix, my shebangs usually look like "#!/usr/bin/env guile", and the system complains if I add options after guile. In this situation, is there also a way to pass arguments to nix? Thank you!
numerobis: Woops, I just saw that it was explained in the following section (4.3.4). Great! :)
reed_: Hi all, is there a standard way to use modules that don't come with guile by default?
bgamari: In which configurations can guile be cross-compiled?
bgamari: is --host=A --build=B --target=B supported?
stratotanker: Hello, I have strange error with a guile program using FFI. That's the output: http://paste.lisp.org/display/359158 
daviid: stratotanker: so, as stated in #scheme, you have to narrow down the cause of this bug, which probably comes from your code, not from guile, and post a snipset of code (10 lines o so) that reproduce it, then we can (try to) help...
stratotanker: Sorry, get's disconnected
stratotanker: daviid: I'm pretty sure it's not a guile bug, I think it's related to dynamic/static memory allocation in the library
stratotanker: I'm using libparted function ped_disk_new_fresh throught this: http://paste.lisp.org/display/359160 
stratotanker: If I comment out the last line (make-pointer) everithing works, but with memory leak
daviid: stratotanker: (a) when you are askng for help, you have to take your time provide a self 'executable' snipset; (b) it seems to me that you're doing things in a very unorthodox way: try to read and learn from other code that use the ffi and binds a C lib, there are tons of examples, grab a simple and easy one to learn ...
stratotanker: can you suggest a simple example?
stratotanker: I read guile-gnome but it's hard for me (I'm a beginner)
daviid: oh no, guile-gnome does not use dynamic ffi
daviid: the manual has a dead siple example to start with: 6.21.6 Dynamic FFI
daviid: a couple of examples actually, try all these, till they work for you on your machine... my recommendation
stratotanker: Daviid is the same way I'm doing it. Please take a look at the complete source: https://bitbucket.org/_Christian/gnufdisk/src/d0c42d2bd00a2b5a02cc1ec353c48fc0648d7625/src/libparted.scm?at=default 
stratotanker: Code is in progress don't hate me
daviid: stratotanker: your 5 lines snipset is totally different from these 3 guile's manual example
daviid: and not complete, I cn't try it here ...
stratotanker: You can download the full repository if you want, its free
stratotanker: In the snippet I paste the sorce where I think the error comes from
daviid: stratotanker: 10 lines complete self exacutable snipset, then maybe someone will look at it ... I'm off this subjct now, sorry
stratotanker: Okay daviid, sorry to disturb.
stis: check out http://www.c-lambda.se/functional-python-ii.html   that's how functional classes should work
mwette: Yay!  I now have geiser working.  Gave up a couple years ago w/ v0.6.  Just tried again and working.
codemac: Is there any documentation on what environment the reader has when reading a scheme file?
codemac: I'm having to use some really weird hacks in a macro to make a binding available via local-eval, and I think I don't understand the intersection of define-syntax macros and environments
codemac: if anyone has docs/reading that could help, because I know I'm doing awful things :P
cmaloney: Evening
amz3: héllo #guile
OrangeShark: happy friday
happy_gnu[m]: \\o/ happy friday
manumanumanu: Happy friday!
manumanumanu: I had to help a friend with a javascript task today. I have managed to completely forget the syntax.
manumanumanu: happy times.
ecraven: use something like parenscript!
ecraven: I wrote a simple transpiler, use it for most javascript tasks I have ;)
joshuaBPMan: hello,  I'm trying to get sxml->string to work, but it's not working...
joshuaBPMan: (sxml->string `(html (body (head (title))))) is returning an empty string
daviid: joshuaBPMan: sxml->string detag an sxml tree, in the above, detag and ther is nothing left
daviid: scheme@(guile-user)> (sxml->string `(p (i "hello world!")))
daviid: $7 = "hello world!"
guile-guest1: hi
sneek: Welcome back guile-guest1, you have 1 message.
sneek: guile-guest1, Apteryx says: then you'll at least need to build proot -- in the same page it details how to build a statically linked proot on a 2nd machine and then transfer the binary to your server.
guile-guest1: do you guys have link for example format gnu robots ?
roelj: What's an elegant way to generate a list with a sequence of numbers: '(1 2 3 4 5 6 7)?
roelj: I now use http://paste.lisp.org/+7P0K 
roelj: But I hoped to find a function that already does this.
janneke: roelj: (iota 7 1) in srfi-1?
roelj: janneke: Thanks!
roelj: Ehh..  How do I merge two lists again..? (define a '(A B C D E F)) (define b '(1 2 3 4 5 6)) (... a b) => ((A 1) (B 2) ...)
roelj: Ah, (zip a b) seems to do that.
civodul: zip!
roelj: Is there an alternative to scandir that allows to select a subset of files without writing a lambda? So something like (scandir "data/prefix-*") => '("prefix-file1" "prefix-file2" "prefix-file3")
civodul: there's 'find-files' in (guix build utils), but it's recursive
civodul: or you could do (scandir dir (cut string-prefix? "prefix" <>))
civodul: no lambda! :-)
roelj: Haha, indeed.. no lambda :)
roelj: That looks nice enough :)
davexunit: ACTION learned how to use prompts to traverse a nested structure and produce a list of results without having to flatten nested lists
civodul: sounds fun
davexunit: I think I could use it to improve my parser combinator code
davexunit: and guile-syntax-highlight
davexunit: basically, each time the recursive process produces a value worth keeping, you abort with that result, the prompt handler simply conses the result onto the result of the continuation
davexunit: the initial thunk given to call-with-prompt returns '() ultimately, and you get a nice proper list
OrangeShark: davexunit: I do something similar to collect values in commonmark using just continuation passing style
davexunit: neat
davexunit: I imagine there are more examples of this style
davexunit: it just took me awhile to understand it
OrangeShark: I still need to understand prompts. For the continuation passing style, I just tried what I learned from the little/seasoned schemer.
davexunit: once you wrap your head around prompts you will find uses for them all over
davexunit: being able to write your own control flow operators is so great.
dustyweb: davexunit: +1
dustyweb: also
dustyweb: I need to finish The Seasoned Schemer
dustyweb: I'd really like to get to the CPS part.
davexunit: yeah I never finished that book either
OrangeShark: the CPS part was great :)
OrangeShark: it shows you some common ways to use CPS
stis: hej guilers!
manumanumanu: Hej stis
numerobis: Hello! I am writing a website in guile, and was wondering whether there was a tutorial somewhere about how to use guile with fastCGI? I've looked around on the web but haven't found anything yet. Thank you!
nalaginrut: numerobis: I'd recommend you try GNU Artanis rather than fastCGI
numerobis: nalaginrut:Thank you for the recommendation! But do you think that GNU Artanis is still maintained today? Reading through the documentation, I saw that some things are still #todo, so I'm afraid it won't be fully functional. Also, it seems that the website of GNU Guile does not use it...
OrangeShark: numerobis: I think GNU pages for software only support static pages.
OrangeShark: numerobis: and nalaginrut is the maintainer of GNU Artanis
numerobis: OrangeShart: I don't really know much about the terminology related to website, but it seems to me that the content of site of Guile (code at http://git.savannah.gnu.org/cgit/guile/guile-web.git)  is generated by guile code dynamically. But since GNU Artanis is still maintained, that's probably easier to use. The only thing that still makes me hesitate is that there isn't a Nix package for it, and I don't have
numerobis: experience in building one myself. But I guess that'll be a good opportunity to learn. :) Do you know if there is a repository somewhere with an example of a website built with GNU Artanis? Thank you!
OrangeShark: numerobis: The GNU Guile website uses haunt, a static site generator, see https://haunt.dthompson.us/ 
OrangeShark: I am not aware of any example websites built with GNU Artanis, would probably be best to ask nalaginrut.
OrangeShark: or ask the GNU Artanis mailing list to see if anyone will link their website
numerobis: OrangeShark:Oh, that's really interesting, thank you! And good idea, I think I'll send an email to the mailing list.
dustyweb: ArneBab_: is there a wisp pretty-printer?:
ArneBab_: dustyweb: not yet
ArneBab_: dustyweb: for wisp it currenty uses source-properties to provide something like that
civodul: hmm module reloading vs. "generative" record types
davexunit: ACTION really wishes GOOPS had method combination
davexunit: could really use the equivalent of :around in CLOS right now
solene: hello, in this page https://www.gnu.org/software/guile/manual/html_node/Linking-Guile-into-Programs.html  HOSTNAME is used but it's not an environment variable exportd (maybe on some system) this cause the example to just return #f
ArneBab: short info: the website still references 2.2.0 (not 2.2.2) and the snapshot-links for 2.2 don’t work: https://www.gnu.org/software/guile/download/ 
ArneBab: if you’re interested in some so-far-undocumented guile datatype and operations benchmark graphs: https://bitbucket.org/ArneBab/wisp/downloads/benchmark-results.tar.xz 
ArneBab: created with https://bitbucket.org/ArneBab/wisp/src/c7e594c41355e369bf708fe643b0580be3f9dcd8/examples/benchmark.w?at=default&fileviewer=file-view-default 
ArneBab: created with https://bitbucket.org/ArneBab/wisp/src/c7e594c41355e369bf708fe643b0580be3f9dcd8/examples/benchmark.w 
solene: interesting
dustyweb: ACTION is a troublemaker https://github.com/w3c-dvcg/ld-signatures/issues/15 
davexunit: dustyweb: if only canonical sexps could take over...
davexunit: I wasn't making trouble, but I did write a general purpose A* pathfinding algorithm http://paste.lisp.org/display/358917 
dustyweb: davexunit: ooh awesome
dustyweb: davexunit: yeah and canonical sexps are just so nice
dustyweb: did you see I built guile-csexp using your json library as a guide?
davexunit: I didn't know! awesome
davexunit: I appreciate their existence so much more after learning that PEM is just so terrible
dustyweb: recursive descent parsing is so nice
dustyweb: oh yeah
dustyweb: PEM
dustyweb: is the fucking worst
dustyweb: I mean it's not PEM itself
dustyweb: but ASN.1 and all the terrible layers beneath it
dustyweb: and there are many
dustyweb: but I think canonical sexps are very nice in general
dustyweb: I am advocating them as the canonicalization method for Smarm
dustyweb:  https://github.com/WebOfTrustInfo/rebooting-the-web-of-trust-fall2017/blob/master/draft-documents/smarm.md 
dustyweb: I think they're also very nice in general as a data serialization format
davexunit: ooh yeah you're right
davexunit: since every Lisp's 'write' is different
dustyweb: I intend to use them for inter-process / networked actor communication in 8sync
davexunit: cool
davexunit: I read some of the 8sync code for some inspiration for a little game thing I started
dustyweb: oh nice :)
davexunit: it's actorish
dustyweb: I hope it was in some way helpful... of course once someone says "I read your code for inspiration" you immediately think of all the flaws it has ;)
davexunit: but not share nothing.
davexunit: hehe don't worry about all that
davexunit: it was very useful
dustyweb: I'm glad :)
davexunit: I took some ideas from 8sync and fibers to make a game object system
dustyweb: cool
dustyweb: I still need to push out my 8sync + fibers branch
davexunit: also read godot docs and code
dustyweb: awesome
dustyweb: all cool projects there
davexunit: and Xelf
dustyweb: that too :D
davexunit: I think that's it :)
dustyweb: cool project overload!
davexunit: game objects form a tree, parent/child relationships and all that, but they communicate with each other over channels that are sort of like what fibers has
dustyweb: cool :)
dustyweb: DAG?
davexunit: it's strictly a tree
dustyweb: I guess trees are a subset of DAGs :)
davexunit: I guess so :)
davexunit: you couldn't, say, attach the player object to 2 different nodes
dustyweb: ACTION nods
davexunit: a single-parent DAG ;)
davexunit: sounds much fancier than "tree"
dustyweb: :D
davexunit: if I get enough to finish it I'm going to submit something to the lisp game jam
davexunit: enough time*
dustyweb: I was thinking the other day about how "oh right merkle-tree'ish/append only systems are always inherently DAGs" and then thinking
dustyweb: "dang if you could break sha1 collisions to introduce a cycle, how much git software would you break"
dustyweb: looplooplooplooplooplooplooplooploop
dustyweb: or maybe
dustyweb: recurserecurserecurserecurserecurserecurse
davexunit: *dustyweb consumes all available RAM*
davexunit: damn guile 2.2!
dustyweb: guile 2.2 is pretty great in general!  but yeah hopefully the compilation memory issues can be fixed :)  it seems like ludo got (a lot of it) narrowed down to weak hash table reimplementation mostly
dustyweb: I still wonder if swapping out the api would fix things then, but of course I'm doing nothing but armchair commentary while I'm swamped over here getting ActivityPub out the door
whaleflower: davexunit: just chiming in here to agree, I think your A* pathfinding algorithm is the best way to abstract graph traversal using different data structures
whaleflower: it abstracts nicely for bfs, dfs, and everything in between
whaleflower: while still giving you the flexibility to use efficient datastructures
stis: yeehaa, got pythons eval/compile/exec working in my python implementation in guile
stis: also tab completions x.fa TAB now works
stis: string operations on bytestrings as also far in implementation
davexunit: whaleflower: hey thanks!
davexunit: I took the pseudocode from here https://www.redblobgames.com/pathfinding/a-star/introduction.html  and translated it
whaleflower: cool, can't wait to read through that
davexunit: I like that the resulting code doesn't care at all what the graph actually looks like
davexunit: I will be plugging 2d tile-based maps into it, but you can use anything.
whaleflower: yeah, it's super elegant and generalized :)
davexunit: I will probably add a data structure that holds the queue and hash tables so that you can keep reusing them for repeated path finding instead of allocating memory constantly, but as is it seems to be a decent start.
ArneBab: Wisp 0.9.7 released with bugfixes: http://www.draketo.de/english/wisp#v0.9.7 
amz3: héllo #guile
OrangeShark: hello guile
OrangeShark: Does anyone else have an issue with the GUILE_PROGS macro that is in trunk?
OrangeShark: I mean master, not trunk
ArneBab_: apteryx[m]: for the string it works, it just warns you that this might not be efficient
ArneBab_: so you might just want to go with it.
ArneBab_: apteryx[m]: even more: this is just a compiler warning. if you pre-compile the code before shipping to users, they should not see that.
Apteryx: I don't understand; all of a sudden Geiser is giving me all kind of silly errors such as: :393:29: :393:29: In procedure module-lookup: Unbound variable: define-module
Apteryx: define-module is a built-in, no?
Apteryx: And I can compile my module using guild or guile without any warning... humph.
Apteryx: I think I've found the culprit. I'm defining a module with (define-module (a b) .... but the a folder is not in my %load-path, so it errors very early it seems, at least when using C-c C-a.
Apteryx: Then nothing works, not even %load-path
happy_gnu[m]: Apteryx: is it working now?
Apteryx: it is! I extended GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH with a new Guile dev sandbox (~/src/guile-hacks/) in my ~/.bash_profile and relogon; now Geiser is happy.
Apteryx: My current scripts are in the ~/src/guile-hacks/fiasco namespace so it works.
Apteryx: Is there any way to set a variable in the Guile REPL without printing it? like a = (my-func) to mute the output? It's very long and causes Emacs to choke.
happy_gnu[m]: Apteryx: ohh cool :)  I didn't know about Guile path
happy_gnu[m]: I think I was reading about something like that in the manual
happy_gnu[m]: Let me see if I can find it
happy_gnu[m]: Apteryx is this what you mean?
happy_gnu[m]: If you happen to love peace and quiet and prefer to keep your REPL’s echo area free from autodoc’s noise, geiser-repl-autodoc-p is the customization variable for you: set it to nil
happy_gnu[m]: and autodoc will be disabled by default in new REPLs. You can always bring the fairies back, on a per-REPL basis, using C-c C-d C-a
happy_gnu[m]: The customization group geiser-guile is also worth a glance, for a couple of options to fine-tune how Geiser interacts with Guile’s debugger (and more).
amz3``: nalaginrut: what's up?
Apteryx: Which should I use, vhashs or hashtables?
Apteryx: Seems they both offer the same performance benefit, but that vhashs also allow easy manipulation via list-based procs, whilst hash tables do not?
dustyweb: Apteryx: hashtables are faster, but are imperative / operate on mutation
dustyweb: Apteryx: vhashes do not mutate and are fairly performant, but every time you add something that already exists it still keeps the old one
dustyweb: so you don't really "replace" the old value... it's still hanging around memory-wise, if that turns out to be important to the code you're working on
Apteryx: happy_gnu[m]: thanks for the geiser guile group tip; I've found a few defaults to adjust for my taste there.
dustyweb: vhashes are kind of like constant-access alists
Apteryx: I see. If the mapping I need is static, I guess both would work the same then?
happy_gnu[m]: Apteryx: Oh I am glad, I think is the first time I help you :)
Apteryx: :)
happy_gnu[m]: I am trying to install chickadee
happy_gnu[m]: I got distracted reading dustyweb blog and I saw about a Guile tutorial with robots
happy_gnu[m]: then I thought.. hey I could try a game with a robot
happy_gnu[m]: that has a REPL and you have to type  commands to advance
dustyweb: Apteryx: yeah if you don't need to update the mapping using either should be fine
dustyweb: because you aren't appending beyond the initial set
dustyweb: so it's both not really mutating and not going to have duplicates
happy_gnu[m]: the little guiler .. the robot guiler .. some name like that
Apteryx: What whas the trick to split the string given to format on multiple lines? The compiler doesn't like (string-append ...)
daviid: Apteryx:  \\n, ~% or 'real' cariage return in the format string itself will do...
Apteryx: daviid: right, that would split the printed string. I'm looking to split the string in the source code file, for readability.
Apteryx: Sorry if I expressed the question poorly.
daviid: I don't understand what you are trying to do, example?
Apteryx: daviid: http://paste.lisp.org/display/358761 
Apteryx: Maybe this is for internalization reasons... I read somewhere it's better if the strings to translate are static instead of dynamic.
daviid: just don't split the string
Apteryx: OK. Seems to run in the face of good coding style conventions though.
daviid: the coding style conventions are for the code itself, not for strings that require 'not to be split' (for example because passed to a gnome widget that wraps them automatically ...)
daviid: if you prefere to keep your procedure 'clean with that respect, you can define a var with the format string outside the procedure and call it using ~?
Apteryx: Right, that'd be a way. Thanks! I'll try to come up with more succint messages as well ;)
Apteryx: Is there anything to understand in this: http://paste.lisp.org/display/358552 
Apteryx: Basically I get different exit status from the same command, depending whether it ran from system* in Guile or under bash directly.
Apteryx: The same exit status 256 also happens when using system instead of system*
Apteryx: Better: guile -c '(let ((status (system "exit 1"))) (format #t "exit status: ~a~%" status))' -> exit status: 256
Apteryx: :D
daviid: Apteryx you must call status:exit-val
daviid: (let ((status (system "exit 1"))) (format #t "exit status: ~a~%" (status:exit-val status)))
Apteryx: Ah, I see. Thanks for saving me the shame of posting my erroneous finding as a guile bug ;)
Apteryx: with-output-to-string doesn't seem to capture stdout from system* commands. Is this expected?
davexunit: yes
Apteryx: OK :/
Apteryx: It works with "with-output-to-file" though.
davexunit: 'system' is a wrapper around the POSIX call of the same name
davexunit: and it does not capture output
davexunit: you should use a pipe
Apteryx: ACTION reads about pipes
dustyweb: if only our pipe situation was better
dustyweb: or at least if only our stdin / stdout / stderr situtation was better
Apteryx: How can I hook a pipe to a system* command?
davexunit: you don't
davexunit: section 7.2.10 in the manual explains
Apteryx: Thanks. I though 7.2.2 Ports and File Descriptor was all there was, eh.
Apteryx: It works very well for capturing stdout. Now back to pondering about stderr.
Apteryx: Seems a workaround is to use the private open-process from (ice-9 popen).
Apteryx: How can I sort a list of structs base on one of its slot?
Apteryx: The slot in question is a string, so I would use string= 7.2) were not met:  No package 'bdw-gc' found
guile-guest7: what am I missing?
guile-guest7: (where STOW_PKGS_TARGET is /home/kmodi/stowed)
Apteryx: guile-guest7: have you considered the proot trick? It seems you could use a guix pack with it without having to build anything from source: https://guix-hpc.bordeaux.inria.fr/blog/2017/10/using-guix-without-being-root/ 
guile-guest7: thanks, I'll try that out
guile-guest7: Looks like I'll need to spend a weekend or two to understand all that.. got confused with guix pack vs proot
guile-guest7: Also I don't have proot
guile-guest7: At the moment I simply build my packages in my $HOME like ~/stow/pkgs/PKGNAME/VERSION and just stow everything to ~/stowed
guile-guest7: I believe Guix will do something like that, but with pre-built packages in its database?
Apteryx: sneek: later tell guile-guest7, then you'll at least need to build proot -- in the same page it details how to build a statically linked proot on a 2nd machine and then transfer the binary to your server.
sneek: Will do.
Apteryx: What do we have in Guile as finalizers?
Apteryx: I want to close some ports at the end of some procedure, wether it went well or not.
Apteryx: or maybe I'm thinking this to hard and can rely on garbage collection?
Apteryx: How can I convey 3 states? In Python I could use None/True/False and None being falsy it would work as a boolean, but I could still extract extra info when I needed it. In Guile '() (empty list), is not falsy, which makes breaks this. Or is there a better None in Guile than '()?
llooda: Apteryx: I'd use any symbol, e.g. #t #f 'neither. For the other stuff are you looking for dynamic-wind maybe?
mwette: there may be concept of nil in guile (not part of scheme) to support elisp
sneek: Welcome back mwette, you have 1 message.
sneek: mwette, ArneBab says: ah yes (no terminator but newline). I need to add that for a general tutorial.
davexunit: mwette: there is but it's not recommended to use it in scheme code.
davexunit: there's no getting around that in Scheme the only falsy value is #f
davexunit: if you want a ternary system, I would make unique objects to represent them and write the necessary operators that use them
davexunit: but I wouldn't use a symbol for the third value.  I'd allocate something fresh so that eq? could never be #t by accident
Apteryx: llooda: thanks!
Apteryx: ACTION goes to read about dynamic-wind
Apteryx: davexunit: OK. I'm not there yet (at the level where creating my own DSL is natural) but I'll keep this on mind. Thank you!
Apteryx: Interesting. My string ports are closed upon entering a dynaminc-wind. Should this be expected?
Apteryx: Here's what I mean by that: http://paste.lisp.org/display/358456 
OrangeShark: Happy Friday
bavier: OrangeShark: indeed, happy Friday
happy_gnu[m]: Hi \\o/
happy_gnu[m]: What Emacs packages do you prefer to work with Guile?
happy_gnu[m]: I only have autocomplete
happy_gnu[m]: What else do you recommend me
ft: Geiser
happy_gnu[m]: Oh I also have geiser :) I forgot that
OrangeShark: rainbow delimiters
OrangeShark: paredit
amz3`: +1 rainbow delimiters
amz3`: +1 week end
amz3`: Apteryx: here is the better-than-pipe thingy, it's the underlying procedure used by open-pipe https://lists.gnu.org/archive/html/bug-guile/2016-09/msg00008.html 
amz3`: sneek: later tell wingo we need to push forward this bug https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15228 
sneek: Will do.
amz3`: sneek: later tell wingo people keep asking that question
sneek: Will do.
amz3`: also, we need to parse url encoded forms or whatever the name is for data that is POST'ed from an HTML form otherwise, classic web dev is impossible in Guile
amz3`: maybe I am wrong, does anyone know how to parse request body from a POST'ed from using Guile?
amz3`: s/from/form/
happy_gnu[m]: Rainbow delimiters is pretty cool :O
amz3`: yeah
amz3`: apparently artanis can process form data, I will extract that from artanis later :)
happy_gnu[m]: And paredit is just perfect
happy_gnu[m]: I am using it
happy_gnu[m]: Just for fun deleting stuff
happy_gnu[m]: And creating
happy_gnu[m]: A lot of s-expressions
manumanumanu: ArneBab: Really, delimited continuations are _cool_. just look at wingo's fibers.
dustyweb: o/
manumanumanu: ArneBab: I implemented the coroutine generator from the generator srfi (125??) using both call/cc and prompts, and the difference is quite something
manumanumanu: even at top level
ArneBab: manumanumanu: sounds good
ArneBab: is the difference speed or elegance or both?
manumanumanu: ArneBab: speed. It could also be done with only one call-with-prompt, instead of two call/cc
manumanumanu: And once the complete continuation starts getting larger, the difference will be a lot bigger. With delimited continuaions, you never save more than you need
ArneBab: manumanumanu: that sounds great
Apteryx: amz3`: thanks for the link!
Apteryx: What's the best way to parse a result file I made when it as one sexp per line? So far I'd read the whole file as a string, split it per line and use eval-string. I guess there might be something more "native"?
Apteryx: s/as/has
mwette: Apteryx: try scm-reader
mwette: oops, I use (define scm-reader (language-reader (lookup-language 'scheme)))
mwette: language-reader is in (system base language)
Apteryx: OK! While searching I stumbled on this: https://www.gnu.org/software/guile/manual/html_node/Scheme-Read.html.  I'll try those options. Thanks!
davexunit: Apteryx: use 'load'
Apteryx: davexunit: seems close! Each line are formatted like this: ("a" "b" "c"). When I eval or use load on that I get: Wrong type to apply: "a", which makes sense. If I put a quote to say it's a list like '("a" "b" "c"), I get: Wrong number of arguments to #. Hmm.
davexunit: okay so what you have is not scheme source code
davexunit: I'm not sure what you are trying to do
davexunit: but I'm going to assume that evaluating that file is not what you want
Apteryx: I tried saving a serialized version of a list of records to a file, one per line. Now I'm trying to load the file and get them back.
davexunit: okay, so if the format is set in stone then open a file, and repeatedly call 'read' until you reach the end of file
davexunit: or, wrap the whole file in parens and read that to get a list
Apteryx: OK. So this was my mistake! I should have used a list. Thanks for pointing it!
Apteryx: I don't need quotes when working with files, right?
davexunit: np
m3tti: hi
m3tti: how could i use guile to make tcp connections
mwette: scm-reader will not eval.  I use a loop basically this:
mwette:     (call-with-input-file file
mwette:       (lambda (iport)
mwette: 
m3tti: 0
manumanumanu: Apteryx: why not basically just use read?
Apteryx: mwette: isn't scm-reader the same as the native 'read'?
mwette: (language-reader 'scheme) is like read but reads one sexp at a time
manumanumanu: mwette: read reads one sexp at the time as well
mwette: ah yes, I thought is was different.  So that should work.
manumanumanu: or datum, of course
Apteryx: mwette: OK, sweet. I'll use a named let, and pass back a list that will get consed to with each line's result.
manumanumanu: Apteryx: I don't know if you know that, but a neat trick in guile is to not use an accumulator, since guile doesn't have a stack limit
manumanumanu: Apteryx: https://pastebin.com/PK9HWnfC 
manumanumanu: that is actually faster than doing it the conventional way, with an accumulator
mwette: Ah.  `read' does not let you specify the context.  I need to check if I need that.
mwette: named let can use the stack if you (cons xxx (iter x)) instead of (iter (cons ...))
manumanumanu: mwette: jesus christ, don't look at that code. it is wrong and not what I intended to do
manumanumanu: mwette: the last line should be (cons line (loop (read port)))
Apteryx: manumanumanu: thanks for sharing. It's good to assume I know nothing about Guile, eh! I don't get it though. I would think your example would return the last line only, instead of a list (I want the later).
manumanumanu: Apteryx: my code is wrong. I didn't even read it through
Apteryx: eh, no worries.
manumanumanu: Apteryx: for clarity, something like this: https://pastebin.com/xb5wpW6K 
manumanumanu: Apteryx: I just wish someone would have told me a lot earlier about the expanding stack :) It is such a cool thing
Apteryx: nice! so this is what mwette was talking about. It suses the stack instead of a variable (accumulator)? Which is faster since it's already using that much of a stack depth?
mwette: manumanumanu: I hadn't looked, but I guess you knew what you were doing.  Thanks for posting the example.
manumanumanu: Apteryx: it is faster since you don't explicitly need to call reverse or reverse! at the end (if you want to keep the order)
manumanumanu: if you don't care about the order, I suspect an accumulator will be faster
mwette: I think it depends on how many bindings you introduce in the named let and other stuff inside the loop.
Apteryx: Interesting. I'm not sure why the returned value would be the list of cons'd read expressions instead of '() though? Given that (if (eof-object? line) '() ...) is going to be evaluated last.
manumanumanu: the only time it, to my knowledge, isn't faster is when jumping in and out of the loop with continuations, since restoring a large stack is more expensive than just a stack with an accumulator on it
manumanumanu: Apteryx: because the result is the whole call stack it conses the line with the result of the next iteration
manumanumanu: (cons line (loop (read port)))
Apteryx: maybe "line" should be copied under the if so that's the final returned value?
manumanumanu: nope
Apteryx: ah, decidely no.
Apteryx: hm, OK. Still a bit mysterious to me :) I'll give it a shot.
manumanumanu: Apteryx: consider this factorial function: https://pastebin.com/sn6mbP9C 
mwette: 1: (let iter ((out '()) (in '(a b c))) (if (null? in) (reverse out) (iter (cons (car in)) (cdr out))))
manumanumanu: mwette: you forgot the accumulator in the last cons
mwette: 2: (let iter ((in '(a b c))) (if (null? in) '() (cons (car in) (iter (cdr in)))))
mwette: 1 and 2 should give same answer if I did it right
mwette: ya ya
mwette: 1: (let iter ((out '()) (in '(a b c))) (if (null? in) (reverse out)
mwette: and (cdr out) -> (cdr in)
manumanumanu: Apteryx: the factorial procedure is not faster than using an accumulator, but it works the same way as the list one. each return value of a procedure is dependant on the return value of the next procedure application until (= n 1)
manumanumanu: now I need to go to bed. gnight
Apteryx: good night!
Apteryx: ACTION studying examples of mwette
Apteryx: factorial is easier to grasp, it just churns until it reaches a single value.
Apteryx: OK, my brain now agrees with the code. Thanks :)
Apteryx:  Basically this for #2: (cons 'a (cons 'b (cons 'c '())))
Apteryx: can I compose with-output-to-string and with-error-to-string to get a combined result?
amz3`: what about trying?
amz3`: pipes? system*? no
amz3`: sneek: say later to civodul, kudos for fixing rekado issue with the verrry big machine :)
amz3`: sneek tell later civodul kudos for fixing rekado issue with the verrry big machine :)
sneek: later, amz3` says: civodul kudos for fixing rekado issue with the verrry big machine :)
amz3`: botsnack sneek
sneek: :)
amz3`: :/
amz3`: it's night where I am, see you tomorrow for new adventures
Apteryx: amz3: I tried, answer is no. Both with system* or system
Apteryx: yikes. Using with-output-to-string with (system* "diff" "-r" dir1 dir2) causes diff to return exit-status of 256 for some reason.
Apteryx: If I remove the 'with-output-to-string' I get a normal exit-status of 0.
amz3: o/
amz3: apteryx[m]: what you want is prolly https://www.gnu.org/software/guile/manual/html_node/Pipes.html#index-open_002dpipe 
Apteryx: My claim about with-output-to-string changing exit status was wrong. I think something else was at play.
Apteryx: amz3: thanks, I'll look into that popen module!
amz3`: Apteryx: how is it going? did you succeed?
Apteryx: amz3`: I used an approach where I didn't need to chain commands, so I've punted on using pipes in Guile for now ;)
Apteryx: Currently making something to capture both stdout and stderr, something which is not readily available in Guile in seems.
Apteryx: *it seems
Apteryx: capture into strings
amz3`: Apteryx: there is a bug somewhere about that
amz3`: Apteryx: I will look it up tomorrow
amz3`: for you
apteryx[m]: amz3`: thanks!
guile-guest7: hello, I am trying to install Guile so that I can install Guix
happy_gnu[m]: If I have '(1 2 3 4) or '(a b c d) is there a procedure to make that list into a single item '1234 or 'abcd
happy_gnu[m]: Ohh I think is list->symbol
dustyweb: sneek later tell civodul https://github.com/WebOfTrustInfo/rebooting-the-web-of-trust-fall2017/blob/master/draft-documents/smarm.md 
sneek: Okay.
OrangeShark: yay I did it :)
OrangeShark: I managed to post on amz3's blog
Apteryx: Hello! How can I exit early, simulating (return my-value) ?
Apteryx: ACTION is reading about prompts
Apteryx: ooh, maybe call/ec is what I need
Apteryx: I've settled for let/ec
ArneBab_: sneek: later tell dustyweb: Is a language actually turing complete (as by its definition to be able to change an arbitrary amount of memory) — or even stronger: isn’t that language then one where its limit of turing completeness is explicitly defined?
sneek: Will do.
ArneBab_: sneek: botsnack
sneek: :)
ArneBab_: sneek: later tell dustyweb: and there you got me stumbling over the Magic turing machine again: http://www.toothycat.net/~hologram/Turing/HowItWorks.html  ☺
sneek: Okay.
amz3: Apteryx: that's it! you can simulate return with call/cc and its friends
manumanumanu: amz3, Apteryx : if you are using guile only, let/ec or call/ec will be faster, since it has a lot better stack usage. It is not portable though, but hopefully r7rs-large will make it so (although I doubt it).
ArneBab_: manumanumanu: I didn’t know that — nice! thank you!
dustyweb: did someone send me a message here?  I disconnected, unfortunately
sneek: Welcome back dustyweb, you have 2 messages.
sneek: dustyweb, ArneBab_ says: Is a language actually turing complete (as by its definition to be able to change an arbitrary amount of memory) — or even stronger: isn’t that language then one where its limit of turing completeness is explicitly defined?
sneek: dustyweb, ArneBab_ says: and there you got me stumbling over the Magic turing machine again: http://www.toothycat.net/~hologram/Turing/HowItWorks.html  ☺
dustyweb: ArneBab_: it does have an explicit constraint yes
dustyweb: but one that doesn't prevent it from being able to run what we would call turing complete programs I think? :)
ArneBab_: dustyweb: yepp.
OrangeShark: Happy Wednesday
Apteryx: Hello! I see this in the info manual:  (error "Unrecognized option `~A'" name)
Apteryx: but when I try `error' myself, the ~A or ~a is not expanded.
Apteryx: Isn't this error procedure a builtin?
stis: hej guilers!
stis: how do you handle SCM types in the FFI interface?
stis: found it, pointre->scm
dustyweb: civodul is uncovering all the memory leaks :)
civodul: they haunt me!
dustyweb: heh
Apteryx: can I use pipes in system* calls?
ArneBab: (with-error-to-string (λ()(write "hello" (current-output-port))))
ArneBab: (with-error-to-string (λ()(write "hello" (current-error-port))))
Apteryx: sneek: later tell civodul, I've posted a repro script for the Geiser issue here: https://github.com/jaor/geiser/issues/83 
sneek: Will do.
Apteryx: ArneBab: thanks :) It's not in Guile's manual index it seems.
Apteryx: In fact there is no string "with-error-to-string" in the Guile's user manual
Apteryx: are srfi-9 records homoiconic? I.e., can I print those to a file and reload them later?
xkapastel: that's not what homoiconic means
xkapastel: i imagine you can find a way to serialize them though
dustyweb: Apteryx: they don't serialize via write / read by default
Apteryx: dustyweb: OK. So I'd have to define a custom printer / reader to do that? Doesn't seem very hard; I can output them to a list and read them using an ice-9 match
Apteryx: Can I use output redirection when using system or system*? like, (system* "gzip" "-c" "-d" "/my/file.tar.gz" ">" "/my/unzipd/file")
ArneBab: Apteryx: I often simply try REPL tab completion (did you activate readline? If not, please do)
ArneBab: (to your question from yesterday)
amz3`: o/
OrangeShark: hi amz3`
amz3`: OrangeShark: hi!
amz3`: tx for +fav on my project :)
OrangeShark: no problem. I want to look more into it later today.
ArneBab: I finally implemented nice doctesting, using a property of the procedure instead of string parsing, and it feels great! → https://bitbucket.org/ArneBab/wisp/src/299795dbb3fecea91dcdde480817b36fc45ccc5f/examples/doctests.scm?at=default&fileviewer=file-view-default 
ArneBab: ^ complete implementation, parsed to scheme, drop-in ready.
ArneBab: to use it (example, 14 lines): https://bitbucket.org/ArneBab/wisp/src/299795dbb3fecea91dcdde480817b36fc45ccc5f/examples/doctests-testone.scm 
amz3`: so... at last I cycle back to my search engine work
dustyweb: I don't suppose there's something like module-add!/module-set! that also allows you to append a syntax form / macro to a module?
civodul: dustyweb: you could add a syntax form, but it wouldn't be used
dustyweb: civodul: aha, ok...
dustyweb: civodul: I ask because I'm implementing more or less the W7 security kernel stuff
dustyweb: on top of (ice-9 sandbox)
civodul: oh oh!
dustyweb: so
dustyweb: if we want to allow modules to define new macros that they then "pass into" child modules that are then run
dustyweb: like the (enclose) form
dustyweb: there has to be some way to put them in there, but I don't know we have something
dustyweb: all I need is to enable myself to define a macro here, and then in the new module I'm defining allow it to be something users of the other module can "use"
dustyweb: civodul: does that make sense?
dustyweb: it's maybe not important
civodul: hmm dunno!
civodul: W7 is very much a "run-time" thing
dustyweb: yes
civodul: macros are very much compile-time
dustyweb: it may be that macros don't make sense in that world
dustyweb: except for ones defined out the system
civodul: they make sense within a "module", i suppose
dustyweb: well and what if you want your module to be available to other modules
dustyweb: as in explicitly you're packaging up some of your features for general use
dustyweb: it seems like macros just aren't very usable for w7 I guess except "within the same module"
dustyweb: oh well!
dustyweb: ok I'll give up on macros for now :)
dustyweb: we'll just need to rely on lambda, the ultimate ;)
dustyweb: otherwise I think I have this working!
dustyweb: I'm getting in a last minute paper for Rebooting Web of Trust on how to use W7'ish scheme for "smart signatures"
dustyweb: this mechanism I'm writing up wouldn't be used long term
dustyweb: but it turns out that (ice-9 sandbox) has enough to define the whole system as a prototype :)
civodul: heh, sounds exciting!
civodul: though "smart" sounds like "cloud" to my ears ;-)
dustyweb: yes :)
dustyweb: civodul: all this "smart contract" stuff really means
dustyweb: is you have a sandboxed script that's effectively a predicate
dustyweb: at some future point, is the contract fulfilled?
dustyweb: that's all.
dustyweb: that demystified a lot of the etherium stuff people are talking about :)
civodul: right, and i think that's a very useful construct, as ethereum indeed shows
dustyweb: also it turns out there are currently some attacks possible against some of these systems
dustyweb: and I'm pretty sure W7 is just the system needed to fix it
dustyweb: lambda, the ultimate!
civodul: definitely :-)
dustyweb: but it wouldn't use guile's VM long term
dustyweb: though it may use guile's compiler tower
dustyweb: because crypto people want the final version to write out native code that can obscure the current operation against side channel attacks
dustyweb: eg recording cpu noise and figuring out keys
civodul: are they ok with using a Turing-complete language for that?
dustyweb: yes, it just has to have constraints in space and time
dustyweb: so that's another thing that would have to be done
dustyweb: it would have to be *deterministically* constrained in space and time
dustyweb: not in terms of seconds for example
dustyweb: but each operation would have a cost, and effectively the code would halt if the total operation count is exceeded
dustyweb: so if you have space/time constraints, and you have capabilities that don't permit mutating the outside world
dustyweb: it should be safe and deterministic!
dustyweb: that also means that the cost of each operation needs to be recorded in a manner that's uniform
dustyweb: across implementations
dustyweb: civodul: if you can surmise a reason why a turing complete language within those constraints is still not sufficient, let me know :)
civodul: dustyweb: i guess you're right, if it's properly constrained in time and space, it should be good
Apteryx: it works :) thanks again!
ArneBab_: glad to help :)
laertus: wow... i finally managed to complete a "guix pull"
laertus: yay
laertus: only took 2 weeks
Apteryx: laertus: Congratulations for persevering! I hope you'll find like me that it pays off :)
laertus: thanks
laertus: i hope so too
laertus: i do love scheme and am quite intrigued by the whole guix concept and architecture (as far as i understand it)
laertus: so i really, really want it to work out
Apteryx: :)
Apteryx: How do I substitute a single character from a string?
Apteryx: I don't get how string-replace is supposed to be used.
Apteryx: I guess I should use string-map instead.
Apteryx: but then I'm lost as to what the proc to pass to string-map should look like
Apteryx: That is tedious... Am I missing an srfi that would provide convenient substring substitution?
manumanumanu: Apteryx: (lambda (ch) (if (char=? ch #\\char_you_want_to_substitute) #\\char-you-want-to-substitute-to ch))
manumanumanu: Apteryx: (lambda (ch) (if (char=? ch #\\a) #\\b ch)) replaces all occurances of #\\a with #\\b . abba => bbbb
manumanumanu: Apteryx: otherwise, you could just use regular expressions. I am a huge fan of irregex by ashinn: http://synthcode.com/scheme/irregex/ 
amz31: héllo #guile
amz3: héllo again ;)
amz3: so I've wondering whether to post a message on the mailling list about the small blog engine I made
amz3: there is various bugs, the quality is not there yet, but I don't think I will continue on this road because of the bugs are difficult to fix (if possible at all)
michaelis: amz3: Hi. What are the bugs if I may ask?
amz3: michaelis: the impossible bug, when you register a new account with login & password, the user is redirect to the login page, autocomplete does fill in the forms but the "frontend state" is not updated accordingly
amz3: so you think you can directly submit the form, because the inputs are filled, but in fact you get an error saying the input is not ok
michaelis: amz3: Ok, thank you.
amz3: but that is very linked to my frontend framework, it's not related to guile
michaelis: amz3: That's what I was wondering, if it had anything to do with guile. Never mind then.
ArneBab: Guile wisp v0.9.6 released: http://www.draketo.de/english/wisp#v0.9.6  — making it easy to start your own wisp project
ArneBab: amz3: maybe you could write a "lessons learned" message
ArneBab: amz3: what you did, what worked well, what you would now do differently.
amz3: ArneBab: good idea :)
ArneBab: amz3: I’m looking forward to reading it!
Apteryx: manumanumanu: thank you!
Apteryx: Can I catch an exit exception to prevent termination of the program?
Apteryx: Geiser lately fails to find any documentation when using C-d C-d... Any advice? I can find everything going in the Guile Reference info manual and using i (search index).
ArneBab: Apteryx: try catch could work, but I didn’t try that yet.
Toga_Virilis: How exactly is (case ... ) implemented in guile? Does it linearly compare all options or does it compile it to some kind of hashing mechanism to do in constant time?
janneke: Toga_Virilis: you can try something like: ,expand (case 0 ((0) 0) ((1) 1) ((2) 1) (else #f))
Toga_Virilis: Ah, it actually uses memv even.
janneke: yeah, not really answering your question, but i figured it must be a macro
Toga_Virilis: Well it answered it, I expanded it.
Toga_Virilis: Maybe it has some heuristics though and compiles to some hash mechanism if it's larger than a certain number of rows or whatever.
Toga_Virilis: But it seems to just go towards (cond [(memv test '(...)) ...] ...) esentially
amz3`: WDYT https://contributopia.org/en/home/  ?
Apteryx: ArneBab: it does work!
ArneBab: amz3`: that’s a beautiful site!
ArneBab: Apteryx: nice!
Apteryx: my handler looks like: (lambda (arg . rest)  (format #t "Caught exception: ~a~%" (cons arg rest))) and it prints: "Caught exception: (quit 1)"
Apteryx: It seems I don't have stderr printed though :/
amz3`: I posted a challenge on the mailing list
amz3`:  http://lists.gnu.org/archive/html/guile-user/2017-10/msg00011.html 
Apteryx: If I run: (format (current-error-port) "error!") in my Geiser's REPL, I don't see any output. Why?
Apteryx: same thing in vanilla guile interpreter prints "error!" as expected.
ArneBab: Apteryx: I’m not sure — it’s likely a Geiser function. Maybe checking its documentation for error-port can help.
ArneBab: Apteryx: you might want to check C-h i m Geiser
ArneBab: (in emacs)
Apteryx: I'm trying to find something about error port in Geiser docs or on the web, but so far have failed.
ArneBab: I didn’t find it either …
ArneBab: (just searched)
ArneBab: Apteryx: you might want to ask in #geiser
Apteryx: ArneBab: It should work! There was an issue closed here (but not resolved): https://github.com/jaor/geiser/issues/83.  I think it was work around for guix-build, but I'm hitting the same problem with guix-download
Apteryx: Basically the output ports are bound to different values in the REPL vs the Scheme buffer, so when running some function eval'd from another place in the REPL it can output to an invisible place; or so I understand so far.
civodul: Apteryx: you can do (current-build-output-port (current-error-port)) in the REPL, though
sneek: civodul, you have 1 message.
sneek: civodul, roelj says: Bug #22138 does not solve my problem.  I notice that when I change the value of 'files to "lib", then it works.  Does it do file checking somehow?  If so, where does it do that?
Apteryx: civodul: There seems to be different opinions about if it's proper to bind current-build-output-port at the top level vs lazy-evaluating it when it's required. Couldn't we use some guile feature here? I'm no expert but maybe wrap the value of current-build-output-port into a (promise ...)? Would that help? (I'm not totally sure what promises do, but I'm under the impression that they enable delaying
Apteryx: evaluation).
Apteryx: s/(promise ...)/(delay ...)
civodul: Apteryx: SRFI-39 parameters need an initial value anyway
civodul: just like current-error-port has an initial value, so does current-build-output-port
Apteryx: can't that initial value be wrapped to be deferred as well?
Apteryx: ACTION is reading about parameters/srfi-39
bavier: how does dynamic-link search for the named library?
bavier: does it try different extensions?
bavier: I have an issue where '(dynamic-link "/lib64/libz") fails because there is no "/lib64/libz.so", but there is an "/lib64/libz.so.1"
civodul: bavier: it needs ".so", not ".so.1"
civodul: this is an annoyance on distros that ship ".so" as part of the -devel package
bavier: civodul: hm, my distro doesn't install the .so
bavier: SLES 12
bavier: civodul: this is related to a guix configure.ac check to define %libz, btw
bavier: which can be worked around by calling configure with 'guix_cv_libz_libdir=""', so not terrible
civodul: bavier: isn't libz.so in "zlib-devel" or something like that?
Apteryx: apparently we can customize the setter of a parameter using CONVERTER argument but not the accessor, so using deferred evaluation of the value wouldn't be transparent... bummer.
bavier: civodul: yes
Apteryx: civodul: I guess I'll reopen that Geiser bug after I've verified that I can reproduce it with clear steps.
Apteryx: Isn't current-error-port different than current-build-output-port in the sense that the former is a procedure whilst the later is a variable? If we could agree to make current-build-output-port a procedure as well (by setting the parameter value to one), it would be a definitive workaround...
Apteryx: I'm wrong. Current-error-port *is* a parameter (thanks for pointing this, civodul), not a procedure. If we were to assign a procedure as a value to it, we'd have to use it as ((current-error-port)), which is ugly ;)
ArneBab: amz3: it is so awesome that you can just use the exact path as procedure name
Apteryx: Could anyone advise as to how I could capture error output to a string? The closes I've found is 'with-error-to-file', but this prints to a file.
Apteryx: If nothing better exist I'll output to a tmpnam (temporary file) and read the content back as a string.
amz3`: IpswichTriptych: what do you plan to do after that? any plans?
dustyweb: o/
IpswichTriptych: amz3`: well, i just started using Guix, so i'm hoping to get a deeper understanding of how Guile is used with Guix
amz3`: good luck ;)
IpswichTriptych: ty! how about you, what are you working on?
amz3`: a search engine
amz3`: i guess
amz3`: I've done several projects in guile, but I think now I will only work on the search engine
IpswichTriptych: cool! does it search webpages or something else?
amz3`: yeah it search web pages
amz3`: but it's not online yet
amz3`: I mean not anymore
IpswichTriptych: i'd be glad to hear more about it if you care to share
amz3`: yeah sure
amz3`: if you are around
amz3`: IpswichTriptych: subscribe to the guile mailing list https://lists.gnu.org/mailman/listinfo/guile-user/ 
IpswichTriptych: sure thing
IpswichTriptych: sub'd :)
Toga_Virilis: I'm sitting on a portable implementation of srfi 89 which guile doesn't have yet (hence I wrote it) is there any easy way to upstream this anonymously?
taylan: Toga_Virilis: you could use a pseudonymous email account and make sure you don't have your real name or email anywhere in your git config, email config, or elsewhere that may end up in commit metadata, email headers, etc.
Toga_Virilis: taylan, ehhh
Toga_Virilis: taylan, is there not like a way to just mail someone the single file that it is?
taylan: Toga_Virilis: oh also I forgot: FSF copyright assignment :\\
Toga_Virilis: taylan, yes, but I was told on reddit by someone that guile doesn't require that
taylan: no idea if that allows for anonymity
Toga_Virilis: But maybe that was Guix
Toga_Virilis: How about I public domain it? Does that work?
taylan: Guix doesn't, Guile did last time I wanted to contribute a patch
Toga_Virilis: taylan, how about if I assign copyright to you, will you accept that without my real name?
taylan: probably the FSF will still want to check whether the assignment is legally valid.  that would just make things more complicated.  also I'm in Germany.
Toga_Virilis: Hmm
Toga_Virilis: So is it more difficult to work with this if you're not from wherever the FSF is from?
taylan: honestly I have barely an idea.  I followed FSF instructions to assign copyright because they know what they're doing; we two probably don't :)
Toga_Virilis: So you think it's possible that I give them the copyright if they agree to NDA my name?
Toga_Virilis: Ahh
Toga_Virilis: Oh well.
taylan: you should speak to the copyright clerk
Toga_Virilis: This seems really complex to upstream a 300-line SRFI implementation in a single file; which is probably to be honest why it's not there yet; this system seems pretty complex for small contributions.
taylan: yeah copyright assignment is an infamous aspect of FSF contribution
taylan: s/FSF/GNU/
taylan: ACTION goes AFK
Toga_Virilis: I guess it's not as much that I lose copyright which I don't care about as much as that it just seems to be too much hastle, but oh well it works for me. As I said the implementation is super portable so I might as well just put it online some-where.
amz3`: héllo :)
dustyweb: wingo: guile currently doesn't gc symbols, right?  I wonder if this is still one way an adversary could make an application crash, even if space/time constrained
dustyweb: effectively, keep generating random symbols across multiple evaluations until the symbol table makes the program run out of memory
Apteryx: Has anyone seen this error in the Guile interpreter: ERROR: In procedure %readline: readline is not reentrant
civodul: hmm no
Apteryx: OK. Here's the snippet I tried copy-pasting in the REPL that lead to the problem: http://paste.lisp.org/display/358020 
Apteryx: and here's the data file used in the previous snippet (known-affected-packages.txt): http://paste.lisp.org/display/358020#1 
Apteryx: Also in my ~/.guile I have: (use-modules (ice-9 readline))(activate-readline)
Apteryx: I guess the cwd is not what I expect and that it blocks trying to open the missing file "known-affected-packages.txt"? I'd expect it to bail out and tell me.
Apteryx: It seems I need to "cancel" the evaluation using C-c to get an error. I wonder why Guile doesn't interrupt itself when it encounters an error instead of staying silent and apparently frozen. Here's the backtrace I managed to get after hitting C-c: http://paste.lisp.org/display/358025.  At this point it is probably just a bug in my code, but it'd be nice for Guile to error out instead of staying silent!
Apteryx: Is using "get-string-all" recommended to read a file as a string? I'm using it in combination with 'with-input-from-file' and it doesn't fly.
Apteryx: Here's a quite minimal example (you just need some text file to read): http://paste.lisp.org/display/358030 
Apteryx: Seems the problem stems from the use of `with-input-from-file'
Apteryx: Even more minimalist: (with-input-from-file "/home/maxim/.emacs" (display (current-input-port))) --> #ERROR: ERROR: Wrong type to apply: #
ArneBab_: Apteryx: use a lambla function: (with-input-from-file "/home/maxim/.emacs" (lambla()(display (current-input-port))))
ArneBab_: Apteryx: you tried to evaluate the return value from display (#)
Apteryx: ArneBab_: Oh, this is what a THUNK mean? I thought it could be about just any block of s-exp! Thanks.
Apteryx: There is a definition under the Guile Reference documentation of the thunk? procedure: a procedure that does not accept
Apteryx:      arguments.
ArneBab_: Apteryx: yepp, that’s what you get with (lambda () ...) — as well as with (define (somename) ...)
ArneBab_: Apteryx: with lambda no name gets assigned to the procedure
akkad: OrangeShark: thanks. is there any sort of curated library manager for these sorts of things?
akkad: is there a webserver in guile?
daviid: akkad: artanis
akkad: thanks.
akkad: ahh sinatrasesque
davexunit: akkad: guile comes with a web server module
IpswichTriptych: hello, folks! i've just started learning about Guile
amz3`: :)
amz3`: IpswichTriptych: welcome
IpswichTriptych: amz3`: thank you!!!
IpswichTriptych: i'm starting the manual now: https://www.gnu.org/software/guile/manual/guile.html 
laertus: very interesting article
laertus: i'm wondering why the bootstrap step uses an interpreter rather than a compiler
laertus: if the goal is to build a compiler, why not just start by building a compiler?
laertus: the interpreter is in C anyway, so why not start with a compiler in C?
dsmith-work: Because the compier is written in Scheme, and there is no system Scheme compiler.
laertus: but couldn't there be a bootstrap compiler written in C?
dsmith-work: Double the work.
laertus: how so?
laertus: i mean just a minimal one, not a full-blown one
dsmith-work: You need to write the same compiler twice.
dsmith-work: Once in Scheme, once in C.
laertus: then why not object to having to do twice the work on the interpreter
laertus: the article says "In our case we do a half-bootstrap, first building an interpreter in C, compiling the interpreter in Scheme, then bootstrapping off that."
laertus: it sounds like double the work is done on the interpeter
dsmith-work: At one time, Guile was all C.  Slowly moving to more and more Scheme.
dsmith-work: and stripping down the C code.
laertus: i understand the desire to use less C and using more Scheme
laertus: but i just don't understand what using the interpreter first buys vs just going to a minimal compiler right away.. a bootstrap compiler
laertus: i'm not suggesting having the final scheme compiler in C.. but just the bootstrap one
laertus: so the duplicate work is minimzed
dsmith-work: That'
dsmith-work: s basically what we have now.
laertus: except there's the interpreter step
dsmith-work: Well, you'd need to ask wingo about it.  I'm pretty sure he doesn't want to put any effort into C code.
dsmith-work: s/into/into adding more/
dsmith-work: I know it's hard.  All that time building the initial compiler. The mind tries to think of things to make it better.
laertus: i'm just trying to decrease global warming... :)
laertus: hmmm... interesting comment in that article:  "Bootstrapping Gambit from source takes about 3.5 minutes on a modern machine."
laertus: "A gambit-hosted guile compiler should be able to compile the guile sources in a blink of an eye."
davexunit: I bet they do not understand the situation fully enough to make that statement
davexunit: you can compile guile releases without bootstrapping the compiler
davexunit: the release tarballs have the pre-built modules
davexunit: you only do the full bootstrapping process when you are building from a git checkout
davexunit: guile is the only scheme I know about that can be compiled without using a pre-built version of itself.
davexunit: maybe gambit can, too, I dunno.  but guile's long bootstrap process has good reason behind it.
davexunit: using gambit to compile guile would be really sad.  it would mean that guile isn't good enough for itself.
laertus: davexunit: another approach could be to learn whatever gambit's doing in this case and apply it to guile
davexunit: sure, if it really is the same thing.
laertus: if in fact there is anything relevant to learn from it that guile's not already doing
davexunit: I'm skeptical.
laertus: right
laertus: skepticism is good
davexunit: people told me that chicken does the same thing but much faster, but when I looked into it I discovered that it was completely different.
davexunit: if there are things to steal from gambit then we should steal them :)
laertus: agreed :)
laertus: what about stalin?
laertus: i keep hearing about how incredibly fast it is.. faster than C even
davexunit: I know nothing about it.
davexunit: except that it's not very practical to use.
laertus:  https://github.com/barak/stalin 
davexunit: with a more advanced linker guile ought to be able to do some "whole program" optimization like that
laertus: stalin's probably not considered very practical because it only supports a subset of R4RS
laertus: but for a first-phase bootstrap compiler you might not need very much
davexunit: I don't think it makes sense to use another scheme compiler to bootstrap guile
davexunit: because it doesn't solve the bootstrapping problem
davexunit: it just pushes the problem to the other compiler you used to bootstrap it
davexunit: guile is its own language, it's not "just" a standard scheme, so it's highly unlikely that it would work anyway.
laertus: again, you don't necessarily have to use stalin itself, just maybe ideas from it to do something similar, if it's possible and if it offers a performance increase
davexunit: stalin is very slow in terms of compilation time
davexunit: it produces fast native code.
davexunit: at the expense of spending huge amounts of time optimizing
laertus: is it slower than the guile bootstrap interpreter, though?
davexunit: not sure
davexunit: but there's a chicken and egg problem
laertus: also, if might be possible to cut down the optimizations that stalin does and still get a performance boost, i dunno
davexunit: if you could just use a compiler to start out with, the problem wouldn't exist
laertus: why couldn't you?  that's what i don't understand
davexunit: because you would need an already built version of guile
laertus: but why don't you need an already built version of guile for the bootstrap interpreter?
laertus: why is it possible to bootstrap with an interpreter but not a compiler?
davexunit: the bootstrap interpreter breaks the cycle
laertus: why couldn't a bootstrap compiler break the cycle?
davexunit: it would require writing a separate compiler in C
davexunit: completely different than guile's regular compiler
laertus: just like it requires writing a separate interpreter in C
laertus: for the bootstrap interpreter
davexunit: one is far simpler than the other
laertus: i see
davexunit: the interpreter is very simple by comparison
laertus: so guile's really choosing simplicity over performance
laertus: as far as the bootstrap process is concerned, anywy
davexunit: I don't think anyone is volunteering to write a completely separate compiler in C
laertus: ACTION nods
davexunit: users compiling guile don't even have to deal with this because the release tarballs have a prebuilt bootstrap compiler
laertus: i'm building from git source, though
davexunit: yeah
laertus: so i definitely have to wait.. and wait.. and wait..
davexunit: so you're hacking on guile
davexunit: so waiting is the name of the game
davexunit: once you do it once you'll rarely have to do it again
davexunit: unless you are hacking on the compiler itself
davexunit: then you might have to rebootstrap some subset of the compiler
laertus: by the way... i keep seeing the guile log show stuff like:  BOOTSTRAP GUILEC ice-9/eval.go
laertus: or:  BOOTSTRAP GUILEC ice-9/psyntax-pp.go
laertus: what's the ".go" extension for?
laertus: that's not the Go language, is it?
nee`: laertus: .go stands for guile object
amz3`: o/
OrangeShark: happy friday!
dsmith-work: Happy Friday, Guilers!!
dsmith-work: Yey!
civodul: hey hey!
akkad: ACTION needs help porting a simple scheme script
amz3`: akkad: what is a the question?
akkad: I guess if this is doable in guile https://github.com/kunabi/read-ct 
akkad: will rtfm
amz3`: akkad: question?
akkad: ENOTINTERATIVE
akkad: nope
akkad: oh I see. no zlib support in guile-lib
OrangeShark: akkad: https://github.com/davexunit/guile-zlib 
davexunit: I wrote that quite a few years ago.  hope it still works!  patches welcome, if not!
Apteryx: how to make string-match return a boolean?
cmaloney: Apteryx: Couldn't you wrap the function so if you get anything other than an empty list it returns true?
Apteryx: cmaloney: oh, it seems we have regexp-match?
cmaloney: Yeah, there's several string matching functions
Apteryx: string-match will return either #f or , so that should work.
cmaloney: \\o/
daviid: GHM video are mono (not stereo) or do I have a config prob here?
michaelis: Hi. Can I create graphical applications in guile? What widget sets are available and easy to use with guile then?
roelj: Is there a faster way to write a byte to a file than using either (write ...) or (display ...)?
michaelis: Hi. Sorry for being so daft but what exactly is guile? Can I write a whole application in it or is used for this thing called "extension", that I don't know anything about? Or is it both?
roelj: michaelis: Guile is an implementation of the Scheme programming language.  So you can write a whole application in it.
michaelis: roelj: Thank you.
roelj: michaelis: But you can also use it as an extension language, because at its core, there is libguile, which is written in C.
michaelis: roelj: And what exactly is a extension language?
roelj: michaelis: A language that can be used to extend your program.  So you need to embed an interpreter for that language in your program.
michaelis: roelj: I see on guiles official web page that there is no way in creating a simple network socket. Do I solve that with for example C and integrate this into my guile source code in some way?
roelj: michaelis: Have you seen this?: https://www.gnu.org/software/guile/manual/html_node/Internet-Socket-Examples.html#Internet-Socket-Examples 
roelj: You could also write that stuff in C, and then expose functions to Scheme from your C code.
roelj: But in the case of network sockets, I think you could just use Guile entirely.
michaelis: roelj: Ok, thank you. I found it just after you posted the link. :) I have just started to navigate the web page.
roelj: Good luck! :)
michaelis: roelj: Thank you.
ArneBab_: michaelis: welcome back. For graphical applications, see guile-gnome
ArneBab_:  https://www.gnu.org/software/guile-gnome/ 
jeko: Is a Guile Hacker called a guiler ?
manumanumanu: yes
manumanumanu: among other things
amz31: davexunit: what is the purpose of before-draw-hook and after-draw-hook in chickadee?
davexunit: amz31: for doing things like frame rate calculation
davexunit: you can measure time before and after the draw call and calculate fps from there
amz31: tx
OrangeShark: Happy Thursday
Apteryx: Hello Guile! When using `string-split', what arg for CHAR_PRED should I use to split on any whitespace character? It says I can use a "character set".
Apteryx: Oh, I just found a "Character Sets" section; it wasn't indexed.
OrangeShark: Apteryx: yeah, there should be a predefined one for whitespace
Apteryx: char-set:whitespace :)
civodul: ooh looks like the bdw-gc list at opendylan.org is dead :-(
ArneBab_: davexunit: what’s the difference/relationship between Chickadee and Sly?
dsmith-work: {appropriate time} Greetings, Guilers
ArneBab_: (appropriate 'time) Greetings ☺
davexunit: ArneBab_: I don't work on Sly anymore.
davexunit: I do work on Chickadee.
ArneBab_: so Chickadee is a followup project?
davexunit: yes.
davexunit: Chickadee is a lower level library that should appeal to more people.
ArneBab_: could you mark it as such on your website?
ArneBab_: (in the project listing)
davexunit: yeah sometime
davexunit: I haven't had much time for editing things like that
ArneBab_: ^ there’s a problem in your editing workflow ☺
davexunit: I'm busy
davexunit: I don't write much code these days
davexunit: let alone work on my website
ArneBab_: (when I hit that wall, I switched to drupal: just clicking edit on the website to change the content)
ArneBab_: (nowadays drupal isn’t really what I want anymore, but I don’t yet have a replacement)
davexunit: I can assure you my workflow is just fine
ArneBab_: (⇒ I need something which avoids having to recover buffers)
ArneBab_: ok :)
davexunit: I haven't prioritized hacking in the past year
davexunit: so things are out of date
ArneBab_: I’m personally dissatisfied with my website dev tools, but I don’t have the time to really fix it.
davexunit: I like using my static site generator.  I need to make a real release of guile-syntax-highlight and clean up my environment.
davexunit: then it will be better.  just unmotivated to do it.
dustyweb: wingo: others: https://github.com/cwebber/rebooting-the-web-of-trust-fall2017/blob/master/draft-documents/lds-obcap/lds-obcap.md 
dustyweb: I collaborated with Mark S. Miller and he offered to be co-author omg
bavier: dustyweb: sweet!
bavier: question: I have a guile@2.0.9 installed in /usr/bin, and a guile@2.0.14 installed into /usr/local/bin.  But when I invoke `/usr/local/bin/guile --version`, I get "2.0.9".  Any ideas why?
bavier: oh, nvm, figured it out.  rpath on the /usr/local guile pointing to /usr/lib64 instead of /usr/local/lib.  doh
civodul: /usr/local is sooo 90's ;-)
laertus: my compilation of guile 2.2.2 has been hanging for hours at "BOOTSTRAP GUILEC ice-9/psyntax-pp.go"
laertus: top shows this process is the culprit, using 84% of the cpu -- mostly in user space:  https://paste.pound-python.org/show/FjgHzHgxA5tCizY5QHtK/ 
laertus: ltrace doesn't show anything... strace shows https://paste.pound-python.org/show/ucc4lUSzUMGDLjD0xnxo/ 
ArneBab_: dustyweb: this sounds like something which would be cool to have in a availabillity-ensurance system for Freenet. Nice!
zacts: hello #guile
dsmith-work: laertus: It usually does take a *long* time. Depends on build machine of course.
dsmith-work: How many hours?
laertus: well, it was hanging on just that part for at least a couple hours
dsmith-work: Did it ever progress beyond that?
laertus: i killed it and am giving it another try without having the guix build directory mounted as ext4 zramfs
laertus: because i have heard on here that guix sometimes has issues with ext4
laertus: (though plenty of other stuff built on there fine for me)
laertus: now it's on spinning rust xfs
laertus: if it had been giving me some progress reports, saying things were kind of sane i would have probably let it run
dsmith-work: laertus: Are you building from a package or from git?  The package has some bootstraping so it takes less time.
laertus: but it just hanging there without making any visible progress for 2+ hours is weird
laertus: that's a good question.. i'm not sure
dsmith-work: laertus: It used to take me a whole weekend to rebuild guile for sneek.
laertus: hmm
dsmith-work: laertus: (the local channel bot)
laertus: maybe i should have let it run...
dsmith-work: Yeah.
laertus: i wish software that took a long time to build would do a little mini-benchmark before it started building and told you what the expected wait time was
dsmith-work: Ooo.  Cool idea.
laertus: it's still being slow
laertus: i wonder what it is that makes it so slow
laertus: i don't think it's the gc, because perf doesn't show the gc functions being hit more than about 8% of the time
bavier: laertus: bootstrapping uses the C scheme interpreter, which is just plain slow
laertus: interesting
laertus: is there any potentially low-hanging fruit in optimizing it?
bavier: laertus: possibly, though I can't think of any offhand
laertus: i seem to remember there used to be a really high performance scheme interpreter
laertus: stalin, was it?
dsmith-work: laertus: All the guile compiler and optimizations are now in Scheme.  The C Scheme interpreter is really minimal and just for bootstrapping.
dsmith-work: laertus: The package comes with pre-compiled files to make it faster.
dsmith-work: laertus: That's the current low-hanging fruit.
laertus: but it's still slow
laertus: so i was wondering if maybe some of stalin's optimizations could be used in it and if it'd make a difference
dsmith-work: laertus: https://wingolog.org/archives/2016/01/11/the-half-strap-self-hosting-and-guile 
laertus: thanks
dsmith-work: laertus: It's actually a time warping optimizer.  Takes all the slowness at runtime and packages it up and stuffs it in the build step instead.  Slower up front but faster where it counts.
dsmith-work: ;^)
laertus: ah
laertus: i guess which is preferable depends on how often you build guile.. :)
dsmith-work: heh
dsmith-work: yes
laertus: also, it looks like the bootstrap compiler is not for this
laertus: "The bootstrap C interpreter in libguile loads the Scheme compiler and builds eval.go from eval.scm."
Apteryx: Hello! When using (ice-9 match), what is the canonical way to match a list of strings, and then mapping over it?
Apteryx: I thought I could have something like: ((str1 str2 ...) (map my-proc (list uri1 uri2 ...)) but this doesn't seem valid.
Apteryx: The use case is taking action on an argument that can be either 1) a single string or 2) a list of strings.
daviid: Apteryx: why not immediately call map: (map myproc yourstrlist)
Apteryx: because I don't always have a list; sometimes a lonely string comes, sometimes a list of strings.
Apteryx: so the type differs
daviid: Apteryx: (map myproc (match vals ((a) (list a)) ((a . rest) vals)))
daviid: or the other way around if yu prefer
daviid: (match vals ((a) (myproc a)) ((a . rest) (map myproc vals)))
Apteryx: wouldn't (a) match '("some-string") rather than "some-string"?
daviid: oh yes
daviid: so use pair?
daviid: or
daviid:  (match vals ((a . rest) (map myproc vals)) (_ (myproc vals)))
Apteryx: this seems to do it: http://paste.lisp.org/display/357600 
daviid: the order is important  ...
Apteryx: I could use "..." after all, just not in the "then" clause
Apteryx: thanks for eminding me I could reuse the top-bound value in (match top-value ...)
Apteryx: *reminding
daviid: np!
Apteryx: When using (and condition1 condition2 condition3), can I use (delay ...) on condition3? It should only be eval'd if condition 1 and 2 are true (otherwise throws an exception).
daviid: Apteryx  and is a macro, it won't try to evaluate cond3 if any of the preceeding are #f
Apteryx: interesting; that means my logic is broken, eh!
Apteryx: sneek: later tell daviid, your match rules were required for my logic to work after all.
sneek: Will do.
Apteryx: how can I convert '() to #f? Is there no (bool '())?
mwette: (not (null? '()))
Apteryx: Strange... When I ran my script from Geiser, it's happy. When I run it from the terminal, it doesn't know about `string-match', even though I'm using the (ice-9 match) module.
Apteryx: mwette: thanks!
Apteryx: efraim: I got the gcc patch right I think! When you have the time, it is to go in core-updates.
Apteryx: ACTION oops. wrong channel.
dsmith-work: Wednesday Greetings, Guilers
ArneBab: sneek: later tell mwette: ah yes (no terminator but newline). I need to add that for a general tutorial.
sneek: Okay.
ArneBab: sneek: botsnack
sneek: :)
dustyweb: I am in a room with Mark Miller of capabilities / erights!
dustyweb: apparently he recently switched to working on WASM because of WASM-GC
dustyweb: apparently WASM's GC stuff is core enough to have Mark Miller on it, and the reason he switched is capabilities based... having WASM have opaque unforgeable pointers means that capabilities are possible in WASM
civodul: neat
civodul: that's Rebooting the Web of Trust?
dustyweb: civodul: yes
dustyweb: civodul: Rebooting Web of Trust has been super cool
cmaloney: I wish I understood any of those acronyms
cmaloney: Web Assembly?
dustyweb: WASM -> WebAssembly
dustyweb: GC -> Garbage Collection
cmaloney: kk
dustyweb: so apparently WASM having GC means no manual memory management, which means that access is by scope
cmaloney: hello...
dustyweb: which means!  (and read Jonathan Rees' security kernel paper)
dustyweb: security capabilities are possible
cmaloney: Isn't WASM just javascript underneath?
cmaloney: ACTION is a little late to this party
dustyweb: no, it's a new set of VM operations
dustyweb: well
dustyweb: not just VM either necessarily
cmaloney: But it's using the JavaScript VM
dustyweb: cmaloney: it may be compiled natively!
cmaloney: *cough* MUG Presentation *cough*
cmaloney: I want to get someone from Mozilla to talk about WASM and Rust
dustyweb: would be cool... may be two separate speakers for that one :)
cmaloney: Or someone who is a rather enthusiastic proponent of web tech
dustyweb: true!
cmaloney: since it's changed significantly even since 2016
davexunit: so goops doesn't support method combination (a la CLOS), I guess?
manumanumanu: ok... I have been reading https://fare.livejournal.com/189741.html  about the nest macro. He claims that the "right fold" syntax-rules one is quadratic, but in my tests it is slower than the final version by a constant factor (and not by much. about 10%). Am I insane, or is it really quadratic?
manumanumanu: it is the straight forward implementation by gwatt on IRC #scheme (search for gwatt on the page)
manumanumanu: is it the matching that is quadratic? I only tested it up to six nests deep
amz3`: AFAIK quadratic complexity or whatever doensn't always mean it is slower, it's only a clue...
amz3`: say, 2² is 4 wheres 4*2 is 8...
amz3`: hth
manumanumanu: amz3`: but then why whine that the algorithm was quadratic? He probably spent more time writing the syntax-case macros than any expansion of the syntax-rules macro will ever take.
m3tti: hi guile channel
manumanumanu: m3tti: hello!
amz3`: o/
roelj: What's the fastest way Guile can write bytes to a file?  Currently, I'm using (display ...), but with that I seem to only get to 5 megabytes per second.
daviid: heya! anyone is using IPFS, i'm curious
sneek: daviid, you have 1 message.
sneek: daviid, Apteryx says: your match rules were required for my logic to work after all.
void_pointer: back after a long time away
void_pointer: Saw the discussion on guile-clutter
void_pointer: looks like a really direct drawing API
void_pointer: is it Gnome 2 based like guile-gnome, or is it Gnome 3 based?
daviid: scheme@(guile-user)> (atan 0.97489  -0.22270)
daviid: $11 = 1.795378814259626
daviid: _but_
daviid: scheme@(guile-user)> (atan (/ 0.97489  -0.22270))
daviid: $12 = -1.3462138393301673
void_pointer: Can confirm, got the same answers in guile master. Going to check another scheme implementation
daviid: void_pointer: was about to do the same
void_pointer: Got the same answer in chicken
daviid: same in racket to, I guess I'm missing some knowledge here, I expected the result to be -1.3462138393301673 in both case
void_pointer: One second, found relevant section in R5RS
daviid: but according to the doc, I think my expectation is correct?
daviid: void_pointer: tx for helping me here!
void_pointer: "The two-argument variant of ‘atan’ computes (angle (make-rectangular x y)) (see below), even in implementations that don’t support general complex numbers."
void_pointer: Hmm, I think I need to think on this one a bit more as to why it would be different.
daviid: I read and read the doc again, I can not convince myself I should not expect the resut to be -1.3462138393301673 in both case
void_pointer: compared to one argument.
daviid: void_pointer: where did yu read the aboce?
daviid: above
void_pointer: Bottom of page 46 of the R5RS standard doc that can be built from what is included in the Guile source
void_pointer: Wait
void_pointer: I think I got it. One second
daviid: ok
daviid: scheme@(guile-user)> (make-rectangular -0.22270 0.97489)
daviid: $14 = -0.2227+0.97489i
daviid: scheme@(guile-user)> (atan $14)
daviid: $15 = -0.7854046767562266+1.0912219371001213i
daviid: 
void_pointer: They are the same answer
void_pointer: Just offset by pi
void_pointer: When you give two arguments to atan, it knows which quadrant you are in and can give a non-ambiguous angle
mwette: depends which branch you are on -- e.g., sqrt(4) is -2 and 2 : offset by pi
daviid: but $15 is a complex number, not  (atan (/ 0.97489  -0.22270))
daviid:  $12 = -1.3462138393301673
void_pointer: But when you divide, you lose branch information since while (atan 0.97489  -0.22270) and (atan -0.97489  0.22270) are different, they look the same when you do the division
void_pointer: Not quite how atan of two arguments works. (atan y x) is equivalent to (angle (make-rectangular x y))
void_pointer: As in, (define atan (lambda (x y) (angle (make-rectangular x y))))
void_pointer: As opposed to (atan (make-rectangular x y))
daviid: void_pointer: (a) it seems ur implementation does not call make-rectangular, since doing so I guet diff results; (b) when I try your later lambda def here:
daviid:  (define atany (lambda (x y) (angle (make-rectangular x
daviid:                y))))
daviid: scheme@(guile-user)> (atany -0.22270 0.97489)
daviid: $18 = 1.795378814259626
daviid: that gives 102 degree (+-), I expect 77 degree here (+-)
daviid: I need to undrstand better ...
void_pointer: I might have gotten the argument order mixed up. One second
daviid: bw right back, have to move table wher I'm sitting (in a lbrary ...)
void_pointer: (define atany (lambda (y x) (angle (make-rectangular x y))))
void_pointer: yes, I did
daviid: ah
daviid: let me move table and get back
void_pointer: I mixed up the argument order in the lambda definition (or equivalently,  in how it is passed to make-rectangular)
void_pointer: sorry about the confusion
daviid: ok, back :)
daviid: that does not sounds good either
daviid: scheme@(guile-user)> (define atany (lambda (y x) (angle (make-rectangular x y))))
daviid: scheme@(guile-user)> (atany -0.22270 0.97489)
daviid: $19 = -0.2245824874647294
daviid: scheme@(guile-user)> (/ (* $19 180) %pi)
daviid: $20 = -12.86762868427871
void_pointer: (atany 0.97489  -0.22270) will give 1.795378814259626 as expected
daviid: oh sorry
void_pointer: no need to apologize
void_pointer: argument order is easy to mix up
daviid: scheme@(guile-user)> (atany 0.97489 -0.22270)
void_pointer: i did it, you did it
daviid: $21 = 1.795378814259626
daviid: scheme@(guile-user)> (/ (* $21 180) %pi)
daviid: $22 = 102.86762868427871
void_pointer: it happens
void_pointer: It should be 102 degrees. 0.97489 is your opposite and -0.22270 is your adjacent. That puts it in the second quadrant (assuming I remember the number order right) which is 90 degrees to 180 degrees. Specifically, it is close to vertical but ever so slightly offset to the left in a typical cartesian coordinates, which matches 102.87 degrees
void_pointer: Now, if your adjacent was 0.22270, then, yes, you should get 77 degrees
void_pointer: by symmetry about the y-axis
void_pointer: I might have misused a term in my last message
daviid: void_pointer: these values (for info) are the eigenvector major x and y returned by vigra (one of the feature on a specific particle): but imagej (sort of another lib I use to cross check results when indoubdt) returns 77deg for ellipses major and minor angle ... hence I started to investigate
void_pointer: but it conveys the gist of it
void_pointer: ah
void_pointer: only barely used imagej, never used vigra
void_pointer: well, it might be that they use different axes definitions
daviid: never used make-rectangle, and reading uur doc, atan does what atan2 C function does (iiuc), and, apart fro a sign problem, if I manually do (/ y x) I get the (sign apart) result
daviid: I will check with the Vigra folks
void_pointer: if one does the typical cartesian (right is +x and up is +y) and one does right as +x and down as +y, then this could be the result (need to think about it a bit more)
void_pointer: also, some systems measure angle form the x axis but others from the y axis
daviid: void_pointer: I'm under the imprssion there is a bug i the vigra eigen vector sign
sneek: Got it.
daviid: sneek: what did you get?
daviid: (our bot is boored and wants to work a bit more I guess ...)
daviid: void_pointer: thanks for your time on this one! will talk to the Vigra folks and wil let you know
void_pointer: ok, so if vigra does right is +x and down is +y and measures angle from the +x axis, then  you get 77 - 180 degrees
void_pointer: and for an ellipses major and minor angle, there is a 180 degree ambiguity I think if I understand the definitions you are using correctly (rotating the ellipse by 180 degrees doesn't change the orientation)
void_pointer: so then vigra giving 77 degrees is correct assuming the coordinate system is +x is to the right and +y is down
daviid: void_pointer: but vigra gives me 102 and that is not coorect
void_pointer: reread what you said earlier
void_pointer: mixed vigra and imagej up
void_pointer: what I just said for vigra, I mean for imagej
void_pointer: sorry about the mixup
void_pointer: mixing things up left and right tonight
daviid: void_pointer: ok, imagej does the right thing here, but no big desl, the big deal is I have to understand and write to  them to ask ...
daviid: void_pointer: this is the correct answer:
daviid: scheme@(guile-user)> ,use (cv)
daviid: scheme@(guile-user)> (atan 0.97489 0.22270)
daviid: $2 = 1.3462138393301673
daviid: scheme@(guile-user)> (/ (* $2 180) %pi)
daviid: $3 = 77.1323713157213
daviid: thanks for you help
void_pointer: no problem
void_pointer: also, sorry for confusing you with all of my mixups
daviid: void_pointer: you might be interested to grab guile-cv then ...
void_pointer: i've been following it a bit
void_pointer: right now, I do all my image processing at work in python because we are a Pythin, C, C++, Fortran workplace
void_pointer: but I try to keep an eye on other things for hobby stuff
daviid: ok, if you clone and checkout the devel branch, yu can try new 22 features, and these eigen vector and values ...
void_pointer: which I will be having at some point in the future since a project I am going to work on with my wife will involve some image processing
daviid: I would be very very happy to have you as a user
void_pointer: eventually. Got to get a python project of mine to the 1.0 release finally and then can really get back to scheme land again.
void_pointer: been working on getting this project to a stable release for four years. Not that far away now. Then no more hobby python except bug fixes for a while
daviid: ok, if you install let me know ...
daviid: what is your project?
void_pointer: I will try to remember
void_pointer:  https://pypi.python.org/pypi/hdf5storage 
void_pointer: It is essentially a marshalling package for python types (not just the numpy types) to and from HDF5 files with support for Matlab's v7.3 MAT file metadata so that data can be transferred between the two environments with as little loss in type information and other structure as possible
void_pointer: And alos to be able to store python types in HDF5 files conveniently and be able to read them back without losing type information (if the option is set to write the right metadata)
daviid: I see, well congrat, not using python though, was just curious...
void_pointer: The one alpha branch (0.1.x) is plagued by abysmal performance due to poor API and algorithm choices (enough so that many people have raised issues not knowing why their files won't load at all), places severe limits on the types of keys in dicts, some other limitations, and not possible for others to implement plugins
void_pointer: 1.0 release fixes all of these issues
daviid: I'm scared to have to wait 1.0 for you to start to use guile-cv, that's sounds like in a long time :):)
void_pointer: not really
daviid: just kiddig
void_pointer: got most of it already done
daviid: cool
void_pointer: if it weren't for health problems and then problems being productive with the time I do have, I could finish it enough in a week to do a beta release and then a month later to the 1.0 release depending on any issues found
void_pointer: reality, I will probably get the beta pushed out in November or December
daviid: void_pointer: takt it easy, health comes first
void_pointer: then it is back to scheme. But got to get back on the R7RS-small stuff I left off on first
void_pointer: daviid: very true. I am a living example of what happens when one doesn't do that
void_pointer: it is why I gave a very long time table for a relatively easy task
void_pointer: then hope to do some other fun stuff
void_pointer: in scheme
void_pointer: I will remember to look at guile-cv
daviid: cool, hope you'll get better
void_pointer: daviid: thank you. Been steadily doing so bit by bit. Funny story, actually started scheme while I was at home recovering from a surgery since I needed something to do
void_pointer: started with "Teach Yourself Scheme in Fixnum Days" and scheme sort of just stuck in my interest ever since
void_pointer: and now we will see how many years I stick with it before moving onto something else (a bit of a rolling stone language wise, for better or worse)
void_pointer: anyhow, it is time to go to sleep
daviid: ok, night
void_pointer: goodnight
nilg: is there a multi-threaded version of `map`?
nilg: there is, see https://www.gnu.org/software/guile/manual/html_node/Parallel-Forms.html 
nilg: thanks nilg, that was very helpful!
m3tti: hey folks how do you manage your additinal libraries
m3tti: like guile-reader or guile-ncurses
civodul: wingo: i've sent a bunch of patches for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28590 
civodul: nothing really great though
dsmith-work: Tuesday Greetings, Guilers
OrangeShark: Tuesday greetings!
OrangeShark: is anyone going to LibrePlanet 2018?
davexunit: OrangeShark: I will most likely be going.
davexunit: I've been to the last 3.
davexunit: er, 4 actually.
OrangeShark: davexunit: I am going to try going, this will be my first time.
davexunit: OrangeShark: great :)
davexunit: I'll have Guile or Guix on my nametag, and maybe my IRC nick, so people can recognize me.
amz3`: Guest55450: hey
manumanumanu: OrangeShark: wrong continent :(
bavier: I'd like to get to a LibrePlanet one of these days
amz3`:  http://webresidencies-solitude-zkm.com/ 
MuteParrot: Given a GOOP class in a module that has many slots with getter and setter methods, how can I export all the getters and setters?
MuteParrot: do I have to do (export get-foo get-bar get-baz ...) for each getter/setter, or is there a better way?
MuteParrot: also, is there a module with a define-method equivalent to define-public?  or should I create my own macro for this?
daviid: MuteParrot: the former. note that you have to re-export if you imported a module tht also defines these getters/setters
daviid: No, to your last question
MuteParrot: that's unfortunate.
daviid: MuteParrot: actually, with no offense what so ever, what you are asking for  would not make sence in Guile's implementation of (part of) the CLOS protocol. however, I do understand you and wrote a macro oyu might be interested to use, and, combined with the module definition option #:duplicates (merge-generics replace warn-override-core warn last), will provide a simulation of the clos protocol (which defines a specific module for all
daviid: clos def* ...
daviid: here is the macro i'm talking about:
daviid: MuteParrot: http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/support/goops.scm?h=devel 
daviid: oh, sorry not this one this one:
daviid:  http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/support/g-export.scm?h=devel 
MuteParrot: daviid: thanks!
MuteParrot: in truth I know little about CLOS.  when I'm not using guile I typically use racket not CL
daviid: MuteParrot: welcome! and here is a simple use so you can better grab what's going on:
daviid:  http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/idata.scm?h=devel 
MuteParrot: awesome, thanks
daviid: MuteParrot: wc! yes racket oo system has nothing to do with clos (on purpose but imo, it was a very bad decision)
MuteParrot: yes, racket's oo seems to be not be used for much, probably as a consequence.  off the top of my head I can only think of the gui package using it.
daviid: MuteParrot: I recommend you read this paper http://www.dreamsongs.com/Files/clos-cacm.pdf 
daviid: MuteParrot: actually, this paper is listed here, along with other documents you might be interested to read (intro...) http://www.dreamsongs.com/CLOS.html 
MuteParrot: thanks, I'll check it out
dsmith-work: Morning Greetings, Guilers
amz3: o/
OrangeShark: morning
jherrlin: Hey folks, i am studying the SICP book and would like to have some feedback on one of the exercises.
jherrlin:  http://paste.lisp.org/display/357498 
jherrlin: 
jherrlin: please give me some feedback on the solution
jherrlin: found http://community.schemewiki.org/?sicp-ex-2.18  to i guess i have some solutions to compair with
ft: There are shorter solutions to this, if you think about how cons works.
ft: Specifically, what's (cons 1 '()) and what is (cons 2 '(1)).
ft: Yeah. If asked, I'd implement it like the first solution on your link does. I'd probably use a named-let, but that's a minor detail.
jherrlin: ft: thx for the feedback! i am currently looking at the second solution and trying to understand
jherrlin: ft: what is the reason you would choose the second?
ft: I wouldn't want to call append.
ft: So, I wouldn't choose it.
jherrlin: ft: because of performance?
ft: Yes.
jherrlin: okey, i see! and it's not using tail-recursion so it could blow the stack to, right?
ft: Yup, that's not a tail call.
jherrlin: nice, thanks alot ft !
happy_gnu[m]: \\o/
happy_gnu[m]: Hi
dsmith-work: sneek: botsnack
sneek: :)
dsmith-work: Goodbot
happy_gnu[m]: I wanna try creating a simple game
happy_gnu[m]: 5-in-a-row
happy_gnu[m]: In like tic-tac-toe but with more squares
happy_gnu[m]: I wanna do it following GNOME designs
happy_gnu[m]: Not because I think they are good but because I think they are simple
happy_gnu[m]: I should use guile-gnome
happy_gnu[m]: And does anyone has any suggestions on what else to use?
happy_gnu[m]: I've never build any GUI before
happy_gnu[m]: In any language
cmaloney:  https://octodon.social/@craigmaloney/7142549  Some light reading
daviid: happy_gnu[m]: note that guile-gnome is gnome-2 still, not gnome-3 (it is really good but won't 'look' like gnome-3, obviously), then for such a simple game I'd use guile-clutter (mind you it's a bit more difficult to install, but I wrote a step by step 'guide', and can help here...), or you could look at chickadee as well ... depending on your objectives
daviid: happy_gnu[m]: https://www.gnu.org/software/guile-gnome/clutter 
happy_gnu[m]: daviid: well my objective is making something for others
happy_gnu[m]: It doesn't necessarily has to be done for GNOME
happy_gnu[m]: I just want to make a game or some program that others can use
happy_gnu[m]: And learn to package it as an executable
happy_gnu[m]: Like .deb or .rpm
daviid: happy_gnu[m]: the problem is, given that objective, how easy it is for others to install: it is difficult to install guile-gnome and even a bit more difficult to install guile-clutter, and these are not part of any distro (guile-gnome is in guix actually)
happy_gnu[m]: Things like that
daviid: happy_gnu[m]: for info, here are some examples I wrote to help people to start to write clutter apps using guile: http://www.nongnu.org/grip/examples.html 
happy_gnu[m]: daviid: ohh those are good
happy_gnu[m]: But you say it will be difficult to package it right? :(
happy_gnu[m]: That is not good but I will try anyway
daviid: happy_gnu[m]: tx, clutter has everything you need to write a simple game, but for real games you'd want to use another lib
happy_gnu[m]: I want a simple game
happy_gnu[m]: I actually wonted to do a program
happy_gnu[m]: But the only thing I can think of is games
daviid: happy_gnu[m]: I'd be very happy to help, wrt guile-gnome guile-clutter.  then to package, yu best route will be to use guix (which has guile-gnome already) and get help to package guile-clutter, then your game ...
happy_gnu[m]: And I don't know any Libre program written in guile that I can collaborate.
happy_gnu[m]: I am learning to package stuff for guix but that is not exactly a program and I looked at GNU cash but it is written in C and I don't even understand GNU Cash
happy_gnu[m]: Ok
happy_gnu[m]: I will use that
happy_gnu[m]: Even if the game is packaged for deb or rpm I doubt it will be very used anyway
happy_gnu[m]: Is gonna be a simple game
daviid: happy_gnu[m]: before, take a look at chickadee
happy_gnu[m]: I am looking at it
daviid: and there are tons of program you could contribute to
happy_gnu[m]: It has a lot of documentatiot on web development
happy_gnu[m]: In scheme? I searched Github but found mostly Racket or Scheme implementations
happy_gnu[m]: But no actual Scheme programs where I could help
happy_gnu[m]: Maybe I am just very insecure
happy_gnu[m]: :/
daviid: happy_gnu[m]: send an email to guile-user asking to contribute to some project and see ... ?
happy_gnu[m]: Ohh
happy_gnu[m]: I didn't know about it
happy_gnu[m]: Ok
happy_gnu[m]: I will
daviid: happy_gnu[m]: no guarantee what so ever, maybe you'll receive no answer, I don't know ...
daviid: happy_gnu[m]: the guile community is full of lonely hackers :), that come here to ask for tips, code review, ideas for 'how should I do this and this...' but very friendly though
happy_gnu[m]: :)
happy_gnu[m]: That's why I feel intimidated
happy_gnu[m]: You all seem to know a lot about programming
daviid: happy_gnu[m]: don't be, guilers are always happy to help, and I never seen any pedantic or condenscendent behavior here, just learn do and ask ...
daviid: happy_gnu[m]: for now, I'd go with your idea to write a simple game, to learn and 'do something' ...
happy_gnu[m]: Ok
happy_gnu[m]: I have to go to the doctor now :)
happy_gnu[m]: Thanks daviid
daviid: np!
amz3`: I have copy of that
amz3`: random_numbers: no it's different
amz3`: random_numbers: the diff is that about JS Objects which are convert to hash tables instead of alist
random_numbers: Ah that's a shame.
random_numbers: Any publicly available repo that has it? Because the gitlab one apparently requires permissions or doesn't exist anymore.
amz3`: random_numbers: https://framagit.org/a-guile-mind/culturia/blob/master/src/json.scm 
dustyweb: random_numbers: https://gitlab.com/dustyweb/guile-sjson 
dustyweb: -sjson, not -json
MuteParrot: Is there a convienent way to (export ...) all the getters and setters generated by GOOPS classes that reside in a module?
random_numbers: Ah right, sjon exists.
random_numbers: Thanks amz3`, dustyweb
daviid: random_numbers: https://savannah.nongnu.org/git/?group=guile-json 
daviid: ah, but that is not the same project as the one developped by dustyweb
daviid: better ask dustyweb , the login gitlab to access is a 'mistake', i'm pretty sure of that
random_numbers: daviid: Yeah, dustyweb answered with the right link a few lines above.
daviid: so many guile-json repos ...
random_numbers: It's a common use-case and the current Scheme library environment favors reinventing the wheel.
daviid: ok, didn't see dustyweb answer, tx
random_numbers: Or that's the impression I get at least.
dustyweb: hey, I didn't totally reinvent the wheel... I used davexunit's code as a basis ;)
random_numbers: So yours uses hash-tables or a-lists?
dustyweb: fashes or alists
dustyweb: but it may be adjsuted soon to support other options for the map bit
random_numbers: fashes?
dustyweb: the current fashes support is kinda hashed in
dustyweb: random_numbers: yeah functional hashmaps
random_numbers: dustyweb: Oh. That sounds interesting. Part of which SRFI?
dustyweb: none
random_numbers: dustyweb: Your very own implementation. Nice.
dustyweb: it's a library written by wingo, mostly based on clojure's datastructure design iirc, and I bundled it
dustyweb: not my work
dustyweb: I just bundled it
random_numbers: So, what's the Scheme-y term for docstrings?
amz3`: docstring
mwette: random_numbers: https://gitlab.com/dustyweb/guile-sjson 
random_numbers: mwette: Ah, thanks though dustyweb already answered before.
mwette: random_numbers: good news
random_numbers: Indeed. As it seems XML APIs are disappearing. I don't think I'll miss them too much.
Apteryx: Hello Guile! Where is match-lambda defined?
daviid: Apteryx in (ice-9 match)
daviid: Apteryx: note this module actually uses match.upstream.scm ...
Apteryx: thanks!
daviid: wc!
Apteryx: I'm a bit confused with matching a symbol which happens to be bound to a record. I'd like to match the symbol itself if possible. Should my match pattern by something like ('symbol) ?
Apteryx: e.g., supposing the symbol is named texinfo-5, should my match be (('texinfo-5) ... ?
daviid: Apteryx: not using record so much, but there are examples in guix, and according to the doc, you'd do something like
daviid: (match texinfo-5 (($  pat_1 ... pat_n) your code here))
daviid: Apteryx there is an example in the doc actually, look at match doc ... define-record-type person ...
daviid: section 7.7 pattern matching ...
Apteryx: yep I'm looking at this one... looks like they omit the <...> around the package symbol?
Apteryx: but I see instances in guix where it's being used. hmm.
Apteryx: (with <, >)
daviid: the package?
daviid: surrounding record names with '<' and '>' is merely a convention
Apteryx: oh, I see! Sorry, package is a guix specific.
live_the_dream: im trying to package guile 2.2 for an android project called termux. im just wondering about cross compiling guile
live_the_dream: is compiling 32 bit hosts from 64 supported or will i have to compile guile in 32 bit first ?
random_numbers: Any recommendation for SSL/TLS libraries for guile for HTTP-GET/POST kinda stuff?
random_numbers: Guess I'm gonna go with gnutls
amz3`: héllo :)
janneke: hey amz3`
amz3`: I need to work with epoch...
amz3`: i need to convert epoch in seconds to epoch in days
amz3`: any idea?
amz3`: I think it's just a division
janneke: amz3`: if you don't need to be accurate and don't care about leap seconds, sure simply divide
amz3`: tx!
amz3`: it's for gathering some stats in my blog
amz3`: but I guess nginx logs will do, I just need to configure the referer thing
amz3`: seems like its the default nginx configuration
amz3`: the thing is only, it ain't perfect but it does the job
amz3`: s/only/online/
amz3`:  http://presence.hyperdev.fr/post/58FL3FUK 
amz3`: I can go back on hack on something extra ;)
m3tti: i've got 2 questions. first what is your main editor for writing scheme and is anyone using scheme for web apps??
amz3`: m3tti: 0) emacs 1) yes, see http://presence.hyperdev.fr/post/58FL3FUK  it's written in scheme (both frontend and backend)
m3tti: emacs because of the inferior lisp shell?
amz3`: m3tti: emacs because it's my default editor, but honestly, I don't use often the scheme integration called geiser
janneke: amz3`: you don't use geiser?!
amz3`: janneke: not really, i seldom use. The only feature I use, is macro expansion but I seldom write macros
janneke: interesting...i guess geiser (next to paredit, of course) is what moved two juniors away from their modern editors and got them hooked on emacs
amz3`: m3tti: why do you ask?
amz3`: m3tti: honestly from my point of view, any editor will do
m3tti: i was a former emacs user but i've switched to vim
m3tti: because i love the movements in vim
m3tti: i know there is evil mode
m3tti: but its not the same
janneke: yeah, movements in vi are amazing
m3tti: and somehow i've the feeling that emacs is driving away from its cli editor stuff
m3tti: most of the tools i've seen uses the gui part of emacs
m3tti: that was my main reason to switch to neovim to be correct
m3tti: and the second question is because i like to write apis and i wasn't sure if there are any good scheme web frameworks/libraries out there
m3tti: and if you are looking for stuff for scheme google and co aren't a big help
m3tti: mostly you don't find anything about scheme
m3tti: and i don't know why scheme is awesome
m3tti: simple and awesome
m3tti: it's like lisp but more simple :D
m3tti: no nasty for loops :D
dustyweb: hello #guile!
m3tti: and what is the reason for guile over chicken scheme or gambit
m3tti: hi dustyweb
janneke: hey dustyweb
ft:  https://wingolog.org/archives/2013/01/07/an-opinionated-guide-to-scheme-implementations 
m3tti: thanx ft
ft: m3tti: ^- that one may help. wingo is one of the Guile maintainers.
m3tti: i love oppinionated blog posts
janneke: dustyweb: was just thinking..with the OO hype coming to an end, iwbn if we had something better than records and less OO than GOOPS.  Any ideas there?
dustyweb: janneke: GOOPS is pretty nice!  And I think with wingo's recent work on git master to unify the underlying structure of GOOPS and records, that puts us in a good place
dustyweb: use records when you use speed
dustyweb: use goops when you want dynamic live hackability
janneke: dustyweb: GOOPS /is/ pretty nice.  I'm using it with only #:getter and I like define-method better than (define (o) (match o (($ <...>))))
dustyweb: OO definitely experienced an irritating amount of hype, but I also consider anti-OO to be a kind of hype... after all "what is an object"? http://www.mumble.net/~jar/articles/oo.html 
dustyweb: one of the nicest things GOOPS gives us is its generic methods.  But I think there's room for more exploration in the generic methods space
dustyweb: after all generic methods are effectively the same as how pattern matching is used in languages like Haskell, but done at runtime rather than compile time
dustyweb: haskell / ML-ish lanugages
janneke: dustyweb: do you have a (lambda (o )) macro?  i've been thinking of writing something like that
dustyweb: janneke: oh interesting
dustyweb: janneke: though in that case why not use match-lambda?
janneke: we also need define-method-public ... those things make me wonder if any but you and I use GOOPS ;-)
dustyweb: can generic methods really be used without being bound to a generic?
dustyweb: you can use generics without defining them at a toplevel
dustyweb: and I used such recently
dustyweb: they're objects that can be passed around
dustyweb: but you do need to append to them
dustyweb: hence why I'm not sure how you'd do it with lambda
janneke: hmm, I'm still scared of match-lambda prolly from the time i was scared by macros ... will have a look
dustyweb: match-lambda is super nice and I use it all the time :)
dustyweb: as for "more room for experimentation in generics"
janneke: yeah
dustyweb:  http://groups.csail.mit.edu/mac/users/gjs/6.945/psets/ps03  and http://groups.csail.mit.edu/mac/users/gjs/6.945/psets/ps04  from http://groups.csail.mit.edu/mac/users/gjs/6.945/index.html 
dustyweb: are worth reading/exploring
dustyweb: Sussman plays with a predicate-based generics system
dustyweb: unfortunately making it fast means appending caching to an object
m3tti: is it better to use define-record or could i use alists
m3tti: or plists
m3tti: cause i'm used to that kind of datastructure in javascript with json objects
janneke: dustyweb: skimming through those pdf's...so "we"'re still experimenting...that's pretty amazing
dustyweb: m3tti: you can always use what you choose; alists are easy to follow and serialize but their access is O(n)
dustyweb: janneke: yes that class' problem sets are pretty incredible
dustyweb: I wish I could take it
janneke: also, i stopped watching wingo and guile master since 2.2.0; that was a mistake :-)
janneke: yeah
m3tti: and records or that goops
m3tti: what are goops
dustyweb: m3tti: GOOPS is an "object oriented" system for Guile; it's very similar to Common Lisp's CLOS
dustyweb: m3tti: it's nice because it's very live hackable and provides generic methods
dustyweb: m3tti: records are fast and minimalist, and (srfi srfi-9 gnu) provides immutable records
dustyweb: m3tti: IMO if you don't know what you want:
dustyweb:  - want to explore as you go?  start with GOOPS
dustyweb:  - know you need speed?  use records
dustyweb:  - know you need immutability and speed?  use immutable records
dustyweb:  - want minimalism?  use alists
m3tti: just wanted to know whats possible
dustyweb: these days I start with GOOPS and refactor to something else if appropriate
m3tti: i was used to alists
dustyweb: alists work and are there for you if you want them
m3tti: and currently i'm working on an card game
dustyweb: m3tti: give GOOPS a try.. generic methods may save you a lot of work
dustyweb: but!
dustyweb: that's just a recommendation.  do as you want!
dustyweb: janneke: btw one way to do the predicate based dispatch would be to use object properties
dustyweb: but!
dustyweb: er, the caching for
dustyweb: but I get a weird sense that nobody else uses object properties in guile :)
dustyweb: also, checking a list of predicates is inherently linear I think, though could be organized to move "hot" predicates to the top
dustyweb: on the trie
janneke: dustyweb: i guess i have some affinity for minimalism, esp. because of developing mes
janneke: i'm using a kind of goops--, and iwbn to have records++ grow towards that
dustyweb: janneke: I think that's what's happening now :)
janneke: assuming records++ is just a couple of macros that any simple scheme can run
dustyweb: janneke: though!  you could make predicate generics which are very minimalist
dustyweb: I would think in < 100 SLOC
janneke: yeah, i haven't really looked at that and stuck with records...
dustyweb: and then you could use anything with them.. alists, goops, records
janneke: iwbn to investigate that
dustyweb: you can even use prime? as a check ;)
dustyweb: granted then you *really* want caching ;)
janneke: i actually wrote an extension to `match' that would transparently handle goops/records and `typed lists'
dustyweb: oh!  I read an interesting paper recently that suggested adding *macro* generics
janneke: not unlike your serialization thingy '(type-symbol slot1 slot2 ...)
dustyweb: so that match could be extensible :)
dustyweb: janneke: so IMO that was pretty interesting
janneke: hmm, macro generics ... whoa
dustyweb: janneke: yes, I wish I could find the paper!  I found it to be very interesting.
dustyweb: and in fact it used match as an example of where generics would be useful
dustyweb: and how without generics macros are very "rigid"
dustyweb: ie you can't add the GOOPS matching example you suggested or any other new syntax without forking the pattern matcher
cmaloney: (tzag)
dustyweb: hi cmaloney
cmaloney: How goes?
dustyweb: cmaloney: ok!  geting some client work done from the airport.
cmaloney: Cool!
cmaloney: Flying home or heading out to more fun?
dustyweb: cmaloney: heading to Rebooting Web of Trust
dustyweb: which should be a lot of fun
dustyweb:  https://github.com/WebOfTrustInfo/rebooting-the-web-of-trust-fall2017/  look how many cool papers there are to read! :)
cmaloney: dustyweb: Oh cool. So it's both business and pleasure :)
dustyweb: cmaloney: yup :)
cmaloney: That's awesome
rekado: does anyone here have an idea what I can do to avoid problems with Guile compilation on a machine with 192 CPU cores and 1.5TB RAM?
rekado: can I trick Guile into assuming fewer resources?
rekado: I’ve already tried “taskset -c 0 …” to only allow it access to one CPU, but that didn’t help
rekado: (this is related to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27476) 
stis: hej guilers!
amz3`: 1.5TB of RAM that's a lot...
rekado: amz3`: it sure is!
taylskid: wilo[m]:
taylskid: wilo[m]: oh crap I'm sorry, I did not mean to highlight you
amz3`: o/
amz3`: login page is done
amz3`: I am working on the 'new post' page
amz3`: like I said previously it's not difficult
amz3`: but it's a lot of work
wingo: sneek: later tell civodul: idle thought, the slot allocators uses integers as bitmasks
sneek: Okay.
wingo: sneek: with functions with many slots (more likely the case with long functions; heuristics can be complicated) that means more bignums
wingo: sneek: later tell civodul with functions with many slots (more likely the case with long functions; heuristics can be complicated) that means more bignums
sneek: Okay.
wingo: sneek: later tell civodul: i wonder if those finalizers are perhaps cause of some of our gc woes?
sneek: Got it.
wingo: sneek: later tell civodul: i.e. bignum finalizers
sneek: Okay.
stis: hej guilers
sneek: Welcome back stis, you have 4 messages.
sneek: stis, wingo says: (5) yes, there is a finalizer slot on structs
sneek: stis, wingo says: (3) you mean compile-time warnings?  yes it would be nice in some ways if there were a warning handler as a fluid or soemthing
sneek: stis, wingo says: (2) you can always build such a procedure of course :)
sneek: stis, wingo says: (1) yeah really sorry about the guile maintenance situation!  for me things will be better at end of october.  but feel free to post and re-post until it gets attention :)
stis: sneek later tell wingo: in case you stall a thread for later execution in fibers, you will unwind the stack and the problem is that a finally clause which is a dynwind will execute
sneek: Okay.
stis: sneek later tell wingo: if there was a per thread variable that indicated if the unwinding was of this case one can direct the finally clause to ignore the unwinding
sneek: Got it.
amz3`: time for a demo
amz3`: but I need to upgrade my vps to strech :(
amz3`: stretch*
amz3`: my vps is so slow
mwette: working on ffi and bytestructures support for varargs functions
sneek: mwette, you have 1 message.
sneek: mwette, ArneBab says: this release (wisp 0.9.5) also does the first step towards providing a wisp tutorial for beginners: It makes it easy to create a wisp project when you have vanilla Guile installed. And I wrote an article today which describes how to create a wisp project: http://www.draketo.de/proj/with-guise-and-guile/wisp-project.html 
mwette: ArneBab: Nice going.
mwette: ArneBab: One more item:  I believe there is no expression terminator besides newline (python has `;') so the manual should make clear that
mwette: ArneBab: `foo : bar : baz' means `(foo (bar (baz)))' and not `(foo (bar) (baz))'.  IMO, this needs to be explained w/o reference to Scheme.
amz3`: here is the demo website for my blog engine, I put it online to test whether google can successfuly index pure scheme frontend applications
amz3`:  http://presence.hyperdev.fr/ 
amz3`: you read correctly, my blog engine use scheme in the frontend and scheme in the backend :D
amz3`: TODO: comments and stats
QoDliBt: hi there
amz3`: QoDliBt: hey
mwette: amz3`: Great!  Now only a few steps to be able to run an emacs editor in a browser window.
OrangeShark: amz3`: nice, I can't wait to see more of it :)
amz3`: OrangeShark: :)
m3tti: hi there im trying to use fold or foldr in guile but it doesn't work
m3tti: it says
m3tti: In procedure module-lookup: Unbound variable: foldr
m3tti: same for fold
m3tti: what should i do
ft: fold and fold-right are defined in (srfi srfi-1)
m3tti: i see
m3tti: :D
m3tti: i'm new to scheme
m3tti: i was used to lisp
m3tti: and now i'm seeing the benefits of scheme :D
ft: See the menu about modules and srfi support. There you'll find the documentation for the srfi-1 module.
ft: On the interwebs: https://www.gnu.org/software/guile/manual/guile.html#SRFI_002d1-Fold-and-Map 
random_numbers: Is there any nice library/module for json?
mwette: random_numbers: gitlab.com/dustyweb/guile-json
random_numbers: mwette: Private project?
mwette: random_numbers: I guess, but has been discussed on the guile mailing lists.
random_numbers: I asked mainly because it's asking me to register.
random_numbers: The devel list?
mwette: yes
mwette: check the archive
random_numbers: Does it double as guile-users?
mwette: try this: http://lists.gnu.org/archive/html/guile-devel/2017-05/msg00012.html 
random_numbers: mwette: I'm getting a 404 on https://gitlab.com/dustyweb/guile-json 
random_numbers: "
random_numbers: The resource that you are attempting to access does not exist or you don't have the necessary permissions to view it."
random_numbers:  https://github.com/aconchillo/guile-json  Is this an up-to-date copy of the same?
happy_gnu[m]: I was learning about Lazy Evaluation
happy_gnu[m]: Yesterday and today
happy_gnu[m]: And I just saw this video
happy_gnu[m]:  https://www.youtube.com/watch?v=tlTKTTt47WE 
happy_gnu[m]: They talk about Reality being real or a simulation
happy_gnu[m]: And how, if in a simulation, maybe things are empty until you open them
happy_gnu[m]: That got me thinking of Schrödinger's cat
happy_gnu[m]: Of course I am not physicists neither a computer scientists
happy_gnu[m]: But Schrödinger's cat seems to me is like lazy evaluation it doesn't happen until you call it
happy_gnu[m]: Hahaha
wingo: later tell stis: (5) yes, there is a finalizer slot on structs
sneek: wingo, you have 1 message.
sneek: wingo, stis says: I published the questions earlier, check the irc logs etc
wingo: sneek: later tell stis: (5) yes, there is a finalizer slot on structs
sneek: Will do.
wingo: sneek: later tell stis: (4) what is a stalled thread?
wingo: sneek: later tell stis: (3) you mean compile-time warnings?  yes it would be nice in some ways if there were a warning handler as a fluid or soemthing
sneek: Got it.
wingo: sneek: later tell stis: (2) you can always build such a procedure of course :)
sneek: Got it.
wingo: sneek: later tell stis: (1) yeah really sorry about the guile maintenance situation!  for me things will be better at end of october.  but feel free to post and re-post until it gets attention :)
sneek: Will do.
amz3: woot!
amz3: I successfuly installed guix in a debian stretch lxc
amz3: I don't know what happened but 'guix pull && guix package -u' worked
OrangeShark: happy friday
dsmith-work: Happy Friday, Guilers!!
civodul: happy Friday!
civodul: amz3: why "i don't know what happened"?  :-)
civodul: sounds like: "surprisingly, it actually worked"
civodul: :-)
amz3: civodul: a few days agao, I did the same commands and it failed with an error, I did not report
amz3: cf. #guix
amz3`: so I have an 'assoc' validation "framework"
amz3`: basically a '(validate spec assoc)' where SPEC is itself a an association between symbols and procedures that must throw a validation-error if the passed value is not good
amz3`: validate first checks that spec and assoc have the same keys and the proceed to check every value of ASSOC with the associated procedure in SPEC
amz3`: that's all I did last night...
amz3`: (I have the feeling that I am coding more slowly nowdays, but it might be because I have to implement things that I never implemented before)
amz3`: anyway, I will post the code of that validation thing
amz3`: once I have a complete test suite
amz3`:  https://gist.github.com/amirouche/5bb9667466f022aea517b4667a09fcb9 
OrangeShark: amz3`: that sounds like something for input validation, is that what you plan to use it for?
amz3`: OrangeShark: yes
OrangeShark: oh nice, this is for your blog engine?
amz3`: yes
amz3`: janneke: I know you are working on bootstraping, I hope some day I will grow wiser reading all your wor
amz3`: work*
janneke: amz3`: i "just" started and learned while doing :-)
amz3`: well, still you have the gut to do it
amz3`: most of the work I do, I know how to do it, I have to fight laziness
janneke: haha
manumanumanu: Ahoyhoy!
davexunit: dustyweb: do you know how GOOPS handles the "diamond problem"?
davexunit: that is, a class D that inherits from classes B and C, where classes B and C inherit from class A.
davexunit: dustyweb: nvm I found the "class precendence list" section in the manual
dustyweb: davexunit: yeah it can be just as screwed as any other multiple inheritance system :)
dustyweb: but you can introspect the precedence list
dustyweb: though
wingo: later tell stis what questions :)
wingo: sneek: later tell stis what questions :)
sneek: Okay.
dsmith-work: Thursday Greetings, Guilers
civodul: hello!
OrangeShark: Happy Thursday
amz3`: o/
cmaloney: \\o/
cmaloney: \\o/ ,o. o< /o\\
amz3`: cmaloney: what's up? have you had time to hack on guile stuff?
amz3`: :)
cmaloney: amz3`: Not recenlty
cmaloney: I've been too busy misspelling recently.
cmaloney: you?
amz3`: I am building a blog engine
amz3`: something that can both handle stats and comments
amz3`: maybe at some point I will hook it into indieweb or something like that
cmaloney: nice!
amz3`: cmaloney: misspelling? you mean in your code?
cmaloney: I meant in my reply to you. :)
amz3`: oh I don't mind
amz3`: I do a lot of typing mistakes myself
amz3`: also I found out, that at least google bots can index pages that are fully rendered client side
amz3`: which means that at some point my blog will be running guile frontend side and backend side
amz3`: which is very cool
amz3`: :)
amz3`: but I need to figure a good data model, I have too much choices so I am strugling
stis: hey guilers!
sneek: stis, you have 1 message.
sneek: stis, wingo says: what questions :)
stis: wingo: 1. I have an old patch for guile, shall I wait with that?
stis: wingo: 2. It would be nice if teh compile function could be passed to a function like : (lambda (compile) do-stuff (compile)))
stis: with that ane can controll comilation of other langagues throu som user hook
stis: wingo: 3. It would be nive to work in shceme and be able to compile programs in other languages that compiles to scheme or tree.il to work trough file suffixes
stis: at least let the user enable this, I have a patch that works perfectly from scheme in this respect
stis: wingo: It would be nice to better controll the warnings of variables better. It is a relaly useful feature and I want to enable it but have no procedure from vanilla guile to direct the warnings from tons of false positives
stis: wingo: 4: in fibers it would be good to have a per thread fluid that tells if the unwinding is due ta a stalled thread.
stis: The reason is that you don't wan't finally code to be executed in exception blocks for stalled threads.
stis: wingo 5: is there a way to add a finalizer to goops classes?
stis: Otherwise I'm working quite hard with a prolog to scheme compiler, and these issues is from that experience.
stis: All the best /Stefan
stis: wingo here is a difff of the guile sources that can be as a base for discussion https://gitlab.com/python-on-guile/python-on-guile/blob/master/python.diff 
stis: sneeklater tell wingo: I published the questions earlier, check the irc logs etc
stis: sneek later tell wingo: I published the questions earlier, check the irc logs etc
sneek: Got it.
galex-713: Damn the python ecosystem impress me
galex-713: Is there any way of calling python from guile?
galex-713: People just dropped lot of flyers about some centralized proprietary local social network in my college, and I just found the reverse enginering of its api on github
galex-713: plus a more recent node.js webapp version which has the newest update keys
galex-713: oh I found pyguile on github
galex-713: is it somewhat known around guile community?
galex-713: Because it seems a lot useful
galex-713: damn it’s from 2008 and based on guile 1.6 :/
galex-713: any way of importing python objects into guile otherwise?
galex-713: Just heard you could use FFI for that…
amz3`: héllo all
amz3`: dustyweb: did you have a look at argon2i, the recommend algorithm to hash passwords?
amz3`:  https://github.com/P-H-C/phc-winner-argon2/ 
amz3`: how do you generate cryptographically secure random bytes?
amz3`: seems like Python's argon2i bindings is using /dev/urandom
amz3`: got it
amz3`: I made some bindings for argon2i http://paste.lisp.org/display/356996 
amz3`: (using /dev/urandom for generating the salt)
amz3`: I need to deal with secure cookies now
galex-713: amz3`, oh hi, what are you doing currently?
dustyweb: amz3`: secure cookies are supported in guile-webutils
dustyweb: I have signed cookie based sessions support
dustyweb: look at pubstrate to see how it's used
dustyweb: ACTION really needs to make a guile-webutils release!
dustyweb: I haven't looked at argon2
dustyweb: I forget even what I used in pubstrate; it was whatever I was able to use from gcrypt
dsmith-work: {appropriate time} Greetings, Guilers
manumanumanu: Good afternoon! What are you all up to today?
amz3`: manumanumanu: I am coding a blog engine
manumanumanu: amz3`: nice! I myself is trying to re-implement guile's reader in scheme so that I can do all sorts of funny things :)
manumanumanu: It's about time we had reader macros :D
manumanumanu: or at least some sort of not so low level parsing utility. As it is right now, even using hash-readers is a pita if you want to delimit them with anything else than ( or [
manumanumanu: say #{(a b) (+ a b)} -> (lambda (a b) (+ a b))
manumanumanu: but unless you also turn on curly infix, } is not a recognized token, and will be read as a part of a symbol by read, so you will have to more or less scrap together your own reader
davexunit: we do have reader macros.  guix uses them.
manumanumanu: oh, but that is using a third party library that won't compile for be
manumanumanu: (my own fault, my system is in a very sad state)
manumanumanu: guile-reader is exactly what I want.
manumanumanu: it looks fantastic
davexunit: I just double-checked and guix doesn't depend on guile-reader
manumanumanu: what am I missing then?
davexunit: dunno
davexunit:  http://git.savannah.gnu.org/cgit/guix.git/tree/guix/gexp.scm#n1179 
davexunit: here is where guix defines a reader macro
manumanumanu: is it using read-hash-extend?
OrangeShark: manumanumanu: yeah, looks like it
davexunit: yes
manumanumanu: what I am trying to do is to write a general thing to work with tokens
manumanumanu: anyway. work in progress
davexunit: in general I think it's a bad idea to write reader macros
davexunit: but there are very rare cases where it is useful
davexunit: people talk about hash tables a lot but they really shouldn't have a read syntax
davexunit: reader macros don't compose
amz3`: manumanumanu: I tried to code my own 'read' procedure, the task seemed daunting especially if you want to make the reader configurable
amz3`: manumanumanu: also, reporting errors was not perfect
dsmith-work: manumanumanu: Day job: embedded python on Linux talking to AWS with MQTT and devices using ANT.
dsmith-work: *really* grooving on magit!
dsmith-work: Finnaly found out how to split a commit when rebasing.
dsmith-work: Magit is *fun* !
dsmith-work: manumanumanu: No guile unfortunately
amz3`: galex-713_: I am working on a blog engine
amz3`: galex-713_: what are you up to?
davexunit: fyi, for static blogs, there is already something available: https://haunt.dthompson.us/ 
amz3`: Yes, I know, tx. I need something that can handle comments and stats
amz3`: it's mostly an excuse to code something that is too complicated
amz3`: I mean somewhat complex but not too much
galex-713_: amz3`, restarting studies
amz3`: galex-713_: computer science?
galex-713_: amz3`, yup
amz3`: galex-713_: cool
galex-713_: beh
galex-713_: they’re saying students to do Visual Basic .NET on Windows 10 with Visual Studio by designing gui with a gui…
amz3`: ouch!
amz3`: ahem
amz3`: we need everything to do a world ;)
OrangeShark: galex-713_: that sounds fun :)
galex-713_: OrangeShark, sarcasm?
OrangeShark: yes
galex-713_: ah, lol then x)
OrangeShark: I guess that is one of the intro classes?
galex-713_: it is the intro class
galex-713_: first semester java, then C
galex-713_: err vbnet
galex-713_: first semester vbnet here
galex-713_: then C
galex-713_: then java
galex-713_: and some ocaml
OrangeShark: I wish I went to a school where the intro class was scheme :)
galex-713_: I thought the same thing x)
OrangeShark: I think some schools still use scheme in their graduate programs
galex-713_: especially that racket/pltscheme/drscheme was made for that purpose in that context
galex-713_: it’s sad guile hasn’t all the nice features of racket
OrangeShark: well guile is growing so we can always keep trying to improve
galex-713_: still growing? I’m not following that much
OrangeShark: well guix has helped attracted more people and there is some pretty cool stuff planned on the roadmap for Guile 3.0 or whatever next major version
galex-713_: native compilation?
OrangeShark: yeah that is one
galex-713_: I don’t understand how guix can attract that much people
OrangeShark: one of the google summer of code projects had compile to JS
galex-713_: r7rs and guile emacs would be cool
OrangeShark: well guix uses guile, so when people want to enhance or extend, they are going to get involved in guile.
galex-713_: ah no I don’t mean that
galex-713_: I mean, how guix can attract that much people to itself
galex-713_: I mean it’s natural to attract people to the lisp dialect you’re coded in
galex-713_: like emacs did
OrangeShark: I am not sure, but guix has a lot of activity.
galex-713_: yeah I noticed that
OrangeShark: I would like to see r7rs support and guile emacs as well
amz3`: galex-713_: a lot of people are attracted to guix, I remember the only foss contributor I new at school was in the distribution space
amz3`: s/new/knew/
amz3`: sorry
amz3`: they think it's easy
amz3`: idk actually why some much people are attracted by working on distros
galex-713_: especially that I heard it has poor dependency working
amz3`: dependency? in guix?
galex-713_: yeah
galex-713_: it seems to be less good than debian from the outside
amz3`: I would not say poor, but opiniated
galex-713_: (well from what I heard from the inside)
galex-713_: yeah both :P
galex-713_: debian has rich dependency working
galex-713_: ie “bloated” if you don’t like/use debian
amz3`: what I miss in guix, is to be able to fine tune my build to make it very fast like gentoo
galex-713_: I’d like to see some compatibilities/gateways between guix and debian
janneke: amz3`: i'm contributing to guix because it's not `a distro' to me
galex-713_: yeah it’s like gentoo or LFS
galex-713_: more a metadistro
galex-713_: yet it doesn’t explain why it attract more people than gentoo or LFS
amz3`: janneke: what do you do in guix? cuirass?
janneke: amz3`: i'm mainly working on removing the need for bootstrap binaries
amz3`: ok
janneke: i'm adding the occasional package, and do some cuirass work
amz3`: oh
janneke: i've moved all my machines to guixsd and am moving my primary client's ecosystem from ubuntu to guix
amz3`: ah
amz3`: I had again trouble installing guix 0.13 on debian inside an lxc
amz3`: I am not moving right now
amz3`: I feel stupid, but it's a real story
janneke: yeah, it's not too friendly yet, many rough edges
amz3`: tx
amz3`: for saying it
amz3`: I am not against the cli/scheme based installation process
janneke: i'm just totally taken by the idea to declaratively describe your whole os using guile...amazing
amz3`: it's just that 'guix pull && guix package -u' fails
amz3`: janneke: me too
galex-713_: yeah me too
janneke: yup, installing it might be very easy, or terribly difficult depending on circumstances
janneke: esp. the bit-for-bit reproducibility feature that guix adopted i think is amazing
janneke: just don't feel bad if it doesn't work for you yet
stis: heay wingo:
stis: I got a few questions.
amz3`: o/
manumanumanu: civodul: haha! I am happy I was right, but I am sorry to hear that you have to debug it :(
manumanumanu: I have only met it on the implementation side of things, and I can imagine weak references suck even more to have to debug from the other side
civodul: indeed :-)
manumanumanu: Hmmm. regarding fluids. Can I set a fluid in a module and have it active in code that imports that module? I am trying to change current-reader...
civodul: yes, though if modules are compiled, they're obviously not going to be 'read'
civodul: so you might want to use it in 'eval-when'
manumanumanu: ah.
dsmith-work: Hey Hi Howdy, Guilers
benq: hi
amz3: nice!
OrangeShark: hello
manumanumanu: Why isn't read-hash-extend generalised? It would be neat to be able to hijack the reader for any kind of chars. Or maybe I'm just bitter because I can't install guile-reader
manumanumanu: I give up. hijacking the current reader is no fun.
dsmith-work: manumanumanu: Mostly history I guess.  Guile's reader was (is?) mostly in C (as was most all of Guile).
manumanumanu: dsmith-work: so I have noticed
dsmith-work: manumanumanu: Take heart! As the compiler gets better and better, more and more of Guile is being rewritten in Scheme.
manumanumanu: dsmith-work: I already started writing my own
manumanumanu: :D :D
ArneBab_: manumanumanu: I now ran our wordcount tool on the docker provided by https://github.com/juditacs/wordcount  , but performance is pretty bad (almost last place).
ArneBab_: manumanumanu: how to repeat that: https://github.com/juditacs/wordcount/pull/95#issuecomment-332280639 
ArneBab_: manumanumanu: well … on the second run performance is about as good as nodejs
ArneBab_: wingo: I see a factor 2 disparity between the first run of a script (where it gets auto-compiled) and the second run. Is that a known problem?
ArneBab_: wingo: this is with 2.2.2
ArneBab_: manumanumanu: about as good as nodejs *typescript*, native JS is faster
manumanumanu: ArneBab_: how big disparity?
manumanumanu: The compile shouldn't be more than 0.5s
manumanumanu: ArneBab_: that v8 ds faster shouldn't come as a surprise
manumanumanu: v8 is _blazing_ for single thread stuff
ArneBab_: manumanumanu: I get roughly twice the runtime in the process which does the auto-compile
ArneBab_: first run takes about 2x as long as second run (or subsequent runs)
ArneBab_: manumanumanu: not in this test … Python2 is around factor 3 faster
lukas__: nvm I found it under nala's github : https://github.com/NalaGinrut/guile-tjit 
lloda: lukas__: please let us know if you manage to compile & test it, I tried it a while ago and I couldn't, I can't remember why rn
amz3: o/
dustyweb: hiya
OrangeShark: hello
dustyweb: civodul: looks like weak hash tables haven't left your nightmares yet :)
civodul: not at all!
civodul: today, several times i was like "yeah, got it"
civodul: the minute after i realize i still don't understand what's going on
manumanumanu: Ahoy!
manumanumanu: I hear weak hash tables! Every time I hear "how would you introduce a memory leak in [GC'd language of your choice]" I always think of 1. weird threading behaviour (java has loads of pitfalls) and 2. weak circular references
manumanumanu: I haven't tried it in guile though
manumanumanu: How would you leak memory in guile?
civodul: manumanumanu: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28590  :-)
manumanumanu: hehe
reed_: Hi all, I have written a function in 'c', which I have been able to call from the guile repl by following the methodology in the 'tortoise tutorial' https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html.  If I wanted to add the function to a module am I right to look at this part of the documentation: https://www.gnu.org/software/guile/manual/html_node/Modules-and-Extensions.html#Modules-and-Extensions  ?
reed_: It seems there is a couple of ways to access 'c' code from guile and I want to make sure I'm doing it in a some what canonical way
Muto: I have Guile 2.2 & 2.0 installed, I'm trying to get the Guile-Gnome library, but during the output of './configure --prefix=/usr' I get the error: "found development files for Guile 2.2, but /usr/bin/guile-2.0 has effective version 2.0"
lloda: reed_: there are like 3 ways of doing it. One is as in that page which is 'extending' (1). Another is to link your C modules with libguile which is 'embedding' (2). And finally there is the FFI (3).
lloda: I think modern preference is (3) if you can, (1) if you cannot, and (2) is somewhat discouraged (but every case is different and it might be better sometimes). I started using Guile long ago so I use all three. If I was starting now I would use just (1) & (3).
lmat: How do I transform a list using a function?
lloda: lmat: https://www.gnu.org/software/guile/manual/html_node/List-Mapping.html#index-map 
lmat: lloda: That is clearly what I want, but there is lacking documentation...   what does map return? What is the difference between map and map-in-order?
lmat: I kinda want to think that map applies proc to each argument and returns a new list which is the result.
lmat: And what about the type of the arguments? Should they be list elements or lists?
lmat: (Maybe I was supposed to learn this in Scheme class 1; I'm noob ^_^)
reed_: lloda: Thank you for your detailed response! In the 'extending' documentation they say "When loaded with (use-modules (foo bar)), the load-extension call looks for the foobar-c-code.so (etc) ". What exactly is meant by the 'etc'? Does that mean it could be foobar-c-code.o as well?
lmat:  https://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Fold-and-Map.html   has    Scheme Procedure: map f lst1 lst2 (which is already more suggestive), and it has a good bit of prose to help.
dsmith-work: Monday Greetings, Guilers
cmaloney: greeets
amz3`: o/
llooda: reed_: I think it just means that the extension could be different depending on the system. For exmaple on the Mac it's .dylib. .o files are not suitable for dynamic linking I don't think.
llooda: 
llooda: lmat: yeah the Guile manual is mostly for Guile and not really for Scheme.
lmat: llooda: Is map a scheme keyword?
llooda: yes.
lmat: llooda: thanks!
llooda: well, no. Not a keyword.
llooda: but a standard function.
llooda: Here's a Scheme reference. http://scheme.com/tspl4/control.html#./control:h5 
dsmith-work: lmat: "map" (or something really close to it) is available in many languages that are to some degree "functional".
lmat: dsmith-work: okay.
lmat: llooda: thanks
llooda: lmat: np. maybe look through http://scheme.com/tspl3/  better as it's older and more standard. tspl4 has many r6rs isms. I just don't want to confuse you :-/
lmat: llooda: Thank you; good idea.
llooda: more examples in the Guile manual would be a good thing for sure
dsmith-work: The + example from http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_idx_642  sums it up nicely.
dsmith-work: Pun wasn't intended, but I'll take it.
lmat: Where can I find a list of standard scheme functions?
lmat: For instance, googling     "elt" site:scheme.com/tspl3/        was not helpful.
lmat: Oh crap, I think elt is a declared object in my code :'(  (what's that called? a variable?0
OrangeShark: lmat: for standard scheme functions, you can look at the scheme standards like r5rs and r6rs. There is a new standard r7rs as well which guile doesn't fully support yet. Guile has a section of the manual dedicated to r6rs.
OrangeShark: but to see what functions are supported in guile, best bet is to just look at the guile manual, specifically section API reference and Guile Modules. There is also a procedure index too if you know the name of it.
ArneBab: benq: fixed the bug with partial unindent. See https://bitbucket.org/ArneBab/wisp/src/52d72f6f9d00366a632b1f8b0bbbc264bfca2137/tests/partial-indent.w  and https://bitbucket.org/ArneBab/wisp/src/52d72f6f9d00366a632b1f8b0bbbc264bfca2137/tests/partial-indent.scm 
ArneBab: what I love about autotools: make distcheck.
lmat: OrangeShark: thanks
ArneBab: fixed the bug, did the release: wisp 0.9.5, now with standalone language/ → https://bitbucket.org/ArneBab/wisp/downloads/wisp-0.9.5.tar.gz 
ArneBab: sneek: later tell mwette: this release (wisp 0.9.5) also does the first step towards providing a wisp tutorial for beginners: It makes it easy to create a wisp project when you have vanilla Guile installed. And I wrote an article today which describes how to create a wisp project: http://www.draketo.de/proj/with-guise-and-guile/wisp-project.html 
sneek: Okay.
lmat: How do I print something out during guile execution?
lmat: (I need to debug my script...)
OrangeShark: ArneBab: nice tutorial. I wonder if there is a way to simplify the usage of other languages in guile. I feel like always having to do "-x '.w' --language wisp" every time is a bit annoying.
ArneBab: OrangeShark: That’s something I’d like to see. But we’re not there yet …
ArneBab: (or at least I don’t know how I can do that)
amz3`: lmat: use 'pk' procedure, mind the fact that 'pk' returns it's last argument, for instance (pk 1 2 3) will print ;; (1 2 3) and return 3
lmat: amz3`: thank you
amz3`: lmat: pk == peek i guess
lmat: ahh
ArneBab: OrangeShark: and thanks ☺
ArneBab: OrangeShark: with the header I already simplified the process a bit: You can simply copy the header
amz3`: lmat: the fact that it returns the last argument is very useful to avoid the need to create a "new line" in the code to inspect a value, you can just "nest" the value you need to inspect with 'pk'...
lmat: amz3`: yeah.
OrangeShark: ArneBab: wonder if something like languages registering extensions like .w to guile. So when guile is given a foo.w, it knows this is wisp source code.
ArneBab: I’d like to have that, especially because after compilation, the language does not matter anymore: If the language could be be switched based on the extension, developers wouldn’t even have to know the language in which some file is written.
ArneBab: That would be a complete multi-language environment.
dustyweb: hi hi
OrangeShark: ArneBab: yup, would be pretty much invisible for users.
ArneBab: We could use javascript libraries (which stick very strictly to the syntax), elisp, lua, wisp and scheme together.
dustyweb: ArneBab: wisp stuff, whoo
dustyweb: ArneBab: what's up with <
> ? dustyweb: is that meant for like ;; foo dustyweb: maybe ;; header goes here ArneBab: But I’m not sure whether I see all potential pitfalls (i.e. from switching language rapidly) dustyweb: would be clearer if so? ArneBab: dustyweb: <
> is the first code block in http://www.draketo.de/proj/with-guise-and-guile/wisp-project.html#sec-3 OrangeShark: there might be a couple of rough edges communicating between languages. It might be interesting to explore. dustyweb: ArneBab: I'd suggest inserting the example header, then a comment below it like dustyweb: ;; ^-- switch out with the header determined above dustyweb: ArneBab: at first I was like "did ArneBab add new wisp syntax"? dustyweb: :) ArneBab: dustyweb: I now explained that <
> is noweb syntax for including the header. ArneBab: dustyweb: no new syntax, just plain org-mode ☺ dustyweb: oic dustyweb: noweb noproblems ArneBab: ☺ ArneBab: dustyweb: I use noweb, because I want to put the focus on the point that the header is a template you can simply copy in without changes. dustyweb: ArneBab: tbh I think it adds an additional layer of complexity for the average user to follow dustyweb: noweb is not very well known outside of some very small communities dustyweb: so you're adding a new thing to learn for many users dustyweb: I'd go with the minimum viable number of new concepts to learn in a tutorial ArneBab: maybe you’re right … I can add specialized tangling blocks which pull both together. ArneBab: I wish my wisp-mode recognized multi-line comments … dustyweb: yeah, that's fine to do on your "source" end, though I would just not mention it on your exported HTML :) ArneBab: dustyweb: realized that. Thank you! dustyweb: later! dustyweb: ACTION going to find food ArneBab: bbad Apteryx: Hello! When --auto-compile is active (the default), is the file compiled before being run? or is it interpreted and run, and then compiled in the background? daviid: Apteryx: the former apteryx[m]: OK. Thanks. daviid: apteryx[m]: you can introduce a tiny bug in some of your to convince yourself ... if you wish ... apteryx[m]: Eh, I put a timer in my code and could see that it is a you described. Auto compilation leads to much slower execution on the first run. daviid: apteryx[m]: obviously - it has to compile (and optimize) ... amz3`: héllo all! amz3`: I discovered a security issue in my web app boilerplate amz3`: basically, the static route can lead to display any file in the host like /etc/shadow amz3`: via a url that is /static/../../../../etc/shadow amz3`: you can not reproduce the issue with browser because they strip extra ".." amz3`: the boilerplate code is based on guix-web \\cc davexunit amz3`: how did you solve this issue? amz3`: I can simply forbid .. in the path component amz3`: here is fix https://github.com/a-guile-mind/guile-web/commit/b43cabef9a337bc07d13fcd3d25c77a48eec6757 manumanumanu: Is there any documentation how the guile reader works? I would like to modify it without the guile-reader extension (which won't compile on my broken system) manumanumanu: oh. found the source. Neat. I can work this manumanumanu: So: the reader is a fluid. Is there any way I can set it to affect anything outside the current file? Doing a fluid-set! seems to give only very local results stis: hello guilers! mwette: hi sneek: mwette, you have 2 messages. sneek: mwette, ArneBab_ says: 0.9.4 now uses /site/ sneek: mwette, ArneBab_ says: editing for non-programmers is something I see as a goal for wisp. However I don’t think that the syntax is actually much easier to edit. What it provides is that it looks less daunting, so people dare to assume that they can understand what it does — and therefore dare to edit. lukas__: Hey, does anybody know where I can see the code of Nash written by Atsuro Hoshino? lukas__: I emailed him some time ago without response so just wanted to know what is status quo of JIT for guile mwette: ArneBab: wisp could be used to write specs, like guix package specs, in excel even. However, what is needed is a language spec/intro that does not require one to have familiarity w/ lisp manumanumanu: stis: Skepp ohoj! ArneBab: mwette: I hope that I’ll manage to write that the next months mwette: ArneBab: Awesome! Maybe look at RnRS or other tutorial like "learn Scheme in fixnum days" ArneBab: mwette: do you know casting spels with lisp? ☺ mwette: ArneBab: Have not heard of it. I will look. ArneBab: (though that’s somewhat building upon parens) ArneBab: http://www.lisperati.com/casting-spels-emacs/html/casting-spels-emacs-1.html mwette: thx mwette: z manumanumanu: amz3`: dsmith-work : thanks. that one it is! amz3`: yw! amz3`: ACTION reading stuff about natural language processing, information retrieval and search engines amz3`: that's much of fun amz3`: I have figured that cycling between project is a bad habit amz3`: because I need to learn my code again amz3`: which leads me to think that adding synonym handling at query time will not be difficult amz3`: that said, I don't know how to pre-compute synonyms ArneBab_: amz3`: a good point about cycling between projects is that you learn which code styles actually make it easy for people to jump in ArneBab_: :) amz3`: ArneBab_: answer: none! ArneBab_: really? amz3`: ArneBab_: nobody, contributed to my projects except maybe guile-git, but I lost track of what is done there ArneBab_: I found that some of the comment-heavy styles I used made it very easy for me to get into my project again amz3`: ArneBab_: ah, I did not understand it that way ArneBab_: writing TODO items in the code file works, as does the t (or b) issue database (in the repo) amz3`: "as does the t (or b)" >> what do you mean by that? stis_: yeah dictionaris is now implemented stis_: hash-for-each should be done in scheme so that we can turn it into an iterator dustyweb: guile: warning: weak hash table corruption (https://bugs.gnu.org/19180)grafting '/gnu/store/k0pxmkbv99gv79slq68z0wpiixhyv5xy-xorg-server-1.19.3' -> '/gnu/store/8m5ch6lx9cn7vr452rbykllkchxfkk4v-xorg-server-1.19.3'... dustyweb: huh dustyweb: that happened in guix dustyweb: but according to the bug dustyweb: it shouldn't be happening in 2.2 dustyweb: but clearly it did.. civodul: dustyweb: for grafting we use 2.0... to avoid a 2.2 bug :-) dustyweb: civodul: ha :) civodul: civodul: in my nightmares i see weak hash tables slyfox: scary amz3`: o/ amz3`: nalaginrut: did you have a look at guile-js? amz3`: I made a small boilerplate to start coding web apps https://github.com/a-guile-mind/guile-web manumanumanu: ArneBab: The thing is, I don't think I have ever seen curly infix used. The closest thing is the racket ., (eg: (5 . < . 6) => (< 5 6)), but most people don't use that either nalaginrut: amz3: oh~nice, I didn't know it work now nalaginrut: I'll take look later, after I released 0.1.2, I have to consider to add good abstract for web frontend stuffs in Artanis nalaginrut: I think 0.1.2 will be in this or next month, with a better websocket implementation bavier`: ACTION having fun with threading in guile civodul: bavier`: what kind of fun? :-) bavier`: civodul: there are several ways to do threading in guile, I'm trying to figure out the right paradigm bavier`: civodul: I'm trying to "fix" guix's 'compile-all' script so that it integrates with make's jobserver bavier`: my laptop unfortunately starts to overheat if more than one core is busy for too long, which means 'guix pull' is painful bavier`: :P bavier`: I've not touched threading in guile much before, so this is fun civodul: heh, i see! cehteh: here it compiles on all availabel cores, but the problem is, that guile itself is so slow bavier`: cehteh: my problem's the opposite, I don't mind if it's slow, and I want to be able to use less cores cehteh: cant that be configured? bavier`: cehteh: currently not, 'guix pull' ignores the --cores option bavier`: maybe better discussion for #guix cehteh: ah ok cehteh: should be fixed yes, but just respecting the --cores option would be nice (or alternatively a --load option which starts jobs as long load stays under limit) ArneBab: manumanumanu: I’m using curly infix regularly ArneBab: manumanumanu: it’s really cool for if: (if (or {a = b} {c > d} {x equal? y}) #t #f) dsmith-work: Happy Friday, Guilers!! OrangeShark: happy friday manumanumanu: ArneBab: a matter of taste. I prefer the regular way :) However, doing (find {= 5 <>} my-list) really tickles me in the right spot manumanumanu: I haven't found a good way to alter the reader though, but I remember someone mentioning a library for doing just that amz3`: manumanumanu: guile-reader? dsmith-work: manumanumanu: http://www.nongnu.org/guile-reader/doc/guile-reader.html dustyweb: https://gitlab.com/dustyweb/guile-csexps cmaloney: \\o/ dustyweb: needs better docs and a Real Release(TM) but I think the README explains the rationale well cmaloney: Yeah, it's mostly clear cmaloney: though my mind kept saying "JUST USE JSON" dustyweb: for binary data? :) cmaloney: Yes cmaloney: #\\7FFF#\\8FFF cmaloney: ;) dustyweb: heh dustyweb: one nice thing about this library also dustyweb: though I haven't demo'ed it yet in the docs dustyweb: is you can describe how to transform something like a srfi-9 record or a goops class dustyweb: and it'll recursively package it all up dustyweb: and unpack it back cmaloney: Oh, nice cmaloney: ACTION thinks of pickling data. ;) dustyweb: yes, except less dangerous :) dustyweb: when you set up a serializer here you're explicitly describing how it works dustyweb: though there are some lazy procedures to make describing that in just a couple of lines very easy dustyweb: more to come anyway cmaloney: iirc Python Pickling is essentialy a memory dump, no? dustyweb: yup dustyweb: also not safe to send across the wire because of it cmaloney: Yeah cmaloney: which is why we json all the things. cmaloney: except dates cmaloney: because JavaScript dustyweb: the pain of not knowing whether or not a field was a uri or a string in json-ld is partly what kept me thinking about canonical s-exps dustyweb: you have to expand it out to its unambiguous form dustyweb: and then you aren't really working on json anymore cmaloney: Yeah dustyweb: however cmaloney: The sad thing about XML is you can spec that nonsense. The sad thing about JSON is you can't. dustyweb: json has a nice feature in that it provides a few core types and it's easy to parse for pretty much everywhere dustyweb: json is a good lowest common denominator dustyweb: but when you want more than that, it gets a bit irritating cmaloney: Right, save for when you have to ensure type-safety cmaloney: Funnily enough a friend was lamenting a situation where he was passing XML somewhere cmaloney: and it screamed "USE SOAP / WSDL" cmaloney: and naturally they weren't using it cmaloney: crazy-making cmaloney: They had to install some black-box tech that would say whether the XML was passing or non-passing dustyweb: SXML is really nice in scheme-land dustyweb: though dustyweb: also not good for binary data either cmaloney: XML is terrible for binary data dustyweb: and you can't write an xml parser in 150 lines of code :) cmaloney: God no. It's like parsing an email address using regex. ;) dustyweb: I wrote the csexp reader/writer both in 150 SLOC cmaloney: w00t dustyweb: largely inspired by davexunit's json stuff :) dustyweb: of course in csexp you need to make sure that both sides know how to interpret type stuff the same way dustyweb: which is fine if you've just got pretty much the same two programs running, but if you want somthing more complicated... that's another layer to implement dustyweb: but for what I wanted it for it's not a big deal cmaloney: Yeah, that's cool str1ngs: hello, I'm messing around with ffi. I'm trying to call the glob libc function. but I'm having trouble figure out how to get the char **gl_pathv field. I can get the int fields but not sure how to handle C string arrays amz3`: tzag stis_: hurray, I managed to compile python *arg *kwargs e.g. keyword arguments and optional arguments stis_: It's lot of work just to reach somewhat accapteble default python environment. dustyweb: o/ dustyweb: hm, what to use for csv parsing dustyweb: I guess https://github.com/NalaGinrut/guile-csv ? dustyweb: https://github.com/NalaGinrut/guile-csv/commits/master not sure what's going on in these recent commits, looks like nala removed the automake stuff(?) hooverville: dustyweb: i struggled with finding a csv parser that fit my needs earlier in the year. Someone in this channel pointed/provided me with an older module neil van dyke wrote for racket, before it required other racket modules ArneBab_: dustyweb: I’m currently using guive-csv, but not for anything performance critical dustyweb: hooverville: ArneBab_: thanks for the feedback dustyweb: ACTION packages for guix ArneBab_: it works pretty well, gives me lists like (record-1 ((header1 value1) (header2 value2) ...) amz3`: what do you use to hash password to store in database? dustyweb: amz3`: I can point you what I do if you like amz3`: dustyweb: sure dustyweb: amz3`: it uses guile-gcrypt dustyweb: so you'll need that dustyweb: ACTION ought to make a proper release... dustyweb: amz3`: https://gitlab.com/dustyweb/pubstrate/blob/master/pubstrate/webapp/auth.scm#L43 amz3`: tx dustyweb: np dustyweb: oof :< https://github.com/NalaGinrut/guile-csv/blob/master/Makefile dustyweb: I do not like that Makefile civodul: heh :-) OrangeShark: dustyweb: https://github.com/NalaGinrut/guile-csv/issues/1 dustyweb: OrangeShark: yeah I saw that dustyweb: OrangeShark: well, the build script for guix is also pretty simple ;) dustyweb: copy over and compile over a file :) dustyweb: hm dustyweb: we don't have a make-method any more dustyweb: though the docs claim we do :) daviid: dustyweb: is that so? daviid: I did not check, I thought it would be part of make check ... dustyweb: you still have (method ...) dustyweb: but it's a macro daviid: dustyweb: I thought make-method was part of the MOP, so it would not 'disapear' daviid: it's definitely in the manual daviid: dustyweb: in the men time you can use make daviid: make-method is a simple wrapper around make with metaclass plugd: Hi everyone, is there a module that provides the MIT-Scheme syntax for implicitly defining higher order functions? I.e. (define ((c f g) x) (f (g x))) to define a composition function. plugd: (Chicken also allows this.) lloda: plugd: (ice-9 curried-definitions) lloda: https://www.gnu.org/software/guile/manual/html_node/Curried-Definitions.html plugd: lloda: thanks! lloda: yw OrangeShark: hello everyone bavier`: hello OrangeShark cmaloney: (tzag '()) reed_: Hi all, I am currently learning the guile/C interface and would like to send a guile list to a c function. Is there a canonical way to do this? amz3`: tzag amz3`: idk sorry janneke: reed_: have tried calling a C function with a guile number/integer? reed_: janneke: I think I have figured it out. I can use the scm_car and scm_cdr functions in C to unpack the list. janneke: reed_: yes, for (; scm_is_pair (exp); exp = SCM_CDR (exp)) { .. } wingo: good evening cmaloney: \\m/ dustyweb: hi daviid: hi dustyweb dustyweb: heya daviid dustyweb: wingo: turns out I have good use for your recent code for unifying GOOPS class structures and records structures daviid: and then ... we could patch match to accept instances ... ArneBab: benq: I just added a note to the README about installation in /usr/local benq: arnebab: thanks, interested in a 'realpath' command? ArneBab: yes pebftab: daviid , dsmith-work : welp, found out that DUMA was causing trouble. Time to switch to valgrind. benq: arnebab: perl -MCwd -e 'print Cwd::realpath($ARGV[0])' ArneBab: benq: is perl guaranteed to exist on OSX? benq: or with a newline: perl -MCwd -le 'print Cwd::realpath($ARGV[0])' ~/.Xauthority pebftab: thanks anyway, and may that be a lesson on "if it breaks in testing, perhaps your testing tools are breaking it" benq: yes, Perl is used for many utilities. That's the reason I still use Perl a lot. ArneBab: why ARGV[0] and not $0? benq: I don't understand why not more people take more advantage of Perl wide distribution. ArneBab: (or rather '$0') ArneBab: (or rather '…'$0'…') ArneBab: benq: can I make this fail if the path does not exist? ArneBab: (return 1 instead of 0) mwette: ArneBab benq: for portable realpath look at the stackoverflow ref. It provides a bash function mwette: #!/bin/bash mwette: mwette: realpath() { mwette: [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" ArneBab: mwette: do you mean this one? 2>/dev/null 1>/dev/null mwette: } mwette: mwette: realpath "$0" ArneBab: this one: https://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-osx ArneBab: (sorry about the previous, wrong copy buffer) ArneBab: does OSX always have bash? mwette: yes ArneBab: then that shall be my fallback-fallback ft: That's not very realpathy though. :) One could at least take the directory part, cd to that in a reassemble properly. benq: ArneBab: I think it would be nice to have a customizable delimiter in wisp. I replaced ':' with '$' ArneBab: benq: You might want to try out the readable project then. Wisp should stay as simple as possible. benq: Right now I use both .... ArneBab: benq: in readable they added several useful syntactic structures, but by doing so they lost the simplicity which had drawn me to them ArneBab: that’s the origin of wisp: trying to make a simpler readable ArneBab: benq: the reason why I don’t want to add more syntax is that every syntax element I add makes the language more complex and removes one element the programmers can use for their own tools ArneBab: mwette, benq: wisp 0.9.4 should now have working make check on OSX (still untested, since I don’t have OSX): https://bitbucket.org/ArneBab/wisp/downloads/wisp-0.9.4.tar.gz ArneBab: ACTION needs to get to bed ArneBab: benq, mwette: thank you for your help in making wisp better! benq: ok, you sleep well. ArneBab: thank you! ArneBab: cu mwette: I would prefer to see you use /site/. mwette: The nice thing about wisp is that it could be used by people who don't operate a language sensitive editor. Scheme has got to be tough if you edit using textedit or some noise like that. one could potentially have non-sw folks edit in gnumeric amz3`: https://github.com/JunSuzukiJapan/macro-lisp ArneBab_: benq: the deeper reason for preferring : over $ is that : occurs more frequently in normal prose, therefore code written with : looks more familiar to all people who know prose. ArneBab_: sneek: later tell mwette: 0.9.4 now uses /site/ sneek: Okay. ArneBab_: sneek: later tell mwette: editing for non-programmers is something I see as a goal for wisp. However I don’t think that the syntax is actually much easier to edit. What it provides is that it looks less daunting, so people dare to assume that they can understand what it does — and therefore dare to edit. sneek: Got it. benq: ArneBab_: I think I once read your entire conversation Arne/David about wisp/readable. What I recall is that he showed great interests in you thoughts I think he even mentions you positively in his SRFI. Thats the important thing: curiosity. In that sense: you see it more from a purely syntactical side, me on the other hand I narrow it down to use the additional sugar for specific uses. benq: so I use ':' only as infix operator for function application. And to emphasize that point I use a operator symbol that is also used in other languages which is '$' ArneBab_: benq: yes. I also refer to his SRFI-109 for all the complex stuff. David did great work and wisp wouldn’t be possible without readable, and programming in wisp would be much less convenient without his curly infix (SRFI-105). The difference is essentially aesthetics and purity of language design. ArneBab_: benq: the actual deep difference is that wisp uses the dot-prefix to denote a line as "not a procedure call". Readable does not have that, so in theory it would need much more vertical space, but that is mitigated by the additional syntax elements. ArneBab_: benq: how do you use : as infix? do you mean inline? benq: I thinks there is one big difference and not even sure if that was intentional on your side because it is not discussed in the conversation (as far as i remember). I don't know the proper term, but the thing I'm talking about is how Wisp handles "negative" indentation. benq: sorry all my typos... ArneBab_: do you mean a line with less indentation than the previous one? benq: yes, this is absolutely genius ArneBab_: I’d love to take that praise, but that’s essentially stolen from Python :) benq: and the only reason I went through the auto tools pains multiple times. benq: I once recreated this rules in Perl. It was a painful experience. ArneBab_: I also fought quite a lot with it ☺ — I have a python implementation which isn’t completely correct, and a scheme implementation which isn’t completely correct, and then a second scheme implementation which finally gets it right :) benq: you mean 'wisp.scm' ? ArneBab_: the bootstrapping uses the python-implementation to parse the first scheme implementation which then parses itself and then the second scheme implementation. ArneBab_: wisp.scm is the first, wisp-scheme.w is the second benq: good to know. what do you think about curly braces? ArneBab_: there are some corner cases in string handling which wisp.scm doesn’t get perfectly right. ArneBab_: benq: I like curly braces a lot. Prefix-math is off-putting to many, and curly braces make that code approachable to them. benq: any plans to implement it in wisp? ArneBab_: it’s already included: when you switch to wisp it activates curly braces syntax from SRFI-105 benq: I've tried it in the past, but it never worked. ArneBab_: there is one catch compared to readable: curly braces in wisp are always a full expression. If you want to use them as only item on a line, you have to prefix the expression with a dot ArneBab_: . {3 + 4} ArneBab_: benq: do you have a successfully built wisp folder around? ArneBab_: if yes: cd $WISP_FOLDER; guile -L . --language=wisp ArneBab_: then type . {3 + 4} . ArneBab_: (the final period just relieves you from having to hit return thrice) benq: and which ci tool would you use? benq: I mean cli ... ArneBab_: what do you mean by that? ArneBab_: I run the Guile wisp prompt and edit with Emacs benq: my system is a mess Wisp wise. So I have to work in the local folder of wisp. Is it wisp-scheme.scm? ArneBab_: just run guile -L . --language=wisp ArneBab_: (in the wisp folder) benq: Ok , the real works. great! ArneBab_: nice! benq: and now I would like to transpile a file :-) ArneBab_: (you can do that to create other wisp projects: it only needs language/wisp/spec.scm and wisp-scheme.scm — but a future release should move wisp-scheme.scm into language/wisp.scm so you’d only need language/ ArneBab_: benq: guile wisp.scm file.w > file.scm benq: but wisp.scm not final/good implementation, no? ArneBab_: this actually works for most lisp syntaxes, including emacs lisp ArneBab_: benq: it’s the implementation which has at least one known bug in character literal handling in comments ArneBab_: but it works for almost all wisp files — should work for all files which don’t do something crazy like implementing a wisp parser :) benq: I get '{ 55 + 88 }' or '({ 55 + 88 })' ArneBab_: run this . {55 + 88} ArneBab_: (mind the leading period) benq: I get '{ 55 + 88 }' ArneBab_: that’s correct ArneBab_: if you use curly infix in the wisp, you will get curly infix in the scheme ArneBab_: you need to activate its reader directive ArneBab_: !curly-infix benq: Ahh now it get interesting benq: I love directives .. (not so much) ArneBab_: hm … need to check that ArneBab_: ah, #!curly-infix benq: nope, and #!curly-infix doesn't do it either ArneBab_: please create a file with the following content: ArneBab_: #!curly-infix ArneBab_: (display {55 + 88}) ArneBab_: (newline) ArneBab_: does guile display 143? benq: I check that, meanwhile examples/fib.w is also interesting. benq: #!curly-infix benq: ((display {55 + 88})) benq: ((newline)) benq: thats the output benq: sorry ArneBab_: benq: ah, that’s from running guile wisp.scm on the file ArneBab_: what I gave you was the scheme testfile benq: Ah, sorry, yes then the result is correct benq: but I would be interested in the transformed code ArneBab_: now to transpile, use this content: ArneBab_: . #!curly-infix ArneBab_: display {55 + 88} ArneBab_: newline ArneBab_: (dear powers that be, I hope it’s ok to paste the lines three) benq: for me it's ok, is there some IRC rule about pasting stuff? benq: and how to process the file with this 3 lines? benq: guile wisp.scm t.w benq: the curly braces are still unprocessed. ArneBab_: benq: that’s intentional: guile wisp.scm t.w > t.scm; guile t.scm ArneBab_: curly braces are completely orthogonal to wisp ArneBab_: in other words: wisp plays well with curly places ArneBab_: in other words: wisp plays well with curly braces benq: yes I know that, but still ... (sorry to be annoying) ArneBab_: you’re not :) benq: It would be great if wisp could process/transform the curleys ArneBab_: if I were to implement curly-braces uncurlying, then wisp would no longer play well with curly braces ArneBab_: if someone were to add new features to curly braces, wisp would not have them benq: oh man this goes over my head :-) ArneBab_: therefore rather use: (write '{55 + 88}) ArneBab_: then guile writes the uncurled version benq: ok arne: in a few month there is christmas, maybe you can make me a wisp-ben version ... ArneBab_: I can’t promise that, sorry :-) ArneBab_: wisp is as it is, because that’s the best way I see to do it. There are reasons I did not do it in any other way. ArneBab_: benq: so, if you want to uncurl curly infix, just use (write '{55 + 88}). the output is (+ 55 88) ArneBab_: you don’t actually need wisp for that benq: wisp-ben version: curly-braces are processed, delimiter is customizable, dot-prefix notation can be disabled (I think you don't like that either, aaand neoteric expressions! ArneBab_: → use readable benq: readable: no "negative" indentation, lot's of additional sugar ('<*', '*>', '\\\\', .. ) I don't like. benq: so I think my processing pipeline will remain long. benq: or to put it in other words: I think you took the 'readable' tool and added the pythonic indention rules, which is really great. Then you took a lot of syntax away, a little too much since the dollar-sign and neoteric-expression and curly-infix is great. And then you added dot-prefix which I personally don't like, but I think this comes really down on personal preference. ArneBab_: but IIRC readable does have something for un-indenting ArneBab_: yepp, definitely ArneBab_: https://sourceforge.net/p/readable/wiki/Examples/ ArneBab_: see the fixnum example benq: but you cannot do https://pastebin.com/JmxsYJLL ArneBab_: you cannot do that in wisp either (or rather: you should not be able to. If you can, that’s a bug in the parser) benq: I had cases where I've used this benq: not sure if it was exactly this case, but definitely cases where 'readable' didn't work. benq: your right this a bad example benq: and there is a more serious problem with 'readable': it changes the code! So you loose track of the lines. ArneBab_: this is a non-caught error in wisp.scm. The reader will throw an error here, because it’s too easy to get misled by the different indentation ArneBab_: benq: that’s true (or at least it was). I took some pains in wisp.scm to preserve lines and comments benq: And thats REALLY important. I don't know how I forgot that. benq: indeed; readable erases comments. Cannot use that. benq: I wait for christmas than. Maybe I'll get my pony. ArneBab_: or play with wisp :) ArneBab_: you already have curly infix there ArneBab_: and you can make the dollar sign yourself (but I really wouldn’t. It only looks simple to people used to programming languages with $) ArneBab_: benq: one great part: You found a bug in the reader. I just added a testcase for it. The next release should have consistent transpiling and direct reading ArneBab_: (direct reading treats intermediate indentation as the lower indentation level, which is the most wrong™ option) ArneBab_: benq: thank you! benq: hey you took away my dearest feature :-) benq: "you already have curly infix there" yes, but only in guile. Am I correct? civodul: wingo: i'm curious what you think of https://lists.gnu.org/archive/html/guile-devel/2017-09/msg00031.html civodul: i'd love to address it wingo: i thought the focus on the weak hash table was probably off-base, but it's an interesting candidate. i need to collect thoughts more tho wingo: incidentally it is possible to incrementally mark a large region wingo: i.e. without making the mark stack overflow civodul: oh, is it? wingo: yes, see comments in gc_mark.h civodul: how do you tell the GC that an object is partially marked? wingo: you mark a fixed size, then re-push the to-be-marked large object on the mark stack, remembering where you were wingo: but i didn't get any improvement when using that strategy to mark stacks wingo: which surprised me :/ civodul: ok wingo: i think for that reason i didn't commit that test, and then lost the code when i lost my laptop :/ civodul: bah :-/ civodul: i can experiment with it wingo: i wanted to do some differential profiling at some point... i.e. profile a test file with size N, 2N, 3N, etc, and compare profiles civodul: yes that could be useful ArneBab_: benq: yes, only in Guile and other schemes which understand curly infix ArneBab_: benq: I’m currently unsure whether I’ll throw an error or treat it the same way as the transpiler dsmith-work: Tuesday Greetings, Guilers thomasd: hello #guile sneek: Welcome back thomasd, you have 2 messages. sneek: thomasd, nee`` says: I moved the system links like you said and reconfigure worked now. Thank you! sneek: thomasd, nee`` says: in the new parameters file (store (device ...)) is still #f thomasd: Hi Guilers, is there a guile interface for DBus? davexunit: not that I know of dsmith-work: I think civodul has one dsmith-work: Or maybe I'm thinking avahi instead thomasd: thinking about how to listen for dbus/udisk events in a GuixSD service, might not be easy :-/ dsmith-work: thomasd: I saw this: https://wingolog.org/archives/2004/09/11/all-aboard maybe that's what I remember thomasd: yes, I found that, too, but I haven't found any other trace thomasd: Well, if anyone's looking for a project idea... ;-) dsmith-work: civodul: Didn't you have guile interface for dbus? dustyweb: beep beep cmaloney: boop civodul: dsmith-work: i think wingo had libdbus bindings a loooong time ago manumanumanu: ArneBab_: about curly infix... Wouldn't it be neater to make curly bracket partial application? Now, I don't think that would be possible to make as a library, but it would be pretty useful manumanumanu: {eq? x <>} => (cut eq? x <>) dsmith-work: civodul: Ok thanks. amz3`: tzag amz3`: ijp: did you look at my code? amz3`: ijp: silly, question, do you think it doable to cache some of what is compiled by jslink? amz3`: https://gitlab.com/ijp/guile/merge_requests/1/commits ArneBab_: manumanumanu: I think (cut eq? x <>) is so close to {eq? x <>) that we don’t need special syntax for that. For curly-infix there’s an dedicated section detailing why it is the only approach which can work well: https://srfi.schemers.org/srfi-105/srfi-105.html#rationale_changereader ArneBab_: manumanumanu: if it weren’t for that reasoning, I’d actually be against using up syntax characters for this. amz3`: “When you have a company idea, you usually want to start right away.” amz3`: Ah... those startup peoples... amz3`: Then you end up with dozens of dead projects amz3`: at the same time it's better than nothing dustyweb: guess I can answer my own question by testing it :P dustyweb: set-port-encoding! doesn't seem to have a significant cost. daviid: ot: just noticed using tor browser that github is actually tracking any visitor in a much worse way then I initially thought! I hope the all world will cancel their github acoount dustyweb: daviid: in what way? daviid: it's trying to identify your computer based on html5 canvas and mouse movements daviid: dustyweb: just try ... you'll see the tor browser alert by yourself dustyweb: ACTION wishes tor browser bundle was packaged for guix :< daviid: i wish epiphany would offer similar protection, i really like epiphany, but more nd more I'm thinking to ony use tor daviid: except for local pages (like verifying guile-cv html doc ...) I've noticed almost all sites I access looking at HN are tracking my computer ... this world is disaster ArneBab_: amz3: we could run the closure compiler over the generated javascript to see how much smaller it gets: https://github.com/google/closure-compiler daviid: davexunit: I know you are the author of sxml->html, but do we have an html->sxxx tool? (if that is possible, no very knowledgeable in that area)? mwette: daviid: html->sxml, in htmlprag.scm, is in guile-lib on savannah daviid: mwette: ah! thanks ryanwatkins: How might one pass a TLS-encrypted I/O port to http-get? ecraven: is there a way to introspect which bindings an environment has? like (module-bindings (interaction-environment))? ecraven: module-for-each seems good for this ;) rekado: Greetings, Guilers! amz3: ArneBab: I tried closure-compiler-js (the javascript version) and it failed, I will try later with the native java version amz3: the javascript version is compiled java->javascript FalconPilot: using (ice-9 match), how can I match a number that's bound to an identifier? FalconPilot: I'd like to do something like (match ch ((KEY_LEFT ... FalconPilot: where KEY_LEFT is int 260 amz3: FalconPilot: something like that: http://dpaste.com/1W0ZPP1 amz3: FalconPilot: remove the extra paren ( in the match rule you pasted and it should work as expected FalconPilot: ah okay, thanks amz3: the rule you pasted is trying to match (list KEY_LEFT) amz3: :) FalconPilot: I think this still isn't working: http://dpaste.com/1P8JTMD FalconPilot: it seems to match anything with the first pattern, binding any input to foo FalconPilot: from the guile manual on Pattern Matching, this seems to be correct: FalconPilot: pat ::= identifier anything, and binds identifier FalconPilot: https://www.gnu.org/software/guile/manual/html_node/Pattern-Matching.html FalconPilot: using the predicate pattern lets me get the behavior I want, but it's not very pretty... http://dpaste.com/1A6XRNA ArneBab: amz3: closure-compiler reduced the size of main.js to 3.6 MiB for me. FalconPilot: I suppose I can clean that up a bit with: (define (id x) (lambda (a) (eq? a x))) FalconPilot: seems like there should be a better way though ArneBab: amz3: the tco function did not suffice to avoid hitting the recursion limits. I fear I may have used it the wrong way. ArneBab: amz3: at least I now have a 18 MiB main.js with proper indentation amz3: ArneBab: cool, I will try it later amz3: ArneBab: that said, closure-compiler is for production build, right now the next issue I need to tackle is the jslink step which takes too much time amz3: ArneBab: what are you interested in doing using guile-js? ArneBab: amz3: I’d like to see whether I can get text-rpgs to work in the browser ArneBab: and then combine wisp with js, because that would give me wisp for the browser. amz3: oh ok amz3: ArneBab: btw, I did not chime in wisp conversation, but my point of view is that guile maintainer should only accept modules they are confortable with maintaining, so it's their decision and I can not weight in this conversation amz3: ArneBab: that said, I think maintainer should make it easy to use wisp amz3: stis proposal about making it easy to specify compilation source, is in the step in the right direction i think amz3: IIRC, wisp does not require the compilation tower to kick in, does it? djcb: scheme@(guile-user)> (assoc "foo" '(("foo" . "bar"))) djcb: $3 = ("foo" . "bar") djcb: scheme@(guile-user)> (assoc-ref "foo" '(("foo" . "bar"))) djcb: $4 = #f djcb: hmmm.... am I misunderstanding `assoc-ref'? ArneBab: amz3: wisp just hands compilation over to scheme, but what’s missing is a way to specify "(import (from-language (package module) wisp)" amz3: djcb: assoc-ref takes the assoc as first argument amz3: djcb: unlike assoc ArneBab: amz3: this is to make it easy to just install stuff with wisp. ArneBab: amz3: I already have workarounds to make wisp easy, but every workaround is a hurdle amz3: ArneBab: and other languages? ArneBab: amz3: yes, other languages, too: I use shell indirection ArneBab: to specify the language of the file ArneBab: but I cannot as of now tell it *easily* to search by extension ArneBab: (though I’ll try to document how to do it) ArneBab: once I pre-compile all files, everything works ArneBab: amz3: the next step is the guix-recipe for using wisp in a program (I’ll try to get that going) djcb: amz3: oh, of course! thanks! dsmith-work: Morning Greetings, Guilers OrangeShark: morning benq: hi amz3`: tzag ArneBab: amz3: having to pre-compile the files means that I have to either add a build system or a pre-compilation step in the shell indirection header. Both duplicates the information in the file itself (the import statement), that’s why I’d like to have something more powerful. amz3`: ArneBab: you'd rather add a build system, that's what do JavaScript people, it works well ;) amz3`: pilling up build system is the way to go :sarcasm: dsmith-work: amz3`: Used to be everyone wrote their own editor. Now it's a "builder". ArneBab: amz3: it’s not like I dislike build systems. It’s just that I know how much easier it can be to start if you can simply call ./duel.w ArneBab: amz3: building js from guile (and wisp) would be awesome, because it would give the things I create the lowest possible barrier of entry: I could just put them on websites and give people links. But they could still install it locally to get the real usability (like easy shell scripting) benq: hi arnebab: I saw you by accident, there is something I'd like to tell a long time ago: I was never able to build wisp without errors. If i recall correctly some of the path where not compatible. And then another problem with an m4 macro @GUILE@ which was not recognized. yay something less to think about :-) ArneBab: benq: thank you! ArneBab: benq: that sounds like it’s missing autotools stuff :( — did you run ./configure ; make from a distribution tarball? pebftab: good evening folks ArneBab: hi pebftab benq: arnebab: yes I've tried multiple machines, multilple wisp versions, multiple autotools versions (update). I did the autoreconfigure stuff ArneBab: could you send me a build log by email? ArneBab: this is something I should get fixed pebftab: hi ArneBab benq: its some time ago but I'll have a look ArneBab: benq: maybe I’m missing some m4 stuff which does not show up in Gentoo because Gentoo includes all the -dev stuff be default daviid: ArneBab: these errors are a symptom of a bad ACLOCAL (and friends) config on the user computer, or that guile is not installed (unlikely). I recommend you to add an m4 dir, copy the guile.m4 file there and update yur configure.ac so it' uses this m4 directory ... my 2c (it is the most recurrent I hear from users unable to install (extra) guile projects/packages benq: fighting with some stuff .. meanwhile why WHY even use autotools at all? ArneBab: benq: because autotools has make distcheck. ArneBab: benq: and I had the experience that everything else became worse benq: premature optimization :-) daviid: benq: autotools is the best ... but this is OT anyway benq: never mind, I like wisp ArneBab: everything else includes waf, scons and cmake ArneBab: benq: I’m glad to hear that! benq: or your own perl script that checks some boring stuff that 99% of all users use ArneBab: except that I tend to belong to the 1% which gets bitten :) benq: what I want to say: I use a lot of software and wisp is one of the most difficult to build. daviid: ArneBab: the above suggestion will also cover the situation where guile has not been installed yet (it happens, more then you think ...) ArneBab: benq: wisp actually bootstraps itself completely when you build it benq: but I think generations of developer have argued over this ArneBab: but it shouldn’t be complicated (it should just be ./configure ; make ArneBab: ) benq: but I agree with something: autotools is the worst build system except everything else ArneBab: benq: I agree with that :) ArneBab: daviid: how to I add the m4/ dir cleanly? daviid: ArneBab: you do that on your tree, once for all ... benq: ok, I try to build from source and I think I can reproduce it, ./configure: line 1886: syntax error near unexpected token `2.2' / ./configure: line 1886: `GUILE_PKG(2.2 2.0 1.8)' ArneBab: benq: and autotools has some of the worst documentation — often complete, but lacking best practices like actually telling me what I really need to do so everything works) ArneBab: benq: that looks like GUILE_PKG does not know about Guile 2.2 benq: benq: which guile: /usr/local/bin/guile benq: guile --version: guile (GNU Guile) 2.2.2 ArneBab: benq: find /usr -name guile.m4 benq: just fyi: I once did mess with that too. You would be ashamed if you'd know how much time I've wasted with wisp ;-( daviid: ArneBab: here is an example http://git.savannah.gnu.org/cgit/guile-cv.git/tree/?h=devel you create m4, copy ... then look for m4 in , Makefile.am, configure.ac, and do the same on your project - and solve this annoying problem 'for ever' ArneBab: benq: sorry about that :( ArneBab: benq: I’ll try to make up for it by getting this fixed benq: on the other side, it aligns with the shitty day I had. Messing with auto tools describes absolutely my mess in real live. daviid: benq: this you are facing has nothing to do with the autotool chain, which is by far the best tool for us, developers ... don't blame the autotool chain, it would be unfair benq: m4 the best? I'm not sure. ArneBab: in fairness: it is easy to get caught in autotools. Most of the time I lost wasn’t due to implementation in autotools, though, but due to documentation issues. dsmith-work: m4 is what it is, a macro processor. Kind of like a stream editor, but different. daviid: benq: not just 'm4', the autotool chain ... and please note that your are blaming a tool that has nothing to do with the problem you report, hence your are being unfair ... and try to disqualify a fantastic tool based on your wrong assumptions ... but hey, let ArneBab solve this for you, just be a little patient, and thanks for reporting this here ... ArneBab: benq: yes, thank you for reporting! I would otherwise have been oblivious of lots of potential users who didn’t get it to build dsmith-oldcodger: Back in the day, when m4 was all you could get ... pebftab: sorry to interrupt, not trying to piss anybody off ... but has anyone heard about the 'ERROR: In procedure load-thunk-from-memory: incorrectly aligned base' thing ? I can't seem to find anything about it benq: At least I know now that guile probably never will get rid of autotools. And guile is besides wisp one of the most fragile software to install. daviid: pebftab: this is a (possible) symptom you have more then one guile installed, and wrong PATH, GUILE_LOAD_PATH, LD_LIBRARY_PATH ... daviid: benq: guile installation is very robust, wisp is not guile, wisp is an external module ... ArneBab: benq: where are you trying to install Guile? ArneBab: benq: you could actually get most of wisp by simply copying three files: language/wisp/spec.scm wisp.scm and wisp-scheme.scm benq: no, I work on different machines and different OS. Guile installation is a constant source of pain, that's why I switch to other schemes (gauche) which are far more reliable to build. ArneBab: benq: does this work for you? https://bitbucket.org/ArneBab/wisp/downloads/wisp-0.9.3.tar.gz benq: I don't want to offend anyone. But I spend far to much time with finicky adjustments. I think I'm allowed to express my experiences. pebftab: daviid: %load-path and %load-compiled-path seem to be fine ... although something definitely seems to be wrong with my installation, i had to manually create the directory /usr/share/guile/site/2.2 , because the REPL was complaining about a missing directory in a similar error ... dsmith-work: benq: Really? Unreliable? Iv'e not seen that. For releases. Takes a LONG time to build, but that's not a reliability thing. ArneBab: benq: I’ve been bitten myself by not having the right GUILE_LOAD_PATH and such ArneBab: when installing Guile from git in ~/.local dsmith-work: pebftab: As usual in these cases, some usage of strace might reveal something. benq: I think the way GIT uses autotools makes sense. It is very focused on the important stuff, not just throwing bloat on the source code base. ArneBab: I never had to fiddle with installing git myself — my distro takes care of that. daviid: pebftab: I recommend you to uninstall (like 'apt-get purge ...' if you're on debian, or what ever purge if other dostro), untill there is no guile installed, then install the latest arch package (iirc you're on arch), the try a repl again ... (and you should _not_ create dir in /usr manually ... ) pebftab: daviid: yep, arch it was benq: just to report this: I had some errors with the extract: tar: copyfile unpack (wisp-0.9.3/examples/-examples-doctests--doctests-extract-from-string--mytest.log) failed: No such file or directory ArneBab: that’s strange. the file should be wisp-0.9.3/examples/._-examples-doctests--doctests-extract-from-string--mytest.log ArneBab: (mind the ._: ._-examples instead of -examples) ArneBab: … and I just saw that it packed up the ._site/ dir which does not belong there … benq: configure: error: benq: No Guile development packages were found benq: I have a sense that this could have something to do with pkg-config. I think that was it in the past.. ArneBab: it needs that, yes benq: FIY: I'm working on macOS sierra. I could try it also on (l)ubuntu ArneBab: ah, macOS … is it possible that you’re not using GNU make but some other make? ArneBab: and that the shell is not bash? mwette: When I `tar xf wisp-0.9.2.tar.gz' I get lots of errors. I think my tar does not like files that begin with `-'. What is that all about anyway? benq: what do you suggest: messing with $PKG_CONFIG_PATH ArneBab: mwette: these are hidden log files which don’t actually need to be included mwette: I am on macOS benq: my shell is fish and bash ArneBab: then the OSX tar has problems with the format mwette: benq: are you using MacPorts or Fink? stis_: yeeha, the list functionality is in place, python lists are now growable vectors and tuples are guile cons lists ArneBab: stis_: nice! ArneBab: benq: you *could* try something along these lines: ./configure PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig/ && make PKG_CONFIG_PATH=$HOME/.local/lib/pkgconfig/ ArneBab: that’s what I’m doing to test against the locally installed wisp ArneBab: s/wisp/Guile/ benq: what do you have in pkgconfig? ArneBab: benq: do you also get these problems under *buntu? If not then the pain you’re feeling might be from departures MacOSX took ArneBab: guile-2.2.pc benq: I'm not 100% sure but I think yes benq: ACTION I have that in benq: ah sorry, I want to say I have that in /usr/local/lib/pkgconfig/guile-2.2.pc benq: It seems like ./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig make the error go away mwette: ArneBab: wisp `make check' is failing on macOS due to no `realpath' ArneBab: benq: great! ArneBab: mwette: do you know what the shell on OSX has instead of realpath? ArneBab: (I should ask autoconf … ) benq: arnebab: do you modify your config or do you mention it in the README ArneBab: I already mention the PKG_CONFIG_PATH in the readme mwette: ArneBab: https://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-osx benq: 'make check' went fine. I would suggest to put a realpath script somewhere under /scripts mwette: MacPorts has realpath -- just installed benq: my Guile is not installed in my home, and I think my guile.pc was at a pretty standard location. mwette: and `make check' works now -- I need to make a Portfile to get it in mwette: Why do you install wisp in share/guile/2.2/language instead of share/guile/site/2.2/language? I suggest the latter. ArneBab: mwette: nice! ArneBab: I’m not sure whether I had problems with site/ or just didn’t know better at the time I wrote it happy_gnu[m]: ACTION is not doing anything interesting :/ ijp: ACTION is writing a classifier, but in python, so ho hum daviid: ACTION needs a classifier 'à la octave' for guile-cv stis_: coding in python and guile atm, compiling python lookalike code to guile scheme daviid: wingo: great work on goops, as usual :). fwiw, I'd make #:metaclass the default. users who want to benefit from static slot allocation would then have to ask for it, like #:metaclass or somethig like that ... mwette: looking at liblinear classifier ; ran into issue w/ my FFI helper, but working to fix daviid: mwette: cool! mwette: I got it to compile. send me an email mwette at gmail.com daviid: mwette: did you upload the code somewhere? have to run, be back in an hour or so daviid: i can send an email of course but if the code is upoaded i clone ... mwette: not in latest release -- gonna be a while for a new release mwette: I'm looking for suckers to try the generated code out. I am having some success though. It seems to be working on cairo. I was planning to send you the linear.scm file and the ffi-helper runtime. mwette: oops email is matt.wette at gmail.com daviid: mwette: I have to look if it would fit my needs (it appears it would, though my initial plan was to talk to the octave team to extract 'classify' from the octane-nan package ... but I admit I have little hope this happens, as it would not be easy, because their code is split in between C++ and octave itself ... none that we can reuse 'as is' using our ffi ...) daviid: then I thought you were actively working to make a good binding, maintained and documented ... a real project I could rely on ... but I understand you did pick this up to test nyacc and ffi-help ... daviid: and I have liited time, but, I'll send an email and try it for you ... the linear.scm is generated no? mwette: I have no wish to support liblinear, but linear.scm is 100% auto-generated from linear.h It can support add-on scheme code (just add to the .ffi file) daviid: so, if I grab a copy of ffi-help I should would generate it and it would be identical to your ? mwette: to run the auto-generator you need the nyacc distribution, because that has the C parser and analysis routines, and ffi-help. To use linear.scm you only need ffi-help-rt.scm, which is the runtime support. Others are using nyacc, for the C parser, via guix. mwette: Here is "linear.ffi" which is the input to the autocoder: daviid: ok, sent ... mwette: (define-ffi-module (ffi linear) mwette: #:include '("linear.h") mwette: #:library '("linear") mwette: ) mwette: daviid: mwette: I'll take the offer not to run the generator then, I'll try your generated binding, thanks (I sent an email ...) daviid: mwette: I'm on debian buster, here liblinear is 2.1.9 daviid: sorry 2.1.0 daviid: will that work? what is the version yo used to generate the binding? mwette: I think mine is linear 2.1.0 as well, but not sure: shows up as "2.01_0" o macports mwette: You will also need bytestructures for the struct support. daviid: ok, I beleive "2.01_0" is a string bug, and I must already have a clone of bytestructures somewhere (never used it though) daviid: * believe mwette: So I can see, looking at train.c, that you need to pass pointers to vars. I'm thinking about the double, but parameter is like this: mwette: (define param (make-struct-parameter)) mwette: (define param-bs (fh-object-val param)) mwette: (bytestructure-set! param-bs 'solver_type 3) mwette: (define prob (make-struct-problem)) mwette: (define prob-bs (fh-object-val prob)) mwette: ... daviid: mwette: if you can put this in the email, right now I'm on something else and would not be able to concentrate 'to be with you' ... mwette: daviid: sent email -- I have issue. not easy to pass pointer-to double right now (but pointer-to struct is OK). I need to gen some macros to be able to declare a double and get it's value after passing it as (pointer-to double-var) daviid: mwette: ok thanks. don't spend too much time on this 'for me', I'm not sure I will use it 'seriously' ... but tx again daviid: mwette: I see they have python and python3 bindings by the authors, may be some ideas to snarf from there ... mwette: daviid: Thanks. I'm not looking to make a custom interface. I may play with it to see if train.c can be converted. daviid: mwette: it's ok, if I go down that route I'll daviid: I would write a 'proper binding' anyway mwette: daviid: got it daviid: but that is uncertain really ... and before anything else I will try to evauate the results I could reach using this lib using their liblinear-tools (command line ...) daviid: liblinear-train and liblinear-predict ... dustyweb: o/ dustyweb: wingo: btw I've thought about it and I agree with daviid and davexunit that the metaclass is a good default, and that "ossifying" should be more done explicitly with GOOPS dustyweb: also! dustyweb: davexunit: I've got a nice canonical-sexp parser, and I built it by studying the ice-9 json stuff dustyweb: thanks again for that work :) cmaloney: ooooo cmaloney: ppppp ArneBab_: seeing a natural language paper fail in the introduction: "As a rule, implementations of recursive functions are slower than those of iterative because recursive functions must allocate memory for their multiple instances." → https://mindmodeling.org/cogsci2012/papers/0340/paper0340.pdf — tail recursion strikes janneke: ArneBab_: for some popular programming languages that may seem pretty true? ArneBab_: janneke: yes, but that does not make it into a good base to discuss general cognition: If Scheme can do tail recursion, why should our brain not be able to? ArneBab_: amz3: lispyscript has a generic solution to add TCO to JS: https://gist.github.com/Gozala/1697037 ArneBab_: amz3: just wrap every function definiton in tco(function(…){…};) and our JS should work in all browsers. ArneBab_: (not yet tested) ArneBab_: ijp: see above ^ (fix missing TCO) ArneBab_: and it’s surreal to see the name Gozala there — the one who wrote the other wisp ☺ ArneBab_: the world of specialist knowledge is a village ArneBab_: ☺ ArneBab_: (other than failing at that rule, the paper seems interesting till now) dustyweb: how expensive is the set-port-encoding! procedure? dustyweb: I currently have read-csexp and write-csexp both call it on every invocation dustyweb: but maybe that's unnecessary, I'm not sure. dustyweb: canonical s-exps library seems to be able to parse ~50k messages per second on this naive implementation on this decade old machine dustyweb: seems pretty good happy_gnu[m]: dustyweb: thats a lot :O ArneBab_: dustyweb: nice! pebcak_: good evening folks pebcak_: on the risk of pissing people here off: Has anybody compiled guile under arch lately ? I'm trying to get some basic examples to work but hitting increasingly difficult to research errors pebcak_: the last one (ERROR: In procedure load-thunk-from-memory: No such file or directory) dissapeared when i mkdir'd the missing /usr/share/guile/site/2.2 directory pebcak_: _now_ i got another one instead (ERROR: In procedure load-thunk-from-memory: incorrectly aligned base) which i can't seem to find anything about ft: pebcak_: Do you have .go files around that were built with guile 2.0 and you're trying to use them with guile 2.2? I think I saw errors like that when I tried that. pebcak_: ft: i don't think so ... i'm quite new to the whole guile thing, so 2.2.2 is the first version i'm experimenting on, but let me check my pacman logs just to be sure ft: pebcak_: If not, I guess people may need a bit more detail. I'm not an expert on the internals by any stretch. You may have to sit tight for a while until an expert's timezone comes up. :) pebcak_: ft: correct me if i'm wrong, the .go files should be in the LOAD_COMPILED_PATH directories ? ft: %load-compiled-path at the guile repl. ft: LOAD_COMPILED_PATH extends that. pebcak_: alright, 2017-04-30 was the date my pacman decided to get me from 2.0.14-1 to 2.2.1-1 pebcak_: ft: alright, thanks for your help, i think i'm gonna go search for some older .go -files, and catch some sleep mwette: I found on macOS (dynamic-link) works but on GNU/Linux (Centos) you need ot do (dynamic-link "libcairo") civodul: heya! civodul: wingo: could you push the Guile 2.2.2 news entry in guile-website.git? :-) mwette: I released nyacc 0.82.1. The FFI helper is working pretty well now. civodul: woow, congrats mwette! mwette: thx dustyweb: ACTION writing a csexp library built to be used as an efficient message serialization format daviid: ACTION is reading the goops patches in master daviid: guile-guest7: iirc guile 1 does not parse the string, so you should be able to write it 'in clear' in the string, try copy paste ... guile-guest7: guile> "↗" "�\\x86�" guile> daviid: guile-guest7: lilypond user? guile-guest7: nope, texmacs user ... I have a scheme function in a plugin wich must "send" unicode character to texmacs document ... not working so far daviid: guile-guest7: and if you send it, even if it displays badly in a guile 1 repl, how does texmac sees it? guile-guest7: as garbage string daviid: try both the #\\x and the 'graphics', not processing the string in guile 1, just 'pass it' ... guile-guest7: doesn't work daviid: guile-guest7: I'm sorry, it worked for me (like 10y ago) between guile-gnome gtk widget (which expect utf8) and guile 1, but I was using I can't think of any valid approach then, of course it works fine using guile 2.2 (it won't using 2.0 either by the way) so the bet is to convince texmacs maintainers to move on ... daviid: oh, I mixed 2 sentences up there :), but the thing is it won't work I guess, sorry, texmac maintainers should move on and use guile-2.2 daviid: texmacs guile-guest7: thanks for your time guile-guest7: is there still online guile 1.x documentation ?? daviid: guile-guest7: it's ok, maybe you can try guile 2.2 (not to interact with texmacs), here is what you get :) daviid: scheme@(guile-user)> "↗" daviid: $9 = "↗" galex-713: Hi galex-713: Do someone know if there is some good introduction to programming that use scheme&guile? davexunit: another guile-emacs discussion https://www.reddit.com/r/emacs/comments/701v90/guile_needs_a_community_elispemacs_needs_a/ davexunit: dustyweb: you wouldn't happen to know anything about the applicable struct stuff in the goops module, would you? davexunit: it's not documented... but it sounds oh so useful dustyweb: davexunit: applicable struct? oh, hm I didn't think I knew that was a thing :) davexunit: I'm taking a stab at a game idea and using goops to model the models davexunit: er, model the object types galex-713_: Do someone know if there is some good introduction to programming that use scheme&guile? daviid: galex-713_: pick any scheme book of your choice, there are quite a lot out there, then experimentimplement the exercises using guile daviid: galex-713_: in // to reading a scheme book dedicated to teaching scheme, read chapter 1, 2, 3 nd 4 of the guile manual daviid: then talk to us :) daviid: * teaching how to program inscheme ... daviid: it is somehow unfortunate that none of us did pick up and made guile-emacs 'happen', then these threads about 'it's a dead technology...' gives a bad impresion to newbies and future generation of schemers guilers ... daviid: the worst of this is that, imo, some of the best hackers in the entire world are amng ud, yet with have all so lilmited resources ... that it all appears the bet hackersare pythonists .. or javsist ... daviid: hum, my dactilo (lack of) skills aren't so good today .. tipo after tipo, my msg becomes funny (at most...) :) wingo: dustyweb: see the docs recently pushed to master wingo: comments welcome wingo: basically, you can define redefinable goops classes -- but only classes that you intend to be redefinable are in fact redefinable wingo: s/classes/trees of classes/ wingo: could be we have the wrong default and should make "define-class" default to redefinable classes, dunno amz3: o/ civodul: (read-disable 'positions) saves ~15% on the build time of gnu/packages/a*.scm civodul: i suspect we're not done with the finalizer issues wingo: civodul: i wouldn't necessarily conclude that it's the fault of finalizers; there is one finalizer to deal with the weak source map table, yes, but i suspect the overhead is also related to memory (source info is persistent through the compiler phases, not accessed weakly) and possibly also related to emitting more debugging information civodul: wingo: hmm maybe, it's hard to tell civodul: wingo: also, what are your thoughts about the algorithmic complexity of intmap/intset lookup? civodul: well, not an easy question either civodul: https://lists.gnu.org/archive/html/guile-devel/2017-09/msg00020.html OrangeShark: Happy Friday wingo: civodul: i am not sure how to answer. i think there is a gc-related problem -- i mean, half the time in gc! and of course it's in those routines that we have allocation, so that's where gc time would show up. i don't know though. wingo: i want to run those tests on master too. i wonder if there is a problem given the two-word displacement of structs on 2.2. probably not but who knows wingo: i think not tho civodul: yeah civodul: it's half the time in GC, but the heap is so big anyway civodul: this is closely related: we retain a lot, so we spend more CPU time on GC civodul: and in turn that makes it harder to interpret the profile civodul: also, GC_DUMP_REGULARLY=1 shows we occasionally have large regions of the heap that are black-listed wingo: orly dustyweb: wingo: wow I didn't realize that @efraim@tooot.im @gargron@mastodon.social > Back to the analogy of 'hey neighbor, can I store my stuff in your garage for free indefinately?' dustyweb: argggghh dustyweb: pastefail dustyweb: I didn't realize that go_to_hell was a procedure in goops.c, funny :P dustyweb: is what I meant to say wingo: :) dustyweb: wingo: ok! I read up dustyweb: I'm ok with that route! dustyweb: I'm also unsure if it's the right default, maybe for goops the opposite structure should be used (redefinable by default) but honestly I think it's not a huge deal davexunit: wait classes can't be redefined by default now? dustyweb: davexunit: see the latest commit in master davexunit: I just did some goops hacking last night where I was re-evaluating my class definition frequently dustyweb: davexunit: you can do it dustyweb: you just need to add a metaclass slot davexunit: having that fail would suuuuuuck dustyweb: so it's more of an explicit decision to live hack davexunit: dislike dustyweb: :) dustyweb: wingo said they were unsure which was the right default dustyweb: so, I guess that's feedback? davexunit: let me be more constructive... dustyweb: I also feel like in general when I'm using GOOPS, a large motivator is the live hacking dustyweb: but I think having the option to turn it off or on is good davexunit: I usually do non-default things when I need to make performance optimizations dustyweb: that's a good way to put it! davexunit: having the default path be the happy live hacking path is what I prefer. dustyweb: make things flexible, then eventually they ossify as things set into place? davexunit: yeah, when needed. dustyweb: +1 davexunit: like usually I have a few core data types that I do crazy things with to make them fast. dustyweb: I agree davexunit: and that usually means not using goops anyway dustyweb: davexunit: btw the other side of this means we're looking to see more of a unification of GOOPS and records ie records also being classes dustyweb: is my understanding dustyweb: without a cost overhead dustyweb: (I think the choice of default isn't a cost there, it's just a decision that needs to be made, but I'm excited about the refactor) davexunit: that is a good thing. guile 2.2 sort of broke some things there. dustyweb: yeah dustyweb: off to shower! bbiab davexunit: so yeah, looks like I like all of that news except the default metaclass thing. davexunit: by chance does any of this work help set us up for optimizations like struct field/goops slot unboxing? dsmith-work: Happy Friday, Guilers!! davexunit: that is probably the biggest pain point for me now. I have a handful of types for linear algebra (2d vectors, 3d vectors, matrices, quaternions, rectangles) that are merely wrappers around bytevectors with a lot of ugly supportingcode. cmaloney: Good morning civodul: we're at ~80 bytes per source property civodul: so if you have a source file with 2M pairs, source properties alone take ~152MiB civodul: (i think it was the same order of magnitude in 2.0 and earlier) amz3: http://www.nbu.gov.sk/skcsirt-sa-20170909-pypi/ janneke: amz3: are you a guix user? manumanumanu: Ahoy fellow guilers! stis_: tjeena manumanumanu manumanumanu: tjabba stis_ ! happy_gnu[m]: I have this error happy_gnu[m]: updating list of substitutes from 'https://berlin.guixsd.org'... 100.0%guix substitute: error: 'https://berlin.guixsd.org/nar/gzip/3a7fyczcvfdzxglayl5n0bbp0jl65wh8-module-import' is signed with an unauthorized key mwette: Hi all. Is it possible to capture a Guile keyword (e.g., #:foo) as syntax in a syntax-rules pattern (e.g., syntax-rules (#:foo) ...) ArneBab_: mwette: it’s possible that you might need syntax-case for that, because you want to break hygiene ArneBab_: you could also just defer that to a helper function which gets the argument list. ArneBab_: s/function/proc/ mwette: ArneBab_: Thanks. I am using syntax-case with fenders for now. mwette: It seems the syntax for define-module quotes the expressions that occur after keywords. I want to use an expanded form of that but I think I need unquoted expressions after keywords, in order to deal with system dependencies. I need to look closer at the syntax for define-module manumanumanu: mwette: yes it is manumanumanu: but you should not include the #: in the literals ... part manumanumanu: so (syntax-case (foo) [(_ #:foo) manumanumanu: mwette: hope i'm not too late :) manumanumanu: wohoo, a question I could answer manumanumanu: good night manumanumanu: and I think it might work with syntax-rules, since matching keywords is not breaking hygiene manumanumanu: Good morning guilers! wingo: i removed the indirection in structs, yay wingo: can proceed to instruction explosion i think amz3: o/ amz3: I stumbled upon a difficult bug while coding 2048 in guile js civodul: wingo: indirection in structs? wingo: civodul: that whole mess that was in struct.h wingo: that structs pointed to their vtables' data, that their data was indirected through a pointer in word 1, etc civodul: oh right! wingo: before: [ vtable data pointer + struct tc3 | data pointer initially pointing to slot 0 | initial slot 0 | slot 1 | ... ] wingo: now [ vtable pointer + struct tc3 | slot 0 | slot 1 ... ] civodul: yeah struct.h in stable-2.2 has a nice diagram civodul: the 2nd version looks much nicer :-) wingo: :) wingo: i was thinking also, probably we can just reserve goops slots in all vtables, so that all vtables can be classes wingo: already when you make vtables there's a hook call into goops (if it's loaded, otherwise the vtable is put on a queue for processing in case goops is loaded) wingo: dunno, a thought for later wingo: for now i just wanted to make it so that struct-ref / struct-vtable could be open-coded efficiently to low level assembly civodul: i'm not clear on what's needed from structs to support GOOPS civodul: class redefinition is complex civodul: heh, i see :-) wingo: well, we used that redirection trick to allow for class redefinition -- redefinition in general can chagne the number of slots in an object wingo: so we used that indirection to allow an old instance to point to new slots, if needed. wingo: but it was too expensive i think. so instead i lifted that indirection into goops, and into only a subset of goops classes wingo: the down-side (but also partly an up-side) is that now only a subset of goops classes can be redefined and have their instances migrate automagically wingo: to that i say, "oh well" :) civodul: ok civodul: might be frustrating to those who want to have fun with the MOP though civodul: (that's how i got into Guile :-)) blancmange: hello, does anybody know how to overcome the issue with TLS and HTTP headers with incorrect dates causing requests to fail? blancmange: e.g. (http-get "https://google.com/") OrangeShark: post about guile on emacs subreddit https://www.reddit.com/r/emacs/comments/701v90/guile_needs_a_community_elispemacs_needs_a/ dsmith-work: Thursday Greetings, Guilers manumanumanu: good afternoon! manumanumanu: OrangeShark: hmmm... I am not sure what I think. I would love to be able to extend emacs in guile scheme, but a new editor? manumanumanu: not really: I am pretty sure what I think: it ill never work. manumanumanu: A new editor would not be similar to emacs. You would probably use something like a rope, and even though most things could be abstracted away, making a port easy from emacs is probably too hard. manumanumanu: I have though thought about at taking arximboldi's ewig editor and build something proper using it :) OrangeShark: manumanumanu: seems the OP wants a modern lisp environment rather than just an editor. amz3`: o/ manumanumanu: ahoy! amz3`: ah! amz3`: I think I found the nasty bug I have amz3`: yep that's it, it was my totaly my fault amz3`: now I can continue on the road to 2048 amz3`: (I won't finish the game just show that it's doable) amz3`: (no animations also) amz3`: (gaming doesn't pay the bills) amz3`: (at least not 2048 games) ecraven: is there a high-level socket library? something that opens a tcp listener on some port, then gives me a normal Scheme i/o port for communication? amz3`: normal Scheme i/o port? amz3`: what you describe looks like read/write over socket ecraven: amz3`: yes, something like (let ((x (tcp-listen 123))) (read (tcp-accept x))) amz3`: AFAIK you don't need a higher level abstraction on top of read/write and socket ports amz3`: that said, read and write IIRC is not guaranteed to be safe ecraven: hm.. I'd need read-bytevector (or read-string) and the same for writing amz3`: I am not sure I understand what you need, i let others chime in ecraven: well, I want to open a socket, and then read/write bytevectors or strings from/to it amz3`: you want a port where what you read from it are scheme values that can be any scheme primitive datatypes? amz3`: when you write a scheme value to the port it does serialize it for you and on the other end of the port it's deserialized automatically to the correct datatype? ecraven: amz3`: no, I just want to write/read bytes to the network ecraven: sorry for not making that clear amz3`: ah ok ecraven: but I don't want a specific sendto / rcvfrom, but just use general read/write bytes procedures amz3`: I think people use get-u8 and put-u8 to do that ecraven: yea, but what do I use to actually open the socket port? amz3`: I think there is an example of that in guile-websocket amz3`: https://git.dthompson.us/guile-websocket.git/blob_plain/HEAD:/web/socket/server.scm amz3`: look at make-server-socket ecraven: great, thank you! ecraven: that looks exactly like what I wanted ;) amz3`: there is an example for doing the client, client.scm amz3`: cool dustyweb: i was thinking also, probably we can just reserve goops slots in all vtables, so that all vtables can be classes dustyweb: the down-side (but also partly an up-side) is that now only a subset of goops classes can be redefined and have their instances migrate automagically dustyweb: wingo: I think we talked about this not so long ago dustyweb: I think having more unity between GOOPS and records-as-classes is a good idea, though we shouldn't drop the ability to redefine classes in GOOPS. Though I think when we talked about it last time I raised that I'd be willing to keep a cost penalty in GOOPS, even have it be slightly more costly if that meant that redefinition was possible but expensive and GOOPS / records share the same underlying structure reed_: Hi all. I am trying to make a very basic multi-file project. I am having trouble defining my own module. I am getting an error that says 'no code for module (foo)' reed_: I have read through the documentation on creating and using modules, but I'm not quite sure what is happening. I think I need to tell scheme where to look for foo.scm? daviid: reed_: in the manual, see this section 6.18.7 Load Paths reed_: daviid: Thank you, that helped a lot! guile-guest7: how to write literal unicode caracter in guile 1 ? daviid: guile 1? guile-guest7: (string #\\x8599) does not work guile-guest7: yes guile 1.xx guile-guest7: (not guile 2.x) felipebalbi: any chance we can get a letcc helper on guile mainline? It's simpler to write: (letcc foo ... then (call-with-current-continuation (lambda foo ... felipebalbi: I have never done any define-syntax-rule before, but I *think* this is enough felipebalbi: (define-syntax-rule (letcc hop e ...) felipebalbi: (call/cc felipebalbi: (lambda (hop) felipebalbi: (begin e ...)))) felipebalbi: https://gist.github.com/anonymous/03fe9dee8fb7ed01a253afafaa354030 wingo: if the only thing you need is an early return, consider let/ec from (ice-9 control) wingo: your definition is good, but the begin is unnecessary; you can just do (lambda (k) e ...) felipebalbi: wingo: thanks :-) having letcc just helps following "The Seasoned Schemer", really :-p wingo: part of the fun in scheme is building up your own language, often with macros :) one of the corrolaries is that we can't provide the superset of all languages wingo: in this specific case we'd probably name it let/cc which wouldn't be of use to you felipebalbi: wingo: fair enough :-) felipebalbi: I'll keep this locally then ;-) wingo: :) felipebalbi: I must say, after so many years of C, Scheme is a lot of fun :-) wingo: :) felipebalbi: wingo: btw, what is guile missing for full r6rs compliance? Is there any wiki page of some sorts tracking that? If possible, I'd like to help out. wingo: i believe https://www.gnu.org/software/guile/manual/html_node/R6RS-Incompatibilities.html is the summary wingo: if you find an incompatibility tho, patches to fix it are welcome :) wingo: mail them to bug-guile@gnu.org felipebalbi: wingo: I guess a better idea would be to implement some test cases for r6rs-defined functions? wingo: there are also a number of open bugs about r6rs felipebalbi: wingo: at least list-sort and vector sort are missing, for instance wingo: they are certainly there; you have to write an r6rs program to use them (with proper import statements etc) wingo: i.e. list-sort is in the (rnrs sorting) r6rs library wingo: so do (import (rnrs sorting)) to get it felipebalbi: oh, indeed. I must have forgotten to import (rnrs sorting) when I tested this cmaloney: morning manumanumanu: Good afternoon guilers! manumanumanu: I am very happy today. I got arximboldi's immer bindings for guile to work. Truly impressive stuff manumanumanu: I don't know what to do with it yet, but those data structures is the only thing I miss from clojure civodul: manumanumanu: i looks nice indeed! civodul: you should make a Guix package for it ;-) manumanumanu: civodul: Haven't got guix up and running yet... that will be the next project manumanumanu: they are a bit of a pain to install, and guix would simplify that a lot... manumanumanu: and they really are very very fast. amz3`: nice dustyweb: ACTION sighs dustyweb: civodul: do you know what format import-x509-certificate expects? dustyweb: I figured I could do dustyweb: (import-x509-certificate (string->utf8 "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB") x509-certificate-format/pem) dustyweb: but I getr dustyweb: ERROR: Throw to key `gnutls-error' with args `(# import-x509-certificate)'. civodul: dustyweb: there's a couple of examples in GnuTLS, under guile/tests civodul: the thing should start with "-----BEGIN CERTIFICATE-----" civodul: followed by a series of base64 lines, followed by "-----END CERTIFICATE-----" amz3`: for some reason the x509-certificate.pem has two certificate in it amz3`: I am talking bout gnutls tests too dustyweb: civodul: hm ok, will look dustyweb: civodul: seems like there's a distressingly large number of pem-like formats! amz3`: yep dustyweb: industria has pkcs#1 but not pkcs#8 dustyweb: D: manumanumanu: why are the alist procedures named with a ! ?? They don't mutate amz3`: manumanumanu: what alist procedure has a ! ?? dustyweb: manumanumanu: they shouldn't have a ! if they don't mutate.. manumanumanu: try it yourself manumanumanu: assoc-set manumanumanu: ! manumanumanu: returns a new list manumanumanu: does not modify the original manumanumanu: at least not in the repl manumanumanu: ah, the manual talks about it amz3`: on my side, it mutated the original amz3`: scheme@(guile-user)> (define a (acons 'a 'b '())) amz3`: scheme@(guile-user)> a amz3`: $1 = ((a . b)) amz3`: scheme@(guile-user)> (assoc-set! a 'a 'c) amz3`: $2 = ((a . c)) amz3`: scheme@(guile-user)> a amz3`: $3 = ((a . c)) dustyweb: yeah it mutates here too manumanumanu: the manual talks about it. if the "key" is not present, it conses it to the beginning of the alist, and then the symbol pointing to the alist won't reflect that change manumanumanu: doing (define a (acons 1 2 '()) and then (assoc-set! a 2 3) won't modify a manumanumanu: I should RTFM before whining in the IRC channel. amz3`: :) manumanumanu: but TIL about assoc pitfalls amz3`: fwiw I had only bad luck using set-car! and set-cdr! amz3`: I did not try too hard tho manumanumanu: we should have an assoc-set amz3`: manumanumanu: that is alist-delete from srfi-1 amz3`: manumanumanu: look at this https://gitlab.com/amirouche/guile/blob/compile-to-js-2017/forward.scm#L52 amz3`: that's helpers I wrote to work with alists amz3`: they work with 'equal?' amz3`: in guile you would do differently but in pure scheme that's what it looks like amz3`: also there is a set* dustyweb: ah dustyweb: I see why I was having troubles dustyweb: civodul: apparently the key format was in SubjectPublicKeyInfo format which I think is supported by gnutls but there's no guile bindings to import it maybe dustyweb: @_@ dustyweb: oh! dustyweb: maybe it's new... dustyweb: whoa manumanumanu: amz3`: whoa! "pure" alists are sloooow dustyweb: http://nmav.gnutls.org/2017/08/gnutls-3-6-0.html dustyweb: > OpenPGP functionality was removed dustyweb: > When I originally started working on GnuTLS I was envisioning a future where OpenPGP certificates will be used instead of X.509. My driver was the perceived simplicity of OpenPGP certificate format, and the fact that obtaining a certificate at the time required the intervention of costly CA, in contrast with OpenPGP where one had to generate a key and manage its web of trust. That never took off as a deployment nor idea, and today dustyweb: none of the original driving factors are valid. OpenPGP certificates are not significantly simpler to parse than X.509, the web-of-trust proved to be a more difficult problem than Internet PKI, and the costly CAs verification issue is no longer relevant after letsencrypt.org. amz3`: manumanumanu: for better or worse, I did no benchmarks, it works good enough project manumanumanu: amz3`: I didn't use those, but what I threw together works the same dsmith-work: Wednesday Greetings, Guilers manumanumanu: oh yes! wednesday greetings! amz3`: dsmith-work: tx for bringing back sneek :) dsmith-work: amz3`: Sorry for my inattention. dsmith-work: When we lose power, it doesn't seem to come up as automatically as it used to. civodul: dustyweb: OpenPGP certs is also one of the things that drove me to GnuTLS back in the day dustyweb: civodul: support for them? or frustration with them? civodul: support for them civodul: i was convinced by nmav's motivation dustyweb: ACTION nods dustyweb: btw, as an aside dustyweb: dammmmmmmmmn the world of encoding keys is hella complex dustyweb: I was like, how hard could this be, it's just base64 encoded text right dustyweb: O_O dustyweb: I had no idea. dustyweb: makes me also feel even stronger empathy for rivest's canonical s-exps civodul: definitely! civodul: canonical sexps are great stis_: yeah, I think I got my python loop macro to work. No you can use python generators in your loop and not litter the copde with set! which was the target stis_: e.g. if you loop inside scheme that is mwette: di roelj: I get a "ERROR: Wrong type (expecting exact integer): #\\a", even though the C function that handles this uses scm_to_char (...), and not scm_to_int32_t (...). roelj: What's up with that? stratotanker: solved using rnrs bytevectors janneke: b manumanumanu: Morning guilers! pmikkelsen: morning manumanumanu! manumanumanu: What are you all working on? amz3: guile js :) amz3: manumanumanu: and you? manumanumanu: Nothing in particular. Learning common lisp and porting whatever I like from it to guile pmikkelsen: I am woring on writing a meson-build-system for guix, so we can hopefully get the latest gnome when/if they switch ;) amz3: I shoud also work on ffi helper amz3: (at the present time I am at work, and I don't work on guile ;) manumanumanu: I am not a very good programmer (classical musician by profession), and I feel a bit sad I can't really contribute to most oss projects. The guile for-loops I wrote are about as complex as I can write manumanumanu: (but I am proud of those. they work very well, and produce optimal code in most cases) pmikkelsen: manumanumanu: I am confident you can contribute to guix if you want to, but if you don't use it, maybe it is not so fun ;) pmikkelsen: The guix team is very helpfull amz3: manumanumanu: fwiw I am programmer by trade and I don't feel like I am up to the task of writing for-loops amz3: manumanumanu: you have imposter syndrom ;) amz3: like me gour: morning gour: is it reasonable tp expect that one could use guile for configuring emacs in the foreseeable future or am i better learning some elisp as well? otoh, my interest for guile is to use it with gnucash as well as to possibly migrate to guixsd (from fedora) if i manage to find compatible hw not requiring special firmware pmikkelsen: Last time i used that guile emacs, it was not very fast, but it may have had something to do with how it was build. Although I can highly recommend learning guile for guixsd, and even just for guix on fedora :) gour: pmikkelsen: yeah, guix on fedora might be a good step into right direction gour: as far as guixsd, wifi drivers are probably the only/main obstacle since i anyway have/use old ati cards with floss drivers pmikkelsen: gour: yeah wifi.. I was really lucky that my system had hardware that just worked out of the box, wifi and all ;) civodul: hey wingo wingo: heya~! civodul: wingo: i just emailed you with more data re compiler profiling :-) wingo: oh good :) civodul: i'll be away for several hours, but i'd be happy to read your thoughts! wingo: i will look at it as soon as i can! :) civodul: awesome :-) wingo: ACTION was hacking on removing the indirection in structs this morning wingo: but to do that, class redefinition needs to be reimplemented; so i made it so that class redefinition is a layer on top of "fixed" classes wingo: which is a relief in many ways, as redefining itself is terrifying wingo: so after this change, we still have redefinable classes, but only some classes are redefinable wingo: and the new thing is that after the change, we can have proper goops classes for fixed structs without the indirection wingo: and then structs remove their indirection and weird GC interaction, and then "instruction explosion" can do a good job for structs wingo: ACTION has been agonizing over this for months :P ecraven: wingo: say I wanted to add the simple parts of r7rs to guile (boolean=?, string-for-each, let*-values, such things). where would I start? is there a file where r7rs compatibility code should live? ecraven: exact / inexact for inexact->exact and exact->inexact would be simple too, for example wingo: i do not know :) would require more thought than i have at the moment. some things like exact->inexact should probably just be renamed in the root env. some things like let*-values are already part of a srfi. you can obviously define a module that exports precisely the r7rs interface... wingo: but what the overall guile/r7rs story looks like, i don't know. other people have thought more about this than me. wingo: i suspect that we need a command-line arg for --r6rs or --r7rs, something like that, where guile will have r7rs small support built in probably wingo: via some module wingo: and --r7rs will expose that module wingo: in the default env wingo: but for the large modules i expect most to remain as 3rd party libraries as they are just libraries wingo: but that is just an ignorant thought :) ecraven: wingo: it might be "good enough" for starters to at least have the correct names in the initial environment? ecraven: especially for existing things that were just renamed in r7rs wingo: "correct" :) ecraven: wingo: yea, not thinking about r7rs-large yet ;) wingo: i think we probably will not expose string-for-each in the default env, for example wingo: but with --r7rs we would arrange for that to be the case ecraven: so the way to go would be to create something like an r7rs-compat module, that re-exports existing functions under the right names? wingo: yes i think that's the right way to go, yes wingo: we can always integrate more tightly with time if that becomes a good idea wingo: hard to remove added interfaces though! ecraven: my interest is mainly poking all Schemes until there is at least *some* way to get an r7rs-small environment ;) ecraven: I'm not saying guile should move to r7rs entirely, but it would be nice to have some way to get at least r7rs-small (which [apart from import] shouldn't be too hard, as everything is probably there already, just not under the right bindings) ecraven: is there some place in ~ where I can put guile modules so that guile will find them? gour: how might guile compare performance-wise with the racket? it's not present in language-shootout (http://benchmarksgame.alioth.debian.org/) although i'm aware it might not be close to the real-world... ecraven: gour: take it with a grain of salt, but there's https://ecraven.github.io/r7rs-benchmarks/ gour: ecraven: thanks a lot! it seems there is no lack of scheme implementations. ;) noreover, it's interesting to see that chez is very quick and racket dpes plan to depend on it in the future... ecraven: gour: just remember that there are many things you *don't* see in those benchmarks gour: ecraven: yeah, benchmarks are always tricky...just wonder is it difficult to switch 'context' if one wants to use different implementations of scheme like guile/racket...? ecraven: depends on what programs you write, but for anything even remotely complicated, you will have to use implementation-specific code, and that makes things much harder to port ecraven: r7rs-large is trying to change this (very sloooowly ;) gour: does r7rs includes racket as well or is it too different? gour: *include ecraven: racket has a compatibility mode (which isn't perfect yet) ecraven: I think the only implementation that is entirely r7rs is chibi gour: that's interesting ecraven: https://ecraven.github.io/r7rs-coverage/ is a start at looking at compatibility ecraven: cyclone is looking very good too ecraven: kawa too ;) gour: what would be some scheme implementation suitable as kind-of python replacement for writing tiny scrpts and/or cli utilities? ecraven: most of the larger ones are suitable for that ;) gour: cool ecraven: gour: my suggestion would be, start with one (guile isn't a bad choice here), look how you like it ecraven: if you find features you need, but which guile doesn't have, either implement them yourself, or look at other implementations ecraven: but guile has tons of libraries, you'll find most of what you need pre-made gour: ok, learning guile would pay of for gnucash reports as well... ecraven: and guixsd, and many other projects ecraven: if you learn one Scheme, it will help you with all others, just the libraries are different gour: guile's gui is still gtk2? any plan for gtk3 support? ecraven: what's your favorite editor? gour: ecraven: but Elisp is a bit different ecraven: if you know emacs, you should look into geiser ecraven: yes, elisp is not Scheme gour: starter with the Emacs...using for general writing, orgmode... ecraven: geiser has support for guile, https://github.com/jaor/geiser ecraven: M-x list-packages gour: that's why i did originally asked about Emacs & using Guile for it :-) gour: let me use-package for geiser... ecraven: M-x run-geiser RET guile RET gour: very nice gour: i know that racket has its own multi-platform library...but wonder any other scheme could be suitable for writing multi-platform (although linux is my native platform) desktop app (i hate JS and browser apps) with good support to bind 3rd party C libs? ecraven: again, most of the larger ones have some sort of bindings to GTK or QT or so ecraven: and most have a decent FFI gour: i'm excuse for being ignorant, but i'm aware only of racket's gui. :-( gour: *i excuse myself ecraven: gour: well, it depends on what you want to do. what kind of application do you want to write? gour: ecraven: 'typical' desktop app, using 4rd party lib to speed up some computations, having sqlite3 as storage back-end... gour: ACTION is reading http://www.phyast.pitt.edu/~micheles/scheme/index.html manumanu1: amz3: haha, like in all other parts of my life. But anyway, the for-loops are easier than hey look. You can get 98% of racket's functionality with a quarter of the code. manumanumanu: are there any non-slow way of comparing symbols/keywords < > = ? manumanumanu: how are they represented internally? Is converting to and from strings expensive? civodul: manumanumanu: symbols and keywords are "interned", meaning you can compare them with 'eq?' civodul: and 'eq?' is pointer comparison (very cheap) manumanumanu: civodul: the thing is, I have been using them as keys in an assoc, and I need to sort them :) My option seems to be to convert them to strings, but that seems rather expensive civodul: oh right, use strings in this case manumanumanu: thanks civodul: quizz: which of the following options consumes less memory? civodul: the string "(a b c d e)" civodul: the list '(a b c d e) civodul: the list '("a" "b" "c" "d" "e") cmaloney: trick question? happy_gnu[m]: The first string civodul? civodul: probably the first string, followed by the 2nd list, followed by the 1st list civodul: this one is a simple example, but i was wondering about this in the context of a big CPS dump cmaloney: Wouldn't the list of symbols be using different memory? civodul: (as in "guild compile --to=cps") civodul: cmaloney: symbols are interned, so the amount of memory used depends on the frequency of occurrence of these symbols cmaloney: right amz3`: o/ stis_: hey guilers! manumanumanu: hey stis_ happy_gnu[m]: \\o/ manumanumanu: stis_: what are you up to? stis_: analyzing python constructs and what it means for scheme, also a python->scheme compiler stis_: for example an object system that i similar to python and how to make a similar exception mechansims as in python using goops stis_: I've also hacked guile to autocompile python files, in discussion to get it into mainline stis_: e.g. not python but the nessesary code stubs that must be included in guile in order to get autocompilation of multiple different langugages working stis_: manumanumanu: and you? manumanumanu: stis_: ported a piece of common lisp code for working with ID3 and Vorbis tags stis_: coolio manumanumanu: factoring some stuff out into libraries manumanumanu: the whole tagging part is still too wonky, but there are some stuff I can see myself reuse manumanumanu: BTW: why do we use alists instead of plists? stis_: really don't know, but I think that plists is used in the guile compiler though as a list of directives dustyweb: manumanumanu: https://www.reddit.com/r/lisp/comments/2wancz/why_property_lists/cop33cs/ dustyweb: tl;dr "there's no fundamental difference between them, just convention, but plists tend to be mutated while alists don't" manumanumanu: dustyweb: hmmm. thanks.using plists with apply works in guile as well. cmaloney: ACTION feels like he's slacking stis_: listening to music and writing about functional programming for my relatives on facebook (I live in another city) stis_: it's cool to try to write with words so that even my mother understands. manumanumanu: I can't even get my .net-programming friend to understand what macros are. Probably my fault :( stis_: I think that macros are more difficult to explain in order to show it's uses, generally it just means that your language can be tiny and that your programming experience can be infinitely rich. stis_: the drawback is that people have a hard time seeing what the macros does from source code in case they are complex and under documented and you end up having hard time understanding the code stis_: but using advanced functions abstractions also have this problem so donugh, when you don't want the applicativiness of a fucntion or bind variables it's a must else functins usually is fine stis_: My focus on functional was the ability to frreeze instruction and pass it to a rotine that can execute it at the right places e.g. higher order programming and show why python is not especially functional because the yield statement is local to the function frame, and non tail calls means that you cant make some abstarctions with functions stis_: actually I added the ability to place a yield in another frame inmy compiler and also the functions are the proper scheme tail call ones manumanumanu: stis_: I managed to explain them by example, to which he replied "we do that wih templates". At least until I showed him the for loops :D :D manumanumanu: Now, good night stis_: night! manumanumanu: dustyweb: hmmm. the alist stuff in scheme very much lends itself to mutation, and not in a very pretty way. manumanumanu: whereas, writing your own persistent alist/plist is pretty simple dustyweb: manumanumanu: I mean, any of these things can be mutated. dustyweb: if you have mutable cons cells dustyweb: you *can* mutate manumanumanu: of course, but the way to work with alists lends itself much better to a mutable way manumanumanu: even the docs use set! dustyweb: manumanumanu: ok manumanumanu: it doesn't matter though. dustyweb: manumanumanu: like I said, it's convention, if anything, and the convention is not as strong in scheme land because mutation is somewhat more frowned upon here than in common lisp dustyweb: but that, too, is convention of the community, since nothing in scheme stops you from mutating like crazy. (at least we have the ! suffix though) dustyweb: (! is also convention !) radial: i just tried to compile guile freshly cloned from git://git.sv.gnu.org/guile.git and after "./autogen.sh ; ./configure ; make" i got a "/usr/lib32/libltdl.so: error adding symbols: File in wrong format" error radial: full log here: https://paste.pound-python.org/show/rtKElWxcg0F7dlU5QbG1/ radial: btw, i'm not sure why guils is looking in /usr/lib32 as i'm on a 64-bit system radial: gentoo amd64 amz3: o/ amz3: sorry radial I don't know what might cause the issue amz3: radial: did you try to install guile coming from gentoo? does it work? amz3: s/from/with/ amz3: radial: did you install 32bit compatibility libs? I think it's called multiarch in gentoo? radial: amz3: i have an old version of guile that i installed through gentoo's package manager (portage): guile 1.8.8 radial: the newest guile in portage is 2.0.14, and it's marked unstable, and i haven't tried installing it amz3: radial: what are you trying to achieve? you want to fiddle with the bleeding edge guile git or just use a recent guile? radial: also gentoo often has its own patches to make packages work with gentoo radial: and i do have some compaitibility libraries installed for gentoo (something like multiarch, i think) radial: my goal is to run guile emacs radial: i've heard that guile 2.2 is required for that amz3: radial: the best way to try guile-emacs is via guix radial: i don't have guix installed yet radial: last time i tried (which i admit was some years ago), i had all sorts of problems, sadly radial: i intend to give it another chance, though gour: morning gour: i'd like to be able to write custom reports within Gnucash and wonder whether Guile ref. manual is enough and/or recommended docs? i've played a bit with Racket, but, otherwise, no Lisp/Scheme experience (although I plan to learn some Elisp) manumanumanu: Good day! catonano_: manumanumanu: hello :-) amz3: boo amz3: guile-js output can not go through google-closure-compiler amz3: catonano_: o/ catonano_: amz3: if you see what Hoplon is doing in order to have common js libs available you ll be surprised catonano_: AND you could reuse some of their work :-) amz3: I will have a look, tx! cmaloney: morning manumanumanu: cmaloney: good afternoon! cmaloney: LMK how the day is over there so I can get ready for the afternoon that is to come. ;) manumanumanu: cmaloney: rainy. wife and kids in another part of the country, so today is programming day dsmith-work: Monday Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) dsmith-work: goodbot manumanumanu: dsmith-work: good day! amz3`: o/ amz3`: what will be fun demo to have for guile js? amz3`: something that I did not try already with biwascheme is preferable jlicht: amz3`: what are the constraints on guile js? Can you use all/most of guile and pure-guile libraries? amz3`: I can use pure guile libraries amz3`: I can use ajax, but I'd rather not, I prefer something without backend manumanumanu: what would be the best way to serialize scheme records? jlicht: amz3`: ah, you mean the guile -> JS transpiler? Not the JS implementation on the guile vm? jlicht: in that case it would be cool to see some game programming in guile. janneke: manumanumanu: write and read as sexps, guix has a nice set of macros to read records from sexps manumanumanu: janneke: hmmm. might as well just use p-lists amz3`: jlicht: that is a good idea, I look how to make games in the browser cmaloney: amz3`: Create a react-style framework for Guile JS. :) cmaloney: Done yet? amz3`: yes cmaloney: ACTION rejoices! amz3`: =) amz3`: I need add unittests and documentation amz3`: (and it doesn't use reactjs itself but a spinoff called snabbdom.js) amz3`: (so no issues with licensing) cmaloney: I had not heard of this amz3`: I did not publish anything about it on guile ml because it was using biwascheme cmaloney: Is it ready to use with guile js? amz3`: I guess, I did not test it on big-ish projects yet amz3`: it works on a simple 'counter' app amz3`: counter app, is a button which increments a integer and displays it... most basic app you can find cmaloney: Right, Elm has a tutorial of that janneke: could it be that guile-git does not grok http urls? -- having many troubles with cuirass amz3`: idk jcowan: Is anyone currently working on either Guile Emacs or R7RS in Guile? civodul: hey jcowan civodul: jcowan: i think the answer is "no" to both questions jcowan: Bummer. ft: I think there's an r7 branch, that mark weaver worked on. civodul: though Guile 2.2 does have some r7 support civodul: right ft: Don't know what the actualy status of that is. jcowan: Is there any list of r7rs features in 2.2? ft: Maybe on that branch. I don't know. civodul: maybe civodul: apart from that 2.2 mostly supports the syntactic extensions of r7 civodul: #false, SRFI-46, things like that ecraven: civodul: things like inexact seem to be missing ecraven: (which should really be trivial to support ;) ecraven: boolean=? jcowan: The biggest single item is R7RS libraries jcowan: they can be transformed into R6RS libraries with some effort civodul: i think mark_weaver gave it some thought civodul: and perhaps code, like ft wrote stratotanker: Hello! someone have idea on how to foreign this function (ped_unit_parse) with guile: https://www.gnu.org/software/parted/api/group__PedUnit.html#g4fe5596503ae165739dfcc59ebd0fdcb amz3`: (I think if figured why elm does things like it does) stratotanker: In general, I don't know how to foreign a pointer to pointer happy_gnu[m]: dustyweb: are you here? dustyweb: happy_gnu[m]: I'm here happy_gnu[m]: Hi :) you did the land of lisp right? dustyweb: happy_gnu[m]: most of it... happy_gnu[m]: I have a question maybe you can help me dustyweb: I didn't type in all the examples but I read most of it ;) dustyweb: I did read all the comics! ;) happy_gnu[m]: Apparently the code is outdated for the server happy_gnu[m]: So it won't load it on firefox happy_gnu[m]: Instead it shows the plain dustyweb: oh, for the board game? happy_gnu[m]:
happy_gnu[m]: There is one before happy_gnu[m]: But yeah I read that won't work either happy_gnu[m]: So I think I need to put this dustyweb: happy_gnu[m]: do I remember that you write your own html templating language in that? dustyweb: happy_gnu[m]: if that's actually what it's outputting, your code must not be rendering elements? because that looks pretty sparse happy_gnu[m]: HTTP/1.1 200 OK dustyweb: 200 OK is ok :) happy_gnu[m]: So Firefox will render happy_gnu[m]: But I am not sure how to write the code happy_gnu[m]: "HTTP/1.1 200 OK
" dustyweb: happy_gnu[m]: sounds like what you should try to do is not render the whole application, but play with trying to get smaller bits of html to spit out dustyweb: happy_gnu[m]: this sounds like an opportunity for a REPL debugging session ;) happy_gnu[m]: Repl is working and server is working dustyweb: great! then you should try to render little html snippets at the repl happy_gnu[m]: Is just Firefox doesn't render it just shows plain text and I don't know how the HTTP/1.1 200 OK happy_gnu[m]: Works :/ dustyweb: 200 OK is fine dustyweb: don't worry about that dustyweb: it's just an http response saying that things are not broken dustyweb: and "here's your document" happy_gnu[m]: Ah what I mean is that the example needs this 200 to work but I don't know where to put it happy_gnu[m]: Before the ? Does it need tags? dustyweb: oh I see, it just relies on the extreme forgivingness of web browsers in this dustyweb: doesn't even mention how to do a proper response really... happy_gnu[m]: Yes :/ but Firefox doesn't work anymore so I went to the forum and there someone had a similar problem and they said to add the 200 OK and a blank line dustyweb: happy_gnu[m]: scroll down to HTTP Protocol on https://www.ntu.edu.sg/home/ehchua/programming/webprogramming/HTTP_Basics.html and you'll see an example happy_gnu[m]: dustyweb: great thanks :) dustyweb: "HTTP/1.1 200 OK" goes on its own line, as do all the other headers. In general, you should end the lines with "\\r\\n" though many browsers let you get away with just "\\n" dustyweb: happy_gnu[m]: probably also want Content-Type, and maybe even Content-Length (I don't know if it'll let you get away without that one) dustyweb: but there you go, it's an example dustyweb: good luck / happy hacking! happy_gnu[m]: dustyweb: thanks :) sorry for bothering you, I didn't know who else to ask dustyweb: happy_gnu[m]: np! btw you may also want to join #lisp and #scheme happy_gnu[m]: Yes you are right dustyweb :) happy_gnu[m]: dustyweb: do you have any book suggestion for that type of web/server stuff? Ober: for guile? happy_gnu[m]: dustyweb: it works :D happy_gnu[m]: Thank you so much :) dustyweb: happy_gnu[m]: I don't have a book suggestion; Mozilla Dev Network is great though happy_gnu[m]: dustyweb: OK I will try to learn there :) happy_gnu[m]: Have a good night dustyweb dustyweb: gnite happy_gnu[m] happy_gnu[m]: :) amz3`: o/ amz3`: does anyone have pure implementation of 'read' and 'write'? amz3`: pure scheme janneke: amz3`: mes has most of it's read and write in scheme... janneke: *its amz3`: it's something that is also needed by guile fiber IIRC amz3`: oh ok amz3`: nice I will have a look at it amz3`: janneke: where can I find the source? janneke: ...but that's not (directly) usable with Guile, of course janneke: here's read: https://gitlab.com/janneke/mes/blob/master/module/mes/display.mes janneke: eh, write :-) janneke: and read: https://gitlab.com/janneke/mes/blob/master/module/mes/read-0.mes cmaloney: (tzag) amz3`: catonano: what's up? amz3`: long time... janneke: mwette: congrats on the release! amz3`: mwette: ! mwette: janneke: thanks very much mwette: amz3`: thanks again janneke: mwette: your 0.81.0 prompted me to see if I could prepare a new Mes release, really happy with your progres! stis_: tja guilers! stis_: sorry folks for working with a python to scheme compiler, but it's fun and it makes me appriciate scheme the more stis_: tonight I will hack in try except I think. stis_: if only I could use guile at work, we want to standardize on a functional language on an open platform. stis_: but it looks again that programmers in general can't handle the parens - acording to the execs amz3`: sad story amz3`: a collegue at work, is convinced you can't write a database in guile amz3`: why? amz3`: because guile is immutable stis_: lol stis_: sad actually amz3`: yeah amz3`: I did not even bother try to explain him what was true amz3`: I should have, but I lake energy amz3`: for that person in particular stis_: I tend to say my meaning but in practice have little influence. Scheme is so insanly well designed and not even on the radar of what people see as viable amz3`: I love this quote: “inteligence is not what you do when you know, it's what you do when you don't know” amz3`: stis_: yes amz3`: sadly stis_: amz3`: a very good quote! amz3`: stis_: yes, in particular this persons knows I am/was working on database in Guile but instead of asking how it was possible he rejected the idea in bulk amz3`: using a wrong argument amz3`: at the very least, he could have said, that's dynamic language, it will be slow. amz3`: that argument I can understand stis_: or point to our gc issues amz3`: yes amz3`: but that doesn't make guile useless amz3`: afaict Guile is on a good track, even if it will take time to have all this packaged in a nice box amz3`: I mean to have all the thing I want in stable master amz3`: like fiber, guile-js and ffi helper stis_: Yes, and this is what exciting. stis_: I would actually want guile to compile towards the jvm as well in case oracle will open source it mwette: stis_: Have you looked at kawa? https://www.gnu.org/software/kawa/ stis_: mwette: sure I know about kawa, but I tend to like the guile flavor of scheme thiugh and if it can get to jsm why not jvm janneke: mwette: supporting Nyacc's new asm-expr alongside the old version is trivial, great! mwette: janneke: good news janneke: mwette: now mescc compiles tinycc into a somewhat functional C compiler; we're getting real close to a proper C compiler. janneke: mwette: sent patch to update nyacc to 0.82.0 to guix! mwette: janneke: How about a scheme version of lightning? janneke: mwette: yeah, i've been thinking about that... janneke: my problem currently is that i want to use a rather minimal Guile feature set for the Scheme C compiler janneke: because it needs to run on a Scheme [interpreter/compiler] that can be written in assebly (currently Mes) happy_gnu[m]: hi happy_gnu[m]: so I am reading more of the land of lisp, I am on the webserver part happy_gnu[m]: and I was curious happy_gnu[m]: Is the guile web server in top of apache? happy_gnu[m]: I found this on internet happy_gnu[m]: https://wingolog.org/archives/2012/03/08/an-in-depth-look-at-the-performance-of-guiles-web-server happy_gnu[m]: Article says it is on top of apache but that might change soon (2012) happy_gnu[m]: and documentation does not mention anything about apache amz3`: happy_gnu[m]: it works without apache amz3`: ijp: in guile-js, you are always calling functions using call or apply but passing something as 'this' but afaict there is not use of that amz3`: that is 'this' is never used amz3`: ijp: also see this beautiful code https://gitlab.com/amirouche/guile/commit/74c7541cf0592b7e4cb0f5c6f7105681522ac759 amz3`: happy_gnu[m]: I have a project showing how to do web dev in guile if you want amz3`: happy_gnu[m]: https://github.com/a-guile-mind/guile-web amz3`: \\o/ amz3`: /o/ amz3`: \\o\\ amz3`: \\o/ amz3`: ACTION dance with guile-js happy_gnu[m]: amz3`: ohh this is cool!! happy_gnu[m]: amz3`: thank you :) happy_gnu[m]: amz3`: I see you alse have a book!! amz3`: happy_gnu[m]: it's here that you add routes to the webapp https://github.com/a-guile-mind/guile-web/blob/master/web.scm#L623 amz3`: happy_gnu[m]: I am just getting started amz3`: happy_gnu[m]: much work is required to call it a book proper happy_gnu[m]: I understand amz3`: I will try to sleep now amz3`: see you later happy_gnu[m]: ok good night amz3` amz3`: o. amz3`: o/ happy_gnu[m]: o/ stratotanker: Hello, I'd like to known how to foreign C structure with nested structures, guile support this? dsmith: sneek: botsnack sneek: :) mwette: wingo: Do you convert SVG (as SXML) to PNG etc? If so, how? I was thinking of using librsvg from within Guile, but not sure that is good. Now looking atusing cairo to do it. (I have ffi for Guile for both but rsvg pulls in glib and that is now a monster ~ glib+gobject+rsvg = ~6 M of .go files) janneke: mwette: got your message about asm-expr, great! mwette: janneke: good. I guess you are using asm then. janneke: mwette: yes, using a bit of asm, for _start, syscalls and such amz3`: so my js-closure function doesn't properly capture the closure amz3`: that the last bug I need to tackle before being able to run my framework amz3`: and that is a success! amz3`: I found the bug, fixed and my framework works amz3`: \\o/ amz3`: and it's not slow, yet ;) amz3`: ouf! amz3`: which means I will have a nice week end happy_gnu[m]: amz3`: great :) amz3`: the code is here https://gitlab.com/amirouche/guile/tree/compile-to-js-2017 ijp: amz3`: yeah, that one is easy done amz3`: indeed, it was not hard if i succeed amz3`: still a win! dustyweb: beep hello civodul: hello! dustyweb: I need to implement HTTP Signatures for Guile dustyweb: because it turns out! dustyweb: this is being implemented by all ActivityPub implementations in practice dustyweb: this is good because HTTP Signatures is a solid spec! dustyweb: the bad news is I can't use Guile's built-in web server dustyweb: reason being that the way we handle headers is "nice" in that everything's ported to actual types you can mess with dustyweb: however, with http signatures when we read a request we're going to have to quasi-canonicalize it dustyweb: and unforutnately dustyweb: that involves preserving the whitespace etc of headers dustyweb: and also the ordering! dustyweb: ordering, I think we can do that, but whitespace, not the case. dustyweb: so I'm thinking of what I have to do, and best I can tell I should do the following: dustyweb: read the headers for canonicalization while also writing the original contents out to a string port dustyweb: and *then* pass the string port's contents over to guile's normal headers parsing code dustyweb: ramble ramble ramble dustyweb: anyway! that's what's up with me civodul: dustyweb: oh so these are signatures computed over the set of HTTP headers? civodul: we had a similar "problem" for narinfo signatures FWIW, where we have to keep the exact initial narinfo representation (order, whitespace, etc.) to be able to verify the signature dustyweb: civodul: signtures of both headers and body, but headers need to be able to be "normalized", yeah civodul: so the signature is over normalized headers, or over the headers as-is? dustyweb: semi-normalized, but now I'm confusing myself! dustyweb: normalized at least in terms of "they are sorted" dustyweb: at the very least we'll hit the problem that this needs to be able to normalize headers guile doesn't "know about" civodul: if it's "normalized" it's less bad than if it needs to be as-is civodul: perhaps Guile could do it civodul: after all it already does a pass of "normalization" dustyweb: yeah maybe dustyweb: civodul: though would still need to handle terms that Guile currently "drops" civodul: hmm yeah daviid: amz3: you could ask the libgit2 team to add en entry for guile-git (actually send a patch ...) amz3`: daviid: a patch about what? amz3`: daviid: an entry in guile projects? daviid: about their front page and bindings page ... amz3`: daviid: oh daviid: so guile-git appeas on the front page, next to chicken-git :) ... amz3`: daviid: yeah, but it's not complete yet amz3`: daviid: I mean it's far from complete even if useable amz3`: daviid: sure I will submit a PR for that once I find it good enough amz3`: I was supposed to work on hat this week end daviid: not usable? I thought guix was using it already amz3`: yes, it's useable but incomplete amz3`: but since guile-js is working... I think I will give guile-js a go ;) daviid: ah ok mwette: waiting for 26k line module (glib) to compile ... mwette: died -- damn pmikkelsen: hello guile civodul: i was reading the Lisp Machine manual linked from https://news.ycombinator.com/item?id=15185827 civodul: and thinking how depressing it must have been for rms to move to a Unix-like thing amz3: guile-js compiler requires *a lot* of disk space amz3: at least 1Go amz3: it requires at least 10Go so far amz3: 20Go civodul: amz3: 20G to do what? amz3: civodul: to execute: ./guile/meta/uninstalled-env guild jslink main.js -o main.js amz3: oh amz3: I see I made a mistake in the command amz3: sorry! amz3: it works actually without a lot of disk space amz3: ^^' civodul: heheh ArneBab_: civodul: I thought the same — but then I read in the Unix Haters Handbook that Lisp Machines took half a day to boot → http://simson.net/ref/ugh.pdf ArneBab_: (page 26) happy_gnu[m]: Half a day..p happy_gnu[m]: That probably was fast for the times happy_gnu[m]: Wasn't it? davexunit: civodul: me too! it was a wise strategy for the health of free software, but sad that the Lisp Machine wasn't practical enough for widespread adoption davexunit: I was reading the section about "areas", and I wish we had something like it in Guile davexunit: I really really want more ways to influence how memory is allocated for performance optimization. davexunit: like I wish my linear algebra types could be allocated from a pool where, as objects of that type are GC'd, the memory is re-used for others. avoine: davexunit: that sounds like chez'S Big Bag of Pages : https://www.cs.indiana.edu/~dyb/pubs/bibop.pdf civodul: davexunit: areas also caught my attention :-) civodul: it's clear that Lisp Machines incorporated a lot of experience davexunit: avoine: oh neat, thanks for sharing that. davexunit: civodul: I wonder what wingo would think of such a feature davexunit: I don't think it's possible to implement something like pages in userspace davexunit: s/pages/areas/ davexunit: well, I think it's possible to define a type whose make-foo procedure returned an instance from a shared memory pool, but then you'd need to use a guardian to protect everything from the GC and return items to the pool davexunit: I don't know how conducive guardians are to high performance code davexunit: soon enough you'd have a userspace garbage collector... amz3`: pk ftw! amz3`: with unit tests it would be much easier to test! amz3`: to debug I mean amz3`: ijp: I think I successfully implemented scheme callbacks ijp: as in javascript calling scheme code, yes ijp: or the other way? ijp: I guess this refers to the ffi patch ijp: hmm, I'm interested in this issue with the 'rest' parameter. I don't know why showing would be an issue ijp: shadowing ijp: the only time "real" names should show in code is in arguments to "real" procedures, whereas that let should have just ended up as a continuation ijp: ah, I think I know what the problem is, kind of silly really ijp: hmm, no amz3`: apparently, I can call scheme code from javascript and javascript from scheme ie. it works both ways amz3`: but my program doesn't fully run, yet. amz3`: I have other bug to squash ijp: amz3`: I believe what happens is that in the conversion from tree-il to cps, guile supplies the symbol 'rest as the name for the rest parameter, and I am just blindly copying it ijp: cps->bytecode doesn't care about the symbol, just the truthiness, which is what I should do ijp: possibly I should update my id representation to include a "raw" option, that doesn't get converted amz3`: I am not sure the origin of the bug ijp: I think this is it, but I want to clarify a few things before I make a change amz3`: sorry, i don't understand that yet amz3`: anyway, I am almost done amz3`: there is just a bizar bug with the following code: amz3`: (define (foo) amz3`: (number? (cons 1 2))) amz3`: (foo) ijp: does it error or give the wrong answer? ijp: if it errors, then it's probably just missing. I did make integer? available, but not number? since it wasn't necessary for boot-9, but the same code would work amz3`: ok amz3`: my webpage is running, but callbacks don't work ijp: wingo: are you still at icfp? stis: urgh python is horrible stis: it's so tide up to non functional programming that it's insane happy_gnu[m]: stis: thats interesting, as someone who is learning programming, everyone and everywhere people say learn python first stis: it's basic design is to mutate, like the for loop. stis: Also functional languages makes sure to use tail position, returning from non tail positions means that you net let/ec and that's extra work happy_gnu[m]: I felt a little lost with it stis: taht is not needed happy_gnu[m]: I didn't like that everything I had to do import. I said I want to actually learn not just import everything :/ stis: this mutating frenzy measn that delimited continuation is of much lesser value happy_gnu[m]: And lists feel so much better and intuitive than arrays happy_gnu[m]: I seriously don't understand why people think scheme or lisp is hard happy_gnu[m]: It is so intuitive and easy happy_gnu[m]: So much more logical happy_gnu[m]: Maybe I am just to noob to appreciate what they mean :/ stis: the beuty of the simplified core language of scheme is amazing, it's really really sound for computing stis: the more I work with scheme the more I learn to like it, not so for python stis: anyway for loops now works in my python to scheme compiler stis: for loops that is stis: A much better python (has tail calls) but still way too much mutating and stuff that sous not use tail call positionings happy_gnu[m]: I was on reddit on /r/Linux and someone posted this happy_gnu[m]: Just looking at thin remembered me why I didn't like those happy_gnu[m]: https://www.youtube.com/watch?v=QPZ0pIK_wsc happy_gnu[m]: Scheme is so much cleaner and happy_gnu[m]: I am just look at it { } if, else if, else { { } } ; stis: it's a pity that industry don't get it, only C C++ java C# bleah happy_gnu[m]: I don't understand why they say that is for beginners daviid: do we have 'serious' figures on how guile performs compared to python? happy_gnu[m]: /o\\ Apteryx: There's something I'm apparently missing with match: http://paste.lisp.org/display/355139 Apteryx: Any hints as to what I'm doig wrong would be appreciated! cmaloney: it looks like it's having problems with your comments cmaloney: though I can't run it locally because it's complaining that i don't have match cmaloney: (assuming that the bit between "" is a comment or docstring or ...) Apteryx: cmaloney: thanks! Sorry, there should be a hyphen between ice and 9 in my (use-modules (ice-9 match) ...) Apteryx: But even with that I still get the error in comments ft: Apteryx: Doesn't #:key require define* from (ice-9 optargs)? Apteryx: oh, that must be it... ah. I find Guile pretty tricky to get started with, it seems for every small thing I need a use-module ;) ijp: you shouldn't need to import define* ijp: (but yes, you should be using it) ft: Is it in the default namespace? Apteryx: OK, right, it works. Thank :) Apteryx: Seems it is! ijp: ft: for a few years ft: Heh. Okay then. :) ft: Good to know. :) Apteryx: Is a map in a map the best way to combine ("a" "b" "c") and (1 2 3 4 ...) into ("a1" "a2" "a3" "a4" "b1" "b2" ...) ? ft: There's a map implementation in (srfi srfi-1) that allows multiple lists to be traversed, IIRC. ft: (map f lst1 lst2 ...) ft: f then takes as many arguments as you provide lists to map. ft: Shortest list decides how long the procedure goes on. Apteryx: ft: thanks! I'll have a look. ijp: Apteryx: yeah, append-map a map to get a cross product ijp: cartesian product* Apteryx: Hm, I think the srfi-1 map would solve a different problem. ijp: if it got any more complicated, use a looping macro like srfi41 Apteryx: Also, I find myself using streams (srfi-41) simply to generate lists... And there's no stream-append-map for example. Is there a simple non-generator way to generate lists such as with range(10) in Python? ijp: 42 not 41 ijp: apteryx: iota Apteryx: nice! Now I'm wondering what iota means ;) Apteryx: thanks ft: I would have thought that with srfi-1's map, that `f' would just be a string-concatenate and a number->string with those two source lists. ijp: it doesn't mean anything, the name was taken from APL Apteryx: ok :) ft: Meh. I just reread your question. Misunderstood. Scratch everything I said. :) Apteryx: ft: ok! np mwette: b Apteryx: What should I use between floor or round? I'm using this with log10 to determine the width of a number (in digits). happy_gnu[m]: So in The Land of Lisp I am on the part of the periodic table of loop macro happy_gnu[m]: It is so weird :/ happy_gnu[m]: Where scheme is minimalist and simple happy_gnu[m]: Common lisp is so bloated :/ happy_gnu[m]: But I figured it won't hurt me to learn about it ijp: apteryx: floor is probably more appropriate happy_gnu[m]: I am understanding why racket has (first '(list)) or second or all that Apteryx: Is there a way to unload a module? I don't want map1 from srf1, I want plain map. Apteryx: I could kill my REPL and start over, but there must be a way? Apteryx: How do I convert a float to an integer? ijp: assuming it has been rounded, inexact->exact ijp: (IMO the rounding functions should do it automatically) Apteryx: I see! Thanks. Apteryx: The result of these questions is: http://paste.lisp.org/display/355144 ;) Apteryx: Just a small function to help with generating OpenStreetMap addr:flat or building:flat entries. nalaginrut: ACTION is looking CastXML which is alternative of gccxml for newer C++ compiler amz3: o/ Apteryx: Can the guix closure from guix pull be reused by 'guix system reconfigure ...'? I'm just wondering why it's rebuilding Guile 2.2.2. Apteryx: oops, wrong channel happy_gnu[m]: o/ reed__: Hi everyone. I'm pretty new to guile and lisp in general. Is there a way to have a file open in one terminal and every time you save it, the function and variable declarations are updated and available to a repl open in another terminal? janneke: reed__: Guile's REPL command: ,re will reload the module you changed janneke: or ,re (your module) in case you're not changing the REPL's current module reed__: janneke: Thank you! janneke: reed__: emacs with geiser are a perfect setup for this kind of thing janneke: the guile manual has some tips on that reed__: I've actually started to head down that road already. It seems to be working well. reed__: Another quick question. How do you kill a process in the REPL? janneke: (kill SIGKILL) reed__: I mean if I wrote an infinitely recursive function, is there a way to terminate its execution? janneke: reed__: C-c janneke: ie, ctrl-C reed__: But I'm in emacs, so C-c is bound janneke: reed__: then it's probably C-c C-c reed__: That worked. Thank you! janneke: yw! amz3`: welcome reed__ :) manumanumanu: reed__: welcome! I am pretty new around here as well. I hope you will feel as welcome as I did. reed__: manumanumanu: So far it's been great. Both guile and guix seem very welcoming and extremely helpful. stis: Assume I have a macro that looks like (defined-if-nondefined 'o) and then ues (set! o 1). The problem now is that I get a warning for this symbol that I woul dlike to turn off for just this variable how? amz3`: good question stis: (unbound-variable stis: "report possibly unbound variables" stis: ,(lambda (port loc name) stis: (if (not (member name %dont-warn-list)) stis: (emit port "~A: warning: possibly unbound variable `~A'~%" stis: loc name)))) stis: That will do it, but it needs to go into the guile sources stis: Yes, I managed to get it working for one file, recursive compilation will not work though stis: scheme@(guile-user)> (use-modules (language python module f)) stis: ;;; note: source file /home/stis/src/python-on-guile/modules/language/python/module/f.py stis: ;;; newer than compiled /home/stis/.cache/guile/ccache/2.2-LE-8-3.A/home/stis/src/python-on-guile/modules/language/python/module/f.py.go stis: ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 stis: ;;; or pass the --no-auto-compile argument to disable. stis: ;;; compiling /home/stis/src/python-on-guile/modules/language/python/module/f.py stis: ;;; compiled /home/stis/.cache/guile/ccache/2.2-LE-8-3.A/home/stis/src/python-on-guile/modules/language/python/module/f.py.go stis: sorry for spamming! amz3`: ijp: actually it works under chromium using the following command amz3`: chromium-browser --js-flags="--harmony-tailcalls" amz3`: \\o/ amz3`: ijp: any idea, where is coming from the duplicate 'rest' argument I was talking about on the mailing list? manumanumanu: is there any way to write gui applications? daviid: manumanumanu: yep, guile-gnome and also guile-clutter amz3`: ijp: nvm, I found a workaround for the duplicate rest argument thing amz3`: ijp: also there an issue with utf8 amz3`: as usual ;) cmaloney: UTF = Usually The Fault. amz3`: ^^ civodul: :-) daviid: manumanumanu: guile-gnome comes with examples, guile-clutter examples web page points to some examples I wrote that are not distributed with guile-clutter ... daviid: manumanumanu: are you using guix? ijp: amz3`: I haven't had a look yet, but I'll try to get back to you tomorrow amz3`: ok amz3`: ijp: the only thing I am missing is 'js-closure' procedure which will allow to submit scheme callbacks to javascript code happy_gnu[m]: pmikkelsen: thanks!! happy_gnu[m]: I'll look at it amz3: o/ happy_gnu[m]: Hello happy_gnu[m]: amz3: \\o/ dsmith-w`: Tuesday Greetings, Guilers civodul: heya! cmaloney: (howdy) dsmith-w`: Whee! I just got magit rebasing to work for the first time last week. I think I was always having trouble before becuse I had cruft in my working dir. dsmith-w`: Such fun! dustyweb: amz3: look cool re: 500lines pmikkelsen: o/ happy_gnu[m]: \\o/ dustyweb: o/ ArneBab_: \\o? ArneBab_: amz3: I can’t say much about the content, but the design looks like a neat book mwette: amz3: I sent new info on libgit2.scm. I am working to chase down the pointer issue. sneek: mwette, you have 1 message. sneek: mwette, janneke says: congrats on the release! i'll be interested to see what asm does...mescc has been using its own construct to implement asm which looked like a function call :-) mwette: janneke: thanks, I don't remember what I return. I may be just ignoring, but I can add it in. mwette: janneke: I just checked. The parser returns `(asm-expr ...)' mwette: amz3: if you are here, I am trying debug the pointer issue. mwette: It is in unwrap~pointer. I am trying to support both Guile foriegn pointers and bytestructure pointers. Converting these back and forth must be broken. mwette: and wrap/unwrap should be only needed withing libgit2.scm. They would only be needed by other ffi-modules using types defined in companion ffi-modules mwette: amz3: got it working. In ffi-help-rt.scm I changed ... mwette: lloda: for my --listen port encoding question the other day, I have a solution lloda: call scm_setlocale(scm_from_int(LC_ALL), scm_from_locale_string("")); before entering the Guile shell lloda: the problem was only when embedding, $GUILE --listen was always ok lloda: kind of surprised it's needed otherwise, oh well cmaloney: morning dustyweb: moin moin dustyweb: meow meow happy_gnu[m]: hello \\o/ happy_gnu[m]: I've been reading '(the land of lisp) happy_gnu[m]: it is really different from scheme :/ happy_gnu[m]: I feel like I am reading a python book zacts: hi guilers zacts: happy_gnu[m]: have you tried the Realm of Racket book? zacts: racket is a scheme variant zacts: it's inspired by Land of Lisp happy_gnu[m]: zacts: no I haven't yet :) but I have it already happy_gnu[m]: I will do that book after this one zacts: cool zacts: I own both books as well zacts: I need to get through them too zacts: I've just been caught up with learning Ruby lately dustyweb: happy_gnu[m]: Land of Lisp is fun zacts: I much prefer scheme/lisp over Ruby zacts: but much existing codebases and frameworks are using Ruby zacts: so I may need it for a job dustyweb: happy_gnu[m]: probably a lot of the difference you're seeing is that it uses an imperative style until towards the end of the book dustyweb: at which point it introduces functional programming zacts: I do like Ruby syntax though zacts: but I like lispy syntax actually better due to its practical features, and it's very elegant. direct code is already an AST happy_gnu[m]: dustyweb: ohh I see happy_gnu[m]: Yeah I like the games it is fun dustyweb: I really liked the mini-genetic-programming game happy_gnu[m]: maybe the author thought more on imperative programmers, as there are more and schemers probably didn't need any help lol dustyweb: well it isn't really genetic programming happy_gnu[m]: I am at half more or less dustyweb: as much as it is a slight amount of evolution happy_gnu[m]: on the orc battle happy_gnu[m]: one friend told me to do a chess board dustyweb: happy_gnu[m]: it was useful for me, because I was an imperative programmer with a background in python, and the functional programming part of the book finally brought some clarity to me by what was meant by that and why it was valuable happy_gnu[m]: we are thinking on how to do it with guile happy_gnu[m]: we are not plannig an AI for now, just a board and check if movements are correct happy_gnu[m]: but it is really harder than it looks :/ happy_gnu[m]: dustyweb: I see, I don't know much python or javascript, I barely know about objects, so I found scheme way simpler happy_gnu[m]: But I want to do fun complicated stuff :) problem is, is hard :/ dustyweb: happy_gnu[m]: figuring out how to turn such concepts into running code does take time, and practice jonh: and coffee or *insert fav drink here* happy_gnu[m]: jonh: lol :) amz3`: that is good project: https://github.com/aosabook/500lines/ ijp: amz3`: what a coincidence, I was going to bring it up myself pmikkelsen: happy_gnu[m]: speaking of chess I made this for an exam at my school. it wasn't a programming exam, but an exam in electronic circuts, so the code is a bit of a mess. we made a moving chess board, but never finished it ;) https://gitlab.com/pmikkelsen/guile-chess pmikkelsen: is was my first "big" project in guile and boy, i love the language amz3`: why is that? amz3`: do you feel englightenened already? pmikkelsen: i have been a haskell user for quite some time, and then i got into lisp and then scheme, and it just seems so "simple" if you know what i mean pmikkelsen: the one thing i really want to learn though is macros amz3`: I've doing guile for something like 4 use, I only know define-macro and define-syntax-rule amz3`: I already had a look at the mighty define-syntax but no much pmikkelsen: to me they are magic ;) mwette: pmikkelsen: search for paper by Dybvig called "Writing Hygienic Macros in Scheme with Syntax-Case" mwette: He also has explanaions and examples in his book "The Scheme Programming Language" pmikkelsen: thanks mwette, I will give it a read tomorrow amz3`: tx mwette for the quick reply, I did not try it yet, but I will do it tomorrow hopefully amz3`: I hope to have at the current test suite passing before december amz3`: mwette: btw, the thow other bindings I am interested in are cairo and wiredtiger amz3`: I have tests for wiredtige amz3`: but it can wait, I libgit2 amz3`: I also have a program running using termbox so I can test it with that amz3`: which are very simple amz3`: but you prolly havea lot on your plate :) mwette: cairo is in the 0.81.0 nyacc release, in examples/nyacc/lang/c99/ffi.d. I am working on glib, which is providing a few new challenges (e.g., bit-fields) amz3`: oh amz3`: glib? really? amz3`: I will surely include your ffi helper in my book as soon as a get something like libgit2 working amz3`: or prolly start with a simple example like cairo mwette: I wanted rsvg which relies on glib, gobject, ... so I want to add #:use-ffi-module (glib) amz3`: oh ok daviid: manumanumanu: for info, there is this one as well https://git.dthompson.us/guile-parser-combinators.git amz3`: ijp: can you summarize what's the gist of cheney on the mta? amz3`: I mean there is not stack or heap in javascript amz3`: or do you emulate a stack/heap when compile guile? manumanumanu: amz3`: is it similar to parsack? I have used parsack before quigonjinn: tekuti looks for '/base.css' by default. does anyone know where root is supposed to be? amz3`: manumanumanu: not really amz3`: manumanumanu: the thing is that the proper way to do sequencing in parsack is >>= or something like that amz3`: manumanumanu: guile-parser-combiantor has something like that called parser-bind amz3`: manumanumanu: in combinatorix, it's not the case, it's not monadic amz3`: manumanumanu: that said, I made a small article on how to use guile-parser-combinators amz3`: http://hyperdev.fr/notes/getting-started-with-guile-parser-combinators.html amz3`: but if you already know parser combinators it's useless manumanumanu: amz3`: thanks. amz3`: quigonjinn: did you find what you were looking for? quigonjinn: amz3`: yes, I just needed to change the root location to "= /", so that it won't redirect to tekuti cmaloney: (howdy) quigonjinn: that was how it's done in tekuti's example nginx-config but I didn't notice amz3`: cool dustyweb: o/ amz3`: the grand debug of my book about guile https://a-guile-mind.github.io/book/ amz3`: ;) amz3`: s/debug/debut/ ;) amz3`: it lakes glitches and mezangelle tho cmaloney: amz3`: This is a short book amz3`: that's correct, I am jsut getting started, I will copy my tutorial inside it and extend it amz3`: and other stuff amz3`: right now the issue I have, and i don't know how to solve amz3`: is that I'd like to have space themed book, but I am not sure how to translate that in terms of software+story amz3`: I will see amz3`: the tutorial is already kind of space themed amz3`: sort of cmaloney: What year do you want to se it? 1960s space? 1980s space? Present space? cmaloney: Alien encounter? amz3`: the last cmaloney: Ah, so teaching scheme to aliens? cmaloney: How close to "Land of Lisp" do you want to get? ;) amz3`: oh no not like that amz3`: more like battle star galactica thing cmaloney: You want to use Guile to make Cylons? :) amz3`: why not :) cmaloney: Eh, we've had a good run cmaloney: Though I think that would be a little harsh for a learning book amz3`: you know opencog is partly written in guile? amz3`: it's not far away ;) amz3`: see you later, I am off! cmaloney: G'night ArneBab_: amz3`: I think it looks good. … HTML would have been so much cleaner if it had been done like that … ArneBab_: is shift-reset.com down for you, too? ijp: ArneBab_: ft: Works for me. ijp: thanks for mentioning that ArneBab_: ijp: it’s back. Thanks! ArneBab_: what had happened? ijp: I think my instance got restarted a few days ago, because my znc wasn't running either ArneBab_: I just read your SoC Recap (that’s how I noticed you site being down ☺). It sounds good — and I hope it can be merged into Guile soon! ArneBab_: I think one powerful application would be to build a site where all logic is done by Scheme compiled to js with just an abstract interface in pure JS ArneBab_: (such that people could simply strap in their own Scheme and have it power a website) ArneBab_: integration with skribilo could pull all content creation and logic into Scheme amz3`: ijp: just to be precise, in the end, you are right among many things in particular the need for cheney on the mta whatever it is amz3`: guile can not rely on third party implementation of tco ArneBab_: amz3`: even if all major browsers were to provide it? ijp: cheney on the MTA is a really underrated strategy compared to trampolines amz3`: ArneBab_: maybe you are right, the thing is that there is always the problem of older browsers amz3`: maybe it's not useful amz3`: soon enough it will be in chrome I will be able to continue my work amz3`: like I said in the mail, TCO is implemented in recent nodejs with the correct flag ArneBab: amz3`: here’s the FF bug for TCO: https://bugzilla.mozilla.org/show_bug.cgi?id=723959 oriansj: just a stupid question but anyone else notice the implementation of unless in guile behaves weirdly? oriansj: for example (unless #t 3 4) doesn't return anything but (unless #f 3 4) does mange: That sounds about right to me. (unless #t 3 4) is the same as (if (not #t) (begin 3 4)). What did you expect? oriansj: hmm, I thought the definition of less is supposed to be (define·unless·(lambda·(p·c·a)·(if·(not·p) c·a))) thus was supposed to behave like (if (not #t) 3 4) oriansj: but I guess if it was defined as (define unless (lambda p . c) (if (not p) c)) that would make sense mange: unless is the inverse of when, so (when a b c d) => (if a (begin b c d)), and (unless a b ...) => (when (not a) b ...). They're useful for when you have one-armed ifs. amz3`: wrt guile-js I filled an issue against traceur-compiler https://github.com/google/traceur-compiler/issues/2140 amz3`: please +1 that to get attention :) janneke: sneek: later tell mwette: congrats on the release! i'll be interested to see what asm does...mescc has been using its own construct to implement asm which looked like a function call :-) sneek: Okay. manumanumanu: are there any neat parser combinator libraries for guile? stis: manumanumanu: I use stis-parser stis: but there are a couple of other to choose from manumanumanu: stis: I need documentation :) stis: http://www.c-lambda.se/guile-log/parser-combinators.html#parser-combinators manumanumanu: thx amz3`: manumanumanu: there is also mine amz3`: https://gist.github.com/amirouche/72c24b7122b7067ca4ee03e7a5ba616b amz3`: there is documentation for min yet, but tha are tests amz3`: and it's ill-indented amz3`: manumanumanu: what do you want to parse? stis: yay I can run prolog code that I compile, autocompilation works beutifully with a patched guile amz3`: stis: if I understand correctly your proposal is to have something like racket #lang in guile? dustyweb: wb sneek civodul: to those interested in Git implemented in a memory-safe language: https://github.com/mirage/ocaml-git amz3: the current version of my parser combinators https://gist.github.com/amirouche/72c24b7122b7067ca4ee03e7a5ba616b amz3: it use cps amz3: and it should be possible to parse any stream amz3: error handling is not good enough, yet. megaparsack library does add more procedure and avoids atomatic backtracking amz3: civodul: do you plan to port skribilo to guile 2.2? amz3: or maybe it works on guile 2.2, I did not find a package in guix civodul: amz3: it's mostly ported in skribilo.git, but there's a segfault in Guile while building the doc civodul: this is due to Skribilo mutating an immutable pair apparently civodul: i should investigate more i guess dsmith-work: Happy Friday, Guilers!! sneek: ACTION wags amz3: o/ manumanumanu: dsmith-work: happy friday! cmaloney: (friday (tzag)) davexunit: has anyone ever implemented something like local static variables in C? davexunit: I've had cases where I have some performance critical code, doing vector math let's say, and I'd prefer to not allocate a new vector every call. I'd rather it keep re-using the same object. I can approximate this with careful use of let-over-lambda. davexunit: but something a little more robust might be cool. janneke: davexunit: a static variable is a global prefixed with the name of the function dsmith-work: davexunit: Hmm. Well, from a C/asm/linker perspective, the only difference between a static variable at file scope and at function scope is the visibility. janneke: what would a local-static be, how would you implement it? janneke: possibly gcc's inner functions have something? dsmith-work: let-over-lambda seems the right thing, to limit visibility, otherwise how about just a non-exported top-level binding? davexunit: janneke: no, like a local variable in C. davexunit: that uses static memory allocation davexunit: I would like some macro sugar to approximate this behavior, where the variable is heap allocated only 1 time per thread. janneke: but every recursion into the function gets a fresh heap-allocated version? i don't graps your question yet... janneke: *grasp janneke: ACTION is implementing a c compiler in scheme, so quite interested here... davexunit: it might need to do that, yeah. manumanumanu: What would be a good efficient way to represent paths? I will o lots of appending and such, and have thought about storing the path in reverse as a list manumanumanu: a growable vector is probably faster thouh davexunit: a file name is usually only a few directories deep, so using a vector seems not worth it davexunit: just using a list davexunit: is what I would do davexunit: '("usr" "bin" "bash") manumanumanu: I will store a lot of extra data. a pointer to the last element for fast appending could maybe be worth it davexunit: well I guess that's up to you to determine davexunit: I try not to get carried away with performance optimization janneke: davexunit: what if you'd use a function-static array with an index that increases upon entry and decreases upon return davexunit: maybe but I don't know it would work davexunit: this is probably just a silly idea davexunit: but in the most performance sensitive parts of my game engine project I could definitely benefit from reducing GC pressure a bit. janneke: ah, cool. critical parts are in C, something like that. davexunit: no davexunit: writing C is failing davexunit: my code is pure guile janneke: oh wow, i've been misunderstanding everything until now. sorry. janneke: you're looking for a new feature in guile? davexunit: something like that davexunit: currently I use a let-over-lambda to handle things that I don't want allocate fresh every time a procedure is called janneke: but a static variable in C is a global...what is wrong with globals in guile? davexunit: I'm talking about locals davexunit: function foo(int x) { int result; result = x + 2; return result } davexunit: result is a local and its memory is statically allocated janneke: do you mean { static int result ...} ? otherwise result is on the stack davexunit: forget static davexunit: it's confusing you davexunit: a local variable davexunit: that is stack allocated davexunit: my point is that in C you don't do extra allocation for many locals because they are stack allocated janneke: sure davexunit: obviously in guile everything is heap allocated but for certain situations it would be nice to have an approximation of this davexunit: like in a vector math function where you have a local variable to store part of a computation. would be great to allocate that once and never again. davexunit: again, a simple let-over-lambda works, but it's no longer thread-safe, etc etc janneke: ah, okay. you want something like a thread safe let-over-lambda shared variable davexunit: yes, some macro that will make it no harder (or not much harder) to use them than it is to use regular locals mwette: But foo() { static int memo; ... } is not thread-safe either ... davexunit: please, forget I said static. davexunit: this is why I don't ask these questions usually... mwette: what about fluids? (define foo (let ((memo (make-fluid))) (lambda (... janneke: and where do fluids/parameters fail? janneke: they are thread safe, and global...performance might be lacking? davexunit: okay so the answer is just "no one has tried this before" janneke: davexunit: well, haven't heard wingo yet ;-) davexunit: I'm ready to drop the subject. davexunit: thanks for trying to help. janneke: just wrote my first scheme interpreter and c compiler this year, lots to learn i still have amz3`: joke ahead http://clochure.org/ amz3`: tzag mwette: davexunit: I see what you want now. Since MT safe, unless the items are always same size, not worth it, IMO. It seems to me you want an allocator for same-sized (or maybe max-sized) items. Maybe something like a make-vector-from-pool where you `(make-vector-pool )' amz3`: I tried to make a new website for skribilo https://screenshots.firefox.com/oRzvPcn8U6S64RX6/localhost amz3`: ijp: wrt guile-js, is it possible to break the call stack using settimeout in the implementation of call/cc? amz3`: as temporary fix amz3`: +1 amz3`: +a amz3`: I implemented so basic ffi similar to biwascheme amz3`: even a simple program such as: amz3`: cat main.scm amz3`: 42 amz3`: leads on nodejs 8.4.0 to a hit the call stack limit amz3`: I will make a mail amz3`: erk, the problem is not about call/cc but the whole program which is written in recursive style which leads to to hit the stack limit stis: I just sent a mail for an adition to guile I would like to have. E.g. getting prolog source files to autocompile just like scheme files stis: WDYT mwette: stis: that would be fun dustyweb: o/ OrangeShark: hello ijp: amz3`: how would you be using settimeout anyway? amz3`: ijp: nvm, it's stupid idea, I read some people use it in javascript to "break" the call stack OrangeShark: amz3`: oh do you mean like a very heavy/slow computation where everything sort of freezes? random_numbers: So, where would one look for libraries? dustyweb: random_numbers: guix has some nice ones random_numbers: The distro? Do they have some web index/manual of some sort? amz3: dsmith-work: yeah, some is working on a REPL using ncurses amz3: ecraven: ok lloda: guile 2.2, f I connect to the port that Guile opens with --listen I see %default-port-enconding = "ANSI_X3.4-1968" even though the default at the Guile REPL is "UTF-8". setting the fluid does nothing. how do I fix this? lloda: --listen calls (spawn-server) and that calls (make-tcp-server-socket) and that port has ASCII encoding, but if I call (make-tcp-server-socket) at the REPL I do get UTF-8. I don't see where the ASCII encoding comes from :-| dsmith-work: amz3: I've never heard of one. Why bother since readline is available? dsmith-work: amz3: You could probably use rlwrap, but that just uses readline. cmaloney: I have a quick question about paren matching in the repl: only one of my machines seems to want to do it cmaloney: Ubuntu 14.04, same libraries AFAICT cmaloney: same .guile config on all machines (copied from my main machine, which doesn't do paren matching) cmaloney: Where's the best place to see why the one machine is behaving how I want (paren matching) and the others aren't. cmaloney: s/see/look/ cmaloney: bah, I mean look to see. :-/ dsmith-work: cmaloney: Just a guess. ISTR some recent improvement for paren matching at the repl. Basically, DON'T do it while pasting. Maybe the code that detects if it's a paste is deciding wrongly. cmaloney: It's not during a paste dsmith-work: EXactly! dsmith-work: But maybe it *things* it is cmaloney: Am now confused. :) cmaloney: heh dsmith-work: So somewhere there is some code that figures out if it's a paste or not, and disables paren matching if it is. (cause paren matching really screws up in a paste). dsmith-work: If that code is broken and is *always* assuming "pasting" .... dsmith-work: Pure speculation though cmaloney: Is there a config param that I can pass to the repl to see what it thinks? dsmith-work: cmaloney: Look in guile-readline/readline.c dsmith-work: cmaloney: Maybe see if HAVE_RL_GET_KEYMAP is set dsmith-work: cmaloney: Also need to have "vi" in your readline keymap (whatever that is!) dsmith-work: cmaloney: Also, is can be configured through te bracketed-paste guile readline option. dsmith-work: I don't see how it decides it's paste though. dsmith-work: Ah!. It's a readline variable dsmith-work: cmaloney: https://cnswww.cns.cwru.edu/php/chet/readline/rluserman.html#SEC10 dsmith-work: cmaloney: So that depends on your readline library on that system. cmaloney: AHA! cmaloney: I think I know what's going on cmaloney: it's more vi user oppression. ;) cmaloney: This is in my .inputrc set editing-mode vi cmaloney: set keymap vi cmaloney: set convert-meta on cmaloney: feh cmaloney: http://paste.ubuntu.com/25438558/ cmaloney: I added those to the environment of the machine that is doing the paren matching and it now behaves like the other machines cmaloney: It looks like if editing-mode is set to vi then it no longer does paren matching dsmith-work: cmaloney: Yey! you found it. cmaloney: trying to debug it with gdb and finding that setting a breakpoint is maddening. ;) cmaloney: Not able to break on guile-readline/readline.c::429. dsmith-work: cmaloney: That's init_bouncing_parens() ? dsmith-work: Hm. I wonder if those rl_bind_key's will work when in vi mode. That modal stuff might get in the way. cmaloney: I'm trying to make some test code to see what gets returned and I'm about as stuck as I can get cmaloney: http://paste.ubuntu.com/25438895/ cmaloney: http://paste.ubuntu.com/25438900/ cmaloney: I'm not sure what I'm doing wrong where it's not linking cmaloney: OK, figured out what i was doing wrong (-lreadline needed to be at the end) cmaloney: it looks like this is dead code on my system cmaloney: (guile-readline/readline.c:429) cmaloney: since it shows up as emacs, even with the .inputrc file setting the mode to vi cmaloney: That test code always returns "emacs" stis: yeehaa, starting to be able to compile python defs to guile :-) amz3`: so it seems like indeed call-with-continuation makes all things more terrible at compiling scheme to javascript amz3`: stis: ! amz3`: dsmith-work: apparently that's a REPL that support sexp editing like paredit does amz3`: I don't do paredit myself yet stis: amz3`: im exploring what python+guile means, not the same as python if you ask me but very similar stis: plus I want to play with an extension for funcitonal objects stis: python style oop but interoperating with goops nicely amz3`: stis: I lost faith I think regarding python, scheme is much more powerful even if exception handling in python is rather nice amz3`: stis: yes, a layer on top of goops for using goops like python oop will be nice stis: true, you can use the python object system from scheme if you like as well and not use python syntax amz3`: stis: I am writing yet another time my parser combinator ^^ stis: coolia amz3`: I'd like to improve error handling somehow amz3`: I discovered that megaparsack also, which does some of the thing I would like to have amz3`: like a "context" thing stis: yes i've been thinking likewise stis: some way to say that when you come so far you should succceed is the most lowest hanging fruit stis: in the more complex case there is a tree of reasons for failing the parser amz3`: I have written parser with two layers: first layer does tokenization and another which does build the ast amz3`: both use the parser combinators stis: okey, yes that's what I do as well amz3`: it doesn't work yet stis: https://gitlab.com/python-on-guile/python-on-guile stis: if you are interested folks stis: I think that I will add the following syntax stis: x : x.a.b = 1 stis: meaning that x.a.b is updated functionally and we will create a new object returned to x stis: x2 : x1.f(10) stis: likewise stis: e.g. f might update x1 and hence return a new object stis: x1.f(10) - will call the same function but perhaps mutate x1 dsmith-work: amz3: Yeah, I havne't taken the plunge into paredit yet. Played with it a few times. But it's not under my fingers. dsmith-work: I don't edit sexp files as much as I'd like. janneke: i found #:canonicalization 'absolute on compile-file janneke: *finally* have emacs jump to error locations again...*HAPPY!* civodul: :-) sneek: Welcome back civodul, you have 2 messages. sneek: civodul, ng0 says: A check for shell support before I continue working on it: would you accept new introduced files especially for tcsh/csh and fish to get their environment variables from? Those are so far the 2 major shells which differ from the way zsh/*ksh*/bash sets them. In (guix search-path) I just need to add 2 variations which will then be used in (guix build profiles) to generate the sneek: civodul, ng0 says: etc/csh.profile and one other thing for fish i haven't looked into yet janneke: :-) civodul: i've had a couple of issues with Geiser since 2.2 i think civodul: like doc and autodoc amz3: Three Implementation Models for Scheme https://www.cs.indiana.edu/~dyb/papers/3imp.pdf manumanumanu: arximboldi: _really_ cool work with the immutable data structures manumanumanu: arximboldi: I haven't been able to play with them yet though, since my package manager hasn't got the boost version required (callable_traits is a new addition I think). I'll have a look at it in a week or two ecraven: amz3: no, I thinking about a generic swank backend for r7rs schemes, but no concrete code yet arximboldi: manumanumanu: oh yeah, the callable_traits thing I install via nix arximboldi: it is note yet in official boost arximboldi: i think you should be able to check that library out manually, it is a header only library arximboldi: thanks for the compliments, very encouraging! amz3: ecraven: it was for me? cmaloney: (tzag) dsmith-work: Wednesday Greetings, Guilers dsmith-work: sneek: botsnack sneek: :) dsmith-work: goodbot ecraven: amz3: probably a few days ago: someone here was working on a guile repl with line editing support, I don't remember who ecraven: that wasn't me ;) dsmith-work: ecraven: Line editing? As in, not using readline? ecraven: no idea ;) dsmith-work: Oh. Maybe I should have addressed that to amz3 dsmith-work: amz3: Hmm. You can check the logs. dsmith-work: Unfortunately, they don't have a search feature like the old logs did. dsmith-work: (rotty's logs) dsmith: sneek: botsnack sneek: :) dsmith: Goodbot dsmith: sneek: seen wingo? sneek: wingo was here Aug 16 at 11:41 am UTC, saying: if you want to look further regarding guile-pg, civodul has a commit to gnutls where he makes the gnutls guile bindings use either old or new C port types. amz3: dsmith-work: tx for bringing back sneek manumanumanu: ijp: wow. cool gsoc project! sneek: ACTION wags dsmith-work: Morning Greetings, Guilers dustyweb: o/ OrangeShark: good day cmaloney: morning ijp: davexunit: I know you don't do as much game stuff these days, but you might like http://antirez.com/news/113 davexunit: ijp: hey, thanks! I'll put it on my "to read" list mwette: ping stratotanker: another help stratotanker: Guile manual tell me that when catching exception with key 'misc-error, args can be used with simple-format stratotanker: I'm not able to do it stratotanker: args is a list with (#f format-spec arg1...) stratotanker: so, (simple-format args) not valid, how i can pass args to simple-format? mwette: I use the following: mwette: (lambda (key fmt . args) (apply simple-format #t fmt args)) davexunit: rekado: no yaml library that I know of. I wrote a really hacky subset of a yaml parser before, but the yaml standard is *terrifying* so I gave up going further. dustyweb: davexunit: YaML is really the worst of the *ML family of languages ;) ijp: We should have a bug tool in guile called guilt davexunit: dustyweb: hahaha davexunit: ijp: +1 dsmith-work: Monday Greetings, Guilers cmaloney: (tzag) rekado: davexunit: I only really need strings and lists, so a small subset of the specs would probably be sufficient for my purposes. amz3: sneek! oh! sneek come back to our room, it's full of blooming conversation, that needs your presence to be the perfect place to be on the internet OrangeShark: hello amz3: hi OrangeShark! amz3: OrangeShark: how are you doing? OrangeShark: I am alright, how are you amz3? amz3: fine :) dsmith-work: amz3: Ah fouey! Forgot to check on sneek over the weekend. dsmith-work: I'll try to remember tonight. manumanumanu: Has anyone tried porting clojures data structures to guile? arximboldi: manumanumanu: i have been experiment with immutable vectors, by binding my C++ library: https://sinusoid.es/immer/guile.html arximboldi: these vectors are more powerful than clojure's though, they are based on rrb-trees so they support log-n concat/slicing/insertion at any point arximboldi: while having similar performance otherwise arximboldi: I think wingo has been experimenting with pure scheme implementations though ijp: Guile uses integer map/set types internally that come from clojure ijp: my own functional vector library (pfds sequences) is not based on clojure, but on fingertrees, and my (fectors) is a whole different thing that is only semi-persistent manumanumanu: arximboldi: wow. that's impressive! ijp: GSOC Wrap-up sent to guile-user ijp: fectors doesn't get any love, my code mostly acts as a reference point for when I want to talk about that implementation strategy dustyweb: ijp: yay! manumanumanu: ijp: why leftist tree and not a pairing heap? manumanumanu: I always managed to squeeze slightly better performance from pairing heaps ijp: manumanumanu: what's the context for that? manumanumanu: ijp: oh. sorry, pdfs heaps are based on leftist trees manumanumanu: I haven't tested in guile though, but for most other projects I have found pairing heaps to give slightly better performance ijp: Ah. At the time I was needing a priority queue, and wasn't focusing too much on speed, so I implemented the one I could do from memory manumanumanu: If you want you can have my pairing heap. ijp: pfds has some conflicting goals in mind. Portability really hurts its performance on guile manumanumanu: how portable? manumanumanu: my pairing heap is r6rs ijp: pure r6rs ijp: If you want to link me the code, or send a pull request, or whatever, I can take a look, but I haven't really been focussing on pfds manumanumanu: ijp: https://bitbucket.org/bjoli/nietzsche/src/1769998a800955d5831aa7c0c8b3c31ba00f7050/data/pairing-heap.scm?at=default&fileviewer=file-view-default manumanumanu: I'll have a look if I can make a PR manumanumanu: whatever you do, don't look at the other code. much of it is crap manumanumanu: That's it for me. good night ijp: night dustyweb: gnite ijp dustyweb: btw here's the link to ijp's guile-user update on gsoc https://lists.gnu.org/archive/html/guile-user/2017-08/msg00070.html dustyweb: #lazyweb dustyweb: #lazyirc? cmaloney: #l cmaloney: (too lasy to type the rest) cmaloney: s/lasy/lazy/g even daviid: ijp: congrat for the strong dedication and the good work! amz3: ijp: what's the option you use to increase stack frame limit? amz3: in browsers that is amz3: ACTION reading ijp post dustyweb: amz3: it's in the post dustyweb: see the command with "node" amz3: ah yes, I was looking for the same thing under firefox amz3: nvm amz3: ijp: great achievement, you succeed where I failed numerous times! very great! amz3: (and I know javascript :p) cmaloney: Isn't writing in JavaScript just taking a 1 in 6 chance of returning NaN or undefined? :) dsmith-work: ijp: Yes Congrats! dsmith-work: ijp: Talking to someone forces you to collect your random nebulous thoughts into clear language. That very act often brings solutions. stratotanker: Hello! stratotanker: Can someone help me with guile foreign structs? I'll describe a struct containing a field of struct type, is this supported? amz3`: stratotanker: yes, it supported via scheme-bytestructures? amz3`: stratotanker: are you using guix? amz3`: stratotanker: https://github.com/TaylanUB/scheme-bytestructures stratotanker: amz3` no, im usign system foreign amz3`: stratotanker: you need to install the above ^ scheme-bytestructures stratotanker: I'll look at.. thanks! amz3`: yw! manumanumanu: Good day, guilers amz3`: tx :) cmaloney: greets cmaloney: ACTION saves you all the half-hour slowly-scrolling-sinewave of seizure-inducing-text amz3``: mwette: ffi helper runtime it quiet slow to compile amz3``: wait amz3``: It's me amz3``: its the bindings that are taking time actually mwette: amz3 mwette: once compiled it should be fine. There is a LOT of code to compile. mwette: if you are compiling the libgit2 file amz3``: indeed the file is 15K LOC mwette: libgit2.scm is 15000 lines, so probably at least 5 k lines of code mwette: I get compile time of libgit2 with guile22 4m44s and with guile20 1m7s. mwette: OTOH `guild22 compile -O0 libgit2.scm' takes 51s. amz3``: oh amz3``: I desactivated auto compilation for the time being amz3``: mwette: I get the following error: libgit2/raw.scm:477:0: libgit2/raw.scm:477:0: Unbound variable: wrap-git_transfer_progress_cb amz3``: raw.scm is the libgit2.scm file you gave me I renamed it amz3``: when I look at the definition of git_transfer_progress_cb I see there is a random number at the end of the definition, something like the following: wrap-git_transfer_progress_cb-63bd61d526e9f stratotanker: Hello, more help within guile and FFI please. I have a C function that returns a dynamically allocated string (char*). I don't know how to free this string. I'm thinking about make a foreign pointer to free and call it passing the string. I'ts right or there is a better way? mwette: hmm, something amiss. I get the undefined wrap also for guile22. I need to add the function wrappers. You could define that as identity for now. mwette: I don't know what the random number is: looks like an address. mwette: stratotanker: I don't know that one. Maybe you can make an ffi for free() and pass it the pointer stratotanker: mwette thanks for reply, I'll put a tag and continue, maybe there is a better clean way to do this :) mwette: jobs amz3``: mwette: what the difference between /p and other macros? amz3``: oh amz3``: it also defines pointer descriptors amz3``: I get it mwette: "with pointer" amz3``: there is something wrong with 'define-fh-function' macro amz3``: on my side at least mwette: here is what I currently have: mwette: (define-syntax define-fh-function mwette: (lambda (x) mwette: (define (stx->str stx) mwette: (symbol->string (syntax->datum stx))) mwette: (define (gen-id tmpl-id . args) mwette: (datum->syntax mwette: tmpl-id mwette: (string->symbol mwette: (syntax-case x () mwette: ((_ name return-t args-t) mwette: (with-syntax ((desc (gen-id x #'name "-desc")) mwette: mwette: I have also added this to the libgit2.scm: mwette: (define void intptr_t) ;; no void in bytestructures mwette: amz3``: I have that amz3``: the problem is with 'export' and 'syntax-case' thing amz3``: I will try to make a small example dustyweb: hi #guile amz3``: o/ mwette: I get the unbound wrap-git_transfer_progress_cb mwette: but not for any other function typedefs. so odd amz3``: now I have another behavior... seems like define-syntax doesn't behave correctly in front of 'export' amz3``: or I am mis-using define syntax amz3``: http://paste.lisp.org/display/354505 amz3``: wait I made a mistake obv mwette: Now if I swap decl's of git_transfer_progress_cb and git_transport_message_cb I get error that wrap-git_transport_message_cb is undefined. amz3``: same here amz3``: I will paste the result of the macro expander on that expression amz3``: http://paste.lisp.org/display/354506 amz3``: I changed a little the definition of define-fh-function to use define-public, the problem is the same amz3``: e.g. it define the following 'git_transfer_progress_cb-desc-11a3102235694990' and then try to export 'git_transfer_progress_cb-desc' mwette: Maybe my use of #'( (aka (syntax ) and the defined "desc" is not right. amz3``: I think there is an issue between 'wrap' syntax defined in `define-fh-function/p` and the `wrap` syntax defined in `define-fh-function` without the p amz3``: when you use define-fh-function alone it works amz3``: mergin both macro into a single macro solve the issue amz3``: I got a bunch a undefined symbols due to the fact that I use an old-ish libgit2 and things compiled fully amz3``: now let's add some sugar. mwette: I think you are onto something. janneke: a mescc-built tinycc: mes-tcc just compiled its first working executable ijp: gratz mwette: janneke: nice work. happy_gnu[m]: Hi :) happy_gnu[m]: I just want to invite you to #lgn happy_gnu[m]: Is a channel we have to play libre games janneke: mwette: thanks! happy_gnu[m]: We play each week a different game at a different time so every time zone can join happy_gnu[m]: We only play libre games :) happy_gnu[m]: http://libregamenight.xyz/schedule.html amz3``: mwette: I tested basic stuff and it seems to work amz3``: mwette: I am not sure yet what to do with the procedure generated with define-fh-compound amz3``: et al. mwette: https://github.com/TaylanUB/scheme-bytestructures mwette: bytestructures allows you to get/set structure field values mwette: you can make a structure with (make-foo_t ) where values is bytevector (there may be other choices -- can't look now) stratotanker: hello, I'd like to debug an error in a script. I tried to run guile with --debug but nothing happen, also using (debug) at the beginning of the wrong code does not help, please someone can help? manumanumanu: stratotanker: did you try starting it from the repl? manumanumanu: start guile and then use (load "your-file-here.scm") stratotanker: manumanumanu, sorry I'm pretty new to scheme, I didn't try this, please wait a sec... stratotanker: nothing changed manumanumanu: but now you can inspect the error manumanumanu: what error do you get btw? stratotanker: I cannot, I think because of my catch block manumanumanu: from the repl you can try it with different inputs to try to narrow down what the problem might be manumanumanu: stratotanker: I am probably not the right person to help though, since I do (display)-driven debugging stratotanker: Uh, I do it in the same way in C manumanumanu: Do you have any code I can look at? stratotanker: especially when working with cross compiled executable stratotanker: sure! pastebin? manumanumanu: yeah stratotanker: okay, whait a sec please stratotanker: manumanumanu https://pastebin.com/XS0c3Bu5 stratotanker: I got: wrong-type-arg (#f Wrong type to apply: ~S (0) (0)) manumanumanu: stratotanker: and you are sure that is where things break? stratotanker: but, apart from this case, there is a debug mode in guile? like gdb? Remember, I'm pretty new and this maybe a stupid question :\\ manumanumanu: Most people debug in the repl. You can inspect the continuations and bound variables and such manumanumanu: in the repl you can type ,help debug and get more info stratotanker: removing catch blocks i get backtrace and some info manumanumanu: anyway, that error seems to imply that something is #f and you are trying to use it as a procedure stratotanker: sure I'm using catch in a wrong way stratotanker: always catch #t stratotanker: :\\ manumanumanu: and btw: (while (not (eq? iterator #f)) is the same as (while iterator manumanumanu: since anything not #f is truthy stratotanker: also if iterator is not always a boolean? manumanumanu: stratotanker: yes stratotanker: it's a foreign pointer manumanumanu: truthy stratotanker: okay, many thank's, sorry for basic questions manumanumanu: I'm just glad I can be of any help. manumanumanu: anyway, what are you writing? it seems dangerous :D stratotanker: It's gnu fdisk, I'm restarting from scratch using scheme manumanumanu: :) stratotanker: anyway also backtrace is not helpful to me stratotanker: maybe this https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Single-Stepping-through-a-Procedure_0027s-Code.html#Single-Stepping-through-a-Procedure_0027s-Code rekado: davexunit: do you know if there’s a usable guile-yaml library? amz3`: o/ cmaloney: i'm reading through elm docs and now i want typed guile with adts cmaloney: this is not normal daviid: cmaloney: better read the land of lisp then ... :) daviid: http://landoflisp.com/?ref=nf/ daviid: CL can be fast, upto .3 C executin time ... our next step cmaloney, thanks to andy of course, is to have an AOT, then we may introduce declaration (by the way, I hope that when that comes, we will adopt the CL way, not the kawa way, but ... synctatically speaking, which may sound like a detail but ino is not ... akkad: fast CL is ugly :P daviid: not necessarily daviid: it all depends on your skill, no one said, no one ever said programming is a piece of cake ... it takes a life, 30, 40y to reaaaaaallllllllly become good, so be patient and learn, learn, and learn again ... cmaloney: heh happy_gnu[m]: So daviid i shouldn't be frustrated after 6 months? happy_gnu[m]: Is kinda hard to go from simple stuff to interesting :/ daviid: happy_gnu[m]: no, keep quiet, and stay among us, there are quite good hackers here, and all are very nice people too, always ready to help ... cmaloney: what if you are on year 35 and still feel like an amateur? :'( happy_gnu[m]: And reading SICP is awesome but hard :( daviid: cmaloney: that, imo, is good daviid: because, it means youe are still ready to learn daviid: the enemy is when you start to believe 'you know', that's the dead end cmaloney: i dunno... you said CL was good. now your opinion is suspect. ;-) daviid: why cmaloney: i'm teasing daviid: sorry, I don't get it. I said CL can be fast, but I sitched to guile a while ago (15y) ... and still am here daviid: guile is the future, it will be fast, then the benefit of scheme over CL will show ... we have goops too, which is why I picked up Guile, along with eith part of GNU and other reasons, but don't wna to tal about that right now daviid: happy_gnu[m]: keep going, reading, not just SICP, any lisp based stuff, read code, ask here, try to have a 'pet project' of your own ... and you will be fine happy_gnu[m]: daviid: thanks :) yeah I am also reading the land of lisp daviid: happy_gnu[m]: in a few years you'll become a good hacker, but that won't happen ina WE cmaloney: daviid: in my head we have different functional factions throwing gang signs (lambdas with the left hand = lisp, lambda with the right = guile) happy_gnu[m]: And it helped me to understand o little bit of a similar game on emacs cmaloney: it's a ridiculous thought but one that struck me as fummy cmaloney: funny even daviid: :) cmaloney: night happy_gnu[m]: But I feel like there is too much to learn, Unix philosophy, shell, all types of shell :/, JavaScript, HTML, php, lisp, Haskell, Java, clojure happy_gnu[m]: It is overwhelming happy_gnu[m]: I try not to think about that and focus on lisp though adhoc: happy_gnu[m]: it sure can be, there are decades of culture and development in those things daviid: happy_gnu[m]: emacs can be a good start as well, any lisp based coding is a good source, then with time, of course, you'll recognise good from bad coding ... which a nice skill t have too of course ... adhoc: getting in early on the development cycle of alanguage helps a lot as you grow with it happy_gnu[m]: And then games and design inkscape, gimp, blender happy_gnu[m]: I feel bad I started so old happy_gnu[m]: I feel like I wasted a lot of time daviid: happy_gnu[m]: don't think that way! there is no 'good' age to start, in any domain by the way, just start ... and feel happy, so many people would like but don't start ... precisley because they beleive age is a 'problem', I don't agree daviid: what matter is desire, not age happy_gnu[m]: Yeah at least I am trying daviid: if you have the desire to progress then you1re good happy_gnu[m]: I closed my law office to become a programmer happy_gnu[m]: Discovering GNU/Linux was beautiful daviid: happy_gnu[m]: exactly, and I swear, if you are patient and stick with 'us', and guile (or lisp based s/w), then you will progress and succeed in writing something ... adhoc: weh had a nold timer join our radio club, age 74, mainly to find folkks to talk to about programming arduino and started coding in c,c++ and now python nad javascript happy_gnu[m]: Thanks daviid daviid: happy_gnu[m]: welcome! adhoc: had done basic decades ago, now spends about half his time working on projects adhoc: never too ld to lern to code happy_gnu[m]: Oh how cool adhoc adhoc: yeah has been interesting to field questions OrangeShark: happy_gnu[m]: I sort of feel like that sometimes too, I wish I started earlier. daviid: adhoc: yes, this is a well known medecine fact: the age is never an obstacle, the obstacle is the lack of desire ... there are people that learned at 80y old a new (speaking) language, quick as light speed, becaue they had to (and accepted 'they had to', converting the 'have to' in desire ... adhoc: yes adhoc: time and energy to spend one it is the key thing djcb`: did anyone succeed in using `meson` for guile-related tasks (.go compilation, snarfing etc.)? amz3`: héllo #guile amz3`: what's up? amz3`: each time I play an RPG game, I dream of making one, I can't focus on the game itself, except wondering how everything is done amz3`: now I know for a fact, that if I started such a game I would not finish it amz3`: so I'd rather stop dreaming... amz3`: I've been fiddling around rust, I am wondering what Guile does provide that makes it better than rust platform for programming, any idea? happy_gnu[m]: amz3`: there are a lot of positive things in Guile happy_gnu[m]: amz3`: guile is part of the Lisp family happy_gnu[m]: This can help you a little happy_gnu[m]: https://www.quora.com/Why-should-I-learn-Lisp amz3`: tx happy_gnu[m] happy_gnu[m]: amz3`: I don't have much technical knowledge to help you more but happy_gnu[m]: I can tell you learning guile is awesome happy_gnu[m]: amz3`: maybe you can read Structure and Interpretation of Computer Programs (SICP) and watch the lectures cmaloney: I can say that learning a little bit of Guile / Scheme has made learning other functional languages easier for me cmaloney: and now I understand some of the "weird syntax" for functional concepts that are being bolted on to other languages like Python amz3`: happy_gnu[m]: I know Guile, I am asking for other point of view on rust amz3`: I see rust makes a very good point about error handling amz3`: In guile, you are basically on your own amz3`: IMO, exception support is not good enough happy_gnu[m]: amz3`: then maybe is about what you prefer and what you feel more conformable with. amz3`: afaik you can't raise/throw an exception that is a GOOPS object amz3`: hence you can have a hierarchy of exceptions and handle them particularly amz3`: this ^ is a comparison to python way of handling errors amz3`: compared to rust, rust requires you to handle errors everywhere, see the .unwrap() method call and '?' add the end of expressions all are placeholders for actual good rust error handling amz3`: I am not sure what's the best approach to error handling exception/error codes (like C) or rust's thing amz3`: one thing I am sure, is that rust is more explicit about the places where you need to handle errors which is not the philosophy of dynamic languages where things are less explicit amz3`: by default amz3`: daviid: can you raise/throw an exception that is a goops object? amz3`: daviid: how do you handle errors in your program? amz3`: basicallly what's the schemey way of handling errors OrangeShark: amz3`: yeah, there is definitely different ways to handle errors in programming. There is error codes, exceptions, result/optional style values cmaloney: This is the same thing that I noticed with Elm and the Algebraic Data Types cmaloney: where it puts in error handling for unhandled case statements amz3`: OrangeShark: scheme do all those things :/ OrangeShark: yup, you can do all of those amz3`: cmaloney: how does elm handle errors? cmaloney: It uses strict typing and complains a lot at compile time amz3`: that what rust does too, it leads to slower 'write then run' life cycle but when it runs you have more chance to have it right cmaloney: https://guide.elm-lang.org/types/union_types.html ijp: amz3: you can throw any object as an exception cmaloney: This is what prompted me to wonder (in channel) re: Typed Racket support for Guile OrangeShark: cmaloney: there is a typed version of guile OrangeShark: called Theme-D cmaloney: Wow, Google really doesn't know about it. :) amz3`: ijp: oh, nice! I should give it a chance cmaloney: Getting everything for the Street Fighter character "Guile" and his theme. ;) OrangeShark: lol amz3`: cmaloney: look in the mailing list ijp: well, it does go with everything OrangeShark: cmaloney: http://www.tohoyn.fi/theme-d/ amz3`: ahah, ddg://guile+wiredtiger leads to a "Images > Sorry, no results here." but still gives the correct results below amz3`: https://duckduckgo.com/?q=guile+wiredtiger amz3`: happy_gnu[m]: what are you interested in? web? desktop apps? games? algorithms? data structures? amz3`: happy_gnu[m]: I am asking because you asked previously help to hack on something, but you did not tell what you are interested in amz3`: ijp: I think you implementation of fingertrees is unique, I can't find a similar datastructure in python or rust or javascript amz3`: that's strange because it works quiet well for representing text in text editors ijp: it is certainly not unique, it's just not as common outside functional languages amz3`: It will be nice to have some datastructure zoo coming with it implementing various other datastructures on top of it amz3`: I will add that to my todo list amz3`: cmaloney: did you have a look at guile-wiredtiger? happy_gnu[m]: amz3`: i am connected with Riot I can't pm happy_gnu[m]: Riot don't let me amz3`: nvm amz3`: happy_gnu[m]: what are you interested in? amz3`: happy_gnu[m]: maybe you like artificial intelligence? happy_gnu[m]: Well for now I am just starting to learn programming OrangeShark: amz3`: You need to add some images for guile wiredtiger so they can show up! happy_gnu[m]: :) amz3`: oh you are getting started programming, I did not know I was under the impression that guile yet another programming language you knew amz3`: OrangeShark: that's a good idea OrangeShark: like a logo happy_gnu[m]: I just know a little python and JavaScript but nothing much happy_gnu[m]: I read on github Open Source University and started doing a course called how to design data amz3`: happy_gnu[m]: what project did you already start in all those languages? happy_gnu[m]: But I felt like I wasn't learning amz3`: happy_gnu[m]: I don't know those happy_gnu[m]: So I read about the course and discovered that it was scheme amz3`: happy_gnu[m]: well reading or listenning doesn't feel like you know programming because you don't actualy write code but it helps to read & listen happy_gnu[m]: So I decided to Learn and started reading SICP and the little schemer amz3`: SICP is full of exercices amz3`: I know only 'reasoned schemer' book, but I guess it's a good teaching material OrangeShark: happy_gnu[m]: how to design data is the course using racket, isn't it? happy_gnu[m]: I've done simple projects a few websites and a lot of exercises happy_gnu[m]: Yes it is OrangeShark happy_gnu[m]: But they don't really teach scheme I felt like was doing the things but I wasn't understanding why happy_gnu[m]: That is why I also dropped Free Code Camp happy_gnu[m]: But SICP is awesome I understand why I do each thing happy_gnu[m]: And I feel like there is nothing I can't do or understand happy_gnu[m]: Of course I've got a lot to learn but the possibilities are infinite happy_gnu[m]: In python or JavaScript I always felt I was too stupid to write the that made "for" or "while" OrangeShark: happy_gnu[m]: wasn't sure which to use? happy_gnu[m]: No I meant happy_gnu[m]: I can write a "new-for" loop in scheme like the new-if of SICP OrangeShark: ohh happy_gnu[m]: But in JavaScript I can't write a new-if or a new-foc happy_gnu[m]: New-for OrangeShark: yeah, basically how lisp allows you to easily extend the language. That is definitely one of the cool features of lisp amz3`: yes you can't really do that without macros amz3`: that said, javascripters successfully extended the language via things like babel OrangeShark: there is also sweet.js for macros amz3`: if only GNU Guile had a marketing departerment ;) amz3`: it would win the language war OrangeShark: so amz3` what have you been up to? happy_gnu[m]: Is so awesome happy_gnu[m]: I teached my brother in 10 minutes happy_gnu[m]: More that I learned with python in 1 month :/ amz3`: OrangeShark: well... I was not doing guile stuff lately, I think I will do python/javascript freelance so I am kind of preparing a porfolio of some sort amz3`: I promised mwette to try libgit2 bindings generated with his helper amz3`: that's all! amz3`: OrangeShark: and you? OrangeShark: that binding generator looks promising :) OrangeShark: I have mostly been busy work, also reading some software books. I am hoping to get back to working on guile related projects now. amz3`: OrangeShark: what kind of book? OrangeShark: currently code complete, it a software engineering book on software construction amz3`: ok amz3`: at work, we had a presentation about what do with legacy code, it was quiet interesting amz3`: I did not knew that in english it was called 'legacy code' amz3`: in french, we say "historical code" or "old code" OrangeShark: well legacy code might have different meaning to people OrangeShark: some people define it as "code with no tests" OrangeShark: there is a good book on legacy code called "Working Effectively with Legacy Code" amz3`: that's the book the presentation was based on OrangeShark: oh! amz3`: legacy code is rusty code for me, this includes code wihtout test amz3`: he also talked about tests pyramid amz3`: where basically, you have a lot of unit tests, the higher level the test is the less of them there is amz3`: so it makes a pyramid OrangeShark: yup, that is generally how it is amz3`: like for instance, he argued that there should never be a lot of selenium tests OrangeShark: higher level tests also tend to run longer amz3`: yep OrangeShark: unit tests should run fast, because you want to keep running them as you develop your code cmaloney: amz3: No, what is that? daviid: in a standard commit log, we add affected procedures 'names' in parens, before the ':', so when we change the name of a procedure, in that list should we list the new or the old (asking because the old does not exist anymore...)? cmaloney: (tzag) OrangeShark: happy friday dsmith-work: Happy Friday, Guilers!! happy_gnu[m]: \\o/ happy friday dsmith-work: Aww. dsmith-work: Where did sneek go? dsmith-work: Can anyone tell me when sneek left? dsmith-work: Like maybe the 14th? janneke: definately maybe stratotanker: Hi everyone ijp: dsmith-work: probably when half of freenode got kicked? stratotanker: someone can help me with guile foreign ? ijp: we won't know until you tell us what your problem is :) dustyweb: o/ stratotanker: solved myself, thanks! ArneBab: amz3`: if you want to build a social network, you need to think about scaling it, so you need a way to remove no longer needed data (though I don’t think GNU social provides this). cmaloney: amz3: This sounds like that git-annex project for backups cmaloney: I'm not sure that would scale well. ;) cmaloney: amz3: I think a book like Realm of Racker for Guile would be pretty sweet cmaloney: Though I think DrRacket makes a book like that more convenient cmaloney: since you're not fighting with platform strangeness as much felipebalbi: while building guile-2.2.2 (from git) I get a lot of "ERROR: In procedure load-thunk-from-memory: No such file or directory". For several of the files under bootstrap felipebalbi: any hints? Apteryx: I think the bootstrap is using guile@2.0? I'm not sure why building guile 2.2.2 would affect it? Apteryx: oh, sorry, I thought this was a Guix question somehow. Apteryx: Hello; would anyone know how I can statically link Guile with the readline library? dsmith-work: Morning Greetings, Guilers davexunit: Apteryx: I'm not sure that is possible davexunit: guile's readline integration uses the dynamic linker to load it at runtime Apteryx: davexunit: OK. I'm not knowledgeable with autoconf, but I thought I can maybe supply some variable there to have it buils statically instead? Apteryx: built* davexunit: it's beyond an autoconf thing davexunit: readline support is activated via a guile module at runtime that uses the dynamic linker to open the readline shared library davexunit: maybe there is a way to statically link it, but it's very unlikely that it's as easy as a gcc flag or something Apteryx: davexunit: OK, thanks for the disclaimer :) Apteryx: One interesting bit is that there is this file: /gnu/store/xxi8scxxx8g6i9h0lm57i5kc3xwcgj5r-guile-static-2.0.14/lib/libguilereadline-v-18.a for the guile-static@2.0 package in Guix. Apteryx: This is the package used in the initrd; it'd be nice to have readline support there! dsmith-work: There is also the license difference between Guile and libreadline. One (the?) reason readline is dynamically loaded and not loaded by default. dsmith-work: I think it could be posisble to link libreadline.a and libguile.a into an application. You would still need to load the module and call (activate-readline). dsmith-work: No one does static linking though, so the code may have bitrotted. davexunit: dsmith-work: I haven't read the source but activate-readline could very well unconditionally call on the dynamic linker to do the work davexunit: if static linking is possible somehow there would be no problem wrt licensing for guix. the resulting guile would be distributed under the gpl and that's just fine Apteryx: dsmith-work: Based on the guile-static package definition in Guix, it seems that setting guile_LDFLAGS = -all-static in the Makefile.in should accomplish that. random-nick: it's also be nice if the guile repl had some basic line editing support random-nick: s/it's/it'd/ Apteryx: Oh, it also sets the configre flags: --disable-shared" "LDFLAGS=-static Apteryx: I'll have a look at the build log davexunit: it doesn't incorporate readline, though davexunit: I took a look at the source and here's what I've learned davexunit: guile contains a GPL licensed extension called guile-readline davexunit: it's a C extension + some supporting scheme code davexunit: the C extension is a shared library. it ought to be possible to statically link readline into that shared object davexunit: but AFAIK (someone correct me if I'm wrong) guile extensions are always loaded via the dynamic linker davexunit: I know of no way to statically link guile extensions into a guile executable Apteryx: Thanks for the detective work! This is interesting. It seems it'd be a useful feature; I can think that when embedding Guile, to have it fully static would desirable. amz3`: someone here was working on a guile repl with line editing support, I don't remember who amz3`: based on ncurses iirc davexunit: Apteryx: yeah so I think the follow-up to this would be to see if a guile maintainer could chime in on what they think of statically linked extensions amz3`: ecraven: is that you ? davexunit: the guixsd initrd is a good use-case for it Apteryx: OK. I'll try to formulate something comprehensible to send to guile-devel; is this the right mailing list? CharlieBrown: Does Guile WM work yet? CharlieBrown: I see a commit from this year. CharlieBrown: https://github.com/mwitmer/guile-wm davexunit: oh wow, mwitmer is alive and committing davexunit: maybe he'll make a comeback davexunit: I guess he's been using guile-wm silently this whole time janneke: yay! CharlieBrown: I don't want to go thru the effort of building StumpWM. dustyweb: I use stumpwm, it's ok. CharlieBrown: davexunit: Hey, he [fixed it for Guile 2.2](https://github.com/mwitmer/guile-xcb/commit/3d25fcb177141c235dbaf2c7e934e3c00bfddb1f)! dustyweb: I pretty much set it up for my basic needs and left it there dustyweb: especially because I still don't trust the SLIME live hacking since they didn't fix the localhost spoofing thing yet Guest69444: hello :) CharlieBrown: Man, I want GuixSD with Guile WM and Guile Emacs. Guest69444: Do anyone here has a project that a begginer like me can help :) ?? CharlieBrown: Guest69444: Fix Guile Emacs. CharlieBrown: :P Guest69444: CharlieBrown: that seems cool but, I think it is too complex for me :/ CharlieBrown: Guest69444: Write a Guix package for a simple program like mcwm. I alrady started: https://launchpad.net/calher-mcwm-guix CharlieBrown: mcwm has only one dependency, it should be easy. dustyweb: hi Guest69444 dustyweb: welcome to #guile :) Guest69444: dustyweb: hi :) dustyweb: Guest69444: writing packages for Guix is indeed a nice way to get started, but it also has a lot of its own overhead dustyweb: Guest69444: what have you done so far? or are you just getting started? dustyweb: are you familiar with lisp or scheme before Guile? Guest69444: dustyweb: yes sorry, I have almost finished the little schemer dustyweb: Guest69444: awesome! janneke: CharlieBrown: i'm running emacs-exwm which is not too bad dustyweb: Little Schemer is fabulous. Guest69444: I've read like 250 pages of SICP Guest69444: I use emacs dustyweb: Guest69444: you're more than prepared to hack on things then :) Guest69444: And I am reading also the land of lisp davexunit: sometimes writing shell scripts in guile is a fun way to get into things davexunit: solve a real problem with some scheme code dustyweb: that can be fun too dustyweb: Guest69444: what are *you* interested in? CharlieBrown: janneke: I've thought about exwm, but can it do floating? Guest69444: I did the first edx How to design data Guest69444: the one based on how to design programs janneke: CharlieBrown: supposedly it can... dustyweb: Guest69444: if you aren't totally sure, I do recommend writing some simple guix packages as an early way to get started... it helped me. but I also worked on some projects that I really wanted CharlieBrown: davexunit: How can shell scipts be written in Guile? I'd like to get out of Bash, since it's unfashionable to write shell. Guest69444: I have a little experience with javascript and python, but pretty basic too janneke: CharlieBrown: i used stumpwm before and i never got that into sane floating Guest69444: dustyweb: so I should install guix? dustyweb: Guest69444: I recommend it; Guix is also kind of Guile's de-facto package manager these days dustyweb: so that's another reason to do it :) dustyweb: Guest69444: there are some videos on the Guix homepage that may give you an interesting overview Guest69444: do you mean like creating my own package, or packaging something like i.e. pidgin or something CharlieBrown: Guest69444: The init system is written in Scheme. dustyweb: Guest69444: yes, package something that exists as a good first step dustyweb: find, what do you wish was packaged there? and package that :) Guest69444: yes I should use guix, it uses linux-libre and libre drivers right? CharlieBrown: janneke: If your computer won't boot, you can at least compute with it: (+ 2 2) dustyweb: Guest69444: if you use it as a distro (GuixSD). You can also use it as a package manager on top of another GNU/Linux distro CharlieBrown: janneke: Stumpwm has a float extension Guest69444: dustyweb: well I think going full guix will help me too :) dustyweb: Guest69444: awesome! It's a lot of fun :) CharlieBrown: Guest69444: packaging software for guix, like the mcwm i suggested witch is a tiny program with only one dep that's in guix already Guest69444: ok so I install guix and then I package something right? Guest69444: CharlieBrown: it is a windows manager written in guile right? janneke: CharlieBrown: is that packaged with guix? dustyweb: Guest69444: if that's what you want to package, go for it, but find something you want dustyweb: scratching your own itch is a good way to move forward and stay motivated CharlieBrown: Guest69444: no, mcwm is a tiny c program. i wish a guile wm reimplemented its features, though, so i could live-hack it with scheme Guest69444: dustyweb: to be honest I am a little afraid of not understanding things Guest69444: I feel like I can do small scripts that do nothing interesting rekado_: The website hosting the Guile WM tarball has disappeared :( CharlieBrown: janneke: mcwm is not pkg'd with guix, whcih is why im trying to convince Guest69444 to pkg it lol CharlieBrown: b/c it's real simple CharlieBrown: rekado_: yes, mwitmer's domain expired. github still has it tho Guest69444: but I don't know C CharlieBrown, do I need to know? CharlieBrown: Guest69444: you don't neeed to know c to build a program CharlieBrown: written in c CharlieBrown: just compile it using the guix tools CharlieBrown: and make that a pkg def dustyweb: CharlieBrown: if Guest69444 wants to package that it's fine but, they should work on what they're interested in dustyweb: so they can look and see :) CharlieBrown: dustyweb: i can still try davexunit: guix *may* be a bridge too far for a guile beginner right now dustyweb: Guest69444: don't be too afraid of having trouble dustyweb: you can't imagine the kinds of mistakes I made early on :) CharlieBrown: tbh, i dont need mcwm the most rn. what i need most on guix is Ekiga CharlieBrown: i use ekiga to call my mom Guest69444: I feel desperate because I want to do GUI's and useful things davexunit: dustyweb has the right idea. scratch an itch. Guest69444: but then I read code Guest69444: And I don't understand a thing Guest69444: someone elses code dustyweb: Guest69444: it took me a lonnnnng time until I understood the majority of guile code I read dustyweb: it gets easier over time Guest69444: programming is hard :/ CharlieBrown: Guest69444: write nice wrappers around already existing tools, to give them a gui so ppl dont have to use the cli CharlieBrown: wrappers are easy dustyweb: hmmmmmm that's not necessarily so dustyweb: wrappers are a lot of gruntwork janneke: Guest69444: "GUI's and useful things" in one sentence ;-) Guest69444: how do I do a GUI with guile? dustyweb: Guest69444: our GUI options are kind of limited right now. guile-gnome is probably the most fleshed out system davexunit: Guest69444: I wouldn't recommend trying GUI programs with Guile right now. there is no beginner friendly option right now. dustyweb: Guest69444: most of the stuff I do is webdev so most of it is sxml -> html ;) Guest69444: janneke: I do understand that CLI is great but for majority of people it is too hard CharlieBrown: Guest69444: the gtk bindings for guile have major suck Guest69444: ok oh dustyweb: CharlieBrown: be nice please Guest69444: so I will stuck to CLI davexunit: a web UI is much more feasible, *if* you already know how to do html and such dustyweb: yeah Guest69444: I do know html css and javascript dustyweb: Guest69444: oh cool CharlieBrown: dustyweb: it's ok to be mean to programs. Guest69444: not expert, but I've done a few websites dustyweb: Guest69444: so the guile manual has a nice tutorial on getting started with webdev stuff Guest69444: I don't know server side though :/ rekado_: are the gtk bindings provided by guile-gnome? Or is this something else. CharlieBrown: davexunit: why does guile's gtk binding suck? dustyweb: Guest69444: it's a lot to take in but really interesting Guest69444: oh dustyweb cool!! Guest69444: ok I will download guix davexunit: CharlieBrown: I wouldn't use that word. Guest69444: and try it rekado_: CharlieBrown: most programs have authors. davexunit: gtk is a *big* library Guest69444: let me connect here from my main account davexunit: writing a good wrapper that fits in with the host language well is difficult Guest69444: the Riot one davexunit: guile-gnome is not currently up to date with the latest gtk, it's a work-in-progress CharlieBrown: davexunit: if you want to get into a language war, i will have you know that 'suck' has nothing to do with a human activity. it has to do with an animal activity between cow and calf CharlieBrown: so it's not bad Guest69444: is I3wm in guix? CharlieBrown: yes Guest69444: that is good enough for me then :) dustyweb: \\o/ Guest69444: I haven't used another wm Guest69444: but someone suggested me to try a Common Lisp WM rekado_: stumpwm is a common lisp wm Guest69444: yes that one dustyweb: yeah that's probably what was suggested Guest69444: is it on guix? rekado_: I found it adequate. rekado_: yes dustyweb: yeah that's what I run dustyweb: it does the job, and it's written in a lisp :) rekado_: but I haven’t been able to control it from within Emacs rekado_: dustyweb: have you got SLIME and stumpwm interaction working? dustyweb: rekado_: I did and I disabled it because they haven't dealt with the localhost rebinding attack we fixed in guile yet rekado_: oh dustyweb: and by we I mean Mark Weaver :) rekado_: heh :) dustyweb: yeah, bummer :( rekado_: when people say that Guile WM isn’t quite usable yet and needs a champion,… what exactly does that mean? rekado_: does it crash often or does it just lack features? davexunit: rekado_: I encountered a bug that completely locked it up and I had to restart X davexunit: and I had no luck trying to identify the issue rekado_: oof davexunit: some bad key combo I did davexunit: problems like that are tough to deal with without an active maintainer rekado_: is it still worth working on an X11 window manager, or should one rather hack up a window manager for wayland? dustyweb: I think a wayland wm would be amazing janneke: guile-emacs-wayland-wm Guest69444: I am happy_gnu[m] :) davexunit: rekado_: wayland would be the more forward looking thing. the developer of guile-wm wanted to explore wayland support. davexunit: if anyone is interested in wayland, the first step is a libwayland (or whatever it is called) wrapper library dustyweb: oh hey happy_gnu[m] :) dustyweb: I am paroneayea :) paroneayea: just to make life complicated ;) happy_gnu[m]: Hei happy_gnu[m]: I use Riot to connect here paroneayea: happy_gnu[m]: great to hear that you went forward with studying little schemer and sicp and etc since we last talked :D paroneayea: that's super awesome. Guest69444: paroneayea: yes thanks :) Riot is on my phone so is harder to use the happy_gnu[m] right now.. Guest69444: paroneayea: I am trying to do some real programming now Guest69444: that is why I was asking about a project to help Guest69444: I didn't avanced much the last month because I was on rehabilitation, because I was hurt on my knees and back Guest69444: But I want to keep learning now :) CharlieBrown: davexunit: do i need to prove to you that my insult to guile-gnome has no lewd etymology, so you won't be offended by everyday language? paroneayea: cool Guest69444 :) paroneayea: Guest69444: sorry to hear about your injury though :( paroneayea: Guest69444: it sounds like you want to work on things but don't really know where to start; my suggestion would be paroneayea: Guest69444: write a fun little web application, something simple, following the guile web tutorial paroneayea: Guest69444: from there, maybe install guix and contribute a package? paroneayea: that would be a pretty good on-ramp I think paroneayea: and I'm sure we'd love to have your help in Guix-land :) CharlieBrown: davexunit: I'm put on heavy defensive, because you made issue with something that was far removed from the idea I was conveying using standard speech. Guest69444: do I need to learn about apache and mysql and that? paroneayea: Guest69444: nope! Guest69444: ok then let me start :) paroneayea: CharlieBrown: I can't speak for davexunit, but what I'd like is for you to stop escalating this conversation aggressively paroneayea: just cool it down Guest69444: I realy like web applications :) paroneayea: Guest69444: :) CharlieBrown: paroneayea: I'm scared I'll use the phase again by accident, and get banned. Guest69444: I have seen a lot of guile making references to C, should I learn C? I mean I plan to eventually, but for now? paroneayea: Guest69444: you don't need to know C paroneayea: Guest69444: Guile is built on C and for historical reasons is a good language for embedding in C paroneayea: but you don't have to write any C stuff paroneayea: I don't know C very well paroneayea: and am doing a lot in Guile paroneayea: just skip those sections for now :) Guest69444: oh ok paroneayea, well I will start reading now Guest69444: thank you so much :) Guest69444: I hope to advance more now, that I am better, I was counting, it is actually almost 2 months I've been on therapy :/. For a while I couldn't even walk Guest69444: I was so desperate to be back :) rekado_: CharlieBrown: don’t. Just don’t dwell on it. rekado_: CharlieBrown: remember that comments like this can make the authors of the software rather sad. Guest69444: rekado_: your nick seems familiar, do you visit trisquel forums? paroneayea: Guest69444: glad to hear you're doing better Guest69444: thanks :) rekado_: Guest69444: no, I’ve never been there. Guest69444: rekado_: oh ok, my mistake then ijp: paroneayea: I don't have much of an update for you, but I hope to have a draft for you tomorrow paroneayea: ijp: ok, cool thanks cmaloney: I like that the first video on concurrent ML is wingo's talk at Curry On dustyweb: cmaloney: :) mwette: My FFI helper can now compile cairo.h, gdbm.h, sqlite3.h, git2.h to scheme. mwette: I am still having a few issues. If types are defined outside of the collection of dot-h files my helper should expand those types. It is not going all the way down (into structs) yet, so I am running into undefined type from compiling rsvg.h, which pulls in tons of stuff from glib-object.h amz3: o/ rekado: mwette: I find your work on an FFI helper really exciting! dsmith-work: Wednesday Greetings, Guilers cmaloney: (tzag) cmaloney: ACTION wonders if typesafe racket might be fun in the browser. cmaloney: ala Elm zacts: hi #guile ArneBab: wisp 0.9.2 released: http://www.draketo.de/english/wisp#v0.9.2 with many additional examples including the proof-of-concept for a minimum ceremony dialog-based game duel.w and the datatype benchmarks in benchmark.w ArneBab: manumanumanu: that means that racket plus chez is a really powerful combination … but then I also remember how fast Guile became with the PoC compost: https://wingolog.org/archives/2014/02/18/compost-a-leaf-function-compiler-for-guile ijp: I'm still somewhat surprised by the racket+chez announcement ArneBab: same for me, let’s see how it plays out manumanumanu: ArneBab: I doubt it will bring _that_ much speed. chez isn't more than 2x faster on average, and the racket runtime surely has some cost manumanumanu: but there are other neat things manumanumanu: of course ijp: wingo: I probably won't be back on this evening, but I was wondering if I could have a word with you tomorrow about my GSOC work, nothing exciting, just licensing, coding standards etc. ijp: just give me a ping whenever you are free amz3`: héllo all amz3`: I got an idea for a append-only static social network powered by git amz3`: that a long sentence with a lot of buzz words amz3`: it works, like other projects powered by git amz3`: using pull-requests or another way to push changes to another git instance amz3`: the workflow is the following: amz3`: a) you git clone a repository where this social network lives amz3`: b) you register an account, this will create an entry for your username in the social network database (more on that later) with a rsa public key amz3`: and associated private key is stored in another directory ignored by git amz3`: encrypted with a password amz3`: well that's detail amz3`: at this you can create a commit with your username+public-key amz3`: c) you can build the whole social network into a set of static html files amz3`: sorry, the site is not static amz3`: actually c) is that the git repository hosts both a database of json (or scheme) documents. Like an account is a document with 'username' key and 'public-key' key dict (or respectively in the case of scheme alist) amz3`: so, as static files, it's easy to keep track of them amz3`: and audit incoming change requests amz3`: since the database is append-only it's also easy to see if someone is trying to tamper some data amz3`: s/tamper/edit/ amz3`: edits happens via copies amz3`: so you have to copy a document, edit it, and sign it yourself amz3`: a documentation that is not signed is not valid amz3`: s/documentation/document/ amz3`: and every documentation signature must be correct to be sure who created what amz3`: hence there is this database of flat files amz3`: it's easy to imagine that it's possible to build anything on top of it amz3`: ACTION trying to pitch his idea amz3`: the other thing the git repository is hosting, is the code running the website on top of that database amz3`: the point in using git, is to make it easy to share copies of the "website" with other people while still allowing them to 1) have a full copy of the website b) be able to edit it like via an UI amz3`: (it's difficult to create the database files by hand even if possible) amz3`: anwyay amz3`: I am not here to ask for help to code it amz3`: actually, what I am wondering is whether my guile fellow contributors would be interested to in a social network around GNU Guile amz3`: and what kind of social network it should be amz3`: It not necessarly a "social" network amz3`: but more like a collaborative work amz3`: (social network is collaborative work but anyway) amz3`: the thing I am thinking about is a book amz3`: what do you think about another book about guile? amz3`: please ping here or use amirouche@hypermove.net if you are interested in taking part in this amz3`: ah amz3`: last words amz3`: nvm amz3`: maybe it's a bad idea, one could simply use texinfo and a mailinglist but the mailing will not be in the git repo and the git repo still need a way to process pull requests amz3`: something like... email. amz3`: this is a bad idea. amz3`: sorry for the noise edrex: hi, i am a scheme newb trying to configure xbindkeys, and I have a question about timers/threads: edrex: I want to evaluate a function after a certain timeout has passed, in another thread. How can I do such a thing? edrex: Is this a good place to ask language questions like that, or only for dev chat? ArneBab: manumanumanu: thank you for the info! cmaloney: edrex: it hink this is the place to ask a question like this cmaloney: So you're looking to do some form of event-based coding where a timer triggers an event? cmaloney: edrex: Also: have you looked at fibers? edrex: cmaloney: yes, i want to evaluate a function after a timeout. edrex: *looking..* edrex: ideal it wouldn't require any libraries outside the stdlib, since this is going in my xbindkeysrc.scm cmaloney: You can check out signals as well : https://www.gnu.org/software/guile/manual/html_node/Signals.html cmaloney: that might work? cmaloney: sig_alarm possibly? edrex: yeah, i was reading that. If I knew how to create a new thread, I could probably use that to block it until a timeout occurs? cmaloney: yeah, I'm sort of new here so I don't know how you'd do that cmaloney: though you might be able to create the alarm. I know under UNIX (iirc) it will still interrupt and run the alarm code cmaloney: since the alarm signal is sent separately edrex: oh, interesting.. ok, i've got to hop off, but I'll try that and report back. cmaloney: edrex: No worries. Let us know if it works. :) manumanumanu: Morning guilers! civodul: hey there! civodul: wingo: did you have a chance to look at the dreaded quadratic GC issue? cmaloney: (tzag) civodul: hi! :-) dustyweb: heya! ddp: it’s so nice seeing the whole gang back together... ddp: that was obviously the wrong window. i think maybe i better just log out of freenode until after the burn is done ddp: yes, that’s a good plan amz3: o/ OrangeShark: hello everyone tohoyn: does anybody know about guile syntax objects? tohoyn: I need to know where the (syntax x) forms are compiled tohoyn: has anybody made a Debian package for guile 2.2? apacuro: Is it possible to mix C code with macro programming ? random-nick: what do you mean by that? random-nick: using macros in C? C only has CPP macros which operate on simple text substitution apacuro: Let's say I want to implement a type system within guile, apacuro: and I want to use a C-implemented hash, to store the type-variable association apacuro: Is that possible ? random-nick: why would you want a C implemented hash for that? random-nick: I think you can do it by using the FFI in macro-expansion time with eval-when random-nick: see the API reference for eval-when and the FFI apacuro: [looking at that right now] cmaloney: morning joolean: Howdy, Guilers! joolean: So, I’m finding `syntax-module’ very useful, but I find that it’s only reliable in the context of `eval-when (load)’. I.e., `(import (foo module)) (syntax-module foo)’ => `(guile user)’ whereas `(import (foo module)) (eval-when (load) (syntax-module foo))’ => `(foo module)’. joolean: I think I know why this is happening, but is this the expected behavior? wingo: joolean: what about (begin (import (foo module)) (syntax-module foo)) wingo: just wondering joolean: Hey wingo! I’ll try that. wingo: there are some differences based on whether it's two top-level expressions or one joolean: Sorry to hear about the Paul Graham thing, by the way :) wingo: lol joolean: If you’d like I can send you a digest of his worst, most-inhumane thoughts wingo: that's since years ago, and that guy is a jerk anyway :) joolean: ha joolean: wingo: Doesn’t seem to make a difference. wingo: yeah, sorry then :/ wingo: guile's expand-time mapping of what module is current is kinda wonky joolean: Would you accept a patch to add some docs around that? joolean: Or is it wonky enough that you’d prefer people stay away cmaloney: for those of us tuning in: what's up with PaulG, the walking horoscope of advice? wingo: joolean: i dunno, it's somewhere in between the two of those things joolean: ha wingo: like, it's something i would rather fix than document; but perhaps that is not the useful approach joolean: oh, I mean, I guess I meant do you want people to stay away from `syntax-module’ itself? joolean: there are some ominous comments about it in the manual wingo: no, i mean i would rather have a better story about how top-level binding resolution works joolean: gotcha. Okay. wingo: syntax-module is fine :) joolean: phew cmaloney: "here be dragons"? :) wingo: "and this is a taxonomy of the dragons found herein..." :) cmaloney: :D cmaloney: completely unrelated: been playing around with Elm a bit and I have to thank guile for having a snappy REPL cmaloney: Elm's REPL's syntax checking makes it noticably slow cmaloney: (and not just the first statement execution like Racket) ArneBab: I did a basic geometric mean evaluation of the results from ecraven, and it shows a remaining factor 8 distance from chez ArneBab: (so chez takes on average 1.87-times as long as the fastest while Guile takes on average 15 times as long as the fastest) ArneBab: (expt (apply * result) (/ 1 (length result))) ArneBab: (this finally gives me a feeling how programs would perform when run under Chez) ArneBab: listing only the schemes with at least 54 successful tests: Chez 1.9, Gambitc 2.8, Larceny 4.4, Racket 4.7, Petite 12.0, Cyclone 13.3 Guile 15.4 Gauche 18.7, Sagittarius 21.5 ArneBab: so there’s still quite a bit space for improvement for Guile on this benchmark ArneBab: (and with Racket switching to Chez, it should close the gap between Scheme and Java/Go/C#/Ada/Swift) ArneBab: (/Fortran) ArneBab: (/Chapel) amz3`: \\o/ amz3`: where is sneek? amz3`: erf! dustyweb: o/ cmaloney: howdy cmaloney: part of the fun of being married to a college astronomy professor: we're doing science here. manumanumanu: ArneBab: I finished the first 100 or so problems of project euler with both guile and chez. Chez is friggin fast, but has no batteries included. That's why I started Nietzsche. I have a lazy prime sieve somewhere in my bitbucket repo, and that one beat the Haskell one I copied by so much it wasn't even funny manumanumanu: ArneBab: and chez sometimes gives you weird or no error messages, which is sad avoine: rekado: Did you found a solution for serializing Scheme code? rekado: avoine: no, I have not, because it probably isn’t really what I actually wanted. dustyweb: heya rekado_ wingo: rekado_: i thought i traced there and then after another 10 hours of tracing i was more confused! will work on it tho. wingo: on my list. rekado_: wingo: thanks! This sounds hairy. amz3`: o/ manumanumanu: heyo amz3`: ACTION trying to add auto indentation to my editor amz3`: seems like the first step is to convert scheme to an ast amz3`: does something like that exist in guile? amz3`: I was under the impression that scheme syntax was its *own* ast amz3`: so not sure how this will help amz3`: manumanumanu: what's your next project? djcb: trying to use meson for my guile/c project (with installing go files, snarfing etc.) amz3`: meson? djcb: did anyone already do something similar? djcb: meson the hipster build system amz3`: oh reading about it on wikipedia, https://en.wikipedia.org/wiki/Meson_(software) amz3`: what does snarfing mean? amz3`: means* amz3`: or mean? amz3`: first time I read about meson myself djcb: see the fine guile reference manual for snarfing djcb: basically, making c function visible to guile amz3`: ok amz3`: got it amz3`: https://www.gnu.org/software/guile/manual/html_node/Function-Snarfing.html#Function-Snarfing manumanumanu: amz3`: I have some small kinks to iron out of the loops (adding your own sequences, etc), other than that I am thinking of writing a library to conveniently translate "cat hello | wc -l ..." into scheme. manumanumanu: and talking about that: how would one close wc -l and still get the output from it? manumanumanu: should I manually write an eof to the port? manumanumanu: pipe*? amz3`: manumanumanu: ha, I have patch for that amz3`: I think amz3`: let me look it up manumanumanu: in chez you get a couple of ports, and it is just a matter of closing the correct one. amz3`: yes, guile has that, but the procedure is not public yet amz3`: https://lists.gnu.org/archive/html/bug-guile/2016-09/msg00008.html amz3`: manumanumanu: so you know 'chez', what lead you to move to guile? manumanumanu: amz3`: chez is not as much fun. amz3`: manumanumanu: the example use html2text, which requires you to close the input port before being able to retrieve the result in the output port, markdown command works similarly amz3`: manumanumanu: really manumanumanu: sweet. thank you amz3`: manumanumanu: that said, "cat hello | wc -l ..." is different in that there is pipe manumanumanu: I know. I have to find a nice schemey syntax for it amz3`: oh amz3`: stis: what's the advantage of using cps instead of prompts? amz3`: In the context about your parser combinator library stis: no buildup of stack, perfect to combine with fibers if you like, you can maintain the "stack" separate from the guile stack, which I like as a concept and I can add features that else needs perhaps hacks inside guile . stis: The combinators is ontop of a logic solver like prolog or kanren, and the feature of having cps is nice some times stis: for core functionality, they are interchangeable stis: Ig I had a solver with prompts in stead, I would have used that actually. stis: I actually took guile-log logic engine and ported it to pure guile scheme with no c-code addition and ontop of that made a separate self containe parser combinartor engine that has all the features of the one in guile-log amz3`: makes sens amz3`: so stis parser is using kanren to implement parser combinators? is that correct? stis: no but a similar macrology, easy to make a kanren out of it dmiles: oh i remember a feature i wanted to think would be usefull in guilelog (i couldnt remember it a couple years ago i think) would be the abily to construct a loop and have the interaton of that loop leached by prolog.. example (create-intervar ?MyVar (map (lambda () '(1 2 3 4 5 6))) dmiles: leased* dmiles: so the ?MyVar gets initially 1 and leave a coice point.. on REDO its gets 2 dmiles: i guess somewhere in the loop there would be a (bind ?MyVar ...) that makes the loop pause right there and return control dmiles: or even a (yeild ...) that binds the var to the ... dmiles: so like (create-intervar ?MyVar (foreach ((number '(1 2 3 4 5)) (letter '(a b c d e))) (yield (list number letter)))) dmiles: and then the inversion of this to.. (do ()()((prolog-has-redo)) (display ?MyVar )) dmiles: Oh i guess it needs to make thje clas happen to dmiles: the call* ennoausberlin: Hello guix, does someone know a few real world examples for the PEG parser implementation of guile. I read the manual, but didnt fully understand amz3`: it's not guix amz3`: it's not #guix ennoausberlin: amz3`: You are right. :) I visit both channels. Just a typo amz3`: and I don't know example code using peg parser amz3`: ennoausberlin: what are you trying to parse? ennoausberlin: amz3`: logfiles. Just to understand how peg works. Some lines contain info some other error messages. ennoausberlin: Peg looks like a powerful tools. I ennoausberlin: want to master it, like regex ennoausberlin: For now I modified the passwd example, but logfiles structure does not fit amz3`: sigh amz3`: why nobody tried to push parser combinators? amz3`: afaict ennoausberlin is on a hell of ride with peg parser amz3`: anyway ennoausberlin: amz3`: found http://hyperdev.fr/notes/getting-started-with-guile-parser-combinators.html ennoausberlin: thanks for the pointer amz3`: ennoausberlin: afaik it's easier to work with paser combinators that PEG ijp: many implementations of parser combinators in non-lazy languages are annoying and leak that non-laziness ijp: I wrote an iteratee based version ages back, but then iteratees became unfashionable amz3`: what do you mean by "leak that non-laziness" ? amz3`: what language is lazy outside haskell? manumanumanu: Happy saturday, guilers! amz3: \\o/ stis: yey! amz3: time for some guile hacking! amz3: I am wondering what to do next amz3: maybe hack on my toy editor amz3: or improve guile-wiredtiger amz3: or create some webapp with guile-squee amz3: to use something that is standard and show that it's possible to do regular webdev in guile amz3: s/regular/casual/ ;) amz3: or improve somehow forward.scm manumanumanu: amz3: i'd like to be able to write web stuff, but I am too stupid for web development. amz3: manumanumanu: oh! amz3: first time I read, web dev is complicated amz3: I was under the impression that webdev was 'programming for the dummies' kind of thing.. amz3: maybe i have impostor syndrom or something amz3: well the problem with webdev, is that you need to know: HTML, CSS, JS and Guile amz3: manumanumanu: what do you find complicated in webdev? manumanumanu: I can't understand front end stuff amz3: then it's prolly GUI development that's is the culprit amz3: maybe start with desktop GUI dev and later try to understand webdev frontend amz3: I don't remember how I jumped into frontend dev, I learned webdev as thing evolved, so in the beginning it was very easy since there was not a lot to know about manumanumanu: amz3: mostly it is the web development that itches. I hate html/css and js. I can't wrap my head around it. Give me qt any day of the week. :) rekado: wingo: do you happen to know a fix for the memory bloat when compiling large files with Guile 2.2? I vaguely remember that you traced it to the garbage collector. ArneBab_: Amynka: well-done webdev is pretty complicated these days: You have to know visual and interaction design, the browser, the server (from the libraries to the hardware), the connection between both, details of TCP and HTTP, often also databases and distributing a system between several physical or virtual systems, and you need to combine all that to build a system which has an initial load time *at the client* of less than 1 second — while you ArneBab_: already lose 100ms per round trip. And you have to keep the complexity low enough to be managable for humans. Amynka: ArneBab_: was it for me? Amynka: is* ArneBab_: Amynka: argl, sorry, no, it was for amz3, but you were first on the tab-completion list … Amynka: haha no worries :) ArneBab_: manumanumanu: I’d start by noting the data that needs to be shown, than doodling how it should look and how people can navigate, and only then realizing that in HTML+CSS: HTML is the content, CSS positions it. Put stuff which the user needs right away (the main content) earlier into the HTML file. ArneBab_: JS comes in for anything which you can’t do easily with HTML+CSS, mainly updating only parts of the site. ArneBab_: (what would have been done with frames earlier) manumanumanu: ArneBab_: nah. I have no interest. Managed to scrape koketteriet.se together, which is good enough for my needs. ArneBab_: no probs :) manumanumanu: every time I try web dev I just realise that life is too valuable :) manumanumanu: So, I have realised that cut and and-let* are my two favourite srfis. Are there any neat ones I have missed? amz3: http://i.imgur.com/xm49sQK.jpg amz3: create a persistent datastructure library amz3: compile it to javascript amz3: ... amz3: profit amz3: https://github.com/swannodette/mori amz3: ijp: you are talking about lambda* or lambda? amz3: I see nothing special in lambda* nor lambda ijp: amz3: the difficulty with guile is that keywords are not always keyword arguments e.g. (list #:foo) returns a list containing a keyword ijp: also, it's not just lambda*, but case-lambda amz3: yeah, case-lambda is special ijp: but they are both handled by the same machinery under the hood amz3: where is defined lambda* I can't find it in the source ijp: probably psyntax ijp: it doesn't exist in tree-il, and the macroexpander is the scheme->tree-il compiler amz3: ok tx amz3: indeed it must be in psyntax amz3: i skipped that file during my first grep bavier1: what would be the benefit of setting C_INCLUDE_PATH in a build phase instead of passing CPPFLAGS to a configure script? bavier1: anyone else see "error: K: unrecognized option" for 'guix challenge'? bavier1: hmm, oops, wrong channel akkad: irc is hard lloda``: OT i'm getting spammed with image links pretty hard lately :-| wingo: lloda``: did you get that global message that freenode changed peoples' settings to turn off private messages from unregistered users? wingo: i haven't seen this attack fwiw lloda: wingo: just saw it lloda: reconnects keep changing my nick :-/ manumanumanu: ijp: I'm going to go with your keyword idea. Thanks for the tip. manumanumanu: It is miles better than introducing two complementary bidings. amz3: o/ amz3: https://yoric.github.io/post/binary-ast-newsletter-1/ amz3: did anyone try forward.scm (https://amirouche.github.io/forward.scm/) ? amz3: how do you think I can improve something in forward.scm to make it easier and/or more suitable for you? amz3: TIA ijp: hmm, I seem to have introduced a bug when cleaning up the commits, I hate it when I do that ijp: hmm, weird, it seems to be loading ice-9/threads ijp: ah, I see the issue ijp: okay, nothing has broken since earlier, I'm definitely getting to the end of the file, and everything is pushed to gitlab ijp: zv: it is interesting that you brought up that day, because I was thinking about the unums conversation recently when talking with a numerical analyst bavier: trying to use (system vm program), find out that 'program-arities' is unbound bavier: guile 2.2.2 bavier: I guess 'program-arguments-alist' works, instead of 'program-arities' ennoausberlin: Hello again. What module needs to be loaded to use peg-patterns? lloda``: I don't use it, but grep says (ice-9 peg) ennoausberlin: lloda``: Thanks. Where did you grep? Just curious? ArneBab: is there a way to call apropos in a way which searches not-yet-loaded modules? ArneBab: ^ related ijp: ArneBab: not really amz3: o/ ijp: hmmm, I think I have been handling keyword arguments incorrectly ijp: wingo: can I clarify my understanding of keyword arguments? ijp: suppose I have a function (define bob (lambda* (wibble #:optional wobble #:key splat) ...)) ijp: if I call the function (bob #:splat), then #:splat is our required argument, but if I have (bob 'goes #:splat) is #:splat supposed to be parsed as the optional or the keyword ijp: I think I am parsing it as the optional, but it is supposed to be the keyword (and hence an error) ijp: and once you've started parsing keywords, then anything after is treated as a keyword? so you don't have (bob 'goes #:splat 'sometimes 'whoops) the same as (bob 'goes 'whoops #:splat 'sometimes) ijp: I thought that my keyword parsing was obeying these rules, but apparently I am sometimes treating keywords as optionals ijp: I might hack this for now, but I think my argument handling is going to need a rethink ijp: I don't know if it would break something, but we probably could fix it so that keywords and optionals can be mixed amz3: it seems like it doesn't work ijp: what didn't? amz3: sorry, I am preparing an example code that show how I am handling args, rest, keyword and rest keyword argument in my python->javascript compiler maybe it might be helpful to you amz3: (I got disconnected) ijp: amz3: I know how to do it, it's just I'm very conscious of my time right now, and I don't want to make any large changes amz3: I got disconnected, 20:10:10 amz3 | the example doesn't use keyword argument because to my suprise it's not implemented in pythonium │ amz3: 20:11:14 amz3 | here is the compiled js code: http://dpaste.com/0NHCBYX │ amz3: 20:13:17 amz3 | basically, at call site, compiled functions takes a list of arguments per usual in order to make it possible to ffi easily │ amz3: 20:14:54 amz3 | again at call site, if the python function takes keyword arguments or keywords rest they are all packed into a single JSObject │ amz3: 20:17:12 amz3 | an unique object called __ARGUMENTS_PADDING__, it is in reality a sentinel separting positional arguments from keyword arguments │ amz3: 20:17:41 amz3 | is placed at the end of the positional arguments ^^ and after it comes the keyword JSObject │ amz3: 20:17:53 amz3 | (cf. the bottom of the js file) │ amz3: 20:18:23 amz3 | Then every function definition has an 'unpack arguments' preamble │ amz3: 20:19:03 amz3 | first we check for keywords arguments sentinel (called __ARGUMENTS_PADDING__) amz3: oops! amz3: ijp: do you want me to explain or not? amz3: just to finish, if the sentinel is there, we know the arguments before are required positional arguments and any rest positional arguments amz3: after the sentinel there is the packed keyword and keyword rest arguments amz3: you have to separate them into there respective variables amz3: same for required positional and optional positional arguments amz3: same for required positional and rest positional arguments amz3: I don't know if guile support rest positional arguments when there is keword arguments amz3: the advantage of this approach is that calling a javascript function from Guile will have no overhead amz3: in python->javascript there is an overhead because python has a particular semantic regarding calling (a callable can be a function or another object with a class a stuff) amz3: (it can also be a metaclass) amz3: ijp: I backlogged, my answer: as you wish ijp: guile does support rest arguments, but iirc it just assumes that all the keywords are rest arguments ijp: amz3: guile has an issue that python won't, which is that keywords can also be positional arguments ijp: if it were otherwise, everything would be much nicer ijp: this was the crux of my bug, that it wasn't clear that keywords couldn't be *optional* positional parameters ijp: when you can clearly delineate the keywords, then you just pass around a dictionary like some js libraries amz3: afaict it's also possible to implement positional arguments passed as keyword argument using the thing i described (which is supported by python) amz3: anyway, I will try to do it if you don't amz3: a python function can have the following signature: my_function(a, b, c, *rest, e=42, f=101, **keyword_rest) ArneBab: this is in python3, right? amz3: and you can call it as you wish mixing keyword and positional as long as positional comes before keywords amz3: ArneBab: yes ArneBab: A python3 function can force separation of positional and keyword arguments via f(a,b, *, c=d, **e) ArneBab: afaik python2 forced using *args after any keyword argument amz3: fwiw I don't understand the new * feature you describe, i thought it was to ignore some positional arguments amz3: to keep backward compatibility amz3: when upgrading some code without having to change the call site ArneBab: amz3: as far as I understand it, it ensures that the keyword arguments cannot be hit by positional arguments amz3: oh ArneBab: they cannot be positional ArneBab: but I’m not perfectly sure amz3: that's strange ArneBab: let me check amz3: because the positional called as keyword, is a feature to document function calls amz3: so it seems counter intuitive to forbid it ArneBab: https://www.python.org/dev/peps/pep-3102/ ← keyword only arguments ArneBab: the advantage of this is that you can later add optional positional arguments without getting into ambiguity ArneBab: amz3: assume that we have f(x,a=0). I can call that as f(1, 2). Now you want to add an optional y parameter: f(x, y, a=0). If someone called your function with f(1, 2), the code will now be wrong. ArneBab: if a is keyword only, this cannot happen. ArneBab: so you get a more stable API ArneBab: you could still call the positional like a keyword, though: f(x=1, a=2) would work and would stay stable after the change. ijp: amz3: I don't think you understand my complaints ijp: if guile's functions were as straightforward as python's, this issue would have never arisen manumanumanu: OK: what is a good macro naming? What I have now is in-range for increasing AND decreasing ranges. The problem is that it is potentially slow in when the direction isn't available to the optimizer. As it is right now I have two support macros in-range+ and in-range- manumanumanu: in-incr-range and in-decr-range as complements to the regular values one? Or in-range being only increasing and in-reverse-range being decreasing and then having a third one that does both at potential cost? ijp: manumanumanu: you could make it a (keyword) argument to the (in-range ) form ijp: similarly if you wanted to allow changing the step value, making the end includive, etc. manumanumanu: ijp: it is already: (in-range end) (in-range start end) or (in-range start end step). And it is only slow when step is not known to the optimizer manumanumanu: but then it is _very_ slow manumanumanu: So it is already kind of a special case manumanumanu: ok, I know how to make it cheaper manumanumanu: but it will still be slower bavier: sad day, no guile package for android Termux ijp: anyway, I did fix the keyword parsing, but I'd still like to do a rewrite later ijp: okay, so now it works with boot-9 completely unmodified, but you do have to increase the stack size but I'm not 100% sure why manumanumanu: Good morning everyone! I have spent the whole day gardening manumanumanu: Such a fantastic hobby, which sadly my whole family considers a waste of time manumanumanu: planning a garden is fun nee`: I took a short look at guile-pg and why it doesn't build with guile2.2. It uses the scm_port struct which was renamed to scm_t_port and had it's definition removed from libguile/ports.h. Is there some alternative, or should a pointer to a custom struct be restored in SCM_STREAM now? wingo: nee`: does guile-pg implement a port type? wingo: in summary tho the change is documented in NEWS and the port API is documented in the manual: https://www.gnu.org/software/guile/manual/html_node/I_002fO-Extensions.html#I_002fO-Extensions nee`: wingo: yes for a postgresql connection I think http://git.savannah.nongnu.org/cgit/guile-pg.git/tree/src/libpq.c wingo: hoo, that code is pretty old wingo: if you can, you probably want to get rid of the mark function for the "xc" data type wingo: see https://www.gnu.org/software/guile/manual/html_node/Foreign-Object-Memory-Management.html#Foreign-Object-Memory-Management for a discussion nee`: I've been using it to connect to postgres. I'm now considering wether it's less work to upgrade it, or to just switch to guile-squee (which is pure guile code). wingo: yeah i feel you. in your place i would look at switching to guile-squee but i understand the pain of migrating working code :/ wingo: if you want to look further regarding guile-pg, civodul has a commit to gnutls where he makes the gnutls guile bindings use either old or new C port types nee`: okay thanks for the hints rekado_: manumanumanu: oh, a fellow gardener! ennoausberlin: Hello, Guix ennoausberlin: I wonder if there is a way to get the result of a grouping in a guile regexp ennoausberlin: Lets say: I have a string like "Starting point: 'xxxxx' end point: 'yyyyy' Time: zzzzz" where xxxxx, yyyyy and zzzzz arent fix. How do I get them as result of a match:string ijp: okaky, so I think I know my issue from yesterday which is that I don't think the module was "beautified" cmaloney: morning ijp: afternoon dustyweb: o/ manumanumanu: rekado_: it's a shame I am got started so late. We have had a house like... forever. stis: Hey all! stis: The irc logs does not work for me with chrome, some problems with sequrity it seams. Anyone knows what happened? lfam: stis: The site's TLS certificate expired stis: thanks for the info ifam daviid: nee`: if you switch to guile-squee, checkout the devel branch, because I autotool chained there (in the devel branch) and for some reason, christopher did not merged these mofifs yet ... - also note that guile-squee is very experimental and does not compare, by no means to guile-pg in terms of functionalty daviid: nee`: https://notabug.org/cwebber/guile-squee/src/devel zv: so, https://gnunet.org is down with an expired certificate zv: also uses HSTS -- can't that *permanently* lock you out of your site? zv: luckily w3m still works :) lfam: zv: Once the certificate is valid again, then the site will work again. zv: lfam: isn't the thing with HSTS that it delivers TOFU in addition to a CA-verified certificate? zv: oh, actually that's HKPK zv: err, HPKP lfam: HSTS tells the client (like your browser) that the site should only be accessed over HTTPS. It's a way for site operators to disable unauthenticated HTTP with compliant clients. lfam: As you found, it's possible to write a client that doesn't handle it lfam: Or, you can just tell your client that you will accept bogus TLS lfam: One shouldn't enable HSTS unless they are confident they can manage their TLS certificates lfam: zv: I'm curious, where did you get your w3m? From a distro? zv: lfam: yeah lfam: The project was abandoned upstream and Debian seems to be the most active development site zv: of course there is no way to search the logs the day I need them :) zv: ijp: is there any way you remember a conversation about something having to do with some scoping issue or something like that about 6 months back? zv: SICP-related? ijp: not off the top of my head, but if you have some more context... zv: There was a bug in guile, or at least you said it was a bug zv: it was let/letrec related?? ijp: I vaguely remember it zv: you angrily insisted it was a bug when i brought it up later? zv: s/angrily/firmly zv: well i can't search logs so this is why i'm bugging you zv: maybe there was a guile patch, i'll have to take a look ijp: okay, july 14th? ijp: 2016...maybe this is the wrong one zv: maybe just search "sicp" if you're keeping logs ijp: is this it http://shift-reset.com/tmp/zvlog? ijp: whoops wrong encoding :/ ijp: I think my "firm insistence" relates to the question about symbol-set! vs module-set! ijp: dustyweb: assuming I'm not accidentally invoking the wrong continuation (which is always a possibility), then apart from a few lines which call resolve-module (<= 6 of them) we have boot-9 dustyweb: ijp: woohoooooo! dustyweb: ASCII DANCE PARTY dustyweb: dustyweb: /_o_/ \\ / \\o_ o dustyweb: ( _|_ ) //) dustyweb: /\\ / o \\ /| /| dustyweb: dustyweb: *BMCH BMCH BMCH BMCH* bavier`: lol ijp: that was very confusing for a few lines dustyweb: ;) dustyweb: nice work ijp dustyweb: I know that's a hell of a lot of hacking dustyweb: now bee arr bee, lunch ijp: I owe my success to dustyweb, the good people at Tetley and 1980s rock music janneke: dustyweb: you ever read `the dancing men?' dustyweb: :) dustyweb: janneke: I have not, what is it? janneke: dustyweb: it's a short Sherlock Holmes story by Sir Arthur Conan Doyle janneke: your ascii dance party has some resemblance to it janneke: more than some dustyweb: aha :) janneke: :-) zv: thats it ijp cmaloney: I'm getting an error on this line in Fibers: https://github.com/wingo/fibers/blob/master/fibers.texi#L826 cmaloney: Should that be @code{sup} ? cmaloney: Introdced in this commit: https://github.com/wingo/fibers/commit/2a4f707827105d041668f34b62daaff871c22c07#diff-b2b20f2adfe41d88efea699432cd3096 cmaloney: or is that supposed to be something like superscript? cmaloney: Feh, naturally that was added after ubuntu 14.04 shipped. ;) cmaloney: I hacked the doc so it uses @math{2^{32}} instead. Seems to work on older versions of Texinfo roelj: Can the (web ...) modules do "Digest" authentication? I see there's a header for "authorization", but I don't know how to do the back-and-forth in a straighforward way. ArneBab_: manumanumanu: can you provide an example in the documentation which shows for/list break ArneBab_: ijp: nice! manumanumanu: ArneBab_: I probably could, but I suspect that everyone that knows what a multi-shot continuation is and is able to put one together won't need those docs manumanumanu: :) ennoausberlin: Hello, guix. Is there an easy way to install guile 2.2 into debian 9? ArneBab_: manumanumanu: I’m not that sure :) (can’t it happen that you use a library which does that?) manumanumanu: ArneBab_: It was a tradeoff they thought was valid for guile2.0. But sure, i'll whip togeher an example. manumanumanu: map worked like that until 2.2 manumanumanu: ArneBab_: https://koketteriet.se/software/guile-for-loops/docs.html#org2793768 under the second headline manumanumanu: ArneBab_: oops. that anchor won't work. it is under the FAQ dustyweb: o/ bavier`: dustyweb: howdy davexunit: yo dustyweb ijp: I think there is a similar issue to equal? with the-root-module when it comes to (system syntax internal) ijp: the only thing is, this one does use a toplevel box, but I think it must be the wrong one ijp: since it seems to be a fresh one ArneBab_: manumanumanu: thank you! ArneBab_: manumanumanu: if you could add a line "if your code needs multi-shot-continuations, use for/list/pure instead", it would be perfect ijp: yeah, I don't see where these bindings should be coming from daviid: paroneayea: I feel sorry to hear you're somehow stuck :( paroneayea: well! since I said all that paroneayea: I managed to figure out a kludge to make it through paroneayea: daviid: so less dire than when I last spoke in here :) daviid: paroneayea: oh, great! then you'll make it with your deadline ... paroneayea: yeah I think so daviid: ACTION just released GNU Guile-CV 0.1.6 cmaloney: ++ adhoc: i wonder if you can use the CV library to look at the ouput of SDR to auto-tune rekado: artyom-poptsov1: I’m having weird problems with Guile SSH on a couple of nodes; inside node-eval “(getenv "GUILE_LOAD_PATH")” returns #F, but with a plain remote Guile process, the load path is correct. rekado: this is fine: ssh hydra@192.168.0.7 guile -c "'(display (getenv \\"GUILE_LOAD_PATH\\"))'" artyom-poptsov1: rekado: Hi! Okay, I'll check it the next few days. rekado: artyom-poptsov1: ah, never mind: the problem was that an old guile process was lying around from before the changes to /etc/environment. rekado: that almost drove me crazy for a couple of days :) artyom-poptsov1: rekado: :-) manumanumanu: I reinstalled my system recently, and guile doesn't remember previous repl sessions manumanumanu: Is there any way I can activate that? ft: manumanumanu: load the readline module in ~/.guile manumanumanu: it is already loaded ft: (use-modules (ice-9 readline)) (activate-readline) manumanumanu: I already have it, but it doesn't save history between sessions manumanumanu: i have history within a session ft: Then I don't know. That's all I have configured wrt readline and it happily fills ~/.guile_history ft: You sure you also have the (activate-readline) call? manumanumanu: weird. manumanumanu: my .guile_history is owned by root manumanumanu: that's why manumanumanu: thanks manumanumanu: for pointing me in the right direction ft: Sure. Great you found it! manumanumanu: now it works manumanumanu: I know why even. I started guile as root in a sudo shell, so i started guile as root, but with my users home directory dsmith-work: Monday Greetings, Guilers paroneayea: wingo: bonk, back at you https://github.com/wingo/fibers/pull/13#issuecomment-322184191 wingo: lgtm then! paroneayea: wingo: woo, merging cmaloney: Good AM wingo: moin ijp: wingo: I'm a little confused about the 'module-box' vm opcode & how it works with 'equal?' wingo: how do you mean? ijp: after the module system is booted by a call to set-current-module in boot-9.scm, the definition of resolve-module is (define (resolve-module name . args) (if (equal? name '(guile)) the-root-module (error ...)) ijp: AFAICT, that call to equal? must use a module-box, and so module-box should call public/private_lookup on the variable, which eventually should call resolve-module ijp: the only way this would not infinite loop, is if (SCM_UNLIKELY (!SCM_VARIABLEP (var))) fails, right? ijp: (that condition is in "module-box") wingo: i think the way this works is that when you compile boot-9.scm, the current module is (guile) wingo: so the reference to equal? gets compiled to toplevel-box wingo: right? maybe i am forgetting how this works ijp: that is what I had expected wingo: toplevel-box uses a module that was captured when the outermost top-level procedure was defined wingo: which was captured just by doing (current-module) and writing that to a box wingo: so there's no resolve-module going on for the "equal?" reference in resolve-module ijp: I thought this is how it should work, but I ended up in a loop on friday when I reimplemented some of the module primitives ijp: currently I'm special casing equal? because it's the only problem I have with this behaviour, but I would like to figure out why I'm getting a module box rather than a toplevel box ijp: wingo: this might be related to my read-and-compile issue from before wingo: could be, yeah; i think the current scheme compilation pipeline will individually expand expressions to tree-il then "join" those expressions; i.e. not expanding the whole file as a toplevel sequence wingo: the choice of whether to make a toplevel-box or a module-box is from tree-il's toplevel-ref / module-ref wingo: which is a choice made by the expander: what module the expander thinks is current when it sees a reference wingo: vs the module that's associated with that reference (syntax object) wingo: if they are the same, then toplevel ref; otherwise module ref wingo: this part of guile could be lots better :P ijp: I guess I should just keep the special case, along with a comment explaining it, for now bavier`: looks like fun reading: https://michael.steindorfer.name/publications/phd-thesis-efficient-immutable-collections.pdf dustyweb: o/ dustyweb: bavier`: yeah, that's the basis for CHAMP based hashmaps, which I had mentioned in an email a bit ago to the guile mailing list bavier`: dustyweb: cool! ijp: ACTION downloads dustyweb: the author of the clojurescript implementation of the CHAMP hashes said they'd be okay with us doing a direct port of their implementation and licensing under the LGPL for Guile ijp: if someone reminds me nearer christmas, I can do it dustyweb: :D ArneBab: dustyweb: nice! dustyweb: heya ArneBab dustyweb: how goes ArneBab: mostly well, a bit more worry right now since I’m looking for a job after the post-doc ArneBab: how about you? dustyweb: I'm ok cmaloney: What is this nick change I can't even ... *boom* dustyweb: yeah I'm not sure if I should switch or not dustyweb: I've had paroneayea for a long time on here dustyweb: but is it perhaps a bit silly? dustyweb: cwebber is taken by the other Chris Webber cmaloney: I used to be snap-l for the longest time cmaloney: until I realized that the name had 0 meaning anymore cmaloney: was a nick that I chose in a hurry when I connected to efnet on #rgvc cmaloney: (rec.games.video.classic) dustyweb: heh cmaloney: and was chosen because I drank a lot of snapple on trips cmaloney: (iced tea). dustyweb: paroneayea is a username I had because terrible MUD username I chose when I was 14? cmaloney: I don't drink the stuff anymore cmaloney: Heh holomorph: dustyweb: as good a reason as any! cmaloney: well, your site is dustyweb, so the mapping is still there dustyweb: well, my site is dustycloud.org :) dustyweb: not quite dustyweb dustyweb: but close cmaloney: Should register dustyweb as well. ;) dustyweb: but a more recognizable connection cmaloney: dustyweb.org is available. ;) cmaloney: as is dustyweb.net cmaloney: and dustyweb.com appears to be squatted cmaloney: so, whole namespace available to you. ;) cmaloney: just call me the enabler. dustyweb: I think I need to set up the websocket server to do a keep alive ping davexunit: at aws summit nyc, not a single guile talk. what gives!? ;) manumanumanu: I could really need some feedback for https://bitbucket.org/bjoli/guile-for-loops if anyone is interested. They are done now. manumanumanu: and work pretty darn well, at least on 2.2. davexunit: any benchmarks? bytecode analysis? davexunit: (I don't have time to do a deep dive on your code, but I appreciate the effort you've put in) manumanumanu: davexunit: the loops are as fast as hand-rolled named lets ArneBab: manumanumanu: I looked at the docs and they look pretty good. You could export them as texinfo to fit typical style. I can see whether I can whip up a Makefile which automates that. ArneBab: (later today) manumanumanu: except for for/vector which, unless you specify #:length x will grow the vector until the looping is done ArneBab: manumanumanu: regarding for/list, I think a typical API would rather give the pure version as default and then add a for/list/destructive manumanumanu: davexunit: i did a pretty deep dive into continuations and loops. Doing a non-tail-recursive cons is not an option. The cost of restoring those continuations is simply too big. ArneBab: or rather: for/list! manumanumanu: ArneBab: yeah, that was one of the things I have been thinking about ArneBab: I think for/list! would be the way to go ArneBab: hm, maybe … ArneBab: not that sure anymore :) davexunit: manumanumanu: okay davexunit: I'm a little skeptical of that claim ArneBab: manumanumanu: but before saying anything else: congratulations! davexunit: but you're the one that did the work so I'll take your word for it :) manumanumanu: davexunit: They have the same problem in racket. manumanumanu: Try making a generator that yields the values from a map, you'll see. davexunit: what do generators have to do with this? manumanumanu: it will be excrutiatingly slow after a couple of thousand iterations manumanumanu: well, implement a generator with continuations :) manumanumanu: That's how I tried it. I started a guile-implementation of srfi-whatever (121? the generator one) ArneBab: manumanumanu: I think for/list! would be right. filter! also returns the results but allows itself to mutate what it gets. davexunit: I don't understand what generators have to do with not using reverse! ArneBab: https://www.gnu.org/software/guile/manual/html_node/List-Modification.html ← list! davexunit: the reason to use reverse! is that guile 2.2 does not penalize recursion davexunit: perhaps I misled you with the continuation safety thing manumanumanu: davexunit: your suggestion in the reddit thread was to work like map davexunit: yes manumanumanu: but that gets very slow when restoring very long continuations davexunit: continuation safety is just a minor consideration manumanumanu: let me show you davexunit: the main thing is that guile doesn't penalize recursion davexunit: no time, sorry davexunit: we're miscommunicating and I can't resolve that right now manumanumanu: all right. no problem. however: I tested. using a non-tail-recursive cons will penalize jumping in and out with continuations. ArneBab: manumanumanu: for/list/parallel would have saved me some time a few months ago :) davexunit: I'm not concerned with continuations davexunit: I'm concerned with memory usage and general performance ArneBab: manumanumanu: is there a way to make for/list/parallel use a thread pool? ArneBab: or does it already do? manumanumanu: ArneBab: it does already davexunit: I shouldn't have mentioned continuation safety, it's irrelevant. davexunit: I was just looking for additional benefits of a recursive implementation ArneBab: nice! I like tools which do the right thing *by default* :) davexunit: see this article from wingo https://wingolog.org/archives/2014/03/17/stack-overflow manumanumanu: davexunit: no man, it is a valid concern. However, a tail recursive loop that does a non-destructive reverse at the end will have a lot better performance if you are jumping in and out with continuations. ArneBab: bbl davexunit: we continue to talk past each other. davexunit: that article explains everything. do with it what you will. manumanumanu: davexunit: yes, what I have been trying to say is that that seems to be pretty slow when jumping in and out of the recursive function using continuations (delimited or otherwise). I did some testing to find the best approach after the reddit thread, and using an accumulator was MUCH faster than a recursive cons-loop manumanumanu: but that is a digression manumanumanu: the loops are done, apart from some small decision on how to work with user-specified sequence types. as of right now, they don't work at all amz3: manumanumanu: don't wait (a lot of) reaction/feedback from guile community, post a message to the mailing list and move on amz3: which happens to be true for any community I know about manumanumanu: amz3: I know that. amz3: getting into another one project is hard, so feedback is rare amz3: 2c manumanumanu: this migt be my chance to learn how to use mailing lists :) manumanumanu: ArneBab: I am not sure about the for/list for/list! distinction. for/list is not doing a linear update on any "user-facing" data, but only on the internal accumulator. That is exactly how guile's map-function ran prior to 2.2. manumanumanu: ArneBab: and it matters only in the case of multi-shot continuations, and that is a rather special use-case manumanumanu: doing a reverse! will be faster and use less memory, and is what most people should use manumanumanu: I was about to do what guile 2.2 does for it's map implementation, because that is about as fast as doing a reverse! and is multi-shot continuation safe, but I did some tests, and it is pretty damn slow when jumpin in and out using prompts or call/cc data_hope: is there a unit test runner for guile that you can recommend? manumanumanu: data_hope: not sure whether it suits you, but there is srfi-64 daviid: data_hope: there is one in guile-lib as well ijp: the end is so close I can taste it (99%) ijp: that's (module-use! the-scm-module (resolve-interface '(srfi srfi-4))) for those of you playing along at home reepca: how would one go about figuring out which kind of port a port is? For example, socket, file, pipe, etc. cmaloney: reepca: I think the only data you get (iirc) is whether it's a block or character device cmaloney: reepca: Is this a remote port or a local port? manumanumanu: davexunit: so, back to continuation-safe for/list loops. I have a question. Wouldn't jumping in and out of a continuation with a lot of conses take a lot of time? There was just a pretty big performance bug in racket using generators and their for/list that wasn't tail recursive, and I wouldn't want to spend lots of time implementing continuation-safe loops and have them be dirt-slow for continuations :) It manumanumanu: might just be racket specific, but that stuff goes way over my head: https://github.com/racket/racket/issues/1721 manumanumanu: Found the problem, btw: racket expands for/list loops with #:break/#:final statements to a simple (reverse (loop))), but uses the neat (now slow) behaviour for the other lists. efraim: is there a guile-soap library? or is the emacs-soap library the closest one manumanumanu: ok, tried it. re-instating the continuation is a lot faster using an accumulator than a non-tail-rec loop using cons. cmaloney: tzag amz3: héllo #guile paroneayea: hello #guile paroneayea: in case you want to see Pubstrate running live paroneayea: https://chaos.dustycloud.org/u/chaosmonkey/p/MfGFbDsAEcpgSfdw2H9NaODcQUDdBzMB5h8gZ-Ib paroneayea: https://chaos.dustycloud.org/u/chaosmonkey/p/SkueW_47ImJAjas2m0IIt6HpHvcqCtW_Uyu2NDOs paroneayea: https://chaos.dustycloud.org/u/chaosmonkey/p/TPyZsdTihLT6hZctFcn6ts2vIyvJjDNOgJ12LZGK paroneayea: not permanent links, just a test instance mwette: paroneayea: looking nice paroneayea: thanks mwette paroneayea: hoo I have really painted myself into a corner tho paroneayea: I'm so far down the yak mines paroneayea: I thought layering 8sync on top of fibers would paper over the problem I was having because it would automatically suspend a fiber that was blocking (we still don't have suspendable-ports support for custom binary i/o ports) with its pre-emptive feature paroneayea: only realizing now that it can't be suspended, since the port itself is stuck behind a continuation barrier paroneayea: so now I've got to implement remote actor support and actually do all the http requests, temporarily, behind another process paroneayea: what a goofy situation paroneayea: I'm checking off all sorts of tasks I've wanted to do while trying to get this out the door, but in a rushed fashion spk121: paroneayea: just reading that wore me out. paroneayea: spk121: heh :) paroneayea: thinking, maybe there's another way paroneayea: actually if I can explicitly create a fiber in another thread, it's probably fine. paroneayea: wingo: is that possible? it looks to me like if I want to explicitly create a fiber in another thread, I have to create a scheduler in another thread, right? paroneayea: wingo: otherwise you have no control over what's in antoher thread or not paroneayea: ? paroneayea: hm paroneayea: it looks like there's no "safe" way to do that without violating fibers' underlying structure if I'm reading right paroneayea: ughhhhhhh my brain is going to explode paroneayea: this thing is so past due and I need to have it up by tuesday morning :( akkad: ACTION thought guile got installed as a dependency of gmake ijp: paroneayea: so, update before bed. I've done a rewrite of the modules stuff, and modulo the issue with equal?, I am back to the binding for duplicate-handlers in boot-9 (~87%) paroneayea: ijp: great news :) paroneayea: now go get some sleep! paroneayea: ijp: look forward to a catch-up early next week :) ijp: night manumanumanu: sleep sounds nice! manumanumanu: I'm finished with my for/vector loops, so now I have nothing left. It bothers me that I'm too dumb to make for/list non-tail-recursive and still keep compatibility, but that will have to rest for now. The code is a lot clearer now. manumanumanu: Gnigt amz3: héllo reepca: Any idea what would cause "ERROR: In procedure ttyname: Success"? Some tests are failing and that's the last thing I see. And somehow it's related to doing this in an isolated environment that isn't quite like the isolated environment it should be, and I'm trying to track down where the difference is. amz3: reepca: is there some code available online which can help reproduce the issue? amz3: what is an isolated env? an lxc? reepca: amz3: as soon as I push my changes, aye, but the issue there is that the iteration time is realllly long, especially from scratch. "Isolated environment" here means "clone to create new mount, pid, ipc, and uts namespaces, use pivot-root and umount to get rid of the world outside of a directory containing only the dependencies needed to build guile". There's a bit more to it, but that's the main stuff. amz3: oh ijp: a "success error" reminds me of the phrase "successful crash landing" amz3: ijp: what's the plan regarding javascript <-> guile interop? paroneayea: amz3: ijp can say more if they choose, but the plan is, ijp is working on scheme -> js, and thinks that maybe something like (system foreign) could be done for scheme -> js allowing calls from the outputted code to the normal javascript environment (but it's not clear if that will happen during the gsoc) paroneayea: and they're working on it and making progress, see their last email to the list. ijp: right, and as for js calling guile, that would look something like C calling guile ijp: I have a few other ideas for guile calling js, but it is not a priority amz3: seems like dynamic contexts are coming to #python https://www.python.org/dev/peps/pep-0550/ akkad: him and nat were a bit too much PuercoPop: Is there a common way to structure a guile project? daviid: PuercoPop: yes, somehow there is, though with diffs here and there of course, but anyway, the best you could do is to look at other guile projects, there are quite a lot out there PuercoPop: The ones I looked at (from davexunit mostly) use autoconf, but I'm not sure why daviid: PuercoPop: we all use autoconf daviid: you may look at guile-squee as well daviid: have to leave the place I'm working now, talk to you later daviid: https://notabug.org/cwebber/guile-squee the devel branch, because master is not merged yet and I autotooled a while ago on the devl branch daviid: it is a simple and easy to 'copy' project to start with, with texinfo doc as well ... PuercoPop: daviid: thanks davexunit: PuercoPop: yeah, the autotools are the way to go. I won't say that the autotools are good, they are terrible, but they are the least terrible option available. they actually work for all possible use-cases a user might have, and `./configure && make && make install` is easy for users. dsmith-work: Happy Friday, Guilers!! OrangeShark: happy friday manumanumanu: happy happy! manumanumanu: Is there anything about the vector implementation in guile that makes it... slowish? manumanumanu: I am trying to figure out a neat way to implment for/vector in my racket-like for loops, but whatever I whip up is still slower than just wrapping a for/list in list->vector manumanumanu: hmh... I could try running the expanded code in chez. random-nick: manumanumanu: did you look at the disassembled bytecode? ijp: the array situation is somewhat complex, and that may affect it. Also vectors don't get represented specially by guile, whereas pairs do manumanumanu: random-nick: nah, but since the loops need to keep track of position and such to be able to grow the vectors, the code was a bit more complex. I just thought it would be faster since it didn't have to chase pointers. manumanumanu: ijp: what does that mean? ijp: I don't know offhand how vectors are represented, but if they are treated as arrays, then they will break in all the complexity associated with them. See https://www.gnu.org/software/guile/manual/html_node/Arrays.html#Arrays ijp: I'm not saying this is the problem, but it is one thing that might be lloda`: we got rid of most of that in 2.2. There are residues in the code, but the main functions vector-ref, vector-set!, vector-length etc. are all clean and strictly below any array stuff. ijp: lloda`: ah, good to know manumanumanu: There is a larger overhead for vectors over lists in guile than in chez though. The expanded for/vector code runs faster in chez than (list->vector (for/list ...)), whereas it was the other way around in guile ijp: how big are these vectors? manumanumanu: 10 000 000 elements. manumanumanu: it was a silly loop just to measure overehead manumanumanu: I'll keep the "proper" for/vector code in case things change in the future ijp: how much overhead is there roughly? manumanumanu: The problem is probably that I have to keep track of length and grow them as needed manumanumanu: 25% ijp: for this sort of pattern, building the list and converting is probably sensible anyway, unless you make them specify the vector length ijp: 25% does seem really high though manumanumanu: got it down to 10% manumanumanu: ijp: the code is now better optimized than before, so now it is slightly faster. I had to coax the guile optimizer a bit manumanumanu: But I am not very familiar with the disassembler. are consecutive (vector-length) optimized or can I save some extra time keeping track of the length? ijp: it would be optimised well before the disassembler ijp: or at least, I would imagine so, I haven't actually checked ijp: I seem to have introduced an indirect infinite loop in my module system code...wtf ijp: essentially it can't find my version of the equal? function, so it tries to find it, but that goes through resolve-module which uses equal? ijp: no idea why it can't be found though dsmith-work: ijp: Ouch! cmaloney: good day ijp: hmm, I still can't find the loop paroneayea: ijp: if a second pair of eyes would help, I could look, but I think it's enough new stuff that by the time I wrapped my head around it you might find it :) ijp: paroneayea: no, I think I know where it is, I just don't see how to resolve it cleanly paroneayea: ijp: feel free to rubber duck here if you'd like :) ijp: I suspect that equal? needs to be handled specially when being compiled, since otherwise this infinite loop seems inevitable paroneayea: think that's possible to hack in? ijp: I'm just going to have a look in compile-bytecode first paroneayea: well, if a kludge will make movement possible, a kludge is better than being stuck :) ijp: right paroneayea: I am embarassed by how frequently I end up committing "Oops, removing an accidental `pk'." paroneayea: though a lot of those pk's could be improved by that preserving-variables-for-debugging compiler task paroneayea: maybe eventually I'll learn enough to help there paroneayea: s/improved/removed/ ijp: I don't get that so much, but I do forget to commit newly created files fairly often paroneayea: I do that sometimes paroneayea: I am way less likely to make these kinds of mistakes if I commit via magit and am forced to follow GNU ChangeLog style commits tbh paroneayea: though I do find ChangeLog style commits kind of a dreary activity to type up (but magit does make it so much easier with the C key) ArneBab_: ijp: I tend to just use vc-next-action for most simple changes (C-x v v) — which are the ones which just touch one file. If I did not add the file yet, I have to do that twice. paroneayea: I don't suppose we have any memory profiling tools I don't know about...? paroneayea: looks like it's in 8sync somewhere... paroneayea: I found the source of the memory leak paroneayea: it *was* in fibers after all paroneayea: sneek: later tell wingo found a memory leak in Fibers, but not sure why it's happening https://github.com/wingo/fibers/issues/12 sneek: Okay. dsmith-work: paroneayea: By "properly tail recursive" are you asking if a recursive call grows stack or not? dsmith-work: paroneayea: Guile will always make a jump when a call is in tail position. dsmith-work: (per the scheme spec) paroneayea: dsmith-work: yeah, was just checking that I wasn't screwed over by some crazy macrology or something. I did ,optimize to see what it was going to be paroneayea: and that confirmed, the call was in the tail position. Turned out that wasn't the bug. paroneayea: wingo: got a minute? I'm trying to read channels.scm and I'm a bit confused by the (maybe-commit) sub-procedure in put-operation paroneayea: the 'W handler does a (maybe-commit) but it doesn't necessarily succeed paroneayea: just trying to understand... so is this basically where it *tries* to remove an item from the queue, but maybe doesn't succeed paroneayea: ok, wait I think I get it... we want to do it at the enqueue! stage. amz3`: nice to see some interaction between guilers amz3`: instead of everyone working on their own speck paroneayea: amz3`: yeah! Fibers and 8sync are finally coming together, arm in arm, at last :) paroneayea: ... hey wingo :) paroneayea: wingo: where'd this functional dequeue design come from? davexunit: okazaki's data structure, but ijp's scheme implementation I think? paroneayea: ACTION playing with it paroneayea: I get it now paroneayea: you reverse the tail of the list when you dequeue and move it to the head paroneayea: pretty cool OrangeShark: paroneayea: oh ya, that one I think is in Okazaki's functional data structure paper paroneayea: :) paroneayea: wingo: https://github.com/wingo/fibers/pull/13 fix for the channels dequeue leak paroneayea: seems to work here. ijp: The queue version of that is probably the best functional queue under normal access patterns, but I've always been more sceptical of the deque version ijp: it's also roughly how you do a list zipper ijp: which gets used in minsky's proof that PDA with 2 stacks are equivalent to turing machines paroneayea: interesting paroneayea: I don't find Mono to be that exciting, but more webassembly generation is cool http://www.mono-project.com/news/2017/08/09/hello-webassembly/ ijp: I'd forgotten all about mono. Weird, because it / de icaza used to be really controversial paroneayea: heh indeed paroneayea: dsmith-work: cool paroneayea: hey janneke, people on the fediverse love your work on Mes :) https://octodon.social/@cwebber/4935740 paroneayea: a bunch more people shared that post today, even though I posted it a couple of weeks ago :) ijp: I'm pretty annoyed, I have one particular line that works from the repl just fine, but fails for nonobvious reasons in a script janneke: paroneayea: wow, 10 shares. You did write a great post :-) janneke: paroneayea: in the mean time, tcc.mes now only runs and segfaults janneke: it has just compiled `int main (){return 42;} to a valid ELF .o file janneke: *now NOT only reepca: "ERROR: In procedure ttyname: Success"... what? manumanumanu: so, if I have a macro and I pass a lambda exression to it, can I in any way call that lambda in the macro? I can of course using eval, but that's no fun random-nick: manumanumanu: as in evaluate in macro expansion time? I think that eval is the only way manumanumanu: That will have to do. manumanumanu: random-nick: thanks. so do I manumanumanu: neat. I can pass syntax objects directly to eval ennoausberlin: Hello, guile ennoausberlin: I am looking for a function which does something similiar to Smalltalks collect: message. Say, I have a collection/list with single distances. How can you create a collection that sums up the single distances. I guess I can do it recursivly but I read about map and fold are equivalent to Smalltalks collect: and inject: messages ennoausberlin: (3 4 9 2) will become (3 7 16 18) atheia: (reverse (fold (lambda (in return) (cons (+ in (car return) return))) '() '(3 4 9 2))) atheia: Something like that? atheia: (i might be missing some parens, did this on the fly in my irc client…) ennoausberlin: Well, thats not easy to understand. Is there a more concise way? But I turns me into the right direction atheia: There might be, for me it's pretty intuitive, but then I'm used to fold now. Happy to explain parts if that helps. ennoausberlin: Thank you. I am still a newbie who wants to know how to do it the scheme way. I am living on the countryside so no mentor around. You are of great help atheia: But other than that, not aware of a more concise way. atheia: heh, np. atheia: OK, so: atheia: (use-modules (srfi srfi-1)) (reverse (fold (lambda (in return) (cons (+ in (car return)) return)) '(0) '(3 4 9 2))) atheia: emits $2 = (0 3 7 16 18) atheia: (there were two small errors in the original suggestion. ennoausberlin: I wrote a function that searches for a pattern in text. Because I want to split the text into pieces. string->contains gives me an index for a single first match. I did it recursivly so I get relative indices. Thats the reason I want to sum up. Converting relative to absolute indices ijp: the function is usually called scanl, but is not a common one in schemes ennoausberlin: ljp: Thank you for the pointer. My lunch break is over. I will try it out later ijp: I am not sure why read-and-compile is giving me errors when compile-file is not ijp: hmm, but not at the repl ijp: ice-9/boot-9.scm:230:17: In procedure map1: ice-9/boot-9.scm:230:17: Syntax error:(map1 (() ((_) #t) ((_ x) x) ((_ x . y) (if x (and . y) #f)))) ijp: I do not understand why this error sometimes occurs and sometimes doesn't ijp: huh, weird ArneBab: ijp: do you have an update to your js work at hand? ArneBab: (or rather: can I help you somehow to get that update out?) ijp: ArneBab: the email is written, I just want to get this one thing fixed before I send it ijp: wingo: are you around? I was wondering if you know why I might be getting the above error ijp: I'm really confused because guild compile works, compile-file & read-compile work in a different script, but in another they are failing wingo: hi :) wingo: am around but a bit spotty; lost my laptop and am currently rotating all the keys :P ijp: http://shift-reset.com/pastes/link-dependency.html ijp: I've pulled this out of my (scripts jslink) module ijp: can you think of any implicit state I'm depending on ArneBab: ijp: thank you for the update! ArneBab: (s/update/info/) ijp: okay, there only seems to be a problem when I call link-dependency on two files, not just one wingo: ijp: do you have an example that's not boot-9? wingo: boot-9 is strange as you know ijp: wingo: I think the actual file is a red herring now ijp: is that default environment preserved between calls? ijp: hmm, no that shouldn't be it ijp: wingo: so I tried using it on psyntax then ice-9/deprecated, and got a different error, but not when psyntax followed by psyntax ijp: I think maybe psyntax is the problem dsmith-work: ijp: Your gift of understatement is astounding ijp: okay, a workaround seems to be to leave psyntax to last, but I don't know why that works ijp: my feeling is that state is being leaked, but I don't know if it's me or guile, and if it is guile then why has it not been noticed before now? cmaloney-exile: I'm used to debuggers like gdb and pdb. Is there something similar where I can single-step through guile's code? (eg. set a breakpoint on a function and single-step through it?) ijp: there is a debugger builtin dsmith-work: cmaloney-exile: There is, but I've never used it. cmaloney-exile: trying ,break function-name doesn't seem to do what I thought it should. :) cmaloney-exile: Um, nvm cmaloney-exile: <- embarassing mistakes made while you wait. *blush* ijp: a mistake a day keeps the ego away cmaloney-exile: pretty sure I've made enough mistakes to send my ego on a very nice trip via frequent-flyer miles ArneBab: ijp: does "no cheney on the mta" mean no tail recursion? ArneBab: ijp: thank you for your update! paroneayea: yeah thanks for the update ijp :) ArneBab: ijp: if I understood your answer correctly, we can already execute the compiled file in node. And that’s great! ArneBab: ijp: regarding cheney on the mta: I think relying on tail calls in the JS implementation is a perfectly good solution. ArneBab: ijp: given that WebAssembly will support proper tail calls, I think it is very likely that proper tail calls will soon be provided in most JS implementations. ArneBab: → https://github.com/WebAssembly/design/blob/master/FutureFeatures.md#signature-restricted-proper-tail-calls ijp: ArneBab: yes, Cheney on the MTA is the method Chicken uses for providing proper tail call recursion with C amz3`: cmaloney: pdb doesn't exist in guile yet paroneayea: hm paroneayea: there seems to be some sort of memory leak, either in 8sync or in Fibers still... gotta track it down paroneayea: If I have two actors polling each other constantly I seem to end up in some sort of memory leak problem. Not sure why that is yet. paroneayea: what's a good way to track down whether a procedure is properly tail recursive in guile? dsmith-work: Hey hey hey paroneayea: hello #guile! OrangeShark: hello ArneBab_: hi cmaloney: greetings amz3`: héllo amz3`: cmaloney: did you look at forward.scm ? paroneayea: what are people hackin' on today bavier`: did guile@2.2 change the tree-il representation? bavier`: or, maybe my environment is messed up.. just a sec bavier`: paroneayea: hacking on my Joy compiler a bit today paroneayea: bavier`: cool :) bavier`: oh, yup, 2.0.14 had tree-il , but now it's in 2.2 cmaloney: amz3`: Not yet. Have a few other things percolating before I can even begin to think about web frameworks. dsmith-work: paroneayea: What as I hacking on? Trying to get some bootloader code for an arm system to place a certain function at a specfic address. dsmith-work: To be backwards compatible to an incorrectly implemented system. bavier`: yay, ported (finally) my thing to guile@2.2 :) ijp: If I want to refer to a specific file in guile after it is installed, how can I do this ijp: oh right, using primitive-load-path will work ijp: bavier`: what did you port? bavier`: ijp: my simple Joy language compiler ijp: (I meant %search-load-path) Apteryx: Is there a recursive mkdir like "mkdir -p" in Guile? davexunit: Apteryx: not in guile, but guix has one. davexunit: which I assume is where you are using it :) Apteryx: davexunit: Yes I am :) davexunit: I'm pretty sure I snarfed the implementation for another project of mine Apteryx: I didn't find it. I used (system* "mkdir "-p" ...) paroneayea: davexunit: https://groups.csail.mit.edu/mac/users/gjs/6.945/readings/robust-systems.pdf paroneayea: an essay on robustness by sussman paroneayea: maybe good to throw at someone who argues "but that violates the unix-philosphy!" davexunit: paroneayea: oh cool, is this new? paroneayea: davexunit: nope, it's from 2008 paroneayea: and it's mostly the same thing as in the talks he's given recently paroneayea: degeneracy of biological systems as an example, emacs as an example, etc paroneayea: but paroneayea: it's nice to have a paper version :) cmaloney: And now, because of one toot by paroneayea I have now added 13 videos to my to_watch folder paroneayea: davexunit: but I did find a series of newer videos by sussman https://groups.csail.mit.edu/mac/users/gjs/6946/Video/ paroneayea: haha cmaloney paroneayea: cmaloney: btw speaking of videos! cmaloney: yes? paroneayea: I watched your intro to scheme talk and liked it cmaloney: Thank you! paroneayea: it was review for me but I thought it was a good overall intro paroneayea: I also notice that in that videos link above, there's a bunch of intro to scheme videos by sussman https://groups.csail.mit.edu/mac/users/gjs/6946/Video/scheme.html cmaloney: Thanks. The audience was primarily unix admins so I got a lot of "why would I ever use this?" questions paroneayea: lol paroneayea: cmaloney: did you tell them "because in the future you're running guix and shepherd and guile's running everything on your system!"? :) paroneayea: ;) cmaloney: Well, you probably wont, but it's a gentler introduction to JavaScript than JavaScript cmaloney: paroneayea: Nah, they have yet to forgive systemd. paroneayea: heh :) cmaloney: Or rather, PulseAudio cmaloney: and likely the move from BSD-style init to SystemV init paroneayea: I know people who are still upset that they had to move from LILO to GRUB! cmaloney: Oh totes. cmaloney: Change is hard. cmaloney: Hell, I'm describing a language that is older than me cmaloney: maybe we could do something with it? :) cmaloney: (DId I mention that several folks at Coffee House Coders didn't even know what a LISP was?) paroneayea: dang cmaloney: Yeah. I mean, I haven't been into Lisp at all but even I knew it just from the background radiation cmaloney: But, every day there's someone born who doesn't know "The Flintstones". cmaloney: (you poor summer children) paroneayea: I wonder how many people are sick of me linking to scheme things on mastodon paroneayea: or rather, the ostatus fediverse cmaloney: Nah, I think that's part of the fun cmaloney: and if they're sick of it they can unfollow / mute / block cmaloney: many options cmaloney: sucking eggs is also an option Apteryx: Is it legit to symlink a symlink? ;) Apteryx: It's giving me a duplicate level... so I guess not. Apteryx: What is the best way to write a string to a file? Apteryx: call-with-output-file? Apteryx: Seems a bit indirect to have to use "display" instead of a write. manumanumanu: davexunit: Thanks for the ideas you gave me in the reddit thread. Next revision of the loops will do some quasisyntax magic and have support for non-tail-recursive loops. I will have to do some major refactoring though, and I will group that with a rewrite to make everything but the emit-case more procedural. This will be not only much more flexible, but also faster since there will be a lot less syntax manumanumanu: transformations davexunit: manumanumanu: you're welcome! paroneayea: rekado_: btw, re: your "is there any way to save the state of some module, etc", I found it interesting that MIT Scheme allows you to save a "world" to disk, not unlike the old lisp machines of yore https://www.gnu.org/software/mit-scheme/documentation/mit-scheme-user/World-Images.html paroneayea: however, that would probably store more than you actually wanted, but I thought of your exploration of related topics when I bumped into it paroneayea: I'm not sure it's a feature we want in guile either, but it does seem cool :) catonano: paroneayea: I would like to hhave it in Guile rekado_: sneek: later tell paroneayea “disk-save” is interesting. For Guile I think we can do better by implementing static linking. sneek: Will do. paroneayea: :) sneek: paroneayea, you have 1 message. sneek: paroneayea, rekado_ says: “disk-save” is interesting. For Guile I think we can do better by implementing static linking. rekado_: oh, you’re around. rekado_: don’t see your name in my autocomplete results dsmith-work: Daily Greets, Guilers cmaloney: greets and salutations paroneayea: hey ho cmaloney cmaloney: How goes the battles? paroneayea: meh, lots of contracting to work on paroneayea: tempted to work on other things, but I'm being good paroneayea: only occasionally stealing glances at problem sets from the symbolic computation class I linked :) paroneayea: how are you cmaloney? cmaloney: Contracting? Sounds exciting. cmaloney: Dealing with a recruiter that said (no joke) that they see lots of Python and Scheme jobs paroneayea: wow! lots of scheme jobs? cmaloney: which seems a bit of nonsense to me. ;) cmaloney: Yeah, he wants to get me on the phone cmaloney: so I asked him "what part of my resume would you like to talk about"? cmaloney: because I really hate talking to recruiters paroneayea: I'm getting away with scheme at my contract, but that's because it's some data generation stuff that nobody is working on but me :) cmaloney: it's rare to find one that isn't trying to jam you into a job like a kid that's two-sizes too lard for their clothes. cmaloney: <3 cmaloney: s/lard/large/ paroneayea: I've never gotten a job through a recruiter paroneayea: I did go through one once, it was a recruiter that worked at the company themselves cmaloney: Early on I did (1990s) but most of them have been utter disasters paroneayea: but I didn't get that one cmaloney: They don't understand OSS, so I'm one of the outliers. amz3`: cmaloney: let me understand, some recruiter is looking for scheme hackers? cmaloney: No, some recruiter is full of crap cmaloney: I think I have as much chance of finding a scheme job in Metro Detroit as I have for 6502 assembly cmaloney: (not impossible, but highly unlikely) amz3`: hmm amz3`: ok amz3`: too bad cmaloney: Meh, I'm not at the level where I'd claim competency in Scheme anyway amz3`: at least I am not coding in C# or Java, but I wish I could use some guil cmaloney: but I mentioned that i was learning Scheme and had Python experience and his response was "we have lots of those jobs". cmaloney: Which felt a lot like he was full of the poopies. amz3`: well, given the number of guile hacker, you may be in the category of hire-able anyway :) amz3`: :) cmaloney: Heh cmaloney: I think there's 118 other folks in line. :) amz3`: take daviid as an architect and it will be smooth cmaloney: unless there's another bot in here that I'm not aware of. manumanumanu: davexunit: Why isn't reverse! continuation safe? is it implemented in C or is there some mutation thing I don't quite understand amz3`: I've seen people starting coding javascript, with no prior background javascript, sure it will be possible to do some scheme work as easily in the proper environment davexunit: manumanumanu: think about using map where the mapping function uses abort-to-prompt or something amz3`: right now, the best chances to land a job in Guile is via a) guix b) artanis davexunit: it's possible that the continuation can be resumed more than once davexunit: but reverse! mutates the list davexunit: so the results can get super messed up davexunit: so using reverse! not only makes for ugly code compared to the natural recursion, it means that your code won't compose with continuations cmaloney: (Not familiar with Artanis, and Google has polluted that namespace with Starcraft) manumanumanu: davexunit: ah! of course. thanks cmaloney: (Ah, the web framework) davexunit: manumanumanu: yw. if the code you are working with is inherently imperative anyway, then it doesn't matter, but as a general-purpose utility library, preserving continuation safety seems like a noble goal to reach for. daviid: :) amz3` tx for the nice word,. I also wish they would be more work for schemers and guilers, and I'm currently looking for some (free s/w, gpl compat, research, part time freelance ...) but most offers are about java and python cmaloney: Yeah, I've been looking for remote Python work. cmaloney: Except most of those are for Full-stack developers and my front-end experience ends about 2000ish cmaloney: apparently things have changed since then cmaloney: (possibly since breakfast) amz3`: cmaloney: yes, javascript eco system is fast manumanumanu: davexunit: not just noble. it's cool :) I slept on the problem, and I think I can do some quasisyntax things and make it general so I don't need any special case davexunit: manumanumanu: good luck with it :) cmaloney: And frankly I'm a little sad that React essentually won because I'm no fan of Facebook cmaloney: I'd rather work with Elm than React if I'm going to write meta-language amz3`: cmaloney: well, there is vue et preact cmaloney: (and JSX just rubs me the wrong way) davexunit: I always forget that react isn't javascript but an additional language davexunit: ugh davexunit: JSX is *horrible* and unfortunately that is an unpopular opinion davexunit: combining javascript syntax with html? what could go wrong? amz3`: cmaloney: I ported what react does with sxml instead of jsx https://amirouche.github.io/forward.scm/ dsmith-work: Anyone have any thoughts on Elm ? cmaloney: I remember when mixing templates and code was a bad thing, but it appears we're good at reproducing PHP amz3`: cmaloney: pseudo sxml, but you can fix the parser to be 100% sxml compatible davexunit: Elm is okay, but it's a brand new language. davexunit: that tries to be Haskell, but it's not Haskell cmaloney: amz3`: Ah, nice. That's neat. davexunit: to me there's nothing that is better than plain ol' Javascript yet cmaloney: iirc Elm is more like Erlang / Elixir amz3`: dsmith-work: the 'return intent' to avoid side effects at all cost is too much trouble davexunit: the static type weenies want their haskell cmaloney: Agreed. JavaScript (ES6+) seems to be what I've wanted in the browser all along davexunit: but I am a dynamic language fossil davexunit: luddite if you will daviid: but once we have ijp guile-js ... would that help? such as writing a new 'react' ...? amz3`: dsmith-work: if you allows ajax request in the controller, it much more useable IMO amz3`: daviid: that's the plan i have at least davexunit: guile in the browser sounds cool. the win there is that you have the same language for front and back ends dsmith-work: I've been wanting to play with it, but haven't had the time/opportunity daviid: amz3` great! let's help ijp ... amz3`: daviid: where's the code of guile-js? davexunit: which is why I don't like Elm. you're *still* writing in multiple languages for the front and backends daviid: davexunit: also, would it be easier to adress security issues? using guile I mean for the all 'chain' amz3`: Elm has an incredible reputation, tx to her creator amz3`: or his amz3`: (its maybe) cmaloney: daviid: There's a little more to React than FP (the virtual DOM is the biggie), but yeah, we could finally get the scheme on the browser that we deserve. :) davexunit: daviid: I don't know if it would be any easier, but writing just 1 language is an advantage because 1 > 2 daviid: amz` I don1t know, think ijp likes to get it to a very good and high level of quality before to start to share it ... so we have to wait a signal ... davexunit: er davexunit: 1 < 2 davexunit: hehe amz3`: daviid: not really, but it will help in the road of universal web like hop.js is doing amz3`: daviid: IMO, same security issues will exists amz3`: daviid: that was my impression too amz3`: actually I implemented, the same API in forward.scm that elm use, except dynamic, and it lead to very confusing code amz3`: maybe the code is online amz3`: no it's not amz3`: this project is almost 1 year old daviid: ym: you probably mean Guix, which obviously has the latest (and earlier) versions of Guiel, as for emacs-wip I don't know, but these quiz are better asked on #guix ... daviid: s/Guiel/Guile :) paroneayea: ym: oh paroneayea: are you talking about the guile-emacs versions of those? paroneayea: if so, guix does ship with a package of guile-emacs, which has those two branches yes paroneayea: though I'm not sure if it's building right now :) ym: Yep, s/GuileSD/GuixSD/. ym: Thanks for answer. ym: But I think I'll get my hands dirty with autotools trying to build emacs-wip on debian. rlb: Uploaded guile-2.2 2.2.2+2-1 to Debian; removed gc-benchmarks/ and HACKING. We'll see if the ftp-master like that better. (Also updated debian/copyright -- looks like there are 14 or more different licenses among the remaining files.) rlb: "likes" janneke: rlb: yay! roelj: Is there already something in Guile to read from serial ports? ft: roelj: https://github.com/ft/guile-termios ft: ft: Should update that with the improved errno handling from recent guile releases. paroneayea: janneke: https://social.heldscal.la/notice/3290920 click the *view more inconversation* bit paroneayea: janneke: basically, Claes is asking what's the relationship between mescc and nyacc paroneayea: I know mes ships with nyacc? paroneayea: so I'm guessing it's mes-wrapped nyacc? janneke: paroneayea: nyacc has been unbundled from mes janneke: paroneayea: mes (use-modules)'s / (mes-use-module)'s nyacc janneke: nyacc is a C99 parser, i.e. C99 -> AST, mescc is a C99 compiler, i.e. AST -> M1 janneke: mes is a scheme interpreter that can run mescc paroneayea: janneke: so nyacc is no longer used by mes? ft: He said it was. :) ft: Just not bundled. janneke: ft: right janneke: nyacc in an amazing parser generator framework that comes with an almost complete c99 parser and preprocessor paroneayea: cool ok :) paroneayea: janneke: gonna share this back on that thread :) janneke: paroneayea: that's gnu social right? paroneayea: janneke: yeah but I'm using mastodon paroneayea: they use the sam protocol though janneke: ACTION tried password recovery here and there because i was sure i had an account at some time...confuses me paroneayea: janneke: I recommend getting an account on octodon.social, which I find is a nice place :) paroneayea: https://octodon.social/@cwebber is me paroneayea: https://octodon.social/@cwebber/5240867 paroneayea: hopefully I got that right :) janneke: paroneayea: thanks roelj: ft: Thanks! mbuf: Can Guile run on Chez Scheme interpreter? cmaloney: i'm on octodon.social as well. admin is pretty good cbaines: Quick question, when using ,trace is there a way to prevent truncating the output? manumanumanu: daviid: sorry that I didn't reply yesterday. Yes, the licences are compatible daviid: manumanumanu: ok good, any reason why you did not pick GPL v3+? just curious manumanumanu: daviid: the mpl has easier language when it comes to static linking, and doesn't require other open source projects to fiddle with proper attribution manumanumanu: and is explicitly compatible with gpl, lgpl and agpl. manumanumanu: 2(.1) or any later version manumanumanu: but don't quote me on the attribution thing :) manumanumanu: IANAL, and english is my third language manumanumanu: daviid: https://www.fsf.org/blogs/licensing/mpl-2.0-release and https://www.mozilla.org/en-US/MPL/2.0/FAQ/#mpl-and-lgpl daviid: manumanumanu: it's ok tx ym: Will I get guile- and emacs-wip out of the box in GuileSD? ym: Can't build emacs-wip in Debian. rlb: nb. removing HACKING from the upcoming Debian packages since it also appears to be non-DFSG: "...and that any new or changed statements about the activities of the Free Software Foundation are approved by the Foundation" sneek: Welcome back rlb, you have 2 messages. sneek: rlb, daviid says: 'make' worked fine but 'make check' remains in 'Running sandbox.test' for ever when commenting thse three gc-benchmark/larceny file we were talking about yesterday, so that approach won't work 'just like that', it might still work but would need a bit more then just commenting these in the Makefile.am sneek: rlb, daviid says: I recommend you send an email to guile-devel and posibly copy it to guix-devel as well, because it is 'holiday time' i europe and I'm not sure (all) maintainers will see and respond to our irc conversation and attempt to solve it asap for you to introduce 2.2 in debian unstable... better email I think rlb: daviid: thanks, and I should probably summarize all this to the liast once I'm finished, but I'm not blocked. I'm just removing the files from the source package. For now I just removed gc-benchmarks/ altogether, assuming we don't actually need it, though I haven't tested the build after that yet. rlb: s/liast/list/ dsmith-work: rlb! Greetings rlb: dsmith-work: hey! mbuf: Is it possible to use Guile on Chez Scheme compiler? gour: hello, i'd like to learn some elisp in order to be able to tweak Emacs better, so wonder if Elisp-knowledge is somewhat transferable to Guile for the need of customizing Gnucash's reports? gour: i was (am) also interested to learn some Racket which might be closer, but not sure whether my free time will allow me. gour: i also wonder if Guile is going to be able to replace Emacs' Elisp some day? random-nick: well, a big part of learning elisp is learning emacs' APIs random-nick: but guile does not implement emacs APIs since guile is not a text editor dsmith-work: Happy Friday, Guilers!! random-nick: someone did try to make a version of emacs which uses guile's implementation of elisp random-nick: but the development of that stalled dsmith-work: gour: I learned elisp before guile. I was suprised (and pleased) at some of the basic differences. dsmith-work: gour: The list stuff is mostly the same, but with differences in important details. rekado: gour: some idioms differ a lot dsmith-work: Scheme is properly tail recursive, while elisp is not, so you have a lot more imperative looping contructs in elisp. dsmith-work: You can take the car or cdr of an empty list in elisp, which is an error in scheme. gour: random-nick: i'm aware of emacs' part of elisp...too bad that prpject is stalled gour: dsmith-work: thanks dsmith-work: gour: So while they are really very similar, the details are often different. gour: ok, will consider that while exploring both gour: what are some of the significant changes to be brought in 3.0 release? manumanumanu: gour: there has been talk of generating native code, which would be cool gour: ACTION nods manumanumanu: 2.2 is already much faster than 2.0, and native code would speed it up even further manumanumanu: It is great fun look at the output of ,opt and try to learn how to write fast code manumanumanu: Speaking of ,opt: anyone knows any good resources on reading the disassembly? dsmith-work: gour: Also possibly combining .go files into a single executable (like a linker). gour: dsmith-work: something ala racket? stis: manumanumanu: ,x -fkn-name- ? dsmith-work: gour: No idea. dsmith-work: gour: Wingo posted an email at one time with a list of things. stis: manumanumanu: I used module/system/vm/assembler.scm a lot dsmith-work: stis: Do you have a link to that hacking task list? stis: no, sorry. Should have bookmarked it. mwette: good source of info: http://wingolog.org mwette: or http://wingolog.org/archives/ amz3: héllo all :) amz3: OrangeShark: hey, it looks like guile-git is live in guix stis: hi amz3! amz3: hey stis, how do you do? amz3: I look at racket to see whether I can implement my framework in it amz3: the good thing is that they have a super nice manual, I mean the look'n'feel aka. css is great amz3: there search engine works great amz3: but amz3: it doesn't support posix threads and racketscript doesn't plan to support call/cc amz3: POSIX thread thing is can be replaced in racket with Future and Places (which seems like something like a processus (or like python's 'multiprocessing')) amz3: my understanding is that a Place in racket does spawn another kernel processus and communication can ONLY happen over serialized datastructure manumanumanu: amz3: racket has threads manumanumanu: oh. posix threads :( amz3: AFAIU racket threads are equivalent to fibers amz3: coming from Python and Guile, understanding racket way of doing was kind of diffuct amz3: When I started GNU Guile, it was clear to me the mapping to do between Guile's modules vs Python's packages amz3: in racket, it's weird amz3: It's like its own world! amz3: another planet :) amz3: that said, I discovered something that might interest people here, the creator of minikanren is going to speak @ http://con.racket-lang.org/ amz3: s/creator/creators/ amz3: as usual the conf website is... beautiful, my taste anyway amz3: also, I re-implemented my forward.scm frontend framework in javascript and things are much more complicated which makes me think that BiwaScheme (and scheme) has a great learning curve, it's easier to jump into forward.scm than the equivalent in JavaScript amz3: much easier amz3: much much easier amz3: this lead me to have deeper look at GraphQL, basically GraphQL has nothing to do with graph in particular or SQL outside the fact that's "yet another query language" amz3: I hope you see where I am going amz3: GraphQL is DSL that aims at replacing REST endpoints amz3: it will be the default API of github AFAIK amz3: knowing that scheme is great at DSL, I am wondering how this could be translated to GNU Guile manumanumanu: So. My for loops are ready to be battle tested. If anyone wants to, please try my loops: https://bitbucket.org/bjoli/guile-for-loops manumanumanu: docs here: https://koketteriet.se/software/guile-for-loops/docs.html amz3: «Compared to the output of srfi-42 you notice one thing: no safety checks. It is up to the programmer to check the arguments.» great! amz3: manumanumanu: what do you use for the generating the documentation? amz3: please manumanumanu: amz3: org-mode, of coures :D amz3: what! amz3: that's neat! manumanumanu: I would never leave the comfort of emacs for something other than irc amz3: code highlighting is very nice manumanumanu: and web banking, but that is never comfortable manumanumanu: amz3: you need to get the org from melpa. the one included does not support it amz3: tx manumanumanu: newest version, export to html. voila manumanumanu: Now, people, how do you write your unit-tests? amz3: manumanumanu: regarding your project, do you recommend using it whenever I can or something else? it's there a specific usecase where it makes sens? sorry if it's a silly question manumanumanu: amz3: well, i am pretty satisfied with it. The looping constructs have zero or very close to zero runtime costs. I'd rather use racket-style for loops than hand-rolling my loops manumanumanu: they are mighty comfortable amz3: I use srfi-64 and a simple macro https://framagit.org/a-guile-mind/guile-wiredtiger/blob/master/tests/helpers.scm#L69 amz3: if remove the 'with-directoy' form, it's a 10 line macro for doing tests manumanumanu: amz3: and when you start having to hand roll something similar to the for*-loops, then for* is not only cleaner, but less error prone amz3: I defined 'test-begin' and 'test-end' also to keep track of whether a suite is successful or not. TBH srfi-64 does the job amz3: manumanumanu: ah manumanumanu: thanks amz3: that's a good argument manumanumanu: The only real downsides are: 1. you depend on a third party library. 2. compilation times increase. amz3: (for* ([a '(1 2)) b '(x y)]) ...) does the product of of A and B, right? amz3: srfi-64 is builtin guile afaik amz3: iirc I mean manumanumanu: amz3: correctly formatted, that code would loop 1 : x y; 2: x y. manumanumanu: amz3: my macros produce slightly faster code than srfi-42, and takes less time to compile amz3: I don't understand the example with 'x', 'y' manumanumanu: amz3: look in the docs under 3. Conventions amz3: the caveat I see, with 'for' is that it makes scheme less minimal somewhat, that said it allows to avoid bugs amz3: tx! manumanumanu: amz3: on the contrary! this is created by building on a strong set of well-defined primitives. Very schemey :D amz3: tbh, I don't plan to dive further in your project, right now, if someone chime in my project and tell me a one of the named-let I use can be replaced with a for-loop I will gladly make the change manumanumanu: amz3: probably most of your named lets can be replaced without any performance regressions other than at compile time manumanumanu: that is my sales pitch :) manumanumanu: I am pretty happy with how the loops turned out manumanumanu: and it should be pretty portable :) amz3: :) daviid: manumanumanu: mozilla public license v2? is this compatible with GPL v3+? solene: hello, I'm trying to use sxpath but I'm really lost. I want to get the content/value/text of a td which has a certain class. but all I can get in return of sxpath is the class that match the class I need. like (sxpath '()// td @ class (equal? "theclass")) returns ("theclass" "theclass") if there are 2 td with this class amz3: solene: for instance: ((sxpath '(// td *text*)) xml) returns ("win!" "lose") with the following sxml ((*TOP* (body (table (tr (td (@ (class "foo")) "win!") (td (@ (class "no")) "lose"))) (div "b"))) mwette: solene: try (sxpath '(// (td @ class (equal? "theclass")))) amz3: I am trying to understand how sxpath does query over another xml axis amz3: solene: try: ((sxpath '(// (td ((@ (class (equal? "foo"))))) *text*)) xml) amz3: solene: with the same example you gave me amz3: I've been trying to solve this problem for quite some time solene: amz3: that doesn't work for me solene: mwette: this returns ("foo") amz3: http://dpaste.com/2YRC9T5 amz3: here is a permalink http://paste.lisp.org/display/352569 solene: amz3: thx that works, I think I did an error while copy/pasting solene: :) amz3: solene: tx for asking! I was wondering how to do this for months...! amz3: I never got into trying again amz3: now i can improve sxpath doc solene: amz3: I'm struggling with guile doc, I'm new to scheme and guile so I assume this is me. I'm reading the documentation by little everyday, everything is well documented but it's hard to understand how to use it when you discover it amz3: solene: I never read the doc, I mostly look up things in the procedure index for things and ask question when I need amz3: solene: like I said, before now, I did not know how to do the query you asked for paroneayea: http://dustycloud.org/tmp/mudsync-on-8sync-fibers.png whew paroneayea: 8sync-on-top-of-fibers finally working enough that my MUD works :) paroneayea: \\o/ daviid: paroneayea: great! cmaloney: is there a way to take a list '(#f #t #t) and "and" the list (so it returns #f in this case) cmaloney: my google-fu is failing me daviid: cmaloney: no, you have to write your own and-l, since and is a macro ... daviid: cmaloney: there is one here if you want [line 109 -> 114) http://git.savannah.gnu.org/cgit/guile-cv.git/tree/cv/support/utils.scm?h=devel cmaloney: I found and-map, which does what I wanted it to do. cmaloney: Thank you. :) cmaloney: (and-map identity /list/) daviid: cmaloney: cool, but its not in guile manual, where did you find it? cmaloney: I found it in the racket stack overflow pages manumanumanu: dsmith-work: thanks. I just wondered if there was anything specific manumanumanu: cmaloney: srfi-1 has every. manumanumanu: cmaloney: (every values '(#t #t #f)) manumanumanu: which is the schemey version of racket's and-map manumanumanu: but hey, guile has and-map it seems :) manumanumanu: if you are trying to write portable code, you should probably just rely on srfi-1 and cond-expand IMHO manumanumanu: or implement it yourself. it is like a 4 line function :) cmaloney: manumanumanu: Thank you. ijp: wingo: are you around, I want to pick your brain about something wingo: hi wingo: sorta around wingo: what's up? ijp: basically, I was wondering what thought had been given to static linking in guile, and if so, how it could translate to my guile-js wingo: hmm wingo: only some partial thought. i don't see the whole solution wingo: at least in my head i mean ijp: right now, for testing, I've been essentially building a small map in the file when I test it, and that maps module paths to the compiled unit wingo: makes sense wingo: i think as far as i got was https://wingolog.org/archives/2016/02/04/guile-compiler-tasks on the "linking multiple modules together" ijp: I feel like, in principle, we can usually statically determine this ijp: most people are using define-module, and so it should be possible at compilation (macro expansion) time to embed some information about what is required wingo: yes i think you're right, but there is the danger that we might change guile's semantics if we made a core change wingo: i mean, that might be a good thing of course :) but it's a tricky area to work in ijp: right, I don't think this is a part of guile I really want to be touching right now ijp: I wonder what the "reasonable first step" is for me, then. ijp: paroneayea: thoughts? ijp: I could formalise the "manually build the map" I've already been doing, with the understanding that we would move to a solution more like what is described in the blog post once I have a better understanding of the linking process ijp: essentially, a small file that includes all the files you want bundled, plus which guile builtin modules it depends on (not a full dependency tree, the tool would recursively include those) ijp: nothing too fancy (main "foo.js" (depends ((foo bar) "foo/bar.js") ((srfi srfi-1)) ...)) dsmith-work: ijp: Sounds like a linker ijp: it is a linker ijp: it's just a really bad one dsmith-work: heh paroneayea: ijp: so when a user compiles a Guile program -> JS, it includes everything they need for that Guile program? paroneayea: a somewhat or even really bad linker is ok, this could always be refactored later right? ijp: right now, when you do guild compile foo.scm --to=javascript, you get a file that just represents that module, as you would expect from a .go ijp: so afterwards you would need to link it paroneayea: ijp: so this would be one big recursively built js file? paroneayea: it seems fine for now, maybe even in the future we'd have better ways to distribute javascript with programs where they can be linked together dynamically without it being a nightmare, but I agree that for the moment this is probably what people want paroneayea: ijp: my view is you should do the thing you think is reasonably cleanest that you can get going with. in the future if a better way becomes clear, that can be refactored ijp: the two issues are: 1. Can I infer the dependencies, and 2. If not, and I infer the pathnames for linking paroneayea: ijp: I guess anyone who uses (@@ (foo) bar) is pointing a shotgun footward too, huh? :) ijp: indeed, but they knew that at the time davexunit: I use @@ sometimes for what I consider to be a legitimate reason davexunit: in order to use private APIs from another module in the same project. that way the private API is never exposed to users. paroneayea: yeah I find @@ is useful for when you either have a) cycles that are really hard to work around or b) need to use something that really shouldn't-be-exposed-normally, eg in testing paroneayea: but I know it's a foot-gun :) paroneayea: ijp: anyway your plan seems like a good direction to explore. Go for it! ijp: davexunit: I haven't done it in a while, but I always bundled those in (project private submodule) paroneayea: ijp: that's still a lot of work for unit tests I feel like paroneayea: ACTION shrugs though paroneayea: "unit tests aren't real world code" anyway wingo: ijp: if you want advice, for me it's "be just as dynamic as guile" -- e.g. implement the caching module variable lookups etc for top-level and cross-module references wingo: guile is not so nice here but that's probably the path of least friction -- there are optimizations possible but for me they would be more appropriate as a next step ijp: I'm not sure I can be "as dynamic as guile" in the guile-js context ijp: or maybe I just misunderstand you ijp: all I'm really thinking about is deployment, and what work it is reasonable to expect a user to do w.r.t. dependencies ijp: is there a template for things that go in (scripts *) ? ijp: do we have a procedure to copy from another port? paroneayea: ijp: hm, I don't know of one... I've just read bytevectors in chunks from one port to another anon9002: davexunit: It seems you forgot to renew your SSL certificate on dthompson.us. It's been expired for almost 2 months now. davexunit: anon9002: yes I know davexunit: unfortunately my certs cannot be renewed anymore for some reason paroneayea: davexunit: D: paroneayea: on Let's Encrypt? dsmith-work: ijp: Is one port a file and the other a socket? (as in, can you use sendfile() ?) dsmith-work: Ooo. https://www.gnu.org/software/guile/manual/html_node/File-System.html#index-scm_005fsendfile rekado_: davexunit: can’t you just remove /etc/letsencrypt and start over? ijp: dsmith-work: sendfile might work for me, thanks paroneayea: dsmith-work: ijp: one caveat is that I think sendfile doesn't work with (ice-9 suspendable-ports), if you intend the code to work with that later paroneayea: or at least, doesn't right now davexunit: paroneayea: yeah, maybe my client is too old davexunit: but my guix is hopelessly out of date davexunit: and I cannot update davexunit: I have to start from scratch paroneayea: davexunit: oh, maybe you have the issues rekado_ and I did paroneayea: I wrote something to the mailing list a while ago davexunit: oh I haven't been paying attention paroneayea: davexunit: Hey wait! I thought guix was the land of fearless upgrades! :) davexunit: I should do a search when I have a chance paroneayea: ;) davexunit: paroneayea: not when 'guix pull' doesn't work. 'guix pull' is the achilles heel and it's frustrating paroneayea: ah yes davexunit: ACTION goes afk, will read backlog later paroneayea: davexunit: I don't use guix pull btw, I do guix-from-git only paroneayea: but paroneayea: that's clearly not what we recommend paroneayea: and it isn't something we should expect of people dsmith: sneek: botsnack sneek: :) dsmith: Yey manumanumanu: What do you guys use to write documentation? I have more or less finished my almost-racket-compatible-syntax-case-only for loops, but I need to document it manumanumanu: Preferrably with syntax highligting of code examples and such manumanumanu: org mode? edne: Hi! I'm quite new to Guile, now I'm using it embedded in a C program edne: I'm trying to define a new foreign object type following this guide: edne: https://www.gnu.org/software/guile/manual/html_node/Defining-Foreign-Object-Types.html#Defining-Foreign-Object-Types edne: but I get an "undefined reference to `scm_make_foreign_object_type'" edne: I'm using Guile 2.0, I tryed to grep "scm_make_foreign_object_type" in the "/usr/include/guile/2.0" folder but it seems to be not defined edne: Do I need to install some library or this function is just deprecated? and in that case someone know how to do it in this version of Guile? edne: ok, maybe I solved simply using scm_from_pointer webshinra: guile/2.2/libguile/foreign-object.h webshinra: 30:SCM_API SCM scm_make_foreign_object_type (SCM name, SCM slot_names, webshinra: (please notice that ripgrep rox) dsmith-work: manumanumanu: For person stuff I use org-mode, but texinfo should be used for gnu stuff. edne: webshinra, I have guile/2.0/libguile/foreign.h :( edne: but now I am compiling the 2.2 for the atomics support webshinra: :) solene: data solene: oops cmaloney: I think you mean #basic, solene ;) cmaloney: ACTION remembers all of those data statements dsmith-work: cmaloney: Did you ever type in a BASIC program from a magazine that was just a few lines of code and about 500 data statements? (the data was actualy machine code) cmaloney: a-yep dsmith-work: heh cmaloney: Later Compute magazine was pretty much all "5-line-loader + 5 pages of data statements" dsmith-work: They even had checksums built into them. cmaloney: at least those had a TSR program that would prnt a checksum cmaloney: yeah cmaloney: I think Antic / Analog had those as well cmaloney: don't recall one for Atari Explorer cmaloney: and Byte magazine thought nothing of just printing out assembly code cmaloney: which, frankly, might have been easier cmaloney: though no checksumming dsmith-work: I had a C64. Compute! sounds familar cmaloney: Compute! covered a lot of the machines cmaloney: plus they had some of the great books like "Mapping the [machine]" and "Compute's first book of [machine]" cmaloney: I wish I had the foresight to pick up Mapping the Atari and De Re Atari back in the day cmaloney: and Mac/65 on a proper cartridge cmaloney: hindsight and all dsmith-work: yep cmaloney: I have copies now, but having the sponge-like brain of a 10y/o would have been nice. dsmith-work: One of the first things I did with the C64 was dissasemble the roms. cmaloney: I wish I had a mentor to show me how to do that dsmith-work: Got away from basic as qucik as I could. cmaloney: I played Star Raiders. :) dsmith-work: Mainly used it as a terminal to dial in to the local public-access unix system to learn C. cmaloney: Ah. I got the Atari when I was ~ 10 dsmith-work: (which was running xenix on a trs-80) cmaloney: so basic was pretty much what I was used to cmaloney: Woah cmaloney: Model 2 or Model 16? dsmith-work: THe 68000 trs-80 cmaloney: I think that was the 16 cmaloney: Daaaamn cmaloney: I've only read about that machine. Never saw one in person dsmith-work: ncoast pubic access unix. dsmith-work: I as about early 20's then. cmaloney: Right, but you had the experience of logging into a UNIX machine and learning C in the 1980s cmaloney: I had to wait for college for that cmaloney: early 1990s cmaloney: My first UNIX machine was a lab of SparcStation 1s dsmith-work: Yeah, I've been doing C for more than 30 years. cmaloney: (and one 2, one IPC, one IPX...) cmaloney: In high school we had access to a mainframe for BASIC cmaloney: It was terrible. Stupid 3270-ish terminals that would time out based on some arbitrary load. dsmith-work: cmaloney: Ever use Forth ? cmaloney: so you'd hit "enter" and it would log you out. cmaloney: I've only played with Forth on a Jupiter Ace emulator. ;) cmaloney: I was cogniscent enough on the 1980s to want a Jupiter Ace, but never got one cmaloney: mostly because it looked like a neat machine dsmith-work: Heh. My first real job was fixing 3270's. And the rest of the 360/370 stuff. cmaloney: Gah cmaloney: Moving one of those had to be painful cmaloney: just moving the keyboard took effort dsmith-work: Heh cmaloney: made the Model M keyboards seem light by comparison cmaloney: (Keep a model M keyboard by your bed in case of intruders; you can swish it at them to scare them away) dsmith-work: lol cmaloney: At some point we moved to IBM PS/2 machines (286s... think they were model 30s) with Turbo Pascal cmaloney: And college was all Pascal / Modula 2 / ADA (with smatterings of C, Lisp, COBOL, and assembler) cmaloney: and I think SNOBOL, but I've looked at the Wikipedia page for SNOBOL and it doesn't look remotely familiar. dsmith-work: Oi dsmith-work: Never touched any of that stuff. cmaloney: Hope College got a grant from the DoD to teach Modula 2 and ADA. I think ADA is a miserable language. dsmith-work: Converted some pascal code to C but that was about it. cmaloney: spent most of the section with ADA trying to figure out the printed manual in the lab. cmaloney: And of course I thought Pascal was the bee's knees. dsmith-work: Now ada seems like a language where editor templates come in really handy. cmaloney: I also thought the 3DO was nifty, stuck with my Atari 8bit into 1993, bought a Sega Saturn and Dreamcast. cmaloney: If I'm betting on a horse it's a fair bet that you may want to bet on something else. cmaloney: Yeah, it would be better served with an IDE cmaloney: Honestly I wonder how much of Modula 2 / Ada made it into Delphi cmaloney: I'd imagine a few bits snuck in cmaloney: I think I got Delphi at a student discount at the college I worked at, but that was also when I was transitioning from Windows to Linux full time cmaloney: Back in ye-olde Slackware days cmaloney: where kernels were hand-compiled and disk 22 was always screwed up. dsmith-work: cmaloney: Yeah, slackware was the first linux I installed. Kernel 1.8 (or 1.0.8?) dsmith-work: Had to hack the sound driver to enable the cdrom dsmith-work: Before I did that, needed to boot back to dos and copy packages to floppy, then boot back to linux to install them. What a pain! manumanumanu: cmaloney: I still think pascal is a nice language. At least the deplhi Object Pascal version with all the neat things manumanumanu: that came out wrong cmaloney: manumanumanu: Right. We never got to that point. I didn't see OO in practice until after college. cmaloney: dsmith-work: Good times. ;) manumanumanu: I think it is nicer to do object pascal development than the C family of languages cmaloney: Don't get me started on C++. ;) dsmith-work: cmaloney: Heh. Yeah, thanks for the memories. cmaloney: dsmith-work: No worries. It was a magical time for me, and I love these old machines. cmaloney: http://www.old-computers.com/museum/computer.asp?c=242 dsmith-work: cmaloney: I used to dissasemble code on continuous feed paper. I've have like a 30 foot printout on the floor going into different rooms. I'm markup all the loops and functions. cmaloney: <3 ijp: the printup went uphill bothways in 20ft of snow too ijp: printout* dsmith-work: ijp: Hah! dsmith-work: cmaloney: I have a real vt100 at home. cmaloney: I never got a VT-100, but I have an ADM 11 in the basement. cmaloney: http://terminals-wiki.org/wiki/index.php/File:Terminal-adm11.jpg ijp: I keep a spectrum at home, but it's symbolic more than anything. The first "machine" I really programmed was some PIC cmaloney: Had another terminal that literally had a radiation sticker on it. Gave that to my friend as a joke. cmaloney: <3 the ZX Spectrum, but I wasin the USa so we never had that machine proper here. janneke: it looks like `guix environment --ad-hoc -l guix.scm' does not do what i expect? ijp: I doubt I can help you, but you should probably clarify what you expected and what it did davexunit: janneke: it should... mwette: Hi Folks. I am working on a project to convert .h files into .scm files in order to provide access to C libraries. In at least one case the header file is covered by GPL v2 while my code is covered by GPL v3. Does this mean those translated files cannot be released? (A specific case is for libgit2.) civodul: hey mwette! mwette: civodul: howdy civodul: mwette: IANAL, but i think that since it's an automated translation process, the liecense that applies on the source .h file also applies on the generated .scm file janneke: hi mwette! civodul: it's similar when, say, a .c file is compiled to .o mwette: OK. My thinking was to copy (by hand) the copyright notice from the header (or a representative quote from possibly multiple headers) into the ".ffi" config file. DO you think that will work? civodul: mwette: i think you don't even need to bother civodul: BTW, are you aware of https://gitlab.com/guile-git/guile-git ? :_) daviid: mwette: and aware of guile-cairo as well? mwette: haha. No, I wasn't aware. I have no current interest. I was looking for header to throw at the tool (ffi-helper). But thanks. civodul: :-) mwette: The same issue goes for cairo, which I am interested in. I know there is a cairo-guile port but that may be a bit old. IIRC wingo produced that port. civodul: right civodul: maybe a renewed Guile-Cairo would make sense (the existing one uses the C API) daviid: mwette: yes, guile-cairo, but it would be more productive to clone and patch... imo, and pickup another header to play with civodul: though it's more than a bunch of .scm files, of course mwette: I can currently convert cairo.h cairo-svg.h and cairo-pdf.h to a single .scm file which is ~ 6000 lines long; all automated. civodul: neat mwette: libgit2.h converts to libgit2.scm, about 7000 lines daviid: civodul: yeah, but guile-cairo is guile-gnome and guile-clutter 'aware', a new binding would not work ... civodul: yeah mwette: gdbm.scm is about 600 lines civodul: mwette: i guess the ffi-helper could also be used at macro-expansion time, right? civodul: could be fun janneke: mwette: btw, thanks a lot for 0.80.4! mwette: civodul: not getting you. mwette: The idea right now is to use "guild compile-ffi path/to/foo.ffi" which generates path/to/foo.scm. civodul: ooh, i see civodul: i though you could have a macro, like (make-me-an-ffi "/usr/include/cairo.h") civodul: *thought civodul: and that'd expand to the definitions civodul: anyway, a detail mwette: I'm sure that could be done. mwette: my script/compile-ffi.scm just calls a procedure compile-ffi-file with the spec in it. The minimal info is header name and pkg-config name. mwette: So one could (make-me-an-ffi "cairo.h" #:pkg-config "cairo") civodul: ok daviid: I wonder if cairo has a gir module daviid: i can't remember civodul: i don't think so daviid: civodul: yeah, I think you are rght civodul: mwette: anyway, impressive piece of work again! mwette: janneke: you are welcome; IO appreciate you finding bugs. I have found more that didn't make it into 0.80.4 janneke: davexunit: thanks, I guess my package description is broken mwette: civodul: thank you janneke: mwette: ah, yes rain1 found one new bug and i also just found one janneke: making good progress with compiling tinycc civodul: has one of you looked into compiling C to Tree-IL? civodul: could be fun civodul: although i guess the hard part would be the run-time support janneke: davexunit: i guess that for a guile package to work with environment --ad-hoc, it needs to set native-search-paths for GUILE_LOAD_[COMPILED_]PATH davexunit: janneke: yup davexunit: wait, no davexunit: you need to add guile to the environment janneke: davexunit: ah, right davexunit: guile has the native-search-paths you need janneke: yes, thanks davexunit: executables that use guile ought to be wrapped to do the right thing somehow davexunit: civodul has brought this up before with my own software, but I don't know how to implement it janneke: it's nyacc, no executables ;-) davexunit: ah okay civodul: davexunit: i did it this way: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile.scm#n1160 davexunit: civodul: I recall you saying how the application build system should take care of this somehow davexunit: so that extra guix code isn't necessary, because we wouldn't want to duplicate that for every guile executable in the world civodul: davexunit: yeah i may have said that ;-) civodul: python-build-system does that automatically davexunit: I couldn't tell if you mean the guix build system or the autotools build system for the application civodul: yeah i'm not sure exactly where it'd belong civodul: for python it was obvious paroneayea: huh paroneayea: https://github.com/nineties-retro/sps paroneayea: > SPS is a Pre-Scheme to (GNU) C compiler written in Pre-Scheme. paroneayea: janneke: ^^^ maybe a fun thing to look at paroneayea: rekado_ also janneke: paroneayea: oh nice! wingo: paroneayea: i was thinking, i can probablymake fibers a bit more lightweight wingo: i was at first trying to make them have identity -- like you could ask what fibers are running etc. but now i think that's a layer that's best added above wingo: i.e. you can build fibers-with-identity on top of "raw" fibers wingo: or actors-with-identity, etc sjoerd`: has there been activity on making a JIT already? It would seem libgccjit might be a proper backend for bytecode ArneBab_: sjoerd`: there are people who experimented with compiling with GNU lightning: https://www.gnu.org/software/lightning/manual/lightning.html ArneBab_: "One thing I have found incredibly pleasant with Guile is the manual. Good manuals explain how to use the software. Great manuals encourage you to understand the software and the implementation details." → http://decafbad.net/2017/07/26/day-56100-leap-years-in-scheme-guile-code-and-the-guile-manual/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+CraigMaloney+%28Craig+Maloney%29 ArneBab_: (sorry for the PR dirt in the link, I didn’t realize it was in there when copying) ArneBab_: sjoerd`: were there news around gccjit? ArneBab_: sjoerd`: here’s the link to the compiler experiment: https://github.com/8c6794b6/guile-tjit sjoerd`: ArneBab_: it is right here, https://gcc.gnu.org/wiki/JIT sjoerd`: Would it also make sense to have GNU R compiling to Tree-IL? civodul: would be interesting :-) civodul: re guile-tjit, there's a paper from the 2016 Scheme Workshop mbuf: Are there any examples on integrating JavaScript with Artanis? ArneBab_: sjoerd`: I think it would be interesting to have R on Guile ArneBab_: but likely lots of work ArneBab_: sjoerd`: the larger plan for Guile is however to add a specialized compilation step. For a proof-of-concept see http://wingolog.org/archives/2014/02/18/compost-a-leaf-function-compiler-for-guile sjoerd`: Am reading dsmith-work: Morning Greetings, Guilers civodul: ACTION struggles with bytestructures paroneayea: wingo: hm interesting... I think it wouldn't interfere at all with the stuff I'm doing to make that change jlicht: Does guile have something akin to a reader macro? I found the documentation for `read-hash-extend', which might already do what I want paroneayea: wingo: are you thinking it would be better for conceptual simplicity or speed? wingo: paroneayea: both paroneayea: wingo: gotcha paroneayea: right now 8sync on fibers is "half the speed" on a single core than it was before but paroneayea: now we can take advantage of multiple cores paroneayea: you get it back if you add two cores ;) paroneayea: and that's just for message passing, which I think won't be the bulk of cost of most programs (most of it should happen in the handlers themselves) paroneayea: so I think it's mostly ok paroneayea: being able to take advantage of multiple cores and preemption is a big win, so civodul: jlicht: read-hash-extend is the thing (or Guile-Reader); but think twice before you start relying on a reader extension :-) wingo: paroneayea: one thing, did you try re-using the operation for every turn of the actor's loop? wingo: like the operation that you make to send or receive or be signalled -- that data structure is stateless, you can re-use it jlicht: civodul: I am player around with Semantic Versions, and it quickly became a hassle to run (clean <..>) on all my input while doing some REPL driven development ;-) paroneayea: wingo: yup I'm reusing it jlicht: civodul: So I will only be using it as a convenience when coding, not in the actual code itself paroneayea: wingo: also, adding actors overhead runs at half the speed of a basic ping-pong test in fibers also wingo: paroneayea: cool ijp: if it's only for the repl, then a repl command is probably more appropriate than a reader extension paroneayea: and of course paroneayea: we do have double the message passing paroneayea: because we have the intermediary delivery fiber paroneayea: for the buffered queue civodul: jlicht: i agree with ijp ↑ jlicht: ijp: That is probably more appropriate then. How can one 'extend' the repl in this way? The manual mostly talks about the existing commands ijp: Check out the module (system repl command) and in particular define-meta-command ArneBab_: hello ijp — nice to catch you online! jlicht: cool. Thanks civodul, ijp :-) paroneayea: I'm still a bit jealous of Akka which apparently can get to 1M messages per second per core, but maybe we'll get a nudge closer to that when we hit native code generation :) ArneBab_: ijp: do you have an update on your guile-js work? ijp: ArneBab_: If you don't mind waiting, I'll message the list at some point in the week ArneBab_: sure :) ArneBab_: ijp: one problem which came up here which I couldn’t answer was "is the code somewhere" ArneBab_: ijp: do you have your code online somewhere? ijp: there is some on gitlab, but I haven't pushed recently ArneBab_: will you do that for the message to the list? ijp: yes ArneBab_: ah, gitlab as keyword found your gitlab repo in my history: https://gitlab.com/ijp/guile/tree/compile-to-js-2017/ manumanumanu: So, I have added #:final-keywords to my for loops, which are not quite syntactically the same as rackets ones (no body-or-break-clause, but nobody uses those any way), but they are on par feature wise. However, ArneBab_ asked me about the macro expansion time, which is somewhere close to 0.02s for a non-trivial for loop. That is not good enough. What are the tricks to keep macro expansion down? manumanumanu: macro-expansion time* manumanumanu: I moved away from generating and outputting lots of syntax in favour of a more procedural style, which made it slightly faster manumanumanu: the code can be found here: https://bitbucket.org/bjoli/guile-for-loops/ (explanation/docs in for-loops-impl.scm) ArneBab_: manumanumanu: you can call into helper functions as much as possible. That keeps the code size down (be minimizing duplicated intermediate code) manumanumanu: yeah, that's what I have been doing. My first attempt was more or less a syntax-rules-only approach, but now, instead of generating and outputting code for the next macro, I am passing syntax objects to helper functions around manumanumanu: before i started doing that, I had 3 steps that generated the code for the next macro, now I only have 1 intermediate step before emitting the code. manumanumanu: I still need to use syntax-case to destructure the syntax passed around, so I don't know how much is gained by the procedural style anyway solene: hello, how can I parse a html answer to extract some tags ? I can't find any library doing this bavier`: solene: you might be able to use the sxml module dsmith-work: Ancient, but might be able to be resurrected: https://lists.gnu.org/archive/html/guile-devel/2013-07/msg00029.html dsmith-work: I guess htmlprag is part of guile-lib daviid: solene: htmlprag is in guile-lib, here is the doc link: http://www.nongnu.org/guile-lib/doc/ref/htmlprag/ solene: bavier`: I tried the sxml module but it seems that my html isn't a perfect xml so it throws an error while converting it dsmith-work: solene: Which is the exact problem htmlprag attempts to address dsmith-work: A "pragmatic" parser for html solene: yes, htmlprag seems to do exactly what I need ! :) ijp: Someone(tm) should go over the html5 parsing algorithm with a fine toothed comb, and make htmlprag do the same paroneayea: or just rewrite it following https://www.w3.org/TR/2011/WD-html5-20110113/parsing.html paroneayea: or even the current editor's draft paroneayea: current ED looks more complicated tho ;P paroneayea: might be easier to start with the 2011 document paroneayea: ah no paroneayea: nm me paroneayea: it looks just as complex paroneayea: I didn't see that https://www.w3.org/TR/2011/WD-html5-20110113/tokenization.html was on its own page, heh paroneayea: I think auditing the algorithm against that incredibly complex document would be so much work that it would maybe even be less work to just type in the algorithm from that page by hand paroneayea: esp since the w3c document isn't a specification of behavior as much as a step by step algorithm ennoausb`: Hello ennoausb`: Is there a string-append variant that puts spaces between the string args? That might be useful to construct command lines for system() calls janneke: ennoausb`: there is string-join janneke: it takes a list and optional separator and grammar ennoausb`: janneke: Thank you. I knew guile provides something like that reepca: I don't suppose we have anything like getgrouplist? Something that takes a UID and gives supplementary groups, rather than just giving current supplementary groups? paroneayea: btw I misspoke pretty badly! paroneayea: not 125k messages per second but 12.k messages per second paroneayea: shift over a whole digit, oops ennoausb`: Hello, I just ran into a problem as I overengineered my first guile project. :) paroneayea: it was 25k before the port ot fibers ennoausb`: I played around with mcron and I wrote some guile files to describe the jobs ennoausb`: After a file I mentioned that most of the job code is identical so I just used a config file what setups the cron jobs. So far so good. But the next step failed. I softlinked the .guile files to the now refactored job file which uses (current-filename) to test which corresponding .cfg file to load. Unfortunately this file was compiled once and reused than. ennoausb`: So job1.guile,job2.guile,job3.guile seem to be identical even if job1.cfg job2.cfg and job3.cfg are different ennoausb`: So I guess there is no easy way to achieve different behaviour with linked files. ennoausb`: like shutdown halt poweroff commands under linux paroneayea: it looks like fibers, on its own, can spawn about 26k fibers per second. So really, the overhead of adding actors is not so high in that sense paroneayea: likewise for the pingpong test ArneBab: I now described my doctest implementation for guile-user paroneayea: omg paroneayea: D: paroneayea: the bug paroneayea: it was a stupid typo the whole time paroneayea: (re: slowdown in 8sync and fibers) paroneayea: typo on my end daviid: paroneayea: oh! a tipo would generally raise an exception, no? how come it 'just' slowdown things, just curious paroneayea: daviid: well, typo in that I had done a refactoring and paroneayea: I had something like paroneayea: (let lp () paroneayea: (if foo? paroneayea: (lp) paroneayea: 'done) paroneayea: (lp)) paroneayea: yep that's right paroneayea: I accidentally ran the loop regardless. paroneayea: I found it out by putting a (pk 'hammertime) in the place it should have stopped daviid: ah, it happes! oh man, good you found it paroneayea: and my screen was filled with hammertime ;) daviid: s/happes/happens paroneayea: ok now things are running fast :) paroneayea: well I still went through a ton of Concurrent ML literature, enough to add the GC of waiters to conditions, which I guess is still useful even though it wasn't the cause daviid: paroneayea: very good news, because that what fibers claims it is ... paroneayea: and enough to really understand the heart of the beast a lot better paroneayea: I guess that wasn't for nothing, if I learned a lot :) paroneayea: I still have to finish the port of 8sync on top of fibers tho daviid: I wish I had time more to learn about concurrency, one day maybe daviid: paroneayea: pk is a good friend :) daviid: pk is a good boy, like sneek cluck: janneke: congrats on mes :) daviid: in a manual, saying 'Returns multiple values: ...' then I wonder if numbering would be '(1)', '1-', or '1.' ...; '(2)' ... how is that for a friday night existential quizz? :) paroneayea: wingo: https://github.com/wingo/fibers/pull/9 :) paroneayea: moin moin paroneayea: ok! paroneayea: so, message passing is slower in 8sync with fibers, but paroneayea: I think the tradeoff is worth it. paroneayea: previously: paroneayea: 4.032482s real time, 4.572554s run time. 1.203915s spent in GC. paroneayea: now: paroneayea: 7.453797s real time, 8.658398s run time. 2.784487s spent in GC. paroneayea: for handling 100k messages paroneayea: but! we can also take advantage of multiple cores now, which is nice paroneayea: that was just with a single actor; I haven't tried the difference if there were multiple actors dispatching to each other paroneayea: I suspect 8sync-on-fibers may be nicer there, again, because of multiple cores cmaloney: nice! cmaloney: is it pretty much double the time, or does it even off at larger loads? paroneayea: cmaloney: I haven't tried paroneayea: I assume it's about double, but only for the message passing itself cmaloney: kk paroneayea: presumably most of computation is the stuff in-between the messages passed paroneayea: I think 125k messages / second is still pretty ok for a single core on a decade-old machine though! cmaloney: yeah, no doubt. :-D magnicida: hi! magnicida: I'm working on some library to make it easy to bind C++ code to Guile magnicida: https://sinusoid.es/schmutz magnicida: https://github.com/arximboldi/schmutz ArneBab_: magnicida: nice! (and a nice name ☺) magnicida: thanks! :-) solene: hello, what is the best way to describe a structure with attributes in guile scheme ? I'm currently using (list '(attr1 . "value1") '(attr2 . "value2")) and retrieve values with (cdr (assoc 'attr1 mylist)) but I'm not sure it's the best way to achieve this lloda: solene: in Guile there's assoc-ref lloda: if you're not sure, encapsulate so you can change the structure later w/o affecting users lloda: e.g. to a hash table later on solene: indeed, assoc-ref is easier than my code, thanks lloda solene: I miss getf and keywords from common lisp solene: is it right that I can't use keywords instead of pairs ? like #:attr1 "value1" instead of '(attr1 . "value1") mbuf: Does guile use pthreads? mbuf: can it be used for parallel and concurrent programming? solene: mbuf: AFAIK guile uses green threads so everything runs on one CPU but can share time between tasks solene: which is not what you want janneke: solene: you can use `((#:attr1 . ,v1) (#:attr2 . ,v2)) lloda: solene: mbuf: Guile does use pthreads. See (ice-9 threads). It's not the most robust thing ever ime, but it's there. lloda: see also e.g. https://github.com/wingo/fibers mbuf: solene, lloda okay, thanks! mbuf: lloda, fibers is nice solene: janneke: that's the same as not using keyword ? janneke: solene: i don't understand...using keywords as keys is using keywords, not using keywords as keys is using ... well whatever you are using lloda: I think solene wants to (make-data #:key value #:other-key other-value ...) solene: janneke: I'm still in a common lisp way to think so I have bad habits from a schemer point of view, both languages are close and also very differents. I was writing this in common lisp and wondered if it was possible (list #:attr1 "value" #:attr2 "value") lloda: I guess you can build that taking a rest list and then using keyword->symbol lloda: it's not built in janneke: solene: ah...i'm not much of a lisper janneke: i think (ice-9 optargs) has something for handling (list #:attr1 "value" #:attr2 "value") solene: I'll see ice-9 and make-data, thanks janneke and lloda solene: but assoc-ref works so at least I got one way to do what I need ! :) mbuf: solene, what is the alternative to green-threads? solene: mbuf: I don't know, I'm not using guile since a long time and I've read this in a tool documentation relying on guile that only green threads were available. and lloda said that pthreads were available with ice-9 mbuf: solene, okay lloda: solene: make-data doesn't exist, I was making it up. You can build it though lloda: https://www.gnu.org/software/guile/manual/html_node/Threads.html ArneBab: mbuf: to keep it simple, you can use par-map for parallel work. Here’s an example: https://bitbucket.org/ArneBab/freenet-guile/src/4faaf1c6bf88deff2914689f0f2b54ffda7d588c/crawl-wot.scm?at=default&fileviewer=file-view-default#crawl-wot.scm-201 mbuf: ArneBab, I see ArneBab: via (import (ice-9 threads))) ; see (help par-map) ArneBab: it uses pthreads, though, which means you’ll want to have larger chunks of work. Essentially it gives you a thread pool. ArneBab: mbuf: fibers manage to give you both: easy threading and full usage of all your cores. So go for that if you can. mbuf: in GNU Artanis how is javascript added? mbuf: ArneBab, will give it a try; thanks! mbuf: ArneBab, is there anyone actively working on Emacs-Guile? ArneBab: this says that the last commit to elisp was a year ago: http://git.savannah.gnu.org/cgit/guile.git/log/?h=wip-elisp mbuf: ArneBab, okay ArneBab: this says the last commit to the emacs-part was in 2015: http://git.hcoop.net/git/bpt/emacs.git/info/ ArneBab: which is what guix says, too: http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/emacs.scm#n258 ArneBab: http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile.scm#n276 ArneBab: ACTION wants to have a development team who uses Guix and Guile and Emacs and Wisp to build meaningful programs. mbuf: ArneBab, I am in! ArneBab: now we just need someone to give us money for that :) paroneayea: ACTION just sent "thanks for the reply" to the mailing list then felt awkward about it rekado: I have some Czech coins left after my trip to Prague. I’d use them to fund work on Guix/Guile/Emacs/Wisp. rekado: Now we only need to find people willing to match the donation. civodul: OrangeShark: could you add me to https://gitlab.com/guile-git/guile-git ? janneke: ArneBab: i'm working with a team that has adopted Guile and is adopting Guix... civodul: janneke: super cool! OrangeShark: civodul: sure janneke: civodul: yeah, took me > 3 years in the physical universe civodul: not so bad civodul: how much would it take in the virtual universe? civodul: s/much/long/ janneke: not bad at all, with hindsight civodul: ACTION is also working on it :-) janneke: in the virtual universe, guile took 3 weeks, guix took only a week civodul: :-) civodul: OrangeShark: awesome! i have a few commits regarding settings and error handling OrangeShark: civodul: you should be added now janneke: it's so cool how guile and guix reinforce eachother OrangeShark: janneke: that is cool, how did you manage to pull that off? :) civodul: OrangeShark: thanks, and pushed :-) janneke: OrangeShark: by helping others solve an impossibl problem using Guile, then practice patience and much hard work OrangeShark: janneke: that sounds like a good way :) janneke: OrangeShark: :) janneke: ACTION tried much evangelism and finally gave up civodul: yeah it always works better when you solve practical issues paroneayea: janneke: awesome to hear :) janneke: civodul: i'm learning... janneke: civodul: Guile solved Rutger's problem -- that's almost 3 years ago civodul: heh civodul: janneke: now we need Rutger to solve "our" problems :-) janneke: i'm sure they will :-) civodul: OrangeShark: BTW, i'd welcome feedback on https://gitlab.com/guile-git/guile-git/commit/b6b2760c2fd6dfaa5c0fedb43eeaff06166b3134 paroneayea: since I don't have a good solution for suspending custom ports right now paroneayea: I'm going to keep working on the 8sync-on-top-of-fibers thing so I can use an independent thread as a workaround ArneBab: janneke: cool! civodul: paroneayea: sorry i didn't help with this! civodul: that's quite a lot to page in and my cache is kinda full ;-) ArneBab: I created a simple doctest system based on srfi-64: just write your tests in the docstring. Example usage: https://bitbucket.org/ArneBab/wisp/src/1ce02fce232f429fc1cbd29c666e36d34ec22d76/examples/doctests-test.scm Code: https://bitbucket.org/ArneBab/wisp/src/1ce02fce232f429fc1cbd29c666e36d34ec22d76/examples/doctests.scm ArneBab: (just fixed the last glitches) ArneBab: syntax: (test 'testname ...) with ... the forms from srfi-64. paroneayea: civodul: it's ok! ArneBab: avoiding (test-begin 'testname) and (test-end 'testname) makes for easier parsing. ArneBab: (they are added automatically using the 'testname) civodul: paroneayea: i'd like to play around with Fibers or 8sync "one of these days", so hopefully i'll get to these issues too paroneayea: civodul: :) ArneBab: usage in the repl: (import (examples doctests)) (define (one) "(test 'foo (test-equal 1 (one)))" 1) (doctests-testmod (current-module)) ArneBab: ACTION marks one more point on his convenient-coding-wishlist rekado: I’m autoconf’iscating another in-house tool today and I wished I could use Guile instead of the autoconf/automake/m4 macros. stis: heya guilers! stis: Did some fun things with functional objects and the python object model. check out and discuss if interested at http://www.c-lambda.se/functional-python.html spk121: I did my own take on a logger kind of like glib's logger that can write to console or systemd's binary log. It has actually been pretty useful. I'll have to clean it up and make it standalone sometime. https://github.com/spk121/libguile-mlg/blob/master/mlg/logging.scm ArneBab: rekado: what’s missing for you in autoconf? (I think it’s pretty good that autotools keep their requirements tiny — you need something to build Guile while there is no Guile yet) rekado: it would already be helpful to be able to generate configure.ac and Makefile.am from Guile. rekado: I find the syntax arcane and it’s tedious and verbose to write custom checks. paroneayea: okay paroneayea: so the Parallel Concurrent ML paper is great paroneayea: and after swimming in this stuff for a while I'm finally getting it ;P paroneayea: wingo: ping paroneayea: wingo: to do the gc of waiters, I'm assuming we're going to have to add a mutex around it right... right? paroneayea: or maybe it's possible if I do the spin thing paroneayea: maybe I could implement stack-filter! using update! from stack.scm paroneayea: I'll try that... paroneayea: hm paroneayea: I'm imagining a scenario where fiber A keeps doing stack-push! paroneayea: and fiber B is trying to do asingle stack-push-all! paroneayea: since fiber B will try to append an entire list and then spin if it fails paroneayea: if A just keeps appending small items paroneayea: B may be stuck for a long time or forever? paroneayea: maybe this won't happen in practice but I worry about these kinds of things ArneBab: rekado: do you know conf? https://bitbucket.org/ArneBab/conf ← my try at autotools templates: conf new — currently mostly supports bash, but adding other project-types just requires adding templates. rekado: ArneBab: interesting. rekado: ArneBab: I package a lot of bioinfo pipelines and this requires custom version checks all the time. rekado: I also need to check for R packages, so I wrote a macro that starts R and tries to load the required libraries. ArneBab: having a template with pre-created (but commented-out) checks might help a lot with that. ArneBab: It saves reading rekado: well, I can also just pour this into an m4 macro file rekado: it’s just not something I enjoy doing and it’s error prone ArneBab: would it be less error-prone with guile? Wouldn’t that actually add another layer of indirection? Or would you call Guile for the checks? paroneayea: either I need to figure out how to proxy each read/write to the underlying port and watch carefully for -1 paroneayea: or I need a way to not "call through C" to the supplied read/write function, which means setting scm_read and scm_write, but apparently that's currently done on the port type rather than the port itself happy_gnu: hello :) happy_gnu: I am trying to pass as arguments "and" or "or" happy_gnu: but when i call the function with them i get a syntax error happy_gnu: "unknown location: source expression failed to match any pattern in form and" happy_gnu: (define comparative happy_gnu: (lambda(comp arg1 arg2) happy_gnu: (comp arg1 arg2))) happy_gnu: happy_gnu: (comparative or #t #t) happy_gnu: I get an error :/ happy_gnu: what am I doing wrong? daviid: happy_gnu: you can't do that because and and or are macros, not functions daviid: what you can do is pass a symbol and use case in the body daviid: (define (comp op foo bar) (case op ((or) (or foo bar)) ((and) (and foo bar)))) happy_gnu: ohhh ok daviid :) i was very confused daviid: not sure what yu are trying to do though happy_gnu: i never try to pass them as arguments, couldn't understand why this didn't work happy_gnu: daviid: I am doing the little schemer happy_gnu: there are 2 functions intersects? and subset? they are really similar just change the "or" and the "and" happy_gnu: so I thought of making one that can cover both happy_gnu: this is not part of the little schemer but I am trying to do everything that comes to my mind daviid: happy_gnu: ok, good to experiment yes daviid: i wonder why reduce args were defined in that order, I'd rather reduce something using a procedure and an initial value ..., just curius happy_gnu: daviid: it works :) :D great daviid: wc! happy_gnu: daviid: ohh they do not use them the way I did :/ happy_gnu: I just saw that 2 very similar functions were only different for and "and" and a "or" happy_gnu: so i tried defining one and just define them using the one that groups them but I didn't know I couldn't pass "and" and "or" as arguments :V paroneayea: janneke: WOW! I just read now about https://lists.gnu.org/archive/html/guile-user/2017-07/msg00089.html paroneayea: compiling tinycc???? incredible! cmaloney: woah paroneayea: rekado_: ^^^^^^ cmaloney: https://octodon.social/@craigmaloney/4935912 paroneayea: okay, sent an email to the list about where I'm at with the suspendable-ports and gnutls https://lists.gnu.org/archive/html/guile-devel/2017-07/msg00014.html paroneayea: wingo: If you can find time to look over https://lists.gnu.org/archive/html/guile-devel/2017-07/msg00014.html and offer advice, I'd really appreciate it! janneke: paroneayea: hehe yeah :-) janneke: paroneayea: ouch, sorry to read you're stuck...good luck with that! ArneBab: two months ago I asked in guile-devel about including wisp in Guile, but there was no result of the discussion. How should I move forward with that? Thread: https://lists.gnu.org/archive/html/guile-devel/2017-05/msg00039.html magnicida: is there a way to produce/compare SCM_UNDEFINED from Scheme directly? ArneBab: I would assume that no, because "Its most important property is that is not equal to any valid Scheme value." → https://www.gnu.org/software/guile/manual/html_node/Immediate-objects.html ArneBab: but I’m only going by the docs here ArneBab: paroneayea: you could stray from the cooperative model and spawn a receiver pthread just before you send the request paroneayea: ArneBab: I could, though I'd need a good way for it to send a message back to the actor rekado_: tb paroneayea: and paroneayea: I could do that more feasibly if I finished switching 8sync on top of fibers paroneayea: but that's a lot of extra work itself paroneayea: maybe that is the fastest way to make this happen paroneayea: but it's a pivot in strategy, and it's still leaving a problem open ArneBab_: paroneayea: doesn’t ActivityPub send a message to the test when it gets a reply from the other server? ArneBab_: (to make this even cleaner, you could start a second process which only listens for the request from ActivityPub and provides the expected result) paroneayea: ArneBab_: yeah, so here's the situation that's happening paroneayea: the test suite needs to run a "fake" AP server paroneayea: to see if it gets federated messages paroneayea: but we're also logged into the remote server, using the client to server API paroneayea: where we can post messages logged in as that user paroneayea: so if we do paroneayea: POST: {"to": ["https://address.of/our-local-user/"], "type": "Note", "content": "Hi!"} paroneayea: and submit that to our outbox endpoint of the user we're logged in as paroneayea: when we do the http request, in a cooperative model where https blocks, we're waiting for the response paroneayea: but paroneayea: the server getting it, we have no control over how it's written paroneayea: and it may actually try federating the message *before* we get an HTTP response paroneayea: but the server is blocked on the initial request paroneayea: anyway, yes, if this was running in a separate process or thread, it wouldn't be a problem paroneayea: when I said paroneayea: ArneBab: I could, though I'd need a good way for it to send a message back to the actor paroneayea: I wasn't referring to messages as in terms of AP messages paroneayea: but 8sync actor messages paroneayea: so, layering 8sync on top of fibers would fix this, because each actor could run in its own thread, and yeah you could have a worker process to do requests paroneayea: that's a possible direction happy_gnu: paroneayea: hi :) paroneayea: happy_gnu: hi happy_gnu: paroneayea: I've learned a lot of lisp since the last time we talked and I was trying to look for your game to see if I understand it better now happy_gnu: but i can't find it in your blog paroneayea: https://notabug.org/cwebber/mudsync/ paroneayea: video on https://notabug.org/cwebber/mudsync/ gives a general idea of some concepts happy_gnu: i think it is the same link paroneayea :) happy_gnu: ok great I hope I can understand more now catonano: happy_gnu: the video is on the 8sync web site catonano: happy_gnu: https://www.gnu.org/software/8sync/ happy_gnu: catonano: yes!! thanks cbaines: Hey, any suggestions on how to check using Guile if a particular port is in use? e.g. is there something bound to port 8080? wingo: cbaines: make a nonblocking socket and try to bind to that port? paroneayea: wingo: I think I'm starting to get a handle on this paroneayea: wingo: one thing is that I would need to "pass along" the fnctl bit if someone wanted to make the gnutls-wrapped port nonblocking, but maybe I should actually do that in the gnutls port itself? dunno paroneayea: er in the call that generates it paroneayea: I don't think it's possible to do that in guile currently so I guess I should just have an option to set the underlying port to be nonblocking wingo: why would you want to do that? wingo: the current non-blocking fcntl incantation only works with file ports paroneayea: wingo: ok :) paroneayea: wingo: basically I need to set it on sockets still though right? paroneayea: so I need to set it on the underlying socket? paroneayea: I guess I should just do that when setting up the underlying socket wingo: paroneayea: yes do it on the underlying socket wingo: ACTION has a patch that might work for that quadratic stack-marking issue... paroneayea: wingo: so I guess if we switch from c_read/write -> scm_read/write then we might even be able to use the suspend'ability of the underlying port anyhow paroneayea: because if using c_read/write, I'm guessing it'll pass through C, and then it can't suspend paroneayea: but if using scm_read/write, it might actually just be able to take advantage of the suspending of the underlying port anyway...? paroneayea: this is all guessin' :) wingo: well if the read/write functions can return -1 then they can suspend paroneayea: wingo: right, well... I can do that too, but then I guess I have to do some more careful bit-fiddling than the lazier get-bytevector-some and put-bytevector approach we're currently taking with the underlying port paroneayea: since I guess we need to "watch for" if the parent socket returns -1 on read/write so we can "forward" that cmaloney: just do the part that makes it work. paroneayea: cmaloney: thanks :P cmaloney: ;) wingo: hoo, been a month or more since programming in C... cmaloney: not like riding a bike where you just pick up and go? wingo: apparently not :) paroneayea: hm cmaloney: what's up? paroneayea: Seems like there are two paths forward: paroneayea: - Return -1 from the existing read/write and just add the read/write_wait_fd. But this means that we "detect" the read/write from the parent port. paroneayea: or, detect the -1 from the parent port paroneayea: (in the wrapped gnutls custom port) paroneayea: - Switch from c_read/c_write to scm_read/scm_write and take advantage of the parent port suspending. But I can't figure out how to do this; it looks like the right procedures are scm_set_port_scm_read and scm_set_port_scm_write, but I can't figure out how to run them on individual ports. paroneayea: presumably I'd want ot add it in make_custom_binary_(i/o)_port C procedures cmaloney: Ho you have some code that an idiot (like myself) can take a peek at? cmaloney: s/Ho/Do/ paroneayea: I don't have useful code written, but you can look at the make_custom_* procedures in libguile/r6rs-ports.c paroneayea: and paroneayea: tls-wrap in module/web/client.scm paroneayea: http://sebsauvage.net/paste/?2828b23da627438a#FEPYARA1Tm4hJm5h60A9XQWMblGdQrWFas6JYa2XPnY= here are all my local notes cmaloney: Feh, doesn't work on the tablet that I'm on. ;( paroneayea: hm ok, try http://dpaste.com/1FHZ83V cmaloney: That works better. Thank you. paroneayea: maybe I need to do SCM_PORT_TYPE(port) before passing that in to scm_set_port_scm_read/write paroneayea: I'm kinda out of my league here though :) cmaloney: I feel like an American trying to understand Cricket in this code cmaloney: s/American/USA/ paroneayea: you feel like an USA? ;) paroneayea: jk cmaloney: Yep, The whole country. cmaloney: I carry the burdens of the USA trying to understand Cricket and miserably failing cmaloney: ACTION takes up his cricket bat catonano: hi cmaloney ! cmaloney: hello. :) cmaloney: (please don't explain Cricket to me. ;)) catonano: me ? Cricket ? No such risk ;-) cmaloney: heh cmaloney: What's the best way to build a debugging version of guile? (eg: gcc -g ... ) ? CFLAGS=-g? slyfox: that works paroneayea: arg paroneayea: it seems like scm_read and scm_write apply to the whole port type paroneayea: I'm not sure how to set them on each custom binary i/o port :\\ manumanumanu: Where is the hygiene part of syntax objects? I am trying to introduce bindings in a procedure (not a define-syntax) into a syntax object directly, but it does't seem to work manumanumanu: Do I have to use define-syntax to get the hygiene manumanumanu: ? manumanumanu: I know about generate-temporaries and all those, but they aren't pretty :D manumanumanu: oh... I can roll my own using gensym. paroneayea: moin moin civodul: hello! civodul: taylan: bytestructures fails to build with Guile 2.0 with: "re-exporting local variable: cstring-pointer" civodul: does that ring a bell? civodul: i looked into it a bit but couldn't find any obvious issue paroneayea: wow, bytestructures is cool paroneayea: first time I actually looked at it ;p civodul: yeah it's pretty cool! cmaloney: pro-tip: Google tries to correct "guile exercism" as "guile exorcism" and that gets into some pretty wild territory. ;) paroneayea: wingo: if you're around and have time to talk about suspendable custom ports, give me a ping :) paroneayea: if not, a-ok! wingo: hey wingo: sure paroneayea: hi wingo ! paroneayea: wingo: so my feeling from looking at the code is what I really need to do is add read_wait_fd and write_wait_fd stuff to custom ports wingo: i am thinking not fwiw paroneayea: really! paroneayea: ok :) wingo: if you look at ports-internal.h there is a scm_read and scm_write function wingo: which are used by the suspendable ports code wingo: right now custom binary ports bounce through C because the C code implements the shim between the R6RS and the Guile implementations of port implementations wingo: but to me it makes more sense if we can directly install the custom binary port read procedure as that scm_read member wingo: likewise for write wingo: and if we can't directly do that, the instead use a wrapper paroneayea: ok, how can this be done? paroneayea: wingo: and won't the custom binary port read/write procedures still need to "hand over" a file descriptor to the scheduler? wingo: change make_custom_binary_input_port (and _output_port, and _input_output_port) to initialize the "scm_read" and "scm_write" members of the port type wingo: maybe that won't work, dunno... wingo: anyway yes you do need to implement read_wait_fd and write_wait_fd as well :) wingo: but you also need to cause the read and write functions to return -1 when/if they would block paroneayea: got it, ok paroneayea: so in the case of the https wrapper wingo: maybe that's sufficient though and you don't need them implemented in scheme? wingo: so you could be right there paroneayea: it would want to check the read and write from the parent port? paroneayea: http://dpaste.com/3AYZG5P here's what I started with paroneayea: haven't actually tested running it at all ;P wingo: i guess i was thinking of the case where a custom binary input port itself wraps another port paroneayea: yes and in fact that's what the gnutls / https port does janneke`: paroneayea: what a great talk, enjoyed it very much, thanks! paroneayea: janneke`: :) janneke`: they're taking maxwell's equations a lot further than i am, still it feels as the same inspiration paroneayea: I also like their use of the pattern matcher in the metacircular evaluator paroneayea: much easier to read than SICP's paroneayea: also, using the lambda for the environment was pretty brilliant paroneayea: I also think their demo of that UI that automatically generates code is pretty cool, though I'm not sure how we could do such a thing for auto-generating guile code that's in a real, large project janneke`: yes -- and i even learned about (guard in pmatch :-D janneke`: "test driven development", like it a lot paroneayea: it would be nice to have a future where emacs + geiser could try to generate the right code for you in the background while you hack ;) paroneayea: or validate it janneke: it's both terribly inspiring and scary paroneayea: but I'm thinking of a project the size of guix or even pubstrate it would bring such a thing to its knees paroneayea: also hopefully it doesn't have any procedures with system side effects like delete-file that it goes and tests out ;) janneke: how often haven't i had code that passed a, b and failed c janneke: upon change, passed a and c, faied b paroneayea: wingo: okay, I'll look into this and try to get things working during this week paroneayea: thanks for your advice :) paroneayea: so my rough outline on how to do it: paroneayea: - add scm_read and scm_write to custom_binary_port and associated methods paroneayea: - add read_wait_fd and read_write_fd to custom_binary_port and associated methods paroneayea: - turn make-custom-i/o-port type methods into a procedure in scheme that takes keyword arguments for the (read/write)_wait_fd and scm_(read/write) slots paroneayea: - profit??? wingo: so my first point might have been wrong. i do not know. wingo: sorry, all this stuff gets confusing paroneayea: np wingo: so wingo: there are two general options. one is, if this port is always operated on from scheme, *and* you arrange for it to implement the read/write functions via the scm_read / scm_write members and not the c_read/c_write -- wingo: then in that case, the read/write functions written in scheme can themselves use suspendable ports, transparently blocking. wingo: the second option is to change the read/write functions to allow them to return -1 when they would block, and in that case you implement the read_wait_fd / write_wait_fd methods. wingo: i suspect the latter is going to be easier but i don't know paroneayea: ok, got it I think :) wingo: godspeed :) paroneayea: thanks paroneayea: I'm going to have a weird call today where I say "yeah I could have had the stuff up today but I need to extend my language" paroneayea: there may be a downside to trying to advance all my causes at once in an intermingled way ;) paroneayea: but "sometimes when you're on the bleeding edge, you're bleeding"! wingo: :) paroneayea: wingo: thanks for the help, I'm feeling confident it can be done :) paroneayea: wingo: I feel like I've been asking a lot of questions lately, I hope you don't mind. at least though, I think they're so I can advance things that I think are also in your interest! I hope that makes it a bit better :) wingo: np don't apologize :) wingo: i don't mind the questions, just that i don't always have time to answer paroneayea: :) paroneayea: ACTION nods paroneayea: I def understand how that is / can be cmaloney: https://trello.com/c/vaVo1JpR/646-guile-stickers cmaloney: Please consider upvoting this card so UNIXStickers will consider making Guile stickers. rain1: hello #guile :) paroneayea: hi rain1 francisv: Hi. I want to find out what are the most common words in the subject of my email account. Googling I have that mu-guile makes possible to do all kind of statistics (https://www.djcbsoftware.nl/code/mu/). I don't know Guile, so I wonder whether the learning curve for such task is worth it? I cannot find any example for finding word frequency in Guile, but I can find a many examples in Phyton and other scripting languages. francisv: Could somebody point me to some sources where I can learn on how to get the most frequent words in a text? I would use mu4e to analyze the text of the subjects of my email account. quigonjinn: francisv: look at section 9.4 http://www.scheme.com/tspl3/examples.html francisv: quigonjinn: oh yes! something like this I was looking for. francisv: Thanks! taylan: sneek: later tell civodul I'm almost sure that was fixed upstream sneek: Will do. taylan: sneek: later tell civodul see the comment explaining the workaround at the start of $repo_root/bytestructures/guile.scm: https://github.com/TaylanUB/scheme-bytestructures/blob/master/bytestructures/guile.scm if you have this version but still have problems, please notify. sneek: Got it. taylan: sneek: botsnack sneek: :) paroneayea: rekado_: if you're looking to look at lexical environment and etc paroneayea: rekado_: maybe a combination of current-dynamic-state and the-environment may provide something paroneayea: but that's just a guess paroneayea: I'm guessing even if somehow these were to give you the right info, and I don't feel confident they would paroneayea: you'd need to write serializers for all the information paroneayea: ? paroneayea: rekado_: I suspect anything of the sort would be fragile though paroneayea: rekado_: what's this for? paroneayea: rekado_: I guess maybe this depends on whether you're talking about doing so ahead of time or during runtime maybe too if you're thinking ELF and etc apply? paroneayea: but I am pretty naive, just trying to think out loud. rekado_: paroneayea: my goal here is to create frozen slices of Guix, so that the state of the package graph can be restored from that slice at a later point without having to have a copy of the old Guix. rekado_: I want the graph to live on, even after the dead build artifacts have been installed and Guix has moved on. rekado_: I want to be able to just run Guile against any store item and explore the package closure from there. rekado_: but without having to store *all* of Guix for each item. paroneayea: rekado_: hm... seems very tricky :) rekado_: This was actually requested a couple of times here at this conference. rekado_: People were easily sold on the idea that having programmatic control over the package graph is very useful. paroneayea: it feels to me like traversing all the bits you need in the guix codebase might end up traversing all of guix itself rekado_: and they were kinda bummed to hear that this is essentially lost when Guix “moves on” after installation paroneayea: maybe I'm wrong :) rekado_: take (gnu packages games) for example. I need none of that stuff when I install “samtools” from (gnu packages bioinformatics) rekado_: or (gnu packages python)… rekado_: I really just want to dump the closure – or maybe even *less* than that paroneayea: rekado_: well, I suspect if you pull it off, you'll manage to learn a lot more about how guile works! :) rekado_: yeah, I’m afraid of that :) rekado_: I feel that the easiest way would be to have one Guile module per Guix package. paroneayea: at that point, maybe we really shouldn't be using define-module paroneayea: but some other abstract sugar rekado_: right rekado_: and then install that module with the store item. paroneayea: rekado_: I don't know what you're talking about, I love that python.scm has all the python stuff I need in one place! ;D paroneayea: rekado_: storing a module with a store item would be interesting and maybe even could work, but paroneayea: rekado_: it might also break if we change our apis under the hood rekado_: well, I wouldn’t want to install python.go to a store item that doesn’t need it. paroneayea: rekado_: (I was joking about python.scm) paroneayea: rekado_: but, I guess the challenge of those modules breaking is just the same as channels breaking paroneayea: you now have a core guix with package bits disconnected from the core rekado_: re changing apis: the Guix API may change; we would just install (gnu packages) and (guix packages) with the module. paroneayea: the core machine could change and the surrounding bits break... it's a risk paroneayea: rekado_: I mean things like the actual arguments and etc rekado_: I would hope that Guile’s ELF format wouldn’t change again, so I’d assume that this is stable and future-proof paroneayea: say we refactored all the python modules to remove package-with-python-2 or whatever it's called paroneayea: or rekado_: but whait paroneayea: say we deprecate a slot on package rekado_: package-with-python2 creates a package object rekado_: I just want to ship the result rekado_: not the code rekado_: and I don’t want the code to depend on the *current* guix paroneayea: rekado_: oh I see right paroneayea: rekado_: so as long as you aren't "linking to" a procedure we've removed... paroneayea: the ELF should work rekado_: right. paroneayea: or change around arguments, etc paroneayea: guix seems mostly stable-ish on that stuff, but I guess we'd *really* find out if it were if we had this feature ;) paroneayea: and that's why I'm saying it's the same challenge that channels would have paroneayea: because if we link to procedures removed, etc, or arity / argument order changed etc rekado_: I got really excited about this when I played with it – I just didn’t notice that I had GUILE_LOAD_PATH and GUILE_COMPILED_LOAD_PATH set, so I was actually just using the *current* Guix instead of my “serialized” blob. paroneayea: in both cases, things break that way rekado_: I guess I’d need to figure out a way to resolve modules at compile time and inline the parts that we’re using. paroneayea: rekado_: wait a moment though, even if we packaged every package in its own ~module paroneayea: you'd still need to include all dependency ~modules rekado_: yes rekado_: but they’d be in their own store item paroneayea: hmmmmmmmmmmmmmm rekado_: so if I wanted to look at the closure of a package I’d load up the modules of the union of the store items that make up the package closure. paroneayea: what about when we do fancy things like (substitute-keyword-arguments (package-arguments another-package)... paroneayea: will that still work, I wonder? rekado_: each of these modules is incomplete on its own, but taken as a union they would be sufficient to describe the package closure as a “live” graph rekado_: paroneayea: these are evaluated when the value for the package object is computed rekado_: the evaluation happens right there. rekado_: it’s only a problem if you have delayed computations somewhere rekado_: and the arguments themselves are just data anyway. paroneayea: rekado_: maybe you don't even need to serialize the environment in some cases paroneayea: and can actually serialize the package object itself rekado_: hmm rekado_: maybe paroneayea: in something more custom paroneayea: but paroneayea: I suspect you'll ahve to solve the closure problem anyway rekado_: we already do something custom, actually rekado_: all the references are recorded in the database rekado_: taken together this allows us to traverse the closure paroneayea: ok :) paroneayea: rekado_: sounds like you've got some fun hacking to od paroneayea: do rekado_: but what I’d really like is to be able to use, say, “package-source” on an actual package object, long after the thing has been installed. ShedDweller: Does Guile have an equivalent to "defstruct"? paroneayea: ACTION reads more documentation on ports paroneayea: ShedDweller: yes rekado_: maybe we could even replace the database at some point … paroneayea: (srfi-9 records) ShedDweller: paroneayea: Thank you! paroneayea: ShedDweller: np! paroneayea: ShedDweller: see the docs, they're pretty good on this subject ShedDweller: paroneayea: Alright, I might check the docs out, thanks paroneayea: np ShedDweller paroneayea: ACTION reading "how to write ports in C" part of guile docs paroneayea: I need to get better at C to understand how to better contribute to Guile's internals yegortimoshenko: ArneBab: see guile-ref, @, boot.el (http://git.savannah.gnu.org/cgit/guile.git/tree/module/language/elisp/boot.el) and elisp README (http://git.savannah.gnu.org/cgit/guile.git/tree/module/language/elisp/README) yegortimoshenko: ArneBab: e.g. (defun terpri () (funcall (@ (guile) newline))) rekado_: http://paste.lisp.org/display/351539 rekado_: I find this confusing rekado_: I create a new environment, define a value “foo” in it, then compile “foo” using the environment … rekado_: … and this just results in a *lookup* for the value “foo” rekado_: it does not pre-evaluate “foo” in that environment, nor does it embed the environment itself. rekado_: it only generates: # rekado_: of course, loading this all on its own is going to fail, because “foo” is undefined. rekado_: Am I misunderstanding the env argument of “read-and-compile”? ennoausberlin: Hello, I wrote a few lines of code to understand the for-each procedure but at some point I get an error ennoausberlin: Could someone have a look, please? ennoausberlin: http://pastebin.com/7S97i9Wt ft: What's the error? lloda: ennoausberlin: file-exists? expects a string and you're passing symbols ennoausberlin: Wrong type argument in position 1 (expecting open file port): todays-dir lloda: do (list todays-dir ...) instead of '(todays-dir ...) lloda: `(,todays-dir ,log-dir ...) would also work ennoausberlin: lloda: I guess, I have to reread the quote chapter in my study book. ennoausberlin: lloda: I hope I get familiar with this soon. ennoausberlin: Thanks to both of you paroneayea: janneke: https://www.youtube.com/watch?v=OyfBQmvr2Hc janneke: paroneayea: #*&(&#!@@@@@#! E: [pulseaudio] main.c: Daemon startup failed. janneke: :-) paroneayea: janneke: arg :) janneke: i only use audio/video once in a while, so sad how brittle that is paroneayea: well, it's William Byrd (of minikanren, Little Schemer, etc) talking about "Maxwell's Equations of Software", but not *your* maxwell's equations of software specifially... talking about lisp in lisp, and showing all the mind blowing ways you can alter it janneke: paroneayea: i hoped as much...wow janneke: thanks janneke: of course my mes is just one incarnation of The "Maxwell's Equations of Software" janneke: i'm working very hard on getting tcc to compile and run janneke: ACTION google says to remove state: rm -r ~/.config/pulse janneke: yay! janneke: *sigh* paroneayea: so paroneayea: ACTION comes back to suspending custom i/o ports paroneayea: actually, it doesn't seem so hard paroneayea: just an extra thing to add... paroneayea: wingo: okay, so I don't know how you feel about this, but my feeling on how to make custom binary i/o suspenable: paroneayea: - add read_wait_fd/write_wait_fd to the custom_binary_port struct, and make use of it in the way that file ports are used paroneayea: - add keyword arguments to make-custom-binary-(input,output,input/output)-port for read-wait-fd and write-wait-fd paroneayea: in the case of https, we'll actually just be passing through the underlying port's information paroneayea: however it doesn't appear possible to do define* type things in C, unless I'm misreading paroneayea: which means that I'd probably have to have make-custom-binary-[io]-port stuff be in scheme, passing in those arguments or #f. paroneayea: does that make sense? paroneayea: or does anyone else with enough ports internal knowledge have an opinion before I spend time on this? (maybe civodul ?) civodul: paroneayea: i think at this stage you know more than me about suspendable ports :-) paroneayea: civodul: egads :) paroneayea: well I don't know much about C and guile's C internals! paroneayea: I think that's what's making me so afraid to hack it civodul: heh :-) paroneayea: gotta get over my C-phobia civodul: perhaps you can do things in Scheme like you wrote? paroneayea: civodul: hm I don't think so, the custom-binary-i/o stuff is all in C, and slots there basically need to be exposed paroneayea: civodul: so once the slots are added in C, I think yeah, you can actually do the wiring of this in scheme paroneayea: that's my understanding civodul: hmm ok civodul: i have to go (really, that's not because i want to escape problems ;-)) paroneayea: hehe :) paroneayea: thanks civodul paroneayea: have a good one! civodul: let's talk about it at a later point if you want civodul: yw! rekado: I’m playing with serialisation and I gotta say: I’m such a noob! rekado: I get easily confused with nested quoting. rain1: i just had a thought, would it be possible to turn the lambda in your code to some kind of data structure? and calling it with an apply function rain1: the ones that needed serialized rekado: what I’m doing now is this: a) get the struct to be serialized, b) go through all its field, c) generate an S-expression, d) feed that to (compile e #:from 'scheme #:to 'bytecode) rekado: the S-expression I generate has to be sufficient to reconstruct the state of the struct. rekado: I find it sad that that’s not so easy. I always found printers that produced something like # ugly. rekado: When the reader encounters “#” it won’t know what to do with it. rekado: this is why I need to go the extra mile and make sure that the S-expression is just a bunch of constructors. rain1: hmm this is an interesting problem.. rain1: i wonder if there could be a writer that throws an exception when if it has to print something which cant be read back rekado: yeah rekado: maybe I can just overwrite the writers. rekado: (or are they called “printers” in Guile?) rekado: “set-record-type-printer!” paroneayea: rekado: I've been thinking about making a serializer package for guile that uses something along the lines of canonical s-expressions paroneayea: rekado: the really nice idea that canonical s-expressions has is its "display hints" field paroneayea: which I think is a good place to give extra type info rekado: what conditions need to be fulfilled before (procedure-source some-procedure) will return something other than #f? rekado: I enabled source copying with (read-enable 'copy), but I cannot seem to get the source code for other modules or even local procedure definitions. amz3`: C amz3`: oops sorry rain1: rekado i am curious what this is for ? maybe its some code online I could see? rekado: rain1: I’d like to figure out if we can store “slices” of the package graph with the build artifacts rekado: this would make it possible for a user to look at relevant parts of the package graph at a later point without having to have an old version of Guix. rekado: I’d like to have a lispier alternative to the Guix store database. rekado: the database keeps a record of package references, but that’s not nearly as nice as exploring the package graph in a REPL. rekado: one way to do this is to just store *all* compiled Guile modules that make up the particular Guix version and store or link those for every installed package. rekado: but that’s a bit heavy, I think rekado: on the other hand it seems much less like a hack rekado: ugh, bug 24887 :( rekado: I guess I’ll have to get the sources by reading from source files. rekado: maybe “procedure-source” should be removed from the documentation, or a warning be added that you’ve got to put something in there before retrieving it. rekado: I just rediscovered this: https://wingolog.org/archives/2016/02/04/guile-compiler-tasks rekado: now that I’m motivated to look at linker things I think I’ll take a closer look at the first task paroneayea: rekado: :D paroneayea: rekado: I actually want to work on the "opposite" one, basic register allocation :) rekado: interesting. paroneayea: really because I want to add more support for debugging info rekado: how does this work? The scope of interest is only known at debug time, isn’t it? So how can one know ahead of time what values need to be kept alive? paroneayea: I don't actually know rekado: :D paroneayea: but that's what wingo says I need to look at to make it happen :) paroneayea: right now guile has an in-theory-amazing debugging suite at the repl paroneayea: but in reality everyone uses (pk) because ,locals tells you often nothing rekado: yeah rekado: many of the tasks on that list sound like they’d be fun to work on. paroneayea: yeah paroneayea: I need ot overcome my fear of hacking guile itself paroneayea: also, you can tell I'm a stereotype of this channel: I'm compiling guile's stable-2.2 branch on my server from the guix environment that I'm running my project out of because I need some of the recent commits paroneayea: I really need to find time to work on guix-deploy too but that won't happen until next year paroneayea: I am buried @_@ davexunit: I want struct field unboxing, but the real task is huge I found out. rekado: paroneayea: gah, same here! wingo: ACTION will have some guile time over the next couple weeks wingo: been zero guile time over this last month :P sneek: Welcome back wingo, you have 1 message. sneek: wingo, paroneayea says: so as you may have seen, I now have 8sync running entirely on top of fibers... almost! Everything works but I don't have a way to halt an actor's event loop to shut it down. I thought I had a solution with conditions, but it seems that watchers don't get removed after they "move on" by something else being selected in a choice-op. I wonder what the right solution is, and if you have thoughts? rekado: ACTION reads the recommended series of blog posts on linkers paroneayea: hiya wingo :) wingo: heya :) wingo: i don't know what you mean by "watchers" in that note paroneayea: wingo: sorry that I've kinda overwhelmed your backlog possibly :) wingo: np :) paroneayea: wingo: so say you've got a condition `stop?' (I have no idea how bad of abuse it is to use a ? postfix on conditions) paroneayea: basically so that when your async queue fiber is looping around and doing paroneayea: (let lp () paroneayea: (perform-op (choice-op stop? ; breaks the loop paroneayea: (wrap-op get-message paroneayea: (wrap-op send-message paroneayea: paroneayea: watcher here actually refers to the use of the term in the conditions code I think rain1: the fibers post was really awesome I learned a lot from it... I had been thinking continuations were not really a "useful" thing more like a puzzle thing to play around with/induce headaches so it smashed that & it's really cool to see them used in a practical way paroneayea: oh paroneayea: waiters! paroneayea: not watchers :) wingo: anyway is good to define terms :) paroneayea: wingo: so the problem with this "solution" is that every time you loop a new waiter gets consed on paroneayea: to the condition wingo: ah paroneayea: eventually the condition grows way outta control... yow! paroneayea: so aside from that :) wingo: yes i see what you mean paroneayea: I think I have 8sync running on fibers paroneayea: so maybe conditions are the wrong choice here paroneayea: if they were going to work, they'd have to "unsubscribe" when another choice happens wingo: well wingo: usually what you need to do is arrange for somebody to do "gc" wingo: basically, every so often, tidy up the set of waiters paroneayea: another way I could handle it, I suppose paroneayea: would be to have stop? actually be an atomic box, checked right before perform-op at the top of the loop paroneayea: and put a timeout on the loop paroneayea: that way old waiters gc themselves wingo: so like every Nth wait you go through the whole set of waiters and prune out the events that are already in 'S state wingo: but also GC when a waiter is woken up paroneayea: wingo: aha, maybe the condition itself could do that? wingo: or when you wake up a waiter wingo: yes paroneayea: that would work well paroneayea: wingo: want me to give that a try and send you a patch? wingo: look at the bits in https://wingolog.org/archives/2017/06/29/a-new-concurrent-ml marked "maybe gc" paroneayea: wingo: cool ok :) wingo: yes please :) paroneayea: wingo: btw we shouldn't miss out the real meat of the news on this though! paroneayea: (seitan of the news?) paroneayea: which is that 8sync on fibers otherwise seems to work :) wingo: wow :) wingo: great news :) paroneayea: I think we can unify the guile async space! wingo: yay! paroneayea: so 8sync can become an optional layer of actors and etc wingo: does it work well enough? paroneayea: performance-wise I couldn't test because the bug we just talked about killed performance so bad that testing anything else, I dunno :) paroneayea: but paroneayea: I think design-wise it's great wingo: cool paroneayea: I also took an opportunity to spiff up the way that actors "reply to" each other paroneayea: by two things: you no longer explicitly "reply" to a message, that happens automatically by the system replying with the return values paroneayea: and! that gets passed back to the original actor's continuation paroneayea: so "sending a message that will wait for a reply" involves continuations in more ways than one :) paroneayea: much more schemey paroneayea: but actors can handle other correspondence while waiting for replies on the messages they send with (<-wait ...) paroneayea: imo works pretty well paroneayea: and results in way less verbose code than before paroneayea: wingo: I suspect it'll be peformant enough, since I also cut out the "delivery actor" in most cases, the Hive paroneayea: Hive still exists now, for two purposes wingo: do you take advantage of multicore? paroneayea: wingo: it can now paroneayea: I haven't tested how it affects things paroneayea: actors run in their own fiber (well technically two fibers, one for the queue and one for the actor) paroneayea: but in theory we can paroneayea: and does even paroneayea: needs more tests though paroneayea: testing against Mudsync should be a fun test wingo: :) paroneayea: wingo: so the other bit of news is that I'm trying to make custom binary i/o ports be suspendable paroneayea: turns out I need this for a deadline! wingo: for ssl? paroneayea: yep wingo: when is the deadline? paroneayea: wingo: heh, well I need to get up a version by tomorrow but I can have that one only half working. so really, as soon as I can... I'm trying to do it this week, and I think I can wingo: :) paroneayea: I just want to run whether or not what I'm doing makes sense by you paroneayea: if you have a moment wingo: unfortunately i am zzzzzzz wingo: long day paroneayea: ok wingo: but i will read it in the morning :) wingo: happy hacking and good luck! paroneayea: wingo: ok, let's talk tomorrow :) paroneayea: thanks! paroneayea: I appreciate your feedback! rekado: paroneayea: is this for the web module you’ve been working on? paroneayea: rekado: not for guile-webutils (though that's used) but for Pubstrate paroneayea: which is the federated social networking software and standard test suite rekado: ah, I see rekado: have you published guile-webutils yet? rekado: I’ll have to write another web thing and it would come in very handy, I’m sure. paroneayea: rekado: I have a repo, but no release yet, because deadlines paroneayea: but paroneayea: I should paroneayea: guix is enabling me! rekado: no rush! paroneayea: I'm making git-based packages adding to the guix.scm I'm using it in :) magnicida: hi, here i am again trying to find a nice way to do unit tests in guile catonano: so tonight it was about linking, debugging and, tangentially, unboxing magnicida: I have just tried two libraries that fail: magnicida: - https://github.com/axch/test-manager magnicida: - https://github.com/yawaramin/ggspec magnicida: they seem to not work with guile 2+ catonano: magnicida: look, I'm the last fool here. But for a toy project of mine I ust used the basic vanilla test runner. It worked catonano: magnicida: I may be misinterpreting yor needs, though magnicida: catonano: what is the basic vanilla test runner? magnicida: oh, maybe you mean SRFI-64? catonano: magnicida: yes, that one. Look, it's here https://gitlab.com/humanitiesNerd/guile-freexl catonano: it's really a stupid project catonano: but it's a valid template for binding a C library AND running some tests magnicida: thanks a lot, actually i did not realise srfi-64 was included in guile magnicida: ACTION should rtfm better next time catonano: magnicida: ah :-) you're welcome ! magnicida: aha! the guix.scm in that repo also solves another problem of mine: defining an guix.scm to put in the repo that uses the current checkout magnicida: awesome :D magnicida: are you using travis or some ci too? magnicida: i was trying to find a way to use guix inside travis but i could not find anything easy catonano: magnicida: are you asking me ? magnicida: yeah catonano: no, I'm not using Travis, sorry magnicida: wow, this is weird, so if I use the (test-group macro) to define all my tests I get this error in the line where the macro is first used: magnicida: In procedure struct_vtable: Wrong type argument in position 1 (expecting struct): #f magnicida: but if I do define one test before using (test-begin) and (test-end) everything works magnicida: mmm ok it seems that there is no test-runner-current magnicida: one is created by test-begin but not by test-group... looks like a bug to me but not sure 100% reepca: A program started with system* should have the same input/output as the program that started it, right? daviid: reepca: but, if you want to get your hands on the results you should use (ice-9 popen) instead daviid: reepca: see 7.2.10 Pipes reepca: I'm wondering because I'm in a rather strange situation where I can run programs but can't see their output. Probably has something to do with file descriptors in this chroot thingy that I haven't fully comprehended yet. reepca: but good to know it's not a guile issue daviid: reepca: well you cn try this in a repl: (system "ls") and see it displays the results of the ls command on guile's standard output port, but you can't 'use' these results, such as getting a math value to process it i gule after the command is executed ... that requires (ice-9 popen) reepca: slightly off-topic, but are symlinks resolved lazily? That is, if I symlink from A to B, and B is a symlink to C, and I later change B to symlink to D instead, will accessing A give me C or D? reepca: daviid: ah, that's just the problem, though - (system "ls") doesn't show me any output at all. daviid: reepca: in a repl? that means somwhow you redefined the dtandard output prt I guess, not sure reepca: (current-output-port) => # reepca: I'm connecting from geiser, could that have anything to do with it? daviid: reepca: for advanced system programming, you really want to define and use your input output ports, imo at least daviid: it seems you connected to a spawn server rather then M-x run-guile reepca: yep, I needed to run guile in a certain environment reepca: hm, outside of the chroot madness, (system "ls") produces output in the shell running the listener reepca: but I just need the output for debugging anyway - I'll just write a wrapper around system that uses a pipe and prints the output. reepca: err, not a wrapper around system - something that mimicks system. daviid: reepca: yes, in that case it will display the output of system/system* in the shell where you launched guile ShedDweller: Does Guile have an equivalent to "defstruct"? amz3`: https://github.com/fantasyland/fantasy-land \\cc davexunit rekado_: Is it possible to “dump an image” of an environment in Guile? rekado_: I’d like to be able to serialise a closure of a Guix package to a small binary and deserialise it at a later point. rekado_: I’ve played around with “read-and-compile”, but the resulting binary is dynamically linked, i.e. it still depends on having all referenced modules on the load path. rekado_: in most cases I’ll probably not need the full module, however; just a subset. paroneayea: rekado_: I imagine that various C-based structures may make that hard, esp from third party libraries? paroneayea: I dunno though! amz3`: rekado_: that would be nice didi: taylan: ping rekado_: paroneayea: I only want to serialize Scheme code. rekado_: Guile compiles each module to its own ELF file, so maybe the answer is to use smaller modules and install all of them that are needed. rekado_: but that’s not quite what I had in mind. rekado_: I’m not entirely sure what I want, though. reepca: I don't suppose anyone would happen to know what might cause "apply-smob/1" to fail in guile 2.0? daviid: reepca: why are you using 2.0? (as in why not 2.2 I mean?) reepca: daviid: because it's what the guix bootstrap guile uses. rekado_: reepca: do you have more context? rekado_: because that’s a really low level error message reepca: rekado_: that's the frustrating part, the error message is extremely minimal. http://paste.lisp.org/display/351519 daviid: reepca: fair enough :) then I was going to ask the same quizz as rekado_, though probably I won't be of any help, maybe others can... if more info ... daviid: reepca: can you try a full backtrace mybe reepca: I happen to know thanks to good old print-statement debugging that it's triggered by starting the "set-paths" phase of gnu-build-system daviid: reepca: and/or running under strace if you can, to try to get more debug info reepca: daviid: and that's the second frustrating part, I can't actually interactively do anything with this. In the build environment I can get a guile 2.2 REPL, and from there I can try using system* to run guile-2.0, but starting it with no arguments causes it to start up, print the usual "no warranty" message... and immediately exit reepca: the entire situation is really bizarre. I can copy the failing builder into a -c argument, and put a catch around it that will print something when an error is reached, but that just silences all output for some reason. reepca: and when I copy+paste the builder into my 2.2 REPL it works just fine daviid: reepca: it could be that you need very carefull path and GUILE_* env var seting prio to launch 2.0 from using system* from 2.2, because probably what happens is guile 2.0 will try to load go from 2.2 ... or vice e versa... taylan: sneek: later tell didi I can be better accessed through email, via taylanbayirli at google mail sneek: Okay. yegortimoshenko: how do i run emacs lisp using guile? taylan: yegortimoshenko: in the REPL, ",language elisp" taylan: yegortimoshenko: and the 'compile' procedure has a keyword argument #:from, IIRC, with which one can set the source language random-nick: but you should note that guile doesn't have elisp-the-library, only elisp-the-language yegortimoshenko: thanks! i've found the cli option after that you mentioned it yegortimoshenko: thanks rekado_: reepca: what are the contents of the builder? rekado_: reepca: and as daviid suggests: do check the GUILE_LOAD_PATH and GUILE_COMPILED_LOAD_PATH. No mixing of 2.2 paths with 2.0. reepca: rekado_: http://paste.lisp.org/display/351521 yegortimoshenko: random-nick: that's a very subtle distinction. so it just emulates elisp semantics and i can't even use defun? random-nick: you can use defun random-nick: but not buffers yegortimoshenko: oh, definitely yegortimoshenko: no buffers reepca: side-note, do we have any tools for insta-prettifying automatically generated builders? daviid: reepca: i have both installed here as well, let me try to launch 2.0 from 2.2 daviid: in the paste you have (unsetenv "GUILE_LOAD_COMPILED_PATH") daviid: and unset LD_... as well daviid: reepca: it works fine here daviid: but I'm not using guix, I can launch 2.0 from 2.2 from geiser and I'm using debian buster (for info), so env var are probaly totlly diff from what you get in guix daviid: reepca: http://paste.lisp.org/+7J8I reepca: it works for me to launch 2.0 from 2.2 as well normally, but for some reason not in the build environment. daviid: reepca: can you patch the script guile-2.0 has to ru so it prints env vars? daviid: reepca: have to go, bbl, good luck, I would try, from 2.2: (system* "strace -o strace.out guile-2.0 -s ") daviid: ACTION will release Guile-CV version 0.1.5 tonight reepca: also, does system* automatically make the executable name the first argument? reepca: these are the environment variables the failing builder is run with, according to environ: http://paste.lisp.org/display/351523 reepca: when I remove GUILE_AUTO_COMPILE=0, the --no-auto-compile argument is completely ignored reepca: scratch that question about system*, rereading the manual makes it clear yegortimoshenko: does guile (emacs lisp flavor) have an http client/server and if the answer is yes, how to access that? ArneBab: yegortimoshenko: you can call regular scheme from emacs lisp — I’ll test it yegortimoshenko: ArneBab: thanks! ArneBab: yegortimoshenko: I don’t get stuff imported right now — guile-emacs provides a richer set of elisp functionality, so you might need to use that ArneBab: yegortimoshenko: so it’s there in theory — if you find the way to call it, please highlight me with it! reepca: I may have missed this in the manual somewhere, but how are circular module dependencies handled? A depends on B depends on C depends on A... paroneayea: :X amz3``: :) daviid: heya! daviid: amz3``: yesterday jcowan was trying to find you on #scheme, did you see it? amz3``: no thx daviid: I thik the channelis loged as well paroneayea: ACTION trying to read some of guile's guts to understand how to get https/custom i/o ports cooperating with suspendable-ports paroneayea: my guess is paroneayea: we need a slot on custom ports paroneayea: for the file descriptor? paroneayea: if there is one ofc daviid: paroneayea: I think you'll like this :) http://imgur.com/Ie7dWdD daviid: ACTION secretly hopes paroneayea will present guile-cv to the world ... :) reepca: Hm, when should I be using custom ports and when should I be using soft ports? paroneayea: daviid: oh hey cool, you've got it integrated with geiser's image view stuff too huh daviid: yes, it's a user option, you can use gthumb, eog or the viewer of your choice daviid: paroneayea: here, for info: http://www.gnu.org/software/guile-cv/manual/html_node/Utilities.html#im_002dshow daviid: paroneayea: and with this guile-cv/geiser integration, one could write a tutorial for kids, à la drracket and picture programming :) - though guile-cv is a scintific image processing and analysis lib, it can be used to teach and have fun as well ... daviid: anyway, have to leave the place I'm working now, bb tomorow catonano: sneek later tell daviid guile-cv is awesome ! sneek: Will do. ennoausberlin: Hello. I have a beginner question. As I understand in scheme code is data and data is code. So I decided to use a association list to store some key value pairs inside a file to use it for configuration. Whats the guile way to read in these assocs? lloda: ennoausberlin: (read port), or (call-with-input-file "filename" read) lloda: depending on what's on the alist, you may need to do more work to serialize ennoausberlin: its just something like ((temp_dir . "./tmp") (log_dir . "./log") ... etc) ennoausberlin: I want to set some variables depending on the assoc in the config file rain1: im just a little worried about how you would detect syntax errors in the config file ennoausberlin: the entries in the config usually dont change. And its not critical if program stops with an error. I just do myy first steps with guile ennoausberlin: call-with-input-file looks good rain1: (catch #t (lambda () (call-with-input-file "filename" read)) (lambda (err . args) (display `(something went wrong ,err)))) ; this works rain1: but yeah just (call-with-input-file "filename" read) is fine for starting.. I was just wondering how to check for parse errors ennoausberlin: rain1: thank you. I am not familiar with common scheme patterns. Thats why I am asking. Your solution does it the right way, I think. Thanks to both of you rain1: I installed guile on debian (2.0) but i only have guile not guild rain1: i wonder if i need a newer guile to get guild ennoausberlin: I did some work in Smalltalk and Ruby. So far I like scheme. Its fun to gain some knowledge. Sometimes I miss the Smalltalk environment but emacs does well for now ennoausberlin: rain1: I have debian stretch running and guild is there. ennoausberlin: Maybe in guile-2.0-devel rain1: oh great thaht was it! rain1: thanks ym: Doesn't "meta/uninstalled-env bash" environment works for emacs-wip build? webshinra: well, I use load or primitive-load for that kind of use, I should not? ym: You want to say that I can load some scheme file from guile's REPL to build emacs-wip from scratch? paroneayea: I ought to just import ice-9 match whenever I start to define a guile module at this rate reepca: I don't suppose there's a "substring"-like function for vectors which shares memory with the original? bavier`: reepca: you can use array procedures like make-shared-array on vectors bavier`: reepca: e.g. (define v #(1 2 3 4)) (define v' (make-shared-array v list 2)) reepca: wow my info browsing skills failed pretty hard there bavier`: :) reepca: is there a way to use match to get both an element and the list containing that element? For example, to get the second element of a list as well as the sub-list containing everything from the second element onward? bavier`: reepca: e.g. (match '(1 2 3 4) ((_ . (and sub (sec . _))) sub)) bavier`: there might be a better way to express that daviid: reepca: in this case, you may also consider member :) sneek: daviid, you have 1 message. sneek: daviid, catonano says: guile-cv is awesome ! daviid: sneek: later tell catonano thank you! sneek: Will do. janneke: i'm fighting with include-from-path janneke: it works as expected in 2.2, with 2.0 i see unexpected behaviour janneke: wondering what changed here paroneayea: :) roelj: Why can't I have "multipart/form-data; boundary=..." as content-type field in http-post? sneek: roelj, you have 1 message. sneek: roelj, rekado says: I still get an error: http://paste.lisp.org/display/351187#1 roelj: sneek: botsnack sneek: :) ym: Cloned guile branch, reading README: "Generic instructions for configuring and compiling Guile can be found in the INSTALL file."... ym: y@d:~/src/guile$ find . -name "INSTALL" ym: y@d:~/src/guile$ ym: Where is it? roelj: ym: It seems to be missing.. But this is a file that is the same across all autotools projects, so here's one: https://github.com/roelj/inklingreader/blob/master/INSTALL ym: Thank you. manumanumanu: is there any reason to use define-inlinable over a syntax-rules macro? rain1: it would be bad coding style to abuse syntax-rules to inline a function, define-inlinable is better because it both inlines the function when used and allows you to still pass the function around as a first class value manumanumanu: aight. thanks ym: Wow. INSTALL file appeared after guile built. ym: I don't sure on what stage exactly, though. manumanumanu: Any reason why the guile manual doesn't serve a last-modified header? manumanumanu: I am not always on a computer where I can use the offline version, and today I must have loaded the procedure index something like a billion times :) paroneayea: hi hi paroneayea: how's it going, * OrangeShark: hi paroneayea. It is alright, I feel sleepy though cmaloney: Good morning cmaloney: reading the fibers info page and learning much cmaloney: ACTION feels like he was sequestered in business computing for many years paroneayea: cmaloney: :) ym: Is there a way to build emacs-guile with debian's libjpeg62-turbo jpeg library? ym: Seems like it should, but configure script says it's not found. ym: libjpeg-dev package installed, jpeglib.h is in /usr/include/ ym: hmm ym: Uh ym: WARNING: libjpeg found, but not version 6b or later ym: JPEG_LIB_VERSION=62 in my case. ym: Seems like configure script generated with autogen has missing "fi" keyword for condition which tests if libjpeg is needed on mingw32 system. ym: Not missing, but in wrong place. ym: Wrong nested. ym: http://paste.lisp.org/display/351300 ym: Whole "${opsys}" = "mingw32" test corresponds to this one condition. ym: Nope, I'm wrong. There is elif in the middle. amz3`: héllo ym: # 115 "confdefs.c" ym: version= ym: # 115 "confdefs.c" 3 4 ym: 62 ym: gcc -E generated such output, that's why egrep failed. ym: So $CPPFLAGS should be -E -P ym: Yep, works for me now. joajjajo: whats a good guide on how to debug code and stuff using guile? i keep getting [n] things that bothers me until i type ,q. daviid: joajjajo: what do you mean by 'keep getting [n] things that bothers me ' daviid: look for backtrace in the manual, and, carefully read the outputof the error, it often prints the cause and the source code line ... then if that fails, use pk (to display values at crutial pont/steps in your code ... joajjajo: ill try that ty:o daviid: wc! bavier`: has anyone else read https://www.cs.indiana.edu/~dyb/pubs/nano-jfp.pdf ? rain1: yes bavier`: they wrote another paper describing how they used the ideas to replace the core of the chez scheme compiler. Was that experimental, or was it upstreamed? rain1: yes chez uses that library now bavier`: interesting bavier`: perhaps because I'm still learning, but it seems like specifying the intermediate languages and transformations are the most difficult to understand and implement correctly. bavier`: A compiler library like that seems like it would make things much nicer. amz3`: ijp: what's up? amz3`: ijp: did you see that https://github.com/vishesh/racketscript amz3`: ijp: where is your code? ArneBab_: amz3`: "RacketScript doesn't support Racket features which are expensive, for example proper tail calls and continuations." ← I think ijp goes further ster: Hello, what is the status of ECMAScript support in GNU Guile at the moment? I could only find this: https://www.gnu.org/software/guile/manual/html_node/ECMAScript.html, which is fairly ambiguous in many ways. Is it usable? Any other documentation I could take a look at? z0d: is I do scm_c_eval_string("(+ 1 2)") from C, how can I get the value out of the SCM object it returns? z0d: s/is/if/ janneke: z0d: something like if (scm_is_integer (o)) i = scm_to_int (o); janneke: z0d: and SCM is a pointer, right? janneke: z0d: iirc, you can choose -- why do you ask? z0d: well, I'm doing a rather silly thing. I try to use libguile.so from bash. there's a project, which makes it possible to call C functions from bash. https://github.com/taviso/ctypes.sh/ z0d: e.g. http://paste.lisp.org/display/351208 z0d: this works fine z0d: and prints Guile's version inside bash z0d: but, dlcall -n buffer -r pointer scm_c_eval_string "(+ 3 4)" segfaults for some reason janneke: z0d: cool; a friend of mine has created a guile PEG for simple bash syntax with variables and job control, pipes janneke: i don't know why one would work and the other segfaults lloda: SCM may contain a pointer, but it's not a pointer. See libguile/tags.h in the source. For small integers the SCM holds the number itself. manumanumanu: Good day guilers! manumanumanu: I am getting a "syntax-case: misplaced ellipsis in form" error, but I can't for the world guess why manumanumanu: and I am pretty sure it is correct janneke: manumanumanu: in that case, you may need to teach the computer that it's correct manumanumanu: janneke: oh yes! The problem seems to be that I can't have two ellipsised patterns after eachother manumanumanu: ((kw arg) ... rest ...) manumanumanu: which i find odd, since rest would be the other option not following the (kw arg) form manumanumanu: and (kw arg) ... . rest works, but doesn't match (kw arg) manumanumanu: it is such a sad thing that I don't know macros manumanumanu: hmmm. you can't have two ellipsised patterns follow eachother? manumanumanu: Alright, I'll write a helper macro. manumanumanu: I should probably do what stis is doing and use syntax-parse. faalentijn: I'm going to be a tad annoying and ask the same question again but does anyone have any idea why http-post throws a "The TLS connection was non-properly emrinated." gnutls-error when trying to send a body to a TLS website? amz3: I had the same issue previously amz3: I mean I tried to http-get something and I had the same issue amz3: just a few days ago using guix 2.2.2 amz3: guile 2.2.2 faalentijn: Okay so it is not me being stupid (always a chance when you're a beginner)? Was it also while trying to read out the response to a request to a website that only accepts SSL/TLS? amz3: no, it was against gnu.org amz3: http://gnu.org does redirect to https://gnu.org amz3: also I don't remember which version it was but http-get used to work with https for sure faalentijn: I noticed that the message was sent just fine, that it sparingly works when it accepts both but panics when it is either SSL only or redirects. faalentijn: I've no issues with doing a simple (http-get website) or even (http-get website #:body "") but it panics when trying to do (http-get website #:body "test"). faalentijn: http://paste.lisp.org/display/350675 amz3: faalentijn: btw you can use 'pk' instead of 'display' faalentijn: Oh really? Cool thanks. amz3: faalentijn: there is 'utf8->string' procedure in (rnrs bytevectors) faalentijn: Thanks, will keep that in mind for the future amz3: and welcome :) faalentijn: So, I guess that I will need to file a bug since it is not me being a dunce? amz3: yes faalentijn: I'll do so but it does sound rather terrifying to me amz3: actually that https support is recent amz3: in guile amz3: maybe it explains amz3: in the meantime, you try to downgrade to 2.2.0 maybe faalentijn: Seems to yeah, I tried to check whether 2.0 worked just in case it was a recent regression but it didn't support TLS at all. amz3: 2.2.0 has TLS support but it has a bug with small payloads faalentijn: Does 2.2.0 work or do I need to first wrap it for GnuTLS myself? I know guile-oauth does the wrapping itself because I tried to look for examples. amz3: it can not read reponse body that are smaller than the system page or something like that amz3: faalentijn: the fool proof work around is to use guile-curl I guess amz3: which is supposed to work with both guile 2.0 and guile 2.2... amz3: and the maintainer is around sometime amz3: and responsive amz3: over github faalentijn: I can try doing that but I've always been averse to using things that aren't in the standard library unless I really need to. Got a bit of that Python/javascript trauma where everything is a library. amz3: my day job involves both python and javascript amz3: I don't blame them, i just prefer guile but to be honest I wish there were more libs in guile faalentijn: I like Python and javascript it is more that I'm afraid of becoming a left-pad programmer amz3: :) amz3: btw leftpad was added to ES2017 or ES2018 as a standard string method faalentijn: Of course it would be nice if there were more libraries but there should be a happy medium between the standard library and external libraries. You want libraries to actually be useful and not just endless mediocre bloat. faalentijn: Might be a bit of a funny story (or not) but I did my final project in Python for my community college graduation a month or so back. My teacher almost fainted by the sight of function decorators. daviid: faalentijn: fyi, and a bit of history, all this comes from CL, actually CLOS, which 'invented' before and after methods ... daviid: faalentijn: way before java and python did even exist ... faalentijn: I still have the problem with Guile 2.2.0 cmaloney: faalentijn: 2.2.0 or 2.2.2? amz3: both faalentijn: both. manumanumanu: so, my racket-style for loops are nearing completion. Still no error reporting, but I am pretty happy with the result right now. The speed is comparable to srfi-42 (unless you use in-hash) manumanumanu: https://bitbucket.org/bjoli/guile-for-loops manumanumanu: probably pretty portable, since I only rely on guile extensions for silly things. faalentijn: I just swiched from (web client) to guile-curl and it works like a charm. Thanks a lot amz3 manumanumanu: wingo, civodul : peval is king: ,opt (for/sum ([a (in-list '(1 2 3))]) (+ a 1)) => 9 civodul: of course! ;-) cmaloney: I swear, learning Scheme is like a short-cut to learning Computer Science cmaloney: ACTION is learning all sorts of new things just in reading wingo's blog posts rain1: what did you larn today? cmaloney: looking at the concurrency / fibers stuff in recent posts cmaloney: and realizing that everything old is new-ish again rain1: ah i shoueld read that soon cmaloney: I blame paroneayea for this z0d: hi amz3: hi z0d: I'm looking at libguile and I want to call e.g. scm_version from C. how can I convert Scheme string into a C string? z0d: does that even make sense? lloda: z0d: see scm_from_string, scm_to_string in the manual lloda: rather scm_to_stringn lloda: https://www.gnu.org/software/guile/manual/html_node/Conversion-to_002ffrom-C.html#Conversion-to_002ffrom-C z0d: lloda: thank you, checking hugo: Could anyone help me with how I best create a guile record (srfi-9) from some C code? paroneayea: mwette: amz3: I recorded a note on this, luckily... paroneayea: http://sebsauvage.net/paste/?e35b78e7e09ac8e8#w+OvsS8PQRzitvMqxKcbLZ26J7XN561zCHoYSfhczyA= paroneayea: oops that's the wrong one paroneayea: hm, maybe the info I thought I had doesn't match paroneayea: nm! amz3: intresting blog and interesting post amz3: http://blog.cleancoder.com/uncle-bob/2017/07/11/PragmaticFunctionalProgramming.html OrangeShark: amz3: oh cool, an Uncle Bob blog post. It is interesting to see him move to functional programming and clojure. magnicida: any take on the easiest way to get guile 2.2 on travis ci? magnicida: i am guessing just getting the source and building it in the travis script (+ cache?) magnicida: but maybe there is some better way...? magnicida: i am really hoping for guix support on travis some day (they already have nix) but who knows... grr_: Hi. Anyone here? grr_: Wondering if there is anyone that can help regarding a question as I am new to guile daviid: grr_: go ahead and ask, don't ask to ask... grr_: Thought I was the only person here - which is why I didnt ask. grr_: :-) grr_: Anyway... amz3: I see a lot people.. grr_: I am trying to get some more information of web scraping with guile grr_: As well as the manual, I came across this page on the same question. However, the example assumes you are using the repl, or that you can determine the variable name ($1, $2, $10, etc) grr_: This is the page that covers it im better detail. https://lists.gnu.org/archive/html/guile-user/2012-01/msg00049.html grr_: However, how do you scrape -- getting the results of the html string into your oen variable? grr_: (http-get (string->uri "http://www.gnu.org/software/guile/")) ;;; Returns 2 results ... into $1 and $2 grr_: I hope my question makes sense? grr_: PS -- Yes... I see lots of people (now) -- haven't used IRC before. daviid: grr_: in the manual, look for Returning and Accepting Multiple Values grr_: Hi daviid -- l shall have a nose... grr_: Ahh... Okay... I see where we are going here. grr_: I will have a proper look at this section later tonight (Multiple values) grr_: Thank you. However, if anyone knows -- why return multiple values when scheme is good with lists? grr_: Something to do with multi processes? Anyway - will look at the manual. Thank you. paroneayea: hello, friends daviid: hi paroneayea OrangeShark: hi paroneayea paroneayea: hi daviid, OrangeShark :) amz3: hi paroneayea paroneayea: hi amz3 amz3: fwiw there is cython implementation of psycopg binary protocol called asyncpg that is reported to be the fastest pgsql driver around amz3: https://github.com/MagicStack/asyncpg/ faalentijn: hello paroneayea janneke: o/ paroneayea: amz3: cool paroneayea: and hi faalentijn catonano: hi paroneayea paroneayea: heya catonano catonano: :-) cmaloney: hello faalentijn: Hello cmaloney! amz3`: Scheme For The Win http://spectrum.ieee.org/static/interactive-the-top-programming-languages-2017 random-nick: hm, why is scheme marked as "Mobile"? ft: And Haskell as embedded. amz3`: THose means it's used in the mobile industry ArneBab_: Go stumbles over GC cost, too: https://www.youtube.com/watch?v=q1h2g84EX1M ← I say "too", because I saw 50% GC load quite a few times with Guile. lloda: just wasted some time with https://lists.gnu.org/archive/html/libtool/2009-12/msg00057.html :-/ daviid: anyone has experienced 'make check' remains for ever in 'Running sandbox.test'? this is on stable-2.2, after I commented 3 files in the larceny test-suite (which should not have anything to do with this, but.. ) daviid: hum, this behavior is related to these files, just reverted my changes ... that is too bad (was trying to help rlb wrt a license problem in these... but it seems they are required to run make check, or would imply more changes ...) daviid: sneek: later tell rlb 'make' worked fine but 'make check' remains in 'Running sandbox.test' for ever when commenting thse three gc-benchmark/larceny file we were talking about yesterday, so that approach won't work 'just like that', it might still work but would need a bit more then just commenting these in the Makefile.am sneek: Will do. daviid: sneek: later tell rlb I recommend you send an email to guile-devel and posibly copy it to guix-devel as well, because it is 'holiday time' i europe and I'm not sure (all) maintainers will see and respond to our irc conversation and attempt to solve it asap for you to introduce 2.2 in debian unstable... better email I think sneek: Okay. civodul: lloda: bah, that ltdl bug is terrible! lloda: civodul: crazy old, too... bavier`: is the claim here https://programmingpraxis.com/2017/07/11/my-new-programming-environment/ about guile being "aggressively R5RS" even accurate? davexunit: bavier`: that seems a little extreme davexunit: considering that guile has r6rs compatibility and r7rs compatibility planned bavier`: one can run "pure" r6rs programs in guile, correct? davexunit: i'm not sure since i haven't tried davexunit: ACTION pays no mind to scheme standards cmaloney: iirc there's r6rs support in guile 2.0 with an external library cmaloney: but it's not complete and says as much in the manual cmaloney: (not complete as in there are philosophical reasons why Guile doesn't support X) random-nick: bavier`: see this section in the manual: https://www.gnu.org/software/guile/manual/html_node/R6RS-Incompatibilities.html#R6RS-Incompatibilities cmaloney: unrelated: I've been kicking around learning Debian packaging by creating a PPA for guile 2.2 for Ubuntu 14.04 on up cmaloney: any reason why that would be a silly idea? cmaloney: I built guile 2.2 in a LXC container and it took long enough that I'm not eager to repeat that mwette: so I'm working the FFI Helper and peeps suggested the gdbm API but lol that has this: mwette: typedef struct { char *dptr; int dsize; } datum; mwette: datum gdbm_fetch(GDBM_FILE, datum) mwette: So the function gdbm_fetch takes struct values (datum) as argument and returns structs. This is not supported by the current FFI signature scheme. mwette: I have not explored the implementation but guessing the guts of calling C functions this way in libguile, registers allocated to argument are spilled onto the C-stack (e.g., as would be done for varargs calls). But what about return values? I'm guessing the FFI pointer->procedure api may need to change. Thoughts? mwette: I found on wikipedia "X86 calling conventions" with ref to SysV AMD64 ABI mwette: now searching in libffi documentation mwette: and guile documentation on ffi. Passing and returning structs may already be supported but how is not clear to me. amz3`: via pointers? amz3`: actually you pass a pointer, then turn that into a bytevector and convert that to something schemey via bytestructure amz3`: but I am not sure about gdbm mwette: The issue here is that structs are being passed and returned by value (in C programs). amz3`: that's not possible afaik amz3`: but that's what does happen in https://github.com/ijp/guile-gdbm/blob/master/gdbm.scm#L72 amz3`: (define-foreign %gdbm-fetch datum "gdbm_fetch" (list '* datum)) amz3`: where amz3`: (define datum (list '* int)) amz3`: if this was true, it would make guile bytestructure useless, I am not sure I understand amz3`: I need to sleep mwette: Ah. From reading parse_ffi_type in libguile/foreign.c I was thinking support might be there already. So I should use the following: mwette: (pointer->procedure (list '* int) (dynamic-func "gdbm_fetch" (dynamic-link)) mwette: (list '* (list '* int)) mwette: It will get more tricky for code passing unions by value. I will need a routine to compile the largest component (with alignment) of the union. mwette: I hope I punt support for passing unions. arrays can be handled via structs: mwette: (pointer->procedure ret-arg fctn-pointer (list (list int int int))) for function with one arg declared as "int x[3]" amz3`: it only works if there is no specific alignement to do? amz3`: ? faalentijn: Hello, I'm not sure where this is exactly the right place to ask but I want to know for certain that I'm not doing something really stupid before filing a bug (it both scares me and, as a beginner, I presume everything is my fault by default). But when using the (web client) module to do a post request with a body to a service that is TLS only, it will throw the "The TLS connection was non-properly terminated". For example it will do faalentijn: (http-get "https://ptpb.pw/R1gC") just fine but will balk when you try to do (http-post "https://ptpw.pw" #:body "hello world!"). I tried multiple different services (http + https seems to be fine), setting the streaming flag, sending it a bytevector, sending it with the length of the bytevector and the like but it hasn't been working. faalentijn: faalentijn: I'm I being a dunce or is there something wrong with (web client) or (gnutls). Guile 2.2 and GnuTLS 3.5.14 but I've also tried it using the Guix & Debian packages. paroneayea: hm cbaines: I'm seeing some weird behaviour from current-time in SRFI-19, (current-time time-monotonic) => #