00:02:14 | * | aziz joined #nim |
00:02:42 | * | desophos quit (Remote host closed the connection) |
00:14:37 | * | yglukhov quit (Remote host closed the connection) |
00:15:42 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:19:10 | * | Varriount quit (Ping timeout: 260 seconds) |
00:23:32 | * | boopsies is now known as boopsiesisaway |
00:37:47 | * | desophos joined #nim |
00:54:47 | * | aziz quit (Remote host closed the connection) |
00:57:24 | * | brson quit (Quit: leaving) |
01:22:12 | * | CryptoToad quit (Quit: Leaving) |
01:25:52 | desophos | https://github.com/nim-lang/Nim/issues/2172 :( |
01:32:56 | * | irrequietus quit () |
01:33:23 | desophos | omg my game finally compiled and ran |
01:33:30 | desophos | after many days of not running |
01:48:17 | * | ephja quit (Ping timeout: 252 seconds) |
02:00:59 | * | jakesyl quit (Ping timeout: 240 seconds) |
02:05:02 | desophos | OMG IT ACTUALLY RUNS |
02:14:34 | * | desophos_ joined #nim |
02:19:28 | * | desophos_ quit (Ping timeout: 272 seconds) |
02:37:37 | * | vendethiel joined #nim |
02:39:21 | desophos | is there any downside to just using ref objects everywhere? |
02:52:23 | * | strcmp1 quit (Ping timeout: 264 seconds) |
02:55:43 | * | strcmp1 joined #nim |
03:06:17 | * | nande quit (Quit: No Ping reply in 180 seconds.) |
03:07:41 | * | nande joined #nim |
03:18:56 | * | darkf joined #nim |
03:28:43 | desophos | i miss python's simple comprehensions :( |
03:32:25 | * | vendethiel quit (Ping timeout: 246 seconds) |
03:39:20 | desophos | can someone tell me wtf is wrong with http://ideone.com/3sczFF please? |
03:39:30 | desophos | "undeclared identifier"? huh? |
04:09:35 | * | bigfondue quit (Ping timeout: 268 seconds) |
04:11:01 | * | bigfondue joined #nim |
04:13:14 | * | benaiah left #nim ("WeeChat 0.4.2") |
04:17:31 | desophos | the lc macro uses an nnkPar node, which was broken in 0.12.0; could that be the problem? |
04:35:37 | * | nande quit (Remote host closed the connection) |
04:37:20 | * | desophos quit (Read error: Connection reset by peer) |
05:43:23 | * | skalpin quit (Ping timeout: 264 seconds) |
06:37:12 | * | yglukhov joined #nim |
07:05:06 | * | barosl quit (Read error: Connection reset by peer) |
07:37:53 | * | Trustable joined #nim |
07:48:53 | * | bjz joined #nim |
07:57:09 | * | desophos joined #nim |
08:01:36 | * | desophos quit (Ping timeout: 255 seconds) |
08:07:15 | * | gokr_ joined #nim |
08:15:06 | * | gokr_ quit (Read error: Connection reset by peer) |
08:16:57 | * | gokr_ joined #nim |
08:31:04 | * | Arrrr joined #nim |
08:55:48 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
09:02:49 | * | coffeepot joined #nim |
09:03:28 | * | Demon_Fox quit (Quit: Leaving) |
09:13:15 | * | xificurC quit (Ping timeout: 256 seconds) |
09:54:17 | * | barosl joined #nim |
10:10:59 | * | silven quit (Ping timeout: 252 seconds) |
10:11:31 | * | silven joined #nim |
10:15:15 | * | makoLine quit (Ping timeout: 255 seconds) |
10:20:09 | * | strcmp1 quit (Ping timeout: 252 seconds) |
10:20:37 | * | zepolen joined #nim |
10:25:47 | * | zepolen quit (Remote host closed the connection) |
10:27:18 | * | strcmp1 joined #nim |
11:06:58 | * | boopsiesisaway is now known as boopsies |
11:07:02 | * | boopsies is now known as boopsiesisaway |
11:08:08 | * | boopsiesisaway is now known as boopsies |
11:12:42 | yglukhov | is "when T is SomeOrdinal" supposed to work? |
11:12:51 | * | ephja joined #nim |
11:36:07 | * | zepolen joined #nim |
11:44:46 | * | elrood joined #nim |
11:51:25 | * | zepolen quit (Remote host closed the connection) |
11:51:36 | * | desophos joined #nim |
11:53:17 | * | zepolen joined #nim |
11:58:08 | * | aziz joined #nim |
12:11:46 | desophos | is it possible to define a constructor for a subtype in a different module from the base type without exporting the base type's fields? |
12:13:10 | * | silven quit (Ping timeout: 240 seconds) |
12:13:31 | * | silven joined #nim |
12:16:42 | * | vqrs quit (Ping timeout: 272 seconds) |
12:18:14 | * | vqrs joined #nim |
12:20:25 | Araq | desophos: kind of if the subtype's constructor calls the base constructor rather than accessing the hidden fields |
12:21:24 | desophos | that's what i was hoping to do; do i need to cast the object returned from the base type constructor to the subtype? |
12:21:47 | desophos | so that i can set the subtype fields |
12:22:08 | desophos | i guess that wouldn't work |
12:22:11 | desophos | not sure how to do that |
12:23:05 | Araq | convert it to the base type via base(foo) |
12:25:20 | desophos | sorry, can you explain please? i don't understand how to handle the object returned from the base constructor |
12:26:17 | desophos | not explain typecasting, i get that |
12:27:07 | * | xificurC joined #nim |
12:29:00 | desophos | can i pass the base object to the subtype constructor somehow? |
12:29:16 | desophos | er, the actual subtype creation proc |
12:32:34 | * | zepolen quit (Remote host closed the connection) |
12:33:35 | * | zepolen joined #nim |
12:35:39 | * | gokr joined #nim |
12:37:47 | * | gokr_ quit (Ping timeout: 265 seconds) |
12:40:23 | * | CcxCZ quit (Ping timeout: 264 seconds) |
12:41:37 | * | CcxCZ joined #nim |
12:43:11 | * | gokr quit (Remote host closed the connection) |
12:43:23 | * | gokr joined #nim |
12:45:24 | Araq | desophos: these questions are all answered in gokr's excellent blog posts about OO in Nim |
12:45:59 | desophos | i actually have that open right now |
12:47:11 | desophos | well, i had http://goran.krampe.se/2014/10/29/nim-and-oo/ open, now looking for others |
12:47:16 | desophos | http://goran.krampe.se/2015/05/06/nim-and-super/? |
12:48:53 | desophos | oh wow, he has a lot |
12:55:09 | * | Arrrrr joined #nim |
12:55:13 | * | Arrrr quit (Ping timeout: 246 seconds) |
12:57:20 | desophos | ahhhh i see, i need to pass an already-initialized base object to the subtype constructor? |
12:58:30 | * | gokr quit (Read error: Connection reset by peer) |
12:59:10 | Arrrrr | Yep, as far as i know, there is no constructors as in java, only field initializer (Person(name: "Arr")) |
12:59:15 | OnO | whazzup |
12:59:38 | OnO | Araq: made "borrow all" working in this PR https://github.com/nim-lang/Nim/pull/3494 |
13:00:09 | OnO | this can be used to make some generics eg. Defaulting[T], Tainted[T] etc. etc. |
13:00:13 | Araq | hi OnO |
13:00:35 | Araq | that's cool, but I think it should be under {.experimental.} |
13:01:02 | Araq | also some people complained our build.sh uses CR-LF but afaict that's not the case. any ideas? |
13:01:21 | Araq | (and yeah, we actually tested these scripts on macosx) |
13:01:37 | desophos | weird, it must have been my git settings i guess? sorry |
13:03:09 | OnO | yup, I checked everything is LF here, maybe checked out on Windows, then copied to Linux |
13:03:56 | desophos | i cloned on Mac, so idk what went wrong |
13:04:19 | OnO | Araq: regarding experimental, this is natural extension to borrow which isn't experimental, we could indeed make it experimental, but I was about to propose Defaulting[T] and DefaultingTo[T, Def] which relies on that |
13:04:29 | OnO | if it is experimental, then effectively it couldn't be really sued |
13:04:54 | OnO | Araq: just have a look, I think this borrow all is pretty simple, just check if HiddenStdConv on 1st arg is the way to go |
13:05:18 | reactormonk | Araq, I ran dos2unix over build.sh, no changes. |
13:05:33 | OnO | desophos: but what is exactly happening there? what error msg? |
13:05:40 | Araq | OnO: yeah, I reviewed it already |
13:06:03 | Araq | still not really happy with this thing, will sleep over it |
13:06:22 | OnO | desophos: maybe we got some 'git config core.eol' set to crlf? |
13:06:25 | Araq | I can see it's kinda redundant to require .borrow to use .experimental |
13:06:42 | desophos | OnO, yeah, it's probably something wrong with my git settings |
13:08:03 | Arrrrr | i think this message has one 'or' more than needed https://github.com/nanoant/Nim/blob/patch/distinct-type-borrow-all/compiler/pragmas.nim#L558 |
13:09:53 | OnO | oops, you're right |
13:10:30 | OnO | btw. can literal be part of the template? eg. "" literal in: DefaultingTo[Table[string, string], ""] |
13:10:41 | OnO | so far I can't make it work |
13:11:46 | OnO | (btw. typo in PR fixed) |
13:12:11 | Araq | yeah once the staticT rewritings arrive, I will look at why this doesn't work. |
13:16:34 | OnO | yeah, that's a little shortcoming comparing to C++ templates |
13:18:38 | OnO | also 'type DefaultingTo*[T, D] = distinct T' emits 'Hint: 'D' is declared but not used [XDeclaredButNotUsed]', is it right? |
13:19:17 | OnO | maybe I want to use D on some other places and just stick it to the type |
13:20:06 | desophos | Araq, i got it to work by taking an initialized base object, casting it to the subtype, and setting subtype fields on it |
13:20:07 | * | BitPuffin joined #nim |
13:20:35 | desophos | thus avoiding calling the constructor in the subtype module at all |
13:23:04 | Arrrrr | wut |
13:23:11 | desophos | never mind, it didn't work :) |
13:24:05 | desophos | Error: unhandled exception: invalid object conversion [ObjectConversionError] |
13:25:26 | OnO | template default[T]: expr = (var t: T; t) <NL> echo (default[int]) <- crashes with SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
13:26:03 | OnO | but 'echo ((var t: int; t))' works fine showing '0', WTF? |
13:26:28 | Araq | default[int]() |
13:26:56 | OnO | no effect, echo(default[int]()) still crashes |
13:27:38 | Araq | fix it |
13:27:44 | Arrrrr | desophos: http://ideone.com/39ufJ8 |
13:28:51 | desophos | this is what i tried: http://ideone.com/lik2V7 |
13:29:31 | Arrrrr | of course it cant work |
13:30:09 | desophos | why not? |
13:30:34 | Arrrrr | For many reasons, one of them is that you first create A, which takes less space than B |
13:31:03 | Arrrrr | But anyway, nim wont allow you to convert parent type to child type |
13:31:33 | Arrrrr | You have to do it the other way, first create B and then init props from A |
13:31:40 | desophos | hmm |
13:33:19 | OnO | Araq: evalTemplateArgs crashes in let default = s.typ.n.sons[i].sym.ast, apparently expectedRegularParams is counted wrong comehow |
13:33:27 | desophos | you know what, inheritance probably isn't the best for this anyway |
13:33:52 | desophos | oh btw, did anyone see my messages from last night? |
13:34:09 | desophos | http://ideone.com/3sczFF |
13:34:29 | desophos | are listcomps broken or am i doing something wrong? |
13:34:41 | desophos | <desophos> the lc macro uses an nnkPar node, which was broken in 0.12.0; could that be the problem? |
13:35:10 | OnO | aha... better givenRegularParams is -1 :)) |
13:37:00 | Araq | desophos: yes. |
13:37:18 | Araq | could be the problem |
13:37:27 | Arrrrr | the example from the future docs is working |
13:39:11 | OnO | okay, looks like serious bug, given: template pass[TT](t: TT): expr = t |
13:39:13 | desophos | hmm, indeed it is |
13:39:22 | OnO | pass[int](1) crashes, but pass(1) not |
13:44:54 | OnO | okay I don't get this... evalTemplateArgs n.kind is nkIdent !? what? |
13:49:56 | * | gokr joined #nim |
13:54:13 | OnO | how do I dump PNode tree in compiler? |
13:56:58 | reactormonk | OnO, debug maybe? |
14:00:13 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
14:07:17 | * | pregressive joined #nim |
14:07:55 | * | elrood quit (Remote host closed the connection) |
14:14:50 | * | silven quit (Ping timeout: 240 seconds) |
14:15:19 | * | silven joined #nim |
14:15:50 | OnO | thanks. is there a way to set some "magic" variable so my compiler debug works only in the scope? |
14:16:39 | OnO | just want to skip all the "system" libraries and emit debug only for specific code |
14:18:17 | federico3 | |
14:22:30 | * | aziz quit (Remote host closed the connection) |
14:24:47 | * | elrood joined #nim |
14:26:41 | Araq | OnO: http://nim-lang.org/docs/intern.html#debugging-the-compiler |
14:26:52 | Araq | if n.info ?? "temp.nim": |
14:26:53 | Araq | # only output when it comes from "temp.nim" |
14:26:55 | Araq | echo renderTree(n) |
14:27:14 | OnO | great thanks! |
14:27:42 | Araq | it's depressing that you don't already know this -.- |
14:28:54 | Araq | I don't even want to know how much time is lost by people thinking GDB or Visual Studio is an acceptable debugging solution ... |
14:30:01 | Arrrrr | Talking of which, how can i benchmark procs from executables produced in nim? |
14:30:54 | Arrrrr | (i mean tools, not using epochTime) |
14:35:40 | OnO | nah, I forgot somehow about ?? trick I am working on quite a few projects |
14:37:15 | Araq | Arrrrr: http://forum.nim-lang.org/t/1730/1 |
14:37:40 | Araq | "I usually just run code through Instruments on OS X (with the "Invert Call Tree" option checked). If you're familiar with Nim's name-mangling mechanism, it's generally pretty easy to tell where the performance hotspots are. On Linux, Google performance tools should give you similar functionality." |
14:38:00 | Arrrrr | Thank you Araq |
14:47:51 | * | gokr quit (Read error: Connection reset by peer) |
15:02:51 | * | gokr joined #nim |
15:25:42 | * | zepolen quit (Remote host closed the connection) |
15:42:14 | * | coffeepot joined #nim |
15:54:18 | Arrrrr | i got sleepy www.codersnotes.com/sleepy/ but even with --debugInfo i cant see the names of the procs (win xP compiled using mingw) |
16:15:37 | * | desophos quit (Read error: Connection reset by peer) |
16:21:59 | * | pregressive quit (Remote host closed the connection) |
16:24:42 | * | boopsies quit (Ping timeout: 255 seconds) |
16:31:14 | * | darkf quit (Quit: Leaving) |
16:32:30 | * | strcmp1 quit (Ping timeout: 240 seconds) |
16:33:34 | Arrrrr | Ok, i had to put --passC: "-gdwarf-2" |
16:36:26 | * | pregressive joined #nim |
16:40:23 | * | EastByte_ joined #nim |
16:40:24 | * | EastByte quit (Read error: Connection reset by peer) |
17:01:52 | * | brson joined #nim |
17:03:10 | * | strcmp1 joined #nim |
17:03:59 | Arrrrr | Is nimscript broken in windows? i get the "Error: cannot 'importc' variable at compile time" for winlean |
17:05:28 | * | iamd3vil joined #nim |
17:05:37 | * | iamd3vil quit (Client Quit) |
17:06:20 | * | iamd3vil joined #nim |
17:09:06 | * | jonasac joined #nim |
17:10:31 | * | pregressive quit (Remote host closed the connection) |
17:11:42 | * | pregressive joined #nim |
17:13:38 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
17:21:58 | * | aziz joined #nim |
17:23:33 | * | gokr_ joined #nim |
17:31:12 | Araq | Arrrrr: well the docs of nimscript mention what can be imported... |
17:32:20 | * | Matthias247 joined #nim |
17:34:59 | * | zepolen joined #nim |
17:37:39 | * | jonasac quit (Remote host closed the connection) |
17:39:34 | * | ochkoffein joined #nim |
17:42:25 | * | yglukhov quit (Ping timeout: 240 seconds) |
17:42:50 | OnO | Araq: I need you help about explicit template template instantation, just to recall if we have: template ttmpl[T](t: T) = echo t, then doing ttmpl(1) works, where ttmpl[int](1) crashes compiler |
17:43:29 | OnO | the problem is that semSubscript tries to turn 'ttmpl' expr into value |
17:43:39 | OnO | with proc it will just turn it to proc symbol |
17:43:52 | OnO | with template it tries to evaluate template with no arguments at all |
17:43:57 | OnO | this is all wrong there |
17:44:44 | * | jonasac joined #nim |
17:47:03 | Araq | doesn't seem hard to fix? |
17:48:05 | OnO | I tried, eg disabling evaluation, and making ttmpl[T] turn nkIdent into symbol like for proc |
17:48:49 | OnO | and passing to explicitGenericInstantiation like proc, but it crashes somehwere else |
17:50:37 | OnO | maybe it isn't hard to fix for you when you wrote all this stuff :> |
17:55:23 | * | strcmp1 quit (Ping timeout: 244 seconds) |
17:56:50 | * | ochkoffein quit (Ping timeout: 250 seconds) |
17:57:02 | * | strcmp1 joined #nim |
18:09:12 | * | gokr_ quit (Read error: Connection reset by peer) |
18:12:13 | * | ochkoffein joined #nim |
18:12:45 | Araq | well if it crashes somewhere else then, it means progress |
18:13:51 | * | desophos joined #nim |
18:21:46 | * | jonasac quit (Remote host closed the connection) |
18:26:44 | * | brson quit (Quit: leaving) |
18:29:39 | * | gokr_ joined #nim |
18:30:41 | * | brson joined #nim |
18:34:59 | * | ochkoffein quit (Ping timeout: 240 seconds) |
18:36:20 | * | aziz quit (Remote host closed the connection) |
18:40:24 | * | yglukhov joined #nim |
18:41:44 | * | zepolen quit (Remote host closed the connection) |
18:42:48 | * | vendethiel joined #nim |
18:48:10 | * | iamd3vil left #nim ("Leaving") |
18:50:29 | * | ochkoffein joined #nim |
18:52:32 | * | desophos quit (Remote host closed the connection) |
19:04:51 | * | ochkoffein quit (Ping timeout: 256 seconds) |
19:20:11 | * | ochkoffein joined #nim |
19:22:36 | * | jonasac joined #nim |
19:24:33 | * | jonasac quit (Read error: Connection reset by peer) |
19:24:39 | * | lazypenguin quit (Ping timeout: 240 seconds) |
19:25:09 | * | jonasac joined #nim |
19:27:16 | * | zepolen joined #nim |
19:43:32 | * | zepolen quit (Remote host closed the connection) |
19:46:28 | * | gokr quit (Ping timeout: 244 seconds) |
19:50:19 | * | BitPuffin quit (Ping timeout: 246 seconds) |
20:01:11 | * | xificurC quit (Quit: WeeChat 1.3) |
20:02:39 | * | yglukhov quit (Remote host closed the connection) |
20:06:51 | * | gokr joined #nim |
20:09:39 | * | gokr_ quit (Ping timeout: 240 seconds) |
20:13:48 | * | Jesin quit (Quit: Leaving) |
20:16:30 | * | yglukhov joined #nim |
20:19:36 | * | silven quit (Ping timeout: 255 seconds) |
20:20:00 | * | silven joined #nim |
20:21:48 | * | yglukhov quit (Remote host closed the connection) |
20:29:04 | * | Demon_Fox joined #nim |
20:37:13 | * | jonasac quit () |
20:37:46 | * | yglukhov joined #nim |
20:37:51 | * | desophos joined #nim |
20:38:45 | * | benaiah joined #nim |
20:42:03 | * | desophos quit (Remote host closed the connection) |
20:42:51 | * | desophos joined #nim |
20:44:53 | * | gokr quit (Read error: Connection reset by peer) |
20:49:22 | * | nande joined #nim |
20:51:33 | * | jakesyl joined #nim |
20:52:25 | * | brson quit (Ping timeout: 240 seconds) |
20:53:44 | * | makoLine joined #nim |
20:54:39 | * | brson joined #nim |
20:55:14 | * | ochkoffein quit (Ping timeout: 260 seconds) |
20:59:00 | * | gokr joined #nim |
21:05:03 | OnO | oh well, I think I have a solution, I am going to file a bug report then make a PR for it |
21:09:22 | * | joebo joined #nim |
21:12:05 | * | avsej quit (Ping timeout: 240 seconds) |
21:13:23 | * | avsej joined #nim |
21:13:23 | * | avsej quit (Changing host) |
21:13:23 | * | avsej joined #nim |
21:17:41 | * | desophos quit (Remote host closed the connection) |
21:18:35 | * | brson quit (Ping timeout: 256 seconds) |
21:23:58 | OnO | Araq: done, that was quite a exhausting task spend almost all day on it, I hope I get some good insights from you on the problem and my solution |
21:24:44 | OnO | again I learnt a lot as well, so the time was not lost |
21:25:13 | Araq | hrm ... insights. |
21:29:21 | OnO | btw. found one (single) place where tmpl[0], where [] was NOT generic arguments |
21:30:13 | OnO | my PR makes tmpl[...] to be a template call with generic arguments and no normal arguments |
21:30:37 | OnO | so [] means always generic arguments, not an array access on template result |
21:30:47 | OnO | this is more inline with procs |
21:31:15 | OnO | but since you cannot "instantiate |
21:31:32 | OnO | template from generic one it does not need empty () |
21:31:54 | Araq | that sucks |
21:32:23 | Araq | templates for aliasing stuff and using array indexing on it is an important feature of Nim |
21:32:44 | * | kulelu88 joined #nim |
21:32:44 | * | kulelu88 quit (Changing host) |
21:32:44 | * | kulelu88 joined #nim |
21:32:47 | * | brson joined #nim |
21:33:07 | Araq | how about we finally make [. .] stand for unambiguous generic instantiations? |
21:33:45 | Araq | the overloading of [] really caused lots of hacks and workarounds |
21:33:56 | OnO | yeah I know, but now tmpl()[...] is array access on tmpl result, but tmpl[...] is generic call |
21:34:16 | Araq | yes, I understood you, but that sucks |
21:34:29 | OnO | I know, but otherwise you can't have both :) |
21:34:42 | OnO | unless you have [. .] but that's kind of huuuuge change |
21:34:43 | Araq | with [. .] you can. |
21:35:19 | Araq | well actually, it's no big deal. If ambiguous, use [. .] otherwise [] continues to work for good. |
21:36:19 | Araq | we can also introduce some nice Unicode aliases for [. .] |
21:36:52 | OnO | oh well... () makes this unambigious too |
21:37:14 | Araq | but foo()[] is ugly. |
21:37:33 | Araq | and foo[int]() so uncommon that it shouldn't eat up a nice syntax |
21:37:39 | OnO | as I said, I found just one place in whole compiler I had to fix |
21:38:07 | OnO | but foo[int] may be very common |
21:38:16 | Araq | that means there are "just" 10 places in jester and it goes downhill from there :P |
21:38:29 | OnO | hehe... ok ok |
21:38:35 | Araq | the compiler doesn't even use templates that heavily |
21:39:06 | * | zepolen joined #nim |
21:39:19 | OnO | anyway shouldn't it be defined in grammar |
21:39:27 | OnO | rather than dependent on context? |
21:39:54 | Araq | not many languages do that. |
21:41:16 | Araq | and how do you think it would look like? |
21:42:10 | OnO | xxx[...](...) template call, always |
21:42:40 | OnO | and no other notation for template calls |
21:43:24 | OnO | of you wanted different meaning use parenthesis eg. (xxx[...])() |
21:43:51 | Araq | the grammar has no notion of what a "template call" is. |
21:44:32 | Araq | and we don't want to have IDENT | TEMPLATE_IDENT pseudo-tokens that depend on the symbol table |
21:45:13 | OnO | I think that's the problem |
21:45:21 | Araq | you would just introduce some hand waving into the "grammar". |
21:45:42 | OnO | and remove lot of ambiguity and hacks from sema |
21:46:13 | Araq | moving the sem hacks to lexer hacks makes everything worse. |
21:47:12 | Araq | and since I implemented a C++ parser I think I can judge the tradeoffs very well. |
21:47:15 | OnO | why lexer hacks, there would be no hacks since there is single rule: ident[expr,...](expr,...) -> templCallExpr |
21:48:08 | Araq | this rule has no meaning if you don't define what 'templCallExpr' means. |
21:48:23 | OnO | anyway, if templates, macros are kind of inline or compile-time procs, why you want tmpl[...] to have different meaning to proc[...] !? |
21:49:21 | OnO | eg. I turn some generic procs into templates (eg. optimizing stuff) and poof my program doesn't compile anymore, or worse have different logic |
21:49:55 | Araq | templates are close to generic inline procs, but they are NOT generic inline procs. |
21:50:08 | Araq | they are used for all sort of different things. |
21:50:22 | Araq | template foo = x.field.a.y |
21:50:33 | Araq | foo[i] = y |
21:50:41 | Araq | is an important use case. |
21:51:04 | Araq | you could differentiate between |
21:51:08 | Araq | template foo() = ... |
21:51:10 | Araq | and |
21:51:12 | Araq | template foo = ... |
21:51:31 | Araq | but this is subtle and no code out there cares about it |
21:51:34 | * | lazypenguin joined #nim |
21:52:01 | OnO | okay, I may differentiate checking if tmpl sym in tmpl[] is generic template or not too |
21:52:23 | Araq | yeah that is much better |
21:52:32 | Araq | but still I want my [. .] |
21:52:40 | Araq | because it makes sense. |
21:53:15 | OnO | yeah a "square tits" operator |
21:53:29 | Arrrrr | lol |
21:53:41 | Araq | ._. |
21:54:45 | * | Araq wonders if we could use foo(T)(x, y) instead |
21:55:13 | Araq | or maybe foo(T; x, y) |
21:56:10 | Arrrrr | or foo(x, y) {.muhPragma: T.} |
21:56:43 | Araq | well how are "curly tits" better? |
21:57:22 | Araq | (except that we have them everywhere already and nobody noticed their sexual connotations) |
21:57:32 | * | jonasac joined #nim |
21:57:54 | makoLine | IMO, get rid of [] for array indexing (or, if that is not possible, magically go back in time and undo your decision to include it ;] ) |
21:57:54 | makoLine | I like scala's way, indexing uses the apply operator, (eg array(i)), and I've never seen an entity where you wanted both indexing and application at the same time (a mapping, that is also a function, but the function is not the mapping? Sounds awful.) |
21:58:07 | Arrrrr | usually pragma names are long, so you dont notice it |
21:58:11 | makoLine | So that doesn't introduce any conflicts. |
21:58:31 | Araq | I dislike Scala's solution in this case. |
21:59:03 | Araq | array indexing with square brackets is just too sexy and would sorely be missed. |
22:00:15 | Araq | explicit generic instantiations at callsite are very rare, don't optimize the language for it. |
22:00:35 | jonasac | this function signature says it returns a string right ? http://nim-lang.org/docs/httpclient.html#getContent,string,string,int,SSLContext,Proxy |
22:01:01 | Araq | yes |
22:02:02 | jonasac | giving nim a spin, i basically have a proc that returns the result of a call to that function, but the compiler is saying the type is a (string, string) |
22:02:12 | Arrrrr | talking about apply, can you do proc `()` ? |
22:02:58 | Araq | Arrrrr: yes |
22:03:30 | Arrrrr | but not for 'a () b' |
22:03:45 | Arrrrr | a question |
22:05:23 | Arrrrr | ujj, it actually works http://ideone.com/NdtXNu |
22:05:37 | Arrrrr | I'll keep that in mind, good night |
22:05:38 | * | Arrrrr quit (Quit: WeeChat 1.2) |
22:08:53 | OnO | Araq: okay updated my PR to only apply to generic macros/templates, non-generic ones work as before |
22:09:46 | Araq | jonasac: well there is little I can do to help you without more code snippets |
22:10:27 | jonasac | being assured that i read the return type correctly was all i needed :) |
22:11:34 | OnO | use case: https://github.com/nanoant/Nim/blob/47e45dee7e9157212995c5769b93713f5a4dd14b/tests/generics/tgenerictmpl2.nim |
22:15:45 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:17:39 | * | jonasac quit () |
22:19:33 | OnO | ehm... I think I found another bug :~( generic arguments cannot be used in generic templates, getting Error: undeclared identifier: 'T' |
22:20:27 | Araq | yeah I thought Zahary had fixed that. |
22:25:30 | * | xet7_ quit (Ping timeout: 240 seconds) |
22:25:49 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:28:15 | * | Trustable quit (Remote host closed the connection) |
22:28:41 | OnO | well indeed there is a commit 02f97489 that is suppose to fix that, but it doesn't fix the case here: https://github.com/nim-lang/Nim/issues/3498 |
22:32:20 | Araq | well I dunno. seems hard to implement and the workaround is trivial anyway |
22:32:35 | Araq | (var d: type(t); d) |
22:33:25 | * | vendethiel quit (Ping timeout: 246 seconds) |
22:34:18 | * | elrood quit (Quit: Leaving) |
22:36:07 | OnO | yeah, but what if I have argless template? |
22:36:50 | Araq | what if you don't? |
22:36:59 | Araq | seriously. |
22:37:06 | OnO | and btw. I checked, Zahary change works only with statics |
22:37:28 | OnO | so if T is static[int], then T gets int value |
22:37:29 | Araq | that we don't support generic parameters fully for templates was a concious implementation choice |
22:37:49 | OnO | if T is type, then T stays and undeclared T |
22:38:10 | Araq | IMO we can simply write that in the manual and call it good enough for version 1. |
22:38:23 | Araq | (I mean this part of the language) |
22:38:50 | Araq | there is nothing wrong with prunning a combinatorial explosion of features |
22:41:04 | Araq | proc default[T](): T {.inline.} = discard "cannot be a template, boohoo, deal with it, we have 30 high priority bugs open and you're concerned with this fringe case" |
22:47:40 | OnO | to be honest, my main interest in Nim is the meta programming capabilities, that don't work completely as advertised, the difference from other users is that I am trying to fix the bugs I encounter using Nim for some little projects, rather than creating new issue report and waiting for someone else to fix it |
22:49:29 | OnO | also I think the things that make Nim special comparing to other languages should have top prio, because this is what is Nim advertised for |
22:56:23 | Araq | fair enough and I love your work. |
22:57:51 | Araq | it's just that I think your effort would better be spent a little differently, but I'm not telling you what to do, go ahead and make generic templates work 100% |
23:00:42 | * | desophos joined #nim |
23:02:48 | * | Kingsquee joined #nim |
23:22:59 | OnO | oh yeah... got it :)) |
23:32:31 | Araq | you mean you got it to work? |
23:34:02 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
23:34:37 | * | Kingsquee joined #nim |
23:34:48 | * | pregressive quit (Remote host closed the connection) |
23:37:00 | * | boopsies joined #nim |
23:38:10 | OnO | yes, the fix was very easy |
23:38:22 | OnO | PR incoming in one 1min, just running tests here |
23:38:38 | OnO | there was some old 2 year strange mistake in the code != instead == |
23:39:33 | OnO | https://github.com/nim-lang/Nim/pull/3500 |
23:58:07 | * | boopsies is now known as boopsiesisaway |