IRC channel logs

2016-12-23.log

back to list of logs

<janneke>roelj: are you looking for (symbol->string (symbol-append 'my- 'string)) ?
<janneke>ACTION -> zZzzz
<roelj>janneke: No, I'm looking for the other way around. I would like to get "Hello world" instead of "my-string".
<roelj>janneke: Goodnight
<paroneayea>so the message passing in 8sync looks like
<paroneayea>(<- from-actor to-id 'action action-args ...)
<paroneayea>but, the from-actor is probably always available via a parameter.
<paroneayea>I wonder if I should drop it.
<davexunit>roelj: (module-ref (current-module) 'my-string)
<roelj>davexunit: Thanks! It took a bit of time to adapt it in my code, but it works. Thanks a lot!
<davexunit>roelj: I will note that if you are doing this, you probably have a design issue.
<davexunit>it's *very* rare that you need to do something like this
<roelj>davexunit: Heh. I am writing a web page in which each page is implemented as a module.
<roelj>Well actually, a function in a module.
<roelj>Depending on the request path (/hello-world) it goes to the corresponding page.
<roelj>Are there examples of running a daemon with Guile code?
<paroneayea>just learned about alist-cons from srfi-1
<paroneayea>a bit nicer than (cons (cons 'key 'val) lst)
<paroneayea>always some abstraction in guile I haven't bumped into yet
<OrangeShark>paroneayea: there is also acons which is in part of guile
<paroneayea>OrangeShark: huh, so there is
<paroneayea>and that one I don't even need to import srfi-1 for :)
<paroneayea>ok, made use of srfi-37 for the first time
<paroneayea>it's pretty nice!
<paroneayea>(fold-args)
<paroneayea>here's something I can't figure out how to do with fold-args
<paroneayea>syncbot.scm --server irc.freenode.net --username sinkbot --channels "#8sync #guile"
<paroneayea>it doesn't seem to automatically snarf the next argument the way getopt-long does
<paroneayea>I can do:
<paroneayea>--channels="#8sync #guile"
<paroneayea>but it doesn't work
<paroneayea>because it doesn't group those arguments together
<paroneayea>guess long arguments with spaces doesn't work
<paroneayea>with fold-args
<wleslie>I would have guessed a comma
<paroneayea>a comma would work I guess
<paroneayea>I'm just surprised that space containing values don't seem to work
***dcluna_ is now known as dcluna
<mbuf>What is the memory footprint of a Guile VM?
<ArneBab_>mbuf: for which task? When it does nothing?
<ArneBab_>mbuf: I see a newly started guile 2.1.4 consume 15 MiB of memory.
<ArneBab_>importing srfi-42 increases that to 23 MiB
<mbuf>ArneBab_, okay
<mbuf>ArneBab_, if embedding in a C project?
<ArneBab_>I don’t know — please let me know if you try it.
<ArneBab_>I did not yet do that myself.
<ArneBab_>mbuf: however if I run it non-interactively
<ArneBab_>mbuf: this reduces to 1.7 MiB
<mbuf>ArneBab_, nice! thanks
<ArneBab_>also it depends on the tool I use to count…
<ArneBab_>with KDE system activity I get only 6 MiB for a newly started Guile 2.1.4
<ArneBab_>top still gives me 6 MiB for the non-interactive one
<ArneBab_>mbuf: just try guile -c "(sleep 100)"
<mbuf>ArneBab_, 7.5MB here
<mbuf>ArneBab_, using 2.0.13
<ArneBab_>mbuf: does it change with -q?
<mbuf>ArneBab_, increased by 1M with -q option to 7.6MB
<ArneBab_>Ah, I found the difference. 1.7 MiB private, 4.2 MiB shared
<ArneBab_>mbuf: if I start 100 Guile processes (2.1.4) these 4.2 MiB shared are only 42kiB per process
<mbuf>ArneBab_, okay
<ArneBab_>(which is pretty cool)
<ArneBab_>mbuf: do you have defined requirements you want to meet?
<mbuf>ArneBab_, just trying to choose between Lua and Guile
<mbuf>Whoever designed the site https://www.gnu.org/software/guile/, did an excellent job! I[t looks great!
<mbuf>*It
<ArneBab_>mbuf: ask wingo if you want a truly informed decision. He’s using Lua for high performance packet filtering and is working on the lowest levels of Guile to make it more efficient.
<ArneBab_>the site is wonderful, yes!
<ArneBab_>and more and more of the GNU sites are currently getting this treatment.
<ArneBab_>the Guile site showed me that a modern-style site can actually be done right
<ArneBab_>mbuf: my opinion on Guile vs. Lua is much less informed and much more biased: I’d choose Guile because I want the flexibility which comes with Scheme and Guile, and I would want to be able to use wisp, for example because it gives me this: https://fosdem.org/2017/schedule/event/naturalscriptwritingguile/
<ArneBab_>I have read lots of good things about Lua, too, but I did not test any of them myself.
<mbuf>ArneBab_, okay; thanks for your feedback!
<ArneBab_>mbuf: sorry that I cannot give you a more informed opinion on Lua
<ArneBab_>mbuf: you might want to read all the Lua and Guile things in http://wingolog.org
<ArneBab_> http://wingolog.org/tags/lua and http://wingolog.org/tags/guile
<ArneBab_>and http://wingolog.org/tags/luajit
<mbuf>ArneBab_, thanks!
<ArneBab_>mbuf: what kind of application do you have in mind?
<ArneBab_>ACTION kept thinking about your question
<mbuf>ArneBab_, nothing specific in mind, actually
<OrangeShark>Happy friday
<amz3>o/
***daviid is now known as Guest34943
***Guest34943 is now known as daviid
<amz3>héllo guilers :)
<ArneBab>hi amz3
<amz3>ArneBab: I read you do a presentation about your work
<ArneBab>yes *happy*
<amz3>I have a question kind of related, how much slides do you plan to use?
<ArneBab>given that there’s 20 minutes I think I won’t have more than 10 slides
<amz3>ah ok
<ArneBab>It would be really cool to have a laptop there which could run code, but I don’t think that will be easy enough to prepare
<ArneBab>(mine are not compatible with presentations)
<amz3>I don't plan to do a demo, but having a laptop to view my slides would be good
<amz3>as I don't plan to bring my laptop
<ArneBab>I plan to just upload the slides and share the link on the mailing list, asking any of the folks with laptops to download them beforehand
<amz3>That's a good plan
<amz3>I will also bring a usb key
<amz3>je suis sur qu'ils vont arreter le dev de wiredtiger pour se consacrer pleinement à crée un bon storage backend pour mongodb
<amz3>wrong channel
<paroneayea>ok
<paroneayea>now I'm facing something really difficult
<paroneayea>which is how to let actors "clean up" after themselves at event loop shutdown.
<paroneayea>eg, imagine an actor which is controlling a database, or watching a socket
<paroneayea>when the event loop shuts down, they should get sent something that gives them an opportunity to close such things
<paroneayea>the question is, should it also use the same event loop
<paroneayea>what about messages that are currently in-process?
<paroneayea>should it dump the queue?
<paroneayea>eg if there's a C-c / SIGKILL style interrupt
<paroneayea>one option would be: dump the queue, and start up a new queue with one message sent to every actor: *clean-up*
<paroneayea>and that's the actor's one chance to do cleanup for an unexpected shutdown.
<paroneayea>it might be a decent solution for now.
<paroneayea>also, unrelatedly
<paroneayea>well, hm, maybe I should leave that as a surprise for my FOSDEM talk :)
<paroneayea>I have some fun things planned.
<paroneayea>daviid: ping
<daviid>paroneayea: hello!
<paroneayea>daviid: so, here's your chance to convince me of a traditional CLOS style thing I haven't bought into yet ;)
<paroneayea>normally when I use generic methods, I still do something like
<paroneayea>(define-method (irc-bot-handle-line (irc-bot <irc-bot>) line)
<paroneayea> ...)
<paroneayea>now I see plenty of generic methods just doing
<paroneayea>(define-method (handle-line (irc-bot <irc-bot>) line)
<paroneayea> ...)
<paroneayea>which is certainly shorter, but I wonder if you lose something nice about seeing what the "method" is expected to be related to
<daviid>you don't loose anything since the dispatch is on the first arg, which vehicle that same info
<paroneayea>I suppose that's true
<paroneayea>it's certainly easier to read not having the extra 8 characters of irc-bot-
<paroneayea>but
<paroneayea>less clear when invoked maybe
<paroneayea>maybe one motivator for the shortness is that the -method on define-method is already taking up a precious extra 7 characters on my line ;)
<daviid>wrt 'less clear', only if you badely name your args
<daviid>like
<daviid>(define not-a-bot (make <irc-bot>)) then (handler-line not-a-bot) :) but that is also true for none oop programming
<paroneayea>hm
<daviid>paroneayea: i would always pick the shorter possible name when using goops
<daviid>* the shortest
<paroneayea>daviid: ok, well thanks! I appreciate your input :)
<daviid>but you also have to deeply understand guile's module system when exporting these
<paroneayea>daviid: because if you have two different "frobnicate" generic methods in two different modules and then import them both... ? :)
<daviid>yes, and also you can't use #:export m-name if you impoirt a module that defines m-name ...
<daviid>I should write something and upload it about this, but in the mean time, I have a 'strict' approach when it comes to using goops: (1) make sure your class names are unique (for the entire 'system', always unique for all modules) and export them, #:export <...>; (b) always set #:duplicates (merge-generics replace warn-override-core warn last)); (c) do not define generic, let the system do it for you; and (d) always use g-export to
<daviid>either export or reexport methods
<daviid>
<daviid>then you will never ever face a bug wrt method 'availabiloity' and dispatch from any module
<daviid>g-export is here
<daviid>hum, will paste an up-to-date version in a min
<daviid>paroneayea: here http://paste.lisp.org/submit
<daviid>paroneayea: welcome!
<daviid>paroneayea: g-export [goops export], which re-export defined names, should _only_ be used for getters, setters, accessors and methods (of course, but better state it :))
<paroneayea>daviid: ah thanks
<paroneayea>daviid: d8id you mean to paste the paste link, or the submit link?
<daviid>ah sorry, here http://paste.lisp.org/+76B4
<daviid>welcome!
<paroneayea>daviid: thanks
<paroneayea>daviid: is that copyright header correct? is guile-cv a gnu project you've signed papers for?
<paroneayea>because if not I don't think it's (C) FSF
<daviid>paroneayea: I'm working on and will submit it soon now, I beleive it will be accepted, so I worked with these headers ... but feel free to snarf and change the header ...
<paroneayea>ok, thx
<daviid>paroneayea: I've signed the papers for guile, and I beleive that covers guile related projects, because they did not ask me to sign any other paper for g-golf and foliot
<daviid>but anyway, guile-cv is not publicly available yet, I just posted a copy of one of its file for you to look at and snarf ...
<paroneayea>daviid: I don't think it covers related projects as far as I know
<paroneayea>but anyway, I don't mean to be hung up on it either, just commenting :)
<paroneayea>thanks for your feedback daviid
<daviid>paroneayea: ok, but they did not ask me to sign any other paper for guile-gnome, guile-clutter, g-golf and foliot, so I was assuming ... but I'm not a pro wrt license ... if they ask i sign anyway ... everything i do must be gpl or lgpl compatible anyway