<< 06-08-2014 >>

00:02:02Araqflaviu: import foo.* is not homoiconic without yet another special case in the grammar :P
00:02:46Araqmyimport foo.* # breaks the parser unless we introduce postfix operators
00:02:58flaviuAraq: I was mostly playing devil's advocate
00:03:17flaviuCurrent syntax is a bit odd, but its fine with me
00:04:09Araqyeah well I'm only saying this because it's something we keep forgetting about
00:04:47*askatasuna quit (Quit: WeeChat 0.4.3)
00:04:48Araqand if anything the syntax needs to become more homoiconic, not less
00:05:46*BlameStross left #nimrod (#nimrod)
00:06:30bogenAraq: I submitted a fix for #1451
00:07:03*johnsoft quit (Quit: Leaving)
00:07:41Araqbogen: is it urgent?
00:08:02bogenno, I can use my own builds for now
00:08:32bogenI can wait for the next production release
00:09:42Araqbtw you can use c[i] in {' ', '\t', '\L', '\c'}
00:09:58NimBotAraq/Nimrod devel 530d210 Dwight Schauer [+0 ±1 -0]: Added carriage return and linefeed check to os::parseCmdLine ti delimiting whitespace eating.
00:09:58NimBotAraq/Nimrod devel cc230fc Andreas Rumpf [+0 ±1 -0]: Merge pull request #1453 from dschauer/devel... 2 more lines
00:10:41Araqdef-: ugh, I really don't want "-lm" for posix? is that really necessary?
00:12:43def-Araq: doesn't compile if you want to use these functions
00:12:50def-they could also be moved to another module i guess
00:12:54def-math or a new one?
00:13:09Araqwhat are these functions?
00:14:07def-set and get how floating point numbers are rounded
00:15:03def-They are standardized in C99 too
00:15:04Araqis that Posix 99 that nobody implements?
00:15:49Araqdoes macosx have these? BSD? Solaris? Irix?
00:16:00def-C99 and POSIX.1-2001 apparently
00:16:42Araqmeh, put them in math.nim
00:16:42bogenok, thanks... I was just following the example of the code that was there...". c [i] in {...} is cleaner...
00:17:04Araqbogen: yeah I know, but I thought maybe you don't know already
00:17:16def-Araq: hm, they don't seem to work everywhere. "Microsoft has _controlfp(). Some Unix clones, like OpenBSD, have fpsetround()"
00:17:39Araqdef-: yup
00:18:05bogenAraq: you are correct, I did not know it, I meant, thanks for the suggestion :)
00:26:44def-Araq: is there a way to have the volatile pragma for parameters?
00:29:01Araqno, I can add it, but why do you need it?
00:29:28Araqwho needs volatile anyway, its semantics are unclear
00:29:43def-exactly for this float rounding stuff
00:30:18def-if i don't set the parameters to volatile gcc optimizes away the second calculation and i get the wrong result:
00:30:27def-https://github.com/def-/nimrod-unsorted/blob/master/safeadd.nim
00:31:29Araqwhat?
00:31:41Araqare you sure that's the problem?
00:31:57Araqare the volatile lets not good enough?
00:32:01def-They are good enough
00:32:06def-I just wanted it without them
00:32:12Araqah ok
00:33:42Araqwhat happens when fesetround produces a memory barrier?
00:33:49Araqdoes GCC still optimize it then?
00:34:53def-i don't know. how would i test that?
00:37:46Araqwrap it in some proc that also does {.emit: """asm volatile("pause" ::: "memory");""".}
00:38:05Araqbut I guess it does
00:38:26Araqit's crazy to treat non volatile locals as "memory"
00:39:35def-Araq: still optimized away
00:43:44*saml_ joined #nimrod
00:47:01VarriountHi saml
00:47:22saml_hi Varriount
00:47:36saml_i've been waiting for you
00:47:39saml_welcome to the channel
00:47:42VarriountUh oh...
00:48:17saml_lol
00:48:19VarriountAraq: http://forum.nimrod-lang.org/t/514
00:48:28*Joe_knock joined #nimrod
00:48:44*Varriount waves at Joe_knock
00:49:02Joe_knockHello Varriount :)
00:49:04AraqVarriount: yes, I read it
00:49:58AraqFileInfo should expose whether it's a hidden dir/file
00:52:12Joe_knockIs there a way to execute the executable in linux? I don't see the command and hitting "right-click, execute" doesn't work.
00:53:37VarriountAraq: At that point, you get into what exactly constitutes a 'hidden' file, and whether there are any other important file attributes that need to be exposed.
00:54:47flaviuAraq: What happened to sleeping?
00:55:00Araqflaviu: it's overrated
00:55:26def-Joe_knock: what executable?
00:55:30flaviulol
00:56:27Joe_knockdef- the one that is created when I compile a .nim file.
00:57:25def-Joe_knock: I can just execute them. You can run them from a terminal?
00:57:55Joe_knockdef-: That is what I am trying to find out. What command do I use with the executable?
00:58:16def-when you're in the same directory of the file ./filename
00:58:17saml_./asdf
00:58:30saml_nimrod c --run asdf.nim
00:58:44def--r also works!
01:00:06Joe_knockWait a second, this feels very much like running a normal linux executable :-/ I think I've been spending too much time on the dynamic side of coding :'D
01:00:16def-Sure, it's a normal executable
01:00:46Araqgood night
01:00:46Araqthis time for real
01:01:48Joe_knockdef-, flaviu: I think our combined timezones stretch across the world
01:06:28Joe_knockWhat is the most up to date Nimrod code highlighter in ST2?
01:07:23def-I guess this one: https://github.com/Varriount/NimLime
01:08:54*johnsoft joined #nimrod
01:12:56Joe_knockdef- That looks like the most advanced one.
01:21:21*brson quit (Quit: leaving)
01:31:18*q66 quit (Quit: Leaving)
01:39:58*saml_ quit (Remote host closed the connection)
01:47:23*willwillson quit (Ping timeout: 240 seconds)
01:57:20Joe_knockIs anyone still here?
01:58:50Skrylarnope, we were all abducted :(
02:00:14def-I'm going to sleep, bye
02:00:19Joe_knockSkrylar: If you are able to assist, I keep getting this error: Error: type mismatch: got (TaintedString) but expected 'float'
02:00:36Joe_knockI am trying to get number input from the user using readLine(stdin)
02:00:43def-Joe_knock: import strutils
02:00:50def-and then parseFloat(readLine(stdin))
02:05:42*saml_ joined #nimrod
02:05:46Joe_knockWould this be considered incorrect: var numero: float = parseFloat(readLine(stdin)) ?
02:07:02Skrylaroh. you have the tainted string stuff turned on
02:07:58Skrylaryou're supposed to make sure there's nothing bad in the string before using .string to cast it from taintedstring to string IIRC
02:08:11Joe_knockCan you only feed input that are strings?
02:08:31Skrylartaintedstring is considered distinct to stop someone from wildly taking input from unsafe sources and tossing it at code that should be receiving safe input
02:10:08Joe_knockSkrylar: So when I say that the only valid input is strings, is this correct?
02:15:06Skrylaras far as i am aware yes
02:15:33SkrylarparseFloat(readLine(stdin).string) ought to work
02:15:46SkrylarIIRC
02:16:26Joe_knockinteresting. Is it possible that parseFloat may require 2 variables in the function? I seem to have gotten an error that indicates such.
02:17:31Skrylari haven't particularly used parseFlot or done a lot of IO work
02:17:35Skrylarunfortunately
02:44:38*Joe_knock quit (Quit: Leaving)
02:57:23bogenflyx: are you around?
03:11:03*xenagi quit (Quit: Leaving)
03:25:24*Jesin quit (Quit: Leaving)
03:28:28*adoniscik quit (Ping timeout: 255 seconds)
03:36:35*kshlm joined #nimrod
03:46:30*Hat_and_Cloak joined #nimrod
03:51:20*Hat_and_Cloak quit (Quit: Leaving)
04:01:06*JStoker quit (Ping timeout: 244 seconds)
04:03:03*Zuchto quit (Ping timeout: 255 seconds)
04:04:20*Zuchto joined #nimrod
04:04:36*JStoker joined #nimrod
04:45:32*ARCADIVS joined #nimrod
04:49:31*JStoker quit (Ping timeout: 256 seconds)
04:53:05*JStoker joined #nimrod
04:53:18*Zuchto quit (Ping timeout: 260 seconds)
04:54:55*Zuchto joined #nimrod
05:12:25*saml_ quit (Quit: Leaving)
05:17:07*shodan45 quit (Quit: Konversation terminated!)
05:22:02*Demos_ quit (Read error: Connection reset by peer)
05:25:39*methlabs joined #nimrod
05:25:51*methlabs left #nimrod (#nimrod)
06:05:09*nande quit (Read error: Connection reset by peer)
06:16:42*kaushal_ joined #nimrod
06:17:20*kshlm quit (Read error: Connection reset by peer)
06:19:40*gsingh93 quit (Quit: Connection closed for inactivity)
06:21:14*kaushal_ quit (Ping timeout: 250 seconds)
06:45:06*kshlm joined #nimrod
06:55:46*kunev joined #nimrod
07:07:10*silven quit (Ping timeout: 250 seconds)
07:27:12*adoniscik joined #nimrod
07:30:54*darkfusion quit (Ping timeout: 250 seconds)
07:31:03*Zuchto quit (Ping timeout: 260 seconds)
07:35:38*Zuchto joined #nimrod
07:39:11flyxbogen: I am now.
07:46:21flyxbogen: I'll be afk for another hour or so, but I'll read the backlog when I come back.
07:55:06NimBotAraq/Nimrod devel a64d733 Araq [+0 ±2 -0]: some bugfixes for 'deepCopy'
07:55:06NimBotAraq/Nimrod devel 404ada2 Araq [+0 ±1 -0]: Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
07:57:20*BlameStross1 joined #nimrod
08:19:11*darkfusion joined #nimrod
08:20:56*EXetoC joined #nimrod
08:53:32*rektide quit (Ping timeout: 266 seconds)
08:53:32*skroll quit (Ping timeout: 266 seconds)
08:53:47*skroll joined #nimrod
08:53:51*rektide_ joined #nimrod
09:40:56*adoniscik quit (Ping timeout: 255 seconds)
09:49:57*willwillson joined #nimrod
09:54:48*zahary joined #nimrod
10:04:25*ARCADIVS quit (Quit: WeeChat 0.4.3)
10:46:04*flaviu quit (Ping timeout: 240 seconds)
11:24:05bogenflyx: on the echo problem the issue is in compiler/ccgexprs.nim in genEcho (as far as I can tell). Once I wrap my head around linefmt I can correct the issue
11:33:57bogenrather than >>> printf("%s\012", (X)->data); <<< the compiler needs to generate something like >>> frwite((X)->data, (X)->Sup.len, 1, stdout); putchar ('\n'); <<
11:38:04bogens/frwite/fwrite/
11:38:36bogenflyx: I'm referring to https://github.com/Araq/Nimrod/issues/1137
11:53:41*darkf quit (Quit: Leaving)
12:02:51bogenwell, I need to wrap my head around appf and app as well. I need to take off for a while, I'll check the channel logs when I get back
12:03:02*bogen left #nimrod (#nimrod)
12:29:33flyxbogen: shouldn't it rather be >>> fwrite((X)->data, sizeof(char), (X)->Sup.len, stdout); <<<
12:35:04*untitaker quit (Ping timeout: 240 seconds)
12:42:07*untitaker joined #nimrod
13:06:03*kshlm quit (Quit: Konversation terminated!)
13:15:26*Araq_ joined #nimrod
13:16:27Araq_bogen: keep in mind that the spec says 'echo' is thread safe and so you either need to generate 1 printf call or use an explicit lock around mutliple puts calls
13:17:20Araq_this file lock is likely not in Ansi C leading to further complications
13:39:31*bjz joined #nimrod
13:59:13flyxafaik, ANSI C doesn't even specify that printf is thread-safe
13:59:30flyxPOSIX does
14:06:00flyxhowever, it shouldn't be a problem to fill one char[] with all the output and then fwrite() it.
14:06:55Araq_but it is, you don't want to allocate and a fixed size buffer is not enough
14:07:20flyxhm. wouldn't printf allocate internally anyway?
14:08:37flyxah, probably not, it directly stuffs it into the output stream
14:10:32flyxbut ISO C99 allows char[] with a length that isn't a constant expression
14:12:56flyxnot an option if the output should be ANSI C, of course
14:17:12Araq_that only transforms it into a potential stack overflow
14:17:30Araq_generting a single printf call is the way to go here
14:25:17*bogen joined #nimrod
14:27:29bogenprintf will always stop on \0. locks would be expensive. It would be cheaper to do a copy/append and fwrite the result
14:27:43bogenthe issue is not multiple c calls or buffer
14:27:49bogenbuffering...
14:27:59bogenthose can be preemempted
14:28:19bogen(as far as being thread safe)
14:28:26Araq_you can tell printf to use a passed length for the passed cstring
14:28:35Araq_forgot the %syntax for that though
14:28:48bogenok, and it will skip the nul?
14:28:57bogenlet me try that with regular c
14:29:03bogenthat would fix the problem
14:29:08Araq_yes
14:29:17EXetoCare you the one who responded to that issue on github? I posted a solution there
14:29:35EXetoCwhich is exactly that
14:29:41bogenyeah, I understand that now
14:29:59EXetoCbut that was a couple of months ago
14:30:19bogenthat is a better way to fix it. I saw your solution, and I did find the place to fix it
14:30:33EXetoCok
14:31:06bogenI just did not connect your solution as being the fix until you clued me into here :)
14:31:25EXetoCright
14:32:40bogenwhat I was getting at earlier is that it is not the multiple c calls or the buffering, it is just that the final result of printf gets handed off to the kernel in a single call
14:33:10bogenwhich won't be preempted causing overlapping text output
14:34:00Araq_so how does printf manage its buffer?
14:35:07bogenI would need to look into that. In order to be thread safe though it has to only make one kernel call (due to the forced flush from the final newline char)
14:36:13Araq_well we can always have our own lock for stdout
14:36:40Araq_'echo' doesn't support anything other than stdout and the other IO procs are not guaranteed to be thread safe
14:39:31bogenprintf("%.*s\n", 7, "dog\0cat"); // that still gets clipped at dog
14:39:48bogenwhy a lock? why not a copy/append?
14:40:20bogen(a copy and append the newline, the fwrite the result?)
14:40:27bogenthen...
14:41:16Araq_a lock is likely cheaper for long output
14:42:22bogenyeah, that would need to be profiled
14:42:46Araq_well a lock is cheap when there is not much contention
14:43:06Araq_copy is always O(n), even if there is no contention
14:43:07bogenI'm not disagreeing, but I think it would need to be many lines of output for a lock to be cheaper
14:43:31bogenyeah, I'm not familiar with the locking you would be using
14:43:54EXetoCof course my example sucks
14:44:06bogenor that you would want to be used in this case
14:47:07Araq_stack overflow agrees:
14:47:13Araq_printf("%.*s", length, string) will NOT work.
14:47:15Araq_This means to print UP TO length bytes OR a null byte, whichever comes first
14:47:26Araq_damn, this sucks
14:54:37Araq_oh well, I might as well change the spec then, I see no reason to guarantee that
14:54:48Araq_echo "foo", "bar"
14:54:52Araq_behaves like
14:55:02Araq_echo "foo" & "bar"
14:56:20Araq_when the implementation has to do exactly that and can't do it more efficiently
14:57:51Araq_I mean writing & is easy enough if I need the guarantee
15:06:25bogenyeah
15:09:01bogenso either per the the spec echo is thread safe (and harder to implement) or echo is not compliant with all unicode encodings
15:12:42Araq_what has unicode to do with it?
15:16:15*[CBR]Unspoken2 joined #nimrod
15:22:54bogenunicode 16 can't be used with printf
15:23:41bogenwhich is why windows has wspintf and wprintf
15:24:22bogenhttp://stackoverflow.com/questions/6907297/can-utf-8-contain-zero-byte
15:24:49bogenutf-8 also has nuls it seems
15:24:57Araq_so? echo outputs utf-8 / byte strings
15:25:28Araq_utf-16 needs to die
15:25:54bogenecho with "nimrod i" works find with nuls
15:26:52bogencan echo print utf-8 byte strings that use code point 0?
15:28:10Araq_well it should be able to do that, hence the bug report
15:28:22Araq_I don't understand your question
15:29:47bogenhttp://en.wikipedia.org/wiki/UTF-8#Codepage_layout see row C_, columns _2 through _4
15:30:24bogenthere are others as well that have 00 bytes
15:32:54bogenoh, the encoding likely does not end up with nuls, as I can do an echo "Ā"
15:33:08bogenhttp://en.wikipedia.org/wiki/Latin_Extended-A
15:33:25bogenso, if all of UTF-8 can be printed, this issue can be closed
15:34:34bogen#1137 can closed I think if it is determined that all of UTF-8 is supported and that it does not need to support UTF-16
15:35:33bogenwhich is what flyx said in #1137: Impact: May lead to unexpected or missing (debug) output, especially when working with stuff like UTF-16.
15:41:31bogenhttps://www.google.com/search?q=can+UTF-8+strings+have+nuls others seem to say no, I've not seen a definitive source on that (other than what libgit2 and rust people have discussed)
15:42:24def-bogen: https://en.wikipedia.org/wiki/UTF-8#Description
15:42:47def-bogen: there is always a leading 1 bit in each byte, so no byte can be nul
15:42:48bogenyes, but where does it say there will not be nuls
15:44:01bogenbyte 1 if only 7 bit ascii, can have a nul
15:44:31def-yes, but that's the nul characte, which you want to have
15:44:37bogenmultibyte encodings don't have nul
15:46:08bogenso the spec for echo could be, works with UTF-8, does not work with UTF-16, does not work with embedded nuls (which are not needed for the extended character sets)
15:50:39Araq_I don't understand this, depending on which type you use for utf-16, it doesn't compile or it uses $ to transform it into utf-8
15:51:07Araq_and it should work with embedded nuls, hence the bug report
15:54:00Araq_why does utf-16 need to be mentioned? why not utf-32?
15:56:19bogenhttps://github.com/Araq/Nimrod/issues/1137 "Impact: May lead to unexpected or missing (debug) output, especially when working with stuff like UTF-16.". flyx mentioned it initially, not me, but as you said, utf-16 is transformed to utf-8
15:58:16*kunev quit (Quit: leaving)
15:58:29flyxit was just an example.
16:04:00Araq_ok ok
16:09:46bogenwell, I need to leave, I'll check the logs when I come back
16:09:56Araq_ok, bye
16:10:04bogenbye
16:10:08*bogen quit (Quit: Leaving.)
16:11:55def-Is there a way to execute some memory as if it were a function (without emitting C code): https://github.com/def-/nimrod-unsorted/blob/master/machinecode.nim#L24
16:19:24Araq_no, but I dreamed of a proc allocExecutableMem()
16:19:53Araq_then you can cast this pointer to some proc type and invoke it
16:21:28Araq_I'm pretty sure Mat3 has code for that somewhere, but he'll be back in a month
16:21:53*zahary1 joined #nimrod
16:22:20Araq_allocExecutableMem is not allowed on iOS iirc
16:26:04*zahary quit (Ping timeout: 260 seconds)
16:27:53*zahary joined #nimrod
16:28:24*zahary1 quit (Ping timeout: 260 seconds)
16:37:06*Matthias247 joined #nimrod
16:38:47*govg joined #nimrod
16:38:54*Jesin joined #nimrod
16:46:07*silven joined #nimrod
16:49:34*Jesin quit (Quit: Leaving)
16:51:06*Jesin joined #nimrod
16:51:33Araq_screw this, PROT_EXEC is supported on iOS
16:55:03*Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140421221237])
16:56:10*Matthias247 quit (Read error: Connection reset by peer)
17:05:14*q66 joined #nimrod
17:11:47*Jesin quit (Quit: Leaving)
17:19:15*brson joined #nimrod
17:23:09*zahary quit (Quit: Leaving.)
17:29:42*Demos joined #nimrod
17:37:06*Jesin joined #nimrod
17:44:14*willwillson quit (Ping timeout: 255 seconds)
17:46:05*kunev joined #nimrod
17:48:33*pown joined #nimrod
17:55:34*pown quit (Read error: Connection reset by peer)
17:56:13*pown_ joined #nimrod
17:58:21pown_Hi, anoyone here working on c2nim?
17:59:01*nande joined #nimrod
18:08:25*Fr4n quit (Ping timeout: 244 seconds)
18:12:22Araqhi pown_
18:12:23Araqrarely.
18:19:31*adoniscik joined #nimrod
18:23:20pown_Hi! OK, any suggestions on approach for wrapping fftw3?
18:23:33pown_Do you usually just do it 100% manual when c2nim breaks?
18:24:10DemosI usually fix the C source file
18:24:22EXetoCI can't remember which fft lib I tried to wrap
18:24:58Demosoften the problems are with macros, you may have to manually convert them but for everything else you can run the c preprocessor to just eliminate macros and then add them back into the nimrod file
18:25:03Araqlol, 100% manual when c2nim breaks. no way.
18:25:10EXetoCwell it worked, but I could never figure out why the nimrod code would behave differently
18:25:37AraqI cleanup the C header until c2nim likes it
18:26:28pown_I see. THanks!
18:26:53EXetoCyou basically have to, and it's often worth it
18:27:59EXetoCit's just difficult to learn how to fix things in batches, cus C is C
18:29:00pown_Mm!
18:30:15pown_Tricky to guess what to do to make c2nim like it though
18:30:26EXetoClet's replace C with something from this century that actually makes wrapper generation relatively simple
18:30:54*johnsoft quit (Read error: Connection reset by peer)
18:31:08dom96hello
18:31:33EXetoCin many cases it's dll macros, which you can just define to nothing, the c2nim way (the manual explains that part)
18:32:07EXetoCand then there are some problems with multiline macros and anonymous types and such
18:32:11Araqpown_: just ask and gist some examples
18:32:23AraqEXetoC: anon types now work afaict :P
18:32:44EXetoCgreat. I recall that being worked on
18:34:06Araqhi dom96
18:34:12dom96hi Araq
18:34:53pown_Araq, thanks! So here is one which I am not sure how to fix: https://gist.github.com/anonymous/85214cbf6bc6f98a48c1
18:35:28pown_(that is a smaller one, obviously - there are many defines in FFTW_DEFINE_API)
18:35:32Araqreplace #define by #def
18:45:58pown_Araq - you mean to put FFTW_DEFINE_COMPLEX as def? https://gist.github.com/anonymous/85214cbf6bc6f98a48c1
18:46:53Araqwell yes but ensure c2nim doesn't see the #define
18:47:44pown_Hah! Operation successful - thanks!
18:49:01*johnsoft joined #nimrod
18:52:41Araqbtw isn't this the very first thing that c2nim's docs now teach you?
18:59:19pown_I think so. I just was not able to "get it", I'm afraid
19:00:03Araqno problem, but if you know how to improve the docs, I'm all ears
19:00:24Araqmaybe add your gist as an example
19:03:25pown_OK perhaps suggestions for the docs: it is more general than just "function prototype". And with yes, perhaps one more example. Btw, curious, how come c2nim does not attempt to just "search replace" the macros? (why the need to make #def?)
19:04:30pown_oh and I deleted the gist, but I added it on the issues on c2nim
19:04:52Araqcan you make a PR please to improve the docs?
19:05:03pown_I can try :)
19:05:54Araqit doesn't attempt to just "search replace" because I came up with a useful heuristic later and now I've lots of more important things to do
19:06:33pown_Ah I see. Thx!
19:07:53pown_If you have a quick answer: does c2nim always fail to expand macros?
19:08:02pown_macros/defines
19:09:34Araqthe documentation explains this
19:12:41Araqpown_: #define FOO 8989
19:12:50Araqis most common and c2nim handles that correctly
19:13:06pown_OK Let me reread the docs properly
19:35:10pown_Seems nimrod doc c2nim.txt fails on master branch
19:36:13Araqnimrod rst2html c2nim.txt
19:36:25Araqdoc is for nimrod source code
19:37:47pown_:]
19:38:00*wan joined #nimrod
19:38:28*willwillson joined #nimrod
19:40:01*brihat joined #nimrod
19:43:25Araqhi willwillson welcome
19:47:35pown_Araq: https://github.com/nimrod-code/c2nim/pull/9
19:49:59Araqpown_: thanks. applied
19:52:21*brihat left #nimrod (#nimrod)
20:03:58*io2 joined #nimrod
20:09:56*flaviu joined #nimrod
20:14:52*flaviu quit (Remote host closed the connection)
20:21:23*BlameStross1 quit (Ping timeout: 240 seconds)
20:38:17*pown_ quit (Remote host closed the connection)
20:41:25*Matthias247 joined #nimrod
20:49:39*pown joined #nimrod
20:51:22*pown quit (Client Quit)
20:54:49*wan quit (Quit: WeeChat 0.4.3)
20:55:14*Fr4n joined #nimrod
21:03:19Araqping Varriount
21:12:45*CARAM_ is now known as CARAM
21:13:49*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
21:20:52*flaviu joined #nimrod
21:27:45Araqping flaviu
21:28:48Matthias247pong ;)
21:30:05flaviuAraq: Hey
21:40:25*nande quit (Read error: Connection reset by peer)
21:49:02*Fr4n quit (Ping timeout: 244 seconds)
21:49:06*kunev quit (Quit: Lost terminal)
21:57:31VarriountAraq: Pong
21:57:52AraqVarriount: I'm waiting for your PRs
21:58:05VarriountFor..?
21:58:11VarriountWhich ones?
22:03:23VarriountAraq: Which PR's do you want?
22:04:28AraqVarriount: well I don't really know. hiddenFile attribute for FileInfo?
22:05:16VarriountThat can be done. Do you want a new walkDirRec as well?
22:07:46*bogen joined #nimrod
22:09:14Araqyeah
22:09:25Araqperhaps walkFileInfos ?
22:09:25bogenHi Araq
22:09:32Araqwb bogen
22:10:02bogenhttp://bazaar.launchpad.net/~vcs-imports/glibc/master/view/head:/stdio-common/vfprintf.c#L221 a printf is more expensive than a copy/append/fwrite
22:10:22bogenprintf has to build another string from based on the template
22:12:21*Jehan_ joined #nimrod
22:12:22bogenso for nimrod's echo it sees the %s, copies the string, and appends new line
22:13:22Araqbogen: without some micro benchmark this doesn't mean anything
22:13:52bogenyeah, I will do some benchmarking in large loops
22:14:38bogenbut skipping the I/O I guess, as that would be the slowest part
22:14:46bogenso just an sprintf
22:14:52VarriountAraq: Oo, nice name
22:14:54Araqhmm ok
22:15:08*Varriount stabs launchpad
22:15:19AraqVarriount: really? glad you like it then, was a first shot
22:17:56VarriountAraq: Any other file attributes I should look into including?
22:18:35Araqwell you already have soft links etc. right?
22:19:11VarriountYeah, but only because pcLinkTo* is part of the PathComponent enum. *grumble grumble*
22:20:19Araqwhy the gumble?
22:22:10VarriountI keep thinking that it might have been better to replace TPathComponent with some sort of TFileDetails set, which contains various file aspects: "isFile", "isHidden", etc.
22:28:01flaviuAraq: You pinged me a while back?
22:28:28Araqflaviu: yeah for the same reason. get your ass up and fix some bugs or do some other nimrod related work.
22:33:55*Skrylar wrote a msgpack serializer FWIW
22:34:14Varriountflaviu: Apparently we're lazy lunks
22:34:39flaviulol
22:36:48flaviuSorry though, I've started trying to come up with my own language. Of course like most things I start, it'll take a (long | never) time to actually do anything lol
22:37:19VarriountAraq: I'm assuming that you would like wether a file is hidden or not to be expressed through a boolean isHidden attribute?
22:39:25AraqSkrylar: it is on babel? if not, it doesn't exist
22:42:03AraqVarriount: sure, unless you already have some 'flags' attribute in FileInfo
22:43:05VarriountAraq: Are the any explanations for https://github.com/Araq/Nimrod/issues/1445 ? That's an interesting issue.
22:43:49AraqI thought it was related to PR #1400 but according to def- that doesn't change anything
22:44:13Araqneed to look at it, or even better implement some memory visualizer
22:44:15VarriountUnless PR #1400 doesn't work...
22:44:39Jehan_It's something different, as far as I can tell.
22:45:17Araqwell I didn't really look at it
22:45:31Jehan_Currently looking at it.
22:50:27Jehan_Interestingly, it manifests regardless of the GC type.
22:51:05Jehan_I mean, the memory leak exists for the reference counting collector, the mark and sweep collector, and the Boehm GC.
22:51:27Jehan_I had been wondering if maybe it was an issue with refcounts being off, but apparently not.
22:52:19Araqthat's interesting indeed
22:55:19Jehan_if I insert the "if i mod 1_000_000 == 0:" version, it goes away for all but the Boehm version.
22:58:42*Fr4n joined #nimrod
22:59:50Araqwell gc:markAndSweep transforms leaks into crashes, usually
23:00:16Araqif the refcounting is wrong, it produces leaks
23:00:32AraqmarkAndSweep instead frees things prematurely
23:00:35def-I just started reporting where cpp doesn't compile but this might end up with too many issues
23:00:48Araqdef-: don't report it, fix it
23:02:16*Matthias247 quit (Read error: Connection reset by peer)
23:02:19VarriountAraq: Could it be that the programs are allocating memory faster than the Garbage collectors can deallocate it?
23:02:53Araqthat can only happen for the realtime gc
23:04:31VarriountAraq: Should I also follow this rule? http://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory#GNOME
23:05:24AraqVarriount: yes, on unix.
23:05:38VarriountNo, I mean, the gnome convention
23:06:08Varriount"In the GNOME desktop environment (as well as all programs written using GLib[7]), filenames listed in a file named .hidden in each directory are also excluded from display"
23:07:22VarriountOh crud. This is.. interesting.
23:08:27VarriountSince getFileInfo works with file handles (behind the scenes), I can't actually get the file name of the target.
23:09:28VarriountWhich means I can't determine whether a file is hidden on Unix-like systems.
23:10:00bogenAraq: https://gist.github.com/dschauer/8804f820a6664671f9ce the copy/append is about 3 times faster than sprintf on my system
23:10:50bogenwith the malloc/free overhead it would likely be even faster, I will test it with the malloc/free outside
23:11:29*darkf joined #nimrod
23:12:20Jehan_Araq: I think I know why the bug happens.
23:12:54Jehan_generic assignments are bracketed with GC_disable() and GC_enable()
23:13:18VarriountO_o
23:13:33Jehan_Because no allocation happens outside that, collection is never triggered.
23:14:09Araqhuh, interesting
23:14:16Araqand easy to fix :-)
23:14:47AraqI disabled these for .. erm ... reasons
23:14:47*bjz quit (Ping timeout: 245 seconds)
23:15:54AraqVarriount: ok, well can't you check for filename[0] == '.' in the construction of FileInfo
23:15:58Araqor however you do it
23:16:23VarriountNot if the procedure is called with a file handle
23:16:44bogenabout 9 times faster without the malloc/free overhead https://gist.github.com/dschauer/1715b86f8a6f3269ff22
23:16:52VarriountIronically enough, getting a file name from a file handle is easy on Windows, but difficult with Unix systems.
23:17:05Varriounthttp://stackoverflow.com/questions/1188757/getting-filename-from-file-descriptor-in-c
23:17:53*brson quit (Quit: leaving)
23:17:59Varriountbogen: Is this code/technique meant to replace anything in particular?
23:19:35flaviuVarriount: Ignore the gnome thing
23:19:47flaviuif ls doesn't use it, you shouldn't either
23:20:28AraqVarriount: there is no irony here. unix breaks as soon as you take a close look at it
23:20:45*willwillson quit (Ping timeout: 256 seconds)
23:21:41AraqVarriount: I suppose this means my isHidden(filename: string): bool idea has even more merit?
23:22:06VarriountAraq: Yes... but it would only work for path names, not strings.
23:22:11Varriount*not handles
23:23:22*Fr4n quit (Ping timeout: 250 seconds)
23:23:48Araqppfff hidden files are not special in any meaningful way anyway. why are they even a deal?
23:24:09flaviuBecause I don't want my ~ clogged up with dot files?
23:24:24Araqlol
23:24:33Araqas if you can avoid it
23:24:57AraqI have ~/projects and this is my "real" home dir for exactly this reason
23:24:58Varriountflaviu: Then go petition Unix systems to develop a proper configuration store.
23:25:26flaviuVarriount: They have one: .config, and /etc/
23:25:39Araq.bashrc is not in .config
23:25:40flaviuPlease don't try to get the windows registry into unix
23:26:21flaviuVarriount: Windows has the same problem too, although a more manageable
23:26:24Araqthe registry sucks but gnome and KDE copied it
23:26:30flaviuIt has AppData
23:26:33Varriount:3
23:27:01flaviuAraq: Gnome discontinued that
23:27:42Araqhu? why? what do they use instead?
23:27:46flaviuand from how much KDE configuration I've done, I'd say that KDE has done so too
23:28:21flaviuflat files, unix-style
23:29:19flaviu.kde4/share/config looks like
23:29:28flaviuJust a bunch of files, one per program or so
23:30:17flaviukde looks like its never had a registry
23:30:42flaviuIt's done some fancy caching with different file formats, but no more
23:35:01VarriountI wonder why, with the philosophy of "do one thing and do it well", linux never had a program to read/write configuration values to a file.
23:35:28bogen Varriount: it is meant to fix echo from stopping at nul bytes. (it could also possibly speed up echo, but that is not the intent, it is just that it would undesirable to slow down echo with the fix). https://github.com/Araq/Nimrod/issues/1137
23:35:47Varriountbogen: Yay!
23:36:53VarriountAraq: Should the isHidden proc error if the file doesn't exist, even on Unix-like systems?
23:39:07Araqmeh I dunno. I would make it return false on error
23:39:21*Fr4n joined #nimrod
23:41:13flaviuVarriount: What is the point of having a program to do that?
23:41:40Jehan_Varriount: It's `vi ~/.profile` :)
23:41:41flaviuYou just have to parse it yourself anyway, might as well cut out the middle man
23:41:55Varriountflaviu: Making sure configuration formats are similar.
23:42:11Jehan_More generally, it doesn't make much sense with the combinator-style shell programming UNIX uses.
23:42:13flaviuminor problem, I haven't had much issue
23:42:25flaviuits mostly ini-style
23:42:36Jehan_For all other use cases, you want a library, not a program.
23:44:42*Fr4n quit (Ping timeout: 250 seconds)
23:44:47bogenAraq: since copy/append is 3-9 times faster than sprintf, I plan to move ahead with implementing a fix for 1137, unless you still have some concerns. I need to know how you would want the allocation for the copy to be handled if I proceed.
23:49:59Varriountbogen: I wonder if there are other uses of printf family procedures that could be replaced with your code.
23:57:38*Fr4n joined #nimrod