<<17-11-2012>>

00:47:52*q66 quit (Quit: Quit)
03:14:27*fowl_ joined #nimrod
03:16:50*fowl quit (Ping timeout: 260 seconds)
03:44:09reactormonkAraq, ensime looks like a good point to start :-)
03:44:19reactormonkbut let's finish this shit first.
07:10:37Araqreactormonk: hu? we are working on 'compiler as a service' already ...
08:19:53*Araq is now known as araq_bnc
08:56:18*araq_bnc is now known as Araq
09:34:18*Trixar_za joined #nimrod
09:38:00Araqwb Trixar_za
09:39:58Araqping zahary
09:41:17Trixar_zaThank Araq
09:42:06Trixar_zaDamn box was hacked and DDoS'd - I love how these script kiddies have to inflate their egos by adding insult to injury
09:42:33Araqfor some reasons the number of people in this channel is shrinking :-/
09:44:23Trixar_zaIt happens. It'll grow again soon.
09:45:07Trixar_zaEverytime it's Spring or Summer somewhere in the world, then IRC shrinks
09:45:08Trixar_za:P
09:46:14AraqI see ;-)
09:52:20Araqwow there is a german version of the slitaz website
09:59:03Trixar_zaProbably an ancient translation
10:06:00Araqyeah the news section is not up to date ...
10:12:06Trixar_zaWe really need more translators :P
10:17:54Araqnot really
10:18:06Araqenglish version suffices IMHO
10:18:19Araqlinux users are geeks
10:18:32Araqthey all speak a bit of english
10:18:46AraqI have to go, see you later
10:19:13Trixar_zaBye Araq
11:12:23*ekselkiu joined #nimrod
11:21:07*q66 joined #nimrod
11:45:00Araqping q66
11:45:09q66pong Araq
11:45:56AraqI've already discussed this quite a bit with zahary, but like to know a second opinion
11:46:45Araqin Lua there are proper co-routines
11:47:09Araqso you can use them to define an "actor" sequentially
11:47:43Araqsomething like: "turn left; go 10 meters; start shooting the alien"
11:50:09Araqnow if you don't do this in the scripting layer of your engine
11:50:29Araqyou have to convert the sequential code to a state machine
11:52:30Araqthe question is: how often does this come up?
11:53:31AraqNimrod recently got support for "crippled" coroutines/ Python-like iterators (no stack capturing) and the question is how useful they are ... ;-)
11:54:16q66Araq, i use coroutines in a few places but i avoid them in performance heavy things
11:54:41q66but they're useful indeed
11:54:46q66they simplify a lot of things
11:55:00q66they're just a bit slow
11:55:15q66about 2x slower than if you had a regular state machine
11:56:55Araqbut that's Lua specific, right?
11:57:07AraqI mean the "2x slower" part
11:57:34q66Araq, well, i guess they'll always be somewhat slower
11:58:23Araqbut Lua's coroutines support recursion iirc
11:58:37Araqthat means they capture the stack / have their own stack
11:59:07Araqthis may be the reaons why they're slower
12:03:46Araqso what do they simplify for instance?
12:07:22q66Araq, well, for example they simplified lexing strings in my language a lot.
12:07:42q66because strings in Vortex are multi-token
12:07:50q66because of string interpolation
12:08:20AraqI'm asking about examples within a game context :P
12:08:21q66so read_string is just a coroutine that gets resumed each time until it's dead
12:08:29q66returning a token and its semantic value
12:08:41Araqyeah yeah yeah
12:09:15Araqno need to explain lexers to me :P
12:09:24q66Araq, in game context, for example action system, though i don't use coroutines there as i already solved it differently
12:09:29q66basically, you know, there's a main loop
12:09:33q66there's an entity storage table
12:09:48q66each frame, it gets iterated and it "acts" on the entity
12:10:05q66the entity then contains an action queue - i.e. animation changes etc
12:10:26q66actions take N seconds, basically they begin, they run for some time and they end
12:10:41q66so, the entity "runs" on each action in its queue
12:11:15q66the thing is - without coroutines, you have to store all the data in an object and query it each time it's called, as you have no way to communicate between separate frame calls
12:11:40q66with a coroutine, you maintain an infinite loop in the action object, store all the data (private ones anyway) as locals, and yield each iteration
12:11:49q66it simplifies design, but is somewhat slower :)
12:12:18q66as entities and actions are performance heavy though, i use the non-coroutine approach
12:12:37q66of course, in specialized cases, custom action objects can handle their own coroutine in the appropriate method
12:14:36q66speaking of coroutines in this use, they can also be used to create completely table-less objects :)
12:14:49q66where method calls are not method calls, but instead some sort of "signals"
12:15:36q66bbl
12:17:00Araqbrb too
14:44:40zaharyAraq, I was out yesterday and I missed your conversation with dom96. If I was here, I would have corrected you :)
14:44:50zaharyPlease, read this: https://gist.github.com/4096467
14:51:07*FreeArtMan joined #nimrod
15:21:59*XAMPP_ quit (Ping timeout: 246 seconds)
16:03:04Araqzahary: alright, I think I figured it out finally
16:03:23Araqbut I'm reading your gist now
16:03:46Araqwelcome FreeArtMan
16:04:04*ekselkiu quit (Ping timeout: 260 seconds)
16:04:05FreeArtManhi Araq
16:06:52AraqFreeArtMan: are you new or did you change your nick? :-)
16:07:14FreeArtMannew
16:07:31Araqgood
16:09:20Araqjust ask if you need any help, nobody here bites
16:11:13FreeArtManok ;]
16:11:14Araqzahary: my design looks almost identical; I called TPromise an "event" instead, not sure if that is the better term
16:12:50Araq(and yeah, we are aware 'select' is ancient ... but for now it did the job)
16:15:01dom96Araq: I think that TPromise is a better term. It rings a bell with me at least.
16:15:39dom96Also the name has a meaning, you are making a "promise" that the data will be retrieved at some point the future.
16:15:56Araqthe problem is that there are quite a few of these concurrency related terms and I'm not sure they have formal definitions
16:16:18Araqactually the code doesn't make a 'promise' at all
16:16:33dom96And changing select to epoll should not be a problem.
16:17:01Araqyield download(url) does not promise anything
16:17:19Araqinstead it means: "wait for a downloading-completed event"
16:17:54dom96It promises that the resource at ``url`` will be downloaded at some point in the future, no?
16:18:13Amrykid:o are you guys talking about asynchronous stuff?
16:18:30AraqAmrykid: indeed and nimrod is getting native support for it
16:18:38AmrykidAraq, thats awesome.
16:18:44Araqin fact, the key feature for it has already been implemented
16:19:26Amrykidok, so I read up until the TPromise bit. instead, yield seems like 'wait'.
16:19:44Araqthat's my point, yes
16:20:16Amrykidcan you not like attach a callback (closure) when it returns, that'll execute?
16:20:16zaharyI'm just passing by and have to go - it's true that future/promise/task/etc are used a bit inconsistently across the different languages, but still they are relatively established as terms
16:21:05AraqAmrykid: yeah but then you have to wrap the continuation in a callback
16:21:11Araqwith 'yield' you don't have to
16:21:18zaharyalso, I have not covered error handling in my gist - this is also important
16:21:39AmrykidAraq, so what seems to be the issue?
16:21:59Amrykidwith 'yield'?
16:22:01zaharysee you later
16:22:06Araqno real issues, we're discussing details of the design/API
16:22:13Amrykidah
16:22:17Araqzahary: alright
16:28:20Araqwell for me 'promise' implies that some threading is involved
16:28:44Araqbut 'yield' has nothing to do with threads
16:29:05Amrykidyield is for iterators, correct?
16:29:33Araqyes
16:30:17Amrykidbest you use a seperate keyword like 'promise' or something to prevent double definitions.
16:34:30Araqwell what do you wait for?
16:34:38Araqa 'promise' or an 'event'?
16:36:00Amrykidan event. people don't always keep their promises. events happen unless they are canceled.
16:40:59dom96Araq: I want to see why nimbuild's CPU usage spikes, can I use your profiler for that?
16:52:09AraqI doubt it ;-)
16:52:49Araqyou can try
16:52:55Araqwhen it spikes you can press ctrl+c and inspect the stack trace :P
17:13:16dom96hrm, the results are what I suspected
17:13:24dom96Although i'm not sure if i'm reading it correctly heh
17:18:02FreeArtManAraq, is in nimrod is possible segfault?
17:18:05FreeArtManmade by user
17:20:04FreeArtMani more interested in out of array indexing
17:21:41*fowl_ quit (Ping timeout: 245 seconds)
17:24:21AraqFreeArtMan: segfaults are possible but mostly because the compiler doesn't insert null pointer checks
17:24:45Araqarray bounds are checked and lots of other checks are performed too in debug builds
17:24:59FreeArtManthat very nice then
17:25:24Araqit's memory safe if you don't misuse some C wrapper and stay away from 'cast' and 'addr'
17:25:47Araq'cast' and 'addr' are unsafe but easily detected because they are keywords
17:28:28FreeArtMani have seen nimrod syntax and told to my self that it beautiful =D
17:28:41Araqthanks :-)
17:29:03Araqsome people find it "weird" instead ;-)
17:30:38FreeArtManwierd its maybe not C like
17:38:42Araqyeah, speaking of which ...
17:38:46Araqiterator p(): TEvent =
17:38:54Araq yield download(url)
17:39:17Araq yield download(url2)
17:39:29Araq--> this is not an 'iterator'
17:39:39Araqand it doesn't really 'yield' either
17:40:27Araqit uses the same implementation as an iterator though ...
17:42:01Araqwe could introduce new keywords for it:
17:42:23Araqtask p(): TEvent =
17:42:30Araq await download(url)
17:42:39Araq await download(url2)
17:43:29Amrykid^
17:43:38FreeArtManis there some standart for nimrod'e?
17:44:53dom96Araq: Maybe the ': Tevent' should then be implicit for 'task'?
17:45:37Amrykidthis all sounds like what C# did, just putting that out there.
17:46:31Amrykidin .NET 4.5, C#/VB have Async/Await keywords that function like this.
17:46:42AraqAmrykid: we know ;-)
17:46:58AmrykidAraq, yeah, I thought this wasn't 'C#' :D
17:47:26*XAMPP joined #nimrod
17:47:50Araqwell the new features of C# are all good because they hired people who know what they are doing
17:48:14Araqso it's no shame to copy from C# :P
17:48:25Amrykidheh
17:48:36Araqit's the old Java-like parts that are annoying
17:49:26dom96hrm, seems Github is failing at webhooks.
17:49:47Araqit's because your dom.co.cc domain ceased to exist
17:50:02dom96ahh yes.
17:50:06dom96Of course.
17:50:45AraqFreeArtMan: we have a manual/spec but it's no ANSI/ISO standard ;-)
17:50:54Araqyet :P
17:52:03dom96meh, that's old
17:52:41Araqyeah github gets webhook switching wrong
17:52:54Araqdid the same for the nimrod compiler
17:54:40dom96nah, test hook just sends the master branch
17:54:46dom96instead of the latest branch
17:55:14Araqhrm, perhaps
17:55:29*XAMPP quit (Quit: Leaving)
17:56:49Araqboth 'await' and 'async' can be implemented as macros
18:01:45Amrykidi see how you would use 'await' but async?
18:01:51Amrykidasync proc... ?
18:03:51Araqproc p {.async.} = ...
18:05:28*XAMPP joined #nimrod
18:06:56Araqand yeah, dom96, the ': TEvent' should be implicit then
18:13:25*fowl joined #nimrod
18:14:31*XAMPP quit (Quit: Leaving)
18:14:47*XAMPP joined #nimrod
18:15:35FreeArtManis some large project with nimrod?
18:15:41FreeArtManthat i can get and compile?
18:16:05dom96FreeArtMan: Aporia, jester, nimbuild are some examples ;)
18:16:12dom96and of course the Nimrod compiler itself
18:16:26FreeArtManok will check them now
18:23:30Araqhrm C# 5's await does not capture the stack either
18:23:44Araqwhich means Nimrod's is on par
18:25:23FreeArtManhow was to compile smallest possible code?
18:25:40FreeArtMani have found it on the site and now cannot find again
18:28:49Araqhttp://nimrod-code.org/question.html
18:28:57AraqFor the standard configuration file, -d:quick --opt:size does the trick.
18:29:17FreeArtManthx
18:29:28dom96Araq: What limitation does not capturing the stack introduce?
18:30:19Araqactually I may be wrong for C#, still trying to figure it out
18:30:49Araqthe limitation means that the async "workflow" needs all to be within a single iterator
18:31:01Araqyou can't do:
18:31:17Araqproc foo() = yield
18:31:26Araqiterator bar() =
18:31:28Araq foo()
18:32:13AraqI don't think how often this will come up in practice
18:32:57AraqI tried to ask q66 about it but he instead explained efficiency tradeoffs in Lua :P
18:34:13dom96will that mean then that I will not be able to call an async proc from within an async proc?
18:34:34FreeArtMancannot compile Aporia
18:34:38FreeArtMansome error
18:34:54dom96FreeArtMan: You need the latest compiler from git.
18:35:04FreeArtManok
18:39:27Araqdom96: you can do that ... mostly ...
18:39:33Araqit's complicated :P
18:39:47dom96lol. ok
18:40:38Araq0.9.0 is not good enough to compile aporia?
18:40:53dom96I think I added some stuff to the gtk wrapper
18:40:54dom96so no
18:41:04AraqI see
18:41:20Araqyou should provide stable aporia releases :P
18:41:48dom96I do.
18:42:09Araqreally? where to get those?
18:42:34AraqFreeArtMan: nimrod's forum is also written in Nimrod
18:43:03Araqand so is NimBot
18:43:21FreeArtMani am not in nimrod!!!
18:44:02AmrykidIm still sad that nimbuild doesn't provide builds of aporia, which i thought was the offical nimrod ide
18:44:02Araqhu? read it again
18:44:08dom96Araq: https://github.com/nimrod-code/Aporia/downloads
18:45:51Araqdom96: maybe we should put these on nimrod's website ...
18:46:08dom96Araq: Sure, if you want.
18:46:12AraqI don't expect github to host binaries
18:46:25dom96Might as well wait for the new release though
18:46:39FreeArtManhost base64 binaries =D
18:46:43Araqand Amrykid is right, nimbuild should provide them
18:47:10dom96Well pull requests are always welcome for Nimbuild ;)
18:47:27dom96I'm having a hard enough time finishing branch support
18:48:21FreeArtManit possible to compile kernel module with nimrod? =D
18:49:49AraqFreeArtMan: people wrote toy OS kernels in nimrod
18:50:32FreeArtManprove in the studio
18:50:49FreeArtManAporia compiles fine with newest nimrad
18:51:00FreeArtManand works
18:51:26AraqI know, I recompiled it today ;-)
18:51:45AraqI'm using it all the time
18:51:49FreeArtManon 64bit system? =]
18:51:54Araqyes
18:52:10FreeArtMan;]
18:52:47Araqon linux
18:53:28FreeArtMan;]
18:56:00Araqcan't see a reason why Linux kernel modules can't be written in nimrod but it requires some command line options to strip away the stdlib
18:56:30FreeArtManmodule dont have standart headers
18:57:55Araqyou need to patch nimbase.h then :P
19:19:04Araqugh annotating the stdlib with tags is quite some work :-/
19:31:25AraqI have the effect 'FDb' and then have to annotate almost every operation in db_sqlite
19:32:21Araqhowever this is redudant as every operation having a 'db: TDbConn' parameter should be annotated with FDb ...
19:33:30dom96Maybe being able to push {.effect: FDb.} or whatever it is so that all procedures get it would be useful?
19:34:03Araqit's not all procs, but most
19:34:18dom96yeah, then you could pop around them?
19:34:34Araqthat would work
19:34:59Araqbut I need to distinguish between FReadDB and FWriteDB anyway
19:35:32dom96ahh
19:35:39Araqand then it may even catch some real bugs
19:36:06Araqinstead of being a "feeling good" feature ;-)
19:45:14Araqhrm, is 'open' and 'close' an effect?
19:45:35Araqyes.
19:54:59*FreeArtMan quit (Quit: Out of this 3D)
20:02:59reactormonkAraq, yeah, but the emacs API
20:03:34Araqadhereing to an API that I didn't invent is no fun :P
20:08:25reactormonkAraq, go implement SWANK :-P
20:12:15Araqswig support sounds more useful :P
20:24:20*XAMPP_ joined #nimrod
20:27:47*XAMPP quit (Ping timeout: 246 seconds)
20:30:59*fowl quit (Changing host)
20:30:59*fowl joined #nimrod
20:31:42Araqdeploy this new awesome NimBot asap :D
20:31:54Araqdoes it pass the Turing test now?
20:32:20dom96Yep. It has a female personality too.
20:32:51Araqwith a sexy voice?
20:33:08Araq!lag
20:33:08NimBot7ms between me and the server.
20:33:09dom96of course.
20:33:32Araq!strip
20:33:41dom96lol
20:33:45Araqnot implemented, hu?
20:33:52dom96no :P
20:34:54Araqmore realistic that way ;-)
20:35:24Araqmost girls don't obey this command either
20:35:32dom96hah
20:37:08fowldom96: you should use something like this for the commands: https://gist.github.com/4013528
20:38:46dom96perhaps, but NimBot doesn't really need anything complicated. At least for now.
20:39:31dom96Wish I had time for fancy macros :|
20:47:05dom96grr. I think I just found a bug in the IRC module.
20:47:26Araqcan't be a serious bug, can it?
20:49:04dom96Well, it's not super bad.
20:49:07dom96But not trivial either
20:49:28dom96I need to see how the IRC protocol works in this situation to know.
20:53:09Araqthat sounds like an "undocumented feature" then
20:53:32dom96It shouldn't cause any issues unless you are changing your nick.
20:53:39dom96Fixing now.
21:25:42Araqdamn writing to a PSurface can be an IO operation but often is not ... :-/
21:25:57Araqso graphics.nim can't annotate anything
21:26:48fowlwhen is writing to a surface IO
21:27:19fowlalso i thought about it and why not just have PSurface = ref sdl.PSurface
21:27:57fowlsdl.psurface has w/h fields already
21:28:36Araqyeah but it's more convenient this way
21:29:31Araqonce destructors work properly we can even do: PSurface = sdl.PSurface
21:30:30Araqthe indirection is only necessary for the finalizer
21:31:04Araq"writing to a surface" is no IO unless it's the screen surface
21:31:27fowlahh
21:33:14Araqhowever for a game server any graphics operation is likely a bug ... hrm
21:41:12fowlgame server dont need to run any graphics
21:45:12Araqyes that's the point
21:45:49Araqso you do: proc serve() {.tags: [].} and the compiler validates that 'serve' has no tag 'FGraphics'
21:46:27dom96why would anyone put graphics code in server code? 0_o
21:46:47Araqbecause of weird dependencies?
21:46:58Araqthese things tend to creep in ...
21:47:10Araqand it's nice you can shield against it
22:01:28Araqhttp://dendory.net/blog.php?id=509ec629
22:13:44*NimBot_ joined #nimrod
22:13:44*NimBot_ quit (Remote host closed the connection)
23:22:18*NimBot_ joined #nimrod
23:22:49dom96!trusted
23:22:50NimBot_Trusted users: dom96@unaffiliated/dom96
23:22:52dom96yay
23:23:37Araq!strip
23:23:51Araq!untrusted
23:23:55dom96She doesn't like ya
23:24:02Araq!trusted
23:24:02NimBot_Trusted users: dom96@unaffiliated/dom96
23:24:11Araqyeah, she doesn't trust me
23:24:21dom96!addtrust
23:24:22NimBot_Syntax: !addtrust <nick> <host>
23:24:27dom96Araq: Try using that command
23:25:54Araq!addtrust Araq host
23:25:54NimBot_Access denied.
23:25:57dom96:D
23:26:09Araq!addtrust trust me
23:26:10NimBot_Access denied.
23:26:34dom96!addtrust Araq 2a01:7e00::f03c:91ff:fe93:822b
23:26:35NimBot_Done.
23:26:38dom96!trusted
23:26:38NimBot_Trusted users: dom96@unaffiliated/dom96, Araq@2a01:7e00::f03c:91ff:fe93:822b
23:26:55Araqipv6?
23:27:05dom96yeah. IP of the BNC
23:27:21dom96Freenode picks that up for some reason
23:27:24Araquse my MAC instead :P
23:27:52dom96lol nah
23:28:00dom96Try using !addtrust again
23:28:10Araqno
23:28:15AraqI'm busy
23:28:28dom96Fine :(
23:30:25*NimBot_ quit (Remote host closed the connection)
23:31:35dom96Araq: Marshal creates quite odd json files
23:32:45Araqhow so?
23:32:59dom96it doesn't seem valid
23:33:10dom96yeah...
23:33:18dom96Seems like a bug
23:33:23dom96:(
23:34:58AraqI screwed up json generation?
23:35:14*Araq doesn't believe it :P
23:35:24dom96https://gist.github.com/7519dfbd52ff4ebf211b
23:35:32dom96Might be something else
23:36:04Araqyes
23:36:39*XAMPP_ quit (Read error: Connection reset by peer)
23:37:07*XAMPP_ joined #nimrod
23:43:44dom96Araq: here is the object I serialize: https://gist.github.com/f8e1861e89c35f2138ba
23:46:21*XAMPP_ is now known as XAMPP
23:46:26*XAMPP quit (Changing host)
23:46:26*XAMPP joined #nimrod
23:55:24Araqdom96: proper bug report please
23:55:31dom96will do
23:55:32Araqlooks difficult
23:58:52Araqplease check if the unit tests in marshal.nim work for you
23:59:12Araq(nimrod c -r lib/pure/marshal.nim)
23:59:48dom96seems to work