<< 21-11-2013 >>

00:07:17*brson joined #nimrod
00:10:13C0C0anyone interessted in a mersen twister implementation (I heard there was some critic on the defulat rng a while ago)?
00:12:35*webskipper joined #nimrod
00:13:30*webskipper quit (Client Quit)
00:30:48*xenagi joined #nimrod
00:39:34VarriountC0C0, interested as in, to code, or interested as in, to use/include?
00:58:05VarriountAraq, will the new VM fix any bugs with generic creation/instantiation?
01:03:01*BitPuffin quit (Ping timeout: 248 seconds)
01:42:42*NimBot joined #nimrod
01:45:31mkbd/w 3
01:50:41*familiar125 joined #nimrod
01:51:46*DAddYE quit (Remote host closed the connection)
02:04:32*brson quit (Quit: leaving)
02:04:46*brson joined #nimrod
02:15:02*brson quit (Ping timeout: 248 seconds)
02:28:28*brson joined #nimrod
02:31:48*comex quit (Ping timeout: 245 seconds)
02:50:13*brson quit (Ping timeout: 248 seconds)
03:02:42*DAddYE joined #nimrod
03:07:05*DAddYE quit (Ping timeout: 252 seconds)
03:26:26*DAddYE joined #nimrod
03:30:51*DAddYE quit (Ping timeout: 246 seconds)
03:45:02*brson joined #nimrod
03:49:25*brson quit (Ping timeout: 248 seconds)
03:52:20*DAddYE joined #nimrod
03:52:38*DAddYE quit (Remote host closed the connection)
03:52:44*DAddYE joined #nimrod
04:07:06*brson joined #nimrod
04:30:06*brson quit (Ping timeout: 265 seconds)
04:35:42*xenagi quit (Quit: Leaving)
04:35:58*xenagi joined #nimrod
05:00:54*OrionPK quit (Quit: Leaving)
05:04:29*XAMPP quit (Quit: Drink all the Booze; Hack all the Things; Kill all the Humans;)
05:23:41*xenagi quit (Quit: Leaving)
05:28:46*familiar125 quit (Read error: Connection reset by peer)
05:35:04*XAMPP joined #nimrod
06:13:58*Jackneill joined #nimrod
07:19:05*shodan45 quit (Quit: Konversation terminated!)
07:34:05*silven quit (Read error: Operation timed out)
07:52:34*silven joined #nimrod
07:57:46*silven quit (Ping timeout: 246 seconds)
08:00:42*silven joined #nimrod
08:18:51*anton2 joined #nimrod
08:43:33*anton2 quit (Quit: anton2)
09:22:02C0C0Varriount: as in "to use/include"
09:22:42C0C0just wrote it for myself, and read something bout missing rngs some time ago
09:35:27*CarpNet joined #nimrod
09:37:34*silven quit (Ping timeout: 272 seconds)
09:41:01*zahary_ joined #nimrod
10:44:29AraqVarriount: no
10:51:02zahary_Araq, it's embarrassing to admit, but today I read the first-class iterator docs for the first time and the design seems wrong to me
10:52:36zahary_I think we've discussed this before, but there are really two "types of iterators" - the first one is an iterator function that can have arbitrary parameters and it will produce "an iteration / coroutine".
10:52:57Araqwe talked a lot about this design
10:53:05zahary_i.e. this is the current type iterator (x: foo, y: bar): baz
10:53:34zahary_the second type is the "iteration" itself - this is the thing that has finished(); resume(), etc procs
10:54:33zahary_in the simple case it have a type like Coroutine[T] (Iterator[T]); (you just call it without argument to get the next value)
10:54:37Araqto produce an iterator you simply close over the variables you want to iterate over and let the closure escape
10:55:08AraqI still think my design is very natural and consistent with other first class functions
10:55:14Araqbut bbl
10:55:21zahary_in some languages like lua, it can accept values at each step; then it's something like Coroutine[X, Y, Ret]
10:55:46zahary_well, I'm pretty sure we've discussed this indeed and I think I must have made the same points then
10:59:32zahary_can you clarify the runTasks example in the manual; why do I pass the ticker argument on each step? and what actually results from this? the captured value in the iterator closure is changed that way?
10:59:51zahary_http://build.nimrod-code.org/docs/manual.html#first-class-iterators
11:24:06Araqno the "ticker" is just a dummy argument in that example :-)
11:25:26zahary_but it must be supplied I guess (that's what the closure expect)?
11:25:47Araqno, iterator a1(): void would be perfectly fine
11:26:02Araqbut then TTask must be iterator() of course
11:26:18Araqthe real problem with my design is the "finished" built-in. It's very hard to make that perform like people expect.
11:26:43Araqoften it only returns true the 2nd time it's finished
11:26:54Araqthe following illustrates the problem:
11:26:59Araqiterator (): int =
11:27:03Araq yield 1
11:27:08Araq discard
11:27:27Araqit yields 1 but then it's not finished
11:27:34Araqbecause it has yet to run the 'discard'
11:29:00zahary_the problem is that a real similar task system will have functions with different parameters producing tasks, but once the task is produced, it can be handled with the same interface no matter the factory/producing function
11:29:24Araqbut that's not a problem because you can do:
11:29:46Araqproc produce(): iterator (): int = captureThings() ...
11:29:54Araqproc produce2(): iterator (): int = captureDifferentThings() ...
11:32:30zahary_well, then the current iterators are equivalent to the Iterator[T]/Couroutine[T] that I described, bust I think most people confuse them with the "factory" type
11:33:23zahary_I guess the full code is like this
11:33:23zahary_proc foo: iterator(): int =
11:33:23zahary_ iterator x: int {.closure.} =
11:33:23zahary_ capture stuff
11:33:23zahary_ return x
11:34:01Araqyes
11:34:31Araqand yeah it means people will expect anonymous iterators to work ...
11:35:11zahary_I guess this confusion comes form the fact that the non-closure iterators behave like the "factory" type
11:35:49AraqI don't think they do.
11:36:00Araqin fact now I need to think why you think they do
11:36:02zahary_because, there you can have the arbitrary input parameters and the body will return the equivalent of iterator(): X (for the purposes of the loop)
11:36:03Araq;-)
11:36:26zahary_it erases the input parameters so to speak
11:38:24Araqfor i in iter(a, b) # input arguments are passed every time to 'iter'
11:38:38*BitPuffin joined #nimrod
11:39:05Araqor perhaps: let x = a; for i in iter(x) but still they are not erased
11:39:48zahary_they shouldn't be; if you ask me what is the abstract type of iterating over a collection (doesn't matter if this is array, list, etc); the answer is iterator(): ElementType
11:39:56BitPuffingood * guys!
11:40:23zahary_I can have many factory functions such as items(array), items(seq), every_odd_element(list)
11:40:52Araqso for you iterator(): ElementType is IEnumerable<ElemenType> ?
11:40:53zahary_the all produce itearator(): ElementType
11:41:01zahary_yes
11:41:04Araqaha
11:41:55*BitPuffi1 joined #nimrod
11:42:13zahary_now you should see why this is what the for loop consumes (sans the inlining)
11:42:24*BitPuffin quit (Read error: Connection reset by peer)
11:42:40zahary_and how nonclosure iterators act as a factory for such Enumerable objects
11:42:43*BitPuffi1 is now known as BitPuffin
11:42:45Araqindeed this is where Nimrod and C# differ: C# has a special "lazy return type" (IEnumerable) whereas Nimrod conflates the laziness with the function kind
11:43:20zahary_but nimrod has it too in the form of closure iterators
11:46:13Araqfor me iterator (): T {.closure.} is quite different from IEnumerable<T> conceptually. But I can see your point. They are the same for you.
11:47:15zahary_and my point is that nonclosure iterators are different than closure iterators in the way they encode the "creation of the iteration"
11:47:35zahary_if I wish to refactor a non-closure iterator into a closure one, I have to wrap it up in a proc
11:48:02Araqdepends on your exact refactoring. otherwise you simply have to add {.closure.}
11:48:38zahary_I challenge you to give me example where this would work
11:49:02Araqiterator split ... {.inline.} = ...
11:49:13zahary_so this produces words
11:49:24Araqproc takeIt(it: iterator (): string)
11:49:27zahary_the correct signature is itearator(): string
11:49:30AraqtakeIt(split) # gah
11:49:43Araq--> make split a .closure and it compiles
11:49:48zahary_but the split iterator was defined iterator(x: string): string
11:50:04Araqgood point
11:50:20Araqproc takeIt(it: iterator (input: string): string) is unnatural I guess
11:50:26zahary_it will be like this in every example
11:51:53zahary_I'm ok with the current design, but I guess it's not explained very well
11:52:08Araqok but if iterator (): T is IEnumerable<T> what is iterator (a: S): T?
11:52:23Araq(both iterator headers are .closure here)
11:52:31zahary_this is the coroutine that takes arguments on every step
11:52:57Araqyeah but now you see why it's different
11:52:58zahary_imagine a mud game; the iterator walks though rooms and ask you for a next step
11:53:35AraqFunc<Input, IEnumerable<Output>> is iterator (Input): Output. perhaps.
11:53:53zahary_nope, the factories can have arbitrary arguments
11:54:27zahary_that's why you should not try to consider them in the "type of the iteration"
11:54:47Araqwell it's your turn then. What is iterator (x: Input): Output {.closure.} in C#?
11:55:14zahary_C# doesn't have these I guess (co-routines?)
11:55:22zahary_I mentioned lua as an example for this
11:55:44zahary_http://www.lua.org/pil/9.1.html
11:55:53zahary_notice how the resume function can have arguments
11:56:01zahary_then, within the iterator the syntax is like this
11:56:08zahary_var next_step = yield(room)
11:56:37zahary_you have two-way communication - the iterator yields rooms, the user supplies the next step
11:59:26Araqok well more interesting for me is this:
11:59:29Araq coroutine.resume(co) --> co 10
11:59:31Araq coroutine.resume(co) -- prints nothing
11:59:32AraqDuring the last call to resume, the coroutine body finished the loop and then returned, so the coroutine is dead now.
12:00:04Araqso it's dead AFTER an additional "print nothing"
12:00:39Araqso it has the same issue as my system.finished
12:00:55zahary_so you wander how the last value is consumed/signaled?
12:01:34Araqno I wonder whether somebody came up with a better solution or if it's inherent
12:03:08zahary_well, I remember we discussed this as well
12:03:35Araqand you're right Func<Input, IEnumerable<Output>> is different from the iterator
12:04:11zahary_what was going to happen when I try to call the iterator after it has produced the last value (it still runs its epilogue code, then what?)
12:04:34Araqit produces default(T) aka binary zero
12:04:46Araqiirc
12:05:11Araqin fact, I let the implementation decide
12:05:36zahary_there is some magic that let you set the default value?
12:06:02Araqyou can invoke iter() as often as you like even when finished() returns true
12:06:43zahary_yeah, but how the user know that this last zero it got is not an actual value
12:10:22Araqwell finished returns true after the last value has been read
12:11:32Araqwell let me fix some iterator related bugs and I can give you better answers
12:12:10zahary_so you know to ignore the last value you got just before finished? having a magic to set the "EOF value" could be useful - it will allow loops without `finished` in them
12:12:33Araqfinished is very cheap though
12:12:47Araqno indirect function call and it only reads the internal 'state' field
12:12:57Araqwhich is always at offset 0
12:13:07zahary_sure, but it more cumbersome to write my code
12:13:12Araqah ok
12:13:18Araqthat's a different issue then
12:13:56zahary_I'm splitting words and putting each word in a seq; I hit finished and now I must know to remove the last word (that was empty or something)
12:14:22Araqno you don't
12:14:37Araqwhile not finished(it): echo it()
12:14:48Araqis the 'for' loop replacement iirc
12:15:18zahary_but the last call ot it() will return the default zero value
12:15:25Araqfor i in it(): echo i # translates into the above 'while'
12:15:53Araqwell ... I don't remember
12:15:58Araqlet me look at the implementation again
12:16:01zahary_we are talking about closure operators here (splitting words is not a good example)
12:16:05zahary_it's easier to have while (word = next(); word.not_empty): words.add(word)
12:16:49zahary_otherwise, I should have while not finished(it): words.add(it()); now after the loop; words.erase_last()
12:17:45Araqah well apparently it's:
12:17:50Araqwhile true:
12:17:55Araq let x = it()
12:18:01Araq if finished(it): break
12:18:14Araqso you're right but the loop is still simple *cough*
12:18:38Araqin a way you get (next, finished) = it()
12:18:49zahary_but it's not finished if it still needs to do something in the iterator
12:18:52Araqand should not look at 'next' if finished == true
12:19:29zahary_iterator foo =
12:19:29zahary_ yield 1
12:19:29zahary_ yield 2
12:19:29zahary_ print "exiting"
12:19:29zahary_ doSomethingImportant()
12:21:17Araqactually the major gripe I have with my design is that the state machine algorithm is too useful to attach it to heap allocated closures only. And even escape analysis doesn't help. When you don't have closures but explicit memory management you can easily put them into arrays etc. All these things are lost with closures.
12:22:06Araqalso serialization of a closure requires some magic
12:23:03Araqyour iterator foo is arguably bad style. it's easy enough to "yield -1" at the end and tell people it's another way to determine if it finished
12:23:19zahary_hmm
12:23:36Araqthe sentinel version is easy enough to provide if you want to and have a value that can act as such
12:23:45*BitPuffin quit (Ping timeout: 272 seconds)
12:23:47zahary_maybe you have a point, since I'm suggesting a magic that will require a similar line
12:24:54zahary_but is the compiler otherwise smart enough to notice that yield is the last statement and to populate finished for me properly?
12:25:28zahary_that's quite nice if it's true
12:26:21zahary_e.g. the last yield automatically sets "finished" as well if the compiler sees that nothing further interesting is going to happen
12:27:19Araqthat's what I planned to implement, in fact
12:27:28Araqbut it changes semantics subtly
12:27:42Araqarguably it changes it for the better though
12:28:02zahary_it seems hard to do considering that the exit is usually going to happen due to some loop exit branch
12:28:35Araqyeah it's only easy to come up with heuristics
12:29:26AraqI need to go, see you later
12:29:31zahary_bye
12:42:20*BitPuffin joined #nimrod
12:47:59*zahary_ left #nimrod (#nimrod)
13:12:25*BitPuffin quit (Read error: Operation timed out)
13:12:28*BitPuffi1 joined #nimrod
13:16:41BitPuffi1Araq: me and my friend might be doing this 64k thing, is there a way to get the space usage down to as low as C? :P
13:16:49BitPuffi1otherwise we're gonna have to use C :P
13:19:19*zahary_ joined #nimrod
13:28:22*EXetoC joined #nimrod
14:07:33*BitPuffi1 is now known as BitPuffin
14:21:37VarriountHm. Anyone know how to reset your forum account's password?
14:22:32VarriountBitPuffin, -> http://forum.nimrod-code.org/t/301
14:26:09BitPuffinVarriount: hmm?
14:29:40BitPuffinVarriount: I am not sure if I like the blending of parameters and parameter types
14:32:29VarriountBitPuffin, parameters and parameter types can already be blended. :/
14:32:30*OrionPK joined #nimrod
14:34:02BitPuffinsay you'd want something like this: proc foo[T, S, P](a: T[S], b: T[P]), that'd become proc foo(T: typedesc, S: typedesc, P: typedesc, a: T[S], b: T[P])
14:34:03VarriountBitPuffin, "proc foo(T: typedesc, obj:T): T" is a perfectly valid function.
14:34:14BitPuffinVarriount: oh
14:34:18BitPuffinwell that's a shame xD
14:34:22BitPuffinbut yeah
14:34:25BitPuffinI missed his point
14:34:31BitPuffinhe wants partial function application
14:34:32VarriountBitPuffin, I'm not suggesting that generic *declaration* syntax change
14:34:38VarriountAlso, that user is me.
14:34:48VarriountI forgot my forum password.
14:35:03BitPuffinah
14:35:05BitPuffinhaha
14:35:07BitPuffin :P
14:35:29BitPuffinI'm not sure the genericProc[int, 20] syntax makes much sense
14:35:50BitPuffinthat bleeds together the parameters and generic parameters
14:35:50VarriountThat's merely an example case
14:35:53BitPuffinyeah
14:36:27OrionPKwhat kind of db does the forum use?
14:37:18BitPuffinOrionPK: sqlite
14:37:27BitPuffinthe sauce is on github
14:37:37OrionPKyeah I know
14:37:42OrionPKjust curious if anyone knew off hand
14:37:58BitPuffinVarriount: you forgot to elaborate on type parameters
14:38:03BitPuffin"while procedures with type parameters (which is why iterators with typedesc parameters hardly work, if at all)."
14:38:17BitPuffinwhile procedures with type parameters what :P
14:38:28VarriountAh, sorry
14:38:32BitPuffinOrionPK: alright :)
14:38:41BitPuffinOrionPK: why are you wondering? :P
14:38:42VarriountI wrote all this on my phone at 12:00 pm
14:38:55BitPuffinIt's cool, just thought it'd be helpful to point it out
14:38:58OrionPKbitpuffin curiosity :P
14:39:24BitPuffinOrionPK: something that is urgent imo to fix about nimforum is the pw hashing
14:39:42OrionPKwhats wrong w/ it?
14:39:47BitPuffinOrionPK: it uses md5
14:39:58OrionPKyou would have to reset everyone's password to fix that
14:40:04BitPuffinnot really
14:40:07BitPuffinjust rehash the hash
14:40:24OrionPKi guess that would work heh
14:40:40BitPuffinif they have stored the information lke you should where you prefix with what algo it is it's fine
14:40:46OrionPKsha1 isnt really that secure either though
14:41:01BitPuffinif not well then they should first update the db to have that info
14:41:10BitPuffinOrionPK: hell no I'm not suggesting sha1
14:41:16OrionPKokay lol :p
14:41:24BitPuffinOrionPK: https://bitbucket.org/BitPuffin/scrypt.nim
14:41:28BitPuffinalthough that's not done yet
14:42:48BitPuffinit doesn't know how to check yet
14:42:53BitPuffinbut damn it I think I implemented that
14:42:56BitPuffinjust that I lost the data xD
14:42:59BitPuffinbecause i didn't push
14:44:14*comex joined #nimrod
14:50:04BitPuffinOrionPK: I'm actually debating whether sha1 is secure enough for h-macs even
14:50:21BitPuffinmaybe I should scrypt that too
14:50:28BitPuffinjust that verifying cookies happen a lot
14:51:23EXetoCnewException(EIo, "oh no") I think it's pretty clear. it's more limited though, but it's concise
14:52:22BitPuffinEXetoC: lol wut
14:52:49EXetoCtypedesc
14:53:25BitPuffinEXetoC: ah
14:53:34BitPuffinsure it is clear
14:53:42BitPuffinBut I dunno
14:53:53BitPuffinnewException[EIo]("oh no") is even more clear
14:53:55BitPuffin:P
14:54:11BitPuffinbecause let's not forget that we also parameterize types with []
14:54:31BitPuffinso we become familiar with the fact that generic params are within []
14:57:38*Kristina_ joined #nimrod
14:57:50*Kristina_ is now known as Kristina
15:02:24EXetoCI'm used to both
15:04:23BitPuffinEXetoC: sure but consistency has value
15:04:47BitPuffinWhich is why I try to follow nimrod naming conventions
15:04:51BitPuffinnot because I agree with it
15:05:01BitPuffinand not only because Araq will send an assassin otherwise
15:05:08BitPuffinbut just because it benefits everyone :P
15:12:04*olahol quit (Quit: Lost terminal)
15:14:49EXetoCI guess
15:20:21*q66 quit (Ping timeout: 246 seconds)
15:22:37*q66 joined #nimrod
15:23:32EXetoCAraq: will users always be required to handle input contracts manually? because it might be a good idea to implicitly raise EAssertionFailed by default
15:26:20EXetoCbut it might not be so bad to just do it manually by wrapping said function
15:27:50BitPuffincan't you make a proc raise an exception by default?
15:28:21BitPuffinyeah
15:28:25BitPuffinyou should be able to
15:28:32BitPuffinso pull request EXetoC
15:28:34BitPuffin:P
15:29:48*DAddYE quit (Remote host closed the connection)
15:29:54EXetoCsuch contracts haven't even been implemented yet
15:30:16*DAddYE joined #nimrod
15:30:19EXetoCif ever, but it seems useful
15:31:25EXetoCproc f(x: int) {.in: x < 10.} something like this
15:32:39EXetoCwhere the contract is supposed to be validated at compile-time according to Araq (with conditional statements), in case you missed that discussion
15:35:02*DAddYE quit (Ping timeout: 272 seconds)
15:38:10EXetoCprocs cannot actually be members of a type, so I wonder if it'll be feasible to have type-wide contracts
15:39:02BitPuffinEXetoC: gotcha
15:39:11BitPuffinit would be useful both at compile time and runtime
15:39:12EXetoCor maybe explicit is better than implicit in this case: proc f(x: TFoo) {.in: fooInvariant(x).}
15:39:43BitPuffinEXetoC: it doesn't even seem hard to do
15:39:47BitPuffinEXetoC: just write a module
15:39:49BitPuffincall it contracts
15:39:57BitPuffinmake macro that does the checking
15:40:02BitPuffinand then use the macro as a pragma
15:40:04BitPuffin???
15:40:06BitPuffinprofit
15:40:07EXetoCthat's what I planned to do IIRC
15:40:21EXetoCbut then it can't be enforced at compile time
15:40:26BitPuffinEXetoC: it can
15:40:29EXetoCnot the way Araq intended anyway
15:40:31EXetoChow?
15:40:51BitPuffinEXetoC: overloading, for literals etc have one that uses when
15:40:56BitPuffinEXetoC: for values use if
15:41:00BitPuffinumm
15:41:02BitPuffinruntime values
15:41:39BitPuffinthat should work no?
15:41:45EXetoCproc f(x: int) {.in: bla.} ... if (bla): f(42) # Check enforced by compiler
15:42:39BitPuffinhuh?
15:43:11EXetoCoops missed a couple of things
15:44:01EXetoClet x = 42; if bla(x): f(x)
15:45:39BitPuffinwhat do you mean if bla?
15:45:47BitPuffinis that what it's transformed to
15:48:23EXetoCno, user code would be required to perform that check prior to calling the function
15:49:27EXetoCand I suggested that maybe EAssertionFailed should be raised implicitly if the user doesn't check the pre-condition and it then happens to fail
15:50:14BitPuffindoesn't the user check eliminate the convenience of a contract?
15:53:24EXetoCI suppose, but sometimes you want to perform different actions depending on whether not the pre-condition
15:53:25BitPuffinmaybe I'm confused with what it's supposed to do because I'm tired
15:53:29EXetoCand only abort in some cases
15:54:12EXetoCI might gist an example later
15:54:58BitPuffinsure
15:57:49*Varriount wonders when Araq will be up.
16:03:21EXetoCif x >= 0: let y = sqrt(x) # Allowed by the compiler .......... let y = sqrt(x) # Should the compilation abort here or should EAssertionFailed be raised implicitly if the pre-condition fails?
16:03:35EXetoCBitPuffin: is that clear?
16:04:22EXetoCproc sqrt(x: T) {.in: x >= 0.}...
16:06:57BitPuffinsec
16:09:14VarriountBitPuffin, I've updated the post to better elaborate.
16:09:41BitPuffinVarriount: cool!
16:12:10BitPuffinEXetoC: abort if value is known at compile time, exception if not
16:12:22*OrionPK quit (Quit: Page closed)
16:12:54*familiar125 joined #nimrod
16:18:11*BitPuffin quit (Ping timeout: 272 seconds)
16:33:01familiar125is there a pragma to arbitrarily run cmds at compile time?
16:37:10dom96Why a pragma?
16:37:12dom96There is staticExec
16:37:22dom96also hi
16:40:07familiar125hi dom96
16:40:34familiar125staticExec, thanks
16:51:53*familiar125 quit (Read error: Connection reset by peer)
17:20:53*MFlamer joined #nimrod
17:53:30Varriountdom96, if you need a documentation builder, I don't mind hosting another build-bot
17:55:57*familiar125 joined #nimrod
17:58:25dom96Varriount: Thanks but currently there is no code for the upload of the docs so the builder which builds the docs must be local.
18:04:54*brson joined #nimrod
18:05:46*DAddYE joined #nimrod
18:05:50*DAddYE quit (Remote host closed the connection)
18:06:02*DAddYE joined #nimrod
18:08:40*silven joined #nimrod
18:21:44*CarpNet quit (Quit: Leaving)
18:22:05*familiar125 quit (Read error: Connection reset by peer)
18:24:56*shodan45 joined #nimrod
18:35:32*familiar125 joined #nimrod
18:44:47*Mat2 joined #nimrod
18:44:50Mat2hi all
18:47:28AraqEXetoC: compile time evaluation is the whole point, otherwise 'in' can already implemented with a macro that transforms the proc body and inserts an 'assert'
18:47:57Araq"emit assert if you can't prove it" is a misfeature
18:48:56VarriountGood evening Araq.
18:50:48*filwit joined #nimrod
18:51:07filwit51 users?
18:51:18filwitthat a new record, or where we going for 60?
18:51:22filwitdom96 ^
18:51:38dom9660 is the current record
18:51:42Varriountfilwit, it fluctuates.
18:51:52filwitdom96: when did that happen?
18:52:08dom96sometime after my article went live
18:52:13filwitnice
18:52:27Varriount~45 - ~60
18:52:52filwitVarriount: yes, i just meant "most people every here at once"
18:53:08filwitdom96: well, 70's the new 40!
18:53:40filwitdom96: sounds like articles do a lot for Nimrod's publicity
18:53:54Mat2you can bet on it
18:54:43VarriountAraq, have you read this proposed idea/concept on the forum? -> http://forum.nimrod-code.org/t/301
18:56:47filwiti really don't understand that guys proposal. I'm probably missing some key part of the syntax, but how can (T:typedesc, obj:T) translate into (a, b:T)?
18:57:10filwitwhere did 'aobj' come from in his example?
18:57:20filwitobjA**
18:57:47filwitalso, his syntax suggestion for auto-templates would probably only make the code harder to read
18:57:55filwitbut those are just my thoughts
19:01:39*Mat2 I'm not sure if need of the these features are not really fixes for bad code design
19:02:30*brson quit (Ping timeout: 272 seconds)
19:03:41*brson joined #nimrod
19:03:57Varriountfilwit, "that guy" is me. Also, I wrote that on my phone, at 12 pm
19:04:00Varriountam
19:04:03Varriount*am
19:05:15Varriountfilwit, ok, I fixed that mistake, any others?
19:06:15MFlamerI'm confused by the [T] vs. (T: typedesc) in general now. I know zahary was mentioning that [T] is limited in power now and that the other syntax is prefered now?
19:06:51EXetoCAraq: right, but I was just thinking of an optional way to have it assert instead, but without having to create an if/else pair every time
19:07:03VarriountMFlamer, A generic procedure that uses the [] syntax instead of a typedesc parameter cannot be partially instanciated with just the types.
19:07:17Varriount*can be partially instanciated.
19:08:01MFlamerahh, ok
19:08:25Araqhuh? it can't be partially instantiated either way
19:08:38EXetoCAraq: I realize that I'm a little pedantic once again, but perhaps it's doable
19:08:45AraqVarriount: I read it but my head is already hurting
19:08:46EXetoCwe'd need more reflection capabilities though
19:08:52*brson quit (Ping timeout: 264 seconds)
19:09:09Varriount^ What I get when writing at midnight on a phone
19:09:16AraqEXetoC: it's not about whether it's doable, it's about whether it's a good idea
19:09:22Araqif you have:
19:09:36Mat2Araq: It's not (my opinion)
19:10:03Araqproc foo(x: int) {.in: x < 0.} with my proposal guarantees x < 0
19:10:10Araqat compile time
19:10:27Araqwhereas with your way we're back to 'in' being sugar for 'assert'
19:10:28*brson joined #nimrod
19:11:01Araqand I can't easily see whether the 'in' is proven or not with your proposal
19:15:37zahary1well, the hard part is to prove such things, not to choose syntax for the feature
19:16:33zahary1Varriount: can you illustrate the problems you are having with typedesc params and iterators with an example?
19:16:50zahary1I suspect you're doing something wrong
19:19:44bastian_really happy with nimrod so far, great productivity and the generated code looks also great
19:20:24EXetoCAraq: no, It'd just be a simple way of saying "just raise EAssertionFailed if the contract fails", and it'd still be self-documenting, though maybe not self-documenting enough according to you
19:20:31bastian_Araq: good job!
19:20:54AraqEXetoC: well what syntax exactly do you propose?
19:21:00Araqbastian_: thank you. :-)
19:22:05bastian_any reason why 'var x : seq[uint8] = @[0, 0, 0, ...' won't work, but using '@[0'u8, 0, 0, ...' does?
19:22:13zahary1there is little point in putting invariants on procs as these can be replaced with simple assert statements; what's useful is to put invariants on types, then the compiler can insert them automatically on each proc modifying an object of the given type
19:23:01bastian_also, found compiler/bitsets.nim
19:23:22Araqbastian_: there is a reason. ;-)
19:23:51Araqit's not a bug, but perhaps a questionable design
19:24:26bastian_not a problem, just thought type inference would pick it up
19:24:45Araqthat would be non-local type inference
19:24:51EXetoCAraq: something like "assert_contract sqrt(x)" maybe, which is a little more compact
19:25:33*brson quit (Ping timeout: 272 seconds)
19:25:42Varriountzahary1, https://gist.github.com/Varriount/7587953
19:26:13Araqzahary1: yeah well but the docgen should look into the proc body and extract the assertions
19:26:20EXetoCAraq: but what's wrong with having it raise EAssertionFailed by default? I'm guessing that the whole point of this is to be explicit. can't think of anything else really
19:26:35Araqno the whole point is to *prove* things
19:26:48AraqEAssertionFailed doesn't prove anything since it's all at runtime
19:27:52*brson joined #nimrod
19:27:59Varriountzahary1, also, having to either give iterators the same arguments each time they are iterated on is annoying.
19:28:07zahary1well, Varriount, did you catch my discussion with Araq earlier today?
19:28:23VarriountNo...?
19:29:10Araqzahary1: I think I already told you, but proving array bounds is within reach with the inference engine
19:29:41zahary1http://build.nimrod-code.org/irclogs/21-11-2013.html
19:29:41zahary1your iterators are perfect example of the confusion users have regarding the closure iterators
19:30:52*brson quit (Client Quit)
19:31:01Araqwell I'm more concerned about their bugs for now
19:31:07*brson joined #nimrod
19:31:38AraqI'm not sure they are more confusing than any other design I can come up with ...
19:32:42Varriountzahary1, which is?
19:33:57VarriountBesides, I still can't use iterators with typedesc parameters, nor can I have iterators that just have to accepts arguments once
19:34:30zahary1I left you a comment in the gist
19:34:30zahary1https://gist.github.com/Varriount/7587953
19:35:07zahary1to understand why this is necessary, you'll have to read through the logs starting from 10:51 today
19:36:13zahary1Araq, the design is fine with me - the explanation in the manual is currently lacking
19:38:28VarriountZahary, your example gives me a codegen error.
19:39:37Araqzahary1: also the problem we talked about can easily be solved with a builtin setFinished()
19:39:43AraqsetFinished()
19:39:47Araqyield 1
19:39:57fowli dont understand why each time you call the instantiated closure iterator with arguments each time
19:40:04Araq# --> no need for generating a sentinel value
19:40:04zahary1well, that would be bug, please file it, but still that's the correct way to write the code
19:40:40VarriountAlso, the example does nothing to bridge the gap between typedesc parameters and generic parameters.
19:41:31zahary1well, what is the problem with typedesc parameters? that you cannot "instantiate" the iterator?
19:41:46VarriountMy main complaint is about the subtle differences between generic parameters (those within []) and typedesc parameters (those within ()).
19:41:48zahary1the enclosing proc will have the typedesc parameters and you'll just call it
19:42:21VarriountAs well as the different situations in which you can/should use them
19:44:21zahary1the simple guideline that we should adopt is this: explicitly supplied generic parameters should be used only for types. procs should have inferable generic parameters and explicitly provided typedesc parameters
19:44:51zahary1the partial application that you propose in the forum is called "currying"
19:44:52zahary1http://en.wikipedia.org/wiki/Currying
19:45:11EXetoCAraq: yes, but then the 'if' block isn't entered, but rather the 'else' block which raises EAssertionFailed
19:45:29EXetoCso the only difference is that the proof would be hidden behind some generic construct
19:45:35zahary1it works the same way for both regular values such as ints and strings and with compile-time values such as types, expressions, etc
19:45:42EXetoCsimilar to just creating wrapper functions, except it would be less tedious
19:46:06Varriountzahary1, yes, it is, and I don't see why it's worse than the current generic/typedesc concept.
19:47:16VarriountIt's an extension of your typedesc idea, allowing such procedures to be partially generated/instantiated.
19:47:49EXetoCwhile still making the intent clear: macro assertContract(x: lazy_call, msg: string) = if magicWayToAccessContract: x() else: assert false, msg
19:48:00EXetoC(tons of magic omitted)
19:48:22Araqah alright I see
19:48:43Araqwell I consider this bad style :P
19:48:56Varriountzahary1, and besides, your anonymous iterator idea still requires boilerplate wrapper code.
19:50:11bastian_is newSeq zero-initializing the seq?
19:50:20Araqbastian_: yes
19:50:24EXetoCAraq: yes the point is that it must be proven, but aren't you implying that you think it should be explicit? which seems like a reasonable requirement
19:50:28Mat2ciao
19:50:32*Mat2 quit (Quit: Verlassend)
19:50:52zahary1that's not my idea, but our current design - if you read the logs I mentioned you'll see that I was initially complaining about how confusing it is
19:51:14Araqyeah yeah, blame it all on me, I can handle it ;-)
19:51:34bastian_Araq: it looked like it, but the docs say " will be filled with uninitialized entries"
19:51:42Araqwhat?
19:51:49Araqlet me check
19:52:13bastian_http://nimrod-code.org/system.html#206
19:52:22Araqyeah it's a documentation bug
19:52:46Araqwhat gradha here means it's initialized with 'nil' for strings
19:53:12zahary1I like aspects of the design as well - indeed, the symmetry with regular closures is quite nice
19:53:15bastian_ah I see, just wasn't sure
19:53:31EXetoCbut I don't know... in some cases a function might be littered with fairly similar if/else pairs
19:53:46bastian_pretty nice it's doing the 'right' thing by default, reduces bugs
19:53:59bastian_thanks
19:54:34EXetoCso that's roughly 3-4 additional lines for each contract assertion, depending on whether or not a value is returned
19:57:33AraqEXetoC: perhaps but come on. that's nothing to worry about *now*
19:57:42EXetoCsure
19:57:44Varriountzahary1, is 'auto' actually documented anywhere? And by documented, I mean has it's usage explained.
19:59:14zahary1auto is a type class matching any type - its usage in this context is explained in the section of the manual called return type inference
20:00:47Araqbtw zahary1 my final solution is to make 'len' and 'add' check for 'nil' and leave strings and seqs as they are with 'nil' being distinct from "" and @[]. Seems to be the best solution given that "" and @[] allocate which can be costly. Any better ideas?
20:01:27fowlAraq, fye on that
20:01:35fowlor fie, im not sure which
20:02:01fowlthe last thing we need is more checks, you already get a backtrace on SEGFAULT, anything more is superfluous
20:04:00Varriountzahary1, and what if I wanted to get just the type of a procedure with typedesc params, given concrete type arguments? Is there some equivalent to "var x: genericProc[int, string]"?
20:04:04EXetoCAraq: actually, improved statements-as-expressions semantics would improve the situation a little (allowing the ability to throw in some branches while evaluating a value in others).
20:04:23zahary1in C++ libraries, I've used a clever trick for empty containers such as seq[T] and string;
20:04:23zahary1each string or sequence is just a pointer to a heap allocated buffer of variable length;
20:04:23zahary1to represent the empty default value, you prepare a single empty buffer that will be used by all default constructed strings
20:04:23zahary1that way, most of the operations won't have any code dealing with the empty case (if empty: allocate ..)
20:04:45EXetoCJust saying. I know you said it might be tricky to implement. Doesn't hurt to submit a feature request though (will do that some day)
20:06:10zahary1that's because the empty buffer has a capacity and lenght of 0
20:06:10zahary1the code for `add` for example does this:
20:06:10zahary1 newLenght = current (which is 0) + newSuffix.len
20:06:10zahary1 if newLenght > capacity (which is 0): allocate
20:06:26zahary1the same code works when the current length and capacity are not 0
20:06:55fowlmeh
20:06:59zahary1all you have to special case is the destruction in C++ (you have to be careful not to free the empty buffer)
20:07:28fowli'd rather var x: string not nil allocate an empty string and leave normal stuff as it is
20:09:17Araqzahary1: I know about this trick but it's not that simple to implement plus it doesn't allow memset()ing the memory for newSeq(s, N)
20:09:23Varriountzahary - https://github.com/Araq/Nimrod/issues/683
20:10:07zahary1well, your claim is that memsetting to 0 is faster than memsetting to some fixed value
20:10:14Araqnot quite
20:10:35Araqfor i in 0..N: s[i] = emptyValue means we incRef emptyValue N times
20:10:57Araqunless you introduce a special sticky RC value too
20:11:14zahary1ideally, the empty value won't have to be counted
20:12:09Araqbut even then memsetting to 0 should produce less code
20:12:23Araqalso tuple[x: int, s: string] get ugly
20:12:30Araqx needs to be 0, but s does not
20:13:05Araqwith 'nil' you can rely on cmov for the overhead to become unnoticable
20:13:06zahary1yes, but it's still hard to tell if these drawbacks will offset the benefits
20:13:44Araqalright then my argument about the implementation complexity remains :P
20:14:09zahary1because you lose just a little bit of the assembly efficiency of memset (although you still touch the same memory) on initialization, but you gain the streamlined code in every other operation
20:14:49Araqwell thanks to 'cmov' and modern branch prediction I predict my way would win :-)
20:15:25zahary1I've tested my way in C++
20:15:37Araqyeah but that was years ago :P
20:15:43zahary1:)
20:16:42Araqand in fact, you chose the same implementation with 'safeAdd'
20:18:02zahary1well, can't argue on the easy-to-implement-from-our-current-position factor
20:19:38Araqok so the decision has been made
20:20:08zahary1safeAdd still has one semantic difference with the other proposal tho - when you pass a nil string to a proc expecting strings (in order to print them for example), such procs have to deal with the nil case explicitly
20:20:43zahary1this is especially true for foreign C procs that are outside our control
20:21:28Araqwell as I said "" remains different from 'nil' but 'nil' won't bite nearly as often as 'len' returns 0 for it and 'add' can handle it
20:32:14VarriountAraq, ever thought of putting "effective obfuscation" as a selling point for nimrod?
20:33:12*filwit quit (Ping timeout: 246 seconds)
20:35:22AraqVarriount: are you still annoyed by 'proc foo(a, b)' or what are you referring to?
20:35:43VarriountAraq, I'm referring to the generated C code.
20:36:32Araqwell I don't read it often. I don't read the generated asm often either...
20:36:46VarriountI'm exploring how the code works, in a vain attempt to fix anonymous iterators, or at least, get a better understanding of nimrod internals.
20:37:01familiar125who are you going to be giving the C code to, varriount?
20:37:13familiar125you either give them the nim, or you give them the binary
20:37:25AraqVarriount: -d:release helps to cut it down
20:38:32*BitPuffin joined #nimrod
20:40:31C0C0how do I initialize a reference properly?
20:40:45C0C0e.G. return new(TSomeThing(x: ..., y: ...))
20:40:50familiar125new(varName)
20:40:57familiar125you need to declare it ahead of that
20:41:03AraqMFlamer: I just got "types and programming languages"
20:41:10C0C0and then I have to set the members individually?
20:41:16VarriountC0C0, yes.
20:41:21Araqnah
20:41:23fowlC0C0, if you have a PType for it you can say PType(x: 1, y: 2)
20:41:30C0C0ah
20:41:32C0C0cool
20:41:41VarriountOr create a newType function
20:41:44Araqfowl is up to date :-)
20:41:52C0C0should have tried that first^^
20:42:04VarriountWhich is standard operating procedure, at least, as far as the standard library goes.
20:42:12familiar125Araq the question is, is it PType(x=1, y=2) or (x:1, y:2) :P
20:42:17familiar125Araq god knows I'll never remember
20:42:33fowlfamiliar125, its just like tuple syntax
20:42:57familiar125fowl I know, the proc syntax is different
20:43:42AraqMFlamer: but I can't do exercise 3.2.5 because it's clearly wrong?
20:43:55AraqS1 is not a subset of S2 ...
20:53:02MFlamerlet me take a look....
20:55:22C0C0is there a way to make runtime errors a little more verbose
20:55:38C0C0currently I only get the stacktrace but not the error message itself
20:55:59fowl--verbosity
20:56:18MFlamerAraq: I read that chapter a few nights ago but havent done the exercises yet.
20:56:21fowlC0C0, error message will be above the stacktrace
20:58:37C0C0aahhh
20:58:48C0C0 --advanced gives the real --help^^
21:00:36C0C0hmm
21:00:39*Jackneill quit (Remote host closed the connection)
21:00:59C0C0nope that seems to increase the verbosity of the compiler
21:01:04C0C0but not of the program itself
21:01:50*brson quit (Quit: leaving)
21:02:06*brson joined #nimrod
21:02:33fowlC0C0, the error is above the stacktrace
21:02:42C0C0nope
21:02:43C0C0just
21:02:44fowlC0C0, that's all i can tell you without seeing the output myself
21:02:53C0C0TRaceback (most recent call last)
21:03:14C0C0and then the callstack file(line) functionname
21:07:02C0C0ah if i run it in bash it prints SIGSEGV Illegal storage access. (Attempt to read from nil?)
21:07:16C0C0seems my prompt swallowed that part (below the stacktrace)
21:07:59VarriountAraq, do you prefer that enum fields be camelCase, or PascalCase?
21:08:54VarriountC0C0, that attempt to read from nil *is* the error message
21:09:31C0C0yeah its always there with bash, but my zsh prompt somehow fucked it up
21:09:38VarriountUsually it means that the program tried accessing an object or tuple field that either didn't exist, or was set to nil
21:09:57VarriountSometimes its a variable, though not often.
21:10:12C0C0allready fixed that bug
21:10:20C0C0thx ^^
21:10:39C0C0attempt to read from nil + line is a pretty decent error message^^
21:10:54fowlbeats C
21:11:08C0C0sure enough
21:11:10fowloh you got a null pointer? better open gdb
21:11:21fowl<- no idea how to gdb
21:11:26C0C0^^
21:11:31C0C0don't use gdb
21:11:36Varriount<- theoretical idea how to gdb
21:11:39C0C0always use valgrind etc
21:14:45*familiar125 quit (Read error: Connection reset by peer)
21:15:41*OrionPK joined #nimrod
21:18:32MFlamerAraq: "{pred t1....}" implies the set terms apply to the predecessor also, if we look at 3.2.1 (2) dosent this imply the cumulativity of the sets? Also, look at the second half of the 3.2.3 definition, has the sum right there
21:22:18MFlameractually, the second half is refering to S being the sum of subsets, so, I'm wrong above
21:23:02MFlamerI was thinking it was Si
21:25:08MFlamerI agree it's not really clear why it's cumulative. The next few paragraphs are comparing the 2 methods of definition, maybe the reason is burried there
21:27:10MFlamerAraq: you still around?
21:29:40C0C0is there a nice way to echo a pointer that might be nil?
21:30:12fowlC0C0, repr()
21:30:55C0C0ah
21:30:58C0C0thx :)
21:31:29fowlC0C0, any more tips will cost $1 a piece
21:31:46C0C0payable in?
21:31:56fowlBTC is acceptable
21:32:56C0C0if I was sitting on a stash of bitcoins I wouldn't be sitting on a stash of bitcoins after they went up to 800$^^
21:33:34fowljust this week i've watched it go up and down from 500-800-500-650-500 and now its at 700 again
21:33:47fowlkicking myself for not buying them years ago for pennies
21:33:54C0C0same here
21:34:42fowlC0C0, lets start a website on tor where we offer illegal services then ignore the people who pay us
21:35:23C0C0fowl: well we should deliver for the first few weeks
21:35:24AraqMFlamer: I'm back and I now think it's correct :-) but surely subtle
21:35:49fowlC0C0, deliver them to the FBI maybe
21:36:00fowl(not the bitcoins, the patrons)
21:36:07C0C0hehe
21:36:27C0C0are you hoping the FBI is paying you with the confiscated bitcoins from silkroad
21:36:40C0C0(also: german here, FBI would be the wrong juristdiction)
21:37:36fowlwell ok then the kriminalprosekutung or whatever sie kerle have
21:37:42Araqoh btw guys, nimrod-lang.org is now available
21:37:44C0C0^^
21:38:01C0C0fowl: Bundeskriminalamt
21:38:54fowlbitcoinen
21:39:05fowlor is it bitkeunen?
21:39:13C0C0but they would probably imprisson you for possesion of "Hackerwerkzeuge"
21:41:19fowlfor using Tor?
21:41:49C0C0fowl: there is the "hackerparagraph" which makes posession of "Hackerwerkzeuge" illegal
21:41:56C0C0but its unclear what hackertools are
21:42:28C0C0recently some idiot politician came up with the idea to make Tor "meldepflichtig"
21:42:50fowli'm sure if you said you're protecting yourself from the NSA they would verstehen
21:42:53C0C0meldepflichtig = you have to tell the government you are using it and for waht
21:45:54mkbcan you say you're protecting yourself from the BND?
21:46:08C0C0mkb nope
21:46:09dom96Araq: Does nimrod-lang.org work for you on its own now?
21:46:16C0C0the BND is not even allowed to spy on germans
21:46:24C0C0thats the job of the verfassungsschutz
21:46:39mkband the NSA is not even allowed to spy on americans
21:46:39mkboh
21:47:04C0C0^^
21:47:05C0C0yeah
21:48:18mkbfrom wikipedia: main concerns of the BfV are ... scientology
21:48:24C0C0^^
21:48:24mkbthe NSA would do well to copy them
21:48:27Araqdom96: yeah
21:49:21dom96Araq: ok, in that case I will make nimrod-code.org redirect to nimrod-lang.org
21:49:59C0C0mkb and making leftwing women pregnant for additional cover^^
21:50:19Araqdom96: alright thanks
21:50:30mkbdom96, www.nimrod-lang.org redirects to your blog..
21:50:48Araqdamn mkb is right. wtf.
21:51:36dom96Araq: you set up the redirect incorrectly.
21:52:29dom96s/178.79.158.152/http://nimrod-lang.org/
22:01:51OrionPKwww isnt set up properly
22:01:57OrionPKbut nimrod-lang.org is fine
22:02:50Araqdunno what you mean. www.nimrod-lang.org is just fine :P
22:03:06OrionPKlol
22:03:13OrionPK302 = the devil
22:03:28OrionPKor 301, whichever you're using
22:04:36AraqI thought it's easier this way for google
22:04:57dom96I think it is.
22:06:16OrionPKdark theme, woo! https://dl.dropboxusercontent.com/u/417554/familiar-dark.png
22:06:58dom96OrionPK: omg open source this sexiness already
22:07:37OrionPKdom96 as soon as httpserver doesnt need my ugly hacky patch to work with asyncio :P
22:07:59fowlOrionPK, do you use the 'Rod for JS also
22:08:10OrionPKbtw, if you have a phone.. it works really well
22:08:12OrionPKno, typescript
22:08:21fowlewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
22:08:25Araqgah, use my JS backend ...
22:08:32OrionPK:P
22:08:59OrionPKfowl once I open source it, you guys will be free to submit a pull request that changes it to the nimrod js backend :P
22:09:19OrionPKIm not a believer in compile to JS though
22:09:29fowltypescript compiles to js
22:09:32OrionPKespecially since the JS code is ~15 kb before gzip right now
22:09:50OrionPKfowl only sort of
22:13:23AraqOrionPK: what? "only sort of"?
22:13:46Araqbecause IE will get a specialized VM for it and every other browser will not?
22:13:49OrionPKI mean you can plop javascript into a ts file and run it through tsc and it produces the same output
22:13:58OrionPKthats not going to happen
22:14:07OrionPKyou're thinking of dart :p
22:14:18AraqI said IE
22:14:22OrionPKI know you did
22:14:46OrionPKwhy would microsoft do that after investing so much into chakra & running JS as "native" apps for windows 8?
22:15:41Araqbecause ms is a big company and managers don't communicate
22:15:57OrionPKtypescript is much more 1:1 with javascript, the output is very similar to the input so debugging w/ f12 tools is much easier
22:16:31OrionPKAraq they're pretty heavily invested in JS, and NOT very invested in typescript
22:16:40*brson quit (Ping timeout: 245 seconds)
22:20:03MFlamerAraq: I need to generate the C source for a type. I see alot of useful procs in ccgtypes.nim but not sure if there is a main entry point for this topic, do you have any suggestions? If not, I'll figure it out
22:21:02*brson joined #nimrod
22:21:33AraqMFlamer: getTypeDesc()
22:22:40MFlamergreat, thanks.
22:23:43Araqand seriously
22:24:18AraqS1 contains (succ 0)
22:24:33AraqS2 can only contain (succ succ 0)
22:25:33Araqgah but 0 is always in Si
22:25:55Araqnever mind then
22:26:43MFlamerWhere do I get this BModule?
22:27:07MFlamerI got a BProc
22:27:20OrionPKAraq u get a chance to look at 681?
22:27:40Araqp.module
22:29:18MFlamergot it
22:30:02dom96Let me know if some of the redirects fail.
22:32:28*Associat0r joined #nimrod
22:33:31AraqOrionPK: well it's a bug
22:34:34Araqthe issue is that nimrod knows range[0..23] - 12 produces range[-12..11] and for some reason demands val12.hour falls into this range
22:34:54dom96Now keep attention to reddit because this is an excuse for someone to resubmit a link to Nimrod's homepage
22:35:22dom96Araq: Update the url on github
22:38:48Araqdone
22:39:06dom96and in the readme too :P
22:39:32Araqthat's your job
22:44:12dom96Should the nimrod-code organisation on github stay as it is?
22:44:35AraqI don't know what a name change implies
22:45:37dom96"We will create redirects for your repositories (web and git access)."
22:45:43dom96"You will need to update your local repositories to point to the new location."
22:45:49dom96Sounds like more bother than it's worth
22:45:55Araqyeah
22:46:56NimBotAraq/Nimrod master 43e2c29 Dominik Picheta [+0 ±2 -0]: Modified website links in readme.
22:54:09*OrionPK quit (Read error: Connection reset by peer)
22:59:56MFlamerError: type mismatch: got (string, PRope) for `&`
23:00:26Araqthe compiler's ropes are archaic
23:00:31MFlamerDo I have to qualify operators or something? ropes is imported
23:00:51Araqit's been translated from pascal which doesn't know about cross module overloading
23:01:09Araqso ... instead of 'add' and '&' there is 'app' and 'con'
23:01:24MFlamerok, I was using those before, no biggie
23:01:43Araqwell we should change it eventually
23:02:15Araqbut then I dislike patches affecting 4000 lines of code that do nothing
23:02:27fowlhttp://9gag.com/gag/aG9pXZG
23:03:14fowlAraq, it doesnt have to all change at once
23:03:41Araqfowl: but then new people need to look at both anyway
23:04:15Araqand need to know about the old stuff
23:04:33Araqmy time is better spent fixing bugs instead
23:06:54C0C0is `if x != nil:` or the alternativ `if not x.isNil:` considered better style?
23:07:07fowlnot x.isNil
23:07:34C0C0thx :)
23:08:17*DAddYE quit (Remote host closed the connection)
23:10:29*DAddYE joined #nimrod
23:13:07AraqVarriount: enum field should be camelCase. everything should be camelCase except types which should be PascalCase. that's what we decided iirc
23:18:09VarriountAraq, the forum post says camelCase or PascalCase
23:20:26*OrionPK joined #nimrod
23:23:24Araqwell the forum post is old
23:29:30fowlin a world, where style doesn't matter...
23:30:13MFlamersweet, as a learning exercice, I have added a pragma that allows you to specify a type for enum variants. The enum can then act as a sum ptr. https://gist.github.com/mflamer/7591727
23:33:04fowli dont get it
23:33:47AraqMFlamer: impressive
23:34:10MFlamerthanks master
23:35:18MFlamerIt allows you to use our enums like a haskell ADT. When I add field access etc. it will be much clearer.
23:37:42VarriountMFlamer, can you explain what you did exactly?
23:39:10MFlamerthe machinery was already present in the parser for an additional token representing either the ord value for the enum variant and/or the string representation
23:39:35MFlamerI extended it a little to also accept a type
23:39:51VarriountAnd do... what with the type?
23:40:39MFlamerJust keep it in the AST for type checking later or casting
23:41:56MFlamerthere is room in an enum of 4 or less variants(32bit 8 for 64bit) for a ptr
23:43:06*filwit joined #nimrod
23:43:29MFlamerso you can keep a pointer and its type in an enum which is 1 word
23:43:30VarriountMFlamer, just make sure to also produce some tests, so that I can test the machinery on Windows and it's wierd memory sizes.
23:44:09MFlamersure, for larger enums, I'm going to just use another word
23:45:06MFlamerbut I am also on windows, btw
23:45:37VarriountOh, I didn't know. Are you also using both 32 and 64 bit compilers?
23:45:40fowlMFlamer, dont forget there is also {.size.} for enums
23:46:37MFlamerfowl: I'll have to take a look, I forget what that does now
23:48:40VarriountAraq, the compiler also uses lambda lifting for actual inner functions, right? Not just ones directly attached to a variable?
23:51:23MFlamerfowl: {.size.} is a pragma?
23:51:35fowl{.size: someSizeInBytes.}
23:53:00fowllol
23:53:05fowli cant find any documentation of it
23:53:20MFlamerI see it in the compiler,
23:53:37AraqVarriount: yes
23:53:46MFlamerpragmas.nim
23:54:12VarriountAraq, does the compiler have any logic in place to lift iterators?
23:54:43MFlamerok, well if that sets the size of the enum representation, I'll have to limit that when used with my pragma
23:55:38AraqVarriount: yeah but there 2 very different implementations
23:55:45Araqone that inlines iterators
23:55:57Araqand one that produces a state machine from an iterator
23:56:00*familiar125 joined #nimrod
23:56:04Araqfor obvious reasons
23:56:29fowlMFlamer, its mainly used in c wrappers where the size of enum should be sizeof(cint)
23:57:32MFlamerok, I am actually forcing the size to a word already, so shouldnt be a problem. Thanks for the heads up
23:57:57*brson quit (Ping timeout: 248 seconds)
23:59:53*brson joined #nimrod