IRC channel logs

2014-11-20.log

back to list of logs

***cluck` is now known as cluck
<nalaginrut>morning guilers~
<sneek>Welcome back nalaginrut, you have 3 messages.
<sneek>nalaginrut, ArneBab says: I now created the last release before the SRFI, so I’d be very interested in your comments on the parts you already read!
<sneek>nalaginrut, ArneBab says: did you think of something like this? http://draketo.de/proj/wisp/src/474cedeb0f8ec4bcab5c7a7f84f3b427e80d9109/tests/sxml.w.html
<sneek>nalaginrut, ArneBab says: or like this (more complex version): http://draketo.de/proj/wisp/src/648454658765b918dc03cccfbb6513dc9803d647/tests/sxml.w.html
<nalaginrut>ArneBab: yes, something like that, but may I expect more? ;-)
<nalaginrut>you know, as a template, there'd be code embedded in, and should be eval when rendering
<nalaginrut>I expect 'code' tag and it could be eval
<nalaginrut>dunno if it's possible to be added into wisp, maybe I should modify its reader?
<cky>nalaginrut: Since you're on Quora, you might like this: https://www.quora.com/Why-does-0-1+0-2-does-not-equal-to-0-3-in-most-programming-languages/answer/Chris-Jester-Young (not related to Guile, but it's such a common programming question that someone would eventually ask it about Scheme ;-)).
<nalaginrut>oh nice
<nalaginrut>I'll read it, thanks ;-P
<nalaginrut>cky: yes, it's a frequently-asked-question
<cky>Yeah. :-)
<nalaginrut>ArneBab: how can I do (display (format #f "asdf: ~a" (1+ 99))) ?
<nalaginrut>I mean, the second expr contains two more sub expr
<nalaginrut>maybe I should use two tabs indent for that?
<ArneBab>nalaginrut: wisp expects indentation by spaces
<nalaginrut>it's fine for Emacs
<ArneBab>nalaginrut: first line: display (no indent), second line format #f "asdf: ~a" (some indent), third line 1+ 99 (more indent)
<nalaginrut>how many spaces could be one indent?
<ArneBab>or you can simply use `display : format #f "asdf: ~a" : 1+ 99` on one line (but the inline-colon only works for the last expression in the line)
<nalaginrut>or at least one?
<ArneBab>nalaginrut: at least one
<nalaginrut>ok
<nalaginrut>ArneBab: is it possible to run code in the sxml?
<nalaginrut>like this shows: http://slim-lang.com/
<ArneBab>nalaginrut: I defined the sxml with quote. If I had used quasiquote, I could have simply run code with ,(code)
<nalaginrut>hmm...I think I have to add quote for users, but it's easy to do
<ArneBab>or you could provide templates as the “message” in the second example
<ArneBab>message is replaced when going from template to template2 by match
<nalaginrut>I want to provide the template as a independent file
<ArneBab>I guess it could either be a module or it could be a script to run
<nalaginrut>the template should be eval on the fly (rendering)
<nalaginrut>so don't have to be a module
<nalaginrut>fortunately we have local-eval
<ArneBab>it should be easy to create markup for running code
<nalaginrut>that's nice to implement template easier
<ArneBab>it actually is: I’m doing that in the example ,(map loop a)
<ArneBab>that example could also run all code in a
<nalaginrut>yes, it works
<nalaginrut>I just think if it's possible to reduce , or ` or , or ,@
<nalaginrut>since the designer may not comfortable with them
<nalaginrut>template is for them
<ArneBab>you can spell ` as quasiquote, that already makes it look easier
<ArneBab>but for the template, the match I’m using shows that you don’t even need that
<nalaginrut>yes, I will add (quasiquote ...) after I read the template as a s-expr
<nalaginrut>then I can eval it
<nalaginrut>I don't want users add quasiquote themselves
<nalaginrut>I prefer the template looks similar to plain html
<ArneBab>like this? define-template <name> body ... → define name : quote body
<ArneBab>and then use match to replace (scheme body ...) by ,(body)?
<nalaginrut>I think it's `(quasiquote ,(call-with-input-file "xxx.tpl" read))
<ArneBab>doesn’t that mean that the template is read from disk on every run of the code?
<nalaginrut>oh, it could be optimized with a cache
<nalaginrut>but trivial in this case
<ArneBab>so you want it to always reload automatically when the template is changed?
<nalaginrut>this could be optional
<nalaginrut>I just want to split template and the code
<nalaginrut>designers don't know any Scheme code
<nalaginrut>they just write the template like html
<nalaginrut>and reference the var name
<nalaginrut>the var is set in the model
<nalaginrut>and template is the view part
<nalaginrut>MVC pattern
<ArneBab>that should be doable with both methods (match or including the tree directly)
<ArneBab>I’m a bit wary about including the code directly, because that could breed closer coupling.
<nalaginrut>I've already done it with SXML and php like template
<nalaginrut>I want to provide a readable way for wisp
<nalaginrut>more readable
<nalaginrut>ArneBab: no, although it's possible to include the code, it shouldn't allow
<nalaginrut>the code is actually, just a var
<nalaginrut>it's better
<ArneBab>I guess you can experiment with it - it’s a design question not a language question.
<ArneBab>8
<ArneBab>nalaginrut: I don’t know enough about the larger structure so my input can mostly be shooting into the blue…
<ArneBab>blind shooting ☺
<ArneBab>(shooting into the blue is a germanism)
<nalaginrut>ArneBab: yes, it's design question, I'm just not familiar with wisp at present, or my idea maybe clearer
<nalaginrut>I hope I don't have to modify the reader
<nalaginrut>;-)
<ArneBab>nalaginrut: you could just use (wisp-scheme-read-file name) instead of (with-input-file ... read)
<nalaginrut>alright, it's cool
<nalaginrut>you remind me to implement template cache
<nalaginrut>I forget it
<ArneBab>I’ll try :)
<nalaginrut>you'll like it if you want to build dynamic site
<ArneBab>I guess so
<ArneBab>(I’m mostly building static sites nowadays, because I realized that I no longer have enough time to maintain my sites well enough that they are safe against crackers)
<civodul>Hello Guilers!
<nalaginrut>heya
<nalaginrut>ArneBab: one of the aims of Artanis is to make it safe, and easier
<nalaginrut>but it's fine, since static sites is popular these days
<cky>ArneBab: As I mentioned in my comment: 1. decent Scheme implementations (including Guile, thankfully) will also return true for `(= (#e0.1 #e0.2) #e0.3)`. 2. exact numbers are awesome when you need more than 53 bits of precision for stuff: http://stackoverflow.com/a/24101699/13 (pure-Scheme implementations of SHA-2).
<ArneBab>cky: I agree (and sha256 in scheme looks nice!). I also have an example for that: http://draketo.de/english/exact-math-to-the-rescue
<ArneBab>the code in the link did not work at all in Python, but works really nicely in Guile (because intermediate numbers are huge)
<cky>Yeah, the things that exact numbers enable are amazing.
<cky>ArneBab: Wow, you have a pretty low userid on Stack Overflow. Nice!
<ArneBab>cky: that’s coincidence on when someone finds a site :)
<cky>ArneBab: Hehehehe. (In my case, my userid is not coincidence. ;-))
<cky>ArneBab: During the Stack Overflow private beta, you needed a special password to get onto the site. I found a way to bypass that password check, so I was able to create an account ahead of others.
<ArneBab>wow…
<ArneBab>that’s a well deserved low ID then :)
<cky>:-D
<dsmith-work>Morning Greetings, Guilers
<daviid`>hello guilers
<Chaos`Eternal>helo, guilers
<sneek>Welcome back Chaos`Eternal, you have 1 message.
<sneek>Chaos`Eternal, nalaginrut says: Even errno is thread-safe now (because of TLS), it may not be safe in a specific thread, since it's global in a thread. If you can't guarantee to fetch errno value immediately after any possible change, then safe issue is suspended. That's why I said "errno is still a problem in a thread". Anyway, just for a mention. ;-)