<<31-05-2013>>

00:27:57NimBotAraq/Nimrod a8ce01d Billingsly Wetherfordshire [+0 ±1 -0]: rename json.existsKey to hasKey, deprecates existsKey
00:27:57NimBotAraq/Nimrod 1d32ea1 Araq [+0 ±1 -0]: Merge pull request #455 from fowlmouth/patch-7... 3 more lines
00:29:57NimBotAraq/Nimrod 19529a6 Araq [+0 ±4 -0]: better error message for subtle nil errors
00:29:57NimBotAraq/Nimrod a2610fe Araq [+0 ±1 -0]: another attempt to implement #448
00:29:57NimBotAraq/Nimrod dc2b3eb Araq [+0 ±2 -0]: fixes #458
00:29:57NimBotAraq/Nimrod 55c4c0a Araq [+0 ±1 -0]: Merge branch 'master' of github.com:Araq/Nimrod
00:31:18*SirSkidmore quit (Ping timeout: 264 seconds)
01:50:08*q66 quit (Remote host closed the connection)
01:50:11reactormonkwhat's nimRTL?
01:56:21fowlrtl = runtime library
02:00:49reactormonkkk
02:07:54*GuidovanPossum joined #nimrod
02:09:41*GuidovanPossum quit (Client Quit)
02:10:09*GuidovanPossum joined #nimrod
02:20:21*GuidovanPossum quit (Quit: GuidovanPossum)
02:21:35*GuidovanPossum joined #nimrod
02:23:01*GuidovanPossum quit (Client Quit)
02:32:10tangentstormwe got the brainf*** thing working. even wrote a little visual debugger for it. :)
02:32:16tangentstormhttps://github.com/tangentstorm/grimspike/blob/master/bfrun.nim
02:51:47*Associ8or joined #nimrod
02:54:02*SchalaZeal joined #nimrod
02:54:20SchalaZealGetting a very weird error from the compiler.
02:57:05SchalaZealhttp://pastebin.com/tbhh0s8v
02:57:38SchalaZealAccording to the compiler, TNamedBinaryTag is marked as final when it isn't.
02:58:02SchalaZealgetting "Error: inheritance only works with non-final objects" on every inheriting object declaration line
03:00:35fowlhey SchalaZeal
03:00:41SchalaZealhey
03:00:57SchalaZealI made an AUR package for that nifty nimlibs project of yours.
03:01:26fowlobject's aren't inheritable by default, so tnamedbinarytag needs to be object of TObject or {.inheritable.}
03:01:41fowlno need, its in babel
03:01:44SchalaZealthen why have {.final.}?
03:02:14fowlim not sure :D
03:02:21fowli think the behavior used to be different
03:02:30SchalaZealseems like more work for me now
03:02:35SchalaZealit did
03:02:49SchalaZealdefault was inheritable unless {.final.} was specified
03:03:17SchalaZealseems annoying to reverse it
03:03:56fowlits been this way for a while now
03:04:14SchalaZealwell I haven't used Nimrod much in said while
03:04:39SchalaZealtrying to make a modular Minecraft server in it
03:04:47fowlcool
03:05:33SchalaZealthe .dat files use the "named binary tag" format and are g-zipped, so I'm building it according to the specs for the format
03:06:51SchalaZealhad to go out of my way to make floating point endian conversion procs though
03:07:25fowlyou cant use the endians module?
03:07:34SchalaZealit only does integers
03:07:37SchalaZealnot floats
03:08:21SchalaZealfor Minecraft data storage I need to work with integer and floats in big endian
03:08:32SchalaZealand strings in UTF8
03:08:33fowlyea
03:09:10fowlthis seems to work: https://gist.github.com/fowlmouth/6206634695a55e223b80
03:10:03SchalaZealah
03:10:15SchalaZeal*scraps the silly nbcommon module I have*
03:10:45fowlcheck this out i wrote it to read/write in bigendian https://github.com/fowlmouth/nimrod-enet/blob/master/enet_pkt_utils.nim
03:11:46SchalaZealI can nail the NBT format, provided there's gzip capability in Nimrod's libraries. The region files are going to be a tad tricky though
03:14:23SchalaZealis there any pragmas for bit/byte packing and also for abstract objects?
03:14:42SchalaZeal{.align: #.} no longer exists
03:15:24fowlnot to my knowledge
03:15:30fowlwhat do you mean by abstract object
03:16:05SchalaZealan object that shouldn't be instantiated, that should be inherited by a derived class
03:16:48SchalaZealsimilar to abstract classes in C#/Java or virtual foo() = 0; in C++
03:20:02fowlno you could make such an abstract class but you cant keep it from being instantiated
03:20:22fowler abstract type
03:20:41SchalaZealeh well...should anyone reuse my code, they're likely to get shot in the foot should they use it like that
03:23:31SchalaZealbyte/bit packed objects/tuples are a necessity though I think
03:25:31fowlyou'd have to ask araq about that
03:25:38SchalaZealhmm ok
03:25:41fowlwhat you been up to lately i havent seen you around
03:25:56SchalaZealMinecraft, and seeking a career in 3D modeling
03:26:26fowlcool
03:26:37SchalaZealyep
03:27:45SchalaZealI guess I made an AUR package because I'm OCD about having installable packages of everything rather than rearranging files myself
03:28:17fowlyou should make one for babel if there isnt already
03:28:36SchalaZealI did but orphaned it when I personally didn't want it anymore
03:30:32SchalaZealfeel free to grab it, babel-git
03:30:57fowlim not on arch
03:31:19fowlit probably doesnt ever need to be updated, the install should just be git pull && nimrod c babel && mv babel /to/bin
03:31:40SchalaZealI prefer install instead of mv
03:31:49SchalaZealmv doesn't set the access
03:32:04fowlah
03:32:28SchalaZealinstall -Dm755 babel $pkgdir/usr/bin/babel
03:33:41SchalaZealhmm... do generics have constraints?
03:33:53reactormonkSchalaZeal, sure you can have them, T: string|int
03:34:19SchalaZealwhat about like T: TFoo being TFoo and descendants?
03:34:38reactormonkthere is no covariance iirc
03:34:48reactormonkAraq, how's covariance?
03:38:33SchalaZealI have this so far
03:38:40SchalaZealproc `data`[T: TNamedBinaryTag]*(p: var TListTag[T]): seq[ref T]{.inline.} =
03:38:42SchalaZeal return p.fArray
03:38:49reactormonkSchalaZeal, covariance rings a bell?
03:39:03SchalaZealwith C++ I suppose
03:39:18reactormonkkk
03:40:43SchalaZealtemplate<Foo T> class<T> { }; T would be Foo or its descendants
03:41:23reactormonknot sure about covariance in nimrod, you could try
03:46:13SchalaZealit compiles
03:47:41SchalaZealand it runs!
03:47:50SchalaZealcovariance is indeed in Nimrod
03:47:59fowldoesnt work for me: http://pastebin.com/m95YcG3Z
03:48:31SchalaZealmine: http://pastebin.com/BFu60pjV
03:53:04SchalaZeal........hmm
03:53:10SchalaZealthis isn't right
03:53:58fowlso that part seems to work but no covariance for matching generic procs
03:54:00SchalaZealtried to cause a compiler error by chancing b: TBlah[TFoo2] to TBlah[int] ...... still successful
03:54:14fowlah
03:54:54SchalaZealah... but it fails to run
03:55:15SchalaZealhmm actually...
03:56:02SchalaZealyeah... getting a segfault if it's any type other than TFoo
03:56:10SchalaZealor derived classes
03:56:16SchalaZealinstead of a compiler error
04:02:59*SchalaZeal quit (Quit: Konversation terminated!)
04:05:56*___ joined #nimrod
04:10:16*OrionPK quit (Read error: Connection reset by peer)
04:12:04*___ quit (Quit: Page closed)
04:55:37*ARCADIVS quit (Quit: WeeChat 0.3.8)
05:35:48*Associ8or quit (Read error: Connection reset by peer)
06:52:26*zahary_ joined #nimrod
06:54:12zahary_dom96, nice work on the webframeworks benchmark, but why are you putting nginx in front of jester? just go straight to the metal like the onion guys:
06:54:13zahary_https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/onion
06:54:25zahary_onion is a C framewok
07:13:41*fowl quit (Ping timeout: 248 seconds)
07:17:42*fowl joined #nimrod
07:18:22*fowl quit (Read error: Connection reset by peer)
07:32:15*comex` joined #nimrod
07:34:58*comex quit (*.net *.split)
08:15:22*fowl joined #nimrod
08:21:58*fowl quit (Read error: Connection reset by peer)
08:22:02*Endeg quit (Read error: Connection reset by peer)
08:22:46*fowl joined #nimrod
08:23:08*fowl quit (Read error: Connection reset by peer)
08:24:08*fowl joined #nimrod
08:24:23*fowl quit (Read error: Connection reset by peer)
08:25:14*fowl joined #nimrod
08:27:58*fowl quit (Read error: Connection reset by peer)
08:28:37*fowl joined #nimrod
08:28:43*fowl quit (Read error: Connection reset by peer)
08:29:27*Endeg joined #nimrod
08:32:11*fowl joined #nimrod
08:32:12*fowl quit (Read error: Connection reset by peer)
09:17:00Araqzahary_: actually I prefer it this way, nginx has optimized static file serving plus lots of other features, so it's a more realistic scenario this way
09:17:46Araqeventually we'll have all these features too but until then we use nginx
09:17:52zahary_I would put nginx in production in front of nimrod to deal with security risks too, but this is benchmark
09:18:11zahary_and others may be getting unfair advantage
09:19:26AraqI haven't looked at the details but yeah
09:19:54Araqfair benchmarks would put nginx in front of everything :-)
09:49:47*q66 joined #nimrod
10:07:25*q66 quit (Ping timeout: 240 seconds)
10:07:32*q66 joined #nimrod
10:49:14dom96zahary_: Our httpserver is still not optimized, scgi is. We would lose, badly, if we went bare metal. httpserver would just lock up with the amount of requests that they put it through.
10:49:43zahary_hmm, scgi does open/close connection on each request, right?
10:50:15dom96yes
10:50:28zahary_how come it's more optimal than HTTP? you mean the HTTP request parsing business will be slower?
10:51:34dom96It's by no means more optimal. What I mean is that before 0.9.2 I optimized the scgi module, but I did not have enough time to do so for the httpserver. The current async implementation of httpserver isn't async enough, it still uses blocking sockets.
10:52:02zahary_I see, so you have implemented an epoll loop somewhere?
10:52:15dom96lol, not even.
10:52:28dom96That's another optimization we could do.
10:53:16dom96but results were promising even with select.
10:54:37dom96The method in which I made scgi fully async is a bit ugly, and hopefully the 'await' stuff will help a lot: https://github.com/Araq/Nimrod/blob/master/lib/pure/scgi.nim#L179
10:55:24NimBotAraq/Nimrod c0b1c07 Araq [+0 ±2 -0]: more accurate effects for times.nim; bugfix for the JS codegen
10:58:26zahary_hmm, how does recvAsync work actually? I see the results are ready on the next line. where is the async part?
10:59:48dom96zahary_: if you look closely you can see that I check its return value. `-1` means we got no data, so we simply return and the callback will be called again when data is available.
11:05:55Araqdom96: we need a "diff" like feature for nimbuild
11:05:57dom96diff for what?
11:05:58Araqmanually comparing the test results sucks
11:05:58dom96the testresults?
11:05:58dom96yeah, sure.
11:06:12Araqin fact, the test results suck too
11:06:19AraqI mean their presentation
11:06:23dom96would perhaps be better if the test results were generated as JSON
11:06:32dom96Then nimbuild could do something with them
11:06:33Araqit should be grouped by topic
11:06:41dom96As well as NimBot
11:07:41Araqwell things would be different if we were close to 100% green tests
11:07:49Araqbut we aren't
11:09:24Araqand manually changing the tests to "ignore" doesn't work either, too laborsome
11:09:42Araqplus ignored tests stay on "Ignore" forever
11:16:58dom96why is that relevant?
11:19:12dom96what does this have to do with this 'diff' feature?
11:19:35Araqas I said, the diff feature wouldn't be necessary if we always had 100% green/yellow tests
11:19:46Araqyou can easily spot the new red tests then
11:19:53dom96i see
11:21:35zahary_dom96, redis contains one of the smallest epoll/kqueue implementations. if we just convert/port the code to nimrod, it could serve as a good starting point:
11:21:45zahary_https://github.com/antirez/redis/blob/unstable/src/ae.c
11:21:46zahary_https://github.com/antirez/redis/blob/unstable/src/ae_epoll.c
11:22:06zahary_https://github.com/antirez/redis/blob/unstable/src/ae_kqueue.c
11:22:40zahary_here is an example usage from wrk: the server testing tool used by the benchmark guys
11:22:41zahary_https://github.com/wg/wrk/blob/master/src/wrk.c
11:25:48dom96interesting.
11:28:11dom96indeed, looks like a good place to start. However I must admit my C is a bit rusty.
11:32:55zahary_was c2nim supposed to be able to convert whole C files btw?
11:46:37NimBotAraq/Nimrod 03c9a02 Dominik Picheta [+0 ±1 -0]: Added unittest module to docgen.
11:48:12Araqindeed c2nim can convert whole C files (function implementations/control flow)
11:48:46Araqneeds quite some manual tweaking afterwards of course
11:50:06Araqbbl
15:12:10*erlnoob joined #nimrod
15:13:03erlnoobnice site redesign :)
15:13:43dom96hello erlnoob
15:13:48dom96indeed it is :)
15:13:56erlnoobhello
15:14:31erlnooband 0.9.2 is out!
15:15:13erlnoobbut nimrod definitely needs more marketing
15:16:07dom96erlnoob: What else do you think we could do to make it more popular?
15:16:50erlnoobhmm not sure.. needs lots of link-bait blog posts to HN hehehe
15:17:38dom96yeah, that's what I think also. Problem is getting people to write those blog posts. Trust me I myself am trying to write some.
15:17:45erlnoobgreat language little known, but maybe it's a blessing!
15:18:29erlnoobdom96: care to share a link to your blog?
15:18:47dom96It's still a work in progress so it's not up yet.
15:21:10dom96The URL will probably be: http://picheta.me/blog/
15:21:23erlnoobcool thanks
15:22:20erlnoobwill keep the url for future :)
15:22:27dom96cool :)
15:29:00*Endy joined #nimrod
15:31:51*[1]Endy joined #nimrod
15:34:49*Endy quit (Ping timeout: 276 seconds)
15:37:13*_ponce quit (Ping timeout: 246 seconds)
15:56:41*fowl joined #nimrod
16:50:37Araqerlnoob: we still have 'nil' in the language which is a "deal breaker"
16:51:31Araqnever mind that all it accomplishes for complex code is making me write "if n.typ == nil: InternalError(n.info, "shouldn't happen") " in the compiler everywhere
17:02:08*erlnoob quit (Quit: erlnoob)
17:37:56fowlam i the only one that believes that nil is a value
17:38:18fowleven if it is the value of lacking value, its still a value
17:42:56Araqthe difference between 0 and nil is that even if 0 is an invalid value, it doesn't cause a crash as often as nil as pointer deref is way more common than integer division
17:58:48*erlnoob joined #nimrod
18:00:04*erlnoob quit (Client Quit)
18:12:18fowli dont see what the solution is
18:12:35fowlid rather var x: string NOT allocate a new string until i say to
18:15:12dom96The solution is a TMaybe type.
18:18:47reactormonkdom96, haskell-style?
18:19:04dom96yes
18:29:37*tymat joined #nimrod
18:29:50tymatHello!
18:30:28Araqhi tymat
18:35:18fowli think my TMaybe is pretty useful >_>
18:35:23fowldefinitely moreso than dom's :p
18:35:41Araqwhere is the difference?
18:36:38fowlmine checks isNil(v) if it can
18:37:12fowland doms is immutable
18:51:26*[1]Endy quit (Ping timeout: 252 seconds)
18:54:32*Endy joined #nimrod
19:21:03dom96fowl: Mine was just a proof of concept, I've never actually used it.
19:38:53Araqfyi: http://www.info.ucl.ac.be/~pvr/paradigmsDIAGRAMeng108.pdf
19:40:31dom96Araq: I was once again thinking about babel, and again I think it should work as follows: instead of having the compiler find the installed babel libs, the compiler should simply be called by babel and babel should pass the location of the libs.
19:40:56*Endy quit (Ping timeout: 252 seconds)
19:46:51dom96This would give full control to babel, but would disadvantage quick prototyping where you don't necessarily want to write a babel file and call babel when writing some small app.
19:47:13dom96But in the end you would need a babel file anyway.
19:48:55Araqbabel could do that already, it could pass things via --path
19:49:02Araqso I can't really follow
19:52:58Araqwe only need to make "babel install" also invoke the compiler
19:53:08Araqor perhaps make that "babel build"
19:53:30fowli like the way it is now, if im working inside nimlibs i just have path = ".." in nimrod.cfg and it finds the working fowltek before ~/.babel/libs/fowltek
19:54:27dom96I suppose we can do both. --path overrides --babelPath right?
19:54:40AraqI'm not sure
19:54:55AraqI think command line overrides configuration file
19:55:12Araqso --path on the command line overrides --babelPath hidden in the config
19:55:48dom96right, that would still be fine then.
19:57:52dom96how does --babelPath choose package versions again?
19:58:12Araq0.3.2 is better than 0.3.1
19:58:32*comex` is now known as comex
19:59:10Araqthis means 0.3.1 will never be in your search path unless you add it explicitly
19:59:52Araqbut with babel listening all paths, we can simply get rid of --babelPath completely
20:03:28dom96I was thinking about allowing dependency lists to specify git commit hashes as the version.
20:06:40dom96Since most people don't feel like tagging their commits on git :P
20:09:13Araqyeah sounds like a useful feature
20:12:00*fowl quit (Quit: Leaving)
20:14:03*fowl joined #nimrod
20:42:09dom96wow, that's a lot of deprecated messages for existsKey heh
20:44:03NimBotnimrod-code/nimbuild 7fd9035 Dominik Picheta [+0 ±2 -0]: irclogs: Each IRC message is serialized as a single line and appended to... 2 more lines
20:58:17Araqdom96: if babel invokes the compiler we can implement a very simple form of dependency analysis
20:59:14Araqthe basic idea is that babel simply tries out versions and sees which ones make the project compile :P
20:59:32Araqthis sounds like a hackish solution
20:59:43Araqand yet this is exactly what a human being does
21:00:03dom96huh. Why not let the .babel file specify the version?
21:00:14Araqand it only fails if there are changes in the semantics which are not covered by static checking
21:00:40Araqwell for a start we need a feature "babel check out the deps" anyway
21:00:51Araqso that a library author doesn't have to
21:01:02dom96i'm not sure what you mean
21:01:06Araqand it's a nice fallback
21:01:33Araqok, say I wrote blah-1.0
21:01:42Araqand am creating a babel package for it
21:01:45dom96You mean "babel get me the latest foobar package, I don't care about the version"
21:01:49dom96?
21:01:51Araqno
21:01:59dom96ok, continue then
21:02:16Araqand I used the jester that happens to be installed on the machine for blah-1.0
21:02:34Araqbut I don't know which version of jester
21:02:39AraqI want to do:
21:02:50Araqbabel createPackage blah-1.0
21:02:58Araqand babel generates the babel file for me
21:03:01dom96yeah, ok.
21:03:03dom96That can come later.
21:03:29dom96A good start is getting 'babel build' to work -- with dependencies.
21:03:42Araqyeah alright
21:12:54*_ponce joined #nimrod
21:15:25*ARCADIVS joined #nimrod
21:23:22*_ponce quit (Ping timeout: 246 seconds)
21:29:05dom96Araq: Is there an easy way to set all fields of an object to a value which is "empty but non-nil". i.e. string -> "" and seq -> @[]
21:29:28dom96I suppose I could write a proc to do it myself, but there is nothing in the stdlib is there?
21:30:58*_ponce joined #nimrod
21:31:39Araqdom96: indeed there isn't
21:32:16fowlwrite an initialize(var T) for each type ie initialize(x: var string) = if x.isNil: x = ""
21:33:16dom96meh, i can just do it manually.
21:33:30fowlwhat do you need that for
21:33:53fowldom96, is there a difference in the .babel whether you use key = val or key: val
21:34:10fowlthe example .babel does both
21:34:19dom96there is not
21:34:39fowlok
21:34:51dom96it's how parsecfg works; '=' and ':' are the same.
21:41:31dom96I should really patch parsecfg so that quotes are not required for values without spaces.
21:41:47Araqdom96: yeah ...
21:41:49dom96or in fact even with spaces.
21:41:52Araqno
21:42:00Araqthat breaks stuff
21:42:33dom96alright
21:45:50dom96hrm, which do you think it more proper:
21:46:02dom96*is
21:46:13dom96let babelDir = getHomeDir() / ".babel"
21:46:15dom96or
21:46:29dom96proc getBabelDir: string = getHomeDir() / ".babel"
21:46:38dom96and by proper I guess I mean idiomatic
21:47:38AraqI'd use the 'let'
21:48:37dom96yep, that's what I was thinking
22:16:45*NimBot joined #nimrod
22:19:15dom96!lag
22:19:15NimBot1500ms between me and the server.
22:19:31dom96And we are now using new logs.
22:19:58*tangentstorm joined #nimrod
22:28:57*comex quit (Remote host closed the connection)
22:32:55*comex joined #nimrod
23:08:45dom96Araq: Why does pegs.find match whereas pegs.findAll does not, what's the difference?
23:10:24dom96Araq: Also, shouldn't pegs.find/match work with a seq too?
23:19:51*fowl quit (Ping timeout: 256 seconds)
23:31:29*fowl joined #nimrod
23:46:25reactormonkAraq, so raise without heap, right?