<< 04-11-2017 >>

00:22:24*nsf joined #nim
00:45:20*arnetheduck joined #nim
00:47:21*nsf quit (Quit: WeeChat 1.9.1)
01:00:45*yglukhov quit (Remote host closed the connection)
01:09:43*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:50:46FromGitter<Varriount> @zacharycarter How is the game engine going?
02:04:27*JappleAck quit (Quit: Leaving)
02:05:48*vivus quit (Quit: Leaving)
02:09:20*marenz_ quit (Ping timeout: 246 seconds)
02:16:15*chemist69 quit (Ping timeout: 246 seconds)
02:28:46*chemist69 joined #nim
02:40:52*yglukhov joined #nim
02:45:01*yglukhov quit (Ping timeout: 240 seconds)
04:28:48*yglukhov joined #nim
04:33:03*yglukhov quit (Ping timeout: 248 seconds)
04:41:26*tefter joined #nim
04:43:19*dddddd quit (Quit: Hasta otra..)
04:46:29*SenasOzys joined #nim
04:50:58*SenasOzys quit (Remote host closed the connection)
04:53:46*ipjk quit (Quit: Leaving)
04:58:28*sz0 quit (Quit: Connection closed for inactivity)
05:33:28*yglukhov joined #nim
05:38:07*yglukhov quit (Ping timeout: 248 seconds)
05:45:56*SenasOzys joined #nim
06:17:29*StarBrilliant joined #nim
06:26:54*claudiuinberlin joined #nim
06:28:16*rauss quit (Quit: WeeChat 1.9.1)
06:36:44*lastjedi joined #nim
06:37:04*yglukhov joined #nim
06:41:27*yglukhov quit (Ping timeout: 260 seconds)
06:56:45*vlad1777d joined #nim
07:01:16*miran joined #nim
07:06:45FromGitter<mratsim> Maybe he stopped developing it because he was too busy playing :D
07:07:54*Arrrr joined #nim
07:07:54*Arrrr quit (Changing host)
07:07:54*Arrrr joined #nim
07:36:15*xkapastel quit (Quit: Connection closed for inactivity)
07:41:02FromGitter<dandevelo> I have a type declared as distinct pointer. How can I check if a value of this time is nil?
07:41:11FromGitter<dandevelo> *value of this type
07:43:05FromGitter<dandevelo> Seems like casting to a pointer does the trick
07:45:39*yglukhov joined #nim
07:49:57*yglukhov quit (Ping timeout: 240 seconds)
08:13:42FromGitter<Varriount> @dandevelo You can also use conversion
08:15:00FromGitter<Varriount> `pointer(distinctPointer)`, rather than `castpointer (distinctPointer)`
08:15:06FromGitter<Varriount> @dandevelo ^
08:22:39*smt` joined #nim
08:25:35*smt quit (Ping timeout: 246 seconds)
08:27:53*yglukhov joined #nim
08:31:57*yglukhov quit (Remote host closed the connection)
08:32:13*yglukhov joined #nim
08:59:57*arecaceae quit (Remote host closed the connection)
09:00:16*arecaceae joined #nim
09:01:28yglukhovAraq: ping
09:01:51*SenasOzys quit (Ping timeout: 248 seconds)
09:03:55yglukhovAraq: so regarding the absolute imports. i propose the following. nim will lookup the nimble file for the main file it compiles. if it finds the nimble file it excludes the corresponding package from pkgs dir. sounds good?
09:04:06yglukhovdom96: ping
09:05:07*rokups joined #nim
09:10:28*SenasOzys joined #nim
09:20:26*Trustable joined #nim
09:30:23*nsf joined #nim
09:31:43*derlafff quit (Ping timeout: 248 seconds)
09:33:06*derlafff joined #nim
09:47:46*yglukhov quit (Remote host closed the connection)
09:57:01FromGitter<alehander42> I remember that there was optimizations applicable when mapIt/etc are used, and often the code gets inlined to similar speed to a for loop
09:57:10FromGitter<alehander42> is that true ? or I am imagining stuff
10:01:19Arrrrthese are templates
10:06:17FromGitter<alehander42> I know, I just assumed they're converted to map invocations, now I checked the source and saw they're directly converted to for
10:07:19FromGitter<alehander42> so the reason why I am asking this is I wondered how easy would it be to implement a smarter zip
10:08:01FromGitter<alehander42> because it seems that if you currently use it as zip(a, b).allIt(stuff) it would generate a new sequence combining the previous one-s which is very suboptimal
10:10:26*marenz_ joined #nim
10:12:26FromGitter<alehander42> now, I obviously defined ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59fd928ab20c64242987daed]
10:13:19FromGitter<alehander42> but ofc to chain it to sequtils methods I need to wrap it in toSeq, which is the whole thing I am trying to not do, so overally I wondered if anybody has moe optimal recipes for similar cases
10:23:58ArrrrYou could define a global seq and reuse it
10:24:31ArrrrWould be useful to have a locals for defined procs in module
10:27:07Arrrrmmm maybe i can staticread the file ..
10:27:50*yglukhov joined #nim
10:37:39*couven92 joined #nim
10:40:16*Vladar joined #nim
10:41:07FromGitter<alehander42> :D well I can just write a manual loop
10:41:12FromGitter<alehander42> I hoped to solve this generally
10:41:39FromGitter<alehander42> I think I can make a set of macros on iterators
10:41:44FromGitter<alehander42> overloading mapIt etc
10:42:20FromGitter<alehander42> so mapIt(zipIterator(a, b), it[0] + it[1]) can work more optimally
10:42:46FromGitter<alehander42> do you think something like this would be useful for sequtils?
10:43:00FromGitter<alehander42> (it can be used for other iterators, not only zip)
10:43:48*Sembei quit (Read error: Connection reset by peer)
10:44:52*Sembei joined #nim
10:57:46*nim_newb joined #nim
10:59:12nim_newbI wanted to use `to` macro https://nim-lang.org/docs/json.html#to.m,JsonNode,typedesc but the json contains a field "from" and from is a keyword in nim and can't use it in my object. Any workarounds?
11:00:00*adamchainz joined #nim
11:00:49nim_newbAlso `to` macro does not work if object contains any integer type other than `int`. Any other type gives -> `Error: unhandled exception: false Unable to process nnkSym int64`
11:01:50Arrrrreplace from to anything after reading the json
11:02:25*JappleAck joined #nim
11:03:16*Snircle joined #nim
11:03:57nim_newbWhat about the `int64` issue?
11:05:11nim_newbAlso if the json contains some fields which are not present always, can i specify optional fields in my object for `to` to work?
11:05:40ArrrrGood question, i really don't know. Probably the macro needs more work
11:08:06*zolk3ri joined #nim
11:08:17ArrrrMaybe it doesn't fail if the field is not found
11:13:20nim_newbYeah, just checked. It doesn't fail if the field is not found.
11:13:58nim_newbArrrr: > replace from to anything after reading the json ? sorry for noob question but How to do that in nim.
11:15:34Arrrrimport strutils, read string, replace(string, "from", "source"),
11:18:12ArrrrI mean, before reading the json. I guess you need to pass a string to obtain a json object
11:18:34Arrrrhttps://nim-lang.org/docs/json.html#parseJson,string
11:19:43nim_newbThanks I got it working.
11:22:56nim_newbNow I just need `int64` to work with `to`. Can anyone confirm whether `int64` not working with `to` is by design or a bug?
11:26:57*yglukhov quit (Remote host closed the connection)
11:37:15FromGitter<stisa> nim_newb you can use try using `BiggestInt` instead of int64, or maybe add `"int64"` around here https://github.com/nim-lang/Nim/blob/master/lib/pure/json.nim#L1568
11:37:44FromGitter<stisa> No idea if it's a bug or not
11:38:35*enthus1ast- joined #nim
11:46:51*enthus1ast- quit (Read error: Connection reset by peer)
11:47:04*enthus1ast- joined #nim
11:49:52nim_newbThanks, stisa.
11:52:03enthus1ast-nim_newb: maybe you could also write it like so `from` but not tested
11:53:29enthus1ast-foo.`from` is afaik valid as well
11:56:55nim_newbAlso, i just found out that you cannot name an object `result` if you intend to use `to` on it inside a `proc` because of the impilicit `result` variable in the `proc` https://play.nim-lang.org?gist=7aa15438b836edd56aebd2e06d8a3707 Is this by design? (I know NEP1 says Type identifiers should be in PascalCase, but still...)
11:59:54nim_newbenthus1ast-: Thanks!
12:03:16*elrood joined #nim
12:03:47enthus1ast-nim_newb: try this https://play.nim-lang.org/?gist=8e8774f95ddeb7ab958d724b5ea076da
12:04:23enthus1ast-but if you can better avoid keywords i think
12:05:24nim_newbI am using `Result` in my code, but i was just wondering whether that was by design or not...
12:05:52enthus1ast-every proc has a result which is of the return type of your proc
12:07:57*SenasOzys quit (Ping timeout: 240 seconds)
12:11:36enthus1ast-so you can either just `return` a result or you can assign it to the `result` variable which then is returned after function finished.
12:23:53nim_newbArrrr: >Maybe it doesn't fail if the field is not found. It fails actually, IDK what I tested then but -> https://play.nim-lang.org?gist=64e4b364c800e0fb5bbd7dff96557479
12:28:36Arrrrsubmit an issue on github
12:37:07Araqnim_newb: `from` works as object field name (with the backticks)
12:37:22Araqjson.to is close to unusable the last time I tried to use it
12:38:02Araqnot sure why that circumvented our review process
12:40:45*JappleAck quit (Ping timeout: 258 seconds)
12:41:05nim_newbAraq: are there plans in the short term for a better `to`?
12:45:34nim_newbAlso are there plans for a `requests` like library in the stdlib? `requests` makes it pretty easy to scrape the web because of ease to maintain session cookies
12:48:01Araqyes 'to' is definitely something we need to improve for v1
12:48:27Araqno plans for 'requests', if you want it, write it or ask #nim for it :-)
12:48:57nim_newbOkay thanks
12:58:15*JappleAck joined #nim
13:03:07*SenasOzys joined #nim
13:04:09*nim_newb quit (Quit: Page closed)
13:19:42dom96Come on, it's certainly not "close to unusable"
13:21:40*yglukhov joined #nim
13:29:07*sz0 joined #nim
13:34:25*dddddd joined #nim
13:40:40*miran quit (Quit: Leaving)
13:40:49*miran_ joined #nim
13:48:17*vlad1777d quit (Ping timeout: 248 seconds)
13:48:35*ipjk joined #nim
14:02:23*nsf quit (Quit: WeeChat 1.9.1)
14:04:01*lastjedi quit (Ping timeout: 240 seconds)
14:06:19*miran_ quit (Quit: Konversation terminated!)
14:15:54*Senketsu_ joined #nim
14:27:59*Senketsu_ quit (Quit: Lost terminal)
14:37:39*Senketsu_ joined #nim
14:37:53*enthus1ast- quit (Ping timeout: 248 seconds)
14:41:03*couven92 quit (Ping timeout: 248 seconds)
14:43:55*Senketsu_ quit (Quit: Lost terminal)
14:50:24*Senketsu_ joined #nim
14:52:04*Senketsu_ quit (Remote host closed the connection)
14:56:19*Senketsu_ joined #nim
14:56:23*Senketsu_ quit (Remote host closed the connection)
15:04:21*Senketsu_ joined #nim
15:08:52*PMunch joined #nim
15:21:39*Senketsu_ quit (Remote host closed the connection)
15:27:19GertmNim fails to compile on my first gen RPi unfortunately. I think the 256MB of RAM just isn't enough.
15:27:31GertmGoes to full RAM usage + full swap and then crashes.
15:27:46redlegionGertm: increase the size of your swap
15:27:49dom96^
15:27:54GertmOh that helps?
15:28:00redlegionit ought to
15:28:15redlegionit'll still take a while due to disk access being slower
15:28:17redlegionbut shouldn't die
15:28:19GertmOk awesome. Can I do that on this live system?
15:28:24redlegionsure
15:28:31Gertmcfdisk probably?
15:28:47redlegionjust swapoff, mkswap a 4gb chunk, swapon
15:28:59redlegioni imagine you're working with 1gb swap?
15:29:34Gertmlemme check
15:29:45GertmOh heh 100MB :D
15:29:50redlegiondang
15:29:51GertmDefault Raspian config.
15:30:21Gertmneed to resize my root partition first.
15:32:51GertmI can just use a USB stick for this.
15:34:00GertmOk, thanks redlegion, dom96. Will fix this tomorrow.
15:37:51redlegionno problem
15:39:05*JappleAck quit (Ping timeout: 240 seconds)
15:52:37*JappleAck joined #nim
15:53:27*lastjedi joined #nim
15:57:59*deathstar joined #nim
15:58:24*lastjedi quit (Ping timeout: 246 seconds)
16:04:49*arnetheduck quit (Ping timeout: 248 seconds)
16:05:03*deathstar quit (Ping timeout: 246 seconds)
16:06:44FromGitter<Varriount> nim_newb: there's the http_client module, however it currently has an odd mixture of high/low-level traits
16:08:07*aziz joined #nim
16:08:14*aziz quit (Client Quit)
16:14:29FromGitter<Yardanico> @Varriount it doesn't support cookies sadly
16:14:43FromGitter<Yardanico> you need to set Set-Cookie and Cookie headers manually
16:14:54FromGitter<Yardanico> and update them manually too
16:21:17*nsf joined #nim
16:22:33*nim_newb joined #nim
16:22:36yglukhovAraq: import $package.font doesn't work. Error: package name must be an identifier or string literal
16:24:11nim_newbVarriount: do you mean https://nim-lang.org/docs/httpclient.html ?
16:24:40nim_newb> however it currently has an odd mixture of high/low-level traits. Hmmm.. Are there any plans to have two separate modules for low-level and high-level stuff?
16:26:05FromGitter<Yardanico> I didn't heard of any
16:26:09nim_newbYardanico: it doesn't support cookies sadly. Dang!!! Proper cookie management makes life easier...
16:26:34nim_newbYardanico: Okay! :(
16:26:42FromGitter<Yardanico> well I mean it does support them
16:26:48FromGitter<Yardanico> you just need to set them manually :)
16:27:00FromGitter<Yardanico> but you can do that, so techically httpclient supports them
16:27:05FromGitter<Yardanico> technically *
16:27:46nim_newbYardanico: And yeah I meant automated support :P
16:29:27nim_newbBut nevermind. For now, manual work would do..
16:36:23PMunchHmm, Nim really doesn't like my attempts at adding custom widget creators for genui..
16:36:41PMunchIt either won't compile, or just spins indefinitely when it does..
16:38:48shashlickdom96: I'
16:39:27shashlickdom96: I've submitted a PR to fix an issue with httpclient thru a proxy - https://github.com/nim-lang/Nim/issues/6685
16:44:21*nim_newb quit (Quit: Page closed)
16:54:12*vlad1777d joined #nim
16:59:37FromGitter<data-man> @PMunch: Have you tried the IUP?
17:03:51FromGitter<data-man> IMHO, the great library. And unlike libui it is constantly evolving.
17:17:16*nsf quit (Quit: WeeChat 1.9.1)
17:21:14*elrood quit (Quit: Leaving)
17:30:27FromGitter<Varriount> @data-man Oh wow, IUP appears to have native looks
17:30:52FromGitter<data-man> Yes
17:35:11FromGitter<data-man> For iOS uses Motif
17:40:25FromGitter<data-man> And the IUP has a huge set of widgets
17:43:15PMunchdata-man, I've tried pretty much all of the various graphical toolkits
17:43:16FromGitter<data-man> Including the Scintilla binding
17:46:47FromGitter<data-man> @PMunch: And at each toolkit you found a bunch of flaws? :)
17:49:51*sz0 quit (Quit: Connection closed for inactivity)
17:50:42PMunchWell, some had flaws. Some just have things I don't like
17:51:37PMunchI think the problem with IUP was OS X compatibility
17:52:23*xkapastel joined #nim
17:53:33FromGitter<data-man> Somewhere I read that they plan to fix it.
17:53:59PMunchYeah.. Last time I had a look at it was about a year ago
17:54:35PMunchThe idea with genui is that it should be easy to implement your own UI toolkit into it. So you could write as IUP implementation and then it could export to IUP
17:56:12*PMunch quit (Quit: leaving)
17:57:09*PMunch joined #nim
18:01:27FromGitter<data-man> Great idea, but you can't provide all types of widgets. ⏎ And different libraries have their own settings for each type of widget.
18:02:02PMunchYeah I know
18:02:21PMunchAnd that's were most toolkits like IUP and WxWidgets fall short
18:02:55PMunchgenui will compile away all the abstraction. So while running it's just pure Gtk/Win32/Karax/whatever
18:03:32PMunchThat way you can use a simple when statement and use your toolkit natively should you wish
18:04:13*Jesin joined #nim
18:08:07FromGitter<data-man> Oh, for Windows it will be the big task. :)
18:08:40PMunchHow so?
18:10:03FromGitter<data-man> For example a tables
18:12:04PMunchWhat about them?
18:15:03FromGitter<data-man> For Delphi I used amazing https://github.com/Virtual-TreeView/Virtual-TreeView. It's a big library.
18:18:58FromGitter<data-man> The libui stuck on a tables.
18:18:58*Jesin quit (Ping timeout: 264 seconds)
18:24:16*Jesin joined #nim
18:39:46*Serenitor joined #nim
18:43:07*lastjedi joined #nim
18:45:24*vivus joined #nim
18:54:49*enthus1ast- joined #nim
18:57:15*yglukhov quit (Remote host closed the connection)
18:58:53*Jesin quit (Quit: Leaving)
19:10:19*yglukhov joined #nim
19:10:59Serenitorcan I add a globally used searchpath to the dynlib pragma for importc?
19:10:59SerenitorI've tried adding my path via putEnv("PATH", ...) from the os module, but apparently the paths of the dynlib pragma are validated even before the first line of code, so that didn't work
19:19:16FromGitter<data-man> @Serenitor: What OS are you using? Try setting the path at the system level. ⏎ The putenv is not for this.
19:19:50*rauss joined #nim
19:20:38*def-pri-pub joined #nim
19:20:51*Vladar quit (Quit: Leaving)
19:21:29FromGitter<data-man> Rather not in your case.
19:23:55*def-pri-pub quit (Quit: Leaving.)
19:25:51Serenitor@data-man: win10. I just did that and was surprised to see the same results.
19:25:51Serenitorwhat I wanted to achieve is to load SDL and its various libs dynamically from a shared directory.
19:26:19livcdyglukhov: you around ? :0
19:26:31yglukhovyup
19:26:40livcdsome samples from nimx give me this : view_event_handling.nim(8, 8) Error: method is not a base
19:27:08planetis[m]hey is Yardanico around?
19:27:12*deathstar joined #nim
19:27:16yglukhovlivcd that happens when you compile not through main.nim. dunno why
19:27:16planetis[m]Yardanico: hey
19:27:27*lastjedi quit (Ping timeout: 248 seconds)
19:27:36yglukhovlivcd: run main.nim, it should work
19:27:38livcdyglukhov: oh ok i remember it also happened when i just ran nake
19:27:48livcdor maybe i had a different error ? dunno
19:28:15yglukhovhmm.. i need more info if thats so =)
19:28:24yglukhovdoes nake work now?
19:28:24livcdah ok
19:28:50livcdit is not that important to me i just wanted to see how the examples look like on windows
19:29:26planetis[m]probably not
19:30:01planetis[m]but for history I wrote a scraper using VkApi https://gist.github.com/konqoro/3dcc54255c44fb1a6a39274cab5f6556
19:30:11planetis[m](excellent work btw)
19:30:48planetis[m]and I am wondering if there is a method for search
19:31:20planetis[m]dont run the gist btw it will fill your hard drive
19:33:29*deathstar quit (Quit: No Ping reply in 180 seconds.)
19:34:53*lastjedi joined #nim
19:35:13planetis[m]maybe i am dumb i can search the json
19:35:27*SenasOzys quit (Ping timeout: 248 seconds)
19:38:39*JappleAck quit (Ping timeout: 248 seconds)
19:43:25*PMunch quit (Quit: leaving)
19:49:35*lastjedi quit (Ping timeout: 240 seconds)
19:55:27*JappleAck joined #nim
20:04:06FromGitter<data-man> @Serenitor: Run set path in cmdline. ⏎ Make sure that the sdl dlls are present in the listed paths. ⏎ Or run set path=%path%; <your path to sdl dlls>
20:14:14*nsf joined #nim
20:15:42*def-pri-pub joined #nim
20:23:11Serenitor@data-man oh right, now it checks the added path. thanks.
20:23:12Serenitorany idea how to make this distributable though? (maybe something nicer than launching the executable with a bat file?)
20:26:09*def-pri-pub quit (Ping timeout: 248 seconds)
20:27:23dom96put the dlls beside your exe
20:29:19Serenitoryep, figured as much..
20:39:03*salewski joined #nim
20:41:03*def-pri-pub joined #nim
20:41:26salewskiA funny fact is that strutils.toLowerAscii() becomes more than 10 times faster when one copies it into another module.
20:41:31salewskiSee https://forum.nim-lang.org/t/3305/1#20812
20:41:52salewskiDo you have an idea about the reason?
20:45:48*def-pri-pub quit (Client Quit)
20:53:53salewskiWell, it may be just missing inline? This makes it very fast again:
20:53:58salewskigcc.options.speed = "-march=native -O3 -flto -fstrict-aliasing"
20:59:59salewskiBye.
21:00:03*salewski quit (Quit: WeeChat 1.9.1)
21:18:03FromGitter<Yardanico> planetis[m]: can you add it to https://github.com/vk-brain/nimvkapi ? :)
21:18:06FromGitter<Yardanico> as sorry
21:18:10FromGitter<Yardanico> you're already using it lol
21:20:41FromGitter<Yardanico> what's the problem?
21:22:16FromGitter<Yardanico> planetis[m] - if you will be here, you can contact me vk.com/yardanico, or PM in gitter, so I will definitely see your messages :)
21:22:22FromGitter<Yardanico> https://vk.com/yardanico
21:24:01*JappleAck quit (Ping timeout: 240 seconds)
21:36:06dom96https://twitter.com/d0m96/status/926924868146352128 :D
21:41:15*JappleAck joined #nim
21:43:11*rokups quit (Quit: Connection closed for inactivity)
21:52:26FromGitter<data-man> @dom96: How long did you write your book? :)
21:52:37dom962 years in total
21:52:45FromGitter<data-man> Wow!
21:53:42FromGitter<data-man> I would like to translate the book into Russian.
21:55:06dom96Go for it :)
21:55:20dom96Contact Manning and see what their thoughts are.
21:58:36FromGitter<data-man> Oh, I don't even know where to start. ⏎ The problem is that I'm not a citizen of Russia.
21:59:37dom96Why would that be a problem?
22:02:52FromGitter<data-man> Actually, yes. It's not a problem. :)
22:05:38FromGitter<data-man> Maybe @Yardanico is also interested in this.
22:12:23*TjYoco joined #nim
22:13:27*enthus1ast- quit (Ping timeout: 240 seconds)
22:17:33*FromGitter quit (Remote host closed the connection)
22:17:41*FromGitter joined #nim
22:20:17*enthus1ast- joined #nim
22:29:37*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:29:55*TjYoco quit (Quit: Leaving)
22:32:15vivuswhat do you Nim folks think about Crystal?
22:39:59FromGitter<zacharycarter> @Varriount I haven't been but I'd like to get back into it soon
22:50:14dom96vivus: I think it's awesome :)
22:51:40vivusno sarcasm? dom96
22:51:57dom96of course not
22:52:38*tefter quit (Remote host closed the connection)
22:56:58*Arrrr quit (Read error: Connection reset by peer)
22:57:59FromGitter<Varriount> I find the Crystal syntax a bit odd, but I'm a Python programmer, so it's to be expected. :P
23:03:17vivus@Varriount yeah it does come across as terse/different, but its quite interesting what they're doing
23:12:53Araqyglukhov, use $package / font
23:13:07Araqin general I'd like to deprecate dots for path separators
23:14:29*Trustable quit (Quit: Leaving)
23:16:04*yglukhov quit (Remote host closed the connection)
23:38:36*yglukhov joined #nim
23:40:51*yglukhov quit (Remote host closed the connection)