IRC channel logs

2015-09-19.log

back to list of logs

<paroneayea>ArneBab: well, for posterity http://dustycloud.org/tmp/0001-guile-wisp.-almost-works-but-there-s-no-make-install.patch
<paroneayea>there's an almost working package :)
<ArneBab>can you figure out the guile load path from the package? :)
<paroneayea>ArneBab: I can figure out pretty easily what to do with the .scm files, but I don't know what to do with the .w files
<ArneBab>you don’t need to install the .w files
<ArneBab>./bootstrap.sh turns them into .scm files, and they are all you need
<paroneayea>ArneBab: oh!
<paroneayea>ok! :)
<ArneBab>just wisp-scheme.scm and language/wisp/spec.scm
<paroneayea>ArneBab: so just those ones need to be on the guile path?
<ArneBab>also they need to be precompiled when you want to run with --language=wisp
<ArneBab>if you just want to use ,L wisp in guile, that’s not needed
<ArneBab>(yes, only those are needed)
<ArneBab>paroneayea: does it work?
<paroneayea>ArneBab: just finished adjusting the package
<paroneayea>let's see
<paroneayea>making minor fixes
<paroneayea>ArneBab: btw, how does the project do the .w -> .scm stuff?
<ArneBab>there’s wisp.scm which converts wisp files into regular scheme
<ArneBab>which is created from wisp-guile.w
<ArneBab>and wisp-guile.w is converted to regular scheme by wisp.py :)
<ArneBab>(there’s a monotonically *de*-creasing number of parsing bugs from wisp.py over wisp-guile.w so wisp-scheme.w — the first two have known errors)
<paroneayea>ArneBab: might be neat if we can reduce the amount of bootstrapping by starting with guile rather than python
<ArneBab>I could include wisp.scm in the release tarball
<ArneBab>it actually is included
<ArneBab>(or should be)
<ArneBab>ah, no
<ArneBab>not yet included
<ArneBab>need to put it in EXTRA_DIST
<paroneayea>ArneBab: hm, no that's now what I mean :)
<paroneayea>I mean the initial bootstrapping process written in guile rather than python, if it were to eventually be included in guile core :)
<ArneBab>the bootstrapping process is just the shell script — to include wisp in core I’d leave out wisp.py
<ArneBab>and bootstrap directly from wisp.scm
<paroneayea>hm
<paroneayea>ArneBab: so I have things kinda working!
<paroneayea>except that ,L doesn't work
<ArneBab>cool!
<paroneayea>:)
<ArneBab>oh…
<paroneayea>it does go in the right path
<paroneayea>and installs the files
<paroneayea>though
<ArneBab>the current bootstrapping pretty much follows the historical development of wisp: I first wrote the python-based parser, then I wrote a wisp parser in wisp, then I wrote a second, cleaner wisp-parser in wisp. The first wisp-based wisp-parser can be used to bootstrap the second.
<paroneayea>I can do (use-modules (wisp-scheme))
<ArneBab>is wisp-scheme.scm at the top-level in the path
<paroneayea>but not -L wisp
<paroneayea>er
<paroneayea>,L
<ArneBab>can you also do (use-modules (language wisp spec))?
<paroneayea>hm, nope
<paroneayea>oh
<paroneayea>my bad
<paroneayea>one sec
<paroneayea>ArneBab: I totally know what I did wrong
<ArneBab>what was it?
<paroneayea>ArneBab: I accidentally dumped the filename in the directory name, if you can believe it
<paroneayea>so it was language/wisp/spec.scm/spec.scm and language/wisp/spec.scm/spec.go
<ArneBab>ah, yepp, that seems like an error which can happen pretty easily
<paroneayea>ArneBab: if you push out a new version and change the way building works btw
<paroneayea>please let me know
<paroneayea>just so guix can be updated accordingly
<ArneBab>sure!
<ArneBab>to make that clean, I could add a --bootstrap flag to configure which runs through the whole process
<paroneayea>well.... progress?
<paroneayea>scheme@(guile-user)> ,L wisp
<paroneayea>While executing meta-command:
<paroneayea>ERROR: In procedure setlocale: Invalid argument
<paroneayea>scheme@(guile-user)> ,L wisp
<paroneayea>While executing meta-command:
<paroneayea>ERROR: no such language wisp
<paroneayea>scheme@(guile-user)>
<paroneayea>but I can now
<paroneayea>scheme@(guile-user)> (use-modules (language wisp spec))
<paroneayea>why it has different results the first vs rest
<paroneayea>not sure
<paroneayea>but
<ArneBab>I also started to see the setlocale problem here, but I thought it was a local setup problem…
<paroneayea>cwebber@earlgrey:~$ guile
<paroneayea>warning: failed to install locale: Invalid argument
<paroneayea>happens with local guile
<paroneayea>so interestingly
<ArneBab>it’s (setlocale LC_ALL "")
<paroneayea>ArneBab: ok, it WORKS kinda :)
<ArneBab>does that work in your guile?
<paroneayea>ArneBab: so this is funny :)
<paroneayea>it works in not-guix guile :)
<paroneayea>if I do /usr/bin/guile
<paroneayea>but with guix's package in my environment
<paroneayea>,L wisp works!
<ArneBab>yay!
<paroneayea>ArneBab: I think I'll submit it to the list and ask for advice there
<paroneayea>this may be a guix-centric bug.
<ArneBab>I also get the setlocale thing with Gentoo, but don’t know why
<ArneBab>because it used to work…
<paroneayea>ArneBab: it's a bit weird having to do two blank lines after every wisp statement to get it to eval
<paroneayea>why not just one blank line?
<paroneayea>in the interpreter I mean
<ArneBab>because that would break functions which have a single empty line between statements
<paroneayea>ArneBab: meh, python doesn't care :)
<paroneayea>why should wisp?
<ArneBab>I stumbled over that dozens of times with Python
<paroneayea>ArneBab: maybe we can make this a parameter
<ArneBab>you have a code file which works
<ArneBab>then you throw the code in the interpreter and it doesn’t
<paroneayea>so users can configure at the interpreter how many <RET> they want :)
<ArneBab>because the interpreter executes pre-emptively
<paroneayea>ArneBab: but yes I've had that trouble too
<paroneayea>ArneBab: it feels like two modes I'd like to switch between
<paroneayea>copy-pasta mode
<paroneayea>and "quick hacking" mode
<ArneBab>the current development version includes an addition which allows finishing a statement with a final period
<paroneayea>ArneBab: one kinda bummer at the repl tho
<paroneayea>it doesn't go "flush" with the code you're writing :(
<ArneBab>(which uses the “reserved for future experiments trailing dot” from SRFI-119)
<paroneayea>wisp@(guile-user)> + 1 2 3
<paroneayea>... - 4 5
<paroneayea>...
<paroneayea>...
<paroneayea>$2 = 5
<ArneBab>I did not release that yet, because I’m still testing (and writing the PhD draft)
<paroneayea>wisp@(guile-user)> 5
<paroneayea>...
<paroneayea>...
<paroneayea>ERROR: In procedure 5:
<paroneayea>ERROR: Wrong type to apply: 5
<paroneayea>!!
<paroneayea>that's a surprise to me
<ArneBab>it tried to execute 5 as function
<paroneayea>ArneBab: right, but it shouldn't right?
<ArneBab>essentially wisp just turns the parens around
<paroneayea>oh right
<ArneBab>. 5
<paroneayea>aha ok
<paroneayea>yes that's something to get used to, but doable
<ArneBab>since lines starting with paren are much more common than lines starting without paren
<paroneayea>ArneBab: yes, the right call I think
<ArneBab>^ that’s the big difference to readable and SRFI-49: avoiding a special case for single-element lines
<ArneBab>but yes, it takes getting used to
<ArneBab>(and it’s a source of errors — the discussion with the readable folks isn’t completely closed on that from my side — I can’t yet say whether the problem will persist with somewhat better tooling)
<ArneBab>(like warning when you begin a line with a string or number without preceding .
<paroneayea>ArneBab: so, question
<paroneayea>ArneBab: at some point I'd like to dig into guile's compiler, and it sounds like you're interested in this becoming a guile core thing
<ArneBab>(I think it’s the right way to go, though)
<paroneayea>if I *did* and not promising I would
<paroneayea>would you be okay with relicensing as LGPLv3 and shooting for guile upstream?
<ArneBab>definitely, yes
<paroneayea>cool
<paroneayea>it seems like a good entry-level way for me to get into the compiler, since you've done the brunt of the work
<paroneayea>and it's just going to scheme
<ArneBab>paroneayea: you can have a look at language/wisp/spec.scm to see the compiling it currently does
<ArneBab>paroneayea: but first: thank you very much for creating the guix package!
<paroneayea>ArneBab: :)
<paroneayea>ArneBab: hm, wisp-mode is in desparate need of good C-j support in emacs :)
<ArneBab>yes it is…
<paroneayea>still, a good startr
<paroneayea>ArneBab: thanks for working with me on this today!
<ArneBab>I would love to already have nice keep-indentation and indentation cycling via tab…
<ArneBab>paroneayea: thank you for taking it up!
<paroneayea>ArneBab: yes something python-mode like would be nice
<ArneBab>what do I do when make needs guile to run but I just deinstalled guile?
<ArneBab>(to get the new version the unclean way…)
<daviid>do we have a built-in that would do (... '(a b c d) '(1 2 3 4)) -> '(a 1 b 2 c 3 d 4) what would be its name or a good english name if i write it ?
<please_help>it should probably be called something like unzipn* as it matches the unzip<#> pattern in srfi-1 except it returns a list instead of multiple values.
<daviid>please_help: ah, tx, did not look at srfi-1 :) but wrote these 2, don't know about the naming though? [and list-insert could accept any number of list but this is a quick thing I needed immed...] http://paste.lisp.org/+3BX1
<mark_weaver>sneek: later tell daviid: a simple way to write that is: (define (interleave a b) (concatenate (map list a b)))
<sneek>Will do.
<mark_weaver>sneek: later tell daviid: (interleave '(a b c d) '(1 2 3 4)) => (a 1 b 2 c 3 d 4)
<sneek>Will do.
<mark_weaver>sneek: botsnack
<sneek>:)
<mark_weaver>sneek: later tell daviid: to generalize to arbitrary numbers of lists: (define (interleave . lls) (concatenate (apply map list lls)))
<sneek>Got it.
<paroneayea>btw protip for wisp if you don't use it already, ArneBab_
<paroneayea>M-x whitespace-mode
<ArneBab_>paroneayea: I don’t use it yet — thanks!
<daviid>heya guilers!
<sneek>daviid, you have 3 messages.
<sneek>daviid, mark_weaver says: a simple way to write that is: (define (interleave a b) (concatenate (map list a b)))
<sneek>daviid, mark_weaver says: (interleave '(a b c d) '(1 2 3 4)) => (a 1 b 2 c 3 d 4)
<sneek>daviid, mark_weaver says: to generalize to arbitrary numbers of lists: (define (interleave . lls) (concatenate (apply map list lls)))
<daviid>mark_weaver: thanks!
<paroneayea>hi!
<daviid>hi paroneayea! how is hacking today?
<paroneayea>daviid: I need to get out a blogpost on state of the goblin instead
<paroneayea>however, next week, which I was going to spend on federation, I think I am going to spend on guix stuff instead, because of the talk
<paroneayea>meanwhile I am idly reading module/languages/ of guile :)
<daviid>ok, needs to be done too i guess ... i'm on guile-clutter and grip-clutter today
<daviid>i have to give a try to kawa as well, i don't like clojure so much and hate the idea to have to learn yet anotner ecosystem ... maybe not today but will do
<daviid>spoke to the kawa folks and Per [the kawa developer and maintainer] emailed me this link, maybe it interest someone here: https://www.reddit.com/r/lisp/comments/2df2rm/should_my_startup_attempt_to_use_abcl_in_a/
<taylanub>ACTION just implemented bit-fields for https://github.com/taylanub/scheme-bytestructures \\o/
<taylanub>I need to do some good testing though. struct alignment is tricky as hell.
<daviid>taylanub: i wish i had the time and the skil to inject your work in g-wrap
<amz3>daviid: thx interesting
<amz3>I am always surprised to see that much people use kawa
<amz3>always in the sens, that even the obscure implementation/language have user
<amz3>yes kawa seems to me like obscure implementation
<amz3>but it looks that I'm wrong
<amz3>at least the top commenter gives a detailed answer about why to choose it over the three other languages
<amz3>which means kawa *has* users
<daviid>amz3: i really don't and never did think kawa is/was obscure, it is just scheme [almost, see consciensly taken decisions about partial continuation implementation], it's just that it compiles to jvm blabla
<daviid>i posted the link here because, presumably, i'm not the only one who has to face this clojure 'problem' and 'ecosystem', coming from scheme ... and tere are at least 2 alternatives, as it appears, really well and deeply analyzed by the author adn in the responses...
<taylanub>daviid: what's g-wrap? my library is in dire need of actual use, to test its capabilities, so I might work on integrating it into something.
<daviid>taylanub: oh, g-wrap is used by guile-gnome and guile-clutter, see here:
<daviid> http://www.nongnu.org/g-wrap/
<sirgazil>Hi :)
<sirgazil>I'm trying (ice-9 getopt-long)
<sirgazil>But I'm failing to use the "predicate" property of options
<sirgazil>Here's what I'm trying to do: https://bitbucket.org/snippets/sirgazil/yRBgz
<sirgazil>The error I get is in the comment in that same URL ^
<paroneayea>hello sirgazil!
<paroneayea>sirgazil: looking
<paroneayea>more fun than doing the work I'm supposed to be :)
<sirgazil>:)
<mark_weaver>sirgazil: you need to change the "'" to "`" and put a comma "," before 'file-exists?'.
<mark_weaver>the problem is that since that's a quoted structure, you were giving it the symbol 'file-exists?' instead of the procedure.
<paroneayea>got it sirgazil
<paroneayea>oh
<paroneayea>mark_weaver beat me to it :)
<daviid>paroneayea: yeah, mark_weaver is a wizard :) and he does that with 1 kid in each hand ... :)
<mark_weaver>"`" is a shorthand for "quasiquote", which is a templating mechanism. it means that not everything in the structure is quoted; you can "unquote" things with comma, and then those parts will be evaluated and their values inserted into the template.
<sirgazil>Ah, I didn't understand that part in the documentation. Thank you mark_weaver and paroneayea for taking a look :)
<mark_weaver>glad to help; happy hacking!
<paroneayea>:)
<mark_weaver>daviid: the kids are out for a few hours, so I'm free!! :)
<paroneayea>sirgazil: I encourage you to look at the quasiquote part of the docs to see why this is
<mark_weaver>+1
<sirgazil>I will, thanks. I need to understand why quoting and quasiquoting :)
<daviid>taylanub: i beleive it would require a substantial amount of learning/work on your part, because g-wrap uses, extensively, goops too, but for you to see what i could dream of appears in here http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gparameter.c?h=devel , line 429 and below, then look at http://git.savannah.gnu.org/cgit/guile-gnome.git/tree/glib/gnome/gobject/gparameter.scm?h=devel, line 77, a redefinition
<daviid>of (define-method (compute-get-n-set (class <gparam-class>) s) using %hacky-struct-ref %hacky-struct-set!
<taylanub>"Should be unnecessary once the patches submitted to guile-devel on 10 April 2008 are accepted." O_o
<taylanub>do Guile's struct-ref/struct-set! have anything to do with C structs? I'm not sure if I understand the relation.
<daviid>taylanub: also, everybody here will rather recommend to integrate your work to/with/within the FFI ... so ignorant like me can 'just' access any C struct
<taylanub>yes, I'll work on FFI integration eventually.
<daviid>taylanub: that's a much better focus :)
<daviid>then we can rewrite g-wrap to use the FFI, and improve h2defs.py, so 1 day it just read any C .h file and writes the wraper for us
<taylanub>I also have it on my long-term plans to write something that generates bytestructure code from C headers, but no idea what the best approach would be. maybe a GCC plugin.
<daviid>taylanub: this is behond my knowledge, but I wish we could totally automatically wrap C code: is this an ignorant dream ? or 1 day we could acheive this?
<taylanub>not my expertise either, but from my imagination: a mechanic transformation/wrapping of all #defines, type definitions, global variables, functions, etc. should be possible given enough effort, but even then there will be the problem of C libraries being designed in line with C idioms like manual creation/destruction of objects. probably some human intervention is necessary for a good Scheme
<taylanub>wrapper of an arbitrary C library. otherwise one will be forced to "write C in Scheme" as they say
<please_help>there were utilities to automatically generate ffi wrappers, and lazy-ffi in chicken is pretty automatic as well.
<please_help>the utility I was thinking of was called SWIG, though its guile support is broken at the moment.
<daviid>please_help: never used it, I trusted our maintainers who did not either, they knew about it, and rotty [the g-wrap author] is a very knoledgeable person, they wrote g-wrap, our swig...
<daviid>g-wrap is from the 'old school', it generates C code, sing SCM_..., compiled in a lib.a we load and use... I wish a knowledgeable guiler could look at g-wrap and help me to rewrite it to use the FFI instead
<daviid>then we would port h2defs.py to guile, adapting it to the new g-wrap 'capacity', and work toward full automation, step by step...
<daviid>it's not too bad as it is becausse the C code is generated, so drastically reducing human errors, but the modern ffi would be much better of course
<daviid>any candidate ? :)
<daviid>ping me
<daviid>I wish I would be a C expert
<daviid>just wrapping glib generates 6000 lines of C code, gtk 33000 lines of C code
<paroneayea>ArneBab_: I wish there was a way to make the REPL "flush" on any of the continuing "..." lines with the user's first line
<paroneayea>it's kind of confusing working with wisp otherwise
<paroneayea>at the repl that is
<paroneayea>I think this is true of a lot of non-scheme stuff at guile's repl though
<paroneayea>there needs to be a "flush" repl option or the like