<< 27-10-2018 >>

00:06:03*chemist69 quit (Ping timeout: 264 seconds)
00:06:59*chemist69 joined #nim
00:26:27*Calinou quit (Ping timeout: 240 seconds)
00:43:11*Jesin joined #nim
00:45:34shashlickIn a nutshell, make threadvar, initialize it for each thread separately, pass stuff around with channels
00:45:48shashlickUse spawn to kick off threads
00:47:19shashlickSee autodup for how I got threads and async working together
00:47:22shashlickhttps://gist.github.com/genotrance/ef84e2ee7daab54c0a385e92c0a2757d
00:51:14FromGitter<zacharycarter> that's a great example :)
00:57:47FromGitter<zacharycarter> also - some very clean code shashlick
00:58:21FromGitter<zacharycarter> I never know how to name consts in Nim
00:58:47FromGitter<zacharycarter> I usually just use camel case
01:09:32*Death916 quit (Changing host)
01:09:32*Death916 joined #nim
01:09:32*Death916 quit (Changing host)
01:09:32*Death916 joined #nim
01:22:02*elronnd joined #nim
01:22:26*elronnd is now known as Elronnd
01:24:51*zachk quit (Quit: Leaving)
02:03:48*smt quit (Read error: Connection reset by peer)
02:05:06*banc quit (Quit: ZNC - http://znc.in)
02:20:02*darithorn quit ()
02:21:22xacedebugging a module with gdb, and compiled with --debug:native. I'm trying to `print *m_<TAB>` but it won't tabcomplete it. any idea if nim mangles variables with short names differently?
02:22:21*banc joined #nim
02:22:22xacenvm, just looked at the current frame and found it, it wasn't mangled at all
02:31:34*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:38:47*darithorn joined #nim
02:39:41*kadin quit (Quit: ZNC 1.7.1 - https://znc.in)
02:43:42FromGitter<kayabaNerve> Why was `queue` deprecated?
02:43:54FromGitter<kayabaNerve> I just found out about it when trying to shift a seq.
02:44:24FromGitter<kayabaNerve> Is the 'good' thing to do add an element and delete the first?
02:49:29FromGitter<zacharycarter> I didn't realize nim had a `queue`
02:49:40FromGitter<zacharycarter> I've only ever known about `dequeue`
02:51:03FromGitter<kayabaNerve> ... there's two of them? This is getting out of hand!
02:51:55FromGitter<kayabaNerve> (yeah yeah; the lines are flipped and it's "Now there are"; I cared more about the conversation the meme)
02:52:29FromGitter<kayabaNerve> @zacharycarter deques is a double ended queue module.
02:52:40FromGitter<kayabaNerve> I just wanted to shift a seq the proper way. I'm adding and deleteing.
02:59:52FromGitter<zacharycarter> I know
03:00:07FromGitter<zacharycarter> but I think you can use a seq like a queue, no?
03:00:27FromGitter<kayabaNerve> Yeah but I wanted to shift it lol
03:00:36FromGitter<kayabaNerve> That's why I was looking into queue for the proper/optimized way
03:00:39FromGitter<zacharycarter> oh
03:00:43FromGitter<kayabaNerve> Because that's what an old forum pot said
03:01:06FromGitter<zacharycarter> this one? https://forum.nim-lang.org/t/2552 ?
03:01:51FromGitter<kayabaNerve> Yeah
03:02:34FromGitter<zacharycarter> I don't know - data structures and algorithms aren't my wheelhouse unfortunately :( that's my next goal to improve upon - but atm it's a weakness of mine
03:02:45FromGitter<zacharycarter> I understand the difference b/q a double ended queue and a regular queue
03:03:00FromGitter<zacharycarter> but I don't know how to write an optimized shift implementation for a sequence in Nim
03:03:50FromGitter<kayabaNerve> ... I just added and deleted 0
03:03:59FromGitter<kayabaNerve> ``` epochs.add(newEpoch) ⏎ epochs.delete(0)``` [https://gitter.im/nim-lang/Nim?at=5bd3d59f069fca52a59e4175]
03:04:35FromGitter<kayabaNerve> I solved this a long time ago. I appreciate all your feedback but I'm doing fine. It's an op I run every ten minutes for a seq that's 6 long. The seq contents are a ref.
03:04:37FromGitter<zacharycarter> I mean - if that achieves what you want ¯\_(ツ)_/¯
03:04:44FromGitter<kayabaNerve> You dropped this \\
03:04:53FromGitter<zacharycarter> blame copyshrug
03:04:58FromGitter<kayabaNerve> Yeah. It's not intensive. It was more about being right then being fast.
03:05:02FromGitter<zacharycarter> gotcha
03:05:53FromGitter<kayabaNerve> I need more devs on this project lol
03:06:03FromGitter<kayabaNerve> Turns out there's not a lot of Nim coders out there
03:06:52FromGitter<kayabaNerve> \*a lot of available ones ⏎ \*a lot compared to C++
03:07:07FromGitter<zacharycarter> hell - if I could make 2k a month to pay my mortgage and buy dog food - I'd go anywhere I could program in Nim
03:07:14FromGitter<zacharycarter> and my mortgage is hopefully a fleeting thing
03:07:26FromGitter<zacharycarter> but... I can't find a good way to leave my job while I wait for my home to sell
03:07:30FromGitter<zacharycarter> so I'm stuck :(
03:08:00FromGitter<zacharycarter> at work - I've basically been relegated to writing Terraform / doing operations work
03:08:37FromGitter<zacharycarter> not because of performance reasons or because of incompetence - it's the opposite - I'm the only one competent enough to do the work, so I get to do it, while everyone else gets to write shitty code
03:08:38FromGitter<zacharycarter> yay!
03:09:19FromGitter<zacharycarter> enterprise IT sucks - I will never work in this industry again
03:09:49FromGitter<zacharycarter> if you want to steal my soul - at least give me back some kind of work that's challenging or that I enjoy
03:12:05FromGitter<kayabaNerve> I can pay in exposure!
03:13:03FromGitter<kayabaNerve> Nahhhhhh. I could do a bit more than exposure but less than anything that I'd expect anyone to take *unless they were in the field, believed in X* :P.
03:15:24FromGitter<zacharycarter> I just want to make vidya games
03:15:56FromGitter<zacharycarter> I'll go shrink horse testicles for peanuts - as long as I get to work in a field I'm passionate about.
03:16:09FromGitter<kayabaNerve> Nice
03:16:37FromGitter<zacharycarter> that probably makes no sense - unless you're familiar with the Rockstar controversy going on
03:16:51FromGitter<kayabaNerve> Yep.
03:16:59FromGitter<zacharycarter> well they were working their devs to death
03:17:09FromGitter<kayabaNerve> In Red Dead Redemption 2, cold weather shrinks the animal's... parts.
03:17:17FromGitter<zacharycarter> yeah
03:17:18FromGitter<kayabaNerve> But if you get to code it in Nim, #WorthIt
03:17:24FromGitter<zacharycarter> well - no
03:17:37FromGitter<zacharycarter> I don't care what language I program in - I just want to work with intelligent people that are passionate about what they do
03:17:45FromGitter<kayabaNerve> I haven't heard about horrible dev policies beyond the usual crunch time.
03:17:49FromGitter<zacharycarter> I don't want to show up to work and hear about how great the cake my co-worker baked is for 45 minutes
03:17:50shashlick@zachcarter: thanks for the compliment! That was my initial few months with Nim so wasn't complying with any style
03:18:03FromGitter<kayabaNerve> Which is something almost every studio suffers from.
03:18:11FromGitter<zacharycarter> while I have to fix his broken code / all the bugs that he lets creep in because he can't even manually test software after he releases it
03:18:15FromGitter<zacharycarter> /rant
03:18:34FromGitter<zacharycarter> shashlick: it's very good code for someone that is new to Nim :)
03:18:43FromGitter<zacharycarter> @kayabaNerve very true
03:19:05FromGitter<kayabaNerve> I said I'd get a... developer beta of an open source app around next sunday. Then the TODO list grew.
03:19:07FromGitter<kayabaNerve> I am doing work.
03:19:18shashlickI'd like to post that project, never got around to it
03:19:32shashlickGot distracted with creating Nim wrappers and what not
03:19:40FromGitter<zacharycarter> :)
03:19:52FromGitter<zacharycarter> well I think your work is amazing and very fundamental to Nim's ecosystem
03:20:02FromGitter<zacharycarter> so don't stop, please
03:20:04shashlickI'm interested in adding image blur detection with opencv
03:20:51shashlickMight wrap opencv since dom96's wrapper depends on dlls
03:20:59*wildlander quit (Quit: Konversation terminated!)
03:21:02shashlickBut the list is endless
03:21:45FromGitter<zacharycarter> very true
03:21:53shashlickThat being said, I have almost zero feedback on these wrappers so wonder if any are ever used
03:22:38*vlad1777d_ quit (Ping timeout: 246 seconds)
03:24:47FromGitter<zacharycarter> yeah - I dunno, that's a tough one
03:25:01FromGitter<zacharycarter> out of all the bindings I've made - nuklear has been by far the one that's been most used
03:25:20FromGitter<zacharycarter> but I mean - even small /tiny ones like libbearterminal, get used and contributed to
03:25:41shashlickAnyway, some day maybe
03:25:59shashlickI guess I should stick to wrappers I use and call it a day
03:26:14FromGitter<zacharycarter> that's been my philosophy
03:26:27FromGitter<zacharycarter> trying to extend Nim's ecosystem on your own is difficult
03:26:31shashlickBut making wrappers is quite easy now for me
03:26:45shashlickSo I do these other ones when someone asks here
03:27:01FromGitter<zacharycarter> well - we still lack a lot of really important wrappers / libs IMO
03:27:24FromGitter<zacharycarter> like for instance - game developers are going to want bullet 3 and https://github.com/recastnavigation/recastnavigation
03:27:39*chemist69 quit (Ping timeout: 264 seconds)
03:27:46FromGitter<zacharycarter> I hope to change that with my new engine - but I'm sure it's a reason people choose C++ for building games over Nim right now
03:28:06FromGitter<zacharycarter> and then with web dev - as we talked about earlier briefly - Nim has no server GQL implementation
03:28:27FromGitter<zacharycarter> so I'm sure people are choosing typescript / golang / nodejs etc over Nim because of that
03:28:48shashlickWell I don't mind helping grow specific areas
03:29:10FromGitter<zacharycarter> I agree - but IMO - make sure it's also important to you
03:29:11*chemist69 joined #nim
03:29:24FromGitter<zacharycarter> because I think a lot of us have produced libraries / bindings to others that we thought people would use
03:29:29shashlickIf there is a focused initiative, it will be effective
03:29:33FromGitter<zacharycarter> and then no one did - and then we get asked about them years later
03:29:36FromGitter<zacharycarter> yeah - exactly
03:29:56FromGitter<zacharycarter> that's what I've always thought we as a community - compared to Rust for instance - have been lacking
03:29:58shashlickWell honestly I code for fun so nothing is really important to me
03:30:35shashlickI like automating since I can't stand doing the same thing twice
03:30:46FromGitter<zacharycarter> but whenever I've brought it up - A) I get no response or B) The reasoning is questioned or some part of it is - like the person doesn't like a technology I suggest we focus on, so that becomes the topic of convo rather than my sentiment
03:31:05shashlickWell I kind of feel the same
03:31:08FromGitter<zacharycarter> well I think you're smart for that - it's something I don't do enough of
03:31:24FromGitter<zacharycarter> I've brought it up for graphql for instance
03:31:29FromGitter<zacharycarter> and AWS / GCP / Azure bindings etc
03:31:31shashlickCause wrappers are much less appreciated than Nim native code
03:31:42shashlickAgreed it is more portable and can be used at compile time
03:31:45FromGitter<zacharycarter> like - if Nim really wants to hit it big, it should focus on cloud native development, because that's where all the industry hype is
03:32:11shashlickBut I think it is a waste to sit and reimplement stuff
03:32:28FromGitter<zacharycarter> that's true
03:32:40FromGitter<zacharycarter> but like - no one is going to write a GraphQL implementation for Nim - besides the Nim community
03:32:57FromGitter<zacharycarter> the thing is - beyond Nim and some of the core libraries a lot of developers rely on - there isn't much community collaboration
03:33:13FromGitter<zacharycarter> and that's probably due, I imagine, to the small number of Nim devs there are in existence
03:33:30FromGitter<zacharycarter> but like - even amongst the game devs we have in the Nim community, most of us have different interests / goals
03:33:32shashlickThat's getting better due to http://status.im
03:33:57FromGitter<zacharycarter> I want to write engine / tooling stuff - so does krux02, but he wants to focus on OpenGL / Vulkan I want to write a large cross platform game engine ala Godot using Nim
03:34:29FromGitter<zacharycarter> he's much more into the graphics programming side of things - I'm more into game engine architecture / learning about a wide variety of topics related to game programming
03:34:39shashlickBut I've been quite frustrated with 0.19.0 and #head, everything is broken and hard to make backwards compatible
03:34:44FromGitter<zacharycarter> and then there are the majority of people using Nim for game programming, who are fine with SDL2 / allegro / etc
03:34:52FromGitter<zacharycarter> I haven't hit this yet
03:35:19FromGitter<zacharycarter> are you referring to the seq / string stuff?
03:35:33FromGitter<zacharycarter> I'll be right back - going to run to the store before it closess
03:35:48shashlickWell my goal has been to have these wrappers seamless to install and consume
03:36:42shashlickThere have been a variety of issues
03:36:54shashlickAnyway, ttyl
03:55:12*stefanos82 joined #nim
04:04:59*dddddd quit (Remote host closed the connection)
04:09:42FromGitter<zacharycarter> back
04:10:07FromGitter<zacharycarter> shashlick: well - I think this is to be somewhat expected with a language pre 1.0
04:10:31FromGitter<zacharycarter> I do agree that some of the changes are quite abrupt - but if they're better for the language overall - I can understand
04:11:19FromGitter<zacharycarter> but I can also totally relate to the feeling that whatever you build is going potentially be waste if adapting to a rapidly changing language isn't realistic
04:12:24FromGitter<zacharycarter> I'm hoping that Nim is getting close to a 1.0 release - but it's not grounded really - I'm not that glued into what still needs to be done pre-1.0 and what kind of changes that will impose on the current state of the language.
04:32:05*chemist69 quit (Ping timeout: 276 seconds)
04:33:25*chemist69 joined #nim
05:00:30shashlickwell, it's hard as a regular developer but at least you can stick to a particular version and upgrade only when you want to
05:01:40shashlickas a lib builder, it is much harder since you have to offer backwards compatibility somehow
05:02:47FromGitter<zacharycarter> true
05:03:41shashlickbut I think that is inherently a flaw in how nimgen is today - I have no snapshots for the past and many folks have pushed me in that direction
05:05:36Araqshashlick: morning, please share your frustrations with us
05:06:12AraqIMO the non-nil thing was totally worth it
05:06:48FromGitter<citycide> can anyone tell me what's going on here? https://ptpb.pw/vyI9/nim -- running this with `nim c -d:ssl -r file.nim` exits with no errors and no output (regardless of the url I'm requesting)
05:07:01shashlickbut that isn't easy to achieve since I have to cache generated wrappers for every nim version and for every OS - and it will be specific to an upstream lib version, so if you want a newer upstream lib version, then another set of cached files for that combo
05:07:28shashlickAraq: sorry, don't mean to stink up your Saturday morning 🙂
05:08:06shashlickI won't argue about breaking changes - they are inevitable and aren't done recklessly
05:08:24*avsej quit (Ping timeout: 272 seconds)
05:08:38*avsej joined #nim
05:08:38*avsej quit (Changing host)
05:08:38*avsej joined #nim
05:08:53shashlickbut I wonder how to reduce the pain and effort of maintaining the ecosystem
05:08:57FromGitter<zacharycarter> I guess it's time for me to go to bed :P
05:09:35FromGitter<zacharycarter> if folks in Europe are up now - it means I'm up too late
05:09:45FromGitter<zacharycarter> night!
05:30:54*tiorock joined #nim
05:30:54*rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
05:30:54*tiorock is now known as rockcavera
05:37:08FromGitter<citycide> ^ if I switch to the non-async `HttpClient` (and remove the `await`s) my above repro works just fine...
05:37:46*darithorn quit ()
05:40:12*endragor joined #nim
05:42:14*nc-x joined #nim
05:42:41nc-xWhat is everyone's opinion on https://github.com/nim-lang/nimble/issues/572 ?
05:45:13*nc-x quit (Client Quit)
05:46:16*nsf joined #nim
06:03:29*NimBot joined #nim
06:24:38Araqhttps://www.youtube.com/watch?v=yy8jQgmhbAU
06:27:55*narimiran joined #nim
06:28:11FromGitter<alehander42> ha, the guy is from a bg game company, neat
06:39:18FromGitter<alehander42> aos vs soa is an interesting problem, haven't heard of it outside of gamedev until now
06:41:41FromGitter<alehander42> don't people solve this with some kind of metaprogramming? (the same API using a configurable layout internally, as it seems which one is more efficient can be hard to determine until late in the project )
06:42:00AraqI would solve with it a bunch of accessor templates
06:42:29AraqC++ lacking properties makes this a bit annoying with all its ()
06:46:51Araqmutation of SOA can also be done with a macro, stuff.add obj becomes stuffA.add obj.a; stuffB.add obj.b; stuffC.add obj.c
06:49:39FromGitter<alehander42> yeah, I don't doubt in Nim this is achievable
06:50:01FromGitter<alehander42> I wondered how hard is it in C++ as I don't have so much xp with it
06:50:17FromGitter<alehander42> the `()` are a con indeed
06:50:32Araqbut when you build your language around SOA vs AOS you kinda bet that hardware caches and prefetchers will never ever get a "stride" feature
06:52:12FromGitter<alehander42> hm, this makes sense
06:52:23FromGitter<alehander42> but still, this would be very hardware-platform-specific
06:52:38Araqhmm the used addresses are 8, 16, 64, 72, 120, 128, try to see the pattern at runtime
06:52:50FromGitter<alehander42> so it's good to have this customizable somewhere in your own code
06:53:01Araqseems to be just a little oversight in today's hardware design
06:53:48FromGitter<alehander42> I agree
06:55:35Araqthat's just a Column-oriented DBMS
06:55:56Araqvery useful for sure but hasn't won everywhere
06:56:05FromGitter<alehander42> but even then, for a long time 80% of customer's hardware wouldn't have it for a while, so it's not very close in the future
06:56:29FromGitter<alehander42> hardware progress trickles down slowly
06:58:34FromGitter<alehander42> offtopic, another X->Y lang version overview, the idea of converters instead of maintaining code for several versions in the same time is interesting https://github.com/golang/proposal/blob/master/design/28221-go2-transitions.md#proposal
06:58:46Araqhardware progress much faster than software
07:00:32*mech422__ joined #nim
07:03:33*mech422_ quit (Ping timeout: 252 seconds)
07:04:40Araqhttps://github.com/nim-lang/Nim/issues/7441 another try to get somebody involved who knows about Chinese
07:11:21FromGitter<technicallyagd> A problem only on Windows?
07:11:33Araqyup
07:11:50AraqWindows's Unicode/Console handling is a clusterfuck
07:14:51FromGitter<technicallyagd> lol because most developers on windows usually use an full fledged IDE?
07:19:57*Vladar joined #nim
07:33:27FromGitter<alehander42> Araq yes, but it trickles down slowly: you don't get your new CPU until you buy a new computer
07:33:41FromGitter<alehander42> but maybe people upgrade their computers more often than I think
07:34:09Araqsmartphones don't age well
07:34:51Araqand progamers on PCs don't mind buying a new PC if it means a 6x out of the box performance improvement
07:36:11Araqor even a factor of 2 for non-threaded ordinary OOP-ish code would sell new PCs
07:36:40Araqbut probably it's hard to redesign how cache lines work :-)
07:36:49FromGitter<alehander42> well, if the speedup is big enough, somebody would've done it if there is demand
07:37:12FromGitter<alehander42> you have to keep this moore law running somehow
07:37:14Araqwell the data-driven design people argue that it has been overlooked
07:37:31FromGitter<alehander42> so we can continue writing software with even more abstractions :)
07:46:27*chemist69 quit (Ping timeout: 252 seconds)
07:46:52*chemist69 joined #nim
08:12:22*Trustable joined #nim
08:56:30FromGitter<alehander42> what should I work on now in my spare time? py2nim / stabilizing gara(the pattern matching lib) / finishing the JS sourcemaps thing ?
08:56:46narimiranfirst two :)
08:57:46narimiranfirst remove that "of" in matches, replace it with indents. of course :)
08:58:42narimiranbtw, i've tried gara the other day, just on one small example, and i was pleasantly surprised i could make it work (because i didn't manage to do that with patty)
09:01:07FromGitter<alehander42> oh great, please open issues if you hit any bugs, that's exactly what I need to fix for 1.0
09:01:42narimiranwill do
09:02:11FromGitter<alehander42> the js sourcemaps thing might be more complicated as I have an existing PR , but it's hacky: if I decide to to the unhacky thing, I have to basically rewrite a lot of jsgen and if I do this, I want to include support for generating modules too
09:02:21FromGitter<alehander42> es modules*
09:03:00Araqupdate py2nim first
09:03:08Araqso that it works with 0.19
09:03:16Araqand then JS sourcemaps
09:03:34narimiranoh, it doesn't work with 0.19? then yeah, that should be the priority, definitely
09:04:15narimiranbtw, Araq, will we see 0.19.2 soon? (let's say, after the hacktoberfest is over)
09:05:04Araqask kaushalmodi
09:05:43narimiran@kaushalmodi will we see 0.19.2 soon? (let's say, after the hacktoberfest is over)
09:08:21FromGitter<alehander42> Araq, so about https://github.com/nim-lang/Nim/pull/7508#issuecomment-381313318 still OK for the bigger refactoring?
09:12:51Araqdepends on what that means, I generally want every codegen to be an AST to AST transformation
09:22:48FromGitter<alehander42> I am not quite sure what I meant
09:23:07FromGitter<alehander42> but I guess that I wanted to build the sourcemap recursively while traversing the AST
09:23:38FromGitter<alehander42> so probably I planned on building it while generating the code
09:24:01*narimiran quit (Quit: Konversation terminated!)
09:25:27FromGitter<alehander42> the problem is that the sourcemap needs to know the final line/column numbers of the generated code, which is kinda weird while you're still generating it
09:26:27FromGitter<alehander42> maybe another option was to generate a tree of raw JS code nodes(corresponding to tokens or nim nodes) and then to optionally generate the sourcemaps from this
09:26:30FromGitter<alehander42> yes, that was it
09:28:16Araqwell that's my AST to AST transformation then
09:28:55FromGitter<alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bd42fd7c7bf7c3662798311]
09:42:00dom96oooh
09:42:09*wildlander joined #nim
09:42:12dom96The Digital Ocean guys included us in their Hacktoberfest reminder email :D
09:43:15*narimiran joined #nim
09:46:44narimiranwhoever got the idea to write the hacktoberfest blogpost - praised be! :P :D
09:46:53*narimiran quit (Client Quit)
09:47:55*narimiran joined #nim
09:48:52dom96Yeah. Praise to that person... wait a minute, wasn't that you? :P
09:51:18narimiranwow, what a coincidence!
09:58:02*Taylor_ joined #nim
10:00:04*PrimHelios quit (Ping timeout: 264 seconds)
10:04:07*wildlander quit (Quit: Konversation terminated!)
10:04:12*gmpreussner_ is now known as gmpreussner
10:04:21*wildlander joined #nim
10:34:33*narimiran quit (Ping timeout: 252 seconds)
10:35:37*enthus1ast joined #nim
10:38:21Araqnarimiran[m]: thanks, it is awesome :-)
10:44:15FromGitter<alehander42> nice, narimiran!
10:44:58FromGitter<alehander42> offt: I also want to write a small kernel in nim (eventually): are there any other except nimkernel?
10:49:34*Snircle joined #nim
11:07:57*enthus1ast quit (Read error: Connection reset by peer)
11:26:34*elrood joined #nim
11:29:36*Calinou joined #nim
11:33:20*endragor quit (Remote host closed the connection)
11:39:12FromGitter<mratsim> @alehander42 there is this SOA vs AOS vs AOSOA in scientific computing as well.
11:39:44FromGitter<mratsim> especially when working with geometry and 3D, but usually you can solve it with a multidimensional strided array, like the tensors I implemented.
11:40:25FromGitter<mratsim> just make sure that memory accesses in a tight loop are contiguous to avoid cache misses
12:13:26*endragor joined #nim
12:17:41*narimiran joined #nim
12:17:47*endragor quit (Ping timeout: 240 seconds)
12:18:36FromGitter<alehander42> @mratsim yeah, what I imagined was that maybe people describe the data structure they want and internally a middleware replaces it with a data structure optimized for a certain usecase (e.g. soa or aos)
12:30:29FromGitter<tim-st> Can I require a nimble package from a specific author? The current way doesnt ensure that the required package comes from correct source
12:30:46*kapil____ joined #nim
12:30:48FromGitter<tim-st> (I assume)
12:36:55FromGitter<alehander42> you can use a github url
12:37:18FromGitter<alehander42> git*
12:37:52FromGitter<tim-st> when I do this what would be the installed package name?
12:38:39FromGitter<tim-st> e.g. for `https://github.com/tim-st/nim-lzma` it would be `lzma` ?
12:38:55FromGitter<Vindaar> @tim-st yes
12:39:06FromGitter<tim-st> there are multiple packages named lzma
12:39:48FromGitter<tim-st> golang solves it by installing it to complete url
12:44:29AraqNimble solves this by allowing complete URLs as dependencies
12:44:55FromGitter<tim-st> so I can do `import https://github.com/tim-st/nim-lzma` ?
12:47:13dom96no, you put `requires https://github.com/tim-st/nim-lzma` in your .nimble file
12:47:16dom96Then `import lzma`
12:47:32dom96Compile using `nimble c ...` or `nimble build` and you'll get the right package
12:47:53FromGitter<tim-st> dom96: thanks, how is it internally ensured to import the correct package if there are multiple with same name from different authors?
12:48:08dom96Nimble passes the package paths to Nim
12:48:23FromGitter<tim-st> ok, perfect, thanks :)
12:53:21FromGitter<tim-st> hm, I tried to install my package and an other named the same, but it only allows overwriting or not installing
12:53:58FromGitter<tim-st> it has same name and same version^^
12:56:13dom96yeah, that's tricky
12:56:20dom96I would honestly suggest naming your package something else
12:57:18FromGitter<tim-st> yeah, but when there are more packages they will have same names
12:57:29FromGitter<tim-st> (I mean also regarding future)
13:00:02FromGitter<alehander42> I don't get it, do you use different versions of them in the same time
13:00:33FromGitter<alehander42> doesn't nimble has the option of per-project `.nimble/` pkgs?
13:01:18FromGitter<tim-st> I'm testing it at the moment if it actually works or not
13:08:54FromGitter<tim-st> no, it doesnt work...
13:09:21FromGitter<tim-st> try this to reproduce:
13:09:28FromGitter<tim-st> `nimble install https://github.com/ephja/lzma`
13:09:41FromGitter<tim-st> then: `nimble install https://github.com/tim-st/nim-zim@#nimble-same-name`
13:31:09FromGitter<yyyc514> is there some way to set a variable at compile time and also use it at compile time in a macro? i’m trying to have a model set it’s list of fields and then iterate over that same list in macro
13:34:40dom96https://github.com/nim-lang/Nim/blob/devel/lib/core/macrocache.nim
13:34:45dom96You can use that
13:35:44FromGitter<yyyc514> " Starting with version 0.19 of Nim this is not directly supported anymore"
13:35:46FromGitter<yyyc514> nope
13:36:01FromGitter<yyyc514> oh wait
13:36:15FromGitter<yyyc514> not very clear
13:37:11FromGitter<yyyc514> i was trying to declare a proc with the data compileTime, should that not work?
13:39:29FromGitter<yyyc514> this doesn’t even necessarly need to cross module boundaries
13:39:39FromGitter<yyyc514> i’m trying to describe a data model then iterate over it
13:44:39FromGitter<yyyc514> it was working when i used a global const but now i’m trying to group things a bit better
13:49:11FromGitter<dawkot> Hello, does anyone know what could cause an error like this on a simple hello world program?
13:49:19FromGitter<dawkot> ```code paste, see link```
13:50:13FromGitter<dawkot> https://pastebin.com/84G46ZF8
13:51:42FromGitter<dawkot> oh, threads being enabled caused it
13:52:25dom96yyyc514: heh, I read it the same way. Definitely needs to be reworded
13:53:57FromGitter<mratsim> @yyyc514 the macro should take a `macro foo(x: static YourType)` parameter
13:54:25FromGitter<mratsim> but if you want to iterate on fields at compile time you can use the `fields` and `fieldPairs` iterators in system.nim
13:55:24FromGitter<yyyc514> @mratsim The type can vary, this is a ORM
13:55:25FromGitter<kaushalmodi> Hmm, why ask me for 0.19.2 release? :)
13:55:28FromGitter<yyyc514> macro loadAll*T (p: T) : untyped =
13:55:46FromGitter<yyyc514> @mratsim I need my own list the fields of the object contain extra internal fields
13:55:58FromGitter<yyyc514> that’s good to know though
13:57:07FromGitter<yyyc514> adding static just gets "Error: cannot generate VM code for T"
13:57:23FromGitter<mratsim> there is no generic macro
13:57:32FromGitter<mratsim> p: typed is what you want
13:58:04FromGitter<mratsim> and getTypeImpl(p) in the macro i guess
13:58:49FromGitter<kaushalmodi> Btw thanks @dom96 and @Araq for approving my `dumpLisp` PR. That was, I believe, my most serious contrib to Nim.
13:58:59Araqkaushalmodi: cause you're the automated builds man
13:59:11dom96Awesome :)
13:59:46FromGitter<kaushalmodi> seriousness == non-doc loc
14:00:00FromGitter<mratsim> also @yyyc514 check the custom pragma annotations on type: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-custom-annotations you could add a custom annotation on internal fields so that you ignore them with the fields iterator
14:00:03*Taylor_ quit (Read error: Connection reset by peer)
14:00:30FromGitter<mratsim> there is even an ORM example
14:01:27FromGitter<kaushalmodi> @Araq the builds seem to be working, except that it looks like I cannot uniquify the release archive names
14:01:58Araqwhat about the appveyor builds?
14:02:06FromGitter<kaushalmodi> All releases done on the same commit of nightly tag along with the next release done on the same nightly commit (but of course newer Nim commit)
14:02:19FromGitter<yyyc514> @mratsim Ok that’s cool but i’m not sure how i’d use that
14:02:37FromGitter<kaushalmodi> I am looking only at Travis as I am not acquainted with Windows builds
14:02:47FromGitter<yyyc514> oh it it just saying they’d show up in the ASt?
14:03:07FromGitter<yyyc514> that i understand
14:03:08FromGitter<kaushalmodi> You said that you figured out some script issue that's failing Appveyor?
14:10:55Araqno I said my script is just wrong but I don't know how it is supposed to look like
14:13:28FromGitter<tim-st> what does nimbles error `Error: 'hg' not in PATH.` mean?
14:15:37FromGitter<tim-st> ok, it seems I need this https://www.mercurial-scm.org/
14:17:14narimiranso, @kaushalmodi, 0.19.2 next weekend? :)
14:19:38FromGitter<kaushalmodi> I honestly haven't looked into Appveyor/Windows builds ever.
14:20:34FromGitter<kaushalmodi> If someone here is good with building Nim on Windows, the best bet is to add the `os: windows` build to Travis CI of the nighties repo
14:22:40FromGitter<yyyc514> if i include a import over and over what is the scope of top-level things declared?
14:22:51FromGitter<yyyc514> are they unique or the same for every file imported into?
14:26:09FromGitter<mratsim> if you import multiple time the same module it’s the same as importing it once
14:26:44FromGitter<dawkot> is it normal for nim to complain about expecting cstring where kstring is used?
14:27:05FromGitter<dawkot> code just works because both are the same when compiled to js target
14:28:27FromGitter<yyyc514> @mratsim but if i use a global variable for macro help effectively it’d be unique during the parsing, or no?
14:28:40FromGitter<yyyc514> ie `var currentModel {.compileTime} : string = “"`
14:29:03FromGitter<mratsim> in the imported modules? I don’t think so but i never tried
14:29:12FromGitter<alehander42> @yyyc514 I was also thinking of an orm last week, it will be interesting to compare
14:29:28FromGitter<yyyc514> well mine is pretty bare bones so far
14:29:36FromGitter<yyyc514> i just want to save/load/access fields :)
14:29:40FromGitter<alehander42> mine is thought-only so far
14:30:25FromGitter<alehander42> I started a migrations library for my job, and I am still not sure if I can make them play nice to each other somehow
14:30:45FromGitter<yyyc514> in a macro if i type a string is there anyway to turn it into an enum value?
14:31:11FromGitter<yyyc514> i have an ident “dbSerial” and what I want is the actual dbSerial
14:31:21FromGitter<yyyc514> at compile time
14:37:38FromGitter<tim-st> is the following nimble syntax allowed? `requires "https://github.com/user/package@#branchname"`
14:41:36dom96remove the @
14:42:13FromGitter<tim-st> dom96: thanks, when I install @ head i always use the @ :\
14:43:36dom96The @ is only necessary on the command line
14:44:05FromGitter<tim-st> yeah, I realized that it doubles the @ in the required block
14:45:27FromGitter<tim-st> thanks, it works now. Now the final tests what happens with a newer same named version
14:46:25FromGitter<yyyc514> trying to do something simple like save a list of DbTypeKind at ocmpile time to a compile time variable
14:49:23FromGitter<yyyc514> building an ORM and web framework probably not a great first project learning nim lol
14:50:29FromGitter<alehander42> you're doing great!
14:50:37FromGitter<alehander42> :D we need some web framework competition
14:51:55FromGitter<yyyc514> so any idea how to turn “dbSerial” into dbSerial?
14:52:37FromGitter<alehander42> well, use a table
14:52:42*krux02 joined #nim
14:53:15FromGitter<yyyc514> ugh, is that the only way?
14:53:54FromGitter<yyyc514> something like `set_fields @["paste_id", “body”… ` easily works because it’s easy to turn strings into string in macros
14:53:59FromGitter<yyyc514> but not `set_types @[dbInt, dbVarchar,…`
14:54:36FromGitter<yyyc514> honestly i could probably just use strings, btu then you lose the niceness of types and all that compile time type checking etc
14:56:37*smt joined #nim
14:57:58FromGitter<alehander42> well isn't this DbTypeKind just an enum with several values
14:58:02FromGitter<alehander42> this is the simplest
14:58:13FromGitter<yyyc514> right
14:58:40FromGitter<yyyc514> guess i’m just whining about the difficulty… so for every type i’d want to use at compiel time i have to build my own lookup table?
14:58:53FromGitter<yyyc514> sounds ugh
14:59:02FromGitter<yyyc514> feel like i’m missing something
15:01:10FromGitter<alehander42> ok, you're right
15:01:15FromGitter<alehander42> if you know the enum type
15:01:29FromGitter<alehander42> it should be possible to map them with a helper macro
15:01:40FromGitter<alehander42> accessing the type as `typed` arg
15:01:53FromGitter<alehander42> it can iterate through the enum values
15:02:04FromGitter<alehander42> and check which of them has the same string repr
15:02:13FromGitter<alehander42> this should work for all enum types
15:02:19FromGitter<alehander42> i guess that's what json does
15:02:24FromGitter<yyyc514> well i think it’d be a proc running at compile time
15:02:30FromGitter<yyyc514> but yeah thanks to DbTypeKind(0) == string
15:02:39FromGitter<yyyc514> or at least $ works on it
15:02:58FromGitter<alehander42> well, that's actually even simpler indeed
15:03:07FromGitter<alehander42> great
15:04:54FromGitter<citycide> @yyyc514 I think maybe you need `parseEnum` from strutils?
15:05:23FromGitter<yyyc514> lol, does it already exist? looking
15:05:53FromGitter<yyyc514> lol
15:05:54FromGitter<yyyc514> great
15:07:19FromGitter<yyyc514> well and finally :)
15:07:22FromGitter<yyyc514> @citycide thanks!
15:11:33FromGitter<citycide> Sure thing
15:11:58narimirannim doc throws an error when it gets to the line which is `#################`
15:13:02narimiransolved by having `# ###########`, but even still....
15:13:40FromGitter<citycide> Alright I gotta try again now, I hit a problem with `AsyncHttpClient` last night, might be a bug: https://ptpb.pw/vyI9/nim
15:14:54FromGitter<alehander42> oh parseEnum, cool !
15:14:56FromGitter<citycide> That fails to compile in the playground with no helpful error, compiles fine in 0.19.0 but exits with no errors or output
15:15:04narimiranalso, nim doc somehow outputs "An alias for countup(a, b, 1)." as a documentation for one my function without any docstring! wtf?
15:15:29FromGitter<alehander42> narimiran `####` is a backdoor !
15:16:05FromGitter<alehander42> Araq, it would be cool to make `-d:banksy`which destroys random parts of the source files instead of compiling
15:16:51FromGitter<kaushalmodi> narimiran: https://github.com/nim-lang/Nim/issues/9432
15:19:01Araqyyyc514: look at Ormin for inspiration
15:19:20narimiran@kaushalmodi thanks, will write there too
15:20:24FromGitter<kaushalmodi> narimiran: yeah, you can add your minimal reproducible example there which could serve as another test case
15:21:02FromGitter<kaushalmodi> see my test case in https://github.com/nim-lang/Nim/issues/9432#issuecomment-431155362
15:21:28FromGitter<yyyc514> yeah an ORM is a bit more than SQL satement generation :)
15:21:40narimirani cannot have such a minimal (but working) example, unfortunately
15:21:40FromGitter<yyyc514> sql is the last of my problems right now :)
15:26:05FromGitter<alehander42> ormin is pretty nice, but I want to use my types as a base instead of the sql tables
15:27:04FromGitter<yyyc514> yeah i want to encode the db format in the code instead of loading it from the DB (ala rails)
15:27:20dom96citycide: there is an http client regression in Nim 0.19.0
15:27:27dom96You might be hitting it there
15:27:47*vlad1777d_ joined #nim
15:29:17FromGitter<alehander42> I also want to try to use the repo pattern, I don't really want to reimplement activerecord
15:31:20FromGitter<citycide> dom96: I thought that could be it, I'm currently trying to choosenim devel but that's failing for me on Win 10 now..
15:31:34dom96In what way is it failing?
15:32:22FromGitter<citycide> https://ptpb.pw/bHZT
15:35:32FromGitter<citycide> hmm I think it's the `nim-#devel` folder that it's failing on - I tried deleting it manually and apparently something is using it `¯\_(ツ)_/¯`
15:36:03FromGitter<citycide> thanks windows
15:37:31shashlickMust be nimsuggest
15:37:47shashlickYour editor still open?
15:38:18FromGitter<citycide> slashlick: I think you're right, I closed VS Code and was able to delete it. I was using stable but nimsuggest must have been hanging onto that directory for some reason
15:39:50shashlickWell if you ran vscode and then switched with choosenim after the fact, it might still be using the devel binaries
15:40:28FromGitter<citycide> not sure, I've had code open for days :)
15:41:13FromGitter<citycide> dom96: repro still fails on devel
15:41:35FromGitter<citycide> I can file an issue
15:41:37shashlickdom96: curious what your thoughts are on the choosenim release cycle - it isn't really dependant on the Nim release cycle, can we post more often?
15:41:53FromGitter<citycide> well not fails but it "succeeds" and doesn't have any output
15:42:35narimiranshashlick: https://github.com/dom96/choosenim/pull/95#issuecomment-432801256
15:43:50narimiranbut if we're doing 0.19.2 soon, it might be a nice timing to update choosenim too
15:44:38shashlickWell again I feel we can release more often
15:45:03shashlickHappy to help with releases if dom96 let's me know the process
15:45:18shashlickI think he builds on xp?
15:48:16shashlickMight need to look into musl to make life easier on Linux
15:54:24*nc-x joined #nim
15:56:47nc-xAraq: https://github.com/nim-lang/nightlies/pull/8 Appveyor now builds. Here is the run on my fork https://ci.appveyor.com/project/nc-x/nightlies/build/job/l53xcgdy9gn3fhv4
15:58:44nc-xAnd the 32-bit build fails because of some bug(?) in strutils: https://ci.appveyor.com/project/nc-x/nightlies/build/job/9byxa01c390vmkxw#L5921
16:02:11*nc-x quit (Quit: Page closed)
16:04:06*theelous3 joined #nim
16:04:33*darithorn joined #nim
16:09:52dom96shashlick: Yeah, I build on XP in a VM
16:09:54dom96It's a pain
16:10:40dom96I cycle between my projects and only release after I have had time to do some significant dev
16:12:18shashlickI'm happy to help with such stuff
16:12:37shashlickI feel choosenim should move faster since even minor improvements will help the community
16:13:28shashlickSay that binary build install PR, or perhaps a devel update with git pull rather than full rebuild
16:13:32dom96Sure, all help welcome
16:13:51dom96All I need to do is update a file in nim-lang.org
16:13:55dom96when a release happens
16:15:57dom96In fact, my travis config already uploads the binaries
16:16:03dom96on a release
16:16:23dom96Now that Travis supports Windows it may just be a case of turning that on
16:16:28dom96PRs welcome :)
16:16:44shashlickOk so when you get a chance, can you share your release process for both win and Lin
16:17:32FromGitter<alehander42> btw nice wrappers shashlick, I found only today the whole suite
16:20:21dom96shashlick: There isn't much to it, I tag a release. Travis builds the Linux/OSX binaries for me.
16:20:36dom96I build the Windows binary in a VM and package it up into a self-extracting .exe and .zip files
16:20:47dom96Then I upload it to GitHub
16:28:08FromGitter<yyyc514> so if i want to instrument the DB stuff do i have to wrap all the library functions completely?
16:29:00FromGitter<yyyc514> or rewrite them?
16:43:45FromGitter<yyyc514> *sighs* ok yeah the compile time variables seem to be shared so if a seond model changes them then the first model stops working
16:45:31FromGitter<yyyc514> hmmm or maybe not
16:49:29dom96are you writing an ORM? :O
16:51:07FromGitter<yyyc514> that’s the idea
16:51:15FromGitter<yyyc514> or the beginnings of one at least
16:51:50dom96Awesome!
16:52:17*platoff joined #nim
16:54:02dom96I'm not 100% sure about your question, but the macro cache is pretty flexible
16:54:07dom96You should be able to use it for this
16:54:15dom96What do you need the cache for though?
16:58:22FromGitter<yyyc514> right now trying to figure out simple stuff like a model keeping track of it’s fields and referencing them later
17:05:31FromGitter<yyyc514> right now i’m left with stuff like this though which seems pretty ugly to me: https://gist.github.com/yyyc514/0afa3a3486bb1b797487d8ac49ce1244
17:07:45FromGitter<yyyc514> so much uglier than like my find() which doesn’t need to be deferred
17:08:42FromGitter<yyyc514> actually grrr, find is referrings the same variables
17:10:49FromGitter<alehander42> are you asking about the db_
17:10:51FromGitter<alehander42> modules?
17:11:03FromGitter<alehander42> it would be great to reuse them
17:12:11FromGitter<alehander42> but they basically help with connection and returning raw results
17:12:13FromGitter<yyyc514> looks like to add instrumenttion you’d have to copy and paste them and rewrite them
17:12:27FromGitter<alehander42> in my ORM I am planning on adding custom sql generators for each one
17:12:38FromGitter<alehander42> mostly sharing code
17:14:07FromGitter<alehander42> maybe I am not sure about which instrumentation are you talking
17:16:58*krux02 quit (Remote host closed the connection)
17:18:29FromGitter<alehander42> what would be your queries actually? e.g. insert
17:21:17FromGitter<yyyc514> huh?
17:21:36FromGitter<yyyc514> i want to instrument the queries, log them, time them, etc...
17:22:01FromGitter<alehander42> well, your code generates and executes the queries
17:22:33FromGitter<alehander42> I don't understand why would you need to rewrite the db_ modules
17:22:42FromGitter<yyyc514> so you can instrument them
17:22:51FromGitter<yyyc514> because they bury the SQL generation
17:23:00FromGitter<alehander42> eh?
17:23:19FromGitter<yyyc514> if i want to log the SQL call and the time i can’t do it without repeating work (dbFormat twice, etc)
17:23:33FromGitter<yyyc514> so there is no easy way to wrap the library
17:24:51*platoff quit (Ping timeout: 252 seconds)
17:25:52FromGitter<alehander42> huh, I just found db_common
17:25:56FromGitter<alehander42> useful
17:26:17FromGitter<alehander42> well, you can directly exec the dbFormat result?
17:26:44FromGitter<yyyc514> then you have to rewrite the insertID stuff :)
17:28:04FromGitter<alehander42> yeah, btw I used getRow(" ... ... RETURNING id")[0].parseInt for this
17:28:06FromGitter<alehander42> until now :D
17:28:18FromGitter<alehander42> but insertID is very simple
17:28:33FromGitter<alehander42> it's not perfect, but you can single-case it
17:29:07*kapil____ quit (Quit: Connection closed for inactivity)
17:29:40FromGitter<tim-st> Ideas? https://github.com/nim-lang/nimble/issues/573
17:29:56*nsf quit (Quit: WeeChat 2.2)
17:30:21FromGitter<alehander42> I wonder more if dbQuote is robust enough
17:30:35FromGitter<alehander42> but if you have something that sanitizes args correctly
17:31:00FromGitter<alehander42> you can dbFormat with it, and then reuse the query
17:32:12FromGitter<alehander42> you can also directly PR the stdlib if this is not sufficient
17:32:24FromGitter<yyyc514> yeah i can’t do it like i want *blah*
17:32:44FromGitter<yyyc514> can’t use compiel tile variables in the model eacuse they get clobbered with multiple model
17:32:55FromGitter<yyyc514> if you have the source in the model module file itself
17:33:21FromGitter<yyyc514> maybe you have to generate it all with macros completely?
17:33:24Araq*cough* Ormin
17:33:30FromGitter<yyyc514> not helpful
17:33:50Araqit is, it asks the right questions and the implementation is pretty cool too
17:34:13FromGitter<yyyc514> i looked, it’s not really an ORM imho
17:34:28FromGitter<alehander42> it is an ORM of course
17:34:30FromGitter<yyyc514> i ant to declare typs and then Paste.find paste.destroy etc
17:34:37FromGitter<alehander42> this is just the rails orm
17:34:48AraqI don't care about terminology
17:34:49FromGitter<alehander42> there are a lot of ORM designs
17:35:10FromGitter<yyyc514> well i’m trying to write mine :)
17:35:23FromGitter<alehander42> great, but you're incorrect about ormin
17:35:36AraqOrmin is typesafe and has no overhead and it respects the DB technology
17:35:56FromGitter<yyyc514> i think i got too far without trying to do multi-model
17:36:26*hoijui joined #nim
17:36:39AraqI think Nim's type system doesn't describe foreign keys and relations very well so I generate the Nim types from the model not the other way round
17:36:59dom96Araq: why does strutils disable line trace?
17:37:36dom96Is it just that the nimln() calls add too much overhead for such a heavily used module?
17:38:46FromGitter<alehander42> @Araq well here it's a matter of taste: some people would prefer to do it all in Nim, not defining all their tables in sql first
17:39:07FromGitter<alehander42> and I feel the foreign key thing is a moot point: even if you load them from a model
17:39:16FromGitter<alehander42> you still need to describe them somehow in a typesafe way
17:39:20FromGitter<alehander42> to map them to something
17:40:26Araqdom96: it's a mistake, the .push should only refer to cmpIgnoreStyle
17:40:33dom96ahh, cool
17:40:34Araqbut code got edited :P
17:40:36dom96I'll make a PR
17:40:41Araqok thanks.
17:40:49dom96Can we also add an indicator for tracebacks?
17:40:59dom96That the line number is missing because line tracing is off?
17:41:08AraqRFC: push/pop is error prone, replace with a pushPragma block
17:41:28dom96Seeing `a8.nim (LF:OFF)` would already be much better than `a8.nim`
17:41:38dom96Where even you have no idea whether it's a bug or not
17:41:55Araquse nimfix2 on every Nim codebase out there to patch your .push/pops
17:42:02Araqok enough of this.
17:42:22Araqwell if line info is turned off we don't know about LF:OFF
17:42:39Araqbut maybe I'm not creative enough...
17:43:33Araqalehander42: maybe but I also have 'create index' statements that Ormin can simply ignore
17:43:35dom96We're generating calls to nimfr anyway
17:43:56Araqhuh, do we...
17:44:12dom96yeah, otherwise why would there be an entry in the stack trace at all?
17:44:22dom96Btw I'm getting "Error: {.pop.} without a corresponding {.push.}" :/
17:44:51FromGitter<alehander42> well, this is an optimization which can be configured separately
17:44:51dom96oh
17:44:57FromGitter<alehander42> (createIndex)
17:44:57dom96it pops everything :(
17:45:08FromGitter<alehander42> we need a popBot
17:46:02FromGitter<alehander42> and I think foreign key relations can be described fine, but my plan includes using a `models:` macro anyway
17:46:20Araqalehander42: well model generation from Nim code can also be added to Ormin
17:46:33dom96Oh right, it was a pop but really far down
17:46:46FromGitter<alehander42> unless we get typesection macros which reminds me https://github.com/nim-lang/Nim/issues/9139 yes or no (so I can know what to do in gara)
17:46:52AraqI'm not opposed to it but Ormin is useful without it too
17:47:37Araqalehander42: "no" for now but I'll consider it after v1
17:47:44dom96I would definitely say "no" for now
17:47:49dom96and possibly in future too
17:49:48Araqwell I like the proposal, but it's just sugar we can live without
17:50:06Araqtype sections are super unlispy though
17:50:12Araqand can be improved
17:51:53FromGitter<alehander42> I actually wonder, why did nim originally start having type sections instead of just ⏎ `Name = <type>`
17:52:33*kapil____ joined #nim
17:53:39Araqtoo much Pascal influence plus type sections are special because only in them you are allowed to write cycles
17:53:39FromGitter<alehander42> yeah the macros might be too much for now (but each macro hook prevents some future backward incompatible changes)
17:54:04FromGitter<alehander42> I originally wanted to directly RFC a new `data` or `variant` keyword
17:54:09FromGitter<alehander42> but I thought macros have a better chance
17:54:17FromGitter<alehander42> ah yeah, the cycles
17:56:27theelous3hi, noob here just started finished poking through part 1 of the tut. How can I define a proc that can take a seq of any type?
17:56:39theelous3wow I mangled that sentence
17:56:40theelous3:D
17:57:15FromGitter<alehander42> you need a generic function
17:58:26FromGitter<alehander42> are the elements in the list with the same type ?
17:58:35FromGitter<tim-st> theelous3: proc test(s: seq) = echo s.len; test(@[1,2,3])
17:58:57theelous3well, I'm just writing a little proc to get the last element of xs, where xs is a seq. iirc a seq doesn't have to be all of the same type?
17:59:10theelous3at least the sequence section doesn't mention they have to all be of the same type
17:59:11FromGitter<tim-st> it must be the same type
17:59:13theelous3ok
17:59:40theelous3well, I don't understand the question then, of "are the elements the same type"
17:59:44FromGitter<tim-st> but you *could* use type pointer but that bad; normally you never need to use a generic seq; that's python style
17:59:46*leorize joined #nim
17:59:58narimirantheelous3: you cannot have @[1, 2.4, "foo"]
18:00:12theelous3I gettcha
18:00:25theelous3I could have a list of refs to different things of different types
18:00:27theelous3but that's bad?
18:00:35narimiranbtw, to get the last element of xs, you can just do xs[^1]
18:00:40FromGitter<tim-st> yes, the safety is gone then
18:00:46theelous3:)
18:01:07FromGitter<tim-st> have a look at object variant, json or you can chose a better style to use same type seq
18:01:08theelous3so by "generic" I can simply leave out the typing
18:02:11FromGitter<alehander42> not exactly, you can reuse the same function for different types
18:02:17FromGitter<alehander42> e.g. proc(e: seq[T])
18:02:35FromGitter<alehander42> `proc fT (e: seq[T])`
18:02:35*elrood quit (Quit: Leaving)
18:02:43FromGitter<alehander42> can be called for
18:02:46FromGitter<alehander42> seq[int]
18:02:48FromGitter<alehander42> seq[float]
18:02:51FromGitter<alehander42> seq[whatever]
18:03:08theelous3is T an actual thing here, meaning 'of whatever type'?
18:03:15FromGitter<alehander42> yes
18:03:23FromGitter<alehander42> but all the elements of the seq need to be the same T
18:03:45FromGitter<tim-st> and T has to be clear at compile time
18:03:47theelous3so `proc lastElm(xs: seq) =` is not valid?
18:04:01FromGitter<tim-st> it is valid
18:04:10FromGitter<tim-st> but not for mixed seq like @[1, "abc"]
18:04:30dom96I feel like you guys are going off on a tangent here
18:04:32theelous3what is the difference between the seq[T] example and the bare seq
18:04:35FromGitter<alehander42> it means the same thing
18:04:41FromGitter<alehander42> it's just a shorter notation
18:04:47theelous3ok :)
18:04:52dom96`seq` is a typeclass
18:04:55dom96It's not exactly the same
18:05:05FromGitter<alehander42> well, it's an initial explanation
18:05:10FromGitter<tim-st> [T] is more often used
18:05:30dom96It's better to be more explicit with seq[T]
18:05:33theelous3roger
18:05:35dom96and most of us will use that notation
18:05:48theelous3for my return type for lastElm, should I also use T?
18:05:55FromGitter<alehander42> yes
18:05:59theelous3proc lastElm(xs: seq[T]): t =
18:06:02theelous3like so
18:06:09theelous3oops, T no t
18:06:19FromGitter<tim-st> proc lastElmT (xs: seq[T]): T = I think
18:06:33theelous3seemsgood
18:06:35dom96proc lastElm[T](xs: seq[T]): T
18:06:41dom96FromGitter relay eats the brackets
18:06:46narimiranthat's lastElm[T], theelous3, gitter strips brackets sometimes
18:06:49FromGitter<alehander42> no gitter also kills it
18:06:54theelous3oh huh
18:06:54FromGitter<alehander42> you need to quote it
18:07:17FromGitter<alehander42> `proc lastElmT (xs: seq[T]): T`
18:07:25theelous3what's the [T] between lastElm and (xs: seq[T]) there
18:07:32theelous3ok
18:07:34dom96That's the generic definition
18:07:36FromGitter<alehander42> it tells Nim T is a generic argument
18:07:47dom96You can name it whatever you want
18:07:50FromGitter<tim-st> it's called generics^^
18:07:50theelous3ah, so T as a char
18:07:51theelous3yeah
18:08:02dom96proc lastElm[MySeqElem](xs: seq[MySeqElem]): MySeqElem
18:08:07oprypinFromGitter doesn't escape markdown, which can actually be useful, but then there's that
18:08:18theelous3so I can put whatever there, like proc lastElm[XXX](xs: seq[XXX]): XXX =
18:08:27oprypinGitter users need to be mindful not to edit messages, and IRC users need to be mindful about Markdown
18:08:36dom96oprypin: I consider that a bug :P
18:08:43FromGitter<alehander42> wow the fromgitter guy himself
18:08:54FromGitter<alehander42> theeolous3 yep
18:08:57theelous3sweet
18:09:19theelous3T by convention though I take it
18:09:30dom96yeah
18:09:31theelous3what about multiple generics?
18:09:41FromGitter<tim-st> `[A, B]`
18:09:44dom96T, U
18:09:47theelous3I presume we don't start walking the alphabet from T?
18:09:49theelous3or we do?
18:10:00FromGitter<alehander42> actually many people do
18:10:14theelous3fair enough :D It'll improve my alphabet skills
18:10:19dom96For some reason the convention is T, U, V
18:10:26dom96or maybe T, V, U
18:10:31FromGitter<alehander42> no no no
18:10:34FromGitter<alehander42> T U V
18:10:37theelous3if a cop ever asks me to start the alphabet at a strange location I'll blow him out of the water
18:10:40dom96Feel free to use A, B, C too though
18:10:47FromGitter<alehander42> or maybe Т У Ф
18:10:57theelous3unicode train picture
18:10:59theelous3gottcha
18:11:05theelous3pictures*
18:11:10FromGitter<alehander42> oh cmon man, doesn't irc support cyrillic
18:11:25theelous3it does lol
18:11:35theelous3I was just suggesting a language agnostic alternative
18:11:47theelous3pictures of trains for clarity and inclusion
18:12:03FromGitter<alehander42> i am only happy when it trains
18:13:04narimiranpurple train?
18:14:59theelous3do people get upset if code is 4 spaced?
18:15:17theelous3is the 2 space convention strong?
18:15:21FromGitter<alehander42> we just get sad
18:15:21narimiranmuch less than when i see space before a colon ;)
18:15:35theelous3 :D
18:15:51narimirantheelous3: give 2 spaces a try. do it for a week, and then (try to) go back ;)
18:16:04dom96#2Spaces4Life
18:16:14theelous34 life
18:16:19dom96:P
18:16:20FromGitter<alehander42> EFFICIENCY
18:16:23narimirannow python looks to me s o m u c h i n d e n t e d
18:16:33theelous3yeah I'm coming from python
18:16:39dom96See how well that works? #4Spaces8Life just doesn't work :P
18:16:49theelous3 8 life
18:16:52theelous3seems fine
18:16:55theelous3one short of a cat
18:17:01FromGitter<alehander42> now i am hungry again
18:17:20theelous3have pizza en route to celebrate not being lazy and trying a new lang
18:17:43FromGitter<alehander42> the universe expands though, so after a while we'll have 2^12 spaces
18:17:47FromGitter<alehander42> cherish the moment
18:17:51narimirantheelous3: nice idea! i should give rust a try and order some pizza too! :D
18:17:56theelous3:D
18:18:03dom96#2Deep4Me :P
18:18:19theelous3rust is nice. refs and borrowing is awesome, if a little weird to start
18:18:20narimirangr8 m8
18:18:36theelous3i like the whole never-null thing
18:18:42FromGitter<alehander42> narimiran, you'll have an incredibly oxidized pizza
18:18:49theelous3lol
18:19:25theelous3how to mentions work across the gateway? does alehandder42 mention, or do I need to @
18:20:08narimiranwell, i'm still changing my mind: should i try rust (i just quickly went through its tutorial) or should i maybe do something in nim? (or, should i, like normal people, enjoy saturday evening watching some sitcom)
18:20:12FromGitter<alehander42> you need to `@`
18:20:18theelous3ok :)
18:20:31theelous3narimiran: the rust book is really nice
18:21:06theelous3I think more langs should make a serious effort to have their own cannonical book in that style
18:21:07FromGitter<alehander42> narimiran I am trying to start a side project while binging brooklyn 99, do both
18:21:36theelous3charles <3
18:21:49FromGitter<alehander42> I almost starting using `you need to type one d you fucking punk` to theelous3
18:21:57FromGitter<alehander42> holt really got crazy
18:21:59dom96narimiran: nim of course
18:22:12narimirandom96: the voice of reason ;)
18:22:25theelous3@alehander42 one d? totally baffled lol
18:22:29Araqyeah every language should just do as Rust does it, why don't they? these morons. - What do you mean, not every language has seen multimillion dollar investments?
18:22:38FromGitter<alehander42> theeolous3: i am incredibly confused by charles' culinary taste
18:22:40dom96theelous3: You should check out my book :D
18:22:51theelous3dom96: show me your... book
18:23:02narimiranshit theelous3, you summoned wild Araq!
18:23:49FromGitter<alehander42> Araq, we just need to build our own browser and bancrupt mozilla
18:23:53theelous3official python tut was written with no funding and is, I think, quite a bit longer than the rust book
18:24:01theelous3just needs a couple of people who care
18:24:15theelous3and hello wild Araq
18:24:31narimirantheelous3: well, i did https://narimiran.github.io/nim-basics/ , but it is just the basic stuff, it needs "part 2"
18:24:31theelous3just takes time is all
18:24:46theelous3if it has any exercises, I'm sold
18:25:04narimiranit has exercises after some sections
18:25:12theelous3I always end up defaulting to the haskell 99 problems (stolen from perl?) whenever I try something new
18:25:14FromGitter<alehander42> I always think building a simple project in a lang is a great way to start
18:25:31FromGitter<alehander42> I am too lazy for exercise problems
18:25:34narimiranto me, AoC is great tool for learning a new language
18:25:54theelous3steep ramp up with AoC, props to you for the approach
18:26:10dom96theelous3: http://book.picheta.me/
18:26:36dom96It costs money but it's a book :)
18:26:44Araqhi theelous3 welcome
18:26:58theelous3thanks
18:27:11dom96I do wish I could have negotiated a deal where I could keep the e-book open source
18:27:16dom96Maybe someday
18:28:59theelous3dom96: these are both yours?
18:29:14dom96both?
18:29:27theelous3oh sorry
18:29:36theelous3different people linked things
18:29:40theelous3thought you linked both
18:29:50dom96It's your lucky Saturday guys! I finally published the analysis of the 2018 Nim community survey: https://nim-lang.org/blog/2018/10/27/community-survey-results-2018.html :)
18:30:15FromGitter<alehander42> oh yesh
18:30:17narimirankrux couldn't have his 5 days of fame? :D
18:30:21FromGitter<alehander42> time to check all the stats
18:30:32dom96brb food
18:33:19theelous3"module import semantics" 1%
18:33:24theelous3what a stickler
18:52:37FromGitter<tim-st> btw I read sizeof is compile time now? does it work for all types at compile time?
18:54:46shashlick@alehander42: thank you, very appreciated!
18:55:22shashlick@dom96: so looks like only choosenim for windows needs some automated releasing - I'll look into it
18:55:54FromGitter<dawkot> how do you silence "expected kstring but expected cstring" sort of errors?
18:57:09shashlick@dom96: do you think there any need to get choosenim built with musl? cc @kaushalmodi
18:57:52FromGitter<tim-st> sizeof seems to work :) https://gist.github.com/tim-st/f458b7c17c62d42e5b1197c5edf098eb
18:58:07FromGitter<tim-st> 4 ⏎ 6 ⏎ 4
18:59:19*zachk joined #nim
19:03:19*kungtotte joined #nim
19:04:09*hoijui quit (Ping timeout: 246 seconds)
19:08:27FromGitter<yyyc514> why does `result = quote:` work but not `result.add quote:`
19:08:29*zachk quit (Changing host)
19:08:29*zachk joined #nim
19:08:43*narimiran quit (Quit: Konversation terminated!)
19:08:45dom96dawkot: huh, kstring == cstring IIRC (on JS backend at least)
19:09:18dom96shashlick: Yeah, musl would be helpful, there have been people who had trouble on distros with an older GLIBC
19:09:20FromGitter<yyyc514> is there a way to properly escape it?
19:10:10FromGitter<dawkot> @dom96: Sure, but nim complains about expecting one type and not the other. Not very important because code compiles, just a little annoying.
19:11:08theelous3what's a good paste service for nim?
19:11:22FromGitter<yyyc514> lol
19:11:24FromGitter<yyyc514> i’m working on one :)
19:11:30dom96yyyc514: result.add(\nquote:\n) or something like this
19:11:31FromGitter<yyyc514> but that doesn’t help you right this sec
19:11:40theelous3:D
19:11:52dom96dawkot: It gives that as a warning?
19:11:58dom96That seems incredibly strange
19:12:01dom96Never seen that before
19:12:54*theelous3_ joined #nim
19:13:51FromGitter<yyyc514> dom96: youd’ think but i must be doing it wrong
19:14:00FromGitter<kaushalmodi> shashlick: yes, musl build of choosenim will help folks like me on OS with older glibc; ref: https://github.com/dom96/choosenim/issues/15
19:15:44FromGitter<yyyc514> dom96: need quote do for some reason
19:15:48FromGitter<dawkot> @dom96: It's a type mismatch error, so for this code: https://pastebin.com/MUHbbMsv it says: https://pastebin.com/hPMzhTQp
19:15:56*narimiran joined #nim
19:16:09dom96yyyc514: submit a bug for this please, I want us to get rid of this requirement (and the do notation in general)
19:16:44dom96dawkot: that's an error though, it shouldn't compile anyway
19:17:39FromGitter<dawkot> @dom96: I think it just assumes the code will be compiles to c where kstring is string (right?)
19:18:33dom96https://github.com/pragmagic/karax/blob/master/karax/kbase.nim#L4
19:21:07*jsonfrost left #nim (#nim)
19:22:39FromGitter<tim-st> this one would allow clean go to nim source code translation :0 https://github.com/ReconfigureIO/goblin
19:22:40FromGitter<alehander42> ah I use this a lot in my code like `defaultstring`
19:27:37FromGitter<kaushalmodi> theelous3: paste service: ptpb.pw
19:27:39FromGitter<mratsim> @tim-st https://github.com/stefantalpalaru/golib-nim
19:28:04FromGitter<mratsim> and you can use the Go GC in Nim :p https://github.com/nim-lang/Nim/pull/2851
19:28:35FromGitter<kaushalmodi> theelous3: add "/LANG" to the end of the links to syntax hightlight the code in that LANG e.g. https://ptpb.pw/bkz3/nim
19:28:35FromGitter<tim-st> @mratsim afaik this only implements the go language concepts, but doesnt allow using go source code
19:28:57FromGitter<tim-st> imagine just loading their crypto things
19:29:21theelous3nice ty
19:29:24FromGitter<alehander42> @tim-st honestly, you'd be better off porting them
19:29:38FromGitter<tim-st> ^^
19:29:42FromGitter<alehander42> but a go2nim tool can of course help with that
19:29:44dom96Damn. moigagoo's karax tutorial is awesome https://moigagoo.svbtle.com/exploring-karax
19:30:14FromGitter<alehander42> great, karax really needs a site with a similar tutorial
19:30:14FromGitter<kaushalmodi> theelous3: If you use Emacs, there's a package supporting webpastes to arbitrary services
19:30:21FromGitter<tim-st> the go2nim ast translator would still need a translation of the "magic" elements from go
19:30:28dom96yeah, we need promotional sites for Karax and Jester
19:30:35FromGitter<kaushalmodi> using that I just select the code, press key binding and I get the link
19:30:36FromGitter<alehander42> jester too, it's really strange to look at example files
19:30:38FromGitter<alehander42> yes
19:30:40dom96Araq: Might be worth hiring someone to create a cool website for Karax
19:31:12FromGitter<alehander42> @tim-st well, this shouldn't be too hard compared to e.g. porting dynamic languages
19:32:02FromGitter<alehander42> can you give an example of hard to translate "magic"
19:32:04FromGitter<tim-st> @alehander42 yes this was exactly my idea and together with the library above which implements the hard "go only" things in nim everything should be there
19:32:32FromGitter<tim-st> there is nothing hard to translate in the magic, it's just manual work
19:32:54FromGitter<tim-st> I think most of them is covered by nim stdlib already likely all
19:32:56FromGitter<alehander42> yeah, but my point was that such a go2nim should be enough to do ~50-90% of the work, but it will always require some human touch
19:33:06FromGitter<alehander42> at least to make more nim-ish API-s
19:33:16FromGitter<tim-st> no, it wouldnt require it
19:33:26FromGitter<alehander42> but then the lib will suck
19:33:37FromGitter<tim-st> because the ast is translated to nim ast and nim ast can dump to nim scource code in nim style
19:33:40FromGitter<tim-st> (I assume)
19:33:41*nsf joined #nim
19:33:42FromGitter<alehander42> compared to a pure nim solution
19:34:00*hoijui joined #nim
19:34:22FromGitter<tim-st> yes, a bit, like the interface type
19:34:42FromGitter<alehander42> what I mean is that from a lib design viewpoint it's a bit better to have properly designed Nim API with stronger types & more flexible DSL-s
19:35:02FromGitter<alehander42> so e.g. such a tool can do the hard job of translating all the algorithms and boring logic
19:35:15FromGitter<alehander42> but a human can still refine it a bit
19:35:15FromGitter<tim-st> yes, but I think the normal go api could be used then
19:35:31FromGitter<alehander42> at least that was our initial intention while working on py2nim
19:35:42FromGitter<tim-st> especially since go requires a main func
19:36:01FromGitter<tim-st> but it would be too much work ;)
19:36:12FromGitter<alehander42> yes, but what's considered a nice api in Go isn't always a nice api in nim (and reverse)
19:36:20FromGitter<alehander42> but of course, this is a secondary concern
19:36:31FromGitter<alehander42> having a way to somehow reuse/port code is always useful
19:36:37FromGitter<tim-st> yes, then it would need "wrappers" like from c code
19:37:50FromGitter<alehander42> well, that's the thing: the way I imagine is "A ports lib B to B-NIM using go2nim and then refines it and then the community maintains B-NIM separately"
19:38:10FromGitter<alehander42> but you imagine "A compiles B to B-NIM and then the development continues only in the Go original"
19:38:35FromGitter<alehander42> the second thing is more immediately useful
19:39:13FromGitter<alehander42> but I'd love if people maintain pure-nim ports/libs too
19:40:08FromGitter<tim-st> yes, though I dont know if it's legal at all to port a lib 1:1 :\
19:40:17FromGitter<tim-st> regarding license
19:40:57FromGitter<alehander42> yeah, for some licenses it must be fine
19:41:15FromGitter<alehander42> it mostly influences the nim lib license
19:41:41FromGitter<alehander42> @arnetheduck probably knows more about this (licenses of ported libs)
19:42:05FromGitter<tim-st> but it would be fun to create such a go2nim I looked at the created json ast and it should be enough information :)
19:46:03theelous3is there a list / iterator comprehension syntax?
19:46:21theelous3I see some old SO posts about a macro in future
19:46:29theelous3that supported natively now?
19:46:29FromGitter<alehander42> @tim-st absolutely, those things are fun
19:46:58narimirantheelous3: there is but it is ugly
19:47:05FromGitter<kaushalmodi> theelous3: there's one in works (list/dict aka table/set comprehension): https://github.com/alehander42/comprehension
19:47:08narimiranbetter to use `map` and `filter`
19:47:46theelous3can operators be used in a map?
19:48:00theelous3as proc
19:48:06theelous3nvm I'll just google it, being lazy
19:48:06narimiranyes
19:48:17theelous3neato
19:48:28narimiranand for some sugar, see `mapIt` https://nim-lang.org/docs/sequtils.html#mapIt.t%2Ctyped%2Cuntyped
19:49:01theelous3oh that's decent
19:49:04FromGitter<kaushalmodi> was going to say `mapIt` :)
19:49:35FromGitter<alehander42> yes, for now please use mapIt / filterIt
19:49:47FromGitter<alehander42> these days the comprehension lib will be ready too
19:50:26narimirantheelous3: and here is `map` documentation, so you can see proc usage: https://nim-lang.org/docs/sequtils.html#map%2CopenArray[T]%2Cproc(T)
19:51:07FromGitter<kaushalmodi> I had posted this about 2 days back; hope it is OK to post again: https://scripter.co/notes/nim/#mapit
19:54:11dom96theelous3: you're supposed to use a for expression
19:54:15*stefanos82 quit (Quit: Quitting for now...)
19:54:50dom96although I'm not sure that's been implemented heh
19:54:52FromGitter<alehander42> argh `~` just works with a `[]` `{}` `()` dsl so much better than `comp`
19:55:21narimiran@alehander42 post a snippet
19:55:22*Vladar quit (Remote host closed the connection)
19:55:28dom96Araq: Where are we with for loop expressions?
19:55:48narimirandom96: we have them for some time now
19:55:49FromGitter<kaushalmodi> @alehander42 My only worry is that `~` has already a lot of connotations
19:55:56FromGitter<kaushalmodi> "not", "matches"
19:56:08dom96narimiran: got a link to an example handy?
19:57:05FromGitter<alehander42> https://gist.github.com/alehander42/3fd73a60f83ce381039b523e38a629fa
19:57:17FromGitter<yyyc514> https://gist.github.com/yyyc514/d52078db8013a43d90f839545a80ba7a why the heck is it expecting NimNode?
19:57:30narimirandom96: Araq usually posts this when asked about it: https://github.com/nim-lang/Nim/blob/132eb31e32844a6cb312d9d33d62c522772548b9/tests/macros/tcollect.nim
19:57:50FromGitter<alehander42> @kaushalmodi yep, I don't like it too much, but symbols are easier to make it work with `[]` `{}`
19:58:17dom96narimiran: thanks <3
19:58:22FromGitter<kaushalmodi> what about `%`?
19:58:22narimiran@alehander42: what is (...) comprehension? tuple?
19:58:34FromGitter<alehander42> on the other hand we can just have `comp(..)` for everything but the body being `{element}` for sets is a bit hacky: it might seem like you are returning a set for each iter
19:58:37dom96I'll be using more hearts now because someone in the survey said they felt #nim doesn't have a "loving atmosphere" :)
19:58:51*theelous3_ quit (Changing host)
19:58:51*theelous3_ joined #nim
19:58:55FromGitter<alehander42> narimiran was originally all the comprehensions
19:58:56theelous3_I was trying stuff like http://dpaste.com/3GJJC91
19:58:57theelous3_but eh, idk
19:59:10FromGitter<alehander42> in this idea is a seq one, but this is also not perfect I agree
19:59:32FromGitter<alehander42> I planned on `comp[..] / symbol[]`
19:59:42FromGitter<alehander42> but I thought people might expect an array?
19:59:50narimiran[x] seq, {x} set, {x: y} table
20:00:03FromGitter<kaushalmodi> @alehander42 ahem.. what about `🎜( ..)`, `🎜[ .. ]`
20:00:03FromGitter<alehander42> on the other hand people don't really use arrays like that often
20:00:05dom96This is the first one I tried: https://gist.github.com/dom96/7e259733ac50356a0c8adf485014e4b3
20:00:09FromGitter<kaushalmodi> you know .. *compose*
20:00:19FromGitter<kaushalmodi> vvcrrrlfuhnreecuigibugjkbiklfgcviktivbegtcdv
20:00:35FromGitter<alehander42> @kaushalmodi I see a weird rectangle :D
20:00:40FromGitter<kaushalmodi> oh
20:00:49FromGitter<kaushalmodi> i pasted https://emojipedia.org/beamed-ascending-musical-notes/
20:00:59FromGitter<alehander42> @dom96 the problem is that people often expect dict/set comprehensions too
20:01:33FromGitter<alehander42> so you basically have 3 choices: having a diff name for each: ⏎ ⏎ ```setcomp(for ..) ⏎ tablecom(for )``` [https://gitter.im/nim-lang/Nim?at=5bd4c41c82893a2f3b4d39b7]
20:01:52FromGitter<alehander42> having a single name for all and somehow hinting what it is in its body
20:01:58FromGitter<kaushalmodi> why not just `lc`, `tc`, `sc`?
20:02:02FromGitter<alehander42> comp(for .. {element}) ⏎ comp(for .. {k: v})
20:02:13FromGitter<alehander42> or having `comp[..] comp{} .. `
20:02:47FromGitter<alehander42> @kaushalmodi those two letter names sound weird to me
20:02:50FromGitter<yyyc514> weird, “result” inside quote: doesn’t work right?
20:02:54FromGitter<alehander42> a lot like a misterious unix command
20:02:55narimiran@kaushalmodi: if we're being (too) pedantic, `lc` doesn't give you *list* ;)
20:03:07FromGitter<alehander42> yes and seq / set both use s
20:03:13FromGitter<kaushalmodi> hmmm
20:03:43narimiranuse `!` ?
20:04:39theelous3_does this make sense? sum((var i = 0; for x in xs: inc(i); i))
20:04:42FromGitter<alehander42> it doesn't seem to work when I do a macro !
20:05:01FromGitter<alehander42> but I can use `@@`
20:05:06FromGitter<alehander42> which sounds insane
20:05:18narimiranyeah, let's not go there please :D
20:06:27FromGitter<alehander42> theelous3 yes, you can also use for i, x in xs: i
20:06:33FromGitter<alehander42> you dont need enumerate
20:06:35FromGitter<alehander42> like python
20:08:35narimirantheelous3_: well, there's nothing to sum there, the result of the parenthesis is a number
20:08:55FromGitter<rayman22201> @dom96 thanks for community survey post! Nice to see the results!
20:09:03dom96np :)
20:09:12dom96I'm curious what you guys think about it too
20:09:31dom96Analysing all of this has been hard so I decided to just create a massive screenshot to give everyone a chance to look at most of the data
20:10:01FromGitter<alehander42> @narimiran @kaushalmodi we can also have <-{for e, f in a: 0}
20:10:07FromGitter<alehander42> sounds best to me from all the symbols
20:10:35narimiranbut it doesn't make sense if there's a = before that
20:10:39*nsf quit (Quit: WeeChat 2.2)
20:10:46narimiranlet a = <-{.....}
20:11:42narimiranif that was `let a <- {...}` i would be ok with it
20:13:03theelous3_narimiran, heh, yeah
20:14:43FromGitter<alehander42> ok yeah
20:14:51FromGitter<alehander42> well then `comp[]` `comp{}` it is
20:15:28FromGitter<alehander42> and comp() can generate an iterator ??
20:15:30FromGitter<kaushalmodi> final suggestion.. `seqC`, `tabC`, `setC`
20:15:56FromGitter<alehander42> my only worry is that overriding `{}` might somehow break something
20:16:24FromGitter<kaushalmodi> my above suggestion is to remember bracket remembering overhead (even though not much)
20:16:32FromGitter<kaushalmodi> set has {} association, but others don't
20:16:38FromGitter<mratsim> might somehow break something somewhat*
20:16:44theelous3@alehander42 aye ty, just trying to do things awkwardly to learn :P
20:17:04FromGitter<kaushalmodi> with seqC, tabC, setC, it clear what type of comprehension it is
20:17:14FromGitter<kaushalmodi> and the usual () parens would be used
20:17:24narimiran@alehander42 iterator comp. would be nice indeed
20:17:41FromGitter<mratsim> I’m still always wondering in {‘foo’: 1, ‘bar’: 2}.toTable what does those `{}` mean and produce
20:18:01FromGitter<kaushalmodi> @mratsim +1
20:20:51FromGitter<rayman22201> @dom96 One thing I immediately notice is that the "do you feel informed about the direction of Nim" and the "Should Nim be 1.0 already?" questions seem highly correlated. If people aren't informed about Nim, it's hard to make value judgements about the stability / 1.0ness, if that makes any sense? But, I think the situation has improved since the survey, and probably since the status.im sponsorship... Also, the
20:20:51FromGitter... results about wanting improved docs makes me feel somewhat vindicated for caring about that aspect of Nim :-P
20:21:06FromGitter<tim-st> @mratsim it produces [(k, v)]
20:21:17FromGitter<tim-st> (an array of kv tuples)
20:21:50FromGitter<alehander42> @kaushalmodi very hard for me to assess <name>C vs comp brackets
20:22:46dom96rayman22201: yeah, docs are really something I want us all to improve. Definitely good that you care :)
20:25:38*chemist69 quit (Ping timeout: 276 seconds)
20:27:05*chemist69 joined #nim
20:28:44*Trustable quit (Remote host closed the connection)
20:29:29FromGitter<tim-st> should this compile? `proc matchesAllTypes(t: typed) = echo "matched!"`
20:29:55FromGitter<tim-st> `; 1.matchesAllTypes`
20:30:49FromGitter<tim-st> ah, `any` is the type, I had the same question some days ago^^
20:44:23*narimiran quit (Remote host closed the connection)
20:53:50*adeohluwa joined #nim
20:54:44FromGitter<alehander42> ok guys, a new temp version is on https://github.com/alehander42/comprehension
20:56:10FromGitter<alehander42> the tcollect-based code from https://github.com/alehander42/comprehension/pull/1/files is better at some things than my code, so eventually I'll merge a version of it and maybe move the repo to an org?
20:56:17FromGitter<alehander42> the only thing remaining is to decide the final api
20:57:07FromGitter<nothratal> can someone explain me the idea of the Option type in nim? I think I fully understand the type itself, it's like the Option type of rust, but where is the point if the std lib is not forcing me to use it? Are there plans for the future?
20:59:07*kapil____ quit (Quit: Connection closed for inactivity)
21:03:45*banc quit (Ping timeout: 252 seconds)
21:05:33FromGitter<yyyc514> is there no way to do two deep macros without hitting `Error: 'export' is only allowed at top level`?
21:05:48FromGitter<yyyc514> @nothratal if you need to model nil you kind of need optionals
21:06:04FromGitter<yyyc514> like a database operation that might return a result or not
21:10:47*banc joined #nim
21:12:08FromGitter<nothratal> Sure, but where is the need if I can just check on nil?
21:13:26FromGitter<alehander42> @nothratal well it depends: if you're creating the API you can just choose to use Options as they are more type safe
21:13:52FromGitter<alehander42> it's true that some existing nim api-s use nil too much, but there are efforts to change that/add option api-s
21:14:56FromGitter<alehander42> in some edge cases there are also other approaches : e.g. seq[Option T] vs seq[T], seq[bool] (I know it sounds crazy, but in some cases the second API might be more beneficial)
21:15:22FromGitter<alehander42> @yyyc514 well the only important thing is that the final code should have export at top level
21:15:51FromGitter<yyyc514> yeah i got past that i was using NimNode when i wanted untyped
21:16:11FromGitter<yyyc514> now i’m tryign to shorten `result.add quote do:`
21:17:48FromGitter<yyyc514> man using string interpolation with macros is kind of crazy
21:18:22FromGitter<alehander42> try to keep macros readable haha
21:18:34FromGitter<alehander42> a lot of my macros started a bit messy
21:18:59FromGitter<alehander42> they require some additional comments/care :(
21:19:58FromGitter<yyyc514> could i use templates to shorten that somehow?
21:20:06FromGitter<yyyc514> the magic {} template syntax?
21:20:33FromGitter<alehander42> what is the magic `{}` ?
21:20:47FromGitter<alehander42> `{}` operator?
21:21:03FromGitter<alehander42> well result.add quote do: seems not too verbose to me
21:21:16*zachk quit (Read error: Connection reset by peer)
21:21:16FromGitter<alehander42> and it's very obvious what it does to nim devs
21:21:40*rlr joined #nim
21:21:41FromGitter<yyyc514> but it blends with the code too much, looks toom uch like the regular code if you zoom out a bit
21:21:49*zachk joined #nim
21:22:13FromGitter<yyyc514> `template ormLoad*{user.field}(user: Model, field: expr{field}): expr =` this kidn of stuff
21:22:36*zachk quit (Changing host)
21:22:36*zachk joined #nim
21:23:00*wildlander quit (Ping timeout: 252 seconds)
21:23:15FromGitter<alehander42> honestly, I've never used this ^
21:23:28FromGitter<alehander42> be careful where are you looking for examples
21:23:39FromGitter<alehander42> `expr` and `stmt` were older typeclasses
21:24:06FromGitter<alehander42> so basically I don't know about this `{}` if you find use for it, great
21:25:09FromGitter<yyyc514> finally making some progress once i decided the model macro was just going to have to write most of the code itself
21:25:20FromGitter<yyyc514> vs trying to use some sort of generics
21:36:36FromGitter<alehander42> yeah, here you need the structure of the types
21:39:00dom96Trying to remove a keyword from the Nim lexer feels like it's way harder than it should be
21:44:01FromGitter<Epictek> Reading the survey results, I'm guessing I'm the 0.01% that uses kakoune so that wasn't included in the editor chart? :D
21:45:46FromGitter<Epictek> I thought more Nim users actually used Kakoune, I saw it mentioned on the Nim Forums a few times which actually made me switch to it when researching it
21:46:10dom96Maybe everyone spelled it differently :)
21:46:29FromGitter<Epictek> maybe lol
21:46:40theelous3with mapIt, does it literally look for "it" and replace "it" with the element, or is it some sort of positional thing?
21:47:49theelous3(also, does map produce an iterator? or does it do all the work up front?)
21:48:55FromGitter<alehander42> dom96 which keyword *shakes nervously*
21:49:03dom96`out`
21:49:22dom96Trying my best to fix https://github.com/nim-lang/Nim/issues/6011
21:49:51FromGitter<alehander42> ah, was it used for something in past
21:50:11dom96Not as far as I know
21:52:18dom96Araq: What's this magic in the lexer?
21:53:28*hoijui quit (Ping timeout: 264 seconds)
21:53:55dom96I removed all signs of tkOut and the lexer is doing some weird shit with tkInt
21:54:32Araqdom96: well you need to touch wordrecg.nim too
21:55:16Araqkeywords change so rarely that I never used more metaprogramming to solve this :P
21:55:44Araqalso ... IMO 'out' should be kept as a keyword
21:56:14dom96okay, so I need to add a new node kind then
21:56:31Araqwhy?
21:56:38dom96since you've mapped tkOut to nkVar
21:57:52FromGitter<yyyc514> hmmmm
21:57:56FromGitter<yyyc514> what magic is & doing
21:58:31Araqhmmm
21:59:04Araqthat's stupid, edit parser.nim and remove that
22:00:42dom96still curious why my efforts failed in lexer
22:01:50Araqbecause there is a 2nd enum in wordrecg that needs to mirror the keywords
22:01:59Araqin the same order
22:02:23Araqwordrecg recognizes special words and then via arithmetic it's mapped to TTokKind
22:02:39FromGitter<alehander42> @yyyc514 `&stuff` is fmt from stformat , `a&b` is concat
22:02:52Araqdoesn't win prizes but it is fast
22:03:51dom96okay cool, I think I got it figured out :D
22:04:53FromGitter<yyyc514> i know
22:05:06FromGitter<yyyc514> &"{tableName}” is giving me tablename when tableName() itself doesn’t work
22:06:49FromGitter<yyyc514> so i’m lost as to what extra magic & is doing
22:09:47FromGitter<yyyc514> the comparable code is `echo "TABLENAME", type(p).tableName()` which confuses me
22:18:51dom96Loving how people are just using markdown on the forum without care
22:20:13*PMunch joined #nim
22:21:34Araqmaybe tableName is not callable
22:22:03FromGitter<yyyc514> ?
22:22:23FromGitter<yyyc514> my understanding is &{} would pull in things as if there were expressions
22:22:35FromGitter<yyyc514> so if {tableName} works why doesn’t tableNAme itself work naked
22:30:49FromGitter<yyyc514> and then it works in one method but not another, something is weird
22:33:16FromGitter<yyyc514> when you call something with paste.blah semantics does it change the scoping of certain things?
22:33:58FromGitter<yyyc514> it’s like insert(paste) has different internal scope than Paste.find
22:34:25FromGitter<yyyc514> insert has access to a constant defines in the paste module but `Paste.find` seems not to
22:36:53FromGitter<yyyc514> i don’t recall reading anything like taht in the manual
22:40:09FromGitter<yyyc514> https://gist.github.com/yyyc514/3d118d52a19af88c400cca80b8c2949a
22:48:02FromGitter<yyyc514> yes, `p.another(); Paste.another2()` seem to have different scoping
22:48:09FromGitter<yyyc514> they are both in the same module
22:48:53FromGitter<yyyc514> but another2 doesn’t have access to the const that i defined in paste module
22:49:09FromGitter<yyyc514> is that correct behavior?
23:16:12*darithorn quit ()