IRC channel logs

2016-01-26.log

back to list of logs

<silmakuoppanen>Is there any way to pretty-print sxml?
<paroneayea>silmakuoppanen: yes, the standard pretty-printer should do just fine!
<paroneayea>one advantage of using lisp'y datastructures :)
<silmakuoppanen>paroneayea, oh, n, I mean ehh, t pretty print the XHTML output
<silmakuoppanen>As in the "normal" one as a string
<paroneayea>silmakuoppanen: ah, I'm not sure of that
<paroneayea>silmakuoppanen: you might need an external pretty printer for that...
<wingo>moin
<wingo>i wonder if we could get out a 2.1.2 this week
<ArneBab_>moin
<ArneBab_>that would be cool!
<peterbrett_work>If you get a 2.1.2 out this week, I will attempt to compile it for Windows and report back on whether I succeeded.
<peterbrett_work>I need something to do on the plane to Brussels
<civodul>wingo: that'd be awesome!
<wingo>i'd want to get all the strange makefile stuff done
<peterbrett_work>I was thinking about cross builds
<peterbrett_work>If cross builds could use the precompiled compiler .go objects in the source distribution
<peterbrett_work>It would make cross builds reasonably fast
<peterbrett_work>I don't know how practical that is
<peterbrett_work>Automake doesn't manage the distinction between host and build objects very well
<wingo>i think we would add prebuilt/$host_cpu/ to the GUILE_LOAD_COMPILED_PATH
<peterbrett_work>Does that work? Surely it assumes compatible ABI (e.g. LP64 vs LLP64)
<wingo>and make sure to generate prebuilt/{x86_64,i386,...}
<wingo>hum, good question.
<peterbrett_work>mark_weaver said the other day that he looked into it
<peterbrett_work>And the problem is that GMP's API is all expressed in terms of "long"
<wingo>my initial idea was to use prebuilt/{64,32}-{little,big} because that's the real difference for .go files i think
<wingo>but then i thought, well, why not use host triples...
<peterbrett_work>Host triples would actually work well, I think
<wingo>that way the makefiles will work just as well when we do native compilation
<wingo>trouble is just choosing the right set of triples
<wingo>so that we cover the hosts we're interested in
<rntz>hm. add-to-load-path appears to (a) not check whether a path is already in %load-path and (b) add the given path *twice*
<peterbrett_work>Even starting with i686-linux-gnu and x86_64-linux-gnu would cover most Guile users
<peterbrett_work>Crazy people like me can just continue to harm the environment I guess ;-)
<rntz>can anyone check whether their guile's add-to-load-path also has these bugs?this seems so extraordinary that I have to assume I've fucked up somehow
<peterbrett_work>rntz: What version are you using?
<rntz>2.0.11
<peterbrett_work>rntz: I can duplicate the bug
<rntz>huh, ok
<wingo>rntz: i think it might actually do it twice :/ the reason is, it does it once at expand-time and once at compile-time
<peterbrett_work>It adds each path element twice
<wingo>er
<wingo>s/compile/run/
<rntz>wingo: hm. ok, so if it checked whether it was already there, presumably this would fix the add-it-twice behavior?
<rntz>(it would add it at expand-time, then at run-time it would notice it was already there and not do anything?)
<wingo>rntz: yes, but keep in mind that order is important in that list -- the current behavior is wasteful but failing to ensure it's the first element would be a bug
<wingo>run-time might be in a different process
<rntz>ah, I see
<peterbrett_work>rntz: I don't think that would be correct — you might want to add a path that's already in the list to the front of the list in order to… wingo ^^
<wingo>you will see the double-adding only if you expand and run in the same process
<peterbrett_work>wingo: Like in the repl for example
<wingo>yep
<peterbrett_work>I feel like it's a bug
<peterbrett_work>But I can't work out what sane behaviour would look like
<rntz>well, I think 'correct' behavior would be "if already present, move to front; otherwise, add to front"
<rntz>but an even simpler partial fix would be "if thing being added is the car of the %load-path, don't add it again"
<peterbrett_work>Hmm. But (begin (add-to-load-path "/path/a") (add-to-load-path "/path/b")) would still be surprising
<rntz>ah, with the partial fix? yeah.
<wingo>i would punt for now :) it's ugly but not buggy
<davexunit>well, this is interesting: https://github.com/drforr/perl6-Inline-Guile
<davexunit>a Perl 6 library for including inline Guile Scheme code.
<civodul>ouch!
<davexunit>pretty funny!
<davexunit>also, someone posted this to r/guile http://pasoev.github.io/words
<davexunit>"guile-words - Vocabulary for Scheme and C programs"
<civodul>sounds like WordNet, pretty cool
<paroneayea>sad about minsky's passing
<paroneayea>ACTION feels that generation 0 of hackers are leaving the world stage :(
<davexunit>it's interesting to be part of a field so young that you get to see the earliest pioneers.
<peterbrett_work>mark_weaver: Thanks for the patch — I'll try it out later and get back to you
<nalaginrut>paroneayea: yes, I feel so this morning when I saw the news
<artyom-poptsov>Hello everybody
<davexunit>hello!
<artyom-poptsov>Just saw the news about Marvin Minsky. Very sad.
<artyom-poptsov>Although he was an Alcor member and a proponent of cryonics, there's a hope that he was cryopreserved.
<mark_weaver>peterbrett_work: actually, I realized that a few more changes are needed. please wait for version 2 of the patch :)
<mark_weaver>(shouldn't be long)
<peterbrett_work>mark_weaver: It'll be 2-3 hours before I can even begin setting up a suitable build env
<peterbrett_work>So don't rush :)
<mark_weaver>okay
<mark_weaver>I didn't know that Marvin Minsky was an Alcor member. I knew another Alcor member who is now cryopreserved: Hal Finney, who I knew from PGP Inc, where we were both early employees. (the last time I worked on non-free software)
<artyom-poptsov>mark_weaver: http://www.alcor.org/AboutAlcor/meetsciadvboard.html#minsky
<mark_weaver>Gerald Jay Sussman was Marvin Minsky's doctoral student.
<mark_weaver>there's a little story about Sussman and Minsky here: https://en.wikipedia.org/wiki/Marvin_Minsky#Personal_life_and_death
<davexunit>mark_weaver: I love that koan.
<nalaginrut_>mark_weaver: sounds like a Zen story ;-)
<csed>Wasn't Minsky the guy who did AI with McCarthy?
<csed>And then they sort of diverged, at some point.
***nalaginrut_ is now known as nalaginrut
<csed>Yeah, he is.
<scheme_beginner>Hello everyone. I'm currently willing to learn Scheme. However I only have r7rs (small) as material for learning. Could you please tell me if Guile supports r7rs??
<mark_weaver>scheme_beginner: there's a branch of our git repository that has R7RS support, but it's not yet merged into the master branch.
<mark_weaver>you would have to build it from source code to use it, and even then it's a bit inconvenient to get the REPL into that mode.
<mark_weaver>sorry
<mark_weaver>for now, we support R5RS, most of R6RS, and many SRFIs and extensions.
<mark_weaver>scheme_beginner: I guess for now you'd be better of playing with chibi-scheme
<mark_weaver>*better off
<mark_weaver>taylan: fwiw, I've decided that Guile should support R7RS
<taylan>mark_weaver: neat :)
<taylan>I have some patches lying around for R7RS too. IIRC we wanted to rebase the r7rs branch on master?
<mark_weaver>yeah, I think so
<mark_weaver>well, I suppose most of it could go into stable-2.0 as well, but not the support in 'write' to print circular/shared structure.
<mark_weaver>hacking that into stable-2.0 without changing the ABI was too gross
<Malopolski-Zubr>How to make test-2 work like test-1 without defmacro? http://pastebin.com/MKhwDTZ5
<Malopolski-Zubr>Where is defmacro definition? geiser-edit-symbol-at-point doesnt find it
<mark_weaver>Malopolski-Zubr: well, first, let me point out that you can write that macro simply as (define-syntax-rule (test-1 var value expr) (let ((var value)) expr))
<mark_weaver>the 'with-syntax' and 'datum->syntax' would only cause hygiene to be lost.
<mark_weaver>but the problem with your test-2 is that 'var-name' is a pattern variable, and pattern variables are only accessible with 'syntax' forms, which is normally written with the #' abbreviation
<mark_weaver>what are you trying to do?
<Malopolski-Zubr>Rewrite test-1 without defmacro. I thought hygiene doesn't allow for passing variable name
<mark_weaver>sure it does
<mark_weaver>defmacro is defined in ice-9/boot-9.scm
<Malopolski-Zubr>I see now
<Malopolski-Zubr>Thanks
<mark_weaver>you're welcome!
<mark_weaver>writing 'test-1' using syntax-case would look like this: (define-syntax test-1 (lambda (x) (syntax-case x () ((_ var value expr) #'(let ((var value)) expr)))))
<mark_weaver>and that's hygienic
<mark_weaver>the pattern variables 'var', 'value', and 'expr' are accessible there because they occur with a 'syntax' form. note that #'foo is an abbreviation for (syntax foo), similarly to 'foo being an abbreviation for (quote foo)
<mark_weaver>Malopolski-Zubr: ^^ fyi
<Malopolski-Zubr>I started from wrong assumption. I get it now. Thank you))
<mark_weaver>glad to help
<mark_weaver>s/occur with a 'syntax' form/occur within a 'syntax' form/
<scheme_beginner>@mark_weaver thanks for the information!
<mark_weaver>np!
<scheme_beginner>@mark_weaver a final question. I researched a bit for r7rs implementations and I found chibi scheme but also picrin scheme. Would you recommend chibi over pincrin? :)
<mark_weaver>scheme_beginner: I've never heard of pincrin, so I have no idea.
<scheme_beginner>I see :( np, I'll use chibi then, thanks a lot!
<mark_weaver>you're welcome!
<mark_weaver>guile will roll out support for R7RS at some point, maybe even the next release, so feel free to check in again in a month or two :)
<scheme_beginner>I will!
<taylan>scheme_beginner: I can vouch for Chibi, out of simplicity. other fairly complete R7RS implementations at the moment are Kawa, Gauche, and Larceny.
<taylan>Kawa runs on the Java VM. Gauche is for general-purpose programming on Unix-like systems AFAIK. Larceny is more of a research platform AFAIK.
<scheme_beginner>Yeah, I found them but even though the Github sites of Larceny and Gauche seem to be active, their websites have several months without updates or releases. I also found Kawa, but on the gnu page it says it's an extension of Scheme. Does that mean I can limit Kawa to use only r7rs features without problem?
<taylan>scheme_beginner: when importing an R7RS module, it will at least be compatible. I'm not sure if it actively limits itself to R7RS only and raises errors when one uses features not defined in R7RS though.
<scheme_beginner>I see. But which would you tell is more mature, Kawa or Chibi?
<mark_weaver>scheme_beginner: Kawa had to make some compromises in order to run on the Java Virtual Machine, most notably that it doesn't support proper tail calls by default in the general case.
<mark_weaver>if you want to focus on R7RS specifically, chibi has the benefit of being mostly (entirely?) limited to R7RS.
<taylan>Chibi has extensions to R7RS too
<mark_weaver>okay
<scheme_beginner>I see
<taylan>Kawa is older and I think it has a couple more users than Chibi. when I first tried out Chibi I was met with a few silly bugs. then again they were trivial and fixed very quickly by the author (Alex Shinn, AKA foof) when I reported them... I couldn't say one is definitely more mature.
<taylan>I only have fairly basic experience with both anyway
<scheme_beginner>I understand. I guess I'll give Chibi a try. Thanks to both of you, @mark_weaver and @taylan
<mark_weaver>scheme_beginner: happy hacking!
<taylan>happy to help :)
<scheme_beginner>By the way, a last question. Is it possible to go through SICP using an r7rs implementation?
<paroneayea>scheme_beginner: mostly yes, for any rnrs
<paroneayea>the main thing you need to know
<paroneayea>is that true -> #t and false -> #f
<paroneayea>most other things were the same in my experience
<paroneayea>granted that was for guile which is more r5/r6rs
<OrangeShark>they also use nil in the beginning until they introduce '()
<paroneayea>scheme_beginner: but I think the community yhasn't broken much else backwards-wise other than that
<paroneayea>ah yeah nil is #nil, but much better, use '()
<paroneayea>pretty much everything else works out of the box though.
<scheme_beginner>I see. So now the new symbols are #t #f and #nil? :O
<paroneayea>scheme_beginner: yup
<OrangeShark>r7rs also has #true and #false if I recall correctly
<paroneayea>OrangeShark: really? weird...