00:10:15 | * | brson quit (Ping timeout: 272 seconds) |
00:10:37 | * | brson joined #nimrod |
00:18:52 | dom96 | Good night |
00:26:25 | * | BitPuffin quit (Ping timeout: 240 seconds) |
01:43:39 | * | Boscop_ joined #nimrod |
01:57:01 | * | brson quit (Quit: leaving) |
01:58:57 | OrionPK | yep. that's the plan |
02:16:47 | * | Boscop_ is now known as Boscop |
02:17:04 | * | Boscop quit (Changing host) |
02:17:04 | * | Boscop joined #nimrod |
02:17:04 | * | Boscop quit (Changing host) |
02:17:04 | * | Boscop joined #nimrod |
02:23:46 | OrionPK | dom96 somethings fucky |
02:23:54 | OrionPK | system.nim(2555) hiddenRaiseAssert system.nim(1844) raiseAssert Error: unhandled exception: not j.isAsync [EAssertionFailed] |
02:46:59 | * | Mordecai joined #nimrod |
02:50:29 | * | psquid quit (Ping timeout: 272 seconds) |
02:54:41 | OrionPK | araq.. I cant believe this even works |
02:54:42 | OrionPK | https://gist.github.com/onionhammer/8214287 |
02:54:44 | OrionPK | you are my hero |
02:59:31 | * | Demos joined #nimrod |
03:00:47 | OrionPK | hi demos |
03:00:49 | OrionPK | hows it goin |
03:01:14 | Demos | hi, not bad, I got my VS plugin to load. But it does not seem to actually do anything, which is kinda strange |
03:01:25 | OrionPK | doh |
03:01:39 | OrionPK | im still flabbergasted that this works https://gist.github.com/onionhammer/8214287 |
03:01:40 | Demos | I fixed a host of bugs in my c++ code, ate some food, played some morrowind |
03:01:51 | OrionPK | ha, nice |
03:02:06 | OrionPK | this is the first time I've had any melaxation in 2 days |
03:02:09 | Demos | I am not even gunna try and devine wtf that is doing |
03:02:15 | OrionPK | haha |
03:02:25 | OrionPK | the source code highlighting on github sucks |
03:02:30 | OrionPK | looks much nicer in sublime |
03:03:05 | OrionPK | https://dl.dropboxusercontent.com/u/417554/templatemadness.png |
03:03:08 | Demos | soon in VS I hope! It turns out that it is pretty hard to debug a plugin for the software running your debugger! |
03:03:30 | OrionPK | doh, yeah I can imagine |
03:03:49 | OrionPK | I'd love to have visual studio support going, once you get a nice framework in place maybe i'll help out with your plugin |
03:04:36 | OrionPK | we've almost got a real razor mvc competitor here :) |
03:04:45 | OrionPK | this is (IMO) *better* than razor though |
03:04:52 | OrionPK | as it actually gives you compile time errors |
03:05:08 | Demos | well if you know anything about VS managed package framework that would be helpful. I also need to figure out how to get the native glue dll distributed along with the package, atm I just threw the dll into c:\windows\system32 |
03:05:27 | OrionPK | oh, ew :p |
03:05:30 | Demos | yeah |
03:05:43 | OrionPK | i havent done much with VS plugins |
03:05:53 | OrionPK | I wrote one ages ago to count lines of code I think |
03:06:00 | OrionPK | and I've done office plugins |
03:06:16 | Demos | yeah, I think langugae services are different |
03:06:22 | OrionPK | no doubt |
03:06:23 | Demos | there are about 14 different plugin frameworks |
03:06:39 | OrionPK | lame |
03:07:00 | Demos | I /think/ I am provideing the proper token type and color information to VS but I am not sure if I need to implement my own Colorizer class to get stuff actually rollin |
03:07:00 | OrionPK | are you just going to aim for VS11 support |
03:07:02 | OrionPK | ? |
03:07:07 | Demos | VS2013 |
03:07:17 | Demos | so VS12 |
03:07:23 | Demos | may work with 11 though |
03:07:29 | OrionPK | mm ok |
03:08:07 | OrionPK | i have both installed |
03:08:32 | Demos | I think the sln format did not change, you are welcome to try it out once I have it working. The code is actually on my github but as I said, it does nothing :( |
03:10:21 | OrionPK | :( |
03:10:24 | OrionPK | you'll figure it out |
03:10:29 | Demos | yeah eventually |
03:11:53 | * | darkf quit (Read error: Connection reset by peer) |
03:12:19 | * | darkf joined #nimrod |
03:12:38 | EXetoC | what's tmpl? |
03:12:58 | OrionPK | https://github.com/onionhammer/onion-nimrod/tree/master/templates |
03:16:59 | OrionPK | more specifically https://github.com/onionhammer/onion-nimrod/blob/master/templates/tests.nim |
03:26:21 | * | Varriount joined #nimrod |
03:34:08 | Varriount | Araq, dom96, ping |
03:44:17 | OrionPK | bit late for them methinks |
03:45:20 | Varriount | Rats |
03:45:47 | Varriount | OrionPK, nimrod is failing to boot |
03:45:56 | Varriount | Thus, the builders are failing |
03:46:09 | OrionPK | :s |
03:46:15 | Varriount | c:\64\nimbuild\nimrod\lib\system\widestrs.nim(99, 56) Error: cannot convert 56320 to range 0..1023(int) |
03:47:42 | * | Varriount runs around, panicking |
03:50:17 | OrionPK | guess it'll have to wait :O |
03:50:33 | * | Varriount panics even more |
03:51:49 | OrionPK | i am so frigggin tired |
03:51:57 | OrionPK | i got like 4 1/2 hours of sleep last night it hink |
04:26:12 | * | xenagi joined #nimrod |
04:49:27 | * | Mordecai quit (Ping timeout: 260 seconds) |
05:25:35 | * | xenagi quit (Quit: Leaving) |
05:39:22 | * | Endy joined #nimrod |
05:52:14 | * | Mordecai joined #nimrod |
06:00:40 | * | XAMPP joined #nimrod |
06:34:05 | * | XAMPP quit (Ping timeout: 245 seconds) |
06:41:01 | * | Demos quit (Ping timeout: 272 seconds) |
07:43:19 | * | [1]Endy joined #nimrod |
07:46:39 | * | Endy quit (Ping timeout: 240 seconds) |
07:46:39 | * | [1]Endy is now known as Endy |
09:14:30 | * | OrionPK quit (Write error: Broken pipe) |
09:53:55 | * | Araq_ joined #nimrod |
09:58:02 | * | Araq_ quit (Client Quit) |
10:07:13 | * | EXetoC quit (Quit: WeeChat 0.4.2) |
11:35:42 | * | zielmicha joined #nimrod |
11:51:48 | * | BitPuffin joined #nimrod |
11:59:50 | * | Mordecai is now known as psquid |
12:23:23 | * | EXetoC joined #nimrod |
12:27:17 | BitPuffin | de herro |
12:35:56 | dom96 | hallo |
13:20:07 | BitPuffin | dom96: aren't you supposed to be on prom? |
13:20:21 | dom96 | not yet |
13:20:26 | dom96 | I leave in a couple of hoursd |
13:20:28 | dom96 | *hours |
13:20:39 | dom96 | But actually I need to leave now to get ready :P |
13:20:40 | dom96 | bbl |
13:21:34 | * | girvo joined #nimrod |
13:22:38 | BitPuffin | lawl |
13:22:40 | BitPuffin | good lack! |
13:26:43 | * | darkf quit (Quit: Leaving) |
13:26:59 | * | ddl_smurf joined #nimrod |
13:38:22 | * | girvo quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
13:41:52 | * | Araq_ joined #nimrod |
13:42:26 | dom96 | back briefly |
13:42:34 | dom96 | hello Araq_ |
13:42:38 | Araq_ | hi |
14:12:40 | * | Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 26.0/20131205075310]) |
14:33:05 | * | psquid quit (Quit: work) |
14:42:04 | * | OrionPK joined #nimrod |
15:53:59 | * | capisce quit (Read error: Connection reset by peer) |
15:54:09 | * | capisce joined #nimrod |
15:58:16 | NimBot | Araq/Nimrod devel 692e478 Zahary Karadjov [+0 ±5 -0]: fixed #597 |
16:57:58 | * | io2 joined #nimrod |
17:07:17 | OrionPK | finally figured out a way I can make this work dom96 |
17:07:27 | OrionPK | https://gist.github.com/onionhammer/8222475 |
17:08:09 | OrionPK | everything should get written out to a socket in the correct order w/ that |
17:08:41 | OrionPK | and it's not TOO ugly (at least with working syntax highlighting) |
17:24:11 | * | Demos joined #nimrod |
17:27:02 | Varriount | Araq, dom96, ping |
17:32:24 | * | ddl_smurf quit (Quit: ddl_smurf) |
17:47:09 | Araq | Varriount: pong. I got your message about bootstrapping not working anymore for win64 |
17:47:37 | Varriount | And win32 |
17:47:50 | Araq | master or devel? |
17:48:00 | Araq | I'm working on win32 all the time ... |
17:48:02 | Araq | on devel |
17:48:11 | Varriount | Master, or whatever the builder checks out |
17:49:02 | Araq | the builder checks out whatever has been pushed to |
17:50:09 | * | BitPuffin quit (Ping timeout: 245 seconds) |
17:50:44 | Varriount | Araq: Ah. Looking at the console logs, it appears that the 'devel' branch is what is failing to build |
17:51:00 | Araq | blame zahary then :-) |
17:51:05 | Araq | he merged lots of stuff |
17:54:13 | Varriount | Araq, I'm curious, which is better - one sequence with a tuple containing an enum member and a string, or two sequences containing strings? |
17:54:47 | Araq | enums rule |
17:59:39 | Varriount | Araq, quite true. I'm particularly amazed at how enums can be used to differentiate 'kinds' of things, like sockets or paths. It's most.. dynamic |
18:03:06 | Araq | lol well |
18:03:49 | Araq | array [TMyEnum, string] might also work instead of array [tuple[TMyEnum, string]] |
18:04:14 | * | brson joined #nimrod |
18:15:23 | * | DAddYE joined #nimrod |
18:29:18 | * | zielmicha quit (Ping timeout: 240 seconds) |
18:44:46 | * | zielmicha joined #nimrod |
18:54:37 | * | io2 quit (Ping timeout: 265 seconds) |
18:59:34 | * | DAddYE quit (*.net *.split) |
18:59:35 | * | JStoker quit (*.net *.split) |
18:59:35 | * | Kooda quit (*.net *.split) |
19:05:10 | * | DAddYE joined #nimrod |
19:05:10 | * | JStoker joined #nimrod |
19:05:10 | * | Kooda joined #nimrod |
19:18:48 | * | io2 joined #nimrod |
19:19:38 | * | gradha joined #nimrod |
19:31:48 | gradha | OrionPK: wrt #792 why don't you upload docgen_samples/sample.nim instead of the generated html files? Otherwise the git generated version will need updating every time css/html changes |
19:41:06 | OrionPK | lets cross that bridge when we come to it |
19:41:38 | gradha | lol, i'm wading right now there, changing the HTML |
19:43:37 | gradha | at least add docgen.txt to web/nimrod.ini so it gets built |
20:02:16 | OrionPK | oop you must not have put that in the last PR comments |
20:09:20 | gradha | Araq: given a PNode for a parameter with default value, is there any way to extract the type? |
20:09:39 | Araq | n.typ ? |
20:10:11 | Varriount | Araq, I have interesting news regarding removeDir |
20:10:46 | Araq | how can removeDir be interesting? but go on please |
20:11:17 | gradha | <fansworth>I have good news regarding removeDir!</fansworth> |
20:11:40 | Araq | hmm Futurama? |
20:11:52 | Varriount | Araq: I reimplemented removeDir using a non-recursive implementation, and did a quick profiling of both the original and new implementations |
20:11:56 | gradha | yep, looks like I missed an 'r' |
20:12:27 | gradha | don't you love that fictional characters get a wikipedia page but programming languages don't? |
20:12:54 | Araq | wikipedia is absurd anyway, can't take it serious |
20:13:19 | Araq | just look at articles about politicians to know what I mean |
20:13:19 | Varriount | Araq, in short, though the original implementation of removeDir is slightly faster, the new implementation of removeDir that I have uses significantly less memory and other system resources |
20:13:43 | Araq | Varriount: how does that work? |
20:14:00 | Araq | but hmm |
20:14:10 | Araq | no, don't get it |
20:14:12 | Varriount | I tested the two implementations using a ram-disk and process explorer, and timed each on how long it took to delete the boost c++ lib source code |
20:14:30 | Araq | interesting benchmark :P |
20:15:16 | Araq | how did you make it non-recursive? |
20:15:20 | gradha | Varriount: did you try fat16? |
20:15:25 | Araq | like I did with an explicit stack? |
20:15:37 | Araq | or by using some other win API? |
20:16:32 | Varriount | Araq, yes |
20:16:39 | Varriount | an explicit stack. |
20:16:41 | Varriount | One moment |
20:16:43 | Varriount | Old Implementation: Peak Private Bytes - 2560, Peak Working Set - 8144, Peak Handle Count - 187 |
20:16:55 | Varriount | New Implementation: Peak Private Bytes - 1016, Peak Working Set - 2396, Peak Handle Count - 9 |
20:19:29 | Araq | how does that work? |
20:19:44 | Varriount | Araq, how does what work? |
20:20:06 | Araq | why does it use fewer handles? we don't free any handle |
20:20:11 | gradha | Araq: I'm in docgen phase, the only info I have in the PNode is 'type = nil, s = "false"' + line/col |
20:20:12 | Varriount | Heres the implementations, for comparison - https://gist.github.com/Varriount/8226008 |
20:21:21 | Varriount | Araq, the recursive implementation keeps the handle to whatever directory it is currently deleting open, even when it is deleting a child directory |
20:22:31 | Araq | ok |
20:22:43 | Varriount | So peak handle usage is, at minimum, equal to the deepest sub directory path |
20:23:41 | Varriount | Should I go on explaining? |
20:23:47 | Araq | no lol |
20:24:07 | Varriount | Ok. I only ask because I tend to rample on. |
20:24:53 | Varriount | Araq, I'm guessing the reason that the new implementation is *slightly* slower is because it reopens handles. I the end, it's a tradeoff. |
20:26:17 | Varriount | New Implementation Time - 4.9569999999999999e+000 |
20:26:17 | Varriount | Old Implementation Time - 4.8239999999999998e+000 |
20:26:29 | Araq | yeah yeah yeah |
20:26:36 | Varriount | :P |
20:26:37 | Araq | we'll take it |
20:29:32 | gradha | Araq: is there a magic proc which turns the string "false" into a typ object? |
20:30:51 | Araq | gradha: when you're in doc2 you have the type information |
20:31:55 | gradha | will doc2 prevail and cut off doc's head at some point? |
20:32:12 | Araq | yeah |
20:46:25 | OrionPK | jebus. just rendered my page 100, 000 times in a quarter of a second |
20:52:17 | shevy | was it an empty page |
20:57:57 | OrionPK | nearly |
20:58:25 | OrionPK | just some header/footer, generic greeting, a css include |
20:58:41 | OrionPK | when I render a real page it's 0.9850 milliseconds per iteration. |
20:59:12 | OrionPK | so about 98 seconds for 100,000 iterations |
20:59:51 | OrionPK | and I havent even done the straight-to-socket optimization yet :) |
21:25:02 | * | ddl_smurf joined #nimrod |
21:29:19 | OrionPK | dom96 sendheaders sucks :P |
21:30:37 | gradha | dom96: you need to start tweeting pictures of honey badgers |
21:30:43 | OrionPK | should take an openarray of tuple[string,strnig] instead of a PStringTable |
21:33:15 | gradha | https://www.honeybadger.io |
21:49:20 | EXetoC | Varriount: nice, you managed to output readable float exponents :p |
21:59:24 | Varriount | EXetoC, erm, that's the default behavior |
22:00:12 | Varriount | EXetoC, all I did was "echo "CPU time [s] ", cpuTime() - t0" (t0 is a previosly captured cpuTime()) |
22:03:58 | Varriount | EXetoC, are you running Linux at the moment, and in a position to test something as root user? |
22:04:40 | EXetoC | yeah and it's fine for some ranges at least :> |
22:04:41 | EXetoC | yes |
22:05:40 | EXetoC | any non-virus will do |
22:06:03 | Varriount | EXetoC, could you please check out the "os/add-linkprocs" branch from my fork of nimrod, and then compile and run this program as root -> https://gist.github.com/Varriount/8185073 |
22:08:28 | * | Endy quit (Ping timeout: 245 seconds) |
22:15:58 | EXetoC | ok |
22:16:52 | EXetoC | Varriount: ./koch boot: "lib/pure/os.nim(415, 48) Error: expression 'S_IFLNK(res.st_mode)' cannot be called" |
22:17:18 | EXetoC | I think I re-compiled correctly, and that seems relevant |
22:18:01 | Varriount | EXetoC, you're running as root? And you have access to the posix headers? |
22:18:49 | EXetoC | what, even koch? |
22:19:39 | Varriount | You shouldn't need to run koch, just checkout the branch and run the test program. |
22:19:50 | Varriount | Although, why koch boot won't work, I don't know... |
22:20:30 | Varriount | The only time I've gotten an error message like that is when nimrod couldn't find the header to a cimport'ed procedure |
22:20:31 | EXetoC | Varriount: ok, same error |
22:20:55 | EXetoC | as root. I should have the posix headers but let me check |
22:22:00 | * | joelmo quit (Ping timeout: 252 seconds) |
22:22:01 | EXetoC | I have unistd.h, so the others ought to be present |
22:26:08 | Araq | wer weniger schläft ist länger wach |
22:26:25 | shevy | lol |
22:26:37 | gradha | so you are in release mode? |
22:27:51 | * | NimBot joined #nimrod |
22:29:12 | EXetoC | Varriount: "lib/pure/os.nim(1219, 11) Error: type mismatch: got (TPathComponent) but expected 'TPathKinds'" |
22:29:12 | EXetoC | ok let's see |
22:29:32 | EXetoC | pc -> pk? |
22:29:52 | Varriount | Gah. *bangs head* |
22:30:12 | Varriount | EXetoC, one moment. Lemme change some stuff on my branch |
22:32:14 | Varriount | EXetoC, ok, re-pull the linkprocs branch and try again |
22:33:29 | gradha | I can create a proc foo(a: int) and proc foo(a: var int), but how do I specify which one I'm calling? |
22:33:59 | * | shodan45 quit (Quit: Konversation terminated!) |
22:36:56 | gradha | tried passing a const value but it still complaints |
22:36:56 | Varriount | gradha, "complains"? |
22:36:56 | EXetoC | Varriount: same error as when I made it compile myself: "Error: unhandled exception: UnixToNativePath(iPath) == oPath [EAssertionFailed]". line 88, line 40 |
22:36:58 | gradha | Varriount: Error: ambiguous call; both ma.t1(a: int) and ma.t1(a: var int) match for: (int literal(3)) |
22:37:16 | Varriount | gradha, maybe you *can't*? |
22:37:16 | gradha | but why allow the overload? |
22:37:57 | gradha | I'm also passing a const, so presumably it should not be able to modify it as a var |
22:38:20 | gradha | yes, if I remove one proc then it correctly says a var type needs a variable |
22:38:39 | Varriount | EXetoC, what does it say is the input, output, and expected results? |
22:39:17 | EXetoC | Varriount: ah :-) "Input: /user/tester/nimrod -> Output: /user/tester/nimrod -> Expected: /usr/tester/nimrod" |
22:39:20 | EXetoC | just a typo yeah? |
22:40:42 | Varriount | yeah. Blame me and my familiarity with windows. |
22:40:59 | Araq | gradha: overloading by var is not supported but you can work around with AST based overloading |
22:40:59 | Araq | (var T){lvalue} |
22:41:01 | Varriount | EXetoC, by the way, you might have to delete some directories/files that are created if the test program fails halfway through, in order to ensure that, even when fixed, it will run successfully again. |
22:42:44 | EXetoC | ok. haven't seen any yet |
22:43:20 | Varriount | Filesystem based tests are very.. finicky. >_< |
22:50:46 | Araq | I need a new type qualifier. I called it "protected". any objections? |
22:50:46 | Araq | it means the value is protected by a lock |
22:51:06 | gradha | locked is too obvious? |
22:51:06 | Araq | I guess it's confusing for the people coming from OO languages |
22:51:06 | Varriount | Araq, explain? |
22:51:46 | Araq | gradha: "locked" is a bit off though, it needs to be locked for access, it is not constantly locked |
22:52:07 | Araq | var x: protected ptr int |
22:52:20 | gradha | serial, from serial access |
22:52:20 | gradha | or better, seq |
22:52:27 | gradha | sequential access |
22:52:41 | Araq | echo x[] # invalid |
22:52:41 | Araq | lock x: |
22:52:41 | Varriount | How about "readonly"? |
22:53:07 | Araq | echo x[] # valid |
22:53:07 | Araq | "readonly" is completely different |
22:53:28 | gradha | readonly sounds more like immutable |
22:53:28 | Araq | "serial" is ... meh |
22:53:48 | Varriount | "hide"? "cover"? "sequester"? |
22:54:08 | Araq | well it IS protected, so why not call it that way? |
22:55:09 | Varriount | Araq, just a warning: if you use 'protected', you're going to confuse every hard-core OO programmer (essentially, any java junkie) |
22:55:30 | Demos | what about volitile? |
22:55:30 | Araq | "shielded"? |
22:55:30 | Araq | "volatile" is different |
22:55:49 | Varriount | I like "shield" |
22:55:49 | Demos | does nimrod already have volatile? does it translate to c's concept of volitile |
22:56:10 | Araq | Demos: as a pragma yes |
22:56:10 | Varriount | "disbar"? |
22:57:11 | Varriount | Ideally, you want something 7 letters or less. Any longer and you take up valuable line space |
22:57:12 | Araq | true |
22:57:19 | Araq | well no |
22:57:31 | Araq | it's a rare keyword |
22:57:34 | * | JehanII joined #nimrod |
22:57:37 | Varriount | "closed"? |
22:57:50 | Araq | hi JehanII welcome |
22:57:55 | Varriount | "aloof"? |
22:58:32 | Varriount | Araq, how about "sealed"? |
22:58:52 | Araq | c# uses "sealed" for "final" |
23:00:51 | * | zielmicha-cloud quit (Ping timeout: 245 seconds) |
23:01:34 | gradha | rlock, read lock |
23:01:42 | gradha | plus it rhymes with sherlock |
23:02:16 | gradha | but in a pirate kind of way |
23:02:34 | Varriount | Well, I like the sound of "shielded", but as far as communicating meaning goes, "locked" and "protected" are a bit better. |
23:02:57 | ponce__ | how about "synced" |
23:04:20 | * | zielmicha-cloud_ joined #nimrod |
23:04:33 | * | JehanII quit () |
23:06:44 | * | JehanII joined #nimrod |
23:07:16 | JehanII | Hmm, I think this is what happens when one hasn't used IRC in over a decade. :) |
23:07:59 | Varriount | Just marvel at the fact that IRC is still around, even after a decade+ of existance |
23:08:40 | * | capisce quit (Ping timeout: 245 seconds) |
23:10:20 | Araq | JehanII: still reading your email, many thanks for all the literature I now have to read ... :-) |
23:12:22 | JehanII | Araq: I'm sorry. If it makes you feel any better, it's only a fraction of the stuff that I had to read over the past 20 years or so myself. :) |
23:13:20 | Araq | well I spent the evening with ftp://ftp-sop.inria.fr/mimosa/personnel/gbo/adfsfsmc.pdf |
23:13:43 | Araq | and frankly I don't get his basic ideas |
23:13:43 | * | darkf joined #nimrod |
23:13:43 | * | darkf quit (Changing host) |
23:13:43 | * | darkf joined #nimrod |
23:15:05 | JehanII | I'm not familiar with the paper, and anything with type theory stuff in it is usually twice as dense as necessary. :) |
23:16:42 | JehanII | Deadlock avoidance, in the end, comes down to one of two things: Avoiding cycles in the wait-for graph or breaking them. |
23:17:03 | JehanII | And there are only a few fundamentally different ways to go about that. |
23:17:43 | JehanII | The difference between various mechanisms is usually the level of sophistication and how good a fit each is for a given language/paradigm. |
23:18:12 | * | capisce joined #nimrod |
23:25:38 | Varriount | EXetoC, ping |
23:27:46 | Araq | JehanII: as I said, preventing races is more important to me, but there seems to be no real solution for the essential problem that |
23:28:12 | Araq | lock a: foo(a) |
23:28:12 | Araq | lock b: bar(b) |
23:28:37 | Araq | was written when the semeantics need to be: |
23:28:53 | Araq | lock a, b: |
23:28:53 | Araq | foo(a) |
23:28:53 | Araq | bar(b) |
23:29:13 | JehanII | Yup. That's a general race, though, not a data race. |
23:29:33 | JehanII | Data races are especially bad, because, well totally undefined behavior. |
23:29:51 | Araq | yeah but all the type system can do is to ensure I don't forget the 'lock a' entirely |
23:29:56 | JehanII | General races lead to non-determinism. Which sucks, too, but is less bad. |
23:30:14 | JehanII | Trust me, that's important enough. |
23:30:14 | Araq | so that's what I like to accomplish |
23:30:34 | JehanII | I spent the past four years parallelizing a computational algebra system. |
23:30:34 | Araq | with the simplest mechanism possible |
23:30:34 | JehanII | Without that safeguard, I think I'd have lost my mind halfway through. :) |
23:31:15 | JehanII | That sounds perfectly reasonable. |
23:31:35 | Araq | yay :-) |
23:32:15 | JehanII | Digression: You cannot discover general races (i.e., where all memory accesses are guarded, but not necessarily in the way you want) without augmenting your program with a specification. |
23:32:56 | JehanII | See Owicki and Gries's parallel variant of the Hoare calculus. |
23:33:04 | JehanII | To identify one thread interfering with another under their model, you require annotation with pre- and postconditions. |
23:33:36 | JehanII | Which means that the general problem is pretty hard. |
23:33:57 | JehanII | You'd have to add a lot of stuff to any programming language to solve it. |
23:37:08 | JehanII | That said, one approach that I have been playing around with has been not to describe sections where locks are being held, but where they're being yielded. |
23:37:59 | JehanII | And having an obvious visual marker in the source for such code. |
23:37:59 | Araq | well my idea is to have both "shared ptr" and "protected ptr" where the latter is a subset of the former. Threads can only access "protected" pointers. |
23:38:19 | JehanII | That means rather than having sections of code where you know: things are deterministic here, you will be told where things may be non-deterministic. |
23:38:35 | Varriount | If only this were a gordian knot that could be sliced through. |
23:39:31 | JehanII | Hmm. How do you go from a shared to a protected ptr? |
23:39:31 | * | DAddYE quit () |
23:39:40 | Araq | things like protected ptr tuple [L: Lock, data: int, next: shared ptr ...] are valid though |
23:40:15 | EXetoC | Varriount: ya |
23:40:15 | Araq | and the semantics are that L protects the stuff "next" points to too |
23:40:18 | Varriount | EXetoC, did the test run successfully? |
23:40:43 | JehanII | Varriount: It's only been an unsolved problem for about forty years. :) |
23:41:42 | Araq | but to access protected[].next you need to acquire L obviously so things are not too bad |
23:42:12 | JehanII | I'm still not quite sure I'm following you? |
23:42:26 | JehanII | I.e., what does a separate `protected` type buy you? |
23:42:42 | Araq | how I go from shared to protected is not entirely clear yet :P |
23:43:03 | JehanII | Does a lock implicitly promote a shared ptr to a protected ptr? |
23:43:03 | * | psquid joined #nimrod |
23:43:03 | JehanII | Ah, okay. :) |
23:43:03 | Araq | no the opposite |
23:43:16 | JehanII | Gotcha. |
23:43:28 | Araq | a lock promotes a protected ptr to a shared ptr |
23:43:38 | Araq | the "shared" is rather meaningless, it only helps that you use allocShared/deallocShared |
23:43:45 | Araq | and not alloc/dealloc |
23:44:44 | JehanII | So, a protected ptr is something that is on the shared heap but can be freely accessed by the current thread as though it were on the thread-local heap? |
23:44:44 | EXetoC | Varriount: "Error: unhandled exception: Not a directory [EOS]". line 89, 83 |
23:44:44 | EXetoC | if I correct that typo |
23:45:23 | Araq | no it cannot be deferenced (sorry in my article that was called "shared") |
23:45:23 | JehanII | Eh, something that "points to" rather than "is on". |
23:45:47 | Araq | you need to lock it and then deref is allowed |
23:46:05 | * | DAddYE joined #nimrod |
23:46:45 | JehanII | Okay, I think I understand now. |
23:47:06 | Araq | so a protected ptr points to the shared heap, yes |
23:47:15 | Araq | the spawn/createThread primitive ensures that passed arguments are "protected" |
23:47:37 | Araq | or rather that the thread proc only takes protected ptrs or simple values |
23:48:31 | Araq | threads can access globals but these need to be protected ptrs too then |
23:49:08 | Araq | this is easily enforced with some effect tracking |
23:50:15 | Araq | construction causes some problems though: |
23:50:19 | JehanII | So, what are shared ptrs then? Basically a version of protected ptrs without any guarantees? |
23:51:29 | Araq | that's one way to look at it, but I see them as "ptr" with a label so that you use allocShared instead of alloc |
23:51:29 | JehanII | If it helps, the requirement that global variables point to protected data is essentially what I did in my last project, too. |
23:51:36 | JehanII | (Only as a rule, was a dynamically typed language, so it couldn't be enforced.) |
23:52:16 | Araq | "shared ptr" is rather unimportant, we might as well use "ptr" |
23:52:50 | Araq | ok now the problem is that for construction this happens: |
23:53:11 | Araq | proc createFoo(): shared ptr Foo = ... |
23:53:30 | Araq | var global: protected ptr Foo = createFoo() # should be valid |
23:54:31 | Araq | but I don't know whether assignments from shared to protected are safe in general |
23:54:43 | JehanII | I don't see the problem? |
23:55:12 | Araq | I guess they are |
23:55:12 | Araq | because the protection refers to the memory that's pointed to |
23:55:12 | Araq | and not to the pointer itself |
23:55:12 | JehanII | Oh, right, missed the shared vs protected. |
23:55:52 | JehanII | Why not have createFoo() return a protected ptr Foo? |
23:56:32 | Araq | because then you need to do: |
23:56:53 | Araq | proc createFoo(): protected ptr Foo = |
23:56:53 | Araq | result = allocshared(...) |
23:57:19 | Araq | result.data = 33 # oops |
23:57:34 | Araq | result.lock = createLock() |
23:57:34 | * | io2 quit (Ping timeout: 260 seconds) |
23:57:34 | Araq | lock result: result.data = 33 # that's valid but stupid |
23:57:43 | * | zielmicha quit (Ping timeout: 246 seconds) |
23:58:19 | Araq | I guess you can make construction a single expr and thus avoid this problem |
23:58:22 | JehanII | There are a couple of things that you could look at. |
23:59:01 | JehanII | One is to automatically insert a lock after an assignment to result. |
23:59:35 | Araq | wait .. what? |