<< 15-08-2017 >>

00:01:09*Xe quit (Changing host)
00:01:09*Xe joined #nim
00:01:32*kunev quit (Ping timeout: 240 seconds)
00:01:35*yglukhov joined #nim
00:02:37*kunev joined #nim
00:03:36*flyx joined #nim
00:03:58*euantor is now known as Guest85972
00:03:59*Pisuke is now known as Guest3423
00:04:23*byte512 joined #nim
00:04:24*pydsigner joined #nim
00:04:46*m712 joined #nim
00:05:48*yglukhov quit (Ping timeout: 240 seconds)
00:10:37*Jipok[m] joined #nim
00:11:24*smt joined #nim
00:12:27*smt_ joined #nim
00:14:57*smt` quit (Ping timeout: 248 seconds)
00:16:37*smt quit (Ping timeout: 260 seconds)
00:16:51*MrAxilus[m] joined #nim
00:16:52*ehmry joined #nim
00:16:52*dyce[m] joined #nim
00:16:52*Demos[m] joined #nim
00:16:59*hohlerde joined #nim
00:16:59*TheManiac joined #nim
00:16:59*jivank[m] joined #nim
00:16:59*mindB joined #nim
00:29:59*smt joined #nim
00:33:31*smt_ quit (Ping timeout: 246 seconds)
00:42:41*sz0 quit (Quit: Connection closed for inactivity)
00:49:24*def-pri-pub joined #nim
01:00:51Elronndwtf does this nimble warning mean? "Warning: File inside package 'goodbot' is outside of permitted namespace, should be named 'goodbot.nim' but was named 'logging.nim' instead. This will be an error in the future." I *have* a file named goodbot.nim, and it imports logging.nim. Why tf should that be an issue?
01:15:45*maxcroud joined #nim
01:16:44maxcroudnim.fun domain is available for $4.99, renewal: $24.99. Just so ;)
01:16:52*maxcroud left #nim (#nim)
01:25:27*ShalokShalom quit (Ping timeout: 240 seconds)
01:37:25*def-pri-pub quit (Quit: leaving)
01:38:25*onionhammer quit (Quit: WeeChat 1.7)
01:50:40*couven92 quit (Read error: Connection reset by peer)
01:51:43*pilne joined #nim
01:55:10*chemist69 quit (Ping timeout: 240 seconds)
01:56:17*onionhammer joined #nim
02:09:09*chemist69 joined #nim
02:40:39FromGitter<brentp> hi, if I define a type like: `Op* = uint32` and then define an exported `$` on Op, then it seems to try to use that `$` method for all uint32's even if I haven't defined them as Ops. Is there a way to get around this?
02:44:00*Kingsqueee quit (Quit: https://i.imgur.com/qicT3GK.gif)
02:46:16FromGitter<brentp> the specific error I get is
02:46:20FromGitter<brentp> ``````
02:46:23FromGitter<brentp> Error: ambiguous call; both system.$(x: uint64) and hts.$(o: Op) match for: (uint8)
02:49:57*def-pri-pub joined #nim
02:49:57*def-pri-pub quit (Changing host)
02:49:57*def-pri-pub joined #nim
02:50:37def-pri-pubzacharycarter: not sure if you're here or AFK right now, but I posted the spec for the ZSPrite as a merge request. If it looks good to you, can you add it in? Otherwise, tell me what's off and we can work on a better design.
02:50:58*Kingsquee joined #nim
02:50:59def-pri-pubWhat I think I have right now should suit 99% of the needs for simple animated sprites at the moment.
02:57:24*pilne quit (Quit: Quitting!)
03:05:04raussIn a concept, is there a difference between `x is Type` and `x of Type`? The docs say `is` but `of` is used everywhere else for type checking AFAICT
03:09:32*endragor joined #nim
03:22:43*def-pri-pub quit (Quit: leaving)
03:48:26*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
04:07:22*MrAxilus[m] quit (Ping timeout: 276 seconds)
04:19:08*MrAxilus[m] joined #nim
04:28:22*v17d joined #nim
04:35:27*dankrad joined #nim
05:00:49*v17d quit (Remote host closed the connection)
05:02:22*v17d joined #nim
05:29:34*haha_ joined #nim
05:36:30*dankrad quit (Ping timeout: 240 seconds)
05:42:30*ShalokShalom joined #nim
06:04:33*solitude joined #nim
06:10:45*Vladar joined #nim
06:23:45*haha_ quit (Quit: haha_)
06:24:28*rauss quit (Quit: WeeChat 1.9)
06:24:46*yglukhov joined #nim
06:31:30*nsf joined #nim
06:31:30*yglukhov quit (Remote host closed the connection)
06:32:37*ShalokShalom_ joined #nim
06:35:16*ShalokShalom quit (Ping timeout: 240 seconds)
06:40:04*ibutra joined #nim
06:41:57*solitude quit (Ping timeout: 240 seconds)
06:42:12*solitude joined #nim
06:49:51*Arrrr joined #nim
06:51:24*gangstacat joined #nim
07:06:07*v17d quit (Ping timeout: 260 seconds)
07:08:06*haha_ joined #nim
07:09:59*haha_ quit (Client Quit)
07:12:55*v17d joined #nim
07:18:37*mahmudov joined #nim
07:25:27*yglukhov joined #nim
07:27:46*gokr joined #nim
07:28:49*yglukhov quit (Remote host closed the connection)
07:29:01*yglukhov joined #nim
07:37:14Araqbrentp: use a distinct type?
07:41:15*scriptum quit (Quit: Leaving)
08:08:20*salewski joined #nim
08:10:12salewskiAraq, you pointed me recently to the sameType() function for use in macros to test for exact same types.
08:10:48salewskiIs there something like the "of" operator which can be used in macros?
08:12:16salewskiI think for some signals with not uniq names and different parameter list I will use such a test in the macro.
08:12:35*ShalokShalom_ is now known as ShalokShalom
08:12:51*ShalokShalom quit (Remote host closed the connection)
08:13:32salewskiSo when button is a subtype of widget, and user passes a Button type, I would have to recognize that it is "of" type Widget.
08:14:23salewskiTHat is necessary only for a few signals, but I can not really avoid it.
08:15:51salewskiMaybe I can use somethink like "when compiles()" in the macro, doing an assignment in the passed arguments.
08:16:16salewskiWhen it compiles, then types are compatible.
08:25:57Araquhh, macro's getType does give you supertype information already
08:26:40Araqt[0] or t[1] gives the super type that you can that check against Buttton. sorry, forgot the details but it's possible
08:29:29salewskiOh, that is interesting. Will test that, thanks.
08:33:28*salewski quit (Quit: WeeChat 1.4)
08:42:01*Jipok joined #nim
08:43:05JipokHey. I have a pointer to the C array. How do I convert this to nim array/seq?
08:45:23JipokI tried cast[seq[uint8]](pixels), and got "index out of bounds [IndexError]"
08:45:38FromGitter<zacharycarter> @define-private-public sorry yesterday was a wash for me I'll have more time today to review issues / prs
08:46:51yglukhovJipok: var mySeq = newSeq[MyType](myLen); memCopy(addr mySeq[0], myCArray, myLen * sizeof(MyType)
08:46:58yglukhov* copyMeme
08:47:02yglukhov* copyMem
08:47:20Jipokwow
08:48:37JipokIt does not look good
08:49:15JipokI get a copy?
08:49:37yglukhovyup
08:49:42yglukhovdon't you want to?
08:50:16*dom96|w joined #nim
08:50:31JipokYes, I need to change the array
08:50:50yglukhovyou can use {.unchecked.} array then
08:51:01yglukhovgrep the manual for {.unchecked.}
08:51:47JipokI tried, but it seemed to do it wrong
08:53:05JipokI have to declare my type and then cast array to him?
08:53:06*Guest85972 is now known as euantor
08:53:36*euantor is now known as Guest30533
08:54:07yglukhovyup, smth like that, don't remember exactly
08:56:21Jipokso, i tried "var data: ArrayPart = surf.pixels"
08:56:31Jipokbut got type mismatch: got (pointer) but expected 'ArrayPart = array[0..0, int]'
08:56:37yglukhovcast?
08:57:14Jipoktype mismatch: got (ptr ArrayPart) but expected 'ArrayPart = array[0..0, uint8]'
08:57:27Jipokoh
08:57:33JipokError: expression cannot be cast to ArrayPart
08:59:05Jipokcan I simply change the value of the pointer and get data at its address?
08:59:12yglukhovtype MyArr {.unchecked.} = array[0 .. 0, int]
08:59:17yglukhovvar a: ptr int
08:59:21yglukhovvar arr = cast[MyArr](a)
08:59:25yglukhovworks for me
08:59:53Jipokhmm
08:59:57Jipokptr int
09:00:02Jipokbut i have just pointer
09:00:26yglukhovwell, cast it to (ptr T) before casting to array
09:01:25Araqactually an unchecked array is still an *array* and you want a pointer to it
09:01:36yglukhovalso note that 0 .. 0 might not be a valid range for you, because range checks are done in compile time afaik
09:01:59Araqyglukhov: that's apparently not a problem anymore
09:02:11yglukhovoh, cool
09:02:44JipokAraq, how i can do it?
09:04:57Jipokyglukhov: "cast it to (ptr T)" not works too
09:05:42yglukhovJipok: which nim version are using btw?
09:05:55yglukhovactually i can cast pointer directly to array
09:05:59yglukhovwith no errors
09:06:10yglukhovhaven't tested it in runtime though
09:06:10yglukhov=)
09:07:16Jipoklast stable
09:07:32Jipok0.17.0 (2017-05-17)
09:07:59Araqtype MyArr {.unchecked.} = array[0 .. 0, int]
09:08:45Araqvar view = cast[ptr MyArr](data)
09:09:08Araqand then use view[i] etc
09:10:23yglukhovAraq: will `var view = cast[ptr MyArr](data)[]` (note deref) produce the same code?
09:10:56JipokWell at least now it is compiled
09:11:24yglukhovi think devel is already too far away from 0.17...
09:11:44Araqwell the deref produces an array copy
09:11:58yglukhovhow would it copy an unchecked arary?
09:11:58Araqand the compiler cannot copy it becuase it doesn't know the size
09:12:08yglukhovok
09:12:14Araqwell it would do something ... crazy
09:12:18yglukhov=)
09:12:26Araqlike copying an array with 1 element in it
09:13:07Araqin retrospect .unchecked is kind of messy
09:13:38yglukhovmaybe zielmicha's views will kick in at come point?..
09:16:02Araqnot sure I like it, yes at least you don't lie to the compiler but it introduced a new kind of type into the language via some innocent pragma
09:16:11Araqa type of "unknown" size.
09:16:25AraqNim doesn't have these
09:17:12yglukhovtype of "unknown" size? how come? isn't it just a wrapper to some buffer?
09:17:26yglukhovwith internal pointer/ref to the buffer
09:17:27Araqan unchecked array is a type of unknown size
09:17:37Araqso every copy operation must be prevented
09:17:44yglukhovah that one is.
09:18:05yglukhovi was talking about zielmicha's views =)
09:19:18yglukhovgitter-irc bot is somewhat lagging...
09:20:23yglukhovtest
09:20:36FromGitter<yglukhov> test
09:20:50yglukhovnevermind, looks ok now.
09:22:34*Tiberium joined #nim
09:39:09*Jipok quit (Quit: Page closed)
09:39:20*couven92 joined #nim
09:40:46Jipok[m]Thanks to everyone, finally I was able to do it
09:40:53Jipok[m]https://i.imgur.com/oQwh7kb.png
09:48:53*dddddd quit (Remote host closed the connection)
09:59:12TiberiumJipok[m], well, will you make a PR to nimgame2 ? :)
10:01:37*crem quit (Ping timeout: 276 seconds)
10:01:54dom96|wAraq: This might be of interest: https://news.ycombinator.com/item?id=15016083
10:03:06*haha_ joined #nim
10:03:12Araqnim's GC is based on this paper
10:03:20Araqor at least earlier versions were
10:07:40*Guest30533 is now known as euantor
10:07:54*euantor quit (Changing host)
10:07:54*euantor joined #nim
10:09:42ArrrrMmm i was under the impression new was a reserved word
10:10:49*gangstacat quit (Quit: Leaving)
10:10:50Tiberiumit's a proc AFAIK
10:10:56euantorLooks like the website for that Dao programming language was brought grinding to a halt by HN
10:11:28Tiberiumhow to find it in google?dao lang doesn't give any results :)
10:11:35Tiberiumah, dao programming language
10:11:51Tiberiumit's written entirely in C
10:13:01Tiberiumwell it looks like it's a VERY new language
10:13:22dom96|wAraq: cool
10:14:17Tiberiumoh wait i'm wrong
10:14:31Tiberiumcurrent dao development began in 2006
10:21:04*dddddd joined #nim
10:26:33Tiberiumis there any way to check current directory at compile-time? in a macro
10:27:59AraqTiberium: dirExists works at compiletime iirc
10:28:13Tiberiumthanks, this is exactly that I need!
10:34:38Tiberiumyeah, works
10:47:06Araqdom96|w: it's also wrong btw
10:47:16Araqthat paper has a bug ;-)
10:47:21Araqa big one, in fact
10:50:58*tankfeeder quit (Quit: Connection closed for inactivity)
10:52:57*haha_ quit (Quit: haha_)
10:54:10Tiberiumbtw, AsyncHttpServer is very stable, it didn't crash even after 10 days of working (but most of the time it was idle)
10:54:17Tiberiumalso for now I need to use nginx for SSL
10:56:22*mal`` quit (Quit: Leaving)
10:57:42subsetparkHard not to. We should really have a wsgi protocol implementation
10:58:48Tiberiumwell I wanted to have something built-in in jester or asynchttpserver for SSL (it's easier to use SSL this way for testing)
10:59:11TiberiumI know that for production you shouldn't use built-in SSL
11:02:22*tankfeeder joined #nim
11:22:31*couven92 quit (Quit: Client disconnecting)
11:26:14*mal`` joined #nim
11:35:27*dave24 quit (Ping timeout: 240 seconds)
11:35:44*couven92 joined #nim
11:35:59*dave24 joined #nim
11:44:20*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:44:56*haha_ joined #nim
11:47:35FromGitter<yglukhov> Tiberium: we're using it on prod, and did a stress test to it with 30k simultaneous "users", no problems there
11:47:46Tiberiumyeah, that's the good thing :)
11:47:48FromGitter<yglukhov> 1) without ssl
11:47:57TiberiumI use it for vk.com Callback API
11:48:14Jipok[m]some noob question. how to concatenate two strings?
11:48:20TiberiumJipok[m], "a" & "b"
11:48:29Jipok[m]why not +?
11:48:30FromGitter<yglukhov> however, there is one tiny. it may go out of sockets on accept, and will raise, and stop listening.
11:48:51TiberiumJipok[m], because explicit is better than implicit? :)
11:49:02Tiberiume.g. it's better to have separate operator for strings
11:49:06Tiberiumwell, don't ask me
11:49:12TiberiumI don't know actually
11:49:44yglukhovbecause "+" comes from math? and match doesn't know how to add strings? =)
11:51:05FromGitter<Sud0nim> If you really want to use + you can just overload the operator:
11:51:06FromGitter<Sud0nim> proc `+`(a,b: string): string = a & b
11:51:42Tiberiumtemplate is better maybe?
11:51:53Tiberiumbecause someone can add & to their type
11:52:15Tiberiumtemplate `+`(a, b: untyped): untyped = a & b
11:52:17FromGitter<Sud0nim> Fair enough, but either way I think using & is better
11:52:20Tiberiumyeah
11:56:20*ibutra_ joined #nim
11:58:13*ibutra_ quit (Client Quit)
11:58:21*ibutra_ joined #nim
11:58:21*ibutra_ quit (Client Quit)
11:58:48*ibutra_ joined #nim
11:59:53FromGitter<Sud0nim> Hmm, maybe I should convert most of my proc overloading to templates for performance reasons... Still learning a lot
12:00:16Tiberiumwell you can use "inline" too
12:00:27FromGitter<Sud0nim> {.inline.} ?
12:00:29Tiberiumyes
12:00:30Tiberiumtemplates are better because you don't need generic procedures
12:00:33*ibutra quit (Ping timeout: 248 seconds)
12:00:44Tiberiumif you're overloading operator which is used for many types
12:01:33FromGitter<Sud0nim> Yes I think they feel cleaner to me also looking at the code also, rather than pragmas which I don't like so much aesthetically
12:02:09*ScherzkeCks joined #nim
12:03:38*kalexm joined #nim
12:04:49*ibutra_ quit (Ping timeout: 248 seconds)
12:07:29*ScherzkeCks quit (Quit: Leaving)
12:10:37*arnetheduck joined #nim
12:13:57Demos[m]idk I'd keep em generic
12:14:12Demos[m]since generics are less powerful and participating in overload resolution is nice
12:14:22Demos[m]there is no runtime perf difference
12:14:37Demos[m]and probably not much of a compile time one
12:15:26*ScherzkeCks joined #nim
12:15:28*ScherzkeCks quit (Client Quit)
12:15:50*ibutra joined #nim
12:17:13*dom96|w joined #nim
12:17:24TiberiumDemos[m], well with generics a function is generated for every type on which this generic proc is called
12:17:47Tiberiumyou can see this in C code
12:17:50Demos[m]yeah, but that's not a huge problem
12:18:29Demos[m]you can probably have many thousands of instantiations before it becomes noticible compile time wise
12:18:33Demos[m]and runtime shrug
12:18:34Tiberiumwell I think with millions of calls there would be a small performance difference :)
12:18:36*pwntus_ is now known as pwntus
12:18:45Demos[m]but it's not millions of calls
12:18:54*pwntus quit (Changing host)
12:18:54*pwntus joined #nim
12:18:57Demos[m]the worst it could be is I$ thrashing
12:19:28Demos[m](also for most operators you need different code (assembly) for different types
12:19:37Demos[m]and the cost of using dynamic methods to do that is more
12:19:43Demos[m]since then everything must be the same size
12:19:54Demos[m]which implies heap allocations and whatnot
12:23:32Tiberiumlol wat
12:23:33Tiberium"template" 71.68ns 13.95M
12:23:33Tiberium"proc" 71.17ns 14.05M
12:23:45Tiberium13.95 and 14.05 is iters/s
12:23:50Demos[m]yeah
12:23:51Demos[m]same speed
12:23:55Tiberiumwhy proc is faster?
12:23:58Tiberiuma little bit
12:24:02Demos[m]is million iters per second
12:24:04Demos[m]?
12:24:09Demos[m]umm just slightly different codegen
12:24:12Tiberiumyes
12:24:17Tiberiumah
12:24:21Demos[m]maybe one of the instantiations allowed something to be optimized out
12:24:24Tiberiumwell
12:24:32Tiberiumwell
12:24:34Tiberiumif I run it again
12:24:38Tiberiumit shows that template is faster :)
12:24:38Demos[m]you really need to looks at the code in vtune at those numbers
12:24:47Demos[m]is the first one per-run
12:25:04Demos[m]you need to run more interations
12:25:11Demos[m]but it sounds like almost the same code
12:26:19Tiberiumwell I've used nimbench from nimble
12:26:23Tiberiumit's very easy to use
12:27:02Demos[m]you need more runs of the code
12:27:18Demos[m]also you need to look at the code in a good profiler
12:27:33Demos[m]but generics don't have any runtime cost
12:33:57*mahmudov quit (Ping timeout: 260 seconds)
12:37:29*kalexm quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
12:40:35*Vladar quit (Ping timeout: 240 seconds)
12:48:04*Vladar joined #nim
12:48:14TiberiumDemos[m], unlike in some other languages :)
12:48:27Demos[m]like what?
12:48:52AraqJava
12:49:52*endragor quit (Remote host closed the connection)
12:52:42*crem joined #nim
12:53:01*endragor joined #nim
12:57:14*endragor quit (Ping timeout: 246 seconds)
13:07:02*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
13:12:58TiberiumAraq, I see on SO: "No, it won't affect performance since it's not even there at runtime."
13:13:02Tiberiumabout generics for java
13:13:27Tiberiumhttps://stackoverflow.com/questions/6224368/does-using-generics-in-java-affect-performance
13:14:01AraqI don't feel like answering that one
13:14:40Tiberiumwell maybe they're wrong :)
13:15:00*couven92 quit (Read error: Connection reset by peer)
13:15:56*endragor joined #nim
13:16:21Demos[m]I think it's "compared to what"
13:18:36*Arrrr quit (Quit: Leaving.)
13:18:43*dom96|w joined #nim
13:19:07FromGitter<krux02> I added a comment with "compared to what?"
13:20:37*endragor quit (Ping timeout: 260 seconds)
13:20:55Tiberiumwell it's a bit old answer :)
13:21:07Tiberiumah
13:21:08TiberiumYes, it does affect performance because the compiler creates type-casts.
13:26:34FromGitter<brentp> > **<Araq>** @brentp: use a distinct type?
13:26:44FromGitter<brentp> can you clarify? (I'm new to Nim).
13:26:56Araqtype Foo = distinct uint32
13:27:18Tiberiumbut you'll also need to borrow some procedures for uint32 if you need them (like + proc)
13:28:19*BitPuffin|osx quit (Ping timeout: 276 seconds)
13:36:10FromGitter<brentp> got it. thank you.
13:37:13FromGitter<ephja> I assume I have to resort to the compiler API in order to do things like ensure that one module references all exported symbols of another module
13:40:30Araqnot really, you can parseStmt(staticRead("mymodule.nim")) to get the exported symbols and to perform some checking
13:41:06FromGitter<ephja> neat
13:46:32FromGitter<ephja> but then you need to wrap the contents of the module that performs this check in a macro, right? It's not that bad but there are ways to make it more elegant
13:46:54*rauss joined #nim
13:49:25FromGitter<ephja> maybe similar to how you can push pragmas
13:55:14*ibutra quit (Read error: Connection reset by peer)
14:06:02*BitPuffin|osx joined #nim
14:10:34*gangstacat joined #nim
14:25:57*arnetheduck quit (Ping timeout: 260 seconds)
14:37:47*sz0 joined #nim
14:46:27*v17d quit (Ping timeout: 240 seconds)
14:52:19FromGitter<Stromberg90> I'm trying to do some simple ffi with c++, here is my code https://pastebin.com/gjLCrMQG ⏎ I compile using: nim cpp -r cpp_ffi.nim ⏎ ⏎ this is the errors I get: https://pastebin.com/VR5BynXT... [https://gitter.im/nim-lang/Nim?at=59930aa3162adb6d2efa01ac]
14:58:16Araq"importcpp" is really more like "import method" and you import ordinary functions
14:58:24Araqso you should use importc here
14:58:56Tiberiumhis code then says "b.cpp:(.text+0xdc): undefined reference to `greet'"
15:00:11*v17d joined #nim
15:01:25FromGitter<Stromberg90> yeah, then I get undefined reference to greet and print_something
15:02:25Tiberiumprobably C++ compiler optimized them away?
15:03:05FromGitter<Stromberg90> importcpp seemed natural to me, since it's a cpp file, but If I knew more about it, it would probably make sense.
15:03:17Tiberiumwell importcpp is used in JS backend too
15:03:35gangstacathey, would it be considered a bug if you name a file true.nim and that you use the boolean true in your program, then Nim says "Error: Error: ambiguous identifier: 'true' --use unknown.true or bool.true", you use bool.true but Nim still gives this message, you must obviously use system.true in this case (or rename the file obviously)
15:03:52Tiberiumwell it's already submitted on github issues
15:04:37gangstacatgood then
15:04:49Tiberiumwell it's just about error message
15:04:55Tiberiumwhich can be more helpful :)
15:05:59FromGitter<Stromberg90> I tried renaming the functions to greet2, gives me the same errors.
15:07:12Tiberiumwell probably C++ compiler optimized these functions away
15:07:50*vivus joined #nim
15:10:38*haha_ quit (Quit: haha_)
15:11:14*haha_ joined #nim
15:12:01*ShalokShalom joined #nim
15:16:27*haha_ quit (Quit: haha_)
15:17:21*PMunch joined #nim
15:19:47*haha_ joined #nim
15:21:39FromGitter<Stromberg90> How would I stop it from doing that?
15:23:40Tiberiumwell I may be wrong
15:23:47TiberiumI don't know C++ or C :)
15:23:56*haha_ quit (Ping timeout: 240 seconds)
15:24:12*Arrrr joined #nim
15:25:57FromGitter<Stromberg90> as far as I can tell it doesn't compile with optimizations on
15:28:21Tiberiumyes this means C compiler optimizes it away
15:29:21FromGitter<Stromberg90> are you sure?
15:29:37TiberiumI'm not as I said
15:30:01FromGitter<Stromberg90> right
15:31:20FromGitter<Stromberg90> I followed what's here https://hookrace.net/blog/what-is-special-about-nim/ ⏎ under the "Bind to your favorite C functions and libraries" section.
15:32:27*Trustable joined #nim
15:35:54Tiberiumhmm it works for me with C
15:36:05TiberiumI don't know that is bad with your C++ version
15:37:00FromGitter<Stromberg90> yeah, me neither :/
15:38:38ArrrrFor some reason, calling alloc afer i dealloc gives me a SIGSEV, what would be the reason for this?
15:40:52FromGitter<ephja> Araq: roughly how would you implement a feature that retrieves the value that a compile time variable holds at the very end of the compile time context?
15:41:49FromGitter<ephja> do we need the current (lexicographically dependent) behavior?
15:43:27FromGitter<ephja> yo, dom96|w: https://github.com/nim-lang/opengl/issues/46 :p
15:44:51FromGitter<ephja> can only the repo owner change the description?
15:45:15Tiberiumyou mean GitHub description?
15:45:20Tiberiumor README?
15:46:36FromGitter<ephja> the former
15:47:13TiberiumIDK, probably only the owner
15:47:44FromGitter<ephja> yeah
15:49:07dom96|wsuggest a description then
15:53:46FromGitter<ephja>
15:58:03FromGitter<ephja> dom96|w: "An OpenGL interface for Nim" might do
16:12:06FromGitter<ephja> Having memory issues? Try the Rasmus Lerdorf solution: ⏎ ⏎ ```While ($true) ⏎ { ⏎ taskkill /F /IM nimsuggest.exe /T ⏎ Start-Sleep -s 600 ⏎ }``` ⏎ ⏎ ;) [https://gitter.im/nim-lang/Nim?at=59931d55ee5c9a4c5fc28340]
16:15:48FromGitter<TiberiumN> lol
16:15:59FromGitter<TiberiumN> well nimsuggest can use quite a lot of memory, this is true
16:18:16*BitPuffin|osx quit (Ping timeout: 240 seconds)
16:25:13*dankrad joined #nim
16:35:19FromGitter<ephja> IIRC it also triggers a GC bug
16:36:33Jipok[m]can someone test duckduckgo?
16:36:36Jipok[m]https://duckduckgo.com/?q=sdl
16:36:53Tiberiumwhat do you mean?
16:37:02Tiberiumit works for me
16:37:05Jipok[m]It seems it does not work. I tried to go with a proxy and it's empty
16:37:20Tiberiumwell it works for me
16:37:23Tiberiumwithout any issues
16:37:31Jipok[m]https://i.imgur.com/xYEVLma.png
16:37:35Jipok[m]hmm
16:38:51*Trustable quit (Remote host closed the connection)
16:39:33Jipok[m]https://twitter.com/duckduckgo/status/897497301106663425
16:39:38Jipok[m]thx
16:48:51*yglukhov quit (Remote host closed the connection)
16:50:32*yglukhov joined #nim
16:55:04*gangstacat quit (Quit: Leaving)
16:55:05*rauss quit (Quit: WeeChat 1.9)
16:55:40*yglukhov quit (Ping timeout: 276 seconds)
16:56:09*rauss joined #nim
16:57:08*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:15:21*haha_ joined #nim
17:20:17Demos[m]Should we consider adding more reasonably names ffi pragmas?
17:20:43Demos[m]Also does there exist some module implementing the old style using statement
17:29:37*itseris quit (Quit: Konversation terminated!)
17:31:13*nsf quit (Quit: WeeChat 1.9)
17:35:17*yglukhov joined #nim
17:35:33*yglukhov quit (Remote host closed the connection)
17:35:47*yglukhov joined #nim
17:58:03*itseris joined #nim
18:02:38*kier joined #nim
18:04:32dom96hello, sup guys?
18:07:56Demos[m]sup
18:09:51*v17d quit (Remote host closed the connection)
18:18:30*scriptum joined #nim
18:24:14*haha_ quit (Quit: haha_)
18:24:54*haha_ joined #nim
18:27:49*ShalokShalom quit (Quit: No Ping reply in 180 seconds.)
18:29:27*ShalokShalom joined #nim
18:31:57FromGitter<ephja> Araq: some of the symbols are generated by a macro though
18:32:25FromGitter<ephja> but it doesn't matter in this particular case
18:34:39FromGitter<ephja> since it's a list of procs in a template that have nodes added to them, so they can still be identified before the expansion
18:41:01*Arrrr quit (Read error: Connection reset by peer)
18:49:05*dankrad quit (Ping timeout: 248 seconds)
18:49:25*haha_ quit (Quit: haha_)
18:50:46*dankrad joined #nim
19:03:12*rauss quit (*.net *.split)
19:03:13*mal`` quit (*.net *.split)
19:03:14*solitude quit (*.net *.split)
19:03:33*solitude joined #nim
19:03:33*rauss joined #nim
19:04:42*mal`` joined #nim
19:17:44*Jesin joined #nim
19:20:21*haha_ joined #nim
19:25:53*haha_ quit (Quit: haha_)
19:26:23AraqDemos[m]: there is an issue open for that, yes definitely
19:31:31*haha_ joined #nim
19:47:03dom96Elronnd: All files in a package must be namespaced appropriately.
19:47:15dom96mv logging.nim pkgName/logging.nim
19:49:18Elronnddom96: but it's in src already
19:49:27Elronndwhy should I put it in another dir?
19:49:40*Vladar quit (Quit: Leaving)
19:50:51*endragor joined #nim
19:55:14dom96Elronnd: Because if you don't people will be able to write `import logging`
19:55:19dom96and that will clash with a stdlib module
19:55:32*endragor quit (Ping timeout: 260 seconds)
19:55:39dom96and if we let every package do this then modules will start clashing
19:56:09Elronndbut it's not a library
19:56:23Elronndno one *else* will write 'import logging'
19:56:26dom96okay, so then add 'skipExt = @["nim"]'
19:56:29dom96to your .nimble file
19:56:39Elronndwhat's that do?
19:56:47dom96it tells Nimble not to install any .nim files
19:57:25Elronndah
19:59:08dom96I may make this implicit for packages with a 'bin' at some point in the future.
19:59:30*nsf joined #nim
20:03:26ShalokShalomcan i code in a functional style?
20:09:07Tiberiumyes
20:09:18Tiberiumlook at some sequtils procedures for example :)
20:10:25Tiberium*templates
20:13:41*mahmudov joined #nim
20:13:42Tiberiumhmm
20:14:10Tiberiumdom96, is this supposed to work? var a = @[1, 2, 3]; a.applyIt(it * 2).keepItIf(it > 2)
20:14:28Tiberiumah no
20:14:37dom96no idea
20:14:56Tiberiumi did it wrong
20:15:21Tiberiumecho @[1, 2, 3].mapIt(it * 2).filterIt(it > 2)
20:15:22Tiberium:)
20:16:31TiberiumIs this a "functional" style?
20:17:31dom96Sorta
20:17:43dom96It's a special Nim functional style
20:20:06FromGitter<Smaehtin> @Tiberium Keep in mind that these operations make a new `seq` every time = they're not lazy, but eager
20:20:13Tiberiumyes, I know
20:20:18FromGitter<Smaehtin>
20:23:33*haha_ quit (Quit: haha_)
20:25:55Tiberiumneat, you actually can "emulate" python dict comprehensions with nim list comprehensions (you can do that in python too)
20:26:14Tiberiumecho lc[(x, x^2) | (x <- 1..10), tuple[x, y: int]].newTable()
20:26:23Tiberiumimport future, tables
20:26:28Tiberiumimport math
20:28:50dom96oh, interesting
20:29:25Tiberiumwell you can do that in Python too
20:29:42Tiberiumlol
20:29:43Tiberiumecho lc[($x.toUpper, x.repeat(3)) | (x <- "abcd"), tuple[x, y: string]].newTable()
20:30:04Tiberiumis equivalent for {x.upper(): x*3 for x in 'abcd'}
20:31:21dom96cool, would be nice if we could get something closer to Python's syntax :)
20:31:24Tiberiumyeah
20:31:35Tiberiumbut macros are magical
20:31:38Tiberiumin a good way
20:37:03dom96Sucks that this doesn't work: https://gist.github.com/dom96/58cdcd81527cfb5eddc691598db18114
20:37:55Tiberium lc[x in "abcd": ($x.toUpper, x.repeat(3)), tuple[x, y: string]] :D
20:38:38Tiberiumwait, isn't there a way to avoid typing with list comprehension in future module?
20:38:51TiberiumI think it should be possible
20:38:54Tiberiumhmm
20:47:03FromGitter<brentp> hi all. I got help from some of you over the last few days to write my first nim lib. it is here: https://github.com/brentp/hts-nim/ any suggestions welcome.
20:47:33Tiberiumrequire?
20:47:39Tiberiummaybe "import" ? :)
20:47:44Tiberiumrequire hts
20:48:05Tiberiumoh, about distinct types
20:48:11Tiberiumyou should've used borrow pragma
20:48:14Tiberiumah wait
20:48:51FromGitter<brentp> oops. thanks. changing to import in the README
20:49:13Tiberiumwell nim **can** look like JS, but very rarely :)
20:49:20Tiberiumthose "var"s, yeah
20:49:35FromGitter<brentp> I have no excuse. I don't even use js.
20:49:50*Tiberium quit (Remote host closed the connection)
20:53:15dom96proc calls shouldn't begin with a capital letter
20:54:07dom96(you're using `Open` in the readme)
20:54:19*Tiberium joined #nim
20:54:59dom96And in general I would try to be consistent with your case/style (use camelCase for everything instead of a mix of camelCase and snake_case)
20:56:09*mahmudov quit (Remote host closed the connection)
20:57:36FromGitter<brentp> ok. will change, I can blame golang for that one.
20:57:55FromGitter<brentp> with distinct types, there's no way to get around this: https://github.com/brentp/hts-nim/blob/master/hts/flag.nim#L7
20:57:57FromGitter<brentp> ?
21:00:26Tiberiumwhy do you need a distinct type?
21:02:39*rauss quit (Quit: WeeChat 1.9)
21:03:03FromGitter<brentp> I wanted the `$` proc
21:03:59FromGitter<brentp> in that case, I don't really, but e.g. for this one: https://github.com/brentp/hts-nim/blob/master/hts/cigar.nim#L36
21:04:07FromGitter<brentp> the `$` proc.
21:04:45FromGitter<brentp> but yeah, I'll remove the distinct from Flag. thanks!
21:06:14FromGitter<GULPF> you can use the `{. borrow .}` pragma to avoid reimplementing a ton of procs
21:06:17FromGitter<GULPF> https://nim-lang.org/docs/manual.html#distinct-type-modelling-currencies
21:11:27*Jesin quit (Ping timeout: 240 seconds)
21:11:46*Jesin joined #nim
21:11:48FromGitter<brentp> sweet. thanks. collecting these here: https://github.com/brentp/hts-nim/issues/1
21:16:50dom96Otherwise though, seems like a well written library :)
21:22:33FromGitter<brentp> :-)
21:37:05*solitude quit (Ping timeout: 248 seconds)
21:39:02*Sembei joined #nim
21:39:25Araqdom96: any ideas of how to do list comprehensions?
21:39:58dom96Araq: what do you mean?
21:40:10Calinouare the MinGW compilers included in MSYS2 "compatible" with native MinGW-w64 compilers? as in, can I use them to compile Nim code for Windows?
21:40:20Calinou(I have these installed, I'd rather not duplicate things around if possible)
21:40:30*Guest3423 quit (Ping timeout: 240 seconds)
21:40:33CalinouI managed to compile Nim from source on Windows, using the bundled mingw32 that came with choosenim
21:40:36Calinoubut that's 32-bit :P
21:41:10dom96Calinou: try it and see if it works :)
21:42:53Araqdom96: the 'lc' macro is cool but also strange
21:43:37dom96Araq: oh cool, so you agree that it should be improved to fit the language better :)
21:43:48Araqyeah
21:44:14Calinoudom96: 32-bit GCC 7.1 provided by MSYS2 works, but not 64-bit: https://hastebin.com/pibixowuci.txt
21:44:26dom96well, as I've written: lc[for x in [1,2,3]: x * 2] would be nicer already
21:44:40Calinouthis might be because I'm just re-running "bin\nim c koch" and not cleaning files
21:44:47dom96But I don't even use list comprehensions in Python enough to remember exactly how they work
21:45:02Araqwell last time I thought about it the problem is the stmt/expr split. 'for' is a statement or leads type 'void' (depending on how you look at it)
21:45:03dom96Allowing the 'for' as an expression in Nim might be enough
21:45:18Araqif we make 'for' an expression ... lol
21:45:33dom96what would happen? :P
21:46:09dom96Calinou: you need to rebuild from C sources AFAIK
21:46:20dom96possibly rebuild koch too
21:46:24Araqbuild64.bat, Calinou
21:46:46Araqkoch supports the --cpu flag too, no need to rebuild koch
21:47:02Calinouah yes, for building the C sources, there's a different script
21:47:06Calinoujust noticed, because it told me :P
21:47:28CalinouAraq: now… if I want to distribute an application both as 32-bit and 64-bit, do I need only the 64-bit Nim compiler? or do I also need a 32-bit one?
21:47:35Calinou(since, ultimately, GCC will compile the generated C code)
21:48:26Araqany version of nim supports --cpu
21:48:35Araqand that's all you need really
21:49:06Araq32bit nim can build 32 or 64 bit apps, 64bit nim can build 32 or 64 bit apps
21:49:31Calinouyeah, I figured
21:53:22AraqtakesSeq(for x in bar: if cond: f(x))
21:54:01Calinourandom question: is it safe to leave MinGW permanently in your PATH?
21:54:07Calinou(won't it override built-in Windows utilities?)
21:54:28Araqit's safe, Windows doesn't care
21:55:01Calinoualso, the Nimble I just built errors with "could not load: libeay64.dll" :/
21:55:34Araqhttps://nim-lang.org/install_windows.html
21:56:02Araqthe installers come with the required DLLs
21:57:16*Tiberium quit (Ping timeout: 276 seconds)
21:57:26AraqtakesSeq((var tmp: seq[T] = @[]; for x in bar: if cond: tmp.add(f(x)); tmp))
21:57:43Araqseems to be a pretty simple transformation
21:58:35dom96Araq: yep, so why the 'lol'?
21:58:55Calinouthanks, Nimble works once the appropriate libraries are copy-pasted :P
22:00:26*cspar quit (Ping timeout: 246 seconds)
22:00:45*rauss joined #nim
22:06:04Calinouthings seem to work alright, including building an hello world :P
22:06:12Calinouthanks… this was pretty easy
22:09:34*PMunch quit (Quit: leaving)
22:19:26Araqdom96: lol because we thought the same
22:19:30*acidx quit (Ping timeout: 240 seconds)
22:20:34*acidx joined #nim
22:21:05*gokr quit (Ping timeout: 240 seconds)
22:21:22dom96i see :)
22:34:32*ehmry uploaded an image: file1502836466786.jpg (46KB) <https://matrix.org/_matrix/media/v1/download/matrix.org/jOZDAryJHHPqvLoukSxnwTax>
22:35:10ehmrydom96: just got my book
22:35:40dom96:D
22:35:51dom96Hope you enjoy it :)
22:53:33*Tiberium joined #nim
22:56:34*clarity510 joined #nim
22:57:20*clarity510 left #nim (#nim)
23:05:11*vivus quit (Quit: Leaving)
23:40:45*Jesin quit (Quit: Leaving)
23:48:36*zahary_ quit (Quit: Connection closed for inactivity)
23:55:54*nsf quit (Quit: WeeChat 1.9)
23:56:29*ludocode quit (Ping timeout: 240 seconds)