<roelj>Ah, I found it: 6.20.10 Accessing Modules from C. Sorry for the noise <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" <dadinn>dsmith: interestingly it is a shell built in for Arch, while it's a binary on Debian, and Guix :/ <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>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 <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>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>I've also always heard that terms within the context of HPC, and bare metal HPC .. <daviid>dsmith: whatr is your raspeerry os? <daviid>did you had to adapt guile or just it compile 'put of the box' using gcc <sneek>Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux <daviid>dsmith: ok, i guess not worth an article then :) <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 <daviid>by the way, whileat somewhat slightly ot subjects, does any one knows if guile will easily compile/install on a libbrem 5 phone? <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>but i know next to nothiong about proceors <dsmith>I would say "probably", but won't know til you try. <daviid>i would love to read a tut on a dev env <dsmith>guile actually cross compiles pretty good. <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>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. <dsmith>Ah, one of those multi-arch thingies <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. <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" <daviid>i wish i could 'apt-get install librem5-sdk', install guile and g-golf in it, and start to 'play with it' ... <daviid>yes i did see that, but i don't think there is a 'librem5-sdk' yet :) <daviid>i mean a VM running PureOS and you'd see the phone in host window ... <daviid>we need at least one guile killer app on the librem5 phone, for yesterday :):) <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. <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>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 ... <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 <dsmith>Is this that linux phone for about, oh $200 or so? <daviid>dsmith oh no, the librem 5 is $799 <dsmith>I must be thinking of something else. <daviid>and only have 24h in my days as well :):) <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>the entire future of thye all humanity is in these 2 phones :):):) <daviid>of course that can only happen if they run guile :):) <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 ... <daviid>dsmith: i live in a country that taxes 100%, anything from abroad <daviid>here, the phone would cost me $1,500 <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>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. <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!' ... <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: wc! ping me anytime ... <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 <daviid>seepel1: that would be wonderfull <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. <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 <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 <pkill9>hmm i don't think, I want to create a tool for creating guix packages <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>but i'm not too fond of it, i'm not enough of a power user lol <apteryx>agreed, that more automation would be welcome. ***nikita_ is now known as nikita`
<a_v_p>ArneBab: I'll appreciate any help with making Guile-SSH better for sure. ;-) ***apteryx_ is now known as apteryx
<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. ***jonsger1 is now known as jonsger
<a_v_p>ArneBab: That would be nice, thanks. <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. ***wxie1 is now known as wxie
<ArneBab>send message blocks if another message is currently being sent. <ArneBab>the links are valid for commit c826c5e0b3e374d885d23e1c010a7178632d0336 <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 ***dongcarl9 is now known as dongcarl
***terpri__ is now known as terpri
<pkill9>how do you add completion functionality to guile's readline? <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>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. <dadinn>quick question: how do I do sed style search-replace on a string in guile? <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>dadinn: I think the manual has some examples. <pkill9>ah, the completer is adding a space at the end <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 <tab> 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? <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>what is the recommended way to do unit testing in guile? ***sputny1 is now known as sputny
<ATuin>hi I need some help with a syntax-case macro <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>i'm a bit confused with it being honest <leoprikler>Guile-GI actually does something vaguely similar to what you're trying to achieve <ATuin>mmm the strange thing is the unbound variable message <leoprikler>Either way, I'd let-bind name first and then use with-syntax, seems cleaner imo <ATuin>i get all the time the unbound variable error <ATuin>but macros can reference normal procedures right? <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>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)) <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>and you can use let-bindings by simply doing #, inside it <ATuin>so in your example you can prefix the `%` inside the #` construct? <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>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>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>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? <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>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. <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? <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>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? <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>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>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 ..