<<27-01-2013>>

00:00:35Araqreactormonk: the information is in the generated type info
00:01:03AraqI need to fix it in the codegen; should be quick
00:02:40Araqoh but it'll lose your space I think :P
00:02:50Araqhowever you should do:
00:03:16Araq enumField = "its string repr", enumFieldB = "B's string repr"
00:03:35Araqthen it should work
00:05:05reactormonktiling.nim(5, 3) Error: 'Top' cannot be assigned to
00:05:35Araqtype TMyEnum = enum
00:05:43Araq enumField = "its string repr" enumFieldB = "B's string repr"
00:05:56Araqobviously :P
00:07:53reactormonk...
00:08:31reactormonkHow can I access the string for here then?
00:08:44Araqwith the builtin $ operator ;-)
00:08:47reactormonk$ triggers the same error
00:08:52AraqI know, working on it
00:10:11Araqreactormonk: how to convert a number into a string in JS btw?
00:12:25reactormonkeehm
00:12:40reactormonk"" + 2
00:12:42reactormonk'2'
00:13:19Araqthat's how I would have implemented it :-)
00:13:19reactormonkor (2).toString()
00:13:27Araqugh
00:13:36reactormonk2.toString seems to parse it as a float and fail
00:13:53reactormonkat least node
00:13:54Araq"" + 2 may be better for the JIT
00:14:19reactormonk"" + a maybe not
00:16:07Araqbut it should
00:39:10NimBotAraq/Nimrod 42d671f Araq [+0 ±1 -0]: implemented $/repr for enums for the JS target
00:39:11*q66 quit (Quit: Quit)
00:39:30Araqreactormonk: implemented now
00:39:44reactormonkbooting...
00:40:49reactormonkitem_26134 = (var defaultbindings_26096 = NimCopy([{Field0: 0, Field1: cstrToNimstr("M-9")}, {Field0: 1, Field1: cstrToNimstr("M-8")}, {Field0: 2, Field1: cstrToNimstr("M-0")}, {Field0: 3, Field1: cstrToNimstr("M-i")}, {Field0: 4, Field1: cstrToNimstr("M-p")}, {Field0: 7, Field1: cstrToNimstr("M-,")}, {Field0: 5, Field1: cstrToNimstr("M-m")}, {Field0: 6, Field1: cstrToNimstr("M-.")}], NTI26097);
00:40:51reactormonk, defaultbindings_26096)[i_26144];
00:40:53reactormonkhmmm
00:42:45Araqthat looks like wrong code :P
00:45:16Araqbut now that you've seen my fixes you should know how the JS backend works
00:45:25Araq;-)
00:45:27Araqand can fix it yourself
00:50:40*Anaphaxeton quit (Remote host closed the connection)
00:56:41reactormonkwhy wrong code?
00:56:56Araqis it correct?
00:57:02Araqlooks wrong to me
00:57:22reactormonkwell, item_X is used afterwards
00:57:26reactormonkso it's not that bad
00:57:37reactormonkerr, wait.
00:59:50reactormonkwhile (false);
00:59:53reactormonkwhut?
01:02:11Araqwell I have to sleep now
01:02:14Araqgood night
01:02:27reactormonkgood night and thanks for the help
01:02:58reactormonk http://sprunge.us/NVJI
01:03:05reactormonkjslint does not like generated JS ^^
01:05:31NimBotnimrod-code/Aporia 09274b7 Dominik Picheta [+0 ±2 -0]: Added "Go to definition" to the Edit menu.
01:05:58reactormonkdom96, not really edit imo
01:06:16reactormonkdom96, edit is something that changes a file. Put it somewhere else.
01:06:28dom96where should I put it?
01:07:37dom96I guess I'll make a separate section called "Find" or something
01:07:52dom96But it's late, so I don't feel like it :P
01:08:06reactormonkdom96, make a github issue then
01:09:16dom96I'll add it to my todo file :)
01:10:16dom96reactormonk: Are you using Aporia yet?
01:14:29*Anaphaxeton joined #nimrod
01:16:06reactormonkdom96, I'm stuck with vim keybindings.
01:17:00dom96Make an issue, I might be able to help out with that.
01:20:03dom96But let me know what keys you use and such.
01:21:07dom96Full vim support would be a bit too much, from what I recall with my adventures with vim.
01:34:38dom96good night
01:37:49reactormonkdom96, that's likely.
01:38:01reactormonkdom96, well, hell a lot.
02:02:41Anaphaxetonnighters
02:39:15*XAMPP-8 joined #nimrod
02:55:48reactormonk... works halfway.
04:12:42*SchalaZeal joined #nimrod
04:13:23SchalaZealI'm rather curious as to how importobjc pragma works.
04:13:54SchalaZealI'm looking at the "horrible example" and I don't know where "Greater new" came from
04:22:35SchalaZealoh wait
04:22:41SchalaZealWikipedia...heh
04:52:11*SchalaZeal quit (Quit: Konversation terminated!)
05:44:00*XAMPP joined #nimrod
07:34:53Anaphaxetongood morning
07:42:40*shevy joined #nimrod
09:57:39*XAMPP-8 quit (Read error: Connection reset by peer)
10:10:44*XAMPP-8 joined #nimrod
11:17:40*q66 joined #nimrod
11:35:31dom96'morning
11:41:13shevysex
11:41:16shevyoops wrong channel!!!
11:43:31dom96lol
11:54:11Anaphaxetonhaha
11:58:35shevyyou know what would be nice?
11:58:49shevyif you could mix in different scripting languages, and they'd all have very good, strong points each
11:58:58shevyso that you could actually use them for their strengths
11:59:11shevywhen I look at php, the strengths it has are rather few
11:59:31shevythe only ones I could think of, is actually software like phpBB or mediawiki
12:22:06q66but both phpBB and mediawiki are pretty bad
12:56:38dom96Yet PHP somehow manages to be used by all these big websites like Facebook.
13:10:43Anaphaxetonmarketing works
13:11:07Anaphaxetonthey promoted php a lot back then
13:50:20shevyq66 I think both phpBB and mediawiki are quite good, compared to many other things out there. you also always need to look at what a competition can offer
13:50:33shevyin ruby, without ruby-on-rails there would be barely any real competition at all to these :(
13:50:54q66shevy, both phpBB and mediawiki are prone to spam attacks
13:51:11q66more so than the other apps
13:52:52shevywell that is understandable, if software is used a lot, more people will try to break it
13:53:44q66shevy, but PHP just encourages bad security and attacks
13:54:11shevyphp is a fairly awful language, yeah
16:23:01*FreeArtMan joined #nimrod
16:55:03*gradha joined #nimrod
17:27:58*gradha quit (Quit: Leaving)
18:04:23*XAMPP-8 quit (Ping timeout: 246 seconds)
18:15:35NimBotAraq/Nimrod 3b1ca1e Araq [+0 ±5 -0]: bugfix: typeinfo.extendSeq
18:31:54*codeallergy joined #nimrod
18:32:13Araqping reactormonk
18:39:44*gradha joined #nimrod
18:47:24Araqhi gradha
18:48:16gradhahi Araq
18:48:54Araqmy brain is dizzy so: given too ranges A..B and C..D how do I check for any overlaps?
18:49:52gradhaYou could try testing for exclusion
18:50:02gradhaif D < A and C > B then they don't overlap
18:50:18gradhaactually, that would be an or
18:51:20Araqbut that's not sufficient, is it?
18:51:47gradhano, you would need to test the same for the reverse range, meaning A..B doesn't overlap C..D
18:52:16Araqnot overlapping iff A notin C..D and B notin C..D ?
18:52:24Araqdoesn't work, right?
18:54:11gradhaif it makes more sense you can always check for the inclusion of C or D inside A..B plus the check of C < A and D > B
18:54:44gradhasounds like something which should have been debated to death on the internets, let's check
18:55:20gradhahttp://stackoverflow.com/questions/3269434/whats-the-most-efficient-way-to-test-two-integer-ranges-for-overlap
18:55:40gradhaagain, this considers ranges are integers
18:55:47gradharanges are more fun with floats and epsilons
18:56:54NimBotnimrod-code/Aporia 9be6af5 Amrykid [+0 ±5 -0]: Windows improvements.
18:56:54NimBotnimrod-code/Aporia 2dedd77 Dominik Picheta [+0 ±3 -0]: 'piekno' is now the default color scheme.
18:56:54NimBotnimrod-code/Aporia 3c25dc5 Dominik Picheta [+0 ±5 -0]: Merge branch 'master' of git://github.com/Amrykid/Aporia into Amrykid-master
18:56:54NimBotnimrod-code/Aporia 0031640 Dominik Picheta [+0 ±5 -0]: Refactored GetCmd. Renamed getNimrodPath to promptNimrodPath.
18:57:14*shevy quit (Ping timeout: 246 seconds)
19:00:11Araqwell the top answer should work with floats too
19:02:42gradhaI believe the formula I have been using so far is C > B AND D < A AND A > D AND B < C -> no overlap
19:02:42gradhanever bothered to check if it worked, seemed legit
19:03:22gradhahmm... but it might not have been ranges what I were testing... huh, what a help
19:08:35gradhaoh, just realized why the stackoverflow answer wasn't making sense to me: I'm used to expressing ranges in form x1,y1 vs x2,y2, not x1,x2 vs y1,y2
19:08:55Araqbbl
19:10:03*shevy joined #nimrod
20:26:37reactormonkAraq, pong
20:27:27Araqreactormonk: do you feel like testing exception handling for the JS backend?
20:27:38reactormonkAraq, didn't need any so far
20:28:22reactormonkAraq, sure, but not today
20:28:31Araqok
20:28:48Araqwhat about the wrong produced JS code? or did that work?
20:29:21Araqwhat about closures for the JS backend? what's the problem with them?
20:31:17reactormonkAraq, nope, but that may not be my fault, gotta debug it
20:31:36Araqalright
20:42:10*FreeArtMan quit (Read error: Operation timed out)
21:58:31NimBotAraq/Nimrod fce5975 Araq [+1 ±3 -0]: bugfix: overlap checking for 'case'
22:11:50gradhaAraq: you mentioned that "for" inlines iterators
22:12:04gradhais this inlining different from a proc marked as inline?
22:12:49Araqyes
22:13:07Araqfor a start the nimrod compiler does it, 'inline' for procs is left to C's optimizer
22:13:38Araqbut the real difference is that inlining an iterator means that 'yield' is replaced by the for loop body
22:13:56Araqthis has consequences for code size
22:13:58gradhaoh, nasty
22:14:16Araqthe stdlib's iterators only use 1 'yield' for a reason ;-)
22:15:06Araqbut closure iterators don't have this problem
22:15:53gradhacoming back to the discussion on "type future compatibility", why do procs by default use the closure calling convention if you need to mark them as {.procvar.} to actually use them as closures? wouldn't nimcall be better as the default calling convetion?
22:16:44Araqyour question doesn't make sense because the claims in it are wrong :P
22:16:56gradhathat's what I was supposing
22:17:26gradhaI think you said nasty people do "var x = procBlah" and that can break in the future
22:17:45Araqproc *types* default to 'closure' so that it's not overly verbose in sort's signature etc.
22:18:15Araq*procs* default to nimcall but that is compatible to 'closure'
22:18:49Araqan explicit calling convention implies 'procvar' (though that's wrong for .inline.)
22:19:31gradhahow can nimcall procs be compatible with closure if they lack the additional hidden environment parameter? does the compiler not need this hidden parameter?
22:20:13gradhaI think my problem is I don't understand the manual with nimcall and closure both being defaults
22:20:39gradhaif I write a proc without pragmas, is it nimcall or closure? not that I care, just trying to understand the manual
22:20:57Araqa proc without pragmas is nimcall
22:21:08Araqa proc *type* without pragmas is closure
22:21:22Araqtype ProcTypeHere = proc (a, b: int) # closure
22:21:57Araqproc realProcHere(a, b: int) # nimcall
22:22:29gradhaoh, so whenever you write a proc accepting a proc it is always of closure type
22:22:40gradhathe parameter
22:22:51Araqyes
22:22:52gradhaand the proc itself is a nimcall
22:22:59Araqyes
22:23:14gradhaeverything clear now, thanks
22:29:06Araqdom96: what about the osproc/tester bugfix?
22:31:58dom96oh yeah. I'll get right on that. Need to take a shower first though.
22:37:54Araqgradha: what about the 'procvar'? do you still think it's a bad idea?
22:38:35AraqI'd argue it's even more tolerable once we got the shorter lambda syntax with better type inference
22:38:36gradhaI'll tell you if I ever hit the issue, most of the time I talk about corner cases simply because it is fun
22:39:09Araqwrapping the library proc in a lambda is future proof
22:39:33Araqand it's exactly what the compiler would have to do for system.`+`
22:39:54Araqso I think it's a pretty good idea and fits the language perfectly fine
22:40:32gradhaIIRC I didn't pursue the conversation further because I still don't understand why adding a default parameter to a proc used as the type for a var would break compilation
22:40:57gradhawell, I sort of undestand it, or maybe not
22:41:10gradhatoday it's unsure day for me
22:41:14Araqbut extra parameters are not binary compatible
22:41:39Araqfor closures it works because the compiler inserts some magic for you
22:41:53Araqbut it only works because it's a single additional parameter
22:42:07gradhacan't you add magic to the compiler to add the default parameter then?
22:42:37Araqwell the compiler could rewrite a default param to an overloaded proc
22:42:52Araqbut that's a code explosion waiting to happen
22:43:37gradhawould this problem go away if you couldn't have binary nimrod code and always had to parse again everything?
22:43:37Araqproc p(a = 0, b = "", c = false)
22:43:57gradhaI mean the object files in nimcache and incremental compilation
22:44:12Araqthat has nothing to do with it
22:44:58Araqit can go away with a custom calling convention like Haskell uses afaik
22:45:22Araqbut a new custom calling convention is hard to do when targetting C
22:45:35Araqnor is the problem worth the effort
22:45:39gradhaok, don't mind me then, I still don't understand enough to discuss this seriously
22:49:26Araqer .. forget this
22:49:37Araqhaskell doesn't support that either anyway
22:49:58Araqin fact, it's not currying
22:50:10NimBotAraq/Nimrod c87973d Zahary Karadjov [+0 ±18 -0]: caas is now drivable through stdin... 4 more lines
22:50:10NimBotAraq/Nimrod c8312eb Zahary Karadjov [+0 ±23 -0]: CaaS in-memory caching... 4 more lines
22:50:10NimBotAraq/Nimrod 4721506 Zahary Karadjov [+0 ±9 -0]: [caas] first version that actually works (still has a lot of logical memory leaks on recompilation)
22:50:11NimBotAraq/Nimrod c77df1f Zahary Karadjov [+0 ±7 -0]: store the instantiation cache in the generic symbol
22:50:11NimBotAraq/Nimrod b2481c4 Zahary Karadjov [+0 ±3 -0]: experimental compile-time rope formatting code
22:50:12gradhayou'll find a better ROI poking dom96 to do stuff rather than discussing with me
22:50:39gradhahuh? the mythical caas branch ready? is it christmas?
22:51:01Araqhi zahary
22:51:13zaharyhi everybody, sorry for not being around in the last week
22:51:50zaharyI'm changing jobs and this is keeping me too busy
22:52:19Araqer ... congratulations then?
22:52:43zahary:) sure
22:52:51gradhaexcellent
22:55:22Araqwhat about the GC?
22:55:53Araqyou have both fixes for the old one and working on a new one, right?
22:56:21zaharythe old one is not really fixable
22:56:31zaharyit performs pruning in a wrong way
22:56:31Araqof course it is
22:56:44Araqwell alright
22:56:48Araqlet me fix it then
22:57:08Araqand you should give your GC a name and add it to the --gc option
22:57:21zaharylet me just explain what I mean
22:57:31Araqok
22:59:28zaharythe real reason why the old GC is so fast is this line:
22:59:28zaharyhttps://github.com/Araq/Nimrod/blob/master/lib/system/oldgc.nim#L607
22:59:29zaharyin the mark phase it only considers objects that are current cycle candidates
23:00:06zaharythis is a very small number of objects most of the time (given the fact that cycleRoots is cleared between collections)
23:01:15zaharyto implement a proper fix, you can either remove this pruning method or if you keep the original python approach, cycleRoots should not be emptied, but rather it should contain all alive cyclic objects
23:01:41zaharynow, this is a much much larger set of objects that will bring the old GC to a crawl
23:01:48gradhadoes a substr proc exist for sequences where it returns a range of a sequence?
23:02:11Araqgradha: there is s[1..3] for sequences, but no substr
23:02:26gradhaoh, slices work on sequences? cool
23:04:19Araqzahary, you said the difference was 0.3s for bootstrapping iirc
23:04:37Araqthat's not "bring it to a crawl", is it?
23:05:34dom96yay, it is christmas!
23:06:09zaharywhat I mean is that the old GC cannot be fixed in a useful way - sure, you can spent some time plugging the leaks, but you won't get better performance
23:06:43zaharythe constant factor of the old GC is higher, because it uses hash tables where the new GC uses arrays
23:08:04zaharyI've currently left a way to switch the GC in mmdisp, and there are some useful print outs of various stats you can look at
23:08:34AraqI don't mind a crappy cycle collector
23:08:43zaharyyou can find a special revision in the logs where the print outs are enabled
23:08:56AraqI do mind a GC that wasn't written by me :P
23:09:17zaharywell, the new one is not much different, try to read the code
23:09:27Araqwell, a new GC isn't something that's introduced without a fallback to the old one
23:10:22Araqbtw you broke 6 tests
23:14:45zaharyI know, I'll try to fix them in the next few days
23:15:12zaharyI started with 20 broken tests after the merge
23:16:20Araqalright
23:16:33Araqwhat's broken?
23:19:06dom96zahary: docs for caas would also be nice.
23:19:07zaharyI've changed the way IDs are assigned to files and modules and I need to make a small change in how symbol files use them
23:19:07zaharyone of the tests that fails locally looks bad tho - it appears and disappears with unrelated code changes - could be something about the new GC
23:21:59zaharydom96, I'll try to integrate it in my vim plugin and it could serve you as a reference implementation
23:23:58gradhaAraq: found this as semi-broken https://github.com/Araq/Nimrod/issues/321
23:23:58dom96Alright.
23:24:19zaharyAraq, another thing - currently, it's easy to switch GCs, but I plan to generate a bit more optimised marker procs that will be compatible only with the new one
23:25:14Araqgradha: negative indexes are supposed to work for seqs
23:25:47gradhacool
23:26:26gradhawait, but do they reverse the sequence if necessary, or would they only work as long as the second index is bigger than the first?
23:27:11gradhaah, ok, so they don't reverse, [-3..3] works, since -3 is lesser than 3 in this case
23:27:45gradhathe negative seems to be a problem for the second index
23:27:59Araqyou need to split up '..-' into '.. -'
23:28:11Araqdue to the operator lexing rules
23:28:41gradhaok, so negative indexes work, no plan for reversing the sequence on the fly?
23:29:35gradhahmm... not sure if I want this feature myself
23:30:06gradhajust asking, since asking is free
23:32:48Araqno reverse on the fly
23:35:41gradhabtw, the repr(t) which crashes was found when I was trying to use the t as an index into a TTable, in this situation it doesn't crash but the types don't match
23:36:09gradhaI usually log with repr to see if the type I'm getting is the one I am expecting
23:43:53gradhadoes something use the ropes module? I see no examples, and have trouble finding a use case for them
23:44:34Araqthere are no good use cases for them because they're slow
23:44:52Araqin theory they are great though, O(1) string concat
23:45:18Araqso if you build a huge output file from lots of small pieces it can be the tool of your choice
23:46:00gradhadoes the reverse exist? something which given a huge string creates substrings by using pointers into the bigger one? I would find that useful for parsing
23:46:55Araqthere are helpers in parseutils which take (s: string, startIndex: int)
23:47:18Araqand there are ways to implement efficient slices in Nimrod, but the stdlib doesn't
23:47:48AraqI use integer indexes for parsing instead
23:48:47gradhayou convert the indices into string objects with the substr proc or something internal more efficient?
23:49:01gradhaor maybe you don't convert ever to string?
23:50:34Araqoften I have a buffer that is 4-8K and so can't keep the entire input anyway and I produce a single string containing the parsed token
23:51:06Araqtry that with slices :P
23:51:28Araqit requires you to keep your whole input in memory then
23:52:24gradhayes, I was thinking of input which always fits in memory
23:52:39Araqbut with mmap() and virtual memory it could be the better option, yeah
23:59:42NimBotAraq/Nimrod 22a93a0 Dominik Picheta [+0 ±1 -0]: Fixes #317