IRC channel logs

2017-04-20.log

back to list of logs

<Rains>ijp, och mate
<Rains>I cannae live without yer Sco'ish accent ye ken.
<Apteryx>Any suggestion for computing the difference between two list of strings?
<Apteryx>In other, I want to eliminate the entries (strings here) which are common to both lists.
<Apteryx>words*
<wingo>lset-difference
<wingo>or lset-subtract, one of those
<wingo>check srfi-1
<Apteryx>wingo: Thanks :)
<saikyun>wingo: I saw one of your talks about guile - it was really interesting, so thanks for that!
<wingo>tx for kind words saikyun :)
<ertes>is there a variant of open-pipe that lets me redirect stderr as well?
<wingo>ertes: very sadly, no. open-pipe needs to be better :/
<ertes>too bad… any other options?
<wingo>redirect stderr to a file? i know, the worst.
<wingo>good morning civodul
<civodul>morning!
<ertes>that's not good enough in this case, unfortunately… i guess, i'll need to switch to a different scheme for this particular project
<ertes>thanks for your help!
<wingo>alternately, add that interface to open-process :) not too bad. but if switching interpreters is easy that can be a good option too.
<ertes>i'm still in an early stage, so it's pretty much trivial =)
<ertes>this is also kind of a research project to see how fit scheme is as a replacement for shell scripts
<wingo>ACTION nod
<wingo>you might want to check out "shill"
<wingo>it's pretty great
<ertes>is that a scheme implementation?
<wingo>it's a language implemented on top of racket
<wingo> http://shill.seas.harvard.edu/
<ertes>hmm… racket…
<ertes>i have mixed feelings about that one
<brendyn>Isn't shill a negative word ^.^
<brendyn>ertes: Which feelings?
<ertes>disclaimer: this experience was made on a netbook with a celeron CPU
<ertes>the compiler took half a minute to compile hello world
<ertes>the interpreter took 200ms to start up
<ertes>not the REPL, but the interpreter
<brendyn>time racket -e "(display \\"hi\\")" => 364 ms
<brendyn>time guile -c "(display \\"hi\\")" => 25ms
<ertes>yeah, not acceptable for scripting
<ertes>racket i mean
<brendyn>ertes: What things do you program?
<ertes>brendyn: the things i'd like to use scheme for are mostly systems programming: executing programs, connecting their stdins, stdouts, stderrs, moving files around, etc.
<ertes>basically i'm trying to replace my shell scripts
<wingo>it's possible in guile to use primitive-fork, but in that case you will want to ensure that you are not otherwise using threads and that the GC isn't using threads
<wingo>for the latter, set GC_MARKERS=1
<wingo>maybe it's possible for guile to do a better job here (shut down markers if we primitive-fork)
<ertes>wingo: yeah, i had found that option, but it's not quite as convenient and safe as open-pipe… i'll give chicken a shot now
<wingo>cool, good luck :)
<wingo>civodul: apparently GC_is_heap_ptr is a libgc 7.3 thing
<wingo>maybe we should just require libgc 7.3
<wingo>otherwise we can shim it
<ertes>cool, chicken even has lightweight threads… ok, i'm hooked =)
<wingo>bah there never was a libgc 7.3 :P
<wingo>ertes: guile has that in a library :)
<wingo>a few libraries actually. https://github.com/wingo/fibers is one of them
<wingo>ACTION meant to update web site before leaving yest but apparently i was working on an outdated copy
<ertes>wingo: as a library? i can't imagine how that would work
<brendyn>Anyone know any other sites like programmingpraxis?
<ertes>i guess it provides alternative ports as well
<wingo>ertes: docs here fwiw https://github.com/wingo/fibers/wiki/Manual
<wingo>it uses guile's ports
<ertes>interesting
<ertes>give me working lightweight concurrency, open-pipe with stderr redirection and perhaps as a bonus a static type system, then i'm 100% happy =)
<wingo>give me, give me, give me ;)
<civodul>wingo: re GC_is_heap_ptr, not sure what the best approach is
<wingo>i just pushed a shim to implement it in terms of GC_base
<wingo>well, i would if the gnu servers would catch up
<wingo>things seem to be very slow atm, dunno if it is my network
<civodul>ok, good
<saikyun>when using geiser with guile, is there a way to somehow autoload the modules I'm currently using so that the geiser repl knows about them? it's kind of annoying to have to run (use-module ...) all the time
<wingo>maybe add them to your .guile?
<wingo>dunno, maybe geiser doesn't load that
<wingo>i would check the manual :)
<saikyun>oh, I didn't even know about .guile... I'm super new to guile, haha. I'll start by checking that out then
<wingo>ffs git push slow
<wleslie> http://community.sparknotes.com/2017/04/19/if-shakespeare-characters-had-business-cards/
<nalaginrut>nikita1: could you elaborate your question? are you uploading a large file and Artanis is blocking for another parallel request?
<nikita1>nalaginrut: The Artanis works as a html/json frontend for Postgresql database. The problem is that several connections have to wait each other to complete.
<nikita1>... if the database responses slowly for big requests
<nikita1>small off-topic: there were some odds in implementation of db module of Artanis concerning postgresql (during initialization it tries to connect to PG server without database name and then to switch to particular database - but PG doesn't allow such trick)
<nalaginrut>nikita1: It's good question ;-)_
<nikita1>nalaginrut: can Artanis do some kind of "gevents" or something like this?
<nalaginrut>nikita1: in the latest commit, Artanis takes advantage of SO_REUSEPORT since Linux-4.5 for multi-core
<nalaginrut>nikita1: so you can start many Artanis instance listening on the same port to handle slow request with multi cores
<nalaginrut>it won't be blocked in userland even if one of the request works very slow
<nalaginrut>nikita1: Artanis use delimited-continuations for coroutines, and with the latest server.multi feature, you can start many Artanis instances just like people did in threading server programming
<nalaginrut>nikita1: but my design reduced complexity, and in principle, you may start infinite Artanis instances if you have enough resources for parallel performance
<nikita1>nalaginrut: I've found such option as (server workers) -- is there any meaning to use it in such case?
<nalaginrut>nikita1: (server workers) is obsolete from now one, I'll not support threads in Artanis, the only way to take advantage of multi-cores is to start many Artanis instances. This avoid many issues for threading programming
<nalaginrut>s/from now on
<nalaginrut>you should enable server.multi to make sure all Artanis instances listening to the same port
<nalaginrut>and of course, kernel-4.5+
<nalaginrut>you could try it now, but I just finished it few hours ago, so it could be buggy ;-P
<nikita1>nalaginrut: Thanks! good work! I'll try it..
<nalaginrut>if any bugs, feel free to blame me and report on gitlab ;-)
<nikita1>sure
<nikita1>nalaginrut: first of all, db conection to PG doesn't want to establish again. If you want, I can send you a workaround I do -- may be you'll find better place for it.
<nikita1>nalaginrut: have you tested Artanis on BSDs?
<meena>goodmorning wh is software hi
<lloda>savannah seems to have died...
<lloda>guile on savannah I mean
<wingo>erryting on savannah :P
<nalaginrut>nikita1: you may paste to gitlab and raise an issue. And there's connection pool when Artanis started. If you want to do massive write and prevent other requests to access, then it means you need a higher abstract architecture for your whole environment, it's not simple case to use a web-framework simply
<nalaginrut>and if you just need to read massive data from DB, then it's fine to block in one Artanis instance, other requests will be handled in other instances
<nikita1>nalaginrut: I suppose, massive read will work in this case. I'm still trying to get through blockers of beta-version.. already filed some issues on gitlab.
<nikita1>Backtrace:
<nikita1>Prepare for regnarok-open
<nikita1>Added listenning port to epoll
<nikita1>Prepare for main-loop
<nikita1> Backtrace:
<nikita1> 0 6 (apply-smob/1 #<catch-closure 142fca0>)(apply-smob/1 #<catch-closure 12d2c00>)(apply-smob/1 #<catch-closure 142fca0>)(apply-smob/1 #<catch-closure 12d2c00>)
<nikita1>ERROR: In procedure apply-smob/1:
<nikita1>ERROR: In procedure dbi-close: Wrong type argument in position 1: #<finalized smob 1a2ed10>
<nikita1>In ice-9/boot-9.scm:
<nikita1> 710:2 5 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
<nikita1>In ice-9/eval.scm:
<nikita1> 619:8 4 (_ #(#(#<directory (guile-user) 135a1e0>)))
<nikita1>In ice-9/boot-9.scm:
<nikita1> 2309:4 3 (save-module-excursion _)
<nikita1> 3816:12 2 (_)
<nikita1>In artanis/server/ragnarok.scm:
<nikita1> 428:10 1 (establish-http-gateway _)
<nikita1>Exception thrown while printing backtrace:
<nikita1>ERROR: In procedure vector-ref: Value out of range: 156
<nikita1>artanis/server/ragnarok.scm:357:6: In procedure ragnarok-http-gateway-run:
<nikita1>artanis/server/ragnarok.scm:357:6: Throw to key `artanis-err' with args `(500 "BUG: There should be `http' protocol at least!")'.
<nikita1>uupss...
***vicenteH` is now known as vicenteH
<dsmith>Morning Greeting, Guileers
<wingo>heya dsmith
<dsmith>wingo: Yey! 2.2.1
<dsmith>wingo: Don't forget to update https://www.gnu.org/software/guile/download/
<wingo>good point
<wingo>fwiw i did update the web site news but with savannah borkage this morning i think it didn't take
<dsmith>wingo: Hmm. I'm also hitting bug#26570: GC_is_heap_ptr() dep for 2.2.1
<wingo>dsmith: i think i fixed in git
<dsmith>Cool
<amz3>io #guile
<joolean>Hi Guilers!
<Apteryx>Hi! What's the best way to combine two predicates for a filter?
<Apteryx>joolean: hi :)
<Apteryx>Maybe, compose?
<joolean>I’ve got an application that uses Guile and for which I’m attempting to put together a new release. I’d like to encourage people to build it against Guile 2.2, particularly because of the performance improvements; but my application is backwards compatible with Guile 2.0, and since 2.2’s not in widespread use yet, I want to make sure it still works as a “vanilla” build option. What’s the best way to support this from an Autotools / pkgconfig
<joolean>perspective?
<Apteryx>Like, (filter (compose pred1 pred2) my-list)
<amz3>Apteryx: that doesn't work, the output of pred2 is a boolean
<Apteryx>Hm.. nope that won't work. Rather maybe I should enclose the two preds in a lambda with an and on the two predicates.
<Apteryx>amz3: Right :)
<amz3>maybe and=> works
<amz3>wait and=> is something else entirely
<amz3> https://www.gnu.org/software/guile/manual/html_node/Higher_002dOrder-Functions.html#index-and_003d_003e
<amz3>joolean: I think you need a maybe monad ;)
<amz3>joolean: regarding packaging, personnaly i don't care, I just expect people to copy paste the files of my libraries in their project
<joolean>you do? Yikes
<joolean>well, my thing is a bit more complex
<joolean>I’m assuming I may have to write some m4 code to make this work
<amz3>lot of energy is required for that. Also, you don't need autotools to package guile modules to guix
<joolean>Indeed. But my thing is a C application that links with libguile.
<amz3>I meant to say pure guile modules
<amz3>then idk, sorry for the noise
<Apteryx>amz3: Yeah, it looks like and=> would not work too. I'll go with the brute approach (lambda + and between my two preds)
***wleslie is now known as _extremist
<civodul>wingo: how do we compare two syntax objects? 'equal?' no longer works
<civodul>which breaks gexps
<avoine>hey spk121, I'm trying to port Chez's ncurses based expression editor/REPL to Guile using guile-ncurses but I think I'll need bindings for ncurses/term.c for things like tputs: https://github.com/cisco/ChezScheme/blob/master/c/expeditor.c#L827
<avoine>spk121: or is there an other way to do that?
<spk121>avoine: let me look
***nikita2 is now known as nikita1
<spk121>avoine: Yeah, looks like I didn't include that, but writing one in pure scheme that you could include is straightforward for standard terminals. I can play with it later today, if you like.
<avoine>spk121: oh that would be really nice!
<avoine>spk121: I'm kind of confuse with what defines like #define cursor_left CUR Strings[14] means
<amz3`>io again!
<spk121>avoine: without digging to much, it is likely that they are getting the escape sequence that causes the cursor to move left without actually entering an ncurses mode
<avoine>ok
<spk121>avoine: for example, cursor_left probably just contains "^H"
<avoine>ah!
<amz3`>avoine: what does chez expr editor does?
<avoine>amz3`: it a repl
<avoine>with editor like feature
<amz3`>hmm
<avoine>like forward-sexp, marks, completion, string macro, etc
<avoine>auto-indentation
<amz3`>avoine: fwiw I made some bindings for termbox another TUI library https://github.com/amirouche/azul.scm/blob/master/termbox.scm
<daviid>ecraven: hello! it would be cool to rerun your benchmark when possible, using 2.2.1, I see you used 2.1.8 still ...
<ecraven>daviid: I'll try to run it today or tomorrow!
<avoine>amz3`: I'll check it up but since I'm doing a REPL I'm not sure it would fit
<daviid>ecraven: great! make sure to grab and compile the latest tarball then ...
<ecraven>I'm using the arch linux packages
<daviid>ecraven: it is not usefull unless you run the latest, imo
<daviid>i doudbt arch as 2.2.1
<ecraven>well, it does have guile-git :P
<ecraven>which is what I've been using for 2.1.8
<daviid>ecraven: what is guile-git?
<ecraven>the package
<daviid>but this has nothing to do with guile itself
<ecraven>it does, if I install package guile-git, then I'll have an executable guile-2.2, which I use to run the test
<daviid>ecraven: there is a guile-git package which is a binding to the libgit lib ... arch should rename that package really but anyway, what is the guile-git version then?
<ecraven>2.2.1.2.g02cf38514-1
<ecraven>though it directly pulls from git, so it is whatever git head is
<daviid>ecraven: ah ok, perfect then! thanks
<daviid>ecraven: we should help you with the output, using guile-charting and guile-cairo ... one day maybe :)
<ecraven>hehe, well, atm. it is just a very hackish mit-scheme script that generates some svg/html
<ecraven>I haven't had time to improve on it :-/
<ecraven>the benchmark script is a shell script, I've been planning to use scheme for that too
<daviid>ecraven: ok
<daviid>ecraven: let us know when new bench is uploaded, tx
<ecraven>will do
<jophish>hmm, how long can I expect to be compiling eval.go for?
<amz3`>jophish: 30minutes or longer
<OrangeShark>I wonder if we should change the name of our libgit2 bindings for git...
<amz3`>idk
<OrangeShark>since guile-git can also refer to a version of guile from a recent git checkout
<jophish>amz3`: gotcha, thanks
<amz3`>OrangeShark: you are right
<avoine>ACTION wonder why there is no named let*
<amz3`>OrangeShark: feel free to do what sound reasonable
<OrangeShark>okay amz3`
<OrangeShark>avoine: it suppose to be like the number of arguments for the named let are the variables
<avoine>OrangeShark: that make sense
<handsome_pirate>Y'all
<handsome_pirate>.libs/libguile_2.2_la-posix.o: In function `scm_tmpnam':
<handsome_pirate>/builddir/build/BUILD/guile-2.2.1/libguile/posix.c:1574: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
<handsome_pirate>If I were to create a patch for that, would there be interest?
<spk121>avoine: actually for any modern terminal (tputs string num callback) can be assumed to be (write string port)
<spk121>avoine: or rather (display string port)
<spk121>avoine: but here's one that includes the parser for the archaic terminfo delay escape sequence. It is a transliterated C parser so it is extra ugly. http://paste.lisp.org/+7E0D