Perl 6 - the future is here, just unevenly distributed

IRC log for #darcs, 2015-05-14

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

All times shown according to UTC.

Time Nick Message
01:36 favonia joined #darcs
06:05 lambdabot joined #darcs
06:19 alexei_ joined #darcs
06:50 alexei_ joined #darcs
07:54 _loic_ joined #darcs
10:16 maerwald joined #darcs
10:59 maerwald_ joined #darcs
11:44 alexei_ joined #darcs
12:33 Riastradh joined #darcs
13:10 maerwald_ joined #darcs
13:12 maerwald_ left #darcs
13:28 alexei_ joined #darcs
13:38 maerwald joined #darcs
14:29 alexei_ joined #darcs
15:04 alexei_ joined #darcs
15:15 alexei_ joined #darcs
15:41 alexei_ joined #darcs
16:00 notdan joined #darcs
19:07 alexei_ joined #darcs
19:21 * Heffalump appears
19:21 Heffalump maerwald: what does the Data.Reflection stuff let you do that ?settings :: Settings doesn't?
19:23 maerwald Heffalump: class (?x :: Int) => Foo a
19:23 maerwald that does not work for example
19:23 maerwald with reflection it works
19:23 maerwald and you can do multiple concurrent settings
19:24 maerwald but I have obliterated the patch, because the maintainer of the reflection package said I should not use the Given class, but the Reify one
19:24 Heffalump oh, I thought Given was advertised as a simpler option
19:25 Heffalump can't you do multiple concurrent settings with implicit parameters too?
19:25 Heffalump I see your point about superclasses, though you can use constraint aliases to do a lot of the same stuff now
19:25 maerwald I'm not an expert on that front, but the paper from Oleg describes it a bit more in detail http://okmij.org/ftp/Haskell/tr-15-04.pdf
19:26 Heffalump yeah, I'm aware of the implicit configurations paper, but I'm not sure the criticisms of implicit parameters actually apply in this case
19:26 maerwald me neither
19:28 maerwald Heffalump: I also find it confusing that the Given class is advertised, but edwardk actually doesn't like it and even wants to move it to a different package
19:28 maerwald it seems it is not as safe as actual reification
19:31 maerwald I was looking at the ConfigFile package last weekend, but I haven't made much progress there
19:31 maerwald it's quite a heavy-weight solution
19:32 Heffalump my feeling is we can get dynamic configuration just by changing the way we invoke the current code
19:32 maerwald Heffalump: sure
19:32 maerwald I realized that too :)
19:32 maerwald we just call "withSettings" with a local variable from the function
19:33 maerwald and that's it
19:33 maerwald currently "settings" is globally accessible via the Production.hs settings module
19:34 maerwald http://hub.darcs.net/simon/darcsden/browse/web-server/darcsden.hs#28
19:34 maerwald so we define "settings" there locally and that's it
19:37 Heffalump right - if we want to switch between different backends it might require a bit more care but it still should be doable
19:38 maerwald so we can substitute the "settings" variable from Production.hs with something like "getSettings :: Filepath -> IO Settings"
19:38 maerwald and then
19:38 maerwald settings <- getSettings "whatnot"
19:38 maerwald withSettings settings $ ...
19:39 Heffalump right
19:39 maerwald so actually not much code change
19:39 maerwald I am just not sure what library is best for actual configuration reading/parsing
19:40 Heffalump any preferences on config file format?
19:40 Heffalump I don't really care as long as it's easy to change the data structure itself
19:40 maerwald old-style Window .INI files?
19:41 Heffalump hmm, when I said "I don't really care"...
19:41 maerwald :D
19:41 Heffalump more concretely, I think I'd prefer something with a cleaner approach to structure/nesting
19:41 Heffalump at least from what I remember of them, I could be wrong
19:42 Heffalump not sure what all the cool kids are using nowadays. Yml?
19:42 maerwald a real problem is that it's very hard to make the frontPageContent, siteLink and siteFooter configurable from within a config file... since it might/does contain actual code references
19:42 Heffalump yeah
19:43 Heffalump there's some work to tease this all apart nicely
19:43 Heffalump I'd also like stuff like port to be configurable, but then you have to make sure that the port it listens on and the port it puts in URLs are consistent
19:45 maerwald Heffalump: well, for ssh port we hacked around it by http://hub.darcs.net/simon/darcsden/patch/20150507202206-0bd70 but it's still not nice and looks like it should be configurable from within darcs
19:46 Heffalump I see, nice
19:48 maerwald one nice thing about the ConfigFile package is it lets you merge two configs via "merge"... so we can hardcode one configuration literally as a String in Production.hs which then serves as a fallback
19:48 maerwald but it's all monad burrito API
19:49 maerwald so the user configuration does not have to be complete... merge takes care of that
20:08 alexei_ joined #darcs
22:03 alexei_ joined #darcs
22:30 maerwald Heffalump: I have something
22:30 Heffalump cool
22:30 maerwald http://hub.darcs.net/maerwald/darcsden/patch/20150514222751-0bd70 but it's not particularly nice
22:30 maerwald the getSettings function probably need to be refactored
22:31 maerwald but the API is tedious, so I'm not sure how to remove the code duplication
22:31 Heffalump the forceEither $ get stuff ?
22:32 maerwald Heffalump: yeah, that too
22:32 Heffalump what duplication did you mean? :-)
22:32 maerwald e.g. all functions are named again in the return call
22:33 Heffalump In the Types.Settings construction where you list the parameters explicitly, any reason not to stick with {..} ?
22:33 maerwald Heffalump: I don't even know what {..} does :D
22:33 Heffalump ah, it's a RecordWildcard
22:33 Heffalump it populates the record with the values currently in scope, field name by field name
22:33 Heffalump so if you have data X = X { a :: Int, b :: Int }
22:33 maerwald unfortunately we have to use homeDir'
22:34 maerwald is that a problem?
22:34 Heffalump then let a = 3 ; b = 5 in X {..} works
22:34 Heffalump how come?
22:34 maerwald because of backendPermanent
22:34 Heffalump My primary concern about the explicit listing is that if the required order changes, we could miss updating this
22:34 maerwald yeah
22:35 Heffalump I think you can do X { homeDir = homeDir', .. }
22:35 maerwald I'll try that
22:35 Heffalump sorry, why because of BackendPermanent?
22:35 maerwald because it already reads homeDir from the config so homeDir is already imported
22:35 maerwald backendPermanent and backendTransient cannot be part of the settings
22:36 maerwald it would cause recursive import
22:36 Heffalump I see, maybe
22:36 Heffalump btw, the path the config file is read from should be selectable on the command-line
22:36 Heffalump IMO
22:37 maerwald yeah, but I'm not sure what happens with those arguments
22:37 maerwald they are passed to go
22:37 Heffalump can you read the settings before go is called?
22:37 Heffalump also, do you have the tests running? It's not exactly trivial (but shouldn't be awful) but it'd be good to keep them working.
22:38 maerwald Heffalump: I have not touched the test code at all... and for the test code Production.hs is not used anyway, so I think it should work, I'll check
22:40 maerwald yes, it successfully builds and then fails because of missing files
22:40 maerwald so looks ok :D
22:42 maerwald is the config read for "darcsden --root DIR"?
22:43 Heffalump fails because of missing files?
22:43 maerwald yeah, because I don't have /home/darcsden/test/log/access.log etc
22:44 Heffalump ah, right. So tests really need their own config file or something. Or to be better at making up a path.
22:44 Heffalump ok, but I see, you're not changing the Test settings at all, they're still programmatic?
22:44 maerwald I think it's fine that test config is hardcoded
22:45 Heffalump not really, a new dev like you should be able to run them trivially.
22:45 Heffalump But that doesn't mean you have to fix it now either :-)
22:45 Heffalump what do you mean by "is the config read"?
22:45 maerwald I am already fixing it
22:49 Heffalump oh, also, given that the rest of the code uses the root directory to find things, would it make sense to look for the config there rather than via getHomeDirectory?
22:56 maerwald Heffalump: http://hub.darcs.net/maerwald/darcsden/patch/20150514225455-0bd70
22:57 Heffalump makes sense
22:57 Heffalump I think I'd prefer that it defaults to the root directory, not the current directory, but it's no big deal
22:57 maerwald Heffalump: problem is... it will screw up if you do
22:57 maerwald darcsden --root foo --config bar
22:57 Heffalump ah, and that would be harder to parse
22:57 Heffalump yeah
22:58 Heffalump I think we can evolve this, anyway
22:58 Heffalump I think logically once there's a config file, there's no need for --root at all
22:59 maerwald yeah
23:00 maerwald siteLink, siteFooter, frontPageContent still remain static... I am not even sure if it can be made dynamic at runtime because of HSP
23:00 maerwald I mean, it is compiled
23:01 maerwald does the framework even allow to mess with that during runtime?
23:05 Heffalump I doubt it
23:05 Heffalump hmm
23:05 Heffalump that's kind of sad, but I guess wanting to vary those is much less likely
23:06 maerwald well, then what remains is: get rid of --root, use config file for tests
23:06 Heffalump On reflection I agree the tests should have a hard-coded config, actually
23:06 Heffalump but it should also setup its own sandbox area and then clean it up afterwards
23:07 maerwald yeah
23:07 Heffalump so they "just work" (you'd still need selenium/webdriver though)
23:07 maerwald how can i squash patches :o
23:07 Heffalump unrecord the more recent ones, amend-record the earliest one
23:07 * maerwald is used to git rebase -i
23:11 maerwald http://hub.darcs.net/maerwald/darcsden/patch/20150514230910-0bd70
23:11 maerwald this looks ok?
23:14 Heffalump I think so
23:16 sm this is sounding great
23:19 maerwald sm: I also have pushed this README update http://hub.darcs.net/maerwald/darcsden/patch/20150510203810-0bd70
23:20 sm aieee
23:21 * sm lands in darcs conflict marker hell
23:21 Heffalump do we understand anything much about the "Not a repository: ./users/simon/darcsden" type errors?
23:21 Heffalump sm: did you have local changes?
23:21 Heffalump (unrecorded ones)
23:21 sm yes I always have a bunch in Production.hs
23:21 maerwald heh, which is completely rewritten
23:21 Heffalump this is the last time you'll need them :-)
23:22 sm which is *awesome*
23:22 maerwald well, siteLink, siteFooter, frontPageContent, backendPermanent and backendTransient are still static
23:22 sm Heffalump: that error from doing what ?
23:22 Heffalump visit e.g. http://hub.darcs.net/maerwald/darcsden/patches
23:23 Heffalump I thought it was being discussed on here a few days ago
23:23 maerwald backendPermanent and backendTransient could be improved... we could allow setting the couchHost etc, but for siteLink, siteFooter etc I don't have a solution
23:23 Heffalump the "branches" link is basically broken everywhere AFAICT
23:23 sm ugh.. they seem to be on the rise recently. I might have an issue or two open as well
23:23 sm broken branches is in the tracker
23:24 Heffalump ah, ok, yes
23:24 Heffalump so it is understood
23:25 sm by notdan :)
23:26 maerwald idially we should also support redis unix socket, but that's for another day
23:26 sm http://hub.darcs.net/simon/darcsden/issue/131 and http://hub.darcs.net/simon/darcsden/issue/108 might be related to the not a repo error
23:27 sm should we replace redis with acid-state or at least sqlite ?
23:27 Heffalump doesn't seem a priority given the in-memory backend
23:27 Heffalump I'd much rather focus on an alternative to CouchDB
23:28 sm true
23:28 sm same question
23:28 maerwald also, I can reproduce the branches error on my server
23:28 sm notdan's going to work on that I imagine
23:28 sm excellent
23:28 maerwald I forked sm's test repo http://darcs.cs-minden.de/hasufell/test-2/patches
23:28 Heffalump yes, I've suggested he use the filesystem along the lines I've been arguing for in the past
23:29 sm oh, or that
23:29 sm maerwald: great
23:37 sm I'm really excited to try this config patch, will do asap
23:37 sm afk, see you o/
23:37 maerwald cya
23:50 sprang joined #darcs

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