IRC channel logs

2013-06-26.log

back to list of logs

<nalaginrut>morning guilers
<nalaginrut>~
***ijp` is now known as ijp
***janneke1 is now known as janneke
<brendyn>Anyone thought of implementing Clojure ontop of Guile? :P?
<ijp>just you
<brendyn>Must be silly then
<ijp>actually, come to think of it, technomancy on #emacs suggested it for after guilemacs becomes mainstream
<brendyn>I have been reading about Clojure and it seems people think it is very nifty, and will gain popularity. So atleast from a tactical perspective, if it was ontop of guile too that could get guile some more attention
<brendyn>Do you have an opinion on it?
<ijp>in three letters M E H
<brendyn>Is that this one http://www.emacswiki.org/emacs-en/GuileEmacs ?
<brendyn>Not particularly excited about it? Do you use scheme andor guile for most of your programming?
*DerGuteMoritz started a clojure->chicken compiler but didn't get all that far
<DerGuteMoritz>some things already work but notably missing are the proper persistent data structures ;-)
<DerGuteMoritz>then there is also a project to reimplement emacs in clojure
<DerGuteMoritz>but I doubt that this is likely to succeed
<brendyn>:O
<brendyn>Like rewrite all of emacs?
<brendyn>or the bit above the C core?
<brendyn>DerGuteMoritz: can that be translated to clojure->guile or is it somehow very chicken dependant?
<brendyn>i hardly know how language implementations even work ;p
<lloda>Doesn't Clojure depend on the jvm? does it make sense to have Clojure without all the Java libraries.
<DerGuteMoritz>brendyn: AFAIK all of emacs, yeah
<DerGuteMoritz>brendyn: it should not be too hard to port to guile, I can give you the address of the repo, just a minute
<DerGuteMoritz>lloda: it doesn't depend on the jvm, no. e.g. there is also a clojure->js compiler
<brendyn>lloda: Yeah, clojurescript
<brendyn>it just means you wont get all the java stuff. but im interested anyway because it seems to make advances as a language alone
<brendyn>DerGuteMoritz: seems pretty crazy to try catch up on 30 years of development from scratch. im keen on guileemacs
<DerGuteMoritz>brendyn: yeah my thought exactly
<DerGuteMoritz>brendyn: https://bitbucket.org/DerGuteMoritz/chicken-clojure
<brendyn>nice
<DerGuteMoritz>it is a bit of a prototype and shows some evolutionary scars I think
<DerGuteMoritz>but feel free to use it
<brendyn>i would not notice, im still only a beginner really
<DerGuteMoritz>alright
<DerGuteMoritz>let me know if you have questions
<brendyn>im wondering if scheme or clojure is a better place to start learning
<DerGuteMoritz>learning to program?
<DerGuteMoritz>for learning to hate Java, Clojure is a better choice
<brendyn>yeah i realise clojure is better than java its self
<brendyn>I was a bit concerned though that whein I load up a clojure repl, java uses about 700MiB of ram and gets my fan going
<brendyn>i hope actual clojure programs dont have to do that by default?
<DerGuteMoritz>kindof
<DerGuteMoritz>that was my main motivation for trying to write chicken-clojure actually :-D
<brendyn>:(
<brendyn>i have not looked at chicken, only guile
<nalaginrut>DerGuteMoritz: just front-end?
<DerGuteMoritz>nalaginrut: how do you mean?
<nalaginrut>you plan to write a clojure front-end? or a java bytecode converter?
<DerGuteMoritz>nalaginrut: sorry, got interrupted
<DerGuteMoritz>nalaginrut: it's a chicken program that reads clojure code, emits chicken code and then compiles that
<DerGuteMoritz>using the chicken compiler, of course
<DerGuteMoritz>so it's not really a chicken compiler frontend in that sense
<DerGuteMoritz>(or backend?)
<DerGuteMoritz>it's more of a ... TRANSPILER
<brendyn>but chicken code is just scheme?
<DerGuteMoritz>yeah, with some non-standard extensions
<DerGuteMoritz>e.g. as it implements R5RS it has a custom module system
<brendyn>can you do much with it? seems like the lack of librarys in comparison to something like the jvm is problematic?
<wingo>TRANSPILER
<wingo>TRANSPILE ALL THE THINGS
<DerGuteMoritz>heh, the T word
<DerGuteMoritz>brendyn: oh it actually has quite some libraries, and also interfacing with C libs is easy as chicken TRANSPILES to C
<DerGuteMoritz>(brb)
<brendyn>:O i have not used C
<brendyn>wingo: said it was a sin (lol)
<wingo>c is cinful
<brendyn>oh, i just downloaded your tekuti
<brendyn>but /blog/admin does not exist
<wingo>yes, it's not the easiest thing in the world to set up... the wingolog.org/software/tekuti page has all i know about it though
<DerGuteMoritz>cin is a C++ thing
<brendyn>im interested in starting a blog, even if i dont show it to anyone. ive discovered that writing about my ideas as if to an audience helps me develop them
<brendyn>so im wondering what software might be good for that
<brendyn>haha "... will stop growing, and decline as pieces that are now written in C will be written in Python, in JavaScript, in Guile"
<brendyn>plans for guile supremity?
<ijp>a lot of people write their own blogging software, I know I did
<brendyn>i woudnt know how
<DerGuteMoritz>yeah, blog software is the ultimate yak
<DerGuteMoritz>I made mine a static HTML generator
<DerGuteMoritz>which is nice as you don't have to worry too much about operations
*fbs uses pelican
<DerGuteMoritz>I think this is in violation of the Lisp Party Ethic though
<DerGuteMoritz>ยง 2 b) We are obliged to give a parenthetic shaving to every yak we encounter.
*ijp stopped paying party dues
<brendyn>what tools do you use for your blog?
<DerGuteMoritz>ijp: don't tell the guys over at #lisp :-)
<DerGuteMoritz>brendyn: I use hyde (http://api.call-cc.org/doc/hyde)
<DerGuteMoritz>ah damn it, the documentation still claims that there is no native markdown implementation
*DerGuteMoritz fixes
<civodul>Hello Guilers
<brendyn>DerGuteMoritz: cool, so basically you never write html or css directly, but type in scheme all day long?
<DerGuteMoritz>brendyn: yeah!
<brendyn>nice :D
<DerGuteMoritz>except the post contents themselves, I currently write them in svnwiki syntax
<brendyn>ill have to figure out how to do this begind nginx
<brendyn>behind*
<brendyn>would you recommend chicken scheme for someones first experience programming?
<DerGuteMoritz>brendyn: there is nothing to be had "behind" nginx, you just dump the compiled site into a document root and have it served
<DerGuteMoritz>no, I wouldn't particularly recommend chicken for that purpose
<DerGuteMoritz>its error reporting is not exactly stellar
<DerGuteMoritz>Racket or Guile do a much better job in that regard
<brendyn>mmk, but i cant use hyde in guile?
<DerGuteMoritz>it could easily be ported I think
<DerGuteMoritz>then again, I would build it a bit different today
<brendyn>you helped make it?
<DerGuteMoritz>I'm the main author (remember, the yak)
<brendyn>i remember wingo did wrote something about serving up http with guile but his blog is too big to find it
<DerGuteMoritz>big data!
*DerGuteMoritz starts a hadoop job to search wingo's blog
<brendyn>his search engine seems weird. "http" or "html" werent particularly useful
<brendyn>which makes sense since those words are probably all through any site
<brendyn>what is yak?
<DerGuteMoritz>brendyn: http://catb.org/jargon/html/Y/yak-shaving.html
<brendyn>mmk funny
*civodul reads about Hyde
<civodul>looks cool
<DerGuteMoritz>cool!
<DerGuteMoritz>I don't have my blog code online anywhere alas
<DerGuteMoritz>but C-Keen does, if you are interested, see: http://pestilenz.org/~ckeen/blog/posts/hyde-blog-generator.html
<DerGuteMoritz>the source is here https://github.com/ckeen/hyde-blog
<civodul>nice result!
<brendyn>i need to find some good blogs to get design ideas from
<wingo>my blog search is git grep
<wingo>true fact.
<wingo>a pretty terrible search engine :P
<brendyn>cool blog, although i would narrow the margins since it is known that it makes it easier to read
<wingo>it needs quite a lot of design love, but that's always at the bottom of the list
<brendyn>well that explains white "http" returns almsot everything
<DerGuteMoritz>heh nice @ git grep powered search
<add^_>davexunit: I removed my fork because I fell behind.. Anyway, I'll tell you if I have something I can do.
<davexunit>add^_: sure thing. no worries. :)
<tupi>mkdir does not have a -p option, is this intentional?
<tupi>(mkdir "/tmp/pelota-af08/c")
<tupi>ERROR: In procedure mkdir:
<tupi>ERROR: In procedure mkdir: No such file or directory
<add^_>Huh, weird
<add^_>tupi: maybe you should add that ;-)
<ijp>mkdir is the system call, not the shell script
<nalaginrut_>seems write-date in (web http) is not suitable for Cookies' expired
<add^_>ijp: oh
<add^_>right -.-
<nalaginrut_>Or I missed something?
<ijp>nalaginrut_: probably not, there are far too many different date formats
<tupi>ijp: i think the way it is, if i may say so, in guile, is not good [enough] for users. i understand what you say, but would suggest a 'better' mkdir
<add^_>jao: Howdy :-D
<ijp>tupi: and if we did, the other side of this argument would complain
<ijp>it's a lose-lose
<jao> hi add^_ (and everyone else)
<ijp>there's probably a mode for this anyway, check your manpages
<tupi>ok, i already wrote 'make-dir' which calls the script, tx
<nalaginrut_>ijp: what's the proper way to format a cookie-expired string? how about date->string?
<ijp>what is the format?
<ijp>please $deity let it be ISO 8601
<nalaginrut_>e.gWed, 26 Jun 2013 17:58:07 GMT
<nalaginrut_>e.g Wed, 26 Jun 2013 17:58:07 GMT
<nalaginrut_>and date-write seems ignored local time
<nalaginrut_>but I need local time
<ijp>correct, HTTP dates are always gmt
<ijp>now to check the cookie rfc...
<nalaginrut_>but after I set-cookie: (set-cookie . sid=88afd2936797973d153a6d20532c7202;Domain=localhost;Path=/auth;Expires=Wed, 26 Jun 2013 17:58:07 GMT;HttpOnly)
<nalaginrut_>the browser send only sid=... without expire
<nalaginrut_>that makes artanis always count it as session-cookie
<nalaginrut_>say, only (cookie . sid=88afd2936797973d153a6d20532c7202)
<nalaginrut_>no expires, no domain or others
<ijp>the browser doesn't send the expires date does it?
<nalaginrut_>hmm...
<ijp>that's not really relevant
<nalaginrut_>but even in the browser, I checked the cookie, it has no expires
<nalaginrut_>anyway, I don't think the cookie was set correctly
<nalaginrut_>but the http header was sent to the browser properly, I think
<ijp>the cookie rfc doesn't seem to say anything about timezones
<nalaginrut_>OK, that's one of the problems, I can ignore the timezone
<ijp>the expectation is utc
<nalaginrut_>but why the browser didn't get the expired time
<ijp>how are you checking?
<nalaginrut_>the browser has the function to show all the cookies
<ijp>you mean document.cookie ?
<ijp>that won't display that information
<nalaginrut_>that
<nalaginrut_>that's one of the way
<ijp>I don't even think you can query this info from javascript
<nalaginrut_>it's not important, I can use other way to show the cookies
<nalaginrut_>in chrome, chrome://settings/cookies
<nalaginrut_>and I found there's only sid left, path & domain & expires went away
<nalaginrut_>I'm not sure, but is it related to Guile's http header parser?
<ijp>write the request out to a string and see
<ijp>but I suspect not
<ijp>hehe, spotted the bug
<nalaginrut_>(cookie . sid=21b511057203856c950e436a902c9a2b), only this
<ijp>nalaginrut_: you realise of course that ; is the scheme comment symbol?
<ijp>use a string, not a symbol
<nalaginrut_>hmm...I think it's formatted to string, I'll check
<ijp>so what you pasted above was not actual code?
<nalaginrut_>it's the actual code
<add^_>:-)
<ijp>then you've commented it out
<nalaginrut_>I think, but it's printed out, maybe not so exact
<ijp>write will escape properly
<nalaginrut_>I suspect if it's commented out, the program shouldn't work
<nalaginrut_>but it works well, except for expires
<add^_>nalaginrut_: just try
<ijp>then paste the actual code with some surrounding context
<add^_>Hm, is it the line 96 in cookie.scm ?
*add^_ shuts up now
<nalaginrut_>add^_: it's update several lines today, so maybe changed from ithub
<nalaginrut_>github
<add^_>ah ok
<add^_>I was actually thinking about using artanis for a project, but maybe I shouldn't? What do you suggest?
<add^_>Maybe I should just make my own, for the fun of making stuff :-)
<nalaginrut_>add^_: if I solve this cookie problem, I think it could be used for some actual work, at least it's my plan
<add^_>ah ok :-)
<nalaginrut_>anyway, I'm writing a guile-on-rails alike thing in lisp-in-summer-project, based on artanis
<nalaginrut_>named ricecat, which would more easy to use than artanis
<nalaginrut_>and I'll invite some friends to give me advices of security
<add^_>ah, security..
<add^_>Probably a challange :-)
<add^_>Unless your using something existent
<nalaginrut_>well, following their advices, the work maybe easier
<add^_>:-)
<add^_>Hope it goes well
<nalaginrut_>;-P
<add^_>Bummer, I've wrecked my guile-dbd-sqlite3 thingy...
<add^_>Oh well
<nalaginrut_>I wish there's dbd-mariaDB ;-)
<ijp>so? bug fixed? or am I going to get to see some code?
<nalaginrut_>ijp: no, I'm trying to dig something with your advices
<nalaginrut_>but I've no idea...
<nalaginrut_>ijp: when I print it out, I can't tell if it's string or symbol
<ijp>so, put a pk in the part where you create the request
<nalaginrut_>(pk req) ?
<ijp>not what I was thinking, but probably works just as well
<nalaginrut_>ijp: (pk req) ?
<ijp>^^ roughly means yes
<ijp>personally, I would have done it only for the headers alist
<nalaginrut_>I encountered some problem...
<nalaginrut_>;;; (#<<response> version: (1 . 1) code: 301 reason-phrase: #f headers: ((server . "Artanis-0.0.1") (date . #<date nanosecond: 0 second: 53 minute: 8 hour: 18 day: 26 month: 6 year: 2013 zone-offset: 0>) (last-modified . #<date nanosecond: 0 second: 53 minute: 8 hour: 18 day: 26 month: 6 year: 2013 zone-offset: 0>) (set-cookie . "sid=c317fdd09569f696824b5c940ef06de4;Domain=localhost;Path=/auth;Expires=Wed, 26 Jun 2013 19:08:53 GMT;HttpOnly") (location
<nalaginrut_>. #<<uri> scheme: http userinfo: #f host: "localhost" port: 3000 path: "/admin" query: "sid=c317fdd09569f696824b5c940ef06de4" fragment: #f>) (content-type text/html) (set-cookie . "sid=c317fdd09569f696824b5c940ef06de4;Domain=localhost;Path=/auth;Expires=Wed, 26 Jun 2013 19:08:53 GMT;HttpOnly")) port: #f>)
<nalaginrut_>seems no problem?
<ijp>okay, so it was a string. That's one thing ruled out
<ijp>is that a newline in the string?
<nalaginrut_>ijp: set-cookie? no
<ijp>or is it just an artifcat of the posting
<ijp>artifact
<nalaginrut_>what artifcat?
<ijp>"In computer science, digital artifacts are anomalies introduced into digital signals as a result of digital processing."
<ijp>in this case, it was introduced by my irc client
<nalaginrut_>well, it's just wrapped by my xchat I think
<nalaginrut_>if there's newline, it shows a strange symbol
<ijp>ooc why are there two identical set-cookie headers?
<nalaginrut_>ijp: it's not two, the second is in uri struct
<nalaginrut_>and the http header was generated from some info of the uri
<ijp>it isn't in the uri struct
<ijp>that would make no sense
<ijp>but anyway, it's irrelevant
<ijp>hmm, maybe you were right about the date
<nalaginrut_>ijp: OK, I see, it's not so normal
<ijp>hmm, no, I was just confused by some other sites cookies
<ijp>it uses a different delimiter, but both seem to be acceptable
<nalaginrut_>ijp: how can I display the final http header string?
<ijp>(call-with-output-string (lambda (out) (write-response res out)))
<nalaginrut_>HTTP/1.1 301 Moved Permanently
<nalaginrut_>Server: Artanis-0.0.1
<nalaginrut_>Date: Wed, 26 Jun 2013 18:30:52 GMT
<nalaginrut_>Last-Modified: Wed, 26 Jun 2013 18:30:52 GMT
<nalaginrut_>Set-Cookie: sid=0b109b969d9a649b7860bad4fc987c06 ;Domain=localhost ;Path=/auth ;Expires=Wed, 26 Jun 2013 19:30:52 GMT ;HttpOnly
<nalaginrut_>Location: http://localhost:3000/admin?sid=0b109b969d9a649b7860bad4fc987c06
<nalaginrut_>Content-Type: text/html
<nalaginrut_>seems OK
<ijp>one reasonable hypothesis is that chromium just treats all cookies for localhost as session cookies, on the assumption that it was only for development
<ijp>but this is just me shooting in the dark
<ijp>try on other browsers?
<nalaginrut_>ijp: but the strange thing is that the browser didn't receive the cookie anymore
<nalaginrut_>I can't see any cookie in the browser now
<ijp>hmmm
<nalaginrut_>ijp: firefox can't deal with 301/302 redirect which is a big problem for Artanis
<ijp>pretty sure it can
<nalaginrut_>well, what's your firefox version
<ijp>more to the point, should you be using nonportable browser features?
<nalaginrut_>20.0, it' can't
<nalaginrut_>301/302 is HTTP
<ijp>so is DELETE and PUT
<ijp>doesn't make them portable
<nalaginrut_>artanis do support them, but I never use them for examples
<ijp>anyway, I'm out of ideas for now
<nalaginrut_>it's so sad that the browser never sent cookie anymore...
<DerGuteMoritz>cookies are annoying :-/
<nalaginrut_>DerGuteMoritz: sorry I didn't response you this afternoon, since I went home, and I didn't saw the last message ;-)
<DerGuteMoritz>nalaginrut_: no problem, what was your question about again?
<nalaginrut_>I'll feedback this morning
<DerGuteMoritz>I forgot
<youlysses>DerGuteMoritz: Cookies are delicious.
<nalaginrut_>DerGuteMoritz: I'm not concerning the clojure, but cookies
<nalaginrut_>youlysses: seems hard to cook ;-/
<DerGuteMoritz>youlysses: heh
<nalaginrut_>DerGuteMoritz: the strange thing is, I format the proper set-cookie in the response, but the browser never store the cookie and never send cookie when GET
<DerGuteMoritz>nalaginrut_: then you probably made a mistake in the set-cookie header
<DerGuteMoritz>it's a PITA to get that right
<youlysses>nalaginrut: 1.) Pre-heat your web-browser to 450 degrees. 2.) ? 3.) Profit!
<nalaginrut_>Set-Cookie: sid=ea505b9ce9f9cb531bad5cc32f98b1e0;Domain=localhost;Path=/login;Expires=Wed, 26 Jun 2013 20:21:24 GMT;HttpOnly
<nalaginrut_>that's the response header
<DerGuteMoritz>is /login intented?
<DerGuteMoritz>this means the cookie will only be sent for paths beginning with /login
<nalaginrut_>I changed / /login /admin ...
<nalaginrut_>but it didn't solve the problem
<nalaginrut_>the cookie is not in the browser anyway
<DerGuteMoritz>try with Max-Age instead of Expires
<nalaginrut_>the browser didn't response the set-cookie
<DerGuteMoritz>it's a bit easier to handle anyway
<nalaginrut_>but I have to make it store in the browser
<nalaginrut_>before that, I can see cookie in browser
<nalaginrut_>but after several update, it can't now
<nalaginrut_>well, I removed domain/path/expires, the browser stored the cookie
<nalaginrut_>seems something is not correct~
*DerGuteMoritz bets it's the Expires param
<nalaginrut_>ok I see
<nalaginrut_>I have some ill-logic in the code
<nalaginrut_>the response handler will generate cookie each time
<nalaginrut_>because browser won't send expires to the server (I guess), so each time response handler returned "cookie: sid=..." which makes the cookie modify to a session cookie
<nalaginrut_>now the expires OK~
<nalaginrut_>the bug is I shared rc-cookie to store both request-cookie and response-set-cookie...
<DerGuteMoritz>as I sai, cookies are terrible
<nalaginrut_>well, some guy here, once told me there's no better way except cookie
<nalaginrut_>anyway, I provide both cookie & session
<DerGuteMoritz>yeah it's the only way to do stateful sessions more or less properly
<DerGuteMoritz>cookie & session?
<nalaginrut_>nice! cookie works~
<nalaginrut_>I don't have to login~
<nalaginrut_>DerGuteMoritz: sorry, it's url rewrite
<nalaginrut_>url write & cookie
<nalaginrut_>hmm...04:07am, have to go sleep
<nalaginrut_>but there's another bug left, when I add path/domain, the cookie won't stored by the browser
<nalaginrut_>anyway, night guys~
<nalaginrut_>zzzZZZ
<add^_>night nalaginrut_