<< 11-05-2014 >>

00:22:33*superfunc joined #nimrod
00:34:46flaviuAraq: If you aren't asleep yet, consider how bignums would interact with the rules you're implementing. If they are to fit into your new type system, then you'd need a way of describing them to it. Same thing could be done with the current magics
00:46:14*Matthias247 quit (Read error: Connection reset by peer)
00:59:18*superfunc quit (Ping timeout: 240 seconds)
00:59:28*DAddYE_ quit (Remote host closed the connection)
00:59:55*DAddYE joined #nimrod
01:00:45flaviuhttps://www.artima.com/forums/flat.jsp?forum=106&thread=171028&start=0&msRange=90
01:04:44*DAddYE quit (Ping timeout: 265 seconds)
01:13:16flaviuWith the modifications to the language I was talking about, I think its possible to implement dependent without even touching the compiler!
01:16:40flaviuIf `if` was implemented as a library function
01:19:12flaviu`parseFloat` doesn't take into consideration the oddities of floating point, it isn't very accurate :/
01:19:46flaviu1.08293520532202032 -> 1.0829352053220205, correct answer wold be 1.0829352053220205
01:21:38flaviuCopy-pasted wrong, correct answer should be 1.0829352053220203
01:30:29*DAddYE joined #nimrod
01:34:34*DAddYE quit (Ping timeout: 240 seconds)
01:47:17*q66 quit (Quit: Leaving)
02:01:31*bjz quit (Ping timeout: 250 seconds)
02:06:11*superfunc joined #nimrod
02:22:55*Skrylar joined #nimrod
02:25:15milosnit works.
02:25:18*superfunc quit (Ping timeout: 240 seconds)
02:25:19milosnhttp://pastie.org/9164177
02:25:20milosn:D
02:25:31milosnnow i can sleep ... its alive.
02:25:32milosn:D
02:26:20milosnits alive! its alive!
02:26:58milosnAraq: you are gonna hate me so much more than i thought you would the previous night ... but oh well
02:31:22*DAddYE joined #nimrod
02:35:30*DAddYE quit (Ping timeout: 240 seconds)
02:38:29milosnhmmm
02:38:33milosnwell this was fun
02:47:10*bjz joined #nimrod
02:55:42reactormonkmilosn, we need MOAR
03:03:24renesachttp://programmers.stackexchange.com/questions/238661/which-low-level-programming-language-is-most-similar-to-python
03:07:16reactormonkrenesac, go write something witty for nimrod and be downvoted ^^
03:14:09renesacthat will be potentially dom96
03:14:41renesacI'm just dropping the link here in case somebody can write a good answer there
03:15:06flaviurenesac: I'll have a go at it before going to bed
03:28:22Varriountflaviu, renesac: As will I
03:32:08*DAddYE joined #nimrod
03:36:19*DAddYE quit (Ping timeout: 240 seconds)
03:48:57*superfunc joined #nimrod
03:51:08*nicolastarzia quit (Quit: Leaving)
04:01:46*DAddYE joined #nimrod
04:12:59*Kelet quit (Quit: Lost terminal)
04:39:25*flaviu quit (Remote host closed the connection)
04:39:42reactormonkuser60561 come on
05:00:45Varriountreactormonk: ?
05:12:01reactormonkmake a real™ nick
05:32:08njoejoemilosn: that dirtyorm looks handy.
06:06:58*noam quit (Quit: Leaving)
06:10:30*oxful__ joined #nimrod
06:14:05*oxful_ quit (Ping timeout: 264 seconds)
06:28:57*seertaak joined #nimrod
06:30:27seertaakare nimrod identifiers case-sensitive? saw a post by araq on forum about removing case-insensitivity, and making correct style for variables camelCase, and types PascalCase. is this the current state of the art?
06:39:48*seertaak quit (Ping timeout: 240 seconds)
07:27:47*boydgreenfield quit (Quit: boydgreenfield)
07:43:18*zahary1 joined #nimrod
07:43:49*zahary quit (Read error: Connection reset by peer)
08:16:52*DAddYE quit (Remote host closed the connection)
08:17:19*DAddYE joined #nimrod
08:21:30*DAddYE quit (Ping timeout: 240 seconds)
09:00:48*kunev joined #nimrod
09:31:22*io2 joined #nimrod
09:58:51*vendethiel quit (Read error: Connection reset by peer)
10:00:47*Matthias247 joined #nimrod
10:02:11*vendethiel joined #nimrod
10:03:43*BitPuffin quit (Read error: Connection reset by peer)
10:23:48*superfunc quit (Ping timeout: 240 seconds)
11:18:31milosnnjoejoe: yeah
11:19:14milosnusefull, but there is a reason why its called "dirty" ... its dirty in python, and in nimrod? ill upload source to bitbucket when i clean it up
11:19:23milosn... its just plain dirty :)
11:20:38milosnhmmm looks like db_mysql runs all connections in auto-commit mode, i cant find switch to disable it
11:21:21milosnfor large/bulk inserts you need beginTrans()/commitTrans()/rollbackTrans() thingies
11:28:55*Trimsty joined #nimrod
11:33:31*Trimsty quit (Client Quit)
11:35:50*BitPuffin joined #nimrod
12:35:31*q66 joined #nimrod
12:35:31*q66 quit (Changing host)
12:35:31*q66 joined #nimrod
12:56:45*darkf quit (Quit: Leaving)
13:11:38*kunev quit (Quit: Lost terminal)
13:14:25*enurlyx joined #nimrod
13:21:25Skrylari still sometimes wish we had a cross between ecco pro and tinderbox when i plan things to write in nimrod ><
13:41:10*flaviu joined #nimrod
13:42:13enurlyxIs it possible to disable assignment for a object?
13:42:21enurlyxvar x = createFoo()
13:42:26enurlyxx = y # error
13:43:26flaviuenurlyx: I don't think so yet
13:44:08flaviuhttp://build.nimrod-lang.org/docs/manual.html#tuples-and-object-types , " Overloading of the assignment operator for objects is not possible, but this will change in future versions of the compiler."
13:44:40enurlyxThe problem is, when there exists a destructor and a user copys the value, then the destructor is called twice and frees a resource twice
13:45:03enurlyxSo i want to force him to use clone.
13:45:13enurlyxNice if it can be done in the future :)
13:47:06*Jehan_ joined #nimrod
13:48:40EXetoCso two copies are made. the language could prevent that
13:50:14enurlyxEXetoC do you mean i should use a ref type instead?
13:53:29EXetoCnow maybe, but it could work correctly for value types
13:54:12EXetoCbut there might be some problems associated with the lack of immutable var's (lhs parameter for `=`)
13:55:33EXetoCmaybe inline would do the trick
13:56:41*eigenlicht quit (Ping timeout: 252 seconds)
14:03:19*Jehan_ quit (Quit: Leaving)
14:07:43*psquid_ left #nimrod ("WeeChat 0.4.3")
14:29:04*Trimsty joined #nimrod
14:34:27*Trimsty quit (Quit: Trimsty)
14:48:10flaviuI wish koch had daemon mode
14:53:04fowlkoch possess victim
15:14:53*flaviu quit (Remote host closed the connection)
15:16:50EXetoCfor persisting what?
15:32:46*flaviu joined #nimrod
15:57:19*eigenlicht joined #nimrod
16:00:00VarriountGod. Whoever set the precedent for null terminated strings needs to be hit over the head with something hard.
16:04:13*untitaker quit (Ping timeout: 265 seconds)
16:09:18*untitaker joined #nimrod
16:16:25EXetoCthey had good reasons back then
16:19:31EXetoChttp://stackoverflow.com/a/2221340/3477721
16:22:53*kunev joined #nimrod
16:44:32*boydgreenfield joined #nimrod
16:45:25*flaviu quit (Ping timeout: 276 seconds)
17:04:17renesacEXetoC, saving a byte per string was not really a good reason
17:05:34njoejoeSkrylar: ecco pro as in the PIM?
17:10:34*Jesin quit (Quit: Leaving)
17:11:21VarriountEXetoC: I can only imagine how much better the world would be if we had Pascal strings instead (with the length prepended)
17:12:14VarriountOf course, the problem you have then is, what size should the length be? 32 bits? 64 bits? Larger/Smaller?
17:13:32renesacyou could have different types of strings, one of each size
17:13:39renesacstring8, string16, etc
17:13:40*Varriount briefly imagines a world of "string16", "string32", and "string64"
17:14:03renesacmuch better than a world of \0 ended strings
17:14:04renesac:P
17:14:32VarriountMaybe more type hassle, but at least you don't have quite as many overflows due to missing nul terminators.
17:14:47renesacor due to spuriou
17:14:53renesacspurious null terminators
17:15:05*boydgreenfield quit (Quit: boydgreenfield)
17:15:28renesacone could use string functions in binary data w/o fear
17:16:02renesacwell, you always have to fear if your function depends on the existence of a \0...
17:16:11renesacat the end of the string
17:17:09VarriountAnother idea is to have a pointer which points to the end of the string.
17:17:40VarriountAlthough, that's not as simple to serialize.
18:05:43renesacin D, a string is a memory region pointed by a pointer + lenght
18:10:57*Jesin joined #nimrod
18:14:46Matthias247Varriount: that would be same or even more expensive than a 32bit size field :)
18:14:47EXetoCfowl, packed + variant seems to work
18:19:28EXetoCrenesac, not even in the 70s?
18:19:34EXetoCbut whatever. it's still here, and it sucks
18:22:38*flaviu joined #nimrod
18:23:45EXetoCflaviu, what would benefit from daemonization?
18:24:23flaviuEXetoC: Make a change, it automatically recompiles so you can test the change immediately
18:30:06EXetoCok I guess you save 1-2 key presses
18:30:30flaviuIf it was supported by the compiler too, I'd also save ~20 seconds.
18:31:24flaviuSince the compiler would only have to parse the modified files
18:31:57EXetoCit doesn't just look at the timestamp when booting?
18:32:30EXetoCanyway, I think zahary uses a faster method for the common case
18:32:49flaviuHas he documented it anywhere?
18:33:22EXetoCdunno
18:34:28flaviuzahary1: ping
18:35:59EXetoCwell, does it not compare the timestamps? though you still need to compile big parts of the dependency tree in many cases
18:36:39*Jesin quit (Quit: Leaving)
18:39:19flaviuI don't know, I haven't looked a those parts
18:40:56flaviuBut I don't think it stores the dependency graph anywhere
18:44:21*Jesin joined #nimrod
18:45:51Trixar_za*coff* http://trixarian.net/SHODAN.ogg *coff* - Found a copy of the original Wikipedia clip I got years ago
18:47:00*boydgreenfield joined #nimrod
18:53:51EXetoCflaviu, I guess not. 20 seconds for parsing?
18:55:55*kunev quit (Quit: leaving)
18:56:33flaviuEXetoC: Well, for total compilation. I just compiled it without any changes, it took 20.28 seconds at 90% CPU. Most the time was spent in samacrossanity
18:56:57*superfunc joined #nimrod
19:00:21Araqflaviu: what? semmacrosanity is a bottleneck now?
19:00:40flaviuNo, compiling semmacrosanity.nim takes a while
19:00:56flaviu~3s/20s for me
19:01:59Araqunlikely
19:02:04Araqlook at the module
19:02:18Araqit doesn't even do many template instantiations
19:02:40Araqit might trigger an expensive GC run though
19:02:48flaviuoh, its cgen
19:02:59flaviuit hints the module name after compiling it
19:03:17Araqhmm quite possible
19:16:51EXetoCfowl, or maybe not. getting some wrong values, and I don't know why
19:17:51EXetoCthe size is the same as the C struct
19:18:38fowlEXetoC, you have to figure out the size of the event type
19:19:24EXetoCwell, I'm working on the mongodb interface atm
19:22:01EXetoCjust trying to figure out if it'll work if the kind field comes first
19:29:45EXetoCI'm just being stupid again. of course there already exists a kind field if you have a variant
20:19:05*io2 quit (Remote host closed the connection)
20:19:29*io2 joined #nimrod
20:20:22*Jesin quit (Quit: Leaving)
20:39:02flaviuAraq: Have you read my comments from last night after you went to bed?
20:39:15Araqsure
20:39:40Araqso you want 'semantics: lessEqual' instead of 'magic: LeInt'
20:39:53Araqso bignums work too with these rules
20:40:33flaviuAraq: Sort of, but even more powerful
20:40:37flaviuhttp://goto.ucsd.edu/~rjhala/liquid/haskell/blog/blog/2013/01/01/refinement-types-101.lhs/
20:41:28flaviuSomething like that, but with the syntax pragma based instead of whatever that library does
20:44:34flaviuBut that's probably too complicated, so the `semantics: lessEqual` would also suffice
21:04:03*xenagi joined #nimrod
21:06:34uggedalcan an inner proc close over arguments to its parent proc?
21:07:52*Jesin joined #nimrod
21:08:33Araquggedal: yes but only 1 level deep for now
21:10:43*Skrylar quit (Ping timeout: 250 seconds)
21:14:08uggedalhmm, I must be doing something wrong: http://sprunge.us/jLfO
21:14:18uggedalsource here: https://github.com/uggedal/depict
21:14:46uggedalmore specifically, here: https://github.com/uggedal/depict/blob/master/mortar.nim#L34
21:14:54*Johz joined #nimrod
21:21:49dom96looks like a compiler bug
21:22:29dom96unfortunately :(
21:24:34uggedalok, I'm open to other ways of wrapping the async http handler with my own object that does not trigger the bug :)
21:25:43dom96uggedal: Try: var mDummy = m
21:25:57dom96and see if you can then use 'mDummy' in the body of 'wrapper'
21:27:44uggedalError: internal error: expr: var not init dummy
21:31:58dom96hrm, that's me out of ideas. Araq?
21:32:36uggedalor I could use a global...
21:32:54Araqwell 'async' itself produces an inner iterator, so you're closing over 2 levels, like I said
21:33:08uggedalAraq: ah, I see
21:33:15dom96That's true.
21:33:38dom96That makes things problematic...
21:35:18Araquggedal: I'm afraid for now you need to use a global
21:35:30dom96Araq: Is getting support for more than 1 level very difficult?
21:35:46Araqthe code for it exists but doesn't work
21:36:00Araqso I don't think so
21:36:50dom96Is there any hope of me fixing it?
21:39:43Araqyou can surely try
21:40:02dom96hah, well you'll be away anyway right?
21:40:10dom96when are you leaving exactly?
21:40:48AraqI already left
21:40:56Araqbut it turns out ... I have internet here :P
21:41:21dom96I see.
21:41:32dom96So much for getting work done lol
21:49:04*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
21:51:13*enurlyx quit (Quit: Nettalk6 - www.ntalk.de)
21:58:53EXetoCcan %(x, y) be called such that the arguments aren't treated as a single tuple?
22:01:57EXetoCmaybe it's only going to be possible with the upcoming parsing system
22:03:19dom96proc `%`(x, y) ?
22:03:29EXetoCyes
22:03:37dom96oh but then you need the ` when calling too
22:05:34EXetoCnow anyway. I'll just make it a tuple
22:08:45Araq`%`(x, y) is x % y
22:08:45Araqwith the backticks
22:29:13flaviureactormonk: I'm user60561, but I don't have any ideas for a clever nick.
22:37:28*Skrylar joined #nimrod
22:38:52EXetoCAraq, yeah fair limitation
22:43:55flaviuSay I had a pointer to location `A`, would the garbage collector free `A` if I also had a pointer to `A+4`? I can't think of a way it'd know that, so I'm leaning towards thinking that it would.
22:45:26flaviuAlso, what is the memory layout of a seq? len: int32, body: ref T?
22:45:40Araqflaviu: sure, it would. unless this pointer happens to be on the stack, but that's an implementation detail
22:45:57EXetoCsee system.seqtopointer or something
22:46:41Araqflaviu: len, cap: int, data: ptr T
22:46:44*noam joined #nimrod
23:08:07*Matthias247 quit (Read error: Connection reset by peer)
23:08:15VarriountAraq: I thought that you weren't going to be here. :3
23:08:51AraqVarriount: well the connection is pretty bad :P
23:10:18VarriountAraq: I have a procedure that is like $ for widestring, but uses a given length instead of looking for a null terminator. It's copied from widestr.nim . Should I keep the procedure there, and what should I name it?
23:10:42Araqwhy didn't you export it instead?
23:10:58VarriountWhat do you mean?
23:11:15Araqgive it a * in widestrs.nim
23:11:33VarriountThat's what I'm currently doing.
23:12:00Araqwell what's its name? $ ?
23:12:17Araqwhat's the name you like it to have?
23:12:33VarriountYeah. Currently it's using a distinct WideStr type.
23:12:46Varriountas the 'string' argument.
23:14:19Araqso .. er ... what's your question again?
23:14:46VarriountShould I keep it in widestr.nim?
23:15:01Araqsure why not
23:16:01flaviuVarriount: I'd say to put it in strutils, and make the widestr equivalent delegate to the strutils version
23:16:31Araqflaviu: that totally ignores its dependencies
23:19:36Varriountflaviu: Ineffecient. The WideStr version uses the null terminator as a signal to stop looping. If I were to delegate that to this new procedure, WideStr would have to be looped through twice, once to find the null terminator, and a second time to do the translation from WideStr to Str
23:21:32flaviuVarriount: There isn't any difference between a widestr and a string except I assume that the widestr has a null terminator of 2 bytes
23:22:03Araqwidestr = utf-16, string = utf-8
23:22:20VarriountYeah, I know that.
23:22:53flaviu`$`(str: widestr, len: int) = `$`(cstring(str), len*2)
23:23:39Varriountflaviu: You want me to put this new procedure, which converts a non-null-terminated WideStr to a str, and then you want me to make the procedure which converts a null-terminated WideStr to Str delegate processing to the new procedure?
23:23:48*superfunc quit (Ping timeout: 240 seconds)
23:24:11flaviuVarriount: Sorry, I thought that widestrs are null-terminated, the same way stings are
23:24:28Varriountflaviu: Sometimes they are, sometimes they aren't.
23:25:01Araqand they have 2 byte characters as opposed to 1 byte characters
23:25:02VarriountIn this particular case, I'm given a length, and a pointer to a section of memory that contains the non-null-terminated string.
23:25:29Varriountflaviu: See http://msdn.microsoft.com/en-us/library/windows/desktop/aa364391(v=vs.85).aspx
23:26:22flaviuAraq: That part isn't really important, memory doesn't have a data type. all that has to be done is len*2
23:28:37Araqthere is a difference between \0 and \0\0 and len("ä") * 2 != len(wideStr("ä"))
23:28:49*brson joined #nimrod
23:31:15*darkf joined #nimrod
23:32:32flaviuAraq: In that case, technically there isn't since "ä" == 228. But I'm not thinking about unicode at all. len(wideStr("ā")) == len("\u01\u01")
23:33:37Araqflaviu: "ä" in utf-8 takes up 2 bytes, 2 * 2 == 4, "ä" in utf-16 takes up 2 bytes
23:33:41VarriountHm. What should a non-null-terminated WideStr type be called?
23:34:00VarriountWideBuffer? WideCharBuffer?
23:35:02Araq"ä" == 228 is perhaps Windows Ansi characterset
23:36:53AraqVarriount: what's wrong with the current name?
23:37:48VarriountAraq: It implies that the string is null terminated.
23:37:59flaviuAraq: You're right about len("ä") == 2, but unicode is irrelevent here. All I care about right now are the raw bytes. wideStr("ä") == [0x00u8, 0xE4u8] == [0x00E4u16]
23:38:01VarriountAlso, the new procedure would clash with an already existing procedure.
23:38:49VarriountHm. "Cannot evaluate sizeof because type is not defined completely"
23:41:02Araqflaviu: not sure what you're really after but you simply can't use C's strlen for wide strings
23:43:38VarriountOh goody. I can't just use a distinct WideStr type because it's a 'ref' type, and the memory I'm type-ifying is a raw section of wide characters
23:43:56flaviuAraq: I'm also confused, so I'll end my end of the conversation here in the interest of time since it isn't really that important
23:44:52Araqflaviu: very good, we all should do this more often. :-)
23:45:59VarriountSkrylar: I don't suppose you could integrate your unicode stuff into the stdlib?
23:59:13SkrylarVarriount: i could