<< 02-01-2014 >>

00:10:15*brson quit (Ping timeout: 272 seconds)
00:10:37*brson joined #nimrod
00:18:52dom96Good 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:57OrionPKyep. 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:46OrionPKdom96 somethings fucky
02:23:54OrionPKsystem.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:41OrionPKaraq.. I cant believe this even works
02:54:42OrionPKhttps://gist.github.com/onionhammer/8214287
02:54:44OrionPKyou are my hero
02:59:31*Demos joined #nimrod
03:00:47OrionPKhi demos
03:00:49OrionPKhows it goin
03:01:14Demoshi, not bad, I got my VS plugin to load. But it does not seem to actually do anything, which is kinda strange
03:01:25OrionPKdoh
03:01:39OrionPKim still flabbergasted that this works https://gist.github.com/onionhammer/8214287
03:01:40DemosI fixed a host of bugs in my c++ code, ate some food, played some morrowind
03:01:51OrionPKha, nice
03:02:06OrionPKthis is the first time I've had any melaxation in 2 days
03:02:09DemosI am not even gunna try and devine wtf that is doing
03:02:15OrionPKhaha
03:02:25OrionPKthe source code highlighting on github sucks
03:02:30OrionPKlooks much nicer in sublime
03:03:05OrionPKhttps://dl.dropboxusercontent.com/u/417554/templatemadness.png
03:03:08Demossoon in VS I hope! It turns out that it is pretty hard to debug a plugin for the software running your debugger!
03:03:30OrionPKdoh, yeah I can imagine
03:03:49OrionPKI'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:36OrionPKwe've almost got a real razor mvc competitor here :)
03:04:45OrionPKthis is (IMO) *better* than razor though
03:04:52OrionPKas it actually gives you compile time errors
03:05:08Demoswell 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:27OrionPKoh, ew :p
03:05:30Demosyeah
03:05:43OrionPKi havent done much with VS plugins
03:05:53OrionPKI wrote one ages ago to count lines of code I think
03:06:00OrionPKand I've done office plugins
03:06:16Demosyeah, I think langugae services are different
03:06:22OrionPKno doubt
03:06:23Demosthere are about 14 different plugin frameworks
03:06:39OrionPKlame
03:07:00DemosI /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:00OrionPKare you just going to aim for VS11 support
03:07:02OrionPK?
03:07:07DemosVS2013
03:07:17Demosso VS12
03:07:23Demosmay work with 11 though
03:07:29OrionPKmm ok
03:08:07OrionPKi have both installed
03:08:32DemosI 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:21OrionPK:(
03:10:24OrionPKyou'll figure it out
03:10:29Demosyeah eventually
03:11:53*darkf quit (Read error: Connection reset by peer)
03:12:19*darkf joined #nimrod
03:12:38EXetoCwhat's tmpl?
03:12:58OrionPKhttps://github.com/onionhammer/onion-nimrod/tree/master/templates
03:16:59OrionPKmore specifically https://github.com/onionhammer/onion-nimrod/blob/master/templates/tests.nim
03:26:21*Varriount joined #nimrod
03:34:08VarriountAraq, dom96, ping
03:44:17OrionPKbit late for them methinks
03:45:20VarriountRats
03:45:47VarriountOrionPK, nimrod is failing to boot
03:45:56VarriountThus, the builders are failing
03:46:09OrionPK:s
03:46:15Varriountc:\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:17OrionPKguess it'll have to wait :O
03:50:33*Varriount panics even more
03:51:49OrionPKi am so frigggin tired
03:51:57OrionPKi 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:17BitPuffinde herro
12:35:56dom96hallo
13:20:07BitPuffindom96: aren't you supposed to be on prom?
13:20:21dom96not yet
13:20:26dom96I leave in a couple of hoursd
13:20:28dom96*hours
13:20:39dom96But actually I need to leave now to get ready :P
13:20:40dom96bbl
13:21:34*girvo joined #nimrod
13:22:38BitPuffinlawl
13:22:40BitPuffingood 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:26dom96back briefly
13:42:34dom96hello Araq_
13:42:38Araq_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:16NimBotAraq/Nimrod devel 692e478 Zahary Karadjov [+0 ±5 -0]: fixed #597
16:57:58*io2 joined #nimrod
17:07:17OrionPKfinally figured out a way I can make this work dom96
17:07:27OrionPKhttps://gist.github.com/onionhammer/8222475
17:08:09OrionPKeverything should get written out to a socket in the correct order w/ that
17:08:41OrionPKand it's not TOO ugly (at least with working syntax highlighting)
17:24:11*Demos joined #nimrod
17:27:02VarriountAraq, dom96, ping
17:32:24*ddl_smurf quit (Quit: ddl_smurf)
17:47:09AraqVarriount: pong. I got your message about bootstrapping not working anymore for win64
17:47:37VarriountAnd win32
17:47:50Araqmaster or devel?
17:48:00AraqI'm working on win32 all the time ...
17:48:02Araqon devel
17:48:11VarriountMaster, or whatever the builder checks out
17:49:02Araqthe builder checks out whatever has been pushed to
17:50:09*BitPuffin quit (Ping timeout: 245 seconds)
17:50:44VarriountAraq: Ah. Looking at the console logs, it appears that the 'devel' branch is what is failing to build
17:51:00Araqblame zahary then :-)
17:51:05Araqhe merged lots of stuff
17:54:13VarriountAraq, 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:47Araqenums rule
17:59:39VarriountAraq, 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:06Araqlol well
18:03:49Araq 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:48gradhaOrionPK: 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:06OrionPKlets cross that bridge when we come to it
19:41:38gradhalol, i'm wading right now there, changing the HTML
19:43:37gradhaat least add docgen.txt to web/nimrod.ini so it gets built
20:02:16OrionPKoop you must not have put that in the last PR comments
20:09:20gradhaAraq: given a PNode for a parameter with default value, is there any way to extract the type?
20:09:39Araqn.typ ?
20:10:11VarriountAraq, I have interesting news regarding removeDir
20:10:46Araqhow can removeDir be interesting? but go on please
20:11:17gradha<fansworth>I have good news regarding removeDir!</fansworth>
20:11:40Araqhmm Futurama?
20:11:52VarriountAraq: I reimplemented removeDir using a non-recursive implementation, and did a quick profiling of both the original and new implementations
20:11:56gradhayep, looks like I missed an 'r'
20:12:27gradhadon't you love that fictional characters get a wikipedia page but programming languages don't?
20:12:54Araqwikipedia is absurd anyway, can't take it serious
20:13:19Araqjust look at articles about politicians to know what I mean
20:13:19VarriountAraq, 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:43AraqVarriount: how does that work?
20:14:00Araqbut hmm
20:14:10Araqno, don't get it
20:14:12VarriountI 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:30Araqinteresting benchmark :P
20:15:16Araqhow did you make it non-recursive?
20:15:20gradhaVarriount: did you try fat16?
20:15:25Araqlike I did with an explicit stack?
20:15:37Araqor by using some other win API?
20:16:32VarriountAraq, yes
20:16:39Varriountan explicit stack.
20:16:41VarriountOne moment
20:16:43VarriountOld Implementation: Peak Private Bytes - 2560, Peak Working Set - 8144, Peak Handle Count - 187
20:16:55VarriountNew Implementation: Peak Private Bytes - 1016, Peak Working Set - 2396, Peak Handle Count - 9
20:19:29Araqhow does that work?
20:19:44VarriountAraq, how does what work?
20:20:06Araqwhy does it use fewer handles? we don't free any handle
20:20:11gradhaAraq: I'm in docgen phase, the only info I have in the PNode is 'type = nil, s = "false"' + line/col
20:20:12VarriountHeres the implementations, for comparison - https://gist.github.com/Varriount/8226008
20:21:21VarriountAraq, the recursive implementation keeps the handle to whatever directory it is currently deleting open, even when it is deleting a child directory
20:22:31Araqok
20:22:43VarriountSo peak handle usage is, at minimum, equal to the deepest sub directory path
20:23:41VarriountShould I go on explaining?
20:23:47Araqno lol
20:24:07VarriountOk. I only ask because I tend to rample on.
20:24:53VarriountAraq, 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:17VarriountNew Implementation Time - 4.9569999999999999e+000
20:26:17VarriountOld Implementation Time - 4.8239999999999998e+000
20:26:29Araqyeah yeah yeah
20:26:36Varriount:P
20:26:37Araqwe'll take it
20:29:32gradhaAraq: is there a magic proc which turns the string "false" into a typ object?
20:30:51Araqgradha: when you're in doc2 you have the type information
20:31:55gradhawill doc2 prevail and cut off doc's head at some point?
20:32:12Araqyeah
20:46:25OrionPKjebus. just rendered my page 100, 000 times in a quarter of a second
20:52:17shevywas it an empty page
20:57:57OrionPKnearly
20:58:25OrionPKjust some header/footer, generic greeting, a css include
20:58:41OrionPKwhen I render a real page it's 0.9850 milliseconds per iteration.
20:59:12OrionPKso about 98 seconds for 100,000 iterations
20:59:51OrionPKand I havent even done the straight-to-socket optimization yet :)
21:25:02*ddl_smurf joined #nimrod
21:29:19OrionPKdom96 sendheaders sucks :P
21:30:37gradhadom96: you need to start tweeting pictures of honey badgers
21:30:43OrionPKshould take an openarray of tuple[string,strnig] instead of a PStringTable
21:33:15gradhahttps://www.honeybadger.io
21:49:20EXetoCVarriount: nice, you managed to output readable float exponents :p
21:59:24VarriountEXetoC, erm, that's the default behavior
22:00:12VarriountEXetoC, all I did was "echo "CPU time [s] ", cpuTime() - t0" (t0 is a previosly captured cpuTime())
22:03:58VarriountEXetoC, are you running Linux at the moment, and in a position to test something as root user?
22:04:40EXetoCyeah and it's fine for some ranges at least :>
22:04:41EXetoCyes
22:05:40EXetoCany non-virus will do
22:06:03VarriountEXetoC, 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:58EXetoCok
22:16:52EXetoCVarriount: ./koch boot: "lib/pure/os.nim(415, 48) Error: expression 'S_IFLNK(res.st_mode)' cannot be called"
22:17:18EXetoCI think I re-compiled correctly, and that seems relevant
22:18:01VarriountEXetoC, you're running as root? And you have access to the posix headers?
22:18:49EXetoCwhat, even koch?
22:19:39VarriountYou shouldn't need to run koch, just checkout the branch and run the test program.
22:19:50VarriountAlthough, why koch boot won't work, I don't know...
22:20:30VarriountThe 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:31EXetoCVarriount: ok, same error
22:20:55EXetoCas root. I should have the posix headers but let me check
22:22:00*joelmo quit (Ping timeout: 252 seconds)
22:22:01EXetoCI have unistd.h, so the others ought to be present
22:26:08Araqwer weniger schläft ist länger wach
22:26:25shevylol
22:26:37gradhaso you are in release mode?
22:27:51*NimBot joined #nimrod
22:29:12EXetoCVarriount: "lib/pure/os.nim(1219, 11) Error: type mismatch: got (TPathComponent) but expected 'TPathKinds'"
22:29:12EXetoCok let's see
22:29:32EXetoCpc -> pk?
22:29:52VarriountGah. *bangs head*
22:30:12VarriountEXetoC, one moment. Lemme change some stuff on my branch
22:32:14VarriountEXetoC, ok, re-pull the linkprocs branch and try again
22:33:29gradhaI 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:56gradhatried passing a const value but it still complaints
22:36:56Varriountgradha, "complains"?
22:36:56EXetoCVarriount: same error as when I made it compile myself: "Error: unhandled exception: UnixToNativePath(iPath) == oPath [EAssertionFailed]". line 88, line 40
22:36:58gradhaVarriount: Error: ambiguous call; both ma.t1(a: int) and ma.t1(a: var int) match for: (int literal(3))
22:37:16Varriountgradha, maybe you *can't*?
22:37:16gradhabut why allow the overload?
22:37:57gradhaI'm also passing a const, so presumably it should not be able to modify it as a var
22:38:20gradhayes, if I remove one proc then it correctly says a var type needs a variable
22:38:39VarriountEXetoC, what does it say is the input, output, and expected results?
22:39:17EXetoCVarriount: ah :-) "Input: /user/tester/nimrod -> Output: /user/tester/nimrod -> Expected: /usr/tester/nimrod"
22:39:20EXetoCjust a typo yeah?
22:40:42Varriountyeah. Blame me and my familiarity with windows.
22:40:59Araqgradha: overloading by var is not supported but you can work around with AST based overloading
22:40:59Araq (var T){lvalue}
22:41:01VarriountEXetoC, 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:44EXetoCok. haven't seen any yet
22:43:20VarriountFilesystem based tests are very.. finicky. >_<
22:50:46AraqI need a new type qualifier. I called it "protected". any objections?
22:50:46Araqit means the value is protected by a lock
22:51:06gradhalocked is too obvious?
22:51:06AraqI guess it's confusing for the people coming from OO languages
22:51:06VarriountAraq, explain?
22:51:46Araqgradha: "locked" is a bit off though, it needs to be locked for access, it is not constantly locked
22:52:07Araqvar x: protected ptr int
22:52:20gradhaserial, from serial access
22:52:20gradhaor better, seq
22:52:27gradhasequential access
22:52:41Araqecho x[] # invalid
22:52:41Araqlock x:
22:52:41VarriountHow about "readonly"?
22:53:07Araq echo x[] # valid
22:53:07Araq"readonly" is completely different
22:53:28gradhareadonly sounds more like immutable
22:53:28Araq"serial" is ... meh
22:53:48Varriount"hide"? "cover"? "sequester"?
22:54:08Araqwell it IS protected, so why not call it that way?
22:55:09VarriountAraq, just a warning: if you use 'protected', you're going to confuse every hard-core OO programmer (essentially, any java junkie)
22:55:30Demoswhat about volitile?
22:55:30Araq"shielded"?
22:55:30Araq"volatile" is different
22:55:49VarriountI like "shield"
22:55:49Demosdoes nimrod already have volatile? does it translate to c's concept of volitile
22:56:10AraqDemos: as a pragma yes
22:56:10Varriount"disbar"?
22:57:11VarriountIdeally, you want something 7 letters or less. Any longer and you take up valuable line space
22:57:12Araqtrue
22:57:19Araqwell no
22:57:31Araqit's a rare keyword
22:57:34*JehanII joined #nimrod
22:57:37Varriount"closed"?
22:57:50Araqhi JehanII welcome
22:57:55Varriount"aloof"?
22:58:32VarriountAraq, how about "sealed"?
22:58:52Araqc# uses "sealed" for "final"
23:00:51*zielmicha-cloud quit (Ping timeout: 245 seconds)
23:01:34gradharlock, read lock
23:01:42gradhaplus it rhymes with sherlock
23:02:16gradhabut in a pirate kind of way
23:02:34VarriountWell, I like the sound of "shielded", but as far as communicating meaning goes, "locked" and "protected" are a bit better.
23:02:57ponce__how about "synced"
23:04:20*zielmicha-cloud_ joined #nimrod
23:04:33*JehanII quit ()
23:06:44*JehanII joined #nimrod
23:07:16JehanIIHmm, I think this is what happens when one hasn't used IRC in over a decade. :)
23:07:59VarriountJust 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:20AraqJehanII: still reading your email, many thanks for all the literature I now have to read ... :-)
23:12:22JehanIIAraq: 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:20Araqwell I spent the evening with ftp://ftp-sop.inria.fr/mimosa/personnel/gbo/adfsfsmc.pdf
23:13:43Araqand 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:05JehanIII'm not familiar with the paper, and anything with type theory stuff in it is usually twice as dense as necessary. :)
23:16:42JehanIIDeadlock avoidance, in the end, comes down to one of two things: Avoiding cycles in the wait-for graph or breaking them.
23:17:03JehanIIAnd there are only a few fundamentally different ways to go about that.
23:17:43JehanIIThe 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:38VarriountEXetoC, ping
23:27:46AraqJehanII: 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:12Araqlock a: foo(a)
23:28:12Araqlock b: bar(b)
23:28:37Araqwas written when the semeantics need to be:
23:28:53Araqlock a, b:
23:28:53Araq foo(a)
23:28:53Araq bar(b)
23:29:13JehanIIYup. That's a general race, though, not a data race.
23:29:33JehanIIData races are especially bad, because, well totally undefined behavior.
23:29:51Araqyeah but all the type system can do is to ensure I don't forget the 'lock a' entirely
23:29:56JehanIIGeneral races lead to non-determinism. Which sucks, too, but is less bad.
23:30:14JehanIITrust me, that's important enough.
23:30:14Araqso that's what I like to accomplish
23:30:34JehanIII spent the past four years parallelizing a computational algebra system.
23:30:34Araqwith the simplest mechanism possible
23:30:34JehanIIWithout that safeguard, I think I'd have lost my mind halfway through. :)
23:31:15JehanIIThat sounds perfectly reasonable.
23:31:35Araqyay :-)
23:32:15JehanIIDigression: 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:56JehanIISee Owicki and Gries's parallel variant of the Hoare calculus.
23:33:04JehanIITo identify one thread interfering with another under their model, you require annotation with pre- and postconditions.
23:33:36JehanIIWhich means that the general problem is pretty hard.
23:33:57JehanIIYou'd have to add a lot of stuff to any programming language to solve it.
23:37:08JehanIIThat 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:59JehanIIAnd having an obvious visual marker in the source for such code.
23:37:59Araqwell 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:19JehanIIThat 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:35VarriountIf only this were a gordian knot that could be sliced through.
23:39:31JehanIIHmm. How do you go from a shared to a protected ptr?
23:39:31*DAddYE quit ()
23:39:40Araqthings like protected ptr tuple [L: Lock, data: int, next: shared ptr ...] are valid though
23:40:15EXetoCVarriount: ya
23:40:15Araqand the semantics are that L protects the stuff "next" points to too
23:40:18VarriountEXetoC, did the test run successfully?
23:40:43JehanIIVarriount: It's only been an unsolved problem for about forty years. :)
23:41:42Araqbut to access protected[].next you need to acquire L obviously so things are not too bad
23:42:12JehanIII'm still not quite sure I'm following you?
23:42:26JehanIII.e., what does a separate `protected` type buy you?
23:42:42Araqhow I go from shared to protected is not entirely clear yet :P
23:43:03JehanIIDoes a lock implicitly promote a shared ptr to a protected ptr?
23:43:03*psquid joined #nimrod
23:43:03JehanIIAh, okay. :)
23:43:03Araqno the opposite
23:43:16JehanIIGotcha.
23:43:28Araqa lock promotes a protected ptr to a shared ptr
23:43:38Araqthe "shared" is rather meaningless, it only helps that you use allocShared/deallocShared
23:43:45Araqand not alloc/dealloc
23:44:44JehanIISo, 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:44EXetoCVarriount: "Error: unhandled exception: Not a directory [EOS]". line 89, 83
23:44:44EXetoCif I correct that typo
23:45:23Araqno it cannot be deferenced (sorry in my article that was called "shared")
23:45:23JehanIIEh, something that "points to" rather than "is on".
23:45:47Araqyou need to lock it and then deref is allowed
23:46:05*DAddYE joined #nimrod
23:46:45JehanIIOkay, I think I understand now.
23:47:06Araqso a protected ptr points to the shared heap, yes
23:47:15Araqthe spawn/createThread primitive ensures that passed arguments are "protected"
23:47:37Araqor rather that the thread proc only takes protected ptrs or simple values
23:48:31Araqthreads can access globals but these need to be protected ptrs too then
23:49:08Araqthis is easily enforced with some effect tracking
23:50:15Araqconstruction causes some problems though:
23:50:19JehanIISo, what are shared ptrs then? Basically a version of protected ptrs without any guarantees?
23:51:29Araqthat'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:29JehanIIIf it helps, the requirement that global variables point to protected data is essentially what I did in my last project, too.
23:51:36JehanII(Only as a rule, was a dynamically typed language, so it couldn't be enforced.)
23:52:16Araq"shared ptr" is rather unimportant, we might as well use "ptr"
23:52:50Araqok now the problem is that for construction this happens:
23:53:11Araqproc createFoo(): shared ptr Foo = ...
23:53:30Araqvar global: protected ptr Foo = createFoo() # should be valid
23:54:31Araqbut I don't know whether assignments from shared to protected are safe in general
23:54:43JehanIII don't see the problem?
23:55:12AraqI guess they are
23:55:12Araqbecause the protection refers to the memory that's pointed to
23:55:12Araqand not to the pointer itself
23:55:12JehanIIOh, right, missed the shared vs protected.
23:55:52JehanIIWhy not have createFoo() return a protected ptr Foo?
23:56:32Araqbecause then you need to do:
23:56:53Araqproc createFoo(): protected ptr Foo =
23:56:53Araq result = allocshared(...)
23:57:19Araq result.data = 33 # oops
23:57:34Araq result.lock = createLock()
23:57:34*io2 quit (Ping timeout: 260 seconds)
23:57:34Araq lock result: result.data = 33 # that's valid but stupid
23:57:43*zielmicha quit (Ping timeout: 246 seconds)
23:58:19AraqI guess you can make construction a single expr and thus avoid this problem
23:58:22JehanIIThere are a couple of things that you could look at.
23:59:01JehanIIOne is to automatically insert a lock after an assignment to result.
23:59:35Araqwait .. what?