<<22-09-2012>>

00:40:27*q66 quit (Quit: Quit)
01:49:11*Boscop quit (Disconnected by services)
01:49:13*Boscop joined #nimrod
01:53:34*Boscop quit (Disconnected by services)
01:53:39*Boscop joined #nimrod
04:47:38*Trix[a]r_za is now known as Trixar_za
06:32:57*Trixar_za is now known as Trix[a]r_za
07:18:55*XAMPP quit (Ping timeout: 252 seconds)
10:00:26*q66 joined #nimrod
10:57:13dom96I think continuations would really help working with ftpclient.
11:00:27*zahary joined #nimrod
11:39:04*Trix[a]r_za is now known as Trixar_za
12:05:23*Trixar_za is now known as Trix[a]r_za
13:24:53*exhu_ joined #nimrod
13:25:41exhu_Hi there! does anyone know what is the "interface" keyword in nimrod for?
14:17:03fowlexhu_: i think its just reserved at the momnet
14:17:09Araqhi exhu_
14:17:20AraqI reserved it for future growth
14:18:06exhu_is it related to OOP?
14:18:25Araqyes
14:18:43exhu_nice -)
14:20:48Araqwell currently my plan is to make interface[...] the same as a tuple of closures but the environment will be shared
14:24:33AraqI also want to support proc p[T: myInterface](x: T) ...
14:26:00Araqdom96: you could use continuation passing style as a workaround ;-)
14:27:12dom96Araq: mmm
14:29:28dom96I would like a nice way to express the build process in nimbuild.
14:29:36dom96Something like:
14:29:51dom96exec "git pull"
14:30:24dom96if existsFile("csources.zip"): exec "unzip csources.zip"
14:30:33dom96exec "nimrod c koch"
14:30:36dom96.. etc
14:30:42Araqwell?
14:30:43dom96But it should be asynchronous.
14:30:46Araqaha
14:30:54Araquse a macro
14:31:02dom96Yeah, that's my plan :)
14:31:26dom96Currently I have a big enum :P
14:31:40dom96Which gets very confusing, because steps can be skipped etc.
14:39:17shevymy enum is bigger than yours!
14:47:25Araqreally? how is that more confusing than any web app?
14:47:40Araqit's a state machine in any case ...
14:48:37fowldom96: use nake ;)
14:49:27dom96I might :P
15:01:39Araqdom96: instead of async io you could also use threads
15:01:57dom96Would that really make the job easier?
15:02:23Araqsure why not?
15:03:23Araqdo the blocking call in a worker thread
15:04:03dom96hrm, yeah. That will probably work.
15:17:55Araqexhu_: any experience with Nimrod's templates?
15:19:32AraqI still wonder if .immediate shouldn't be the default for them
15:22:16exhu_Araq, tried to apply c++ experience using generics. Still not sure what the proper way is to implement similar stuff using Nimrod.
15:23:06Araqwell Nimrod's templates have nothing to do with C++'s ...
15:23:23*zahary quit (Quit: Leaving.)
15:25:13exhu_I can tell that macros being very effective and advanced stuff are too hard to write.
15:28:37Araqa 'template' is a way to construct an AST in a declarative way
15:28:58Araqyou can use them to do quasiquoting in macros
15:31:35exhu_yes, but i could not manage to use templates to pass a variable declarations block, that's why had to use a macro.
15:36:05fowlyou have to use {.dirty.} on the template or {.inject.} each var
15:41:58exhu_I've just looked into http://build.nimrod-code.org/docs/manual.html and think more examples with comments needed there in the templates section.
15:42:25Araqtrue but then what should my book contain? :D
15:42:39exhu_ha-ha -)
15:46:32exhu_wish I lived in the western world because it's pain to get any books here unless some colleagues travell to US or Germany for duty jorney.
15:50:46Araqso where are you from?
15:51:56exhu_belarus
15:52:19exhu_between poland and russia
15:52:35Araqyeah just looked it up ;-)
15:53:04Araqdidn't know belarus means weißrussland
15:53:59exhu_ok, so you are from germany? -)
15:54:12Araqyes
15:55:49exhu_i was learning the german language 5 yrs ago. the new books used Belarus, the older ones -- Weissrussland.
15:56:57Araqyeah quite possible, I read "Belarus" is now often used officially
15:57:09dom96oh hey exhu_. I'm originally from Poland but live in Ireland :)
15:57:47exhu_dom96, czesc -) learned some polish about 7 yrs ago -)))
15:58:26dom96exhu_: Dzieńdobry przyjacielu :)
15:58:30dom96exhu_: Cool cool
16:03:15*zahary joined #nimrod
16:28:01Araqdom96: please make that "output/error list" bottom window optional for the next release
16:28:12Araqit takes up lots of valuable screen space ...
16:28:31dom96huh?
16:28:41dom96You don't want it to show up when you hit F5?
16:28:57Araqit shows up permanently for me
16:29:10Araqomg
16:29:15AraqI feel stupid
16:29:16Araqsorry
16:29:18dom96lol
16:29:41dom96You can hide it with Ctrl + Shift + B :P
16:29:54Araqhey I didn't expect "View" to actually contain useful icons :P
16:30:07dom96;)
16:34:41dom96hrm, I just thought of another feature for Nimbuild :P
16:34:56dom96Cross-platform/architecture test result comparisons on a single page.
16:35:16dom96Too much work :P
16:38:03Araqbut it would be very useful
16:38:20dom96oh, so you do like that idea.
16:39:39*zahary quit (Read error: Operation timed out)
16:39:47*zahary joined #nimrod
16:40:01*shevy quit (Ping timeout: 260 seconds)
16:40:36exhu_what is nimbuild?
16:42:04dom96It's a build farm; a website which builds nimrod, tests it on multiple platforms and displays the results.
16:52:37*shevy joined #nimrod
16:59:24*zahary quit (Ping timeout: 246 seconds)
16:59:33*zahary joined #nimrod
17:22:04Araqping zahary
17:23:24zaharypong Araq
17:23:41Araqwhat's the status of 'auto' as return type?
17:23:55zaharynothing new there
17:24:07Araqwhat was the status? I'm working on: proc p: int = 34
17:24:28Araqaka "implicit return" for proc bodies
17:25:04*exhu_ quit (Quit: Ex-Chat)
17:28:17zaharynothing about it is implemented yet - we have talked about how proc foo[T](a, b: T): type(a+b) cannot work, because the compiler tries to determine the return type too early in the pipeline
17:28:45Araqbut ': auto' can work easily
17:28:58Araqand 'type(a+b)' is redundant anyway
17:29:17zaharyyep
17:30:30zaharythe implicit return will be limited to single expressions or it will just look at the last expression in each code path?
17:31:49Araqwell it will look if the body has a type and if so transform it to 'result = body'
17:32:20Araqand then once 'case' supports types this will be supported automatically
17:32:36AraqI mean it will be done incrementally
17:33:00Araq'case'/if are the obvious next candidates for expr support
17:34:03zaharyso the body must be a single expression?
17:35:36Araqyeah
17:35:51Araqbut nkStmtListExpr is also a "single" expression ;-)
17:40:01zaharyI'm asking about the style you prefer - some languages choose "last expression in the body", others "body must be single expression"
17:40:48Araqit's "last expression in the body" then I guess
17:41:26zaharyok, me too :)
17:42:41Araqanother minor problem: binding `[]=` doesn't work due to a bug currently
17:43:15Araqbut templates will default to 'bind' soon and there is a 'mixin' statement for open symbols
17:44:07Araqhowever this cannot work for: x[i] = y
17:44:16Araqwell it can work I guess
17:44:24zaharywhy so?
17:44:30Araqbut it's a special case
17:44:46Araqwe have no types when processing a template's body
17:45:10Araqso whenever it encounters a[i] it needs to bind `[]`
17:45:37Araq(a[i] is still nkBracketExpr)
17:45:49zaharyaha, it's not clear whether you mean (a[]) = or a([]=)
17:46:02Araqyeah
17:46:21Araqso for nkAsgn(nkBrackeExpr ...) it needs to bind `[]`, `[]=`
17:46:36zaharyI noticed that you want to support better the C++ style of return var from the [] indexer
17:47:00Araqyes
17:47:11zaharyit's a good idea I think, because there are some situations where []= doesn't compose well
17:47:21Araqindeed
17:47:28zaharyfor example, say I want to pass some element to a var taking function
17:47:40zaharymodify(a[10])
17:47:48zaharydoesn't work with []=
17:48:00Araqit does with a special rule:
17:48:17Araqvar tmp = a[10]; modify(tmp); a[10] = tmp
17:48:27AraqC# does that afaik
17:48:58Araqwhen passing a get/set property to a 'ref' parameter
17:49:11zaharynice workaround, but still doesn't work for non-copyable type
17:49:51AraqI think there is no such thing as a "non-copyable" type in this context
17:49:58Araqraw bit copy should do
17:50:10zaharyanother good idea is to have the clay's "forward" type
17:51:00zaharyinstead of writing two functions - one taking var and returning var and one non-var, have a single function written to use the forward type
17:51:55AraqI always wanted to use templates for forwarding
17:52:18Araqand I think they work good enough there
17:52:35Araqexcept for visibility rules
17:52:48zaharywhat do you mean? have the implementation in a template that is used in both functions?
17:53:24Araqtemplate myProperty(x: TMyObject): int = x[0].prop
17:53:53Araqdue to the inlining semantics it's like a 'var int'
17:54:57zaharyhmm, what about the forwarding optimisations we have talked about?
17:55:39Araqhow do they apply here?
17:56:44Araqtemplate `myProperty=` (x: TMyObject, y: someType{call}) = shallowCopy(x[0].prop, y)
17:57:02zaharysorry, I was afk for a moment. I got what you mean
17:58:07zaharymaybe that solution is good enough indeed - it's rare that such duplicated accessors are long functions
17:58:40Araqaccessors shouldn't be long functions
17:59:13Araqbut you can do things like longFunction(x)[] # returns a 'ptr'
17:59:22zaharywell, container acessors will implement some algorithm
17:59:37zaharyso they can be longer, but still rare case
18:00:11Araqyeah but they can easily delegate to a "real" function
18:01:44zaharywell, we are talking about conveniences here - in C++ you just use const_cast after all - 1 line of code
18:02:38fowlare there plans to make var and ptr types compatible
18:02:53Araqfowl: indeed there are
18:03:20fowlcool
19:55:19Araqzahary: did you read my thoughts about improving nimrod's message passing?
20:00:38zaharywhere can I read them?
20:01:05Araqhttp://build.nimrod-code.org/irclogs/21-09-2012.html
20:01:24Araqfrom 18:27
20:04:47zaharythe read-onliness of the messages is reasonable assumption
20:05:39Araqthe effect system tracks writes per type
20:05:57Araqand I want 'distinct {.noalias.}'
20:06:27Araqso you can write in a task, but the types must be distinct
20:07:14Araqit's easy to do better and indeed the thread heap analysis already does so :D
20:07:17zaharyvery long term, it would be nice if nimrod gets some of the features of spec# (the singularity OS compiler) - the effect tracking you describe here is what's needed there for the super-efficient IPC mechanism
20:07:57Araqbut the thread heap analysis a whole program analysis
20:08:04Araq*is a
20:08:44Araqbasically it annotates expressions/paths/locations with a heap region
20:09:22Araqbut these things cry for formal proofs of correctness :D
20:09:29zaharywell, how much harder becomes the problem of tracking effects if it's per locations?
20:09:41Araqwe'll see ;-)
20:10:03Araqbut it can't be done locally anymore then
20:10:29Araqas a proc's body is polymorphic wrt a heap region
20:11:00zaharyI guess I must see the tracking per type in action - I can't really imagine how often I will be burned by it
20:11:29Araqha, me neither
20:12:01Araqbut using specialized TMsg types may help
20:17:59Araqbtw I'm also working on a new grammar/parser
20:18:43Araqthe current indentation handling is quite complicated because I cared about a formal LL(1) grammar
20:19:23*Trix[a]r_za is now known as Trixar_za
20:19:25AraqI'm quite sure it's not LL(1) anymore so I want to do it differently
20:20:11AraqI don't care about a traditional grammar anymore, instead the spec will use a PEG
20:20:48Araqand the pseudo tokens IND, SAD and DED will become IND(x)
20:20:59Araqdenoting an indentation of 'x' spaces
20:25:00Araqhowever I'm struggling with the notation a bit:
20:25:06Araq stmt ::= singleStmt
20:25:08Araq | IND{x} singleStmt (IND(x) singleStmt)*
20:26:03AraqIND{x} means "if there is indentation > then the tos (top of indentation stack), then bind the number of spaces to 'x'"
20:26:25Araqand IND(x) means: "if there is an indentation with the same number of spaces as in 'x' "
20:27:18Araqbut the grammar rules become tedious because you have:
20:27:40Araq IND{x} ruleA (IND(x) ruleA)*
20:27:59*XAMPP joined #nimrod
20:28:12Araqso you have to write ruleA twice
20:31:11AraqI guess I can simply define an ** operator so it becomes:
20:31:16AraqruleA**
20:33:18*Trixar_za is now known as Trix[a]r_za
20:33:57Araqany opinions?
21:08:59zaharyis your question about the documentation or about the implementation?
21:09:30zaharyare you planning to throw away the recursive-descent parser?
21:12:10zaharyI personally don't care about formal definitions of the grammar. These are useful only for languages with proprietary implementations where you expect other vendors to provide their own implementation for their OSes, etc
21:13:44zaharyI don't care about PEGs much either, because modifying the recursive parser is one of the easier tasks in compiler hacking
21:18:18zaharythat said, what kind of changes in the syntax are you planning? that's more interesting question
21:23:22Araqmy question is about the documentation
21:23:42Araqthe implementation stays a recursive descent parser
21:23:54Araqit should get a bit easier though ;-)
21:24:30Araqplanned syntactic changes are minor
21:24:37AraqI want to allow:
21:24:42Araqproc p()
21:24:49Araq {.pragmas_here.}
21:25:09Araqand change the comment handling
21:25:32Araqoh and I want to specify the AST with each grammar rule
21:26:01zaharydumpTree is the spec I currently use :)
21:26:12AraqI know ;-)
21:27:34zaharywell, if it's just about the documentation I guess adopting pegs could backfire, because from my experience very few developers know them well
21:30:03AraqI misuse the term PEG for "deterministic grammar" :D
21:30:21Araqwhich is what most devs have in mind anyway
21:30:30zaharyaha, I see
21:30:45Araqs ::= 'if' s | expr
21:30:57Araqexpr ::= ..... | 'if' expr ...
21:30:58zaharywell adopt some custom notations then - shorter grammars are easier to read
21:31:20Araqis ambiguous but nobody notices ;-)
21:31:35Araqbecause | is read as / (ordered choice)
21:32:03zaharyyeah, I got it
21:32:42Araqand yeah we need custom notations anyway as traditional notation cannot deal with an indentation based grammar
21:33:57Araqbtw traditional notation sucks; it doesn't support parametrized rules
21:34:18Araqnor anything that can be done in a real parser with higher order functions
21:34:52Araqit can easily be more verbose than an implementation
21:35:06zaharyI've studied more than 50 languages probably and I never find myself reading the formal grammar
21:36:11Araqtrue but if you don't have a formal grammar, you quickly don't know what the parser actually implements
21:36:32Araqin fact, that always happens if you don't use a parser generator
21:37:51Araqrecursive decent is "simple" to implement until you notice that you need to compute first and follow sets in your mind
21:38:11zaharywhat is the meaning of "know" here? I can correctly imagine what is possible within the grammar?
21:38:26Araqand nobody does that properly
21:38:52Araqyou can imagine what's possible, true
21:39:03Araqbut you'll get it wrong what shouldn't be allowed
21:39:15zaharyno, I was going to say that the formal grammar doesn't help you in that regard really
21:39:27AraqI think it does
21:39:41Araqwell if you use a tool for it
21:39:53Araqotherwise not really, that's true
21:40:26zaharycan you tell me for example just looking at the grammar why it's not possible foo: block to be expression in nimrod?
21:41:51AraqexprStmt ::= lowestExpr ['=' expr | [expr (comma expr)*] [macroStmt]]
21:41:59AraqmacroStmt ::= ':' [stmt] ('of' [exprList] ':' stmt
21:42:01Araq |'elif' expr ':' stmt
21:42:02Araq |'except' exceptList ':' stmt )*
21:42:04Araq ['else' ':' stmt]
21:42:33AraqblockStmt ::= 'block' [symbol] ':' stmt
21:42:41Araqso yeah, I can :P
21:42:54Araq'block' is always followed by a colon
21:45:36zaharyI meant code block, not the block keyword (are you referring to this?)
21:45:56Araqoh I see
21:46:34Araqwell foo: blck is an expression soon, but I get your point
21:47:01Araqbut you can figure this stuff out by studying the grammar
21:47:13zaharynah, I tried to implement it once - it cannot work in the general case
21:47:37zaharyif foo:
21:47:37zahary block
21:48:02Araqit's ambiguous then, yes
21:49:04Araqbut we could make the ':' optional for passing a block and then this would work:
21:49:07Araqif foo
21:49:10Araq block:
21:49:29Araqwhich was your idea iirc
21:50:02Araqbut that doesn't really work either:
21:50:19Araqm foo
21:50:21Araq block
21:50:34Araqis 'block' passed to 'foo' or to 'm'?
21:53:47zaharyin my hypolang, this will be call to m with 2 params - I had to adopt the haskell $ operator to get the other meaning
22:26:40*Trix[a]r_za is now known as Trixar_za
22:58:48Araqsorry, dom96, no capturing of 'result'
22:59:01Araqwould require special logic in the backend :P
22:59:17dom96np
22:59:21dom96easy enough to workaround
22:59:41Araqyeah and I did it for tirc
23:00:59dom96thanks
23:23:16*zahary quit (Quit: Leaving.)