IRC channel logs

2023-01-05.log

back to list of logs

<daviid>sneek: later tell akirakyle i pushed the 'custom widget' example to the g-golf example/gtk4 tree and added to the list on the g-golf website, 'learn' - (the last entry on that page) - https://www.gnu.org/software/g-golf/learn.html
<sneek>Got it.
<chrislck>sneek: botsnack
<sneek>:)
<mfiano>daviid: Thanks for your work on g-golf. All the examples and talk about it sounds exciting. I look forward to using it some time when I get up to speed with Scheme.
<sneek>Welcome back rekado :)
<daviid>mfiano: tx - have fun when you'll start to use it, let us know if you need help or find a bug ...
<mfiano>Ok :)
<daviid>i shall release 0.8.0-a.2 any time soon now that i foxed this VFunc related bug
<mwette>sneek: butsnack
<flatwhatson>i don't think sneek likes those
<mwette>sneek seems to be indifferent
<mwette>lol, btw
<mwette>sneek: botsnack
<sneek>:)
<old>wow g-golf makes me want to do GUI again
<old>Maybe a Guix related GUI could be nice to make with it
<daviid>old: tx, have fun as well! wrt a guix gui, make sure to coordnate with other guixers, i think you're not the 1st, i think there's even some designed 'out there', maybe even some project/impleentation draft ...
<old>ohh I see. in that case I will leave it to the expert :-p
<old>Perhaps it won't hurt to just make a blog post of a proof on concept of it though
<old>Will put that on my todo list
<mfiano>Does anyone know the trick to making todo lists actually reduce in size?
<mfiano>(my list is actually a priority queue, and finding where to put things takes time even)
<mfiano>i actually have a project idea on my todo list for trying to solve this problem, haha
<daviid>old: i would post a mail to ask who's interested, if there has been some work already, some design maybe ... on a guix ml, not sure whch - i even heard some (guixers) wanted to use qt ... just to make sure you'd not loose your time, but i don't think there is any expert(ise) (yet), just wishes and maybe some draft(s) ...
<daviid>*I would - you might want to ... ( i won't :))
<daviid>anyone knows if there is a configure parameter/option to disable // compilation of the SOURCE files?
<mfiano>GUILE_JIT_THRESHOLD=-1 ?
<daviid>mfiano: sorry, i badly expressed myself here, i am refering to the gnu build system, how to disable make -j [to disable the -j option]
<mfiano>oh you can just do `MAKEFLAGS="" ./script`
<mfiano>but I do not know for that build system :)
<daviid>but to disable it as part of the project definition ... in the configure.ac file (?) or using special 'something' in the Makefile.am (?)
<mfiano>if you can alter env vars though...
<daviid>not sure we understand each other, i wish to 'do something' so that even if a user asks for 'make -j cpu-nb', it actualy ignores it and runs make -j 1
<daviid>no matter what
<daviid>hum, maybe this https://www.gnu.org/software/make/manual/html_node/Parallel-Disable.html
<old>I think that .NOTPARALLEL is it
<old>I'll send a mail on guix-devel to see if there's any talk about a GUI. Anyway, a very small proof of concept should not be hard and long to make
<old>It would be more to get an hand on g-golf
<daviid>old: using g-golf is relatively easy, the difficulty, with gui in general, is the gui design, and the knowledge you need of the upstream libs - you definitely need to read and know libadwaita and gtk4 [they both ahe a demo and source code of the demo examples ...]
<daviid>old: developing a gui and maintaining it is order of mag more complex then 'normal' development, imo
<daviid>but g-golf is here to make it easier :) - it won't cut the enormous amount of knowledge (and experience) you need to have to design and maintain a good gui
<daviid>old: to get 'a hand' on g-golf, i'd rather pick one of the demo that is not yet in g-golf (there are quite a few ...) and start to 'copy' it, reading the upstream doc, upstream code, and 'pick' a g-golf example as a 'starting mini app template'
<daviid>old: do yu have .NOTPARALLEL 'expereience'?
<daviid>or anyone else here?
<daviid>i need to patch either this file https://git.savannah.gnu.org/cgit/g-golf.git/tree/am/guile.mk (lines 48 - 51) and/or this file https://git.savannah.gnu.org/cgit/g-golf.git/tree/Makefile.am, line 30 - 115 (?) but even reading their manual, i don't get how/what/where i should patch
<old>daviid: I see. My experience with GUI has stopped with Qt in C++. I hated it. Since then I've only done low system programming in C and tools that only require CLI
<old>I avoid GUI, except in video game. But if g-golf can make it fun again then it would be great
<old>I'll check out th edemo ethanks!
<Aurora_v_kosmose>Most UI work I've done is in Emacs/text-oriented.
<old>daviid: I haven't use .NOTPARALLEL, but it seems relatively easy to use and should do what you're expecting, i.e. serialization even with `-j'
<daviid>old: I understand, gui devel can be overwhelming - Qt, C++, pfouww, then even boring i guess :) - i hope g-golf makes it fun again, but you still need a good knowledge of the upstream libs and some design experience ... the nice thing with libdwaita now, is that you can develop adaptive app, they will run on mobile phones (those that runs the gnoe stack i mean, librem5, the pinephones ... not many yet but .. who knows ...
<daviid>old: i just fail to understand how to use .NOTPARALLEL, i need a concrete example to look at - i even think it might not workds actually, as the doc says it disable // execution of the rules (not // compilation of source files of the 'same rule'
<old>Do you need the entire graph to be serial or a subset?
<daviid>to start with, all scm files - but make can build the doc in //
<old>Hold on I'll try a quick snippet
<daviid>then i can see if it indeed 'blocks' make -j xx
<daviid>old you can try on g-golf (if you have a clone?)
<old>So I tried with a guile-parallel
<daviid>old fyi, i asked in ##workingset, one person answered this - the .NOTPARALLEL target disables parallel execution of rules
<old>Serial all %.go: %.scm
<old>Assuming GOBJECTS is a list of all .go files in the project
<old>.NOTPARALLEL: $(GOBJETS)
<old>Should make your %.go: %scm serial
<old>that is what I get here
<daviid>sorry i am a bit lost
<daviid> here is my guile.mk file - https://git.savannah.gnu.org/cgit/g-golf.git/tree/am/guile.mk
<daviid>here is the make file - https://git.savannah.gnu.org/cgit/g-golf.git/tree/Makefile.am
<daviid>what should i add where?
<daviid>from what you said, i assume i only have to patch the guile.mk file
<daviid>line 28 i have GOBJECTS = $(SOURCES:%.scm=%.go)
<daviid>ok
<daviid>old: added .NOTPARALLEL: $(GOBJETS) line 29 of my guile.mk file
<daviid>just checked, and that worked perfectly, thanks! the ##workingset people kindely just answered as well, oh well, i was trying this since yesterday ... fixed now, thanks
<old>Sorry for late reply. Happy that it works out fine!
<mfiano>sneek: later tell dthompson Really, Dave? https://chaser.com.au/general-news/local-programmer-forced-to-change-career-following-2-minute-stackoverflow-outage/
<sneek>Okay.
<Aurora_v_kosmose>rip, it's cloudflared
<lilyp>got a good laugh
<mfiano>guile appreciation realization #2: the module system. what a wonderful piece of work. It's like CL, except has the few features it doesn't and can't have, like renaming symbols. Additionally, I absolutely love that the convention is to use one module per file, with `using-modules` specs explicitly spelled out in a way that clearly maps to where they exist on disk. I am not a huge fan of CL's package
<mfiano>system, but this all boils down to that it's a Lisp-2, and therefor modules don't contain bindings like in Scheme, but actual symbol objects with various containing bindings, so renaming when inheritance is involved kinda breaks object identity and everything symbols are used for. I am very slowly realizing that I might have been a Schemer all along for nearly 20 years.
<civodul>heh :-)
<gtz>This doesn't work the way I want it to work: https://paste.centos.org/view/raw/dd6534c8
<gtz>I am trying to make a macro that will create the boilerplate in define-record-type definitions and I'm having great trouble. I am a scheme novice.
<civodul>sneek: seen jpoiret
<sneek>jpoiret was last seen in #guix 22 hours ago, saying: hi guix.
<gtz>I guess it is because define-record-type is a macro which means I am trying to make a macro that outputs a macro
<civodul>gtz: the use of define-record-type at https://paste.centos.org/view/raw/dd6534c8 misses several arguments
<gtz>civodul, I know but I don't think this is the problem
<gtz>Is there an example that I can look at? It will take me days to figure it out myself.
<gtz>Or maybe what I am trying to do is not possible with syntax-rules.
<a12l>What does the expression `(error #f "Wrong type to apply: ~S" "0")` mean? It seems that it returns a s-expression, but I can't find the documentation for `error` in the reference manual.
<a12l>Lots of hits when searching for "error"
<dthompson>a12l: that error means that you've tried to make a procedure call with something that isn't a procedure
<sneek>Welcome back dthompson, you have 1 message!
<sneek>dthompson, mfiano says: Really, Dave? https://chaser.com.au/general-news/local-programmer-forced-to-change-career-following-2-minute-stackoverflow-outage/
<dthompson>mfiano: omg lololololol
<mfiano>:)
<a12l>dthompson: Does `~S` mean s-expression here?
<a12l>Or symbol?
<drakonis>where are you calling that from?
<dthompson>a12l: that's format string notation for any scheme expression. in this case it looks like you've tried to call ("0" ...) or (0 ...)
<dthompson>usually that means that you mixed up variables and put the wrong thing in the operator position of a procedure call
<a12l>drakonis: https://paste.debian.net/1266222/
<a12l>I can't see where I'm doing the misstake
<drakonis>that (hamming) call maybe?
<drakonis>that is most certainly not a procedure
<dthompson>yup that's it
<dthompson>substituting for the variable you get: (0)
<dthompson>which explains the error about trying to apply 0
<a12l>It seems that I don't really know when I should use parenthesizes, and when I should not.
<a12l>Thanks for the help! Solved it by removing the parens=
<dthompson>parentheses are for function calls and macros
<dthompson>a variable reference is neither so it does not need parens
<jpoiret>civodul: if you're wondering about the posix_spawn, i am planning to rework it according to what you last said, but I am still trying to find the time for that
<civodul>jpoiret: hi! yes, no problem, i'm trying to see how to i can schedule my own activities, not trying to put pressure on you :-)
<civodul>we seem to be mostly done so i'll let us finish that before publishing 3.0.9
<civodul>(well 3.0.9rc1 because there could be new portability issues)
<mfiano>Finally! I just spent the last 3 days getting guile to load my projects correctly. THank you dthompson, flatwhatson, and ArneBab for helping me survive this nightmare.
<mfiano>This is why I like to read first. I can't learn by doing more than I can learn by failing. I feel like one of the typewriter monkeys
<a12l>dthompson: Ah, thanks!
<mfiano>Can someone do me a favor and give me a rough estimate of the timing information on their machine with this? `guile -c ''; time guile -c ''`
<flatwhatson>mfiano: average 0.019s here
<mfiano>Ok. I thought my 0.016 seemed high, but I guess not.
<flatwhatson>on my beefy machine it's 0.010
<mfiano>I'm used to measuring performance in ms and ns, but I'm not complaining
<flatwhatson>for process startup though?
<a12l>real, user, or sys?
<dthompson>mfiano: glad you got things sorted out!
<flatwhatson>eg. doing the same with python is around 0.042s on my slower machine
<dthompson>guile vm start time is quite fast
<a12l>real: 0.014, user: 0.011, and sys: 0.004
<a12l>Thinkpad T460s
<dthompson>.018 real for me, average of 5 runs with guile 3.0.7
<mfiano>Ok I take that back. It's faster than any other REPL installed on my system at the moment
<mfiano>By a good margin
<dthompson>wingo has taken some pride in making startup time quick.
<mfiano>And I cheated
<mfiano>I kept my ~/.guile and disabled rc files for all the other repl's
<mfiano>factor of 2-4x
<mfiano>and just the other day I was thinking I might need to use another scheme for a low latency shell script replacement
<dthompson>I love using guile for shell scripts
<mfiano>gaunche caught my attention for a short while, but didn't seem like it offered much of anything over guile
<mfiano>gauche*
<dthompson>it has its advantages, but overall I like guile the best
<mfiano>:)
<mfiano>With ArneBab's hack, I even avoid parsing the body as a string argument, and also get the benefits of bytecode if it's available.
<dthompson>with guile 3 it can became possible to do indie level games with good performance so I've been pretty happy
<dthompson>did ArneBab show you how to manually invoke the compiler?
<mfiano>No
<dthompson>oh, guess I misunderstood then :)
<dthompson>but that's a fun thing to do when you have a need for it :)
<mfiano>exec -a "$0" guile -L $(dirname $(realpath "$0")) -C $(dirname $(realpath "$0")) -e '(module)' -c '' "${@}"
<mfiano>(define-module (module))
<dsmith-work>Morning Greetings, Guilers
<ArneBab>dthompson: I only showed mfiano how to let guile auto-detect the module bytecode if it’s already compiled and only compile it as needed.
<ArneBab>mfiano: that -C can also be used to compile with guild compile and then find those pre-compiled bytecode-files. The advantage of that is that you can set the optimization level — or even use different languages together.
<dsmith-work>speaking of compiling...
<dsmith-work>Would be a great time to add an option to quiet the noisy compiler.
<dsmith-work>civodul: ^^ for 3.0.9
<civodul>dsmith-work: what noise? the thing that says 'guild' could not be auto-compiled?
<count3rmeasure>good morning (Texas time) guile folk!
<dsmith-work>;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
<dsmith-work>;;; or pass the --no-auto-compile argument to disable.
<dsmith-work>;;; compiling /home/dales/hello.scm
<dsmith-work>;;; compiled /home/dales/.cache/guile/ccache/3.0-LE-8-4.6/home/dales/hello.scm.go
<dsmith-work>civodul: That noise
<civodul>ah well, that noise was intended
<civodul>so we won't change it within a stable series
<civodul>that's when you run "guile hello.scm", right?
<dsmith-work>Yep
<old>dsmith-work: Not the same warning but I have this in my makefiles: @builddir@/pre-inst-env guild compile $< -o $@ | awk '$$0 !~ /wrote.+/'
<old>So I have a nice quiet `GUILD *.go' without any `wrote *.go' in between
<old>For the auto-compilation warning, if it ever shows in my project, it means that I haven't call `make' after a change. I've learn to live with it ^^
<civodul>yeah, same here
<lloda>i never compile anything manually
<old>mfiano: I get 0.006s for Guile and 0.008s for python3.9
<lloda>btw https://debbugs.gnu.org/60522 is an infinite loop in peval. That part of guile is inscrutable to me tho :-\
<mfiano>old: wow
<mfiano>I haven't been this excited about a language in a long time, and it's mostly because of this implementation we call guile. i read the manuals of every popular implementation and guile's very nice documentation with all those nice features (and any of r5-r7 conformance (with some minor variations)..._and_ it's fast. I honestly don't know what more I could ask for from a Lisp. Exciting!
<mfiano>I'm also finding that even as a complete newbie stumbling around with syntax errors, I'm able to write code faster than in CL, mostly because _CL IS SO FREAKING VERBOSE WITH EVERYTHING_.
<old>And when it's not fast enough, Guile has a very powerful foreign interface module so you can call C :-)
<dsmith-work>lloda: Looks like it's spinning on a futex
<mfiano>People keep telling me that, but that just scares me even more than it does when I have to do such things in CL, which is almost never thankfully.
<dsmith-work>I'l like to know CL. But I JUST CAN'T GET PAST ALL THE SHOUTING
<mfiano>shouting?
<dsmith-work>Case insesitive, and most always prints in UPPERCASE
<mfiano>CL is most definitely not case insensitive
<mfiano>and it doesn;t have to print in uppercase. Some implementations do not
<old>I can't get past the `predicate-p'
<mfiano>+1
<dsmith-work>* '(foo bar baz)
<dsmith-work>(FOO BAR BAZ)
<dsmith-work>Yah, all the -p stuff is weird too
<dsmith-work>A 'P' almost looks like a '?' if you connect the dots..
<dsmith-work>And I'm joking about "can
<mfiano>dsmith-work: You are experiencing your implementation's default configuration for both READ and PRINT. There are special variables (parameter objects) to control their behavior if you are on a Lisp that uses a style you don't like.
<dsmith-work>'t get past".
<dsmith-work>Just is ugly to me that's all.
<dsmith-work>mfiano: Nice. I'll have to look into that.
<mfiano>CL has some very strange naming conventions, and there isn't really any consistency because a lot of their names were just lifted from several competing Lisp implementations at the time.
<mfiano>The standard is so well designed that it's the only thing holding it together. I'm surprised the language didn't come apart at the seams a couple decades ago.
<mfiano>I am very critical of the only language I know well. I think I'm qualified to not like a lot about it.
<dsmith-work>Heh
<mfiano>I think it's Scheme's turn to shine. For the last couple years Guile has been getting pretty popular, even discounting guix. Lots of new exciting things popping up. I think Scheme and Guile are looking better than CL in the future.
<mfiano>It was probably the "shiny new" appeal of the 3.0 release.
<mfiano>Does wingo still say hi here once in a while? I haven't been here in over a year.
<dsmith-work>sneek: seen wingo?
<sneek>wingo was in #guile 20 days ago, saying: rerro.
<mfiano>I pinged him a thanks a few days ago. hope he and the other contributors get it! :)
<dthompson>he's here infrequently, but he'll stop by to say "moo" from time to time.
<dthompson>sharing a random little thing: Guile's REPL implementation is more decoupled from i/o than I realized.
<dthompson>which means... it's possible to re-use the REPL machinery for handling languages and stuff and provide a different user interface!
<dthompson>imagine a graphical REPL a la the javascript consoles in web browsers
<dthompson>there are some wrinkles, though. meta-commands that spawn sub-repls will use the standard text i/o REPLs. wonder if that could be made more general.
<old>dthompson: An interface à la Dr.Racket ?
<dthompson>old: yeah, would be cool.
<daviid>using g-golf (and emacs core stuff), it would now possible to completely rewrite genera, for guile/goops
<old>genera?
<drakonis>lisp machines
<old>Ah it's an operating system
<old>I though you meant hardware lisp machines
<drakonis>yes, well, it is an operating system for lisp machines
<drakonis>its a neat thing
<dthompson>maybe one day we'll get back to the 80s
<old>Need more static analysis IMO before making an OS in Scheme. A different GC than Boehm also
<dthompson>like whippet? ;)
<old>Maybe. I don't know the details of it just had a glance of wingo repo
<dthompson>guix + emacs is like half a lisp machine ;)
<old>I just think that it would probably be better to have a specialized GC for a kernel
<old>Perhaps no GC at all if you have goog static analysis
<dthompson>that's where PreScheme comes in :)
<old>Then add a GC in userland. But I don't know if a kernel should have a GC
<old>Right. Lots of talk about PreScheme. Is someone working on that?
<dthompson>flatwhatson is
<old>Maybe having a board of projects for Guile could help to track them ^^
<old>Oh neat
<old>Also a Lisp machines require a lisp hardware
<old>Anybody down to do some VHDL for that?
<old>I think I have vivado somewhere on a HDD taking the dust
<dthompson>flatwhatson said it will be the best performing systems language and that will be stable and ready for widespread usage by the end of january ;)
<old>flatwhatson: 26 days left
<old>Maybe we could rewrite in PreScheme Rust rewrite of C program
<dsmith-work>Just didn't say *which* Janurary?
<dsmith-work>(sorry in a bit of a snarky mood lately)
<dthompson>;)
<daviid>by saying g-golf + emacs core stuff (and guile ofc) we may rewrite genera, i meant the user dev env - the genera 'desktopt' so to speak - ... not the 'all os' (1.5M loc), as you probably understood but ...
<daviid>i already did think about that 2 decades ago, using guile-gnome and clutter ... but things got order of mag better since, so now would be a real 'possible' (not that i am going to do it tomorrow, just saying it would be perfectly possible ...)
<dsmith-work>Emacs itself sort of does the lisp machine thing on it's own. For example, you can use it as a window manager. (I've not tried that). Not really a "machine" but more like the interface of a lisp machine..
<old>daviid: Would you keep the Linux kernel?
<old>Genera would simply be a userland?
<old>dsmith-work: True. But elisp is not Scheme :-(
<old>Btw would making a board of Guile projects by the community be an interesting thing to have?
<old>That would help to get a view of what's happening in the community but also if X want to contribute to something Y, they can search for possible projects and contribute to them
<dsmith-work>sneek: projects?
<daviid>old, as i corrected after reading your conversation with dthompson, i was refering to the genera desktop
<dsmith-work>sneek: packages?
<old>There's already something like that: https://www.gnu.org/software/guile/libraries/
<daviid>sneek: guile-software?
<sneek>Last time I checked guile-software is http://sph.mn/foreign/guile-software.html
<dsmith-work>There it is! Thanks daviid
<old>But something with tags and a filter search bar, couple with the list of maintainer/contacts/pages for each projects
<dsmith-work>Guile elpa
<old>Oh that's cool
<old>did not know about guile-software
<old>daviid: I see. I think it could work great. We already have shepherd for init
<daviid>old: but to rewrite 'a genera desktop like env', you don't need shepherd
<old>By desktop you're refering to something like KDE and Gnome?
<old>No the whole userland OS
<old>sneek: what is guile-software
<sneek>guile-software is http://sph.mn/foreign/guile-software.html
<daviid>old: yu'd need to see a genera demo i think
<old>Perhaps yes
<daviid>there are tons 'out there'
<old>Unrelated question I have here. Anybody writting their pseudo-code in Scheme? Also, would it be legit to use Scheme as pseudo-code in a scientific paper?
<old>daviid: I'll do a search then :p
<civodul>old: i did that years ago, but it's not necessarily a good idea :-)
<civodul>depends on the audience and on what you want to present
<civodul>speaking of https://www.gnu.org/software/guile/libraries/ the good thing is that it's necessarily up-to-date: it only lists software that actually works
<old>Right. I think that libraries is actually what I was thinking. But perhaps just throwing some tags and search bar
<old>Maybe a text variant would be also nice for grepping
<old>Oh I see that it's auto-generated by Guix
<civodul> https://packages.guix.gnu.org is a good approximation :-)
<old>So everything under guile-xyz.scm I guess
<civodul>right, everything that depends on Guile even
<old>hmm not bad: guile and gnome -> I do get g-golf
<old>as inputs and propagated-inputs ?
<old>oh wow even native-inputs
<old>libpatch is list there wow
<old>that's good publicity ^^
<old>and libjami!
<old>Wow okay that page has changed since last time I checked
<oenone>old: Arne Babenhauserheide talks about Scheme as alternative to python for pseudocode: https://www.draketo.de/proj/py2guile/ but more about Wisp (whitespace indented Scheme)
<daviid>fwwi, the guile library page is somehow 'by definition' out of date, as it only lists what has a package in guix, afaict there are quite a few apps/libs that do not have a guix package - the guile-software http://sph.mn/foreign/guile-software.html, which i help to maintain by emailing its author, is nearly 100% accurate (and keeps record of 'old app/lib, which i think might be interesting for those who want to just look, then that
<daviid>triggers an idea, and they can revive or write a new ...)
<drakonis>it is very very out of date
<old>daviid: But does it work? Like civodul things on libraries and known to be reproductible since they are define in guix channel
<old>s/and known/are known
<daviid>old: it doesn't matter, imo - it is a list of past and current s/w written in guile ...
<old>But I see your point. There's ton of things not on Guix there
<daviid>what matters is to know if it exists or existed ...
<old>Care to add guile-parallel? :p
<daviid>sure, let me email, what is the website
<old> https://sr.ht/~old/guile-parallel/
<daviid>ok
<daviid>sent, it can take a few days, sometimes even more, but they always 'get back' and update the site -
<old>Okay
<old>Who's they btw?
<sneek>Yey! mwette is back
<oenone>There's an "awesome" list about Guile, too: https://notabug.org/ZelphirKaltstahl/awesome-guile/src/master/list.md
<daviid>old: te owner ofte site
<drakonis>the discoverability could use some improvements
<old>ArneBab: You've ever published something that has Scheme as pseudo-code?
<old>Scientific paper wise
<old>Just wondering if I should do it or it will be a mistake
<lilyp>Communicating Sequential Processes uses cons, so don't worry about it
<lilyp>as long as it's not a particular dialect and you get to worry about exact semantics
<old>Okay thanks!
<cow_2001>oh my gourd. https://youtu.be/6BnVo7EHO_8
<elevenkb>what is the best way to lift the boolean operations to predcates in guile scheme?
<drakonis>idgi
<stis>f = (x for x in range(250000000))
<stis>print(sum(f))
<stis>with guile that takes 4s
<stis>with python3 that takes 7s
<stis>running with python on guile for guile e.g. the same code
<lilyp>elevenkb: can you give an example of what you're trying to accomplish?
<elevenkb>this isn't urgent anymore b.c. i found a way to rearrange my code to achieve the same level of elegance.
<elevenkb>lilyp: if you are still curious consider the function `(lambda (it) (and? (integer? it) (even? it)))` .
<elevenkb>I wanted to write this as something like `(and? integer? even?)`.
<elevenkb>now the choice of `integer?` and `even?` here signifies nothing: I want the code to work for any predicates.
<lilyp>I think you wanted (and ) instead of and? in your lambda, and and? as the "merged one"?
<lilyp>In any case, the SRFI-1+26 answer is (every (cute <> val) list-of-procedures)
<elevenkb>wild. thanks lilyp
<elevenkb>is that a standard idiom?
<old>How about:
<old>elevenkb: (define-syntax-rule (and? predicates ...) (lambda (e) (and (predicates e) ...))) ?
<old>((and? integer? even?) 6)
<elevenkb>thats also cool. old.
<dthompson>how about function composition?
<dthompson>((compose integer? even?) 6)
<lilyp>That won't work
<lilyp>#t is not an integer
<elevenkb>yah that won't work.
<dthompson>probably wrong order but you get the idea
<lilyp>#t is also not even ;)
<elevenkb>:p.
<dthompson>you get the idea though
<dthompson>add number? in there
<lilyp>compose passes the result
<lilyp>you actually want something similar to a map tho
<dthompson>ah right oopsies
<dthompson>moving too fast here
<lilyp>so either do the every thing, or a syntax rule
<old>you could use compose if you wrap your predicates so that they return the value or false instead
<elevenkb>yah.
<old>probably overkill
<elevenkb>i suck at macros, how should one master those.
<old>Write one :p
<old>then another
<old>you get use to it
<dthompson>yeah every is a good one
<elevenkb>maybe go through the source code for =(ice-9 match)= and =goops=?
<old>start with define-syntax-rule they are super easy
<lilyp>definitely start with define-syntax-rule
<old>then syntax-rules when you want more power
<dsmith-work>sneek: macros?
<sneek>macros is http://hipster.home.xs4all.nl/lib/scheme/gauche/define-syntax-primer.txt
<lilyp>though for the record ice-9 match can also do this:
<old>then the syntax-cases beast if you can to do complex stuff
<lilyp>(and (? integer?) (? even?) v)
<old>true
<old>I wonder if it compile down to something as fast as the and? syntax above
<old>(match e ((and (? integer?) (? even?)) #t) (_ #f))
<daviid>old: wrt symbolics genera, i suggest you watch this one https://www.youtube.com/watch?v=o4-YnLpLgtk - the sound and interlocutor's voice are a bit 'suboptinal', but your hear should 'get it' after a 1/2 to 1 min ... as said in the comments, 'What a blast from the past ... There are so many features in Genera, it was really almost ridiculous ...' Kalman Reti is an ex Symbolics Developer
<daviid>old he still writes code using opengenera, he has a few advent of code 2022 :)
<elevenkb>as a young coder i'm worried about the legacy of the whole smalltalk/lisp machine heritage.
<daviid>as said, the open genera vm on his ubuntu machine bots order of mag faster then the original symblics machine :)
<old>So there's already a genera next gen?
<elevenkb>it seems that we might loose a lot of wisdom since the people who pioneered it didn't teach us anything.
<old>god damn genera quite older than I am
<daviid>old: no, just open genera 2.0 as 'the original'
<old>okay. Thanks for the link I will watch this latter that evening
<elevenkb>mcclim exists though https://github.com/McCLIM/McCLIM
<daviid>elevenkb: you are the 'victim' of a lisp/scheme segregatios in universities, but as you can see, the wind turns ...
<akirakyle>.
<sneek>Welcome back akirakyle, you have 4 messages!
<sneek>akirakyle, daviid says: i am looking at why, in your example, the define-vfunc fails, i can reproduce the bug, will let you know when i find the cause and a fix ...
<sneek>akirakyle, daviid says: i found the cause and pushed a fix, to the devel branch - with this fix, the 'drawing widget' blog example you wanted to try is working fine here - https://paste.rs/YFP.scm - so now you may draw using g-golf :), have fun and let me know if you find some other problems ... tx for the report
<sneek>akirakyle, daviid says: here is a screenshot for the above code ... https://imgur.com/a/JDL98aL
<sneek>akirakyle, daviid says: i pushed the 'custom widget' example to the g-golf example/gtk4 tree and added to the list on the g-golf website, 'learn' - (the last entry on that page) - https://www.gnu.org/software/g-golf/learn.html
<akirakyle>daviid: that's awesome! Thanks for making that example work, I'm gonna take a look now and see how far I can push this idea I have :)
<old>daviid: I think there's 2 peoples at my university doing scheme. Including me ..
<old>It's all about Python now
<old>Fun fact, the maintainer of Gambit was one of my teacher in a course
<old>It's because of him if I use emacs today
<old>and that was the only lisp experience I had at the university :/
<stis>guile without my optimizaiton takes 182s so a nice speedup of 50X
<civodul>old: that must have been a nice experience though!
<old>I don't regret anything even though I haven't continue in that university
<old>Learning emacs was a game changer for real
<elevenkb>does guile have something like racket's =syntax-parse= ?
<Aurora_v_kosmose>Is there a module to load for signal numbers?
<Aurora_v_kosmose>My libc reference manual doesn't specify the numbers, solely the signals, which suggests the actual numbers used might not be standard?
<daviid>akirakyle: welcome! i also just pushed a fix to force a serial build for the $(GOBJETS) rule, so even if you run 'make -j cpu-nb, it won't fail anymore ...
<dsmith-work>stis: Very nice indeed
<old>Any builtin way in Guile to do artihmetic on a certain type size and determine if there's an overflow?
<old>something like gcc __builtin_add_overflow
<old>Typically I want to add two numbers, that are uint8_t in C and want the result modulo 8 bits and if it overflows
<old>But all of this in pure Scheme :-)
<old>I guess I can do that with some artihmetic manipulation but wanted to know if there's a builtin functionnality for that
<daviid>akirakyle: i think you should be able to push the idea as far as you wish, that is, you shold be able to do anything you would using cairo ... including that if the snapshot model misses something, you can use cairo - you may hit bugs in the way though, let me know ...
<daviid>akirakyle: libadwaita also as some of the clutter animations ...
<daviid>*has
<akirakyle>daviid: I just tested that commit and it now builds on guix without needing to pass -c 1 to guix so it should build successfully on hydra once the upstream package recipe is updated. I also can confirm that the drawing-widget.scm example ran for me in guix!
<akirakyle>I suppose disabling parallelism altogether works fine fine since g-golf builds pretty quickly, but probably still a workaround for some makefile dependency issue?
<daviid>akirakyle: it should only seriaqlize the go making, if you use gnu make >= 4.4
<akirakyle>daviid: ah sounds good, probably keeps the makefile rules for the *.go files simpler
<akirakyle>daviid: Yeah I'm interested in having access to a scene graph like rendering model in guile, but the scene graph doesn't exist in clutter in gtk4 afaik, it's all in gsk
<daviid>akirakyle: clutter is 'retired' - gtk4 creates a scene graph 'à la clutter', but still lacks animations (in libadwaita, partially at least) - see https://docs.gtk.org/gtk4/drawing-model.html
<daviid>'The scene graph' ...
<akirakyle>daviid: yes that's more or less what I meant
<daviid>akirakyle: great! i am looking forward to your scene graph drawings! keep us informed ... and remember, g-golf is still in alpha mode, so you are likely going to hit some other bugs, which i'll be pleased to (try to) fix ...
<akirakyle>daviid: Thanks!
<old>Oh well `(define (add-byte-overflow x y) (let ((result (+ x y))) (values (modulo result 256) (>= result 256))))' will do for my usage
<old>daviid: Why did you need to serialize the compilation of gobjects btw?
<ArneBab>old: no, I did not publish anything with pseudocode. But I use Scheme (actually mostly wisp, but some scheme in-between where it is more expressive than wisp …) in lecture slides.
<old>okay thanks
<ArneBab>old: for my lectures I switched to almost exclusively using code that actually runs, because in one of the books I use for reference I found an error in the pseudo-code and I did not want to risk that.
<stis>Ok got vanilla guile to iterate generators 2M iterations / s, python does 30M iterations/s and my optimized iterators does 55M iterations / s
<Aurora_v_kosmose>Not bad.
<dthompson>I have a scene graph-like system for guile built on chickadee. hasn't been officially released yet but it's called catbird. went into some detail about it here: https://dthompson.us/catbird-an-experimental-game-engine-for-scheme-programmers.html
<akirakyle>dthompson: catbird looks very cool indeed! I'm not sure it'll be suited for the idea I have though since it looks much more targeted towards games than ui and my ideas revolve more around text editing than gaming
<dthompson>akirakyle: yeah use a mature graphical toolkit for that!
<dthompson>I am making UIs for this, though, sort of like Smalltalk's Morphic framework
<old>ArneBab: When I wrote pseudo-code, everything is there except perhaps the `use-modules` and some `getter', `setter' `make' for records
<old>Thus I leave the data representation free. I understand that for a lecture though it's better to have everthing executable as it
<old>Since I just want to show an algorihtm in an Annexe, I think that just providing the big procedure is enough.