IRC channel logs

2020-12-08.log

back to list of logs

<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 ..
***apteryx is now known as Guest72514
***apteryx_ is now known as apteryx
<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