IRC channel logs

2015-12-03.log

back to list of logs

***micro` is now known as Guest34591
<nalaginrut>morning guilers~
<wingo>moin
<nalaginrut>wingo: morning
<nalaginrut>wingo: can 2.1 generate native code in master?
<nalaginrut>I saw there's big progress in vm/assembler
<wingo>nalaginrut: no
<wingo>the difference in master relative to 2.1.1 is that it can unbox double and uint64 values on the stack
<wingo>that's all.
<nalaginrut>ok, nice to know that ;-)
<wingo>:)
<wingo>it's mostly good only for tight floating-point or bitwise loops, where it can avoid allocation
<nalaginrut>yay
<nalaginrut>it's really slow to compile, is it possible to add an option to take advantage of current guile in user's distro to be the first pass compiling?
<nalaginrut>for the user who doesn't care about security so much
<wingo>no, unfortunately
<wingo>yeah compilation time is a problem :/
<wingo>especially these days when we are changing bytecodes and we have to recompile all the time
<wingo>aaah, this is getting nice though...
<taylan>I've been meaning to add Guile to the benchmark game thingy but so far it's on my indefinite-future todo. maybe it's better to wait for 3.0 with native compilation anyway. :P
<amz3>the debian benchmark?
<wingo>wow, i can sum a f32vector that is 1.7 elements long in less than 100ms
<amz3>btw it's 24
<amz3>sorry
<wingo>er
<amz3>1.7?
<wingo>1e7
<amz3>:)
<wingo>:)
<wingo>that's 10ns/iteration
<amz3>an exemple use of this new feature, might be something like data analysis?
<wingo>which is pretty good considering that it's almost certainly memory-bound...
<taylan>amz3: yeah this http://benchmarksgame.alioth.debian.org/
<taylan>ugh, they have new ugly CSS. maybe mobile-friendly.
<amz3>btw it's 24PR, it could be nice for people having libraries PR wishlist... maybe...
<amz3>btw it's 24PR, it could be nice for people having libraries **to make** PR wishlist... maybe...
<amz3>I'll do one for my library :)
<nalaginrut>master failed to compile artanis, I'll keep using guile-2.1 tarball
<nalaginrut>and guile-lua-rebirth is based on 2.1+
<amz3>nalaginrut: you made a lua backend for guile vm ?
<amz3>so you could explain to me how this works, so I can do the same for javascript ? :)
<nalaginrut>amz3: no, it's frontend
<nalaginrut>actually, as a frontend, I could finish it year ago, but I'd like to try some fancy things on it
<nalaginrut>for backend, I think it's better wait 3.0, when x86 backend is done. Then the whole infrastructure design is stable
<amz3>not related, but I installed guile 2.1.1 in /usr and now both guix and artanis fail to properly configure
<nalaginrut>well, I think 2.1 is still useful for radical developer to try new project, but not suit for users to upgrade for other existing packages...
<wingo>nalaginrut: bug report?
<nalaginrut>wingo: to my experience, for such bug, it's better to be lazy, since it'll often disappear magically after several commits, and dunno why. ;-)
<nalaginrut>of course, I will report if it's long time bothering me
<wingo>what was the symptom?
<wingo>just curious :)
<wingo>could be you had old bytecode hanging around, of course
<nalaginrut>I removed things in ~/.cache/guile/*
<nalaginrut>or maybe there're more
<nalaginrut>?
<wingo>no, unless you had old .go files in your artanis builddir or something
<nalaginrut>I think I've cleaned all the objs in artanis dir
<nalaginrut>wingo: ~/.cache/guile is the only place to cache .go files, right?
<nalaginrut>wingo: oh, my mistake, there's still one
<nalaginrut>guile -c "(display (%site-ccache-dir))"
<nalaginrut>well, yes, it works fine now
<nalaginrut>I should keep in mind this, thank you very much! wingo
<nalaginrut>ACTION tweaked `make distclean' for this issue
<nalaginrut>hmm...added `make clean-obj' is better
<wingo>cool
<amz3>porting nanoblog to artanis makes good progress
<amz3>I'd like to move to more complicated stuff, but can't wrap my head around them
<nalaginrut>btw, I would like to add tekuti style git-database, my current blog is based on tekuti, I'd like to port it to Artanis too
<nalaginrut>and git db for blog engine is a better choice
<wingo>you think so? it works for me but sometimes i wonder, it's pretty silly to make a database on git :)
<nalaginrut>wingo: but you don't have to worry about sql-injection
<nalaginrut>it's OK for a pure text record service, just like blog
<nalaginrut>I did several research to avoid SQL-injection in Artanis , but still experimental. Of course, a skilled user know how to avoid it
<nalaginrut>ACTION have to go for a lanparty
<amz3>héllo turbopape
<turbopape>hi amz3 !
<amz3>turbopape: I connected my uav database with minikanren :)
<turbopape>how's life !
<amz3>nice :)
<amz3>and you?
<turbopape>I've seen an email talking about mk, but haven't had the time to delve into it !
<turbopape>I'm fine thanks ...
<amz3>you subscribe the ML! good :)
<amz3>do you know if datomic, does recursive queries? and do you have an example of it?
<turbopape>Nope, I am not really into Datomic...
<amz3>with the syntax I use, I can't express recursive queries without dropping to MK
<amz3>ah ok
<turbopape>But recursion in Clojure world is not too advanced...
<turbopape>JVM limits
<turbopape>you have specific constructs
<turbopape>recur
<turbopape>and trampoline
<turbopape>but in general calling recursively -self- is not considered idiomatic in Clojure
<amz3>at least you have the ability to do it in some case
<turbopape>yeah, but exclusively using recur
<turbopape>or through the launch of higher order functions through 'trampoline'
<turbopape>the cond ( ... (cons something (self (cdr.... is not prevalent in clojure ...
<turbopape>but I worked quite a bit with core.logic (clojure's minikanren implementation)
<turbopape>and it is quite decent
<turbopape>And I did write recursive function goals (I cannot do otherwise...))
<turbopape>Can you resend me a link about mk and wtiger ?
<amz3>turbopape: http://lists.gnu.org/archive/html/guile-user/2015-11/msg00078.html
<amz3>IIRC, if I need a cookie named `cc` I need to declare in the route like (get "/cookie" #:cookies '(names cc) (lambda (rc) ...))
<amz3>nalaginrut: ^
<amz3>I'm wondering why it's not something like (rc-cookie-ref rc "cc")
<amz3>what is that configuration doing exactly, because there is a cookie-ref procedure
<dsmith>wingo, v2.1.1-70-g2468871 32bit 1core, real 424m51.874s
<wingo>dsmith is that better or worse
<wingo>worse i think, yes?
<wingo>by about an hour?
<dsmith>It's better. Was in the 500's last time
<nalaginrut>amz3: how's the rule of 24 PRs? is it ok if I commit to the project I maintain
<nalaginrut>?
<wingo>oh that's good i guess
<amz3>nalaginrut: no, I don't think so :)
<wingo>still, a ridiculously long time
<nalaginrut>oh, too bad ;-D
<dsmith>wingo, Note that that also include ./configure and make check
<wingo>that's pretty fast though, as far as that goes
<wingo>i mean it's the .go compilation that takes forever
<amz3>nalaginrut: it's a event to help people get started with contributing to free software projects
<nalaginrut>amz3: the OHT will preprocess something for you
<amz3>nalaginrut: I fail miserably at helping others with their project so far
<dsmith>wingo, there are at least 3 shift warnings
<dsmith>like
<dsmith>hash.c:213:5: warning: left shift count >= width of type
<dsmith> ret = (((unsigned long) c) << 32) | b;
<dsmith> ^
<wingo>uf
<wingo>that's not good
<dsmith>make check passes though...
<wingo>ah
<taylan>Guile also does the thing where every .go is compiled by a fresh Guile process, right? maybe a hack like in Guix would help there too.
<wingo>that's interesting, if (sizeof (unsigned long) == 8)
<wingo> ret = (((unsigned long) c) << 32) | b;
<wingo> else
<wingo> ret = c;
<wingo>i think i did that so i'd compile and check both ways, but evidently i was doing it wrong
<dsmith>??? Indeed
<nalaginrut>amz3: I have so many things to do for the projects I maintain that I have no time to contribute to others'
<dsmith>Ahh
<amz3>nalaginrut: I don't understand how cookies works, there can be several set of cookies for the same domain? where each cookie has a set of key/value or what?
<dsmith>wingo, now building v2.1.1-75-ga1471e0
<nalaginrut>amz3: you may have set of key/value in one cookie, depends on other condition, like expires, domain...
<nalaginrut>feel free to combine it
<nalaginrut>s/it/them
<amz3>nalaginrut: what does #:cookies '(names nanoblog) ?
<amz3>wait I can have a look at the code
<nalaginrut>amz3: this will register a cookie named "nanoblog"
<amz3>I see you already build a csrftoken :)
<amz3>yes, but when I look at cookies storage in the browser, I don't see 'nanoblog', I only see my key/value cookie, is it internal to artanis?
<nalaginrut>the register is important because cookies will be refreshed to route-context before wrap into a response, this work is done inexplicitly by a hook mechanism
<nalaginrut>amz3: no, this name of cookie is handled by you for ref, but you're talking about the key in a cookie
<amz3>yes
<nalaginrut>so you have to use (:cookies-set! rc 'nanoblog "sid" "123321")
<nalaginrut>then the client will get a cookie "sid"="12321"
<nalaginrut>123321
<amz3>what the purpose of stating 'nanoblog?
<nalaginrut>amz3: you may register multi cookies in a row #:cookies '(names nanoblog article)
<nalaginrut>amz3: it's registered by you
<amz3>it's used to namespace cookies?
<nalaginrut>the name of handler of the cookie
<amz3>I never saw such a feature!
<nalaginrut>amz3: something like that, since you may add multi k/v pairs in a cookie
<amz3>nevermind, I will see later
<amz3>last question, I hope, how do I customize the cookie domain ?
<amz3>:)
<nalaginrut>the manual lack so many things ;-)
<amz3>obviously
<nalaginrut>(:cookies-setattr! rc 'nanoblog #:domain whatever-your-domain)
<amz3>oky
<amz3>thx
<amz3>I have all the elements to build auth in my app
<amz3>without the csrftoken yet
<amz3>I should read a bit of litterature about the subject, because I fear all is lost
<amz3>maybe next year, I'll move to this engine as my blog
<nalaginrut>what's the meaning of nano?
<amz3>I hope I won't be slashdotted ;)
<amz3>meh
<amz3>well... it's because it's a microblogging application, but it's single user
<amz3>unlike GMG and twitter
<amz3>it's not a good name, maybe I'll move to the name 'presence' instead
<amz3>nanoblog is a small microblogging application
<nalaginrut>amz3: so I need to add CSRF to Artanis
<nalaginrut>amz3: sounds like a NOTE application?
<amz3>yes, you are right, right now it's a note application. But hopefully, it's my ongoing project for many time now, to build a single application to manage my "online presence"
<amz3>well 'presence' is a french term too, it's an expression to say mostly the same thing as in english
<amz3>" Immediate proximity in time or space."
<nalaginrut>sounds like twitter anyway ;-P
<nalaginrut>but private?
<amz3>private?
<amz3>it's public
<nalaginrut>I mean not a SNS?
<nalaginrut>with multi users
<amz3>yes, it's not SNS, it's important I think
<nalaginrut>oh right
<nalaginrut>security is a thing, well...
<amz3>right now everything is public, like there is no "draft/hidden" note feature.
<nalaginrut>I don't mean 'private' is closed info/source, I mean it's not a SNS like thing
<amz3>it's really just a toy right :D
<nalaginrut>artanis is just a toy in the beginning, but seems it's becoming a monster ;-P
<amz3>dragons are monsters ;)
<nalaginrut>I think it's too big now, but folks have to bare it before plugins&pkg-manager
<amz3>maybe documentation will alleviate for the complexity
<amz3>I think aiming from something inbetween flask and django is a good target
<amz3>well, flask is already big, let's say muffin
<amz3>but the need a framework are different from the needs of single particular user
<amz3>for instance, I can work around the need for cookies for instance, using basic web auth
<amz3>and so on
<amz3>...
<nalaginrut>I'd like to add OAUTH2
***Guest34591 is now known as micro`
<dsmith-w`>Morning Greetings, Guilers
***dsmith-w` is now known as dsmith-work
<vanila>the new site looks nice!
<vanila>the picture on the front page is great
<davexunit>thanks!
<vanila>I wonder if the new scope sets stuff is interesting to guile?
<davexunit>what is that?
<vanila> http://www.cs.utah.edu/~mflatt/scope-sets/ or https://www.youtube.com/watch?v=ABWLveMNdzg
<vanila>It's a generalization of lexical scope to "macro scope" that works well for hygienic macro system implementation
<davexunit>vanila: this is what was used in racket's new macro expander, right?
<vanila>yeah
<vanila>I've been studying it to make a plain scheme implementation of it
<vanila>Is there a way to compile a guile script/program into a unix binary? I see how to produce .go files
<wingo>vanila: not currently
<wingo>would be nice though!
<csed>So uh. What's the practical difference between (list? ...) and (pair? ...)?
<vanila>I'm just working out how to best port my unzipper program to guile, I think Ill use that script #! thing
<vanila>I've enjoyed learning about compilers from your blog posts wingo
<csed>vanila, wingo: Link? Sounds interesting.
<vanila>there's a whole series http://wingolog.org/tags/compilers
<vanila>the CPS soup one is really cool :)
<csed>vanila: Oh, yeah. I've seen that blog a few times. Cheers. Nice blog, wingo.
<csed>And I think I've actually read the CPS one, yeah.
<taylan>csed: (list? '()) = #t, (list? '(a . b)) = #f, (list? '(a b c . d)) = #f
<vanila>one slight problem I have is I need to write "/usr/local/bin/guile" in full in my script for it to run for the person who wrote the docs, but on my machine i have /usr/bin/guile
<vanila>anyway I'll just put a note about that in a readme
<taylan>vanila: you can use /usr/bin/env if you needn't pass args to guile
<vanila>oh I forgot that trick! that's a nice one
<vanila>cheers :)
<taylan>just don't forget that something like "#!/usr/bin/env guile -f main" won't work
<vanila>oh yeah I see
<vanila>it rejects: #!/usr/bin/env guile \\
<wingo>vanila: tx :)
<paroneayea>damn!
<paroneayea>vanila: that video you posted to is amazing
<vanila>isn't it cool!
<paroneayea> https://www.youtube.com/watch?v=ABWLveMNdzg that one
<csed>taylan: Right, cheers.
<paroneayea>fhf
<paroneayea>oops
<nalaginrut>swift goes open!
<taylan>automatic reference counting over GC in this day and age? no thanks :P
<vanila>is there a pastebin i should use to ask a question?
<taylan>vanila: paste.lisp.org is good. sprunge can be used from the console.
<taylan>sprunge.us that is
<vanila>so here's something I tried http://paste.lisp.org/display/164458
<vanila>make a simple module and compile it - then trying to call it from C, but when I run that C program it says it didn't find a public interface
<vanila>do I need to register the module in some way?
<amz3>sneek: botsnack
<sneek>:)
<daviid>vanila: I don't know, there are examples around and in the manual, I think, but we usually do the opposite, which is we bind a C lib and use it/expand it in scheme
<davexunit>vanila: can you load that module *without* using the C api?
<davexunit>,use (my-mod)
<davexunit>at the REPL
<vanila>I'm trying with scheme only now and I'm running into trouble too - what I'm working on is just: How should I best write a unix command line tool in guile
<vanila>I need to get more aquanted with the module system
<davexunit>vanila: it's best to use pure Guile for everything you can
<neiljerram>Make a file whose first two lines are:
<davexunit>SRFI-37 provides a nice interface for manipulating command line arguments
<neiljerram>#! /usr/bin/guile -s
<neiljerram>!#
<neiljerram>Then put Guile code in the rest of the file
<neiljerram>Is that what you meant?
<vanila>well let me show what I have at the moment
<vanila> http://paste.lisp.org/display/164488
<vanila>I was thinking a setup like this might work: I'd have a folder for all my guile code and add that to GUILE_LOAD_PATH, then scripts in ~/bin could just launch them with (main)
<vanila>strangely it seems to actually work THEN error
<vanila>oh I just realized I'm doing both -e main and (main), that must be the problem
<neiljerram>Yes, that's it.
<neiljerram>The second main invocation is as (main args...)
<neiljerram>So if you just remove "-e main", all should be well.
<vanila>nice!
<neiljerram>I'm slightly surprised myself, as I thought -s and -e were mutually exclusive. But it appears not.
<artyom-poptsov>davexunit: Hi.
<artyom-poptsov>I'm trying to implement a forwarding process using 'with-ssh' as I suggested earlier, but I'm getting a Guile warning when try to 'primitive-fork' a multi-threaded application.
<artyom-poptsov>I think it's because the Guile REPL server handles connections in separate threads.
<artyom-poptsov>Is there a way to start a process out of a REPL server so the process won't die when REPL connection is closed?
<davexunit>artyom-poptsov: threads and forks do not mix
<artyom-poptsov>I see. It's written down in the Guile manual.
<davexunit>artyom-poptsov: why are you forking?
<artyom-poptsov>To keep the forwarding process running when 'with-ssh' closes its connection to a remote REPL.
<davexunit>artyom-poptsov: why not just run a loop?
<artyom-poptsov>Hmm, let me check if it works.
<amz3>to demonize?
<amz3>ACTION try to write an eventloop... https://friendpaste.com/17q8jvyPzmaERya5ZuqroM
<amz3>with real bits of call/cc :o)
<amz3>client is left as exercice, hint: (define (send message) (write message port) (write #\\0 port))
<amz3>the previous version, is a smuggler's eventloop wanna be. It doesn't really work because if you remove the loop-run-once calls inside the call/cc lambda it doesn't work anymore
<amz3>not sure how to make it work with call/cc
<amz3>that said, I made it work with call-with-prompt
<amz3> https://friendpaste.com/17q8jvyPzmaERya5ZvHHFr
<amz3>this doesn't rely on a generic yield/async statment that the issue
<amz3>that's an* issue.
<amz3>this needs more work, but I think that's it
<amz3>... not sure of myself obviously.
<amz3>I see two problems:
<amz3>1) read-scm expect a message in one recv, so instead of read* I must define recv*
<amz3>2) the callbacks set by `loop-add-reader' are not "consumed" so the code repeats itself, which is not the intended behavior
<amz3>in the above snippet, if I (send message) two times, it (pk message) two times, which is not what is expected from the server code
<amz3>(pk (read* client)) is called two times
<amz3>..
<artyom-poptsov>davexunit: Here's what I came up with: https://gist.github.com/artyom-poptsov/bb25d5a7518e889f0ccb
<artyom-poptsov>Surprisingly I wasn't able to share one session between two 'with-ssh' threads; the 2nd one just didn't start.
<davexunit>artyom-poptsov: whoa, cool!
<davexunit>I don't totally understand it just from skimming it, but I will read it over later.
<davexunit>thanks for trying this out!
<davexunit>this should provide a good base
<artyom-poptsov>davexunit: You're welcome.
<davexunit>I'd like to avoid the use of REPL servers that don't die when the connection closes, if possible.
<artyom-poptsov>Let me know if the code won't work on your machine.
<davexunit>artyom-poptsov: will do
<artyom-poptsov>Probably I should add 'stop-repl-server?' option to 'make-node'.
<jchmrt>!afk truste
<jchmrt>oh sry, wrong channel
***amz3 is now known as nl2
***nl2 is now known as amz3
<amz3>nalaginrut: have you seen my eventloop :3
<amz3>I'm trying to connect to IRC without success, even telnet doesn't work..
<amz3>I'm pretty sure the design is ok
<amz3>I need your feedback :)