IRC channel logs

2015-12-02.log

back to list of logs

<amz3>ArneBab: do you know which day the talks will happen?
<ArneBab>amz3: no
<ArneBab>bbad
***Guest76271 is now known as mikey
<nalaginrut>morning guilers~
<artyom-poptsov>nalaginrut: Good morning
<artyom-poptsov>nalaginrut: You're the maintainer of Guile-PG, right?
<nalaginrut>artyom-poptsov: no, why you think so? ;-)
<artyom-poptsov>nalaginrut: By no reason aside from an insignificant fact that your name is mentioned in the copyright notices around Guile-PG sources. ;-)
<nalaginrut>artyom-poptsov: oh, I believe I never get involved in this project, maybe they made some mistake ;-)
<artyom-poptsov>I see.
<artyom-poptsov>Anyways, I just thought that it may be interesting for you: https://gist.github.com/artyom-poptsov/03b58dab9ee360238942
<artyom-poptsov>I'm trying to make use of Guile-PG in my work.
<nalaginrut>artyom-poptsov: I don't see my name there, or maybe you didn't mean that?
<nalaginrut>artyom-poptsov: anyway, guile-ssh is cool for me, thanks for working on it ;-)
<artyom-poptsov>Hmm, likely it was my mistake.
<artyom-poptsov>nalaginrut: Glad you like it.
<artyom-poptsov>nalaginrut: And sorry if I bother you too much.
<nalaginrut>np ;-)
<wingo>moin
<wingo>ACTION landed unboxed u64 values
<taylan>wohoo :-)
<nalaginrut>wingo: nice
<wingo>for some workloads it will be a speedup, for some a slowdown
<wingo>but when we do native compilation it will never be a slowdown
<amz3>nice!
<rekado>are there some options I can pass to xml->sxml to make it deal with HTML (e.g. unclosed img tags)?
<amz3>I don't think so, I use a snippet from haunt
<rekado>heh, okay
<amz3>wait xml->sxml?
<amz3>I know about sxml->html only
<rekado>yeah, I just noticed that haunt doesn't seem to have html->sxml.
<rekado>but that's okay.
<rekado>I'll just hack around it.
<rekado>it's just a script
<wingo>tfw when you accidentally make clean :/
<wingo>rekado: use htmlprag
<rekado>wingo: thanks. That's in guile-lib?
<wingo>yeah
<rekado>wee, this is great!
<rekado>bleh, I get a VM stack overflow trying to run an sxpath query over the large SXML.
<rekado>this is enough to cause a stack overflow: ((sxpath '(// a)) sxml)
<rekado>an explicit query like ((sxpath '(html body table tr)) sxml) works fine, but as soon as I go one level deeper I get a stack overflow.
<rekado>:(
<wingo>on master you wouldn't get a stack overflow :)
<wingo>but it could be that something isn't compiled in a good way
<wingo>dunno
<rekado>I'm still on 2.0.11
<rekado>installing 2.1.1 via guile-next on Guix.
<rekado>hmm, can't use 2.1.1. When I send expressions to the REPL via Geiser I get "ERROR: no such language objcode"
<rekado>if I paste the expression directly I get a compilation error: ERROR: In procedure load-thunk-from-memory: not an ELF file
<rekado>probably need to recompile all my modules.
<wingo>yeah geiser doesn't work with master
<wingo>unhappily
<rekado>back to regular expressions then...
<amz3>wingo: do you know what the fix for geiser should be?
<wingo>amz3: mostly. it needs to compile to 'bytecode instead of 'objcode and then use load-thunk-from-memory instead of objcode->program or whatever it's doing now
<wingo>there might be more things, i don't know.
<wingo>but that's the big one. more generally it should know whether it's working with guile 2.0 or 2.2 and be able to do different things.
<wingo>rekado: the second error you give, is it because you installed guile-lib from guix and it was compiled against 2.0 ?
<wingo>or if you installed guile-lib from git it sounds like you built it with guile 2.0
<davexunit>ACTION wrote a good start to guile-websocket's test suite
<wingo>nice :)
<wingo>davexunit: i landed unboxed u64 values :)
<davexunit>wingo: awesome!
<davexunit>now if only geiser cooperated with 2.1.1 I could have more fun trying it out
<wingo>you can fix it:)
<davexunit>:)
<davexunit>I filed a bug report since no one else has yet
<wingo>the fix is not difficult to make, you just have to make geiser ask guile what version it is, and use load-thunk-from-objcode on the result of compiling to 'bytecode instead of 'objcode
<wingo>on 2.2
<wingo>er
<wingo>load-thunk-from-memory
<davexunit>I threw in an excerpt from the channel logs about that
<davexunit>sounds like it will be easy for jao
<wingo>he might not feel like building 2.1.1 ;)
<wingo>anyways...
<davexunit>that's true
<davexunit>I *could* fix it, the issue is time.
<davexunit>I've poked around at almost all levels of guile hackery, I'm not afraid to dive into some elisp.
<davexunit>artyom-poptsov: I may have asked you this before, but is it possible to read/write to a remote unix domain socket via ssh without explicit support for it from the server?
<davexunit>tunneling typically happens over tcp ports
<wingo>does redirecting input and output to a cat process on the file work?
<davexunit>wingo: perhaps! I'll have to fumble around with it
<davexunit>I'm still in that "I have no idea what I'm doing" phase :)
<wingo>me too :)
<davexunit>I'm also drawn towards spending time on other projects like guile-websocket, not sure when I'll get around to the ssh stuff
<wingo>ack
<wingo>so i am thinking of releasing a 2.1.2 sometime soonish, with the unboxing bits, once i document them
<davexunit>I think websockets would be good to include in guile core, if it's actually any good.
<wingo>just saying, in case anyone wants to commit to master, it will be released soon
<davexunit>oh cool
<wingo>davexunit: what is the relationship between websockets and http2
<davexunit>wingo: none, AFAIK.
<wingo>doesn't http2 allow you to do similar things?
<wingo>push notifications etc
<davexunit>well, http2 may effectively deprecates websockets
<davexunit>deprecate*
<wingo>yeah
<davexunit>but http2 will take quite some time to be ubiquitous
<wingo>sure
<wingo>just wondering :)
<davexunit>but maybe it's not worth putting something with a limited lifespan in guile core, and maybe it's not worth me investing so much time in it.
<wingo>yeah i dunno either, could go either way
<davexunit>actually, this stack overflow thread (which is surely 100% accurate) suggests that HTTP2 and WebSocket are complimentary http://stackoverflow.com/questions/28582935/does-http-2-make-websockets-obsolete
<wingo>so, another question :) guildhall has failed in a way
<wingo>guix is more like what we should have and already solves the problem in a good way
<wingo>is there a sensible way for guix to package guile modules, I wonder?
<davexunit>with the caveat that OS X and BSD users cannot use it.
<wingo>especially in a way that can work on systems that don't run guix
<wingo>yeah
<wingo>so i wonder whether there is a way to re-use guix things to make a better package manager for guile
<davexunit>guildhall may still be worth it for this reason
<wingo>perhaps with a different package root
<wingo>i.e. not /gnu/store
<davexunit>perhaps
<davexunit>but I'm not sure how one would do it
<wingo>ACTION neither
<davexunit>guix requires bootstrap binaries for each platform and architecture
<davexunit>if we remove that, then we have to use utils from the host, and then we have guildhall.
<wingo>i think it's reasonable to configure a guixhall to be --with-guile or something
<wingo>so the base guile is out of the guix world
<wingo>and only the "extra" modules are managed by guixhall
<wingo>so there is no bootstrapping
<davexunit>would need other tools as well
<wingo>yeah i guess so.
<davexunit>interested to see if someone can come up with something that works well enough
<davexunit>without too many limitations
<wingo>yeah
<wingo>would be nice to be able to install extensions that need C libs :/
<wingo>that's what using full guix gives you, among other things
<wingo>so an intermediate solution is a bit wonky
<wingo>otoh guildhall explicitly limits itself to just guile modules
<wingo>so a guixhall wouldn't need e.g. a c compiler, if it limited itself to the same scope
<wingo>anyway it would be good if there were a nice answer that didn't make you feel like core was the right place for a websocket module
<wingo>as it is i understand the feeling and i'm not against incorporating modules like that
<wingo>.
<davexunit>wingo: I guess I'm of the feeling that most cool stuff should get included in the core like emacs does
<davexunit>batteries included, if you will.
<wingo>ACK
<wingo>i'm ok with that fwiw
<wingo>but that's just an opinion :)
<davexunit>but as it is, I write my own third-party things and drop a 'guix.scm' file in the root of the source tree
<davexunit>so guix folks can install git snapshots easily
<davexunit>or create dev envs
<davexunit>it might be best to just port Guix to the BSDs.
<wingo>is there a bug open with the issues?
<davexunit>not that I know of
***xdje is now known as 32NAAD5PE
<artyom-poptsov>davexunit: OpenSSH supports forwarding of Unix sockets since version 6.7, if I'm not mistaken.
<artyom-poptsov>That was my answer when you asked me the question some time ago.
<davexunit>artyom-poptsov: problem is that there's more than openssh out there
<davexunit>guixsd systems, the ones I want to work with, use GNU lsh typically
<artyom-poptsov>I see.
<davexunit>so I was hoping there was something I could throw together that would work regardless of the server.
<davexunit>like opening a guile process that can pipe the input from the ssh connection into the socket
<davexunit>my guess is that process spawned by ssh would have its STDIN be the data coming over the ssh connection
<davexunit>I'll have to try it out.
<artyom-poptsov>You could write a Scheme program that will pipe input from a local port into the Unix socket of guixsd.
<artyom-poptsov>So you would have a process on a remote GuixSD host that listens a local port, and forward local connections to that port.
<davexunit>is there a way to do this more automatically?
<davexunit>I'd like the client program to be able to spawn the process
<davexunit>and just pipe STDIN to the socket
<davexunit>I think I was confused by ssh in this regard before
<artyom-poptsov>You could do it.
<davexunit>echo foobar | ssh some-server cat
<davexunit>I want to know how this works
<davexunit>and do the same
<davexunit>replacing 'cat' with a guile program
<artyom-poptsov>Sadly I have no complete answer to your question, haven't tried to implement that kind of functionality in Guile-SSH yet.
<davexunit>okay
<davexunit>well thanks for the pointers
<davexunit>I'll have to do more digging
<artyom-poptsov>You could transfer your forwarding program to the remote host using SFTP, for example.
<artyom-poptsov>Or just execute some Scheme code that will forward your connections using 'with-ssh'.
<davexunit>the latter sounds like what I want
<artyom-poptsov>In this case you won't need to transfer any files at all.
<davexunit>cool
<davexunit>the pipe would only be a few lines of scheme
<davexunit>and guile-ssh would give me a port object to work with
<davexunit>from which I can create a guix daemon connection object
<davexunit>and go from there
<artyom-poptsov>All you'll need is to make sure that the spawned process won't be killed when 'with-ssh' exits.
<davexunit>it would loop
<davexunit>it would keep polling the file descriptor for more stuff to read
<davexunit>and terminate upon EOF
<artyom-poptsov>Yeah, but you may want to use 'setsid' or something.
<artyom-poptsov>In the remote process.
<davexunit>what does that do?
<davexunit>I've never used it
<artyom-poptsov>It creates a new process group for which the process called 'setsid' becomes the leader.
<davexunit>what effect does that have?
<artyom-poptsov>So the calling process will be effectively detached from a controlling terminal if it has one and won't stop when the parent process stop.
<artyom-poptsov>Whant I mean is that you may want to deamonize the spawned process.
<artyom-poptsov>s/Whant/What/
<davexunit>I don't think I want to daemonize it
<artyom-poptsov>Hmm, yeah, I may be wrong here.
<davexunit>but I don't really know yet
<artyom-poptsov>Haven't tried such tricks with 'with-ssh' yet. :-)
<davexunit>I'll try when I have time and report back
<artyom-poptsov>It would be great.
<davexunit>GuixSD badly needs a NixOps equivalent, and guile-ssh is the perfect building block
<davexunit>the distributed computing features will especially come in handy
<amz3>immutable infrastructure through immutable code :)
<davexunit>:)
<amz3>I stumbled upon this term recently "immutable infrastructure"
<davexunit>not sure how I feel about it
<amz3>the other interesting term is "infrastructure as code"
<davexunit>that is good
<davexunit>"immutable infrastructure" seems to mean "throw the VM out when you make a change and build it again"
<davexunit>because config management systems are all garbage.
<amz3>immutable infrastructure means you can rollback to a previous version, with dependencies all setup
<amz3>davexunit: at least from imperative people the VM are not rebuilt, they are stored
<amz3>seems like tangled code to me, but I never dealt with it yet
<davexunit>I think they are doing immutability at the wrong level to work around the lack of functional package/config management
<unknown_lamer>davexunit: hey, propeller is pretty good config management ;)
<davexunit>hehe
<davexunit>propellor is fun, for sure.
<unknown_lamer>I wish I had the mental capacity to transform domtool into something more useful too
<davexunit>but propellor is still working within crazy Debian/Red Hat land.
<unknown_lamer>if only I had realized the "competition" wasn't really any better when domtool was new...
<unknown_lamer>1. port ghc to guile-vm 2. infinite suffering 3. profit
<amz3>:)
<unknown_lamer>I really don
<amz3>guile-vm can host static languages?
<unknown_lamer>t like the whole use a vm template and throw it away thing...
<unknown_lamer>amz3: there's a reason step 2 is infinite suffering
<amz3>nalaginrut: I tried to port my nanoblog project to artanis, but failed at step 0
<amz3>nalaginrut: guile states that there is a syntax error with a macro I wrote
<amz3>nalaginrut: but it works fine in my code without artanis :/
<amz3>I'm not sure how you can help. I'll paste the error
<amz3>nalaginrut: https://friendpaste.com/17q8jvyPzmaERya5Zv0mNp
<amz3>I don't think it's related to wiredtiger
<amz3>when I comment the procedures that contains query* it works
<amz3>here is the definition of query* https://git.framasoft.org/a-guile-mind/nanoblog/blob/master/uav.scm#L133
<amz3>It doesn't seem related to artanis actually
<nalaginrut>amz3: if you use `match', I recommend you not use `else' but `_' for non-matching, this seems unreasonable and maybe a bug of (ice-9 match)
<nalaginrut>maybe this is unrelated to this issue too...
<amz3>ah ok
<amz3>good to know
<amz3>right now I only pasted the code from hypermove.scm in a nanoblog.scm file with artanis imports and server init and I (run) the server
<nalaginrut>hmm
<nalaginrut>when do you call `match'?
<amz3>match?
<amz3>I call match in the handler of the old guile server
<amz3>if I comment it it continue to fail
<amz3>how is this related to match?
<amz3>nalaginrut: ^
<nalaginrut>but I saw the error is failed to match
<nalaginrut>failed to match any pattern in form
<nalaginrut>oh, it's macro expand
<amz3>yes, i think so
<amz3>I checked the fluid id, it's not mine
<amz3>I mean it's not the fluid id I use, I don't know what it is
<nalaginrut>hmm...but you haven't used any thing from Artanis, right? could you remove (init-server)
<nalaginrut>amz3: seems may people dropped, are you still here?
<amz3>yes
<nalaginrut>seems there's DDOS against freenode?
<amz3>yeah, that's what I've read
<amz3>not sure why it's a target
<nalaginrut>amz3: could you try to remove (init-server) then run it
<amz3>nalaginrut: it doesn't do, but when I remove everything artanis it works
<amz3>nalaginrut: do you define a query* macro?
<amz3>I should have checked all that
<amz3>there is not query* in your code
<nalaginrut>I think no
<nalaginrut>how about just import artanis but use nothing from it
<amz3>ACTION trying
<nalaginrut>and don't use `run' from Artanis
<amz3>it's ok
<nalaginrut>amz3: could you try it in REPL, and paste a backtrace
<nalaginrut>amz3: oh, I forget to ask your Guile version
<amz3>guile 2.1.1
<amz3>forgot to mention
<nalaginrut>amz3: btw, there's `where' macro in SSQL
<amz3>ah!
<amz3>that might be the thing
<amz3>let me check
<nalaginrut>and btw2, I've encountered macro expanding bug in 2.1 before, but that bug is fixed now
<nalaginrut>you have to check the first, first ;-P
<amz3>thx nalaginrut!
<amz3>it runs now :)
<nalaginrut>nice~
<amz3>also it looks better
<amz3>because I use :where instead
<nalaginrut>amz3: I wonder how did you fix it properly?
<nalaginrut>oh cool
<nalaginrut>I thought you import artanis with a prefix, that's another approach
<amz3>I replaced in the macro the extra keyword where by :where and updated the code properly
<amz3>that's an idea
<nalaginrut>anyway, congrats! I have to go to bed ;-P
<amz3>nalaginrut: good night thanks :)
<nalaginrut>good night
<amz3>now I can use artanis :)
<nalaginrut>yeah, enjoy and report ;-P
<amz3>nalaginrut: since you don't want to sleep for the real, does the cookie support works ?...
<nalaginrut>yes it works (but I really go to bed now)
<amz3>it's not covered in the tutorial
<amz3>ok
<nalaginrut>amz3: when you find nothing in manual, example/test.scm is your friend too https://github.com/NalaGinrut/artanis/blob/master/examples/test.scm#L151
<amz3>thx
<dsmith-work>Wednesday Greetings, Guilers
<wingo>greets dsmith-work
<dsmith-work>wingo: I see the unboxed 64's code is in.
<wingo>yes!
<wingo>you'll have to do the make clean dance
<wingo>but yeah, good times :)
<wingo>moooo
<holomorph>moo
<roelj>Is there a database module I can use with Guile? (I'm most interested in PostgreSQL and/or SQLite)
<artyom-poptsov>roelj: Take a look on Guile-PG.
<artyom-poptsov>roelj: http://www.nongnu.org/guile-pg/
<dsmith-work>and guile-sqlite3
<roelj>Thanks! those look good
<paroneayea>there's also guile-squee but honestly it's pretty young
<roelj>I see it uses FFI.
<paroneayea>roelj: right
<roelj>That may be nice.
<roelj>Thanks
<davexunit>it will be the preferred way to use postgresql from guile
<davexunit>when it's been hacked on a bit more
<roelj>Why?
<davexunit>guile-pg is crufty and written in c
<davexunit>squee is pure Guile
<roelj>Oh right.
<roelj>Sorry for asking, but what is so bad about writing parts of Guile modules in C?
<davexunit>they are harder to hack on and harder to install
<davexunit>if you want to change a part of a C extension, you have to stop the program and recompile
<roelj>Alright.. So instead you write wrapper functions in Guile to work with an existing C API?
<davexunit>yes
<davexunit>as opposed to writing wrapper functions in C to work with an existing C API
<dsmith-work>And when (not if!) Guile has a native-machine compiler, it may be faster as well.
<roelj>Alright
<wingo>the thing for me is that having a significant part of your program in c means you have an unnatural discontinuity in your program
<davexunit>yes
<roelj>Oh, how would it be faster?
<roelj>Yes, I can understand the feeling of an 'unnatural discontinuity'.
<wingo>roelj: there is a cost for going back and forth between guile and c. if the c wrapper calls a scheme procedure for whatever reason,
<wingo>that will be slower than if the wrapper were written in scheme
<roelj>wingo: But I don't think a wrapper written in C should ever need to call a Scheme function.
<artyom-poptsov>roelj: I needed such calls to implement callbacks that an underlying C library uses.
<artyom-poptsov>As an example.
<wingo>yeah
<wingo>a lot of my code ends up needing to do that, it could be your libs are different
<roelj>The reason I started writing stuff in Guile is because I knew that when I couldn't get something done quickly enough, I could write a C function instead (which I'm used to). I really think that is a great feature of Guile..
<dsmith-work>roelj: There are other reasons too. The compiler might be able to pass in native types, but the C wrapper will always need to convert from SCM -> C -> SCM.
<wingo>dsmith-work: i think for the forseeable future, the calling convention in compiled scheme code will always be tagged values (SCM values)
<wingo>dunno
<dsmith-work>ACTION is hopeful
<wingo>maybe for well-known procedures we can relax that...
<wingo>hummm
<dsmith-work>wingo: I thought CL compilers were able to do that.
<wingo>dsmith-work: that sounds unlikely to me fwiw
<dsmith-work>ok
<dsmith-work>"Nevermind"
<wingo>the one thing that we can do is have optimized calling conventions for primitives
<wingo>well, it's not a bad idea :)
<wingo>roelj: another way guile can be faster is because it can allocate off of a freelist that's closer to hand, so to speak
<dsmith-work>wingo: make check is happy at work BTW (64bit 4-core)
<roelj>But how do Guile primitives get processed by a processor?
<wingo>using scm_gc_malloc et al will get to a freelist via a thread-local variable
<wingo>roelj: not sure i understand your question, but i am getting sleepy, so talk to you tomorrow :)
<roelj>wingo: Ok, sorry :) See you tomorrow
<paroneayea>btw wingo, did you see https://www.cs.utah.edu/plt/scope-sets/
<paroneayea>basically racket redid the way they did hygiene, theoretically making it conceptually cleaner
<paroneayea>I don't know if it actually is or not, but thought you might find it inetersting