IRC channel logs

2017-03-28.log

back to list of logs

***micro` is now known as Guest31748
<daviid> what would be a good english name for a function that takes n lists and 'combine' its elements, for example (foo '(1 2 3) '(4 5 6) '(7 8 9)) -> ((1 4 7) (2 5 8) (3 6 9))
<OrangeShark>daviid: I think that is called zip?
<davexunit>yeah, that is zip
<davexunit>from SRFI 1
<daviid>ah, thanks!
<amz3>héllo #guile
<janneke>hi amz3!
<wingo>moo
<civodul>hi wingo!
<webshinra>peterbrett_work: timing is a bitch
<peterbrett_work>webshinra: hehehe
<webshinra>but the fact I get a : «Thread 10 "openSpaceSimula" received signal SIGPWR, Power fail/restart.» error.
<webshinra>was pretty worrying.
<webshinra>But it seems that it came form somewhere else in my codebase, so it's reassuring… I suppose.
<wingo>i think that's libgc
<wingo>it uses SIGPWR as its mechanism for stop-the-world
<wingo>it installs its own handlers so it should be transparent
<wingo>except in gdb of course :)
<wingo>use scm_leave_guile if you want to do a long-running computation that doesn't use guile values and doesn't need to be paused for gc
<wingo>er
<wingo>scm_without_guile
<peterbrett_work>webshinra: There, have another patch :-)
<webshinra>:)
<webshinra>good idea
<peterbrett_work>webshinra: Would you accept patches that add move & copy construction, `std::swap()` support, etc?
<webshinra>Absolutely, I see no reason to refuse that kind of stuff
<peterbrett_work>webshinra: One of the reasons that I like Rust is that you get most of that stuff "for free"
<webshinra>yep, c++ have history, it have good and bad sides, archaïsm are not from the good ones
<ArneBab>janneke: did you see https://www.quora.com/In-what-language-was-C-written/answer/Arne-Babenhauserheide ← answering the deeper question with mes :)
<mg_>I'm new to guile, but I think the concept of repl-server could fit a problem I'm working on perfectly. Does anyone have any links to tutorials/articles on this feature? Coming from "less enlightened" languages I have problems wrapping my head around exactly how they work.
<janneke>ArneBab: great to take the discussion deeper and thanks for mentioning Mes
<janneke>now if i can only find why mes does not run nyacc's cpp bit correctly
<mg_>an existing codebase that uses this feature would help as well!
<webshinra>mg_: well, I never use that freature, but if I remember correctly, the guile manual have chapter about it
<webshinra>maybe crossing the function/procedure name with sourcecode search engine will give you some references
<wingo>mg_: i think davexunit and paroneayea use it a lot
<wingo>my guile is often too broken for me to take advantage of it; perhaps with the stable release that will change :P
<mg_>webshinra: good idea, thanks :)
<paroneayea>wingo: mg_: yes, live hacking a the repl is the way that I primarily sketch out my designs (often while they run), and I do think that applies to davexunit as well
<paroneayea>mg_: there is a bit of tradeoff that it's possible that you create a variable or import a module at the repl-only that you forget to put in your file; I find that it's ok though, I just occasionally kill the process and run "make" and restart the process
<paroneayea>compiling usually finds those errors
<paroneayea>and they don't happen too often
<mg_>paron
<mg_>paroneayea: have you used it for something other than development?
<paroneayea>mg_: hm, like what? sometimes I use it as a kind of scripting engine
<paroneayea>but that still seems like development
<mg_>I'll try to describe my usecase, give me a minute. Perhaps it's the wrong tool entirely!
<paroneayea>I've also used it to write tools to process large amounts of daa
<paroneayea>data
<paroneayea>and then I have the steps to reproduce the processing written down
<paroneayea>but I can play with it
<mg_>I have daemon that sends messages to other systems periodically. What i'd like to do is to "live program" this daemon such that I can make it send different messages, for example, without stopping the daemon/loop.
<wingo>mg_: do you use emacs?
<wingo>if so geiser is really amazing for this
<wingo>you start a repl server, then M-x geiser-connect
<wingo>that gives you a repl of course
<mg_>wingo: no, I'm a vim guy... (not the right channel to admit that, I presume)
<wingo>but then if you open a file from your daemon, you can C-x C-e to evaluate that definition in that module
<wingo>and it works through the repl to make it happen on the remote side
<wingo>heh, that's cool too :) no geiser tho
<mg_>But I'll have a look at it anyways!
<wingo>check http://www.nongnu.org/geiser/
<wingo>can give you ideas
<mg_>thanks :)
<paroneayea>mg_: btw re: your daemon, if you want to send messages that do specific things
<paroneayea>maybe you're better off not using a live repl and actually use something that does message passing
<paroneayea>mg_: 8sync is well tuned to that, and fibers also uses message passing. I hope to add inter-process / inter-server communication between actors to 8sync soon
<sneek>So noted.
<paroneayea>sneek: forget that
<sneek>Consider it forgotten.
<paroneayea>I'm not sure what I just made sneek forget, suddenly
<paroneayea>sneek: forget beets
<sneek>Consider it forgotten.
<paroneayea>maybe nothing.
<lloda>bytevector->pointer seems pretty slow. Getting pointers through array handles seems to be much faster :-/
<civodul>yeah, not great for FFIs
<civodul>also the fact that pointers are boxed
<daviid>is there hope/plan to improve ? guile-cv extensively uses bytevector->pointer
<mg_>paroneayea: I've had a look at fibers, will take a look at 8sync as well, thanks :)
<paroneayea>mg_: cool
<daviid>hello *
<civodul>daviid: it's not that bad either, only a problem if it's in a hot spot i guess
<daviid>civodul: yeah, I think it's ok, although almost every procedure calls (n times, n being the number of channel or the matrix depth), the cost is marginal compared to the math ops being done ... but if array handle is a lot faster, and this boxing (why actually?) there are room for improvment I guess ...
<civodul>right
<daviid>it's a bit to early now, but in the future I'll try to make some comparisons with octave and imagej, when that make sence of course, but right now I'm happy with the overal peformance and did not tune things yet (except for im-scrap, which used inexact->exact milion of times and I wrote a C func to boost it)
<daviid>of course I would be happy if bytevector->pointer gets faster and does not require boxing... :)
<daviid>anyway, guile-2.2 rocks!
<daviid>the only problem is the fact that we can't set things so the ssystem uses truncated-print upon raised exception
<lloda>I was wrapping a library called cssgrid. It wants you to call it once to get some working data (this first call is slow) and then to call it again for each point you want to process. Those further calls are fast, and that's where bytevector->pointer takes several times longer than the call itself.
<lloda>I could cache the pointers, but it's a pain.
<lloda>So I think that's a limitation of the FFI until things like bytevector->pointer get faster.
<wingo>i expect this is because of the weak pointer->bytevector reference. instead we should just reference the bytevector directly from the pointer.
<wingo>of course it would be nice to avoid boxing entirely
<wingo>but that would be for another day :)
<wingo>so it's an easy fix, just allocate a bigger pointer in bytevector->pointer and reference the bytevector in an additional word.
<daviid>this is a blocker for guile-cv potential users: untill this is solved, it is practically almost unusable (whithout raised exception using truncated-print I mean)
<amz3>an additional word?
<dsmith-work>Tuesday Greetings, Guilers
<dsmith-work>sneek: 8sync?
<sneek>8sync is well tuned to that, and fibers also uses message passing. I hope to add inter-process / inter-server communication between actors to 8sync soon
<dsmith-work>sneek: 8sync?
<sneek>8sync is well tuned to that, and fibers also uses message passing. I hope to add inter-process / inter-server communication between actors to 8sync soon
<dsmith-work>sneek: 8sync?
<sneek>Last time I checked 8sync is well tuned to that, and fibers also uses message passing. I hope to add inter-process / inter-server communication between actors to 8sync soon
<dsmith-work>sneek: forget 8sync
<sneek>Okay.
<dsmith-work>paroneayea: If the bot ever surprises you by remembering something, looks for "<something> is .." in your message
<dsmith-work>It remmembers the <something>
<dsmith-work>guile-2.2 is awesome, sneek
<sneek>Understood.
<dsmith-work>forget guile-2.2, seen
<sneek>Okay.
<janneke>sneek: <something>?
<janneke>sneek: something?
<dsmith-work>So I was thinking that something is really important to be seen
<dsmith-work>Whoh
<janneke>sneek: something?
<dsmith-work>janneke: The <something> above was a meta variable...
<dsmith-work>So I was thinking that something is really important to be, seen
<janneke>dsmith-work: i understand...i was wondering whether sneek would understand
<dsmith-work>Hah ok
<dsmith-work>I always forget to work on it when I'm at home..
<davexunit>lloda: my trick re: bytevector->pointer is to cache the pointer object for future reference
<davexunit>sometimes that means making a record type that has a slot for the bytevector and then its corresponding pointer
<guile-guest9>Anyone online?
***guile-guest9 is now known as Muto
<Muto>I've been having problems running .SCM files with Guile
<Muto>Say I have the simple number program '2', just the number 2 in a 'num.scm' file, now, when I try to use 'guile num.scm', it doesn't execute the program, it just 'writes' it to ~/.cache/guile/num.scm or something...
<Muto>So many people online, all AFK or bots ;-;
<Muto>Hello#
<Muto>!
<Muto>reggggieee: Do you speak English?
<davexunit>Muto: what do you expect from such a program? it doesn't display anything
<Muto>Oh, well I have different programs, simple ones though, but I can't run them in a .SCM file, I have to use the guile-user> terminal input to write all my programs
<reggggieee>Muto: yes, why do you ask?
<Muto>reggggieee: I was just wondering, no-one was online and I'm having issues running .scm files in Ubuntu
<Muto>Ah, here's the message I get when I try to run a simple (display "hello") program:
<reggggieee>ah, i don't have a lot of experience with running scheme files from cli. all i've really done is eval-last-sexp stuff in emacs
<reggggieee>i'm a noob
<Muto>reggggieee: that's fine, me too
<reggggieee>sry
<Muto>muto@laptop:~$ guile hello.scm compiling /home/muto/hello.scm compiled /home/muto/.cache/guile/ccache/2.2-LE-8-3.9/home/muto/hello.scm.go
<dsmith-work>Muto: Yeah, the channel is often slow. Expect to to wait a few hours or maybe even days for someone to respond.
<dsmith-work>Muto: And don't forget to just ask instead of asking to ask!
<Muto>I can't do anything with the .go file, either, I feel like there's something completely obvious I'm doing wrong, but I can't put my finger on it.
<Muto>dsmith-work: I'll remember that, thank you.
<davexunit>Muto: that compiling message is normal
<davexunit>pass --no-auto-compile if you don't want it to compile
<davexunit>the .go file isn't for you to do anything, it's just the compiled source file
<Muto>Aha, I see! I didn't notice the input prompt now says "hellomuto@laptop:~$" because I forgot to add a newline, yes it does work, I feel so stupid now, after all this time, I'm sorry.
<dsmith-work>Muto: np!
<dsmith-work>Muto: we are all learners
<Muto>davexunit: Also, I love your work, do you know if you'll make a new blog post any time soon?
<Muto>Ah, well I should really get going, get work done, goodbye, helpful community!
<daviid>davexunit: yur trick to cache bytevector->pointer works for the binding itrself, but not for guile-cv procedure source code, because it has to allocate mem block at each call, for each channel ... so it would be really cool to unbox and speed things here
<davexunit>unboxing the pointer type is a whole different story
<davexunit>but yes, sounds like a good thing to do, if possible
<davexunit>I continue to be plagued by u64 boxing issues
<davexunit>there must be a way to optimize, but I haven't figured it out yet.
<daviid>davexunit: good luck!
<wingo>good evening
<spk121_>yo
<wingo>:)
<daviid>heya wingo!
<wingo>heya daviid :)
<wingo>how goes?
<daviid>wingo: really nice time thanks to guile-2.2, and guile-cv is promising as well
<wingo>cool :)
<wingo>maybe we do a 2.2.1 soonish
<wingo>hopefully we can get that truncated exception printer thing in
<spk121_>Q: is there any way to register a function to be called on shutdown, as in the C library's atexit()?
<daviid>wingo: that would be fantastic
***spk121_ is now known as spk121
<daviid>wingo: otherwise, my (long term) contract is coming to an end here in Rio, so i'm looking for another freelance free software part time job... then I'm looking to maybe live in Barcelona :) saying thsi because I know you lived there quite a long time ..
<wingo>neat :)
<wingo>it's a nice town
<daviid>I'm a little bit concerned with the nationalism (I hate nationalism :))
<daviid>but otherwise it would be a nice spot I think
<daviid>because they have the super computer, it seems to be a research pool in europe
<daviid>anyway, if you know somethng let me know ... who knows
<wingo>i never had a lot of industry contacts there, sorta lived a perpendicular life in a way
<daviid>did you make spanish 'real' freinds there?
<iamfromgibraltar>hi wingo, do you take applications for Gsoc students?
<daviid>so far i've only worked for universities and research labs, industry is not my style, unless free s/w, part time, applied research, white card for tools (I do everything in Guile, a little C if/when needed) so industry is rare for me
<daviid>anyway, back to hacking
<daviid>sometime I think africa as well, sooo maaany possibiblties :)
<amz3`>daviid: I would love to work like you do
<daviid>ot: I was thinking to try to raise some funding for G-Golf and (separately) Guile-CV actually, anyone has experience?
<daviid>amz3 I'm poor (very poor), live in a room, have nothing , but I'm free (like in philosophy) being a free human has a price ... we all know that
<wingo>iamfromgibraltar: i don't have time to mentor, sorry :/
<iamfromgibraltar>ok
<amz3`>daviid: no problem :)
<wingo>ok! just pushed the code to have syntax objects be a distinct type
<wingo>check it out if that's your thing
<wingo>oh no, i worked on a file in /tmp then rebooted....
<wingo>it is gone :(((((((((((((((((((((((((((
<wingo>that was the sandbox i was working up to.
<wingo>sad.
<dsmith-work>wingo: So is git master ok?
<daviid>wingo: oh, terribly frustrating! how sad
<daviid>sometimes we don't remember what we just did ...
<wingo>dsmith-work: it's fine, just lost some future work
<daviid>and it is a loss of time anyway ...
<dsmith-work>wingo: Whew!
<wingo>heh yeah. the tedious bit is triaging the thousand bindings that guile has into "safe to give to sandboxed code" and "unsafe"
<dsmith-work>wingo: Too bad though. Frustrating.
<wingo>welp, first time that happened to me in many years, i guess i was due
<dsmith-work>wingo: But now you get do the "build one to throw away" thing. ;^}
<wingo>lol
<daviid>wingo: yeah, sometimes i think 'this will never happen again..., lesson learned...' then all of a suddeen, i do it agaim :( (like rm -rf * in the wrong place, no backup, as root...) once every 10y :)
<daviid>the worst is when this happen on a customer box, h man!
<daviid>scary :)
<dsmith-work>daviid: Oh yeah!
<dsmith-work>Did that once.
<wingo>:)
<dsmith-work>Well. I did chown -r altus *
<daviid>yeah, then there is no place to hide :)
<dsmith-work>But that didn't pick up .files, so
<dsmith-work>chown -r altus .*
<dsmith-work>as root
<dsmith-work>On customer box
<dsmith-work>On my first week at Altus
<daviid>pfoufff
<dsmith-work>Yeah. All files in all home dirs was now owned by altus. Bad day for me.
<dsmith-work>I was able to partially recover by re-chown'ing them to whatever home dir they were in.
<daviid>dsmith-work: once i did that on the entire debian tree
<daviid>i finally decided to reinstall the machine, it becane unusable
<dsmith-work>daviid: Was it possible to use packages to fix things up?
<daviid>dsmith-work: maybe, but not a sysadmin expert, i'm good, but not the best ...
<janneke>yeah...nyacc's cpp now runs OK with mescc -- mes does not support module-local variables yet so i prefixed some variables in nyacc
<dsmith-work>Heh. There was some stroy I read in a magazine. Guy recovered from rm -rf with emacs
<dsmith-work>Involved rewriting some suid binary in hexl mode so they could recover from backup tapes.
<wingo>zokeysmokes i have the sandbox back; just have to build the default set of imported bindings
<wingo>but for now, zzz
<daviid>good night!