<< 12-02-2016 >>

00:03:10ldleworkdom96: also, are there any other options?
00:03:41Araqldlework: seems to be tricky support -.- but it surely does count as a bug
00:04:52*allan0 quit (Ping timeout: 248 seconds)
00:05:00ldleworkIt allows me to do exactly what the method version is doing without the methods, I think.
00:05:09*allan0 joined #nim
00:05:39ldleworkIf this would be possible then library extension isn't so bad actually.
00:05:46ldleworkfilcuc: agree?
00:07:30filcucldlework: probably i've to see if i can adapt it to my use case
00:08:16*Dildosan quit (Quit: Leaving)
00:08:49filwitAraq: will you keep the existing non-incremental cycle-scanner around? Or is the new design theoretically better all around?
00:08:58filwitAraq: ^ about the new GC
00:09:02filcucldlework: from what i see concepts are fine for behaviour
00:09:19ldleworkfilcuc: you can even specify field constraints too I think
00:11:15*filippo joined #nim
00:11:19filwitAraq: ie, is there some trade in memory/throughput you're making with the new GC that may be significant enough to where people would want the current solution of the new design for some applications?
00:11:20*filippo is now known as filcuc_
00:11:44filcuc_[01:07] <filcuc> ldlework: from what i see concepts are fine for behaviour
00:11:46filcuc_[01:08] <filcuc> ldlework: but they don't serve me well for enforcing initialization
00:11:47filcuc_[01:08] <filcuc> ldlework: but i think that my use case can be worked around as i explained to you early
00:15:08*filcuc quit (Ping timeout: 240 seconds)
00:15:08*brson quit (Ping timeout: 240 seconds)
00:15:08*M-Quora quit (Ping timeout: 240 seconds)
00:15:08*dyce quit (Ping timeout: 240 seconds)
00:15:14*M-max joined #nim
00:16:04*brson joined #nim
00:16:18*dyce_ joined #nim
00:18:16filcuc_gn
00:18:44*filcuc_ quit (Quit: Konversation terminated!)
00:18:54*yglukhov joined #nim
00:24:16*yglukhov quit (Remote host closed the connection)
00:25:16Araqfilwit: once gc:v2 works, the old GC will be removed
00:26:14filwitAraq: k. BTW have to done any initial benchmarks to compare them, or are you still just working on getting the kinks out.
00:27:01filwitAraq: the only reason I ask is because I quickly read the tri-color wiki explanation, and it sounded like it would be using more memory.. so just curious
00:27:43Araqit will be faster, if I can even get it to work reliably
00:39:44gokrI tried GCv2 in Ni, it was a bit faster, IIRC 10-15%.
00:39:54gokrFor a silly benchmark.
00:40:29gokrWhich of course says nothing - but it *was* faster.
00:41:21gokrAraq: Finally got something that actually works. But.. I had to go gc:none, which of course is not funny.
00:42:47gokrSince I am completely stupid on this level - when a function is called in another object (stdlib_system.o), does that trigger something else to happen in that module? Can't really understand why I couldn't even call the empty systemDatInit000.
00:53:28*derka quit (Quit: derka)
00:54:36*desophos quit (Read error: Connection reset by peer)
00:54:45*M-Quora joined #nim
00:56:35*M-max quit (Quit: node-irc says goodbye)
01:00:24Araqgokr: no, it's just as confusing to me
01:00:56gokrI wonder if it has to do with... link.ld etc, lots of stuff here that I have no idea what it is.
01:01:22gokrTried markAndSweep, same result.
01:01:53*sarlalian quit (Quit: WeeChat 0.4.2)
01:02:58*sarlalian joined #nim
01:04:27Araqit seems to have something to do with the GC's initialization
01:04:46AraqmarkAndSweep uses the same initialization
01:05:20gokryeah
01:05:40*jaco60 quit (Ping timeout: 252 seconds)
01:07:24*saml_ joined #nim
01:41:34dyce_is there an observer pattern for nim like ReactiveX?
01:42:51ldleworkno do you think you'll make one?
01:43:08dyce_once i become an expert, sure :D
02:19:26*dashed joined #nim
02:27:40*gokr quit (Ping timeout: 256 seconds)
02:41:49*Demon_Fox quit (Quit: Leaving)
03:05:35*brson quit (Ping timeout: 264 seconds)
03:38:10*namra joined #nim
03:39:55*ephja quit (Ping timeout: 240 seconds)
03:48:54*desophos joined #nim
04:12:13*filwit quit (Quit: Leaving)
04:24:33*saml_ quit (Remote host closed the connection)
04:35:02*dmitry_p joined #nim
04:51:56*lompik quit (Ping timeout: 240 seconds)
05:04:03*endragor joined #nim
05:07:06*Demon_Fox joined #nim
05:07:34*darkf quit (Read error: Connection reset by peer)
05:08:26*jsudlow quit (Read error: Connection reset by peer)
05:09:03*darkf joined #nim
05:09:30*jackv quit (Ping timeout: 252 seconds)
05:09:37*zxtx quit (Read error: Connection reset by peer)
05:09:51*jackv joined #nim
05:10:02*zxtx joined #nim
05:10:16*jsudlow joined #nim
05:10:35*StarBrilliant quit (Ping timeout: 240 seconds)
05:10:55*Xe quit (Ping timeout: 240 seconds)
05:11:40*Xe joined #nim
05:12:50*StarBrilliant joined #nim
05:16:40*silven quit (Ping timeout: 250 seconds)
05:17:02*silven joined #nim
05:22:32*s4 joined #nim
05:25:01*yglukhov joined #nim
05:30:22*yglukhov quit (Remote host closed the connection)
06:00:23*dashed quit (Quit: Connection closed for inactivity)
06:18:35*BitPuffin|osx quit (Ping timeout: 240 seconds)
06:32:18*ephja joined #nim
06:39:06*onionhammer quit (Ping timeout: 240 seconds)
06:49:01*gokr joined #nim
06:49:14*gokr quit (Client Quit)
06:51:10*toaoMgeorge quit (Ping timeout: 256 seconds)
07:05:20ldleworkhttps://gist.github.com/dustinlacewell/a1194610e036434ad888
07:07:07*onionhammer joined #nim
07:32:18*Varriount joined #nim
07:35:48*Varriount_ quit (Ping timeout: 272 seconds)
07:42:46*endragor quit (Remote host closed the connection)
08:01:07ldleworkI kinda seems like closures are slow...
08:02:28*endragor joined #nim
08:05:49ldleworkI remember the reason that I ported from Javascript was because I could not generate simple random tiles as fast as I could scroll the camera
08:06:07ldleworkBut it seems I'm getting about the same performance
08:06:14ldleworkI wonder if I'm doing something overtly inefficient
08:06:23ldleworkI mean, other than calling a user closure for each tile on the screen
08:07:45ldleworkI would think that native code could call a couple functions a few dozen times a frame
08:17:47*gokr joined #nim
08:18:32*Trustable joined #nim
08:49:02*Demon_Fox quit (Read error: Connection reset by peer)
08:49:20*Demon_Fox joined #nim
08:50:59*darkf quit (Quit: Leaving)
09:20:01*jaco60 joined #nim
09:20:14*coffeepot joined #nim
09:21:32*s4 quit (Remote host closed the connection)
09:22:17*s4 joined #nim
09:50:22*toaoMgeorge joined #nim
09:58:24*desophos quit (Read error: Connection reset by peer)
10:19:50*Demon_Fox quit (Quit: Leaving)
10:27:46*toaoMgeorge quit (Ping timeout: 240 seconds)
10:29:36*toaoMgeorge joined #nim
10:31:56*s4 quit (Remote host closed the connection)
10:33:53endragorIs there a way to simulate multiple inheritance when interfacing with C++? `of` works well when the class inherits single other class, but it doesn't allow to specify multiple classes.
10:35:18*s4 joined #nim
10:36:11Araqendragor: you can use a converter to tell Nim about the additional subtyping
10:37:33endragorAraq: that should work. thanks!
11:32:36Varriountldlework: Time for a profiler?
11:35:02Varriountldlework: Looking at the snippet you posted, a fair amount of string copying is going on. Have you marked them as shallow?
12:03:05*dmitry_p quit (Remote host closed the connection)
12:30:56*toaoMgeorge quit (Ping timeout: 272 seconds)
12:31:09*lompik joined #nim
12:31:18*nthxw joined #nim
12:45:13*filwit joined #nim
12:48:15*toaoMgeorge joined #nim
13:14:07*saml joined #nim
13:22:05*s4 quit (Quit: Konversation terminated!)
13:41:46gokrhttps://github.com/gokr/ardunimo
13:42:04*exebook joined #nim
13:44:30filwitgokr: nice :)
13:45:21filwitgokr: btw, you probably can't turn the GC on due to memory limitations on those boards (depending on the boards you're testing with)
13:46:09*mahasamoot joined #nim
13:48:11*Dildosan joined #nim
13:48:30coffeepotNice, gokr :) I've been wonder what Nim would be like on an arduino!
13:48:55filwitgokr: my brother tried to get Nim working on his many various Audrino and micro-controller chips, but most have something like 1-2k memory (some much less, some much higher).. and Nim's allocator requires 4k min (cause it uses `mmap` to acquire memory from the system.. and that function either doesn't exist on these bare-metal boards, or requires more RAM then they have)
13:53:13gokrThe LinkIt One has 4Mb RAM and runs an ARM CPU, so Arduino is not just limited to the small Atmel chips etc.
13:53:46filwitOkay, so that's the board you're testing with?
13:53:59Araqgokr: --os:standalone without --gc:none has never been tested. I just remembered :-)
13:54:08gokr1-2k sounds very small - most current "small" ones have 32k RAM or similar I would say.
13:55:37Araqwhy do you use --os:standalone? does the device lack an OS? how does C++ and malloc work then?
13:55:40filwitgokr: yeah it's small, but there are a TON of chips out there (especially if you buy from China) that have >1k.. my brother has like 30 boards (literally) of various ranging RAM from ~200 bytes to 1Gb (Intel Edison)
13:55:56*krux02 joined #nim
13:56:20filwitgokr: not that you're trying to target all those, just saying..
13:59:20filwitAraq: some bare-metal embedded boards use their own C compilers which don't support malloc(), so you have to remake it yourself using sbrk()... that said, it seems gokr is not testing on boards like this, but I think most (if not all) Audrino devices are OS-less
14:00:03gokrfilwit: Yes, I have a LinkIt One, but.... we have most other boards here under the sun.
14:00:25gokrAraq: standalone... good question. I don't remember :)
14:00:49gokrPerhaps ... that was the damn issue.
14:01:59gokrThere is no specific reason for the LinkIt - other than the simple fact that it has all communications you want (GSM/GPRS, Wifi, BLE).
14:03:50gokrAraq: stdlib_system.cpp:8:22: fatal error: sys/mman.h: No such file or directory
14:04:01gokr(if I drop standalone and enable the gc)
14:10:37*Arrrr joined #nim
14:17:12Araqedit alloc.nim and implement osAllocPages via malloc()
14:18:34*nsf quit (Quit: WeeChat 1.4)
14:20:44*Arrrr quit (Ping timeout: 276 seconds)
14:20:44*Arrrrr joined #nim
14:22:59gokrOk? :)
14:24:30*Sornaensis quit (Max SendQ exceeded)
14:24:46*Sornaensis joined #nim
14:25:12*Sornaensis quit (Max SendQ exceeded)
14:25:27filwitgokr: mmap (which is what requires mman.h) does not exist on Audrino and is what Nim's alloc.osAllocPage() uses to allocate memory on the system.. so just replace the mmap() with malloc() and that's all you might need to do to get the GC running..
14:25:45*Sornaensis joined #nim
14:28:46gokrGot it.
14:32:01*def- quit (Quit: -)
14:32:21Araqactually you also need to mask the pointer so it's aligned on a page boundary
14:32:53*def- joined #nim
14:34:20filwitacademic question: why does Nim need the memory to be aligned to a page?.. I understand why it would need a specific page size, but how would the alignment mess anything up?
14:35:18*filcuc joined #nim
14:36:07filwitah.. right cause the GC uses the memory regions + type-bit-pattern to determine if the reference is live in O(1) time... so a mis-aligned memory region might mess that up?
14:36:46filwitthat still doesn't quite make sense to me, but my knowledge of memory management at this level of operating systems is very thin..
14:42:13coffeepotaccessing unaligned primitives is hugely expensive for the CPU (as it has to fetch both pages) and buggers up atomic read/writes for eg ints. I'd imagine ensuring the memory is aligned to a page ameliorates this somewhat
14:42:58filwitoh wait, I see.. cause the pointer address would indicate it's offset within the page... so Nim's GC doesn't record some page address offset.. it simply uses the ptr address's page offset + typeDesc bit-pattern to determine if the reference is live
14:43:04coffeepot* accessing unaligned primatives across page boundaries, I meant
14:43:28filwitcoffeepot: sure, there's the performance concern, but I wasn't thinking about that so much as functionality
14:44:05gokrAraq: I just removed that staticlib option and it works fine. So ... you can do what you wish with that PR, probably nuke it.
14:44:31Araqyeah, sorry, but it will only mislead people
14:44:34coffeepotalso if two threads read & write to a misaligned int, they might get 1/2 data from each write
14:45:51gokrAraq: No, its fine. I ... just find all these different pragmas and their various combinations etc confusing.
14:48:34*mahasamoot quit (Ping timeout: 240 seconds)
15:05:04*tt joined #nim
15:05:27*tt is now known as Guest62289
15:07:31*BitPuffin joined #nim
15:13:33*ga2arch joined #nim
15:16:37ga2archhi, i'm using allocShared0 to allocated a ptr to an HashSet[int64], i'm worried about what happens when i insert more elements than it can contains, it should enlarge itself, but is it safe when using allocShared ?
15:25:24*namra quit (Quit: WeeChat 1.4)
15:25:45*ga2arch quit (Ping timeout: 252 seconds)
15:31:14*Guest62289 quit (Quit: Page closed)
15:38:45*Jesin joined #nim
15:43:34*nsf joined #nim
15:46:52*trusion quit (Quit: Leaving)
15:50:33*endragor quit (Remote host closed the connection)
15:52:58*gokr quit (Quit: Leaving.)
16:12:56*mahasamoot joined #nim
16:21:24*pregressive joined #nim
16:23:23*skyfex joined #nim
16:37:56*Arrrr joined #nim
16:37:56*Arrrrr quit (Ping timeout: 240 seconds)
16:49:29*skyfex quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:51:28*endragor joined #nim
16:55:20*desophos joined #nim
16:57:34*endragor quit (Ping timeout: 272 seconds)
17:05:26*mahasamoot quit (Ping timeout: 256 seconds)
17:07:24*brson joined #nim
17:15:18ldleworkVarriount: I'm only experienced profiling Python programs. How do I do it in Nim?
17:17:33*spt joined #nim
17:18:11ldleworkAlso I can't find much information on how to mark individual strings as shallow.
17:20:02*Dildosan quit (Quit: Leaving)
17:22:03sptHello all. I want put library .so in directory with compiled nim file. And if I run it - message "could not load .so". Just don't see lib in same folder.
17:25:32*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
17:26:09*nsf quit (Quit: WeeChat 1.4)
17:28:47*filcuc quit (Read error: Connection reset by peer)
17:30:51ldleworkVarriount: Whenever you're around I would love to talk to you about performance.
17:37:01Araqspt: welcome to Unix.
17:39:43*ics joined #nim
17:40:11sptAraq, and how I can use own library?
17:43:48*spt quit (Quit: Page closed)
17:48:52def-ldlework: I compile with --profiler:native and use callgrind
17:50:10*krux02 quit (Quit: Verlassend)
17:53:31*endragor joined #nim
17:57:56*endragor quit (Ping timeout: 248 seconds)
17:58:06federico3ldlework: look at the profiler docs
17:58:26ldleworkVarriount said I was doing lots of string copying in this snippet: https://gist.github.com/dustinlacewell/a1194610e036434ad888
17:58:35ldleworkcan anyone tell me how I make the strings in this example shallow?
18:07:46filwitAraq: way to not actually help the guy out and just use his question as an opportunity to complain about Unix when in reality the solution is to simply add a "./" prefix or something to the path..
18:08:39def-filwit: yeah, wanted to tell him that as well but the guy was already gone :/
18:09:14def-LD_LIBRARY_PATH, in case anyone wonders
18:15:04filwitdef: now you don't have to modify the actual environment PATH.. the solution is much more straight forward (simply add "./" to whatever name you where trying).. There's barely any difference between how Unix does it and how Windows does it
18:15:07filwitno*
18:17:32AraqI did help him. it's not a Nim specific problem, it's a Unix problem.
18:19:47filwitno you didn't.. he asked you directly "how can I..." (obviously he was confused about your response) and you did not give him any more indication as to what you originally meant.. That's not helping someone figure out a problem they're having, more than likely you just gave this guy the message that the community either doesn't care about Unix or doesn't really care to help out people.
18:21:58filwitI mean, he did just kinda leave quickly after that, and had he stuck around for a bit longer I someone would have answered his questions in more details.. but that might in itself be and indication that he felt your response was too curt and that his question was unwanted.
18:29:02Araqwell I was away afterwards it's not like I wouldn't helped him any further
18:29:20Araq*wouldn't have helped
18:30:46Araqand the channel is logged anyway with a bit of luck spt will read what you wrote.
18:31:48filwityeah, sorry if my post sounds too accusatory.. I don't mean to get on your case over something silly like this, and I realize it's not like your life revolves around answering questions here or that you shouldn't respond a certain way on your own IRC channel..
18:33:16*mahasamoot joined #nim
18:33:49*endragor joined #nim
18:36:02filwitbbl
18:38:22*endragor quit (Ping timeout: 256 seconds)
18:43:52*yglukhov joined #nim
18:45:33*Jesin quit (Quit: Leaving)
18:47:05*Jesin joined #nim
18:48:52*Matthias247 joined #nim
18:53:44*darkf joined #nim
19:08:35*BitPuffin quit (Ping timeout: 240 seconds)
19:09:45*pregressive quit (Read error: Connection reset by peer)
19:09:52*pregress_ joined #nim
19:11:26*yglukhov quit (Remote host closed the connection)
19:12:47*mahasamoot quit (Ping timeout: 264 seconds)
19:14:41Varriountldlework: Strings copy on assignment
19:16:35Varriountldlework: So, in your snippet, each the generator is run, a new string is created.
19:18:36Varriountldlework: You can mark a string as shallow with the shallow(s: string) procedure. Keep in mind that this causes the string to be unmodifiable.
19:21:38*Trustable quit (Read error: Connection reset by peer)
19:24:37*nsf joined #nim
19:25:08*Trustable joined #nim
19:25:39*yglukhov joined #nim
19:29:17*mahasamoot joined #nim
19:30:05*Trustable quit (Quit: Leaving)
19:30:15*Trustable joined #nim
19:45:26*BitPuffin joined #nim
19:55:08yglukhovhi all. tricky question. i've got a nakefile which is normally compiled by nake in a mode without any optimizations, because it doesnt really make a lot of sense to optimize anything in a nakefile. now i want to call some really cpu intensive stuff from a nakefile. can i import a module somehow and say it should always be "imported" with maximum optimization/no checks/etc?
19:57:20*yglukhov quit (Remote host closed the connection)
20:04:44*BitPuffin quit (Read error: Connection reset by peer)
20:06:18*mahasamoot quit (Ping timeout: 272 seconds)
20:12:08*mahasamoot joined #nim
20:13:41*mat4 joined #nim
20:13:48mat4hello
20:14:01Arrrrhi
20:14:04*Arrrr quit (Quit: WeeChat 1.2)
20:14:17mat4hi Arrrr
20:19:32*mahasamoot quit (Ping timeout: 276 seconds)
20:31:54*yglukhov joined #nim
20:38:27*gokr joined #nim
20:40:31*mahasamoot joined #nim
20:47:49*filcuc joined #nim
20:51:40*gokr quit (Read error: Connection reset by peer)
20:51:56*gokr joined #nim
20:54:22*mahasamoot quit (Ping timeout: 256 seconds)
21:01:10mat4hi gokr
21:01:19gokrhey :)
21:01:45mat4just see you uploaded your Arduino wrapper, nice work
21:02:02gokrYeah, I am... rigging a Vagrantfile right now so that you can easily get going.
21:02:29gokrHoping to coax Andreas into helping out with alloc.nim - to make it use malloc instead of mmap.
21:02:33gokr:)
21:05:12mat4please take in mind, that the target MCU probably differentiate between data and Flash memory which likely mean there exist more than one malloc variant
21:05:45*ga2arch joined #nim
21:06:06ga2archhi, how i do i create a Table[int64, int64] on the shared heap using the boehm gc ?
21:06:57gokrmat4: ok
21:07:44gokrga2arch: What has the GC to do with it? (or am I missing something)
21:08:22mat4I don't think the GC is relevant for this task
21:08:51ga2archgokr: i have to share the table with two threads, so i opted for the boehm to not have to deal with manual memory management
21:09:50ga2archbut if i create it like i normally would and then spawn the thread the compiler tells me, Error: 'spawn' takes a GC safe call expression
21:10:14dom96ga2arch: You might want to consider using this module: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/sharedtables.nim
21:10:20dom96Although beware it is very new
21:11:21ga2archthat looks cool thanks, but i'm trying to understand the meaning of that message and nim in general
21:11:23*Varriount quit (Disconnected by services)
21:11:23*Varriount_ joined #nim
21:13:01dom96ga2arch: You cannot access a GC'd global variable from another thread. If you do then your procedure is not GC safe.
21:13:12*mahasamoot joined #nim
21:13:13gokrga2arch: Just wondering what Boehm specifically has to do with it.
21:13:33gokrDoes it behave in some specific way that differs from the normal GC?
21:13:41dom96By "GC'd" I mean "garbage collected", that includes types whose memory is managed by the GC such as string and seq.
21:14:52dom96gokr: I think that Boehm supports shared GC'd memory.
21:15:11gokrdom96: Ok, interesting.
21:15:13mat4ga2arch: If I remeber it correctly, there exist a pragma for excluding definations to be GC'd
21:15:18dom96Even if that is the case, I'm not sure if Nim will allow it.
21:15:36dom96ga2arch: You could try turning off the thread safety analysis using the --threadAnalysis:off flag
21:15:58gokrga2arch: Another idea is to let one thread own the table - and let the other threads talk to it in order to add/delete/read etc.
21:16:47ga2archgokr: i know but for the use of case i have right now it's overkill to use message passing
21:16:55ga2archdom96: gonna try that flag
21:17:19dom96ga2arch: keep in mind that your program may crash then
21:17:44ga2archdom96: with the flag off it works
21:17:45mat4if so, why not simply use cooperate multitasking ?
21:18:17ga2archmat4: what do you have in mind ?
21:20:17gokrdom96: That shared table looks simple and neat.
21:20:42dom96gokr: Araq wrote it so that async can use it
21:20:53mat4just implement your threads as 'coroutines'. This way all ressources are naturally shared and because such 'threads' control task switches there exist no possible access conflict
21:23:09ldleworkmat4: +1
21:23:18ga2archmat4: yes, i could that but it's still way more complex than a simple hashtable + lock, i'm not really looking into doing anything fancy, boehm gc + couple of locks
21:23:23ldleworkTwisted is my favorite networking library.
21:26:20*wuehlmaus quit (Quit: Lost terminal)
21:26:43*nsf quit (Quit: WeeChat 1.4)
21:27:13ga2archit doesn't feel right to disable threadAnalysis, what exactly does that flag do ?
21:27:17ga2archthe manual says "GC-safety checking" .. but in what ways ?
21:32:59gokrAFAIK it verifies that no shared memory is reachable via global variables etc.
21:33:52gokrThe obvious case being two threads both accessing a module level variable, thus stomping all over themselves. ;)
21:42:57Varriount_ldlework: How are the tiles going?
21:43:02*Varriount_ is now known as Varriount
21:43:04ldleworkVarriount_: been working
21:43:12ldleworkI mean at my job
21:43:54mat4ga2arch: sorry, found no progra for this
21:44:00mat4^pragma
21:44:15ga2archmat4: i was looking for it too, too bad, thanks anyways
21:44:22Varriountga2arch: You should be able to turn off thread analysis via a pragma as well. I don't know if you can do it on a module-level basis though.
21:51:48*Demon_Fox joined #nim
21:53:56ga2archhow can i correctly allocate and initialize a Table on the shared heap, with createShared / allocShared0 ?
21:54:46*mahasamoot quit (Ping timeout: 240 seconds)
21:56:26*mahasamoot joined #nim
21:58:43Varriountga2arch: Well, you can have the table object on the shared heap, but that won't do much. The table's data is stored in a sequence member.
21:59:06ga2archthat's what i was worried about
21:59:11ga2archlooking at the source code
22:00:27Varriountga2arch: You could always fork+modify the source.
22:02:06Varriountga2arch: However, I don't know if that will matter, since you're using the boehm gc?
22:02:42VarriountI mean, you should just be able to use a sequence from another thread - no need to allocate it on the shared heap.
22:03:17ga2archVarriount: let me write a simple snippet about what i'm trying to do, because it's getting confusing
22:06:27*gokr left #nim (#nim)
22:07:35ga2archVarriount: http://pastebin.com/vtt157MX
22:08:18ga2archVarriount: snippet.nim(19, 13) Error: 'spawn' takes a GC safe call expression
22:08:55ga2archVarriount: and i understand the error, but how can i fix my code ?
22:09:22*mahasamoot quit (Ping timeout: 240 seconds)
22:12:30*gokr joined #nim
22:13:29*BitPuffin|osx joined #nim
22:23:54Varriountga2arch: Uh, spawn is generally only meant for GC-correct stuff, if I recall correctly.
22:26:48Varriountga2arch: Adding the 'gcsafe' pragma to test along with turning thread analysis off makes the program compile.
22:27:11ga2archyes, without threadAnalysis it works
22:27:20ga2archdoesn't seem right tho
22:29:28Varriountga2arch: Have you considered passing a table to the procedure, rather than using a global?
22:31:04ga2archVarriount: yes, but in the program i'm developing i need to use the table from two different threads, so i can't pass it by value and by ref would not make things different i think(?) ?
22:32:55*Dildosan joined #nim
22:33:47Varriountga2arch: Sorry for yet another question, but is there a reason you're using spawn instead of a basic thread? http://nim-lang.org/docs/threads.html
22:35:32ga2archVarriount: thought it was something akin to Haskell's forkIO
22:36:11VarriountWell, spawn is for high level parallelism, not for manual stuff. Still, there should be a way to get this working...
22:40:04ephjahttp://nim-lang.org/docs/channels.html
22:40:28Varriountga2arch: Here is your secret, magical solution: https://gist.github.com/Varriount/b67a264a7139c900ba65
22:42:17Varriountga2arch: Spawn parameters need to be raw pointers if they are going to be mutated.
22:43:23*filcuc quit (Read error: Connection reset by peer)
22:43:29ga2archVarriount: i see, thanks a lot :) ... is this safe by any means ?
22:44:01ga2archas safe i mean, it's correctly GC'ed nd stuff ?
22:44:13Varriountga2arch: No idea. The extent of my threading experience has been mainly with Python (and some Java).
22:44:50Varriountga2arch: I think so though, as long as you don't modify the table to contain GC'd types, like strings.
22:45:11VarriountThough, again, use of the boehm gc should sort that problem out.
22:46:08ga2archi think probably the correct way to implement this "nim style" would be with a "store" thread and use channel to add del and retrieve stuff from the hashtable
22:46:21ga2archseems so much work for something so simple tho
22:47:13Varriountga2arch: Well, something to keep in mind is that however simple various abstractions make something seem, there's usually a whole lot going on behind the scenes.
22:47:52*mat4 quit (Quit: Verlassend)
22:48:10Varriountga2arch: If you want, use `objdump -d` and look at your function calls.
22:48:18ga2archVarriount: kinda scares me, because a lot of doc is missing, i should probably go read the source code to understand it better
22:48:29ga2archah right, didn't think about it
22:48:34Varriountga2arch: What documentation is missing?
22:48:46ga2archi mean about the internals
22:49:35ga2archhow stuff is implemented, like spawn for example, it's not really clear that it just offload a task to a thread in the threadpool
22:49:38Varriountga2arch: I'd start with the more complicated parts of the standard library before diving into the compiler. Try looking at some of the stuff in lib/system
22:50:52ga2archVarriount: will do :)
23:01:21*Demon_Fox quit (Quit: Leaving)
23:10:07VarriountBy the way, is anyone actually submitting anything to Hacker News? I haven't seen anything Nim-related on there in a while...
23:11:27*nsf joined #nim
23:18:11VarriountHello nsf
23:18:21nsfhello
23:20:37*shodan45 joined #nim
23:20:55*yglukhov quit (Remote host closed the connection)
23:21:11*gokr quit (Quit: Leaving.)
23:28:37*ga2arch quit (Quit: Page closed)
23:50:37*saml quit (Quit: Leaving)