<< 08-10-2017 >>

00:00:07*Demos joined #nim
00:04:26*relax joined #nim
00:06:04FromGitter<genotrance> @araq: figured out how to do the template to generate proc names and details, it's not perfect; I was hoping for a single param (e.g. 256) to fill out the details but this is good enough for now. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59d96beb177fb9fe7e4f7730]
00:09:27*PMunch quit (Quit: leaving)
00:11:01*relax quit (Ping timeout: 255 seconds)
00:12:09JappleAckhow do i convert string to an integer?
00:12:58*couven92 joined #nim
00:14:00FromGitter<mratsim> parseInt
00:14:51JappleAck@mratsim thanks
00:23:58shodan45what's the current best cross platform nim GUI library?
00:24:21shodan45it doesn't have to be full featured, I don't need much
00:25:35*yglukhov joined #nim
00:26:16FromGitter<mratsim> That’s a tough question. Try nimx maybe but better ask @zacharycarter and @yglukhov
00:31:17*yglukhov quit (Ping timeout: 260 seconds)
00:36:12*couven92 quit (Quit: Client Disconnecting)
00:44:31*endragor joined #nim
00:45:06*Demos quit (Ping timeout: 258 seconds)
00:48:49*endragor quit (Ping timeout: 255 seconds)
00:51:25FromGitter<zacharycarter> shodan45: what are you trying to make?
01:02:42*JappleAck quit (Quit: Leaving)
01:22:38*derlafff joined #nim
01:47:05*xet7 quit (Ping timeout: 240 seconds)
02:01:46*chemist69 quit (Ping timeout: 258 seconds)
02:04:10*user0_ joined #nim
02:15:16*chemist69 joined #nim
02:27:25*def-pri-pub joined #nim
02:28:45*yglukhov joined #nim
02:33:13*yglukhov quit (Ping timeout: 255 seconds)
02:51:20*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:53:47*ldleworker joined #nim
02:55:59*ldleworker is now known as ldlework
02:56:00*ldlework quit (Changing host)
02:56:00*ldlework joined #nim
03:30:18*endragor joined #nim
03:48:55*endragor quit (Remote host closed the connection)
03:59:52FromGitter<zacharycarter> https://imgur.com/a/6R6oK
04:09:42FromGitter<mohamedmoussa89> Cool!
04:09:58FromGitter<zacharycarter> thanks
04:10:47FromGitter<genotrance>
04:18:44*def-pri-pub left #nim (#nim)
04:20:04*miran joined #nim
04:30:35*yglukhov joined #nim
04:36:04*yglukhov quit (Ping timeout: 255 seconds)
04:36:17*endragor joined #nim
04:38:00*claudiuinberlin joined #nim
05:40:28*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
05:44:46libmanshodan45: try https://github.com/zacharycarter/nuklear-nim
05:58:08*Vladar joined #nim
06:33:22*yglukhov joined #nim
06:33:29FromGitter<Bennyelg> When you all talking about adding/ modifying files on "stdlib" where you basicly mean: https://github.com/nim-lang/Nim/tree/devel/lib ?
06:33:47*dddddd quit (Remote host closed the connection)
06:37:30*yglukhov quit (Ping timeout: 240 seconds)
06:44:14FromGitter<mratsim> A very long read by someone developing his tensor library in Go (and struggling with lack of generic) https://blog.chewxy.com/2017/09/11/tensor-refactor/. There is a very interesting remark about programming languages for data science. I think Nim ticks all the box. ⏎ ⏎ > But before that it’d be probably wise to state my biases upfront. Here’s what I care about, in priority (1 and 2 are tied): ⏎ ⏎ >
06:44:14FromGitter... *Cognitive crutch* for my ability to think - I like to think of programming languages as a new kind of pen-and-paper. It helps you think about a problem. Some languages causes you to think in more disciplined ways than others, and Haskell is one of them. I will admit to using Haskell as a “thinking” language when trying to solve pr ... [https://gitter.im/nim-lang/Nim?at=59d9c93e210ac26920bd952c]
07:01:34*endragor quit (Remote host closed the connection)
07:04:12*endragor joined #nim
07:08:04FromGitter<Yardanico> Well I've
07:08:50FromGitter<Yardanico> Well go has cross compiler embedded directly in the compiler, so you don't need mingw or some other cross compilers
07:09:07*endragor quit (Ping timeout: 260 seconds)
07:30:06*endragor joined #nim
07:34:47*endragor quit (Ping timeout: 260 seconds)
07:37:10*azur_kind joined #nim
07:40:11FromGitter<Varriount> @mratsim Eh. I like type checking.
07:40:53FromGitter<Varriount> @zacharycarter O_o
07:41:30FromGitter<Varriount> Your engine must either be very usable, or you are very good at game development.
07:41:32FromGitter<mratsim> Ah yeah this, I like type checking too. It’s surprisingly strange from a Haskell program (especially with his first point) I just skipped over that. Note the rust borrow checker tongue-in-cheek ;)
07:44:45*Arrrr joined #nim
07:44:45*Arrrr quit (Changing host)
07:44:45*Arrrr joined #nim
07:45:02*smt` joined #nim
07:45:36FromGitter<Yardanico> @genotrance yes, you can't do that because they're different types
07:48:22*smt quit (Ping timeout: 264 seconds)
07:53:57*endragor joined #nim
07:54:02*libman quit (Quit: Connection closed for inactivity)
07:54:36*yglukhov joined #nim
08:04:20*endragor quit (Remote host closed the connection)
08:05:56*claudiuinberlin joined #nim
08:06:54FromGitter<mohamedmoussa89> I'm looking a the `neo` library code - what is this stuff between the `{ ...} `?? Never seen it before: ⏎ `template rewriteLinearCombination*{v + `*`(w, a)}A: SomeReal (a: A, v, w: Vector[A]): auto =`
08:07:31FromGitter<Yardanico> https://nim-lang.org/docs/manual.html#term-rewriting-macros
08:07:50FromGitter<mohamedmoussa89> oh wow
08:09:49*yglukhov quit (Remote host closed the connection)
08:25:35*Arrrr quit (Ping timeout: 240 seconds)
08:29:06*couven92 joined #nim
08:30:10*Arrrr joined #nim
08:40:09FromGitter<Yardanico> offtopic: wtf https://github.com/Property404/fetlang/blob/master/examples/fibonacci.fet
08:40:20FromGitter<Yardanico> NSFW btw
08:40:44miran:D
08:42:09FromGitter<Yardanico> Fetlang is licensed under the BSDM (BSD, modified) license
08:43:00*Pisuke joined #nim
08:43:45*MyMind quit (Ping timeout: 248 seconds)
08:56:11ArrrrFor some reason, i was expecting sizeOf(someProcVar) to be 4 instead of 8 in my 32b computer.
08:56:32ArrrrWho is in the wrong here?
08:56:53FromGitter<mratsim> When in doubt, blame the other party (TM)
08:58:32FromGitter<mratsim> Maybe it’s because of alignment, the pointer to the function was reduced but another structure couldn’t so packed size would be 6b, but for alignment it becomes 8 ?
08:58:56ArrrrNo, i tested it with a single variable
08:59:26Arrrr`var i: proc(a: int)` returns 8
09:03:10AraqArrrr: it's a (proc pointer, environment) pair to support closures
09:03:17Araquse .nimcall to get the size to 4
09:04:44ArrrrYou are right.
09:35:39FromGitter<Yardanico> is it generally better to use tuples instead of objects when object features are not needed (inheritance runtime type etc)?
09:43:18Araqno, objects that do not use ``of`` have no overhead over tuples
09:44:16FromGitter<Yardanico> ah, ok
09:46:07*Pisuke quit (Ping timeout: 255 seconds)
09:48:14*Pisuke joined #nim
10:31:07*azur_kind quit (Ping timeout: 255 seconds)
10:32:43*ShalokShalom joined #nim
10:33:37*ShalokShalom_ quit (Ping timeout: 248 seconds)
10:54:08FromGitter<mratsim> fun read: https://codecraft.co/2012/09/27/coding-standards/
10:58:05*Snircle joined #nim
11:14:12*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:16:15FromGitter<zacharycarter> @Varriount :)
11:16:20FromGitter<zacharycarter> thank you for the compliment
11:51:59Araqzacharycarter: your game looks superb :-)
11:56:40FromGitter<edubart> gc v2 is not 100% yet, crashes for me in one app while refc runs fine (only with openmp enabled, but I don't do any allocation inside `||` but do pass refs)
11:57:17*ShalokShalom_ joined #nim
11:57:35*ShalokShalom quit (Ping timeout: 240 seconds)
12:00:38FromGitter<Yardanico> well nim's gc is not aware of openmp at all
12:03:08FromGitter<edubart> and I don't need GC with openmp, maybe should I call GC_disable before using openmp?
12:04:29FromGitter<edubart> tried, doesn't help, crashes
12:06:03FromGitter<zacharycarter> Araq: thank you!
12:06:35FromGitter<zacharycarter> https://imgur.com/a/EMtve
12:06:37FromGitter<zacharycarter> unit selection markers
12:07:07FromGitter<Yardanico> you're a beast
12:07:17FromGitter<Yardanico> how did u make it so fast?!
12:07:27FromGitter<Yardanico> I mean it didn't took long for you to make all that stuff already
12:07:46FromGitter<zacharycarter> well the map is from FLARE - a RPG made by Clint Bellanger
12:07:52FromGitter<zacharycarter> which is thankfully public domain
12:08:12FromGitter<zacharycarter> so most of the work has been rendering the isometric tilemaps which is a PITA if you ask me
12:08:34FromGitter<zacharycarter> but I think I have enough implemented to start making a RTS
12:08:43FromGitter<zacharycarter> or a RPG
12:11:28FromGitter<zacharycarter> I need a better selection indicator solution though
12:11:46FromGitter<zacharycarter> as when I get multiple units standing together it'd be cool if they merged
12:24:44obadzAraq: thx
12:28:48FromGitter<Bennyelg> @dom96 Hey Dom, how do I response a json response using jester
12:31:56FromGitter<Yardanico> send headers with content-type application/json and then your json as string?
12:33:03FromGitter<Bennyelg> my bad I did it right just end with . after the } on my json
12:33:04FromGitter<Bennyelg> thanks
12:34:36*ShalokShalom_ is now known as ShalokShalom
12:53:35*PMunch joined #nim
12:54:18*xet7 joined #nim
12:55:48*JappleAck joined #nim
12:56:25*azur_kind joined #nim
13:04:21*miran quit (Read error: Connection reset by peer)
13:05:11*endragor joined #nim
13:08:20FromGitter<Bennyelg> jester.nim(494, 22) Warning: mget is deprecated what is the alternative?
13:09:35*endragor quit (Ping timeout: 240 seconds)
13:10:21FromGitter<Yardanico> []
13:10:27FromGitter<Yardanico> https://nim-lang.org/docs/strtabs.html#mget,StringTableRef,string
13:10:36FromGitter<Yardanico> retrieves the location at t[key]. If key is not in t, the KeyError exception is raised. Use ```[]``` instead.
13:10:44FromGitter<Bennyelg> thanks
13:20:27*miran joined #nim
13:23:01*dddddd joined #nim
13:25:57*JappleAck quit (Ping timeout: 260 seconds)
13:30:24*Snircle_ joined #nim
13:32:23*Snircle quit (Ping timeout: 255 seconds)
13:38:43FromGitter<zacharycarter> https://imgur.com/a/hoEHF
13:38:45FromGitter<zacharycarter> combined unit selection circles
13:39:01*JappleAck joined #nim
13:40:26FromGitter<Jipok> Wow! When the last time I looked at your examples, there was just a rotating model
13:42:09FromGitter<zacharycarter> :D
13:48:10FromGitter<zacharycarter> that looks better
13:48:13FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/g93D/Screen-Shot-2017-10-08-at-9.47.56-AM.png)
13:48:53FromGitter<Jipok> 3d or 2d?
13:49:30FromGitter<zacharycarter> this is all 2d isometric tiles
13:49:52FromGitter<zacharycarter> opengl of course
13:50:21*def-pri-pub joined #nim
13:50:26FromGitter<Jipok> (https://files.gitter.im/nim-lang/Nim/SUGf/___________.png)
13:50:53FromGitter<zacharycarter> that's just where the mouse is hovering
13:50:55FromGitter<zacharycarter> I draw that tile red
13:51:58FromGitter<zacharycarter> I guess I'll actually start making a game this is all in an example file right now
13:52:08FromGitter<zacharycarter> lots of magic numbers everywhere
13:52:49FromGitter<Jipok> This red square is one tile?
13:53:05FromGitter<zacharycarter> yup
13:55:57*relax joined #nim
13:56:00FromGitter<Jipok> I never thought about isometric tiles. And now I have a misunderstanding of how it is stored. Can I see the original tile, exactly how is it stored?
13:56:47FromGitter<zacharycarter> https://github.com/clintbellanger/flare-game/blob/master/art_src/tilesets/grassland/grassland.png
13:59:08FromGitter<Jipok> (https://files.gitter.im/nim-lang/Nim/hxWX/___________.png)
13:59:17FromGitter<Jipok> I see. Thank you
14:00:10FromGitter<Jipok> Just under the tiles, I always imagined it
14:00:18FromGitter<Jipok> (https://files.gitter.im/nim-lang/Nim/hRfj/___________.png)
14:02:01FromGitter<Jipok> And I had no questions about storing such tiles
14:03:39FromGitter<zacharycarter> np
14:03:46FromGitter<zacharycarter> yeah that's orthographic perspective
14:03:47FromGitter<zacharycarter> iso is a bit weird
14:05:49def-pri-pubzacharycarter: heyas
14:05:57def-pri-pubI saw that video/gif you posted last night
14:06:03def-pri-pubWhat was that? tilemap for zengine?
14:09:00FromGitter<zacharycarter> yeah
14:09:03FromGitter<zacharycarter> more or less
14:09:23FromGitter<zacharycarter> how are you feeling? better hopefully def-pri-pub?
14:09:30def-pri-pubslightly better
14:09:41def-pri-pubI can talk about the camera thing right now if you want
14:09:42FromGitter<zacharycarter> good
14:10:08FromGitter<zacharycarter> okay - I guess when we removed that call to identity matrix in a lot of places, it broke the 3d example
14:10:09def-pri-pubso what were your questions?
14:10:14def-pri-pub>_>
14:10:29FromGitter<zacharycarter> I know it's not technically correct according to the OpenGL spec, but putting them back makes things work
14:10:39FromGitter<zacharycarter> so I need to figure out why that is
14:10:55def-pri-pubWhat examples did this break?
14:11:03def-pri-pubOr did it break any of the actual 3D code?
14:11:06FromGitter<zacharycarter> all of the 3d ones except for yours :P
14:11:13FromGitter<zacharycarter> it might have something to do with the 3d camera
14:11:20FromGitter<zacharycarter> I'm not sure exactly where the problem lies
14:12:43FromGitter<Jipok> @zacharycarter Did you see it? ⏎ https://github.com/mxgmn/WaveFunctionCollapse ⏎ Can be useful for tiles
14:13:06FromGitter<zacharycarter> I did
14:13:38FromGitter<zacharycarter> someone (I forget who) ported that to Nim and shared it with me last night
14:14:11FromGitter<Jipok> https://github.com/FedericoCeratto/wave_function_collapse
14:15:15FromGitter<zacharycarter> there it is :P
14:16:18*Trustable joined #nim
14:26:57*yglukhov joined #nim
14:30:13*libman joined #nim
14:34:05*def-pri-pub quit (Quit: Leaving.)
14:34:29*JappleAck quit (Ping timeout: 240 seconds)
14:36:35*relax quit (Ping timeout: 240 seconds)
14:41:32*Sembei joined #nim
14:43:07*Pisuke quit (Ping timeout: 255 seconds)
14:45:49*couven92 quit (Ping timeout: 255 seconds)
14:47:52*JappleAck joined #nim
14:48:21*couven92 joined #nim
14:52:34*relax joined #nim
15:19:29*relax quit (Ping timeout: 255 seconds)
15:25:25*azur_kind quit (Read error: Connection reset by peer)
15:26:10FromGitter<Bennyelg> setCookie("username", "X", daysForward(1)) NOR request.cookies["username"] = "x" ⏎ works
15:26:34FromGitter<Bennyelg> they both not store the cookie after redirect to some route
15:27:27*PMunch quit (Quit: leaving)
15:30:41*miran quit (Ping timeout: 248 seconds)
15:42:50*miran joined #nim
15:53:48miranis there a better way to keep a list of unique tuples than manually checking if the tuple is already in seq and then (not) add it?
15:54:45FromGitter<Jipok> set?
15:55:08FromGitter<Yardanico> yeah
15:55:11FromGitter<Jipok> http://devdocs.io/nim/sets
15:55:12FromGitter<Yardanico> just use "sets" module
15:55:52miranoh, i was looking at sets presented in nim tutorial (https://nim-lang.org/docs/tut1.html#advanced-types-sets)
15:55:59FromGitter<Yardanico> they're built-in sets
15:56:09FromGitter<Yardanico> like a language feature
15:56:18miranmakes sense
15:56:24FromGitter<Yardanico> https://gist.github.com/Yardanico/4aa75eff22fc0a55bb78eea69447abbb
15:56:25mirani didn't know about sets module
15:58:09miranthanks, guys!
16:11:17adam12Looking for hints on how to get form post data using asynchttpserver. Anybody have an idea?
16:14:31FromGitter<Yardanico> yes
16:14:50FromGitter<Yardanico> Request object has "body" field
16:15:33FromGitter<Yardanico> so you would just read this "body" field and split values
16:15:35FromGitter<Yardanico> or use jester
16:16:23adam12@Yardanico Yep. Basically what I did. cgi.decodeData exists, but is an iterator
16:16:42adam12So I just made a string table and used the iterator to fill it.
16:17:14adam12I'm trying to learn more about stdlib without bringing in libraries like Jester. I have a comparable Golang implementation of this project, doing an implementation in nim to see how it compares.
16:18:25FromGitter<Yardanico> well don't expect nim performance to be much better (if better at all) than go
16:18:46FromGitter<Yardanico> in this exact case nim has some performance problems
16:18:52FromGitter<Yardanico> (I mean in http servers)
16:18:59adam12Performance isn't a concern. Just trying to find a compiled language to settle on that I like.
16:23:18adam12Does anybody know if I should prefer asyncfile while inside asynchttpserver loop? I'm presuming standard file operations are blocking?
16:23:47FromGitter<Yardanico> yes
16:24:08adam12@Yardanico thanks again :)
16:26:09FromGitter<mratsim> Nim quizz, How many nimsuggest do you think I have?
16:26:20FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/lmck/2017-10-08_18-24-40.png)
16:27:00FromGitter<Jipok> lol
16:27:03FromGitter<Jipok> vscode?
16:27:12FromGitter<mratsim> yes
16:27:31FromGitter<mratsim> I think it’s because nimsuggest chokes on include and prefers import
16:27:47FromGitter<Yardanico> @mratsim vscode launches new nimsuggest on every file
16:27:51FromGitter<Jipok> It seems the plugin just does not kill processes for closed files.
16:27:58FromGitter<Yardanico> or maybe this
16:28:29FromGitter<mratsim> it crashes a lot too with Error type. I’ll restart and see if it’s better with “import” instead of “include"
16:30:36FromGitter<Yardanico> yeah, nimsuggest is not stable
16:31:31FromGitter<Yardanico> it can crash when compiler can crash
16:31:35FromGitter<Yardanico> because nimsuggest uses compiler
16:31:38FromGitter<Jipok> But it's better than a year ago. Previously, he could easily eat 1.5 GB of memory. Now only 400 mb.
16:32:00FromGitter<Yardanico> it can happen nowadays too
16:32:04FromGitter<Yardanico> sometimes there's memory leaks
16:32:08FromGitter<Yardanico> not very often, but still
16:33:28*azur_kind joined #nim
16:33:29FromGitter<Jipok> Also, this often produces incorrect results for the highlight command.
16:33:36FromGitter<Yardanico> ?
16:34:13FromGitter<Jipok> ?
16:34:27FromGitter<Yardanico> what "incorrect results" ?
16:36:30FromGitter<Jipok> Skips part of the information about tokens. Especially noticeable on large files. I tried to make a plugin that would highlight more than just reserved words.
16:37:04FromGitter<Yardanico> did you try to use epc mode instead?
16:37:28FromGitter<Yardanico> and it works fine in vscode I guess
16:38:19FromGitter<Jipok> I don't remember. It seems so. There were still some problems with closing the connection after one request.
16:39:06FromGitter<Jipok> Does vscode use the results of highlight?
16:39:21FromGitter<zacharycarter> what's the fastest / most efficient way to replace a character in a string?
16:39:25FromGitter<zacharycarter> string.replace ?
16:39:40FromGitter<zacharycarter> I know the position of the character in the string I want to replace
16:39:58FromGitter<Jipok> str[56] = 'n'?
16:41:07FromGitter<Yardanico> @Jipok yes it probably does
16:41:28FromGitter<Jipok> Anyway, I disgustingly know nim
16:41:29FromGitter<Yardanico> https://github.com/pragmagic/vscode-nim/blob/f9d56e957ab40b1f15146a82d66445879e1ba112/src/nimSuggest.ts#L42
16:41:58FromGitter<Yardanico> but not for highlighting it seems
16:42:05FromGitter<Yardanico> I doubt there's a way to do that in vscode
16:42:09*sz0 joined #nim
16:42:10FromGitter<zacharycarter> yeah but I want the operation to return me a new string jipok
16:42:39FromGitter<Yardanico> var mynewstr = str
16:42:43FromGitter<Yardanico> mynewstr[56] = 'n'
16:43:00FromGitter<Yardanico> https://code.visualstudio.com/docs/extensionAPI/language-support#_syntax-highlighting ⏎ ⏎ it only supports highlighting by grammar
16:43:22FromGitter<zacharycarter> is that faster than just
16:43:25FromGitter<zacharycarter> str.replace?
16:43:29FromGitter<zacharycarter> I guess I can benchmark and find out
16:44:32FromGitter<Yardanico> yes it indeed would be faster
16:44:37FromGitter<Yardanico> because you already know the index of char
16:44:42FromGitter<zacharycarter> okay
16:44:47FromGitter<Yardanico> of needed character to replace
16:45:11FromGitter<Yardanico> it's like copy an array and change a value in it
16:57:36FromGitter<zacharycarter> hrm I think maybe I found an issue with cfgparser and strscans
16:57:59FromGitter<zacharycarter> it seems that scanf advances the cfg parser or something strange
16:58:47FromGitter<Yardanico> what?
16:59:11FromGitter<zacharycarter> let me put together a gist
16:59:19*def-pri-pub joined #nim
17:02:17FromGitter<zacharycarter> https://gist.github.com/anonymous/a8de94b5468e22788f5c966f09218726
17:02:23FromGitter<zacharycarter> here's the tileset.cfg
17:02:44FromGitter<zacharycarter> https://gist.github.com/zacharycarter/54d176226f7be1c6cf96f41daf38803d
17:03:31FromGitter<Yardanico> and what is the issue?
17:04:40FromGitter<zacharycarter> https://gist.github.com/anonymous/a8de94b5468e22788f5c966f09218726#file-playground-nim-L43-L48
17:04:54FromGitter<zacharycarter> I would expect that these lines would produce the same integer
17:04:58FromGitter<zacharycarter> one prefixed by a comma
17:05:26FromGitter<zacharycarter> but it's like the scanf operation steps the parser
17:05:53FromGitter<zacharycarter> if you take the first line of the cfg file that has a tile definition
17:06:01FromGitter<zacharycarter> ``````
17:06:08FromGitter<Yardanico> just store p.next().key in the variable, and then use scanf on that variable?
17:06:19FromGitter<zacharycarter> I can but this is weird why does it do this
17:07:38FromGitter<Bennyelg> saving cookies :|
17:07:42FromGitter<Bennyelg> I need help
17:08:27*Jesin joined #nim
17:08:38FromGitter<Yardanico> post a thread on the forum
17:08:43FromGitter<Yardanico> and you'll definitely get an answer
17:11:12FromGitter<Bennyelg> @dom96 ⏎ can I do something like post,get "/login":
17:11:40FromGitter<Yardanico> @zacharycarter yeah, scanf generates a code like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59da5c4cb20c642429d9313e]
17:12:21FromGitter<Yardanico> and also
17:12:22FromGitter<zacharycarter> ah
17:12:57FromGitter<zacharycarter> that explains it
17:13:08FromGitter<Yardanico> maybe you can make an issue
17:13:25FromGitter<Yardanico> on github
17:14:18federico3how to emit a warning at compile time?
17:14:32FromGitter<Yardanico> from a macro?
17:14:57federico3not from a macro
17:15:00FromGitter<Yardanico> if not, then with a pragma "{.warning: "test".}"
17:17:07*claudiuinberlin joined #nim
17:23:34FromGitter<Yardanico> @zacharycarter you could've made a more specific test case
17:26:52FromGitter<Yardanico> @zacharycarter this test-case is better I think: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59da5fdbbac826f0544cb580]
17:27:02FromGitter<Yardanico> it echoes "Someone called me!" twice
17:27:08FromGitter<Yardanico> and "echo" is a side effect
17:28:26*serjepatoff joined #nim
17:29:00*vlad1777d joined #nim
17:29:04FromGitter<Yardanico> maybe something like "scanf can call procs with side-effects multiple times"
17:30:00*libman quit (Quit: Connection closed for inactivity)
17:34:56FromGitter<Yardanico> or
17:35:25FromGitter<zacharycarter> alright I'll update it
17:37:11*nsf joined #nim
17:40:02FromGitter<Yardanico> well I fixed it
17:41:55FromGitter<Yardanico> ah, I think this would be a bad approach
17:42:07FromGitter<Yardanico> because it would require string copying in case of simple strings
17:42:31FromGitter<Yardanico> so it would make it slower to use scanf with strings (and not calls)
17:42:48FromGitter<Yardanico> it can be solved with term-rewriting macro I think
17:43:38*relax joined #nim
17:47:07FromGitter<Yardanico> yeah
17:47:11FromGitter<Yardanico> with term-rewriting template
17:48:06FromGitter<Yardanico> so you would just add this after scanf macro in strscans: https://gist.github.com/Yardanico/e18280902af55a5ef4755d2ebf135d97
17:48:10FromGitter<Yardanico> but I think Araq wouldn't like it
17:57:17*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:00:05*azur_kind quit (Remote host closed the connection)
18:05:59*relax quit (Ping timeout: 240 seconds)
18:12:47Araqyardanico: just fix scanf, it's a macro, it can do introspection and see if it got a call
18:14:24chemist69Hi, for the CPP target cstring seems to map to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >`.
18:14:28chemist69What do I use to wrap a function that expects `std::string`?
18:27:35*libman joined #nim
18:32:57*dmu joined #nim
18:36:26chemist69Gotta go, will be reading the logs tomorrow.
18:37:31FromGitter<Yardanico> btw: I recommend gitter instead of irc logs: gitter seems to be a bit better for this :)
18:43:19Araqchemist69: cstring is always char*
18:43:24*gokr joined #nim
18:43:36Araqwrapping std::string works like wrapping any other C++ object
18:47:00*Jesin quit (Quit: Leaving)
18:49:45*claudiuinberlin joined #nim
18:50:11*claudiuinberlin quit (Client Quit)
18:52:33*Jesin joined #nim
18:54:10*Trustable quit (Remote host closed the connection)
19:17:00*claudiuinberlin joined #nim
19:21:28FromGitter<zacharycarter> hrm if I have a large string containing a comma delimited list of integers
19:21:33FromGitter<zacharycarter> oh wait nevermind
19:22:12FromGitter<zacharycarter> actually yes my question still pertains
19:22:20FromGitter<zacharycarter> how can I parse this into a sequence of integers?
19:23:38Araqscanf
19:23:59FromGitter<zacharycarter> alright thanks
19:25:35FromGitter<Yardanico> but only if number of integers is known
19:25:37FromGitter<Yardanico> AFAIK
19:26:10FromGitter<zacharycarter> it's not :/
19:26:27FromGitter<zacharycarter> I'll play with a user defined matcher
19:26:30FromGitter<zacharycarter> see what I can work out
19:26:50*relax joined #nim
19:28:57FromGitter<Yardanico> yeah you can do it probably
19:34:36livcdwow just found reel valley
19:34:39livcdlooks amazing
19:43:46FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59da7ff2b20c642429d9ca85]
19:45:02*Nobabs27 joined #nim
19:53:30*Vladar quit (Remote host closed the connection)
19:55:17FromGitter<Yardanico> ehm
19:55:33FromGitter<Yardanico> you would be able to parse only one-digit numbers with this
19:56:05FromGitter<zacharycarter> oh crap yeah you're right
19:56:05*gokr quit (Ping timeout: 240 seconds)
19:57:14FromGitter<Yardanico> you should create a temp variable for digits
19:57:23FromGitter<Yardanico> and append digits to this variable
19:57:27FromGitter<Yardanico> until you hit space or ,
19:57:55Araqthe formular for inplace int to string conversion is
19:58:18Araqx = x * 10 + ord(s[i]) - ord('0')
19:58:29Araqno need to append to a temp string
19:59:08FromGitter<Yardanico> how would you do something like this in this proc?
19:59:37FromGitter<Yardanico> I don't see how it can be added there
19:59:42FromGitter<Yardanico> you would need to store index then, yes?
19:59:59Araqscanf can take a custom matcher
20:00:19Araqbut it's probably easier in this case to use the parseutils procs
20:01:30FromGitter<Yardanico> ah, yes
20:03:05*gokr joined #nim
20:03:12*couven92 quit (Ping timeout: 260 seconds)
20:04:19ArrrrIs there any explanation on how to interpret gcstats output?
20:05:50AraqArrrr: what do you want to know?
20:08:59ArrrrEverything, or at least the numbers that should matter to me. "max threshold, zct capacity" maybe they don't matter at all from my point of view.
20:09:13ArrrrI suppose 'cycle collections' is the number of time the GC did its work
20:09:37Arrrrand max pause time how much it took in milliseconds
20:11:37miran@zacharycarter "if I have a large string containing a comma delimited list of integers, how can I parse this into a sequence of integers?"
20:11:50miranline.split(',').map(parseInt) ?
20:12:00FromGitter<Yardanico> well
20:12:05FromGitter<Yardanico> he uses scanf and parsecfg
20:12:14FromGitter<Yardanico> but yeah
20:12:17FromGitter<Yardanico> this should work too
20:12:20shodan45it's been a while since I've actually used nim.... and it seems my biggest gripe with it still stands - you can't tell which identifiers come from which module
20:12:31shodan45by default, "import foo" dumps foo.* into the file's namespace :(
20:12:34FromGitter<Yardanico> well I don't have any problem with that
20:13:11FromGitter<Yardanico> because: ⏎ 1) I know nim stdlib pretty well ⏎ 2) I use vscode with nimsuggest (so I can always hover over a proc)
20:13:23shodan45for example, I'm looking over the examples on http://filcuc.github.io/nimqml/
20:13:38miranshodan45: that is/was strange to me too, coming from python land, but i'm getting used to it
20:13:50FromGitter<Yardanico> everything here is using nimqml, apart from GC_fullCollect()
20:14:05shodan45I don't find it "strange", I find it, well, "bad" :/
20:14:30shodan45Yardanico: go down to example 5
20:14:46FromGitter<Yardanico> aand? it uses only nimqml
20:15:00shodan45"import NimQml, ApplicationLogic"
20:15:06miranat first i was using `from x import y, z, w`, but looking at others' codes, i've seen practically nobody uses that....
20:15:21FromGitter<Yardanico> yes, because it doesn't hurt
20:15:41FromGitter<Yardanico> you are just not used to it
20:16:35shodan45Yardanico: how am I supposed to know what identifiers come from where without using an IDE? like in this case when I'm looking over a library's web page?
20:17:26FromGitter<Yardanico> why would you want it to have something like "NimQml.someInnerModule.ApplicationLogic" instead of ApplicationLogic?
20:17:35FromGitter<Yardanico> and why do you want to code without IDE?
20:17:42FromGitter<Yardanico> examples just give you an overview
20:17:43Arrrryou eventually develop a new sense
20:18:06FromGitter<Yardanico> yes
20:18:53*Arrrr quit (Read error: Connection reset by peer)
20:18:53shodan45Yardanico: 1) explicit > implicit 2) I don't. I'm talking about when I'm reading someone else's code outside of an IDE
20:19:15FromGitter<Yardanico> "explicit > implicit" nim is not python
20:19:23FromGitter<Yardanico> yes, in most cases nim uses "explicit > implicit" too
20:19:25FromGitter<Yardanico> but it's not python
20:19:55shodan45sure; I just find this case to be particularly annoying
20:21:25*Nobabs27 quit (Quit: Leaving)
20:22:26FromGitter<Bennyelg> How do I delete element from stringTableRef
20:22:41shodan45I've mentioned this before, actually, and IIRC the reasoning behind it was that there needed to be a way to import a custom type's operator procs easily
20:22:45FromGitter<zacharycarter> what does this for loop do: https://github.com/clintbellanger/flare-engine/blob/41478fa3a84360cf8bcfd9cce9182dae206d6039/src/MapRenderer.cpp#L334 ?
20:23:15shodan45and "from foo import `==`" or similar wasn't good enough
20:24:53shodan45also, there a lots of other places where you'll have to read nim code that isn't inside an IDE
20:25:24shodan45heck, IRC/slack/etc. are a good example
20:25:56FromGitter<Yardanico> well, how people still use C then ? :)
20:26:10shodan45Yardanico: no comment ;)
20:27:50FromGitter<Yardanico> well I would say that at this point these talks about imports can do nothing, since there's already a lot of nim code
20:28:08FromGitter<Yardanico> I don't think araq would change it in 1.0, but who knows :P
20:28:48shodan45yeah..... :/
20:29:21shodan45I really like nim, very few complaints... but this one is rather big for me
20:29:54shodan45for me, readability (including outside of IDEs or other tools!) is *huge*
20:30:30FromGitter<Yardanico> well I don't have any problems with readability, it seems to be a personal thing... ⏎ you can create a tool which would add inline comments saying where this exact proc came from
20:30:48FromGitter<Yardanico> e.g. echo #[system]# "hi"
20:30:55FromGitter<Yardanico> code would still work
20:31:46FromGitter<edubart> how do add a new compiler to nim cfg? I'm trying to get nim to use the ICC compiler
20:31:52miranspeaking of code, what is a preferred way of calling a function? fn(a), fn a, a.fn, a.fn()?
20:31:56Araqshodan45: the problem with these complaints is that they make no sense
20:32:21FromGitter<Varriount> Miran: all of the above
20:32:34Araqin the average Python code I have no fucking clue what is defined where
20:32:36shodan45Araq: oh? please elaborate :)
20:33:43FromGitter<Yardanico> @edubart just change "cc" from "gcc" to "icc"
20:33:49FromGitter<Yardanico> Nim knows about icc
20:34:34*JappleAck quit (Ping timeout: 264 seconds)
20:34:37miranVarriount: yeah, i've been using all those, but i feel kinda dirty :)
20:34:40Araqfirstly, it's not about readablity, it's about navigability
20:34:43shodan45Araq: you mean stuff like conditionally defined variables? (in python)
20:35:09FromGitter<edubart> @Yardanico changed but got error "Error: unknown C compiler: 'icc'"
20:35:28*relax quit (Ping timeout: 255 seconds)
20:35:57FromGitter<Yardanico> Hmm, arrange
20:36:01FromGitter<Yardanico> Strange*
20:36:09FromGitter<Yardanico> Do you have icc installed?
20:36:14FromGitter<edubart> yes
20:36:20FromGitter<Yardanico> It's it available in your path?
20:36:46FromGitter<Yardanico> Ah, are you on Windows?
20:36:56FromGitter<edubart> i'm on linux, it is
20:37:27FromGitter<Yardanico> Hmm, I've used intel compiler with nim both on Windows and Linux
20:38:37Araqsecondly, it's not about module.f(obj) vs f(obj)
20:39:10FromGitter<edubart> icc is not defined in extccomp.nim while there is a lot others compilers there
20:39:31*vlad1777d quit (Ping timeout: 255 seconds)
20:40:08Araqwhy? because nobody really uses module.f(obj) anywhere consistently in any language, it's super verbose
20:40:59miranfrom module import f? then you can both use just f(obj) and be explicit
20:41:02Araqso it's about f(obj) vs obj.f(), the idea is that
20:41:12FromGitter<Yardanico> @edubart it doesn't need to
20:41:50Araq"yes, I don't know where f really comes from, but it's related to 'obj' and with a bit of luck I can see where 'obj' comes from and so draw some conclusions"
20:42:14FromGitter<Yardanico> Ah wait, try icl maybe?
20:43:00Araqthat's a super vague reasoning that is applied here and on average you succeed with this in Python. And tada, in Nim it's the same.
20:43:11FromGitter<Yardanico> Or change gc
20:43:31FromGitter<Yardanico> Or change gcc.linkerExe, and gcc.exe IIRC
20:44:03FromGitter<Yardanico> gcc.linkerExe and gcc.compilerExe
20:44:09FromGitter<Yardanico> Change these to icc
20:44:37*vivus joined #nim
20:44:44FromGitter<edubart> now works, but that's a hack, you used like that before?
20:44:56FromGitter<edubart> I want to have separate options for both compilers in nim.cfg
20:45:07*relax joined #nim
20:45:52FromGitter<Yardanico> Well
20:46:09FromGitter<Yardanico> It seems extccomp has icc only
20:46:12FromGitter<Yardanico> Not icl
20:46:43FromGitter<Yardanico> We should add icc here too (no new code, just add it to icl section)
20:47:20Araqoh and fyi claiming that "explicit > implicit" in a dynamically typed setting is pure schizophrenia
20:47:43FromGitter<Yardanico> Ah, probably it would be better to split these two
20:47:57FromGitter<Yardanico> AFAIK icl is used in Windows only
20:48:02FromGitter<Yardanico> And icc is Linux only
20:48:51FromGitter<edubart> so I should edit extccomp.nim to have icc using code similar for icl?
20:49:08*relax quit (Ping timeout: 240 seconds)
20:49:41FromGitter<Yardanico> Well remove when statement from icl, and create separate icc entry probably?
20:49:59*libman quit (Quit: Connection closed for inactivity)
20:50:15Araqyardanico: that nails it.
20:50:58shodan45Araq: hehe, good point
20:51:58shodan45although I don't typically code "dynamically" in dynamically typed languagets
20:52:03*JappleAck joined #nim
20:53:37FromGitter<Bennyelg> I am freaking going insane I spend 24 hours figure out the concept of session on nim + jester but I can't get it to work
20:53:45FromGitter<Bennyelg> Any live example I can see?
20:55:29Araqbennyelg: study nimforum?
20:55:46FromGitter<Bennyelg> link to the code
20:56:18FromGitter<Yardanico> https://github.com/nim-lang/n
20:56:18shodan45is VS code the main IDE everyone is using for nim these days?
20:56:19Araqhttps://github.com/nim-lang/nimforum/blob/master/forum.nim#L32
20:56:22FromGitter<Yardanico> https://github.com/nim-lang/nimforum
20:56:39*asdf_ joined #nim
20:56:48FromGitter<Yardanico> Shodan45: yeah, because Nim plugin for it is the best currently
20:56:58shodan45last I used nim for anything "real", it was "aporia" or whatever it was called
20:57:11FromGitter<Bennyelg> thanks
20:57:35miranshodan45: i'm using it because i'm using it for all other stuff i do (python, latex, etc.) so i'm familiar with it
20:57:59vivushow do I import a nimble library that I installed in the same folder as my project? eg. folder/ jester/ app.nim . do I use import "../jester" in app.nim ?
20:58:39shodan45I'm more familiar with idea/pycharm/phpstorm... but I'm not seeing any recently updated plugins for nim
20:58:46FromGitter<Bennyelg> what is it to learn : ( u used database to storge session
20:58:47FromGitter<Bennyelg> delete from session where ip = ? and password = ?
20:58:56FromGitter<edubart> @Yardanico like https://github.com/nim-lang/Nim/pull/6488 right? now works
20:58:59FromGitter<Bennyelg> this is the only thing I wanted to avoid
21:01:19*asdf_ quit (Ping timeout: 260 seconds)
21:01:34FromGitter<Yardanico> @edubart well user would still have to choose "icl" even on Linux
21:02:19FromGitter<Yardanico> Well it's good anyway
21:02:59vivus@Bennyelg if you need something for production-web, I would suggest not using nim/jester. it requires you to do a lot of NIH work
21:03:04FromGitter<edubart> it worked with "icc" I pass `--cc:icc` to nim
21:03:11FromGitter<Yardanico> Ah, ok
21:03:20FromGitter<Yardanico> Fine then :)
21:05:50vivushow do I import a nimble library that I installed in the same folder as my project? eg. folder/ jester/ app.nim . do I use import "../jester" in app.nim ?
21:06:43*PMunch joined #nim
21:06:47shodan45hm, can I build windows or mac binaries on a linux host with nim?
21:10:03vivusshodan45: I believe you can. just pass it the compile-time args
21:10:07Araqvivus: you shouldn't have done it, but sure relative paths work
21:10:34Araqvivus: hey, what's wrong with nim/jester :P
21:11:31vivusAraq: the project is on bleeding-edge and I needed the latest version to use the updated-code. the error I got was: Error: cannot open '../package'
21:11:35FromGitter<Yardanico> Shodan45: yes if you have mingw or compiler for Mac (there's docker for Mac OS compiler)
21:12:32vivusAraq: absolutely nothing wrong. the work you and the rest of the team is doing without a major financial backer is amazing! but building web components requires so much extra-work that many other frameworks in other languages have already solved.
21:12:37shodan45Yardanico: huh, wow... I'll have to look up that mac os compiler thing
21:13:31FromGitter<Yardanico> Ah @zacharycarter
21:13:37FromGitter<Yardanico> *ask
21:14:43Araqvivus: fair enough, I prefer my own security problems over inherited security problems though :-)
21:14:51*Demos_ joined #nim
21:15:16Araq"sure it's broken shit but at least it's all my fault and I'm in full control" ;-)
21:15:31vivusAraq: I think this was debated here last time as well. almost akin to vim vs. emacs discussions XD
21:15:54shodan45Araq: but then you can't blame someone else! ;)
21:20:01*Demos_ quit (Ping timeout: 248 seconds)
21:23:10*couven92 joined #nim
21:23:32vivushas anybody got an sqlite compile error in your program: libsqlite3.o: In function `pthreadMutexAlloc': ... libsqlite3.c:(.text+0x3df6): undefined reference to `pthread_mutexattr_init' ? nimforum doesn't provide any results
21:24:56*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:24:56PMunch--threads:on perhaps?
21:27:25vivuswadda yknow. you deserve 1000 cute kittens memify your dreams for that assistance PMunch . thank you
21:27:32vivus*to memify
21:27:39PMunchHaha, thanks?
21:27:55PMunchI ran into the same issue myself first time I tried to use SQL
21:28:17vivusthis was a by-product of jester+sqlite.
21:31:26vivusI see user Rakuten was facing the same dilemma with Jester since 2014: https://forum.nim-lang.org/t/652#3535 . chicken-egg problem
21:36:53PMunchHmm, maybe I should do a write-up of how I created my little Jester server
21:37:07vivusPMunch: is your code hosted anywhere?
21:37:18PMunchWell, it was until recently
21:37:28PMunchStill working on getting my server back up and running
21:37:52vivusI mean the code itself :P something others can reference to see how you wrote/did things
21:40:34PMunchAh, not really
21:40:43PMunchBut I can pastebin it for you if you'd like
21:40:47*serjepatoff quit (Quit: Leaving)
21:41:29vivusI recall the other day that we were all discussing ORMs, etc. I came across this interesting Rust project: http://diesel.rs/
21:41:36vivusPMunch: if the code is private, no need :)
21:41:49federico3shodan45: Vim works nicely
21:41:52PMunchNot really, it was just part of a school project
21:42:05vivusPMunch: what does the code do?
21:42:09PMunchAnd I didn't really think it was interesting enough to be shared
21:42:21PMunchIt's basically a simple SQL -> REST server
21:42:49vivusPMunch: resources are scare in Nim. anything that runs on nim 0.17.xx helps others to build on top of it
21:43:10PMunchSo you have GET, PUT, POST, DELETE operations which fetches things from a SQL DB
21:51:16*yglukhov quit (Remote host closed the connection)
21:53:13PMunchOh well, I'm off now
21:53:17*PMunch quit (Quit: leaving)
21:53:40*libman joined #nim
21:54:10*solitudesf joined #nim
21:59:10*gokr quit (Ping timeout: 255 seconds)
22:04:17*solitudesf quit (Ping timeout: 258 seconds)
22:05:05*def-pri-pub quit (Quit: Leaving.)
22:10:47*sz0 quit (Quit: Connection closed for inactivity)
22:24:43*Demos joined #nim
22:29:42*Demos quit (Ping timeout: 248 seconds)
22:38:35*couven92 quit (Ping timeout: 240 seconds)
22:38:48*relax joined #nim
22:45:12*nsf quit (Quit: WeeChat 1.9)
22:57:57*def-pri-pub joined #nim
23:08:59*couven92 joined #nim
23:18:26*fredrik92 joined #nim
23:21:29*couven92 quit (Ping timeout: 240 seconds)
23:35:17*Demos joined #nim
23:35:24*Demos quit (Remote host closed the connection)
23:36:40*fredrik92 quit (Ping timeout: 258 seconds)
23:50:42*relax quit (Ping timeout: 260 seconds)
23:59:05*def-pri-pub quit (Quit: Leaving.)
23:59:12*def-pri-pub1 joined #nim