<<12-04-2013>>

00:04:19*XAMPP joined #nimrod
03:42:45*JStoker quit (Quit: JStoker is gone :()
04:03:31*JStoker joined #nimrod
04:04:20*JStoker quit (Remote host closed the connection)
04:18:24*JStoker joined #nimrod
04:45:20*fowl quit (Read error: Connection reset by peer)
05:13:33reactormonkcool @ #345 - so I can start using it for emacs
05:54:07*fowl joined #nimrod
06:25:11*fam|work joined #nimrod
09:01:19Araqhi fam|work, welcome!
09:20:00fam|workhola
09:50:06Araqoh no ... are you the guy that only speaks spanish?
10:31:30fam|worknope
10:31:44Araqoh alright then
10:33:18fam|workhave i passed check?
10:33:40Araqsorry, we recently had a troll here that would insult us in spanish
10:34:58fam|workfrom your side it was like ban/or dont ban him? =]
10:35:38Araqdom96 banned him; I don't think he got in any kind of moral dilemma about it ;-)
11:02:11*Trixar_za is now known as Trix[a]r_za
11:47:15*fowl quit (Ping timeout: 258 seconds)
11:55:48*ddl_smurf joined #nimrod
11:58:15*fowl joined #nimrod
12:05:36*ddl_smurf quit (Quit: _)
12:40:40*fowl quit (Read error: Connection timed out)
12:45:44*q66 joined #nimrod
12:48:58*ack006 joined #nimrod
12:58:05*zahary_ quit (Read error: Connection reset by peer)
12:58:44*fowl joined #nimrod
13:02:39*fam|work quit (Ping timeout: 260 seconds)
14:20:35*fowl quit (Ping timeout: 258 seconds)
14:22:51reactormonk proc `-` (a, b: TTime): int64 =
14:22:53reactormonk return a.getTime() - b.getTime()
14:22:55reactormonkgives me
14:22:57reactormonklib/pure/times.nim(491, 21) Error: can have an unlisted effect: TEffect
14:23:29Araqthe problem is how the "methods" are declared for JS
14:23:57Araqyou need to add {.tags: [].} for importing them
14:24:07Araqotherwise the compiler assumes to have some effect ;-)
14:25:27NimBotAraq/Nimrod 724c402 Araq [+4 ±10 -0]: fixes #287; bugfix: subrange checking is performed again
14:29:07Araqreactormonk: times.nim:440 should be
14:29:23Araq proc newDate(): TTime {.importc: "new Date", nodecl, tags: [FTime].}
14:30:44reactormonkbtw, do I need nodecl for importc?
14:31:08AraqI think for the JS target you don't
14:32:12reactormonk proc newDate(): TTime {.importc: "new Date", tags: [FTime].}
14:32:16reactormonkbut still get that
14:32:32Araqoh my bad
14:33:26Araqyou need to add {.tags: [].} to any 'proc (): int' of TTime that doesn't have an effect (presumably all of them)
14:34:19*fowl joined #nimrod
14:34:22reactormonk:-/
14:34:40reactormonkcan't I just make time immutable?
14:34:47Araqlol
14:35:05Araqimmutability has nothing to do with it
14:35:33Araqyou either have an IO effect that affects 'Time'/Timing or you don't
14:35:43Araqand the compiler assumes the worse :P
14:36:00Araqso yeah, you really need to press CTRL+V a few times I'm afraid
14:36:16Araqdunno if the setters are effect free
14:36:28AraqI guess they are
14:36:54reactormonkyou mean 'p'
14:37:31reactormonkI'll let you take a look afterwards
14:38:13reactormonkwhat's the 'FTime' tag for?
14:38:24Araqthat's the "Time effect"
14:38:39AraqNimrod's effect system is superior to Haskell's :P
14:39:19Araqyay ... the test suite now contains 600 tests
14:39:24reactormonkwhat does that mean, a time effect?
14:39:40Araqit means you're reading the computer's clock
14:40:40Araqin Nimrod that's an IO effect and yet it's pretty different from reading a file and so Nimrod distinguishes them
14:41:01reactormonk getTime: proc (): int {.tags: [FTime].}
14:41:10reactormonkgetTime doesn't need to be on the TTime type, does it?
14:41:41Araqbut getTime doesn't read the computer's clock, so {.tags: [].} would be what you want here
14:41:48reactormonkwait, overload
14:41:50Araqor ... does it?
14:42:06Araqnot sure what JS's getTime does
14:42:53Araqand no, TTime has nothing to do with it
14:43:36reactormonkdo we have a 'no implemented error'?
14:43:44reactormonkas ??? in scala or ... perl
14:43:52Araqwe have:
14:43:59Araqproc p() {.error.}
14:44:14Araqand then the compiler will error if p is attempted to be called
14:44:47Araqhowever, you may as well not export a missing proc in the first place
14:45:06Araqif you do need to do it at runtime, I'd do:
14:45:14AraqdoAssert false, "not implemented"
14:45:35reactormonklib/pure/times.nim(153, 20) Error: implementation of 'times.fromMiliseconds(msSince1970: int64): TTime' expected
14:45:42reactormonkI implemented it in two when clauses
14:47:06Araqmy times.nim has no such proc
14:48:01reactormonksure, I added it
14:48:16reactormonkhttp://sprunge.us/McfE
14:50:35Araqhm don't do it that way
14:50:57reactormonkbut?
14:52:50Araqthe problem is if you forward declare fromMiliseconds the implementation mustn't have a pragma list
14:53:52Araqand I think dom96 used 'float' for a reason, ask him when he's around
14:54:33Araqalso I don't like TTimeInterval and would remove it instead of adding ever more operations supporting it
14:55:20reactormonkAraq, how else to represent a time interval?
14:55:51Araqwith TTime?
14:56:10Araqint - int is an int
14:56:23Araqand yet TTime - TTime should be TTimeInterval? wtf?
14:56:35reactormonksure, time is not as simple
14:59:36reactormonkdom96, ping
15:04:05*fowl quit (Ping timeout: 248 seconds)
15:13:30reactormonkAraq, I'm in favour of timeinterval. It's something different than time.
15:13:44reactormonkalso because you can't have TTime + TTime
15:14:09reactormonk... it's defined as TTime + TTimeInterval. TTime - TTime is defined as between(TTime, TTime)
15:14:21reactormonkso you analogy doesn't work as well.
15:15:40Araqof course it does work well
15:15:58AraqTTime is miliseconds since 1970 or something
15:16:19Araqso it's just a number and you should be able to do what you want with it
15:16:56AraqTTime is already a TTimeInterval if you look at it this way
15:17:20Araqpoints and vectors are very often treated the same in maths
15:17:27Araqand for good reasons
15:18:07reactormonkYes, but a time and an interval should be treated differently. Even if it's just a distinct type.
15:18:20Araqnot in my opinion
15:18:20reactormonkbecause you never want to use a time as an interval and the other way round.
15:19:26Araqyeah right ... I suppose you never need a random timestamp for testing purposes either :P
15:19:59Araq(generating a random number may involve any kind of arithmetic)
15:32:32*fowl joined #nimrod
15:37:19Araqreactormonk: I'd prefer TTIme.addHours(x) instead of TTime + TTimeInterval(Hours: x)
16:05:08*fowl quit (Ping timeout: 245 seconds)
16:09:12*fowl joined #nimrod
16:16:48*fowl quit (Ping timeout: 245 seconds)
16:20:40*fowl joined #nimrod
16:43:03*fowl quit (Ping timeout: 245 seconds)
16:48:17*fowl joined #nimrod
16:50:17dom96reactormonk: pong
17:12:20*fowl quit (Quit: Leaving)
17:13:20reactormonkdom96, got the backlog?
17:13:42reactormonkAraq, and random numbers do not count, you can always convert a number to a time or an interval
17:19:38dom96Could use some more context, where is this float usage of mine which confuses you?
17:20:28reactormonkdom96, that you add floats to time to add time intervals
17:20:42reactormonkI converted them to int64 and made some converters
17:22:20dom96Araq: I think having a separate type for a time interval is nice, because we can have a nice `$` for it.
17:22:45dom96Araq: Also, I don't remember you objecting to my implementation when I made it.
17:24:20Araqdom96: so what? I missed it before
17:24:37dom96reactormonk: I never got around to creating a general proc to convert a TTime into float seconds.
17:24:49reactormonkdom96, I prefer int64.
17:25:23AraqJS doesn't even have an int64 ...
17:25:24dom96Changing it now would be unwise IMO
17:25:44dom96and how do you plan to represent miliseconds?
17:26:14reactormonkdom96, int64 for miliseconds
17:26:31Araqfloat has the tremendous advantage that it doesn't restrict a timer's resolution
17:26:41dom96indeed, what Araq said.
17:26:55dom96And a lot of code already depends on the fact that epochTime returns a float.
17:27:04Araqyep
17:27:07dom96and that the float is in seconds.
17:27:11Araqand JS doesn't even have int64
17:27:47reactormonkdom96, good, enough, so time and intervals should convert from/to float.
17:28:23dom96yes.
17:28:32reactormonkAraq, is there any reason why you would want to use an interval as time and the other way?
17:29:48Araqwhat's the date between A and B?
17:30:37reactormonkthat would be between(A, B)/2 + A
17:31:05reactormonknote that between(A, B) returns an interval
17:32:46Araqhrm
17:33:50Araqmake TTimeInterval = distinct float then
17:33:58dom96reactormonk: You should implement a function which will return stuff like "5 days, 4 hours, 52 minutes and 2 seconds ago"
17:34:09dom96That would be great for the forum.
17:34:27reactormonkAraq, what does distinct float give me over converters?
17:34:43reactormonkdom96, is an interval a duration?
17:35:19reactormonkTime Point -- Specifier for a location in the time continuum.
17:35:22reactormonkTime Duration -- A length of time unattached to any point on the time continuum.
17:35:24reactormonkTime Interval -- A duration of time attached to a specific point in the time continuum. Also known as a time period.
17:36:19Araqwe want the time duration then, right?
17:36:39Araqtime interval would be a tuple (TTime, TTimeDuration)
17:36:41reactormonkYes.
17:36:46reactormonkYep.
17:36:54reactormonkThat's from the boost lib
17:37:15reactormonkAraq, what does distinct float give me over converters? <-
17:37:39Araqa single float surely is more efficient to handle than an object full of ints
17:37:56reactormonknope, ram vs. speed
17:38:15reactormonkdo we have time tests?
17:38:23Araqand the current TTimeInterval is wrong anyway as it doesn't support submilisecond resolution
17:38:32reactormonk... so what.
17:38:44Araqso it's slower and wrong
17:39:15reactormonkcan I mark a certain proc as wrong for converter resolution, but it should keep searching?
17:39:25Araqthere is no point in benchmarking stuff that I know anyway :P
17:40:03Araqthere are no converters here, reactormonk
17:40:13Araqthat would defeat the purpose
17:40:28Araqyou argue for more type safety
17:40:31*Boscop joined #nimrod
17:40:34reactormonkwhy not converters from float to ttime?
17:40:42Araqtype converters weaken the type safety
17:40:43reactormonkyou know a date is _not_ a float in javascript?
17:41:05reactormonkor do you want me to create a new date object each time I call something on it
17:41:06Araqyes, it's some crappy object in JS
17:41:45reactormonkI do have paths to convert to float in JS, but it's not represented as float. That's why I'm in favour of converters.
17:42:14Araqyou're always in favour of converters ;-)
17:42:27reactormonkthey provide a good solution here.
17:42:31Araqthey don't
17:42:40reactormonkyou cannot do float(ttime) in JS.
17:42:50Araqsee?
17:43:09reactormonkyou can do ttime.getUTC to get a float
17:43:16AraqfromFloat(x: float): TTime # name debatable of course
17:43:31reactormonksure. But no distinct float in JS.
17:43:45Araqwhy not?
17:44:42Araqyou can easily do: getDays * 24 * 60 * 60 + getHours * 60 * 60 + ... + getMilis * 0.1
17:44:52Araqwell ... you get the idea
17:45:45reactormonkdoesn't distinct float indicate it's a float?
17:46:21Araqyes
17:46:37Araqit's a float and you have to do some gymnastics to make it a float for JS, so what
17:46:38reactormonkit isn't a float in JS.
17:46:55Araqit's your job to make it a float, even for JS :P
17:47:17reactormonkso call new Date(float).getFullYear for every getter?
17:47:17Araqor maybe we simply shouldn't support for JS
17:47:28Araqhuh?
17:48:05dom96If you're going to change TTimeInterval into a distinct float then please provide a proc which will convert the TTimeInterval into a tuple with such fields.
17:48:21reactormonkAraq, currently, Time is not a distinct float
17:48:24dom96If you know what I mean.
17:48:41Araqargh .... don't tell me you have code that relies on TTimeInterval
17:48:58Araqalso fuck
17:48:58dom96dunno
17:49:03Araqit's in 0.9.0 ...
17:49:07Araqand exported
17:49:10dom96but yeah
17:49:29Araqugh ... well ugh
17:49:41Araqwe leave it as it is then
17:49:51AraqI don't feel like deprecating it
17:51:08Araqreactormonk: TTime wraps posix's time_t
17:51:23Araqfor the C target and that is not to be changed
17:53:19reactormonkAraq, hell I'm going to change that
17:56:44reactormonkAraq, my idea is to add a few converters (maybe marked a procs) to make JS behave the same as C
17:56:56reactormonkbut no direct float() conversions anymore
17:57:49reactormonkif you are against it, let's discuss that in a mumble in about half an hour.
17:58:56AraqI don't know
17:59:15Araqdon't change it, just make it compile under JS in some way or the other :P
17:59:38*filwit joined #nimrod
17:59:51filwithiya folks
17:59:52dom96hey filwit
17:59:56dom96long time no speak
17:59:57Araqhi filwit
18:00:02filwityes, yes
18:00:12dom96I was about to annoy you on steam again ;)
18:00:22filwit:)
18:00:34filwityou still have to play CSS with me sometime
18:00:39filwitif you can get it to work
18:01:07filwitanyways, just droping by to say hi
18:01:27dom96sure. I'm sure it will work on Windows.
18:01:30filwitdom96, do you have a AMD CPU or GPU?
18:01:50filwitactually, it's probably my Mobo...
18:02:08filwityou know anything about Linux's sound volume control being messed up?
18:02:36dom96filwit: I have both from AMD
18:03:19dom96Sound on linux can be a bit iffy.
18:03:21filwitdoes your volume control in Cinnamon mess up?
18:03:54filwitlike, slider: 50% = 100% volue, 25% = 0% volume
18:04:02dom96Seems to be working fine.
18:04:33filwitokay... hmm.. my mother board must just have shit drivers
18:07:39dom96filwit: so how have you been?
18:07:53filwitgood
18:07:59filwitjust busy
18:08:09*xcombelle joined #nimrod
18:08:20filwitnew place is nice though
18:09:11filwitAraq, or dom96. Have you ever worked or seen Backbone.js?
18:09:17filwitworked with**
18:10:08dom96nope
18:10:13dom96why?
18:10:39filwitah, well i was thinking about Nimrod for the web
18:11:18Araqfilwit: just skimmed its docs, too buzzwordy for my taste
18:11:27filwithad some different ideas about how you could make a web framework built with some cool things that Nimrod can do
18:12:05filwitAraq: well compared to regular Javascript, it's a pretty nice library that does a lot of cool things for you
18:12:54filwitanyways... in Nimrod, '{}' is a seq?
18:13:01filwitguess i should look up in the docs
18:13:01Araqreally? does it give you a static type system? :P
18:13:11Araq'@[]' is a seq
18:14:37filwitdoes Nimrod have anonymous objects?
18:14:56Araqyeah, they are called 'tuples' ;-)
18:15:17filwittuples can have var names?
18:15:23filwitkey/value?
18:15:24Araqyes
18:15:32filwitah, interesting
18:15:48filwitso Tuples in Nimrod are a bit more than D's tuples...
18:16:06filwitah right, i remember
18:16:08Araqthere is also {key: value, ...} syntax as sugar for: [(key, value), ...]
18:16:19Araqwhere (key, value) is a tuple constructor
18:16:23filwityou said to do things like Vector structs with Tuples before
18:16:25dom96everything in Nimrod is a lot more than in D :P
18:17:03filwitokay, that's pretty nifty actually
18:17:08filwitabout the syntax sugar
18:17:26filwityou just write the '{}' as a macro or something?
18:17:43filwit(in the stdlib sort of thing)
18:17:51Araqit's superb because it keeps the order so you can initialize an ordered table with it ;-)
18:18:35filwityeah... that's nice
18:19:07filwityou and your inventions
18:21:00filwitanyways, I'm trying to find the tuples docs...
18:21:09filwiton Docs page 2?
18:22:11filwitthat Backbone.js got me thinking about how you could make a pretty cool OOP system in Nimrod
18:22:19filwit:D
18:22:32dom96http://build.nimrod-code.org/docs/manual.html#tuples-and-object-types
18:23:25filwitthanks dom96
18:23:31dom96np
18:23:32Araqfinally figured out OO and a tuple of closures are isomorphic? :P ;-)
18:24:24filwitnot really
18:24:34filwitthere's defined structure to OO
18:25:00filwittuple closures don't have any built-in parent-child relationships and vtables beyond what you make
18:25:04filwitlike C
18:25:15filwitbut it did get me thinking
18:25:42filwitcause if it's that generic, it's just up to some third-party framework to define the structure
18:26:56filwitand Nimrod is kinda built where you can build your own framework type of thing really well... almost everything is definable (almost)
18:27:42filwiti was thinking you could do something like: type Foo = Model.extend({ x:int, y:int })
18:28:20filwitwhich is a macro, that would build out objects for you
18:29:24Araqsounds quite possilbe and easy, yeah
18:29:47filwitso macros would be the best way to accomplish that right?
18:29:58filwitand can i actually do: type Foo = ... ?
18:30:10filwitwhere '...' is a macro that defines a type?
18:30:27Araqthere is code for exactly this syntax
18:30:38AraqI'm not sure it has ever been tested :P
18:30:47filwitreally? where?
18:31:19Araqjust try it out please
18:31:44Araqbbl
18:31:49filwitokay, thought you meant there was some code example out there
18:31:50filwitk
18:34:43filwitbbl as well
18:34:45*filwit quit (Quit: Leaving)
19:00:27*xcombelle quit (Read error: Connection reset by peer)
19:02:52reactormonkAraq, kk
20:06:29*ack006 quit (Quit: Leaving)
22:42:46*fowl joined #nimrod
23:09:38NimBotAraq/Nimrod 1c7d1aa Araq [+1 ±3 -0]: fixes #310
23:25:12NimBotAraq/Nimrod 1ba3569 Araq [+0 ±1 -0]: implements #258; activate via --verbosity:2
23:46:28NimBotAraq/Nimrod bb1a0ba Araq [+0 ±1 -0]: fixes #244
23:56:07*debugging4ever joined #nimrod
23:57:14Araqhi debugging4ever
23:57:29debugging4everhi there!