IRC channel logs

2014-09-02.log

back to list of logs

<nalaginrut>morning guilers~
<nalaginrut>I'm glad to see 80 people around here everyday
<nalaginrut>increased 20 than before
<civodul>Hello Guilers!
***lloda`` is now known as lloda
<taylanub>hello :)
<taylanub>question: ISTR reading something like Tree-IL getting retired. or was that GLIL?
***DrMeredithMcKay is now known as trifling_gnome
<nalaginrut>I think it's GLIL
<civodul>yes
<taylanub>ok. I see GLIL is already out of the master branch's manual. though it also seems to suggest that Tree-IL might get phased out in the future, with the optimizations on it being ported to CPS and noting the possibility of a language being translated to CPS directly
<nalaginrut>I don't think drop Tree-IL is a good idea, although it could be so, it means all the front-end has to be rewritten
<ArneBab>wingo: just read your blog: Thank you for taking up the fight for rules of conduct at GHM!
*ArneBab was in spain during GHM: summer family vacation.
<nalaginrut>keep Tree-IL is a good way to compatible with the old code without any losing, IMO
<wingo>tx
<sneek>Welcome back wingo, you have 2 messages.
<sneek>wingo, mark_weaver says: does this look right to you? I'd expect it to return 1. http://sprunge.us/BNNP (example code by taylanub)
<sneek>wingo, mark_weaver says: here's the bug report: http://bugs.gnu.org/18356
<nalaginrut>s/to/to be
<nalaginrut>ArneBab: well, I just realized what happened, I'm confused when wingo tweet first time
<civodul>you may get an inaccurate idea by just reading wingo's tweets + blog
<civodul>this is not the fight of one person against everyone else
<wingo>i didn't realize it that it could have been misread in that particular way
<nalaginrut>no, I didn't misread, I just confused the connection between this issue and GHM, but it's clear after I read some post
<nalaginrut>after all, there're only 140 chars in a tweet, so...
<nalaginrut>anyway, I don't want to mention this issue again, but I think you're brave to give the attitude, wingo
<sbidin>Is this about http://wingolog.org/archives/2014/08/18/on-gnu-and-on-hackers ? (I'm new to all this stuff.)
<sbidin>Also, sorry for maybe being offtopic, I'm not sure which rules apply in #guile.
<taylanub>sbidin: seems so
<taylanub>sad to hear there's a misogyny problem in the larger GNU community. I wish the entire thing were as sane and nice as, say, #emacs
<civodul>taylanub: you're extrapolating here
<taylanub>ok. maybe I should go to a GHM myself one day
<nalaginrut>me too
<ijp>#emacs is sane and nice?
<taylanub>ijp: why not?
<taylanub>I guess the "sane" part might depend on one's definition, and the place might occasionally be offensive for e.g. a religious fundamentalist... :P
<ArneBab>civodul: I did not mean it as a fight of a single person.
<ArneBab>I was really happy to see how the issue was handdled here and in #guix a few month ago - brought up, everyone agreed that it was sensible, done.
<ArneBab>There is a general problem in the hacker community. Do you remember asher wolf, founder of the cryptoparties, on “dear hacker community, we have to talk”?
<ArneBab>her website is offline nowadays, but some mirrors remain.
<ArneBab> http://inewp.com/dear-hacker-community-we-need-to-talk/
<ArneBab>So I’m happy that at the GHM the issue was brought up, and though it sparked discussion and some disagreement (judging from the post of wingo), it was handled pretty well.
<ArneBab>wingo: and now I’m off to reading your post on CSE with CPS which already sounds very interesting.
<wingo>hehe
<wingo>in the meantime i wrote up something on luajit (!)
<wingo> http://wingolog.org/archives/2014/09/02/high-performance-packet-filtering-with-pflua
<wingo>trace compilation sounds great for other people to use ;-)
<taylanub>wingo: is it conceivable that Tree-IL will be deprecated in favor of direct source->CPS translation, or will it be kept as a convenience layer for language-frontends even if all optimizations are pushed to the CPS pass?
<wingo>taylanub: tree-il is here to stay i think
<taylanub>ok :)
<ArneBab>wingo: nice
<ArneBab>I have a question on parsing scheme code trees: If I have code in standard lists (a b c), but instead of having real improper lists, I have lists with escaped . like (a b #{.}# c), is there a simple way so turn these into improper lists? (so (pair? il) is true, but (list? il) is false)
<ArneBab>I get these strange lists, because I wrote a new wisp parser, which uses (read). Since it cannot just add a paren and run read (it would not know where to stop read), I get these strange lists instead.
<wingo>guile's reader isn't very extensible; the best solution is to write your own, but that's not a great solution :)
<sbidin>A question: both improper and proper lists evaluate to the same value, correct? The difference is only in the way they are represented in code?
<taylanub>no, their structure is different. a proper list is e.g. (foo . (bar . (baz . ()))), an improper one (foo . (bar . baz))
<taylanub>proper lists end in the "empty list" aka "null" object whose external representation is (). (in code this needs to be quoted according to the standard: '())
<taylanub>(in case it appears standalone that is; '(foo . ()) is fine too because the whole thing is quoted)
<sbidin>taylanub: Thanks!
<ArneBab>I found kind of a solution to the improper lists: Adding a second pass, which recursively checks all lists whether they should be improper (member (read ".") list) and then conses their members one by one on their last member.
<ArneBab>but I wondered whether there is a better way to do that.
<ArneBab>something like (list->pair li)
<taylanub>be wary of (foo . bar baz) which needs be a syntax error
<ArneBab>ah, so I always have to test the second last item
<ArneBab>taylanub: thanks for the warning!
<ArneBab>that’s the one thing I’m still missing to have a full-blown read-using wisp-reader.
<ArneBab>in less than 400 LOC (down from about 700 for the string-assembling reader)
<ArneBab>and once I implement the recreation of improper lists, it should be guaranteed to be correct as long as (read) is correct.
<ArneBab>(that’s a big difference to the old parser)
<ArneBab>on the other hand, it is scheme-only and cannot create *nice* scheme files from wisp.
<ArneBab>(it throws away comments and empty lines)
<nalaginrut>hmm, I didn't read the top-half, but seems you encountered problems when parsing wisp?
<ArneBab>with the old parser, there are some strange corner-cases where it stumbles.
<ArneBab>but the reason for implementing a new parser is that I want to have a nice reference implementation for the SRFI.
<ArneBab>If you’re interested in how it looks: http://draketo.de/proj/wisp/wisp-scheme.html
<ArneBab>(it’s naturally written in wisp)
<ArneBab>and it can already parse and eval itself.
*taylanub still wishes we would spread the word about how amazing Paredit is, how beneficial sexpr syntax also otherwise is, and that getting used to it isn't as difficult as it's made out to be, instead of inventing even more unconventional syntaxes than there are... sorry for being a downer :)
<ArneBab>I understand your wish, but my experience is simply very different.
<ArneBab>for example in the little schemer sexps seem very easy, until the expressions become a bit larger (to the end of the book). Then they become confusing.
<sbidin>Would things like paredit not be applicable to wisp as well? Haskell's structured mode is also getting better, and Haskell also uses whitespace.
<ArneBab>sbidin: I’m pretty sure that writing paredit for wisp should be possible. It’s just not yet done ☺
<ArneBab>in essence wisp syntax is just as simple as sexps, just with different paren-symbols ☺
<ArneBab>the main goal is to be able to leave out parens where they can be inferred from indentation.
<taylanub>the thing is, when you have the procedure call "+ 1 2" and the cursor is in front of +, there is no one "sexpr after cursor" that you can operate on, but two
<taylanub>namely the `+' and the `(+ 1 2)'
<ArneBab>the first will always be either a symbol or a full sexp. So it would have “sexp after cursor” and “symbol after cursor”
<taylanub>well sexp after cursor is ambiguous in e.g. "(foo bar) x y". I suppose it would be "immediate sexp" and "full sexp"?
<ArneBab>something like that, yes
<taylanub>it might work, though it might be difficult to tell where it ends... anyway, dunno, maybe it's possible to make a non-sexpr paredit that only duplicates the sexpr operations, which might be acceptable...
<taylanub>ArneBab: BTW how often do/did you edit sexpr code?
<taylanub>it could be that the learning curve is steeper so it just takes a little longer to get used to the syntax but doesn't matter anymore afterwards. IMO that would be an acceptable price to pay for other benefits of sexprs or simply sticking to the established convention
<ArneBab>overall likely 30-40 hours (adjusting my emacs)
<ArneBab>the following would be legal wisp syntax: "(lambda (x y) (+ x y)) 1 2"
<ArneBab>and the reason why I deem wisp useful is that sexp is hard for newcomers and first impressions count.
<ArneBab>sexp-syntax
<ArneBab>I think the number of parens is one of the prime reasons why lisp-like languages aren’t mainstream.
<taylanub>nah, look at JS
<ArneBab>(and javascript is no counter-example: People use it because it is the only way to really write for the web)
<taylanub>do people ever complain about parens in JS though? (except Lisp fans who poke fun at it)
<ArneBab>the one counter-example might be clojure - but then, it’s used by people used to java ☺
<ArneBab>taylanub: people complain a lot about JS in general - there are actual Python-implementations in Javascript to be able to program the web without JS.
<taylanub>is it due to parens though?
<ArneBab>and then it has no prefix-parens
<ArneBab>I don’t know whether it’s due to parens.
<ArneBab>so I think I need to refine my statement about parens: One of the main problems is that in lisp-like languages the paren starts the line.
<ArneBab>(write 1) instead of write(1)
<ArneBab>due to that natural way of reading the expression sees the same character as first character in every line.
<nalaginrut>I've heard people complains curly-braces of JS, many times
<nalaginrut>but when people hear Lisp/Scheme, they united to complain parens
<ArneBab>taylanub: for an example see slide 3 and 4 in http://draketo.de/proj/wisp/why-wisp.html
<ArneBab>and slide 5
<nalaginrut>ArneBab: back to the topic, what's problem in your parsing ;-)
<ArneBab>I have to call (read) on each single symbol in a line, because I can only know where a sexp ends after parsing each symbol.
<ArneBab>(due to linebreaks in strings and so on)
<ArneBab>so "a . b" gives (a #{.}# b) instead of (a . b)
<ArneBab>and I have to turn it to (a . b)
<nalaginrut>so it's specified problem of Guile implementation?
<ArneBab>no
<ArneBab>(read ".") should return something (else I’ll have to special case)
<nalaginrut>hmm...how can you avoid #{.}# in Guile?
<ArneBab>to be exact, I have to turn (list 'a (call-with-input-string "." read) 'b) into '(a . b)
<nalaginrut>well, seems 'match' could do that
<ArneBab>that would be pretty cool!
<ArneBab>my notes for implementing this involve lots of car-ing on reversed lists…
<ArneBab>(it has to work for any kind of list, not only simple ones)
<nalaginrut> ((a #{.}# b) `(,a . ,b))
<nalaginrut>for generic purpose, maybe you have to write bunch of rules to cover
<nalaginrut>and a recursive way, I guess
<ArneBab>(define dot (call-with-input-string "." read))
<ArneBab>(match (list 'a dot 'b) ((a dot b) `(,a . ,b)))
<ArneBab>looks good
<nalaginrut>ah, yeah
<ArneBab>with (use-modules (ice-9 match))
<nalaginrut>frankly, I enjoy 'match' these days
<nalaginrut>pretty cool thing
<ArneBab>yepp
<nalaginrut>maybe 'cool' is not enough for it...
<ArneBab>and since I only have to look for the last expression…
<ArneBab>I need to read up on it
<nalaginrut>;-)
<DerGuteMoritz>ArneBab: that won't work, it will rebind dot in the pattern
<nalaginrut>DerGuteMoritz: you mean dot is used as an internal symbol of match?
<ArneBab>oh
<ArneBab>that explains why it only works in the simple case
<nalaginrut>oh, you need (a '#{.}# b)
<nalaginrut> ((a '#{.}# b) `(,a . ,b))
<ArneBab>ah, yes
<ArneBab>I’m currently struggling with extending this to longer lists
<ArneBab>((a ... b '#{.}# c) `(,a ... ,b . ,c)) does not work
<nalaginrut>I'm sorry I just tricked by the Guile specific symbols, so that I forget #{.}# would be treated as a variable
<ArneBab>no probs
<ArneBab>it surprised me at first, too :)
<nalaginrut>I tried too simple testcase in repl, so...
<ArneBab>(match (list 'x 'a dot 'b) ((a ... b '#{.}# c) (append a `(,b . ,c))) )
<ArneBab>this seems to work
<ArneBab>nalaginrut: the same happened to me - after all I thought that it worked ☺
<nalaginrut>congrats! Are your problems all solved?
<ArneBab>almost ☺
<ArneBab>I just need to turn this into a function and call it recursively on each member of the list.
<nalaginrut>I think you'll need various test cases for this function
<nalaginrut>my experience told me parsing become harder when you testing it ;-P
<ArneBab>I guess so, but the core problem should be done with that.
<davexunit>nalaginrut: hey! does artanis do content negotiation?
<DerGuteMoritz>ArneBab: I guess (cons b c) is a bit easier on the eyes :-)
<ArneBab>ah, yse.
<DerGuteMoritz>ArneBab: you could also match on the value dot is bound to like this: (? (lambda (x) (eq? x dot))) but that's a bit ugly, too
<ArneBab>thanks!
<DerGuteMoritz>ArneBab: alternatively, define a dot? predicate and then use (? dot?) in the pattern
<ArneBab>that should be cross-implementation then, right?
<DerGuteMoritz>yeah, if you use (string->symbol ".") to obtain the dot symbol
<ArneBab>ah, nice! (I don’t even have to (read )the dot)
<ArneBab>ok, if this works, I officially declare match awesome…
<ArneBab>it’s just 9 lines…
<ijp>racket has a == so you can do (== dot) to compare with the value of the variable foo, foof's matcher may have something
<ijp>similar
<DerGuteMoritz>ijp: not that I'm aware of, unfortunately!
<DerGuteMoritz>it's also not extensible in a way that we could add such an operator ourselves
<DerGuteMoritz>well you could abuse the = pattern
<DerGuteMoritz>(= identity dot)
<ijp>I don't think you can
<DerGuteMoritz>works for me on chicken's version of it at least :-)
<DerGuteMoritz>it says that it works on fields only but you actually just pass in a function
<ijp>that would bind dot to the return value of identity
<DerGuteMoritz>ah you are right
<DerGuteMoritz>hecked!
<ArneBab>ok, match officially is AWESOME!
<DerGuteMoritz>yeah it's good anyway!
<ArneBab>a crisp and easy to understand 9 line function just replaced a 55 line monster!
<ArneBab>can I somehow check for (a ... #{.}# b ... c d)?
<ArneBab>match said multiple ellipse patterns not allowed at same level
<DerGuteMoritz>not that I'm aware of. you could try (a ... #{.}# b . (c d)) instead (note that you probably need to quote #{.}#)
<DerGuteMoritz>(unless you actually want to bind #{.}#)
<ArneBab>which I may want - in the parser…
<ArneBab>or not…
<ArneBab>no
<ArneBab>but a user may want to
<DerGuteMoritz>my idea with . (c d) is not equivalent to what you're trying to do actually
<ArneBab>but then this would look like this: (string->symbol "#{.}#") -> #{#\\x7b;.\\x7d;#}#
*DerGuteMoritz &
<ArneBab>(if (and (pair? li) (member #{.}# li)) (throw 'wisp-syntax-error)
<ArneBab>(if (and (not (list? li)) (pair? li) (member #{.}# li)) (throw 'wisp-syntax-error)
<ArneBab>or not…
<ArneBab>can I match a pair?
<ArneBab>(a ... b . c) or so
<ArneBab>(an improper list)
<ArneBab>I think I need the last and second last item to recreate the pair…
<ArneBab>can I force an improper list to a list?
<ArneBab>ok, I can get it with last-pair
<dsmith-work>wingo: Just read your pflua post. Have you changed jobs?
<wingo>dsmith-work: it does make it sound like that, doesn't it? no, though, it was an Igalia thing
<wingo>still with igalia :)
<dsmith-work>Ahh
<davexunit>wingo: that was a neat blog post.
<wingo>tx :)
<wingo>was interesting to work with a tracing system.
<dsmith-work>wingo: Yes, very good.
<wingo>of course the graphs were made with scheme ;)
<ArneBab>ok, the wisp parser works and should now catch the error cases for using dot-syntax in the wrong places.
<ArneBab>thank you for your help!
<dsmith-work>Lack of bit ops really annoys me about lua. Looks like they are available now.
<wingo>dsmith-work: in a module. the module is built-in to luajit tho
<ArneBab>the error handling takes many more lines than making the required lists improper, but I think it is important for wisp: the dots are the one part which is a bit dangerous.
<davexunit>wingo: I've noticed that your posts *always* make it to the front page, but no one ever really comments.
<davexunit>front page of HN*
<wingo>davexunit: they don't always make hn, i don't think; it comes in waves
<wingo>but yeah, when they do there are no comments :)
<ijp>wingo: what work would need to be done to make (language cps) work with stable-2.0?
<wingo>ijp: you mean targeting glil?
<ijp>no, I want to write my own compiler
<wingo>ah
<ijp>I can't build master on this computer, or I'd just use that
<wingo>not much i don't think, i don't think it uses any guile 2.2-specific semantics
<wingo>ijp: why doesn't master build for you? non-4k page size?
<ijp>wingo: not enough ram :)
<wingo>uf :(
<wingo>ijp: just so i know :) how much is not enough?
<ijp>on this computer, I have 1GB
<wingo>ok
<ijp>having said that, I think this may be the last year I can get away with it in general
<ijp>everything is so hungry these days
*ijp glares at firefox
<dsmith-work>ijp: Add swap space?
<dsmith-work>Though it really does seem insane that you need more than 1G.
*dsmith-work boggles
<ArneBab>here’s the whole fakepair->improper function - only the first 11 lines are the actual rewriting, the rest is error-handling: https://bitbucket.org/ArneBab/wisp/src/863a54db27473f9153aec9a91382c9c74750308b/wisp-scheme.w?at=default#cl-419
<ijp>so anyway, supposing I try to create my own branch based off stable-2.0, what git-fu can I do to make this as painless as possible to reintegrate?
<waxysubs>ijp: you're actually pondering porting (language cps) to stable-2.0 just because you don't have enough RAM to compile master?
<waxysubs>seems like a short-sighted approach
<wingo>ijp: you working on a js backend ? :)
<ijp>wingo: yes
<wingo>excellent
<wingo>i think almost any strategy is fine -- try to keep changes to cps isolated to proper commits, but otherwise whatever external modules would be there could just be imported as-is
<wingo>you'll have to make some tweaks to the tree-il->cps compiler, as tree-il is slightly different in master
<wingo>but that's maybe not a big deal; dunno
<ijp>I think the way forward is this 1. new branch with whatever ugliness necessary for cps 2. second branch for compiler based off this 3. rebase as necessary, and one final one when it's ready for inclusion
<ijp>when, not if, I'll be optimistic
<davexunit>ijp: js on guile is very exciting. happy hacking.
<wingo>makes sense to me
<wingo>a js backend will be swell
<ijp>waxysubs: I've been frustrated about this for a few weeks, and I'd rather do something stupid now that can be fixed later than wait any longer
<wingo>ijp: what are you going to do about the runtime functions that are implemented in c? implement them in js?
<ijp>wingo: I expect so
<wingo>another possibility is to implement in scheme and compile to js; dunno
<ijp>I'm still not sure about modules
<wingo>yeah
<waxysubs>ijp: do you have access to a more powerful machine that could be used to compile master and then copy over the .go files?
<waxysubs>or just add swap and let it run overnight ?
<civodul>ijp: hop's scheme2js produces mangled names that encode both the name of the variable and that of the module it comes from
<ijp>waxysubs: I have enough swap, I think, but even overnight, it's not finishing
<ijp>it's just wasted computation
<mark_weaver>ijp: would you accept precompiled .go files from me?
<ijp>I could compile it on my ec2 instance, but it wouldn't fit my arch
<mark_weaver>(signed by the GPG key that it signed by RMS)
<mark_weaver>your arch is 32-bit 686?
<ijp>yes
<mark_weaver>well, I can compile the latest master on my 686 (gluglug x60) if you like
<mark_weaver>I've compiled it rather recently, so should be fast.
<ijp>that would be really kind of you
<mark_weaver>we might want to consider including precompiled .go files for a few common arches as a separate tarball in 2.2.
<mark_weaver>ijp: okay, you'll have them within 10 minutes or so
<mark_weaver>ijp: http://www.netris.org/~mhw/guile-master-7f5887e-i686-go-files.tar.xz (and separate .sig file in the same place)
<mark_weaver>actually, wait a bit, it might still be copying on my end
<mark_weaver>okay, done now
<mark_weaver>my GPG key has ID 7562C516, fingerprint D919 0965 CE03 199E AF28 B3BE 7CEF 2984 7562 C516
<mark_weaver>and the sha256sum of the file itself is: 84fe2ed6f8e360b0b06a131ef985e98a91b5d7c7966bb16c30ab049bc0c2bf8a
<ijp>right, downloaded and checked, thanks
<ijp>took my eight goes to remember the tar right option for xz
<ijp>me* right tar*
<mark_weaver>with modern gnu tar, you don't need to specify the compression option at all when unpacking. just: tar xf foo.tar.xz
<dsmith-work>mark_weaver: Nice. Now what didn't they think of that before?
<ijp>TIL
<mark_weaver>and when compressing, there's the 'a' option that uses the archive suffix to automatically determine the compression
<ijp>well, the good news is I have a working guile-master; the bad news is two coverage tests failed
<dsmith-work>ijp: I think that's expected at this time.
<ijp>yes, I won't lose sleep over this
<sbidin>Is the "coding: utf-8" declaration unnecessary with modern Guile? Utf-8 output of non-ASCII literals seems to work without it.
<civodul>sbidin: source code is UTF-8 unless otherwise specified
<civodul>so "coding: utf-8" is unneeded for source code
<sbidin>civodul: Thanks!
<ijp>if you are processing text, you probably still need a setlocale
<sbidin>ijp: Yes, I do (setlocale LC_ALL ""). This uses the default one, I suppose.
<sbidin>I can supply a docstring for functions, but not variables?
<ijp>correct
<ijp>the docstring is attached to the function object, not the name
<sbidin>Thanks!
<ijp>support for variables could be added, by associating it with the variable objects themselves, but no-one has done that yet
<civodul>artyom-poptsov: ftp://memory-heap.org/software/guile-ssh/ seems to be unavailable
*wingo holiday, back in a week. ciao :)
<daviid>have a nice holiday wingo !!
<davexunit>later wingo!
<davexunit>have fun!