<< 07-08-2014 >>

00:01:13VarriountAraq: Should I change the FileInfo object to a ref object?
00:03:38*Fr4n quit (Ping timeout: 260 seconds)
00:29:48bogenVarriount: well, it is not that simple. "echo 1,2,3,4" produces sprintf ("%s%s%s%s...
00:31:18bogenwhat is needed is a sprintf replacement (in C) that does not take a template string
00:32:40bogenonly takes the number of strings. Not the name we would go with, but something like: char *make_new_line_terminated_buffer (int n, ...);
00:34:34bogenor just: void writeln (int n, ...); It would be laid down once
00:42:23*Jehan_ quit (Quit: Leaving)
00:48:24bogenso, I can fix this, it would be with a function that is layed down once somewhere that genEcho generates a call too
00:48:54bogenit would take n followed by n string addresses and lengths
00:50:05def-bogen: i would like to see how that performs compared to printf
00:50:55bogenit would faster, because printf has to parse a bunch of stuff. I could write it up and compare it to sprintf.
00:51:26bogencomparing to printf is hard to time because the terminal output takes so long
00:51:38def-redirect the output?
00:51:56bogendef-: > /dev/null
00:52:01*Varriount idly wonders if os.nim would better off split into different modules
00:52:25bogenafter verifying that it does indeed output correctly on a small count
00:53:24bogendef-: yes, I will do that, I will compare the replacement to printf, in the way that printf is used by echo
00:53:51def-bogen: because to me printf, like it's used in nimrod, looks pretty fast
00:54:22def-i thought that puts could be faster, but it's not
00:54:29def-(actually slower)
00:54:59bogenyeah, the change I want to make is not to improve the echo speed, it is to fix echo stopping on nulls (and to not slow down echo by the fix)
00:56:29def-Right, makes sense
01:04:02*EXetoC quit (Quit: WeeChat 0.4.3)
01:13:03*Fr4n joined #nimrod
01:18:13*saml_ joined #nimrod
01:20:20*superfunc joined #nimrod
01:22:47*adoniscik quit (Ping timeout: 264 seconds)
01:29:54def-bogen: it shouldn't be used for cstrings though, because then they would need to get traversed twice everytime you print them
01:31:32bogendef-: no, it is not for cstrings. genEcho has the lengths available, it will pass address and length
01:31:52bogenplus, with cstrings it would fail, because I can't strlen them if there is a null
01:31:59bogenthe bug would not be fixed
01:33:22bogenmy function takes (N, addr1, len1, ..., addrN, lenN) // or only 1 address len, or even 0 address len
01:33:56bogenI have it written, I just need to compare it with printf and post the code/results
02:03:30bogenhttps://gist.github.com/dschauer/4e9a8294a923f9f2b4b0 "nimecho" takes roughly half the time as printf
02:10:52bogenand yes, it does work with embedded nuls. https://gist.github.com/dschauer/4e9a8294a923f9f2b4b0
02:11:03bogenhttps://gist.github.com/dschauer/4e9a8294a923f9f2b4b0/b06f851b221b9120f8b9dedb961149d8862c0509 has the time results
02:11:26bogenso, it is faster (not by much) and it displays nuls
02:17:15def-bogen: try with -O3, which nimrod uses for -d:release and it's even more impressive
02:17:34def-I get 3.6s for printf, 0.7 for yours
02:21:52bogenyeah. I'm on a slow laptop. with -O3, 5.123s for printf, 1.819s for mine
02:23:00flaviuhttp://www.joelonsoftware.com/uibook/chapters/fog0000000061.html , worth reading, especially since it sums up my arguments on URIs pretty well
02:23:57bogenok, now to replace the call to printf with the call to this one
02:24:16def-bogen: also, this should work without C++ and stuff like auto I think
02:24:24bogenit does
02:24:29def-great
02:24:35bogenonly my wrapper test code uses the auto stuff
02:25:19bogenit was quick and dirty so I did not have to typedef the function pointer, nimecho is straight C
02:26:16def-the speedup is pretty great
02:26:39def-even if you just print a single long string
02:29:12*xenagi joined #nimrod
02:35:40Varriountflaviu: Ok, do you have the code the gives us consistancy wrt url handling?
02:37:56flaviudom96 already wrote it and its in the stdlib. Not a big fan of the method naming, but my main gripe is that I don't think Araq puts enough focus on familiarity and convention.
02:53:11NimBotAraq/Nimrod devel 688db0f Grzegorz Adam Hankiewicz [+0 ±1 -0]: Improves tut1.txt with more hyperlinks and minor fixes.
02:53:11NimBotAraq/Nimrod devel 8aa0be8 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Improves tut2.txt with more hyperlinks.
02:53:11NimBotAraq/Nimrod devel 1daa54e Grzegorz Adam Hankiewicz [+0 ±2 -0]: Downgrades public module comments to private level.... 3 more lines
02:53:11NimBotAraq/Nimrod devel f3d785b Grzegorz Adam Hankiewicz [+1 ±2 -0]: Factors exception hierarchy into reusable fragment.... 2 more lines
02:53:11NimBot1 more commits.
02:54:37NimBotAraq/Nimrod devel 00f56b2 Grzegorz Adam Hankiewicz [+0 ±1 -0]: Adds usage example to typetraits.name().... 2 more lines
02:54:37NimBotAraq/Nimrod devel 5c9d676 Grzegorz Adam Hankiewicz [+0 ±2 -0]: Adds typetraits to library index and doc build.
02:54:37NimBotAraq/Nimrod devel 0db99be Varriount [+0 ±3 -0]: Merge pull request #1446 from gradha/pr_links_typetraits_module... 2 more lines
03:01:42*flaviu quit (Ping timeout: 246 seconds)
03:06:59bogenanyone here know much about linefmt? used in ccgexprs
03:22:21*saml_ quit (Quit: Leaving)
03:26:27*superfunc quit (Ping timeout: 245 seconds)
03:27:10bogenok, I figured it out. At least it is generating the calls I intend it to
03:39:51*superfunc joined #nimrod
03:48:25*kshlm joined #nimrod
04:06:51*q66 quit (Quit: Leaving)
04:09:38bogenwell, I got it partially working in nimrod
04:09:54*xenagi quit (Read error: Connection reset by peer)
04:10:05bogenit does print strings with nuls
04:10:36bogenso I have some test cases working
04:10:45bogenand the right code is being gen'ed
04:11:02bogenbut a lot of stuff is echoing garbage
04:11:18bogenand some stuff segfaults
04:26:13*Boscop_ joined #nimrod
04:29:05*CARAM_ joined #nimrod
04:29:24*silven_ joined #nimrod
04:30:58*govg_ joined #nimrod
04:34:19*nande joined #nimrod
04:35:33*silven quit (*.net *.split)
04:35:33*Boscop quit (*.net *.split)
04:35:34*govg quit (*.net *.split)
04:35:34*CARAM quit (*.net *.split)
04:39:52*CARAM_ is now known as CARAM
05:54:55*adoniscik joined #nimrod
05:59:14*ics joined #nimrod
06:05:35*kshlm quit (Remote host closed the connection)
06:14:42*nande quit (Remote host closed the connection)
06:25:24*Demos quit (Read error: Connection reset by peer)
06:37:59*kshlm joined #nimrod
06:41:33AraqVarriount: please don't make it a ref object, what's the gain
06:42:09Araqflaviu: the next blog post is called "Next: Designing for People Who Have Better Things To Do With Their Lives"
06:42:27Araqah the irony
06:59:37*gkoller joined #nimrod
07:06:26*kshlm quit (Remote host closed the connection)
07:13:31*kunev joined #nimrod
07:31:16*kshlm joined #nimrod
07:54:30*adoniscik quit (Ping timeout: 260 seconds)
08:25:46*zahary joined #nimrod
08:36:40*ome joined #nimrod
09:20:59*bjz joined #nimrod
09:35:04*EXetoC joined #nimrod
09:56:22*superfunc quit (Ping timeout: 264 seconds)
10:12:18*[CBR]Unspoken2 quit (Quit: Leaving.)
10:57:55*[CBR]Unspoken1 joined #nimrod
10:58:36*saml_ joined #nimrod
11:54:54bogenHi Araq
11:56:23*darkf quit (Quit: Leaving)
11:59:54bogenWell, I'm learning appf (minimally) and linefmt a bit more. (in regards to code generation). In regards to the nimecho work I'll need to put nimecho in a C library and always link against it. I'll read up on that.
12:13:01EXetoCso was fwrite agreed upon?
12:21:49*Araq_ joined #nimrod
12:22:52Araq_bogen: you can make a PR, but it will be rejected. this is not how we do it. we don't write C code ;-)
12:23:11Araq_reimplement it in nimrod and make it a .compilerProc that the codegen uses
12:23:16bogenAraq_: agreed
12:23:58bogenI realized in trying to make the change that I was going contradictory to the DNA of that language and it did not feel write
12:24:42bogenI need to buld the data structures in nimrod and pass it off to fwrite in a single call
12:24:55bogendid not feel right...
12:25:41bogenwhat I have on my fork I don't intend for anyone to use, the change is not right
12:26:00bogenis not implemented right
12:27:04Araq_well with the .compilerProc you get perfect dead code elimination for free as a nice bonus
12:31:43bogenyeah. in nimrod code I need to concatenate the strings and the new genEcho would pass them off to fwrite. I also need to make it a different echo initially because echo is a critical component that I can't be breaking and expecting to properly test it. (Which is what I already ran into)
12:32:54Araq_you can use alloca and copyMem in nimrod too
12:37:04*untitaker quit (Ping timeout: 260 seconds)
12:42:07*untitaker joined #nimrod
12:52:02Araq_Varriount: iirc printf is not used anywhere else really
12:59:34*darkfusion quit (Ping timeout: 240 seconds)
13:10:04*kshlm quit (Quit: Konversation terminated!)
13:11:54*saml_ quit (Ping timeout: 272 seconds)
13:24:41*Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140421221237])
13:34:23*bogen left #nimrod (#nimrod)
14:52:03*gkoller quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:52:17*xenagi joined #nimrod
14:57:06*bogen joined #nimrod
15:35:38*bogen left #nimrod (#nimrod)
15:46:01*ics quit (Ping timeout: 255 seconds)
15:46:58*ics joined #nimrod
16:08:05*kunev quit (Quit: leaving)
16:17:32*Demos joined #nimrod
16:46:32*ics quit (Ping timeout: 245 seconds)
16:47:12*ics joined #nimrod
16:48:44*q66 joined #nimrod
16:55:22*nande joined #nimrod
16:58:25*kunev joined #nimrod
17:06:55*darkfusion joined #nimrod
17:10:11*adoniscik joined #nimrod
17:16:17*zahary quit (Quit: Leaving.)
17:35:34*brson joined #nimrod
17:46:39*zahary joined #nimrod
17:49:02DemosI want to overload based on "varness" but I don't seem to be able to, any tricks?
17:49:17DemosI could cheat and use a typeclass and compiles() but I dont really like that
17:53:56*kunev quit (Ping timeout: 240 seconds)
17:54:26Araqproc foo(x: int{lvalue})
17:54:30Araqiirc
17:57:31*ome quit (Quit: Connection closed for inactivity)
17:58:04*zahary quit (Quit: Leaving.)
18:06:19*zahary joined #nimrod
18:06:33dom96hi
18:07:04*brson quit (Quit: leaving)
18:07:13*brson joined #nimrod
18:09:36OrionPKhi dom
18:10:44dom96hi OrionPK
18:13:27*Trustable joined #nimrod
18:15:38*kunev joined #nimrod
18:26:00DemosI solved it with a when statement
18:26:02Demosworks OK
18:32:34*kunev quit (Ping timeout: 250 seconds)
18:33:27*kunev joined #nimrod
18:36:01Araqhmm I noticed my planned light-weight channels are neither light-weight nor necessary
18:43:48reactormonkAraq, so what's the plan?
18:44:53AraqI dunno, I'm reading some concurrency "patterns" and see if my model can handle them
18:46:19Araqbut I think what I already have is good enough for version 1, once I fixed the remaining bugs and no new features / data structures are necessary
18:46:20*kunev quit (Ping timeout: 240 seconds)
18:47:28*superfunc joined #nimrod
18:48:09*kunev joined #nimrod
18:53:01*Jehan_ joined #nimrod
18:53:39*zahary quit (Quit: Leaving.)
18:57:39Araqah hi Jehan_ I lost my creativity, why do I need channels when I have data flow vars?
18:59:57Araqin most Go examples a channel is captured because a goroutine can't return a value ... this is primitive
18:59:58Jehan_From a pure expressiveness point of view, you don't, since you can emulate channels with data flow variables.
19:00:59Jehan_However, channels can give you performance gains and the emulation may also be cumbersome.
19:07:26Jehan_Simple example of channel usage is a basic implementation of tasks.
19:07:38Jehan_You have one channel that is used by all worker tasks.
19:07:55Jehan_Creating a new tasks sends a task object to the channel.
19:08:23Jehan_Worker threads all receive task objects from the channel (one at a time) and execute the task.
19:11:59*julienaubert joined #nimrod
19:12:15dom96hello julienaubert, welcome!
19:12:16Araqhi julienaubert welcome
19:12:30julienaubertHi! I'm getting an issue that is surprising me, https://gist.github.com/anonymous/12d7b56b9688608f4d25
19:12:42julienaubertI get trying read from nil access error when printing out name
19:12:48julienaubertHowever the compare works fine
19:13:24julienaubertSpecifically: SIGSEGV: Illegal storage access. (Attempt to read from nil?)
19:13:47julienaubertOn line: echo p.options.macros[i].name
19:13:52julienaubertHow come I do not get that on the line above?
19:14:28*io2 joined #nimrod
19:15:14def-julienaubert: you can still compare when it's nil
19:15:27def-julienaubert: but echo doesn't work with nil
19:16:46julienauberthmm I see what you mean, I incorrectly assumed it was macros[i] that was nil. Thanks... now I need to understand why the name is nil
19:17:03AraqJehan_: well for the examples I have in mind spawn+flowVar is already the best design, given our constraints
19:17:51Araqand it's easy enough to pass around arrays of data to mitigate the spawn overhead
19:19:11Jehan_Araq: What do you mean by "given our constraints"?
19:19:26Araqthread local GCs
19:20:04Jehan_I see.
19:21:04Jehan_If that's always the best design, your examples may only be a subset of all concurrent problems.
19:21:53Araqwell exactly :P is there a list of all concurrent problems available somewhere? ;-)
19:22:16Jehan_Araq: Not really. :)
19:22:36Jehan_But try search algorithms, for example.
19:23:09Jehan_They are often implemented via a distributed hash table.
19:23:39Jehan_I.e. there are N hash table threads and M compute threads.
19:24:13Jehan_Each compute thread generates successors of a node and sends them to the corresponding hash thread (hash value mod n).
19:24:56Jehan_The hash thread checks if they are already in the hash table and if not, stores them and sends them to a random compute thread to find new successors.
19:25:15Jehan_That implementation usually depends on channels so that the threads don't stall.
19:27:49Jehan_Parfor-based concurrency is great for arrays or other regular data structures, but not so much for dynamic data structures with an unpredictable structure.
19:28:45reactormonkAraq, nah, no fixing from me, masters thesis
19:29:00Araqok good, let me think about it
19:29:35Araqreactormonk: did I ask you to fix something?
19:35:47*gsingh93 joined #nimrod
19:38:01*Matthias247 joined #nimrod
19:38:55reactormonkAraq, few days back
19:39:29Araqreactormonk: your masters thesis can wait. do what I told you back then that I can't even remember.
19:39:47reactormonk^^
19:43:04AraqJehan_: the thing is not that concurrent hash tables are not useful, but FlowVar[ref Table] lets us easily reuse the existing collections
19:43:45Jehan_Araq: It's not about distributed hash tables, but how they're used in this case.
19:44:38Jehan_Channels, as I said, are used to prevent threads that do work in segments of short duration from stalling.
19:48:14*Demos quit (Read error: Connection reset by peer)
19:53:45*kunev quit (Quit: Lost terminal)
19:54:51*tinAndi joined #nimrod
20:07:48Araqjulienaubert: what's the problem with patching expandMacro to handle ##?
20:07:48*flaviu joined #nimrod
20:16:40*Kelet quit (Ping timeout: 272 seconds)
20:19:23*ics quit (Ping timeout: 240 seconds)
20:20:54*ics joined #nimrod
20:26:26julienaubertAraq, before I do that, I realized I have to handle expanding a macro-argument which is another macro. E.g. MANGLE_DOUBLE(x,y) where #define MANGLE_DOUBLE(x,y) typedef y CAT(x,y)
20:27:02julienaubertand so reading up the code to understand how I could achieve that. Any hint appreciated :)
20:27:10julienaubert(and thanks for the answer in the forum!)
20:27:26Araqthere is no need, it already expands recursively, afaict
20:28:37julienauberthmm
20:30:09AraqgetTok has a while loop for exactly this case
20:30:42Araqbtw the preprocessor and parser have nothing to do with the language standard
20:30:56Araqit's a best effort parser full of heuristics
20:31:28Araqbut it works pretty well once you accepted that you need to modify the header files
20:32:29julienaubertYeh I see what you mean. Interestingly it does not work on my test file though
20:34:02julienaubertI mean: I would expect it to see that CAT is a macro to be expanded once it is expanding MANGLE_DOUBLE
20:35:48Araqwell it happens later
20:36:00Araqit expands to typedef y CAT(x, y)
20:36:13Araqso it inserts 2 tokesn before it comes to CAT
20:36:34julienaubertOK cause right now it gives an error on ")" that it expected an identifier
20:36:51*silven_ is now known as silven
20:39:17julienaubertI.e., https://gist.github.com/anonymous/dc5af36f040b5e99325f c2nim/test.c(12, 29) Error: identifier expected, but found ')'
20:41:47julienaubertanother issue, is that I am not able to compile with the debugger
20:42:47*Kelet joined #nimrod
20:43:54*tinAndi quit (Quit: ChatZilla 0.9.90.1 [Firefox 31.0/20140716183446])
20:43:55Araqjulienaubert: use --debugInfo and gdb
20:44:17Araqthe debugger is barely maintained, unfortunately
20:44:37Araqthat said, I still haven't given up on it, so please submit a bug report
20:46:03julienaubertAh cool thanks
20:46:12julienaubertOK will do!
20:50:21julienauberthttps://github.com/Araq/Nimrod/issues/1466
20:52:16*Boscop_ is now known as Boscop
20:52:18*Boscop quit (Changing host)
20:52:18*Boscop joined #nimrod
20:57:54flaviujulienaubert: I also like to use --lineDir:on
20:58:15julienaubertthanks
20:58:43*Trustable quit (Quit: Leaving)
21:03:54Araqjulienaubert: yeah, I see what you mean
21:04:08Araqonly MANGLE_DOUBLE gets expanded for some reason
21:06:05*Fx00F joined #nimrod
21:07:03julienaubertMm did not manage to understand why yet
21:07:28julienaubertand, now I need to leave. Thanks for the help and hints!
21:07:42Araqwell I'm fixing it
21:07:57Araqchallenge accepted! ;-)
21:12:34*Trustable joined #nimrod
21:17:56julienaubert:D that's great, thx. I will study your commit
21:20:17VarriountSo, today I was using python, and missed Nimrod's templates
21:21:08*Trustable quit (Quit: Leaving)
21:21:25*julienaubert quit (Remote host closed the connection)
21:23:22VarriountAraq: https://github.com/Araq/Nimrod/issues/1424
21:26:00AraqVarriount: I replied
21:30:15AraqVarriount: I usually miss set[T] and templates and 'case' most
21:31:18VarriountAraq: Yeah, case was missed as well. I was doing GUI work, linking selection options to page ID's
21:38:54*xenagi quit (Quit: Leaving)
21:49:24VarriountAraq: Ping
21:49:34Araqpong
21:50:11VarriountAraq: The casting bug seems the be already fixed. I didn't do anything..
21:50:31VarriountOh wait, nevermind
21:55:55VarriountAraq: I submitted a PR to fix the cast[openarray[int]] problem
21:56:37Araqthank you
21:59:58AraqVarriount: I'm not sure this fix is correct
22:00:31VarriountOh?
22:01:41Araqwell for a start, types suck and you have to something like t.skipTypes(abstractVarInst).kind == tyOpenArray
22:01:59Araqbut I wonder if some usages of casting to openarray make sense
22:04:17VarriountThe only usage I can think of is if you recieve a pointer that was originally an openarray.
22:05:28VarriountAraq: Any particular reason why skipTypes only scans a series of last child nodes, rather than the entire node tree?
22:05:33*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
22:07:24VarriountI mean, is there something significant about the last child node?
22:07:57Araqwell the type graph is designed this way
22:08:30Araqit only needs to look at the last child
22:08:52Araqwhen this doesn't work, you can't use skipTypes
22:09:09Araqbut guess what, it almost always works
22:19:55Araqbut ok
22:20:08AraqI think apart from the skipTypes issue your patch is fine
22:22:48Araqaha!
22:22:53Araqgot the c2nim bug
22:23:03Araqdamn this is evil
22:39:27*adoniscik quit (Ping timeout: 245 seconds)
22:43:16*Demos joined #nimrod
22:47:21AraqJehan_: do you think it's same to overwrite boehm's memory header temporarily with a forwarding pointer for deepCopy?
22:47:37Araq*sane
22:48:43Jehan_Umm, explain?
22:49:41*gsingh93 quit (Quit: Connection closed for inactivity)
22:50:44Jehan_Oh, I think I see what implementation you're using.
22:51:17Jehan_Don't store forward references in memory allocated with GC_malloc_atomic().
22:52:55Jehan_Unless they're kept live through another reference.
22:52:58*darkf joined #nimrod
22:52:59AraqI only use that for strings and these do not get a forwarding pointer anyway
22:53:49Jehan_If you overwrite an existing pointer in an object, the object has to be kept live from someplace else.
22:54:42Araqwell what does the header contain?
22:54:54Jehan_What header?
22:55:34Jehan_There's a per hblk header, but not one associated with allocated blocks.
22:56:37Jehan_The Boehm GC manages memory in 4K or 8K hblk (heap blocks).
22:57:28Araqok this means I'm overwriting some actual data then, not good
22:57:33Jehan_Each hblk has an associated meta information block, telling you for small allocations what the size of allocated blocks within the hblk is, which are allocared, etc.
22:57:56Araqp = someAlloc(sizeof(...))
22:57:58Jehan_There's an additional data structure that maps conservative pointers to hblk headers.
22:58:07Araqusually there is a header at p[-1]
22:58:19Jehan_Yup, but not with the Boehm GC.
22:58:57Araqwell this means I need some external table to detect cycles for deepCopy
22:59:04Jehan_This allows it to allocate blocks of 2*wordsize with no additional overhead (except the metainfo per hlbk stuff).
22:59:44Araqand this table needs to be able to grow, so it itself needs to be heap allocated etc ...
23:00:03Araqvery messy for such a rarely used feature
23:00:25*adoniscik joined #nimrod
23:00:41Araqhence I store a forwarding pointer instead, which I know my GC "allows"
23:01:08Jehan_Yup.
23:02:13Jehan_One option is to have an extra word at the end of each allocated object (or beginning, if you want to play around with displacements).
23:03:19NimBotAraq/Nimrod devel a41be80 def [+0 ±1 -0]: Include string.h for strlen with cpp backend
23:03:19NimBotAraq/Nimrod devel 9bb7393 def [+0 ±1 -0]: Also include string.h for strlen for C backend
23:03:19NimBotAraq/Nimrod devel 4ce127b Andreas Rumpf [+0 ±1 -0]: Merge pull request #1465 from def-/cpp-cstring-len... 2 more lines
23:05:16Jehan_If you're using all_interior_pointers at the moment (which you probably are, it's the default), you can probably drop that and come out with the same total memory footprint.
23:07:06AraqVarriount: if you make DeviceId public, make it a distinct type on windows
23:07:20Araqsame for FileId
23:09:03Araqalso don't do the fileExists check on unix, it's not necessary
23:09:11Araqalso it's wrong
23:09:23AraqisHidden("../../foo") == true ?
23:09:51AraqisHidden("./foo") == true?
23:15:17*Matthias247 quit (Read error: Connection reset by peer)
23:21:43*Varriount quit (Read error: Connection reset by peer)
23:22:10*Varriount joined #nimrod
23:28:26*bogen joined #nimrod
23:51:32*nande quit (Remote host closed the connection)
23:58:33*flaviu quit (Read error: Connection reset by peer)