03:43:40 | fowl | zahdoes this is what i came up with tell me if im way off |
03:46:16 | fowl | oh hes not on:/ |
03:46:30 | fowl | https://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:09 | fowl | zahary: 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:56 | zahary | hi 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:39 | fowl | zahary: am i way off here? https://gist.github.com/fowlmouth/5506957 |
20:23:05 | * | gradha joined #nimrod |
20:58:28 | zahary | fowl, I wrote some notes about how my system was organised: https://gist.github.com/fowlmouth/5506957 |
21:03:51 | fowl | componentOffsets: seq[int] this would have to be big enough to hold offsets for every component, |
21:04:10 | fowl | even components that it doesnt have |
21:04:54 | zahary | yep, I updated my comment to clarify this, but maybe you were too quick to open the gist :) |
21:05:54 | fowl | in this system, components that are inherited from another one will have a different ID than their parnet |
21:05:58 | fowl | parent |
21:06:21 | fowl | isnt that wasteful |
21:09:43 | zahary | we 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:39 | zahary | what kind of inherited components do you have in mind? |
21:12:08 | fowl | im not sure but i think the possibility should be there |
21:12:48 | fowl | for 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:35 | fowl | thought that is probably outside the bounds of the components-are-only-data philosophy |
21:15:05 | zahary | my 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:07 | fowl | your Domain type, is this the entity manager or a single system |
21:16:08 | zahary | but another solution that was very often used is to use another task specific polymorphism that is hidden inside the component. |
21:16:46 | zahary | for example, you have a single AIBrain component, but it holds pointers to other objects such as IStrategy or ISensors, etc |
21:19:17 | zahary | I'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:28 | fowl | entitymanager holds the entity data and systems in my design |
21:20:48 | zahary | what is entity data here? |
21:20:57 | zahary | the data of the actual instances? |
21:21:09 | zahary | each tank in game? |
21:21:12 | fowl | yea |
21:21:53 | zahary | as I suggested before, you don't need to hold this data in a central places |
21:26:05 | Araq | making 'nil' the empty statement was a stupid idea ... :-/ |
21:26:15 | zahary | ok, after a second reading of your code, EntityManager is equivalent to my Entity type |
21:26:43 | Araq | lots of special rules to get the expr/stmt unification to work thanks to 'nil' ... |
21:27:44 | zahary | you mean like nil used like this: proc foo = nil |
21:27:55 | Araq | yeah |
21:28:02 | zahary | yeah, I can imagine |
21:28:23 | Araq | that's what you get for saying a keyword ... |
21:28:33 | Araq | *saving |
21:29:49 | Araq | I tried to deprecate it but it's heavily used in the compiler itself |
21:30:00 | Araq | quite suprisingly |
21:52:00 | NimBot | Araq/Nimrod c288854 Araq [+1 ±9 -0]: completed expr/stmt unification |
21:53:48 | dom96 | gradha: I love your idetools tests |
21:54:06 | Araq | oh yeah, thanks for the small test case, gradha |
21:54:15 | gradha | of course, it's going to get better, this is just the beginning |
21:54:17 | Araq | that should really help :-) |
21:55:01 | gradha | depending on how fast Araq fixes these things I'll be implementing a switch to automatically upload testcases to github |
21:55:34 | gradha | muahahaha, I'm so dangerous with a compiler |
21:55:44 | Araq | hmm bootstrapping got 0.3s faster :-) |
21:55:57 | Araq | nice ... |
21:56:16 | Araq | or maybe I misremember the old number |
21:56:39 | gradha | strange you haven't implemented a high score table somewhere |
21:57:00 | gradha | every successful compilation should call some server and upload stats |
21:57:01 | NimBot | Araq/Nimrod 851e003 Araq [+0 ±1 -0]: fixed: typo |
21:57:26 | gradha | at least then we would know if people use nimrod |
22:00:16 | Araq | hmm yeah |
22:00:33 | Araq | won't work on windows with antivirus |
22:00:46 | Araq | without people noticing ;-) |
22:01:00 | gradha | does windows restrict outbound connections by default? |
22:01:01 | dom96 | It should really tweet every time you get a compile time error. |
22:01:25 | dom96 | "I just failed at Nimrod: Undeclared identifier 'prc'" :P |
22:01:40 | * | dom96 saw an emacs thing for Haskell that did that |
22:02:59 | Araq | now comes the fun part ... which semantics did I actually implement? :D |
22:03:21 | fowl | dom96: i updated the PR on babel |
22:03:46 | dom96 | fowl: thanks |
22:03:55 | dom96 | I shall pull ASAP |
22:04:47 | NimBot | Araq/Nimrod 0443d1a Zahary Karadjov [+4 ±5 -0]: test-runner for caas multi-step tests |
22:05:00 | Araq | proc q(): int {.discardable.} = 145 |
22:05:01 | Araq | proc p(): int = q() |
22:05:03 | Araq | echo p() |
22:05:08 | Araq | what does this echo? |
22:05:34 | fowl | 145 |
22:05:59 | Araq | well my compiler says 0 :P |
22:06:37 | gradha | shouldn't that read echo $p()? |
22:06:44 | fowl | i thought the single expr there was supposed to mean `result = ..` |
22:06:44 | dom96 | !repos |
22:06:44 | NimBot | Announced repos: Araq/Nimrod, nimrod-code/nimbuild, nimrod-code/aporia, nimrod-code/nimforum |
22:06:56 | dom96 | !addrepo nimrod-code babel |
22:06:56 | NimBot | Done. |
22:07:01 | Araq | 'echo' auto stringifies, gradha |
22:07:29 | gradha | I think I've missed that since I always use % for interpolation |
22:07:54 | Araq | fowl: I agree with you ... will change the behaviour |
22:08:09 | Araq | the reason is the 'discardable' of course |
22:11:16 | Araq | zahary: 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:18 | zahary | I'll count the lines of code :) didn't this require changes in cgen/jsgen and evals? |
22:18:02 | Araq | jsgen has been rewritten for the expr/stmt stuff anyway, yeah :D |
22:18:13 | Araq | cgen now too ... |
22:18:25 | Araq | evals never cared |
22:18:33 | fowl | gradha: echo has varargs[string, `$`] so it applies $ to arguments to stringify them |
22:20:10 | zahary | hmm, but evals should care too (it used to work, because eval knew how to handle StmtListExpr |
22:20:17 | gradha | maybe "proc `%` *(formatstr: string, a: openarray[string]):" should have the same |
22:20:41 | fowl | strutils.format does |
22:20:48 | Araq | evals produces emptyNode for 'void' and the value otherwise, that suffices for 'if' and 'case' |
22:21:09 | Araq | I checked the code but didn't have to touch it |
22:22:00 | Araq | gradha: it can't work for % as you pass an array to it directly |
22:22:28 | Araq | and the array constructor doesn't stringify |
22:22:59 | Araq | hence I had to introduce strutils.format |
22:24:51 | Araq | perhaps you want an 'echof', gradha? |
22:26:10 | gradha | no special will there |
22:26:42 | dom96 | Araq: It would be helpful if you get the args to an object constructor wrong that the compiler tells you what it expects. |
22:27:13 | Araq | what? should it list all the object fields? |
22:27:17 | fowl | echof(str: string, args: varargs[string,`$`]){.inline.} = echo(str.format(args)) |
22:27:35 | dom96 | Araq: sure |
22:27:47 | fowl | or str.format(args).echo |
22:27:54 | fowl | im going to start using that style more |
22:30:22 | Araq | echo(try: parseInt("1244") except EInvalidValue: -1) # 'try' as expression works :-) |
22:35:35 | zahary | cool, can I also provide multiple except handlers? |
22:36:13 | zahary | not particurly useful, but I'm just curious :) |
22:37:19 | Araq | yeah but currently you have to do it all in a single line :P |
22:37:58 | gradha | does escaping newlines with backslash work for that? |
22:38:29 | Araq | there is no backslash escaping in nimrod except in comments |
22:39:41 | fowl | does this work |
22:39:46 | fowl | var x = case foo |
22:39:49 | fowl | of 1: .. |
22:40:20 | Araq | yeah if you indent the 'of' |
22:40:35 | fowl | nice |
22:41:11 | * | OrionPK joined #nimrod |
22:41:55 | Araq | fowl: that works even in 0.9.0 I think |
22:42:43 | fowl | oh neat |
22:43:20 | zahary | yes, I don't think indenting was strictly necessary. parsing of case statements and expressions is done with the same routine |
22:45:03 | Araq | zahary: it only worked because we allowed for extra indentation in 'case' |
22:45:09 | Araq | case x |
22:45:24 | Araq | of 23: # <-- extra indentation saved us for expressions |
22:45:53 | Araq | 'try except' doesn't allow this and so it only works as a single line for now |
23:28:24 | Araq | dom96: does dispatcher.register return a value? |
23:29:08 | Araq | oh yeah ... there is a version that does ... hm |
23:29:22 | dom96 | yeah, why do you ask? |
23:29:45 | Araq | cause the new compiler doesn't compile tircbot anymore |
23:30:41 | NimBot | Araq/Nimrod 294f7ed Zahary Karadjov [+2 ±1 -0]: adding some failing caas tests |
23:30:41 | NimBot | Araq/Nimrod 7aea07f Zahary Karadjov [+1 ±0 -0]: failing test case demonstrating how generic arguments are preferred to... 2 more lines |
23:33:56 | Araq | just what we need ... more failing tests :P |
23:34:48 | Araq | 'discardable' really is hard to get right: |
23:34:56 | Araq | state.sock = AsyncSocket() |
23:34:58 | Araq | ... |
23:35:03 | Araq | state.dispatcher.register(state.sock) |
23:35:39 | Araq | now is of type PDelegate |
23:36:00 | Araq | but it's used in a void context |
23:36:22 | fowl | then it should have to be discardable or discarded |
23:36:34 | Araq | that's what register is, yeah |
23:37:01 | Araq | but the compiler has to dig deep to see it's discardable |
23:38:11 | fowl | at that point isnt it already known as register(state.dispatcher, state.sock) |
23:38:43 | Araq | yeah but it's the last meaningful statement in a body of code |
23:39:28 | fowl | o |
23:49:42 | * | zahary quit (Quit: Leaving.) |
23:51:50 | fowl | will this work |
23:51:55 | Araq | gradha: the off by one bug is a feature I think |
23:52:11 | Araq | because I can never remember if columns start at 0 or 1 ... |
23:52:16 | fowl | return(var id{.global.} = nextID(); id) |
23:52:38 | Araq | fowl: it should |
23:52:53 | fowl | neat |
23:53:04 | gradha | Araq: write it down somewhere |
23:53:21 | Araq | I'm still fixing bugs but most likely I'll merge it all into master tomorrow |
23:53:37 | Araq | ugh ... tomorrow is already today ... |
23:55:52 | Araq | gradha: doesn't help I need to find out what the compiler does :P |
23:56:27 | fowl | if i were to do |
23:56:43 | fowl | var id{.global.} = (stmt1; stmt2; val) would those statements run only once |
23:57:11 | Araq | fowl: no |
23:57:39 | Araq | it's stmt1; stmt2; var id {.global.} = val |
23:58:21 | Araq | but you know ... you can always do: |
23:58:27 | Araq | template once(s: stmt) = |
23:58:32 | Araq | ... |
23:59:22 | fowl | i dont get it |
23:59:37 | Araq | template once(s: stmt) = |