<<11-11-2012>>

01:05:10*XAMPP joined #nimrod
02:25:55*q66 quit (Quit: Quit)
02:41:30AmrykidWasn't there an effort for nimrod to support 'compiler as a service' a while ago?
07:57:02AraqAmrykid: very basic support for compiler as a service exists, but it's not yet used from aporia
08:05:21Araqand until that is implemented I won't work on the feature as testing it via telnet is a pita ;-)
08:13:27reactormonkAraq, just write some tests
08:13:52Araqindeed I should ... looks like quite some work though :P
08:15:45Araqand I'm figuring out how to use my effect system to prevent deadlocks
08:15:45Araqlooks like a simple problem ;-)
11:38:49dom96good morning
11:39:48*Vladar joined #nimrod
11:40:10VladarHi
11:40:20dom96hello Vladar
11:47:24VladarSo, is there any way to pass some comments from code to html-file generated by 'doc' or 'doc2'?
11:49:36dom96Yeah: ## starts a doc comment
11:50:19Vladaroh, probably missed that. Thanks!
11:50:31dom96Place it underneath a proc declaration
11:50:48dom96You can also document types like that.
11:51:07VladarWill try it right now.
11:51:10*q66 joined #nimrod
11:51:23dom96for example take a look at the stdlib: https://github.com/Araq/Nimrod/blob/master/lib/pure/ftpclient.nim#L78
12:02:14Araq TEffect* = object of TObject ## base effect class; each effect should
12:02:14Araq ## inherit from `TEffect` unless you know what
12:02:14Araq ## you doing.
12:02:14Araq FTime* = object of TEffect ## Time effect.
12:02:14Araq FIO* = object of TEffect ## IO effect.
12:02:43Araq FRead* = object of FIO ## Effect describing a read IO operation.
12:02:44Araq FWrite* = object of FIO ## Effect describing a write IO operation.
12:03:32dom96Time effect?
12:03:34Araq FExec* = object of FIO ## Effect describing an executing IO operation.
12:03:34Araqthat's what I've got so far ... any better names?
12:03:45dom96what is that?
12:03:50Araqdependent on some timing issue
12:04:01Araqfor now I can only image "uses os.sleep"
12:04:14Araq*imagine
12:04:16dom96hrm, so wouldn't all of the times module be that? :P
12:04:39Araq'-' for TTime wouldn't :P
12:05:01dom96Does that mean that the output changes based on the current time, or does it mean that the output could be returned at an arbitrary time?
12:05:12dom96I guess both?
12:05:36Araqit means that a proc p uses os.sleep ;-)
12:06:05Araqor perhaps that it makes some time guarantees like "does not block for more than 3ms"
12:06:32dom96ok, so it does not apply to the times module
12:06:41dom96I guess the times module is FIO
12:06:55Araqno, the times module is FTime for the most part
12:07:04dom96how is it?
12:07:13dom96it doesn't use os.sleep
12:07:18Araqeffects propagate so it's important that the built-ins are properly annotated
12:07:47Araqsure it doesn't use os.sleep, but it *does* deal with time
12:08:41dom96Yeah, but your definition of what FTime means does not suggest that it applies to the times module.
12:08:41Araq'-' for TTime is not FTime as it's a pure function
12:08:59Araqmost other functions in times.nim are not pure
12:10:31dom96Why do we need a separate Time effect anyway?
12:10:53dom96sleep seems like an IO thing
12:11:02dom96and so does retrieving the current time
12:12:31AraqI want to avoid haskell's IO issues
12:12:49dom96what issues are those?
12:12:56Araqfor instance, it's perfectly fine to do 'getenv' in a transaction and to retry it
12:13:10Araqyet haskell's type system would prevent it
12:13:24dom96what if the environment changes?
12:13:57dom96FTime suggests that the proc is timed, but the output will always be the same.
12:13:57Araqgood point, but it could have changed before the first call to 'getenv' too
12:14:05dom96And in that case it does not apply to the times module :P
12:14:19Araqhm, a very good point
12:15:08AraqFTime is a very subtle effect
12:15:21Araqfor instance it doesn't prevent evaluation at compile-time
12:15:32Araqand yet a call to os.sleep MUST not be optimized away
12:16:11Araqeven if its argument is known at compile-time
12:16:53dom96why would you use os.sleep at compile-time?
12:17:37Araqthe point is this should work:
12:17:43Araqproc p(): int =
12:17:49Araq os.sleep(15)
12:17:54Araq result = 12
12:17:57Araqconst x = p()
12:18:22Araqthough maybe that really shouldn't happen in practice
12:18:34Araqand it's bad code to begin with ... I dunno
12:20:05dom96Sorry, I still don't get why...
12:20:24dom96also I don't get what you mean about 'getenv'
12:20:56Araqwell everything that's happening in a transaction needs to be able to be rolled back
12:20:58dom96'getenv' should have the FIO effect.
12:21:25Araqthis means FWriteIO is not allowed in a transaction
12:21:39Araqbut IMO FReadIO is fine in a transaction
12:21:52Araqgetenv should be FReadIO
12:22:24dom96ahh.
12:22:29dom96That makes sense, yes.
12:22:36dom96Haskell doesn't separate those.
12:23:06dom96But I'm not sure it would be of benefit to it, if it did separate it.
12:28:43Araqwell one of ghc's authors thinks so :P
12:29:55Araqbut as usual I lost the link ;-)
12:31:24Araqit's however common sense: IO is simply a too wide field
12:31:56Araqfor instance for my code the difference between "logging IO" and "writes to database" is big
12:33:52Araqin fact, for logging I might fake that it performs no IO ;-)
13:42:17zaharyAraq, if you are still uncertain about the naming scheme, an alternative way is to organize it arround the verbs: TReads, TWrites
13:49:23Araqzahary: but that's confusing as 'reads' and 'writes' are further effect pragmas
13:49:57Araqbut I have to go, see you later
15:13:25*ozkriff joined #nimrod
15:14:07*ozkriff_ joined #nimrod
15:14:55*ozkriff quit (Remote host closed the connection)
15:15:23*ozkriff_ quit (Client Quit)
15:17:53*ozkriff joined #nimrod
15:18:09ozkriffhi
15:22:36Araqwelcome ozkriff
15:24:46Araqer zahary, what do we need quasiquote for? what's the difference to getast?
15:25:06zaharyhaven't we discussed this like gazillion times?
15:25:20Araqno?
15:25:57zaharyare you sure? do you see the docs?
15:26:30Araqyes I do, but getast + a template seems to solve the very same problem?
15:27:10zaharyyes, and this integrates it better into the language - we really have talked about AST quoting many times before
15:28:25Araqwhy did you start with getast then? :P
15:29:05zaharygetAst is still useful if you want the template to be usable by itself
15:29:18Araqbtw we also talked about using \ for getting back the operator
15:29:51zaharyand about [. .] as quoting operator
15:29:51Araqand the lexing rules now reflect that
15:29:59zaharythese details are easy to change
15:30:05Araqaha
15:30:11zaharyin fact, the current grammar doesn't work very well with the feature
15:30:12Araqso it's no "final" patch
15:30:17zaharyvar @a = 10 # not possible
15:30:29Araqyeah I know
15:30:30zaharyvar x = `foo(10)` # not possible
15:35:52*ozkriff quit (Ping timeout: 245 seconds)
15:39:06*ozkriff joined #nimrod
15:40:42ozkriffI can't understand from docs how to use dynamic arrays
15:40:49ozkriffHow can i set array length in runtime?
15:40:55ozkriffOnly adding elements one by one to sequence?
15:41:14ozkriffsorry for my english(
15:42:26Araqozkriff: there is also 'setLen' and 'newSeq'
15:43:19Araqzahary: that's one reason why I don't like 'quote'; I don't find it particularly useful with the current syntax
15:43:55Araqthe next logical step would be to come up with a decent macro API; currently we only have the minimum that's necessary
15:43:57zaharywell, I was going to talk to you about changing the grammar a little bit
15:44:20Araqproblem is: I don't like how it reads in Lisp either ;-)
15:44:45zaharyand getAst is better? just open my unittest module
15:44:49Araqthe declarative approach only goes so far ... and then you want to construct it imperatively
15:45:39zaharyno, no - I almost never want to construct it imperatively - I may want to glue some quoted bits together or to edit some subnode after quoting
15:46:05zaharywhich are both possible with getAst and quote
15:46:13AraqI'm thinking of loops
15:47:12zaharyIMO the unittest module is a very good example for what's needed and what's useful
15:47:24AraqI'm looking at it (again)
15:48:14Araqmacro check uses 2 accumulators
15:48:28Araq'argsAsgns' and 'argsPrintOuts'
15:48:46zaharybut notice how I build everything out of smaller quoted pieces of code like asgn and print
15:49:04zaharyif I had to build this with newNimNode:
15:49:05zaharywhen compiles(string($value)):
15:49:05zaharycheckpoint(name & " was " & $value)
15:49:07Araqyeah but I'm arguing that's an API problem
15:52:22AraqI can't follow, what do you mean?
15:52:43Araqoh
15:52:53zaharyI'm missing your point too - getAst/quote is exactly about mixing imperative code with "declarative" bits
15:53:55AraqargsPrintOuts.add getAst(print(argStr, arg))
15:54:16ozkriffAraq: thanks! And one little question more: what is nimrod-way for: sscanf(buffer, "v %f %f %f", &v->x, &v->y, &v->z)
15:54:16Araqok, how exactly does the new built-in improve that?
15:55:34Araqozkriff: that's much harder ;-)
15:55:50zaharyit's like asking how closures improve on global function with a userData cookie param
15:56:22zaharyit makes the code smaller, removes some boilerplate, puts related things closer in the code, etc
15:56:32Araqit's not; my point is: I can easily parse it
15:56:49Araqthe way it is now especially because there are no quoting rules to consider
15:57:08AraqI get that you want the 'print' definition inline
15:57:41Araqand indeed I would prefer that too, but I dislike quoting
15:58:13zaharywell, what's the alternative?
15:58:23Araqan anon template?
15:58:36Araqnot sure yet ;-)
16:00:31zaharyit's possible to make even more like closures - identifiers from the outer scope are automatically intercepted
16:00:37Araqthe nice thing about templates is that you have named params which avoid the quoting
16:01:03zaharybut then, you often need to interpolate a bit more compilated expression `foo(bar, baz)`
16:02:13Araq'quote' requires special semchecking which means it's actually more of a keyword
16:02:31Araqand indeed it builds an anon template and calls getast on it
16:02:42zaharynot really - once we fix the lazy semantizing in overloading it will work fine
16:02:58Araqhrm that may be true
16:04:33Araqactually 'template' was supposed to be a quasiquote, at least within macros; but then I never got around it and template proved to be very useful for '!='
16:05:06Araqand it would be confusing if 'template' changed its semantics slightly in a macro body
16:09:06Araqozkriff: you need to create some helper proc that calls strutils.parseFloat or parseutils.parseFloat
16:09:44Araqor if you're very lazy, you can easily wrap C's sscanf
16:15:52*ozkriff quit (Ping timeout: 245 seconds)
16:24:49Araq result = (template (Exp, lineInfoLit, expLit): stmt =
16:24:50Araq if not Exp:
16:24:52Araq checkpoint(lineInfoLit & ": Check failed: " & expLit)
16:24:54Araq fail())(checked, checked.lineinfo, checked.toStrLit)
16:25:21Araqhrm and you suggest closure-like capturing
16:25:28*Araq likes it
16:26:46zaharyit's relatively easy to do, but I see 2 potential problems with it
16:27:41zahary1) as I said, you still need a way to interpolate more complex expressions (you either need quoting operator of some kind or you need to assign them to a named variable in the outer scope)
16:28:30zahary2) it will lead to silent errors - typos will be turned into nkIdents, mistyped variabled will be tyrned into nkIdents, etc
16:28:36Araqtrue but is (1) really common?
16:29:29Araqand how would 'quote' prevent that?
16:30:01zaharyout of the 5 getAst calls in unittest, 4 use non-triavial exprsesions
16:30:11zaharythat was about 1)
16:30:34zaharyabout 2), if you have quoting operator, the expression inside it must be a valid PNimrodNode - otherwise you get an error
16:31:12AraqI can't follow, every getAst call that I'm looking at does some easy substitutions
16:32:02zaharyit's possible to interpolate things like ex.lineinfo too, but the rules become a bit more complicated
16:33:51Araqyou can always pass ex.lineinfo to the anon template just like it's now
16:33:51zaharyto clarify: how do you know I didn't mean `ex`.lineinfo?
16:34:32zaharyah, you are talking about your anon template alternative
16:34:43zaharywell, it's more verbose for starters
16:34:55Araqis it?
16:36:37zaharywell, I wrote a param list, had to think about names for the params, used some funny javascript-like parentheses
16:36:46zaharydo you dislike quoting that much?
16:37:19Araqdunno have to see more real world examples ;-)
16:37:56Araqbut I surely dislike an ever growing list of magics which need special semchecking
16:38:15zaharyI did it only for performance reasons btw
16:38:23zaharyit is possible to be defined as a normal macro
16:38:38Araqtrue
16:38:41Araqgood point
16:38:42zaharyand yet why did you implement static as a keyword :P
16:38:56Araqit felt right :P
16:39:33AraqI also want a 'static case'
16:39:44Araqand maybe 'when' should become 'static if'
16:39:54zaharyif static(foo)
16:40:03zaharythat's how it was supposed to be in my hypolang
16:40:41zaharyif foo is const already, you can omit the static part
16:57:49Araqcompile-time still seems an unnatural default :P
16:59:15Araqbrb
17:36:05*ekselkiu joined #nimrod
17:52:13Araqback
18:02:25*XAMPP quit (Ping timeout: 246 seconds)
18:04:25*Guest67212 joined #nimrod
18:19:56AmrykidAraq, is there any documentation for the caas support?
18:21:39Araq'nimrod serve' starts it
18:21:58Araqand then you're supposed to give the socket a command line to tell nimrod what to do
18:22:16*Guest67212 is now known as XAMPP
18:22:23*XAMPP quit (Changing host)
18:22:23*XAMPP joined #nimrod
18:22:24Araqand no, there is no documentation
18:22:35Amrykidthen I telnet into it, im assuming?
18:22:52Araqfor testing, yes
18:23:22Amrykidok, thank you
18:25:01Araqfyi: http://spin.atomicobject.com/2012/11/11/unifying-programming-and-math-the-dependent-type-revolution/#more-90305
18:44:12VladarNimgame v0.3 is released: http://forum.nimrod-code.org/t/107
18:47:08AraqVladar: cool, does it run on linux?
18:48:07VladarAraq: Of course, I making it on Linux.
19:20:06q66Vladar, got screenshots?
19:31:12dom96hrm, seems the latest compiler cannot compile nimgame. I get linker errors. "Multiple definition of ..." errors,
19:31:55dom96Vladar: Looking at the documentation it is looking quite nice and powerful. Nice job!
19:32:08Vladarq66: not much to look at: http://ge.tt/19mZfPR/v/0 you can see screen scaling and buttons.
19:33:54Vladardom96: try 0.9.0 version. I'm also get those "Multiple definition" errors on latest builds. Don't know what changed in compiler lately to cause it.
19:34:53*Trix[a]r_za is now known as Trixar_za
19:38:46dom96Vladar: Awesome, it works with 0.9.0 :)
19:39:15dom96Buttons are a bit weird heh. Shouldn't pressing 'Exit' once quit?
19:39:41VladarIt should.
19:41:02dom96btw does it not support mp3s?
19:41:52dom96it kind of seems like the buttons are toggle-buttons.
19:42:38Vladardom96: it depends on smpeg library. I tried windows version under wine and it played _some_ of mp3's with this smpeg.dll.
19:42:52dom96I see
19:43:02Vladardom96: two of buttons are toggle ones.
19:43:18Vladar'shuffle' and 'next'.
19:43:58q66Vladar, interesting, how about OS X support :)
19:45:01dom96Vladar: When I start it and immediately press the 'play' button it seems to get stuck in the toggled position.
19:45:02Trixar_zaOh sweet
19:45:07Vladarq66: Depends on Nimrod and SDL =)
19:45:18q66SDL works just fine :P
19:45:38q66Nimrod should too
19:45:48q66so I guess there is no platform specific code in the thing?
19:46:18Vladardom96: maybe it just freezes? It's win version, right?
19:46:29dom96Vladar: no, linux.
19:46:41dom96Vladar: That's quite possible.
19:47:06dom96However when I hover over the button it changes.
19:47:08Vladarq66: no, it is just frontend to SDL with some game specific classes.
19:47:47Vladardom96: any console output errors? Also, might be some libs missing.
19:47:59dom96Vladar: No, nothing in the console.
19:48:05dom96Vladar: What libs are required?
19:48:57dom96Vladar: It seems I can reproduce it every time if I give focus to another application, then click on the play button.
19:49:15dom96Then clicking anywhere in the app makes the play button untoggle.
19:49:30Vladaroh, I will test it.
19:50:14dom96I like the songs, where did you get them? :)
19:50:15VladarThanks. Probably, something in button logic.
19:50:25dom96no problem.
19:51:48dom96btw the CPU usage of it seems to be pretty high, any ideas why?
19:53:30Vladardom96: what songs? Isn't 'music' folder empty?
19:54:07dom96Vladar: nope, heh. Maybe you included them by mistake. I downloaded the source + demo.
19:54:40Vladardom96: screen updates? Press 'F' and see how much FPS you get.
19:55:00dom96~200
19:55:30Vladardom96: so here is your cpu usage, I guess.
19:56:28AraqVladar: I'll look into the linker errors, should be easy to fix
19:56:48Vladardom96: yeah, this is songs I tested it on. From "keygens music pack".
19:56:53Araqonce I got the dreaded tags feature to work :-/
19:57:06dom96Vladar: haha. Nice.
19:57:18VladarAraq: Thanks =)
19:58:29dom96Vladar: I'm guessing a sleep() in your infinite loop in ``start`` would lower the CPU usage.
19:58:58dom96But lower the FPS too :\
19:59:39VladarI think, I'll add maxFPS option later.
20:01:20VladarAnd come on, all games eating a lot of CPU =)
20:01:41dom96I guess, heh. Well great job :)
20:01:58Araqsleep is a good idea in a while true loop
20:25:36VladarBye.
20:25:51*Vladar quit (Quit: Leaving)
20:34:38*Trixar_za is now known as Trix[a]r_za
21:46:18*Trix[a]r_za is now known as Trixar_za
22:23:19*Boscop quit (Disconnected by services)
22:23:21*Boscop joined #nimrod
22:39:14*ekselkiu quit (Ping timeout: 260 seconds)
22:45:50fowleh vladar comes back tell him to use TFPSmanager and framerateDelay() in sdl_gfx
22:47:18Araqtell him on the forum ;-)
23:41:09fowli get a bunch of errors from gcc trying to compile his demo: https://gist.github.com/b03cbbfe67c20e0004cc
23:54:57Araqfowl: seems to be a recently introduces compiler bug
23:55:06Araqhaven't looked at it
23:55:19Araq*introduced