<< 20-12-2014 >>

00:00:09*vendethiel joined #nim
00:02:18*Matthias247_ quit (Read error: Connection reset by peer)
00:02:19VarriountAraq: 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:37AraqVarriount: prepare the release binaries already
00:32:13VarriountAraq: Ok.
00:32:19*kniteli quit (Ping timeout: 245 seconds)
00:32:37VarriountAraq: What about Nimble?
00:33:31Araqwhat about it?
00:33:47VarriountAraq: Is it being included in the installer?
00:33:55Araqyeah
00:35:06*kniteli joined #nim
00:38:28*enurlyx quit (Quit: Leaving.)
00:38:35VarriountAraq: To speed up multimethods, could an input type be enumerated, and then used as an argument to an assembly 'jump' instruction?
00:39:05Araqyeah, but then this won't work across DLL boundaries
00:39:20Araqwhich is what people want.
00:39:38Araqwe must not implement even more code generation at linking time
00:40:12*z1y joined #nim
00:40:17Araqwe should instead perhaps investigate JIT like technology for efficient dispatching even across DLLs
00:40:39Araqz1y: 'koch pdf' now works
00:40:49Araqand produces pdfs in $nim/doc
00:40:55VarriountAraq: What about vtables tied to types, rather than type instances?
00:41:21AraqI don't think it matters where/how you tie them
00:45:30VarriountAraq: 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:55VarriountNow, 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:20AraqI think you talk about dispatch trees vs. lookup tables
00:47:37VarriountUh, yes, that's probably it.
00:47:51Araqboth can be used to implement multi methods as can be any combination of these techniques
00:50:00boydgreenfieldIdlework: Updated with some changes again – thoughts? http://a.pomf.se/yqylay.html
00:53:49Araqboydgreenfield: 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:41j3rkythe 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:29Araqj3rky: that should be 'SomeNumber' now
01:02:36Araqwhich is in system.nim
01:03:30j3rkyyeah, i just found it myself :)
01:03:38*Trustable quit (Quit: Leaving)
01:05:04j3rkyAraq: 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:22flaviuNot quite perfect yet. It'd be nice if each proc name linked to it's anchor.
01:07:37flaviuBut that's not really a big deal.
01:08:45Araqflaviu: it's much better than what we currently have, so I want to pull it, regenerate everything and release 10.2 finally
01:09:10flaviuOf course.
01:12:22Araqj3rky: 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:31j3rkyok, 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:27boydgreenfieldAraq: Great, go ahead!
01:34:46VarriountAraq: Um, I think the current installers are broken.
01:44:00*nande joined #nim
01:44:22dom96Araq: we releasing 0.10.2 then?
01:55:36*Ven joined #nim
02:09:55boydgreenfieldAraq: 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:46boydgreenfieldAraq: 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:35boydgreenfieldAraq: 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:23j3rkycan someone tell me what's wrong with these generic types? i can't figure it out :( http://pastebin.com/c5FkN7kf
03:36:46j3rkythe 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:23dts|pokeballhow strong is the linux community in nim?
04:26:59*vendethiel quit (Ping timeout: 250 seconds)
04:27:08j3rkynot sure what that means, pokeball. are you wondering what is the ratio of nim users on linux vs windows?
04:27:52dts|pokeballno. just if a lot of nim coders write nim on linux
04:28:47j3rkyhmm, 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:11fowlmouthdts|pokeball, its probably 60/20/20 linux/osx/windows
04:34:58dts|pokeballso if i write libdaemon which a nim process can be used to make itself a daemon it would be worthwhile?
04:36:31fowlmouthj3rky, how do you try to instantiate it
04:36:54fowlmouthoh i see
04:37:21fowlmouththats a bug
04:43:36*vendethiel joined #nim
04:44:44*yglukhov__ joined #nim
04:48:09j3rkyfowlmouth: 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:41j3rkyi 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:52j3rkyis 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:03judofyris there a way to capture variable named arguments in a proc?
11:46:09judofyr(or a macro)
11:46:30judofyrul(id="foo", class="bar")
11:46:43judofyror: is there a better syntax to accomplish the same thing?
11:50:29dom96Not as far as I know.
11:50:34*johnsoft quit (Ping timeout: 256 seconds)
11:50:45dom96You'd need to specify the args in your proc/macro definition.
11:51:10judofyrbummer
11:51:35judofyranother question: how do I build a JavaScript object?
11:53:11dom96judofyr: Just as you would a Nim object.
11:54:06dom96What do you want to do?
11:54:38judofyrI want ul(("id", "foo")) to be generated as React.DOM.ul({id: "foo"})
11:54:49judofyrbut I realise this might be difficult
11:55:13judofyr(for instance because of the different string representations)
11:55:36dom96Take a look at https://github.com/Araq/Nimrod/blob/devel/lib/js/dom.nim
11:55:40dom96That's how the DOM is defined.
11:55:56dom96You can define a similar object called React.
11:56:24judofyryeah, it's the object literal that's the trouble now
11:56:30dom96Then define it as: var react: React {.importc: "React".}
11:56:55dom96hrm.
11:58:41dom96You can make your React.DOM.ul proc take a RootObj
11:59:04dom96Then make a ul macro which will construct a dummy type which inherits from RootObj
11:59:14dom96Based on the ("id", "foo")
11:59:16*MyMind joined #nim
11:59:27*kniteli quit (Ping timeout: 245 seconds)
12:01:27dom96You may be able to pass in {"id": "foo"} to your macro btw
12:01:44dom96maybe even {id: "foo"} will work
12:02:04*MyMind quit (Client Quit)
12:03:22judofyrnice
12:03:53judofyrwhat type is that?
12:04:05judofyror: where can I read about {"foo":"bar"} in the manual?
12:08:28dom96http://nim-lang.org/manual.html#table-constructor
12:09:24judofyrah, 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:42wanThe 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:31Araqdom96, judofyr it's perfectly easy to capture named args in a macro ...
12:33:53Araqbut you have to use an .immediate macro and 'callsite'
12:34:23judofyrAraq: yeah, I looked in htmlgen and found the trick
12:34:35judofyrAraq: what about the "how to generate object literal" issue?
12:35:13Araqwan: 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:14def-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:22dom96Top of HN too https://news.ycombinator.com/item?id=8776335
13:17:48*flaviu quit (Remote host closed the connection)
13:17:54def-Hm, can't get LDC compiled to compare to D
13:18:05def-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:23def-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:14def-Is there a way to set the compiler to clang without editing build.conf?
13:29:18def-nim.conf*
13:39:27*enurlyx joined #nim
13:44:02dom96pass --cc:clang or something like that
13:47:38wancan confirm that --cc:clang works
13:47:56wandef-: you should add it to the makefile
13:48:08def-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:33wanthis 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:54wanespecially with the docs getting nicer
14:34:41*saml_ joined #nim
14:35:20wanthere 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:23TrustableHi 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:35wanI get 166K when compiled normally, but 57K when run with -d:release. That might be the difference you're seeing
15:11:36Varriountdef-: Oooh, and that benchmark shows Nim as faster then Java.
15:12:17VarriountDon't most smartphones run on ARM processors? Or am I mistaken?
15:12:28*rpag joined #nim
15:15:02VarriountAraq, dom96: The installers are broken. They can't locate the documentation or mingw compilers with the target URL's
15:17:00AraqTrustable: 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:33AraqVarriount: well that's why I told you to build them ;-) so that we can see the problems
15:18:37Trustablewan and Araq: Thanks, you're right, I did not use d:release. With d:release the size good.
15:19:20def-Varriount: no, you're right
15:21:31*gour joined #nim
15:22:13Varriountdef-: Oh! And looking at the other benchmark statistics, Nim is in 2nd or 3rd fastest!
15:22:57def-Varriount: yes, and compare it to the C++ solution, doesn't look nearly as nice
15:23:15def-I tried using bitsets as well in Nim, but for me it's a slowdown
15:25:15VarriountHm, I wonder what the memory usage for each language is like. (S)he didn't post those.
15:27:21def-Varriount: That's interesting indeed! C++: 10.8 MB, D: 9.6 MB, Nim: 5.9 MB
15:27:38VarriountO_o
15:28:01VarriountI would have expected Nim to use *more* memory.
15:28:06flaviuPerhaps nim doesn't do as well as C++ because it doesn't use enough slack memory.
15:28:10Varriount(than C++)
15:28:29def-(I just used /usr/bin/time and looked at maxresident)
15:29:27def-for me Nim is just as fast as C++
15:32:05VarriountHm. I still wonder why C++ used more memory.
15:33:18*vendethiel joined #nim
15:33:23VarriountHi vendethiel
15:36:02def-Varriount: because of the bitset I guess
15:36:14def-or some vector allocated too much memory
15:37:17Varriountdef-: Yes, but 5MB is quite a large amount of excess memory.
15:39:55def-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:04def-but comparisons should be fine
15:40:46flaviuYep, on my cpu, nim is 1.038x faster than C++
15:41:14flaviuover 10 trials each, so it isn't just noise.
15:41:45def-flaviu: what cpu do you have? I'm on a Core2Quad
15:41:58flaviuPhenom II x4
15:42:46Araqso ... still no PR to fix the website's contrast?
15:43:02flaviuoddly, using O3 for c++ actually makes it slower.
15:43:32flaviusignificantly. Like 50%
15:43:54def-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:01VarriountAraq: As soon as the installer links are fixed, I can continue to test the build.
15:57:23AraqVarriount: well can't you fix the links on your own?
15:57:26*johnsoft quit (Read error: Connection reset by peer)
15:58:56VarriountAraq: 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:27vendethielhi Varriount
16:08:07AraqVarriount: http://nim-lang.org/download/mingw32.zip for instance works for me
16:08:30Araqwhat links are you talking about?
16:08:39VarriountAraq: Documentation
16:08:45*Matthias247 joined #nim
16:09:43Araqhttp://nim-lang.org/download/docs-0.9.6.zip works too
16:09:55Araqand docs-0.10.2 doesn't exist yet ;-)
16:10:00Araqbut 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:58j3rky_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:40flaviuj3rky_: 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:41j3rky_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:41j3rky_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:47j3rky_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:37flaviuIt'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:04j3rky_would that type declaration output be a generic type?
16:45:17j3rky_or would i resolve it for the actual parameters?
16:45:49*Triplefox quit (Ping timeout: 250 seconds)
16:46:00j3rky_i guess the latter. it would also have to output the various matching procs and operators, i suppose.
16:46:28flaviuwhichever you'd like. Yes, you would have to output the relevent procs.
16:47:02j3rky_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:20j3rky_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:42j3rky_or do i need to look at the grammar? :)
16:47:44flaviuj3rky_: import macros;dumpTree: ...
16:48:31flaviuYou'll have to indent your whole module, but most text editors can do that.
16:48:45j3rky_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:12def-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:15Varriount_def-: Aren't global variables slower than procedure variables? Usually you should put everything you can in a main() procedure
17:17:49def-Varriount_: I usually write it in this style and it's usually faster (in this case too)
17:18:21def-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:28Varriount_def-: You got the last line wrong. It's supposed to be (duration * 1000) - timeItTakesForCPlusPlus
17:25:32Varriount_: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:03wandef-: I think I got a better version
17:43:25wanI just tried changing seq in openarray and I got better results on my laptop
17:43:48wanhttps://github.com/logicchains/LPATHBench/pull/19/files
17:43:51def-wan: interesting, saw your pull request
17:44:11def-wan: I have a new version as well though: https://github.com/logicchains/LPATHBench/pull/15
17:45:09def-mine is a bit faster for me
17:45:29def-I'm not passing the seq at all
17:45:32reactormonkdef-, you forgot one "nimrod"
17:45:40def-reactormonk: oh
17:45:55ekarlso-Araq_: long from 1.0 ? :p
17:46:01def-No, I fixed that, he must have changed it back^^
17:46:17wandef-: I got 1345 for yours, and 1250 for mine on a i5 m520
17:46:43def-wan: hm ok
17:46:56reactormonkdef-, time for another PR.
17:47:45def-wan: you compile with "nim -d:release --cc:clang c nim"?
17:48:17wanyep (for reference, the current version is at 1370)
17:48:42wanI'll try it again just to check if I made an error
17:48:58wan(I'm on a very recent devel, by the way)
17:49:05wanmaybe that counts?
17:49:09def-for me: current version: 1497, yours: 1435, mine: 1400
17:49:15def-I'm on the most recent devel as well
17:49:42wanwhat Core2Quad do you have? Which frequency?
17:49:58def-Q9300 @ 2500 MHz
17:50:17wanmine is i5 M520 @ 2.40GHz
17:50:31wandamn, my laptop cpu is better than your desktop cpu
17:50:38Matthias247the benchmark is not that fair for all the JITted languages. Doesn't take the time that's needed for compiling into account
17:50:43wanand they are probably about the same age
17:51:00wanfaster* on this benchmark, not better
17:51:12def-wan: nah, mine is from 2008, yours 2010
17:51:33wanah, right.
17:51:58wanwe should choose the solution that will work the best on logicchains' hardware
17:52:06def-haha
17:53:12onionhammer1http://www.reddit.com/r/programming/comments/2pvf68/_/
17:53:21def-oh, hi onionhammer1
17:53:32def-You were the first to write the nimrod solution
17:53:39*boydgreenfield quit (Quit: boydgreenfield)
17:53:47onionhammer1ah yehp
17:53:51onionhammer1I see you improved upon it
17:53:53def-wan and I have tried to get it faster a bit
17:54:02def-but the benchmark author is asleep now, so no more merges
17:54:18onionhammer1;)
17:54:24def-at least on my machine it's faster than C++ & D
17:54:32onionhammer1i didnt try to get it faster, I tried to get it to match the others as closely as possible
17:54:55onionhammer1I 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:59def-yeah, i noticed, but then they switched to bitsets in the C++ solution
17:55:03onionhammer1ahh
17:55:06wanhe has an i5-430M
17:55:22*boydgreenfield joined #nim
17:55:22def-wan: sounds more like yours than mine
17:55:23wanit came out in Q1'10, same as my 520M
17:55:35wanI'm afraid so
17:56:53onionhammer1usually wrapping your logic in a 'main' function is good practice though
17:57:13onionhammer1because not doing so can lead to memory leaks
17:57:19onionhammer1iirc
17:57:22*onionhammer1 is now known as onionhammer
17:57:23wandoes 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:54flaviuI just got a diabolical idea: Does the benchmark require that there be no memory leaks?
18:00:09def-flaviu: haha, why?
18:00:36flaviuIf gc was turned off, the benchmark is short enough that the memory leaks shouldn't be too bad.
18:00:56def-yeah, gc isn't really needed here I think
18:01:30def-same speed without GC
18:02:33def-wan: on a Celeron J1900: D: 1612, C++: 1532, Mine: 1527, Yours: 1588
18:02:40def-Don't have anything ARM
18:02:45flaviuhuh, looks like clang is 2x faster than gcc.
18:03:06def-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:38wandef-: crap, our solutions are architecture dependent. We can't determine a clear winner :(
18:04:14flaviugc none is actually a bit slower for me
18:05:08def-afk
18:05:16wanseriously, you beat C++? On mine, C++ does 1088 (quite far ahead 1250)
18:07:58flaviuYeah, we're not beating c++
18:08:09flaviucpp was compiled with gcc, so it was slow
18:08:44flaviucpp 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:34wanOn 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:05wanSo we do indeed beat cpp on some architectures
18:24:54*boydgreenfield quit (Quit: boydgreenfield)
18:33:36VarriountWell, 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:21nimnoobis there a way to call a base class constructor?
18:37:45nimnoobi have a base class that has a Table and i need to init that table
18:39:45willwillsonnimnoob: not sure what you mean.. are you using generics? can you gist it?
18:39:45wanI 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:16wanwhen the heap*
18:44:08nimnoobhttp://pastebin.com/vfrb66ek
18:44:16nimnoobthat class is a base class for my controls
18:44:38nimnoobit has a table within it that i need to call initTable for
18:45:03nimnoobdoes each derived class have to call initTable?
18:46:52Varriountnimnoob: If they don't call the original constructor, yes.
18:47:22nimnoobhow would they call the original constructor? sorry i am not familiar with the syntax
18:47:54nimnoobin C#, you would call super(...)
18:47:58Varriountnimnoob: Use a conversion, then call the original constructor.
18:48:45wanisn't proccall in? Read the following, it has details http://goran.krampe.se/2014/11/30/nim-and-oo-part-iv/
18:49:13Varriountnimnoob: ParentType(ChildTypeInstance).init() or init(ParentType(ChildTypeInstance))
18:51:06*Matthias247 quit (Read error: Connection reset by peer)
18:51:27nimnoobah ok, thank you Varriount
18:51:47nimnoobthat was something i wouldn't have figured out by myself :)
18:52:31nimnoobit makes sense
18:53:08nimnooba lot of things about nim make sense when i convert them mentally to just dealing with pointers in C/C++
18:53:43Varriountnimnoob: Nim is not as object oriented as C++ - It's much closer to C
18:54:58nimnoobunderstood
18:56:38Varriountwan: That article makes me wonder if we need a 'methodCall' as well.
19:00:59VarriountAraq_: What is the 'release' revision for 10.2?
19:07:32*jefus_ joined #nim
19:08:23*repax joined #nim
19:09:11Araq_Varriount: hrm?
19:11:26*jefus quit (Ping timeout: 256 seconds)
19:17:26*yglukhov joined #nim
19:21:25nimnoobsince you can't call a base class _method_ by casting to the base class type
19:21:41nimnoobi guess one workaround is to implement each base class method as a proc
19:21:51nimnooband have the method call the proc
19:22:13nimnoobanyone 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:34def-hm, how could I get a 64 byte aligned array?
19:39:18Araq_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:58nimnoobok i will try it
19:40:08nimnoobty
19:40:57*yglukhov joined #nim
19:41:32def-Something like "float fa[FLOPS_ARRAY_SIZE] __attribute__((align(64)));"
19:42:03Araq_def-: use .codegenDecl for it?
19:42:17Araq_or just rely on the C compiler to do it anyway
19:42:52def-Araq_: awesome, haven't seen this yet
19:43:13Araq_well I don't remember if it works for vars
19:43:28Araq_it's been designed for procs
19:43:35def-there's a var example in the compiler guide
19:43:42Araq_very well then
19:43:50def-I'm running Nim on the Xeon Phi btw
19:44:36def-Surpringly it works with the intel compiler
19:45:00Araq_Intel C++ is/was a supported compiler
19:45:26*yglukhov quit (Ping timeout: 256 seconds)
19:45:32def-Well, I've recently had a lot of problems with the intel compiler
19:45:45def-and there is no free license for it anymore
19:50:54*yglukhov joined #nim
19:51:12nimnoobdo recursive methods require a special pragma?
19:51:38nimnoobthe compiler is crashing with "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" when i add one
19:58:17Araq_hrm still?
19:58:25Araq_I thought we fixed that months ago
20:03:07nimnoobusing 0.9.6 on linux
20:03:23nimnoobi 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:22Araq_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:04def-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:30Araq_er ... what?!
20:47:49Araq_the intel compiler has *problems* with gotos?
20:48:33Araq_shouldn't it have the best optimizer?
20:49:01def-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:24Araq_well patching the codegen to emit 'for' instead is not easy
20:51:38def-but it works for || loops?
20:52:02Araq_yeah but this is special cased
20:52:17def-ok, I just see it's not the only change I would need
20:54:51def-there is also no way to specify "#pragma omp parallel for private(j, k)"
20:58:00def-the loop variables which you use inside an openmp loop are declared outside of it, so they're shared between all threads
20:58:37def-I think that's a bug, you basically can't loop inside a || loop
20:58:57Araq_that's because C89 doesn't know about for loop local variables
20:59:30def-yes, the C code I translated from was C89 as well, so they used for private(j, k)
21:01:24def-hm, the loops are surrounded with blocks anyway, could declare the loop variable there as well
21:07:38def-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:32def-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:25flaviudef-: wow, the xeon phi is neat
21:16:01def-flaviu: yes, pretty fun with 240 hw threads
21:17:45*MyMind joined #nim
21:22:19def-I can't figure out how to do this optimization automatically in the compiler
21:26:07Araq_as I said, it's not trivial
21:26:27Araq_though we can make 'countup' a magic
21:27:18flaviuoh god
21:29:21Araq_hrm thinking about it ... I think I do for loop detection already for the 'parallel' statement
21:29:43Araq_could reuse that code ...
21:29:54def-Araq_: sounds good
21:30:39wanit might be a benefit for "stupid loop" micro-benchmarks
21:30:57def-wan: tried on the LPATHBench already, no benefit :P
21:31:08wandamn :)
21:31:56*Jaood joined #nim
21:33:12Araq_hi Jaood welcome
21:34:17Araq_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:25flaviuDon't use gotos, gotos are bad ;)
21:37:49Araq_tell that Linus
21:38:23flaviuI hope it was clear I wasn't being serious.
21:38:49*MyMind quit (Ping timeout: 255 seconds)
21:40:07Araq_yeahm was clear
21:45:22def-wan: some more statistics: https://news.ycombinator.com/item?id=8778041
21:52:20ekarlso-why no rust in there ? :d
21:52:39def-i happened not to have rust installed and compiling the rust compiler takes some time, still not done
21:52:48ekarlso-def-: rustup ?
21:53:29def-emerge rust
21:54:03flaviu-funroll-loops?
21:54:26def-flaviu: huh?
21:54:52flaviudef-: A joke. I was making fun of your distro :P
21:55:18def-I could just install it elsewhere, but now that I started the benchmarks on this machine
21:55:52flaviudef-: Don't worry about it, do things however you'd like.
22:04:21flaviuhmm, the Xeon Phi is an expensive piece of equipment.
22:06:22def-ekarlso-: now with rust
22:06:27*brson joined #nim
22:07:10EXetoCfunrolls!
22:12:19*BlaXpirit quit (Quit: Quit Konversation)
22:12:35*BlaXpirit joined #nim
22:29:02*enurlyx quit (Quit: Leaving.)
22:44:35VarriountEXetoC: Are those anything like springrolls?
22:44:44Varriount;3
22:45:48EXetoCVarriount: sure
22:45:53*saml_ quit (Ping timeout: 240 seconds)
22:48:54*gour quit (Quit: Leaving)
22:54:02flaviuVarriount: Yes, except much more fun!
22:54:18flaviuThat's why they're called funrolls: They're more fun than regular bread rolls.
23:01:49def-wan: did you try --passC:-march=native btw?
23:03:49EXetoCfor potentially better optimization?
23:04:05def-yes
23:04:13EXetoCI misread
23:05:26*enurlyx joined #nim
23:10:32wanno, trying it now
23:12:24*enurlyx quit (Quit: Leaving.)
23:19:25wandef-: I'm not sure it changes anything for me
23:19:43def-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 ...)