<<03-05-2013>>

03:43:40fowlzahdoes this is what i came up with tell me if im way off
03:46:16fowloh hes not on:/
03:46:30fowlhttps://gist.github.com/fowlmouth/5506957
04:02:09*OrionPK quit (Quit: Leaving)
04:46:07*xcombelle joined #nimrod
05:14:20*fowl quit (Ping timeout: 272 seconds)
05:15:25*fowl joined #nimrod
05:21:43*Trix[a]r_za is now known as Trixar_za
05:41:59*fowl quit (Read error: Connection reset by peer)
05:43:20*fowl joined #nimrod
05:57:41*Trixar_za is now known as Trix[a]r_za
07:41:06*xcombelle quit (Remote host closed the connection)
08:04:20*Trix[a]r_za quit (Ping timeout: 246 seconds)
08:05:21*Trix[a]r_za joined #nimrod
08:12:08*zahary joined #nimrod
08:25:20*zahary quit (Quit: Leaving.)
08:29:06*zahary joined #nimrod
09:08:09fowlzahary: morning
09:26:03*zahary quit (Quit: Leaving.)
10:53:19*q66 joined #nimrod
10:58:17*xcombelle joined #nimrod
13:49:29*zahary joined #nimrod
13:49:56zaharyhi fowl, what's up?
14:18:58*zahary quit (Read error: Operation timed out)
15:10:26*fowl quit (Ping timeout: 245 seconds)
18:36:18*xcombelle quit (Remote host closed the connection)
20:09:57*fowl joined #nimrod
20:20:31*zahary joined #nimrod
20:22:39fowlzahary: am i way off here? https://gist.github.com/fowlmouth/5506957
20:23:05*gradha joined #nimrod
20:58:28zaharyfowl, I wrote some notes about how my system was organised: https://gist.github.com/fowlmouth/5506957
21:03:51fowl componentOffsets: seq[int] this would have to be big enough to hold offsets for every component,
21:04:10fowleven components that it doesnt have
21:04:54zaharyyep, I updated my comment to clarify this, but maybe you were too quick to open the gist :)
21:05:54fowlin this system, components that are inherited from another one will have a different ID than their parnet
21:05:58fowlparent
21:06:21fowlisnt that wasteful
21:09:43zaharywe had a very few cases of inherited components. the only one I can think of right now was Model -> AnimatedModel (adds bones) -> CompositeModel (add body parts such "boots, pants, armor, erc")
21:10:39zaharywhat kind of inherited components do you have in mind?
21:12:08fowlim not sure but i think the possibility should be there
21:12:48fowlfor ex you might want to subclass the input component to provide a virtual controller that would be controlled by an ai until the player jumps in
21:13:35fowlthought that is probably outside the bounds of the components-are-only-data philosophy
21:15:05zaharymy system allowed you to add and remove components to objects at runtime, so one way to implement this would have been to do a component swap.
21:16:07fowlyour Domain type, is this the entity manager or a single system
21:16:08zaharybut another solution that was very often used is to use another task specific polymorphism that is hidden inside the component.
21:16:46zaharyfor example, you have a single AIBrain component, but it holds pointers to other objects such as IStrategy or ISensors, etc
21:19:17zaharyI'm not exactly sure what the EntityManager does in your gist. It serves as a factory for creating entities so it's like the Domain in this regard. on the other hard, it has a member entityData: seq[cstring], which is not quite clear to me
21:20:28fowlentitymanager holds the entity data and systems in my design
21:20:48zaharywhat is entity data here?
21:20:57zaharythe data of the actual instances?
21:21:09zaharyeach tank in game?
21:21:12fowlyea
21:21:53zaharyas I suggested before, you don't need to hold this data in a central places
21:26:05Araqmaking 'nil' the empty statement was a stupid idea ... :-/
21:26:15zaharyok, after a second reading of your code, EntityManager is equivalent to my Entity type
21:26:43Araqlots of special rules to get the expr/stmt unification to work thanks to 'nil' ...
21:27:44zaharyyou mean like nil used like this: proc foo = nil
21:27:55Araqyeah
21:28:02zaharyyeah, I can imagine
21:28:23Araqthat's what you get for saying a keyword ...
21:28:33Araq*saving
21:29:49AraqI tried to deprecate it but it's heavily used in the compiler itself
21:30:00Araqquite suprisingly
21:52:00NimBotAraq/Nimrod c288854 Araq [+1 ±9 -0]: completed expr/stmt unification
21:53:48dom96gradha: I love your idetools tests
21:54:06Araqoh yeah, thanks for the small test case, gradha
21:54:15gradhaof course, it's going to get better, this is just the beginning
21:54:17Araqthat should really help :-)
21:55:01gradhadepending on how fast Araq fixes these things I'll be implementing a switch to automatically upload testcases to github
21:55:34gradhamuahahaha, I'm so dangerous with a compiler
21:55:44Araqhmm bootstrapping got 0.3s faster :-)
21:55:57Araqnice ...
21:56:16Araqor maybe I misremember the old number
21:56:39gradhastrange you haven't implemented a high score table somewhere
21:57:00gradhaevery successful compilation should call some server and upload stats
21:57:01NimBotAraq/Nimrod 851e003 Araq [+0 ±1 -0]: fixed: typo
21:57:26gradhaat least then we would know if people use nimrod
22:00:16Araqhmm yeah
22:00:33Araqwon't work on windows with antivirus
22:00:46Araqwithout people noticing ;-)
22:01:00gradhadoes windows restrict outbound connections by default?
22:01:01dom96It should really tweet every time you get a compile time error.
22:01:25dom96"I just failed at Nimrod: Undeclared identifier 'prc'" :P
22:01:40*dom96 saw an emacs thing for Haskell that did that
22:02:59Araqnow comes the fun part ... which semantics did I actually implement? :D
22:03:21fowldom96: i updated the PR on babel
22:03:46dom96fowl: thanks
22:03:55dom96I shall pull ASAP
22:04:47NimBotAraq/Nimrod 0443d1a Zahary Karadjov [+4 ±5 -0]: test-runner for caas multi-step tests
22:05:00Araqproc q(): int {.discardable.} = 145
22:05:01Araqproc p(): int = q()
22:05:03Araqecho p()
22:05:08Araqwhat does this echo?
22:05:34fowl145
22:05:59Araqwell my compiler says 0 :P
22:06:37gradhashouldn't that read echo $p()?
22:06:44fowli thought the single expr there was supposed to mean `result = ..`
22:06:44dom96!repos
22:06:44NimBotAnnounced repos: Araq/Nimrod, nimrod-code/nimbuild, nimrod-code/aporia, nimrod-code/nimforum
22:06:56dom96!addrepo nimrod-code babel
22:06:56NimBotDone.
22:07:01Araq'echo' auto stringifies, gradha
22:07:29gradhaI think I've missed that since I always use % for interpolation
22:07:54Araqfowl: I agree with you ... will change the behaviour
22:08:09Araqthe reason is the 'discardable' of course
22:11:16Araqzahary: btw case as expression is way easier in the backend than the transformation you implemented ;-)
22:11:45*fowl quit (Read error: Connection reset by peer)
22:15:53*fowl joined #nimrod
22:16:18zaharyI'll count the lines of code :) didn't this require changes in cgen/jsgen and evals?
22:18:02Araqjsgen has been rewritten for the expr/stmt stuff anyway, yeah :D
22:18:13Araqcgen now too ...
22:18:25Araqevals never cared
22:18:33fowlgradha: echo has varargs[string, `$`] so it applies $ to arguments to stringify them
22:20:10zaharyhmm, but evals should care too (it used to work, because eval knew how to handle StmtListExpr
22:20:17gradhamaybe "proc `%` *(formatstr: string, a: openarray[string]):" should have the same
22:20:41fowlstrutils.format does
22:20:48Araqevals produces emptyNode for 'void' and the value otherwise, that suffices for 'if' and 'case'
22:21:09AraqI checked the code but didn't have to touch it
22:22:00Araqgradha: it can't work for % as you pass an array to it directly
22:22:28Araqand the array constructor doesn't stringify
22:22:59Araqhence I had to introduce strutils.format
22:24:51Araqperhaps you want an 'echof', gradha?
22:26:10gradhano special will there
22:26:42dom96Araq: It would be helpful if you get the args to an object constructor wrong that the compiler tells you what it expects.
22:27:13Araqwhat? should it list all the object fields?
22:27:17fowlechof(str: string, args: varargs[string,`$`]){.inline.} = echo(str.format(args))
22:27:35dom96Araq: sure
22:27:47fowlor str.format(args).echo
22:27:54fowlim going to start using that style more
22:30:22Araqecho(try: parseInt("1244") except EInvalidValue: -1) # 'try' as expression works :-)
22:35:35zaharycool, can I also provide multiple except handlers?
22:36:13zaharynot particurly useful, but I'm just curious :)
22:37:19Araqyeah but currently you have to do it all in a single line :P
22:37:58gradhadoes escaping newlines with backslash work for that?
22:38:29Araqthere is no backslash escaping in nimrod except in comments
22:39:41fowldoes this work
22:39:46fowlvar x = case foo
22:39:49fowlof 1: ..
22:40:20Araqyeah if you indent the 'of'
22:40:35fowlnice
22:41:11*OrionPK joined #nimrod
22:41:55Araqfowl: that works even in 0.9.0 I think
22:42:43fowloh neat
22:43:20zaharyyes, I don't think indenting was strictly necessary. parsing of case statements and expressions is done with the same routine
22:45:03Araqzahary: it only worked because we allowed for extra indentation in 'case'
22:45:09Araqcase x
22:45:24Araq of 23: # <-- extra indentation saved us for expressions
22:45:53Araq'try except' doesn't allow this and so it only works as a single line for now
23:28:24Araqdom96: does dispatcher.register return a value?
23:29:08Araqoh yeah ... there is a version that does ... hm
23:29:22dom96yeah, why do you ask?
23:29:45Araqcause the new compiler doesn't compile tircbot anymore
23:30:41NimBotAraq/Nimrod 294f7ed Zahary Karadjov [+2 ±1 -0]: adding some failing caas tests
23:30:41NimBotAraq/Nimrod 7aea07f Zahary Karadjov [+1 ±0 -0]: failing test case demonstrating how generic arguments are preferred to... 2 more lines
23:33:56Araqjust what we need ... more failing tests :P
23:34:48Araq'discardable' really is hard to get right:
23:34:56Araq state.sock = AsyncSocket()
23:34:58Araq ...
23:35:03Araq state.dispatcher.register(state.sock)
23:35:39Araqnow is of type PDelegate
23:36:00Araqbut it's used in a void context
23:36:22fowlthen it should have to be discardable or discarded
23:36:34Araqthat's what register is, yeah
23:37:01Araqbut the compiler has to dig deep to see it's discardable
23:38:11fowlat that point isnt it already known as register(state.dispatcher, state.sock)
23:38:43Araqyeah but it's the last meaningful statement in a body of code
23:39:28fowlo
23:49:42*zahary quit (Quit: Leaving.)
23:51:50fowlwill this work
23:51:55Araqgradha: the off by one bug is a feature I think
23:52:11Araqbecause I can never remember if columns start at 0 or 1 ...
23:52:16fowlreturn(var id{.global.} = nextID(); id)
23:52:38Araqfowl: it should
23:52:53fowlneat
23:53:04gradhaAraq: write it down somewhere
23:53:21AraqI'm still fixing bugs but most likely I'll merge it all into master tomorrow
23:53:37Araqugh ... tomorrow is already today ...
23:55:52Araqgradha: doesn't help I need to find out what the compiler does :P
23:56:27fowlif i were to do
23:56:43fowlvar id{.global.} = (stmt1; stmt2; val) would those statements run only once
23:57:11Araqfowl: no
23:57:39Araqit's stmt1; stmt2; var id {.global.} = val
23:58:21Araqbut you know ... you can always do:
23:58:27Araqtemplate once(s: stmt) =
23:58:32Araq ...
23:59:22fowli dont get it
23:59:37Araqtemplate once(s: stmt) =