<<29-01-2013>>

00:21:56reactormonkAraq, kwin/kwintoplevel.nim(4, 17) Error: identifier expected, but found '{.'
00:22:04reactormonk alpha*: bool {.importc: "alpha".}
00:22:07reactormonkwrong syntax?
00:23:30*q66 quit (Quit: Quit)
00:46:38Araqreactormonk: alpha* {.importc: "alpha".}: bool
00:47:45reactormonk:-/
01:47:44*Anaphaxeton quit (Remote host closed the connection)
01:55:28reactormonkNimCopy([{Field0: 0, Field1: cstrToNimstr("Meta+9")}, {Field0: 1, Field1: cstrToNimstr("Meta+8")}, {Field0: 2, Field1: cstrToNimstr("Meta+0")}, {Field0: 3, Field1: cstrToNimstr("Meta+i")}, {Field0: 4, Field1: cstrToNimstr("Meta+p")}, {Field0: 7, Field1: cstrToNimstr("Meta+,")}, {Field0: 5, Field1: cstrToNimstr("Meta+m")}, {Field0: 6, Field1: cstrToNimstr("Meta+.")}], NTI26111);
01:55:32reactormonkwhy the NimCopy ?
05:00:32*fowl quit (Quit: Leaving)
05:53:05*SchalaZeal joined #nimrod
06:19:45SchalaZealI'm in a bit of a pickle with my EaselJS wrapper.
06:27:43*Anaphaxeton joined #nimrod
06:29:28*XAMPP-8 joined #nimrod
07:58:30*SchalaZeal quit (Quit: Konversation terminated!)
08:01:16*Araq_ joined #nimrod
08:01:43*Araq_ quit (Client Quit)
08:49:00*XAMPP-8 quit (Ping timeout: 256 seconds)
08:49:31*zahary_ quit (Read error: Operation timed out)
08:54:14*zahary quit (Ping timeout: 252 seconds)
08:59:29*zahary joined #nimrod
10:54:25*Araq_ joined #nimrod
11:02:54*Araq_ quit (Quit: ChatZilla 0.9.89 [Firefox 18.0.1/20130116073211])
12:00:52*zahary quit (Ping timeout: 248 seconds)
12:05:57*zahary joined #nimrod
12:13:30*gradha joined #nimrod
12:14:01gradhaI can get an untraced reference (ptr) to an object with addr
12:14:09gradhahow can I get a traced reference (ref) to an object?
12:14:20gradhas/an object/a variable/
12:29:23*zahary_ joined #nimrod
12:30:11gradhalooks like addr(seq[i]) is not allowed either
12:55:43*gradha quit (Quit: Leaving)
12:59:29*Trix[a]r_za is now known as Trixar_za
13:01:39*zahary1 joined #nimrod
13:01:49*zahary quit (Read error: No route to host)
13:03:09*q66 joined #nimrod
13:23:35*Trixar_za is now known as Trix[a]r_za
15:03:35*gradha joined #nimrod
15:04:53*zahary1 quit (Ping timeout: 248 seconds)
15:06:20*zahary joined #nimrod
16:22:13*Zor quit (Ping timeout: 248 seconds)
16:28:14reactormonkgradha, well, the idea of a traced reference is that you don't fuck with it
16:29:27dom96gradha: addr(obj)?
16:29:49dom96If you want a traced reference you need to declare your variable as `ref TObject`
16:30:10gradhaso basically its impossible to transform a variable into a traced reference without new+copy?
16:32:25gradhaaddr(seq[index]) doesn't work, are sequences special or is the []?accessor preventing addr from working?
16:32:58dom96addr(seq.mget(index)) should work
16:33:19dom96As far as I know it is impossible.
16:49:20*Zor joined #nimrod
16:55:03gradhaI don't think sequences have an mget, the compiler is expecting something from the tables module
16:57:06gradhafailed attempt at http://pastebin.com/JWg6EwDg
16:59:10gradhathe repr proc showing the address of the variable accessed through [] and addr not willing to return it seems like the compiler is mocking me
17:00:29dom96hrm
17:01:30dom96perhaps there is no way to do it.
17:07:10*FreeArtMan joined #nimrod
18:04:34*Trix[a]r_za is now known as Trixar_za
18:39:23*Trixar_za is now known as Trix[a]r_za
18:57:29Araqgradha: my connection is bad tonight
18:57:42*shevy quit (Ping timeout: 256 seconds)
18:58:05Araqindeed you cannot get a 'ref T' without 'new'ing it in the first place
18:58:29Araqand 'addr' does work for seq[i] but not for *parameters*
18:58:48Araqas parameters are readonly
18:59:30Araqfor low level stuff this can be annoying, so I thought about allowing it, or adding a paramCast to the language
19:00:02Araqhowever, 'repr' is written in nimrod so the compiler definitely does not mock you
19:02:04gradhaI'm building a TTable over elements passed in as seq, so I have to to make a copy into a local var to be able to use addr on them?
19:02:22gradhaa TTable[string, ref object]
19:03:05gradhanow I'm simply copying everything by value because its frustrating
19:07:36gradhaok, var param = param it is then
19:10:18*shevy joined #nimrod
19:29:51gradhaI want to write a long string literal and don't want to use triple quotes because I don't want line breaks
19:30:13gradhaI'm using "a" & "b", is this something that happens at runtime or will the compiler put it together at compile time?
19:30:47gradhasort of like putting two C strings together and let the compiler treat them like a single joined one
19:33:42*FreeArtMan quit (Ping timeout: 240 seconds)
19:36:59dom96gradha: Yeah, I believe it happens at compile time.
19:37:13dom96why do you need to use addr on your values?
19:38:59gradhait's an M:N relationship, seems like a waste to copy N more than needed to have M access entries to the table
19:42:38*dom96 isn't really sure what you are doing
19:43:25gradhahttps://github.com/gradha/argument_parser/blob/master/argument_parser.nim#L64
19:43:57gradhathis version is copying the Tparameter_specification object each time it builds an access in the TTable
19:44:17gradhanow I've added "var expected = expected" at the top so I can use addr and avoid the copies
19:50:58dom96I wonder if that's not equivalent to simply using 'ref TParameter_specification' instead.
19:52:10gradhathat would require me to use new() and copy the value into the traced reference when preparing the seq
20:20:05*zahary_ quit (Ping timeout: 252 seconds)
20:23:22gradhalooks like "try: let dummy = parse(all_params, @["int test", "-i", "fail"])" is not allowed
20:23:30gradhagood thing we have discard()
20:32:49gradhalooks like an exception raised inside a template displays an incorrect stack trace, the stack trace contains the correct name of the proc where the template was instantiated, but the line number points to the template's source code rather than the line with the template invokation
20:33:18gradhait makes sense, but could nimrod insert a "false" stack trace with the line where the template is being used? could help debugging
20:37:59reactormonkgradha, file an issue
20:41:45reactormonkGot to admit, I like tk for GUI stuff.
20:42:13gradhafrom the developer pov or the user pov?
20:42:40reactormonkgradha, developer. And it looks native.
20:44:17dom96I have always stayed away from tk because it looks crap
20:44:34gradhaI was afraid to say that aloud
20:45:15reactormonkdom96, the old tk does
20:47:14dom96reactormonk: write a nimrod wrapper for it please :P
20:47:26gradhathe tk website doesn't have screenshot, and a google image search for the domain only reveals pictures of babies?!
20:47:49dom96tk the baby UI toolkit
20:48:01dom96"Fills your screen with babies"
20:48:25gradhaseriously http://www.google.es/imgres?q=site:www.tcl.tk+jpg&um=1&hl=es&safe=off&client=safari&tbo=d&rls=en&tbm=isch&tbnid=Th7_Oezof6sjZM:&imgrefurl=http://www.tcl.tk/community/hobbs/carina/set1/&docid=yPLIqaMTjHEuOM&imgurl=http://www.tcl.tk/community/hobbs/carina/set1/carina02.jpg&w=640&h=480&ei=YzUIUeisLofBhAePwoCADg&zoom=1&ved=1t:3588,r:21,s:0,i:167&iact=rc&dur=433&sig=102270266687391989056&page=2&tbnh=185&tbnw=247&start=12&ndsp=16&tx=125&ty=122&biw=1015&
20:48:26gradhabih=784
20:48:33gradhaoh, crap google search link
20:48:34gradhasorry
20:49:11gradhareactormonk: any scren captures of the fresher native look? I've never seen such a thing out of invoking the OS's standard dialog for file operations
20:50:07reactormonkgradha, http://www.tkdocs.com/
20:50:48reactormonkgradha, http://www.tkdocs.com/tutorial/widgets.html
20:52:34dom96The Linux screenshots don't look very attractive
20:52:43gradhaso it's 8.5 the version with the new featured theme?
20:53:09reactormonkgradha, and use the new widgets.
20:53:18reactormonkaka Tk::Tile
20:53:27dom96although those docs are pretty nice.
20:53:40dom96If only gtk had something similar.
20:54:10gradhalooking at the individual widget comparisons makes me realize it's not the native look that ends up being distracting but people forcing a style for crossplatforms progs
20:54:31gradhaso you end up with a "windowsed" mac/linux version, a "linuxified" windows/mac version, or a "macified" windows/linux version
20:55:17gradhait's a pitty, even the cocoa gtk version of the gimp looked alien on mac, despite using native widgets
20:56:16gradhaisn't tk the gui for tcl programs? does it have C bindings or you have to convert to tcl first?
20:57:02reactormonkgradha, it has C bindings
20:57:50gradhasearching tkdocs for "C API" or "C bindings" comes up empty
20:58:13gradhathey don't advertise their C API much: http://www.tkdocs.com/resources/languages.html
20:59:04reactormonkhttp://wiki.tcl.tk/2074
21:01:23gradhaah, so it has to go through tcl first
21:02:45reactormonkthe api has a bunch of macros :-/
21:06:05gradhais there a way to stringify an expr passed into a template for logging? IIRC this would be like ## macros in C
21:06:47gradhaconsider template test_success(code: expr) {.immediate.} = echo($code)
21:07:04gradhathis runs code, and the result of the expression is stringified and outputed
21:07:38gradhacould I take "code" and stringify that? kind of like showing the source which was passed into the template
21:10:55dom96maybe dumpAST or dumpLisp, but that might just echo the 'nkIdent { name = "code" }'
21:26:18gradhaso if you are parsing arguments, and a switch requires a value, and there is none, would you prefer an EInvalidValue or EInvalidIndex raised?
21:28:36gradhatalking about a commandline switch (aka -s filename), not a language switch/case
21:35:21reactormonkgradha, make your own
21:36:17gradhahehe, let me rephrase then the question: what exception would you like my new one to be inherited from, EInvalidValue or EInvalidIndex?
21:36:51gradhamaybe EMissingValue inheriting from EInvalidValue?
21:38:58dom96hrm, hard question.
21:39:05AraqEInvalidValue
21:40:08Araqoh hey you can read my answers according to the logs :-)
21:40:28Araqwell, gradha, using locals and taking their address and putting it to a table is dangerous
21:40:49gradhaI know, the pointer outliving the original variable, etc
21:42:15Araqyou can move things into tables instead of copying them ... if only tables would support that ...
21:43:00Araqhowever, I'd use 'ref object' in your API
21:43:18gradhais it more optimal?
21:43:33gradhaI'm not interested in any object being "unique"
21:43:42Araqit's what people've come to expect
21:43:44gradhaand I don't care about performance too much now
21:44:04gradhayeah, but that's mainstream, not cool enough
21:44:08Araqpeople can't cope with value types these days anymore anyway
21:45:49gradhabesides, I'm doing this mainly for me to learn nimrod, so I don't care too much what others say, and you said values are ok, so I'm going with that
21:46:09Araqdid I say that?
21:46:23gradhawhen I asked about refs
21:47:18Araqwell you can also use the copying, it'll be optimized away soon
21:47:38Araqthanks to our groundbreaking TR macro system
21:49:21gradhareactormonk: you said idetools was slow, have you tried recent caas commits?
21:49:35reactormonkgradha, caas?
21:49:49gradhacompiler as a service, for idetools
21:49:58reactormonkgradha, doc?
21:50:00gradhaor is that not what caas stands for?
21:50:38gradhano idea about docs, zahary commited some stuff yesterday, haven't looked at it myself yet
21:51:13Araqcaas = compiler as a service, yeah
21:51:23AraqI'm not sure it's working yet
21:52:39gradhaI'm wondering anyway how would that work inside vim/aporia: does the commandline API change or does it require spawning a server and communicating to it through a socket?
21:53:37Araqyou start it with 'nimrod serve' and communicate over sockets
21:55:06reactormonkAraq, protocol? SWANK? something else?
21:55:27reactormonknimrod 9770 tass 3u IPv4 8829854 0t0 TCP *:x11 (LISTEN)
21:55:37reactormonkI assume that one.
21:55:42reactormonkand wtf @ x11 port
21:56:29reactormonk msgs.gErrorMax = high(int) # do not stop after first error
21:56:30reactormonklol
21:57:08Araqreactormonk: if zahary didn't change it, the protocol is that you pass the command line over the socket
21:57:37Araqand terminated by \n
21:59:14zaharyI've also added another mode of operation, where you start a nimrod process and communicate with it over the input/output pipes
21:59:26Araqoh hi zahary
21:59:32AraqI've a list of questions
21:59:35Araqbrb
21:59:37reactormonkzahary, \o/
22:00:16reactormonkzahary, good, gotta rewrite nimrod-mode then to use std/out
22:01:28zaharyreactormonk. I noticed your working on the emacs mode, I'll help you as much as I can
22:01:31reactormonkzahary, got me a few docs on pipes so I don't have to guess too much?
22:01:39zaharybrb
22:02:05reactormonkzahary, well, I'd prefer a SWANK implementation ;-)
22:07:18Araqzahary: I'm still reviewing all your changes but this is way I've got so far:
22:07:40Araq(1) buckets in idents.nim are safe for caas, no need to ever clear this cache
22:08:22Araq(2) streams: backspace removes the last character? really? which other streams implementation does that? why is it necessary?
22:08:47Araq(3) why export PGeneriqSeq/TGenericSeq?
22:09:42Araq(4) what was the leak in (system/sysstr).setLengthSeq?
22:17:23zahary(1) my extreme measures towards clearing global vars were aimed at hunting the memory leaks. I needed to make absolutely sure that all memory will be reclaimed in the "reset" command
22:19:43zahary(2) I had my doubts about this too, but I never followed through it. I guess, we should revert that, but the problem is that nimrod's standard readLine doesn't behave like the similar functions in other languages which allow basic line editing with backspace
22:20:53zahary(3) sorry about that, I exported it so I can do some nasty casts of GC pointers back to their original types for debugging purposes
22:21:32Araq(2) use -d:useGnuReadline then?
22:22:13zaharyas I said standard readline works differently in most languages
22:23:36zahary(4) is the classic leak where a cycle is orphaned through a decref that doesn't perform the full write barrier
22:24:57AraqI don't get why you have to traverse it there
22:25:08Araqjust tell the GC what to do with it
22:26:01zaharywhat do you mean? to call the old forAllChildren(decref)?
22:27:12zaharyI've deprecated these flags. only waPush is needed now
22:27:33zaharyneeded = supported
22:27:44Araqwhat was wrong with the 'op' parameter anyway?
22:27:53reactormonkzahary, http://web.mit.edu/nelhage/Public/dot-elisp/slime/swank-backend.lisp definterface stuff
22:28:00reactormonkzahary, and http://aemoncannon.github.com/ensime/index.html#tth_sEcC.2
22:28:26zaharyjust a quest for speed. no `op` param, no switching in the inner loop
22:29:04zaharyI'll remove even the range checks for waPush btw.
22:29:27Araqbut the GC is has more code this way
22:29:29zaharyyou can ensure that the buffer has enough space before entering the marker proc
22:30:45zaharyI could see the assembly listing, but I doubt the size impact is significant
22:33:06*XAMPP-8 joined #nimrod
22:34:22Araqswitching in the inner loop was free anyway I'd think
22:34:31Araqso easy to predict
22:35:09Araqwhat's the state of the GC?
22:35:21AraqI see things like:
22:35:24Araqtemplate pseudoRecursion(typ: TRecursionType, body: stmt): stmt =
22:35:25Araq #
22:38:05zaharyI wanted to make all these loops prettier :) I'll make one more commit for tidying things up
22:38:05zaharyotherwise, if you noticed my reset command, after executing it now, the compiler frees all the allocated memory
22:38:58gradhadoes nimrod support a platform where high(int) != high(biggestInt)? if so, which?
22:39:20Araqgradha: any 32bit system for instance
22:39:30zaharyreactormonk, does swank cover all the idetools commands. does it have "find references"?
22:40:53Araqzahary: why was it necessary to change markStackAndRegisters?
22:41:21zaharywhat is changed about it? the new stack top?
22:41:41gradhaah, can't compile with --cpu:i386 because of nimbase.h:484:28: error: 'assert_numbits'
22:41:46reactormonkzahary, any interest in adding swank as interface?
22:42:00Araqyou mark the jmpbug in an extra loop
22:42:06Araq*jmpbuf
22:42:15zaharyyeah, see my notes around setStackTop
22:43:04AraqI read them
22:43:36zaharyso, isn't the problem clear?
22:43:38Araqwhat's that to do with ... oh I get it
22:43:51Araqsweet :-)
22:43:54reactormonkzahary, ensime got that command
22:45:10zaharyreactormonk, I promise at least to look through the spec more carefully. you can easily implement an adaptor for any protocol externally btw
22:45:13reactormonkzahary, swank:uses-of-symbol-at-point
22:45:41zaharyah, thanks, didn't see in the first glance
22:50:21gradhagiven that I can't convert expr in a template to a string, is there any variable holding the curren source's file line I could log?
22:51:12gradhajust like C's __FILE__ __LINE__ defines
22:51:39Araqgradha: you can do that but I forgot how ;-)
22:51:57Araqfor the __FILE__ stuff check out how system.assert does it
22:52:22gradha{.line.} pragma
22:53:30gradhaoh, magical InstantiationInfo
22:55:03Araqoh magical 'astToStr' :P
22:55:48gradhaoh, magical irc
22:55:59gradhawhere were you in the past?
22:56:34gradhaawesome, it works
23:00:09Araqzahary: I don't get your write barrier
23:00:20Araqyou still perform inplace RC updates
23:00:35Araqand .. oh wait
23:00:37Araqnever mind
23:01:31Araqhowever the old GC was concerned about memory usage for an excessive cycleRoots sequence
23:02:03Araqwhich is why I left it as a hash table of bitsets
23:02:36gradhamuahaha, thanks for making nimrod, it's really cool
23:02:37Araqthe papers suggest to use a fixed size buffer for cycleRoots and perform a collection when it's full
23:02:59Araqgradha: a bit late for that ... :P
23:03:11Araqbut you're welcome
23:03:55Araqbut I really dislike the write barrier triggering a GC
23:04:24zaharyerm, I haven't looked carefully at the hash table code, but are you suggesting that it uses less memory than an array?
23:04:34Araqyes
23:04:43Araqyou keep saying it's a hash table
23:04:45zaharyhmm, got to take a look at this :)
23:04:47Araqit's not
23:04:53Araqit's mostly a bitset
23:06:29Araqbut traversing it should surely be slower than an array
23:06:31zaharyhmm, indeed I was fouled. I have such a vivid memory of reading some hash table code somewhere, hmm :)
23:07:28zaharyah. there you go. CellSetGet - this looks a lot like hash table
23:09:28Araqlook at the elements iterator
23:11:16Araqit's a hash table of bit sets and yeah the expensive part is the hash table lookup
23:12:25Araqhowever the first access should be successful
23:12:39zaharybut what is a bitset in this context? some kind of trie? how does it manage to compress memory?
23:12:39Araqand then there is 1 additional memory access for the bit test
23:13:32Araqthere is a bit reserved for every word in a page
23:14:07zaharyok, so if you need to remember some pointer, you raise its bit?
23:14:30Araqyeah
23:14:43Araqand the next pointer will likely be in the same page
23:14:57*gradha quit (Quit: Leaving)
23:15:00Araqin fact, during traversal it optimizes for page-based access
23:15:41Araqpage is some random block size btw
23:15:49Araqit doesn't have to match the OS's page size
23:16:17zaharyI see, clever. I never measure the memory consumption aspect as it never occurred to me it was saving memory, but the iteration speed in marking and freeing cycle roots is quite improved with arrays (2x I think)
23:16:54zaharyI also removed any uses of incl and excl
23:17:14Araqyeah cellsets are now only used for repr I think
23:17:39Araqthe cycle collector was not only wrong
23:18:08Araqit was also optimized for code size and few runtime memory usage
23:18:27Araq3 passes over a graph are slow anyway
23:18:34Araqso I never optimized it
23:19:04Araqand benchmarks never showed it being a bottleneck
23:19:13Araqnow we know why, of course ;-)
23:21:50zaharybtw, did you read my latest notes about the memory safety of retired buffers. this problem refuses to go away :/
23:22:14Araqthe comment in setLengthSeq?
23:22:18zaharyyes
23:23:54Araqwhy is it still a problem if you don't dealloc in growObj anyway?
23:26:15zaharythe problematic situation is when the sequence is shrunk
23:26:38zaharylet x = sq[10]
23:26:39zaharysq.setLen(4)
23:27:19Araqah yeah
23:27:30Araqwell it's sort of an edge case
23:27:44Araqwe could not free anything in the old slots
23:27:45zaharythe question is whether we have "crashes-free" mode
23:28:02Araqthen we leak there until the sequence is recycled
23:28:09Araqor the slots are overwritten again
23:28:50zaharyok, we won't free the slots, but should we run the destructor of sq[10]. then x points to a destroyed object
23:30:29zaharyobviously the code is broken and at some point we must refuse to support it, but the question is what kind of curruption/crash safety guarantees are possible
23:31:01zaharythink about it. I'll have to wake up early in the morning tomorrow, good night
23:31:05Araqwe shouldn't conflate 'setLen' and 'shrink'
23:31:21Araqshrink should free and be unsafe, setlen is faster and leaking
23:31:31Araqdunno yet about the destructor issue
23:31:38Araqwill think about that
23:31:58Araqgood night