<< 22-05-2017 >>

00:20:30*PMunch quit (Quit: leaving)
00:42:51*sz0 quit (Quit: Connection closed for inactivity)
00:45:57*dead1 joined #nim
00:54:26dead1please to do i use hexchat to browse anonymous with tor
00:54:52Neomexare you chinese?
00:55:03Neomexotherwise theres no excuse for your bad english
00:56:47skrylari have not poked with async and await in nim
01:03:16skrylar"vtable types." noice.
01:03:21skrylardid you get those before or after go :)
01:05:02*couven92 quit (Quit: Client Disconnecting)
01:07:17FromGitter<Varriount> vtable types don't exist yet
01:09:49*vlad1777d joined #nim
01:13:45FromGitter<Varriount> Unfortunately.
01:37:40*chemist69 quit (Ping timeout: 246 seconds)
01:47:27FromGitter<Varriount> @Araq How would I go about parsing JSON at compile time?
01:47:46FromGitter<Varriount> The current JSON module won't work at compile time
01:49:28*ftsf_ quit (Ping timeout: 268 seconds)
01:52:06*chemist69 joined #nim
01:56:23FromGitter<Varriount> And getting 'when nimvm' working is going to require some effort, as it's "special"
02:02:15libmanhttps://github.com/OpenSystemsLab/jsmn.nim
02:06:27FromGitter<Varriount> libman: Did you write that?
02:06:45libmanNo. I didn't write anything of note.
02:08:35FromGitter<Varriount> Well, hopefully it will work at compile time.
02:09:12FromGitter<Varriount> I've hit a dead end trying to modify the standard library, as 'when nimvm' doesn't work in type sections.
02:12:14libmanA couple other JSON libs in nimble. Hopefully at least one of them works. Sad though.
02:13:15libmanYou can always do the equivalent of `go generate` /irony
02:13:49FromGitter<Varriount> I know it's all magical, but I wish 'when nimvm' worked like a regular when condition
02:17:20FromGitter<Varriount> Ugh, the problem with that library is that it requires a fixed buffer of memory. :/
02:20:51FromGitter<Varriount> Still, it works at compile time
02:24:03libmanThat library is AL2, so you didn't hear about it from me. ;)
02:26:35FromGitter<Varriount> AL2?
02:33:54libmanHmm, https://github.com/OpenSystemsLab/jsmn.nim/blob/master/jsmn.nim says "Apache license" in a comment but everything else says MIT.
02:34:42*pilne quit (Quit: Quitting!)
02:35:31FromGitter<Varriount> Bah. I think I'll just put off JSON parsing then.
02:35:35*BennyElg_ joined #nim
02:35:35*BennyElg quit (Ping timeout: 240 seconds)
02:38:53*yglukhov joined #nim
02:43:08*yglukhov quit (Ping timeout: 240 seconds)
02:43:08libmanThis is a big flaw. Stdlib should have a JSON parser for all seasons.
02:52:59*Snircle joined #nim
03:14:06skrylarhm
03:14:14skrylarwonder why it doesn't work?
03:14:57*BennyElg_ quit (Read error: Connection reset by peer)
03:15:43*BennyElg joined #nim
03:16:34FromGitter<Varriount> lexbase (which is what the parsers use) makes use of a cstring in the BaseLexer type
03:17:17FromGitter<Varriount> there is a switch to use a regular string (for the JS backend) however `when nimvm` won't work with it.
03:17:38FromGitter<Varriount> Even generating two type definitions for each case doesn't work - I get an error about duplicate types
03:21:48*BennyElg quit (Ping timeout: 240 seconds)
03:22:25*BennyElg joined #nim
03:43:48*Neomex quit (Ping timeout: 260 seconds)
03:44:10*skrylar quit (Ping timeout: 268 seconds)
03:46:55*Neomex joined #nim
03:57:48*BennyElg quit (Ping timeout: 260 seconds)
03:59:01*BennyElg joined #nim
04:04:31*BennyElg quit (Ping timeout: 268 seconds)
04:04:50*BennyElg joined #nim
04:05:56*Nobabs27 quit (Quit: Leaving)
04:09:57*dead1 quit (Remote host closed the connection)
04:10:08*BennyElg quit (Ping timeout: 246 seconds)
04:10:09*dead1 joined #nim
04:10:57*BennyElg joined #nim
04:11:30*chrisheller quit (Remote host closed the connection)
04:13:59*chrisheller joined #nim
04:17:57*chrisheller quit (Remote host closed the connection)
04:18:10*chrisheller joined #nim
04:25:11*dead1 quit (Ping timeout: 255 seconds)
04:27:38*BennyElg quit (Remote host closed the connection)
04:31:11FromGitter<zacharycarter> @Varriount what are you using for xml marshalling?
04:31:19*skrylar joined #nim
04:31:55skrylarhttp://ix.io/uwo hmm functional options work alright in nim
04:32:04skrylarCould do without the explicit []
04:40:45*yglukhov joined #nim
04:45:24*yglukhov quit (Ping timeout: 260 seconds)
05:00:15*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:09:08*chemist69 quit (Ping timeout: 240 seconds)
05:11:52*chemist69 joined #nim
05:12:22*dddddd quit (Remote host closed the connection)
05:18:08*xet7_ joined #nim
05:21:28*xet7 quit (Ping timeout: 260 seconds)
05:21:32*Neomex quit (Quit: Leaving)
05:22:38*vlad1777d quit (Remote host closed the connection)
05:23:27*lockdown joined #nim
05:23:53FromGitter<Varriount> Hm. How would I inject a symbol into a block of code passed into a template?
05:28:18*libman quit (Quit: Connection closed for inactivity)
05:30:22*sz0 joined #nim
06:00:07*rauss quit (Quit: WeeChat 1.8)
06:08:47*Arrrr joined #nim
06:09:06*Vladar joined #nim
06:11:37bozaloshtshVarriount: like this? https://glot.io/snippets/eq34nnwu9s
06:11:56bozaloshtsh(inject pragma)
06:16:48FromGitter<Varriount> bozaloshtsh: it's also visible outside the passed in block though
06:17:54FromGitter<Varriount> But this seems to work: https://glot.io/snippets/eq34tukfnw
06:21:38ftsf\o/ my nim game won the Ludum Dare competition, hopefully that will help Nim get some more attention in game dev circles =)
06:22:02bozaloshtshwow awesome
06:23:15FromGitter<zacharycarter> grats!
06:23:48*yglukhov joined #nim
06:24:21ArrrrYou are truly a lucky fellow
06:25:26ftsfi hope it wasn't too much luck =)
06:25:34ftsfpretty pleased though
06:25:41FromGitter<zacharycarter> ftsf: couple of things
06:26:24FromGitter<zacharycarter> 1) is the source code available? if not making it so I think would compound the interest levels it potentilaly draws
06:26:30FromGitter<zacharycarter> potentially*
06:27:25FromGitter<zacharycarter> 2) I think we still need more of an ecosystem before Nim becomes really popular for gaming. Even if SDL2 is the established / popular way for building games with Nim - I'm still not sure things exist like support for tiled maps etc
06:28:22ftsfzachary, yep source is available (requirement for the competition)
06:28:29*yglukhov quit (Ping timeout: 255 seconds)
06:28:35FromGitter<zacharycarter> ah good
06:28:45ArrrrLink?
06:28:59FromGitter<zacharycarter> I didn't realize that nimgame2 had support for tilemaps already, maybe I'm just making things up then
06:29:02ftsfi've got tilemap loading from Tiled json output
06:29:11FromGitter<zacharycarter> nice :)
06:29:11ftsfhttps://github.com/ftsf/ld38-smalltrek
06:29:18ftsfquite trivial to do
06:30:01FromGitter<zacharycarter> yeah I'm doing the same thing with frag right now
06:30:12FromGitter<zacharycarter> I made this over the weekend
06:30:37ftsfand now Tiled won't compile after upgrading my distro so i wrote a tilemap editor in nim
06:30:44FromGitter<zacharycarter> http://imgur.com/a/ItL5G
06:31:04ftsfcute!
06:31:04FromGitter<zacharycarter> are you going to publish it ftsf? I'd love to use it for frag
06:31:24ftsfat some point, it's currently very basic and built on top of nico
06:31:51FromGitter<zacharycarter> ah okay gotcha
06:33:00FromGitter<zacharycarter> ftsf: I take it you're not using the zlib compression from tiled or at least you weren't when you wrote your json parser?
06:33:08ftsfnope
06:33:24ftsfnot using any compression
06:33:33FromGitter<zacharycarter> it'd be nice if a pure nim solution was arrived at in whatever you end up building for your map editor
06:33:41FromGitter<zacharycarter> for compression I mean
06:34:11FromGitter<zacharycarter> I guess if the data is small enough it doesn't matter, but huge tile maps could get heavy
06:37:16*BennyElg joined #nim
06:39:35*BennyElg quit (Read error: Connection reset by peer)
06:39:35*BennyElg_ joined #nim
06:40:20ftsf*nods*
06:40:52ftsfcurrently no compression libs for nim?
06:41:46*nsf joined #nim
06:41:53FromGitter<zacharycarter> hrm not sure
06:44:20FromGitter<stisa> I think nimPNG has an implementation of DEFLATE in pure nim, not sure how easy it would be to make it a separate package
06:47:36ftsfhttps://github.com/jangko/nimPNG/blob/master/private/nimz.nim looks pretty self contained
06:48:17FromGitter<zacharycarter> aye
07:04:20*BennyElg joined #nim
07:04:20*BennyElg_ quit (Read error: Connection reset by peer)
07:07:27*dead1 joined #nim
07:07:33*adeohluwa joined #nim
07:12:36*dead1 quit (Ping timeout: 268 seconds)
07:17:15*vlad1777d joined #nim
07:19:22*yglukhov joined #nim
07:26:33*rokups joined #nim
07:29:17*yglukhov quit (Remote host closed the connection)
07:30:04*yglukhov joined #nim
07:30:15*xet7_ is now known as xet7
07:34:19*yeeve quit (Ping timeout: 246 seconds)
07:41:26*yeeve joined #nim
07:48:08*Andris_zbx joined #nim
08:03:18*BennyElg quit (Remote host closed the connection)
08:03:45*BennyElg joined #nim
08:08:43*BennyElg quit (Ping timeout: 268 seconds)
08:13:21*vlad1777d_ joined #nim
08:13:35*vlad1777d quit (Ping timeout: 240 seconds)
08:14:33*BennyElg joined #nim
08:15:35*xet7_ joined #nim
08:16:37*xet7_ quit (Remote host closed the connection)
08:17:32skrylartilemaps arent so bad depending on your gpu targets
08:17:34*xet7 quit (Ping timeout: 240 seconds)
08:17:58skrylarif you have instanced geometry you're golden
08:30:27*yeeve quit (Ping timeout: 240 seconds)
08:31:34*xet7 joined #nim
08:51:16*yglukhov quit (Remote host closed the connection)
08:53:55*skrylar quit (Quit: leaving)
08:57:04*bjz joined #nim
08:59:15*skrylar joined #nim
09:06:17*yeeve joined #nim
09:17:18*adeohluwa quit (Quit: Connection closed for inactivity)
09:20:10*yglukhov joined #nim
09:29:17ftsfskrylar, heh i'm doing it all in software
09:30:31*sz0 quit (Quit: Connection closed for inactivity)
09:30:59ftsfbut yeah would be very easy to do on gpu
09:31:11skrylarshould be doing it on the gpu
09:31:17skrylardraw calls matter
09:31:43ftsfentirely software i mean, no GL etc
09:31:55skrylarah
09:32:05ftsfjust drawing to a seq[uint8]
09:32:41ftsfwhich after everything is done i convert to an SDL Surface and draw it to the screen.
09:32:48ftsfor html canvas
09:35:07*yglukhov quit (Remote host closed the connection)
09:40:05*PMunch joined #nim
09:40:50*yglukhov joined #nim
09:42:15*yglukhov quit (Remote host closed the connection)
09:42:28*yglukhov joined #nim
09:44:18*yglukhov quit (Remote host closed the connection)
09:44:58skrylarah bleh. apparently kagi died last year
09:53:08*yglukhov joined #nim
09:55:22PMunchhttps://nim-lang.org/docs/docgen.html#other-input-formats Hmm, the docgen.txt link is broken
10:01:53*PMunch quit (Remote host closed the connection)
10:03:22Trioxinjust bought Nim in Action. Let's see what we have here
10:07:37*Ven joined #nim
10:08:01*Ven is now known as Guest38993
10:09:18*Guest38993 quit (Client Quit)
10:11:56*yglukhov quit (Remote host closed the connection)
10:13:17dom96congrats ftsf! :)
10:13:31ftsfthanks dom96!
10:16:49*yglukhov joined #nim
10:19:28*PMunch joined #nim
10:24:36*chrisheller quit (Remote host closed the connection)
10:41:27*chemist69 quit (Ping timeout: 260 seconds)
10:45:28*chemist69 joined #nim
11:02:28*Snircle joined #nim
11:03:47PMunchHmm, I've set up a very simple server with Jester and MySql
11:04:19PMunchBasically it has a data-in post request and a couple data-out get requests that returns JSON formatted data, simple stuff
11:05:20ftsfmmm i haven't tried jester yet, nice to use?
11:05:25PMunchBut for performance reasons I'd like to keep a MySQL connection open and not have to reconnect for every lookup, but the connection keeps timing out because of inactivity. What's the preferred way of dealing with this?
11:05:38PMunchftsf, yeah Jester is really nice
11:05:46PMunchThe entire server is ~160 lines long :P
11:05:51ftsfcool
11:05:59ftsfPMunch, use a connection pooling proxy?
11:06:35PMunchHmm, well that might work
11:07:11PMunchBut then I'd need to check the connections to see if they are up..
11:09:07PMunchCurrently I'm wrapping my db connections in a try catch and see if I get the error code for a disconnected server and then try again once
11:09:40*yglukhov quit (Remote host closed the connection)
11:13:55*skrylar quit (Quit: Leaving)
11:16:11*yglukhov joined #nim
11:17:50*yglukhov quit (Remote host closed the connection)
11:17:55ftsfPMunch, the pooling software should take care of that
11:18:06*yglukhov joined #nim
11:18:59ftsfit's basically a piece of dumb software that opens N sql connections and forwards incoming requests to one of the connections in the pool and returns the results.
11:19:47ftsfcan open more if needed and then close extra ones if they've been around too long and keep a minimum number open
11:22:19PMunchWell I really only need one for this
11:22:27PMunchIt's not meant to scale
11:22:56PMunchAnd I could just program in a timer based on my MySql timeout but I feel that's cheating :P
11:23:12PMunchWhat if I change the timeout and forgot I had it hard-coded into my server..
11:23:29ftsfquery it?
11:23:35ftsfsend keepalives
11:24:23ftsfmysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
11:25:01ftsfhmm doesn't look like nim's db_mysql can set options
11:25:35ftsfoh, you have to use mysql not db_mysql
11:25:37PMunchWell there is the mysql module which lies behind it
11:26:08ftsfhmm which can only set server options, not client options
11:26:40ftsfthere's a reconnect field on St_mysql
11:27:21ftsfi'm sure there's a way to set it, but i'm not sure how =p
11:29:30PMunchYeah I tried to set it but that did nothing :P
11:29:48ftsfmysql.options(OPT_RECONNECT, cast[cstring](somethingWithValueZero))
11:30:03ftsferr 1 rather than 0
11:30:09PMunchI'll just stick to my reconnect on disconnected error code exception handling
11:30:50*bjz_ joined #nim
11:31:33*chrisheller joined #nim
11:32:01FromGitter<BontaVlad> What is the difference between `ref object` and `ref of RootObject`, when to use one over the other?
11:32:27*bjz quit (Ping timeout: 245 seconds)
11:32:34PMunchBontaVlad, ref object of RootObject supports inheritance
11:32:47ftsfobject of RootObject can be inherited from, just object cannot
11:33:00PMunchStructurally it keeps its type information at offset 0
11:33:03ftsfobject of RootObject has a hidden field to store the type
11:33:41FromGitter<BontaVlad> @PMuch, @ftsf, great info, thx a lot
11:36:04*chrisheller quit (Ping timeout: 260 seconds)
11:36:23FromGitter<BontaVlad> Does anybody use spacemacs for nim development? With the newer version, autocomplete is blocking every time it queries nim-suggest, and flycheck-nim seems broken
11:37:10FromGitter<BontaVlad> I looked on the nim-mode project page and flycheck issues, but I found nothing to get me started in fixing these issues
11:41:35*yglukhov quit (Remote host closed the connection)
11:41:40ftsfi'm not sure what spacemacs is, but nimsuggest doesn't work for me at all
11:44:00FromGitter<BontaVlad> oh, spacemacs is just emacs with some fancy packages/configuration.
11:44:31FromGitter<zacharycarter> yeah it's not working for me either with vscode
11:44:33FromGitter<zacharycarter> as far as I can tell
11:45:36FromGitter<BontaVlad> in my case it seems that nimsuggest returns the correct output, it just blocks my editor for like 3 seconds every time it queryes
11:45:56FromGitter<BontaVlad> and flycheck worked as expected in the 0.16x version
11:46:22FromGitter<BontaVlad> I think nimsuggest change the output format :\
11:47:06FromGitter<BontaVlad> elisp seems alien to me :), so I have a hard time tracking down the issue
12:03:35*krux02 joined #nim
12:12:04*gokr joined #nim
12:16:21*Arrrr quit (Disconnected by services)
12:16:21*Arrrr1 joined #nim
12:17:25*yglukhov joined #nim
12:17:36*Arrrr1 quit (Client Quit)
12:34:53*kier quit (Ping timeout: 260 seconds)
12:36:35*PMunch quit (Quit: leaving)
12:40:06*chrisheller joined #nim
12:40:10*PMunch joined #nim
12:45:57*PMunch quit (Quit: leaving)
12:46:09*PMunch joined #nim
12:47:07*kier joined #nim
12:56:16*rokups quit (Quit: Connection closed for inactivity)
12:57:46*ftsf quit (Quit: Leaving)
13:00:32*BennyElg quit (Remote host closed the connection)
13:02:50*BennyElg joined #nim
13:04:21*chrisheller quit (Remote host closed the connection)
13:21:45*Tiberium joined #nim
13:30:07*chrisheller joined #nim
13:30:08*coopernurse quit (Quit: Leaving)
13:39:46*krux02 quit (Disconnected by services)
13:39:46*krux02- joined #nim
13:39:50*krux02- is now known as 7GHAA2HLN
13:39:56*krux02 joined #nim
13:40:06*7GHAA2HLN quit (Client Quit)
13:42:31*planhths joined #nim
13:46:29*rauss joined #nim
13:50:59*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:56:47LyndsySimonIs there is a reference out there that focuses on Nim as a bash scripting replacement, or even just focuses on how to manipulate strings for output?
14:02:44FromGitter<ephja> good old blocking code completion
14:03:06FromGitter<ephja> from a time when life was much simpler
14:11:25FromGitter<Varriount> LyndsySimon: You might look at the osproc module, and the sources for the various tools that come with the compiler (koch, the tester, finish.nim)
14:11:48LyndsySimonVarriount: Excellent idea, thanks!
14:13:10FromGitter<Varriount> Koch and finish.nim in particular execute other programs in various ways
14:16:18Trioxinthe Nim book is pretty sweet so far
14:21:07LyndsySimonTrioxin: I just added it to my Amazon wish list, and am asking my boss to buy a copy for the office.
14:24:17*couven92 joined #nim
14:25:28Trioxinit's 39% off with a coupon code
14:25:50Trioxinfrom retailmenot
14:33:58LyndsySimonOOoh.
14:34:45LyndsySimonUnfortunately, my personal finances are in shambles at the moment, and I've instituted a strict "buy nothing" policy until June 9th. I'll probably pick it up then.
14:36:58*BennyElg quit (Remote host closed the connection)
14:38:36*couven92 quit (Quit: Disconnecting)
14:41:16*xyz_ joined #nim
14:41:23xyz_hello
14:41:53xyz_anyone has amy idea what this warning is?
14:41:54xyz_ Warning: File 'pwm.nim' inside package 'boneGPIO' is outside of the permitted namespace, should be inside a directory named 'boneGPIO' but is in a directory named 'bone' instead. This will be an error in the future.
14:42:25FromGitter<andreaferretti> yup
14:42:34FromGitter<andreaferretti> it is exactly what it says
14:42:41xyz_ahd how tp fix it
14:42:51FromGitter<andreaferretti> the file should be inside a directory named bone :-P
14:43:10FromGitter<andreaferretti> the fact is that nimble is kind of standardizing the package structure
14:43:25xyz_well the folder structure is like this: /boneGPIO.git/src/bone/pwm.nim
14:43:45xyz_and pwm.nim is not the only file in there
14:43:54xyz_but it only complains about this one
14:43:58FromGitter<andreaferretti> ops sorry named boneGPIO
14:44:07FromGitter<andreaferretti> I think it just spits out the first offender
14:44:29FromGitter<andreaferretti> if your package name is foo
14:44:32xyz_so is the .git that is doesn't like
14:44:34FromGitter<andreaferretti> you can have foo.nim
14:44:40FromGitter<andreaferretti> and foo/anything
14:44:52FromGitter<andreaferretti> no, it is nimble
14:44:55*chemist69 quit (Ping timeout: 255 seconds)
14:45:12FromGitter<andreaferretti> it tries to enforce a rule whereby if you create a package foo
14:45:24FromGitter<andreaferretti> people will import it as foo or foo/something
14:45:39FromGitter<andreaferretti> in your case the package is called boneGPIO
14:45:46FromGitter<andreaferretti> but you import as bone/something
14:47:08xyz_but then what is the point of the srcDir = "src"?
14:47:13xyz_in the nimble file
14:47:29*Neomex joined #nim
14:48:19demi-because you might want to specify a subdirectory that has the code files of the library and keep the tests separate
14:49:24*chemist69 joined #nim
14:50:38xyz_ok, I don't think I really understand the problem, but let me digg around a bit more. Thanks for now
14:51:54FromGitter<andreaferretti> your entry point is src
14:52:17FromGitter<andreaferretti> this means that one has to import bone/pwm instead of src/bone/pwm
14:52:25xyz_yes
14:52:26FromGitter<andreaferretti> but still the package name does not match
14:52:37FromGitter<andreaferretti> the package name is boneGPIO
14:53:13xyz_but that mean the path should be bonGPIO/src/BoneGPIO/bone/pwm.nim?
14:53:29xyz_that is just stupid :)
14:54:41FromGitter<andreaferretti> nope
14:54:47FromGitter<andreaferretti> src/boneGPIO/pwn.nim
14:55:09FromGitter<andreaferretti> then people could do `import boneGPIO/pwm`
14:55:12xyz_and what do I do with the files in src/
14:55:30FromGitter<andreaferretti> uh?
14:55:47FromGitter<andreaferretti> just rename src/bone to src/boneGPIO
14:55:47euantorThere should be only one file in src/
14:55:53FromGitter<andreaferretti> nothing else has to change
14:55:57xyz_BTW this is the repo I am talking about
14:55:58xyz_https://github.com/xyz32/boneGPIO
14:55:59euantorsrc/boneGPIO.nim
14:56:21FromGitter<andreaferretti> yeah also rename bone.nim to boneGPIO.nim
14:56:28xyz_aaaa
14:56:31xyz_right
14:56:52FromGitter<andreaferretti> long story short, you cannot have a package named boneGPIO which uses the namespace bone
14:57:05FromGitter<andreaferretti> you either change one or the other
14:57:19xyz_ok
14:57:24xyz_I will give it a go
14:57:27xyz_see what happens
14:57:29xyz_thanks
14:58:34LyndsySimonThe only thing I don't like about Nim so far is how it implicitly imports symbols into your namespace when you include something. Python is the only language I feel got that right.
14:59:02LyndsySimonEverything else though feels like a very nice balance between a lisp and a scripting language. It "feels" good.
14:59:53FromGitter<andreaferretti> it turns out it is much less of an issue as you would thin
14:59:55FromGitter<andreaferretti> think
15:00:00FromGitter<andreaferretti> because of overloading
15:00:13FromGitter<andreaferretti> python cannot have overloading because of dynamic types
15:00:22FromGitter<andreaferretti> hence must be more conservative
15:00:29LyndsySimonI don't think it's really an issue per se, just a stylistic difference.
15:01:16LyndsySimonI'm not sure Python *can't* have overloading, especially with the metadata stuff added in 3.x - but it doesn't make sense to.
15:03:45*chrisheller quit (Remote host closed the connection)
15:05:53demi-LyndsySimon: given that you have to explicitly export symbols from a module, i think this works out rather well
15:06:24*vivus joined #nim
15:06:26LyndsySimondemi-: I get that argument :) I just find it a little hard to learn, since I d have to check every imported module to see where a proc is defined.
15:06:38vivusHow do I update nim from 0.16.0 to 0.17.0 ?
15:08:57*Ven joined #nim
15:09:19euantorvivus: Depends on how you installed - did you build from source?
15:09:21*Ven is now known as Guest7189
15:10:02euantorThe current easiest way to install is choosenim: https://github.com/dom96/choosenim
15:10:50vivusyes, I did build from source
15:12:00euantorOk, easiest thing is to install choosenim, delete the existing version of Nim (and remove it from your PATH), and install via choosenim
15:12:12euantorTHen updating future versions can be done through choosenim easily :)
15:25:56*Guest7189 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:26:13*Ven joined #nim
15:26:36*Ven is now known as Guest88924
15:27:28*Guest88924 quit (Client Quit)
15:37:06FromGitter<andreaferretti> @LindySimon what editor do you use?
15:37:20FromGitter<andreaferretti> most support nimsuggest that will make your life much easier
15:47:28*Ven_ joined #nim
15:47:38*couven92 joined #nim
15:49:27FromGitter<Varriount> LyndsySimon: 'from package import nil' will enforce qualifying namespace (same as 'import package' in python)
15:49:46LyndsySimonVarriount: Interesting, thanks :)
15:50:04FromGitter<Varriount> However you lose operators (I think?) and UFCS by doing that
15:50:10LyndsySimonandreaferretti: I prefer JetBrains IDEs, but I haven't found one with Nim support yet so I'm using Atom.
15:50:29*Arrrr joined #nim
15:50:29*Arrrr quit (Changing host)
15:50:29*Arrrr joined #nim
15:51:41*xyz_ quit (Quit: Konversation terminated!)
15:51:56*PMunch quit (Quit: leaving)
15:52:31*Andris_zbx quit (Remote host closed the connection)
15:54:38*couven92 quit (Read error: Connection reset by peer)
15:58:28*kunev quit (Ping timeout: 240 seconds)
15:58:42*gokr quit (Ping timeout: 245 seconds)
15:59:52*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
16:00:40FromGitter<andreaferretti> atom nim plugin should be able to show you where a symbol comes from
16:00:49FromGitter<andreaferretti> I'm using vscode these days
16:00:54*kunev joined #nim
16:00:56FromGitter<andreaferretti> which certainly can
16:01:04FromGitter<andreaferretti> but I recall atom would do that as well
16:01:24FromGitter<andreaferretti> just hover your mouse on the symbol
16:03:37LyndsySimonYes, and it has a shortcut for jump-to-definition. My comment was more of an opinion than a problem I'm having :)
16:10:12demi-hmmm, is there a way to get that functionality in emacs, or at least have nimsuggest tell me where a method is defined?
16:10:19vivusis this the correct format for the .profile PATH: echo 'export PATH=$PATH:$/path/to/Nim/bin' >> ~/.profile ?
16:11:37*kunev quit (Ping timeout: 245 seconds)
16:13:09vivusfixed. there should be no "$" after ":" so $PATH:/path/to/bin
16:13:29*kunev joined #nim
16:17:55Tiberiumvivus, there's $PATH because PATH is an environment variable AFAIK
16:22:51*yglukhov quit (Remote host closed the connection)
16:23:17*kunev quit (Ping timeout: 268 seconds)
16:24:36*kunev joined #nim
16:25:22FromGitter<ephja> yes but there was a second $ after the correction
16:29:04*kunev quit (Ping timeout: 240 seconds)
16:29:28*arnetheduck_ quit (Ping timeout: 240 seconds)
16:30:29*kunev joined #nim
16:35:34*couven92 joined #nim
16:35:52*BennyElg joined #nim
16:38:28*Ven_ quit (Ping timeout: 260 seconds)
16:41:08planhthsHey, I am trying to code an exercise, something like that: https://pastebin.com/raw/SptZZTTU , is not possible right?
16:42:12*Ven joined #nim
16:42:35*Ven is now known as Guest31182
16:43:03FromGitter<ephja> field names can't be present in multiple branches
16:44:15planhthsI started from this https://pastebin.com/raw/u88PufKS but it is required to make instances of all the 'different' objects
16:45:34planhthsso the fields at each case must be different ok
16:45:44FromGitter<ephja> ok well you just need to rename those fields so that they don't appear multiple times
16:45:52FromGitter<ephja> I dunno if this limitation will go away eventually
16:45:56FromGitter<ephja> right
16:46:51*Guest31182 quit (Ping timeout: 260 seconds)
16:48:07planhthswhat about this: https://pastebin.com/raw/44q6sU2r is it possible somehow?
16:49:07*Ven_ joined #nim
16:50:52bozaloshtshwhile on the topic of editors, what's the situation with vim? I'm currently using https://github.com/zah/nim.vim and nothing else
16:51:10bozaloshtshthe neovim nim plugin was too buggy
16:52:09FromGitter<mratsim> is there a recursive include for c2nim. I’m trying to build binding for https://github.com/flame/blis/blob/master/frame/include/blis.h but it’s hundreds of .h …..
16:53:35*Ven_ quit (Ping timeout: 240 seconds)
16:54:01planhthsbecause previously I had code like this: https://pastebin.com/raw/qXuVv1r6 but as you see there are no generics
16:54:03*pilne joined #nim
16:55:10FromGitter<mratsim> ah, from c2nim repo, it doesn’t follow includes
16:58:31*Ven_ joined #nim
16:59:57*kunev quit (Ping timeout: 240 seconds)
17:00:30*BennyElg quit (Ping timeout: 272 seconds)
17:00:34*kunev joined #nim
17:00:44*BennyElg_ joined #nim
17:02:58FromGitter<Varriount> @mratsim Nope.
17:09:48*Ven_ quit (Ping timeout: 240 seconds)
17:12:32*Ven_ joined #nim
17:12:55*Trustable joined #nim
17:17:01*Ven_ quit (Ping timeout: 255 seconds)
17:17:29*nsf quit (Quit: WeeChat 1.7.1)
17:18:51*Ven joined #nim
17:19:04*gokr joined #nim
17:19:14*Ven is now known as Guest70144
17:23:27*Guest70144 quit (Ping timeout: 240 seconds)
17:27:26*Ven joined #nim
17:27:50*Ven is now known as Guest56196
17:32:48*kunev quit (Ping timeout: 240 seconds)
17:33:40*kunev joined #nim
17:35:07*Guest56196 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:40:33*kunev quit (Ping timeout: 260 seconds)
17:40:46dom96yay, Nim wireworld on HN
17:41:18*brson joined #nim
17:42:16*krux02 quit (Remote host closed the connection)
17:42:35*kunev joined #nim
17:46:59*chemist69 quit (Quit: WeeChat 1.7.1)
17:50:53*jsgrant_ joined #nim
17:53:06*Ven_ joined #nim
17:58:07planhthssomeone any ideas?
18:01:21*yglukhov joined #nim
18:02:16*BennyElg_ quit (Remote host closed the connection)
18:03:44*yglukhov quit (Read error: Connection reset by peer)
18:04:16*yglukhov joined #nim
18:05:47*kunev quit (Ping timeout: 245 seconds)
18:05:57ArrrrWhat's the matter?
18:06:37*kunev joined #nim
18:06:46FromGitter<BontaVlad> `Roulette.max_num`?
18:07:21*yglukhov quit (Remote host closed the connection)
18:07:56*yglukhov joined #nim
18:08:54*couven92 quit (Ping timeout: 272 seconds)
18:10:19planhthsI am trying to achieve this https://pastebin.com/raw/44q6sU2r
18:11:13planhthswith these types https://pastebin.com/raw/u88PufKS
18:11:17ArrrrIs FairRoulette, etc ... enums or types?
18:11:58planhthstypes
18:12:11ArrrrAh, and why not `for G in [ABC(), DEF(), GHI()]: let game = G` ?
18:12:14*yglukhov quit (Ping timeout: 246 seconds)
18:12:51planhthsawesome hope it works thank you!
18:14:04FromGitter<BontaVlad> if the above works do you actually need `let game = G`? why not `for game in [ABC(), DEF ...`
18:14:46ArrrrMm, well it wont work because each object is different
18:14:54*libman joined #nim
18:15:00ArrrrMaybe do this: Roulette[T] = ref object of RootRef
18:15:13Arrrrand late: [RootRef(ABC()), DEF(), GHI()]
18:15:27ArrrrI think that way nim will understand the array is of kind RootRef
18:16:10libmanGlad to see Nim on top at HN - https://news.ycombinator.com/item?id=14395087
18:16:34*BennyElg joined #nim
18:16:36planhthsno it doesn't, I will go with RootRef then
18:21:13*dddddd joined #nim
18:23:59*yglukhov joined #nim
18:24:40*yglukhov quit (Client Quit)
18:25:28*Ven_ quit (Ping timeout: 240 seconds)
18:26:46planhthshttps://pastebin.com/raw/cZXAYjYr I get "Error: undeclared field: 'pockets' " is there something I did wrong?
18:27:32*Ven joined #nim
18:27:55*Ven is now known as Guest27595
18:28:36FromGitter<dom96> RootRef doesn't have that field.
18:28:42*chrisheller joined #nim
18:32:08planhthsso if I remove RootRef from line 33: for game in [RootRef(newFairRoulette()), newEuRoulette(), newAmRoulette()]: still getting this error
18:32:16FromGitter<mratsim> Is there a way to do that? Automatically inserting a function before a program terminates? http://img.ctrlv.in/img/17/05/22/59232e7033174.png
18:32:31FromGitter<BontaVlad> finally
18:32:48FromGitter<BontaVlad> `finally`?
18:33:07planhthsmratsim: yes I think its called addQuitProc
18:33:11planhthsfrom system
18:33:37FromGitter<mratsim> yep found it, thanks
18:34:54*yglukhov joined #nim
18:36:32planhthsanyway I think it is not possible with this design, I will revert to the previous. thanks all!
18:39:04TrioxinError: ambiguous identifier: 'auto' --use system.auto or unknown.auto
18:39:10Trioxinwhy does it want me to do such a thing?
18:40:32*yglukhov quit (Remote host closed the connection)
18:43:24Arrrrplanhths, you can test and cast with `if g of ABC: let g = ABC(g)`. But i don't really know what are you trying to achieve, so i can't give better suggestions. You maybe want to checkout methods and closures
18:44:01ArrrrTrioxin, probably the error is somewhere else
18:44:21ArrrrSometimes nim compiler warns you about things that are actually ok
18:44:50Trioxinit's a really simple example
18:45:02Trioxinproc message(recipient: string): auto =
18:45:07*planhths quit (Ping timeout: 268 seconds)
18:45:11Trioxin "Hello " & recipient
18:46:07Trioxinrunning some of the Nim in Action examples
18:46:14vivuswhen creating an array of regex, how do I store/use reStudy? Here is what I currently have: re("some_regex", {reStudy})
18:46:41Arrrrplay.nim compiles your code, which version are you using?
18:46:57Trioxin0.17.0
18:48:43ArrrrIt works in my computer, maybe some issue with spaces?
18:49:21Trioxinnope
18:49:24*PMunch joined #nim
18:49:41Trioxinhttps://hastebin.com/qafekuyoro.cs
18:50:35*Matthias247 joined #nim
18:51:05ArrrrNo issue at all, maybe you defined a .cfg?
18:51:17Trioxinnope
18:51:42Trioxinauto.nim(1, 34) Error: Error: ambiguous identifier: 'auto' --use system.auto or unknown.auto
18:53:46ArrrrThe heck. Are you on devel? I haven't updated in a week maybe
18:54:12Trioxinit says it's using a cfg file but I've never edited it
18:54:27Trioxin~/bin/Nim/config/nim.cfg
18:54:44TrioxinI'm on the latest release
18:55:13def-Trioxin: is your file named auto.nim?
18:55:21Trioxinyeah
18:55:28def-then give it another name
18:56:08Trioxinduh lol
18:56:18def-filename is used as module name in nim
18:57:18Arrrrlol
18:57:32ArrrrI didn't thought about that
18:57:40libmanLots of comments on https://www.reddit.com/r/programming/comments/6cja23/real_world_nim_adventures_medium_blog_platform/
18:58:09*nsf joined #nim
19:03:16FromGitter<BontaVlad> :) the author is located 200km away from me
19:05:05vivushow do I print out a regex ? I tried using "echo myregex" but echo expects something else besides a regex
19:05:16FromGitter<BontaVlad> I hate comments that treat a language only based on syntax while missing a lot of cool features underneath
19:09:33*planhths joined #nim
19:09:54*Vladar quit (Remote host closed the connection)
19:10:40*Guest27595 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:10:57*Ven_ joined #nim
19:14:06*Tiberium quit (Remote host closed the connection)
19:15:35*Ven_ quit (Ping timeout: 246 seconds)
19:15:43*Arrrr quit (Quit: Leaving.)
19:20:00FromGitter<Varriount> vivus: Try 'echo string(regex)'
19:20:03*yglukhov joined #nim
19:20:55*gokr quit (Quit: Leaving.)
19:26:53vivus@Varriount I am just storing a string-equivalent above the regex itself. string(regex) doesn't work
19:30:38*BennyElg quit (Remote host closed the connection)
19:35:08FromGitter<mratsim> Error: invalid order in enum :/ ⏎ ⏎ The library I’m wrapping has sorted it’s error code in reverse order … why ….. ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/nim-lang/Nim?at=59233d6cc4d73f445ad25d88]
19:38:55FromGitter<Varriount> Are negative error codes normal?
19:39:07FromGitter<Varriount> I always thought they should be positive
19:41:03*tuple joined #nim
19:41:11*tuple left #nim ("Leaving")
19:41:31vivusdoes a comma act as a line-break?
19:41:31*tuple joined #nim
19:41:35FromGitter<mratsim> I dunno but when the init proc returns as an int it returns 4294967295 (which is 2^32 -1)
19:41:42*tuple left #nim ("Leaving")
19:43:22FromGitter<mratsim> @vivus you can break after a comma or any operator in enum and within a parenthesis. There is a whole paragraph somewhere in the manual about that iirc
19:44:02vivusI tried doing that for my array, but it is giving some errors. Maybe cause I tried to nest each string in the array below each other
19:44:32FromGitter<mratsim> paste your code, that should be a simple fix
19:46:45vivus@mratsim : https://www.zerobin.net/?830f677126bb3be9#lijXK0jnLovD7xwRT7zZQK2I7KGtlk/0fZMIogSCwVQ=
19:47:49*BennyElg joined #nim
19:48:33FromGitter<mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=592340912b926f8a67801eb1]
19:48:51FromGitter<mratsim> ^ should compile
19:49:13FromGitter<mratsim> in your code you are declaring reg_display twice due to the indentation
19:52:05vivusoh yes you are right. whoa what a bad syntax error XD
19:58:56vivusin an error message, what does the latter number mean: .nim(7, 41) Error: invalid character constant ? (41?)
19:59:11demi-column
19:59:17demi-line 7, col 41
20:08:08vivuswhy is this an error for strings: "<\/a><\/div>" ? I get these types of errors: invalid character constant . so I have to remove the "\" to make it like: "</a></div>" ?
20:12:03*Ven joined #nim
20:12:27*Ven is now known as Guest22322
20:14:33def-vivus: \\ or raw strings
20:16:03*Guest22322 quit (Client Quit)
20:16:30FromGitter<Varriount> `\\` or raw strings
20:17:58*noethics quit (Remote host closed the connection)
20:18:17*noethics joined #nim
20:23:46*BennyElg quit (Ping timeout: 255 seconds)
20:24:11*noethics quit (Ping timeout: 246 seconds)
20:31:04*filcuc joined #nim
20:31:26*gokr joined #nim
20:31:52filcuci'm getting lib/nim/pure/os.nim(802, 33) Error: cannot evaluate at compile time: environment
20:31:53*noethics joined #nim
20:31:56filcucwith nim 0.17.0
20:32:03filcuc:(
20:32:11filcuc(official release)
20:36:07*literal quit (Ping timeout: 268 seconds)
20:36:55*literal joined #nim
20:42:15*Trustable quit (Remote host closed the connection)
20:45:52*filcuc quit (Quit: Konversation terminated!)
20:58:19*gokr left #nim (#nim)
21:09:41*planhths quit (Ping timeout: 246 seconds)
21:17:58PMunchHmm, I'm working on the server stuff again and when I do a table lookup I get a sequence of strings or nil values. I want to turn this into a JSON object so I'm using the JSON module. But since I get it all as strings I need to use the parseX functions from strutils. The problem is with nil values..
21:18:51PMunchThe json module handles nil values fine but I can't write a ternary that returns a nil or an int..
21:19:20PMunchhttp://ix.io/uAO
21:19:26PMunchThat's what I have to do currently..
21:21:56*yglukhov quit (Remote host closed the connection)
21:26:18*vlad1777d_ quit (Quit: Leaving)
21:29:40*nsf quit (Quit: WeeChat 1.7.1)
21:30:51PMunchHmm, could I create an overload of parseInt that takes a null value and returns a null value?
21:31:41PMunchHmm, no wait that won't work..
21:33:14*rauss quit (Quit: WeeChat 1.8)
21:36:01*bjz joined #nim
21:37:26*vlad1777d joined #nim
21:45:59*brson quit (Ping timeout: 260 seconds)
21:49:01libmanCould someone help me write a comeback for a comment (in the r/programming post linked to above) that claims Nim "misses the Go model of M:N threading, probably the killer feature of the language".
21:51:30FromGitter<ephja> it would be neat if `±` could be called like this: x ± y
21:56:30PMunchWell, Nim doesn't have that. And it is one of Gos killer features..
21:57:07PMunchHowever something similar could probably be implemented with some simple macro magic :P
22:05:33*yglukhov joined #nim
22:07:31Trioxinpff. Go...
22:09:23Trioxinthe best thing about Go is the wealth of packages. that and goroutines. pretty much packages
22:21:04*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:24:28TrioxinNim forum is kinda bleh. try this ( https://www.discourse.org/ ) or at least xenforo. Maybe the forum was coded in Nim (idk) but some things don't need to be a reinvented wheel.
22:25:04PMunchTrioxin, yeah it was written in Nim to show that it could be done
22:25:06PMunchIIRC
22:26:04*brson joined #nim
22:26:48PMunchlibman, if you want a comeback you could write something about how Nim gives you the choice. If you want to implement something like goroutines then you can do that, but you can have actual threads if you want that.
22:27:21libmanIf you use reddit, wanna post that yourself?
22:33:50PMunchSure
22:34:04PMunchHmm, I'm having some trouble with Jester
22:34:40PMunchIt's not stopping when I do 'resp404, "Error message"'
22:35:00PMunchSorry, 'resp Http404, "Error message"'
22:39:26Trioxinhow to specify multiple possible variable types for 1 proc argument? I forgot
22:40:31Trioxinprox bla(user: int, string)?
22:40:35PMunchor
22:40:37Trioxinproc*
22:40:44PMunchproc bla(user: int or string)
22:40:50PMunchI think
22:40:52Trioxink
22:49:19*rauss joined #nim
22:49:37*rauss quit (Client Quit)
23:08:33FromGitter<ephja> ```code paste, see link```
23:09:41FromGitter<ephja> oops. edited it without testing. it's actually a tuple with two of those tuples. kinda neat
23:15:13FromGitter<Varriount> Anyone able to figure out how to pass a complex static type to a macro? I can't seem to get this to work: https://gist.github.com/Varriount/a9c2902b39bea50d4b165600dda3f9e8
23:16:13*yglukhov quit (Remote host closed the connection)
23:18:52FromGitter<ephja> I see you are also living on the edge
23:19:24FromGitter<ephja> those constructs are quite fragile
23:20:37*Matthias247 quit (Read error: Connection reset by peer)
23:21:28FromGitter<ephja> I try to find workarounds and then introduce conditional compilation
23:25:10*vlad1777d quit (Quit: Leaving)
23:25:56*yglukhov joined #nim
23:30:03*yglukhov quit (Ping timeout: 240 seconds)
23:30:38*planhths joined #nim
23:43:06FromGitter<Varriount> @ephja The plan is to parse a JSON file, and emit types and procedures that wrap the AWS API
23:43:31FromGitter<Varriount> A "shape" is a structure defined by the API
23:44:12FromGitter<Varriount> I don't get it - NimNodes work, and this isn't that different
23:46:04*ftsf joined #nim
23:46:20*PMunch quit (Remote host closed the connection)
23:51:45FromGitter<Varriount> Huh. It works if I create a dedicated construction procedure. :/