00:00:11 | Araq | but technically it's a type |
00:00:12 | zahary | but it's up to you |
00:00:46 | Araq | ok |
00:01:42 | Araq | though sigmatch could easily support the generalized patterns ... hrm |
00:04:00 | * | Trixar_za is now known as Trix[a]r_za |
00:05:41 | Araq | what about that re(X,Y) problem? |
00:05:58 | Araq | the compiler could flag that as "already optimized" and not touch it |
00:06:27 | Araq | but then there are patterns that want a fixpoint computation |
00:21:05 | Araq | oh well, I found an easy solution |
00:36:32 | Araq | good night |
01:43:49 | * | q66 quit (Quit: Quit) |
02:21:51 | * | zahary quit (Quit: Leaving.) |
02:49:26 | * | XAMPP_ quit (Read error: Connection reset by peer) |
09:05:05 | * | XAMPP joined #nimrod |
09:19:13 | * | zahary joined #nimrod |
09:36:23 | dom96 | good morning |
09:54:42 | * | q66 joined #nimrod |
10:58:53 | shevy | good midday |
11:36:50 | Araq | good day |
11:40:37 | dom96 | hello Araq |
11:43:03 | Araq | hi dom96 |
11:45:53 | Araq | hi zahary |
16:35:36 | * | shevy quit (Ping timeout: 244 seconds) |
16:47:50 | * | shevy joined #nimrod |
17:42:04 | Araq | ping zahary |
17:45:26 | zahary | hi |
17:45:38 | Araq | two points today :-) |
17:45:52 | Araq | 1) license of the generated code |
17:46:11 | Araq | 2) `&` * a pattern |
17:47:59 | zahary | 2) is about expressions like a & b & c ? |
17:48:09 | Araq | exactly |
17:48:26 | Araq | well (`&`*a) is not really a problem |
17:48:46 | Araq | but ((`+` | `-`)*a) is |
17:49:10 | Araq | because I don't know what should be bound in the 'a' |
17:50:55 | Araq | well I guess the whole tree and then you need to extract the stuff again in the macro's body |
17:52:07 | zahary | the whole tree is what I would expect |
17:52:41 | Araq | but for (`&` * a) 'a' could receive the new nkArgList tree |
17:53:23 | Araq | which is very handy: |
17:53:24 | zahary | nkArgList is flattened view? |
17:53:32 | Araq | exactly |
17:53:56 | Araq | well f(X) matches f(1, 2, 3) |
17:54:05 | Araq | X is then nkArgList(1, 2, 3) |
17:54:20 | Araq | which is flattened into the call for template instantiation |
17:55:25 | zahary | but is there some flattening like 1 + 2 + 3 -> `+`(nkArgList(1,2,3)) ? |
17:55:41 | Araq | that's what the * is for |
17:56:00 | Araq | and yeah that's the plan |
17:56:22 | zahary | I guess you can say that flattening only happens when for groups of operands with the same operator |
17:56:43 | Araq | I guess I will simply distinguish between op * a and (op|op2) * a |
17:56:56 | Araq | so yeah * is in fact 2 operators :-) |
17:56:56 | zahary | 1*2 + 2*3 + 3*4 - the pluses here could be flattened |
17:57:21 | Araq | yep and it's easy to implement |
17:57:49 | Araq | we also need a notation to bind a choice to a parameter |
17:58:13 | Araq | (`+` | `-` ) # works but what can you do with it in the template's body? |
17:58:35 | Araq | (`+` | `-` ) ~ a # binds what matched to 'a' |
17:59:27 | Araq | any better syntax? |
18:02:48 | zahary | it's fine. |
18:02:48 | zahary | will it be possible to share parts of the pattern? |
18:02:48 | zahary | you planned to expand templates in the pattern. e.g: |
18:02:48 | zahary | template ArithmeticOP = `+` | `-` | `*` |
18:02:48 | zahary | template Rule{ (ArithmeticOP)* x } |
18:04:58 | Araq | yeah well, I forgot about that :D |
18:05:11 | Araq | but it's easy to do |
18:06:11 | zahary | how do you distinguish between variables and literal symbols (or expanded symbols) |
18:06:49 | zahary | you just look at the param list to see which are the variables or some form of quoting is required? |
18:08:55 | Araq | like in templates the param list is used to determine that |
18:09:25 | Araq | pattern operators are only special when written in infix form |
18:09:40 | Araq | so that you can use `*`(a, b) to match against multiplication |
18:10:02 | Araq | I think that's easier to deal with than escaping ordinary operators with \ |
18:10:30 | zahary | I see |
18:11:22 | zahary | so what about the license banners? 1) |
18:11:46 | Araq | well the stdlib is LGPL with linking extension |
18:11:56 | Araq | so that you can link statically against it |
18:12:03 | Araq | is that good enough? |
18:14:09 | Araq | you once talked about that the header in the generated C code should be user configurable |
18:14:21 | Araq | but I think that leads to all sorts of problems |
18:14:59 | zahary | I suggested configurable banners for the user code - imagine someone is writing some middleware that is going to be shipped as C code instead of the original nimrod sources |
18:15:21 | Araq | well the banner now says "The generated code is subject to the original license." |
18:15:28 | Araq | whatever that means ... |
18:16:11 | zahary | I haven't looked at it in a while. have you changed something? |
18:16:20 | zahary | anyway, it's a minor feature really |
18:16:22 | Araq | I added that sentence ;-) |
18:16:44 | zahary | I imagine you can supply a command line argument to a text file to be used as banner |
18:16:51 | Araq | well the stdlib has a different license but the compiler can't tell |
18:16:51 | zahary | or you can have a magic that sets it |
18:17:12 | Araq | well it needs to be done per module |
18:17:30 | zahary | hmm |
18:17:46 | Araq | {.copyright: "bla blub".} |
18:17:52 | Araq | is of course a possibility |
18:19:35 | Araq | but then if you ship the C code you can write a script to change the header |
18:20:10 | zahary | some languages have preservable comments, that's another option |
18:20:23 | zahary | ## is preservable for example or something like that |
18:20:40 | Araq | and then it's copied into the C output? |
18:20:43 | zahary | yes |
18:22:48 | Araq | *shrug* so it's only syntax, .copyright does the same more or less |
18:23:44 | zahary | one can argue that comments are more general as you can use them to document procs or other parts of the code |
18:25:35 | Araq | the codegen can easily look at nkCommentStmt and paste the comment into the C code |
18:25:56 | Araq | it won't turn up at the proper position for a copyright header though |
18:27:05 | zahary | well, I would worry about this feature too much - sounds like 1.0 feature :) |
18:27:40 | Araq | ok |
18:27:41 | zahary | .copyring. have the bonus that tools like package managers can scrape it |
19:32:05 | reactormonk | Araq: sounds like something you want to set in your project config file |
19:33:46 | Araq | reactormonk: but it's not per project, but per module |
19:34:08 | Araq | it's not like you can change the stdlib's license :P |
19:34:15 | reactormonk | Araq: oh, right... |
19:34:38 | reactormonk | {.copyright: "GPL".} should do? |
19:34:58 | reactormonk | and a bunch of mappings from abbrev => license text somewhere in the stdlib? |
19:35:23 | dom96 | What if you want a custom license? |
19:38:28 | reactormonk | dom96: no match => paste the text |
19:39:54 | Araq | what is this? trying to bloat up a tiny feature as much as we can? |
19:42:14 | dom96 | reactormonk: That would work. |
19:47:43 | reactormonk | Araq: saves you some copy/pasteing |
19:48:49 | Araq | const gpl = "xyz" |
19:48:55 | Araq | {.copyright: gpl.} |
19:49:17 | Araq | nimrod already has what it takes :P |
19:55:36 | reactormonk | Araq: mention that in the pragma doc then - you could ship a licenses.nim with the most common ones as well |
19:58:32 | fowl | http://i.minus.com/ikY6UUDKT9LHe.png file transfers *almost* work >_> |
20:07:26 | dom96 | fowl: Wow, cool. :D |
20:26:28 | * | JStoker quit (Excess Flood) |
20:28:41 | * | JStoker joined #nimrod |
20:43:06 | reactormonk | fowl: what's that? |
20:45:59 | fowl | reactormonk: the lobby for my game |
20:46:55 | * | EfTwelve_ joined #nimrod |
20:48:55 | * | EfTwelve quit (Ping timeout: 272 seconds) |
20:49:04 | * | EfTwelve_ is now known as EfTwelve |
21:06:37 | Araq | hrm, if (x|y|z){a} means to bind the result to 'a' |
21:07:09 | Araq | shouldn't `&`*a be spelt like: (*`&`){a} |
21:07:16 | fowl | reactormonk: https://github.com/fowlmouth/keineSchweine |
21:07:57 | * | dom96 wonders what keineSchweine means |
21:08:02 | Araq | fowl: come on, screenshot please |
21:08:26 | dom96 | Araq: He just gave us one. |
21:09:08 | fowl | screenshot of the game is boring, theres nothing to do yet but fly around |
21:10:06 | dom96 | Araq: Your pattern matching confuses me. |
21:10:25 | dom96 | Araq: Explain '(x|y|z){a}' further please. |
21:12:48 | reactormonk | dom96: no swines basically |
21:12:52 | reactormonk | ehh no swine |
21:13:19 | dom96 | what? |
21:16:04 | fowl | keine schweine => no pigs |
21:16:20 | dom96 | oh right. |
21:16:33 | dom96 | I didn't realise you were talking about what that phrase mean hah |
21:16:37 | dom96 | *means |
21:16:57 | Araq | template foo{ (~(0|1|2|3)){a}) }(a: int{lit}) = {.error: "explain magic number " & $a.} |
21:19:08 | Araq | he, I should test that |
21:19:55 | * | dom96 has no idea what that is suppose to do |
21:20:23 | Araq | mark magic numbers in your code |
21:21:04 | dom96 | Magic numbers? |
21:21:20 | Araq | there are style guides that say every number that is not 0, 1, 2, 3 should only occur in: |
21:21:29 | Araq | const niceNameHere = 42 |
21:21:44 | Araq | to improve readability |
21:22:48 | dom96 | oh |
21:23:06 | dom96 | How will you check whether it's assigned to a const? |
21:23:35 | Araq | dunno, thinking about it |
21:24:12 | Araq | you can't really do it with patterns |
21:25:03 | * | EfTwelve_ joined #nimrod |
21:28:25 | * | EfTwelve quit (Ping timeout: 246 seconds) |
21:28:28 | * | EfTwelve_ is now known as EfTwelve |
21:29:43 | * | Trix[a]r_za is now known as Trixar_za |
21:31:03 | Trixar_za | 42? Somehow I sense a Hitchhiker joke |
21:31:20 | Araq | hitchhiker is highly overrated IMHO :P |
21:31:43 | Trixar_za | No, just mistakenly named a trilogy |
21:31:53 | Trixar_za | I own four of them :P |
21:32:16 | Araq | congratulations |
21:32:20 | Trixar_za | He should have ended it at the 4th book |
21:32:35 | Trixar_za | But no, his wife had to finish the 5th |
21:33:57 | Trixar_za | But, I personally thing the funniest science fiction (or just fiction) book in existence is Douglas Adams' Starship Titanic by Terry Jones |
21:34:04 | Trixar_za | think* |
21:34:56 | Araq | never heard of it |
21:35:40 | Trixar_za | It was written to accompany the game Douglas Adams released by the same name |
21:35:47 | Trixar_za | But it's way better than the game |
21:37:51 | Trixar_za | It's even rumored Terry Jones wrote it naked |
22:00:39 | * | Trixar_za is now known as Trix[a]r_za |
22:01:32 | fowl | lol |
22:35:57 | * | q66 quit (Quit: Quit) |
22:56:47 | Araq | good night |
22:57:24 | dom96 | see ya Araq |
23:45:59 | * | XAMPP quit (Ping timeout: 246 seconds) |