Perl 6 - the future is here, just unevenly distributed

IRC log for #darcs, 2015-07-13

| Channels | #darcs index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:05 mizu_no_oto joined #darcs
00:08 pointfree Mind if I add my name to the list of marketing people here? http://darcs.net/DarcsTeam#marketing-team
00:51 lf94 joined #darcs
01:30 mizu_no_oto joined #darcs
02:37 mizu_no_oto joined #darcs
04:07 byorgey joined #darcs
04:07 byorgey joined #darcs
04:44 Pastaf joined #darcs
05:34 notdan maerwald: what about just getting rid of `<%` and `%>`?
05:34 notdan (instead of wrapping it in the div)
06:47 alexei___ joined #darcs
09:05 Pastaf joined #darcs
09:43 amgarchIn9 joined #darcs
10:56 mizu_no_oto joined #darcs
11:09 maerwald notdan: then you get type errors
11:35 notdan uh I think I figured it out
11:35 notdan if you have something of type XML you can just turn it into DDXML by `return`ing it
11:35 notdan frontPageContent = return $ cdata $ T.pack "helloWorld"
11:37 notdan DDXML = GenXML (HSPT XML IO) = XMLGenT (HSPT XML IO) (XMLType (HSPT XML IO)) = XMLGenT (HSPT XML IO) XML
11:37 notdan so DDXML is just an XML wrapped in a monad burrito
11:48 notdan I actually like the type burrito madness in HSP; it's very general. Just not very fond of mixing code and HTML with preprocessing step
11:49 maerwald I think it's the biggest anti-pattern in haskell these days
11:50 maerwald which is a sign that we haven't properly figured out yet how to combine and stack effects
11:52 notdan monad transformers?
11:52 notdan I don't know, maybe it's not very good, but it beats having an untyped language
11:53 notdan and mtl-style libraries are modular
11:54 notdan hm, all this talk about monads made me pretty hungry
11:54 notdan brb lunch
11:54 maerwald lol
12:17 maerwald notdan: well, I don't think DDXML is what you think it is, see this error message
12:17 maerwald Expected type: XML -> DDXML
12:17 maerwald Actual type: XML -> XMLGenT (HSP.Monad.HSPT XML IO) XML
12:17 maerwald that's what I get when I use return
12:18 maerwald if DDXML === XMLGenT (HSPT XML IO) XML then the type error does not make sense
12:19 maerwald oh right, it does not make sense
12:19 maerwald you are correct, the type checker just throws crap... the error was in a totally unrelated line (god, I don't want to know why that causes this error message)
12:26 maerwald http://hub.darcs.net/maerwald/darcsden/patch/20150713122435-0bd70 this looks cleaner now
13:35 notdan :D
13:41 maerwald :/
13:42 maerwald this would have been easier in ruby :P
13:42 maerwald afair it has a native xml type
13:43 maerwald notdan: what do you think about "maybeReadFile :: FilePath -> IO (Maybe String)".. maybe add documentation?
13:43 maerwald (what a pun)
13:44 maerwald I'd even consider writing something like "strToDDXML = return . cdata . pack"
13:45 maerwald 2 weeks from now on I will have forgotten how to do it
13:50 notdan I think it's a decent function. I'd either add documentation or call it readFileIfExists
13:50 notdan or something like that
14:00 maerwald http://hub.darcs.net/maerwald/darcsden/patch/20150713135410-0bd70
14:01 maerwald omg, typo, I am terrible
14:53 byorgey joined #darcs
14:53 byorgey joined #darcs
15:37 kaol joined #darcs
15:37 vikraman joined #darcs
15:37 MasseR joined #darcs
15:37 lelit joined #darcs
15:37 burp joined #darcs
15:38 Meeh joined #darcs
15:50 carter_cloud joined #darcs
15:55 Riastradh joined #darcs
17:08 sprang joined #darcs
17:08 notdan Heffalump: ping
17:55 maerwald sm: did you have a look at the patch? Do you want strict file reading maybe?
17:59 sm maerwald: sorry, haven't had time yet
17:59 sm is there a demo ?
18:00 maerwald no, you have to pay the full price
18:00 maerwald :D
18:01 maerwald sm: you want the frontPage.xml files etc?
18:02 sm I don't know :)
18:02 maerwald :o
18:02 maerwald well, just copy paste your modifications to the code I guess
18:04 sm maerwald: I just looked at the patch. Sure, it would be nice to include the default templates somewhere folks can easily enable them
18:05 maerwald right, I just can't figure that out properly from looking at the html code :P
18:05 sm what kind of reduction in performance do you see with siege or ab or similar ?
18:05 maerwald oh, haven't tested yet
18:05 sm is there any value in adding some simplistic caching like I did for darcs hub front page content ?
18:06 sm probably rendering HSP is fast, might be nice to time that too
18:10 sm also any obvious fragility with it ? eg what if you have one template but not the others, a filename with the wrong case on osx (I can test that), a misencoded template, a non-ascii template with no system locale set (LANG=C), a malformed template, an empty template, a template with malicious content..
18:10 sm would be nice if the site can stay up regardless
18:11 maerwald sm: you want runtime validation for the content?
18:11 maerwald how do we do that?
18:12 sm I dunno, if you get an exception while rendering then show the built-in content and a warning instead ?
18:13 sm this is not a merge blocker, I'm just brainstorming
18:13 maerwald servePage (Hub.frontpageP us rs) s
18:13 maerwald is that where exceptions are thrown?
18:14 sm not sure, I don't have that code swapped in my brain just yet
18:16 sm I guess it's not really important
18:16 maerwald I think it currently just sends the "broken" html code if it is broken
18:17 notdan yeah, cdata doesn't do any parsing, it just embeds the text as it is
18:17 maerwald is there a safe cdata thing?
18:18 maerwald we'd just need: safeCDATA :: String -> XML
18:18 maerwald and return a warning page in case the string is garbage
18:18 sm I'm thinking if a busy site admin makes a "harmless" edit to a template and forgets to check the site, is it possible to take the site down ?
18:19 sm if so, just document it
18:19 maerwald sm: you mean while darcsden is running?
18:19 sm yeah. I assume you can tweak templates while the webapp is live ?
18:20 maerwald I don't think it re-reads the file, doesn't seem so
18:21 maerwald we'd need some sort of "reload" for darcsden I guess
18:21 maerwald like normal webservers
18:21 * sm is crushed
18:21 sm I thought that was the point of this
18:22 maerwald the point was to make it configurable without modfying source code
18:22 sm ok, so this just moves the templates out of haskell into separate files - you still need to recompile ?
18:22 maerwald no
18:22 maerwald but you need to _restart_ darcsden
18:22 maerwald unless we have a reload function
18:22 sm ah.. just a restart. Got it
18:23 sm can you still reference any names in scope at the template call site, or do you have to marshal them in some way ?
18:23 maerwald I'm not even sure if it is desired that something like that works without restarting the server
18:24 maerwald sm: you mean call haskell functions inside the plain xml?
18:24 sm in HSP right now you can IIRC call haskell functions, have arbitrary haskell expressions, and reference any names that are in scope without having to pass them in specially
18:24 sm is that still the case ?
18:25 maerwald sm: nah, it's not HSX inline stuff, it is xml stuff, javascript works ofc
18:26 maerwald you'd have parse it during runtime somehow
18:26 maerwald that will be quite challenging
18:26 maerwald maybe even impossible
18:26 sm oh, so it's just static
18:27 maerwald not sure what you mean with static... the code is static :P
18:27 sm it's static content (aside from js tricks). I thought it was still HSP content that you could interpolate things in
18:28 sm anyway I'll have to give it a try, for sure
18:28 maerwald in that case you would probably have to recompile it anyway
18:28 notdan sm: if you start throwing interpolation in you will probably end up with your own templating system :P
18:28 maerwald I don't see how you can have HSP content without recompilation
18:28 maerwald and then the whole xml file configuration idea becomes a moot point
18:29 sm yes probably HSP doesn't support that. Some of the other templating systems do (but they have other disadvantages)
18:29 maerwald sm: which ones?
18:29 sm heist
18:29 maerwald let's switch
18:29 maerwald :D
18:30 sm I wasn't able to figure it out, but you probably can :)
18:30 maerwald it will probably involve a lot of ranting...
18:31 sm there are others too, I forget which. http://stackoverflow.com/a/5771359 are some
18:32 maerwald sm: I feel the combinations of libraries in darcsden is a bit uncommon anyway or I am wrong here
18:32 sm the dynamic templates pretty much all require that you pass in your dynamic parameters AFAIK, which adds overhead when you're refactoring UI
18:32 sm separate template files also add overhead by separating handler and template code that are intimately connected
18:33 sm there are advantages too, but these are worth mentioning I think
18:34 sm I've been keen on anything that would reduce friction in improving darcsden UI
18:35 maerwald I'm not much of an UI guy. The things I am interested in is proper https support for darcsden and email notifications
18:35 maerwald and both are not every easy to do
18:36 sm maerwald: certainly darcsden's deps are outdated, it's old
18:36 notdan s/old/time-tested/
18:36 maerwald rock-solid...
18:37 sm it's not too bad..
18:37 * sm checks uptime
18:37 maerwald well, it has documentation in some places
18:37 maerwald the entry barrier is not that high
18:37 maerwald I can't say the same about darcs ;)
18:38 maerwald apart from that "patch theory" stuff which sounds scary... I don't understand the rest of it either :o
18:38 maerwald but then again, git code is worse
18:39 sm maerwald: yes, darcsden is a much easier way to get into darcs-related hacking I feel
18:39 sm it could be a lot nicer with more cleanup
18:40 maerwald sm: the module hierarchy is fragile... I tried to refactor some stuff a while ago and instantly ended up with circular imports
18:40 sm so it's great to have folks working on it
18:41 notdan http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.110.7346 here's a paper about HSP
18:41 notdan by the author of hsp
18:41 sm I find that's true with most non-trivial haskell apps.. and resolving that tends to push it toward a clearer architecture
18:42 sm nice, yes that's recommended
18:42 sm even though things have changed
18:43 sm afk a bit o/
18:46 Heffalump notdan: I'm sort of around now, but only with a phone so can' t talk much for an hour or so
18:48 byorgey joined #darcs
18:48 byorgey joined #darcs
18:51 Pastaf joined #darcs
18:57 MasseR joined #darcs
19:33 * Heffalump reappears properly
21:34 maerwald joined #darcs

| Channels | #darcs index | Today | | Search | Google Search | Plain-Text | summary