<< 23-12-2014 >>

00:01:36*CaptainRant joined #nim
00:08:00*brson quit (Quit: leaving)
00:11:19*boydgreenfield quit (Quit: boydgreenfield)
00:12:02*Jesin joined #nim
00:14:22*BlaXpirit quit (Quit: Quit Konversation)
00:17:46*CaptainRant quit (Ping timeout: 246 seconds)
00:20:52Mat4ciao
00:20:56*Mat4 left #nim (#nim)
00:26:40*StefanSalewski quit (Quit: Page closed)
00:30:24*z1y quit (Ping timeout: 265 seconds)
01:21:57*repax quit (Quit: repax)
01:23:25*Trustable quit (Quit: Leaving)
01:32:21*z1y joined #nim
01:41:01*z1y quit (Ping timeout: 252 seconds)
01:55:21*rpag joined #nim
01:58:31*darkf joined #nim
02:04:09*z1y joined #nim
02:18:39*willwillson quit (Ping timeout: 272 seconds)
02:18:43*BitPuffin quit (Ping timeout: 255 seconds)
02:21:01*rpag quit (Quit: Leaving)
02:29:10gmpreussneris there a way to do duck typing in nim?
02:35:38gmpreussneri guess generic procs would do the trick
02:41:25*kapil__ joined #nim
02:58:00flaviuYep, and tuples are for structural typing
03:01:41*vendethiel quit (Ping timeout: 252 seconds)
03:13:36*Jesin quit (Quit: Leaving)
03:15:40*vendethiel joined #nim
03:40:54*Jesin joined #nim
03:40:59*vendethiel quit (Ping timeout: 272 seconds)
03:44:23*Jesin quit (Max SendQ exceeded)
03:45:07*Jesin joined #nim
03:46:44*vendethiel joined #nim
03:48:58*boydgreenfield joined #nim
03:52:12*brson joined #nim
03:52:41*boydgreenfield quit (Client Quit)
04:12:49gmpreussnerflaviu, when generic parameters are of type 'range', is there a way to extract the range bounds in the type declaration?
04:13:44flaviuI'm certain it's possible with macros, but let me check the manual to see if there's another way to do it.
04:17:33gmpreussneri couldn't find anything in the docs. there are also aren't any related macros in the core libs, it seems (i looked at system.nim and a few others).
04:17:41flaviugmpreussner: If you're referring to something like `range[0..10]`, not any arrays, then min(range), max(range) should work
04:17:54gmpreussnerok, let me try that...
04:18:01flaviuhttp://nim-lang.org/manual.html#subrange-types
04:18:36gmpreussneryeah, i saw those, but i thought they only apply to instances of ranges
04:19:13flaviuWell, you could create a dummy instance.
04:19:37gmpreussnerwithin the type declaration? what would that look like?
04:19:42flaviumax, min should be calculated at compiletime and the C compiler should optimize the dummy value.
04:19:49flaviugmpreussner: I'm not sure what you mean.
04:20:13gmpreussnerlike where would the dummy be? it would be an unused member of the type, yes?
04:20:53gmpreussneri think in that case it might be better to write a macro that has a local dummy variable
04:20:58flaviuI think I understand what you mean, but can you post a short snippet of what you want the result to be?
04:21:38gmpreussnerconsider something like this: Matrix*[T; R, C] = array[R, array[C, T]] where R and C are ranges. i'd like to turn that into a 1D array using the lower and upper bounds of R and C.
04:22:27flaviuOh, you want to do calculations on ranges? Yeah, I think you need a macro for that.
04:23:06gmpreussnerok, i figured. i'll give that a shot, thanks :)
04:27:13notfowlno
04:27:20notfowlgmpreussner, i'll give you an example
04:27:25notfowl1 sec
04:28:38notfowlwait i dont understand
04:29:52notfowlwhen you say 'turn that into a 1d array' you want a function that takes Matrix[t,r,c] and returns an array[r*c, t] ?
04:34:37*brson quit (Quit: leaving)
04:42:34gmpreussnernotfowl: yes, sort of
04:42:49gmpreussnerexcept the math will be a little more complex
04:44:55gmpreussneri know i can easily do this with static[int]: Matrix[R, C: static[int], T] = array[R * C, T]
04:45:28notfowlgmpreussner, that doesnt actually right now
04:45:55notfowlgmpreussner, problems show up when you try to define two diff matrix types iirc
04:46:07gmpreussnerwell, yeah
04:46:17notfowlsee this https://gist.github.com/fowlmouth/e9e99a427e56b427b34e
04:46:28notfowlyou can use 'auto' return type to do what you want i think
04:46:53gmpreussnerit would be more like Matrix[R, C: static[int], T] = object, and then an array[R * C, T] field. that compiled for me.
04:47:18notfowlgmpreussner, yes but matrix[2,3] and matrix[3,2] become the same type
04:47:20gmpreussnerthe problem doesn't go away though, because eventually you still have to resolve R and C when accessing elements
04:47:40gmpreussneroh i see
04:47:51notfowlwell
04:47:58notfowlwrapping it in an object may work
04:48:30gmpreussnermy unit tests sure went through, but maybe it was a lie :)
04:49:17gmpreussneri'm exploring various options right now. i know several others have tried as well. spent the past two days learning about all the limitations
04:49:47gmpreussneri like the idea of R and C being ranges, because it allows users to control the indexing, i.e. 0- or 1-based
04:50:15notfowli cant test anything because im on windows atm but see if the expression "Matrix[1,2,int] is Matrix[2,1,int]" is true or false
04:50:59gmpreussnerok
04:53:17gmpreussnernotfowl: you are right, it comes out as the same type. that's bad :)
04:54:19gmpreussnerwell, that's not the end of the world as i kind of favor ranges anyway
04:54:36notfowlyou know its likely that the c compiler turns 2d arrays into 1d arrays anyways
04:56:49gmpreussnerim actually not concerned about the storage, but the nested for-loops needed to iterate the elements
04:57:21gmpreussnermatrices are a rather simple case. what i'm really interested in is tensors.
04:57:32gmpreussnermatrices being a special case of tensors
04:58:17gmpreussnerim investigating the possibility of having something like Tensor[3, 4, 5, 6, float] to create a tensor of rank 4 with dimensions 3, 4, 5 and 6
04:58:46notfowlyou could implement items() for your matrix type
04:58:50flaviu.eval type Matrix[R, C: static[int], T] = object; f: array[R * C, T];echo(Matrix[1,2,int] == Matrix[2,1,int])
04:58:51Mimbusflaviu: eval.nim(3, 21) Error: type mismatch: got (typedesc[Matrix[static[int literal(1)](1), static[int literal(2)](2), int]], typedesc[Matrix[static[int literal(2)](2), static[int literal(1)](1), int]])
04:59:21gmpreussnerflaviu: oh, that's cool. didn't know we had that :)
04:59:59flaviugmpreussner: Officially, we don't. It's dts|pokeball's, but I'm temporary running it while he figures out sandboxing.
05:00:23*jefus__ joined #nim
05:00:27notfowl.eval type Matrix[R, C: static[int], T] = object; f: array[R * C, T];echo(Matrix[1,2,int] is Matrix[2,1,int])
05:00:29Mimbusnotfowl: true
05:01:17flaviuI had no idea that it's possible to perform operations on static[T] in types.
05:01:46flaviu.eval type Matrix[R, C: static[int], T] = distinct array[R * C, T];echo(Matrix[1,2,int] is Matrix[2,1,int])
05:01:47Mimbusflaviu: true
05:03:08gmpreussnerit probably tracks R and C as "static[int]" instead of "1" and "2", which is why it comes out as the same type
05:03:32gmpreussneri need to start diving into the compiler so i can debug stuff like that
05:03:38gmpreussnernow if only i had more time
05:04:02*jefus_ quit (Ping timeout: 245 seconds)
05:06:25notfowlgmpreussner, do you have any vacation days?
05:06:55gmpreussneryeah, i got this week and next week off. after that it's back to the salt mine.
05:11:39notfowllucky
05:11:44notfowli dont even get xmas eve off
05:13:42gmpreussneraw that sucks
05:13:42*bjz joined #nim
05:14:20gmpreussnerare you going to celebrate Santa's birthday at the office?
05:15:34notfowlha
05:15:48*BitPuffin joined #nim
05:19:57*BitPuffin quit (Ping timeout: 240 seconds)
05:28:01*bjz quit (Ping timeout: 272 seconds)
05:32:50*nimnoob joined #nim
05:52:52*bjz joined #nim
05:54:35*bjz quit (Remote host closed the connection)
05:55:11*bjz joined #nim
05:56:04*nimnoob quit (Ping timeout: 245 seconds)
06:04:00*dyu joined #nim
06:21:01Varriountgmpreussner: If you want to start out with the compiler, start small, like with the parser.
06:21:21VarriountAlso, document anything you find, for future explorers.
06:22:56Varriount.eval import os;echo(findExe("nim"))
06:22:58MimbusVarriount: /home/sandbox/nim-lang/bin/nim
06:26:09Varriount.eval echo(1+1 / 2)
06:26:11MimbusVarriount: 1.5
06:34:01*bjz quit (Read error: Connection reset by peer)
06:42:13gmpreussnerVarriount: will do, thanks
06:47:35gmpreussneris this expected? http://pastebin.com/4CSxBtRj
06:47:48gmpreussneri don't know if it's a bug, or if i'm doing things wrong
06:51:53gmpreussneri forgot to paste one line at the bottom. X is a range, i.e.: var a: Foo[range[0..2], float]
07:01:35*AMorpork is now known as ZzZMorpork
07:03:45*gour joined #nim
07:07:01dts|pokeball<flaviu> gmpreussner: Officially, we don't. It's dts|pokeball's, but I'm temporary running it while he figures out sandboxing.
07:07:04dts|pokeballty :)
07:07:11dts|pokeballshould be up soon
07:07:24dts|pokeballMOE is just more of a bitch to configure than i thought it would be
07:10:07*bjz joined #nim
07:13:46dts|pokeballalso, i had an idea at work
07:15:08notfowlwhat were you doing thinking when you should be working
07:15:26dts|pokeballoops. i forgot i had to write out the idea :}
07:15:45dts|pokeballnotfowl, i work hard at pretending im working hard
07:15:52dts|pokeballso i dont actually have to work
07:17:16dts|pokeballanyways, what if i split input by ';', erase leading ws, then run the code through a formatter?
07:22:01*bjz quit (Ping timeout: 272 seconds)
07:23:52*khmm joined #nim
07:28:15*khmm quit (Ping timeout: 252 seconds)
07:32:52*khmm joined #nim
07:43:37*z1y quit (Ping timeout: 255 seconds)
08:04:29*z1y joined #nim
08:12:25*vendethiel quit (Ping timeout: 255 seconds)
08:22:16*vendethiel joined #nim
08:23:48*darkf_ joined #nim
08:24:00*Varriount_ joined #nim
08:26:56*darkf quit (Ping timeout: 258 seconds)
08:27:19*Varriount quit (Ping timeout: 258 seconds)
08:33:21*yglukhov joined #nim
08:52:21*BlaXpirit joined #nim
09:20:03*darkf_ is now known as darkf
09:38:58*kniteli quit (Ping timeout: 250 seconds)
09:47:53*milosn joined #nim
10:17:35*Matthias247 joined #nim
10:18:55*zahary joined #nim
10:18:56*zahary quit (Read error: Connection reset by peer)
10:19:41*zahary joined #nim
10:19:48*zahary quit (Read error: Connection reset by peer)
10:22:53*zahary_ joined #nim
10:23:18*zahary_ is now known as zahary
10:28:09Araq_hi zahary welcome back :-)
10:35:43ekarlso-Araq_: is there a Rest framework for nim ?
10:36:14Araq_ekarlso-: I continue to not know what that even means
10:39:46zaharyjester is a rest framework
10:49:21ekarlso-Araq_: REST api ish ;PÅ
11:01:16*BitPuffin joined #nim
11:05:44*bjz joined #nim
11:20:14*z1y quit (Ping timeout: 256 seconds)
11:32:58gokrgmpreussner: About "duck typing", you might want to read my OO articles.
11:33:16gokrAlthough I should write a "summary" article too.
11:34:03gokrRegarding "duck typing" its useful to understand how procs/methods and generics "play together", and those articles explore that.
11:37:42ekarlso-is there sometihng like match in nim ?
11:39:30*vendethiel quit (Ping timeout: 256 seconds)
11:41:35*vendethiel joined #nim
11:41:52*milosn quit (Ping timeout: 240 seconds)
11:43:55*milosn joined #nim
11:50:02*willwillson joined #nim
11:50:33*milosn quit (Ping timeout: 272 seconds)
11:50:55*milosn joined #nim
12:06:52*bjz quit (Ping timeout: 255 seconds)
12:24:28*Varriount_ quit (*.net *.split)
12:24:28*Jesin quit (*.net *.split)
12:24:28*dom96_ quit (*.net *.split)
12:24:28*darkf quit (*.net *.split)
12:24:28*TylerE quit (*.net *.split)
12:24:28*CARAM__ quit (*.net *.split)
12:24:29*gokr_ quit (*.net *.split)
12:24:29*flaviu quit (*.net *.split)
12:24:29*Araq_ quit (*.net *.split)
12:24:29*milosn quit (*.net *.split)
12:24:29*Matthias247 quit (*.net *.split)
12:24:29*jefus__ quit (*.net *.split)
12:24:29*[CBR]Unspoken quit (*.net *.split)
12:24:29*notfowl quit (*.net *.split)
12:24:30*NimBot_ quit (*.net *.split)
12:24:30*onionhammer quit (*.net *.split)
12:24:30*rektide quit (*.net *.split)
12:24:30*Roin quit (*.net *.split)
12:24:30*gmpreussner quit (*.net *.split)
12:24:30*phI||Ip quit (*.net *.split)
12:25:15*Varriount_ joined #nim
12:25:15*Jesin joined #nim
12:25:15*dom96_ joined #nim
12:26:19*darkf joined #nim
12:26:19*TylerE joined #nim
12:26:19*CARAM__ joined #nim
12:26:39*gokr_ joined #nim
12:26:39*flaviu joined #nim
12:26:39*Araq_ joined #nim
12:26:54*milosn joined #nim
12:26:54*Matthias247 joined #nim
12:26:54*jefus__ joined #nim
12:26:54*[CBR]Unspoken joined #nim
12:26:54*notfowl joined #nim
12:26:54*rektide joined #nim
12:26:54*NimBot_ joined #nim
12:26:54*onionhammer joined #nim
12:26:54*Roin joined #nim
12:27:05*TylerE quit (Max SendQ exceeded)
12:27:05*CARAM__ quit (Max SendQ exceeded)
12:27:05*CARAM__ joined #nim
12:28:11*CARAM__ quit (Changing host)
12:28:11*CARAM__ joined #nim
12:28:25*TylerE joined #nim
12:28:52*gmpreussner joined #nim
12:28:52*phI||Ip joined #nim
12:37:04*Banjomaster joined #nim
12:38:03BanjomasterCan i access tkinter through the python interface, say write the application in nim and gui in nim?
12:38:30BanjomasterGui in tkinter i meant
12:52:42*TylerE is now known as TylerE_
12:55:08Araq_ekarlso-: not sure what you're after but there is a 're' module
12:55:16Araq_Banjomaster: I can't see why not
12:56:05ekarlso-Araq_: would it be bad to write a packages.nim.org ish in python ?
12:57:17Araq_ekarlso-: yes, write it in Nim instead
12:57:23ekarlso-:'(
12:57:25ekarlso-booo
12:57:39ekarlso-Araq_: wondering to use a db backend maybe..
12:57:50Araq_db_sqlite exists and works
12:58:01Araq_so does db_mysql and db_postgre
12:58:32ekarlso-Araq_: any migrations tools ?
12:59:24Araq_there is no py2nim but it would make an awesome project
12:59:31Araq_*hint, hint+
12:59:38ekarlso-hah :p
12:59:43ekarlso-dont have time for stuff like that :|
13:08:15BanjomasterThats encouraging, just call the tkinter metods from nim then?
13:10:33Araq_yeah but we also have a TK interface
13:11:12Araq_it's low level wrapper though and I don't know of anybody who uses it :P
13:12:57BanjomasterOk thanks ill check it out
13:14:59*khmm quit (Ping timeout: 244 seconds)
13:27:35*dom96_ quit (Ping timeout: 244 seconds)
13:37:23Banjomasterjust curious what do people use for gui, is support of tk not so good in nim?
13:40:56*dom96_ joined #nim
13:43:02*bjz joined #nim
13:46:59*jefus__ is now known as jefus
14:02:32flaviuBanjomaster: Well, there's only been one GUI project that I know of in Nim so far, Aporia
14:02:39flaviuThat uses gtk2
14:07:50*zeta_ joined #nim
14:09:11gmpreussnerAraq, flaviu: is this is a bug or did i not understand ranges? http://pastebin.com/4CSxBtRj
14:09:12gmpreussnerX is a range, i.e.: var a: Foo[range[0..2], float]
14:10:47flaviuSorry, but I've never touched this part of the language. Araq is your only hope ;)
14:15:25dom96_ekarlso-: How dare you prefer Python over Nim :P
14:18:49flaviuWhy would we need python2nim? There is a compiler that transforms python into C, we can just use c2nim on that.
14:20:24*Matthias247 quit (Read error: Connection reset by peer)
14:30:07Araq_gmpreussner: looks like a bug
14:30:10*dom96_ quit (Read error: Connection reset by peer)
14:32:48gmpreussnerAraq_: ok, i couldn't find any existing issues related to this. i can add a new one.
14:33:05*yeye123 joined #nim
14:34:50Araq_yeah please do so
14:39:00*yeye123 quit (Quit: Leaving)
14:41:44*milosn quit (Remote host closed the connection)
14:47:18*dom96_ joined #nim
14:49:03ekarlso-dom96_: my work does that hah: P
14:49:05ekarlso-openstack
14:52:16*willwillson quit (Ping timeout: 250 seconds)
14:53:22*zeta_ quit (Ping timeout: 255 seconds)
14:57:22*dom96_ quit (Ping timeout: 245 seconds)
14:57:50*Sembei quit (Read error: Connection reset by peer)
14:58:25*MyMind joined #nim
15:03:11*z1y joined #nim
15:23:24Varriount|Busyflaviu: Uh, there might be some concerns with efficiency, translating python to c to nim
15:23:37flaviuVarriount|Busy: So? :P
15:27:53*darkf quit (Quit: Leaving)
15:28:28Varriount|Busy.eval echo(repr([for i in countUp(0, 5): i]))
15:28:29MimbusVarriount|Busy: eval.nim(1, 14) Error: expression expected, but found 'keyword for'
15:28:56Varriount|Busy.eval echo(repr([(for i in countUp(0, 5): i)]))
15:28:57MimbusVarriount|Busy: eval.nim(1, 36) Error: value of type 'int' has to be discarded
15:29:08Varriount|Busy:<
15:29:19flaviuVarriount|Busy: Nim doesn't have for comprehensions.
15:29:36Varriount|BusyAww...
15:31:29*kapil__ quit (Quit: Connection closed for inactivity)
15:37:10gmpreussnerAraq_: i looked into using macros to emulate variadic generics this morning. i hear it's supposed to be possible, but nobody can show an actual example. this is what i came up with:
15:37:12gmpreussnerit looks like type definitions cannot be overloaded based on generic parameters, which means that the macro to create the generic type/parameter combinations has to generate a unique name for each. one also has to generate every desired variadic type combination ahead of time before it can be used.
15:37:20gmpreussnerso in case of a multidimensional array of arbitrary rank, i end up with something like "type defineMultiArray(2)", "type defineMultiArray(3)" and so on, which will generate MultiArrayX type defs. then to use the generated types i have "type Foo = MultiArray2[5, 6]" and "type Bar = MultiArray3[5, 6, 7]",
15:37:26gmpreussneris this as good as it gets right now? what i really want is "type Foo = MultiArray[5, 6]", and ideally i wouldn't have to hard code a list of desired combinations ahead of time :)
15:37:36*z1y quit (Remote host closed the connection)
15:37:52*z1y joined #nim
15:38:59flaviugmpreussner: try using typedescs.
15:39:18flaviumacro foo(types: varargs[typedesc])
15:40:12Varriount|BusyAraq_: Are procedures passed to macros via pragmas supposed to have a 'Do' node root?
15:43:52gmpreussnerflaviu: well, it's not that easy. that would work i was generating concrete types, but in my case i'm actually generating generic types
15:44:53flaviuAh, I see what you mean.
15:44:57gmpreussnerfor example, defineMultiArray(2, T) would generate: MultiArray[D1, D2; T] = object...
15:45:46*milosn joined #nim
15:46:52flaviu.eval type; MultiArray[D1, D2; T] = object; MultiArray[D1, D2, D3; T] = object
15:46:54Mimbusflaviu: eval.nim(3, 2) Error: invalid indentation
15:47:14flaviu.eval type; MultiArray[D1, D2; T] = object; v:int; MultiArray[D1, D2, D3; T] = object; v:int
15:47:15Mimbusflaviu: eval.nim(3, 2) Error: invalid indentation
15:47:59flaviu.eval type; MultiArray[D1, D2, T] = object; MultiArray[D1, D2, D3, T] = object
15:48:00Mimbusflaviu: eval.nim(3, 2) Error: redefinition of 'MultiArray'
15:48:05gmpreussner:)
15:51:06*matkuki joined #nim
15:53:28*nimnoob joined #nim
15:58:24matkukiflaviu: Can I ask you something about your OOP macro and macros in general?
15:58:35flaviuSure.
15:59:54matkukiThe last line "result[0][0][0][2][0][2] = recList", what does it do?
16:01:16flaviuIt digs through the AST to that point and replaces it with all the fields
16:01:32flaviuSee the comment above it, it helps visualize what all those [][][]s are doing
16:01:53flaviurecList is a bunch of object field nodes.
16:03:27matkukiDo objects always have this kind of structure?
16:04:07flaviuYes, they do.
16:04:54flaviuIf you want to see the structure of a particular bit of code, you can do
16:04:54flaviu.eval import macros;dumpTree:; type Test = object; a: int
16:04:56Mimbusflaviu: StmtList
16:05:25flaviuWell, only the first line showed up.
16:07:18matkukiThanks, things are clearer to me now.
16:09:10matkukiWhen a macro is declared as in your example "macro class*(head: expr, body: stmt): stmt {.immediate.} =",
16:09:37matkuki... what part of it is the head and what part is the body?
16:10:37flaviuThe head is the part before the `:` in the invocation, and the body is the part after the `:`
16:11:04flaviu`class Animal of TObject: ...` could be rewritten as `class(Animal of TObject): ...`, if that's clearer.
16:12:18*EXetoC joined #nim
16:12:49matkukiOk, got it. I'm a Nim begginner, so sorry if I ask something that makes no sense.
16:13:31flaviuNo need to apologize about that :)
16:20:39*nimnoob quit (Remote host closed the connection)
16:23:09*z1y quit (Ping timeout: 245 seconds)
16:24:15*khmm joined #nim
16:27:29matkukiAnother thing about types/classes, why is that when declaring an object, it's usually done with "ref object of" instead of "object of"?
16:28:28*khmm quit (Ping timeout: 250 seconds)
16:30:03flaviumatkuki: Because `object of ...` means the object is like a struct. If you extend from it, you'll have problems.
16:30:52flaviufor example, if you have `TestObject = object of RootObj; a: int`, storing that into a seq[RootObj] will cause the `a` field to be truncated.
16:31:58flaviuIf you don't want to use inheritance, you don't have to bother with the `object of` business, and you can use either `ref object` or `object`, whichever you'd like.
16:33:14*khmm joined #nim
16:36:19*nimnoob joined #nim
16:38:25Araq_gmpreussner: I think you can do significantly better right now when you use a tuple instead of faking varargs generics
16:38:43*dom96_ joined #nim
16:40:07Araq_that said, my motivation could be greater to dig into this whole mess again when I had ever seen a matrix/tensor that doesn't end up being a poor reinvention of what the language itself already offers under the name 'array'
16:40:40matkukiflaviu: thanks
16:41:33Araq_I mean ... you start with a glorified type alias for 'array', reinvent [] and []= access ("encapsulation") and then it goes downhill when you realize you also want [[0, 2, 3], [...]] literals for initialization
16:43:34Araq_and then you get quite close to what array already offers, but damn ... your encapsulated matrix cannot easily be a 'const'
16:45:20Araq_and once we get the OpenCL backend we need to be able to map your matrix to the native OpenCL stuff ...
16:45:44Araq_it never stops generating complexity
16:50:02*Araq_ is now known as Araq
16:53:30*BlaXpirit-UA joined #nim
16:55:08Araqbbl
16:55:37gmpreussnerAraq: yeah, those are all great points, and i agree with you
16:55:42*khmm quit (Ping timeout: 256 seconds)
16:56:38*BlaXpirit quit (Ping timeout: 250 seconds)
16:57:39*dyu quit (Quit: Leaving)
17:04:18*Trustable joined #nim
17:05:56*nimnoob_ joined #nim
17:05:56*nimnoob quit (Read error: Connection reset by peer)
17:24:09*Trustable quit (Remote host closed the connection)
17:32:07*nimnoob__ joined #nim
17:32:33*kniteli joined #nim
17:32:51*nimnoob_ quit (Read error: Connection reset by peer)
17:33:52matkukiWhat was the reason for the name change form Nimrod to Nim?
17:34:19def-matkuki: http://forum.nimrod-lang.org/t/561
17:34:54*askatasuna joined #nim
17:45:34*nimnoob__ quit (Ping timeout: 256 seconds)
17:46:26*nimnoob__ joined #nim
17:50:14*yglukhov quit (Ping timeout: 245 seconds)
17:57:25*xtagon joined #nim
17:57:52*BlaXpirit-UA quit (Quit: Quit Konversation)
17:58:11*BlaXpirit joined #nim
18:29:34*xtagon quit (Read error: Connection reset by peer)
18:32:13*Hakaslak joined #nim
19:04:54*Hakaslak_ joined #nim
19:05:29*yeye123 joined #nim
19:08:15*Hakaslak quit (Ping timeout: 258 seconds)
19:09:40*yeye123 quit (Client Quit)
19:12:49*yeye123 joined #nim
19:13:08*ZzZMorpork is now known as AMorpork
19:24:47*rpag joined #nim
19:28:58*dts|pokeball quit (Read error: Connection reset by peer)
19:29:17*Hakaslak_ quit (Quit: TODO: Generate 'Computer Sleep Quit Message')
19:29:39*dts|pokeball joined #nim
19:38:11*Hakaslak joined #nim
19:43:05*rpag quit (Quit: Leaving)
19:43:07*Hakaslak quit (Ping timeout: 264 seconds)
19:46:47*yeye123 left #nim ("Konversation terminated!")
19:46:56*yeye123 joined #nim
19:52:22matkukiflaviu: What would I have to change in the 'class' macro, so it would produce only 'ref object' instead of 'ref object of ...'?
19:54:16matkukiIf I remove the change the definition in my code from 'class MyClass of TObject:' to 'class MyClass' it gives me an error:
19:54:43matkuki"Error: expression expected, but found ':'"?
19:54:53dts|pokeballcode plz
19:55:39matkukiflaviu's nim-by-example OOP macro: http://nim-by-example.github.io/oop_macro/
19:55:52flaviuhuh, it works for me.
19:57:00flaviumatkuki: Did you forget to remove the `of` too?
19:57:48matkukino removed 'of', wait a sec...
20:00:31matkukiflaviu: just remembered another thing, I changed your original code, so that the class can be used in other modules!
20:00:47matkukiIf I use your original macro it works.
20:01:17matkukiflaviu: Is there a simple way to make the class exportable to other modules?
20:03:15flaviumatkuki: Yep. Just add `*` after the type names around `type `typeName` = ref object`
20:09:34*yeye123 quit (Quit: Konversation terminated!)
20:10:52*loz1 joined #nim
20:14:45dts|pokeballso im looking at the fsmonitor module, and am trying to decide which event i want, and found ( MonitorAttrib, ## Metadata changed.) does this mean stuff like the date it was created?
20:16:21matkukiflaviu: Great, it works! Can the macro be changed so that the class is exportable only if declared with an '*' e.g.: "class MyClass*"?
20:17:02*Hakaslak joined #nim
20:17:08dts|pokeball,eval import fsmonitor;echo(add(initMonitor(), "/"))
20:17:19dts|pokeball.eval import fsmonitor;echo(add(initMonitor(), "/"))
20:17:22Mimbusdts|pokeball: eval.nim(2, 9) Error: undeclared identifier: 'initMonitor'
20:17:40dts|pokeball.eval import fsmonitor;echo(add(newMonitor(), "/"))
20:17:43Mimbusdts|pokeball: 1
20:17:51dts|pokeball.eval import fsmonitor;echo(add(newMonitor(), "/bin"))
20:17:53Mimbusdts|pokeball: 1
20:17:57dts|pokeballhmmm
20:18:16dts|pokeballah
20:19:00flaviumatkuki: I'm sure it can. See what the difference is between `class MyClass* of Blah` and `class MyClass of Blah` using dumpTree.
20:19:29flaviumatkuki: It'll be slightly harder than adding a `*` unconditionally though.
20:19:54matkukithanks for the direction, will look into it.
20:28:17*yeye123 joined #nim
20:28:55Araqflaviu: no it cannot. since there are no postfix operators in Nim
20:29:15Araqwe discussed this a few times
20:30:30dv-if I export a function with export instead of using *, it works but I get a XDeclaredButNotUsed hint
20:30:42dv-also, nimrod doc doesn't generate docs for it
20:32:24*yglukhov joined #nim
20:33:07*askatasuna quit (Quit: WeeChat 1.0.1)
20:34:46Araqdv-: 'export' is not meant as an alternative for *
20:35:01*yglukhov quit (Read error: Connection reset by peer)
20:35:03Araqexport is forwarding symbols coming from a different module
20:35:09*yglukhov joined #nim
20:36:24dv-is there something else like it then? * is kinda ugly
20:39:58gmpreussnerdv: you know what, i used to feel the same when i started using nim a couple days ago. now i'm used to it, and i actually like it.
20:40:35gmpreussnerthe reason i hated it is because i've been programming mostly in C++ for the past 15 years, so i always read 'pointer type'
20:40:53dv-yeah
20:40:55gmpreussnernow i see 'public' instead. it only takes a few days :)
20:41:24ldleworkSometimes I hate that I have to type so many *'s to make things public
20:41:24dv-but also it would be useful to see all the exported symbols in one place
20:41:29ldleworkBut then I realized it goes both ways
20:41:49dv-(for example on top of the file)
20:41:58Araqironically when I started with C, I hated the * everywhere because I read it as "multiplication"
20:41:59ldleworkdv-: you can forward declare in Nim
20:42:07gmpreussnerAraq: lol
20:42:18Araqdv-: you're supposed to use the docgen for that overview
20:42:50Araq"const multiplied with int. arrrrghh"
20:43:45ldleworklol
20:46:02yeye123anyone else suddenly having problems with aporia? Error: unhandled exception: index out of bounds [EInvalidIndex]
20:46:37gmpreussneryeye123: i haven't even been able to compile it yet. still running into the "cant open glib2" issue
20:46:53Araqyeye123: maybe aporia only works with Nim now
20:47:09Araqfrom the EInvalidIndex I can tell you're still using Nimrod ;-)
20:47:30yeye123gmpreussner:ok, i guess you have installed that from nimble ?
20:47:38loz1hi guys, is nimrod ide source code available to public?
20:47:40yeye123Araq: thanks, how do i upgrade?
20:47:58Araqbootstrap from github devel
20:48:21Araqthere is no other way because we STILL haven't released 0.10.2 yet
20:48:35yeye123ok, thanks
20:48:58Araq(hi Varriount|Busy, hi dom96_! You're blocking the future of programming.)
20:49:21yeye123hehe ;)
20:49:24gmpreussnerok, nim is cancelled
20:50:09*milosn quit (Ping timeout: 252 seconds)
20:50:18Araqgmpreussner: aww what do you mean?
20:50:31Araqloz1: yes.
20:50:49gmpreussnerj/k :)
20:51:02*rpag joined #nim
20:51:09*Demos joined #nim
20:51:11loz1Araq: what is its name?)
20:52:05dom96Araq: hrm?
20:52:16flaviuAraq: But it does work!
20:52:50flaviuAraq: StmtList(Command(Ident(!"class"), Infix(Ident(!"*"), Ident(!"MyClass"), Prefix(Ident(!"of"), Ident(!"BlahC")))))
20:53:04Araqflaviu: well I guess it does, but it's weird, right? it's parsed as
20:53:05Araqyeah exactly
20:53:14flaviuYep, but it's usable.
20:53:58flaviuAnd I did have a disclaimer that it would be hard :)
20:54:19loz1ok aporia, i found it)
20:54:26gmpreussnerAraq: with regard to matrices/tensors as standard arrays, there is a valid use case where it won't work. if you want the storage to be substitutable, i.e. sparse matrices vs. dense, then we can't alias the array type directly, but have to use composition and expose indexing operators manually.
20:55:34gmpreussneri whipped up a quick test for this scenario earlier, and i'm currently stuck with the assignment operator for supporting assignment of regular arrays (which is one of the complications you pointed out earlier)
21:00:26Araqgmpreussner: yeah there are valid use cases. there are lots of others, for instance if you want to have an assert in your a[i] operation
21:02:02yeye123Araq: for your information, swithching to nim made the trick, thank you!
21:02:14Araqbut I keep looking for alternative ways to accomplish the same
21:02:42*Trustable joined #nim
21:03:56Araqgmpreussner: for instance, what I would currently do is to simply introduce a new operator like:
21:04:47Araqtemplate `|`(x, y): expr = x+y*SomeLength
21:05:06Araqand then use a[i|j]
21:05:25Araq(and simply arrays for 'a')
21:07:59gmpreussneri've seen that in one of your unit tests. you're talking about flattening two- or more dimensional arrays.
21:08:31Araqyou can do the same for sparse matrices
21:11:42gmpreussnerthat's orthogonal to the issue i mentioned though. what i was saying is that we can't do something along the lines of: type Matrix = array[..], because that dictates the element storage. we do not want to expose how elements are stored. what we care about is the contract to access elements, i.e. [1][2] or [1, 2]
21:11:57*rpag quit (Quit: Leaving)
21:12:22gmpreussnerfor convenience, we still want to be able to assign regular matrices though, i.e. var a: Matrix[..] = [[0, 0][0, 0]]
21:13:57gmpreussneri'm currently trying to figure out what the signature for that assignment operator should be
21:14:22flaviugmpreussner: Converter proc?
21:15:32gmpreussnerflaviu: i'll take a look at those right away :)
21:18:37*loz1 quit (Ping timeout: 245 seconds)
21:22:11gmpreussnerflaviu: interesting. does the name of a converter proc have any significance? it doesn't seem to be used in any of the examples i found
21:22:31yeye123I want to step through my nim program and watch all the variables, what are my options?
21:22:58Demoscompile with --lineDir:on --debugInfo
21:22:59flaviugmpreussner: No significance. Although from the few examples I've seen, they've been of the form `foo2bar`
21:23:04Demosand attach a debugger to it
21:23:18Demosthe debugger to use will depend on the compiler
21:23:57flaviugdb on linux.
21:24:11Demosfor gcc and clang you should be able to use gdb or lldb, for icc, clang-cl (do we even support clang-cl?), or vcc you can use windbg, or the VS debugger
21:24:45yeye123ok, im on linux, I'll have a look at it, thank you guys
21:24:57flaviuvariables might be mangled, so that sometimes makes things harder
21:25:48Araqgmpreussner: the reason that you have to give a name is that you can exclude it when importing
21:25:57Araqimport module except theConverter
21:26:50Araqfor the same reason TR macros need to have a name
21:27:22Demosand sometimes scope gets screwed up a bit, if I want to break on a specific line I sometimes use {.emit: "__debugbreak();".} (only works on windows)
21:27:47flaviuAraq: I think he's referring to whether naming it one thing or another makes a difference in where it applies.
21:28:10Araqflaviu: yeah and I indirectly answered that one too :P
21:28:43Araqthe name is irrelevant otherwise, except that you can invoke them explicitly too
21:29:02gmpreussneryeah, that all makese sense, guys
21:30:03gmpreussnerso i'm running into a minor snag: it looks like converter procs cannot be parameterized using the params of the return type. all params must be present in the from-type, i suppose?
21:30:53Araqthat is correct
21:30:59gmpreussnerthat would make it a showstopper, because my to-types have generic parms that are definitely not part of the array to be assigned from
21:31:44Araqhrm
21:34:34Araqwell overloading of '=' is in the works, but will take a while
21:36:16gmpreussnerok :)
21:36:30Araqthat said, I wouldn't do it this way. I'd have some construct macro for the convenience of having
21:36:37Araqconstruct""" 0 0 1
21:36:45Araq 3 4 5 ..."""
21:37:23Araqand then do the "ordinary" conversion from matrix to sparse matrix explicitly
21:37:32Araqin the other cases
21:37:52Araqbut it depends very much on how common that is, of course
21:55:24*dom96__ joined #nim
21:58:04*dom96_ quit (Ping timeout: 258 seconds)
21:59:19yeye123Error: no generic parameters allowed <--its getting late i guess, why cant i use myArray[i] inside a for loop with countup i?
22:03:03gmpreussneryeye123: can you post some more code?
22:05:58yeye123ok, this is what i want to achieve (example): for i in countup(0,15): Word[i] = true
22:06:36yeye123where Word is array of bool
22:07:39ldleworkyeye123: provide some code?
22:07:40EXetoC(0..15)
22:07:46ldleworkoh heh
22:07:57ldleworkwait, his countup should still work tho
22:07:59ldleworkright?
22:08:11gmpreussnerlooks ok to me
22:09:00yeye123hmm
22:09:00EXetoCI'd assume that they are equivalent, but the latter is more common and it's short
22:09:10flaviu.eval var word: array[16, bool]; for i in 0..15:; word[i] = true
22:09:11Mimbusflaviu: eval.nim(2, 4) Error: invalid indentation
22:09:19flaviu.eval var word: array[16, bool];for i in 0..15:; word[i] = true
22:09:21Mimbusflaviu: <no output>
22:09:26flaviuworks for me
22:09:38*rpag joined #nim
22:09:47ldlework:P
22:09:52ldleworkdts|pokeball: good work
22:10:34dts|pokeballwhat now?
22:10:48flaviudts|pokeball: Your bot has been useful once more.
22:10:52dts|pokeball:D
22:11:01dts|pokeballits not even channel ready yet
22:11:02dts|pokeballawesome
22:11:02EXetoC.eval
22:11:04MimbusEXetoC: <no output>
22:11:46gmpreussnerup next: flaviu's hard drive formatted by accident
22:12:01flaviugo ahead and try!
22:12:14flaviuSeriously, do it. use #nim-offtopic to avoid spamming this channel.
22:13:08yeye123ok, sorry guys, there were some unrelated typo, it works now, thank you
22:13:20gmpreussnermaybe later - im gonna be afk for a bit. are you running it in a chroot jail?
22:13:25flaviuNope
22:13:44dts|pokeballbbl
22:13:47flaviuIt's running as it's own user. I've set permissions so all private data is unreadable.
22:14:15matkukiIs there a way to use an `*` and `=` in a macro, like in type declarations: "type mytype* = object"?
22:16:09flaviumatkuki: I'm not sure what you mean.
22:18:12matkukiflaviu: I'm trying to make your class macro to look more like Nim's type declaration: "class MyClass* = object of TObject:"
22:19:07matkukiThat looks almost exactly like Nim's type declaration with only an aditional colon at the end.
22:19:14flaviumatkuki: You can't use that exact syntax
22:19:47matkukiok, thanks.
22:21:00*Mimbus quit (Remote host closed the connection)
22:21:02ldleworkimport basic_language_features
22:21:08*Mimbus joined #nim
22:21:08*Mimbus quit (Remote host closed the connection)
22:22:16*Mimbus joined #nim
22:25:36*z1y joined #nim
22:30:37*BlaXpirit quit (Ping timeout: 252 seconds)
22:36:54*Jesin quit (Quit: Leaving)
22:38:47*gour quit (Quit: Leaving)
22:47:31*z1y quit (Ping timeout: 258 seconds)
22:56:52*yeye123 quit (Quit: Leaving)
22:57:57*Trustable quit (Quit: Leaving)
22:58:24*EXetoC quit (Read error: Connection reset by peer)
22:59:51*EXetoC joined #nim
23:00:15*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0.5/20141126041045])
23:16:04*yglukhov quit (Quit: Be back later ...)
23:58:08*rpag is now known as candlefactory