<<06-01-2013>>

00:02:03fowl.j#ra
00:02:12gradhaindeed
00:06:27gradhais addr the same as casting to pointer type?
00:07:57dom96addr will give you a `ptr T` where as cast[pointer](...) will just be a `pointer`
00:08:53AlexLibmanDid nimrod by any chance relicense while I was offline? :P
00:09:23gradhaAlexLibman: highly unlikely
00:10:24dom96ping zahary
00:12:19dom96Guess he's not here. Pity.
00:14:44gradhaok, can't cast string to pointer
00:14:50gradhabut I can addr string var
00:15:02gradhabtw, any difference between addr string and addr string[0]?
00:15:11dom96yes.
00:15:24dom96addr string[0] points to the first char
00:15:33gradhacool, I'm overwriting memory then
00:15:55gradhamakes sense
00:16:00dom96For cstring it's the same.
00:16:36gradhahm? isn't that a cast? never seen cstring(string[0])
00:17:05dom96addr cstring and addr cstring[0] is the same.
00:17:19gradhaah, ok, didn't follow you there
00:17:31gradhaotherwise you wouldn't be able to pass cstring to C code
00:17:50dom96yes
00:24:24reactormonkoh, he's gone :-/
00:24:33reactormonkYes, readAll isn't that simple :-(
00:26:43dom96I have a deja vu, I think this issue with readAll was already talked about.
01:06:04reactormonkI have no idea how to implement this correctly - maybe I should look at cruby
01:06:21dom96what are you implementing?
01:06:28reactormonkthe readAll
01:06:45dom96oh, what's the problem?
01:08:42reactormonksee above
01:09:45dom96you're having trouble fixing it? isn't it just a matter of subtracting the current file pos from fileSize?
01:09:50dom96Am I missing something?
01:21:08reactormonknah
01:21:13reactormonkgotta look at it
01:36:47reactormonkdom96, then do it ;-)
01:36:49reactormonkPR and stuff.
01:38:04dom96I fear there is a reason why readAll works that way.
01:40:14dom96and then Araq will hunt me down for wrecking his code :P
01:46:50dom96oh man. You said PR and I thought "Public Relations", only got it now.
01:47:23reactormonkit's one of the few pieces I wrote :-)
01:47:51dom96what? I'm confused.
01:48:02reactormonkthe readAll
01:49:41dom96I can help you fix it if you'd like, sure?
01:50:05reactormonkSo there is no reason why readAll works that way ;-) Go ahead and fix it.
01:50:39dom96come on, you can do it :P
02:11:36reactormonkdom96, https://github.com/Tass/Nimrod/commit/eab61f1c0e78c755611de9e589d1432771c36d69 ?
02:14:31dom96well, you shouldn't do it in rawFileSize
02:14:47dom96Since then the function doesn't do what it's name implies
02:18:54dom96hrm, now that I think about it: readAll implies reading everything, no matter what the file pos is.
02:22:38dom96We need our BDFL to decide :P
02:24:46NimBotnimrod-code/Aporia 6d36d13 Dominik Picheta [+0 ±3 -0]: Implemented a fail-proof way to scroll successfully.
02:25:03reactormonk^^
02:25:36dom96I finally figured out how to force GTK to scroll my SourceView :D
02:26:56dom96Good night
02:27:17reactormonkye too
02:35:38reactormonkAny way to get all possible symbols in context? Just go to EOF and call suggest?
10:08:02*fowl joined #nimrod
11:27:55*q66 joined #nimrod
14:01:14dom96I found a case where --def causes the compiler to go into a infinite recursion...
14:21:43AlexLibman* Objective-C wins the TIOBE Programming Language Award of 2012! - http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
14:21:53AlexLibman^ "Other interesting moves of 2012 are the renaissance of C++ (+1.09%, boosted by Microsoft) and Python (+0.96%). On the other hand, C# (-2.57%, due to its late entrance in the mobile market) and Delphi (-0.65%) lost considerable market share."
14:25:48*dom96 dreams of the day Nimrod gets the award
14:27:37AlexLibmanWon't get there if it's copyleft.
14:30:49AlexLibmanLibmanrod, a competing copyfree Pythonesque-to-C compiler, will get the award instead. :P
14:35:10dom96patience is a virtue :P
14:41:45dom96AlexLibman: Have you written any Nimrod yet?
14:53:22AlexLibmanOfficially, I wouldn't admit to writing anything in a non-copyfree language. But there are rumors of an `ununi` command on my system, which uses "unidecode" and renames all unicode filenames to ASCII, no longer being a Node.JS script. ;)
14:54:54dom96hehe, good good.
16:46:01apotheonIs there an INI file parser library for Nimrod?
16:46:24dom96apotheon: http://build.nimrod-code.org/docs/parsecfg.html
16:46:38apotheonAh, nice. Thanks.
16:47:45apotheonBy the way . . . why "of" in "case"?
16:48:28apotheonThat's a much nicer lib design than what I've seen for C INI parsers.
16:48:59dom96You're going to have to ask Araq that :)
16:49:18dom96my guess is: it's not much to type.
16:49:21apotheon"Of" would make more sense if it was "incase" instead of just "case", I suppose.
16:55:27dom96I don't think much of it nowadays. "case" + "of" is completely natural to me now :)
16:57:29*AlexLibman joined #nimrod
16:58:03*_ponce left #nimrod (#nimrod)
17:13:31NimBotnimrod-code/Aporia c767d72 Dominik Picheta [+0 ±4 -0]: Fixed problems with CustomStatusBar.
17:13:31NimBotnimrod-code/Aporia 5b34ac6 Dominik Picheta [+0 ±2 -0]: Fixed a recently introduced status bar bug.
18:42:58Araqhi guys, I'm back
18:43:42AraqAlexLibman: 'of' was chosen because: 1) I was familiar with 'case x of' from Dephi
18:44:02Araq2) it has to be keyword, things like '|' clash with user definable operators
18:44:30Araq3) couldn't think of any shorter keyword ;-)
18:48:37AlexLibmanwb Araq. Apotheon was asking about 'of', not I.
18:48:55Araqoh ... sorry
18:49:14AlexLibmanI once imagined a language with single-character keywords...
18:49:44AraqI imagine one that uses special chars instead everywhere
18:49:52AlexLibman(not counting type qualifiers, like ui64)
18:49:59Araq? would be 'if', @ would be 'while' etc.
18:50:56AlexLibmanWith unicode, you can make it work rather well.
18:51:13AlexLibman(Assuming your editor makes it easy to input unicode characters.)
18:51:19Araqtyping most unicode characters is still too much of a pain
18:51:36AlexLibmanRelated idea: http://xahlee.info/comp/html6.html
18:53:20AlexLibmanAll we need is consistant character names, like "mdash". Then it's trivial to create a keyboard shortcut to insert that character, even at OS level.
18:53:52Araqhow would I write "mdash" then?
18:54:00AlexLibmanBut that defeats the purpose of single-character keywords. :P
18:54:04Araqthe word, not the character
18:55:06apotheonI'm sure emacs has an RSI for that.
18:55:22AlexLibmanYou just type "mdash" to insert the word. To turn it into a character, that depends. On OS level it could be something like caps lock while typing it. On editor level, you can type it and then press Ctrl-something to autoconvert word at cursor.
18:55:26apotheonRSI is my new term for "command" when referring to emacs.
18:56:03AlexLibmanJust random thoughts...
18:56:48AlexLibmanhttp://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML
18:57:18apotheoncontrol-x control-u shift-alt-r for ř
18:59:39AlexLibmanSo like you press Ctrl-& (Ctrl-Shift-7, like the XML prefix char) and the editor goes into insert character mode. You type "di", and the autosuggest scrollbox suggests "divide" for '÷'.
18:59:53apotheon(Don't try that. It probably overwrites your filesystem with zeroes.)
19:01:33AlexLibmanYet Another Useless Idea™ (Ctrl-&trade)
19:02:01apotheonI think you're trying to reinvent xemacs.
19:02:15apotheonConsidering it shouldn't have been invented in the first place . . .
19:02:32AlexLibmanWhat I suggested has nothing to do with xemacs.
19:02:50AlexLibmanIt's like saying you're trying to reinvent apples because your alias starts with "ap".
19:02:54apotheonCtrl-Shift-7 di click
19:02:58apotheonlooks like xemacs to me
19:03:21apotheonHere's a simpler solution:
19:03:22AlexLibmanSingle keystroke combinations are used in every program.
19:03:24apotheonJust use a Compose key.
19:03:40AlexLibmanI don't have a compose key.
19:03:45apotheonConfigure one.
19:03:48AlexLibmanOK, here's the UNIX Way To Do It...
19:04:26AlexLibmanYou have a small program that outputs a unicode character based on argument. It would have a very short name, like `U`. (Uppercase U.)
19:04:44apotheonsetxkbmap -option compose:ralt
19:05:25AlexLibmanAnd you have an editor with command mode, and a very easy way to insert command output at cursor, or filter selection through a command.
19:08:57AlexLibman"... and that the name of Silicon Graphics not be used in advertising or publicity pertaining to distribution ..." -- /usr/ports/x11/setxkbmap/work/setxkbmap-1.2.0/COPYING :P
19:10:45Araqhtml5 looks like a very good idea
19:10:50Araqer, html6
19:11:05AlexLibman:D
19:11:21Araqso it'll never happen :P
19:12:27AlexLibmanI prefer whitespace formatting anyway.
19:13:39AlexLibmans/whitespace formatting/\"off-side rule\"/
19:14:54AlexLibmanHey, http://en.wikipedia.org/wiki/Off-side_rule#Off-side_rule_languages mentions Nimrod, but links to http://en.wikipedia.org/wiki/Nimrod_(distributed_computing)
19:15:56AraqI noticed
19:16:54apotheonAlexLibman: I do have an editor like that . . . but the Compose key doesn't need all that.
19:16:59AlexLibmanWhat I want is an HTML/CSS/JS type format for defining textual interfaces, with support going all the way back to DOS. It would be very menu and keyboard oriented.
19:17:02apotheonAlexLibman: Why do you always want to reinvent the wheel?
19:17:40Araq"The good thing about reinventing the wheel is that you can get a round one."
19:17:57AlexLibmanYou could then compile that syntax into C (that you could even compile in dosbox, or regular UNIX terminal) -or- into HTML/JS/CSS to run in th browser.
19:18:03apotheonAraq: AlexLibman likes 'em triangular.
19:18:12*AlexLibman ignores apotheon
19:20:18apotheonThere are many problems not satisfactorily (for now) solved that could use our attention, rather than problems that have half a dozen satisfactory solutions -- especially when the new solution we come up with is unsatisfactory, like requiring drop-down lists.
19:20:49apotheon. . . or typing en_US.UTF8'ian.
19:22:40apotheonI'm morally opposed to general purpose programming languages that cannot be used with any seriousness unless you have drop-down lists.
19:23:04apotheon(I use the word "morally" pretty loosely here, but you get the idea.)
19:23:37apotheonhttps://xkcd.com/927/
19:23:39apotheonsums it up
19:24:24apotheonNimrod, on the other hand, has promise.
19:25:06Araqthanks :-)
19:27:13apotheonquite welcome
19:28:23apotheonI'm tempted to create variant implementations of various languages that treat all trailing whitespace as Whitespace language syntax, then randomly replace other implementation deployments with my fudged implementations, just to teach people better whitespace discipline.
19:28:58Araqwhat is "better whitespace discipline"?
19:29:07Araqwhy is it important?
19:30:16apotheonLinewraps can get ugly (well, uglier) on long lines of code with trailing whitespace.
19:30:47apotheon(for example)
19:33:47apotheonSome timesaving editor facilities aren't as timesaving with trailing whitespace.
19:33:54apotheon(for another example)
19:34:16apotheonSome grep expressions will unexpectedly fail with trailing whitespace.
19:34:20apotheon(for another example)
19:34:48apotheonI could probably come up with examples of why it's important all day.
19:35:27Araqfor now you didn't convince me ... :P
19:35:29apotheonI'd say "whitespace discipline" is "not being careless with whitespace so that you have a bunch of whitespace weirdness in your text that you don't even know is there", or something like that.
19:36:38apotheonMaybe I'll start sending you patches for Nimrod (after the license change) with sloppy whitespace management (outside of indentation, of course).
19:36:46apotheon. . . until you ask me to stop.
19:37:05Araqplease stop ;-)
19:37:12Araq1) I'm aware of it
19:37:14apotheonAha! I've convinced you after all!
19:37:30Araq2) it's because of it's been translated automatically
19:37:40Araq3) the diffs are distracting
19:37:55apotheonOh, diffs. I should have mentioned that first.
19:37:55Araq4) it's almost never more than a single space at the end of the line
19:39:05apotheonWhat's a faster way to do "$bElC" in vi?
19:39:37apotheon(faster == fewer keypresses)
19:40:43apotheon":s/\s\+$/" is obviously longer
19:42:39Araqbbl
19:44:09apotheonI was confused for a moment there, thinking "That doesn't do anything *like* $bElC!" until I realized Araq was just saying he'd be back later.
19:59:55*Araq_bnc joined #nimrod
20:48:54NimBotnimrod-code/Aporia fce15e7 Dominik Picheta [+0 ±3 -0]: Improved user feedback regarding single instance mode.
20:48:54NimBotnimrod-code/Aporia 69ab1a5 Dominik Picheta [+0 ±3 -0]: Fixed bug in findTab and updated Nimrod's language definition.
21:23:01Araqq66: I read that x+y where x, y are for instance unboxed int64 does allocate on the GC heap
21:23:07Araqin luajit
21:23:11Araqis that correct?
21:23:24q66i don't know
21:24:09Araqwell the FFI guide says something like that
21:25:30AraqI'm evaluating luajit for nimrod's REPL again ... as interfacing via libFFI is getting very time consuming
21:35:08q66Araq, you mean this?
21:35:12q6664 bit integer arithmetic: the standard arithmetic operators (+ - * / % ^ and unary minus) can be applied to two cdata numbers, or a cdata number and a Lua number. If one of them is an uint64_t, the other side is converted to an uint64_t and an unsigned arithmetic operation is performed. Otherwise both sides are converted to an int64_t and a signed arithmetic operation is performed. The result is a boxed 64 bit cdata object.
21:35:46Araqq66: yep
21:36:10q66Araq, look what section it is in
21:36:13q66arithmetic on cdata object
21:36:21q66a number is not a cdata object
21:36:27AraqI know
21:36:39Araqer, a Lua number is not a cdata object
21:37:00Araqbut I intend to use luajit mostly for unboxed operations as Nimrod doesn't require boxing
21:37:27AraqI plan to misuse it as a great JIT with excellent C interop
21:37:59Araqso most generated code will operate on cdata, not on Lua's native data structures
21:39:00q66Araq, just trying stuff, it doesn't seem like the result of the operation is a different object.
21:45:12Araqso luajit optimizes that away?
22:08:41*gradha joined #nimrod
22:18:34Araqhi gradha
22:18:39gradhahi
22:18:47AraqI know about the closure bug that you triggered
22:18:56Araqbut do have a small test program that triggers it?
22:19:11Araqthat should definitely help
22:19:35gradhawasn't a chunk of it in the pastebin?
22:20:22Araqlet me take a look again
22:20:33gradhado you mean http://pastebin.com/1nrWZKJU ?
22:21:29Araqoh hrm
22:21:37Araqthat's a new bug
22:21:48Araqthe error is weird thoug, isn't it?
22:22:12gradhathat comes from parallelBuild
22:22:42Araqwell please make a bug report
22:22:49AraqI'll take a look later
22:22:57gradhais https://github.com/Araq/Nimrod/issues/297 this closure bug you mean?
22:23:21Araqno that's another new one ;-)
22:23:28gradhameh, lucky me
22:23:29Araqthe closure bug is not yet reported I think
22:24:12gradhabtw, I'm trying "each(oneList, `$`)" but doesn't compile with "Error: '$' cannot be passed to a procvar"
22:24:17gradhawhat's the correct syntax for what I mean?
22:24:57Araqeach(oneList, proc toString(x: dunno): string = $x) I guess
22:25:51gradhais `$` special and therefore not a normal proc?
22:26:17Araqno in fact, only procs marked with .procvar. are first class
22:26:33Araqread the reasons for that in the manual
22:26:43Araqand post on the forum if you disagree with them
22:27:17gradha"The procvar pragma is used to mark a proc that it can be passed to a procedural variable."
22:27:28gradhathat's certainly concise
22:27:40gradhaI'm going to meditate over that
22:27:54Araqor you could try and find the passage that I meant :P
22:29:34gradhaI'll meditate then over "The rules' purpose is to prevent the case that extending a non-procvar procedure with default parameters breaks client code"
22:30:14Araqwhat's not to understand about that?
22:31:14Araqhtmlparser.parseHtml (just an example!) may get an additional parameter with a default value
22:31:31Araqso code that used parseHtml continues to work
22:32:06Araqbut ugh, it doesn't because some brainiac could have assigned it to 'var x = parseHtml'
22:32:35Araqand relied on the fact that the signature PStream -> PXmlNode is cast in stone
22:33:11Araqso ... what can you do? you can't ever introduce a new parameter with a default value
22:33:17Araqbut you have to use overloading instead
22:33:29AraqIMO this sucks
22:34:00gradhathe problem is "var x = parseHtml" doesn't get the default parameters?
22:34:22Araqthe type of 'x' will change
22:34:55Araqif you do: 'var x: proc (x: PStream): PXmlNode = parseHtml'
22:35:08Araqis wouldn't compile anymore
22:35:21Araqit's rude to rely on the signature to never ever change
22:35:42Araqso procs that promise stability need to be marked with 'procvar'
22:36:34Araqand default parameters are only one example btw; the proc may also be turned into a template for instance
22:36:35gradhawhat default parameters are you planning to add to `$`?
22:37:38Araqwell a `$`(x: datatype, bufferSize: int): string could be introduced
22:38:01Araqbut $ would be nice for system.each I agree
22:38:31gradhalet's say I have proc(a: int): int
22:38:50gradhanow, instead of adding a default parameter to it, can I add another one named proc(a, b: int): int?
22:39:09gradhawith 'b' being a new default parameter
22:39:48Araqyes
22:41:02gradhaI'll meditate on your concept of politeness
22:41:05*fowl joined #nimrod
22:41:19Araqfor the built-in operators there is indeed an implementation problem
22:42:14Araqas often there is no machine code that would represent the proc, but this can be solved in the compiler
22:44:37gradhathe problems with new default parameters you have described, don't they apply to a proc using aparameter of type varargs[string, `$`]?
22:46:20Araqno