<< 21-02-2015 >>

00:02:05*reem joined #nim
00:04:08*reem quit (Remote host closed the connection)
00:05:13onionhammerVarriount you should add a c/cpp/obj setting ;)
00:09:07*gsingh93 quit (Ping timeout: 255 seconds)
00:18:41*Mat4-coding is now known as Mat4
00:18:48*Mat4 quit (Quit: Verlassend)
00:27:18*chernobyl joined #nim
00:27:27*chernobyl quit (Client Quit)
00:29:02*johnsoft quit (Ping timeout: 246 seconds)
00:29:19*johnsoft joined #nim
00:31:16Varriountonionhammer: Hm?
00:41:35*filwit quit (Quit: Leaving)
00:45:09*pregressive quit (Remote host closed the connection)
00:45:28*pregressive joined #nim
00:47:53*jsudlow joined #nim
00:49:55*enquora quit (Quit: enquora)
01:06:03*sampwing quit (Ping timeout: 252 seconds)
01:22:41*infinity0_ joined #nim
01:22:41*infinity0_ quit (Changing host)
01:22:41*infinity0_ joined #nim
01:22:41*infinity0 is now known as Guest28183
01:22:41*Guest28183 quit (Killed (asimov.freenode.net (Nickname regained by services)))
01:22:41*infinity0_ is now known as infinity0
01:34:39*reem joined #nim
01:40:05*kjo left #nim (#nim)
01:47:50*willwillson quit (Read error: Connection reset by peer)
01:51:42*reem quit (Remote host closed the connection)
02:00:00*d3m1gd quit (Ping timeout: 244 seconds)
02:04:57*dhasenan joined #nim
02:05:17*reem joined #nim
02:09:52*nande_ quit (Ping timeout: 240 seconds)
02:12:20*koz_desktop joined #nim
02:12:55*Trustable quit (Quit: Leaving)
02:14:11koz_desktopDoes Nim's compiler perform TCO?
02:14:20*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:18:32flaviuThis doesn't make much sense. One of my hotspots is somehow being called from a local variable.
02:19:05flaviuerr, global variable
02:27:06*jholland quit (Quit: Connection closed for inactivity)
02:30:44*reem quit (Remote host closed the connection)
02:34:04*nande joined #nim
02:35:34koz_desktopFor the hash tables in the tables module, is a tuple considered a 'simple standard type'?
02:35:38*pregressive quit (Read error: Connection reset by peer)
02:35:44*darkf joined #nim
02:36:43*nande quit (Remote host closed the connection)
02:37:09flaviu.eval import tables; let x = initTable[tuple[x: int, y: string],int]()
02:37:13Mimbusflaviu: <no output>
02:37:51flaviukoz_desktop: There's no type mismatch, so it qualifies as "simple"
02:37:57koz_desktopflaviu: Thanks!
02:38:26flaviuBut "simple standard type" has no general meaning - here it's just referring to something that doesn't have a hash() function in the stdlib.
02:40:52koz_desktopflaviu: That's what I was checking. Thanks!
02:41:21koz_desktopAlso, nim's compiler is pretty smart - it figured out I wanted it to compile stuff in the src directory without me telling it to!
02:43:40*reem joined #nim
02:46:39*reem quit (Remote host closed the connection)
02:49:44*pregressive joined #nim
02:49:47*pregressive quit (Remote host closed the connection)
03:00:50*kapil___ joined #nim
03:05:00Varriountkoz_desktop: The compiler itself doesn't do TCO, however the C/C++/ObjC compiler might.
03:07:13*RayoGundead joined #nim
03:08:23koz_desktopVarriount: On GNU/Linux, does Nim use GCC to compile the C?
03:08:57Varriountkoz_desktop: It uses whatever C compiler it finds. I forget how it finds out.
03:09:19koz_desktopWell, I have both GCC and Clang, so that's why I'm curious.
03:09:33VarriountI think it uses GCC by default. You can tell it to use another compiler via a command line/config switch
03:09:45koz_desktopOK - does it pass any -O parameters to it?
03:09:56koz_desktopBecause if it does, then yes, Nim does TCO as far as I'm concerned.
03:09:57Varriountkoz_desktop: Try adding '--verbosity:2' to the output
03:10:23VarriountYou should see, near the end of the compilation process, the invokation of the C compiler.
03:10:48koz_desktopOh, cool. On normal, it doesn't pass any -O parameters.
03:11:16koz_desktopAnd -O3 with -d:release
03:11:25koz_desktopThat's freaking awesome, thanks Varriount.
03:12:50koz_desktopSuppose I declare a type like type Foo = tuple[a,b: int]
03:13:05koz_desktopIs this type going to be available outside the current file?
03:13:09koz_desktopIf not, where do I put the *?
03:13:13renesackoz_desktop: look at the config directory on nimrod instalation
03:13:26renesacfor more about the compiler parameters
03:14:14renesackoz_desktop: it won't, unless you include instead of importing it
03:14:25renesacput the * before Foo
03:14:39koz_desktoprenesac: So type *Foo = ... ?
03:14:44VarriountActually, it needs to be after Foo
03:14:53renesacoops
03:14:57renesacsorry
03:15:02koz_desktopSo type Foo* = ...
03:15:23Varriountkoz_desktop: Yep. And you can apply * to mark fields and procedures as externally visible too.
03:15:32*renesac don't programs in nimrod since some weeks
03:15:53renesacVarriount: for tuples, all the fields are visible right?
03:16:03koz_desktopI knew about fields and procedures already - just not types.
03:16:12renesaconly objects can hide fields, I think
03:16:18renesacbut I'm not sure
03:16:28koz_desktopAlso, is someone in the Nim community responsible for the nim-mode available in Emacs?
03:17:05renesachttps://github.com/Araq/Nim/wiki/Editor-Support
03:17:27renesacis it the code of one of them?
03:17:59koz_desktopYeah, it is. I even found an answer for th eissue I was having with it.
03:18:05flaviuyep, all the tuple fields are visible.
03:25:40*reem joined #nim
03:26:10koz_desktopOK, in the tables module, it gives an example of how to init a Table as var salaries = initTable[Person, int]()
03:26:18koz_desktopIf I wanted a TableRef instead, what would I do?
03:27:46koz_desktop(sorry for all these questions - I'm new to Nim and I learn best by imitation)
03:29:36*gsingh93 joined #nim
03:29:47Varriountrenesac: I don't quite know.
03:34:50koz_desktopAlso, how would I return a new TableRef from a proc that generates it?
03:35:36koz_desktopDo I just assign it to result?
03:36:11*gsingh93 quit (Ping timeout: 250 seconds)
03:43:49Varriountkoz_desktop: What do you mean?
03:44:09VarriountAssigning the output to result should work.
03:45:09koz_desktopVarriount: Thanks. Also, where do I find the doc for countup?
03:46:21flaviukoz_desktop: see initTable vs newTable
03:46:36koz_desktopflaviu: Thanks.
03:49:24koz_desktopOK, I'm getting weird errors from this program: http://dpaste.com/0S4Y2YH
03:49:38koz_desktopI think I have a type mismatch somewhere, but it's not being very helpful in telling me where
03:50:49renesackoz_desktop: about countup: learn to use http://nim-lang.org/theindex.html
03:51:06renesacit is in system IIRC
03:51:17koz_desktoprenesac: Thanks.
03:51:39renesacyou will normally use the '..' operator though
03:51:41renesacfor countup
03:51:45flaviukoz_desktop: Sure it does. See all the "Info: template/generic instantiation from here"? They're all part of the error message.
03:52:17flaviuThe problem is at test.nim(8, 19)
03:52:43koz_desktopWhen I assign to result?
03:52:47koz_desktopAm I missing a cast or somethign?
03:52:50koz_desktopsomething*
03:52:50flaviuIt's unable to find a hash function for uint32.
03:53:01koz_desktopAh.
03:53:19koz_desktopSo I need to write one that delegates to int64?
03:54:01flaviuSure, that's a solution.
03:54:07koz_desktopHow would I do that?
03:54:38flaviuproc hash(self: uint32): ... = hash(int64(self))
03:56:02koz_desktopShouldn't it be result = hash(int64(self)) ?
03:58:54koz_desktopWriting it exactly as you said (replacing ... with THash) seems to have no effect on the error message.
03:59:13flaviuThat would be equivalent, but I don't like using two equal signs on the same line.
03:59:57flaviuDid you import hashes? If so, you should get a typemismatch on `==`. Just import unsigned.
04:01:25koz_desktopOK, my program now looks like this: http://dpaste.com/1DSQ1KA
04:01:30koz_desktopI still get the same error from the same place.
04:01:58flaviuThat's because nim doesn't do automatic forward declarations.
04:02:15flaviumove hash() to above make_line_graph()
04:02:23koz_desktopI'll add a forward declaration
04:03:15koz_desktopOK, it works now, thanks!
04:04:38flaviugreat!
04:04:38*sitaram quit (Ping timeout: 246 seconds)
04:04:41*pregressive joined #nim
04:04:51koz_desktopAlso, is there any support in Nim for contract programming?
04:06:46*sitaram joined #nim
04:06:46*sitaram quit (Changing host)
04:06:46*sitaram joined #nim
04:08:57flaviuNo, but nim is very extensible. Write your desired syntax inside dumpTree and if it compiles, it's possible.
04:09:27flaviuhttps://gist.github.com/ae3135451aa7158db9ff
04:09:44koz_desktopI see.
04:10:11koz_desktopIn that case, can I take a subrange such that I can only have floats in the interval (0.0 ; 1.0)?
04:11:34koz_desktop(I want to make the only valid inputs to make_line_graph's k parameter to be in that range)
04:11:43flaviuNo, but https://github.com/Araq/Nim/issues/1095
04:12:09koz_desktopAh.
04:14:32koz_desktopI guess I'll just use doAssert for now.
04:16:21koz_desktopI guess uint32 is an ordinal?
04:18:41koz_desktopAlso, the compiler seems unhappy with type Positive* = range[0..high(uint32)]
04:18:45koz_desktopDid I do something wrong?
04:19:20flaviuI think that positive is already taken.
04:19:27koz_desktopAh, ok.
04:19:29flaviuhttp://nim-lang.org/system.html#Positive
04:19:44koz_desktopOK, U32Positive it is!
04:20:29*gsingh93 joined #nim
04:20:33koz_desktoptype U32Positive* = range[1..high(uint32)] is still not satisfactory :(
04:23:02flaviuI'm not sure what the problem is, but I need to go to bed now. Araq will probably be around in the morning, ask again then.
04:23:15koz_desktopOK, thanks!
04:24:09*brson joined #nim
04:26:01koz_desktopVarriount: Any chance you'd know?
04:34:25*sitaram quit (Ping timeout: 256 seconds)
04:35:42*pregress_ joined #nim
04:38:23*pregressive quit (Ping timeout: 256 seconds)
04:41:35*sitaram joined #nim
04:41:35*sitaram quit (Changing host)
04:41:35*sitaram joined #nim
04:51:10*hasenj joined #nim
04:51:11*sitaram quit (Ping timeout: 252 seconds)
04:51:15*pregressive joined #nim
04:52:04*davidhq joined #nim
04:52:06hasenjtotal noob question
04:52:11hasenjI'm trying to use the map function
04:52:22hasenjhttp://hastebin.com/ovujanucig.md (4 lines of code)
04:52:46hasenjI defined the function I want to map as:
04:52:55hasenj proc square[T](n: T): T{.closure.} = n * n
04:53:27hasenjThe compiler is saying it's expecting the function to have the signature:
04:53:29hasenjproc (T): S{.closure.}
04:53:58*pregress_ quit (Ping timeout: 255 seconds)
04:55:14hasenjat leaset that's how I'm reading the error message ..
04:55:50hasenjhttp://hastebin.com/ogihaxeqed.pl
05:03:17*sitaram joined #nim
05:03:35*sitaram quit (Changing host)
05:03:35*sitaram joined #nim
05:08:46*reem quit (Remote host closed the connection)
05:09:20*reem joined #nim
05:10:13*gsingh93 quit (Ping timeout: 250 seconds)
05:15:39*kniteli quit (Ping timeout: 245 seconds)
05:25:17*saml_ joined #nim
05:27:58*saml_ quit (Client Quit)
05:28:48Varriounthasenj: You still here?
05:28:51*saml_ joined #nim
05:28:53hasenjyea
05:29:21hasenjVarriount: yes
05:30:53Varriounthasenj: Ok, I'm looking at it.
05:31:21koz_desktopVarriont: Any chance you could help me with my issue as well?
05:33:26Varriountkoz_desktop: Sure, what is it?
05:34:24*reem quit (Remote host closed the connection)
05:34:39koz_desktoptype U32Positive* = range[1..high(uint32)] is still not satisfactory :(
05:34:44koz_desktopI get a type mismatch for some reason.
05:34:57Varriounthasenj: It seems to be a compiler limitation/language ambiguity
05:35:00*reem joined #nim
05:35:12hasenjVarriount: ok, thanks
05:35:20hasenjI guess I should post in the forum or something
05:35:44Varriounthasenj: When you reference 'square', the compiler puts in the actual generic procedure type, with unfilled type parameters
05:35:52Varriounthasenj: Make an issue.
05:36:37hasenjok
05:36:41Varriounthasenj: You have to put explicit type params
05:36:49Varriountecho sum(map(components, square[int, int]))
05:36:58hasenjaaah, ok
05:36:59hasenjthanks
05:40:00Varriountkoz_desktop: Looking into it now. It might be a compiler bug.
05:41:19*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
05:42:41hasenjhttps://github.com/Araq/Nim/issues/2188
05:43:06koz_desktopVarriount: Thanks!
05:43:58Varriountkoz_desktop: A range expects two ordinals of the same type.
05:44:42VarriountSince an integer literal is assumed to be an 'int' unless otherwise stated, the compiler is complaining about you giving it a range with two types, uint32 and int
05:45:28VarriountIf nothing else, that error message needs to be improved. It's understandable behavior, in hindsight, but the compiler doesn't give much information.
05:45:48Varriountkoz_desktop: 'type U32Positive* = range[1'u32..high(uint32)]'
05:46:50Varriountkoz_desktop: I don't supposed you could hunt down where the error message is being called from, and improve it?
05:48:28Varriountkoz_desktop: All you need to do is try to compile the invalid code with a version of the compiler that has stacktraces and linetraces enabled (which is always, unless -d:release is used)
05:49:39*kniteli joined #nim
05:49:54VarriountHey kniteli
05:50:33kniteliEvening
05:51:40*MightyJoe joined #nim
05:52:29*kapil___ quit (Quit: Connection closed for inactivity)
05:52:50*cyraxjoe quit (Ping timeout: 246 seconds)
05:54:34*hasenj quit (Quit: hasenj)
05:58:37*MightyJoe quit (Ping timeout: 264 seconds)
05:59:57*MightyJoe joined #nim
06:01:41*sitaram quit (Ping timeout: 256 seconds)
06:02:53*reem quit (Remote host closed the connection)
06:03:27*sitaram joined #nim
06:03:35*sitaram quit (Changing host)
06:03:35*sitaram joined #nim
06:04:14*nimnoob123 joined #nim
06:07:46*reem joined #nim
06:11:03*sitaram quit (Ping timeout: 250 seconds)
06:17:03dhasenanHow do I get nim to print out its linker command?
06:17:55*sitaram joined #nim
06:18:58Varriountdhasenan: Try --verbosity:2
06:20:43dhasenanVarriount: thanks.
06:24:22koz_desktopVarriount: I'll have a look
06:25:43koz_desktopIt gives this: graph.nim(27, 24) Error: type mismatch
06:25:59koz_desktopWhere that line is the one I pasted.
06:26:23*sitaram quit (Ping timeout: 246 seconds)
06:27:15koz_desktopAnd for your version, it gives the error 'range is empty'.
06:28:03Varriountkoz_desktop: Huh?
06:28:23koz_desktopI'll paste my whole progrma.
06:28:28nimnoob123spent two days trying to figure out how to do this http://pastie.org/9967958, before my syntax was type x = ref object of RootObj and it would throw errors like: http://pastie.org/9967924, still a bit confused on the ref object syntax
06:28:54koz_desktopVarriount: http://dpaste.com/2072NBF
06:29:31koz_desktopThe error is emitted from the line where I declare that range, and says 'Error: range is empty'
06:30:01Varriountkoz_desktop: What version of the compiler are you using?
06:30:08VarriountI get 'test2.nim(13, 22) Error: invalid type: 'U32Positive' in this context: 'proc (U32Positive, float32): Matrix'
06:30:08Varriount proc make_line_graph* (n : U32Positive, k : float32) : Matrix ='
06:30:59koz_desktopUmmm... wtf?
06:31:15koz_desktopVersion 0.10.2
06:33:27*sitaram joined #nim
06:33:29*sitaram quit (Changing host)
06:33:29*sitaram joined #nim
06:34:02fowlnimnoob123, so that example failed when you use MyObj = ref object of RootObj ?
06:34:08nimnoob123yep
06:34:20*saml_ quit (Quit: Leaving)
06:34:26nimnoob123i got a compiler error from the c source
06:34:37Varriountkoz_desktop: Ah. I'm using the development version.
06:35:05nimnoob123I'm on windows
06:36:07koz_desktopVarriount: So what should I do?
06:36:19koz_desktopI mean, I guess I don't have to use the type system quite so heavily, but what I'm doing *should* work, right?
06:36:54Varriountnimnoob123: What version of Nim are you using?
06:37:03nimnoob1230.10.2 iirc
06:37:19fowlnimnoob123, i tried on HEAD it works
06:37:24nimnoob123Nim Compiler Version 0.10.2 (2014-12-30) [Windows: i386]
06:37:33Varriountnimnoob123, koz_desktop: Both of your errors are due to bugs in the stable version.
06:37:48nimnoob123should i use nightly?
06:38:07Varriountnimnoob123: Yes, if you want bugfixes.
06:38:12fowlVarriount, nim should adopt a policy of renaming stable to stale after a week
06:38:14nimnoob123alright
06:38:36koz_desktopVarriount: I see. Oh well.
06:38:54Varriountkoz_desktop: I'll look into *why* nim doesn't like your code.
06:39:03*MightyJoe quit (Ping timeout: 250 seconds)
06:39:06VarriountIt's erroring, but at least its giving a slightly more sensible error.
06:39:16koz_desktopThanks Varriount.
06:41:33nimnoob123when's the next stable release expected to be released again?
06:41:43*MightyJoe joined #nim
06:41:55Varriountnimnoob123: I don't know.
06:42:27Varriountkoz_desktop: Well, it seems as if disallowing the range is intentional. I wonder why
06:42:46koz_desktopI wonder as well - it's not *that* unusual surely?
06:42:52*sitaram quit (Ping timeout: 240 seconds)
06:43:06*sitaram joined #nim
06:43:31Varriountkoz_desktop: It may be something to do with the type check.
06:44:09VarriountThe specific procedure is 'typeAllowed', in compiler/types.nim
06:44:12nimnoob123damn i wonder how many things i ran into that were just bugs, all I know is after messing with that snippet using ref's i've been left confused since then lol
06:45:38koz_desktopnimnoob123: This happens even with stable languages. I managed to find a very pernicious bug with D's standard library, all the while thinking I was insane.
06:46:06nimnoob123hehe
06:46:12fowli consider HEAD to be stable
06:46:49fowlthere has probably been hundreds of commits since the last release
06:47:39Varriountnimnoob123, koz_desktop: I consider the 'stable' releases to be markers.
06:48:08koz_desktopVarriount: I just got whatever release is in my package manager. Given that I'm on an Arch variant, I expected it was fairly recent... guess not. :P
06:48:15VarriountIt marks a point where the installers and such should be updated, and tells the world that yes, we're still alive.
06:48:43*sitaram quit (Ping timeout: 256 seconds)
06:48:46Varriountkoz_desktop: Well, I think we release at the beginning of February?
06:48:49Varriount*January
06:49:15Varriount10.0.2 is that latest stable.
06:49:19fowlit is as recent as possible for a non -git package, so
06:49:28VarriountEr, 0.10.2
06:49:32koz_desktopI see.
06:49:39koz_desktopWell, that's OK - you guys have been *very* helpful!
06:49:53*reem quit (Remote host closed the connection)
06:50:06Varriountkoz_desktop: Your error might be a flaw in that one procedure. I'm looking at it to see if I can decipher it.
06:50:33fowlkoz_desktop, i recommend bootstrapping from somewhere in ~, you can symlink the binary into PATH, easy install and removal
06:50:37nimnoob123think ill play around w/ rebuilding from github tomorrow/today (late here) when I'm a little more awake
06:51:08Varriountkoz_desktop: What happens when the ordinals of the range are different types?
06:51:20VarriountEg, uint8, int, etc
06:52:05koz_desktopI'll give it a go!
06:52:56koz_desktopVarriount: Type mismatch.
06:54:09Varriountkoz_desktop: I forgot to mention, also modify your program so that it's correct again.
06:54:26Varriountkoz_desktop: I'm trying out a fix, I'll see if it works.
06:55:20*reem joined #nim
06:56:00VarriountCan someone remind me what unsigned types are considered ordinals?
07:00:53*pregressive quit (Remote host closed the connection)
07:02:25koz_desktopI should make myself some Nim headers for my modules, lol.
07:02:28*pregressive joined #nim
07:02:32koz_desktopI guess that's why include is a thing.
07:02:33*reem quit (Remote host closed the connection)
07:04:05Varriountkoz_desktop: Sorry for the wait, my laptop shutdown unexpectedly
07:04:26koz_desktopVarriount: That happens sometimes.
07:05:52Varriountkoz_desktop: It worked! Or at least, it compiled...
07:06:26*reem joined #nim
07:06:31koz_desktop?
07:06:33koz_desktopWhat did you do?
07:07:06Varriountkoz_desktop: I added uint8, uint16, and uint32 to the set of types allowed in a range by typeAllowed
07:07:28VarriountIt compiles. Whether it works or runs is another matter.
07:07:37*Outlander quit (Ping timeout: 264 seconds)
07:07:48koz_desktopIs there a reason why those types weren't allows in ranges?
07:08:13Varriountkoz_desktop: Can you modify the code to test the range? Explicitly pass an int that is out of the range?
07:08:39koz_desktopI need to fetch the latest compiler, though, right?
07:08:45Varriountkoz_desktop: Oversight? I don't know, there aren't too many comments in the compiler source code (which is something I've been trying to improve)
07:08:58Varriountkoz_desktop: Well, I could run it for you.
07:09:06koz_desktopIf you would, that'd be great.
07:09:12koz_desktopDo you need another link to the code in question?
07:09:18Varriountkoz_desktop: But yes, you could build the latest compiler too, if it suits you (it's not all that hard)
07:09:24Varriountkoz_desktop: Yes please.
07:12:39*pregressive quit (Remote host closed the connection)
07:12:48koz_desktopVarriount: http://dpaste.com/39TCVDN
07:12:54*pregressive joined #nim
07:14:43*reem quit (Remote host closed the connection)
07:14:52Varriountkoz_desktop: Ok, it seems to work and run fine.
07:15:22koz_desktopWheeeee.
07:15:32koz_desktopExtra power through type safety!
07:16:01Varriountkoz_desktop: If you want, I can tell you what line to edit to fix the bug.
07:16:37koz_desktopVarriount: Have you already pushed the bugfix?
07:16:45koz_desktopIf so, I'll just clone it and build myself.
07:16:48*reem joined #nim
07:17:21*kapil___ joined #nim
07:18:12koz_desktopAlso, Varriount: Can you do some code review for me? I'm new to Nim, and I want to learn how I can write better. It's not a lot of code.
07:30:26Varriountkoz_desktop: You still there?
07:30:45koz_desktopI am!
07:33:58Varriountkoz_desktop: https://gist.github.com/Varriount/064333ad3ee3a996fe71
07:35:12koz_desktopAh, so doc comments go inside the proc they're documenting>
07:35:14koz_desktop?*
07:35:18VarriountYes
07:35:23koz_desktopOK, thanks!
07:35:48Varriountkoz_desktop: I also made some stylistic changes, following https://github.com/Araq/Nim/wiki/Style-Guide-for-Nim-Code
07:36:23koz_desktopI'll have a read of the style guide. Thanks very much.
07:37:29Varriountkoz_desktop: It's not mandatory (Well, except for not using T/P prefixes and tabs)
07:38:37VarriountThere are ways to get around the tab limitation, but It's not recommended - It'll increase compilation time.
07:38:50koz_desktopIt's better to stick to a style everyone recognizes.
07:41:09Varriountkoz_desktop: Just remind me, are uint16's and uint8's considered ordinal types?
07:43:13koz_desktopAccording to the documentation, 'integer types' are considered ordinal.
07:45:54*koz_ joined #nim
07:46:02Varriountkoz_desktop: I'll send out a pull request. Since this is a bugfix for the compiler, it'll have to wait until araq can review it, or otherwise gives the go-ahead
07:46:27koz_Varriount: Thanks very much. You've been incredibly helpful!
07:46:37Varriountkoz_: You're welcome.
07:55:14*pregressive quit (Remote host closed the connection)
08:06:21*brson quit (Quit: leaving)
08:16:24*sillesta joined #nim
08:33:13*Outlander joined #nim
08:37:54*nimnoob123 quit (Quit: Page closed)
08:55:24*wb quit (Ping timeout: 244 seconds)
09:01:41*kuzy000_ joined #nim
09:02:14*dumdum joined #nim
09:07:46*fizzbooze quit (Ping timeout: 255 seconds)
09:12:27*reem quit (Remote host closed the connection)
09:18:29*BlaXpirit joined #nim
09:27:02*d3m1gd joined #nim
09:29:17*reem joined #nim
09:42:08BlaXpiritI don't know how to make User defined type classes work with `var`
09:43:35BlaXpiritI have type RNG* = generic rng rng.randomUint64() is uint64 but it doesn't detect proc randomUint64*(self: var Type): uint64
09:45:14*Matthias247 joined #nim
09:46:35fowlyou mean var RNG?
09:46:53fowloh
09:47:18fowlBlaXpirit, randomuint64(var rng)
09:47:26BlaXpiritfowl, doesn't seem to work either
09:47:48BlaXpirittype RNG* = generic RNG randomUint64(var RNG) is uint64 same thing
09:49:08fowluse lowercase generic rng and var rng
09:50:00BlaXpiritsame thing
09:50:11BlaXpirithttps://bpaste.net/show/6ef5955ccc92
09:53:33fowlBlaXpirit, what is randomint()
09:53:58fowlwhen i remove it and only use randomuint64() it compiles
09:54:06BlaXpiritsomething that would be based, for example, on randomUint64
09:54:22BlaXpiritof course when you remove it then the generic is taken out of the equation
09:57:36fowlhuh ok
10:00:15fowlBlaXpirit, the problem is Xorshift128Plus is not validating for RNG, you check it like `ty is RNG`
10:01:14fowli discovered the right place to put "var" by experimenting, now it compiles https://gist.github.com/fowlmouth/89e93d498104ebcafb2e
10:01:32fowl`generic var x`
10:01:37BlaXpiritooh. thanks
10:06:43*sitaram joined #nim
10:06:43*sitaram quit (Changing host)
10:06:43*sitaram joined #nim
10:23:58*reem quit (Remote host closed the connection)
10:51:08*ob_ quit (Ping timeout: 244 seconds)
10:56:06*pregressive joined #nim
10:57:19*koz_ quit (Ping timeout: 245 seconds)
11:00:21*pregressive quit (Ping timeout: 250 seconds)
11:07:24*koz_ joined #nim
11:16:07*TEttinger quit (Ping timeout: 250 seconds)
12:18:00*Trustable joined #nim
12:22:32*Trustable quit (Remote host closed the connection)
12:28:41*Trustable joined #nim
12:35:42*koz_ quit (Ping timeout: 245 seconds)
12:50:33*wb joined #nim
13:01:38*d3m1gd quit (Quit: WeeChat 1.1.1)
13:07:16*renesac left #nim (#nim)
13:10:37*pafmaf joined #nim
13:21:55*darkf quit (Quit: Leaving)
13:25:26*reem joined #nim
13:29:45*reem quit (Ping timeout: 244 seconds)
13:47:44*ob_ joined #nim
13:52:07*ob_ quit (Ping timeout: 250 seconds)
14:07:39*chemist69 joined #nim
14:09:21*sitaram left #nim (#nim)
14:11:17*dumdum quit (Ping timeout: 256 seconds)
14:18:05*RayoGundead quit (Quit: Page closed)
14:19:24*saml_ joined #nim
14:28:23*BlaXpirit quit (Quit: Quit Konversation)
14:34:57*pafmaf_ joined #nim
14:35:13*pafmaf quit (Ping timeout: 264 seconds)
14:35:30*BlaXpirit joined #nim
14:50:52*BlaXpirit-UA joined #nim
14:53:52*BlaXpirit quit (Ping timeout: 240 seconds)
15:30:43*dyu joined #nim
15:42:08*dumdum joined #nim
15:44:15*akiradeveloper joined #nim
15:46:46*ob_ joined #nim
15:48:21akiradeveloperlogging module hides handlers variable in devel...
15:49:02dom96akiradeveloper: Yeah, you should use addHandler now.
15:49:05akiradeveloperplease at least add addHandler() in master branch before go forward. build failure is painful
15:49:16akiradevelopermaster branch doesn't have it
15:50:14dom96You can check for the existance of the variable with 'when declared(handlers)'
15:51:22akiradeveloperI see
16:07:59*pregressive joined #nim
16:08:14*pregressive quit (Remote host closed the connection)
16:17:57*gsingh93 joined #nim
16:20:11*pregressive joined #nim
16:24:49*nande joined #nim
16:29:49*gsingh93 quit (Ping timeout: 264 seconds)
16:45:35ekarlsodom96: is tehre a way atm to tell nimble which directory to use ?
16:45:57dom96directory for what?
16:46:04ekarlsoinstall packages
16:47:14*perturbation joined #nim
16:47:17*Matthias247 quit (Ping timeout: 246 seconds)
16:50:47*kernasi joined #nim
16:50:49kernasihi
16:51:37dom96ekarlso: You can change it in Nimble's config.
16:52:00dom96https://github.com/nim-lang/nimble#configuration
16:57:37*pregress_ joined #nim
17:00:29*pregressive quit (Ping timeout: 252 seconds)
17:06:30*BitPuffin joined #nim
17:12:50*pregressive joined #nim
17:13:14*akiradeveloper quit ()
17:16:02*pregress_ quit (Ping timeout: 252 seconds)
17:20:49*Boscop_ quit (Ping timeout: 250 seconds)
17:21:52*[CBR]Unspoken quit (Ping timeout: 240 seconds)
17:26:52*[CBR]Unspoken joined #nim
17:28:36*kernasi__ joined #nim
17:31:55*davidhq joined #nim
17:32:31*kernasi quit (Ping timeout: 250 seconds)
17:38:28*pregressive quit (Remote host closed the connection)
17:39:18*kernasi__ quit (Ping timeout: 244 seconds)
17:40:08*Boscop joined #nim
17:41:50*kernasi joined #nim
17:43:57*pregressive joined #nim
17:46:23*Boscop quit (Ping timeout: 265 seconds)
17:54:09*quasinoxen joined #nim
18:01:38*Cykacykacyka joined #nim
18:02:22Cykacykacykahello, is there a nice tutorial on asynchttpserv ? I am at a loss, I can't even understand where do I manage the posted data, where do I check the requested url.
18:03:40dom96Cykacykacyka: No tutorials as far as I know. All of what you need is stored inside this object: http://nim-lang.org/asynchttpserver.html#Request
18:04:22dom96You most likely want to use Jester though: https://github.com/dom96/jester
18:04:45Cykacykacykawill look into that
18:05:19Cykacykacykayes, seems like it would suit my usecase the most. Considering this is a hackathon and i've got ~18 hours to go
18:06:13dom96Cykacykacyka: oh cool. What hackathon is this?
18:07:12*pregressive quit (Remote host closed the connection)
18:10:19*UberLambda joined #nim
18:10:26kernasisecret hackathon
18:11:54Cykacykacykadom96, stacshack
18:12:19Cykacykacykahmm, Jester seems really http oriented, I'm mostly going to use this server to push json back and forth
18:12:35kernasiso?
18:13:02Cykacykacykaso I must just respond with a jsonified string ? ok.
18:13:28kernasihttp isn't really picky about what you send and receiver :)
18:13:32Cykacykacykabeing the inexperienced person I am, I would have to do all my DB stuff in a different thread ?
18:13:32dom96Cykacykacyka: Why were you looking at asynchttpserver in the first place then?
18:13:33kernasi-r
18:14:04Cykacykacykadom96, it's asynchronous, it's http, didn't really think I'd need much more than that.
18:14:18dom96nah, just let it block, it shouldn't affect performance that much if the db is local.
18:14:32Cykacykacykaok then
18:15:02flaviuAnd it's a hackathon.
18:15:09CykacykacykaI'm guessing the mongodb library isn't well documented is it ?
18:15:45flaviuSo your last worries are performance and clean code. Do whatever takes you the least time to implemnt
18:16:30kernasitime for a schnaps
18:16:51Cykacykacykawell, hopefully you here are patient, as I intend to use this hackathon exclusively to do things I've never done before, e.g. nim, web and mongo
18:17:19kernasiprobably the best channel you can find for nim
18:17:45CykacykacykaI'd believe so.
18:18:02kernasiand now with schnaps in the blood...
18:18:05kernasi:)
18:29:34*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
18:29:49*panzone joined #nim
18:31:05*hasenj joined #nim
18:41:08*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
18:43:32gokrdom96: Sidenote - the HyperDex db client C library is designed asynchronously.
18:43:44gokrThe one I played with in my "Wrapping C" article.
18:50:44Cykacykacykagokr, I've rarely understood how a basic sql/nosql database would handle concurrency. This of course is me being stupid, but wouldn't checking for race conditions/conflicts be too big of a perf penalty to allow concurrency ?
18:56:40gokrEhm, there are plenty of techniques. But the reason for me mentioning the HyperDex db as an interesting option for Dominik is that it has a fully asynchronous client C library. None of the calls into it are blocking.
18:56:42*fizzbooze joined #nim
18:58:22perturbationMost of the time (e.g. with node.js) you get away with this by being concurrent, but not parallel... as gokr says, it's not blocking, so the main event loop can continue to listen/respond to requests while you wait on the DB to respond with JSON/XML/whatever
18:59:04perturbationbut (with node.js, not sure how asynchttpserver works), it's only ever doing one thing at a time, so there aren't race conditions
19:00:01perturbation</parallelism vs concurrency rant>
19:00:24gokrBasically every request to the HyperDex db - gives you back a receipt immediately. Then when you get responses back you need to match it to the right request via the receipt.
19:09:37Cykacykacykagokr, so, the requests can be 'concurrent/paralell', but they are dealt with one at a time ?
19:13:24*dyu quit (Quit: Leaving)
19:20:57Cykacykacykahmm, why does jester say bad gateway when I post to "/stuff" if I've defined post "/stuff"
19:25:13*panzone quit (Ping timeout: 256 seconds)
19:25:19*panzone joined #nim
19:27:14dom96Cykacykacyka: Does your route use 'resp' to respond to the request?
19:28:44Cykacykacykayes
19:29:09Cykacykacykamaybe it never gets to respond, because I'm trying to parse json from the request body ?
19:31:49Cykacykacykayes, I am failing to var push = parseJson(@"payload")
19:32:49*panzone quit (Ping timeout: 255 seconds)
19:33:09dom96perhaps
19:33:30dom96does it give you a stack trace in the response?
19:33:41Cykacykacykayes, that was exactly that, the client wasn't sending any valid json at all
19:33:42*panzone joined #nim
19:34:09Cykacykacykaor actually anything, due to No 'Access-Control-Allow-Origin' header
19:35:37*perturbation quit (Ping timeout: 265 seconds)
19:35:46*alexruf joined #nim
19:35:56*UberLambda quit (Quit: Leaving the Matrix)
19:35:56*koz_ joined #nim
19:37:40VarriountMeep
19:39:07VarriountCykacykacyka: When's the hackathon?
19:51:30ekarlsodoes nim support something like compile upon file change ?
19:51:43*reem joined #nim
19:51:48Varriountekarlso: Do you mean hotswapping code?
19:52:10Varriountekarlso: Or just detecting when a file changes and recompiling?
19:52:11ekarlsoVarriount: like nim c --reload
19:52:13ekarlsoor smth
19:52:16ekarlsothe last :)
19:52:54Varriountekarlso: No, not at the moment, although I'm willing to bet that there are external tools that will run a command when a set of files has been altered.
19:53:08ekarlsoVarriount: like ?
19:53:13kernasion linux inotify
19:53:40kernasior just a small script that runs forever :)
19:53:44ekarlso:P
19:55:42kernasior tell your editor to execute a makefile or script on save
19:56:03ekarlsohmmm
19:56:07ekarlsoisn'nt there caas ?
19:57:49kernasicaas? :)
19:57:54kernasic as a service?
19:58:08ekarlsocompiler as a service
19:58:19kernasioh
19:58:32ekarlsois there any docs on that Varriount ?
20:01:26Varriountekarlso: There are, but I don't recall any compilation-on-save feature.
20:01:42Varriountekarlso: Again, that's usually something an editor or external tool does.
20:02:13Varriount'Watching' files for changes is a nontrivial task.
20:05:27*dumdum quit (Ping timeout: 256 seconds)
20:07:21*Gonzih joined #nim
20:07:28Varriountekarlso: What OS are you using?
20:08:23ekarlsoVarriount: linux
20:09:14Varriountekarlso: http://superuser.com/questions/181517/how-to-execute-a-command-whenever-a-file-changes
20:09:36kernasioh, inotify again
20:09:42kernasilisten to me, ekarlso :)
20:11:32onionhammervarriount i was talking about a quick way to switch backend compiler
20:11:38onionhammerin nimlime
20:11:44ekarlsosomeone should seriously add CI ...
20:11:46ekarlsolib/windows/winlean.nim(76, 19) Error: undeclared identifier: 'TUtf16Char'
20:11:49ekarlsodevel is borked
20:13:23*panzone quit (Ping timeout: 256 seconds)
20:13:27Varriountekarlso: Just pushed a fix for that.
20:13:44ekarlso:p
20:13:59*panzone joined #nim
20:14:01Varriountekarlso: We have CI
20:14:18ekarlsoVarriount: then why is stuff like this getting merged ? :P
20:14:29ekarlsonot first time i've seen it :/
20:14:49Varriountekarlso: Because the CI runs *after* commits have been made, and I can't help it when people push directly to the repo.
20:14:50Varriounthttp://buildbot.nim-lang.org/waterfall
20:15:08Varriountekarlso: We don't have fancy Travis CI support that will test PR's for us.
20:15:09ekarlsosounds like you should start using something like gerrit or so instead :P
20:15:31ekarlsoVarriount: checked out http://gerrithub.io?
20:17:10*pipeep quit (Ping timeout: 252 seconds)
20:17:17Varriountekarlso: Does the new commit fix things?
20:18:08ekarlsoVarriount: seems so : )
20:18:41Varriountekarlso: Could you test something for me? Try compiling a non-empty nim file with the C++ backend.
20:18:56*pipeep joined #nim
20:19:08ekarlsouh, gimme a few
20:21:10ekarlsoVarriount: trying to get play working :)
20:24:42*BlaXpirit-UA quit (Remote host closed the connection)
20:25:39ekarlsoany of you good at c ?
20:25:58koz_ekarlso: I'm not bad.
20:26:20ekarlsolooking for someone that could look at playpen and add user_ns support
20:26:24*BlaXpirit joined #nim
20:26:50koz_ekarlso: Well, I'm not really sure I'd be the right person for that particular job.
20:27:13ekarlso;P
20:28:14*jholland joined #nim
20:29:17*reem quit (Remote host closed the connection)
20:30:06*reem joined #nim
20:30:21*saml_ quit (Ping timeout: 250 seconds)
20:40:05*alexruf quit (Quit: Textual IRC Client: www.textualapp.com)
20:41:05*kernasi quit (Ping timeout: 246 seconds)
20:41:46*bjz joined #nim
20:44:21*brson joined #nim
20:50:38CykacykacykaVarriount, it's now.
20:51:55*gokr_ joined #nim
21:01:17ekarlsoCykacykacyka: what hackathon ?
21:01:55Cykacykacykastacshack, basically a shameless atempt by major companies to employ good students whilst offering free food
21:02:26Cykacykacykawhich I am exploiting by not being a good student and eating as much as I can.
21:10:02*pregress_ joined #nim
21:11:03flaviuhaha
21:14:23*pregress_ quit (Client Quit)
21:23:32VarriountCykacykacyka: Oh good. I was going to say "I hope that it's during a time when this channel is active"
21:26:40*ob_ quit (Ping timeout: 255 seconds)
21:43:17*dumdum joined #nim
21:50:30*hasenj quit (Quit: hasenj)
21:51:09*reem quit (Remote host closed the connection)
21:53:24*gokr_ quit (Quit: IRC for Sailfish 0.9)
21:57:49*reem joined #nim
21:59:00*hasenj joined #nim
21:59:02*hasenj quit (Client Quit)
22:01:35VarriountAraq: C++ compilation is broken. I'm almost done finding the breaking commit.
22:03:40VarriountAraq: It's commit 45a2c1b1d1f18aedeb363b9ef41f9f73b028b581
22:06:59*reem quit (Remote host closed the connection)
22:15:28*shodan45 joined #nim
22:19:32VarriountAraq: Or this url: https://github.com/Araq/Nim/commit/45a2c1b1d1f18aedeb363b9ef41f9f73b028b581
22:25:02VarriountIn fact, I don't quite understand a lot of what's in there...
22:30:17*johnsoft quit (Ping timeout: 245 seconds)
22:30:34*johnsoft joined #nim
22:31:49Cykacykacykahmm, is there a way I can spawn a 'thread' every some seconds ? Or would it be best to just run a while loop that would sleep for 30 seconds and repeat ? Also, it would be relatively safe to block on sqlite operations, right ?
22:35:53*Cykacykacyka quit (Remote host closed the connection)
22:36:07*emils_ joined #nim
22:36:19*emils_ is now known as Cykacykacyka
22:40:02*reem joined #nim
22:43:43VarriountCykacykacyka: What are you aiming to do?
22:44:23VarriountCykacykacyka: http://nim-lang.org/threads.html
22:44:54*filwit joined #nim
22:49:43*panzone quit (Remote host closed the connection)
22:50:45*brson quit (Quit: leaving)
22:50:46*ob_ joined #nim
22:53:19dom96Cykacykacyka: Just a warning: there is currently a bug which prevents mixing of threads and async await.
22:54:47*shodan45 quit (Quit: Konversation terminated!)
23:03:04*reem quit (Remote host closed the connection)
23:03:21*brson joined #nim
23:07:21*dumdum quit (Ping timeout: 256 seconds)
23:07:34*reem joined #nim
23:08:53CykacykacykaVarriount, I have to check ever so often whether an user is late or not. Of course, I may as well just do that every time the client checks back.
23:09:11Cykacykacykadom96, I'm guessing I won't be using threads then/
23:09:49dom96Cykacykacyka: You can do that using async
23:10:37Cykacykacykaalso, what am I doing wrong here ? I do a let init_sql = open('path/to/text.sql').readAll() and then exec(db, sql(init_sql), []) complains that sql has been passed a file, not a string
23:10:52Cykacykacykawell, we have to get to actual interaction with clients :)
23:11:07filwitdom96: hey i started porting my NimKate colors to Aporia. Was going to give you PR tonight but looks like I need to take off now. Just wanted to ask one thing first though: I'm going to port the colors from the website (the ones on the banner) to Aporia as well.. any idea on what we call it (since those weren't copied from any existing color schema)? :)
23:11:47dom96Cykacykacyka: You should use readFile instead.
23:12:15dom96filwit: No idea. I'm bad at names :P
23:12:49*reem quit (Remote host closed the connection)
23:13:01Cykacykacykadom96, yes, just found out that method. How do you deal with namespaces ?
23:13:17Cykacykacykaif I want to use open in the same file for both opening a database and a file ?
23:13:31filwithmm... well i want to name is something cool (cause it's like the main Nim colors new people will see.. and I was even hoping to make it Aporia's default scheme, if that was cool with you)
23:13:57dom96filwit: I wanna keep my theme default.
23:14:07filwitdom96: okay
23:14:17VarriountCykacykacyka: You can reference the module name
23:14:21dom96Cykacykacyka: Use the module names.
23:14:28filwitdom96: i guess i'll just name it like 'nimsite' or something... that just sounded a bit bland
23:14:33BlaXpiritcan I use gcc builtins in nim?
23:14:51filwitdom96: anyways, just thought I'd see if you had any good ideas on what to call it. Later.
23:15:26*kuzy000_ quit (Ping timeout: 264 seconds)
23:15:52Cykacykacykaok, how then I create a connection to my sqlite 'file' ?
23:15:52*filwit quit (Quit: Leaving)
23:17:32*wb_ joined #nim
23:17:48dom96http://nim-lang.org/db_sqlite.html#open,string,string,string,string
23:18:22ekarlsowhat stuff again to use for calling external cmd ?
23:18:56Cykacykacykaman, I should've imported db_sqlite a long time ago, from where did I even get an idea to use import sqlite3...
23:19:02*mal`` quit (Ping timeout: 252 seconds)
23:20:14dom96ekarlso: osproc
23:20:29*wb quit (Ping timeout: 250 seconds)
23:21:38*mal`` joined #nim
23:23:30Cykacykacykawhat's the fastest way to define a new module?
23:25:41*sillesta quit (Ping timeout: 265 seconds)
23:25:52BlaXpiritself-answer: trivially: proc clz(n: culong): cint {.importc: "__builtin_clzl".}
23:28:34BlaXpiritthe real question is how to use it and provide a fallback if it is absent
23:29:44*sillesta joined #nim
23:33:41dom96Cykacykacyka: create a new file
23:34:33*miko_ joined #nim
23:35:03*reem joined #nim
23:36:47miko_I have a question with regard to the design of he syntax. Why does nim (like python) have a ":" before every most indentation? (i.e. after control structures?) They seem superfluous.
23:38:25BlaXpiritmiko_, http://forum.nim-lang.org/t/676
23:39:43miko_So I'm not the only one wondering, and it has a reason.
23:39:45miko_Thanks
23:41:32flaviuBlaXpirit: https://en.wikipedia.org/wiki/Find_first_set
23:43:26fowllol some people think coffeescript is readable
23:43:42BlaXpiritwell it is
23:44:53fowlsee
23:45:18fowlits not really comparable to nim
23:45:51fowlsyntax doesnt contain as much information (types)
23:46:26*banister joined #nim
23:46:39*banister quit (Max SendQ exceeded)
23:48:01*banister joined #nim
23:48:12*banister quit (Max SendQ exceeded)
23:48:20*pafmaf_ quit (Quit: Verlassend)
23:50:50*BitPuffin quit (Ping timeout: 246 seconds)
23:51:47*reem quit (Remote host closed the connection)
23:52:32*reem joined #nim
23:54:36*banister joined #nim
23:56:57*reem quit (Ping timeout: 245 seconds)