IRC channel logs

2016-07-25.log

back to list of logs

<linas>so -- how might one send an exception to a thread?
<ijp>I don't think you can
<linas>.... when I hit ctrl-C in the guile interpreter, how does that interrupt a running block of code
<ijp>signals are handled specially afaik
<linas>Ah, so you figure ctrl-C is a signal?
<ijp>of course?
<linas>I dunno -- it depends on how the guile repl got written/designed
<ijp>afaik, the signal handler for C-c throws the usual exception
<ijp>anyway, you can set signal handlers from guile (info "(guile) Signals")
<linas>throws to where ... which thread?
<linas>I see there is a scm_sigaction_for_thread ...
<linas>I'm trying to avoid calling pthread_cancel to kill a thread ... I'm looking for the cleanest way to break some guile thread out of an inf loop.
<civodul>Hello Guilers!
<wingo>moin :)
<wingo>linas: i think you can register an async on a thread
<wingo>that's what signals do
<wingo>guile receives all signals on a dedicated thread and then registers an asynchronous interrupt on the thread to which the signal should go; something like that
<wingo>i guess we should roll a 2.0.13 for mingw's benefit
<wingo>also that compilation bug
<civodul>sure, why not
<civodul>dunno if mark_weaver had a chance to look at the deterministic compilation thing?
<wingo>i reckon we should wait until eli's patch stack is empty
<wingo>also i am going to be on holiday until next week fwiw
<wingo>some holidays later too, but that will slow down patch review etc
<civodul>same for me, holidays coming
<wingo>euroaugust
<wingo>ACTION just updated master to have all the recent patches against 2.0
<wingo>i didn't realize gnulib had a posix_spawn function; neat.
<ajh>hello. is there something like (with-output-to-string (lambda ()
<ajh>It doesn't work although the book teach yourself scheme in fixnum days says that system outputs to standard output. i also tried to get the outputvalue with getenv, but it seems that system is creating always a new environment.
<wingo>look for open-pipe
<wingo>in the manual
<wingo>ajh: ^
<ajh>wingo: kk thx
<ajh>wingo: works. thank you very much!
<wingo>yw :)
<dsmith-work>Monday Greetings, Guilers
<wingo>heyoo
<Sleep_Walker>o/
<Sleep_Walker> https://www.gnu.org/software/guile/manual/html_node/Symbol-Read-Syntax.html contains broken link 'Formal syntax' leading to https://www.gnu.org/software/guile/manual/r5rs/Formal-syntax.html#Formal-syntax
<linas>thank you wingo
<amz3`>o/
<koosha>Hello !
<paroneayea>wow
<paroneayea>MIT Scheme allows some interesting nested definition argument syntax that guile does not
<paroneayea>here's the K combinator:
<paroneayea>(define ((K x) y) x)
<koosha>I was searching for a guile programming envierment . For examble an ipython for python . Can you introduce one to me ?
<ijp>paroneayea: (use-modules (ice-9 curried-definitions))
<amz3`>koosha: you are looking for guile REPL
<amz3`>koosha: there is no other command REPL
<amz3`>koosha: what are you missing from guile REPL
<ijp>there is no repl but guile and geiser is one of its prophets
<amz3`>+1
<paroneayea>wowee, thank you ijp
<dsmith-work>koosha: Also, you can add readline support to the guile REPL
<amz3`>koosha: here is the content of my ~/.guile file http://dpaste.com/1GFT3BH
<dsmith-work>koosha: https://www.gnu.org/software/guile/manual/html_node/Readline-Support.html
<amz3`>you can use (help proc) to get some help
<paroneayea>hey when did guile get the new info manual look
<dsmith-work>paroneayea: Latest 2.0 release I think
<paroneayea>the html version... it looks much nicer now
<paroneayea>not bare-bones styling
<paroneayea>dsmith-work: ah, I wasn't talking about hte documentation structure just the styling, though I do like that about guile 2.X
<koosha>Oh , yes . Thank you all .
<dsmith-work>paroneayea: I did mean that I thought the style was updated about the same time as the latest 2.0 release
<koosha>That was exactly what I wanted . Thank you .
<dsmith-work>koosha: The guile REPL has a lot of helpful things that are probably similar to ipython. Like access to previously evaled expressions.
<dsmith-work>scheme@(guile-user)> (+ 1 2)
<dsmith-work>$1 = 3
<dsmith-work>scheme@(guile-user)> (* $1 4)
<dsmith-work>$2 = 12
<dsmith-work>for example
<koosha>dsmith-work: Right . interesting .
<koosha>What name should I putt on my guile configuration file in .guile ?
<amz3`>koosha: I don't understand
<dsmith-work>koosha: That *is* the name of the file
<koosha>dsmith-work: So , ~/.guile/guile ?
<koosha>I get error with that .
<ijp>just .guile
<ijp>no directory
<dsmith-work>.guile is the file. It's not a dir
<koosha>Oh , got it .
<koosha>Thank you .
<dsmith-work>np
<koosha>I wrote (cons 1 null) but I got an error .
<amz3`>try #nil instead of null
<koosha>amz3`: Right . Why can't I use null ? I saw in a video that null was used in Scheme .
<amz3`>no
<dsmith-work>koosha: It's spelled '() in Scheme
<koosha>dsmith-work: Right .
<koosha>So why doesn't null work ?
<dsmith-work>koosha: Because there is nothing with that name
<koosha>dsmith-work: I saw it here : https://www.youtube.com/watch?v=Qqext1NwmqM&list=PLgyU3jNA6VjRMB-LXXR9ZWcU3-GCzJPm0&index=2
<davexunit>there's no 'null' in guile
<davexunit>the person that made that video wasn't using guile
<dsmith-work>An alternative spelling is (list) though probably has more overhead than '()
<koosha>davexunit: Right .
<davexunit>dsmith-work: yeah (list) will construct a new list
<davexunit>(unless the compiler decides not to, I guess ;)
<dsmith-work>davexunit: Except for the '() at the end.
<davexunit>either way, (list) is not eq? '()
<dsmith-work>scheme@(guile-user)> (eq? (list) '())
<dsmith-work>$2 = #t
<davexunit>hah
<davexunit>I questioned what I said as soon as I typed it
<davexunit>but you beat me to the REPL
<dsmith-work>heh
<davexunit>makes sense
<koosha>But he was teaching Scheme in the video . Isn't guile an implemention of Scheme ?
<davexunit>(cond ((null? stuff) '()) ...)
<davexunit>koosha: there are many schemes, each supporting different things.
<dsmith-work>Note that null? is a differn't thing than null
<koosha>davexunit: Got it . Thanks .
<dsmith-work>The ? is part of the name
<davexunit>koosha: there are standards, but it's best to think of Scheme as a family of related, but *different*, languages.
<davexunit>I didn't watch that video, but maybe the author did something like (define null '()) for the sake of teaching
<davexunit>or maybe another Scheme implementation does that by default
<ijp>dsmith-work: no extra overhead
<koosha>davexunit: Right
<ijp>well,
<ijp>well, I suppose there could be, since we can't guarantee list is bound to the list procedure in a module
<paroneayea>there's some kind of bug with emacs' syntax highlighting for #| comment |#
<paroneayea>where it goofs up if you have certain things, I think ;
<davexunit>yeah
<paroneayea>makes it hard to read gjs' files
<davexunit>gets all fucked up in geiser repls
<paroneayea>ACTION did a `wget -r https://groups.csail.mit.edu/mac/users/gjs/6.945/'
<amz3`>what is it?
<paroneayea>amz3`: sussman's advanced glass on symbolic computation
<paroneayea>includes all sorts of fascinating things, especially in the problem sets
<amz3`>hmm... sound fun
<paroneayea>implementing diffe-hellman, studying combinators and applying them to build better regexps (in the style of irregex), SKI combinators and building a lambda->SKI combinator mini-compiler, and the propagators system, which I'm currently very interested in
<paroneayea>the propagators system is the root of my interest in this presently
<paroneayea>I've been thinking about how to apply it to a "filter the firehose" stuff for both email and stuff like activitypub (the federation standard stuff I'm working on)
<paroneayea>of course, thinking != doing :)
<paroneayea>but I'm trying to read up
<paroneayea>amz3`: oh, unrelated, but I was thinking about it earlier
<paroneayea>you mentioned your search engine is or at least can be powered by minikanren right?
<paroneayea>amz3`: how do you deal with the combinatorial explosion problem?
<amz3`>it was... yes. It was only a query language on top of a list of tuple (tuple space). To avoid combinatorial explosion, they are a reverse index
<amz3`>basically, you never iterate over the whole database if you write the correct query
<paroneayea>ok
<amz3`>but anyway, i dropped it, because it's not really handy, I need a better abstraction
<paroneayea>good if you can do "correct" queries... "incorrect" queries in any logic programming system seem to lead to search that goes unpredictably wild
<paroneayea>seems hard to figure out which ones are going to be "incorrect" from the outset, too :)
<amz3`>hmm... I never hit the incorrect query case
<amz3`>not sure why
<amz3`>yes, it can, but you need a big database for the explosion to be significant
<amz3`>also, the queries were simple
<amz3`>paroneayea: you know SPARQL, how the queries look in SPARQL?
<amz3`>actually it's possible to explain in SLQ
<amz3`>SQL
<amz3`>it's equivalent to, SELECT * FROM A = B, C = D...
<amz3`>expect you can traverse foreign keys
<amz3`>so
<paroneayea>amz3`: yes it's probably possible for things to be reasonable :)
<amz3`>SELECT * FROM A.id = 123 AND A.fk = B.id
<paroneayea>yeah if you keep it appropriately constrained
<paroneayea>anyway yeah it's also possible to create crazy queries in SQL too... I guess you don't expose that stuff to users
<paroneayea>amz3`: btw I've worked with SPARQL but I'm not good at it :)
<amz3`>actually: SELECT B FROM A.id = 123 AND A.fk = B.id
<paroneayea>yes, that's quite constrained
<amz3`>yep
<paroneayea>amz3`: ok! thanks for the answer
<amz3`>yw!
<zv_>is there any way for a inner sexp macro to escape prior to it's parent macro?
<zv_>i.e to make (include (string-append base "/dir/file"))?
<dsmith-work>zv_: Well, the whole point of a macro is that it gets it's armument(s) unevaulated. Could be any syntax at all.
<zv_>dsmith-work: yeah
***zv_ is now known as zv
<ijp>there are tricks to do it, but it gets weird with phasing
<linas>so I just noticed -- there does not seem to be any scm_lambda call ... !?
<dsmith-work>ijp: Does guile do that phasing stuff?