***lloda`` is now known as lloda
<taylanub>question: ISTR reading something like Tree-IL getting retired. or was that GLIL? ***DrMeredithMcKay is now known as trifling_gnome
<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 <sneek>Welcome back wingo, you have 2 messages. <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>Also, sorry for maybe being offtopic, I'm not sure which rules apply in #guile. <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 <taylanub>ok. maybe I should go to a GHM myself one day <ijp>#emacs is sane and nice? <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>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>in the meantime i wrote up something on luajit (!) <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 <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) <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. <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>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>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 <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"? <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>I think the number of parens is one of the prime reasons why lisp-like languages aren’t mainstream. <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. <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>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 <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) <nalaginrut>so it's specified problem of Guile implementation? <ArneBab>(read ".") should return something (else I’ll have to special case) <ArneBab>to be exact, I have to turn (list 'a (call-with-input-string "." read) 'b) into '(a . b) <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>for generic purpose, maybe you have to write bunch of rules to cover <ArneBab>(define dot (call-with-input-string "." read)) <ArneBab>(match (list 'a dot 'b) ((a dot b) `(,a . ,b))) <ArneBab>and since I only have to look for the last expression… <nalaginrut>DerGuteMoritz: you mean dot is used as an internal symbol of match? <ArneBab>that explains why it only works in the simple case <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>(match (list 'x 'a dot 'b) ((a ... b '#{.}# c) (append a `(,b . ,c))) ) <ArneBab>nalaginrut: the same happened to me - after all I thought that it worked ☺ <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: 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 <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… <ijp>racket has a == so you can do (== dot) to compare with the value of the variable foo, foof's matcher may have something <DerGuteMoritz>it's also not extensible in a way that we could add such an operator ourselves <ijp>I don't think you can <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 <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>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;#}# <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>I think I need the last and second last item to recreate the pair… <ArneBab>can I force an improper list to a list? <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>was interesting to work with a tracing system. <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. <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. <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 <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>ijp: just so i know :) how much is not enough? <ijp>on this computer, I have 1GB <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 <dsmith-work>Though it really does seem insane that you need more than 1G. <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? <wingo>ijp: you working on a js backend ? :) <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. <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? <wingo>another possibility is to implement in scheme and compile to js; dunno <ijp>I'm still not sure about modules <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>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>actually, wait a bit, it might still be copying on my end <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 <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? <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 <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 <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>the docstring is attached to the function object, not the name <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 :)