<< 15-06-2018 >>

00:08:45*Electrux joined #nim
00:13:34*Electrux quit (Ping timeout: 264 seconds)
00:22:29*smt quit (Ping timeout: 268 seconds)
00:25:24*xkapastel joined #nim
00:28:42FromGitter<honewatson> @metasyn also if you like vim you could try spacemacs with nim layer and autocomplete layer which has good support with nim suggest
00:40:45*Electrux joined #nim
00:44:57*Electrux quit (Ping timeout: 240 seconds)
00:45:58*find0x90 joined #nim
00:51:17*yglukhov[i] joined #nim
00:55:41*yglukhov[i] quit (Ping timeout: 256 seconds)
01:09:44*Electrux joined #nim
01:14:27*Electrux quit (Ping timeout: 265 seconds)
01:16:54*smt joined #nim
01:23:07FromGitter<ephja> it takes quite some time to bootstrap now
01:25:29*find0x90_ joined #nim
01:27:35FromGitter<ephja> 35*4 seconds
01:27:59*find0x90 quit (Ping timeout: 256 seconds)
01:55:27FromGitter<ephja> 4, 3, w/e
01:56:16*Electrux joined #nim
01:59:01*find0x90_ quit (Quit: find0x90_)
02:00:57*Electrux quit (Ping timeout: 264 seconds)
02:04:16FromGitter<ephja> life is tough
02:15:23*Electrux joined #nim
02:19:18FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b232225202c8f71f5030605]
02:19:32FromGitter<gogolxdong> How to make this right?
02:19:35*Electrux quit (Ping timeout: 240 seconds)
02:23:30FromGitter<gogolxdong> hints cannot add to node kind: nkEmpty when it's plain provider concatenating. but it's a string ,right?
02:24:08FromGitter<gogolxdong> or provider & "DescribeInstanceCallback" hints NimNode & string
02:26:27*Electrux joined #nim
02:30:57*Electrux quit (Ping timeout: 240 seconds)
02:43:59FromGitter<gogolxdong> hints ```
02:44:05FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2327f5c277fb705dcf8099]
02:46:22*Electrux joined #nim
02:51:06*Electrux quit (Ping timeout: 268 seconds)
02:51:28*craigger quit (Quit: bye)
02:51:38*craigger joined #nim
02:51:52*Electrux joined #nim
03:18:15*Jesin quit (Quit: Leaving)
03:29:23FromGitter<gogolxdong> echo repr result ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b23329282b1b355c9596899]
03:30:33FromGitter<gogolxdong> manually written newProc results the same with getAst of template. says proc has no type.
03:31:38FromGitter<gogolxdong> What am I missing?
03:35:18*yglukhov[i] joined #nim
03:39:56*yglukhov[i] quit (Ping timeout: 265 seconds)
03:49:05*Electrux quit (Ping timeout: 240 seconds)
03:54:39*random_auroras joined #nim
03:54:53random_aurorasIs the two-items tuple iterator a special case or does it generalize for any number of items?
03:54:57random_aurorashttps://nim-by-example.github.io/for_iterators/
03:57:05*Electrux joined #nim
03:58:17*endragor joined #nim
04:07:17*rockcavera quit (Remote host closed the connection)
04:11:44FromGitter<kaushalmodi> pairs is a fixed case that returns a 2-value thing.. a tuple with 2 items
04:11:51FromGitter<kaushalmodi> the item types could be anything though
04:13:10random_aurorasFromGitter: Thanks
04:13:10FromGitterrandom_auroras, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
04:13:41FromGitter<kaushalmodi> You're welcome. If you search for "pairs" here: https://nim-lang.org/docs/lib.html. You will find many examples.
04:15:57*random_auroras left #nim ("thanks for the help")
04:48:39*yglukhov[i] joined #nim
04:52:45*yglukhov[i] quit (Ping timeout: 245 seconds)
04:56:40FromGitter<Varriount> I wonder if a macro could generalize for any number of items.
05:09:21*jxy joined #nim
05:17:52*miran joined #nim
05:23:09*smt quit (Remote host closed the connection)
05:28:59*xkapastel quit (Quit: Connection closed for inactivity)
05:39:43*nsf joined #nim
05:45:47Araqvarriount: a for loop macro?
05:48:01*Electrux quit (Quit: WeeChat 2.1)
05:48:19*Electrux joined #nim
06:01:04*jjido joined #nim
06:16:19*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:18:21*miran quit (Ping timeout: 264 seconds)
06:23:37*tribly quit (Quit: WeeChat 2.1)
06:24:14*xet7 joined #nim
06:39:24*rockcavera joined #nim
06:44:43FromGitter<Varriount> Araq: Yes, but I was pondering more on how such a macro would rewrite the body.
06:46:18*jjido joined #nim
06:54:42*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:56:00*thomasross quit (Read error: Connection reset by peer)
06:56:12*thomasross joined #nim
07:06:18*yglukhov[i] joined #nim
07:12:05*Cthalupa quit (Ping timeout: 260 seconds)
07:13:30*Cthalupa joined #nim
07:14:27*rockcavera quit (Killed (verne.freenode.net (Nickname regained by services)))
07:17:51*xet7 quit (Remote host closed the connection)
07:19:36*xet7 joined #nim
07:27:11*NimBot joined #nim
08:11:28FromGitter<mratsim> here you go: https://github.com/numforge/loop-fusion
08:11:51FromGitter<mratsim> It can probably be transformed into a for loop macro
08:12:12FromGitter<mratsim> right now it creates a custom zip on the fly.
08:12:39FromGitter<mratsim> (pun unintended)
08:13:40FromGitter<mratsim> A generic for loop on variadic number of items should be a good addition to sugar.nim
08:14:23*rokups joined #nim
08:21:25FromGitter<rokups> how do i confirm email for old forum account?
08:25:15FromGitter<mratsim> ping @dom96 with your account if you’re stuck
08:26:27FromGitter<rokups> ah made new account. no problem :)
08:59:13*tribly joined #nim
09:12:25*krux02 joined #nim
09:14:31FromGitter<gogolxdong> my macro errors at runtime
09:14:53FromGitter<gogolxdong> ```code paste, see link```
09:15:19FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2383a78864a936cc8a3655]
09:16:46FromGitter<mratsim> result should be untyped no?
09:17:33FromGitter<mratsim> rule of thumbs: macro —> untyped results. proc —> NimNode results.
09:19:09*xet7 quit (Quit: Leaving)
09:19:41FromGitter<gogolxdong> Sharp
09:21:08*xet7 joined #nim
09:26:58Yardanico@mratsim you have a typo "communauty" twice in your changelog - https://github.com/mratsim/Arraymancer/blob/master/changelog.md
09:27:37FromGitter<mratsim> haha, thanks, I even have def instead of proc somehow in a .rst xD
09:49:35*brainproxy quit (Ping timeout: 260 seconds)
09:54:06*elrood joined #nim
09:57:42*dddddd joined #nim
10:18:42*Vladar joined #nim
10:26:44*rokups quit (Quit: Connection closed for inactivity)
10:28:32FromGitter<codenoid> helo
10:28:42PMunchHi
10:28:44FromGitter<codenoid> nim not installed on my laptop
10:28:52FromGitter<codenoid> idk
10:31:54FromGitter<codenoid> https://i.amz.mshcdn.com/Z4RoLEzGGaYG3COtPATqwQkHGl8=/950x534/filters:quality(90)/https%3A%2F%2Fblueprint-api-production.s3.amazonaws.com%2Fuploads%2Fcard%2Fimage%2F469418%2Fe5582afd-4887-478d-8043-0071299682c3.jpg
10:32:22PMunchWhat?
10:33:19PMunchwhois codenoid
10:33:24PMunchWoops :P
10:33:42FromGitter<kaushalmodi> @mratsim The loop fusion library looks really cool! Thanks for sharing.
10:33:45PMunchAnd they're here through Gitter, so that wouldn't have worked anyways :P
10:34:59FromGitter<codenoid> i have hard time when trying to instsall nim without apt-get install or just `make`
10:36:22PMunchcodenoid, OS?
10:36:32FromGitter<codenoid> it's has been 32hours :" ,
10:36:35FromGitter<codenoid> Ubuntu 16.04.04
10:37:21PMunchHave you tried choosenim?
10:39:32FromGitter<codenoid> yes i choose nim
10:42:30PMunchNo the program "choosenim"
10:43:24PMunchRun this command: "curl https://nim-lang.org/choosenim/init.sh -sSf | sh"
10:43:51*brainproxy joined #nim
10:49:21FromGitter<codenoid> i'm little bit confused when chosenim ask me a question "Can choosenim record and send anonymised telemetry data? [y/n]", at least nim has been installed on my machine
10:53:56PMunchYeah I'm not sure what telemetry data that is, maybe dom96 can shed some light on it
10:54:10PMunchBut I'm guessing it's only which Nim version you currently have selected
10:54:26PMunchBut nice that managed to install it
10:54:49PMunchIf you want to change to a different version (or update Nim when a new version drops) you can do that through the choosenim tool
10:55:04PMunchJust have a look at "choosenim --help" to see how it works
10:55:18dom96codenoid: read the message below that
10:55:23dom96It's a link to more information
10:56:08FromGitter<codenoid> https://goo.gl/NzUEPf
10:56:14FromGitter<codenoid> whooott
10:56:48FromGitter<codenoid> really, I am shocked
10:56:54FromGitter<codenoid> gitter show your picture
10:57:06FromGitter<codenoid> out of my expectation
10:57:15dom96what?
10:59:08dom96If you have a problem with it then answer "n"
11:00:22FromGitter<7sDream> @codenoid ⏎ hello Rikka, I'm Yuuta :P
11:01:06FromGitter<codenoid> show your eye :p
11:03:04FromGitter<7sDream> https://i.loli.net/2018/06/15/5b239cdb98fd7.jpg
11:10:18elroodto make it look less shady, you could just state clearly and transparently which kind of date is collected and what for. just a notion of telemetry and a link doesn't leave a good impression
11:10:27elrood*data
11:13:19dom96It's already a long message
11:13:24dom96and it seems people don't even read all of it
11:13:56elroodeven more reason to drop unnecessary data collection
11:13:57dom96Also, this is how homebrew's telemetry is presented
11:14:17dom96Except that it's opt-oit
11:14:19dom96*out
11:14:42dom96If you don't like the telemetry then it's trivial to answer "no"
11:14:48dom96I don't see an issue
11:15:51FromGitter<mratsim> put a link to the source code :p
11:16:25dom96https://github.com/dom96/choosenim/blob/master/analytics.md#where-is-the-code
11:17:06PMunchelrood, it's not unnecessary though.. It let's us know what versions of Nim are used, and what systems people use Nim on..
11:19:11elrooddoesn't make it necessary. and quite apparently it has a strange flavour for other people as well
11:20:35*noonien joined #nim
11:22:03dom96It's necessary to learn what exceptions people are getting
11:22:33dom96Many people won't bother to report such errors if they are just starting out with Nim
11:22:36dom96They'll just give up
11:22:49PMunchWell it's not necessary, which is why you can opt out..
11:24:52elroodyou're mixing up necessary and valuable or convenient there
11:25:37PMunchYeah as I said, it's not necessary
11:25:43*nsf quit (Quit: WeeChat 2.1)
11:26:54elroodit might not be an issue for you, but many people care, and the impression that your developer tools collect data about you isn't something i'd be comfortable with. lower the barriers to adoption for nim, don't raise them
11:28:14PMunchPfft, most people use an IDE that probably reports stuff to their creators without asking..
11:28:28PMunchAnd as we said, you can just opt out..
11:29:06Araqelrood: iirc choosenim does ask. what else would there be to do?
11:29:43FromGitter<kayabaNerve> What Nim IDEs exist BESIDES Aporia?
11:30:16FromGitter<kayabaNerve> I've been using Atom, which is my default editor, with a Nim package but I'm debating bumping it up\
11:30:31elroodwell, you could for example not convey the impression that data collection is something your tools' developers want to do in the first place
11:31:05FromGitter<kayabaNerve> I do need something that allows me to set custom include directories and then factors that into syntax highlighting versus just yelling variable X doesn't exist... That's my current issue with Atom.
11:31:12elroodyou can also just shrug it off, of course. many of you have grown up with facebook, google and an increasing number of everybody elses collecting your data as if it was the most normal thing in the world. but people increasingly care about princliples of data economy and the sort
11:32:00elrood← can't type. meh
11:32:31FromGitter<kayabaNerve> elrood: Get a Nim based neural net to predict what you would type and type it for you.
11:33:31FromGitter<narimiran> @kayabaNerve you could try vscode - it is "atom as it should have been"
11:34:05elroodalexa/google/siri, type anotherrant for me on irc.. oh, wait.. ;P
11:34:38Araqelrood: ok, so nothing but removing this code would make you happy, got it.
11:35:03FromGitter<narimiran> btw, vscode has telemetry enabled by default! ;)
11:35:09AraqI'm not mocking you, just wanted a clear answer and I got it, thanks.
11:35:24Araqit's a respectable position to take.
11:35:55elroodAraq, nah, besides the point, i'm perfectly happy not using choosenim at all, just drawing attention to something that probably will further decrease the number of potential nim users
11:36:39FromGitter<narimiran> elrood: but there is an option (in plain sight) where you can easily opt-out?
11:36:50FromGitter<alehander42> so if it would be an opt-in ?
11:36:54FromGitter<alehander42> wouldn't that be fine?
11:38:36FromGitter<kayabaNerve> @narimiran I consider it the devil and does it even support Nim?
11:38:43elroodi think i've clearly stated what i see as problematic about it, and it's not actually something i personally have an issue with. in the interest of other people feeling comfortable using nim's tools i'd just not collect telemetry data at all, and be done with it
11:38:56FromGitter<kayabaNerve> And I know Visual Studio != VS Code. I've tried and hate both
11:39:31FromGitter<narimiran> @kayabaNerve yeah, there is a nim extension, it's doing its job quite alright. i rate it 5/7.
11:39:37FromGitter<kayabaNerve> Opt-in anonymous data is helpful. I enable it for small projects I trust the team behind and like. I don't do it for commercial corporations or VLC though
11:40:17FromGitter<kayabaNerve> @narimiran Can I set custom compiler flags/include directories, and will the syntax highlighting fail if I do: ⏎ import customModuleOnlyFoundInCompilerIncludeFlag ⏎ ⏎ discard customModule.myVar [https://gitter.im/nim-lang/Nim?at=5b23a5a16b24803e845aa6df]
11:40:27FromGitter<kayabaNerve> Thanks for the answer btw
11:40:59FromGitter<narimiran> @kayabaNerve regarding the devil part and hating VS and vscode - this would probably become big offtopic discussion so i won't go there
11:41:18FromGitter<kaushalmodi> Hello folks, is there an example flow in place that generates binaries for a Nim project in all the different platforms?
11:41:26*brainproxy quit (Ping timeout: 268 seconds)
11:41:30dom96I like to think choosenim's telemetry is a nice compromise
11:41:32FromGitter<kayabaNerve> @kaushalmodi You need cross compilers
11:41:46FromGitter<narimiran> @kayabaNerve regarding the thing you want - i have no idea. it would be best to try it yourself (if only it isn't devil :P)
11:41:48dom96It forces you to make a choice, it doesn't automatically opt you in, and it doesn't automatically opt you out
11:42:11FromGitter<kayabaNerve> I like that and would opt-in
11:42:22FromGitter<kaushalmodi> @kayabaNerve Any pointers?
11:42:46FromGitter<kaushalmodi> I'd like to publish binaries like Go projects do: https://github.com/gohugoio/hugo/releases
11:44:25FromGitter<kayabaNerve> Learn NimScript, Nake, or Make. That's in order of modern preference. No idea if NimScript is enough though. ⏎ ⏎ Get cross compilers. You'll likely want a Linux OS. Get Windows x64 GCC, x32, same for Mac, same for Linux. You can likely find builds for all, for a 64 bit Linux host, in a package repo. ⏎ ⏎ Start using the --cpu and --platform compiler flags. [https://git
11:44:25FromGitter... ter.im/nim-lang/Nim?at=5b23a699ebf21755ca341562]
11:44:33FromGitter<kayabaNerve> Learn how to use when
11:45:07FromGitter<kayabaNerve> *--cpu and --os
11:45:19FromGitter<kayabaNerve> *x86 not x32
11:46:45FromGitter<kaushalmodi> I have access to only a GNU/Linux system. I have never used cross compilers, but would this be correct: It allows me to generate bianries for other OSes from my OS.
11:47:14FromGitter<kaushalmodi> Also, is there a Nim project I can learn from?
11:50:02FromGitter<mratsim> nimx maybe? it targets all + android
11:50:26FromGitter<kaushalmodi> Found this: https://forum.nim-lang.org/t/3487#21805
11:50:40FromGitter<mratsim> but start by reading this: https://nim-lang.org/docs/nimc.html#cross-compilation
11:50:56FromGitter<kaushalmodi> I also need to look into compiling to "statically linked musl"
11:51:00FromGitter<mratsim> If you only want to support desktop (Linux, Windows, Mac) just use a proper CI.
11:52:03FromGitter<mratsim> Here is Travis to test on Mac and Linux: https://github.com/mratsim/Arraymancer/blob/master/.travis.yml
11:52:08FromGitter<kaushalmodi> Rust binaries get compiled to musl target, and they just work everywhere
11:52:20FromGitter<mratsim> and appveyor for windows: https://github.com/mratsim/Arraymancer/blob/master/.appveyor.yml
11:52:44FromGitter<mratsim> you can ask the CI, to build artifacts and publish them automatically as well
11:52:57Araqyeah probably you need musl
11:53:33FromGitter<kaushalmodi> @kayabaNerve @mratsim many thanks for all those pointers!
11:54:21FromGitter<kaushalmodi> Dumb question... Is "musl" a statically linking compiler you install from somewhere?
11:54:50Araqit's an alternative libc implementation that links statically
11:55:11Araqit's only required because we haven't got rid of libc (yet!)
11:56:10FromGitter<kaushalmodi> And libc is the same glibc that causes choosenim installation issues?
11:56:38FromGitter<kayabaNerve> Libc is provided by glibc
11:56:44FromGitter<kayabaNerve> libc isn't only by glibc
11:57:08FromGitter<kaushalmodi> Hmm, TIL.. TIL many things!
11:57:38FromGitter<kaushalmodi> What if choosenim is compiled using musl?
12:01:33Araqwhat if it isn't?
12:01:50Araqwhat's the topic/problem?
12:02:22FromGitter<kaushalmodi> It doesn't work on my machine as the glibc on RHEL 6.6 is too old
12:03:50FromGitter<kaushalmodi> I have gone down the rabbit hole to update glibc, installing GNU bison, GNU ld.. still unsuccessful in updating glibc
12:04:15FromGitter<mratsim> Which version is it?
12:04:22FromGitter<mratsim> Nim compiles fine with GCC 4.9
12:04:44FromGitter<mratsim> ah glib, mmm
12:04:55dom96It's "just" a case of compiling choosenim on an older Linux
12:05:41FromGitter<kaushalmodi> Ref: https://github.com/dom96/choosenim/issues/15
12:06:57dom96I guess it's even older than Ubuntu Trusty :)
12:07:05FromGitter<kaushalmodi> dom96: If it's compiled to a static binary, shouldn't that permanently resolve the issue?
12:08:41dom96AFAIK it's not a good idea to statically link glibc
12:09:15dom96https://news.ycombinator.com/item?id=9317192
12:12:20*xet7 quit (Ping timeout: 276 seconds)
12:13:35FromGitter<kaushalmodi> dom96: Thanks. I'm am just trying to figure out the best way to generate the binaries for a little utility I am working on (noxhugo). I'd like to use Go binary releases as an example as they "just work".. and trying to figure out how to do that in Nim.
12:14:14FromGitter<kaushalmodi> And then as a side discussion, glibc dependency issues for dynamically linked binaries and choosenim came up.
12:14:46dom96I was thinking of using this: https://github.com/wheybags/glibc_version_header
12:15:29FromGitter<kaushalmodi> In the end, I just want to have statically linked binaries for that utility of mine so that I don't have to support such dependencies issues (which I would be incapable of resolving). That's all :)
12:16:11FromGitter<kaushalmodi> So thinking along those lines, I thought if choosenim can be Go-like "just works" static binary too..
12:16:45dom96I guess you can also statically link against musl
12:16:50dom96but who knows if that works with Nim :)
12:18:43*krux02 quit (Remote host closed the connection)
12:24:28*xet7 joined #nim
12:32:10Demos[m]don't static link glibc, it's usually not what you want
12:33:32Demos[m]instead pick the oldest systems you'd like to support (for example RHEL 5, and build/link against it's version of gcc)
12:34:10Demos[m]although, you can also just compile your program and see if it imports symbols from a version of gcc that's too new
12:35:35elroodmore often than not that's more of a hassle than statically linking though. you just have to know what you're doing and not dynamically load any other libraries, and you should be fine
12:36:48Demos[m]right, point is static linking against glibc on linux is like trying to static link against kernel32.dll on windows
12:36:50Demos[m]don't do it
12:40:08*TheLemonMan joined #nim
12:42:33*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
12:44:44TheLemonManAraq, I'd say that if two non-instantiated generic types are equal the relation between them is isEqual
12:47:39*NimBot joined #nim
12:55:06FromGitter<kaushalmodi> giving up on local glibc update: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Cloning and building nim locally is way easier than upgrading glibc to make choosenim work. [https://gitter.im/nim-lang/Nim?at=5b23b72ae87f0c7bee8e061a]
13:08:15AraqTheLemonMan: yeah and I would agree but some logic relies on isGeneric to mean "and now instantiate it"
13:13:40TheLemonManoh, I see, I'll change it then
13:14:48*brainproxy joined #nim
13:15:29*endragor quit (Remote host closed the connection)
13:15:34TheLemonManis `==` ok as comparison operator there?
13:16:18*CodeVance joined #nim
13:16:25*CodeVance quit (Client Quit)
13:17:24Araqprobably not but I need to investigate the real cause of this bug
13:25:48*cspar joined #nim
13:36:07*cryptocat1094 joined #nim
13:51:45*Vladar quit (Quit: Leaving)
13:57:45*Vladar joined #nim
14:03:10*brainproxy quit (Ping timeout: 245 seconds)
14:17:28*floppydh quit (Quit: WeeChat 2.1)
14:19:47*miran joined #nim
14:22:52FromGitter<kaushalmodi> The test in terminal.nim looks wrong.. can someone confirm? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b23cbbc1c7d4214379b47a3]
14:23:06FromGitter<kaushalmodi> the "ordinary text" and "styled text" are swapped
14:23:28FromGitter<kaushalmodi> Just confirming that what I see is not due to an anomaly of my terminal.
14:23:31FromGitter<kaushalmodi> xterm
14:28:10*PMunch quit (Quit: Leaving)
14:29:23FromGitter<SolitudeSF> for me styled text is not bright nor underscored
14:29:45*riidom joined #nim
14:30:51*brainproxy joined #nim
14:32:07FromGitter<kaushalmodi> the underscore, blink depends on your termcaps
14:32:30FromGitter<kaushalmodi> but I see "styled text" as ordinary and "ordinary text" in blue with cyan bg
14:32:56FromGitter<ephja> good old palettes
14:33:29shashlickkaushalmodi: I believe the setBackground/Foreground calls impact the following write calls, not preceding
14:34:21*FromGitter quit (Remote host closed the connection)
14:34:45shashlicklooks like FromGitter is out to lunch
14:35:17*krux02 joined #nim
14:35:32krux02how do I disable the warnings about spacing?
14:35:48krux02they are pretty annoying and I am not going to change my spacing because of it
14:35:53*FromGitter joined #nim
14:36:55FromGitter<genotrance> @kaushalmodi: I believe the setBackground/Foreground calls impact the following write calls, not preceding
14:39:30FromGitter<kaushalmodi> (https://files.gitter.im/nim-lang/Nim/W74G/image.png)
14:39:50FromGitter<kaushalmodi> (https://files.gitter.im/nim-lang/Nim/QN67/image.png)
14:41:26FromGitter<kaushalmodi> Either there's a bug somewhere or the commands are used incorrectly in that test. the `styledEcho` macro behaves as expected.. but the ones before that, the lower level procs are acting strange.
14:43:29Araqkrux02: but you should.
14:54:47*shashlick quit (Remote host closed the connection)
14:55:04*shashlick joined #nim
14:56:00*Trustable joined #nim
15:08:53*jdhorwitz joined #nim
15:09:14*jdhorwitz quit (Client Quit)
15:19:15*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
15:32:35*xet7 quit (Remote host closed the connection)
15:34:19*xet7 joined #nim
15:39:15*rockcavera joined #nim
15:42:54*xkapastel joined #nim
15:46:24krux02Araq: this produces lots of warnings, and I don't want to change that code: http://ix.io/1dsG
15:46:40krux02I have a lot of code layouted like that
15:47:50dom96Nim's threadpool is M:N multi-threading, right?
15:48:23krux02waht is M colon N multi threading?
15:48:54dom96https://news.ycombinator.com/item?id=17320506
15:49:11dom96Here is the WP definition: https://en.wikipedia.org/wiki/Thread_(computing)#M:N_(hybrid_threading)
15:49:47*cspar quit (Ping timeout: 245 seconds)
15:50:14FromGitter<kaushalmodi> I can use a macro expert's help in this PR: https://github.com/nim-lang/Nim/pull/8047 :)
15:52:06dom96Oh well, I replied that anyway and I'm going to edit the spreadsheet and hope I'm right :)
15:53:06Yardanicobut does nim have lightweight threads?
15:53:38Yardanicothreadpool is a different thing, no?
15:53:45Yardanicolightweight threads are something like coroutines in Go
15:55:46dom96Yeah, but you could spawn async procedures ;)
15:56:03dom96It really depends what they mean by lightweight threads
15:56:58*xet7 quit (Remote host closed the connection)
15:57:13krux02kaushalmodi: I would make the macro args to varargs[untyped]
15:57:20*xet7 joined #nim
15:57:24krux02not because it is necessary, but because you can
15:58:36*xet7 quit (Remote host closed the connection)
15:58:47krux02untyped ast is simpler to work with (fewer ast variations) and you don't make the user that that you do some logic based on getType{Inst,Impl}
15:58:58*xet7 joined #nim
15:59:28krux02I would even try to implement it without a macro
15:59:35krux02just with a template, I think that is possible
15:59:59krux02template code is easier to read and maintain than macro code.
16:01:04FromGitter<kaushalmodi> I tried making that change, but that introduced a functional bug
16:04:52FromGitter<kaushalmodi> (https://files.gitter.im/nim-lang/Nim/hYIh/image.png)
16:04:55mirankrux02: re code snippet @17:46 - this shouldn't produce warnings, agreed
16:05:29miranwarnings should be for mixing spaces and no-spaces. not for spaces and multi-spaces
16:05:37FromGitter<kaushalmodi> see above.. part above the yellow line has that deprecated callsite code
16:05:41*cspar joined #nim
16:05:49Araqkrux02, that code is wrong and nimpretty will rewrite it.
16:06:08FromGitter<kaushalmodi> below the yellow line is with varargs[typed] -> varargs[untyped] and removed callsite() lines
16:06:26FromGitter<kaushalmodi> the code runs, no errors, but is functionally incorrect
16:07:11FromGitter<kaushalmodi> If there is no opposition from anyone I can attempt rewriting styledWriteLine, styledEcho and the new styledWrite using templates.
16:09:06FromGitter<kaushalmodi> *Can the IRC folks see the image I pasted above?*
16:09:41miran@kaushajmodi: we can click on the link and see it in browser
16:10:21FromGitter<kaushalmodi> OK cool, just checking. Thanks!
16:10:27*nsf joined #nim
16:18:36*rokups joined #nim
16:23:09FromGitter<rokups> ```code paste, see link``` ⏎ ⏎ results in `Error: type mismatch: got <string> but expected 'ustring = distinct string'`. any idea why defined `[]` operator would interfere with proc `[]`(s: string, i: int)`? [https://gitter.im/nim-lang/Nim?at=5b23e7ed8864a936cc8b46e4]
16:36:06FromGitter<Vindaar> @kaushalmodi see here: https://github.com/nim-lang/Nim/pull/8047#issuecomment-397676285
16:36:31FromGitter<Vindaar> Tested it on a couple of cases and it seems to work for me
16:36:35FromGitter<Yardanico> @rokups it doesn't do that on devel, but you have an error in your proc - "foo" is of type string
16:36:53FromGitter<Yardanico> maybe the compiler is not smart enough to detect that you want "foo" to be of type "ustring"
16:37:27FromGitter<Yardanico> ```proc `[]`*(s: ustring, i: int): ustring = ustring"foo"```
16:37:34FromGitter<Yardanico> or ustring("foo")
16:43:02FromGitter<rokups> odd. it happens on devel. and it used to work in the past
16:43:11FromGitter<ephja> I think he wanted to call [] defined in system
16:43:29FromGitter<ephja> @rokups the error is on line 2 though and doesn't involve line 3
16:43:47FromGitter<rokups> its on line 3
16:44:14FromGitter<rokups> wait damn, i messed up test
16:45:22Yardanicoyou have an error in your proc body
16:45:26Yardanicoit doesn't affect line 3 at all
16:46:17*xet7 quit (Remote host closed the connection)
16:47:45*xet7 joined #nim
16:48:12FromGitter<rokups> well sucks. i cant make a minimal testcase that would be convenient for anyone to look at :|
16:51:45*Vladar quit (Quit: Leaving)
16:57:00FromGitter<kaushalmodi> @Vindaar Thanks! While the PR doesn't need that macro anymore, your comment is helpful. Why do you have `result[^1].add(arg)` instead of `result.add(arg)`. I was just following the example of `styledEcho`.
16:58:53*miran quit (Ping timeout: 276 seconds)
17:02:57*fvs joined #nim
17:12:12*smt joined #nim
17:13:52FromGitter<Vindaar> @kaushalmodi the reason is that if you simply use `result.add(arg)`, you will add `arg` as a new node to the statement list, i.e. resulting in the following code (excluding the newline part): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b23f3d0d128fa71f66cf442]
17:15:31Yardanico@kaushalmodi you can see what code you've generated in your macro
17:18:30FromGitter<kaushalmodi> I really need to starting learning about macros. I don't yet know how to read that tree and what Call, Curly, etc. mean. I am saving this reference to my notes for future. Thanks!
17:18:57*Trustable quit (Remote host closed the connection)
17:19:00FromGitter<Yardanico> well, just read macros documentation :)
17:19:05FromGitter<Yardanico> and this tree is just an AST tree
17:19:38FromGitter<ephja> if semantic analysis for included files work then maybe it's just the vscode extension that's broken
17:21:10FromGitter<kaushalmodi> @Yardanico Yes, it's just that I haven't yet got to that. Learning macros is on my list :)
17:23:46*cspar quit (Ping timeout: 264 seconds)
17:24:32*Trustable joined #nim
17:33:43*Trustable quit (Remote host closed the connection)
17:34:39*Trustable joined #nim
17:36:23*Perkol joined #nim
17:37:13*Trustable quit (Remote host closed the connection)
17:46:46FromGitter<krux02> @kaushalmodi just look at node.repr and node.treeRepr, and then you will learn and understand a lot
17:47:15FromGitter<krux02> dumpTree can really help you to understand how nim parses a tree
17:47:33*nsf quit (Quit: WeeChat 2.1)
18:08:27Araqkrux02. can you confirm n.ident should be written as n.strVal ?
18:16:47krux02Araq: yes
18:16:51krux02I can
18:17:18krux02when n is a NimNode and you want to get the string value of identifier, then yes
18:20:25subsetparkI know globals can be marked {.threadvar.} to make them thread-local, but what exactly does that do? Does it reinitialize a new copy of the variable for each thread? Or does it simply tell the compiler that I'm doing that manually?
18:21:42krux02subsetpark, I am not sure exactly, I just know that thread_local makes an instance of that variables per thread.
18:21:47krux02(in c++)
18:23:30subsetparkI have the impression that all I have to do is mark as {.threadvar.} and it will magically be taken care of (esp. because it doesn't get mutated) - I just want to make sure that I am not mistaken, and that I don't have to actually change how I instantiate it myself
18:25:24dom96you do have to instantiate it yourself
18:25:33dom96(in each thread)
18:26:25subsetparkhm ok
18:27:43subsetparkso if i have a proc which makes use of a hash table (which never changes), and I want to be GC-safe - can I instantiate within the proc and mark as {.global.} ?
18:28:13*rokups quit (Quit: Connection closed for inactivity)
18:28:21subsetpark(because I don't want to re-instantiate every time the proc is called)
18:32:22*xkapastel quit (Quit: Connection closed for inactivity)
18:35:00*Perkol quit (Quit: Leaving)
18:36:15*jjido joined #nim
18:48:22dom96create a proc that checks if the global variable has be initialised
18:48:28dom96if so return the variable
18:48:33dom96otherwise init and return the variable
19:01:11subsetparkok that works
19:01:50subsetparkWell actually I'm trying to replace the table with nested case statements but that makes sense to me
19:08:21subsetparkdom96: so oddly, I still get GcUnsafe2 errors even without a table at all
19:08:58subsetparkthere are no global variables, and the compiler doesn't explain why the original proc is unsafe
19:09:06subsetparkand even marking it gcsafe leaves it still unsafe :/
19:14:14*Vladar joined #nim
19:17:50*xkapastel joined #nim
19:18:00*Trustable joined #nim
19:24:06*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:33:13Yardanicohttps://github.com/gemath/xpegs
19:36:51dom96ooh
19:38:42*xet7 quit (Remote host closed the connection)
19:42:28*Trustable quit (Remote host closed the connection)
19:51:16Araqsubsetpark: gist your code
19:52:19subsetparkAraq: it was a forward-declaration issue. I don't know why the original proc is marked as unsafe, but marking the forward declaration makes it compile
19:56:11*cryptocat1094 quit (Quit: WeeChat 1.6)
20:01:23*krux02 quit (Remote host closed the connection)
20:13:45*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
20:16:35*jjido joined #nim
20:32:02*xet7 joined #nim
20:34:47*krux02 joined #nim
20:36:05*xet7 quit (Remote host closed the connection)
20:39:12FromGitter<mratsim> ah, @krux02, @Araq, I was writing macros and add the ident is deprecated notice but didn’t find what I was supposed to use instead to get the identifier.
20:39:26FromGitter<mratsim> had not add
20:40:36krux02mratsim: the identifier node is deprecated
20:40:46krux02you have three opetions
20:40:54krux02node == ident"some name"
20:41:02krux02node.eqIdent("someName")
20:41:20krux02node.strVal == "someName"
20:41:33krux02but the last one is not acconding to nim identifier equality rules
20:41:55krux02there is cmpIgnoreStyle, but that is misleading, because it does not compare according to nim style
20:43:01Araqugh, I hate Nim's comments.
20:43:16Araq## vs # vs #[]# vs ##[]##
20:43:41Araqnimpretty will never get them right lol
20:44:21Araqthe original Nim was much better in this regard. comments are part of the AST, deal with it.
20:45:34dom96meh
20:45:35FromGitter<mratsim> basically a non existing ident as untyped parameter and want to create a newIdentNode from that so I guess I have to use `newIdentNode(foo.strVal)`
20:45:45dom96I like being able to put my comments wherever I please
20:46:11Araqmratsim: or copyNode(foo)
20:46:28FromGitter<ephja> does being part of the AST imply otherwise?
20:46:42Araqdom96: yeah and then the tooling doesn't understand it, it sucks.
20:47:10AraqNim is about ASTs, not about string munging.
20:47:35Araqephja: that comments can only occur in specific places as they are part of the grammar.
20:48:37FromGitter<mratsim> @Araq: copyNimNode is not documented :/
20:48:50*nsf joined #nim
20:49:42FromGitter<ephja> yes but do they have to follow the same indentation rules?
20:50:55dom96yes
20:55:51*elrood quit (Quit: Leaving)
20:56:05*xet7 joined #nim
20:56:45FromGitter<ephja> why can't it depend on the node type?
21:08:00*Vladar quit (Quit: Leaving)
21:08:48*noonien quit (Quit: Connection closed for inactivity)
21:12:39federico3Araq: how's nimpretty getting on?
21:24:22Araqfederico3: only one bug away from release *cough*
21:24:33federico3\o/
21:25:32FromGitter<ephja> it's just one big bug isn't it?
21:27:25Araqwell I just fixed it
21:27:43Araqso comment handling seems sane now.
21:27:55Araqbut indentation handling isn't :-(
21:31:01*krux02 quit (Remote host closed the connection)
21:36:03FromGitter<Varriount> Araq: How long did it take you to work the initial version of Nim
21:36:28FromGitter<Varriount> Initial version of Nims parser and lexer
21:37:04Araqcan't remember. it took me at least 2 years for bootstrapping
21:37:26Araqbut that included developing a GC too.
21:38:25FromGitter<Varriount> I'm just writing a lexer and parser for a simple command line shell, and that's been somewhat challenging.
21:40:05*Electrux quit (Ping timeout: 260 seconds)
21:41:41FromDiscord<treeform> nimpretty? is that a nim code formatter?
21:42:04FromDiscord<treeform> link?
21:42:19*Electrux joined #nim
21:42:45Araqit's a general purpose beautifier. later versions will also help you in finding a prettier girlfriend
21:43:41FromDiscord<treeform> i have one too but its space indent/character based, i use it on python, coffeescript and nim. But its not super advanced. Your will be better.
21:44:53FromGitter<notTito> noice
21:45:24FromGitter<Varriount> Araq: Will it be able to make hastily-written c++ code pretty?
21:46:29Araqwell it's general purpose. you inject it into your blood, everything is beautiful afterwards.
21:46:54*Electrux quit (Ping timeout: 260 seconds)
21:46:59*brainpro1 joined #nim
21:47:54*brainproxy quit (Ping timeout: 256 seconds)
21:48:27Araqtreeform: please elaborate how it works
21:48:52FromGitter<notTito> lol got a bit dark
21:48:59shashlickAraq, so did you decide to retain {.define.} or is it gone?
21:49:28Araqshashlick: seems easy to support with AST replays
21:49:54Araqbut better change the defaults so that no .define is necessary
21:50:59shashlickIt's not catastrophic but will be nice if I can define usePcreHeader in nimpcre instead of requiring end user to specify it in command line or .cfg
21:52:18*Electrux joined #nim
21:52:36shashlickThat way all you do is nimble install and import and you no longer need to rely on the dll
21:54:53Araqyeah, so patch nimpcre to default to static linking
21:56:41*Electrux quit (Ping timeout: 260 seconds)
21:58:37FromGitter<ephja> is 'nimsuggest' ever defined when the cmd isn't cmdIdeTools?
22:02:12Araqnot sure lol
22:05:07FromGitter<ephja> just wondering because of: "when defined(nimsuggest): if c.config.cmd == cmdIdeTools: ..."
22:06:41Notkeahello! what would be the idiomatic way of chaining Futures in Nim?
22:07:13shashlicknimpcre already compiles in the pcre source code
22:07:49FromGitter<ephja> has no one tried to regex away all the countups? :p
22:10:23shashlickBut nim's pcre implementation requires that define to skip the dynlib, that's why I want to define it in nimpcre
22:11:14Araqephja: well there are multiple commands for 'nimsuggest' available
22:11:27Araqbut I guess that's a different 'cmd' field then :P
22:11:51AraqNotkea: 'or', 'and' combinators, or set the completion callback
22:12:18*Electrux joined #nim
22:16:57*Electrux quit (Ping timeout: 240 seconds)
22:22:18*Electrux joined #nim
22:26:57*Electrux quit (Ping timeout: 240 seconds)
22:32:18*Electrux joined #nim
22:35:35Notkeathanks! it seems that I cannot find the doc for asyncfutures on nim-lang.org/docs/lib.html :/
22:36:57*Electrux quit (Ping timeout: 264 seconds)
22:40:19FromDiscord<treeform> Araq, it works to make sure spaces are consistent. It checks indentaion, (), operator spaceing and lines between stuff. Its language agnostic so it can't do the really deep things. As it just looks at lines and characters and counts spaces.
22:40:50*Electrux joined #nim
22:44:57*shashlick quit (Remote host closed the connection)
22:45:05*Electrux quit (Ping timeout: 240 seconds)
22:45:11*shashlick joined #nim
22:50:01*nsf quit (Quit: WeeChat 2.1)
22:52:19*Electrux joined #nim
22:57:05*Electrux quit (Ping timeout: 248 seconds)
22:57:22*girvo quit (Ping timeout: 260 seconds)
22:59:18*girvo joined #nim
23:01:02*Electrux joined #nim
23:05:45*Electrux quit (Ping timeout: 264 seconds)
23:12:05*Electrux joined #nim
23:16:59*Electrux quit (Ping timeout: 256 seconds)
23:22:16*Electrux joined #nim
23:26:57*Electrux quit (Ping timeout: 248 seconds)
23:27:48*Electrux joined #nim
23:37:23*Electrux quit (Ping timeout: 268 seconds)
23:42:20*Electrux joined #nim
23:47:01*Electrux quit (Ping timeout: 256 seconds)