<< 04-10-2017 >>

00:17:42*jsgrant quit (Quit: jsgrant)
00:21:50*couven92 quit (Quit: Client Disconnecting)
00:27:32*relax joined #nim
00:30:31*yglukhov quit (Remote host closed the connection)
00:33:59*zachk quit (Quit: Leaving)
00:53:02*user0_ joined #nim
00:54:03user0_Hi
00:54:28user0_I was wondering if debugging nim is complicated due to cross compilation to C
00:54:42ipjkuser0_: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.htm
00:54:46FromGitter<bogen> @adamrezich: you can pass in any Nim variable or data structure. (anything that you can pass on normal Nim function call)
00:58:13user0_Awesome. Thank you.
00:58:20*user0_ quit (Quit: user0_)
01:03:35FromGitter<zacharycarter> err that link 404s?
01:04:00ipjkMust just have crashed or something.
01:04:11FromGitter<zacharycarter> https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html
01:04:17ipjkI was reading it myself just as I posted
01:04:31FromGitter<zacharycarter> you forgot the l! haha
01:04:36ipjkOh, ha!
01:04:43FromGitter<zacharycarter> :P
01:08:54*chemist69_ quit (Ping timeout: 258 seconds)
01:15:45*relax quit (Ping timeout: 248 seconds)
01:18:56*ftsf joined #nim
01:22:21*chemist69 joined #nim
01:31:01*yglukhov joined #nim
01:35:29*yglukhov quit (Ping timeout: 248 seconds)
01:41:28*ipjk quit (Read error: Connection reset by peer)
01:45:42*relax joined #nim
01:57:18FromGitter<zacharycarter> https://nimble.directory/ is down
02:07:41adam12@zacharycarter IIRC, you were cross compiling somewhere/how?
02:21:55FromGitter<zacharycarter> docker
02:22:10FromGitter<zacharycarter> adam12: ^
02:22:42adam12@zacharycarter were you using a pre-build image? I thought I remember you were building for windows or something. One of your games?
02:23:18FromGitter<zacharycarter> yeah I was building my own image and installing Nim on it and everything needed for cross compilation
02:23:49FromGitter<zacharycarter> then mounting my Nim project on the vfs and compiling it on the image and outputting the result to afolder
02:24:45adam12@zacharycarter you see dockcross at all?
02:25:58FromGitter<zacharycarter> yeah - rolling my own images was easier but I wasn't too familiar with docker when I did all this, it might be beneficial now not sure
02:26:41FromGitter<zacharycarter> those images don't have Nim installed on them but they might be good base images to start from
02:26:45FromGitter<zacharycarter> who knows
02:26:55FromGitter<zacharycarter> putting together your own image for CC should be pretty trivial
02:27:16adam12@zacharycarter Yeah. I'm targetting Freebsd. A bit more problematic. Working with Vagrant right now
02:27:50FromGitter<zacharycarter> ouch okay I can see that being painful
02:29:00adam12It is for local builds I guess. I could probably send it off to a server somewhere
02:33:33*dddddd quit (Remote host closed the connection)
02:36:51*Nobabs27 joined #nim
02:46:01*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:05:42*endragor joined #nim
03:11:06*Nobabs27 quit (Quit: Leaving)
03:13:28FromGitter<citycide> I've now picked up `static[T]` thanks to #6469 - I'd guess based on the general rule of simple > advanced ( ie. proc -> template -> macro ) that the static proc would be preferred over a template in a scenario like that?
03:30:13FromGitter<Varriount> @citycide I depends - what filename do you want to get, the file the function is defined in, or the one the function is used in?
03:33:41*yglukhov joined #nim
03:36:15FromGitter<citycide> @Varriount didn't take that difference into account 
03:38:05*yglukhov quit (Ping timeout: 240 seconds)
03:38:10FromGitter<Varriount> I kinda wish we were advised or required to mark procedures line
03:39:23FromGitter<Varriount> mark procedures like that
03:40:23FromGitter<Varriount> I feel like the whole "this return type make the procedure an implicit compile-time procedure" a tad worrying
04:07:37*Pisuke quit (Read error: No route to host)
04:08:42*Pisuke joined #nim
04:13:32*francisl quit (Ping timeout: 246 seconds)
04:27:24*Ven`` joined #nim
04:55:48*BigEpsilon joined #nim
05:06:48*smt quit (Read error: Connection reset by peer)
05:15:59*mal`` quit (Quit: Leaving)
05:16:15*mal`` joined #nim
05:16:53*miran joined #nim
05:25:29*crem quit (Ping timeout: 255 seconds)
05:28:37*crem joined #nim
05:29:26*Arrrr joined #nim
05:29:26*Arrrr quit (Changing host)
05:29:26*Arrrr joined #nim
05:31:34*voiceftp quit (Ping timeout: 264 seconds)
05:34:57*relax quit (Ping timeout: 248 seconds)
05:35:54*yglukhov joined #nim
05:38:03*voiceftp joined #nim
05:38:09*BigEpsilon quit (Ping timeout: 248 seconds)
05:40:15*yglukhov quit (Ping timeout: 248 seconds)
05:42:33*vlad1777d joined #nim
05:46:06Arrrrhttps://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html?ref=reddit
05:46:47libmanJust made some changes to https://en.wikipedia.org/wiki/List_of_arbitrary-precision_arithmetic_software
05:47:42*solitudesf joined #nim
05:48:28*gangstacat quit (Ping timeout: 240 seconds)
06:05:42*miran quit (Ping timeout: 260 seconds)
06:08:05*BigEpsilon joined #nim
06:09:31*BigEpsilon quit (Client Quit)
06:17:05*Ven`` quit (Ping timeout: 248 seconds)
06:23:37*nsf joined #nim
06:42:55*gokr joined #nim
06:50:30*yglukhov joined #nim
06:52:23*yglukhov quit (Remote host closed the connection)
07:02:23gokrI must say I have felt a bit of frustration when it comes to multithreading these last few days.
07:03:47gokrI have a hard time landing on a nice architecture - and I keep banging against inexplicable (to me) GC-safe errors. The last lesson learned was - make sure any forward declarations use {.gcsafe.}
07:04:51gokrI also bumped into the circular import issue which ... after scratching my head - got me into dumping all the code into a single module.
07:07:25Arrrrwelcome abroad
07:08:20Arrrr*Aboard
07:09:17gokrAnyone using sharedtables btw?
07:09:34gokrI even briefly considered just using redis for sharing ;)
07:20:44Araqyes, people use sharedtables, what's wrong with them?
07:21:17gokrNothing wrong - just trying to get more info, find some howto or something
07:21:29Araqforwarding wrt .gcsafe is annoying yes, but I am not sure how to improve it.
07:22:18*claudiuinberlin joined #nim
07:24:01gokrIn that particular case we may just add a small note to the error message - "Nim can not infer GC-safety from forward declarations, so make sure to add gcsafe pragmas to the declarations if needed" - or something.
07:24:49gokrIt felt like I hit my head against other GC-safe mysteries, but... I am not sure.
07:27:24*xet7 quit (Quit: Leaving)
07:46:39*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:47:35*claudiuinberlin joined #nim
07:48:33*xet7 joined #nim
07:50:32*Vladar joined #nim
07:56:53*yglukhov joined #nim
07:59:14*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:03:41gokrBtw, I gave up on using the mqtt library with callbacks, it needs more love for that to work.
08:04:28gokrThe setupForeignGC thing was promising, but... as its written right now with the context thing being passed to the C library for the callbacks - it doesn't work.
08:04:54gokrBut that would probably be a trivial thing for someone like you Andreas to fix.
08:18:26Araqwhere can I find the code?
08:24:26*solitudesf quit (Remote host closed the connection)
08:24:42*solitudesf joined #nim
08:31:34*solitudesf quit (Ping timeout: 264 seconds)
08:34:46*solitudesf joined #nim
08:37:27*PMunch joined #nim
08:37:54PMunchHey dom96 the first image in the debugging article is a bit too big
08:37:58PMunchStretches the entire page
08:38:04dom96clear cache
08:38:56PMunchAh, that's better :)
08:39:21PMunchHaven't had time to read the entire thing yet, but looking forward to it
08:39:40PMunchIIRC a lot of people have mentioned debugging as one of the things that Nim could be better at
08:39:56dom96yep :)
08:40:35PMunchLooking into creating a new kind of cross-platform GUI platform by the way. Heavily relying on Nims macros and posibly also things like concepts
08:41:58PMunchSo that would be one more tick in the boxes of wanted features :)
08:50:04PMunchIt will even be able to create HTML UIs so that we can create UIs over all of Nims export targets :)
08:51:04*claudiuinberlin joined #nim
08:54:13*claudiuinberlin quit (Client Quit)
08:58:08*xet7 quit (Quit: Leaving)
08:58:43*claudiuinberlin joined #nim
09:00:05*xet7 joined #nim
09:02:57Calinouhi :)
09:03:21CalinouI found that https://micro-editor.github.io/ can lint Nim code, this is pretty nice for quick edits :P
09:06:38gokrAraq: Sorry, was looking elsewhere. It's here: https://github.com/barnybug/nim-mqtt/blob/master/src/mqtt.nim#L126-L169
09:07:28gokrAraq: So... the wrapper is quite fine I think, but AFAICT it doesn't fly with the asynchronous style using this setCallbacks() call that the library offers.
09:08:09gokrI added the setupForeignGC thingy in the three callbacks in there, for example here: https://github.com/barnybug/nim-mqtt/blob/master/src/mqtt.nim#L142
09:08:34gokrBut the problem AFAICT is that this code is not GC-safe - it will fail if you try to build it using --threads:on
09:09:02gokrThe example is here: https://github.com/barnybug/nim-mqtt/blob/master/examples/callbacks.nim
09:09:40gokrI think the core issue is the "context" thing that needs to be passed into the C library. The CallbackContext.
09:10:17gokrThe current code happily creates that guy and passes it in - but... the callbacks being made from the C library are of course in new threads that the C library creates.
09:10:54Araqit's not GC safe at all
09:11:01gokrright
09:12:15gokrI now fell back to using this wrapper synchronously - but in its own Thread in Nim with a channel talking to it. It works fine for now for me, but... it would be good to try to get this wrapper a bit more happy.
09:13:03gokrMQTT usage is growing a lot these days - given its dominance within IoT areas. And it's a pretty neat clean small pub/sub protocol.
09:13:22gokrAnd the Paho libraries (that this wrapper uses) is basically de facto standard.
09:14:23gokrI am not presuming you have time to spend of course, but it would be enlightening to know how we handle these things generally (callbacks from C libraries).
09:15:58FromGitter<mratsim> I'm looking into config file format: yaml, toml ... It's a jungle. I like toml. Similar to .ini, comment are using #. Datetime are datetime, two different syntax for arrays and arrays of variant.
09:18:24*xet7 quit (Quit: quit)
09:18:29gokrmratsim: Stumbled over: https://github.com/crdoconnor/strictyaml/blob/master/FAQ.rst#why-not-use-toml
09:18:38*xet7 joined #nim
09:20:56CalinouYAML is a very complex specification, also it has some ambiguity for users
09:21:06Calinoulike, truthiness can be specified with a lot of "strings"
09:22:21Calinouhmm, 1.2 spec doesn't mention it: http://www.yaml.org/spec/1.2/spec.html
09:22:42Calinoubut I've heard that some implementations allow using "y", "yes", "on", "true"… as boolean `true`
09:22:59Calinouand since you don't have to put strings between quotes, it can be pretty confusing
09:23:47FromGitter<mratsim> @gokr appart from being able to do [[1,2],["hello","world"]], I don't agree with the strictyaml criticism. Syntax typing is a feature not an issue
09:25:00gokrI have no real view on the subject :) What's your current take then?
09:25:39Calinouthat said, I like YAML as an user, but TOML is fine to me too
09:25:43Calinouas long as it's not JSON :)
09:25:44*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:25:54Calinou(I don't think JSON is a good format for configuration)
09:28:19FromGitter<mratsim> Still exploring, looking for a format so that user can specify URL to load deep learning model, and data
09:28:48FromGitter<mratsim> Json doesn't support comments (implementation dependant) so ....
09:29:17*claudiuinberlin joined #nim
09:29:32FromGitter<mratsim> Toml or ini files seems the best for the moment
09:29:42Araqmratsim: I don't write programs that can be "configured", write libraries instead ;-)
09:32:20FromGitter<mratsim> I do ;) but I'm thinking of future use cases, like you have a library of models (maybe even stored on GitHub) and you want to load one. I will obviously provide a function for that but it might be useful to provide a confusing file
09:32:25FromGitter<mratsim> Config
09:38:20gokrHehe "provide a confusing file" - what a fitting typo ;)
09:39:04*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:44:05FromGitter<andreaferretti> @dom96 great article! Finally all info that is needed for profiling and debugging collected in one place :-)
09:44:38FromGitter<andreaferretti> It should be linked from https://nim-lang.org/documentation.html though
09:55:40*libman quit (Quit: Connection closed for inactivity)
09:58:13Araqgokr: callbacks to C libraries that are executed on unknown threads need to be .gcsafe as well as call setupForeignThreadGc
09:58:31FromGitter<mratsim> debugEcho !!! wow that's awesome debugging noSideEffect proc was a pain
09:58:55gokrAraq: Yes, I understand that. I am just not sure how to modify mqtt.nim so that it works.
09:59:18Araqoh it's not easy, the design is wrong
09:59:44Araqhe relies on a global holding closures that's as GC unsafe as it can get
10:03:07gokrRight
10:08:06*couven92 joined #nim
10:17:19*claudiuinberlin joined #nim
10:21:25*azur_kind joined #nim
10:32:54*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:35:08*claudiuinberlin joined #nim
10:35:34*claudiuinberlin quit (Client Quit)
10:48:21*kier quit (Ping timeout: 240 seconds)
10:48:28PMunchHmm, is it possible for one macro to store information for another macro?
10:48:38PMunchie. have a compile time global variable
10:49:48Araqit is.
10:50:11Araqit's also super anti modular and will eventually break our back
10:50:35Araqbut you know the saying, in the long run we're all dead.
10:52:14PMunchAnti modular?
10:52:49*kier joined #nim
10:53:07PMunchThe idea is to be able to edit and modify something and only realize it into code when you call a finilizer
10:53:49couven92PMunch, can't you just create an compile time object and pass it on...
10:54:41couven92Araq, can you create a const seq that is filled by a compile-time proc?
10:54:56PMunchHmm, I guess that's pretty much the same..
10:55:11Araqcouven92: yes.
10:55:21couven92wow! :O
10:55:46PMunchI basically want init -> do stuff -> finalize with Nim only generating code when finalize is called based on all the stuff you did since init
10:56:35couven92PMunch, create a hidden object somewhere, call new and pass a finalizer that has captured that hidden object
10:57:22PMunchYeah, a compile time global variable. That's what I was asking Araq if was possibl or not :P
10:57:48couven92PMunch, no... in the object you're initializing, just create a private field there
10:58:32PMunchAh, you're saying I should pass around the object
10:58:55couven92just a moment, let me write up an example
11:02:22*Snircle joined #nim
11:05:07Araqit's possible and even easy but it will cause problems for the poor compiler writer in the long run
11:06:11couven92PMunch: https://gist.github.com/couven92/ce0cdf01a55ba3dc083d0d6acc3f9d51
11:06:18*francisl joined #nim
11:10:57PMunchUhm, I don't think you understood what I meant..
11:11:26livcdwhat forums / channels people check for nim (besides the official one)
11:12:23PMunchIs any of that code evaluated at compile-time?
11:12:39PMunchlivcd, r/nim
11:12:43PMunchOn reddit
11:12:56PMunchBut I guess that's kinda official
11:16:53PMunchcouven92, let's say I have a compile time sequence of ints. I add a bunch of numbers. Then, when I call finalize (a macro) it sums up all the numbers in the int and creates n counts of echo "Hello, world".
11:17:39PMunchThe only thing that exists in the final code is a lot of echo "Hello world". The sequence and all of the adding and summing stuff was done at compile-time.
11:18:55PMunchBut I think this would work for my case: https://news.ycombinator.com/item?id=9479356
11:19:42couven92hmm...
11:19:50couven92yeah okay
11:21:00PMunchAraq, is this the kind of thing you were saying would cause a lot of trouble?
11:21:40couven92globals can ALWAYS cause trouble! :P
11:22:08PMunchHaha, of course. But except the regular trouble with globas
11:22:11PMunchglobals
11:22:24PMunchIt doesn't really have to be global. I could pass an object aronud
11:22:27PMuncharound*
11:27:40*endragor quit (Remote host closed the connection)
11:30:41gokrAraq: I presume one simply uses two channels for bidirectional comm, right?
11:33:53Araqyes
11:34:55AraqPMunch: the use case doesn't really matter
11:35:00*endragor joined #nim
11:35:13Araq.compileTime vars will be a pain for --symbolFiles
11:37:23*gangstacat_ joined #nim
11:37:27*gangstacat_ is now known as gangstacat
11:48:07*PMunch_ joined #nim
11:48:24*smt joined #nim
11:49:51FromGitter<Bennyelg> Can I pass variable to different url in jester? ⏎ Assuming Someone now is in get "/data" ⏎ he clicked on somebutton, I want to redirect the data he clicked on to different path
11:50:35*PMunch quit (Ping timeout: 240 seconds)
11:51:35Araqping zacharycharter
11:52:10FromGitter<Bennyelg> @zacharycarter
11:57:08*claudiuinberlin joined #nim
11:57:09*claudiuinberlin quit (Client Quit)
12:01:08*endragor_ joined #nim
12:04:24*endragor quit (Ping timeout: 258 seconds)
12:14:27dom96Bennyelg: use `redirect`
12:14:59dom96https://github.com/dom96/jester/blob/master/tests/alltest.nim#L34
12:21:05*endragor_ quit (Ping timeout: 240 seconds)
12:24:01FromGitter<zacharycarter> sorry was commuting to work @Bennyelg
12:24:46FromGitter<zacharycarter> or Araq - whoever needed me
12:27:30FromGitter<rokups> Shouldnt either of these two lines with error comments work? Not sure what i do wrong here. https://gist.github.com/c6c8d0ad1fffe815947b474a2278f314
12:33:27dom96So guys, I'm gonna try doing some livestream coding today. If you're interested, take a look: https://go.twitch.tv/morfeusz8 :)
12:33:39couven92dom96, ooohhh! :)
12:34:49*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
12:36:43FromGitter<Yardanico> dom96: why you don't use liveedu?
12:36:50FromGitter<Yardanico> it's better suited for programming IMO
12:40:19couven92dom96, missing cookies probably
12:41:50couven92dom96, curl to amazon.co.uk first, capture the cookies, then go to the specific link
12:43:20FromGitter<Yardanico> couven92: it works for me with https://www.amazon.co.uk/Nintendo-Classic-Mini-Entertainment-System/dp/B073BVHY3F
12:44:09couven92@Yardanico, hmmm... I still get a 503
12:44:37*ShalokShalom_ joined #nim
12:44:37FromGitter<Yardanico> dom96 doesn't, he just tested it on stream :P
12:44:57*PMunch_ is now known as PMunch
12:45:16FromGitter<Yardanico> ah, it's really an error page
12:45:19FromGitter<Bennyelg> Thanks Dom
12:47:27*ShalokShalom quit (Ping timeout: 248 seconds)
12:53:46Araqzacharycarter: you wrote the nim playground, right?
12:57:17FromGitter<Yardanico> yeah, he did it AFAIK
12:57:23FromGitter<Yardanico> https://github.com/zacharycarter/nim-playground
13:06:21*francisl quit (Ping timeout: 240 seconds)
13:07:11*francisl joined #nim
13:09:57*endragor joined #nim
13:12:07*xet7 quit (Quit: quit)
13:12:09Araqwtf the playground is 140 lines of code?
13:12:24*dddddd joined #nim
13:12:38*xet7 joined #nim
13:13:42Araqthere are things missing I guess
13:16:26euantorMost of it is ran inside Docker containers, not sure if the code to manage/orchestrate that is in the repo, and I don't think the webserver config or anything is either
13:19:12FromGitter<rokups> Araq any idea why these fail to compile? https://gist.github.com/c6c8d0ad1fffe815947b474a2278f314
13:19:31*claudiuinberlin joined #nim
13:19:55FromGitter<Yardanico> you're doing it wrong :)
13:19:57Araqoh not that again
13:20:09FromGitter<Yardanico> ah
13:23:47*claudiuinberlin quit (Client Quit)
13:28:00FromGitter<rokups> @Yardanico so whats the right way to do it?
13:28:05*claudiuinberlin joined #nim
13:35:15*taaperotassu quit (Ping timeout: 258 seconds)
13:39:34Araqrokups: x.y[z] is (x.y)[z] not x.(y[z])
13:39:45*adeohluwa joined #nim
13:41:41adeohluwahow do you reliably get the last element of a sequence?
13:42:00adeohluwaespecially when u don't care about the length
13:42:10*xet7 quit (Quit: quit)
13:42:11FromGitter<rokups> hmm ok.. but it still is not clear to me what i should do here
13:42:13adeohluwalist[-1] in python
13:42:16Araqs[^1]
13:42:29adeohluwathanks
13:42:33Araqbut it's not reliable because the seq could be empty :P
13:44:20adeohluwa
13:45:42Araqadeohluwa: well Python's s[-1] has the same issue, it's not Nim specific
13:46:04adeohluwaI get u
13:46:17adeohluwaI'm just peeved @ the joke :D
13:46:35adeohluwaactually tried it on the REPL to be sure
13:46:55*taaperotassu joined #nim
13:52:37Araq'nim pretty' or 'nim fmt' ?
13:53:16cremformatter?? ah, that would be great!
13:53:23cremI vote for fmt.
13:54:13Araqmeh if in doubt, use something with a vowel
13:54:26Araqso 'nim pretty' it is
13:55:08cremwhy not format then?
13:55:24*relax joined #nim
13:55:27Araqbecause I long for pretty things.
13:55:54Araqthat's still what tut1 says iirc
13:56:54Araqyeah it does, "Der Mensch ist doch ein Augentier -- schöne Dinge wünsch ich mir."
13:57:05FromGitter<krux02> "nim prty"
13:57:06couven92Araq, true!
13:57:59FromGitter<krux02> I like maximum uglieness just to troll people
13:58:23*ShalokShalom_ quit (Quit: No Ping reply in 180 seconds.)
13:58:29couven92@krux02 use this in your C code then: https://msdn.microsoft.com/en-us/library/bt0y4awe.aspx
13:58:40Araqcan I make it overwrite the .nim file?
13:58:42couven92that's really nice trolling :D
13:58:52couven92Araq, go fmt does
13:59:20Araqoh yeah, I can create a backup file
13:59:33Araqbbl
13:59:41cremFor html/css/js main tool does "pretty", for python/c++/go it's "format", that's from what I know.
13:59:42PMunchHmm, can I have an object with a field of type typedesc? If not, how would I store this information for later use in a macro?
13:59:42*ShalokShalom joined #nim
14:01:48FromGitter<krux02> yes I prefer format, too. Pretty is subjective, formatting is not
14:01:53dom96I think you should use 'format'
14:02:03dom96heh, was about to say what krux02 just did
14:09:36FromGitter<ephja> "prty" should be obvious, and it saves some space!
14:10:31FromGitter<Yardanico> we have "nim c"
14:10:35FromGitter<Yardanico> so add "nim p" :D
14:11:47FromGitter<krux02> or add an engines that tries to identify the closest match of available commands
14:12:42FromGitter<krux02> so "nim froamt" would still be "nim format"
14:12:43FromGitter<krux02> :P
14:15:08*ipjk joined #nim
14:22:31FromGitter<Yardanico> we already have editDistance in strutils :P
14:23:27PMunchHmm, I've got a really strange thing going on now..
14:24:04PMunch"got typedesc but expected NimNode", change it and I get "got NimNode but expected typedesc"
14:24:21FromGitter<krux02> without code, no help
14:24:59FromGitter<Yardanico> if your macro accepts a typedesct
14:25:12FromGitter<Yardanico> it's still implicitly converted to NimNode
14:25:21FromGitter<Yardanico> everything is converted to NimNode if you pass it to macro AFAIK
14:25:33FromGitter<krux02> unless it is static
14:25:52PMunchUgh, I'm too sleepy to wrap my head around this :P
14:26:04*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:26:18FromGitter<krux02> it's 16:26 and you are already too sleepy
14:26:32PMunchI've been sleepy since I woke up..
14:26:37*gokr quit (Ping timeout: 258 seconds)
14:26:53FromGitter<krux02> me too
14:27:55PMunchThe thing I'm trying to do is on compile time take in a variable, check it's type, and store it for later. After a few calls that does this I want to do a final call that looks at the stored information and generates some code from it
14:28:19PMunchs/it's/its
14:28:21FromGitter<krux02> ah
14:28:36FromGitter<krux02> so you need a static block
14:28:46FromGitter<krux02> can you just post the codes
14:29:20*claudiuinberlin joined #nim
14:29:20PMunchhttp://ix.io/AKt
14:29:31PMunchMight be completely misguided though
14:30:24PMunchBut the code at the bottom (in the isMainModule section) is somewhat what I imagine it would look like
14:30:28FromGitter<krux02> you call getType on an ``untyped`` input
14:30:32FromGitter<krux02> that can't work
14:30:45PMunchOh yeah, I've been switching back and forth trying to get it to work
14:31:27PMunchMakes no difference though
14:31:54PMunchPreferably I would do without the getType call at all
14:32:09PMunchBut I don't think compileTime procs can take in AST
14:32:27FromGitter<Yardanico> they can take AST
14:32:32FromGitter<Yardanico> (NimNode arguments)
14:32:54FromGitter<krux02> wtf you have a type in a static block?
14:33:00FromGitter<krux02> how does that make sense?
14:33:15PMunchAs I said, I've just been trying everything
14:33:19PMunchMade no difference
14:33:22FromGitter<krux02> sorry, but I have no idea what the purpose of it is
14:34:27PMunchWhat I'm trying to do is to create a UI specification in the UserInterface object that will, when I call 'finalize', generate code to create some UI
14:35:03PMunchYardanico, but how do I get Nim to convert the argument to a NimNode?
14:35:37PMunchIf I change t in the addWidget call to be of type NimNode it complains that it got an int but expected a NimNode
14:36:06FromGitter<krux02> http://ix.io/AKw
14:36:48FromGitter<krux02> I have no idea what you want, but that is what you said
14:37:00FromGitter<krux02> macros that have a side effect
14:37:06FromGitter<krux02> they add stuff to buffer
14:37:24PMunchHmm, interesting
14:37:26FromGitter<krux02> and then in the end there is baz that does something
14:38:03PMunchOh well, I have to play around with this more when I get home
14:38:14PMunchThanks for the help
14:38:36*PMunch quit (Quit: Leaving)
14:51:08*Demos joined #nim
15:01:10FromGitter<ephja> the bookmarks extension for vscode now has a pane in the explorer. sweet!
15:01:19FromGitter<ephja> that's a start
15:02:36*sz0 joined #nim
15:04:11*Arrrr quit (Ping timeout: 258 seconds)
15:08:52*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:11:24*miran joined #nim
15:13:32*enthus1ast joined #nim
15:15:43*enthus1a1t quit (Ping timeout: 248 seconds)
15:18:05FromGitter<gokr> @dom96
15:20:48FromGitter<mratsim> @Pmunch of you find a way to store a typedesc in an object I'm interested, I tried various things and I don't think Nim supports non-concrete fields in an object (phantom type in Rust)
15:20:55FromGitter<mratsim> If*
15:21:15dom96gokr: ?????
15:22:26*libman joined #nim
15:22:41*Demos quit (Quit: Demos)
15:24:40cremThe sdl2 wrapper for nim is complete and usable, right? just checking. :)
15:25:03FromGitter<mratsim> Also @pmunch you might be interested in my getSubType macro https://github.com/mratsim/Arraymancer/blob/nn-perceptron/src/autograd/utils.nim I use it to work around the lack of Generic Generics (i.e Generic1[Generic2[T]]])
15:37:04FromGitter<Yardanico> @mratsim it doesn't need to be a macro btw
15:37:30FromGitter<Yardanico> import macros and ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59d50039614889d47574d760]
15:37:54FromGitter<alehander42> is there a pragma to not mangle names?
15:38:14FromGitter<Yardanico> for what?
15:38:22FromGitter<Yardanico> using nim procs in another language?
15:38:26FromGitter<alehander42> ah i found it exportc
15:38:37*Trustable joined #nim
15:39:11*gokr joined #nim
15:39:14*nsf quit (Quit: WeeChat 1.9)
15:40:54*solitudesf quit (Remote host closed the connection)
15:43:10*Jesin quit (Quit: Leaving)
15:45:19*claudiuinberlin joined #nim
15:48:05*claudiuinberlin quit (Client Quit)
15:48:56*claudiuinberlin joined #nim
15:49:48*Jesin joined #nim
15:52:56FromGitter<zacharycarter> Araq: sorry busy morning but yeah I wrote it and yeah it's small
15:53:11FromGitter<zacharycarter> it's split into two separate git repos
15:58:09*Arrrr joined #nim
15:58:36*xet7 joined #nim
15:59:56*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:03:01*claudiuinberlin joined #nim
16:03:41FromGitter<mratsim> @Yardanico Ah yes, I couldn't make it work with proc because I forgot to output a NimNode instead of a typedesc
16:08:38*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:10:02*azur_kind quit (Read error: Connection reset by peer)
16:24:15*xet7 quit (Quit: quit)
16:25:33*dhalinar joined #nim
16:25:47*gokr quit (Ping timeout: 260 seconds)
16:34:31*Demos_ joined #nim
16:41:53*corey1 joined #nim
16:43:08*corey1 quit (Client Quit)
16:46:39*vlad1777d quit (Quit: Leaving)
16:48:13*endragor quit (Remote host closed the connection)
16:48:41*Demos_ quit (Quit: Demos_)
16:49:52*claudiuinberlin joined #nim
17:05:31*Trustable quit (Remote host closed the connection)
17:05:43*endragor joined #nim
17:05:44*endragor quit (Remote host closed the connection)
17:06:11FromGitter<mratsim> @Yardanico, I get type expected error with a compile-time proc
17:07:02*endragor joined #nim
17:09:20FromGitter<Yardanico> ??
17:12:16*sz0 quit (Quit: Connection closed for inactivity)
17:14:13*couven92 quit (Quit: Client disconnecting)
17:14:48*dhalinar quit (Ping timeout: 240 seconds)
17:16:10*Ven`` joined #nim
17:17:02*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:18:04*claudiuinberlin joined #nim
17:26:25*taaperotassu quit (Ping timeout: 248 seconds)
17:29:49*Jesin quit (Quit: Leaving)
17:30:27Demos[m]you know what would be awesome
17:30:42Demos[m]vscode plugin that ran c2nim on a snippet and replaced it with nim
17:30:47Demos[m]for quick and dirty porting stuff
17:32:12*libman quit (Quit: Connection closed for inactivity)
17:33:13FromGitter<Yardanico> why plugin though?
17:33:19FromGitter<Yardanico> you can do it with a simple shell script :D
17:34:48*endragor_ joined #nim
17:36:18*taaperotassu joined #nim
17:38:07*endragor quit (Ping timeout: 248 seconds)
17:39:52*endragor_ quit (Remote host closed the connection)
17:42:03*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:44:04*d10n quit (Excess Flood)
17:44:11*d10n joined #nim
17:44:11*d10n quit (Changing host)
17:44:11*d10n joined #nim
17:46:13*claudiuinberlin joined #nim
17:49:15*Demos_ joined #nim
18:04:02FromGitter<Yardanico> @brentp about mathexpr: maybe https://github.com/sid-code/boolalg is that you need?
18:04:18FromGitter<Grabli66> Is it posible to create async iterator? :)
18:04:20AraqDemos[m]: yeah, that's actually quite a generic task
18:04:33Araq"run program over this snippet"
18:04:46FromGitter<Yardanico> @Grabli66 no, because async proc becomes an iterator itself
18:05:00FromGitter<Yardanico> async is implemented by (ab)using iterators :)
18:05:03Araqgrabli66: yes because async is built on iterators
18:06:26FromGitter<Grabli66> But why i can't use "await" in iterator?
18:07:27FromGitter<brentp> @Yardanico thanks for the pointer. that doesn't seem to support e.g. `>` or `<` either
18:10:00FromGitter<Yardanico> @brentp well my mathexpr is pretty basic. I also have a separated parser/evaluator version, but it's slower (because steps are separated)
18:10:39FromGitter<Yardanico> I should just port tinyexpr to Nim
18:11:06FromGitter<Yardanico> and then refactor it
18:11:11FromGitter<Yardanico> it's only ~600 lines
18:11:58FromGitter<Yardanico> I'm talking about this : https://github.com/codeplea/tinyexpr/
18:13:19dom96Grabli66: yes, use a FutureStream
18:13:42FromGitter<brentp> @Yardanico or e.g. https://github.com/attractivechaos/klib/blob/master/kexpr.c
18:13:58*parakeet joined #nim
18:15:41*parakeet left #nim (#nim)
18:20:58*Jesin joined #nim
18:21:28FromGitter<ephja> are destructors not supposed to work for immutable objects?
18:22:26*Demos_ quit (Quit: Demos_)
18:22:45*Demos_ joined #nim
18:24:02FromGitter<Yardanico> dom96: I need to create an iterator which returns FutureStream or what?
18:24:09*nsf joined #nim
18:24:37dom96no, an async proc
18:28:52*parakeet joined #nim
18:29:31*adeohluwa quit (Quit: Connection closed for inactivity)
18:32:01FromGitter<Yardanico> hmmmm, I can't really find any examples :P
18:32:11FromGitter<Yardanico> basically I wanted something to use with for loop
18:32:12FromGitter<ephja> nevermind
18:32:18FromGitter<Yardanico> so "for event in myloop(): stuff"
18:32:23FromGitter<Yardanico> and myloop would do some async work
18:32:27FromGitter<Yardanico> is this possible?
18:39:59*taaperotassu quit (Ping timeout: 248 seconds)
18:41:34*Demos_ quit (Quit: Demos_)
18:42:00*libman joined #nim
18:43:35*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:44:00*Demos_ joined #nim
18:45:35*claudiuinberlin joined #nim
18:46:33*parakeet quit (Ping timeout: 240 seconds)
18:46:46*parakeet joined #nim
18:47:35*parakeet left #nim (#nim)
18:50:37*taaperotassu joined #nim
19:03:42*Demos_ quit (Quit: Demos_)
19:04:01*Demos_ joined #nim
19:09:35*relax quit (Ping timeout: 240 seconds)
19:12:57*Vladar quit (Remote host closed the connection)
19:17:28*Arrrr quit (Read error: Connection reset by peer)
19:22:08FromGitter<adamrezich> yesterday I asked a question about DLLs; @bogen pointed me to https://forum.nim-lang.org/t/1400 as an example, but I can't seem to make it work when passing ref objects around... I thought this was supposed to work? https://gist.github.com/rezich/17effdc5e1e2ac936221959f3e8e4aec
19:22:32*miran quit (Ping timeout: 260 seconds)
19:23:42*taaperotassu quit (Ping timeout: 258 seconds)
19:29:12FromGitter<adamrezich> if I make `Foo` an `object` it works, as in, you pass the whole object, but I can't seem to pass the object to the proc in the DLL by pointer nor by `ref`. is this impossible?
19:30:30FromGitter<Yardanico> well I don't really know, maybe you can try passing apointer instead?
19:31:15Araqyou need to compile against "nimrtl.dll" as the docs explain
19:32:01FromGitter<Yardanico> ah, didn't you do that? @adamrezich
19:32:57*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:33:18*taaperotassu joined #nim
19:33:32*claudiuinberlin joined #nim
19:33:53FromGitter<Yardanico> also, I assume it isn't possible to use async procedures from another dll's ?
19:33:58FromGitter<Yardanico> if they're written in Nim too
19:35:31FromGitter<adamrezich> I missed the nimrtl.dll thing, that forum post mentions it but was also confused by it
19:36:07FromGitter<Yardanico> well I think you should read the docs :)
19:36:08FromGitter<adamrezich> I have a nimrtl.dll in my nim/lib, do I include it with my project then?
19:36:12FromGitter<Yardanico> *firstly
19:36:28FromGitter<Yardanico> https://nim-lang.org/docs/nimc.html#dll-generation
19:36:50FromGitter<Yardanico> if you want to link with it, use nim c -d:useNimRtl myprog.nim
19:37:05FromGitter<Yardanico> and then nimrtl.dll should be accessible from your main executable (or dll, I don't really know)
19:37:11*Demos_ quit (Quit: Demos_)
19:37:26FromGitter<adamrezich> yeah I'm confused by that, I ran that and it failed because it couldn't find nimrtl.dll, because it's in my nim/lib, not in my project directory. so am I supposed to copy it there?
19:37:31*Demos_ joined #nim
19:37:36Araqyes.
19:37:36FromGitter<Yardanico> yes
19:38:00AraqDLLs are always next to the .exe, otherwise they are looked up in the PATH
19:38:46FromGitter<adamrezich> right, I just wasn't sure if I was supposed to include it in my project or if there was some internal way of handling it for me
19:40:12FromGitter<adamrezich> do I need to -d:useNimRtl for the dll too?
19:40:27Araqyes
19:40:54Araqthat's the point, every binary asks nimrtl.dll for memory
19:41:20Araqand so everything goes through the same alloctor
19:42:00FromGitter<adamrezich> sure, makes sense
19:43:31FromGitter<Yardanico> hmm, something interesting here https://github.com/SunDwarf/NimBA :)
19:44:11SunDwarfuh oh
19:44:11FromGitter<adamrezich> if you take that same gist, put nimrtl.dll in the directory, and do ⏎ ⏎ ```nim c -d:useNimRtl --app:lib demo ⏎ nim c -d:useNimRtl -r app``` ⏎ ⏎ it compiles, but still fails to pass the ref object correctly :\ [https://gitter.im/nim-lang/Nim?at=59d53a0bb59d55b8237307f7]
19:44:15SunDwarfyou found my awful repo
19:44:18FromGitter<Yardanico> oh, hi :)
19:44:24FromGitter<Yardanico> well I search for new nim repos everyday
19:44:45SunDwarfpls dont judge i used nim for a bunch of stuff like a year ago and now im trying again
19:45:01FromGitter<Yardanico> I don't want to do that :)
19:45:08FromGitter<Yardanico> nim community is very friendly :)
19:45:55AraqI am not, apparently.
19:46:07FromGitter<ephja> code not up to standard. you must leave the premise immediately
19:46:22FromGitter<Yardanico> :D
19:46:49FromGitter<Yardanico> SunDwarf: also your logging templates can be improved a bit by adding line info :)
19:49:44FromGitter<Yardanico> https://gist.github.com/Yardanico/768949318035d7f7729b2493616c1ce1
19:50:46FromGitter<Yardanico> this is a really neat thing
19:51:21FromGitter<ephja> premises*
19:51:43SunDwarfthanks yardanico I didn't know that was possible
19:52:12FromGitter<Yardanico> well instantiationInfo has an example like this in docs :)
19:52:22FromGitter<Yardanico> https://nim-lang.org/docs/system.html#instantiationInfo
19:52:44SunDwarfconfession the filename bit was copy/pasted
19:52:54SunDwarftis why I didnt see it
19:53:00FromGitter<Yardanico> ok, that's fine
19:53:16FromGitter<adamrezich> updated the gist, still having problems passing a `ref object` or `pointer` to the dll—any ideas on what I'm doing wrong? https://gist.github.com/rezich/17effdc5e1e2ac936221959f3e8e4aec
19:54:15FromGitter<Yardanico> ah, also this can be improved - "pos" is not needed at runtime at all
19:55:44FromGitter<Yardanico> I updated the gist
19:56:11*Demos_ quit (Quit: Demos_)
19:56:27*Demos_ joined #nim
20:00:02*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:01:11*relax joined #nim
20:06:56*couven92 joined #nim
20:09:57*claudiuinberlin joined #nim
20:12:24*claudiuinberlin quit (Client Quit)
20:14:40Demos[m]is there a library of some standard importcpp'd stdlib things
20:17:54*zachk joined #nim
20:27:14*claudiuinberlin joined #nim
20:29:07*Snircle joined #nim
20:30:32*Demos_ quit (Quit: Demos_)
20:30:50*Demos_ joined #nim
20:44:51FromGitter<gokr> @dom96 I meant to ask what support there is in Jester for "long http requests" but... well, I got distracted :)
20:45:38Demos[m]what's the bests way to allocate a importcpp'd object on heap?
20:48:39*Demos_ quit (Quit: Demos_)
20:48:58*Demos_ joined #nim
20:49:05*Demos_ quit (Client Quit)
20:49:23*Demos_ joined #nim
20:51:43*gokr joined #nim
20:52:08*nsf quit (Quit: WeeChat 1.9)
20:52:12*libman quit (Quit: Connection closed for inactivity)
20:54:54FromGitter<mratsim> For Travis CI MacOSX build, any idea which option has the less wait time? (https://blog.travis-ci.com/2017-09-22-macos-update) ⏎ ⏎ > Currently, Travis CI has three types of hosted build environments for open source customers hosted on three different cloud providers: ⏎ ⏎ > sudo: false, container-based (Docker / Ubuntu) hosted on Amazon AWS EC2 ... [https://gitter.im/nim-lang/Nim?at=59d54a9d210ac26920aa2c67]
20:58:47FromGitter<mratsim> ah I misread >_> I thought they had 3 macOS solutions ...
21:09:38*Ginguin joined #nim
21:09:50*Ginguin left #nim (#nim)
21:11:50FromGitter<mratsim> @dom96 I don’t see the Nimble tag mentionned anywhere in nimble repo. Missing In Action? https://github.com/yglukhov/nimble-tag
21:12:15dom96Needs to be made smaller first
21:18:38*Demos_ quit (Quit: Demos_)
21:20:34*xet7 joined #nim
21:22:20FromGitter<brentp> @Yardanico https://github.com/brentp/kexpr-nim
21:35:51Demos[m]how do I name a nimscript for the equivalent of having a nim.cfg file in the root of my project?
21:37:07*Ven`` quit (Ping timeout: 255 seconds)
21:41:19*gokr quit (Ping timeout: 248 seconds)
21:42:26FromGitter<Yardanico> @brentp I was talking about porting it, not creating a wrapper :) I already had tinyexpr wrapper in my mathexpr repo
21:43:14FromGitter<brentp> yeah. I figured. I was just familiar with that lib and need some of the features it has.
21:46:45*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:57:10dom96damn, I'm pretty proud of how I'm solving this CS assignment in Nim
21:57:14dom96Too bad I can't share it :)
22:00:11*Demos_ joined #nim
22:05:36Demos[m]nim is such a lifesaver when you're like "crap I need to use cpp for this"
22:05:46Demos[m]and you don't want to force everyone to install calypso
22:06:18Demos[m]a calypso like project for nim would be MEGA cool btw
22:06:22Demos[m]it's a ton of work though
22:19:40*Demos_ quit (Quit: Demos_)
22:19:58*Demos_ joined #nim
22:29:57FromGitter<zacharycarter> time to write another tmx parser
22:41:09*Demos_ quit (Quit: Demos_)
22:41:26*Demos_ joined #nim
22:48:46adam12:)
22:50:25FromGitter<brentp> anyone know of any examples of packages in nimble that include c code and use `{.compile.}` rather than linking to shared lib?
22:51:58FromGitter<brentp> cant figure out how to get the library that i posted above to install with nimble.
22:53:04FromGitter<zacharycarter> yeah
22:53:19FromGitter<zacharycarter> https://github.com/zacharycarter/nuklear-nim
22:57:15FromGitter<brentp> cheers
23:05:03*relax quit (Ping timeout: 240 seconds)
23:14:04*Demos_ quit (Quit: Demos_)
23:14:24*Demos_ joined #nim
23:17:23*couven92 quit (Quit: Client Disconnecting)
23:33:38*Demos_ quit (Quit: Demos_)
23:33:54*Demos_ joined #nim