00:00:09 | * | vendethiel joined #nim |
00:02:18 | * | Matthias247_ quit (Read error: Connection reset by peer) |
00:02:19 | Varriount | Araq: Pong |
00:09:51 | * | irrequietus quit () |
00:10:55 | * | brson quit (Ping timeout: 255 seconds) |
00:11:02 | * | kmcguire joined #nim |
00:11:19 | * | vendethiel quit (Ping timeout: 250 seconds) |
00:15:04 | * | saml_ quit (Remote host closed the connection) |
00:31:37 | Araq | Varriount: prepare the release binaries already |
00:32:13 | Varriount | Araq: Ok. |
00:32:19 | * | kniteli quit (Ping timeout: 245 seconds) |
00:32:37 | Varriount | Araq: What about Nimble? |
00:33:31 | Araq | what about it? |
00:33:47 | Varriount | Araq: Is it being included in the installer? |
00:33:55 | Araq | yeah |
00:35:06 | * | kniteli joined #nim |
00:38:28 | * | enurlyx quit (Quit: Leaving.) |
00:38:35 | Varriount | Araq: To speed up multimethods, could an input type be enumerated, and then used as an argument to an assembly 'jump' instruction? |
00:39:05 | Araq | yeah, but then this won't work across DLL boundaries |
00:39:20 | Araq | which is what people want. |
00:39:38 | Araq | we must not implement even more code generation at linking time |
00:40:12 | * | z1y joined #nim |
00:40:17 | Araq | we should instead perhaps investigate JIT like technology for efficient dispatching even across DLLs |
00:40:39 | Araq | z1y: 'koch pdf' now works |
00:40:49 | Araq | and produces pdfs in $nim/doc |
00:40:55 | Varriount | Araq: What about vtables tied to types, rather than type instances? |
00:41:21 | Araq | I don't think it matters where/how you tie them |
00:45:30 | Varriount | Araq: Multimethods are more cache-friendly, however an implementation that has runtime addition of types is probably going to have a complexity of O(n), whereas a vtable based approach will likely have a complexity closer to O(1) |
00:46:55 | Varriount | Now, I always thought the reason multimethods were used was because they didn't require the addition of a pointer to a vtable in the type. |
00:47:20 | Araq | I think you talk about dispatch trees vs. lookup tables |
00:47:37 | Varriount | Uh, yes, that's probably it. |
00:47:51 | Araq | both can be used to implement multi methods as can be any combination of these techniques |
00:50:00 | boydgreenfield | Idlework: Updated with some changes again – thoughts? http://a.pomf.se/yqylay.html |
00:53:49 | Araq | boydgreenfield: that's it. I claim it's perfect and want to pull it now. |
00:54:51 | * | BlaXpirit quit (Quit: Quit Konversation) |
00:56:29 | * | z1y quit (Ping timeout: 245 seconds) |
00:58:41 | j3rky | the nim documentation has an example for a generic matrix type that uses a 'Numeric' type constraint. where is that constraint declared? |
00:59:01 | * | nimnoob quit (Ping timeout: 246 seconds) |
01:00:32 | * | boydgreenfield quit (Quit: boydgreenfield) |
01:02:29 | Araq | j3rky: that should be 'SomeNumber' now |
01:02:36 | Araq | which is in system.nim |
01:03:30 | j3rky | yeah, i just found it myself :) |
01:03:38 | * | Trustable quit (Quit: Leaving) |
01:05:04 | j3rky | Araq: does nim have a notion of type classes similar to Haskell, i.e. if a list of procs that a type must satisfy, or is the enum style syntax as used for SomeNumber the way to go for now? |
01:07:16 | * | yglukhov__ quit (Quit: Be back later ...) |
01:07:22 | flaviu | Not quite perfect yet. It'd be nice if each proc name linked to it's anchor. |
01:07:37 | flaviu | But that's not really a big deal. |
01:08:45 | Araq | flaviu: it's much better than what we currently have, so I want to pull it, regenerate everything and release 10.2 finally |
01:09:10 | flaviu | Of course. |
01:12:22 | Araq | j3rky: for now use the | notation. much better type classes are in the works, but will end up in the experimental mode for 1.0. |
01:13:31 | j3rky | ok, good to know, thanks! |
01:27:14 | * | quasinoxen quit (Ping timeout: 250 seconds) |
01:28:57 | * | quasinoxen joined #nim |
01:29:15 | * | vendethiel joined #nim |
01:34:05 | * | boydgreenfield joined #nim |
01:34:27 | boydgreenfield | Araq: Great, go ahead! |
01:34:46 | Varriount | Araq: Um, I think the current installers are broken. |
01:44:00 | * | nande joined #nim |
01:44:22 | dom96 | Araq: we releasing 0.10.2 then? |
01:55:36 | * | Ven joined #nim |
02:09:55 | boydgreenfield | Araq: Ok, I really have stopped now – and am quitting my editor etc. Please feel free to merge in whenever (that second squashed commit it just having the raw string syntax color match that of other strings vs. that of numbers, which threw me off a bit) |
02:25:46 | boydgreenfield | Araq: One other FYI, is that it looks like we’ll need to update tools/nimweb.nim to incl. the Github path (which was previously hardcoded into rstgen.nim). Happy to do this, but I’m actually having `koch web` break on yesterday’s devel branch with the following error: `system.nim(1115, 14) Error: internal error: cannot generate code for: mDefined`. |
02:46:12 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
02:55:49 | * | yglukhov__ joined #nim |
02:58:09 | * | kmcguire quit (Ping timeout: 250 seconds) |
02:59:35 | boydgreenfield | Araq: OK, that’s done now too. Opened an issue for the koch web bug w/r/t system.nim, which is unrelated. |
02:59:36 | * | dyu joined #nim |
02:59:45 | * | boydgreenfield quit (Quit: boydgreenfield) |
03:00:10 | * | yglukhov__ quit (Ping timeout: 256 seconds) |
03:01:15 | * | darkf joined #nim |
03:15:03 | * | willwillson quit (Ping timeout: 272 seconds) |
03:20:34 | * | boydgreenfield joined #nim |
03:31:13 | * | tinAndi_ joined #nim |
03:31:13 | * | tinAndi quit (Ping timeout: 258 seconds) |
03:31:16 | * | tinAndi_ is now known as tinAndi |
03:32:23 | j3rky | can someone tell me what's wrong with these generic types? i can't figure it out :( http://pastebin.com/c5FkN7kf |
03:36:46 | j3rky | the idea is to specialize for certain generic parameters, so that specialized procs can be added for those cases |
03:38:06 | * | EXetoC quit (Quit: WeeChat 1.0.1) |
03:41:36 | * | boydgreenfield quit (Quit: boydgreenfield) |
03:54:57 | * | rpag quit (Ping timeout: 240 seconds) |
03:56:22 | * | kapil__ joined #nim |
04:25:23 | dts|pokeball | how strong is the linux community in nim? |
04:26:59 | * | vendethiel quit (Ping timeout: 250 seconds) |
04:27:08 | j3rky | not sure what that means, pokeball. are you wondering what is the ratio of nim users on linux vs windows? |
04:27:52 | dts|pokeball | no. just if a lot of nim coders write nim on linux |
04:28:47 | j3rky | hmm, i don't know. i actually thought that most of the devs are on Windows, although i have not asked anyone. |
04:33:23 | * | brson joined #nim |
04:34:11 | fowlmouth | dts|pokeball, its probably 60/20/20 linux/osx/windows |
04:34:58 | dts|pokeball | so if i write libdaemon which a nim process can be used to make itself a daemon it would be worthwhile? |
04:36:31 | fowlmouth | j3rky, how do you try to instantiate it |
04:36:54 | fowlmouth | oh i see |
04:37:21 | fowlmouth | thats a bug |
04:43:36 | * | vendethiel joined #nim |
04:44:44 | * | yglukhov__ joined #nim |
04:48:09 | j3rky | fowlmouth: yeah, i'm reading through the forums and bug database. looks like static[] is not really usable yet :/ |
04:49:05 | * | yglukhov__ quit (Ping timeout: 250 seconds) |
04:50:41 | j3rky | i can kinda sorta get that code to work by declaring Foo as an 'object' and giving it the array as a member, then inherit Bar from Foo. |
05:06:32 | * | vendethiel quit (Ping timeout: 256 seconds) |
05:06:37 | * | brson quit (Quit: leaving) |
05:11:49 | * | vendethiel joined #nim |
05:33:28 | * | vendethiel quit (Ping timeout: 264 seconds) |
05:35:50 | * | vendethiel joined #nim |
05:52:39 | * | boydgreenfield joined #nim |
06:03:51 | * | boydgreenfield quit (Quit: boydgreenfield) |
06:07:58 | * | boydgreenfield joined #nim |
06:08:16 | * | boydgreenfield quit (Client Quit) |
06:33:43 | * | yglukhov__ joined #nim |
06:38:09 | * | yglukhov__ quit (Ping timeout: 245 seconds) |
06:39:49 | * | vendethiel quit (Ping timeout: 245 seconds) |
06:40:19 | * | yglukhov__ joined #nim |
06:42:30 | * | vendethiel joined #nim |
06:44:47 | * | yglukhov__ quit (Ping timeout: 250 seconds) |
07:08:34 | * | comex quit (Ping timeout: 258 seconds) |
07:10:20 | * | noam_ joined #nim |
07:11:38 | * | noam quit (Ping timeout: 258 seconds) |
07:13:10 | * | darkf quit (Ping timeout: 258 seconds) |
07:15:05 | * | biscarch quit (Ping timeout: 258 seconds) |
07:15:09 | * | darkf joined #nim |
07:15:14 | * | darkf quit (Changing host) |
07:15:14 | * | darkf joined #nim |
07:15:59 | * | endou_____ joined #nim |
07:22:02 | * | comex joined #nim |
07:32:35 | * | biscarch joined #nim |
07:52:33 | * | gour joined #nim |
08:01:29 | * | kapil__ quit (Quit: Connection closed for inactivity) |
08:08:22 | * | vendethiel quit (Ping timeout: 255 seconds) |
08:11:52 | * | dts|pokeball quit (Ping timeout: 264 seconds) |
08:18:52 | * | nande quit (Remote host closed the connection) |
08:22:27 | * | vendethiel joined #nim |
08:29:13 | * | yglukhov__ joined #nim |
08:31:52 | * | gour quit (Quit: Leaving) |
08:32:57 | * | gour joined #nim |
08:33:02 | * | gour_ joined #nim |
08:33:37 | * | yglukhov__ quit (Ping timeout: 245 seconds) |
08:36:29 | * | gour quit (Client Quit) |
08:36:35 | * | gour_ quit (Client Quit) |
08:37:20 | * | gour joined #nim |
08:43:37 | * | vendethiel quit (Ping timeout: 245 seconds) |
08:47:14 | * | vendethiel joined #nim |
08:53:30 | * | yglukhov__ joined #nim |
08:58:42 | * | kapil__ joined #nim |
08:58:52 | j3rky | is there a way for the compiler to spit out the AST for a module? |
09:05:12 | * | gour quit (Quit: Leaving) |
09:24:29 | * | notfowl joined #nim |
09:27:17 | * | fowlmouth quit (Ping timeout: 240 seconds) |
09:32:31 | * | vendethiel quit (Ping timeout: 272 seconds) |
09:37:51 | * | vendethiel joined #nim |
09:49:58 | * | z1y joined #nim |
09:51:20 | * | Matthias247 joined #nim |
10:01:40 | * | vendethiel quit (Ping timeout: 264 seconds) |
10:01:55 | * | vendethiel joined #nim |
10:03:00 | * | milosn joined #nim |
10:05:57 | * | z1y quit (Quit: Leaving.) |
10:07:26 | * | milosn quit (Ping timeout: 256 seconds) |
10:25:40 | * | vendethiel quit (Ping timeout: 264 seconds) |
10:27:18 | * | vendethiel joined #nim |
10:40:45 | * | vendethiel quit (Quit: q+) |
11:06:57 | * | BlaXpirit joined #nim |
11:23:46 | * | Trustable joined #nim |
11:24:37 | * | johnsoft quit (Ping timeout: 272 seconds) |
11:25:32 | * | johnsoft joined #nim |
11:35:24 | * | skyfex quit (Read error: No route to host) |
11:41:10 | * | Trixar_za quit (Ping timeout: 244 seconds) |
11:43:19 | * | Trixar_za joined #nim |
11:44:54 | * | johnsoft quit (Ping timeout: 256 seconds) |
11:45:04 | * | judofyr joined #nim |
11:45:50 | * | johnsoft joined #nim |
11:46:03 | judofyr | is there a way to capture variable named arguments in a proc? |
11:46:09 | judofyr | (or a macro) |
11:46:30 | judofyr | ul(id="foo", class="bar") |
11:46:43 | judofyr | or: is there a better syntax to accomplish the same thing? |
11:50:29 | dom96 | Not as far as I know. |
11:50:34 | * | johnsoft quit (Ping timeout: 256 seconds) |
11:50:45 | dom96 | You'd need to specify the args in your proc/macro definition. |
11:51:10 | judofyr | bummer |
11:51:35 | judofyr | another question: how do I build a JavaScript object? |
11:53:11 | dom96 | judofyr: Just as you would a Nim object. |
11:54:06 | dom96 | What do you want to do? |
11:54:38 | judofyr | I want ul(("id", "foo")) to be generated as React.DOM.ul({id: "foo"}) |
11:54:49 | judofyr | but I realise this might be difficult |
11:55:13 | judofyr | (for instance because of the different string representations) |
11:55:36 | dom96 | Take a look at https://github.com/Araq/Nimrod/blob/devel/lib/js/dom.nim |
11:55:40 | dom96 | That's how the DOM is defined. |
11:55:56 | dom96 | You can define a similar object called React. |
11:56:24 | judofyr | yeah, it's the object literal that's the trouble now |
11:56:30 | dom96 | Then define it as: var react: React {.importc: "React".} |
11:56:55 | dom96 | hrm. |
11:58:41 | dom96 | You can make your React.DOM.ul proc take a RootObj |
11:59:04 | dom96 | Then make a ul macro which will construct a dummy type which inherits from RootObj |
11:59:14 | dom96 | Based on the ("id", "foo") |
11:59:16 | * | MyMind joined #nim |
11:59:27 | * | kniteli quit (Ping timeout: 245 seconds) |
12:01:27 | dom96 | You may be able to pass in {"id": "foo"} to your macro btw |
12:01:44 | dom96 | maybe even {id: "foo"} will work |
12:02:04 | * | MyMind quit (Client Quit) |
12:03:22 | judofyr | nice |
12:03:53 | judofyr | what type is that? |
12:04:05 | judofyr | or: where can I read about {"foo":"bar"} in the manual? |
12:08:28 | dom96 | http://nim-lang.org/manual.html#table-constructor |
12:09:24 | judofyr | ah, thanks |
12:10:35 | * | MyMind joined #nim |
12:16:52 | * | MyMind quit (Quit: WeeChat 1.0.1) |
12:17:18 | * | MyMind joined #nim |
12:18:42 | wan | The thing I find the most offputting about the js export is that it doesn't use js strings, and leads to a lot of unneccessary conversions in the generated code |
12:33:31 | Araq | dom96, judofyr it's perfectly easy to capture named args in a macro ... |
12:33:53 | Araq | but you have to use an .immediate macro and 'callsite' |
12:34:23 | judofyr | Araq: yeah, I looked in htmlgen and found the trick |
12:34:35 | judofyr | Araq: what about the "how to generate object literal" issue? |
12:35:13 | Araq | wan: well make a suggestion of how to improve things |
12:37:15 | * | vendethiel joined #nim |
12:46:39 | * | EXetoC joined #nim |
12:55:53 | * | Trustable quit (Remote host closed the connection) |
12:56:43 | * | Trustable joined #nim |
13:00:28 | * | MyMind quit (Ping timeout: 264 seconds) |
13:05:14 | def- | A benchmark including Nim: https://www.reddit.com/r/programming/comments/2pvf68/armv7_vs_x8664_pathfinding_benchmark_of_c_d_go/ |
13:08:28 | * | Matthias247 quit (Read error: Connection reset by peer) |
13:13:34 | * | dyu quit (Ping timeout: 250 seconds) |
13:13:59 | * | dyu joined #nim |
13:17:22 | dom96 | Top of HN too https://news.ycombinator.com/item?id=8776335 |
13:17:48 | * | flaviu quit (Remote host closed the connection) |
13:17:54 | def- | Hm, can't get LDC compiled to compare to D |
13:18:05 | def- | Just made the Nim solution quite a bit faster really simply |
13:18:59 | * | kmcguire joined #nim |
13:22:41 | * | tinAndi quit (Quit: ChatZilla 0.9.91 [Firefox 34.0/20141125180439]) |
13:23:23 | def- | ok, got it. nice, nim is the fastest for me now |
13:24:55 | * | johnsoft joined #nim |
13:25:13 | * | judofyr quit (Ping timeout: 246 seconds) |
13:26:16 | * | flaviu joined #nim |
13:29:14 | def- | Is there a way to set the compiler to clang without editing build.conf? |
13:29:18 | def- | nim.conf* |
13:39:27 | * | enurlyx joined #nim |
13:44:02 | dom96 | pass --cc:clang or something like that |
13:47:38 | wan | can confirm that --cc:clang works |
13:47:56 | wan | def-: you should add it to the makefile |
13:48:08 | def- | dom96: ah, nice |
14:04:50 | * | nande joined #nim |
14:09:54 | * | saml_ joined #nim |
14:16:16 | * | BitPuffin joined #nim |
14:31:29 | * | kapil__ quit (Quit: Connection closed for inactivity) |
14:33:23 | * | yglukhov joined #nim |
14:33:31 | * | saml_ quit (Ping timeout: 252 seconds) |
14:33:33 | wan | this benchmark is a great opportunity for the next release to get more attention |
14:33:40 | * | yglukhov__ quit (Read error: Connection reset by peer) |
14:33:54 | wan | especially with the docs getting nicer |
14:34:41 | * | saml_ joined #nim |
14:35:20 | wan | there would be a clear funnel "what's this nim all about?" -> (goes for the documentation) -> "Nice documentation!" |
14:47:03 | * | vendethiel quit (Quit: q+) |
14:58:05 | * | darkf quit (Quit: Leaving) |
15:04:23 | Trustable | Hi all, is anyone keeping an eye on the binary size of a Hello World program? Why has the size increased from 58 kB to 172 kB in the last month? |
15:08:35 | wan | I get 166K when compiled normally, but 57K when run with -d:release. That might be the difference you're seeing |
15:11:36 | Varriount | def-: Oooh, and that benchmark shows Nim as faster then Java. |
15:12:17 | Varriount | Don't most smartphones run on ARM processors? Or am I mistaken? |
15:12:28 | * | rpag joined #nim |
15:15:02 | Varriount | Araq, dom96: The installers are broken. They can't locate the documentation or mingw compilers with the target URL's |
15:17:00 | Araq | Trustable: strange, there should be no increase in size. can you git bisect it perhaps? or just look at the diffs for the generated C |
15:17:33 | Araq | Varriount: well that's why I told you to build them ;-) so that we can see the problems |
15:18:37 | Trustable | wan and Araq: Thanks, you're right, I did not use d:release. With d:release the size good. |
15:19:20 | def- | Varriount: no, you're right |
15:21:31 | * | gour joined #nim |
15:22:13 | Varriount | def-: Oh! And looking at the other benchmark statistics, Nim is in 2nd or 3rd fastest! |
15:22:57 | def- | Varriount: yes, and compare it to the C++ solution, doesn't look nearly as nice |
15:23:15 | def- | I tried using bitsets as well in Nim, but for me it's a slowdown |
15:25:15 | Varriount | Hm, I wonder what the memory usage for each language is like. (S)he didn't post those. |
15:27:21 | def- | Varriount: That's interesting indeed! C++: 10.8 MB, D: 9.6 MB, Nim: 5.9 MB |
15:27:38 | Varriount | O_o |
15:28:01 | Varriount | I would have expected Nim to use *more* memory. |
15:28:06 | flaviu | Perhaps nim doesn't do as well as C++ because it doesn't use enough slack memory. |
15:28:10 | Varriount | (than C++) |
15:28:29 | def- | (I just used /usr/bin/time and looked at maxresident) |
15:29:27 | def- | for me Nim is just as fast as C++ |
15:32:05 | Varriount | Hm. I still wonder why C++ used more memory. |
15:33:18 | * | vendethiel joined #nim |
15:33:23 | Varriount | Hi vendethiel |
15:36:02 | def- | Varriount: because of the bitset I guess |
15:36:14 | def- | or some vector allocated too much memory |
15:37:17 | Varriount | def-: Yes, but 5MB is quite a large amount of excess memory. |
15:39:55 | def- | Varriount: I think /usr/bin/time reports bad memory sizes anyway, may be factor 4 smaller... |
15:39:59 | * | yglukhov quit (Quit: Be back later ...) |
15:40:04 | def- | but comparisons should be fine |
15:40:46 | flaviu | Yep, on my cpu, nim is 1.038x faster than C++ |
15:41:14 | flaviu | over 10 trials each, so it isn't just noise. |
15:41:45 | def- | flaviu: what cpu do you have? I'm on a Core2Quad |
15:41:58 | flaviu | Phenom II x4 |
15:42:46 | Araq | so ... still no PR to fix the website's contrast? |
15:43:02 | flaviu | oddly, using O3 for c++ actually makes it slower. |
15:43:32 | flaviu | significantly. Like 50% |
15:43:54 | def- | flaviu: yeah, that sometimes happens |
15:44:19 | * | enurlyx quit (Quit: Leaving.) |
15:52:11 | * | nimnoob joined #nim |
15:52:38 | * | gour quit (Remote host closed the connection) |
15:57:01 | Varriount | Araq: As soon as the installer links are fixed, I can continue to test the build. |
15:57:23 | Araq | Varriount: well can't you fix the links on your own? |
15:57:26 | * | johnsoft quit (Read error: Connection reset by peer) |
15:58:56 | Varriount | Araq: I don't know how the website is set up, nor where to put files on the VPS so that they can be downloaded. |
16:05:27 | vendethiel | hi Varriount |
16:08:07 | Araq | Varriount: http://nim-lang.org/download/mingw32.zip for instance works for me |
16:08:30 | Araq | what links are you talking about? |
16:08:39 | Varriount | Araq: Documentation |
16:08:45 | * | Matthias247 joined #nim |
16:09:43 | Araq | http://nim-lang.org/download/docs-0.9.6.zip works too |
16:09:55 | Araq | and docs-0.10.2 doesn't exist yet ;-) |
16:10:00 | Araq | but it will |
16:11:46 | * | gour joined #nim |
16:12:01 | * | nande quit (Read error: Connection reset by peer) |
16:18:39 | * | gmpreussner joined #nim |
16:18:58 | * | vezzy joined #nim |
16:19:31 | * | nimnoob quit (Ping timeout: 246 seconds) |
16:19:43 | * | clone1018__ joined #nim |
16:19:47 | * | bjz_ joined #nim |
16:20:27 | * | gmpreussner is now known as j3rky_ |
16:21:58 | j3rky_ | are there any examples of emulating variadic templates with macros? |
16:22:56 | * | Araq_ joined #nim |
16:38:13 | * | noam_ quit (Ping timeout: 255 seconds) |
16:43:30 | * | quasinoxen quit (*.net *.split) |
16:43:30 | * | j3rky quit (*.net *.split) |
16:43:30 | * | clone1018_ quit (*.net *.split) |
16:43:30 | * | bjz quit (*.net *.split) |
16:43:30 | * | Araq quit (*.net *.split) |
16:43:31 | * | phI||Ip quit (*.net *.split) |
16:43:32 | * | endou______ joined #nim |
16:43:33 | * | CARAM__ joined #nim |
16:43:33 | * | biscarch_ joined #nim |
16:43:33 | * | dyu quit (Quit: Leaving) |
16:43:34 | * | endou_____ quit (Ping timeout: 265 seconds) |
16:43:34 | * | biscarch quit (Ping timeout: 265 seconds) |
16:43:36 | * | Sembei quit (Ping timeout: 245 seconds) |
16:43:37 | * | Sembei joined #nim |
16:43:37 | * | biscarch_ is now known as biscarch |
16:43:37 | * | hguux_ joined #nim |
16:43:38 | * | bjz_ quit (*.net *.split) |
16:43:38 | * | Trixar_za quit (*.net *.split) |
16:43:40 | * | Varriount_ joined #nim |
16:43:40 | flaviu | j3rky_: I'm not sure, but if you'll be more specific in your goal, I could probably point you in the right direction. |
16:43:40 | * | mbenadda quit (*.net *.split) |
16:43:41 | * | Triplefox quit (*.net *.split) |
16:43:41 | * | phI||Ip joined #nim |
16:43:41 | j3rky_ | flaviu: i just started learning nim, and i thought i'd try and implement a multidimensional array with static dimensionality to learn about generics, templates etc... |
16:43:41 | j3rky_ | what i had in mind was something like MultiArray<2, 3, 4, float> that would generate something like array[0..2, array[0..3, array[0..4, T]]] |
16:43:47 | j3rky_ | i don't know, maybe this is a bad idea to begin with |
16:44:04 | * | Varriount quit (Ping timeout: 255 seconds) |
16:44:10 | * | Triplefox joined #nim |
16:44:27 | * | TylerE joined #nim |
16:44:37 | * | bjz joined #nim |
16:44:37 | flaviu | It's possible. Make a macro that takes static[int]s and outputs a type declaration. |
16:45:02 | * | ekarlso- quit (Ping timeout: 265 seconds) |
16:45:04 | j3rky_ | would that type declaration output be a generic type? |
16:45:17 | j3rky_ | or would i resolve it for the actual parameters? |
16:45:49 | * | Triplefox quit (Ping timeout: 250 seconds) |
16:46:00 | j3rky_ | i guess the latter. it would also have to output the various matching procs and operators, i suppose. |
16:46:28 | flaviu | whichever you'd like. Yes, you would have to output the relevent procs. |
16:47:02 | j3rky_ | is there an example of something even remotely similar to this? i've looked at various macros that generate AST, but haven't gotten too far yet. |
16:47:20 | j3rky_ | also, is there a way to have the compiler output the AST for an existing module, so i can learn how things are structured? |
16:47:42 | j3rky_ | or do i need to look at the grammar? :) |
16:47:44 | flaviu | j3rky_: import macros;dumpTree: ... |
16:48:31 | flaviu | You'll have to indent your whole module, but most text editors can do that. |
16:48:45 | j3rky_ | ok cool, i'll check that out |
16:49:17 | * | Triplefox joined #nim |
16:49:17 | * | Trixar_za joined #nim |
16:50:30 | * | endou______ quit (Changing host) |
16:50:30 | * | endou______ joined #nim |
16:50:31 | * | CARAM__ quit (Changing host) |
16:50:31 | * | CARAM__ joined #nim |
16:50:34 | * | biscarch quit (Changing host) |
16:50:34 | * | biscarch joined #nim |
16:50:47 | * | hguux_ quit (Changing host) |
16:50:47 | * | hguux_ joined #nim |
16:51:20 | * | TylerE quit (Changing host) |
16:51:20 | * | TylerE joined #nim |
16:52:41 | * | kokozedman joined #nim |
16:54:49 | * | BlaXpirit quit (Read error: Connection reset by peer) |
16:55:35 | * | BlaXpirit joined #nim |
16:57:12 | def- | Varriount_, flaviu: Got it a bit faster, hopefully it beats C++ & D on his platforms now: https://github.com/def-/LPATHBench/blob/master/nim.nim |
16:57:22 | * | enurlyx joined #nim |
17:04:40 | * | ekarlso- joined #nim |
17:16:52 | * | jefus joined #nim |
17:17:15 | Varriount_ | def-: Aren't global variables slower than procedure variables? Usually you should put everything you can in a main() procedure |
17:17:49 | def- | Varriount_: I usually write it in this style and it's usually faster (in this case too) |
17:18:21 | def- | But yes, I've seen that some things are faster in main() |
17:21:42 | * | boydgreenfield joined #nim |
17:25:21 | * | rpag quit (Ping timeout: 258 seconds) |
17:25:28 | Varriount_ | def-: You got the last line wrong. It's supposed to be (duration * 1000) - timeItTakesForCPlusPlus |
17:25:32 | Varriount_ | :P |
17:25:39 | * | Varriount_ is now known as Varriount |
17:27:57 | * | gour_ joined #nim |
17:28:40 | * | yglukhov joined #nim |
17:30:25 | * | gour quit (Disconnected by services) |
17:30:30 | * | gour_ is now known as gour |
17:31:52 | * | Ven joined #nim |
17:32:00 | * | Ven quit (Client Quit) |
17:33:51 | * | yglukhov quit (Ping timeout: 272 seconds) |
17:35:49 | * | nimnoob joined #nim |
17:38:03 | * | rpag joined #nim |
17:43:03 | wan | def-: I think I got a better version |
17:43:25 | wan | I just tried changing seq in openarray and I got better results on my laptop |
17:43:48 | wan | https://github.com/logicchains/LPATHBench/pull/19/files |
17:43:51 | def- | wan: interesting, saw your pull request |
17:44:11 | def- | wan: I have a new version as well though: https://github.com/logicchains/LPATHBench/pull/15 |
17:45:09 | def- | mine is a bit faster for me |
17:45:29 | def- | I'm not passing the seq at all |
17:45:32 | reactormonk | def-, you forgot one "nimrod" |
17:45:40 | def- | reactormonk: oh |
17:45:55 | ekarlso- | Araq_: long from 1.0 ? :p |
17:46:01 | def- | No, I fixed that, he must have changed it back^^ |
17:46:17 | wan | def-: I got 1345 for yours, and 1250 for mine on a i5 m520 |
17:46:43 | def- | wan: hm ok |
17:46:56 | reactormonk | def-, time for another PR. |
17:47:45 | def- | wan: you compile with "nim -d:release --cc:clang c nim"? |
17:48:17 | wan | yep (for reference, the current version is at 1370) |
17:48:42 | wan | I'll try it again just to check if I made an error |
17:48:58 | wan | (I'm on a very recent devel, by the way) |
17:49:05 | wan | maybe that counts? |
17:49:09 | def- | for me: current version: 1497, yours: 1435, mine: 1400 |
17:49:15 | def- | I'm on the most recent devel as well |
17:49:42 | wan | what Core2Quad do you have? Which frequency? |
17:49:58 | def- | Q9300 @ 2500 MHz |
17:50:17 | wan | mine is i5 M520 @ 2.40GHz |
17:50:31 | wan | damn, my laptop cpu is better than your desktop cpu |
17:50:38 | Matthias247 | the benchmark is not that fair for all the JITted languages. Doesn't take the time that's needed for compiling into account |
17:50:43 | wan | and they are probably about the same age |
17:51:00 | wan | faster* on this benchmark, not better |
17:51:12 | def- | wan: nah, mine is from 2008, yours 2010 |
17:51:33 | wan | ah, right. |
17:51:58 | wan | we should choose the solution that will work the best on logicchains' hardware |
17:52:06 | def- | haha |
17:53:12 | onionhammer1 | http://www.reddit.com/r/programming/comments/2pvf68/_/ |
17:53:21 | def- | oh, hi onionhammer1 |
17:53:32 | def- | You were the first to write the nimrod solution |
17:53:39 | * | boydgreenfield quit (Quit: boydgreenfield) |
17:53:47 | onionhammer1 | ah yehp |
17:53:51 | onionhammer1 | I see you improved upon it |
17:53:53 | def- | wan and I have tried to get it faster a bit |
17:54:02 | def- | but the benchmark author is asleep now, so no more merges |
17:54:18 | onionhammer1 | ;) |
17:54:24 | def- | at least on my machine it's faster than C++ & D |
17:54:32 | onionhammer1 | i didnt try to get it faster, I tried to get it to match the others as closely as possible |
17:54:55 | onionhammer1 | I feel like you could cheat and get it a lot faster by using non nim-like structures, but the same is true w/ the C++ version |
17:54:59 | def- | yeah, i noticed, but then they switched to bitsets in the C++ solution |
17:55:03 | onionhammer1 | ahh |
17:55:06 | wan | he has an i5-430M |
17:55:22 | * | boydgreenfield joined #nim |
17:55:22 | def- | wan: sounds more like yours than mine |
17:55:23 | wan | it came out in Q1'10, same as my 520M |
17:55:35 | wan | I'm afraid so |
17:56:53 | onionhammer1 | usually wrapping your logic in a 'main' function is good practice though |
17:57:13 | onionhammer1 | because not doing so can lead to memory leaks |
17:57:19 | onionhammer1 | iirc |
17:57:22 | * | onionhammer1 is now known as onionhammer |
17:57:23 | wan | does anybody has a Galaxy S3 to test improvements on that? We're still two times slower on that one (maybe gcc works better for ARM?) |
17:59:54 | flaviu | I just got a diabolical idea: Does the benchmark require that there be no memory leaks? |
18:00:09 | def- | flaviu: haha, why? |
18:00:36 | flaviu | If gc was turned off, the benchmark is short enough that the memory leaks shouldn't be too bad. |
18:00:56 | def- | yeah, gc isn't really needed here I think |
18:01:30 | def- | same speed without GC |
18:02:33 | def- | wan: on a Celeron J1900: D: 1612, C++: 1532, Mine: 1527, Yours: 1588 |
18:02:40 | def- | Don't have anything ARM |
18:02:45 | flaviu | huh, looks like clang is 2x faster than gcc. |
18:03:06 | def- | yeah, in most of the nim code I tested clang was faster |
18:03:06 | * | gour quit (Quit: Leaving) |
18:03:07 | * | nimnoob quit (Ping timeout: 246 seconds) |
18:03:24 | * | gour joined #nim |
18:03:38 | wan | def-: crap, our solutions are architecture dependent. We can't determine a clear winner :( |
18:04:14 | flaviu | gc none is actually a bit slower for me |
18:05:08 | def- | afk |
18:05:16 | wan | seriously, you beat C++? On mine, C++ does 1088 (quite far ahead 1250) |
18:07:58 | flaviu | Yeah, we're not beating c++ |
18:08:09 | flaviu | cpp was compiled with gcc, so it was slow |
18:08:44 | flaviu | cpp was compiled with gcc, so it was slow. If both are compiled with clang, c++ is ~50ms faster on my system |
18:14:09 | * | willwillson joined #nim |
18:21:03 | * | gour quit (Quit: Leaving) |
18:21:23 | * | gour joined #nim |
18:21:34 | wan | On my E8400 @ 3.00GHz, current_nim:1245 def:1165 wan:1180 cpp_gcc_O2:1170 cpp_gcc_O3:1255 cpp_clang_O2orO3:1228 |
18:22:05 | wan | So we do indeed beat cpp on some architectures |
18:24:54 | * | boydgreenfield quit (Quit: boydgreenfield) |
18:33:36 | Varriount | Well, the end point is not so much that Nim is fast as/faster than C++, so much as it is that Nim is faster than most other solutions (*cough*java*cough*) |
18:35:48 | * | nimnoob joined #nim |
18:37:21 | nimnoob | is there a way to call a base class constructor? |
18:37:45 | nimnoob | i have a base class that has a Table and i need to init that table |
18:39:45 | willwillson | nimnoob: not sure what you mean.. are you using generics? can you gist it? |
18:39:45 | wan | I think you still have to write your constructor containing initTable. Default values (like 0 for ints, false for bools, etc) can't be applied automatically when the GC is involved (like with initTable). |
18:40:16 | wan | when the heap* |
18:44:08 | nimnoob | http://pastebin.com/vfrb66ek |
18:44:16 | nimnoob | that class is a base class for my controls |
18:44:38 | nimnoob | it has a table within it that i need to call initTable for |
18:45:03 | nimnoob | does each derived class have to call initTable? |
18:46:52 | Varriount | nimnoob: If they don't call the original constructor, yes. |
18:47:22 | nimnoob | how would they call the original constructor? sorry i am not familiar with the syntax |
18:47:54 | nimnoob | in C#, you would call super(...) |
18:47:58 | Varriount | nimnoob: Use a conversion, then call the original constructor. |
18:48:45 | wan | isn't proccall in? Read the following, it has details http://goran.krampe.se/2014/11/30/nim-and-oo-part-iv/ |
18:49:13 | Varriount | nimnoob: ParentType(ChildTypeInstance).init() or init(ParentType(ChildTypeInstance)) |
18:51:06 | * | Matthias247 quit (Read error: Connection reset by peer) |
18:51:27 | nimnoob | ah ok, thank you Varriount |
18:51:47 | nimnoob | that was something i wouldn't have figured out by myself :) |
18:52:31 | nimnoob | it makes sense |
18:53:08 | nimnoob | a lot of things about nim make sense when i convert them mentally to just dealing with pointers in C/C++ |
18:53:43 | Varriount | nimnoob: Nim is not as object oriented as C++ - It's much closer to C |
18:54:58 | nimnoob | understood |
18:56:38 | Varriount | wan: That article makes me wonder if we need a 'methodCall' as well. |
19:00:59 | Varriount | Araq_: What is the 'release' revision for 10.2? |
19:07:32 | * | jefus_ joined #nim |
19:08:23 | * | repax joined #nim |
19:09:11 | Araq_ | Varriount: hrm? |
19:11:26 | * | jefus quit (Ping timeout: 256 seconds) |
19:17:26 | * | yglukhov joined #nim |
19:21:25 | nimnoob | since you can't call a base class _method_ by casting to the base class type |
19:21:41 | nimnoob | i guess one workaround is to implement each base class method as a proc |
19:21:51 | nimnoob | and have the method call the proc |
19:22:13 | nimnoob | anyone who wants to call the base class method can just do a conversion and call the proc instead |
19:22:21 | * | yglukhov quit (Ping timeout: 265 seconds) |
19:24:14 | * | yglukhov joined #nim |
19:28:40 | * | yglukhov quit (Ping timeout: 244 seconds) |
19:30:10 | * | yglukhov joined #nim |
19:34:55 | * | yglukhov quit (Ping timeout: 265 seconds) |
19:38:34 | def- | hm, how could I get a 64 byte aligned array? |
19:39:18 | Araq_ | nimnoob: you can use procCall m(a, b) and then the "super" method is called if 'a' and 'b' have the proper (static) types |
19:39:58 | nimnoob | ok i will try it |
19:40:08 | nimnoob | ty |
19:40:57 | * | yglukhov joined #nim |
19:41:32 | def- | Something like "float fa[FLOPS_ARRAY_SIZE] __attribute__((align(64)));" |
19:42:03 | Araq_ | def-: use .codegenDecl for it? |
19:42:17 | Araq_ | or just rely on the C compiler to do it anyway |
19:42:52 | def- | Araq_: awesome, haven't seen this yet |
19:43:13 | Araq_ | well I don't remember if it works for vars |
19:43:28 | Araq_ | it's been designed for procs |
19:43:35 | def- | there's a var example in the compiler guide |
19:43:42 | Araq_ | very well then |
19:43:50 | def- | I'm running Nim on the Xeon Phi btw |
19:44:36 | def- | Surpringly it works with the intel compiler |
19:45:00 | Araq_ | Intel C++ is/was a supported compiler |
19:45:26 | * | yglukhov quit (Ping timeout: 256 seconds) |
19:45:32 | def- | Well, I've recently had a lot of problems with the intel compiler |
19:45:45 | def- | and there is no free license for it anymore |
19:50:54 | * | yglukhov joined #nim |
19:51:12 | nimnoob | do recursive methods require a special pragma? |
19:51:38 | nimnoob | the compiler is crashing with "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" when i add one |
19:58:17 | Araq_ | hrm still? |
19:58:25 | Araq_ | I thought we fixed that months ago |
20:03:07 | nimnoob | using 0.9.6 on linux |
20:03:23 | nimnoob | i created a small sample and was able to reproduce the issue |
20:06:21 | * | starless joined #nim |
20:16:07 | * | nimnoob quit (Ping timeout: 246 seconds) |
20:27:46 | * | repax quit (Ping timeout: 250 seconds) |
20:42:22 | Araq_ | oh ok, it's fixed on devel then |
20:45:29 | * | yglukhov quit (Ping timeout: 265 seconds) |
20:46:06 | * | yglukhov joined #nim |
20:47:04 | def- | Araq_: the intel compiler has problems with optimizing Nim's loops because of the gotos. the || loops are fine because they're formed with "for (...)". Any chance to get the behaviour for normal loops changed (when possible)? |
20:47:30 | Araq_ | er ... what?! |
20:47:49 | Araq_ | the intel compiler has *problems* with gotos? |
20:48:33 | Araq_ | shouldn't it have the best optimizer? |
20:49:01 | def- | after playing around in the C code I got 2 TFlops on the Phi |
20:49:46 | * | starless quit (Quit: WeeChat 0.4.2) |
20:51:24 | Araq_ | well patching the codegen to emit 'for' instead is not easy |
20:51:38 | def- | but it works for || loops? |
20:52:02 | Araq_ | yeah but this is special cased |
20:52:17 | def- | ok, I just see it's not the only change I would need |
20:54:51 | def- | there is also no way to specify "#pragma omp parallel for private(j, k)" |
20:58:00 | def- | the loop variables which you use inside an openmp loop are declared outside of it, so they're shared between all threads |
20:58:37 | def- | I think that's a bug, you basically can't loop inside a || loop |
20:58:57 | Araq_ | that's because C89 doesn't know about for loop local variables |
20:59:30 | def- | yes, the C code I translated from was C89 as well, so they used for private(j, k) |
21:01:24 | def- | hm, the loops are surrounded with blocks anyway, could declare the loop variable there as well |
21:07:38 | def- | These are the changes necessary to make it work and then go from 470 gflops to 2000 gflops: https://gist.github.com/def-/64f10c359a6962e06d75/revisions |
21:10:32 | def- | I think Nim is in a pretty special position, as it's one of the very few languages that can be used on the Xeon Phi |
21:15:25 | flaviu | def-: wow, the xeon phi is neat |
21:16:01 | def- | flaviu: yes, pretty fun with 240 hw threads |
21:17:45 | * | MyMind joined #nim |
21:22:19 | def- | I can't figure out how to do this optimization automatically in the compiler |
21:26:07 | Araq_ | as I said, it's not trivial |
21:26:27 | Araq_ | though we can make 'countup' a magic |
21:27:18 | flaviu | oh god |
21:29:21 | Araq_ | hrm thinking about it ... I think I do for loop detection already for the 'parallel' statement |
21:29:43 | Araq_ | could reuse that code ... |
21:29:54 | def- | Araq_: sounds good |
21:30:39 | wan | it might be a benefit for "stupid loop" micro-benchmarks |
21:30:57 | def- | wan: tried on the LPATHBench already, no benefit :P |
21:31:08 | wan | damn :) |
21:31:56 | * | Jaood joined #nim |
21:33:12 | Araq_ | hi Jaood welcome |
21:34:17 | Araq_ | def-: but it's interesting. I always thought Nim's overuse of gotos could cause some problems but before now it never was |
21:36:25 | flaviu | Don't use gotos, gotos are bad ;) |
21:37:49 | Araq_ | tell that Linus |
21:38:23 | flaviu | I hope it was clear I wasn't being serious. |
21:38:49 | * | MyMind quit (Ping timeout: 255 seconds) |
21:40:07 | Araq_ | yeahm was clear |
21:45:22 | def- | wan: some more statistics: https://news.ycombinator.com/item?id=8778041 |
21:52:20 | ekarlso- | why no rust in there ? :d |
21:52:39 | def- | i happened not to have rust installed and compiling the rust compiler takes some time, still not done |
21:52:48 | ekarlso- | def-: rustup ? |
21:53:29 | def- | emerge rust |
21:54:03 | flaviu | -funroll-loops? |
21:54:26 | def- | flaviu: huh? |
21:54:52 | flaviu | def-: A joke. I was making fun of your distro :P |
21:55:18 | def- | I could just install it elsewhere, but now that I started the benchmarks on this machine |
21:55:52 | flaviu | def-: Don't worry about it, do things however you'd like. |
22:04:21 | flaviu | hmm, the Xeon Phi is an expensive piece of equipment. |
22:06:22 | def- | ekarlso-: now with rust |
22:06:27 | * | brson joined #nim |
22:07:10 | EXetoC | funrolls! |
22:12:19 | * | BlaXpirit quit (Quit: Quit Konversation) |
22:12:35 | * | BlaXpirit joined #nim |
22:29:02 | * | enurlyx quit (Quit: Leaving.) |
22:44:35 | Varriount | EXetoC: Are those anything like springrolls? |
22:44:44 | Varriount | ;3 |
22:45:48 | EXetoC | Varriount: sure |
22:45:53 | * | saml_ quit (Ping timeout: 240 seconds) |
22:48:54 | * | gour quit (Quit: Leaving) |
22:54:02 | flaviu | Varriount: Yes, except much more fun! |
22:54:18 | flaviu | That's why they're called funrolls: They're more fun than regular bread rolls. |
23:01:49 | def- | wan: did you try --passC:-march=native btw? |
23:03:49 | EXetoC | for potentially better optimization? |
23:04:05 | def- | yes |
23:04:13 | EXetoC | I misread |
23:05:26 | * | enurlyx joined #nim |
23:10:32 | wan | no, trying it now |
23:12:24 | * | enurlyx quit (Quit: Leaving.) |
23:19:25 | wan | def-: I'm not sure it changes anything for me |
23:19:43 | def- | wan: ok, for me it only makes a change on Haswell, not older architectures |
23:27:21 | * | nande joined #nim |
23:27:34 | * | brson quit (Ping timeout: 256 seconds) |
23:33:24 | * | nickles joined #nim |
23:35:12 | * | nickles quit (Client Quit) |
23:36:03 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:40:41 | * | kmcguire quit (Ping timeout: 264 seconds) |
23:51:06 | * | kniteli joined #nim |
23:53:27 | * | yglukhov quit (Quit: Be back later ...) |