IRC channel logs

2017-02-08.log

back to list of logs

<daviid>lloda`: i just pulled, but I don't see your 'truncated-print for exceptions' patch in the git logs, so you did not push tht one yet?
<daviid>lloda`: for info, the latest master, 93cbaef1345d1ba09c584bbeac6acd4580b23d73, does not get things better wrt f32vectors, here is an example that kills my emacs:
<daviid>scheme@(guile-user)> ,use (cv)
<daviid>scheme@(guile-user)> (im-load "gnu.png")
<daviid>$2 = (148 125 4 (#f32(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 # …) …))
<daviid>scheme@(guile-user)> (error "blah!" $2)
<daviid>tough ,bt on some code that raised an exception does work fine (I guess ,bt calls repl-print, just don't know much about this part of guile actually
<daviid>here is such a ,bt [11 lines, please forgive me for the copy paste here!]
<daviid>scheme@(guile-user)> (normalize-2 $2)
<daviid><unnamed port>:141:19: <unnamed port>:141:19: In procedure module-lookup: Unbound variable: normalize-channel-21
<daviid>Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
<daviid>scheme@(guile-user) [1]> ,bt
<daviid>In current input:
<daviid> 141:14 2 (normalize-2 _)
<daviid>In srfi/srfi-1.scm:
<daviid> 592:17 1 (map1 (#f32(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 …) …))
<daviid>In current input:
<daviid> 141:19 0 (_ _)
<daviid>lloda`: could you help to fix the (error "blah!" <a big f32vector...>?
<Apteryx>Hello! Could someone recommend how I can form a list of elements using conditionals, without inserting #undefined or empty lists in the process? E.g., (cons* (if #f 2 '()) "another" '(3 4)) returns (() "another" 3 4) but what I want is ("another" 3 4).
<Apteryx>I guess I could leave the #undefined values and then filter the list... but it doesn't seem very elegant.
<Apteryx>Best I've found so far: leave the '() for the falsy conds, and then use: (remove null? (list (if #f 2 '()) "another" 3 4))
<spk121>Apteryx: what about something like (append (if #f '(1) '()) '(2 3 4))
<wingo>garrr, found some threadsafe ports problems
<lloda`>wingo: will push a last patch on truncated-print if there's no objection https://lists.gnu.org/archive/html/guile-devel/2017-02/msg00021.html. This is more invasive since I needed to pull out a piece of the array print function into Scheme.
<wingo>i am fine moving more things to scheme but i don't think making a new publically exposed function is a good idea
<wingo>unless it's designed and supported anyway. there are ways to expose c to scheme in ways that don't increase our api surface area
<wingo>and there are ways to just make c call out to scheme
<wingo>i think it's reasonable to move the array printer to scheme fwiw, via a new (ice-9 arrays) module or something. having a specific arrays module would also allow you to load-extension within the modules to load whatever helpers you need
<wingo>dunno
<lloda`>yeah, I agree that more public functions isn't the best idea. I'll see how to move the array printer to Scheme then and call it from C then.
<lloda`>sneek: later tell daviid truncated-print already handled bytevectors before, the patches fix other stuff.
<sneek>Got it.
<lloda`>sneek: later tell daviid the exception printers don't use repl-print, you need to patch boot-9.scm to give you a way to replace format.
<sneek>Got it.
<lloda`>sneek: later tell daviid That patch is hacky and I didn't push it to master, but I've put it in another branch http://git.savannah.gnu.org/gitweb/?p=guile.git;a=shortlog;h=refs/heads/wip-exception-truncate
<sneek>Got it.
<lloda`>sneek: later tell daviid you also need the code in http://paste.lisp.org/+797X (I put it in my ~/.guile)
<sneek>Okay.
<lloda`>sneek: later tell daviid let me know if it doesn't work
<sneek>Will do.
<lloda`>sneek: botsnack
<sneek>:)
***darthlukan_ is now known as darthlukan
***Fuuzetsu_ is now known as Fuuzetsu
<paroneayea>hi, *
***micro`_ is now known as micro_
<wingo>ACTION has nice guile and fibers bugfixes coming
<dsmith-work>Wednesday Greetings, Guilers
<janneke>hi!
<daviid>hello guilers!
<sneek>daviid, you have 5 messages.
<sneek>daviid, lloda` says: truncated-print already handled bytevectors before, the patches fix other stuff.
<sneek>daviid, lloda` says: the exception printers don't use repl-print, you need to patch boot-9.scm to give you a way to replace format.
<sneek>daviid, lloda` says: That patch is hacky and I didn't push it to master, but I've put it in another branch http://git.savannah.gnu.org/gitweb/?p=guile.git;a=shortlog;h=refs/heads/wip-exception-truncate
<sneek>daviid, lloda` says: you also need the code in http://paste.lisp.org/+797X (I put it in my ~/.guile)
<sneek>daviid, lloda` says: let me know if it doesn't work
<dsmith-work>wingo: What is a TOCTTOU bug ?
<daviid>lloda`: ok thanks! will look at this and try...
<dsmith-work>Hmm prob this https://en.wikipedia.org/wiki/Time_of_check_to_time_of_use
<wingo>yes that
<ruste>Not sure if there's a better channel for this, but I have a question about CPS conversion.
<ruste>In particular, CPS conversion of lambda forms in an intermediate language with functions of one argument.
<dsmith-work>ruste: Better just ask than ask to ask...
<ruste>So here's the deal. I want to cps convert something of the form (lambda (var) body).
<ruste>A lambda term with one variable.
<ruste>For example I'll use (lambda (x) x)
<ruste>Traditionally (cps '(lambda (x) x)) -> '(lambda (k x) (k x))
<ruste>Which is fine, but my intermediary language only has lambda terms with one variable.
<ruste>My instinct is to curry this and I get something like (cps '(lambda (x) x)) -> '(lambda (k) (lambda (x) (k x)))
<ruste>The problem is that this statement has a function return which is kind of what I'm trying to avoid.
<ruste>I can deal with it, it just feels wrong.
<ruste>What's the right way to do this?
<janneke>ruste: your question is interesting
<janneke>i changed mes's scheme interpreter into CPS two months ago
<janneke>i'm not using an intermediate language and would like to learn more about that
<ruste>janneke, I'm trying to write a scheme->lua compiler for kicks.
<ruste>I started in the middle with a language containing only lambda, set!, if, and quote.
<ruste>Hopefully easy to reason about.
<janneke>sounds real fun!
<ruste>mes looks ambitious. r6rs is a big standard. I'm only aiming for r7rs.
<ruste>Looks cool!
<janneke>ruste: thanks...i should reword the r6rs bit, being complete/complient is not at all a target for mes
<ruste>Did you write your own garbage collector?
<janneke>i'm only stating that because of some specific r6rs-like bits such as syntax-case that are currently mandatory
<janneke>ruste: yes, a variant on SICP's stop-and-copy
<ruste>That's something I'm avoiding by compiling to lua that simultaneously intrigues and terrifies me.
<ruste>I should really read SICP.
<janneke>ruste: it's about 80 lines of C, fairly trivial but also not too performant -- not
<ruste>I never get passed the "here's how to program in scheme bit," because I get bored.
<janneke>:-) i only dared to look at GC when i really had to
<ruste>janneke, I'm doing everything I can not to have to.
<janneke>my C compiler in schee was CONSing in 5min through all my 16gigs...
<janneke>*scheme
<wedesoft>Waiting for the Guile FOSDEM 2017 videos to switch to "done" https://review.video.fosdem.org/overview http://video.fosdem.org/2017/K.4.601/