IRC channel logs
2015-02-20.log
back to list of logs
<nalaginrut>wingo: once you've told me that continuations are actually basic blocks. Does it mean we can handle CPS without generating basic blocks, or we treat continuations as basic blocks in CPS? <wingo>nalaginrut: hmm :) have you read the "lambda, the ultimate goto" paper? <wingo>there is a point in that paper where he shows how some continuations are just labels, and he actually emits labels for them when compiling <nalaginrut>wingo: well, thanks for hint, I collected this paper but never read ;-P <wingo>but that also means that in Guile's intermediate representation the continuations that we represent are only a subset of all continuations inthe program -- <wingo>specifically guile's continuations are only those continuations that can be compiled to labels <wingo>now basic blocks are made up of labelled expressions <wingo>but not every label is a basic block <wingo>because if a label is always in a line with other labels -- only one predecessor and only one successor -- then it is a part of some larger basic block <wingo>so it's more accurate to say that guile's continuations are labels <wingo>i mean, the continuations in the CPS IR <nalaginrut>and I guess this subset of continuation may not provide a general IR for any languages, which implies the font-end on Guile maybe constrained, is that true? <wingo>so we have another thing in the IR, which are function calls <wingo>in a true CPS IR every function call receives a continuation as an argument <wingo>but in Guile's CPS we assume there is a stack, and that functions return to their callers <wingo>there's nothing more or less general, i don't think <wingo>just different ways of solving the same problem <nalaginrut>oh, does it mean we could make the IR generic anyway, but some font-end language may lose some features of AOT <wingo>i think guile's cps is fine for aot as it is -- the other thing you want there are types <wingo>so we might lower to a typed cps, dunno *nalaginrut keep reading ... *davexunit envies racket's built-in support for image manipulation. <davexunit>would be so cool to have images at the REPL. <davexunit>and since I have likely just volunteered myself to do it, I say: some day. <wingo>like ipython's notebooks, sort of thing. <davexunit>I'm not sure of the implementation details, though. <davexunit>but for the web repl, you'd need a web server running as well, feeding things in. <wingo>yeah good question -- do you let the repl drive, possibly with delimited continuations, or do you build it just as a web app <wingo>i think i would probably do the latter, so you could use whatever js you wanted to on the client side, but dunno <wingo>seems like the right thing is not much code but there are many wrong things :) <davexunit>using delimited continuations was how the cooperative REPL server was made, but that's a different thing. <davexunit>would you worry about handling multiple users? <davexunit>should each user session get a new guile process? <davexunit>ya know, so I can't rebind + to (lambda args (display "fart <nalaginrut>davexunit: well, if let me choose, I would go wingo 's way for a webapp. I can even imagine the whole architecture of it, but I have no plan to do that ;-P <wingo>would binding + to fart be so bad? :) <ArneBab>davexunit: could the web repl be done by compiling against asm.js? <wingo>for me i would think that one server would be for one person. <wingo>one person could have multiple repls open but since you can do just about anything with guile it's not well-suited to multiple users right now <wingo>unless you have a good sandboxing story, and that's hard as we can't dynamically limit memory use for delimited continuations... <davexunit>wingo: yeah, fair enough. that simplifies things greatly. <nalaginrut>yeah, and contact each independent server with cookies *nalaginrut means session id <Profpatsch>Is there a way to disable the welcome message when running a script? <Profpatsch>So, is there a way to disable it in general? Command line switch? <dje>Or if not running interactively gdb --batch, or --batch-silent <dje>Oh geez, back from holidays and a little sleepy ... wrong channel. :-) <davexunit>-q in guile will just "inhibit loading of user init file" <daviid>wingo: did you locally change your guile-lib congifure.ac to add serial-tests as well [maybe]? <wingo>daviid: no, i think i just haven't built guile-lib in forever <dje>Interesting question though. Does guile have the equivalent of gdb's -q? <wingo>dje: i don't think so, perhaps it should <daviid>wingo: i just did :) [I, on purpose, did choose to setup a /opt2 for my tests using guile-2.1, guile-gnome needs it ...], so i guess it needs that option right? <daviid>guile-gnome [using guile-2.1] make check reports unbound(s) wrt sxml [pretty-print], texinfo [seed] and then fails compiling glib/gnome/gw/support/gtk-doc.scm with Unbound variable: define-parsed-entity! <daviid>texinfo/reflection.scm:128:17: warning: possibly unbound variable `local-eval' <daviid>texinfo/reflection.scm:131:18: warning: possibly unbound variable `procedure-environment' <daviid>wingo: i don't have guile-lib write access, so i made this configure.ac change locally <davexunit>and I just got to a point where they were implementing 'or'. <davexunit>and they talked about having to use let to avoid evaluating part of the form twice. <davexunit>they used (or (display "hi")) to show that "hi" would be displayed twice. this was in Chez Scheme. <davexunit>evaluated once in the test form of 'if', and then again in the consequent form. <davexunit>however, in Guile, I don't see this behavior. <mark_weaver>I tried this: (define-syntax or (syntax-rules () ((or e e* ...) (if e e (or e* ...))) ((or) #f))) <davexunit>I had an additional case that handled a single argument <mark_weaver>and indeed, that single-argument case is important to implement proper semantics for Scheme 'or'. <mark_weaver>by those rules, (or #f (display "hi\\n")) expands to (if #f #f (or (display "hi\\n"))) and then the single-argument case is used to expand the remaining 'or'. <davexunit>mark_weaver: thanks. knew I was missing something else. *davexunit has finally begun to understand syntax-case <davexunit>it still surprises me a lot, but I was able to write a simple macro that used with-syntax <davexunit>I tried writing it without 'with-syntax' and failed. <mark_weaver>davexunit: it can be done with quasisyntax, a.k.a. #` <mark_weaver>however, the argument to syntax->datum should be #'name, not #'(name), I think. I'm not sure how that's even working. <mark_weaver>but you should be able to write something like #`(define #,(symbol-append ...) value) <mark_weaver>with-syntax probably results in more readable code here though. <davexunit>I wrote a macro called 'datum' to replace (syntax->datum (syntax <pattern-variable>)) <mark_weaver>sorry, I meant to write #`(define #,(datum->syntax ...)) <davexunit>but I knew it had to be possible to accomplish the same goal without it. <mark_weaver>with-syntax is kind of like 'let' for pattern variables <mark_weaver>it's actually just a macro that expands into a use of syntax-case <mark_weaver>sort of like 'let' can be implemented as a macro that expands into a use of 'lambda'. <davexunit>I got the very basics of syntax-rules down awhile ago, but syntax-case was always scary. <davexunit>I now have a chance of grokking civodul's define-record-type* macro <mark_weaver>macros are fairly easy to get started with, but it's quite the rabbit hole to go down, to understand how the machinery works. <mark_weaver>I remember thinking about 10 years ago that I was ready to write my own scheme implementation from scratch, and I was almost right, but when I sat down to do it, I realized that I didn't yet understand the macro system well enough. <davexunit>yeah, I have a long way to go to understanding how this stuff is actually implemented. <davexunit>need to learn more about compilers in general. <stis>it' s pretty cool, in a hefty development, just check the commits. <stis>I'm working on getting some serious prolog code working on it. <stis>and get pretty good support for swi prolog constructs <stis>just recently I added a boolean sat solver, clpb.pl <stis>right now I'm working on using indexing per default and get rid of nasty gc issues <stis>that and the ability to use prolog macros. <stis>yep LGPL v2 or 3 it's your choice <stis>I have taken some source code from the swi prolog release, I need to make that copyright clear though <stis>I can fix it if there is an issue <paroneayea>stis: anyway, neat stuff... and I just noticed so thought I'd ask :) <stis>paroneayea: yes it is pretty unique with pretty cool features, 10x slower then swi prolog but sports delimited continuation, tablating rational datatsructures and of cause great interoperarion with kanren <stis>it's just it is bloody hard to get all the details right and good feature parity with stand alone prolog implementations <davexunit>I wonder if we should get a guile-websockets library before writing a guile web REPL