<<02-09-2012>>

00:00:11Araqbut technically it's a type
00:00:12zaharybut it's up to you
00:00:46Araqok
00:01:42Araqthough sigmatch could easily support the generalized patterns ... hrm
00:04:00*Trixar_za is now known as Trix[a]r_za
00:05:41Araqwhat about that re(X,Y) problem?
00:05:58Araqthe compiler could flag that as "already optimized" and not touch it
00:06:27Araqbut then there are patterns that want a fixpoint computation
00:21:05Araqoh well, I found an easy solution
00:36:32Araqgood 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:23dom96good morning
09:54:42*q66 joined #nimrod
10:58:53shevygood midday
11:36:50Araqgood day
11:40:37dom96hello Araq
11:43:03Araqhi dom96
11:45:53Araqhi zahary
16:35:36*shevy quit (Ping timeout: 244 seconds)
16:47:50*shevy joined #nimrod
17:42:04Araqping zahary
17:45:26zaharyhi
17:45:38Araqtwo points today :-)
17:45:52Araq1) license of the generated code
17:46:11Araq2) `&` * a pattern
17:47:59zahary2) is about expressions like a & b & c ?
17:48:09Araqexactly
17:48:26Araqwell (`&`*a) is not really a problem
17:48:46Araqbut ((`+` | `-`)*a) is
17:49:10Araqbecause I don't know what should be bound in the 'a'
17:50:55Araqwell I guess the whole tree and then you need to extract the stuff again in the macro's body
17:52:07zaharythe whole tree is what I would expect
17:52:41Araqbut for (`&` * a) 'a' could receive the new nkArgList tree
17:53:23Araqwhich is very handy:
17:53:24zaharynkArgList is flattened view?
17:53:32Araqexactly
17:53:56Araqwell f(X) matches f(1, 2, 3)
17:54:05AraqX is then nkArgList(1, 2, 3)
17:54:20Araqwhich is flattened into the call for template instantiation
17:55:25zaharybut is there some flattening like 1 + 2 + 3 -> `+`(nkArgList(1,2,3)) ?
17:55:41Araqthat's what the * is for
17:56:00Araqand yeah that's the plan
17:56:22zaharyI guess you can say that flattening only happens when for groups of operands with the same operator
17:56:43AraqI guess I will simply distinguish between op * a and (op|op2) * a
17:56:56Araqso yeah * is in fact 2 operators :-)
17:56:56zahary1*2 + 2*3 + 3*4 - the pluses here could be flattened
17:57:21Araqyep and it's easy to implement
17:57:49Araqwe also need a notation to bind a choice to a parameter
17:58:13Araq(`+` | `-` ) # works but what can you do with it in the template's body?
17:58:35Araq(`+` | `-` ) ~ a # binds what matched to 'a'
17:59:27Araqany better syntax?
18:02:48zaharyit's fine.
18:02:48zaharywill it be possible to share parts of the pattern?
18:02:48zaharyyou planned to expand templates in the pattern. e.g:
18:02:48zaharytemplate ArithmeticOP = `+` | `-` | `*`
18:02:48zaharytemplate Rule{ (ArithmeticOP)* x }
18:04:58Araqyeah well, I forgot about that :D
18:05:11Araqbut it's easy to do
18:06:11zaharyhow do you distinguish between variables and literal symbols (or expanded symbols)
18:06:49zaharyyou just look at the param list to see which are the variables or some form of quoting is required?
18:08:55Araqlike in templates the param list is used to determine that
18:09:25Araqpattern operators are only special when written in infix form
18:09:40Araqso that you can use `*`(a, b) to match against multiplication
18:10:02AraqI think that's easier to deal with than escaping ordinary operators with \
18:10:30zaharyI see
18:11:22zaharyso what about the license banners? 1)
18:11:46Araqwell the stdlib is LGPL with linking extension
18:11:56Araqso that you can link statically against it
18:12:03Araqis that good enough?
18:14:09Araqyou once talked about that the header in the generated C code should be user configurable
18:14:21Araqbut I think that leads to all sorts of problems
18:14:59zaharyI 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:21Araqwell the banner now says "The generated code is subject to the original license."
18:15:28Araqwhatever that means ...
18:16:11zaharyI haven't looked at it in a while. have you changed something?
18:16:20zaharyanyway, it's a minor feature really
18:16:22AraqI added that sentence ;-)
18:16:44zaharyI imagine you can supply a command line argument to a text file to be used as banner
18:16:51Araqwell the stdlib has a different license but the compiler can't tell
18:16:51zaharyor you can have a magic that sets it
18:17:12Araqwell it needs to be done per module
18:17:30zaharyhmm
18:17:46Araq{.copyright: "bla blub".}
18:17:52Araqis of course a possibility
18:19:35Araqbut then if you ship the C code you can write a script to change the header
18:20:10zaharysome languages have preservable comments, that's another option
18:20:23zahary## is preservable for example or something like that
18:20:40Araqand then it's copied into the C output?
18:20:43zaharyyes
18:22:48Araq*shrug* so it's only syntax, .copyright does the same more or less
18:23:44zaharyone can argue that comments are more general as you can use them to document procs or other parts of the code
18:25:35Araqthe codegen can easily look at nkCommentStmt and paste the comment into the C code
18:25:56Araqit won't turn up at the proper position for a copyright header though
18:27:05zaharywell, I would worry about this feature too much - sounds like 1.0 feature :)
18:27:40Araqok
18:27:41zahary.copyring. have the bonus that tools like package managers can scrape it
19:32:05reactormonkAraq: sounds like something you want to set in your project config file
19:33:46Araqreactormonk: but it's not per project, but per module
19:34:08Araqit's not like you can change the stdlib's license :P
19:34:15reactormonkAraq: oh, right...
19:34:38reactormonk{.copyright: "GPL".} should do?
19:34:58reactormonkand a bunch of mappings from abbrev => license text somewhere in the stdlib?
19:35:23dom96What if you want a custom license?
19:38:28reactormonkdom96: no match => paste the text
19:39:54Araqwhat is this? trying to bloat up a tiny feature as much as we can?
19:42:14dom96reactormonk: That would work.
19:47:43reactormonkAraq: saves you some copy/pasteing
19:48:49Araqconst gpl = "xyz"
19:48:55Araq{.copyright: gpl.}
19:49:17Araqnimrod already has what it takes :P
19:55:36reactormonkAraq: mention that in the pragma doc then - you could ship a licenses.nim with the most common ones as well
19:58:32fowlhttp://i.minus.com/ikY6UUDKT9LHe.png file transfers *almost* work >_>
20:07:26dom96fowl: Wow, cool. :D
20:26:28*JStoker quit (Excess Flood)
20:28:41*JStoker joined #nimrod
20:43:06reactormonkfowl: what's that?
20:45:59fowlreactormonk: 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:37Araqhrm, if (x|y|z){a} means to bind the result to 'a'
21:07:09Araqshouldn't `&`*a be spelt like: (*`&`){a}
21:07:16fowlreactormonk: https://github.com/fowlmouth/keineSchweine
21:07:57*dom96 wonders what keineSchweine means
21:08:02Araqfowl: come on, screenshot please
21:08:26dom96Araq: He just gave us one.
21:09:08fowlscreenshot of the game is boring, theres nothing to do yet but fly around
21:10:06dom96Araq: Your pattern matching confuses me.
21:10:25dom96Araq: Explain '(x|y|z){a}' further please.
21:12:48reactormonkdom96: no swines basically
21:12:52reactormonkehh no swine
21:13:19dom96what?
21:16:04fowlkeine schweine => no pigs
21:16:20dom96oh right.
21:16:33dom96I didn't realise you were talking about what that phrase mean hah
21:16:37dom96*means
21:16:57Araqtemplate foo{ (~(0|1|2|3)){a}) }(a: int{lit}) = {.error: "explain magic number " & $a.}
21:19:08Araqhe, I should test that
21:19:55*dom96 has no idea what that is suppose to do
21:20:23Araqmark magic numbers in your code
21:21:04dom96Magic numbers?
21:21:20Araqthere are style guides that say every number that is not 0, 1, 2, 3 should only occur in:
21:21:29Araqconst niceNameHere = 42
21:21:44Araqto improve readability
21:22:48dom96oh
21:23:06dom96How will you check whether it's assigned to a const?
21:23:35Araqdunno, thinking about it
21:24:12Araqyou 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:03Trixar_za42? Somehow I sense a Hitchhiker joke
21:31:20Araqhitchhiker is highly overrated IMHO :P
21:31:43Trixar_zaNo, just mistakenly named a trilogy
21:31:53Trixar_zaI own four of them :P
21:32:16Araqcongratulations
21:32:20Trixar_zaHe should have ended it at the 4th book
21:32:35Trixar_zaBut no, his wife had to finish the 5th
21:33:57Trixar_zaBut, I personally thing the funniest science fiction (or just fiction) book in existence is Douglas Adams' Starship Titanic by Terry Jones
21:34:04Trixar_zathink*
21:34:56Araqnever heard of it
21:35:40Trixar_zaIt was written to accompany the game Douglas Adams released by the same name
21:35:47Trixar_zaBut it's way better than the game
21:37:51Trixar_zaIt's even rumored Terry Jones wrote it naked
22:00:39*Trixar_za is now known as Trix[a]r_za
22:01:32fowllol
22:35:57*q66 quit (Quit: Quit)
22:56:47Araqgood night
22:57:24dom96see ya Araq
23:45:59*XAMPP quit (Ping timeout: 246 seconds)