<< 13-05-2014 >>

00:30:23boydgreenfieldCan anyone point me to a good optimization/profiling checklist for Nimrod? And/or would be willing to take a look at this bitarray implementation before I push it and add it to Babel? I feel like I may be missing some low-hanging fruit, but am struggling to figure out how to further optimize something as low-level as a series of array accesses.
00:33:11flaviu1Nimrod's profiler gets in the way of optimizations quite a bit, so I'd recommend -d:release --stackTrace:off
00:34:51flaviu1and run through `valgrind --tool=callgrind ./yourprogram`. That way you get to see the real hotspots the integrated profiler cannot detect.
00:35:06boydgreenfieldAh.
00:35:28boydgreenfieldI hadn’t even thought to use valgrind on a Nimrod program. That’s great.
00:35:38boydgreenfieldHow much overhead does stackTrace add? I haven’t been turning that off to date...
00:36:38flaviu1boydgreenfield: Quite a bit: http://i.imgur.com/oN1ymIF.png
00:37:56flaviu1Even more than it shows in that image, it probably thrashes the cache like crazy, and while I don't know much about compilers, it probably breaks up the pipeline quite often too.
00:41:43boydgreenfieldOk wow. Great, good to know.
00:42:11boydgreenfieldWhat are you viewing that callgrind output in?
00:42:24flaviu1KCacheGrind
00:45:15*DAddYE quit (Remote host closed the connection)
00:45:48*DAddYE joined #nimrod
00:46:50flaviu1boydgreenfield: You can turn off stack traces on certain parts. `{.push stackTrace:off.} ... {.pop.}`
00:47:49boydgreenfieldflaviu1: Great. Thanks for the help.
00:50:29*DAddYE quit (Ping timeout: 255 seconds)
00:54:19*brson quit (Ping timeout: 240 seconds)
00:57:20boydgreenfieldflaviu1: Well with —stackTrace:off, time went from 8.6 secs —> 7.9 secs. So ~10% isn’t bad for something trivial. Out of curiosity, what flag does Nimrod use in picking its C compiler? (I’m on a Mac and want to try w/ GCC vs. Clang)
00:57:57boydgreenfieldflaviu!: oh, only 8.3 seconds. Read the wrong line. 5%...
00:58:03flaviu1boydgreenfield: Check the file that follows "Hint: used config file"
00:59:52flaviu1What happens if you push lineTrace off?
00:59:52flaviu1Surprising though, I wonder why valgrind reports it as 21% of the time
01:00:35boydgreenfieldWell, this is basically all constrained by memory accesses. Which is why it’s so hard to optimize.
01:00:39boydgreenfieldI’ll try w/o lineTrace in a sec
01:01:09boydgreenfield(data structure implementation somewhat akin to a Bloom filter)
01:03:20*bjz joined #nimrod
01:03:47boydgreenfield15% slower w/ lineTrace:off?
01:04:10boydgreenfield(I’ll rerun, could’ve just been a quirk)
01:05:33boydgreenfieldYa just a quirk. Basically identical runtimes.
01:06:36flaviu1I have no idea what's going on here. Can you gist the code so I can do my own tests?
01:06:52boydgreenfieldSure.
01:07:11boydgreenfieldone sec.
01:10:00boydgreenfieldPlanning to put all this on Github shortly
01:10:02boydgreenfieldHere’s the gist
01:10:03boydgreenfieldhttps://gist.github.com/boydgreenfield/45c8b7b29c4ed53fa45e
01:10:27boydgreenfieldtrying to profile and speed up something like bloom_filter_w_varying_bit_demo.nim
01:11:02boydgreenfieldNote that this is relying on MurmurHash wrapper I just pushed at https://github.com/boydgreenfield/nimrod-murmur but is not yet merged into in babel’s packages.json
01:11:06boydgreenfield(sorry)
01:11:26boydgreenfield(Hashing w/ the built-in library is like 30X slower and makes the hash operations take ~95% of the total time, making profiling hard)
01:11:28flaviu1No problem
01:11:46*nande joined #nimrod
01:12:07boydgreenfieldAlso you don’t need to use that memfiles.nim patch — it’s only needed if you wanted the tests in bitarray.nim to pass (file permissions issue w/ mmap-backed files)
01:19:47flaviu1boydgreenfield: Embarrassingly, I can't figure out how to compile murmur3.h. What line do you use?
01:21:28*hoverbear joined #nimrod
01:25:48flaviu1nevermind, just had to do -shared
01:25:54boydgreenfieldah sorry
01:26:42boydgreenfieldIt didn’t compile automatically?
01:26:45boydgreenfieldI just normally do
01:26:56boydgreenfield`babel install` in the directory and then it gets compiled upon import
01:27:15flaviu1I dunno, I don't really use babel much
01:28:10flaviu1Just curious, what CPU do you have?
01:44:47boydgreenfieldmm
01:44:49boydgreenfieldi’m on an i7
01:44:53boydgreenfield(macbook pro retina)
01:44:58boydgreenfieldat the moment
02:03:42boydgreenfield(the prior times i gave were for slightly different tests fyi)
02:04:08*springbok joined #nimrod
02:06:39flaviu1debug: 42, 40; O3: 16.6, 16.2; no line numbers: 16.4, 16.1; no stacktrace: 11.8, 11.6; all checks off: 10.9, 10.7
02:09:38flaviu1boydgreenfield: So clang manages to optimize out the line numbers, which is good. Stack traces are ~28% of execution time, so you really want those off in important parts. Checks take ~13% off, the overhead isn't really that bad
02:13:38boydgreenfieldflaviu1: very interesting and good to know. Now wrt the actual `[]` methods on the bitarray – that’s probably as optimal as it gets, huh?
02:19:04flaviu1boydgreenfield: It isn't optimal in debug mode, but the compiler can optimize the divisions and mod without much hassle
02:21:53boydgreenfieldflaviu1: I assumed as much, though since they’re guaranteed to be a power of 2, I guess they could be converted to shifts easily enough (just less readable)
02:22:18flaviu1Yeah, don't bother optimizing that, it'll just make the code worse
02:23:00flaviu1boydgreenfield: Maybe put the conditionals in `when not defined(release):`?
02:24:34*hoverbear quit ()
02:24:42boydgreenfieldyou mean the range checks?
02:25:38flaviu1Yes
02:31:53*flaviu1 quit (Remote host closed the connection)
02:36:22*DAddYE joined #nimrod
03:00:38boydgreenfieldInteresting: that took me from 7 -> 6.5, not too bad
03:01:34boydgreenfieldflaviu1: Is there a symbol I can use to have that only turned off when, e.g., range checks are turned off in the compiler flags? (so that I can have it be safe as a module)
03:01:59Varriountboydgreenfield: If you're doing benchmarks, also try changing the GC settings. If it's a short lived program, then you can compare timings with the gc off versus the gc set to markandsweep, boehm, etc.
03:03:05boydgreenfieldflaviu1: found it. http://nimrod-lang.org/nimrodc.html#additional-compilation-switches_toc
03:03:36boydgreenfield(actually nevermind)
03:03:43boydgreenfieldVarriount: Thanks. I’ll try that too.
03:06:12Varriountboydgreenfield: Just be ready to kill the program when running without a GC. I once tried that technique on a benchmark that did a lot of string copying, and it ate about 2 gb in 5 seconds
03:07:10boydgreenfieldVarriount: good to know. I’m just allocating and then quitting, so shouldn’t be a problem. Do you know if there a similar symbol I can use to write a `when not defined(checks)` block to handle some manual range-checking (vs. `release`)?
03:08:40boydgreenfield(fyi this is what i’m optimizing: https://gist.github.com/boydgreenfield/45c8b7b29c4ed53fa45e)
03:09:11Varriountboydgreenfield: You want to conditionally compile part of a program, based on whether or not range checking is enabled?
03:09:55*hoverbear joined #nimrod
03:10:32Varriountboydgreenfield: I don't think there is a symbol for that. You might be able to gimmick something with compiles() though.
03:12:14Varriountboydgreenfield: There might also be some sort of config file thingie you can use.
03:12:25VarriountI'll keep looking
03:13:26boydgreenfieldVarriout: Yes, but don’t worry about it. defined(release) is probably sufficient.
03:17:03VarriountAlthough, fixing that problem sounds like something easy enough for me to do.
03:17:24VarriountHi again hoverbear.
03:33:59hoverbearVarriount: Hey.
03:34:26*Varriount just finished unit tests for file change monitoring api
03:49:10*Skrylar quit (Ping timeout: 258 seconds)
03:55:36*xenagi quit (Quit: Leaving)
04:07:57*Demos quit (Remote host closed the connection)
04:45:50*BitPuffi1 quit (Ping timeout: 255 seconds)
04:50:39*DAddYE quit ()
05:30:24*BitPuffi1 joined #nimrod
05:31:26*BitPuffi1 is now known as BitPuffin
05:34:18*hoverbear quit ()
05:40:42*Varriount puffs up BitPuffin
05:41:21BitPuffinget puffin
06:04:29*reactormonk quit (Ping timeout: 252 seconds)
06:15:47VarriountStatus update: Nimrod's first enhancement proposal, or NEP, is up to 97 lines. (It's a style guide for the standard library)
06:16:39boydgreenfieldIs there a way to have nimrod doc generate .rst files to then pass to, for example, readthedocs.org or similar?
06:17:12boydgreenfield(Just trying to figure out an easy way to quickly get nicely styled / pretty documentation)
06:17:33Varriountboydgreenfield: What do you mean, like, ftp them? (I have no idea how readthedocs.org does stuff)
06:18:16boydgreenfieldVarriount: readthedocs pipeline is something like (Python or other source) -> .rst files -> HTML w/ Sphinx
06:18:43Varriountboydgreenfield: I think there's a switch to generate html. Lemme check
06:18:46boydgreenfieldMy sense is it’s probably easy to just use Sphinx for that 2nd step, which has some nice HTML templating options
06:18:54boydgreenfieldVarriount: I saw a switch to generate HTML from .rst
06:19:01boydgreenfieldbut not just extract the .rst
06:19:08boydgreenfield(though clearly that’s being done as the intermediate step)
06:19:13VarriountHuh?
06:19:19VarriountI don't follow.
06:19:52boydgreenfieldnimrod doc takes doc comments (rst) and just transforms them into html
06:20:11boydgreenfieldi’m wondering if there’s a way to get it to just spit out the .rst / related index
06:20:18boydgreenfieldmaybe this is all backwards and I should just style the html
06:21:34Varriountboydgreenfield: Looking at nimdoc.cfg, you might be able to get away with just removing the html code from the templates.
06:21:46boydgreenfieldWill try that. Thx.
06:22:16VarriountI don't know if that will work. I could swear there was an rst thingie
06:22:38VarriountI mean, it knows how to generate Tex formatting
06:28:55Varriountboydgreenfield: Are you sure that the doc generator doesn't already output rst files?
06:30:13boydgreenfieldVarriount: I mean, not into my working directory at least. I assume it *does* generate the rst — it just may be ephemeral.
06:30:48boydgreenfieldI’ll dig into it tomorrow. I’d just like a way to mix the automatically documented API-ish docs w/ something a bit richer.
06:31:08boydgreenfield(Or more precisely, more descriptive / not fully appropriate to be in docstrings)
06:35:18Varriountboydgreenfield: Maybe, if it doesn't exist, you could add the option to output RST to the docgen (and possibly fix doc2)
07:54:50milosnmorning
07:55:18*milosn scrolls up
07:55:57milosnumm, sorry to repeat myself, where can i find fork() proc? i dont think anyone asnwered yesterday
07:56:00milosn:)
07:56:20*milosn would expect to find it in system
07:56:24milosnor os
08:04:23*zahary quit (Quit: Leaving.)
08:05:44*nande quit (Read error: Connection reset by peer)
08:15:39*io2 joined #nimrod
09:42:34*Skrylar joined #nimrod
09:42:42Skrylarwell that teaches me not to do extensive research
09:43:08Skrylarmirc complained so i went "eh why not, it doesn't mention that it activates so whats the harm"
09:43:33Skrylar... So apparently it does, they just make sure to not mention it anywhere important like the buy page or the top half of the EULA or the registration window
09:57:14*kunev joined #nimrod
10:47:35Araqmilosn: I think you can find fork in the posix module, but don't use it, it's crap
10:51:57Araqfor instance, fork() is not compatible with Cocoa (Mac OS X)
10:56:50milosnAraq: for what i need it, it needs to work on linux
10:57:02*milosn not bothered about OSX
10:57:17milosnthanks in any case, ill look at posix
10:58:31Araquse osproc instead
10:58:46Araqit's usually more efficient than fork too
11:09:28milosnill have a look
12:28:03Skrylarto be fair, what GUI is compatible with fork?
12:28:26Skrylaryou're basically getting a shadow copy of the program state when you fork, which puts you in a weird position
12:28:59Skrylarcoupled with most GUIs being single-threaded scene graphs..
12:31:36*darkf quit (Quit: Leaving)
12:39:08EXetoCno/partial sensitivity saves a lot of time when creating bindings
12:46:32EXetoCit's mostly just foo_bar_t that's difficult to deal with, but a regex can at least turn that into Tfoo_bar
12:51:53EXetoC"Multi-line procedure declarations/argument lists should continue on the same column as the preceding brace" do you guys prefer that to, say, 2-3 indents to distinguish it from the body?
13:47:22*askatasuna joined #nimrod
14:11:45EXetoCno one has time for bikeshedding?
14:17:47*hoverbear joined #nimrod
14:24:41*hoverbear quit ()
14:36:43*BitPuffin quit (Ping timeout: 240 seconds)
14:48:55*hoverbear joined #nimrod
14:54:52*hoverbear quit ()
15:11:25*bjz_ joined #nimrod
15:12:17*bjz quit (Ping timeout: 250 seconds)
15:16:50*nande joined #nimrod
15:17:10*bjz_ quit (Ping timeout: 276 seconds)
15:45:24EXetoCunittest.check # comment -> ident !"check"
15:47:21EXetoCwill this remain true? the macro does this "let checked = callsite()[1]". I don't know if zahary expected it to work at all times, or if he just didn't consider comments
15:49:25EXetoC"block: # todo" will be disallowed at some point, right? in which case this issue should disappear
15:55:40*BitPuffin joined #nimrod
15:55:59*Varriount|Mobile joined #nimrod
16:01:23Varriount|MobileEXetoC: It would be more appropriate to say that, at some point, the comment will not be included in the AST
16:03:47EXetoCyou're right
16:04:05*untitaker quit (Ping timeout: 252 seconds)
16:05:29fowlEXetoC, if you are doing check something: # just use check(somethign)
16:07:35*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
16:08:07*io2 joined #nimrod
16:09:31*untitaker joined #nimrod
16:11:47EXetoCit's just a minor bug in that macro because of the current comment rules
16:14:27*kunev quit (Quit: leaving)
16:14:50*hoverbear joined #nimrod
16:34:07dom96hallo
16:34:35EXetoChi
16:51:17*boydgreenfield quit (Quit: boydgreenfield)
16:56:09*BitPuffin quit (Ping timeout: 258 seconds)
16:58:32*hoverbea_ joined #nimrod
17:00:42milosnif starting new networking project that needs ssl, which module is best at the moment?
17:01:39*hoverbear quit (Ping timeout: 252 seconds)
17:03:20milosnnet?
17:04:10milosnsockets?
17:04:19milosnany input is welcome :)
17:05:49*DAddYE joined #nimrod
17:05:52fowlhttp client or server? both are available in the std lib
17:06:40milosnit not http, its EPP server ... length prefixed XML-ish protocol we use for provisioning domain names
17:07:10dom96oh yeah, everyone should be using net now.
17:07:13milosnits basicaly XML frames prefixed with 4 bytes of following XML frame length
17:07:16dom96Sockets will be deprecated eventually.
17:07:27dom96I think net supports ssl just like sockets.
17:08:22milosnwhats SSL support like? is there a level of abstraction on a top of OpenSSL bindings or i need to know ins/outs of OpenSSL?
17:08:35dom96Yeah, there is an abstraction.
17:08:39milosncool
17:08:41dom96You use newContext and wrapSocket
17:09:05*boydgreenfield joined #nimrod
17:09:36*boydgreenfield quit (Read error: Connection reset by peer)
17:10:24*boydgreenfield joined #nimrod
17:10:49milosndom96: ill have a look at 'net'
17:11:31milosnive seen async libs exist as well, just i am worried i dont have the full understanding of how to combine async/threads/db_access in nimrod
17:12:01milosnso looking at bog standard ssl socket with fork() solution :P
17:12:28*milosn wants to build prototype and see how it performs
17:13:32EXetoCwill "if x y:" work (command syntax)?
17:14:05*boydgreenfield quit (Read error: Connection reset by peer)
17:14:21fowlprolly
17:15:00*q66 joined #nimrod
17:15:00*q66 quit (Changing host)
17:15:00*q66 joined #nimrod
17:15:06*boydgreenfield joined #nimrod
17:16:19*boydgreenfield quit (Read error: Connection reset by peer)
17:17:02*boydgreenfield joined #nimrod
17:18:03EXetoCyeah. fewer corner cases to remember
17:19:53*boydgreenfield quit (Read error: Connection reset by peer)
17:20:38*boydgreenfield joined #nimrod
17:20:49*boydgreenfield quit (Read error: Connection reset by peer)
17:20:49EXetoCfewer edits too
17:20:51milosndom96: ive seen you jester project
17:20:59milosnyou run any live apps on this? :)
17:21:07milosnyour even :D
17:21:44*boydgreenfield joined #nimrod
17:21:55*boydgreenfield quit (Read error: Connection reset by peer)
17:22:37dom96milosn: the forum runs on jester
17:22:43dom96milosn: nimbuild too
17:22:43*boydgreenfield joined #nimrod
17:23:08milosnhmm cool
17:23:49*Matthias247 joined #nimrod
17:23:58*boydgreenfield quit (Read error: Connection reset by peer)
17:24:04*hoverbea_ quit ()
17:24:42*boydgreenfield joined #nimrod
17:25:10milosnwe are php shop at work, but mainly because boss is/was a php guy, so we shit loads of legacy apps ... more and more he does paper work and management these days ... ive been looking for something replace all our php rubbish, and escape the LAMP stack
17:25:14milosn:)
17:25:46dom96cool. Would be awesome if you used Jester at work.
17:26:23milosnits unlikely to happen any time soon ... i started building an ORM, because first target in replacing PHP is out data access library
17:26:30milosn*our
17:26:42*boydgreenfield quit (Read error: Connection reset by peer)
17:27:00milosnif i can prove that we could have more performant and type checked, to a degree, data access layer
17:27:19milosn... it might happen
17:27:20milosn:)
17:27:32*boydgreenfield joined #nimrod
17:27:44*boydgreenfield quit (Read error: Connection reset by peer)
17:28:50*boydgreenfield joined #nimrod
17:29:06*boydgreenfield quit (Read error: Connection reset by peer)
17:29:41*kunev joined #nimrod
17:29:56*boydgreenfield joined #nimrod
17:30:06*boydgreenfield quit (Read error: Connection reset by peer)
17:30:09milosnplus apart from running small compiled "scripts" ... i have no experience of quality of nimrod really ... GC etc.
17:30:18milosn:)
17:30:50*boydgreenfield joined #nimrod
17:31:32*boydgreenfield quit (Read error: Connection reset by peer)
17:32:32*boydgreenfield joined #nimrod
17:32:58*boydgreenfield quit (Read error: Connection reset by peer)
17:33:23*BitPuffin joined #nimrod
17:33:50*boydgreenfield joined #nimrod
17:34:56*springbok quit (Read error: Connection reset by peer)
17:35:08*boydgreenfield quit (Read error: Connection reset by peer)
17:37:08*boydgreenfield joined #nimrod
17:41:18*boydgreenfield quit (Read error: Connection reset by peer)
17:42:17*boydgreenfield joined #nimrod
17:42:46*boydgreenfield quit (Read error: Connection reset by peer)
17:44:31*boydgreenfield joined #nimrod
17:44:46*boydgreenfield quit (Read error: Connection reset by peer)
17:46:03*boydgreenfield joined #nimrod
17:46:18*boydgreenfield quit (Read error: Connection reset by peer)
18:02:10*brson joined #nimrod
18:05:29EXetoCcan json.`%` be used like this %{} for constructing an empty node?
18:06:59EXetoCI guess not. I'm just trying to figure out a nice way to construct an empty bson document
18:08:08EXetoCbut "newBson()" isn't so bad. especially not in conjunction with default args
18:09:04*wan joined #nimrod
18:09:56fowlEXetoC, try %{:}
18:11:17EXetoCgah. I'm pretty sure I tried that at one point
18:11:45EXetoCthanks
18:11:58EXetoC%{:}-<
18:12:15njoejoedom96: I am trying to figure out how to debug your downforeveryone: https://gist.github.com/dom96/49427cd0a9c8da47fff3 it causes the CPU to spin once it is accessed. Any idea how to approach it? Do you see the same thing? I'm on linux.
18:13:06dom96njoejoe: You mean it causes 100% CPU usage?
18:15:12njoejoeyes (on one core)
18:15:13EXetoCoh yeah I mentioned that, but of course I didn't officially report it
18:16:15dom96hrm
18:16:53dom96The only way that can happen is if epoll returns immediately all the time.
18:17:16dom96Most likely situation that can happen is if the socket wants write events
18:18:00dom96So perhaps there is a bug somewhere which asks for write notifications when it doesn't need them
18:19:31dom96if you can't figure out how to debug it then please report it
18:20:34dom96But if you want to try then take a look at the selectors module
18:21:18dom96you can uncomment that echo on line 112
18:23:27Araqhey, anything important?
18:35:36EXetoCthe C++ issues? :p
18:35:59*hoverbear joined #nimrod
18:36:09EXetoCmaybe you can provide me with some hints. I'm very impatient when it comes to these things
18:36:12EXetoChoverbear, hola
18:36:39*hoverbea_ joined #nimrod
18:38:43EXetoCI'll create a PR with the initial changes, and then re-post the output of the remaining errors
18:40:14*hoverbear quit (Ping timeout: 240 seconds)
18:41:29dom96yay hoverbea_ is still here.
18:42:00AraqEXetoC: ok do that
18:42:57EXetoCwill do in an hour
18:46:41*PortableEXetoC2 joined #nimrod
18:46:56*Demos joined #nimrod
18:47:43*hoverbea_ quit ()
18:51:23njoejoedom96: ok, hopefully i can do it today. btw, i don't get the spinning when using wget, only when i use the browser for localhost:8080/http://www.google.com/ and now i see the browser is asking for favicon.ico. so Replying with: EOS: It's down :( for favicon.ico causes the spin. wget http://localhost:8080/noexist also causes the spin...
18:58:04*hoverbear joined #nimrod
18:58:07dom96njoejoe: interesting.
18:58:42PortableEXetoC2Exception-free signalling with these high level interfaces would be nice
18:58:56PortableEXetoC2I think i said that before
18:59:38dom96PortableEXetoC2: And how should that work?
19:00:36dom96njoejoe: I would think that for such a URL getAddrInfo would fail. Not sure why it would cause high CPU usage.
19:00:49PortableEXetoC2Optionally that is
19:01:13PortableEXetoC2I dont know but it's useful for tasks like these
19:01:27dom96PortableEXetoC2: You can check for exceptions in futures manually.
19:01:28PortableEXetoC2Where failures arent exactly exceptional
19:01:54dom96var fut = recvLine(sock)
19:02:22PortableEXetoC2There you go. So maybe the crawler should do that then
19:02:24dom96echo fut.failed # true
19:02:27dom96If fut failed.
19:02:28PortableEXetoC2And connecting?
19:02:52dom96That doesn't allow you to use 'await'
19:04:21PortableEXetoC2Async + return codes
19:06:00PortableEXetoC2Just need to chuck more procs at it, right
19:10:18PortableEXetoC2Ive been thinking about how to make error signalling through return codes really transparent using metaprogramming
19:12:36PortableEXetoC2And eventually you end up manipulating the whole tree i guess
19:17:01PortableEXetoC2If you replace exception handling with semi-transparent error code propagation :p
19:18:17AraqI recently had the idea that 'errno' is not that bad, if it is an fact a seq of errors that's appended to
19:18:40Araqso you can check this list whenever you feel like it
19:19:02Araqbut at program exit every error that hasn't been popped is reported
19:25:52*hoverbear quit ()
19:26:09EXetoCinteresting
19:27:44EXetoCI might not mind having to explicitly discard error codes though. the syntax doesn't have to be very intrusive I guess
19:29:08*brson quit (Ping timeout: 252 seconds)
19:30:07*hoverbear joined #nimrod
19:30:28Araqthe error would include the stack trace in debug mode, of course
19:31:10Araqmight be really handy for a web-service, so exceptions that fuck your control flow and easy error logging
19:33:24Araq*no exceptions
19:35:56EXetoCand sometimes you don't want to wait >9000ms before you can keep going of course
19:36:56Araqhuh? what do you mean? waiting 9s?
19:37:28dom96bbl
19:38:08EXetoCwell, I guess you won't be rolling back very much anyway in that case, so throwing might not have a big impact
19:39:29EXetoCbut do you think any of this would require additional language features? for example, what about my feature request for allowing exceptions to be raised in blocks that are used as expressions?
19:40:24Araqone point of this approach is to not require any language features
19:40:51Araqand your feature request makes no sense in this context:
19:40:57Araq let foo = case
19:41:04*hoverbear quit ()
19:41:09Araq of valueA: 1
19:41:13Araq of valueB: 2
19:41:35Araq else: (logError("invalid value"); 2)
19:41:55Araqnote that there is no 'raise', but 'logError' so control flow continues
19:42:05Araqand you really need to provide a value
19:42:56Araqthe problem with this errorSeq approach is that it sucks for developing libraries; open(f); f.write(...); f.close() all need to check for some invalid file handle 'f' and become no-ops
19:43:30Araqthough that's what the OS already has to do ...
19:43:39Araqso maybe it's not bad at all
19:44:08fowlwhy the hate on exceptions
19:45:01Araqfowl: they are quite expensive for async
19:45:40Araqiirc dom96 benchmarked 5400 vs 5300 req/s for the exception unsafe vs exception safe handling of http requests or something
19:45:54EXetoCAraq, and I guess you just specify some dummy value when rolling back too.
19:46:08fowlso the cost is 100 reqs per second
19:46:28EXetoCbut several languages let you roll back and not specify a value to be returned
19:46:56EXetoCok
19:47:07*kiwi1423 joined #nimrod
19:47:08EXetoCstill, this is an interesting approach
19:47:15kiwi1423Q: What’s the proper way to use built-in GCC functions w/ Nimrod?
19:47:30kiwi1423(e.g., __popcountl or __builtin_prefetch)
19:48:13Araqlib/system/atomics.nim does it properly, kiwi1423
19:49:44kiwi1423Thx!
19:49:51Araqfowl: GPUs also don't support exception handling in any way, hence I'm thinking about alternatives
19:53:41Demoshow often do you do things on the GPU that should be raising exceptions?
19:54:26EXetoCAraq, what about rolling back by default using this approach?
19:54:52AraqEXetoC: what do you want to roll back? IO? ;-)
19:55:14EXetoCobviously we should replace the whole exception mechanism with this, and without much of an impact on the syntax :p
19:55:35EXetoCAraq, no, I mean rolling back in the stack tree
19:55:54EXetoCas in what happens when exceptions are raised
19:57:11Araqwell it's added to the error seq
19:57:16Araqnot sure what you mean
19:58:07EXetoCthen you're logging by default, rather than rolling back and possibly reaching the main function if not caught at an earlier stage
20:02:39AraqDemos: well I want to run anything on the GPU :P
20:06:49*kiwi1423 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
20:08:21EXetoCyou're not doing anything by default, really. you need at least a pragma to make any of these steps implicit
20:08:42EXetoCfortunately you can just push one at the top of the module. yay
20:15:29*PortableEXetoC2 quit (Quit: cake)
20:26:31*brson joined #nimrod
20:26:59*kunev quit (Quit: Lost terminal)
20:27:15*hoverbear joined #nimrod
20:36:30*uggedal left #nimrod (#nimrod)
20:44:26hoverbeardom96 \o/
20:53:07*Matthias247 quit (Read error: Connection reset by peer)
21:00:32*nande quit (Remote host closed the connection)
21:01:19EXetoCbut isn't the problem then that some template instantiation might modify the control, which makes automatic unwinding provided by a library difficult
21:03:05EXetoCno, the language already takes care of invoking ctors etc anyway
21:05:34*Xuerian quit (Quit: No Ping reply in 180 seconds.)
21:05:58dom96Araq: IIRC the difference was smaller than that. Like 10, and it's possible that it was a slight anomaly, i.e. not related to exceptions.
21:06:32EXetoCthat sure is low overhead
21:08:13*Xuerian joined #nimrod
21:08:58EXetoCwhat does he even mean with "exception unsafe" though? relying solely on return codes?
21:10:16EXetoCI mean safe (no-throw?)
21:13:07EXetoCAraq, ok. we got to boot on the GPU some time
21:30:32AraqEXetoC: "exception unsafe" here means "doesn't work with exceptions but luckily no was thrown"
21:34:14EXetoCthat's an entirely different story
21:34:41Varriount|Mobilekiw
21:34:52EXetoCkiwi?
21:35:17EXetoCkiwi1423? he left
21:35:19Varriount|Mobileyeah, I meant to message him/her
21:44:57renesacAraq, dom96: don't ditch exceptions because 0,1% performance loss on one benchmark, let's not follow Go
21:46:31dom96renesac: Of course not. I love exceptions.
21:49:20renesac:)
21:51:09Araqjust to be clear: no, nimrod won't lose its awesome tracked exceptions that put Java to shame
21:51:16EXetoCagain, these measurements were for un-raised exceptions
21:52:25Araqthe compiler itself uses exceptions, for control flow even
21:52:39EXetoCand that's not what we were discussing. anyway, you can just keep the original interface, and extend it if it really matters
21:53:46renesacright, and I hope one will be able to use them with async too, like in C#, right?
21:54:25EXetoCyes
21:54:33Araqrenesac: right, I think they already work
21:54:50Araqdom96: please correct me if I'm wrong
21:54:57EXetoCyou can't get the current exception yet in an exception handler
21:55:11renesacok, then I didn't understood the discussion above
21:55:17renesacbut no problem then
21:55:33Araqrenesac: but but but ... GPUs!
21:55:45renesacit looked like a regression to checking error codes was being ...
21:55:49EXetoCbut are raised exceptions really ~9000 times slower than the semantically equivalent code that uses return codes?
21:56:13renesacAraq, you don't want a 'if' on gpu either...
21:56:16AraqEXetoC: who said that?
21:56:25renesacafter each call
21:56:46Araqrenesac: my workaround doesn't require this ;-)
21:56:49EXetoCAraq, some people apparently
21:56:56EXetoCthat's an exaggeration of course
21:57:18njoejoedom96: strace ./downforeveryone ; other shell: wget http://localhost:8080/asdf ; and get zillion of these: epoll_ctl(4, EPOLL_CTL_MOD, 6, {EPOLLRDHUP, {u32=6, u64=6}}) = 0 ; epoll_wait(4, {{EPOLLHUP, {u32=6, u64=6}}}, 64, 500) = 1
21:57:18njoejoe
21:57:42AraqEXetoC: 'throw' is dead slow on Java since it needs to build the stack trace
21:58:07renesacI would wait someone with experience with gpu programming try to use nimrod and say what they need...
21:58:14Araqbut that only affects Java/JVM
21:59:00dom96njoejoe: That doesn't really tell me much. Except it perhaps reaffirms what I said previously.
21:59:26renesachttp://en.wikipedia.org/wiki/You_aren't_gonna_need_it
21:59:38njoejoedom96: ok.
22:00:46Araqrenesac: "If I had asked people what they wanted, they would have said faster horses."
22:01:00renesac"Until the feature is actually needed, it is difficult to fully define what it should do and to test it."
22:01:10renesac"Any new feature imposes constraints on what can be done in the future, so an unnecessary feature may preclude needed features from being added in the future."
22:01:13*BitPuffin quit (Quit: WeeChat 0.4.3)
22:02:28*BitPuffin joined #nimrod
22:02:36EXetoCAraq, but you did mention performance when you first responded to me, right? in which case some might need glorified return codes, but only in rare cases
22:03:09AraqEXetoC: sure
22:04:44*def- joined #nimrod
22:05:13Araqrenesac: I know about YAGNI, thanks
22:05:15Araqhi def- welcome
22:05:37def-Hi
22:07:11renesacPyCUDA exposes only exceptions to python programmers: Automatic Error Checking. All CUDA errors are automatically translated into Python exceptions.
22:07:18renesacaparently
22:07:57Araqyeah looks like they don't need it :P
22:08:32njoejoedom96: btw, i uncommented line 112 of selectors.nim and this is what is output https://gist.github.com/jots/c25729dda2d7d0894322 still trying to narrow in on it (because i really want async to work...)
22:09:45dom96njoejoe: looks fine to me.
22:09:59dom96njoejoe: I'll test it now
22:12:04njoejoei don't think it's fine because it is generating tons of those messages when you give it a bad url. when you give it a good url, it does its little bit of work and waits, not spinning like crazy with Epoll: 6 {} {}
22:15:48dom96njoejoe: you're right. It's using 100% even for correct URLs though.
22:18:52*boydgreenfield joined #nimrod
22:20:11njoejoei haven't seen it with correct urls yet. but if you're using a browser it may be asking for favicon.ico behind the scenes which is an invalid url.
22:20:18Varriount|MobileHi boydgreenfield, any progress with RST docgen?
22:20:29dom96njoejoe: I'm not.
22:21:01*Varriount-Mobile joined #nimrod
22:21:25boydgreenfieldVarriount: No – got distracted by some other items today. But will update if I find a pattern that seems sensible / useful.
22:23:46EXetoC"if (!()) goto LA65;" crap
22:23:46*Varriount-Mobile quit (Read error: Connection reset by peer)
22:24:42*Varriount|Mobile quit (Ping timeout: 240 seconds)
22:29:33*Kazimuth joined #nimrod
22:31:23*superfunc joined #nimrod
22:31:48superfunchey everybody
22:32:37EXetoCmorning
22:34:57superfuncI have a API design question, if you don't mind lending your opinion
22:36:41EXetoCdisclaimer: I'm wrong roughly 50% of the time
22:36:44EXetoCok, go on
22:40:25superfuncwould you prefer a highly parameterized type or multiple distinct types. For example. Option A would result in client code looking like this... var g = Graph[int](directed: true, multiedge: true).. whereas option B would look like... var g = DirectedMultigraph[int](..)
22:40:37*brson quit (Quit: leaving)
22:44:09Araqsuperfunc: let the implementation decide. I can imagine the code works well with Option A and option B will become a pita
22:44:25Araqwhere you have lots of procs and they all delegate to common templates
22:45:24AraqEXetoC: cgen.nim, lin 507
22:45:34Araqmake the check:
22:46:06Araq if sfVolatile in s.flags or (p.nestedTryStmts.len > 0 and gCmd != cmdCompileToCpp):
22:48:40superfuncAraq: Thanks. For option B, I was considering having a typeclass imposing some basic behavior so I wouldn't have to write too many procs
22:50:55dom96njoejoe: You can change line 32 of the selectors module to 'when false' as a workaround
22:51:19dom96njoejoe: Please report this on github, it's a bit of a challenge to fix and I don't have the time right now to do it.
22:51:30EXetoCit's mostly about having clearly defined interfaces, but I guess it might result in fewer procs in some cases
22:52:55EXetoCand type classes work, but not those that are so-called user-defined don't really
22:53:04EXetoCsome bugs need to be resolved
22:54:16AraqError: 0..15 not disjoint from 14..30
22:54:23Araqis that even correct english?
22:54:38EXetoCthe former is just T|U|V, while the latter involves the 'generic' keyword
22:55:56*askatasuna quit (Ping timeout: 252 seconds)
22:59:13*yogin joined #nimrod
22:59:21*yogin quit (Remote host closed the connection)
22:59:41*brihat joined #nimrod
23:00:39Kazimuthis it possible to tell koch to build with clang? Just out of curiosity
23:02:22Kazimuthookay, nimrod.cfg, that looks promising
23:03:43Araqkoch boot --cc:clang
23:03:53Araq(I think)
23:04:55EXetoCoh
23:05:48EXetoCdoesn't say that in the help anyway
23:06:01*darkf joined #nimrod
23:06:28*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
23:06:39Araqwhy should it? it passes the options to "nimrod". should koch document everything then that nimrod supports?
23:07:44EXetoCI don't think it's mentioned in the help for either
23:08:19Araq boot [options] bootstraps with given command line options
23:08:50Kazimuthah, that makes sense
23:08:53EXetoCI meant cc
23:08:58Araqoh
23:28:10EXetoCthe volatile error appears to remain
23:28:32AraqEXetoC: but there should be fewer
23:33:00*hoverbear quit ()
23:45:30*superfunc quit (Ping timeout: 265 seconds)
23:46:34Kazimuthwoo, glut works!
23:46:41Kazimuth...I should do homework
23:46:46Kazimuththanks for the help!
23:46:49*Kazimuth quit (Quit: gas leak)
23:46:50*askatasuna joined #nimrod
23:49:35Araqgood night
23:52:04NimBotAraq/Nimrod new_spawn c43e8df Araq [+0 ±10 -0]: progress for the 'parallel' statement
23:53:15*brson joined #nimrod